@gjsify/cli 0.64.12-next.279 → 0.64.12-next.280

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.gjs.mjs CHANGED
@@ -145,7 +145,7 @@ fi
145
145
  `)}`:``;n.fail(N(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(C).length,Object.keys(C).join(`, `)+S))}},F.unknownArguments=function unknownArguments(S,C,I,H,W=!0){let q=t.getInternalMethods().getCommandInstance().getCommands(),Y=[],X=t.getInternalMethods().getContext();if(Object.keys(S).forEach(n=>{!Tp.includes(n)&&!Object.prototype.hasOwnProperty.call(I,n)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),n)&&!F.isValidAndSomeAliasIsNotNew(n,C)&&Y.push(n)}),W&&(X.commands.length>0||q.length>0||H)&&S._.slice(X.commands.length).forEach(t=>{q.includes(``+t)||Y.push(``+t)}),W){let n=t.getDemandedCommands()._?.max||0,C=X.commands.length+n;C<S._.length&&S._.slice(C).forEach(t=>{t=String(t),!X.commands.includes(t)&&!Y.includes(t)&&Y.push(t)})}Y.length&&n.fail(N(`Unknown argument: %s`,`Unknown arguments: %s`,Y.length,Y.map(t=>t.trim()?t:`"${t}"`).join(`, `)))},F.unknownCommands=function unknownCommands(S){let C=t.getInternalMethods().getCommandInstance().getCommands(),F=[],I=t.getInternalMethods().getContext();return(I.commands.length>0||C.length>0)&&S._.slice(I.commands.length).forEach(t=>{C.includes(``+t)||F.push(``+t)}),F.length>0?(n.fail(N(`Unknown command: %s`,`Unknown commands: %s`,F.length,F.join(`, `))),!0):!1},F.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(n,S){if(!Object.prototype.hasOwnProperty.call(S,n))return!1;let C=t.parsed.newAliases;return[n,...S[n]].some(t=>!Object.prototype.hasOwnProperty.call(C,t)||!C[n])},F.limitedChoices=function limitedChoices(S){let N=t.getOptions(),F={};if(!Object.keys(N.choices).length)return;Object.keys(S).forEach(t=>{Tp.indexOf(t)===-1&&Object.prototype.hasOwnProperty.call(N.choices,t)&&[].concat(S[t]).forEach(n=>{N.choices[t].indexOf(n)===-1&&n!==void 0&&(F[t]=(F[t]||[]).concat(n))})});let I=Object.keys(F);if(!I.length)return;let H=C(`Invalid values:`);I.forEach(t=>{H+=`\n ${C(`Argument: %s, Given: %s, Choices: %s`,t,n.stringifiedValues(F[t]),n.stringifiedValues(N.choices[t]))}`}),n.fail(H)};let I={};F.implies=function implies(n,C){argsert(`<string|object> [array|number|string]`,[n,C],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.implies(t,n[t])}):(t.global(n),I[n]||(I[n]=[]),Array.isArray(C)?C.forEach(t=>F.implies(n,t)):(assertNotStrictEqual(C,void 0,S),I[n].push(C)))},F.getImplied=function getImplied(){return I};function keyExists(t,n){let S=Number(n);return n=isNaN(S)?n:S,typeof n==`number`?n=t._.length>=n:n.match(/^--no-.+/)?(n=n.match(/^--no-(.+)/)[1],n=!Object.prototype.hasOwnProperty.call(t,n)):n=Object.prototype.hasOwnProperty.call(t,n),n}F.implications=function implications(t){let S=[];if(Object.keys(I).forEach(n=>{let C=n;(I[n]||[]).forEach(n=>{let N=C,F=n;N=keyExists(t,N),n=keyExists(t,n),N&&!n&&S.push(` ${C} -> ${F}`)})}),S.length){let t=`${C(`Implications failed:`)}\n`;S.forEach(n=>{t+=n}),n.fail(t)}};let H={};F.conflicts=function conflicts(n,S){argsert(`<string|object> [array|string]`,[n,S],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.conflicts(t,n[t])}):(t.global(n),H[n]||(H[n]=[]),Array.isArray(S)?S.forEach(t=>F.conflicts(n,t)):H[n].push(S))},F.getConflicting=()=>H,F.conflicting=function conflictingFn(N){Object.keys(N).forEach(t=>{H[t]&&H[t].forEach(S=>{S&&N[t]!==void 0&&N[S]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,S))})}),t.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(H).forEach(t=>{H[t].forEach(F=>{F&&N[S.Parser.camelCase(t)]!==void 0&&N[S.Parser.camelCase(F)]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,F))})})},F.recommendCommands=function recommendCommands(t,S){S=S.sort((t,n)=>n.length-t.length);let N=null,F=1/0;for(let n=0,C;(C=S[n])!==void 0;n++){let n=levenshtein(t,C);n<=3&&n<F&&(F=n,N=C)}N&&n.fail(C(`Did you mean %s?`,N))},F.reset=function reset(t){return I=objFilter(I,n=>!t[n]),H=objFilter(H,n=>!t[n]),F};let W=[];return F.freeze=function freeze(){W.push({implied:I,conflicting:H})},F.unfreeze=function unfreeze(){let t=W.pop();assertNotStrictEqual(t,void 0,S),{implied:I,conflicting:H}=t},F}var Tp,Ep=__esmMin(()=>{dp(),op(),wp(),gp(),Tp=[`$0`,`--`,`_`]});function YargsFactory(t){return(n=[],S=t.process.cwd(),C)=>{let N=new YargsInstance(n,S,C,t);return Object.defineProperty(N,"argv",{get:()=>N.parse(),enumerable:!0}),N.help(),N.version(),N}}function isYargsInstance(t){return!!t&&typeof t.getInternalMethods==`function`}var __classPrivateFieldSet,__classPrivateFieldGet,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,YargsInstance,Km=__esmMin(()=>{_e(),hp(),op(),Ol(),yp(),dp(),Cp(),Ep(),gp(),jl(),fp(),sp(),pp(),vp(),__classPrivateFieldSet=function(t,n,S,C,N){if(C===`m`)throw TypeError(`Private method is not writable`);if(C===`a`&&!N)throw TypeError(`Private accessor was defined without a setter`);if(typeof n==`function`?t!==n||!N:!n.has(t))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return C===`a`?N.call(t,S):N?N.value=S:n.set(t,S),S},__classPrivateFieldGet=function(t,n,S,C){if(S===`a`&&!C)throw TypeError(`Private accessor was defined without a getter`);if(typeof n==`function`?t!==n||!C:!n.has(t))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return S===`m`?C:S===`a`?C.call(t):C?C.value:n.get(t)},lm=Symbol(`copyDoubleDash`),um=Symbol(`copyDoubleDash`),dm=Symbol(`deleteFromParserHintObject`),fm=Symbol(`emitWarning`),pm=Symbol(`freeze`),mm=Symbol(`getDollarZero`),hm=Symbol(`getParserConfiguration`),gm=Symbol(`getUsageConfiguration`),_m=Symbol(`guessLocale`),vm=Symbol(`guessVersion`),ym=Symbol(`parsePositionalNumbers`),bm=Symbol(`pkgUp`),xm=Symbol(`populateParserHintArray`),Sm=Symbol(`populateParserHintSingleValueDictionary`),Cm=Symbol(`populateParserHintArrayDictionary`),wm=Symbol(`populateParserHintDictionary`),Tm=Symbol(`sanitizeKey`),Em=Symbol(`setKey`),Dm=Symbol(`unfreeze`),Om=Symbol(`validateAsync`),km=Symbol(`getCommandInstance`),Am=Symbol(`getContext`),jm=Symbol(`getHasOutput`),Mm=Symbol(`getLoggerInstance`),Nm=Symbol(`getParseContext`),Pm=Symbol(`getUsageInstance`),Fm=Symbol(`getValidationInstance`),Im=Symbol(`hasParseCallback`),Lm=Symbol(`isGlobalContext`),Rm=Symbol(`postProcess`),zm=Symbol(`rebase`),Bm=Symbol(`reset`),Vm=Symbol(`runYargsParserAndExecuteCommands`),Hm=Symbol(`runValidation`),Um=Symbol(`setHasOutput`),Wm=Symbol(`kTrackManuallySetKeys`),Gm=`en_US`,YargsInstance=class{constructor(t=[],n,S,C){this.customScriptName=!1,this.parsed=!1,Dp.set(this,void 0),Op.set(this,void 0),kp.set(this,{commands:[],fullCommands:[]}),Ap.set(this,null),jp.set(this,null),Mp.set(this,`show-hidden`),Np.set(this,null),Pp.set(this,!0),Fp.set(this,{}),Ip.set(this,!0),Lp.set(this,[]),Rp.set(this,void 0),zp.set(this,{}),Bp.set(this,!1),Vp.set(this,null),Hp.set(this,!0),Up.set(this,void 0),Wp.set(this,``),Gp.set(this,void 0),Kp.set(this,void 0),qp.set(this,{}),Jp.set(this,null),Yp.set(this,null),Xp.set(this,{}),Zp.set(this,{}),Qp.set(this,void 0),$p.set(this,!1),em.set(this,void 0),tm.set(this,!1),nm.set(this,!1),im.set(this,!1),am.set(this,void 0),om.set(this,{}),sm.set(this,null),cm.set(this,void 0),__classPrivateFieldSet(this,em,C,`f`),__classPrivateFieldSet(this,Qp,t,`f`),__classPrivateFieldSet(this,Op,n,`f`),__classPrivateFieldSet(this,Kp,S,`f`),__classPrivateFieldSet(this,Rp,new GlobalMiddleware(this),`f`),this.$0=this[mm](),this[Bm](),__classPrivateFieldSet(this,Dp,__classPrivateFieldGet(this,Dp,`f`),`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`),`f`),__classPrivateFieldSet(this,cm,__classPrivateFieldGet(this,cm,`f`),`f`),__classPrivateFieldSet(this,Gp,__classPrivateFieldGet(this,Gp,`f`),`f`),__classPrivateFieldGet(this,Gp,`f`).showHiddenOpt=__classPrivateFieldGet(this,Mp,`f`),__classPrivateFieldSet(this,Up,this[um](),`f`),__classPrivateFieldGet(this,em,`f`).y18n.setLocale(Gm)}addHelpOpt(t,n){return argsert(`[string|boolean] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,Vp,`f`)&&(this[dm](__classPrivateFieldGet(this,Vp,`f`)),__classPrivateFieldSet(this,Vp,null,`f`)),t===!1&&n===void 0?this:(__classPrivateFieldSet(this,Vp,typeof t==`string`?t:`help`,`f`),this.boolean(__classPrivateFieldGet(this,Vp,`f`)),this.describe(__classPrivateFieldGet(this,Vp,`f`),n||__classPrivateFieldGet(this,am,`f`).deferY18nLookup(`Show help`)),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(argsert(`[string|boolean] [string]`,[t,n],arguments.length),t===!1&&n===void 0)return this;let S=typeof t==`string`?t:__classPrivateFieldGet(this,Mp,`f`);return this.boolean(S),this.describe(S,n||__classPrivateFieldGet(this,am,`f`).deferY18nLookup(`Show hidden options`)),__classPrivateFieldGet(this,Gp,`f`).showHiddenOpt=S,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[Cm](this.alias.bind(this),`alias`,t,n),this}array(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`array`,t),this[Wm](t),this}boolean(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`boolean`,t),this[Wm](t),this}check(t,n){return argsert(`<function> [boolean]`,[t,n],arguments.length),this.middleware((n,S)=>maybeAsyncResult(()=>t(n,S.getOptions()),S=>(S?(typeof S==`string`||S instanceof Error)&&__classPrivateFieldGet(this,am,`f`).fail(S.toString(),S):__classPrivateFieldGet(this,am,`f`).fail(__classPrivateFieldGet(this,em,`f`).y18n.__(`Argument check failed: %s`,t.toString())),n),t=>(__classPrivateFieldGet(this,am,`f`).fail(t.message?t.message:t.toString(),t),n)),!1,n),this}choices(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[Cm](this.choices.bind(this),`choices`,t,n),this}coerce(t,n){if(argsert(`<object|string|array> [function]`,[t,n],arguments.length),Array.isArray(t)){if(!n)throw new Dl(`coerce callback must be provided`);for(let S of t)this.coerce(S,n);return this}else if(typeof t==`object`){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!n)throw new Dl(`coerce callback must be provided`);let S=t;return __classPrivateFieldGet(this,Gp,`f`).key[S]=!0,__classPrivateFieldGet(this,Rp,`f`).addCoerceMiddleware((t,C)=>{let N=C.getAliases()[S]??[],F=[S,...N].filter(n=>Object.prototype.hasOwnProperty.call(t,n));return F.length===0?t:maybeAsyncResult(()=>n(t[F[0]]),n=>(F.forEach(S=>{t[S]=n}),t),t=>{throw new Dl(t.message)})},S),this}conflicts(t,n){return argsert(`<string|object> [string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,cm,`f`).conflicts(t,n),this}config(t=`config`,n,S){return argsert(`[object|string] [string|function] [function]`,[t,n,S],arguments.length),typeof t==`object`&&!Array.isArray(t)?(t=applyExtends(t,__classPrivateFieldGet(this,Op,`f`),this[hm]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).configObjects=(__classPrivateFieldGet(this,Gp,`f`).configObjects||[]).concat(t),this):(typeof n==`function`&&(S=n,n=void 0),this.describe(t,n||__classPrivateFieldGet(this,am,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(t)?t:[t]).forEach(t=>{__classPrivateFieldGet(this,Gp,`f`).config[t]=S||!0}),this)}completion(t,n,S){return argsert(`[string] [string|boolean|function] [function]`,[t,n,S],arguments.length),typeof n==`function`&&(S=n,n=void 0),__classPrivateFieldSet(this,jp,t||__classPrivateFieldGet(this,jp,`f`)||`completion`,`f`),!n&&n!==!1&&(n=`generate completion script`),this.command(__classPrivateFieldGet(this,jp,`f`),n),S&&__classPrivateFieldGet(this,Ap,`f`).registerFunction(S),this}command(t,n,S,C,N,F){return argsert(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[t,n,S,C,N,F],arguments.length),__classPrivateFieldGet(this,Dp,`f`).addHandler(t,n,S,C,N,F),this}commands(t,n,S,C,N,F){return this.command(t,n,S,C,N,F)}commandDir(t,n){argsert(`<string> [object]`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,Kp,`f`)||__classPrivateFieldGet(this,em,`f`).require;return __classPrivateFieldGet(this,Dp,`f`).addDirectory(t,S,__classPrivateFieldGet(this,em,`f`).getCallerFile(),n),this}count(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`count`,t),this[Wm](t),this}default(t,n,S){return argsert(`<object|string|array> [*] [string]`,[t,n,S],arguments.length),S&&(assertSingleKey(t,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).defaultDescription[t]=S),typeof n==`function`&&(assertSingleKey(t,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).defaultDescription[t]||(__classPrivateFieldGet(this,Gp,`f`).defaultDescription[t]=__classPrivateFieldGet(this,am,`f`).functionDescription(n)),n=n.call()),this[Sm](this.default.bind(this),`default`,t,n),this}defaults(t,n,S){return this.default(t,n,S)}demandCommand(t=1,n,S,C){return argsert(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[t,n,S,C],arguments.length),typeof n!=`number`&&(S=n,n=1/0),this.global(`_`,!1),__classPrivateFieldGet(this,Gp,`f`).demandedCommands._={min:t,max:n,minMsg:S,maxMsg:C},this}demand(t,n,S){return Array.isArray(n)?(n.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,em,`f`)),this.demandOption(t,S)}),n=1/0):typeof n!=`number`&&(S=n,n=1/0),typeof t==`number`?(assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,em,`f`)),this.demandCommand(t,n,S,S)):Array.isArray(t)?t.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,em,`f`)),this.demandOption(t,S)}):typeof S==`string`?this.demandOption(t,S):(S===!0||S===void 0)&&this.demandOption(t),this}demandOption(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Sm](this.demandOption.bind(this),`demandedOptions`,t,n),this}deprecateOption(t,n){return argsert(`<string> [string|boolean]`,[t,n],arguments.length),__classPrivateFieldGet(this,Gp,`f`).deprecatedOptions[t]=n,this}describe(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Em](t,!0),__classPrivateFieldGet(this,am,`f`).describe(t,n),this}detectLocale(t){return argsert(`<boolean>`,[t],arguments.length),__classPrivateFieldSet(this,Pp,t,`f`),this}env(t){return argsert(`[string|boolean]`,[t],arguments.length),t===!1?delete __classPrivateFieldGet(this,Gp,`f`).envPrefix:__classPrivateFieldGet(this,Gp,`f`).envPrefix=t||``,this}epilogue(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,am,`f`).epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return argsert(`<string|array> [string]`,[t,n],arguments.length),Array.isArray(t)?t.forEach(t=>this.example(...t)):__classPrivateFieldGet(this,am,`f`).example(t,n),this}exit(t,n){__classPrivateFieldSet(this,Bp,!0,`f`),__classPrivateFieldSet(this,Np,n,`f`),__classPrivateFieldGet(this,Ip,`f`)&&__classPrivateFieldGet(this,em,`f`).process.exit(t)}exitProcess(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Ip,t,`f`),this}fail(t){if(argsert(`<function|boolean>`,[t],arguments.length),typeof t==`boolean`&&t!==!1)throw new Dl(`Invalid first argument. Expected function or boolean 'false'`);return __classPrivateFieldGet(this,am,`f`).failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return argsert(`<array> [function]`,[t,n],arguments.length),n?__classPrivateFieldGet(this,Ap,`f`).getCompletion(t,n):new Promise((n,S)=>{__classPrivateFieldGet(this,Ap,`f`).getCompletion(t,(t,C)=>{t?S(t):n(C)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,Gp,`f`).demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,Gp,`f`).demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,Gp,`f`).deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,Pp,`f`)}getExitProcess(){return __classPrivateFieldGet(this,Ip,`f`)}getGroups(){return Object.assign({},__classPrivateFieldGet(this,zp,`f`),__classPrivateFieldGet(this,Zp,`f`))}getHelp(){if(__classPrivateFieldSet(this,Bp,!0,`f`),!__classPrivateFieldGet(this,am,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[Vm](__classPrivateFieldGet(this,Qp,`f`),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,am,`f`).help())}let t=__classPrivateFieldGet(this,Dp,`f`).runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,am,`f`).help())}return Promise.resolve(__classPrivateFieldGet(this,am,`f`).help())}getOptions(){return __classPrivateFieldGet(this,Gp,`f`)}getStrict(){return __classPrivateFieldGet(this,tm,`f`)}getStrictCommands(){return __classPrivateFieldGet(this,nm,`f`)}getStrictOptions(){return __classPrivateFieldGet(this,im,`f`)}global(t,n){return argsert(`<string|array> [boolean]`,[t,n],arguments.length),t=[].concat(t),n===!1?t.forEach(t=>{__classPrivateFieldGet(this,Gp,`f`).local.includes(t)||__classPrivateFieldGet(this,Gp,`f`).local.push(t)}):__classPrivateFieldGet(this,Gp,`f`).local=__classPrivateFieldGet(this,Gp,`f`).local.filter(n=>t.indexOf(n)===-1),this}group(t,n){argsert(`<string|array> <string>`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,Zp,`f`)[n]||__classPrivateFieldGet(this,zp,`f`)[n];__classPrivateFieldGet(this,Zp,`f`)[n]&&delete __classPrivateFieldGet(this,Zp,`f`)[n];let C={};return __classPrivateFieldGet(this,zp,`f`)[n]=(S||[]).concat(t).filter(t=>C[t]?!1:C[t]=!0),this}hide(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,Gp,`f`).hiddenOptions.push(t),this}implies(t,n){return argsert(`<string|object> [number|string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,cm,`f`).implies(t,n),this}locale(t){return argsert(`[string]`,[t],arguments.length),t===void 0?(this[_m](),__classPrivateFieldGet(this,em,`f`).y18n.getLocale()):(__classPrivateFieldSet(this,Pp,!1,`f`),__classPrivateFieldGet(this,em,`f`).y18n.setLocale(t),this)}middleware(t,n,S){return __classPrivateFieldGet(this,Rp,`f`).addMiddleware(t,!!n,S)}nargs(t,n){return argsert(`<string|object|array> [number]`,[t,n],arguments.length),this[Sm](this.nargs.bind(this),`narg`,t,n),this}normalize(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`normalize`,t),this}number(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`number`,t),this[Wm](t),this}option(t,n){if(argsert(`<string|object> [object]`,[t,n],arguments.length),typeof t==`object`)Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof n!=`object`&&(n={}),this[Wm](t),__classPrivateFieldGet(this,sm,`f`)&&(t===`version`||n?.alias===`version`)&&this[fm]([`"version" is a reserved word.`,`Please do one of the following:`,'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)",`- Use a different option key`,`https://yargs.js.org/docs/#api-reference-version`].join(`
146
146
  `),void 0,`versionWarning`),__classPrivateFieldGet(this,Gp,`f`).key[t]=!0,n.alias&&this.alias(t,n.alias);let S=n.deprecate||n.deprecated;S&&this.deprecateOption(t,S);let C=n.demand||n.required||n.require;C&&this.demand(t,C),n.demandOption&&this.demandOption(t,typeof n.demandOption==`string`?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),`default`in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type===`boolean`)&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type===`array`)&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type===`number`)&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type===`string`)&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type===`count`)&&this.count(t),typeof n.global==`boolean`&&this.global(t,n.global),n.defaultDescription&&(__classPrivateFieldGet(this,Gp,`f`).defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let N=n.describe||n.description||n.desc,F=__classPrivateFieldGet(this,am,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(F,t)||typeof N==`string`)&&this.describe(t,N),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,S){argsert(`[string|array] [function|boolean|object] [function]`,[t,n,S],arguments.length),this[pm](),t===void 0&&(t=__classPrivateFieldGet(this,Qp,`f`)),typeof n==`object`&&(__classPrivateFieldSet(this,Yp,n,`f`),n=S),typeof n==`function`&&(__classPrivateFieldSet(this,Jp,n,`f`),n=!1),n||__classPrivateFieldSet(this,Qp,t,`f`),__classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldSet(this,Ip,!1,`f`);let C=this[Vm](t,!!n),N=this.parsed;return __classPrivateFieldGet(this,Ap,`f`).setParsed(this.parsed),isPromise(C)?C.then(t=>(__classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldGet(this,Jp,`f`).call(this,__classPrivateFieldGet(this,Np,`f`),t,__classPrivateFieldGet(this,Wp,`f`)),t)).catch(t=>{throw __classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldGet(this,Jp,`f`)(t,this.parsed.argv,__classPrivateFieldGet(this,Wp,`f`)),t}).finally(()=>{this[Dm](),this.parsed=N}):(__classPrivateFieldGet(this,Jp,`f`)&&__classPrivateFieldGet(this,Jp,`f`).call(this,__classPrivateFieldGet(this,Np,`f`),C,__classPrivateFieldGet(this,Wp,`f`)),this[Dm](),this.parsed=N,C)}parseAsync(t,n,S){let C=this.parse(t,n,S);return isPromise(C)?C:Promise.resolve(C)}parseSync(t,n,S){let C=this.parse(t,n,S);if(isPromise(C))throw new Dl(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return C}parserConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,qp,t,`f`),this}pkgConf(t,n){argsert(`<string> [string]`,[t,n],arguments.length);let S=null,C=this[bm](n||__classPrivateFieldGet(this,Op,`f`));return C[t]&&typeof C[t]==`object`&&(S=applyExtends(C[t],n||__classPrivateFieldGet(this,Op,`f`),this[hm]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,em,`f`)),__classPrivateFieldGet(this,Gp,`f`).configObjects=(__classPrivateFieldGet(this,Gp,`f`).configObjects||[]).concat(S)),this}positional(t,n){argsert(`<string> <object>`,[t,n],arguments.length);let S=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];n=objFilter(n,(t,n)=>t===`type`&&![`string`,`number`,`boolean`].includes(n)?!1:S.includes(t));let C=__classPrivateFieldGet(this,kp,`f`).fullCommands[__classPrivateFieldGet(this,kp,`f`).fullCommands.length-1],N=C?__classPrivateFieldGet(this,Dp,`f`).cmdToParseOptions(C):{array:[],alias:{},default:{},demand:{}};return objectKeys(N).forEach(S=>{let C=N[S];Array.isArray(C)?C.indexOf(t)!==-1&&(n[S]=!0):C[t]&&!(S in n)&&(n[S]=C[t])}),this.group(t,__classPrivateFieldGet(this,am,`f`).getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,$p,t,`f`),this}required(t,n,S){return this.demand(t,n,S)}require(t,n,S){return this.demand(t,n,S)}requiresArg(t){return argsert(`<array|string|object> [number]`,[t],arguments.length),typeof t==`string`&&__classPrivateFieldGet(this,Gp,`f`).narg[t]||this[Sm](this.requiresArg.bind(this),`narg`,t,NaN),this}showCompletionScript(t,n){return argsert(`[string] [string]`,[t,n],arguments.length),t||=this.$0,__classPrivateFieldGet(this,Up,`f`).log(__classPrivateFieldGet(this,Ap,`f`).generateCompletionScript(t,n||__classPrivateFieldGet(this,jp,`f`)||`completion`)),this}showHelp(t){if(argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldSet(this,Bp,!0,`f`),!__classPrivateFieldGet(this,am,`f`).hasCachedHelpMessage()){if(!this.parsed){let n=this[Vm](__classPrivateFieldGet(this,Qp,`f`),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,am,`f`).showHelp(t)}),this}let n=__classPrivateFieldGet(this,Dp,`f`).runDefaultBuilderOn(this);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,am,`f`).showHelp(t)}),this}return __classPrivateFieldGet(this,am,`f`).showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return argsert(`[boolean|string] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,am,`f`).showHelpOnFail(t,n),this}showVersion(t){return argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldGet(this,am,`f`).showVersion(t),this}skipValidation(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`skipValidation`,t),this}strict(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,tm,t!==!1,`f`),this}strictCommands(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,nm,t!==!1,`f`),this}strictOptions(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,im,t!==!1,`f`),this}string(t){return argsert(`<array|string>`,[t],arguments.length),this[xm](`string`,t),this[Wm](t),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,em,`f`).process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Pp,!1,`f`),__classPrivateFieldGet(this,em,`f`).y18n.updateLocale(t),this}usage(t,n,S,C){if(argsert(`<string|null|undefined> [string|boolean] [function|object] [function]`,[t,n,S,C],arguments.length),n!==void 0){if(assertNotStrictEqual(t,null,__classPrivateFieldGet(this,em,`f`)),(t||``).match(/^\$0( |$)/))return this.command(t,n,S,C);throw new Dl(`.usage() description must start with $0 if being used as alias for .command()`)}else return __classPrivateFieldGet(this,am,`f`).usage(t),this}usageConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,om,t,`f`),this}version(t,n,S){let C=`version`;if(argsert(`[boolean|string] [string] [string]`,[t,n,S],arguments.length),__classPrivateFieldGet(this,sm,`f`)&&(this[dm](__classPrivateFieldGet(this,sm,`f`)),__classPrivateFieldGet(this,am,`f`).version(void 0),__classPrivateFieldSet(this,sm,null,`f`)),arguments.length===0)S=this[vm](),t=C;else if(arguments.length===1){if(t===!1)return this;S=t,t=C}else arguments.length===2&&(S=n,n=void 0);return __classPrivateFieldSet(this,sm,typeof t==`string`?t:C,`f`),n||=__classPrivateFieldGet(this,am,`f`).deferY18nLookup(`Show version number`),__classPrivateFieldGet(this,am,`f`).version(S||void 0),this.boolean(__classPrivateFieldGet(this,sm,`f`)),this.describe(__classPrivateFieldGet(this,sm,`f`),n),this}wrap(t){return argsert(`<number|null|undefined>`,[t],arguments.length),__classPrivateFieldGet(this,am,`f`).wrap(t),this}[(Dp=new WeakMap,Op=new WeakMap,kp=new WeakMap,Ap=new WeakMap,jp=new WeakMap,Mp=new WeakMap,Np=new WeakMap,Pp=new WeakMap,Fp=new WeakMap,Ip=new WeakMap,Lp=new WeakMap,Rp=new WeakMap,zp=new WeakMap,Bp=new WeakMap,Vp=new WeakMap,Hp=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Gp=new WeakMap,Kp=new WeakMap,qp=new WeakMap,Jp=new WeakMap,Yp=new WeakMap,Xp=new WeakMap,Zp=new WeakMap,Qp=new WeakMap,$p=new WeakMap,em=new WeakMap,tm=new WeakMap,nm=new WeakMap,im=new WeakMap,am=new WeakMap,om=new WeakMap,sm=new WeakMap,cm=new WeakMap,lm)](t){if(!t._||!t[`--`])return t;t._.push.apply(t._,t[`--`]);try{delete t[`--`]}catch{}return t}[um](){return{log:(...t)=>{this[Im]()||ge.log(...t),__classPrivateFieldSet(this,Bp,!0,`f`),__classPrivateFieldGet(this,Wp,`f`).length&&__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+`
147
147
  `,`f`),__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+t.join(` `),`f`)},error:(...t)=>{this[Im]()||ge.error(...t),__classPrivateFieldSet(this,Bp,!0,`f`),__classPrivateFieldGet(this,Wp,`f`).length&&__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+`
148
- `,`f`),__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+t.join(` `),`f`)}}}[dm](t){objectKeys(__classPrivateFieldGet(this,Gp,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,Gp,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,am,`f`).getDescriptions()[t]}[fm](t,n,S){__classPrivateFieldGet(this,Fp,`f`)[S]||(__classPrivateFieldGet(this,em,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Fp,`f`)[S]=!0)}[pm](){__classPrivateFieldGet(this,Lp,`f`).push({options:__classPrivateFieldGet(this,Gp,`f`),configObjects:__classPrivateFieldGet(this,Gp,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Ip,`f`),groups:__classPrivateFieldGet(this,zp,`f`),strict:__classPrivateFieldGet(this,tm,`f`),strictCommands:__classPrivateFieldGet(this,nm,`f`),strictOptions:__classPrivateFieldGet(this,im,`f`),completionCommand:__classPrivateFieldGet(this,jp,`f`),output:__classPrivateFieldGet(this,Wp,`f`),exitError:__classPrivateFieldGet(this,Np,`f`),hasOutput:__classPrivateFieldGet(this,Bp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,Jp,`f`),parseContext:__classPrivateFieldGet(this,Yp,`f`)}),__classPrivateFieldGet(this,am,`f`).freeze(),__classPrivateFieldGet(this,cm,`f`).freeze(),__classPrivateFieldGet(this,Dp,`f`).freeze(),__classPrivateFieldGet(this,Rp,`f`).freeze()}[mm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,em,`f`).process.argv()[0])?__classPrivateFieldGet(this,em,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,em,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[zm](__classPrivateFieldGet(this,Op,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,em,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,em,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,em,`f`).path.dirname(__classPrivateFieldGet(this,em,`f`).process.execPath())}/`,``)),t}[hm](){return __classPrivateFieldGet(this,qp,`f`)}[gm](){return __classPrivateFieldGet(this,om,`f`)}[_m](){if(!__classPrivateFieldGet(this,Pp,`f`))return;let t=__classPrivateFieldGet(this,em,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[vm](){return this[bm]().version||`unknown`}[ym](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,em,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[bm](t){let n=t||`*`;if(__classPrivateFieldGet(this,Xp,`f`)[n])return __classPrivateFieldGet(this,Xp,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,em,`f`).mainFilename;__classPrivateFieldGet(this,em,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,em,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,em,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,em,`f`)),S=JSON.parse(__classPrivateFieldGet(this,em,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,Xp,`f`)[n]=S||{},__classPrivateFieldGet(this,Xp,`f`)[n]}[xm](t,n){n=[].concat(n),n.forEach(n=>{n=this[Tm](n),__classPrivateFieldGet(this,Gp,`f`)[t].push(n)})}[Sm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=S})}[Cm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=(__classPrivateFieldGet(this,Gp,`f`)[t][n]||[]).concat(S)})}[wm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[Tm](S),C)}[Tm](t){return t===`__proto__`?`___proto___`:t}[Em](t,n){return this[Sm](this[Em].bind(this),`key`,t,n),this}[Dm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Lp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,em,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,Gp,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Ip,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,zp,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,Wp,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Np,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,Bp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,tm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,nm,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,im,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,jp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,Jp,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,Yp,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,Gp,`f`).configObjects=te,__classPrivateFieldGet(this,am,`f`).unfreeze(),__classPrivateFieldGet(this,cm,`f`).unfreeze(),__classPrivateFieldGet(this,Dp,`f`).unfreeze(),__classPrivateFieldGet(this,Rp,`f`).unfreeze()}[Om](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[km].bind(this),getContext:this[Am].bind(this),getHasOutput:this[jm].bind(this),getLoggerInstance:this[Mm].bind(this),getParseContext:this[Nm].bind(this),getParserConfiguration:this[hm].bind(this),getUsageConfiguration:this[gm].bind(this),getUsageInstance:this[Pm].bind(this),getValidationInstance:this[Fm].bind(this),hasParseCallback:this[Im].bind(this),isGlobalContext:this[Lm].bind(this),postProcess:this[Rm].bind(this),reset:this[Bm].bind(this),runValidation:this[Hm].bind(this),runYargsParserAndExecuteCommands:this[Vm].bind(this),setHasOutput:this[Um].bind(this)}}[km](){return __classPrivateFieldGet(this,Dp,`f`)}[Am](){return __classPrivateFieldGet(this,kp,`f`)}[jm](){return __classPrivateFieldGet(this,Bp,`f`)}[Mm](){return __classPrivateFieldGet(this,Up,`f`)}[Nm](){return __classPrivateFieldGet(this,Yp,`f`)||{}}[Pm](){return __classPrivateFieldGet(this,am,`f`)}[Fm](){return __classPrivateFieldGet(this,cm,`f`)}[Im](){return!!__classPrivateFieldGet(this,Jp,`f`)}[Lm](){return __classPrivateFieldGet(this,Hp,`f`)}[Rm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[lm](t)),(this[hm]()[`parse-positional-numbers`]||this[hm]()[`parse-positional-numbers`]===void 0)&&(t=this[ym](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)),t)}[Bm](t={}){__classPrivateFieldSet(this,Gp,__classPrivateFieldGet(this,Gp,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,Gp,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,Gp,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,Zp,`f`),Object.keys(__classPrivateFieldGet(this,zp,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,zp,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,zp,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,Gp,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,Gp,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,Gp,`f`).envPrefix,__classPrivateFieldSet(this,Gp,n,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)?__classPrivateFieldGet(this,am,`f`).reset(S):usage(this,__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,cm,__classPrivateFieldGet(this,cm,`f`)?__classPrivateFieldGet(this,cm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,Dp,__classPrivateFieldGet(this,Dp,`f`)?__classPrivateFieldGet(this,Dp,`f`).reset():command(__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,cm,`f`),__classPrivateFieldGet(this,Rp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Ap,`f`)||__classPrivateFieldSet(this,Ap,completion(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,Dp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Rp,`f`).reset(),__classPrivateFieldSet(this,jp,null,`f`),__classPrivateFieldSet(this,Wp,``,`f`),__classPrivateFieldSet(this,Np,null,`f`),__classPrivateFieldSet(this,Bp,!1,`f`),this.parsed=!1,this}[zm](t,n){return __classPrivateFieldGet(this,em,`f`).path.relative(t,n)}[Vm](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,Gp,`f`).__=__classPrivateFieldGet(this,em,`f`).y18n.__,__classPrivateFieldGet(this,Gp,`f`).configuration=this[hm]();let I=!!__classPrivateFieldGet(this,Gp,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,Gp,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,em,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,Gp,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,Yp,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Vp,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,sm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,am,`f`).clearCachedHelpMessage();try{if(this[_m](),n)return this[Rm](q,I,!!S,!1);__classPrivateFieldGet(this,Vp,`f`)&&[__classPrivateFieldGet(this,Vp,`f`)].concat(X[__classPrivateFieldGet(this,Vp,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,Hp,!1,`f`);let H=__classPrivateFieldGet(this,Dp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Ap,`f`)?.completionKey?[__classPrivateFieldGet(this,Ap,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Ap,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,jp,`f`)){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Rm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,jp,`f`)){t=F;break}!__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,$p,`f`)&&t&&!re&&__classPrivateFieldGet(this,cm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,jp,`f`)&&q._.includes(__classPrivateFieldGet(this,jp,`f`))&&!ne&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Rm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Ap,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Ap,`f`).getCompletion(n,(t,n)=>{if(t)throw new Dl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,Up,`f`).log(t)}),this.exit(0)}),this[Rm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,Bp,`f`)||(Z?(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,Up,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,am,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,Gp,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,Gp,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new Dl(W.error.message);if(!ne){let t=this[Hm](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!0)),Y=this[Om](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof Dl)__classPrivateFieldGet(this,am,`f`).fail(t.message,t);else throw t}return this[Rm](Y??q,I,!!S,!0)}[Hm](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new Dl(S.message);__classPrivateFieldGet(this,cm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,cm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,nm,`f`)&&(I=__classPrivateFieldGet(this,cm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,tm,`f`)&&!I?__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,im,`f`)&&__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,cm,`f`).limitedChoices(F),__classPrivateFieldGet(this,cm,`f`).implications(F),__classPrivateFieldGet(this,cm,`f`).conflicting(F)}}[Um](){__classPrivateFieldSet(this,Bp,!0,`f`)}[Wm](t){if(typeof t==`string`)__classPrivateFieldGet(this,Gp,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,Gp,`f`).key[n]=!0}}}),qm,Jm=__esmMin(()=>{ap(),Km(),qm=YargsFactory(ip)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var Ym=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.12-next.279`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var Xm=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,Zm=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):Qm}function parseNpmrc(t){let n={registry:Qm,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var Qm,$m=__esmMin(()=>{Qm=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var eh=__esmMin(()=>{Zm(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var th=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var nh=__esmMin(()=>{Xm(),Zm(),$m(),eh()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var rh=__esmMin(()=>{Xm(),Zm(),eh(),th()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var ih=__esmMin(()=>{Xm(),$m()}),ah=__esmMin(()=>{Xm(),Zm(),$m(),th(),nh(),rh(),ih()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return oh===void 0&&(oh=`0.64.12-next.279`),oh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=jn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=jn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var oh,sh=__esmMin(()=>{Ud(),zn(),Xn(),ah()}),ch,lh=__esmMin(()=>{ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(uh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${uh.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&dh[t]===!0}var uh,dh,fh,ph=__esmMin(()=>{uh=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],dh={flathub:!0,web:!0,"microsoft-store":!1,"apple-app-store":!1},fh=`GJSIFY_CHANNEL`}),mh=__commonJSMin(((t,n)=>{let S=(zn(),__toCommonJS(wn)),C=(Vl(),__toCommonJS(Ll)),N=(Ud(),__toCommonJS(Vd)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),hh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),gh=__commonJSMin(((t,n)=>{let S=hh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),vh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(Gl(),__toCommonJS(Hl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(zn(),__toCommonJS(wn)),H=mh(),W=gh();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),yh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),bh=__commonJSMin(((t,n)=>{var S=(Au(),__toCommonJS(Eu)),C=yh(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
148
+ `,`f`),__classPrivateFieldSet(this,Wp,__classPrivateFieldGet(this,Wp,`f`)+t.join(` `),`f`)}}}[dm](t){objectKeys(__classPrivateFieldGet(this,Gp,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,Gp,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,am,`f`).getDescriptions()[t]}[fm](t,n,S){__classPrivateFieldGet(this,Fp,`f`)[S]||(__classPrivateFieldGet(this,em,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Fp,`f`)[S]=!0)}[pm](){__classPrivateFieldGet(this,Lp,`f`).push({options:__classPrivateFieldGet(this,Gp,`f`),configObjects:__classPrivateFieldGet(this,Gp,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Ip,`f`),groups:__classPrivateFieldGet(this,zp,`f`),strict:__classPrivateFieldGet(this,tm,`f`),strictCommands:__classPrivateFieldGet(this,nm,`f`),strictOptions:__classPrivateFieldGet(this,im,`f`),completionCommand:__classPrivateFieldGet(this,jp,`f`),output:__classPrivateFieldGet(this,Wp,`f`),exitError:__classPrivateFieldGet(this,Np,`f`),hasOutput:__classPrivateFieldGet(this,Bp,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,Jp,`f`),parseContext:__classPrivateFieldGet(this,Yp,`f`)}),__classPrivateFieldGet(this,am,`f`).freeze(),__classPrivateFieldGet(this,cm,`f`).freeze(),__classPrivateFieldGet(this,Dp,`f`).freeze(),__classPrivateFieldGet(this,Rp,`f`).freeze()}[mm](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,em,`f`).process.argv()[0])?__classPrivateFieldGet(this,em,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,em,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[zm](__classPrivateFieldGet(this,Op,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,em,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,em,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,em,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,em,`f`).path.dirname(__classPrivateFieldGet(this,em,`f`).process.execPath())}/`,``)),t}[hm](){return __classPrivateFieldGet(this,qp,`f`)}[gm](){return __classPrivateFieldGet(this,om,`f`)}[_m](){if(!__classPrivateFieldGet(this,Pp,`f`))return;let t=__classPrivateFieldGet(this,em,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,em,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[vm](){return this[bm]().version||`unknown`}[ym](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,em,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[bm](t){let n=t||`*`;if(__classPrivateFieldGet(this,Xp,`f`)[n])return __classPrivateFieldGet(this,Xp,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,em,`f`).mainFilename;__classPrivateFieldGet(this,em,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,em,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,em,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,em,`f`)),S=JSON.parse(__classPrivateFieldGet(this,em,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,Xp,`f`)[n]=S||{},__classPrivateFieldGet(this,Xp,`f`)[n]}[xm](t,n){n=[].concat(n),n.forEach(n=>{n=this[Tm](n),__classPrivateFieldGet(this,Gp,`f`)[t].push(n)})}[Sm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=S})}[Cm](t,n,S,C){this[wm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,Gp,`f`)[t][n]=(__classPrivateFieldGet(this,Gp,`f`)[t][n]||[]).concat(S)})}[wm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[Tm](S),C)}[Tm](t){return t===`__proto__`?`___proto___`:t}[Em](t,n){return this[Sm](this[Em].bind(this),`key`,t,n),this}[Dm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Lp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,em,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,Gp,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Ip,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,zp,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,Wp,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,Np,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,Bp,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,tm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,nm,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,im,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,jp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,Jp,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,Yp,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,Gp,`f`).configObjects=te,__classPrivateFieldGet(this,am,`f`).unfreeze(),__classPrivateFieldGet(this,cm,`f`).unfreeze(),__classPrivateFieldGet(this,Dp,`f`).unfreeze(),__classPrivateFieldGet(this,Rp,`f`).unfreeze()}[Om](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[km].bind(this),getContext:this[Am].bind(this),getHasOutput:this[jm].bind(this),getLoggerInstance:this[Mm].bind(this),getParseContext:this[Nm].bind(this),getParserConfiguration:this[hm].bind(this),getUsageConfiguration:this[gm].bind(this),getUsageInstance:this[Pm].bind(this),getValidationInstance:this[Fm].bind(this),hasParseCallback:this[Im].bind(this),isGlobalContext:this[Lm].bind(this),postProcess:this[Rm].bind(this),reset:this[Bm].bind(this),runValidation:this[Hm].bind(this),runYargsParserAndExecuteCommands:this[Vm].bind(this),setHasOutput:this[Um].bind(this)}}[km](){return __classPrivateFieldGet(this,Dp,`f`)}[Am](){return __classPrivateFieldGet(this,kp,`f`)}[jm](){return __classPrivateFieldGet(this,Bp,`f`)}[Mm](){return __classPrivateFieldGet(this,Up,`f`)}[Nm](){return __classPrivateFieldGet(this,Yp,`f`)||{}}[Pm](){return __classPrivateFieldGet(this,am,`f`)}[Fm](){return __classPrivateFieldGet(this,cm,`f`)}[Im](){return!!__classPrivateFieldGet(this,Jp,`f`)}[Lm](){return __classPrivateFieldGet(this,Hp,`f`)}[Rm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[lm](t)),(this[hm]()[`parse-positional-numbers`]||this[hm]()[`parse-positional-numbers`]===void 0)&&(t=this[ym](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)),t)}[Bm](t={}){__classPrivateFieldSet(this,Gp,__classPrivateFieldGet(this,Gp,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,Gp,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,Gp,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,Zp,`f`),Object.keys(__classPrivateFieldGet(this,zp,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,zp,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,zp,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,Gp,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,Gp,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,Gp,`f`).envPrefix,__classPrivateFieldSet(this,Gp,n,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)?__classPrivateFieldGet(this,am,`f`).reset(S):usage(this,__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,cm,__classPrivateFieldGet(this,cm,`f`)?__classPrivateFieldGet(this,cm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldSet(this,Dp,__classPrivateFieldGet(this,Dp,`f`)?__classPrivateFieldGet(this,Dp,`f`).reset():command(__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,cm,`f`),__classPrivateFieldGet(this,Rp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Ap,`f`)||__classPrivateFieldSet(this,Ap,completion(this,__classPrivateFieldGet(this,am,`f`),__classPrivateFieldGet(this,Dp,`f`),__classPrivateFieldGet(this,em,`f`)),`f`),__classPrivateFieldGet(this,Rp,`f`).reset(),__classPrivateFieldSet(this,jp,null,`f`),__classPrivateFieldSet(this,Wp,``,`f`),__classPrivateFieldSet(this,Np,null,`f`),__classPrivateFieldSet(this,Bp,!1,`f`),this.parsed=!1,this}[zm](t,n){return __classPrivateFieldGet(this,em,`f`).path.relative(t,n)}[Vm](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,Gp,`f`).__=__classPrivateFieldGet(this,em,`f`).y18n.__,__classPrivateFieldGet(this,Gp,`f`).configuration=this[hm]();let I=!!__classPrivateFieldGet(this,Gp,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,Gp,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,em,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,Gp,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,Yp,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,Vp,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,sm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,am,`f`).clearCachedHelpMessage();try{if(this[_m](),n)return this[Rm](q,I,!!S,!1);__classPrivateFieldGet(this,Vp,`f`)&&[__classPrivateFieldGet(this,Vp,`f`)].concat(X[__classPrivateFieldGet(this,Vp,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,Hp,!1,`f`);let H=__classPrivateFieldGet(this,Dp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Ap,`f`)?.completionKey?[__classPrivateFieldGet(this,Ap,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Ap,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,jp,`f`)){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Rm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,jp,`f`)){t=F;break}!__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,$p,`f`)&&t&&!re&&__classPrivateFieldGet(this,cm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,jp,`f`)&&q._.includes(__classPrivateFieldGet(this,jp,`f`))&&!ne&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Dp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Dp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Rm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Ap,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Ap,`f`).getCompletion(n,(t,n)=>{if(t)throw new Dl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,Up,`f`).log(t)}),this.exit(0)}),this[Rm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,Bp,`f`)||(Z?(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,Up,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Ip,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,am,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,Gp,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,Gp,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new Dl(W.error.message);if(!ne){let t=this[Hm](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!0)),Y=this[Om](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Rp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof Dl)__classPrivateFieldGet(this,am,`f`).fail(t.message,t);else throw t}return this[Rm](Y??q,I,!!S,!0)}[Hm](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new Dl(S.message);__classPrivateFieldGet(this,cm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,cm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,nm,`f`)&&(I=__classPrivateFieldGet(this,cm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,tm,`f`)&&!I?__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,im,`f`)&&__classPrivateFieldGet(this,cm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,cm,`f`).limitedChoices(F),__classPrivateFieldGet(this,cm,`f`).implications(F),__classPrivateFieldGet(this,cm,`f`).conflicting(F)}}[Um](){__classPrivateFieldSet(this,Bp,!0,`f`)}[Wm](t){if(typeof t==`string`)__classPrivateFieldGet(this,Gp,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,Gp,`f`).key[n]=!0}}}),qm,Jm=__esmMin(()=>{ap(),Km(),qm=YargsFactory(ip)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var Ym=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.12-next.280`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var Xm=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,Zm=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):Qm}function parseNpmrc(t){let n={registry:Qm,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var Qm,$m=__esmMin(()=>{Qm=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var eh=__esmMin(()=>{Zm(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var th=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var nh=__esmMin(()=>{Xm(),Zm(),$m(),eh()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var rh=__esmMin(()=>{Xm(),Zm(),eh(),th()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var ih=__esmMin(()=>{Xm(),$m()}),ah=__esmMin(()=>{Xm(),Zm(),$m(),th(),nh(),rh(),ih()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return oh===void 0&&(oh=`0.64.12-next.280`),oh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=jn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=jn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var oh,sh=__esmMin(()=>{Ud(),zn(),Xn(),ah()}),ch,lh=__esmMin(()=>{ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(uh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${uh.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&dh[t]===!0}var uh,dh,fh,ph=__esmMin(()=>{uh=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],dh={flathub:!0,web:!0,"microsoft-store":!1,"apple-app-store":!1},fh=`GJSIFY_CHANNEL`}),mh=__commonJSMin(((t,n)=>{let S=(zn(),__toCommonJS(wn)),C=(Vl(),__toCommonJS(Ll)),N=(Ud(),__toCommonJS(Vd)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),hh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),gh=__commonJSMin(((t,n)=>{let S=hh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),vh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(Gl(),__toCommonJS(Hl)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(zn(),__toCommonJS(wn)),H=mh(),W=gh();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),yh=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),bh=__commonJSMin(((t,n)=>{var S=(Au(),__toCommonJS(Eu)),C=yh(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
149
149
  `)},set:function(t){S=t}});var F=null,I=Object.getOwnPropertyDescriptor(this,`stack`),H=I.get,W=I.value;delete I.value,delete I.writable,I.set=function(t){F=t},I.get=function(){var t=(F||(H?H.call(this):W)).split(/\r?\n+/g);F||(t[0]=this.name+`: `+this.message);var S=1;for(var C in n)if(n.hasOwnProperty(C)){var N=n[C];if(`line`in N){var I=N.line(this[C]);I&&t.splice(S++,0,` `+I)}`stack`in N&&N.stack(this[C],t)}return t.join(`
150
150
  `)},Object.defineProperty(this,"stack",I)};return Object.setPrototypeOf?(Object.setPrototypeOf(N.prototype,Error.prototype),Object.setPrototypeOf(N,Error)):S.inherits(N,Error),N};N.append=function(t,n){return{message:function(S,C){return S||=n,S&&(C[0]+=` `+t.replace(`%s`,S.toString())),C}}},N.line=function(t,n){return{line:function(S){return S||=n,S?t.replace(`%s`,S.toString()):null}}},n.exports=N})),xh=__commonJSMin(((t,n)=>{let hexify=t=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return`0x`+(n.length%2?`0`:``)+n},parseError=(t,n,S)=>{if(!n)return{message:t.message+` while parsing empty string`,position:0};let C=t.message.match(/^Unexpected token (.) .*position\s+(\d+)/i),N=C?+C[2]:t.message.match(/^Unexpected end of JSON.*/i)?n.length-1:null,F=C?t.message.replace(/^Unexpected token ./,`Unexpected token ${JSON.stringify(C[1])} (${hexify(C[1])})`):t.message;if(N!=null){let t=N<=S?0:N-S,C=N+S>=n.length?n.length:N+S,I=(t===0?``:`...`)+n.slice(t,C)+(C===n.length?``:`...`);return{message:F+` while parsing ${n===I?``:`near `}${JSON.stringify(I)}`,position:N}}else return{message:F+` while parsing '${n.slice(0,S*2)}'`,position:0}};var JSONParseError=class extends SyntaxError{constructor(t,n,S,C){S||=20;let N=parseError(t,n,S);super(N.message),Object.assign(this,N),this.code=`EJSONPARSE`,this.systemError=t,Error.captureStackTrace(this,C||this.constructor)}get name(){return this.constructor.name}set name(t){}get[Symbol.toStringTag](){return this.constructor.name}};let S=Symbol.for(`indent`),C=Symbol.for(`newline`),N=/^\s*[{\[]((?:\r?\n)+)([\s\t]*)/,F=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,parseJson=(t,n,I)=>{let H=stripBOM(t);I||=20;try{let[,t=`
151
151
  `,I=` `]=H.match(F)||H.match(N)||[,``,``],W=JSON.parse(H,n);return W&&typeof W==`object`&&(W[C]=t,W[S]=I),W}catch(n){if(typeof t!=`string`&&!Buffer.isBuffer(t)){let S=Array.isArray(t)&&t.length===0;throw Object.assign(TypeError(`Cannot parse ${S?`an empty array`:String(t)}`),{code:`EJSONPARSE`,systemError:n})}throw new JSONParseError(n,H,I,parseJson)}},stripBOM=t=>String(t).replace(/^\uFEFF/,``);n.exports=parseJson,parseJson.JSONParseError=JSONParseError,parseJson.noExceptions=(t,n)=>{try{return JSON.parse(stripBOM(t),n)}catch{}}})),Sh=__commonJSMin((t=>{t.__esModule=!0,t.LinesAndColumns=void 0;var n=`
@@ -648,7 +648,7 @@ Project '${t.projectName}' (${Rh[t.projectKind]}) ${n}
648
648
  Additional information: BADCLIENT: Bad error code, ${q} not found in range ${F}..${I} (found: ${W.join(`, `)})`),N}return n?H.map(t=>this.mapCodeFixAction(t)):H}getCombinedCodeFix({scope:t,fixId:n},S){Q.assert(t.type===`file`);let{file:C,project:N}=this.getFileAndProject(t.args),F=N.getLanguageService().getCombinedCodeFix({type:`file`,fileName:C},n,this.getFormatOptions(C),this.getPreferences(C));return S?{changes:this.mapTextChangesToCodeEdits(F.changes),commands:F.commands}:F}applyCodeActionCommand(t){let n=t.command;for(let t of toArray(n)){let{file:n,project:S}=this.getFileAndProject(t);S.getLanguageService().applyCodeActionCommand(t,this.getFormatOptions(n)).then(t=>{},t=>{})}return{}}getStartAndEndPosition(t,n){let S,C;return t.startPosition===void 0?(S=n.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=S):S=t.startPosition,t.endPosition===void 0?(C=n.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=C):C=t.endPosition,{startPosition:S,endPosition:C}}mapCodeAction({description:t,changes:n,commands:S}){return{description:t,changes:this.mapTextChangesToCodeEdits(n),commands:S}}mapCodeFixAction({fixName:t,description:n,changes:S,commands:C,fixId:N,fixAllDescription:F}){return{fixName:t,description:n,changes:this.mapTextChangesToCodeEdits(S),commands:C,fixId:N,fixAllDescription:F}}mapPasteEditsAction({edits:t,fixId:n}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:n}}mapTextChangesToCodeEdits(t){return t.map(t=>this.mapTextChangeToCodeEdit(t))}mapTextChangeToCodeEdit(t){let n=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!n&&(n||this.projectService.logErrorForScriptInfoNotFound(t.fileName),Q.fail(`Expected isNewFile for (only) new files. `+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!n}))),n?{fileName:t.fileName,textChanges:t.textChanges.map(t=>convertTextChangeToCodeEdit(t,n))}:convertNewFileTextChangeToCodeEdit(t)}convertTextChangeToCodeEdit(t,n){return{start:n.positionToLineOffset(t.span.start),end:n.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:``}}getBraceMatching(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getPosition(t,N),I=C.getBraceMatchingAtPosition(S,F);return I?n?I.map(t=>toProtocolTextSpan(t,N)):I:void 0}getDiagnosticsForProject(t,n,S){if(this.suppressDiagnosticEvents)return;let{fileNames:C,languageServiceDisabled:N}=this.getProjectInfoWorker(S,void 0,!0,void 0,!0);if(N)return;let F=C.filter(t=>!t.includes(`lib.d.ts`));if(F.length===0)return;let I=[],H=[],W=[],q=[],Y=toNormalizedPath(S),X=this.projectService.ensureDefaultProjectForFile(Y);for(let t of F)this.getCanonicalFileName(t)===this.getCanonicalFileName(S)?I.push(t):this.projectService.getScriptInfo(t).isScriptOpen()?H.push(t):isDeclarationFileName(t)?q.push(t):W.push(t);let Z=[...I,...H,...W,...q].map(t=>({fileName:t,project:X}));this.updateErrorCheck(t,Z,n,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,n){let{locations:S}=t,{file:C,languageService:N}=this.getFileAndLanguageServiceForSyntacticOperation(t),F=Q.checkDefined(this.projectService.getScriptInfo(C));return map(S,t=>{let S=this.getPosition(t,F),I=N.getSmartSelectionRange(C,S);return n?this.mapSelectionRange(I,F):I})}toggleLineComment(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfo(S),F=this.getRange(t,N),I=C.toggleLineComment(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}toggleMultilineComment(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.toggleMultilineComment(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}commentSelection(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.commentSelection(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}uncommentSelection(t,n){let{file:S,languageService:C}=this.getFileAndLanguageServiceForSyntacticOperation(t),N=this.projectService.getScriptInfoForNormalizedPath(S),F=this.getRange(t,N),I=C.uncommentSelection(S,F);if(n){let t=this.projectService.getScriptInfoForNormalizedPath(S);return I.map(n=>this.convertTextChangeToCodeEdit(n,t))}return I}mapSelectionRange(t,n){let S={textSpan:toProtocolTextSpan(t.textSpan,n)};return t.parent&&(S.parent=this.mapSelectionRange(t.parent,n)),S}getScriptInfoFromProjectService(t){let n=toNormalizedPath(t);return this.projectService.getScriptInfoForNormalizedPath(n)||(this.projectService.logErrorForScriptInfoNotFound(n),wh.ThrowNoProject())}toProtocolCallHierarchyItem(t){let n=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:toProtocolTextSpan(t.span,n),selectionSpan:toProtocolTextSpan(t.selectionSpan,n)}}toProtocolCallHierarchyIncomingCall(t){let n=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(t=>toProtocolTextSpan(t,n))}}toProtocolCallHierarchyOutgoingCall(t,n){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(t=>toProtocolTextSpan(t,n))}}prepareCallHierarchy(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.projectService.getScriptInfoForNormalizedPath(n);if(C){let N=this.getPosition(t,C),F=S.getLanguageService().prepareCallHierarchy(n,N);return F&&mapOneOrMany(F,t=>this.toProtocolCallHierarchyItem(t))}}provideCallHierarchyIncomingCalls(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.getScriptInfoFromProjectService(n);return S.getLanguageService().provideCallHierarchyIncomingCalls(n,this.getPosition(t,C)).map(t=>this.toProtocolCallHierarchyIncomingCall(t))}provideCallHierarchyOutgoingCalls(t){let{file:n,project:S}=this.getFileAndProject(t),C=this.getScriptInfoFromProjectService(n);return S.getLanguageService().provideCallHierarchyOutgoingCalls(n,this.getPosition(t,C)).map(t=>this.toProtocolCallHierarchyOutgoingCall(t,C))}getCanonicalFileName(t){return normalizePath(this.host.useCaseSensitiveFileNames?t:toFileNameLowerCase(t))}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,n){if(this.handlers.has(t))throw Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,n)}setCurrentRequest(t){Q.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){Q.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,n,S){let C=this.performanceData;try{return this.performanceData=S,this.setCurrentRequest(t),n()}finally{this.resetCurrentRequest(t),this.performanceData=C}}executeCommand(t){let n=this.handlers.get(t.command);if(n){let S=this.executeWithRequestId(t.seq,()=>n(t),void 0);return this.projectService.enableRequestedPlugins(),S}else return this.logger.msg(`Unrecognized JSON command:${stringifyIndented(t)}`,`Err`),this.doOutput(void 0,`unknown`,t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var n,S,C,N,F,I,H;this.gcTimer.scheduleCollect();let W,q=this.performanceData;this.logger.hasLevel(2)&&(W=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${indent2(this.toStringMessage(t))}`));let Y,X;try{Y=this.parseMessage(t),X=Y.arguments&&Y.arguments.file?Y.arguments:void 0,(n=Ie)==null||n.instant(Ie.Phase.Session,`request`,{seq:Y.seq,command:Y.command}),(S=Ie)==null||S.push(Ie.Phase.Session,`executeCommand`,{seq:Y.seq,command:Y.command},!0);let{response:F,responseRequired:I,performanceData:H}=this.executeCommand(Y);if((C=Ie)==null||C.pop(),this.logger.hasLevel(2)){let t=hrTimeToMilliseconds(this.hrtime(W)).toFixed(4);I?this.logger.perftrc(`${Y.seq}::${Y.command}: elapsed time (in milliseconds) ${t}`):this.logger.perftrc(`${Y.seq}::${Y.command}: async elapsed time (in milliseconds) ${t}`)}(N=Ie)==null||N.instant(Ie.Phase.Session,`response`,{seq:Y.seq,command:Y.command,success:!!F}),F?this.doOutput(F,Y.command,Y.seq,!0,H):I&&this.doOutput(void 0,Y.command,Y.seq,!1,H,`No content available.`)}catch(n){if((F=Ie)==null||F.popAll(),n instanceof OperationCanceledException){(I=Ie)==null||I.instant(Ie.Phase.Session,`commandCanceled`,{seq:Y?.seq,command:Y?.command}),this.doOutput({canceled:!0},Y.command,Y.seq,!0,this.performanceData);return}this.logErrorWorker(n,this.toStringMessage(t),X),(H=Ie)==null||H.instant(Ie.Phase.Session,`commandError`,{seq:Y?.seq,command:Y?.command,message:n.message}),this.doOutput(void 0,Y?Y.command:`unknown`,Y?Y.seq:0,!1,this.performanceData,`Error processing request. `+n.message+`
649
649
  `+n.stack)}finally{this.performanceData=q}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function toProtocolPerformanceData(t){let n=t.diagnosticsDuration&&arrayFrom(t.diagnosticsDuration,([t,n])=>({...n,file:t}));return{...t,diagnosticsDuration:n}}function toProtocolTextSpan(t,n){return{start:n.positionToLineOffset(t.start),end:n.positionToLineOffset(textSpanEnd(t))}}function toProtocolTextSpanWithContext(t,n,S){let C=toProtocolTextSpan(t,S),N=n&&toProtocolTextSpan(n,S);return N?{...C,contextStart:N.start,contextEnd:N.end}:C}function convertTextChangeToCodeEdit(t,n){return{start:positionToLineOffset(n,t.span.start),end:positionToLineOffset(n,textSpanEnd(t.span)),newText:t.newText}}function positionToLineOffset(t,n){return isConfigFile(t)?locationFromLineAndCharacter(t.getLineAndCharacterOfPosition(n)):t.positionToLineOffset(n)}function convertLinkedEditInfoToRanges(t,n){let S=t.ranges.map(t=>({start:n.positionToLineOffset(t.start),end:n.positionToLineOffset(t.start+t.length)}));return t.wordPattern?{ranges:S,wordPattern:t.wordPattern}:{ranges:S}}function locationFromLineAndCharacter(t){return{line:t.line+1,offset:t.character+1}}function convertNewFileTextChangeToCodeEdit(t){Q.assert(t.textChanges.length===1);let n=first(t.textChanges);return Q.assert(n.span.start===0&&n.span.length===0),{fileName:t.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:n.newText}]}}function getLocationInNewDocument(t,n,S,C){let{line:N,character:F}=computeLineAndCharacterOfPosition(computeLineStarts(applyEdits(t,n,C)),S);return{line:N+1,offset:F+1}}function applyEdits(t,n,S){for(let{fileName:C,textChanges:N}of S)if(C===n)for(let n=N.length-1;n>=0;n--){let{newText:S,span:{start:C,length:F}}=N[n];t=t.slice(0,C)+S+t.slice(C+F)}return t}function referenceEntryToReferencesResponseItem(t,{fileName:n,textSpan:S,contextSpan:C,isWriteAccess:N,isDefinition:F},{disableLineTextInReferences:I}){let H=Q.checkDefined(t.getScriptInfo(n)),W=toProtocolTextSpanWithContext(S,C,H),q=I?void 0:getLineText(H,W);return{file:n,...W,lineText:q,isWriteAccess:N,isDefinition:F}}function getLineText(t,n){let S=t.lineToTextSpan(n.start.line-1);return t.getSnapshot().getText(S.start,textSpanEnd(S)).replace(/\r|\n/g,``)}function isCompletionEntryData(t){return t===void 0||t&&typeof t==`object`&&typeof t.exportName==`string`&&(t.fileName===void 0||typeof t.fileName==`string`)&&(t.ambientModuleName===void 0||typeof t.ambientModuleName==`string`&&(t.isPackageJsonImport===void 0||typeof t.isPackageJsonImport==`boolean`))}var vg=4,yg=(t=>(t[t.PreStart=0]=`PreStart`,t[t.Start=1]=`Start`,t[t.Entire=2]=`Entire`,t[t.Mid=3]=`Mid`,t[t.End=4]=`End`,t[t.PostEnd=5]=`PostEnd`,t))(yg||{}),EditWalker=class{constructor(){this.goSubtree=!0,this.lineIndex=new Cg,this.endBranch=[],this.state=2,this.initialText=``,this.trailingText=``,this.lineIndex.root=new wg,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(t,n){n&&(this.trailingText=``),t=t?this.initialText+t+this.trailingText:this.initialText+this.trailingText;let S=Cg.linesFromText(t).lines;S.length>1&&S[S.length-1]===``&&S.pop();let C,N;for(let t=this.endBranch.length-1;t>=0;t--)this.endBranch[t].updateCounts(),this.endBranch[t].charCount()===0&&(N=this.endBranch[t],C=t>0?this.endBranch[t-1]:this.branchNode);N&&C.remove(N);let F=this.startPath[this.startPath.length-1];if(S.length>0)if(F.text=S[0],S.length>1){let t=Array(S.length-1),n=F;for(let n=1;n<S.length;n++)t[n-1]=new LineLeaf(S[n]);let C=this.startPath.length-2;for(;C>=0;){let S=this.startPath[C];t=S.insertAt(n,t),C--,n=S}let N=t.length;for(;N>0;){let n=new wg;n.add(this.lineIndex.root),t=n.insertAt(this.lineIndex.root,t),N=t.length,this.lineIndex.root=n}this.lineIndex.root.updateCounts()}else for(let t=this.startPath.length-2;t>=0;t--)this.startPath[t].updateCounts();else{this.startPath[this.startPath.length-2].remove(F);for(let t=this.startPath.length-2;t>=0;t--)this.startPath[t].updateCounts()}return this.lineIndex}post(t,n,S){S===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(t,n,S,C,N){let F=this.stack[this.stack.length-1];this.state===2&&N===1&&(this.state=1,this.branchNode=F,this.lineCollectionAtBranch=S);let I;function fresh(t){return t.isLeaf()?new LineLeaf(``):new wg}switch(N){case 0:this.goSubtree=!1,this.state!==4&&F.add(S);break;case 1:this.state===4?this.goSubtree=!1:(I=fresh(S),F.add(I),this.startPath.push(I));break;case 2:this.state===4?S.isLeaf()||(I=fresh(S),F.add(I),this.endBranch.push(I)):(I=fresh(S),F.add(I),this.startPath.push(I));break;case 3:this.goSubtree=!1;break;case 4:this.state===4?S.isLeaf()||(I=fresh(S),F.add(I),this.endBranch.push(I)):this.goSubtree=!1;break;case 5:this.goSubtree=!1,this.state!==1&&F.add(S);break}this.goSubtree&&this.stack.push(I)}leaf(t,n,S){this.state===1?this.initialText=S.text.substring(0,t):(this.state===2&&(this.initialText=S.text.substring(0,t)),this.trailingText=S.text.substring(t+n))}},TextChange9=class{constructor(t,n,S){this.pos=t,this.deleteLen=n,this.insertedText=S}getTextChangeRange(){return createTextChangeRange(createTextSpan(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},bg=class _ScriptVersionCache{constructor(){this.changes=[],this.versions=Array(_ScriptVersionCache.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%_ScriptVersionCache.maxVersions}currentVersionToIndex(){return this.currentVersion%_ScriptVersionCache.maxVersions}edit(t,n,S){this.changes.push(new TextChange9(t,n,S)),(this.changes.length>_ScriptVersionCache.changeNumberThreshold||n>_ScriptVersionCache.changeLengthThreshold||S&&S.length>_ScriptVersionCache.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(let t of this.changes)n=n.edit(t.pos,t.deleteLen,t.insertedText);t=new Sg(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=_ScriptVersionCache.maxVersions&&(this.minVersion=this.currentVersion-_ScriptVersionCache.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let n=this._getSnapshot().index,{lineText:S,absolutePosition:C}=n.lineNumberToInfo(t+1);return createTextSpan(C,S===void 0?n.absolutePositionOfStartOfLine(t+2)-C:S.length)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){let S=[];for(let C=t+1;C<=n;C++){let t=this.versions[this.versionToIndex(C)];for(let n of t.changesSincePreviousVersion)S.push(n.getTextChangeRange())}return collapseTextChangeRangesAcrossMultipleVersions(S)}else return;else return Yn}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let n=new _ScriptVersionCache,S=new Sg(0,n,new Cg);n.versions[n.currentVersion]=S;let C=Cg.linesFromText(t);return S.index.load(C.lines),n}};bg.changeNumberThreshold=8,bg.changeLengthThreshold=256,bg.maxVersions=8;var xg=bg,Sg=class _LineIndexSnapshot{constructor(t,n,S,C=Sh){this.version=t,this.cache=n,this.index=S,this.changesSincePreviousVersion=C}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof _LineIndexSnapshot&&this.cache===t.cache)return this.version<=t.version?Yn:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},Cg=class _LineIndex{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:n,zeroBasedColumn:S}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:S+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){if(t<=this.getLineCount()){let{position:n,leaf:S}=this.root.lineNumberToInfo(t,0);return{absolutePosition:n,lineText:S&&S.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let n=[];for(let S=0;S<t.length;S++)n[S]=new LineLeaf(t[S]);this.root=_LineIndex.buildTreeFromBottom(n)}else this.root=new wg}walk(t,n,S){this.root.walk(t,n,S)}getText(t,n){let S=``;return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(t,n,C)=>{S=S.concat(C.text.substring(t,t+n))}}),S}getLength(){return this.root.charCount()}every(t,n,S){S||=this.root.charCount();let C={goSubtree:!0,done:!1,leaf(n,S,C){t(C,n,S)||(this.done=!0)}};return this.walk(n,S-n,C),!C.done}edit(t,n,S){if(this.root.charCount()===0)return Q.assert(n===0),S===void 0?void 0:(this.load(_LineIndex.linesFromText(S).lines),this);{let C;if(this.checkEdits){let N=this.getText(0,this.root.charCount());C=N.slice(0,t)+S+N.slice(t+n)}let N=new EditWalker,F=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let C=this.getText(t,1);S=S?C+S:C,n=0,F=!0}else if(n>0){let C=t+n,{zeroBasedColumn:N,lineText:F}=this.positionToColumnAndLineText(C);N===0&&(n+=F.length,S=S?S+F:F)}if(this.root.walk(t,n,N),N.insertLines(S,F),this.checkEdits){let t=N.lineIndex.getText(0,N.lineIndex.getLength());Q.assert(C===t,`buffer edit mismatch`)}return N.lineIndex}}static buildTreeFromBottom(t){if(t.length<vg)return new wg(t);let n=Array(Math.ceil(t.length/vg)),S=0;for(let C=0;C<n.length;C++){let N=Math.min(S+vg,t.length);n[C]=new wg(t.slice(S,N)),S=N}return this.buildTreeFromBottom(n)}static linesFromText(t){let n=computeLineStarts(t);if(n.length===0)return{lines:[],lineMap:n};let S=Array(n.length),C=n.length-1;for(let N=0;N<C;N++)S[N]=t.substring(n[N],n[N+1]);let N=t.substring(n[C]);return N.length>0?S[C]=N:S.pop(),{lines:S,lineMap:n}}},wg=class _LineNode{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,S,C,N){return S.pre&&S.pre(t,n,this.children[C],this,N),S.goSubtree?(this.children[C].walk(t,n,S),S.post&&S.post(t,n,this.children[C],this,N)):S.goSubtree=!0,S.done}skipChild(t,n,S,C,N){C.pre&&!C.done&&(C.pre(t,n,this.children[S],this,N),C.goSubtree=!0)}walk(t,n,S){if(this.children.length===0)return;let C=0,N=this.children[C].charCount(),F=t;for(;F>=N;)this.skipChild(F,n,C,S,0),F-=N,C++,N=this.children[C].charCount();if(F+n<=N){if(this.execWalk(F,n,S,C,2))return}else{if(this.execWalk(F,N-F,S,C,1))return;let t=n-(N-F);for(C++,N=this.children[C].charCount();t>N;){if(this.execWalk(0,N,S,C,3))return;t-=N,C++,N=this.children[C].charCount()}if(t>0&&this.execWalk(0,t,S,C,4))return}if(S.pre){let t=this.children.length;if(C<t-1)for(let n=C+1;n<t;n++)this.skipChild(0,0,n,S,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(let S of this.children)if(S.charCount()>n)return S.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:S.text}:S.charOffsetToLineInfo(t,n);else n-=S.charCount(),t+=S.lineCount();let S=this.lineCount();return S===0?{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0}:{oneBasedLine:S,zeroBasedColumn:Q.checkDefined(this.lineNumberToInfo(S,0).leaf).charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(let S of this.children){let C=S.lineCount();if(C>=t)return S.isLeaf()?{position:n,leaf:S}:S.lineNumberToInfo(t,n);t-=C,n+=S.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n,S=this.children.length;t++;let C=t;if(t<S){for(n=new _LineNode;t<S;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=C,n}remove(t){let n=this.findChildIndex(t),S=this.children.length;if(n<S-1)for(let t=n;t<S-1;t++)this.children[t]=this.children[t+1];this.children.pop()}findChildIndex(t){let n=this.children.indexOf(t);return Q.assert(n!==-1),n}insertAt(t,n){let S=this.findChildIndex(t),C=this.children.length,N=n.length;if(C<vg&&S===C-1&&N===1)return this.add(n[0]),this.updateCounts(),[];{let t=this.splitAfter(S),C=0;for(S++;S<vg&&C<N;)this.children[S]=n[C],S++,C++;let F=[],I=0;if(C<N){I=Math.ceil((N-C)/vg),F=Array(I);let t=0;for(let t=0;t<I;t++)F[t]=new _LineNode;let S=F[0];for(;C<N;)S.add(n[C]),C++,S.children.length===vg&&(t++,S=F[t]);for(let t=F.length-1;t>=0;t--)F[t].children.length===0&&F.pop()}t&&F.push(t),this.updateCounts();for(let t=0;t<I;t++)F[t].updateCounts();return F}}add(t){this.children.push(t),Q.assert(this.children.length<=vg)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},LineLeaf=class{constructor(t){this.text=t}isLeaf(){return!0}walk(t,n,S){S.leaf(t,n,this)}charCount(){return this.text.length}lineCount(){return 1}},Tg=class _TypingsInstallerAdapter{constructor(t,n,S,C,N,F){this.telemetryEnabled=t,this.logger=n,this.host=S,this.globalTypingsCacheLocation=C,this.event=N,this.maxActiveRequestCount=F,this.activeRequestCount=0,this.requestQueue=createQueue(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){return $s.validatePackageName(t)===$s.NameValidationResult.Ok?(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:`typesRegistry`})),!!this.typesRegistryCache?.has(t)):!1}installPackage(t){this.packageInstallId++;let n={kind:`installPackage`,...t,id:this.packageInstallId},S=new Promise((t,n)=>{(this.packageInstalledPromise??=new Map).set(this.packageInstallId,{resolve:t,reject:n})});return this.installer.send(n),S}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:`closeProject`})}enqueueInstallTypingsRequest(t,n,S){let C=createInstallTypingsRequest(t,n,S);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(C)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(C):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${C.projectName}`),this.requestQueue.enqueue(C),this.requestMap.set(C.projectName,C))}handleMessage(t){var n;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${stringifyIndented(t)}`),t.kind){case rc:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case nc:{let S=this.packageInstalledPromise?.get(t.id);Q.assertIsDefined(S,`Should find the promise for package install`),(n=this.packageInstalledPromise)==null||n.delete(t.id),t.success?S.resolve({successMessage:t.message}):S.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,`setTypings`);break}case oc:{let n={message:t.message};this.event(n,`typesInstallerInitializationFailed`);break}case ic:{let n={eventId:t.eventId,packages:t.packagesToInstall};this.event(n,`beginInstallTypes`);break}case ac:{if(this.telemetryEnabled){let n={telemetryEventName:`typingsInstalled`,payload:{installedPackages:t.packagesToInstall.join(`,`),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(n,`telemetry`)}let n={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(n,`endInstallTypes`);break}case tc:this.projectService.updateTypingsForProject(t);break;case ec:for(this.activeRequestCount>0?this.activeRequestCount--:Q.fail(`TIAdapter:: Received too many responses`);!this.requestQueue.isEmpty();){let t=this.requestQueue.dequeue();if(this.requestMap.get(t.projectName)===t){this.requestMap.delete(t.projectName),this.scheduleRequest(t);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${t.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,`setTypings`);break;case sc:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(t)}`),this.installer.send(t)},_TypingsInstallerAdapter.requestDelayMillis,`${t.projectName}::${t.kind}`)}};Tg.requestDelayMillis=100;var Eg=Tg,Dg={};__export(Dg,{ActionInvalidate:()=>tc,ActionPackageInstalled:()=>nc,ActionSet:()=>ec,ActionWatchTypingLocations:()=>sc,Arguments:()=>cc,AutoImportProviderProject:()=>Vh,AuxiliaryProject:()=>AuxiliaryProject,CharRangeSection:()=>yg,CloseFileWatcherEvent:()=>eg,CommandNames:()=>mg,ConfigFileDiagEvent:()=>Jh,ConfiguredProject:()=>ConfiguredProject2,ConfiguredProjectLoadKind:()=>ug,CreateDirectoryWatcherEvent:()=>$h,CreateFileWatcherEvent:()=>Qh,Errors:()=>wh,EventBeginInstallTypes:()=>ic,EventEndInstallTypes:()=>ac,EventInitializationFailed:()=>oc,EventTypesRegistry:()=>rc,ExternalProject:()=>ExternalProject,GcTimer:()=>Eh,InferredProject:()=>InferredProject2,LargeFileReferencedEvent:()=>qh,LineIndex:()=>Cg,LineLeaf:()=>LineLeaf,LineNode:()=>wg,LogLevel:()=>xh,Msg:()=>Ch,OpenFileInfoTelemetryEvent:()=>Zh,Project:()=>zh,ProjectInfoTelemetryEvent:()=>Xh,ProjectKind:()=>Rh,ProjectLanguageServiceStateEvent:()=>Yh,ProjectLoadingFinishEvent:()=>Kh,ProjectLoadingStartEvent:()=>Gh,ProjectService:()=>fg,ProjectsUpdatedInBackgroundEvent:()=>Wh,ScriptInfo:()=>ScriptInfo,ScriptVersionCache:()=>xg,Session:()=>_g,TextStorage:()=>TextStorage,ThrottledOperations:()=>Th,TypingsInstallerAdapter:()=>Eg,allFilesAreJsOrDts:()=>allFilesAreJsOrDts,allRootFilesAreJsOrDts:()=>allRootFilesAreJsOrDts,asNormalizedPath:()=>asNormalizedPath,convertCompilerOptions:()=>convertCompilerOptions,convertFormatOptions:()=>convertFormatOptions,convertScriptKindName:()=>convertScriptKindName,convertTypeAcquisition:()=>convertTypeAcquisition,convertUserPreferences:()=>convertUserPreferences,convertWatchOptions:()=>convertWatchOptions,countEachFileTypes:()=>countEachFileTypes,createInstallTypingsRequest:()=>createInstallTypingsRequest,createModuleSpecifierCache:()=>createModuleSpecifierCache,createNormalizedPathMap:()=>createNormalizedPathMap,createPackageJsonCache:()=>createPackageJsonCache,createSortedArray:()=>createSortedArray2,emptyArray:()=>Sh,findArgument:()=>findArgument,formatDiagnosticToProtocol:()=>formatDiagnosticToProtocol,formatMessage:()=>formatMessage2,getBaseConfigFileName:()=>getBaseConfigFileName,getDetailWatchInfo:()=>getDetailWatchInfo,getLocationInNewDocument:()=>getLocationInNewDocument,hasArgument:()=>hasArgument,hasNoTypeScriptSource:()=>hasNoTypeScriptSource,indent:()=>indent2,isBackgroundProject:()=>isBackgroundProject,isConfigFile:()=>isConfigFile,isConfiguredProject:()=>isConfiguredProject,isDynamicFileName:()=>isDynamicFileName,isExternalProject:()=>isExternalProject,isInferredProject:()=>isInferredProject,isInferredProjectName:()=>isInferredProjectName,isProjectDeferredClose:()=>isProjectDeferredClose,makeAutoImportProviderProjectName:()=>makeAutoImportProviderProjectName,makeAuxiliaryProjectName:()=>makeAuxiliaryProjectName,makeInferredProjectName:()=>makeInferredProjectName,maxFileSize:()=>Uh,maxProgramSizeForNonTsFiles:()=>Hh,normalizedPathToPath:()=>normalizedPathToPath,nowString:()=>nowString,nullCancellationToken:()=>pg,nullTypingsInstaller:()=>cg,protocol:()=>Dh,scriptInfoIsContainedByBackgroundProject:()=>scriptInfoIsContainedByBackgroundProject,scriptInfoIsContainedByDeferredClosedProject:()=>scriptInfoIsContainedByDeferredClosedProject,stringifyIndented:()=>stringifyIndented,toEvent:()=>toEvent,toNormalizedPath:()=>toNormalizedPath,tryConvertScriptKindName:()=>tryConvertScriptKindName,typingsInstaller:()=>yh,updateProjectIfDirty:()=>updateProjectIfDirty}),ge!==void 0&&(Q.loggingHost={log(t,n){switch(t){case 1:return ge.error(n);case 2:return ge.warn(n);case 3:return ge.log(n);case 4:return ge.log(n)}}})})({get exports(){return I},set exports(t){I=t,n!==void 0&&n.exports&&(n.exports=t)}})})),s_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadTs=t.loadTsSync=t.loadYaml=t.loadJson=t.loadJs=t.loadJsSync=void 0;let S=(Ud(),__toCommonJS(Vd)),C=(Ed(),__toCommonJS(Cd)),N=n((zn(),__toCommonJS(wn))),F=(Xn(),__toCommonJS(Bn)),I=(rl(),__toCommonJS(tl)),H;t.loadJsSync=function loadJsSync(t){return H===void 0&&(H=vh()),H(t)},t.loadJs=async function loadJs(n){try{let{href:t}=(0,F.pathToFileURL)(await(0,C.realpath)(n));return(await import(t)).default}catch(S){try{return(0,t.loadJsSync)(n,``)}catch(t){throw t.code===`ERR_REQUIRE_ESM`||t instanceof SyntaxError&&t.toString().includes(`Cannot use import statement outside a module`)?S:t}}};let W;t.loadJson=function loadJson(t,n){W===void 0&&(W=kh());try{return W(n)}catch(n){throw n.message=`JSON Error in ${t}:\n${n.message}`,n}};let q;t.loadYaml=function loadYaml(t,n){q===void 0&&(q=eg());try{return q.load(n)}catch(n){throw n.message=`YAML Error in ${t}:\n${n.message}`,n}};let Y;t.loadTsSync=function loadTsSync(n,C){Y===void 0&&(Y=o_());let F=`${n}.${(0,I.randomUUID)()}.cjs`;try{let I=resolveTsConfig(N.default.dirname(n))??{};return I.compilerOptions={...I.compilerOptions,module:Y.ModuleKind.NodeNext,moduleResolution:Y.ModuleResolutionKind.NodeNext,target:Y.ScriptTarget.ES2022,noEmit:!1},C=Y.transpileModule(C,I).outputText,(0,S.writeFileSync)(F,C),(0,t.loadJsSync)(F,C).default}catch(t){throw t.message=`TypeScript Error in ${n}:\n${t.message}`,t}finally{(0,S.existsSync)(F)&&(0,S.rmSync)(F)}},t.loadTs=async function loadTs(n,F){Y===void 0&&(Y=(await Promise.resolve().then(()=>__toESM(o_()))).default);let H=`${n}.${(0,I.randomUUID)()}.mjs`,W;try{try{let t=resolveTsConfig(N.default.dirname(n))??{};t.compilerOptions={...t.compilerOptions,module:Y.ModuleKind.ES2022,moduleResolution:Y.ModuleResolutionKind.Bundler,target:Y.ScriptTarget.ES2022,noEmit:!1},W=Y.transpileModule(F,t).outputText,await(0,C.writeFile)(H,W)}catch(t){throw t.message=`TypeScript Error in ${n}:\n${t.message}`,t}return await(0,t.loadJs)(H,W)}finally{(0,S.existsSync)(H)&&await(0,C.rm)(H)}};function resolveTsConfig(t){let n=Y.findConfigFile(t,t=>Y.sys.fileExists(t));if(n!==void 0){let{config:t,error:S}=Y.readConfigFile(n,t=>Y.sys.readFile(t));if(S)throw Error(`Error in ${n}: ${S.messageText.toString()}`);return t}}})),c_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.metaSearchPlaces=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=void 0,t.getDefaultSearchPlaces=getDefaultSearchPlaces,t.getDefaultSearchPlacesSync=getDefaultSearchPlacesSync;let n=s_();function getDefaultSearchPlaces(t){return[`package.json`,`.${t}rc`,`.${t}rc.json`,`.${t}rc.yaml`,`.${t}rc.yml`,`.${t}rc.js`,`.${t}rc.ts`,`.${t}rc.cjs`,`.${t}rc.mjs`,`.config/${t}rc`,`.config/${t}rc.json`,`.config/${t}rc.yaml`,`.config/${t}rc.yml`,`.config/${t}rc.js`,`.config/${t}rc.ts`,`.config/${t}rc.cjs`,`.config/${t}rc.mjs`,`${t}.config.js`,`${t}.config.ts`,`${t}.config.cjs`,`${t}.config.mjs`]}function getDefaultSearchPlacesSync(t){return[`package.json`,`.${t}rc`,`.${t}rc.json`,`.${t}rc.yaml`,`.${t}rc.yml`,`.${t}rc.js`,`.${t}rc.ts`,`.${t}rc.cjs`,`.config/${t}rc`,`.config/${t}rc.json`,`.config/${t}rc.yaml`,`.config/${t}rc.yml`,`.config/${t}rc.js`,`.config/${t}rc.ts`,`.config/${t}rc.cjs`,`${t}.config.js`,`${t}.config.ts`,`${t}.config.cjs`]}t.globalConfigSearchPlaces=[`config`,`config.json`,`config.yaml`,`config.yml`,`config.js`,`config.ts`,`config.cjs`,`config.mjs`],t.globalConfigSearchPlacesSync=[`config`,`config.json`,`config.yaml`,`config.yml`,`config.js`,`config.ts`,`config.cjs`],t.metaSearchPlaces=[`package.json`,`package.yaml`,`.config/config.json`,`.config/config.yaml`,`.config/config.yml`,`.config/config.js`,`.config/config.ts`,`.config/config.cjs`,`.config/config.mjs`],t.defaultLoaders=Object.freeze({".mjs":n.loadJs,".cjs":n.loadJs,".js":n.loadJs,".ts":n.loadTs,".json":n.loadJson,".yaml":n.loadYaml,".yml":n.loadYaml,noExt:n.loadYaml}),t.defaultLoadersSync=Object.freeze({".cjs":n.loadJsSync,".js":n.loadJsSync,".ts":n.loadTsSync,".json":n.loadJson,".yaml":n.loadYaml,".yml":n.loadYaml,noExt:n.loadYaml})})),l_=__commonJSMin(((t,n)=>{let S=(zn(),__toCommonJS(wn)),C=(Hg(),__toCommonJS(Pg)),N=C.homedir(),F=C.tmpdir(),{env:I}=process,macos=t=>{let n=S.join(N,`Library`);return{data:S.join(n,`Application Support`,t),config:S.join(n,`Preferences`,t),cache:S.join(n,`Caches`,t),log:S.join(n,`Logs`,t),temp:S.join(F,t)}},windows=t=>{let n=I.APPDATA||S.join(N,`AppData`,`Roaming`),C=I.LOCALAPPDATA||S.join(N,`AppData`,`Local`);return{data:S.join(C,t,`Data`),config:S.join(n,t,`Config`),cache:S.join(C,t,`Cache`),log:S.join(C,t,`Log`),temp:S.join(F,t)}},linux=t=>{let n=S.basename(N);return{data:S.join(I.XDG_DATA_HOME||S.join(N,`.local`,`share`),t),config:S.join(I.XDG_CONFIG_HOME||S.join(N,`.config`),t),cache:S.join(I.XDG_CACHE_HOME||S.join(N,`.cache`),t),log:S.join(I.XDG_STATE_HOME||S.join(N,`.local`,`state`),t),temp:S.join(F,n,t)}},envPaths=(t,n)=>{if(typeof t!=`string`)throw TypeError(`Expected string, got ${typeof t}`);return n=Object.assign({suffix:`nodejs`},n),n.suffix&&(t+=`-${n.suffix}`),process.platform===`darwin`?macos(t):process.platform===`win32`?windows(t):linux(t)};n.exports=envPaths,n.exports.default=envPaths})),u_=__commonJSMin((t=>{var n=t&&t.__createBinding||(Object.create?(function(t,n,S,C){C===void 0&&(C=S);var N=Object.getOwnPropertyDescriptor(n,S);(!N||(`get`in N?!n.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return n[S]}}),Object.defineProperty(t,C,N)}):(function(t,n,S,C){C===void 0&&(C=S),t[C]=n[S]})),S=t&&t.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),C=t&&t.__importStar||(function(){var ownKeys=function(t){return ownKeys=Object.getOwnPropertyNames||function(t){var n=[];for(var S in t)Object.prototype.hasOwnProperty.call(t,S)&&(n[n.length]=S);return n},ownKeys(t)};return function(t){if(t&&t.__esModule)return t;var C={};if(t!=null)for(var N=ownKeys(t),F=0;F<N.length;F++)N[F]!=="default"&&n(C,t,N[F]);return S(C,t),C}})();Object.defineProperty(t,"__esModule",{value:!0}),t.emplace=emplace,t.getPropertyByPath=getPropertyByPath,t.removeUndefinedValuesFromObject=removeUndefinedValuesFromObject,t.isDirectory=isDirectory,t.isDirectorySync=isDirectorySync;let N=C((Ud(),__toCommonJS(Vd)));function emplace(t,n,S){let C=t.get(n);if(C!==void 0)return C;let N=S();return t.set(n,N),N}function getPropertyByPath(t,n){return typeof n==`string`&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:(typeof n==`string`?n.split(`.`):n).reduce((t,n)=>t===void 0?t:t[n],t)}function removeUndefinedValuesFromObject(t){return Object.fromEntries(Object.entries(t).filter(([,t])=>t!==void 0))}async function isDirectory(t){try{return(await N.promises.stat(t)).isDirectory()}catch(t){if(t.code===`ENOENT`)return!1;throw t}}function isDirectorySync(t){try{return N.default.statSync(t).isDirectory()}catch(t){if(t.code===`ENOENT`)return!1;throw t}}})),d_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerBase=void 0,t.getExtensionDescription=getExtensionDescription;let S=n(l_()),C=n((Hg(),__toCommonJS(Pg))),N=n((zn(),__toCommonJS(wn))),F=u_();var ExplorerBase=class{#e=!1;config;loadCache;searchCache;constructor(t){this.config=t,t.cache&&(this.loadCache=new Map,this.searchCache=new Map),this.#t()}set loadingMetaConfig(t){this.#e=t}#t(){let t=this.config;for(let n of t.searchPlaces){let t=N.default.extname(n),S=this.config.loaders[t||`noExt`]??this.config.loaders.default;if(S===void 0)throw Error(`Missing loader for ${getExtensionDescription(n)}.`);if(typeof S!=`function`)throw Error(`Loader for ${getExtensionDescription(n)} is not a function: Received ${typeof S}.`)}}clearLoadCache(){this.loadCache&&this.loadCache.clear()}clearSearchCache(){this.searchCache&&this.searchCache.clear()}clearCaches(){this.clearLoadCache(),this.clearSearchCache()}toCosmiconfigResult(t,n){if(n===null)return null;if(n===void 0)return{filepath:t,config:void 0,isEmpty:!0};if(this.config.applyPackagePropertyPathToConfiguration||this.#e){let t=this.config.packageProp??this.config.moduleName;n=(0,F.getPropertyByPath)(n,t)}return n===void 0?{filepath:t,config:void 0,isEmpty:!0}:{config:n,filepath:t}}validateImports(t,n,S){let C=N.default.dirname(t);for(let F of n){if(typeof F!=`string`)throw Error(`${t}: Key $import must contain a string or a list of strings`);let n=N.default.resolve(C,F);if(n===t)throw Error(`Self-import detected in ${t}`);let I=S.indexOf(n);if(I!==-1)throw Error(`Circular import detected:
650
650
  ${[...S,n].map((t,n)=>`${n+1}. ${t}`).join(`
651
- `)} (same as ${I+1}.)`)}}getSearchPlacesForDir(t,n){return(t.isGlobalConfig?n:this.config.searchPlaces).map(n=>N.default.join(t.path,n))}getGlobalConfigDir(){return(0,S.default)(this.config.moduleName,{suffix:``}).config}*getGlobalDirs(t){let n=N.default.resolve(this.config.stopDir??C.default.homedir());yield{path:t,isGlobalConfig:!1};let S=t;for(;S!==n;){let t=N.default.dirname(S);if(t===S)break;yield{path:t,isGlobalConfig:!1},S=t}yield{path:this.getGlobalConfigDir(),isGlobalConfig:!0}}};t.ExplorerBase=ExplorerBase;function getExtensionDescription(t){return t?`extension "${t}"`:`files without extensions`}})),f_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=void 0,t.mergeAll=mergeAll,t.hasOwn=Function.prototype.call.bind(Object.prototype.hasOwnProperty);let n=Function.prototype.call.bind(Object.prototype.toString);function isPlainObject(t){return n(t)===`[object Object]`}function merge(n,S,C){for(let N of Object.keys(S)){if(N===`__proto__`||N===`constructor`)continue;let F=S[N];if((0,t.hasOwn)(n,N)){if(Array.isArray(n[N])&&Array.isArray(F)){if(C.mergeArrays){n[N].push(...F);continue}}else if(isPlainObject(n[N])&&isPlainObject(F)){n[N]=merge(n[N],F,C);continue}}n[N]=F}return n}function mergeAll(t,n){return t.reduce((t,S)=>merge(t,S,n),{})}})),p_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Explorer=void 0;let S=n((Ed(),__toCommonJS(Cd))),C=n((zn(),__toCommonJS(wn))),N=c_(),F=d_(),I=f_(),H=u_();var Explorer=class extends F.ExplorerBase{async load(t){t=C.default.resolve(t);let load=async()=>await this.config.transform(await this.#e(t));return this.loadCache?await(0,H.emplace)(this.loadCache,t,load):await load()}async search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=await this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=await n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=async()=>{if(await(0,H.isDirectory)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlaces))try{let n=await this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return await this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=await n.next();return t.done?await this.config.transform(null):(F=t.value,this.searchCache?await(0,H.emplace)(this.searchCache,F.path,search):await search())};return this.searchCache?await(0,H.emplace)(this.searchCache,t,search):await search()}async#e(t,n=[]){let C=await S.default.readFile(t,{encoding:`utf-8`});return this.toCosmiconfigResult(t,await this.#t(t,C,n))}async#t(t,n,S){let N=await this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=await Promise.all(q.map(async t=>{let n=C.default.resolve(F,t);return(await this.#e(n,Y))?.config}));return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}async#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=await N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}async#r(t){try{return await S.default.stat(t),!0}catch{return!1}}async*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(await this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}};t.Explorer=Explorer})),m_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerSync=void 0;let S=n((Ud(),__toCommonJS(Vd))),C=n((zn(),__toCommonJS(wn))),N=c_(),F=d_(),I=f_(),H=u_();var ExplorerSync=class extends F.ExplorerBase{load(t){t=C.default.resolve(t);let load=()=>this.config.transform(this.#e(t));return this.loadCache?(0,H.emplace)(this.loadCache,t,load):load()}search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=()=>{if((0,H.isDirectorySync)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlacesSync))try{let n=this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=n.next();return t.done?this.config.transform(null):(F=t.value,this.searchCache?(0,H.emplace)(this.searchCache,F.path,search):search())};return this.searchCache?(0,H.emplace)(this.searchCache,t,search):search()}#e(t,n=[]){let C=S.default.readFileSync(t,`utf8`);return this.toCosmiconfigResult(t,this.#t(t,C,n))}#t(t,n,S){let N=this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=q.map(t=>{let n=C.default.resolve(F,t);return this.#e(n,Y)?.config});return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}#r(t){try{return S.default.statSync(t),!0}catch{return!1}}*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}loadSync(t){return this.load(t)}searchSync(t=``){return this.search(t)}};t.ExplorerSync=ExplorerSync})),h_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=t.getDefaultSearchPlacesSync=t.getDefaultSearchPlaces=void 0,t.cosmiconfig=cosmiconfig;let n=c_();Object.defineProperty(t,"defaultLoaders",{enumerable:!0,get:function(){return n.defaultLoaders}}),Object.defineProperty(t,"defaultLoadersSync",{enumerable:!0,get:function(){return n.defaultLoadersSync}}),Object.defineProperty(t,"getDefaultSearchPlaces",{enumerable:!0,get:function(){return n.getDefaultSearchPlaces}}),Object.defineProperty(t,"getDefaultSearchPlacesSync",{enumerable:!0,get:function(){return n.getDefaultSearchPlacesSync}}),Object.defineProperty(t,"globalConfigSearchPlaces",{enumerable:!0,get:function(){return n.globalConfigSearchPlaces}}),Object.defineProperty(t,"globalConfigSearchPlacesSync",{enumerable:!0,get:function(){return n.globalConfigSearchPlacesSync}});let S=p_(),C=m_(),N=u_(),F=function identity(t){return t};function getUserDefinedOptionsFromMetaConfig(){let t=new C.ExplorerSync({moduleName:`cosmiconfig`,stopDir:process.cwd(),searchPlaces:n.metaSearchPlaces,ignoreEmptySearchPlaces:!1,applyPackagePropertyPathToConfiguration:!0,loaders:n.defaultLoaders,transform:F,cache:!0,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:`none`}).search();if(!t)return null;if(t.config?.loaders)throw Error(`Can not specify loaders in meta config file`);if(t.config?.searchStrategy)throw Error(`Can not specify searchStrategy in meta config file`);let S={mergeSearchPlaces:!0,...t.config??{}};return{config:(0,N.removeUndefinedValuesFromObject)(S),filepath:t.filepath}}function getResolvedSearchPlaces(t,n,S){let C=S.searchPlaces?.map(n=>n.replace(`{name}`,t));return S.mergeSearchPlaces?[...C??[],...n]:C??n}function mergeOptionsBase(t,n,S){let C=getUserDefinedOptionsFromMetaConfig();if(!C)return{...n,...(0,N.removeUndefinedValuesFromObject)(S),loaders:{...n.loaders,...S.loaders}};let F=C.config,I=S.searchPlaces??n.searchPlaces;return{...n,...(0,N.removeUndefinedValuesFromObject)(S),metaConfigFilePath:C.filepath,...F,searchPlaces:getResolvedSearchPlaces(t,I,F),loaders:{...n.loaders,...S.loaders}}}function validateOptions(t){if(t.searchStrategy!=null&&t.searchStrategy!==`global`&&t.stopDir)throw Error('Can not supply `stopDir` option with `searchStrategy` other than "global"')}function mergeOptions(t,S){return validateOptions(S),mergeOptionsBase(t,{moduleName:t,searchPlaces:(0,n.getDefaultSearchPlaces)(t),ignoreEmptySearchPlaces:!0,cache:!0,transform:F,loaders:n.defaultLoaders,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:S.stopDir?`global`:`none`},S)}function cosmiconfig(t,n={}){let C=mergeOptions(t,n),N=new S.Explorer(C);return{search:N.search.bind(N),load:N.load.bind(N),clearLoadCache:N.clearLoadCache.bind(N),clearSearchCache:N.clearSearchCache.bind(N),clearCaches:N.clearCaches.bind(N)}}}));function isBun(){return globalThis.Bun!==void 0}function isDeno(){return globalThis.Deno!==void 0}function isGjs(){return globalThis.imports?.gi!==void 0}function hostRuntime$1(){return isBun()?`bun`:isDeno()?`deno`:isGjs()?`gjs`:`node`}function isNode(){return isBun()||isDeno()||isGjs()?!1:typeof globalThis.process?.versions?.node==`string`}function gjsSystemVersion(){return globalThis.imports?.system?.version}function gjsExit(t){let n=globalThis.imports?.system;return n?.exit?(n.exit(t),!0):!1}var g_=__esmMin(()=>{__name$1(hostRuntime$1,`hostRuntime`)}),__,__exportAll,v_=__esmMin(()=>{__=Object.defineProperty,__exportAll=(t,n)=>{let S={};for(var C in t)__(S,C,{get:t[C],enumerable:!0});return n||__(S,Symbol.toStringTag,{value:`Module`}),S}});function communicateWithTimeout(t,n,S,C){let N={stdout:null,stderr:null,timedOut:!1,error:null},F=_t.MainContext.new(),I=null,H=!1;F.push_thread_default();try{for(t.communicate_async(n,null,(n,S)=>{try{let n=t.communicate_finish(S);N.stdout=n[1]??null,N.stderr=n[2]??null}catch(t){N.error=t}H=!0}),I=_t.timeout_source_new(S),I.set_callback(()=>(N.timedOut=!0,C(),_t.SOURCE_REMOVE)),I.attach(F);!H;)F.iteration(!0)}finally{I!==null&&I.destroy(),F.pop_thread_default()}return N}var y_=__esmMin(()=>{vt()});function defaultShell$1(){return x_===null&&(x_=!_t.file_test(`/bin/sh`,_t.FileTest.IS_EXECUTABLE)&&_t.file_test(`/system/bin/sh`,_t.FileTest.IS_EXECUTABLE)?`/system/bin/sh`:`/bin/sh`),x_}function shellArgv$2(t,n){return[typeof n==`string`&&n.length>0?n:defaultShell$1(),`-c`,t]}function argv0Shell(){return S_===void 0&&(S_=_t.find_program_in_path(`bash`)??_t.find_program_in_path(`zsh`)),S_??defaultShell$1()}function applyArgv0$2(t,n){return[argv0Shell(),`-c`,`exec -a "$0" "$@"`,t,...n]}function detachedPrefix$2(){return C_===void 0&&(C_=_t.find_program_in_path(`setsid`)),C_===null?null:[C_]}function killProcess$4(t,n,S){let C=n??`SIGTERM`;if(C===`SIGKILL`||C===9){t.force_exit();return}let N=typeof C==`number`?C:S[C]??S.SIGTERM;t.send_signal(N)}var b_,x_,S_,C_,w_=__esmMin(()=>{vt(),b_=Object.freeze({SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGFPE:8,SIGKILL:9,SIGSEGV:11,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28}),x_=null,__name$1(defaultShell$1,`defaultShell`),__name$1(shellArgv$2,`shellArgv`),__name$1(applyArgv0$2,`applyArgv0`),__name$1(detachedPrefix$2,`detachedPrefix`),__name$1(killProcess$4,`killProcess`)});function killProcess$3(t,n){killProcess$4(t,n,E_)}var T_,E_,D_=__esmMin(()=>{v_(),w_(),T_=__exportAll({SIGNALS:()=>E_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$3,shellArgv:()=>shellArgv$2}),E_=Object.freeze({...b_,SIGEMT:7,SIGBUS:10,SIGSYS:12,SIGURG:16,SIGSTOP:17,SIGTSTP:18,SIGCONT:19,SIGCHLD:20,SIGTTIN:21,SIGTTOU:22,SIGIO:23,SIGUSR1:30,SIGUSR2:31}),__name$1(killProcess$3,`killProcess`)});function killProcess$2(t,n){killProcess$4(t,n,k_)}var O_,k_,A_=__esmMin(()=>{v_(),w_(),O_=__exportAll({SIGNALS:()=>k_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$2,shellArgv:()=>shellArgv$2}),k_=Object.freeze({...b_,SIGBUS:7,SIGUSR1:10,SIGUSR2:12,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGIO:29,SIGPOLL:29,SIGPWR:30,SIGSYS:31}),__name$1(killProcess$2,`killProcess`)});function defaultShell(){return _t.getenv(`ComSpec`)||`cmd.exe`}function shellArgv$1(t,n){let S=typeof n==`string`&&n.length>0?n:defaultShell();return M_.test(S)?[S,`/d`,`/s`,`/c`,`"${t}"`]:[S,`-c`,t]}function detachedPrefix$1(){return null}function applyArgv0$1(t,n){let S=Error(`options.argv0 (${t}) is not supported on Windows: GSubprocess cannot decouple the executable path from the child's argv[0]`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}function killProcess$1(t,n){t.force_exit()}var j_,M_,N_,P_=__esmMin(()=>{v_(),vt(),j_=__exportAll({SIGNALS:()=>N_,applyArgv0:()=>applyArgv0$1,defaultShell:()=>defaultShell,detachedPrefix:()=>detachedPrefix$1,killProcess:()=>killProcess$1,shellArgv:()=>shellArgv$1}),M_=/^(?:.*\\)?cmd(?:\.exe)?$/i,__name$1(shellArgv$1,`shellArgv`),__name$1(detachedPrefix$1,`detachedPrefix`),__name$1(applyArgv0$1,`applyArgv0`),__name$1(killProcess$1,`killProcess`),N_=Object.freeze({SIGINT:2,SIGKILL:9,SIGTERM:15})});function detectPlatform(){return I_===null&&(I_=_t.get_current_dir().startsWith(`/`)?_t.file_test(`/proc/self/status`,_t.FileTest.EXISTS)?!_t.file_test(`/bin/sh`,_t.FileTest.IS_EXECUTABLE)&&_t.file_test(`/system/bin/sh`,_t.FileTest.IS_EXECUTABLE)?`android`:`linux`:_t.file_test(`/System/Library/CoreServices/SystemVersion.plist`,_t.FileTest.EXISTS)?`darwin`:`posix`:`win32`),I_}function ops(){switch(detectPlatform()){case`win32`:return j_;case`darwin`:return T_;case`linux`:case`android`:return O_;default:return F_}}function shellArgv(t,n){return ops().shellArgv(t,n)}function detachedPrefix(){return ops().detachedPrefix()}function applyArgv0(t,n){return ops().applyArgv0(t,n)}function killProcess(t,n){ops().killProcess(t,n)}var F_,I_,L_=__esmMin(()=>{w_(),D_(),A_(),P_(),vt(),F_={defaultShell:defaultShell$1,shellArgv:shellArgv$2,detachedPrefix:detachedPrefix$2,applyArgv0:applyArgv0$2,killProcess:(t,n)=>killProcess$4(t,n,b_),SIGNALS:b_},I_=null});function _gioErrorToNodeError(t,n,S){let C=t??Error(`Unknown spawn error`),N=C,F=C.code,I=C.matches,H=!1;if(typeof I==`function`)try{H=I.call(C,_t.SpawnError,_t.SpawnError.NOENT)===!0}catch{}if(!H&&F===_t.SpawnError.NOENT&&(H=!0),!H&&typeof C.message==`string`&&/No such file or directory|ENOENT|Failed to execute|nicht gefunden|nicht ausgeführt/i.test(C.message)&&(H=!0),H){let t=Error(`spawn ${n} ENOENT`);return t.code=`ENOENT`,t.errno=-2,t.syscall=`spawn ${n}`,t.path=n,t.spawnargs=S.slice(),t}if(C instanceof Error)return N;let W=C,q=typeof W.message==`string`?W.message:String(C),Y=Error(q);return(typeof F==`number`||typeof F==`string`)&&(Y.code=F),Y}function _normalizeCwd(t){if(t!=null){if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.href==`string`&&typeof t.protocol==`string`){let n=t;if(n.protocol!==`file:`)throw TypeError(`The URL must be of scheme file:; received '${n.protocol}' for 'options.cwd'`);return fileURLToPath(n)}return t instanceof Uint8Array?new TextDecoder().decode(t):String(t)}}function _encodeEnvValue(t){if(t!==void 0)return`${t}`}function _spawnSubprocess(t,n,S){let C=new Si.SubprocessLauncher({flags:n}),N=_normalizeCwd(S?.cwd);if(N!==void 0&&C.set_cwd(N),S?.env){let t=S.env;C.set_environ([]);let n=new Set;for(let S in t){if(n.has(S))continue;n.add(S);let N=_encodeEnvValue(t[S]);N!==void 0&&C.setenv(S,N,!0)}}let F=t;if(S?.argv0!==void 0&&S.argv0!==null){if(typeof S.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof S.argv0}`);F=applyArgv0(S.argv0,t)}if(S?.detached===!0){let t=detachedPrefix();t!==null&&(F=[...t,...F])}let I=C.spawnv(F);return{proc:I,pid:_capturePidAtSpawn(I)}}function _capturePidAtSpawn(t){let n=t.get_identifier();if(n){let t=parseInt(n,10);if(t>0)return t}return 0}function _watchStdioForClose(t){let n=[t.stdout,t.stderr].filter(t=>t!==null);if(n.length===0)return(n,S)=>{t.emit(`exit`,n,S),t.emit(`close`,n,S)};let S=n.length,C=!1,N=null,F=null,closeIfDone=()=>{C&&S===0&&t.emit(`close`,N,F)};for(let t of n){let n=!1,settleOnce=()=>{n||(n=!0,--S,closeIfDone())};t.once(`end`,settleOnce),t.once(`close`,settleOnce)}return(S,I)=>{N=S,F=I,C=!0,t.emit(`exit`,S,I),queueMicrotask(()=>{for(let t of n)t.destroyed||t.readableEnded||t.listenerCount(`data`)>0||t.listenerCount(`readable`)>0||t.resume()}),closeIfDone()}}function _communicateSync(t,n,S,C){if(S<=0){let S=t.communicate(n,null);return{stdout:S[1]??null,stderr:S[2]??null,timedOut:!1}}let N=communicateWithTimeout(t,n,S,()=>{killProcess(t,C??`SIGTERM`)});if(N.error)throw N.error;return{stdout:N.stdout,stderr:N.stderr,timedOut:N.timedOut}}function _syncTimeoutError(t,n,S,C,N){let F=n?gbytesToUint8Array(n):new Uint8Array,I=S?gbytesToUint8Array(S):new Uint8Array,H=new TextDecoder().decode(I),W=Error(`Command failed: ${t}\n${H}`);return W.code=`ETIMEDOUT`,W.killed=!0,W.signal=typeof N==`string`?N:`SIGTERM`,W.status=null,C===`buffer`||C===null?(W.stdout=it.from(F),W.stderr=it.from(I)):(W.stdout=new TextDecoder().decode(F),W.stderr=H),W}function _decodeExecOutput(t,n){let S=t??new Uint8Array;if(n===`buffer`||n===null)return it.from(S);let C=n&&it.isEncoding(n)?n:`utf8`;return it.from(S).toString(C)}function _normalizeKillSignal(t){return t??`SIGTERM`}function _exec(t,n,S){typeof n==`function`&&(S=n,n={});let C=n||{},N=new ChildProcess,F=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE,I=C.maxBuffer??1024*1024,H=C.timeout&&C.timeout>0?C.timeout:0,W=_normalizeKillSignal(C.killSignal),q=C.signal;return _execImpl(N,shellArgv(t,C.shell),F,C,{cmd:t,encoding:C.encoding,maxBuffer:I,timeoutMs:H,killSignal:W,abortSignal:q,callback:S})}function _absorbExecError(){}function _execImpl(t,n,S,C,N){t.on(`error`,_absorbExecError);let F=null,I=!1,H=null,W=null,armTimeout=n=>{N.timeoutMs&&(F=setTimeout(()=>{I=!0;try{killProcess(n,N.killSignal)}catch{}t.killed=!0},N.timeoutMs))},disarmTimeout=()=>{F!==null&&(clearTimeout(F),F=null)},armAbort=n=>{if(!N.abortSignal)return;let fire=()=>{H=Error(`The operation was aborted`),H.name=`AbortError`;try{killProcess(n,N.killSignal)}catch{}t.killed=!0};if(N.abortSignal.aborted){queueMicrotask(fire);return}W=fire,N.abortSignal.addEventListener(`abort`,W,{once:!0})},disarmAbort=()=>{N.abortSignal&&W&&(N.abortSignal.removeEventListener(`abort`,W),W=null)};try{let{proc:F,pid:W}=_spawnSubprocess(n,S,C);t._setSubprocess(F,W),R_.add(t),armTimeout(F),armAbort(F);let q=_watchStdioForClose(t);t._holdProcess(),F.communicate_async(null,null,(n,S)=>{disarmTimeout(),disarmAbort(),R_.delete(t);try{let[,n,C]=F.communicate_finish(S),W=n?gbytesToUint8Array(n):null,Y=C?gbytesToUint8Array(C):null,X=null;N.maxBuffer!==1/0&&W&&W.length>N.maxBuffer&&(W=W.subarray(0,N.maxBuffer),X=RangeError(`stdout maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`),!X&&N.maxBuffer!==1/0&&Y&&Y.length>N.maxBuffer&&(Y=Y.subarray(0,N.maxBuffer),X=RangeError(`stderr maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`);let Z=_decodeExecOutput(W,N.encoding),te=_decodeExecOutput(Y,N.encoding),ne=F.get_if_exited()?F.get_exit_status():null,re=F.get_if_signaled()?typeof N.killSignal==`string`?N.killSignal:`SIGTERM`:null;t.exitCode=ne,t.signalCode=re;let ie=null;if(H)ie=H,ie.killed=!0,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(X)ie=X,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(I)ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.code=null,ie.signal=typeof N.killSignal==`string`?N.killSignal:`SIGTERM`,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(ne!==0&&ne!==null){let n=typeof te==`string`?te:te.toString();ie=Error(`Command failed: ${N.cmd}\n${n}`),ie.code=ne,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd}else re&&(ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.signal=re,ie.code=null,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd);N.callback&&N.callback(ie,Z,te),q(ne,re)}catch(n){let S=n instanceof Error?n:Error(String(n));N.callback&&N.callback(S,``,``),t.emit(`error`,S)}}),queueMicrotask(()=>t.emit(`spawn`))}catch(S){disarmTimeout(),disarmAbort();let C=_gioErrorToNodeError(S,n[0]??``,n.slice(1));setTimeout(()=>{N.callback&&N.callback(C,``,``),t.emit(`error`,C)},0)}return t}function execFile(t,n,S,C){let N=[],F={},I;typeof n==`function`?I=n:Array.isArray(n)?(N=n,typeof S==`function`?I=S:(F=S||{},I=C)):n&&typeof n==`object`&&(F=n,I=typeof S==`function`?S:C);let H=new ChildProcess,W=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE,q=F.maxBuffer??1024*1024,Y=F.timeout&&F.timeout>0?F.timeout:0,X=_normalizeKillSignal(F.killSignal);return _execImpl(H,[t,...N],W,F,{cmd:t,encoding:F.encoding,maxBuffer:q,timeoutMs:Y,killSignal:X,abortSignal:F.signal,callback:I})}function definePromisifiedExec(t){Object.defineProperty(t,Symbol.for(`nodejs.util.promisify.custom`),{enumerable:!1,value:(...n)=>{let S,C=new Promise((C,N)=>{let callback=(t,n,S)=>{t===null?C({stdout:n,stderr:S}):(t.stdout=n,t.stderr=S,N(t))};S=t(...n,callback)});return C.child=S,C}})}function execFileSync(t,n,S){let C=[],N;Array.isArray(n)?(C=n,N=S):n&&typeof n==`object`&&(N=n);let F=N?.encoding,I=N?.input,H=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE|(I?Si.SubprocessFlags.STDIN_PIPE:Si.SubprocessFlags.NONE),W;try{({proc:W}=_spawnSubprocess([t,...C],H,N))}catch(n){throw _gioErrorToNodeError(n,t,C)}let q=I?new _t.Bytes(typeof I==`string`?new TextEncoder().encode(I):I):null,Y=N?.timeout&&N.timeout>0?N.timeout:0,{stdout:X,stderr:Z,timedOut:te}=_communicateSync(W,q,Y,N?.killSignal);if(te)throw _syncTimeoutError(`${t} ${C.join(` `)}`.trim(),X,Z,F,N?.killSignal);let ne=W.get_exit_status();if(ne!==0){let n=Z?new TextDecoder().decode(gbytesToUint8Array(Z)):``,S=X?new TextDecoder().decode(gbytesToUint8Array(X)):``,N=Error(`Command failed: ${t} ${C.join(` `)}`);throw N.status=ne,F===`buffer`||F===null?(N.stderr=Z?it.from(gbytesToUint8Array(Z)):it.alloc(0),N.stdout=X?it.from(gbytesToUint8Array(X)):it.alloc(0)):(N.stderr=n,N.stdout=S),N}if(!X)return F===`buffer`||F==null?it.alloc(0):``;let re=gbytesToUint8Array(X);if(F===`buffer`||F==null)return it.from(re);let ie=it.isEncoding(F)?F:`utf8`;return it.from(re).toString(ie)}function spawn(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=new ChildProcess,H=N?.shell,W;W=H?shellArgv([t,...F].join(` `),H):[t,...F];let q=N?.stdio,Y=Array.isArray(q)?[typeof q[0]==`string`?q[0]:`pipe`,typeof q[1]==`string`?q[1]:`pipe`,typeof q[2]==`string`?q[2]:`pipe`]:typeof q==`string`?[q,q,q]:[`pipe`,`pipe`,`pipe`],X=Si.SubprocessFlags.NONE;Y[0]===`pipe`?X|=Si.SubprocessFlags.STDIN_PIPE:Y[0]===`inherit`&&(X|=Si.SubprocessFlags.STDIN_INHERIT),Y[1]===`pipe`&&(X|=Si.SubprocessFlags.STDOUT_PIPE),Y[1]===`ignore`&&(X|=Si.SubprocessFlags.STDOUT_SILENCE),Y[2]===`pipe`&&(X|=Si.SubprocessFlags.STDERR_PIPE),Y[2]===`ignore`&&(X|=Si.SubprocessFlags.STDERR_SILENCE);try{let{proc:t,pid:n}=_spawnSubprocess(W,X,N);if(I._setSubprocess(t,n),R_.add(I),Y[0]===`pipe`){let n=t.get_stdin_pipe();n&&(I.stdin=new GioOutputStreamWritable(n))}let S=t.get_stdout_pipe();S&&(I.stdout=new GioInputStreamReadable(S));let C=t.get_stderr_pipe();C&&(I.stderr=new GioInputStreamReadable(C));let F=_watchStdioForClose(I);I._holdProcess();let H=N?.signal,q=null,emitAbortError=()=>{let t=N?.killSignal??`SIGTERM`;I.kill(t);let n=Error(`The operation was aborted`);n.name=`AbortError`,I.emit(`error`,n)};H&&(H.aborted?queueMicrotask(emitAbortError):(q=emitAbortError,H.addEventListener(`abort`,q,{once:!0})));let Z=null;if(N?.timeout&&N.timeout>0){let t=N.killSignal??`SIGTERM`;Z=setTimeout(()=>{I.kill(t),Z=null},N.timeout)}t.wait_async(null,(n,S)=>{try{t.wait_finish(S);let n=t.get_if_exited()?t.get_exit_status():null,C=null;if(t.get_if_signaled()){let t=N?.killSignal;C=typeof t==`string`?t:`SIGTERM`}I.exitCode=n,I.signalCode=C,Z!==null&&(clearTimeout(Z),Z=null),H&&q&&H.removeEventListener(`abort`,q),I.stdin&&!I.stdin.destroyed&&I.stdin.destroy(),F(n,C)}catch(t){I.emit(`error`,t instanceof Error?t:Error(String(t)))}R_.delete(I)}),queueMicrotask(()=>I.emit(`spawn`))}catch(n){deferEmit(I,`error`,_gioErrorToNodeError(n,H?t:W[0]??``,H?F:W.slice(1)))}return I}function spawnSync(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=N?.shell,H=N?.input,W;W=I?shellArgv([t,...F].join(` `),I):[t,...F];let q=N?.timeout&&N.timeout>0?N.timeout:0,Y=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE|(H?Si.SubprocessFlags.STDIN_PIPE:Si.SubprocessFlags.NONE),X=H;if(X!=null&&typeof X!=`string`&&!(X instanceof Uint8Array)&&!(X instanceof ArrayBuffer)&&!ArrayBuffer.isView(X))throw TypeError(`The "input" property must be of type string, Buffer, TypedArray, or DataView. Received type ${typeof X}`);let Z=N?.encoding,te=Z===`buffer`||Z==null?it.alloc(0):``,ne,re=0;try{({proc:ne,pid:re}=_spawnSubprocess(W,Y,N))}catch(n){let S=I?t:W[0]??``,C=I?F:W.slice(1);return{pid:0,output:[null,te,te],stdout:te,stderr:te,status:null,signal:null,error:_gioErrorToNodeError(n,S,C)}}let ie=H?new _t.Bytes(typeof H==`string`?new TextEncoder().encode(H):H):null,ae,oe,Q=null,se=!1;try{if(q>0){let t=communicateWithTimeout(ne,ie,q,()=>{killProcess(ne,N?.killSignal??`SIGTERM`)});if(se=t.timedOut,t.error)throw t.error;ae=t.stdout,oe=t.stderr}else{let t=ne.communicate(ie,null);ae=t[1]??null,oe=t[2]??null}}catch(t){Q=t instanceof Error?t:Error(String(t)),ae=null,oe=null}let ce=ae?it.from(gbytesToUint8Array(ae)):it.alloc(0),le=oe?it.from(gbytesToUint8Array(oe)):it.alloc(0),decode=t=>{if(Z===`buffer`||Z==null)return t;let n=it.isEncoding(Z)?Z:`utf8`;return t.toString(n)},ue=decode(ce),de=decode(le),fe=ne.get_if_exited()?ne.get_exit_status():null,pe=null;if(ne.get_if_signaled()){let t=N?.killSignal;pe=typeof t==`string`?t:`SIGTERM`}se&&(pe=typeof N?.killSignal==`string`?N.killSignal:`SIGTERM`);let me={pid:re,output:[null,ue,de],stdout:ue,stderr:de,status:se?null:fe,signal:pe};if(se){let t=Error(`Command failed: ${W.join(` `)}\n${typeof de==`string`?de:de.toString()}`);t.code=`ETIMEDOUT`,t.killed=!0,t.signal=pe,me.error=t}else Q&&(me.error=Q);return me}var GioInputStreamReadable,GioOutputStreamWritable,R_,ChildProcess,z_=__esmMin(()=>{y_(),L_(),vt(),Ci(),tn(),mt(),la(),Xn(),uo(),He(),GioInputStreamReadable=class extends ra{_stream;_cancellable=new Si.Cancellable;constructor(t){super(),this._stream=t}_read(t){this._stream.read_bytes_async(Math.max(t,4096),_t.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{let t=this._stream.read_bytes_finish(n).get_data();!t||t.length===0?this.push(null):this.push(it.from(t))}catch(t){this._cancellable.is_cancelled()||this.destroy(t)}})}_destroy(t,n){this._cancellable.cancel(),n(t)}},GioOutputStreamWritable=class extends ia{_stream;_cancellable=new Si.Cancellable;_closed=!1;constructor(t){super(),this._stream=t}_write(t,n,S){if(this._closed){S(Error(`write after end`));return}let C=typeof t==`string`?it.from(t):t instanceof Uint8Array?t:it.from(t);this._stream.write_bytes_async(new _t.Bytes(C),_t.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{this._stream.write_bytes_finish(n),S()}catch(t){this._cancellable.is_cancelled()?S():S(t)}})}_final(t){if(this._closed){t();return}this._closed=!0;try{this._stream.close(null)}catch{}t()}_destroy(t,n){if(this._cancellable.cancel(),!this._closed){this._closed=!0;try{this._stream.close(null)}catch{}}n(t)}},R_=new Set,ChildProcess=class extends Wt{pid;exitCode=null;signalCode=null;killed=!1;connected=!1;stdin=null;stdout=null;stderr=null;get stdio(){return[this.stdin,this.stdout,this.stderr]}_subprocess=null;_setSubprocess(t,n){this._subprocess=t,n>0&&(this.pid=n)}kill(t){if(!this._subprocess)return!1;try{return killProcess(this._subprocess,t??`SIGTERM`),this.killed=!0,!0}catch{return!1}}_holdsProcess=!1;_closed=!1;_holdProcess(){this.once(`close`,()=>{this._closed=!0,this._dropHold()}),this._acquireHold()}_acquireHold(){this._holdsProcess||this._closed||(this._holdsProcess=!0,acquireMainLoop())}_dropHold(){this._holdsProcess&&(this._holdsProcess=!1,setTimeout(releaseMainLoop,0))}ref(){return this._acquireHold(),this}unref(){return this._dropHold(),this}},definePromisifiedExec(_exec),definePromisifiedExec(execFile)});function lookupEnv(t,n){let S=n.toLowerCase();for(let n of Object.keys(t))if(n.toLowerCase()===S&&t[n]!==void 0)return t[n]}function escapeCmdCommand(t){return t.replace(U_,`^$1`)}function escapeCmdArgument(t,n=!1){let S=`${t}`;return S=S.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),S=S.replace(/(?=(\\+?)?)\1$/,`$1$1`),S=`"${S}"`,S=S.replace(U_,`^$1`),n&&(S=S.replace(U_,`^$1`)),S}function buildCmdExeInvocation(t,n,S=`cmd.exe`){let C=H_.test(t);return{cmd:S,args:[`/d`,`/s`,`/c`,`"${[escapeCmdCommand(t),...n.map(t=>escapeCmdArgument(t,C))].join(` `)}"`],windowsVerbatimArguments:!0}}function isBareName(t){return!t.includes(`/`)&&!t.includes(`\\`)&&!/\.[^.]+$/.test(t)}function findOnPath(t,n){let S=n.platform===`win32`,C=(lookupEnv(n.env,`PATH`)??``).split(S?`;`:`:`).filter(Boolean),N=S&&!/\.[^.\\/]+$/.test(t)?(lookupEnv(n.env,`PATHEXT`)??B_).split(`;`).filter(Boolean):[``];for(let S of C)for(let C of N){let N=n.join(S,t+C);if(n.exists(N))return N}}function resolveWin32Command(t,n,S){if(S.platform!==`win32`||!isBareName(t))return;let C=findOnPath(t,S);if(C)return V_.test(C)?{cmd:C,args:[...n]}:buildCmdExeInvocation(C,n,lookupEnv(S.env,`COMSPEC`)??`cmd.exe`)}var B_,V_,H_,U_,W_=__esmMin(()=>{B_=`.COM;.EXE;.BAT;.CMD`,V_=/\.(?:com|exe)$/i,H_=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,U_=/([()\][%!^"`<>&|;, *?])/g});function resolveEnv(t){if(!t.color)return t.env;let n=t.env??process.env,S=process.env.FORCE_COLOR!==void 0||process.env.NO_COLOR!==void 0?{}:{FORCE_COLOR:`1`};return{...n,...S}}function toSpawnable(t,n,S){return resolveWin32Command(t,n,{platform:process.platform,env:S??process.env,exists:existsSync,join:On})??{cmd:t,args:[...n]}}function mapSpawnError(t,n){return t.code===`ENOENT`&&n.notFound?n.notFound(t):t}function mustBlock(t){return isGjs()&&t.completion===`return`}function spawnToCompletion(t,n,S){let C=resolveEnv(S),N=S.shell?{cmd:t,args:[...n],windowsVerbatimArguments:!1}:toSpawnable(t,n,C);if(mustBlock(S)){let t=spawnSync(N.cmd,N.args,{stdio:[`inherit`,`pipe`,`pipe`],cwd:S.cwd,env:C,shell:S.shell,maxBuffer:S.maxBuffer??G_,windowsVerbatimArguments:N.windowsVerbatimArguments});if(t.error)return Promise.reject(mapSpawnError(t.error,S));if(S.stdio===`capture`)return Promise.resolve({code:t.status,signal:t.signal??null,stdout:String(t.stdout??``),stderr:String(t.stderr??``)});let n=S.stdio===`inherit-stderr`?process.stderr:process.stdout;return t.stdout&&t.stdout.length>0&&n.write(t.stdout),t.stderr&&t.stderr.length>0&&process.stderr.write(t.stderr),Promise.resolve({code:t.status,signal:t.signal??null})}return new Promise((t,n)=>{let F=N,I={cwd:S.cwd,stdio:S.stdio===`pipe`?[`ignore`,`pipe`,`pipe`]:S.stdio===`capture`?[`inherit`,`pipe`,`pipe`]:S.stdio===`inherit-stderr`?[`inherit`,2,2]:`inherit`};S.shell&&(I.shell=!0),C&&(I.env=C),F.windowsVerbatimArguments&&(I.windowsVerbatimArguments=!0);let H=spawn(F.cmd,F.args,I);S.onSpawn?.(H);let W;if(S.stdio===`capture`){let t={stdout:``,stderr:``};W=t,H.stdout?.on(`data`,n=>t.stdout+=String(n)),H.stderr?.on(`data`,n=>t.stderr+=String(n))}H.on(`close`,(n,S)=>{t(W?{code:n,signal:S,...W}:{code:n,signal:S})}),H.on(`error`,t=>{n(mapSpawnError(t,S))})})}function describeExit(t){return t.signal===null?`code ${t.code}`:`signal ${t.signal}`}var G_,K_=__esmMin(()=>{z_(),Ud(),zn(),g_(),W_(),G_=64*1024*1024});function isExampleRuntime(t){return q_.includes(t)}function buildAppForRuntime(t){return J_[t].buildApp}function requiresGjsSystemDeps(t){return buildAppForRuntime(t)===`gjs`}function isRuntimeOnPath(t){let n=toSpawnable(t,[`--version`]),S=spawnSync(n.cmd,n.args,{stdio:`ignore`,timeout:15e3,windowsVerbatimArguments:n.windowsVerbatimArguments});return!S.error&&S.status===0}function isRuntimeAvailable(t){return t===hostRuntime$1()?!0:isRuntimeOnPath(J_[t].probe)}function defaultExampleRuntime(){return isRuntimeAvailable(`gjs`)?`gjs`:hostRuntime$1()}function readDeclaredRuntimes(t){let n=t?.gjsify?.example?.runtimes;return Array.isArray(n)?n.filter(t=>typeof t==`string`&&isExampleRuntime(t)):null}function checkRuntimeSupported(t,n,S){return n===null||n.includes(t)?{ok:!0}:{ok:!1,message:`"${S}" does not support --runtime ${t}.\n Declared runtimes: ${n.length>0?n.join(`, `):`(none)`}.\n Run it on one of the declared runtimes, e.g. --runtime ${n[0]??`gjs`}.`}}var q_,J_,Y_=__esmMin(()=>{z_(),g_(),K_(),q_=[`gjs`,`node`,`bun`,`deno`],J_={gjs:{probe:`gjs`,buildApp:`gjs`,launch:(t,n=[])=>[`gjs`,[`-m`,t,...n]]},node:{probe:`node`,buildApp:`node`,launch:(t,n=[])=>[`node`,[t,...n]]},bun:{probe:`bun`,buildApp:`node`,launch:(t,n=[])=>[`bun`,[t,...n]]},deno:{probe:`deno`,buildApp:`node`,launch:(t,n=[])=>[`deno`,[`run`,`-A`,`--node-modules-dir=manual`,t,...n]]}}});function isSourceDialect(t){return typeof t==`string`&&X_.includes(t)}var X_,Z_,Q_=__esmMin(()=>{X_=[`react-native`],Z_=new Set([`gjs`,`node`])}),$_=__esmMin(()=>{}),ev=__esmMin(()=>{}),tv=__esmMin(()=>{}),nv=__esmMin(()=>{Q_(),$_(),ev(),tv()});function collectPlatformEntries(t){let n=new Set;if(!t||typeof t!=`object`)return n;for(let S of iv)S!==`gjs`&&Object.prototype.hasOwnProperty.call(t,`./${S}`)&&n.add(S);return n}function findScanRoots(){let t=[],n=jn(fileURLToPath(import.meta.url));for(let S=0;S<8;S++){let S=$(n,`packages`);existsSync(S)&&[`node`,`web`,`dom`,`framework`,`infra`].some(t=>existsSync(On(S,t)))&&t.push({kind:`workspace`,dir:S});let C=$(n,`node_modules`,`@gjsify`);existsSync(C)&&t.push({kind:`installed`,dir:C});let N=jn(n);if(N===n)break;n=N}try{let n=$(process.cwd(),`node_modules`,`@gjsify`);existsSync(n)&&t.push({kind:`installed`,dir:n})}catch{}return t}function ingestPackageDirSync(t,n){let S=On(t,`package.json`);if(existsSync(S))try{let C=readFileSync(S,`utf8`),N=JSON.parse(C),F=typeof N.name==`string`?N.name:null,I=N?.gjsify?.runtimes;if(F&&F.startsWith(`@gjsify/`)&&!n.has(F)&&I&&typeof I==`object`){let S={};for(let t of iv){let n=I[t];typeof n==`string`&&rv.has(n)&&(S[t]=n)}let C=existsSync(On(t,`globals.mjs`)),H=collectPlatformEntries(N?.exports);n.set(F,{name:F,dir:t,runtimes:S,hasGlobals:C,platformEntries:H})}}catch{}}function getCacheSync(){if(av)return av;let t=findScanRoots(),n=new Map;if(t.length===0)return av=n,av;function walkWorkspace(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}if(existsSync(On(t,`package.json`))){ingestPackageDirSync(t,n);return}for(let n of S)n.isDirectory()&&(n.name===`node_modules`||n.name===`lib`||n.name===`dist`||n.name.startsWith(`.`)||walkWorkspace(On(t,n.name)))}function walkInstalled(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S)!C.isDirectory()&&!C.isSymbolicLink()||C.name.startsWith(`.`)||ingestPackageDirSync(On(t,C.name),n)}for(let n of t)n.kind===`workspace`?walkWorkspace(n.dir):walkInstalled(n.dir);return av=n,av}function warnOnce(t,n){ov.has(t)||(ov.add(t),ge.warn(`[@gjsify/resolve-npm] ${n}`))}function resolveSlot(t,n){let S=t.runtimes[n];if(!S)return null;switch(S){case`polyfill`:return n!==`gjs`&&t.platformEntries?.has(n)?`${t.name}/${n}`:null;case`partial`:return null;case`native`:return t.hasGlobals?`${t.name}/globals`:(warnOnce(`${t.name}-${n}-native-missing-globals`,`${t.name} declares runtimes.${n}="native" but ships no globals.mjs — resolving it normally for --app ${n} builds.`),null);case`none`:return null;default:return null}}function getDerivedAliasesSync(t){if(!iv.has(t))return{};let n=getCacheSync(),S={};for(let C of n.values()){let n=resolveSlot(C,t);n!==null&&n!==C.name&&(S[C.name]=n)}return S}var rv,iv,av,ov,sv=__esmMin(()=>{_e(),Ed(),Ud(),zn(),Xn(),rv=new Set([`polyfill`,`native`,`partial`,`none`]),iv=new Set([`gjs`,`node`,`browser`,`nativescript`,`react-native`]),av=null,ov=new Set}),cv,lv,uv=__esmMin(()=>{cv={browser:{renderer:`@gjsify/adwaita-web`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,GtkSource:`5`}},nativescript:{renderer:`@gjsify/adwaita-nativescript`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,GtkSource:`5`},specifiers:{GObject:`@gjsify/adwaita-nativescript/gobject`,GtkSource:`@gjsify/gtksource-nativescript/gtksource`}}},lv=Object.freeze(Object.keys(cv))});function withDerivedSlotRouting(t,n){let S=null,materialise=()=>{if(S)return S;let C=getDerivedAliasesSync(n),N={};for(let[n,S]of Object.entries(t))N[n]=Object.prototype.hasOwnProperty.call(C,S)?C[S]:S;return S=N,S};return new Proxy(t,{get:(n,S)=>typeof S==`string`?materialise()[S]:Reflect.get(t,S),has:(t,n)=>Reflect.has(materialise(),n),ownKeys:()=>Reflect.ownKeys(materialise()),getOwnPropertyDescriptor:(t,n)=>Reflect.getOwnPropertyDescriptor(materialise(),n)})}var dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv=__esmMin(()=>{sv(),uv(),dv=`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/web.stream/consumers.stream/promises.string_decoder.sys.test.timers.timers/promises.tls.tty.url.util.util/types.v8.vm.wasi.sqlite.worker_threads.zlib`.split(`.`),fv=[`readable-stream`,`node-fetch`],pv={jsdom:`@gjsify/empty`,"./polling-xhr.node.js":`./polling-xhr.js`,"./websocket.node.js":`./websocket.js`,"./globals.node.js":`./globals.js`},mv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process`,cluster:`@gjsify/cluster`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto`,dgram:`@gjsify/dgram`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns`,"dns/promises":`@gjsify/dns/promises`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs`,"fs/promises":`@gjsify/fs/promises`,http:`@gjsify/http`,http2:`@gjsify/http2`,https:`@gjsify/https`,inspector:`@gjsify/inspector`,module:`@gjsify/module`,net:`@gjsify/net`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/readline`,"readline/promises":`@gjsify/readline/promises`,repl:`@gjsify/repl`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls`,tty:`@gjsify/tty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/v8`,vm:`@gjsify/vm`,wasi:`@gjsify/wasi`,sqlite:`@gjsify/sqlite`,worker_threads:`@gjsify/worker_threads`,zlib:`@gjsify/zlib`,"node-fetch":`@gjsify/fetch`,ws:`@gjsify/ws`,"isomorphic-ws":`@gjsify/websocket`},hv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process/browser`,cluster:`@gjsify/empty`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto/browser`,dgram:`@gjsify/empty`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns/browser`,"dns/promises":`@gjsify/empty`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs/browser`,"fs/promises":`@gjsify/fs/browser/promises`,http:`@gjsify/http/browser`,http2:`@gjsify/empty`,https:`@gjsify/https/browser`,inspector:`@gjsify/empty`,module:`@gjsify/module/browser`,net:`@gjsify/net/browser`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/empty`,"readline/promises":`@gjsify/empty`,repl:`@gjsify/empty`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls/browser`,tty:`@gjsify/empty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/empty`,vm:`@gjsify/vm`,wasi:`@gjsify/empty`,sqlite:`@gjsify/sqlite/browser`,worker_threads:`@gjsify/worker_threads/browser`,zlib:`@gjsify/zlib/browser`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/ws/browser`,"isomorphic-ws":`@gjsify/empty`},gv=withDerivedSlotRouting(hv,`browser`),_v={child_process:`@gjsify/empty`,cluster:`@gjsify/empty`,dgram:`@gjsify/empty`,dns:`@gjsify/empty`,"dns/promises":`@gjsify/empty`,inspector:`@gjsify/empty`,net:`@gjsify/empty`,tls:`@gjsify/empty`,tty:`@gjsify/empty`,http:`@gjsify/empty`,https:`@gjsify/empty`,http2:`@gjsify/empty`,readline:`@gjsify/empty`,repl:`@gjsify/empty`,v8:`@gjsify/empty`,vm:`@gjsify/empty`,worker_threads:`@gjsify/empty`,perf_hooks:`@gjsify/empty`,diagnostics_channel:`@gjsify/empty`,domain:`@gjsify/empty`,sqlite:`@gjsify/empty`,sys:`@gjsify/empty`,zlib:`@gjsify/empty`,assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,module:`@gjsify/module`,crypto:`@gjsify/crypto`,events:`@gjsify/events`,fs:`@gjsify/native-fs-bridge`,"fs/promises":`@gjsify/native-fs-bridge`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,process:`@gjsify/process`,stream:`@gjsify/stream`,"stream/promises":`@gjsify/stream/promises`,"stream/web":`@gjsify/stream/web`,string_decoder:`@gjsify/string_decoder`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,querystring:`@gjsify/querystring`,console:`@gjsify/console`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/empty`,"isomorphic-ws":`@gjsify/empty`},vv={"abort-controller":`@gjsify/abort-controller`,"compression-streams":`@gjsify/compression-streams`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception`,"event-target-shim":`@gjsify/dom-events`,"message-channel":`@gjsify/message-channel`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch`,formdata:`@gjsify/formdata`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/abort-controller/register`,"compression-streams/register":`@gjsify/compression-streams/register`,"dom-events/register":`@gjsify/dom-events/register`,"dom-events/register/event-target":`@gjsify/dom-events/register/event-target`,"dom-events/register/custom-events":`@gjsify/dom-events/register/custom-events`,"dom-events/register/ui-events":`@gjsify/dom-events/register/ui-events`,"dom-events/register/global-event-target":`@gjsify/dom-events/register/global-event-target`,"dom-exception/register":`@gjsify/dom-exception/register`,"message-channel/register":`@gjsify/message-channel/register`,"eventsource/register":`@gjsify/eventsource/register`,"websocket/register":`@gjsify/websocket/register`,"fetch/register":`@gjsify/fetch/register`,"fetch/register/fetch":`@gjsify/fetch/register/fetch`,"fetch/register/xhr":`@gjsify/fetch/register/xhr`,"webcrypto/register":`@gjsify/webcrypto/register`,"web-streams/register":`@gjsify/web-streams/register`,"web-streams/register/readable":`@gjsify/web-streams/register/readable`,"web-streams/register/writable":`@gjsify/web-streams/register/writable`,"web-streams/register/transform":`@gjsify/web-streams/register/transform`,"web-streams/register/text-streams":`@gjsify/web-streams/register/text-streams`,"web-streams/register/queuing":`@gjsify/web-streams/register/queuing`,xmlhttprequest:`@gjsify/fetch`,"xmlhttprequest/register":`@gjsify/fetch/register/xhr`,"@gjsify/xmlhttprequest":`@gjsify/fetch`,"@gjsify/xmlhttprequest/register":`@gjsify/fetch/register/xhr`,domparser:`@gjsify/domparser`,"domparser/register":`@gjsify/domparser/register`,webaudio:`@gjsify/webaudio`,"webaudio/register":`@gjsify/webaudio/register`,gamepad:`@gjsify/gamepad`,"gamepad/register":`@gjsify/gamepad/register`,webrtc:`@gjsify/webrtc`,"webrtc/register":`@gjsify/webrtc/register`,"webrtc/register/peer-connection":`@gjsify/webrtc/register/peer-connection`,"webrtc/register/data-channel":`@gjsify/webrtc/register/data-channel`,"webrtc/register/error":`@gjsify/webrtc/register/error`,"webrtc/register/media":`@gjsify/webrtc/register/media`,"webrtc/register/media-devices":`@gjsify/webrtc/register/media-devices`,webassembly:`@gjsify/webassembly`,"webassembly/register":`@gjsify/webassembly/register`,"webassembly/register/promise":`@gjsify/webassembly/register/promise`},yv={"@gjsify/node-globals":`@gjsify/empty`,"@gjsify/node-globals/register":`@gjsify/empty`,"@gjsify/node-globals/register/process":`@gjsify/empty`,"@gjsify/node-globals/register/buffer":`@gjsify/empty`,"@gjsify/node-globals/register/timers":`@gjsify/empty`,"@gjsify/node-globals/register/encoding":`@gjsify/empty`,"@gjsify/node-globals/register/url":`@gjsify/empty`,"@gjsify/node-globals/register/structured-clone":`@gjsify/empty`,"@gjsify/node-globals/register/microtask":`@gjsify/empty`,"@gjsify/node-globals/register/navigator":`@gjsify/empty`,"@gjsify/web-globals":`@gjsify/empty`,"@gjsify/web-globals/register":`@gjsify/empty`,"@gjsify/web-globals/register/performance":`@gjsify/empty`,"@gjsify/web-globals/register/formdata":`@gjsify/empty`},bv={system:`@gjsify/node-gi/system`,gettext:`@gjsify/node-gi/gettext`,cairo:`@gjsify/node-gi/cairo`},xv={"abort-controller":`@gjsify/abort-controller/globals`,"compression-streams":`@gjsify/compression-streams/globals`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception/globals`,"message-channel":`@gjsify/message-channel/globals`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch/globals`,formdata:`@gjsify/formdata/globals`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto/globals`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket/globals`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/empty`,"compression-streams/register":`@gjsify/empty`,"dom-events/register":`@gjsify/empty`,"dom-events/register/event-target":`@gjsify/empty`,"dom-events/register/custom-events":`@gjsify/empty`,"dom-events/register/ui-events":`@gjsify/empty`,"dom-events/register/global-event-target":`@gjsify/empty`,"dom-exception/register":`@gjsify/empty`,"message-channel/register":`@gjsify/empty`,"eventsource/register":`@gjsify/empty`,"websocket/register":`@gjsify/empty`,"fetch/register":`@gjsify/empty`,"fetch/register/fetch":`@gjsify/empty`,"fetch/register/xhr":`@gjsify/empty`,"webcrypto/register":`@gjsify/empty`,"web-streams/register":`@gjsify/empty`,"web-streams/register/readable":`@gjsify/empty`,"web-streams/register/writable":`@gjsify/empty`,"web-streams/register/transform":`@gjsify/empty`,"web-streams/register/text-streams":`@gjsify/empty`,"web-streams/register/queuing":`@gjsify/empty`,"@gjsify/abort-controller/register":`@gjsify/empty`,"@gjsify/compression-streams/register":`@gjsify/empty`,"@gjsify/dom-events/register":`@gjsify/empty`,"@gjsify/dom-events/register/event-target":`@gjsify/empty`,"@gjsify/dom-events/register/custom-events":`@gjsify/empty`,"@gjsify/dom-events/register/ui-events":`@gjsify/empty`,"@gjsify/dom-events/register/global-event-target":`@gjsify/empty`,"@gjsify/dom-exception/register":`@gjsify/empty`,"@gjsify/message-channel/register":`@gjsify/empty`,"@gjsify/eventsource/register":`@gjsify/empty`,"@gjsify/websocket/register":`@gjsify/empty`,"@gjsify/fetch/register":`@gjsify/empty`,"@gjsify/fetch/register/fetch":`@gjsify/empty`,"@gjsify/fetch/register/xhr":`@gjsify/empty`,"@gjsify/webcrypto/register":`@gjsify/empty`,"@gjsify/web-streams/register":`@gjsify/empty`,"@gjsify/web-streams/register/readable":`@gjsify/empty`,"@gjsify/web-streams/register/writable":`@gjsify/empty`,"@gjsify/web-streams/register/transform":`@gjsify/empty`,"@gjsify/web-streams/register/text-streams":`@gjsify/empty`,"@gjsify/web-streams/register/queuing":`@gjsify/empty`,"@gjsify/dom-elements/register":`@gjsify/empty`,"@gjsify/dom-elements/register/document":`@gjsify/empty`,"@gjsify/dom-elements/register/canvas":`@gjsify/empty`,"@gjsify/dom-elements/register/image":`@gjsify/empty`,"@gjsify/dom-elements/register/observers":`@gjsify/empty`,"@gjsify/dom-elements/register/font-face":`@gjsify/empty`,"@gjsify/dom-elements/register/match-media":`@gjsify/empty`,"@gjsify/dom-elements/register/location":`@gjsify/empty`,"@gjsify/dom-elements/register/navigator":`@gjsify/empty`,"@gjsify/canvas2d/register":`@gjsify/empty`,"@gjsify/iframe/register":`@gjsify/empty`,"@gjsify/webgl/register":`@gjsify/empty`,"@gjsify/buffer/register":`@gjsify/empty`,xmlhttprequest:`@gjsify/empty`,"xmlhttprequest/register":`@gjsify/empty`,"@gjsify/xmlhttprequest":`@gjsify/empty`,"@gjsify/xmlhttprequest/register":`@gjsify/empty`,domparser:`@gjsify/empty`,"domparser/register":`@gjsify/empty`,"@gjsify/domparser/register":`@gjsify/empty`,webaudio:`@gjsify/empty`,"webaudio/register":`@gjsify/empty`,"@gjsify/webaudio/register":`@gjsify/empty`,gamepad:`@gjsify/empty`,"gamepad/register":`@gjsify/empty`,"@gjsify/gamepad/register":`@gjsify/empty`,webrtc:`@gjsify/empty`,"webrtc/register":`@gjsify/empty`,"webrtc/register/peer-connection":`@gjsify/empty`,"webrtc/register/data-channel":`@gjsify/empty`,"webrtc/register/error":`@gjsify/empty`,"webrtc/register/media":`@gjsify/empty`,"webrtc/register/media-devices":`@gjsify/empty`,"@gjsify/webrtc":`@gjsify/empty`,"@gjsify/webrtc/register":`@gjsify/empty`,"@gjsify/webrtc/register/peer-connection":`@gjsify/empty`,"@gjsify/webrtc/register/data-channel":`@gjsify/empty`,"@gjsify/webrtc/register/error":`@gjsify/empty`,"@gjsify/webrtc/register/media":`@gjsify/empty`,"@gjsify/webrtc/register/media-devices":`@gjsify/empty`,webassembly:`@gjsify/webassembly/globals`,"webassembly/register":`@gjsify/empty`,"webassembly/register/promise":`@gjsify/empty`,"@gjsify/webassembly/register":`@gjsify/empty`,"@gjsify/webassembly/register/promise":`@gjsify/empty`}}),setNodeAliasPrefix,getAliasesGeneralForGjs,getAliasesNodeForGjs,getAliasesWebForGjs,getAliasesGeneralForNode,getAliasesGjsForNode,getAliasesWebForNode,getAliasesForGjs,getAliasesForNode,Cv=__esmMin(()=>{Sv(),setNodeAliasPrefix=t=>{for(let n in t){if(n.startsWith(`node:`))continue;let S=`node:${n}`;t[S]||(t[S]=t[n])}return t},getAliasesGeneralForGjs=t=>pv,getAliasesNodeForGjs=t=>setNodeAliasPrefix(mv),getAliasesWebForGjs=t=>vv,getAliasesGeneralForNode=t=>yv,getAliasesGjsForNode=t=>bv,getAliasesWebForNode=t=>xv,getAliasesForGjs=t=>({...getDerivedAliasesSync(`gjs`),...getAliasesGeneralForGjs(t),...getAliasesNodeForGjs(t),...getAliasesWebForGjs(t)}),getAliasesForNode=t=>({...getDerivedAliasesSync(`node`),...getAliasesGeneralForNode(t),...getAliasesGjsForNode(t),...getAliasesWebForNode(t)}),[...dv,...dv.map(t=>`node:${t}`)],[...fv]}),wv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.splitWhen=t.flatten=void 0;function flatten(t){return t.reduce((t,n)=>[].concat(t,n),[])}t.flatten=flatten;function splitWhen(t,n){let S=[[]],C=0;for(let N of t)n(N)?(C++,S[C]=[]):S[C].push(N);return S}t.splitWhen=splitWhen})),Tv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code===`ENOENT`}t.isEnoentCodeError=isEnoentCodeError})),Ev=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDirentFromStats=void 0;var DirentFromStats=class{constructor(t,n){this.name=t,this.isBlockDevice=n.isBlockDevice.bind(n),this.isCharacterDevice=n.isCharacterDevice.bind(n),this.isDirectory=n.isDirectory.bind(n),this.isFIFO=n.isFIFO.bind(n),this.isFile=n.isFile.bind(n),this.isSocket=n.isSocket.bind(n),this.isSymbolicLink=n.isSymbolicLink.bind(n)}};function createDirentFromStats(t,n){return new DirentFromStats(t,n)}t.createDirentFromStats=createDirentFromStats})),Dv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertPosixPathToPattern=t.convertWindowsPathToPattern=t.convertPathToPattern=t.escapePosixPath=t.escapeWindowsPath=t.escape=t.removeLeadingDotSegment=t.makeAbsolute=t.unixify=void 0;let n=(Hg(),__toCommonJS(Pg)),S=(zn(),__toCommonJS(wn)),C=n.platform()===`win32`,N=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,F=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,I=/^\\\\([.?])/,H=/\\(?![!()+@[\]{}])/g;function unixify(t){return t.replace(/\\/g,`/`)}t.unixify=unixify;function makeAbsolute(t,n){return S.resolve(t,n)}t.makeAbsolute=makeAbsolute;function removeLeadingDotSegment(t){if(t.charAt(0)===`.`){let n=t.charAt(1);if(n===`/`||n===`\\`)return t.slice(2)}return t}t.removeLeadingDotSegment=removeLeadingDotSegment,t.escape=C?escapeWindowsPath:escapePosixPath;function escapeWindowsPath(t){return t.replace(F,`\\$2`)}t.escapeWindowsPath=escapeWindowsPath;function escapePosixPath(t){return t.replace(N,`\\$2`)}t.escapePosixPath=escapePosixPath,t.convertPathToPattern=C?convertWindowsPathToPattern:convertPosixPathToPattern;function convertWindowsPathToPattern(t){return escapeWindowsPath(t).replace(I,`//$1`).replace(H,`/`)}t.convertWindowsPathToPattern=convertWindowsPathToPattern;function convertPosixPathToPattern(t){return escapePosixPath(t)}t.convertPosixPathToPattern=convertPosixPathToPattern})),Ov=__commonJSMin(((t,n)=>{
651
+ `)} (same as ${I+1}.)`)}}getSearchPlacesForDir(t,n){return(t.isGlobalConfig?n:this.config.searchPlaces).map(n=>N.default.join(t.path,n))}getGlobalConfigDir(){return(0,S.default)(this.config.moduleName,{suffix:``}).config}*getGlobalDirs(t){let n=N.default.resolve(this.config.stopDir??C.default.homedir());yield{path:t,isGlobalConfig:!1};let S=t;for(;S!==n;){let t=N.default.dirname(S);if(t===S)break;yield{path:t,isGlobalConfig:!1},S=t}yield{path:this.getGlobalConfigDir(),isGlobalConfig:!0}}};t.ExplorerBase=ExplorerBase;function getExtensionDescription(t){return t?`extension "${t}"`:`files without extensions`}})),f_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hasOwn=void 0,t.mergeAll=mergeAll,t.hasOwn=Function.prototype.call.bind(Object.prototype.hasOwnProperty);let n=Function.prototype.call.bind(Object.prototype.toString);function isPlainObject(t){return n(t)===`[object Object]`}function merge(n,S,C){for(let N of Object.keys(S)){if(N===`__proto__`||N===`constructor`)continue;let F=S[N];if((0,t.hasOwn)(n,N)){if(Array.isArray(n[N])&&Array.isArray(F)){if(C.mergeArrays){n[N].push(...F);continue}}else if(isPlainObject(n[N])&&isPlainObject(F)){n[N]=merge(n[N],F,C);continue}}n[N]=F}return n}function mergeAll(t,n){return t.reduce((t,S)=>merge(t,S,n),{})}})),p_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Explorer=void 0;let S=n((Ed(),__toCommonJS(Cd))),C=n((zn(),__toCommonJS(wn))),N=c_(),F=d_(),I=f_(),H=u_();var Explorer=class extends F.ExplorerBase{async load(t){t=C.default.resolve(t);let load=async()=>await this.config.transform(await this.#e(t));return this.loadCache?await(0,H.emplace)(this.loadCache,t,load):await load()}async search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=await this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=await n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=async()=>{if(await(0,H.isDirectory)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlaces))try{let n=await this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return await this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=await n.next();return t.done?await this.config.transform(null):(F=t.value,this.searchCache?await(0,H.emplace)(this.searchCache,F.path,search):await search())};return this.searchCache?await(0,H.emplace)(this.searchCache,t,search):await search()}async#e(t,n=[]){let C=await S.default.readFile(t,{encoding:`utf-8`});return this.toCosmiconfigResult(t,await this.#t(t,C,n))}async#t(t,n,S){let N=await this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=await Promise.all(q.map(async t=>{let n=C.default.resolve(F,t);return(await this.#e(n,Y))?.config}));return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}async#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=await N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}async#r(t){try{return await S.default.stat(t),!0}catch{return!1}}async*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(await this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}};t.Explorer=Explorer})),m_=__commonJSMin((t=>{var n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerSync=void 0;let S=n((Ud(),__toCommonJS(Vd))),C=n((zn(),__toCommonJS(wn))),N=c_(),F=d_(),I=f_(),H=u_();var ExplorerSync=class extends F.ExplorerBase{load(t){t=C.default.resolve(t);let load=()=>this.config.transform(this.#e(t));return this.loadCache?(0,H.emplace)(this.loadCache,t,load):load()}search(t=``){if(this.config.metaConfigFilePath){this.loadingMetaConfig=!0;let t=this.load(this.config.metaConfigFilePath);if(this.loadingMetaConfig=!1,t&&!t.isEmpty)return t}t=C.default.resolve(t);let n=this.#i(t),S=n.next();if(S.done)throw Error(`Could not find any folders to iterate through (start from ${t})`);let F=S.value,search=()=>{if((0,H.isDirectorySync)(F.path))for(let t of this.getSearchPlacesForDir(F,N.globalConfigSearchPlacesSync))try{let n=this.#e(t);if(n!==null&&!(n.isEmpty&&this.config.ignoreEmptySearchPlaces))return this.config.transform(n)}catch(t){if(t.code===`ENOENT`||t.code===`EISDIR`||t.code===`ENOTDIR`||t.code===`EACCES`)continue;throw t}let t=n.next();return t.done?this.config.transform(null):(F=t.value,this.searchCache?(0,H.emplace)(this.searchCache,F.path,search):search())};return this.searchCache?(0,H.emplace)(this.searchCache,t,search):search()}#e(t,n=[]){let C=S.default.readFileSync(t,`utf8`);return this.toCosmiconfigResult(t,this.#t(t,C,n))}#t(t,n,S){let N=this.#n(t,n);if(!N||!(0,I.hasOwn)(N,`$import`))return N;let F=C.default.dirname(t),{$import:H,...W}=N,q=Array.isArray(H)?H:[H],Y=[...S,t];this.validateImports(t,q,Y);let X=q.map(t=>{let n=C.default.resolve(F,t);return this.#e(n,Y)?.config});return(0,I.mergeAll)([...X,W],{mergeArrays:this.config.mergeImportArrays})}#n(t,n){if(n.trim()===``)return;let S=C.default.extname(t),N=this.config.loaders[S||`noExt`]??this.config.loaders.default;if(!N)throw Error(`No loader specified for ${(0,F.getExtensionDescription)(S)}`);try{let F=N(t,n);return C.default.basename(t,S)===`package`?(0,H.getPropertyByPath)(F,this.config.packageProp??this.config.moduleName)??null:F}catch(n){throw n.filepath=t,n}}#r(t){try{return S.default.statSync(t),!0}catch{return!1}}*#i(t){switch(this.config.searchStrategy){case`none`:yield{path:t,isGlobalConfig:!1};return;case`project`:{let n=t;for(;;){yield{path:n,isGlobalConfig:!1};let t=!1;for(let S of[`json`,`yaml`]){let N=C.default.join(n,`package.${S}`);if(this.#r(N)){t=!0;break}}if(t)return;let S=C.default.dirname(n);if(S===n)return;n=S}}case`global`:yield*this.getGlobalDirs(t)}}loadSync(t){return this.load(t)}searchSync(t=``){return this.search(t)}};t.ExplorerSync=ExplorerSync})),h_=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultLoadersSync=t.defaultLoaders=t.globalConfigSearchPlacesSync=t.globalConfigSearchPlaces=t.getDefaultSearchPlacesSync=t.getDefaultSearchPlaces=void 0,t.cosmiconfig=cosmiconfig;let n=c_();Object.defineProperty(t,"defaultLoaders",{enumerable:!0,get:function(){return n.defaultLoaders}}),Object.defineProperty(t,"defaultLoadersSync",{enumerable:!0,get:function(){return n.defaultLoadersSync}}),Object.defineProperty(t,"getDefaultSearchPlaces",{enumerable:!0,get:function(){return n.getDefaultSearchPlaces}}),Object.defineProperty(t,"getDefaultSearchPlacesSync",{enumerable:!0,get:function(){return n.getDefaultSearchPlacesSync}}),Object.defineProperty(t,"globalConfigSearchPlaces",{enumerable:!0,get:function(){return n.globalConfigSearchPlaces}}),Object.defineProperty(t,"globalConfigSearchPlacesSync",{enumerable:!0,get:function(){return n.globalConfigSearchPlacesSync}});let S=p_(),C=m_(),N=u_(),F=function identity(t){return t};function getUserDefinedOptionsFromMetaConfig(){let t=new C.ExplorerSync({moduleName:`cosmiconfig`,stopDir:process.cwd(),searchPlaces:n.metaSearchPlaces,ignoreEmptySearchPlaces:!1,applyPackagePropertyPathToConfiguration:!0,loaders:n.defaultLoaders,transform:F,cache:!0,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:`none`}).search();if(!t)return null;if(t.config?.loaders)throw Error(`Can not specify loaders in meta config file`);if(t.config?.searchStrategy)throw Error(`Can not specify searchStrategy in meta config file`);let S={mergeSearchPlaces:!0,...t.config??{}};return{config:(0,N.removeUndefinedValuesFromObject)(S),filepath:t.filepath}}function getResolvedSearchPlaces(t,n,S){let C=S.searchPlaces?.map(n=>n.replace(`{name}`,t));return S.mergeSearchPlaces?[...C??[],...n]:C??n}function mergeOptionsBase(t,n,S){let C=getUserDefinedOptionsFromMetaConfig();if(!C)return{...n,...(0,N.removeUndefinedValuesFromObject)(S),loaders:{...n.loaders,...S.loaders}};let F=C.config,I=S.searchPlaces??n.searchPlaces;return{...n,...(0,N.removeUndefinedValuesFromObject)(S),metaConfigFilePath:C.filepath,...F,searchPlaces:getResolvedSearchPlaces(t,I,F),loaders:{...n.loaders,...S.loaders}}}function validateOptions(t){if(t.searchStrategy!=null&&t.searchStrategy!==`global`&&t.stopDir)throw Error('Can not supply `stopDir` option with `searchStrategy` other than "global"')}function mergeOptions(t,S){return validateOptions(S),mergeOptionsBase(t,{moduleName:t,searchPlaces:(0,n.getDefaultSearchPlaces)(t),ignoreEmptySearchPlaces:!0,cache:!0,transform:F,loaders:n.defaultLoaders,metaConfigFilePath:null,mergeImportArrays:!0,mergeSearchPlaces:!0,searchStrategy:S.stopDir?`global`:`none`},S)}function cosmiconfig(t,n={}){let C=mergeOptions(t,n),N=new S.Explorer(C);return{search:N.search.bind(N),load:N.load.bind(N),clearLoadCache:N.clearLoadCache.bind(N),clearSearchCache:N.clearSearchCache.bind(N),clearCaches:N.clearCaches.bind(N)}}}));function isBun(){return globalThis.Bun!==void 0}function isDeno(){return globalThis.Deno!==void 0}function isGjs(){return globalThis.imports?.gi!==void 0}function hostRuntime$1(){return isBun()?`bun`:isDeno()?`deno`:isGjs()?`gjs`:`node`}function isNode(){return isBun()||isDeno()||isGjs()?!1:typeof globalThis.process?.versions?.node==`string`}function gjsSystemVersion(){return globalThis.imports?.system?.version}function gjsExit(t){let n=globalThis.imports?.system;return n?.exit?(n.exit(t),!0):!1}var g_=__esmMin(()=>{__name$1(hostRuntime$1,`hostRuntime`)}),__,__exportAll,v_=__esmMin(()=>{__=Object.defineProperty,__exportAll=(t,n)=>{let S={};for(var C in t)__(S,C,{get:t[C],enumerable:!0});return n||__(S,Symbol.toStringTag,{value:`Module`}),S}});function communicateWithTimeout(t,n,S,C){let N={stdout:null,stderr:null,timedOut:!1,error:null},F=_t.MainContext.new(),I=null,H=!1;F.push_thread_default();try{for(t.communicate_async(n,null,(n,S)=>{try{let n=t.communicate_finish(S);N.stdout=n[1]??null,N.stderr=n[2]??null}catch(t){N.error=t}H=!0}),I=_t.timeout_source_new(S),I.set_callback(()=>(N.timedOut=!0,C(),_t.SOURCE_REMOVE)),I.attach(F);!H;)F.iteration(!0)}finally{I!==null&&I.destroy(),F.pop_thread_default()}return N}var y_=__esmMin(()=>{vt()});function defaultShell$1(){return x_===null&&(x_=!_t.file_test(`/bin/sh`,_t.FileTest.IS_EXECUTABLE)&&_t.file_test(`/system/bin/sh`,_t.FileTest.IS_EXECUTABLE)?`/system/bin/sh`:`/bin/sh`),x_}function shellArgv$2(t,n){return[typeof n==`string`&&n.length>0?n:defaultShell$1(),`-c`,t]}function argv0Shell(){return S_===void 0&&(S_=_t.find_program_in_path(`bash`)??_t.find_program_in_path(`zsh`)),S_??defaultShell$1()}function applyArgv0$2(t,n){return[argv0Shell(),`-c`,`exec -a "$0" "$@"`,t,...n]}function detachedPrefix$2(){return C_===void 0&&(C_=_t.find_program_in_path(`setsid`)),C_===null?null:[C_]}function killProcess$4(t,n,S){let C=n??`SIGTERM`;if(C===`SIGKILL`||C===9){t.force_exit();return}let N=typeof C==`number`?C:S[C]??S.SIGTERM;t.send_signal(N)}var b_,x_,S_,C_,w_=__esmMin(()=>{vt(),b_=Object.freeze({SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGFPE:8,SIGKILL:9,SIGSEGV:11,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28}),x_=null,__name$1(defaultShell$1,`defaultShell`),__name$1(shellArgv$2,`shellArgv`),__name$1(applyArgv0$2,`applyArgv0`),__name$1(detachedPrefix$2,`detachedPrefix`),__name$1(killProcess$4,`killProcess`)});function killProcess$3(t,n){killProcess$4(t,n,E_)}var T_,E_,D_=__esmMin(()=>{v_(),w_(),T_=__exportAll({SIGNALS:()=>E_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$3,shellArgv:()=>shellArgv$2}),E_=Object.freeze({...b_,SIGEMT:7,SIGBUS:10,SIGSYS:12,SIGURG:16,SIGSTOP:17,SIGTSTP:18,SIGCONT:19,SIGCHLD:20,SIGTTIN:21,SIGTTOU:22,SIGIO:23,SIGUSR1:30,SIGUSR2:31}),__name$1(killProcess$3,`killProcess`)});function killProcess$2(t,n){killProcess$4(t,n,k_)}var O_,k_,A_=__esmMin(()=>{v_(),w_(),O_=__exportAll({SIGNALS:()=>k_,applyArgv0:()=>applyArgv0$2,defaultShell:()=>defaultShell$1,detachedPrefix:()=>detachedPrefix$2,killProcess:()=>killProcess$2,shellArgv:()=>shellArgv$2}),k_=Object.freeze({...b_,SIGBUS:7,SIGUSR1:10,SIGUSR2:12,SIGCHLD:17,SIGCONT:18,SIGSTOP:19,SIGTSTP:20,SIGTTIN:21,SIGTTOU:22,SIGURG:23,SIGIO:29,SIGPOLL:29,SIGPWR:30,SIGSYS:31}),__name$1(killProcess$2,`killProcess`)});function defaultShell(){return _t.getenv(`ComSpec`)||`cmd.exe`}function shellArgv$1(t,n){let S=typeof n==`string`&&n.length>0?n:defaultShell();return M_.test(S)?[S,`/d`,`/s`,`/c`,`"${t}"`]:[S,`-c`,t]}function detachedPrefix$1(){return null}function applyArgv0$1(t,n){let S=Error(`options.argv0 (${t}) is not supported on Windows: GSubprocess cannot decouple the executable path from the child's argv[0]`);throw S.code=`ERR_UNSUPPORTED_OPERATION`,S}function killProcess$1(t,n){t.force_exit()}var j_,M_,N_,P_=__esmMin(()=>{v_(),vt(),j_=__exportAll({SIGNALS:()=>N_,applyArgv0:()=>applyArgv0$1,defaultShell:()=>defaultShell,detachedPrefix:()=>detachedPrefix$1,killProcess:()=>killProcess$1,shellArgv:()=>shellArgv$1}),M_=/^(?:.*\\)?cmd(?:\.exe)?$/i,__name$1(shellArgv$1,`shellArgv`),__name$1(detachedPrefix$1,`detachedPrefix`),__name$1(applyArgv0$1,`applyArgv0`),__name$1(killProcess$1,`killProcess`),N_=Object.freeze({SIGINT:2,SIGKILL:9,SIGTERM:15})});function detectPlatform(){return I_===null&&(I_=_t.get_current_dir().startsWith(`/`)?_t.file_test(`/proc/self/status`,_t.FileTest.EXISTS)?!_t.file_test(`/bin/sh`,_t.FileTest.IS_EXECUTABLE)&&_t.file_test(`/system/bin/sh`,_t.FileTest.IS_EXECUTABLE)?`android`:`linux`:_t.file_test(`/System/Library/CoreServices/SystemVersion.plist`,_t.FileTest.EXISTS)?`darwin`:`posix`:`win32`),I_}function ops(){switch(detectPlatform()){case`win32`:return j_;case`darwin`:return T_;case`linux`:case`android`:return O_;default:return F_}}function shellArgv(t,n){return ops().shellArgv(t,n)}function detachedPrefix(){return ops().detachedPrefix()}function applyArgv0(t,n){return ops().applyArgv0(t,n)}function killProcess(t,n){ops().killProcess(t,n)}var F_,I_,L_=__esmMin(()=>{w_(),D_(),A_(),P_(),vt(),F_={defaultShell:defaultShell$1,shellArgv:shellArgv$2,detachedPrefix:detachedPrefix$2,applyArgv0:applyArgv0$2,killProcess:(t,n)=>killProcess$4(t,n,b_),SIGNALS:b_},I_=null});function _gioErrorToNodeError(t,n,S){let C=t??Error(`Unknown spawn error`),N=C,F=C.code,I=C.matches,H=!1;if(typeof I==`function`)try{H=I.call(C,_t.SpawnError,_t.SpawnError.NOENT)===!0}catch{}if(!H&&F===_t.SpawnError.NOENT&&(H=!0),!H&&typeof C.message==`string`&&/No such file or directory|ENOENT|Failed to execute|nicht gefunden|nicht ausgeführt/i.test(C.message)&&(H=!0),H){let t=Error(`spawn ${n} ENOENT`);return t.code=`ENOENT`,t.errno=-2,t.syscall=`spawn ${n}`,t.path=n,t.spawnargs=S.slice(),t}if(C instanceof Error)return N;let W=C,q=typeof W.message==`string`?W.message:String(C),Y=Error(q);return(typeof F==`number`||typeof F==`string`)&&(Y.code=F),Y}function _normalizeCwd(t){if(t!=null){if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.href==`string`&&typeof t.protocol==`string`){let n=t;if(n.protocol!==`file:`)throw TypeError(`The URL must be of scheme file:; received '${n.protocol}' for 'options.cwd'`);return fileURLToPath(n)}return t instanceof Uint8Array?new TextDecoder().decode(t):String(t)}}function _encodeEnvValue(t){if(t!==void 0)return`${t}`}function _spawnSubprocess(t,n,S){let C=new Si.SubprocessLauncher({flags:n}),N=_normalizeCwd(S?.cwd);if(N!==void 0&&C.set_cwd(N),S?.env){let t=S.env;C.set_environ([]);let n=new Set;for(let S in t){if(n.has(S))continue;n.add(S);let N=_encodeEnvValue(t[S]);N!==void 0&&C.setenv(S,N,!0)}}let F=t;if(S?.argv0!==void 0&&S.argv0!==null){if(typeof S.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof S.argv0}`);F=applyArgv0(S.argv0,t)}if(S?.detached===!0){let t=detachedPrefix();t!==null&&(F=[...t,...F])}let I=C.spawnv(F);return{proc:I,pid:_capturePidAtSpawn(I)}}function _capturePidAtSpawn(t){let n=t.get_identifier();if(n){let t=parseInt(n,10);if(t>0)return t}return 0}function _watchStdioForClose(t){let n=[t.stdout,t.stderr].filter(t=>t!==null);if(n.length===0)return(n,S)=>{t.emit(`exit`,n,S),t.emit(`close`,n,S)};let S=n.length,C=!1,N=null,F=null,closeIfDone=()=>{C&&S===0&&t.emit(`close`,N,F)};for(let t of n){let n=!1,settleOnce=()=>{n||(n=!0,--S,closeIfDone())};t.once(`end`,settleOnce),t.once(`close`,settleOnce)}return(S,I)=>{N=S,F=I,C=!0,t.emit(`exit`,S,I),queueMicrotask(()=>{for(let t of n)t.destroyed||t.readableEnded||t.listenerCount(`data`)>0||t.listenerCount(`readable`)>0||t.resume()}),closeIfDone()}}function _communicateSync(t,n,S,C){if(S<=0){let S=t.communicate(n,null);return{stdout:S[1]??null,stderr:S[2]??null,timedOut:!1}}let N=communicateWithTimeout(t,n,S,()=>{killProcess(t,C??`SIGTERM`)});if(N.error)throw N.error;return{stdout:N.stdout,stderr:N.stderr,timedOut:N.timedOut}}function _syncTimeoutError(t,n,S,C,N){let F=n?gbytesToUint8Array(n):new Uint8Array,I=S?gbytesToUint8Array(S):new Uint8Array,H=new TextDecoder().decode(I),W=Error(`Command failed: ${t}\n${H}`);return W.code=`ETIMEDOUT`,W.killed=!0,W.signal=typeof N==`string`?N:`SIGTERM`,W.status=null,C===`buffer`||C===null?(W.stdout=it.from(F),W.stderr=it.from(I)):(W.stdout=new TextDecoder().decode(F),W.stderr=H),W}function _decodeExecOutput(t,n){let S=t??new Uint8Array;if(n===`buffer`||n===null)return it.from(S);let C=n&&it.isEncoding(n)?n:`utf8`;return it.from(S).toString(C)}function _normalizeKillSignal(t){return t??`SIGTERM`}function _exec(t,n,S){typeof n==`function`&&(S=n,n={});let C=n||{},N=new ChildProcess,F=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE,I=C.maxBuffer??1024*1024,H=C.timeout&&C.timeout>0?C.timeout:0,W=_normalizeKillSignal(C.killSignal),q=C.signal;return _execImpl(N,shellArgv(t,C.shell),F,C,{cmd:t,encoding:C.encoding,maxBuffer:I,timeoutMs:H,killSignal:W,abortSignal:q,callback:S})}function _absorbExecError(){}function _execImpl(t,n,S,C,N){t.on(`error`,_absorbExecError);let F=null,I=!1,H=null,W=null,armTimeout=n=>{N.timeoutMs&&(F=setTimeout(()=>{I=!0;try{killProcess(n,N.killSignal)}catch{}t.killed=!0},N.timeoutMs))},disarmTimeout=()=>{F!==null&&(clearTimeout(F),F=null)},armAbort=n=>{if(!N.abortSignal)return;let fire=()=>{H=Error(`The operation was aborted`),H.name=`AbortError`;try{killProcess(n,N.killSignal)}catch{}t.killed=!0};if(N.abortSignal.aborted){queueMicrotask(fire);return}W=fire,N.abortSignal.addEventListener(`abort`,W,{once:!0})},disarmAbort=()=>{N.abortSignal&&W&&(N.abortSignal.removeEventListener(`abort`,W),W=null)};try{let{proc:F,pid:W}=_spawnSubprocess(n,S,C);t._setSubprocess(F,W),R_.add(t),armTimeout(F),armAbort(F);let q=_watchStdioForClose(t);t._holdProcess(),F.communicate_async(null,null,(n,S)=>{disarmTimeout(),disarmAbort(),R_.delete(t);try{let[,n,C]=F.communicate_finish(S),W=n?gbytesToUint8Array(n):null,Y=C?gbytesToUint8Array(C):null,X=null;N.maxBuffer!==1/0&&W&&W.length>N.maxBuffer&&(W=W.subarray(0,N.maxBuffer),X=RangeError(`stdout maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`),!X&&N.maxBuffer!==1/0&&Y&&Y.length>N.maxBuffer&&(Y=Y.subarray(0,N.maxBuffer),X=RangeError(`stderr maxBuffer length exceeded`),X.code=`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`);let Z=_decodeExecOutput(W,N.encoding),te=_decodeExecOutput(Y,N.encoding),ne=F.get_if_exited()?F.get_exit_status():null,re=F.get_if_signaled()?typeof N.killSignal==`string`?N.killSignal:`SIGTERM`:null;t.exitCode=ne,t.signalCode=re;let ie=null;if(H)ie=H,ie.killed=!0,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(X)ie=X,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(I)ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.code=null,ie.signal=typeof N.killSignal==`string`?N.killSignal:`SIGTERM`,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd;else if(ne!==0&&ne!==null){let n=typeof te==`string`?te:te.toString();ie=Error(`Command failed: ${N.cmd}\n${n}`),ie.code=ne,ie.killed=t.killed,ie.signal=re,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd}else re&&(ie=Error(`Command failed: ${N.cmd}`),ie.killed=!0,ie.signal=re,ie.code=null,ie.stdout=Z,ie.stderr=te,ie.cmd=N.cmd);N.callback&&N.callback(ie,Z,te),q(ne,re)}catch(n){let S=n instanceof Error?n:Error(String(n));N.callback&&N.callback(S,``,``),t.emit(`error`,S)}}),queueMicrotask(()=>t.emit(`spawn`))}catch(S){disarmTimeout(),disarmAbort();let C=_gioErrorToNodeError(S,n[0]??``,n.slice(1));setTimeout(()=>{N.callback&&N.callback(C,``,``),t.emit(`error`,C)},0)}return t}function execFile(t,n,S,C){let N=[],F={},I;typeof n==`function`?I=n:Array.isArray(n)?(N=n,typeof S==`function`?I=S:(F=S||{},I=C)):n&&typeof n==`object`&&(F=n,I=typeof S==`function`?S:C);let H=new ChildProcess,W=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE,q=F.maxBuffer??1024*1024,Y=F.timeout&&F.timeout>0?F.timeout:0,X=_normalizeKillSignal(F.killSignal);return _execImpl(H,[t,...N],W,F,{cmd:t,encoding:F.encoding,maxBuffer:q,timeoutMs:Y,killSignal:X,abortSignal:F.signal,callback:I})}function definePromisifiedExec(t){Object.defineProperty(t,Symbol.for(`nodejs.util.promisify.custom`),{enumerable:!1,value:(...n)=>{let S,C=new Promise((C,N)=>{let callback=(t,n,S)=>{t===null?C({stdout:n,stderr:S}):(t.stdout=n,t.stderr=S,N(t))};S=t(...n,callback)});return C.child=S,C}})}function execFileSync(t,n,S){let C=[],N;Array.isArray(n)?(C=n,N=S):n&&typeof n==`object`&&(N=n);let F=N?.encoding,I=N?.input,H=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE|(I?Si.SubprocessFlags.STDIN_PIPE:Si.SubprocessFlags.NONE),W;try{({proc:W}=_spawnSubprocess([t,...C],H,N))}catch(n){throw _gioErrorToNodeError(n,t,C)}let q=I?new _t.Bytes(typeof I==`string`?new TextEncoder().encode(I):I):null,Y=N?.timeout&&N.timeout>0?N.timeout:0,{stdout:X,stderr:Z,timedOut:te}=_communicateSync(W,q,Y,N?.killSignal);if(te)throw _syncTimeoutError(`${t} ${C.join(` `)}`.trim(),X,Z,F,N?.killSignal);let ne=W.get_exit_status();if(ne!==0){let n=Z?new TextDecoder().decode(gbytesToUint8Array(Z)):``,S=X?new TextDecoder().decode(gbytesToUint8Array(X)):``,N=Error(`Command failed: ${t} ${C.join(` `)}`);throw N.status=ne,F===`buffer`||F===null?(N.stderr=Z?it.from(gbytesToUint8Array(Z)):it.alloc(0),N.stdout=X?it.from(gbytesToUint8Array(X)):it.alloc(0)):(N.stderr=n,N.stdout=S),N}if(!X)return F===`buffer`||F==null?it.alloc(0):``;let re=gbytesToUint8Array(X);if(F===`buffer`||F==null)return it.from(re);let ie=it.isEncoding(F)?F:`utf8`;return it.from(re).toString(ie)}function spawn(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=new ChildProcess,H=N?.shell,W;W=H?shellArgv([t,...F].join(` `),H):[t,...F];let q=N?.stdio,Y=Array.isArray(q)?[typeof q[0]==`string`?q[0]:`pipe`,typeof q[1]==`string`?q[1]:`pipe`,typeof q[2]==`string`?q[2]:`pipe`]:typeof q==`string`?[q,q,q]:[`pipe`,`pipe`,`pipe`],X=Si.SubprocessFlags.NONE;Y[0]===`pipe`?X|=Si.SubprocessFlags.STDIN_PIPE:Y[0]===`inherit`&&(X|=Si.SubprocessFlags.STDIN_INHERIT),Y[1]===`pipe`&&(X|=Si.SubprocessFlags.STDOUT_PIPE),Y[1]===`ignore`&&(X|=Si.SubprocessFlags.STDOUT_SILENCE),Y[2]===`pipe`&&(X|=Si.SubprocessFlags.STDERR_PIPE),Y[2]===`ignore`&&(X|=Si.SubprocessFlags.STDERR_SILENCE);try{let{proc:t,pid:n}=_spawnSubprocess(W,X,N);if(I._setSubprocess(t,n),R_.add(I),Y[0]===`pipe`){let n=t.get_stdin_pipe();n&&(I.stdin=new GioOutputStreamWritable(n))}let S=t.get_stdout_pipe();S&&(I.stdout=new GioInputStreamReadable(S));let C=t.get_stderr_pipe();C&&(I.stderr=new GioInputStreamReadable(C));let F=_watchStdioForClose(I);I._holdProcess();let H=N?.signal,q=null,emitAbortError=()=>{let t=N?.killSignal??`SIGTERM`;I.kill(t);let n=Error(`The operation was aborted`);n.name=`AbortError`,I.emit(`error`,n)};H&&(H.aborted?queueMicrotask(emitAbortError):(q=emitAbortError,H.addEventListener(`abort`,q,{once:!0})));let Z=null;if(N?.timeout&&N.timeout>0){let t=N.killSignal??`SIGTERM`;Z=setTimeout(()=>{I.kill(t),Z=null},N.timeout)}t.wait_async(null,(n,S)=>{try{t.wait_finish(S);let n=t.get_if_exited()?t.get_exit_status():null,C=null;if(t.get_if_signaled()){let t=N?.killSignal;C=typeof t==`string`?t:`SIGTERM`}I.exitCode=n,I.signalCode=C,Z!==null&&(clearTimeout(Z),Z=null),H&&q&&H.removeEventListener(`abort`,q),I.stdin&&!I.stdin.destroyed&&I.stdin.destroy(),F(n,C)}catch(t){I.emit(`error`,t instanceof Error?t:Error(String(t)))}R_.delete(I)}),queueMicrotask(()=>I.emit(`spawn`))}catch(n){deferEmit(I,`error`,_gioErrorToNodeError(n,H?t:W[0]??``,H?F:W.slice(1)))}return I}function spawnSync(t,n,S){let C,N;if(Array.isArray(n))C=n,N=S;else if(n!=null){if(typeof n!=`object`)throw TypeError(`The "args" argument must be of type object. Received type ${typeof n}`);C=void 0,N=n}else C=void 0,N=n;if(N!=null&&typeof N!=`object`)throw TypeError(`The "options" argument must be of type object. Received type ${typeof N}`);if(N?.argv0!==void 0&&N.argv0!==null&&typeof N.argv0!=`string`)throw TypeError(`The "options.argv0" property must be of type string. Received type ${typeof N.argv0}`);N?.cwd!==void 0&&_normalizeCwd(N.cwd);let F=C||[],I=N?.shell,H=N?.input,W;W=I?shellArgv([t,...F].join(` `),I):[t,...F];let q=N?.timeout&&N.timeout>0?N.timeout:0,Y=Si.SubprocessFlags.STDOUT_PIPE|Si.SubprocessFlags.STDERR_PIPE|(H?Si.SubprocessFlags.STDIN_PIPE:Si.SubprocessFlags.NONE),X=H;if(X!=null&&typeof X!=`string`&&!(X instanceof Uint8Array)&&!(X instanceof ArrayBuffer)&&!ArrayBuffer.isView(X))throw TypeError(`The "input" property must be of type string, Buffer, TypedArray, or DataView. Received type ${typeof X}`);let Z=N?.encoding,te=Z===`buffer`||Z==null?it.alloc(0):``,ne,re=0;try{({proc:ne,pid:re}=_spawnSubprocess(W,Y,N))}catch(n){let S=I?t:W[0]??``,C=I?F:W.slice(1);return{pid:0,output:[null,te,te],stdout:te,stderr:te,status:null,signal:null,error:_gioErrorToNodeError(n,S,C)}}let ie=H?new _t.Bytes(typeof H==`string`?new TextEncoder().encode(H):H):null,ae,oe,Q=null,se=!1;try{if(q>0){let t=communicateWithTimeout(ne,ie,q,()=>{killProcess(ne,N?.killSignal??`SIGTERM`)});if(se=t.timedOut,t.error)throw t.error;ae=t.stdout,oe=t.stderr}else{let t=ne.communicate(ie,null);ae=t[1]??null,oe=t[2]??null}}catch(t){Q=t instanceof Error?t:Error(String(t)),ae=null,oe=null}let ce=ae?it.from(gbytesToUint8Array(ae)):it.alloc(0),le=oe?it.from(gbytesToUint8Array(oe)):it.alloc(0),decode=t=>{if(Z===`buffer`||Z==null)return t;let n=it.isEncoding(Z)?Z:`utf8`;return t.toString(n)},ue=decode(ce),de=decode(le),fe=ne.get_if_exited()?ne.get_exit_status():null,pe=null;if(ne.get_if_signaled()){let t=N?.killSignal;pe=typeof t==`string`?t:`SIGTERM`}se&&(pe=typeof N?.killSignal==`string`?N.killSignal:`SIGTERM`);let me={pid:re,output:[null,ue,de],stdout:ue,stderr:de,status:se?null:fe,signal:pe};if(se){let t=Error(`Command failed: ${W.join(` `)}\n${typeof de==`string`?de:de.toString()}`);t.code=`ETIMEDOUT`,t.killed=!0,t.signal=pe,me.error=t}else Q&&(me.error=Q);return me}var GioInputStreamReadable,GioOutputStreamWritable,R_,ChildProcess,z_=__esmMin(()=>{y_(),L_(),vt(),Ci(),tn(),mt(),la(),Xn(),uo(),He(),GioInputStreamReadable=class extends ra{_stream;_cancellable=new Si.Cancellable;constructor(t){super(),this._stream=t}_read(t){this._stream.read_bytes_async(Math.max(t,4096),_t.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{let t=this._stream.read_bytes_finish(n).get_data();!t||t.length===0?this.push(null):this.push(it.from(t))}catch(t){this._cancellable.is_cancelled()||this.destroy(t)}})}_destroy(t,n){this._cancellable.cancel(),n(t)}},GioOutputStreamWritable=class extends ia{_stream;_cancellable=new Si.Cancellable;_closed=!1;constructor(t){super(),this._stream=t}_write(t,n,S){if(this._closed){S(Error(`write after end`));return}let C=typeof t==`string`?it.from(t):t instanceof Uint8Array?t:it.from(t);this._stream.write_bytes_async(new _t.Bytes(C),_t.PRIORITY_DEFAULT,this._cancellable,(t,n)=>{try{this._stream.write_bytes_finish(n),S()}catch(t){this._cancellable.is_cancelled()?S():S(t)}})}_final(t){if(this._closed){t();return}this._closed=!0;try{this._stream.close(null)}catch{}t()}_destroy(t,n){if(this._cancellable.cancel(),!this._closed){this._closed=!0;try{this._stream.close(null)}catch{}}n(t)}},R_=new Set,ChildProcess=class extends Wt{pid;exitCode=null;signalCode=null;killed=!1;connected=!1;stdin=null;stdout=null;stderr=null;get stdio(){return[this.stdin,this.stdout,this.stderr]}_subprocess=null;_setSubprocess(t,n){this._subprocess=t,n>0&&(this.pid=n)}kill(t){if(!this._subprocess)return!1;try{return killProcess(this._subprocess,t??`SIGTERM`),this.killed=!0,!0}catch{return!1}}_holdsProcess=!1;_closed=!1;_holdProcess(){this.once(`close`,()=>{this._closed=!0,this._dropHold()}),this._acquireHold()}_acquireHold(){this._holdsProcess||this._closed||(this._holdsProcess=!0,acquireMainLoop())}_dropHold(){this._holdsProcess&&(this._holdsProcess=!1,setTimeout(releaseMainLoop,0))}ref(){return this._acquireHold(),this}unref(){return this._dropHold(),this}},definePromisifiedExec(_exec),definePromisifiedExec(execFile)});function lookupEnv(t,n){let S=n.toLowerCase();for(let n of Object.keys(t))if(n.toLowerCase()===S&&t[n]!==void 0)return t[n]}function escapeCmdCommand(t){return t.replace(U_,`^$1`)}function escapeCmdArgument(t,n=!1){let S=`${t}`;return S=S.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),S=S.replace(/(?=(\\+?)?)\1$/,`$1$1`),S=`"${S}"`,S=S.replace(U_,`^$1`),n&&(S=S.replace(U_,`^$1`)),S}function buildCmdExeInvocation(t,n,S=`cmd.exe`){let C=H_.test(t);return{cmd:S,args:[`/d`,`/s`,`/c`,`"${[escapeCmdCommand(t),...n.map(t=>escapeCmdArgument(t,C))].join(` `)}"`],windowsVerbatimArguments:!0}}function isBareName(t){return!t.includes(`/`)&&!t.includes(`\\`)&&!/\.[^.]+$/.test(t)}function findOnPath(t,n){let S=n.platform===`win32`,C=(lookupEnv(n.env,`PATH`)??``).split(S?`;`:`:`).filter(Boolean),N=S&&!/\.[^.\\/]+$/.test(t)?(lookupEnv(n.env,`PATHEXT`)??B_).split(`;`).filter(Boolean):[``];for(let S of C)for(let C of N){let N=n.join(S,t+C);if(n.exists(N))return N}}function resolveWin32Command(t,n,S){if(S.platform!==`win32`||!isBareName(t))return;let C=findOnPath(t,S);if(C)return V_.test(C)?{cmd:C,args:[...n]}:buildCmdExeInvocation(C,n,lookupEnv(S.env,`COMSPEC`)??`cmd.exe`)}var B_,V_,H_,U_,W_=__esmMin(()=>{B_=`.COM;.EXE;.BAT;.CMD`,V_=/\.(?:com|exe)$/i,H_=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,U_=/([()\][%!^"`<>&|;, *?])/g});function resolveEnv(t){if(!t.color)return t.env;let n=t.env??process.env,S=process.env.FORCE_COLOR!==void 0||process.env.NO_COLOR!==void 0?{}:{FORCE_COLOR:`1`};return{...n,...S}}function toSpawnable(t,n,S){return resolveWin32Command(t,n,{platform:process.platform,env:S??process.env,exists:existsSync,join:On})??{cmd:t,args:[...n]}}function mapSpawnError(t,n){return t.code===`ENOENT`&&n.notFound?n.notFound(t):t}function mustBlock(t){return isGjs()&&t.completion===`return`}function spawnToCompletion(t,n,S){let C=resolveEnv(S),N=S.shell?{cmd:t,args:[...n],windowsVerbatimArguments:!1}:toSpawnable(t,n,C);if(mustBlock(S)){let t=spawnSync(N.cmd,N.args,{stdio:[`inherit`,`pipe`,`pipe`],cwd:S.cwd,env:C,shell:S.shell,maxBuffer:S.maxBuffer??G_,windowsVerbatimArguments:N.windowsVerbatimArguments});if(t.error)return Promise.reject(mapSpawnError(t.error,S));if(S.stdio===`capture`)return Promise.resolve({code:t.status,signal:t.signal??null,stdout:String(t.stdout??``),stderr:String(t.stderr??``)});let n=S.stdio===`inherit-stderr`?process.stderr:process.stdout;return t.stdout&&t.stdout.length>0&&n.write(t.stdout),t.stderr&&t.stderr.length>0&&process.stderr.write(t.stderr),Promise.resolve({code:t.status,signal:t.signal??null})}return new Promise((t,n)=>{let F=N,I={cwd:S.cwd,stdio:S.stdio===`pipe`?[`ignore`,`pipe`,`pipe`]:S.stdio===`capture`?[`inherit`,`pipe`,`pipe`]:S.stdio===`inherit-stderr`?[`inherit`,2,2]:`inherit`};S.shell&&(I.shell=!0),C&&(I.env=C),F.windowsVerbatimArguments&&(I.windowsVerbatimArguments=!0);let H=spawn(F.cmd,F.args,I);S.onSpawn?.(H);let W;if(S.stdio===`capture`){let t={stdout:``,stderr:``};W=t,H.stdout?.on(`data`,n=>t.stdout+=String(n)),H.stderr?.on(`data`,n=>t.stderr+=String(n))}H.on(`close`,(n,S)=>{t(W?{code:n,signal:S,...W}:{code:n,signal:S})}),H.on(`error`,t=>{n(mapSpawnError(t,S))})})}function describeExit(t){return t.signal===null?`code ${t.code}`:`signal ${t.signal}`}var G_,K_=__esmMin(()=>{z_(),Ud(),zn(),g_(),W_(),G_=64*1024*1024});function isExampleRuntime(t){return q_.includes(t)}function buildAppForRuntime(t){return J_[t].buildApp}function requiresGjsSystemDeps(t){return buildAppForRuntime(t)===`gjs`}function isRuntimeOnPath(t){let n=toSpawnable(t,[`--version`]),S=spawnSync(n.cmd,n.args,{stdio:`ignore`,timeout:15e3,windowsVerbatimArguments:n.windowsVerbatimArguments});return!S.error&&S.status===0}function isRuntimeAvailable(t){return t===hostRuntime$1()?!0:isRuntimeOnPath(J_[t].probe)}function defaultExampleRuntime(){return isRuntimeAvailable(`gjs`)?`gjs`:hostRuntime$1()}function readDeclaredRuntimes(t){let n=t?.gjsify?.example?.runtimes;return Array.isArray(n)?n.filter(t=>typeof t==`string`&&isExampleRuntime(t)):null}function checkRuntimeSupported(t,n,S){return n===null||n.includes(t)?{ok:!0}:{ok:!1,message:`"${S}" does not support --runtime ${t}.\n Declared runtimes: ${n.length>0?n.join(`, `):`(none)`}.\n Run it on one of the declared runtimes, e.g. --runtime ${n[0]??`gjs`}.`}}var q_,J_,Y_=__esmMin(()=>{z_(),g_(),K_(),q_=[`gjs`,`node`,`bun`,`deno`],J_={gjs:{probe:`gjs`,buildApp:`gjs`,launch:(t,n=[])=>[`gjs`,[`-m`,t,...n]]},node:{probe:`node`,buildApp:`node`,launch:(t,n=[])=>[`node`,[t,...n]]},bun:{probe:`bun`,buildApp:`node`,launch:(t,n=[])=>[`bun`,[t,...n]]},deno:{probe:`deno`,buildApp:`node`,launch:(t,n=[])=>[`deno`,[`run`,`-A`,`--node-modules-dir=manual`,t,...n]]}}});function isSourceDialect(t){return typeof t==`string`&&X_.includes(t)}var X_,Z_,Q_=__esmMin(()=>{X_=[`react-native`],Z_=new Set([`gjs`,`node`])}),$_=__esmMin(()=>{}),ev=__esmMin(()=>{}),tv=__esmMin(()=>{}),nv=__esmMin(()=>{Q_(),$_(),ev(),tv()});function collectPlatformEntries(t){let n=new Set;if(!t||typeof t!=`object`)return n;for(let S of iv)S!==`gjs`&&Object.prototype.hasOwnProperty.call(t,`./${S}`)&&n.add(S);return n}function findScanRoots(){let t=[],n=jn(fileURLToPath(import.meta.url));for(let S=0;S<8;S++){let S=$(n,`packages`);existsSync(S)&&[`node`,`web`,`dom`,`framework`,`infra`].some(t=>existsSync(On(S,t)))&&t.push({kind:`workspace`,dir:S});let C=$(n,`node_modules`,`@gjsify`);existsSync(C)&&t.push({kind:`installed`,dir:C});let N=jn(n);if(N===n)break;n=N}try{let n=$(process.cwd(),`node_modules`,`@gjsify`);existsSync(n)&&t.push({kind:`installed`,dir:n})}catch{}return t}function ingestPackageDirSync(t,n){let S=On(t,`package.json`);if(existsSync(S))try{let C=readFileSync(S,`utf8`),N=JSON.parse(C),F=typeof N.name==`string`?N.name:null,I=N?.gjsify?.runtimes;if(F&&F.startsWith(`@gjsify/`)&&!n.has(F)&&I&&typeof I==`object`){let S={};for(let t of iv){let n=I[t];typeof n==`string`&&rv.has(n)&&(S[t]=n)}let C=existsSync(On(t,`globals.mjs`)),H=collectPlatformEntries(N?.exports);n.set(F,{name:F,dir:t,runtimes:S,hasGlobals:C,platformEntries:H})}}catch{}}function getCacheSync(){if(av)return av;let t=findScanRoots(),n=new Map;if(t.length===0)return av=n,av;function walkWorkspace(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}if(existsSync(On(t,`package.json`))){ingestPackageDirSync(t,n);return}for(let n of S)n.isDirectory()&&(n.name===`node_modules`||n.name===`lib`||n.name===`dist`||n.name.startsWith(`.`)||walkWorkspace(On(t,n.name)))}function walkInstalled(t){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S)!C.isDirectory()&&!C.isSymbolicLink()||C.name.startsWith(`.`)||ingestPackageDirSync(On(t,C.name),n)}for(let n of t)n.kind===`workspace`?walkWorkspace(n.dir):walkInstalled(n.dir);return av=n,av}function warnOnce(t,n){ov.has(t)||(ov.add(t),ge.warn(`[@gjsify/resolve-npm] ${n}`))}function resolveSlot(t,n){let S=t.runtimes[n];if(!S)return null;switch(S){case`polyfill`:return n!==`gjs`&&t.platformEntries?.has(n)?`${t.name}/${n}`:null;case`partial`:return null;case`native`:return t.hasGlobals?`${t.name}/globals`:(warnOnce(`${t.name}-${n}-native-missing-globals`,`${t.name} declares runtimes.${n}="native" but ships no globals.mjs — resolving it normally for --app ${n} builds.`),null);case`none`:return null;default:return null}}function getDerivedAliasesSync(t){if(!iv.has(t))return{};let n=getCacheSync(),S={};for(let C of n.values()){let n=resolveSlot(C,t);n!==null&&n!==C.name&&(S[C.name]=n)}return S}var rv,iv,av,ov,sv=__esmMin(()=>{_e(),Ed(),Ud(),zn(),Xn(),rv=new Set([`polyfill`,`native`,`partial`,`none`]),iv=new Set([`gjs`,`node`,`browser`,`nativescript`,`react-native`]),av=null,ov=new Set}),cv,lv,uv=__esmMin(()=>{cv={browser:{renderer:`@gjsify/adwaita-web`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,Graphene:`1.0`,GtkSource:`5`}},nativescript:{renderer:`@gjsify/adwaita-nativescript`,namespaces:{Adw:`1`,Gtk:`4.0`,GObject:`2.0`,Gio:`2.0`,GLib:`2.0`,Gdk:`4.0`,Graphene:`1.0`,GtkSource:`5`},specifiers:{GObject:`@gjsify/adwaita-nativescript/gobject`,GtkSource:`@gjsify/gtksource-nativescript/gtksource`}}},lv=Object.freeze(Object.keys(cv))});function withDerivedSlotRouting(t,n){let S=null,materialise=()=>{if(S)return S;let C=getDerivedAliasesSync(n),N={};for(let[n,S]of Object.entries(t))N[n]=Object.prototype.hasOwnProperty.call(C,S)?C[S]:S;return S=N,S};return new Proxy(t,{get:(n,S)=>typeof S==`string`?materialise()[S]:Reflect.get(t,S),has:(t,n)=>Reflect.has(materialise(),n),ownKeys:()=>Reflect.ownKeys(materialise()),getOwnPropertyDescriptor:(t,n)=>Reflect.getOwnPropertyDescriptor(materialise(),n)})}var dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv=__esmMin(()=>{sv(),uv(),dv=`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/web.stream/consumers.stream/promises.string_decoder.sys.test.timers.timers/promises.tls.tty.url.util.util/types.v8.vm.wasi.sqlite.worker_threads.zlib`.split(`.`),fv=[`readable-stream`,`node-fetch`],pv={jsdom:`@gjsify/empty`,"./polling-xhr.node.js":`./polling-xhr.js`,"./websocket.node.js":`./websocket.js`,"./globals.node.js":`./globals.js`},mv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process`,cluster:`@gjsify/cluster`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto`,dgram:`@gjsify/dgram`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns`,"dns/promises":`@gjsify/dns/promises`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs`,"fs/promises":`@gjsify/fs/promises`,http:`@gjsify/http`,http2:`@gjsify/http2`,https:`@gjsify/https`,inspector:`@gjsify/inspector`,module:`@gjsify/module`,net:`@gjsify/net`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/readline`,"readline/promises":`@gjsify/readline/promises`,repl:`@gjsify/repl`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls`,tty:`@gjsify/tty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/v8`,vm:`@gjsify/vm`,wasi:`@gjsify/wasi`,sqlite:`@gjsify/sqlite`,worker_threads:`@gjsify/worker_threads`,zlib:`@gjsify/zlib`,"node-fetch":`@gjsify/fetch`,ws:`@gjsify/ws`,"isomorphic-ws":`@gjsify/websocket`},hv={assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert/strict`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,child_process:`@gjsify/child_process/browser`,cluster:`@gjsify/empty`,console:`@gjsify/console`,constants:`@gjsify/constants`,crypto:`@gjsify/crypto/browser`,dgram:`@gjsify/empty`,diagnostics_channel:`@gjsify/diagnostics_channel`,dns:`@gjsify/dns/browser`,"dns/promises":`@gjsify/empty`,domain:`@gjsify/domain`,events:`@gjsify/events`,fs:`@gjsify/fs/browser`,"fs/promises":`@gjsify/fs/browser/promises`,http:`@gjsify/http/browser`,http2:`@gjsify/empty`,https:`@gjsify/https/browser`,inspector:`@gjsify/empty`,module:`@gjsify/module/browser`,net:`@gjsify/net/browser`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,perf_hooks:`@gjsify/perf_hooks`,process:`@gjsify/process`,punycode:`@gjsify/punycode`,querystring:`@gjsify/querystring`,readline:`@gjsify/empty`,"readline/promises":`@gjsify/empty`,repl:`@gjsify/empty`,stream:`@gjsify/stream`,"stream/web":`@gjsify/stream/web`,"stream/consumers":`@gjsify/stream/consumers`,"stream/promises":`@gjsify/stream/promises`,string_decoder:`@gjsify/string_decoder`,sys:`@gjsify/sys`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,tls:`@gjsify/tls/browser`,tty:`@gjsify/empty`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,v8:`@gjsify/empty`,vm:`@gjsify/vm`,wasi:`@gjsify/empty`,sqlite:`@gjsify/sqlite/browser`,worker_threads:`@gjsify/worker_threads/browser`,zlib:`@gjsify/zlib/browser`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/ws/browser`,"isomorphic-ws":`@gjsify/empty`},gv=withDerivedSlotRouting(hv,`browser`),_v={child_process:`@gjsify/empty`,cluster:`@gjsify/empty`,dgram:`@gjsify/empty`,dns:`@gjsify/empty`,"dns/promises":`@gjsify/empty`,inspector:`@gjsify/empty`,net:`@gjsify/empty`,tls:`@gjsify/empty`,tty:`@gjsify/empty`,http:`@gjsify/empty`,https:`@gjsify/empty`,http2:`@gjsify/empty`,readline:`@gjsify/empty`,repl:`@gjsify/empty`,v8:`@gjsify/empty`,vm:`@gjsify/empty`,worker_threads:`@gjsify/empty`,perf_hooks:`@gjsify/empty`,diagnostics_channel:`@gjsify/empty`,domain:`@gjsify/empty`,sqlite:`@gjsify/empty`,sys:`@gjsify/empty`,zlib:`@gjsify/empty`,assert:`@gjsify/assert`,"assert/strict":`@gjsify/assert`,async_hooks:`@gjsify/async_hooks`,buffer:`@gjsify/buffer`,module:`@gjsify/module`,crypto:`@gjsify/crypto`,events:`@gjsify/events`,fs:`@gjsify/native-fs-bridge`,"fs/promises":`@gjsify/native-fs-bridge`,os:`@gjsify/os`,path:`@gjsify/path`,"path/posix":`@gjsify/path/posix`,"path/win32":`@gjsify/path/win32`,process:`@gjsify/process`,stream:`@gjsify/stream`,"stream/promises":`@gjsify/stream/promises`,"stream/web":`@gjsify/stream/web`,string_decoder:`@gjsify/string_decoder`,url:`@gjsify/url`,util:`@gjsify/util`,"util/types":`@gjsify/util/types`,querystring:`@gjsify/querystring`,console:`@gjsify/console`,timers:`@gjsify/timers`,"timers/promises":`@gjsify/timers/promises`,"node-fetch":`@gjsify/empty`,ws:`@gjsify/empty`,"isomorphic-ws":`@gjsify/empty`},vv={"abort-controller":`@gjsify/abort-controller`,"compression-streams":`@gjsify/compression-streams`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception`,"event-target-shim":`@gjsify/dom-events`,"message-channel":`@gjsify/message-channel`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch`,formdata:`@gjsify/formdata`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/abort-controller/register`,"compression-streams/register":`@gjsify/compression-streams/register`,"dom-events/register":`@gjsify/dom-events/register`,"dom-events/register/event-target":`@gjsify/dom-events/register/event-target`,"dom-events/register/custom-events":`@gjsify/dom-events/register/custom-events`,"dom-events/register/ui-events":`@gjsify/dom-events/register/ui-events`,"dom-events/register/global-event-target":`@gjsify/dom-events/register/global-event-target`,"dom-exception/register":`@gjsify/dom-exception/register`,"message-channel/register":`@gjsify/message-channel/register`,"eventsource/register":`@gjsify/eventsource/register`,"websocket/register":`@gjsify/websocket/register`,"fetch/register":`@gjsify/fetch/register`,"fetch/register/fetch":`@gjsify/fetch/register/fetch`,"fetch/register/xhr":`@gjsify/fetch/register/xhr`,"webcrypto/register":`@gjsify/webcrypto/register`,"web-streams/register":`@gjsify/web-streams/register`,"web-streams/register/readable":`@gjsify/web-streams/register/readable`,"web-streams/register/writable":`@gjsify/web-streams/register/writable`,"web-streams/register/transform":`@gjsify/web-streams/register/transform`,"web-streams/register/text-streams":`@gjsify/web-streams/register/text-streams`,"web-streams/register/queuing":`@gjsify/web-streams/register/queuing`,xmlhttprequest:`@gjsify/fetch`,"xmlhttprequest/register":`@gjsify/fetch/register/xhr`,"@gjsify/xmlhttprequest":`@gjsify/fetch`,"@gjsify/xmlhttprequest/register":`@gjsify/fetch/register/xhr`,domparser:`@gjsify/domparser`,"domparser/register":`@gjsify/domparser/register`,webaudio:`@gjsify/webaudio`,"webaudio/register":`@gjsify/webaudio/register`,gamepad:`@gjsify/gamepad`,"gamepad/register":`@gjsify/gamepad/register`,webrtc:`@gjsify/webrtc`,"webrtc/register":`@gjsify/webrtc/register`,"webrtc/register/peer-connection":`@gjsify/webrtc/register/peer-connection`,"webrtc/register/data-channel":`@gjsify/webrtc/register/data-channel`,"webrtc/register/error":`@gjsify/webrtc/register/error`,"webrtc/register/media":`@gjsify/webrtc/register/media`,"webrtc/register/media-devices":`@gjsify/webrtc/register/media-devices`,webassembly:`@gjsify/webassembly`,"webassembly/register":`@gjsify/webassembly/register`,"webassembly/register/promise":`@gjsify/webassembly/register/promise`},yv={"@gjsify/node-globals":`@gjsify/empty`,"@gjsify/node-globals/register":`@gjsify/empty`,"@gjsify/node-globals/register/process":`@gjsify/empty`,"@gjsify/node-globals/register/buffer":`@gjsify/empty`,"@gjsify/node-globals/register/timers":`@gjsify/empty`,"@gjsify/node-globals/register/encoding":`@gjsify/empty`,"@gjsify/node-globals/register/url":`@gjsify/empty`,"@gjsify/node-globals/register/structured-clone":`@gjsify/empty`,"@gjsify/node-globals/register/microtask":`@gjsify/empty`,"@gjsify/node-globals/register/navigator":`@gjsify/empty`,"@gjsify/web-globals":`@gjsify/empty`,"@gjsify/web-globals/register":`@gjsify/empty`,"@gjsify/web-globals/register/performance":`@gjsify/empty`,"@gjsify/web-globals/register/formdata":`@gjsify/empty`},bv={system:`@gjsify/node-gi/system`,gettext:`@gjsify/node-gi/gettext`,cairo:`@gjsify/node-gi/cairo`},xv={"abort-controller":`@gjsify/abort-controller/globals`,"compression-streams":`@gjsify/compression-streams/globals`,"dom-events":`@gjsify/dom-events`,"dom-exception":`@gjsify/dom-exception/globals`,"message-channel":`@gjsify/message-channel/globals`,eventsource:`@gjsify/eventsource`,fetch:`@gjsify/fetch/globals`,formdata:`@gjsify/formdata/globals`,"html-image-element":`@gjsify/html-image-element`,webcrypto:`@gjsify/webcrypto/globals`,webgl:`@gjsify/webgl`,websocket:`@gjsify/websocket/globals`,webstorage:`@gjsify/webstorage`,"abort-controller/register":`@gjsify/empty`,"compression-streams/register":`@gjsify/empty`,"dom-events/register":`@gjsify/empty`,"dom-events/register/event-target":`@gjsify/empty`,"dom-events/register/custom-events":`@gjsify/empty`,"dom-events/register/ui-events":`@gjsify/empty`,"dom-events/register/global-event-target":`@gjsify/empty`,"dom-exception/register":`@gjsify/empty`,"message-channel/register":`@gjsify/empty`,"eventsource/register":`@gjsify/empty`,"websocket/register":`@gjsify/empty`,"fetch/register":`@gjsify/empty`,"fetch/register/fetch":`@gjsify/empty`,"fetch/register/xhr":`@gjsify/empty`,"webcrypto/register":`@gjsify/empty`,"web-streams/register":`@gjsify/empty`,"web-streams/register/readable":`@gjsify/empty`,"web-streams/register/writable":`@gjsify/empty`,"web-streams/register/transform":`@gjsify/empty`,"web-streams/register/text-streams":`@gjsify/empty`,"web-streams/register/queuing":`@gjsify/empty`,"@gjsify/abort-controller/register":`@gjsify/empty`,"@gjsify/compression-streams/register":`@gjsify/empty`,"@gjsify/dom-events/register":`@gjsify/empty`,"@gjsify/dom-events/register/event-target":`@gjsify/empty`,"@gjsify/dom-events/register/custom-events":`@gjsify/empty`,"@gjsify/dom-events/register/ui-events":`@gjsify/empty`,"@gjsify/dom-events/register/global-event-target":`@gjsify/empty`,"@gjsify/dom-exception/register":`@gjsify/empty`,"@gjsify/message-channel/register":`@gjsify/empty`,"@gjsify/eventsource/register":`@gjsify/empty`,"@gjsify/websocket/register":`@gjsify/empty`,"@gjsify/fetch/register":`@gjsify/empty`,"@gjsify/fetch/register/fetch":`@gjsify/empty`,"@gjsify/fetch/register/xhr":`@gjsify/empty`,"@gjsify/webcrypto/register":`@gjsify/empty`,"@gjsify/web-streams/register":`@gjsify/empty`,"@gjsify/web-streams/register/readable":`@gjsify/empty`,"@gjsify/web-streams/register/writable":`@gjsify/empty`,"@gjsify/web-streams/register/transform":`@gjsify/empty`,"@gjsify/web-streams/register/text-streams":`@gjsify/empty`,"@gjsify/web-streams/register/queuing":`@gjsify/empty`,"@gjsify/dom-elements/register":`@gjsify/empty`,"@gjsify/dom-elements/register/document":`@gjsify/empty`,"@gjsify/dom-elements/register/canvas":`@gjsify/empty`,"@gjsify/dom-elements/register/image":`@gjsify/empty`,"@gjsify/dom-elements/register/observers":`@gjsify/empty`,"@gjsify/dom-elements/register/font-face":`@gjsify/empty`,"@gjsify/dom-elements/register/match-media":`@gjsify/empty`,"@gjsify/dom-elements/register/location":`@gjsify/empty`,"@gjsify/dom-elements/register/navigator":`@gjsify/empty`,"@gjsify/canvas2d/register":`@gjsify/empty`,"@gjsify/iframe/register":`@gjsify/empty`,"@gjsify/webgl/register":`@gjsify/empty`,"@gjsify/buffer/register":`@gjsify/empty`,xmlhttprequest:`@gjsify/empty`,"xmlhttprequest/register":`@gjsify/empty`,"@gjsify/xmlhttprequest":`@gjsify/empty`,"@gjsify/xmlhttprequest/register":`@gjsify/empty`,domparser:`@gjsify/empty`,"domparser/register":`@gjsify/empty`,"@gjsify/domparser/register":`@gjsify/empty`,webaudio:`@gjsify/empty`,"webaudio/register":`@gjsify/empty`,"@gjsify/webaudio/register":`@gjsify/empty`,gamepad:`@gjsify/empty`,"gamepad/register":`@gjsify/empty`,"@gjsify/gamepad/register":`@gjsify/empty`,webrtc:`@gjsify/empty`,"webrtc/register":`@gjsify/empty`,"webrtc/register/peer-connection":`@gjsify/empty`,"webrtc/register/data-channel":`@gjsify/empty`,"webrtc/register/error":`@gjsify/empty`,"webrtc/register/media":`@gjsify/empty`,"webrtc/register/media-devices":`@gjsify/empty`,"@gjsify/webrtc":`@gjsify/empty`,"@gjsify/webrtc/register":`@gjsify/empty`,"@gjsify/webrtc/register/peer-connection":`@gjsify/empty`,"@gjsify/webrtc/register/data-channel":`@gjsify/empty`,"@gjsify/webrtc/register/error":`@gjsify/empty`,"@gjsify/webrtc/register/media":`@gjsify/empty`,"@gjsify/webrtc/register/media-devices":`@gjsify/empty`,webassembly:`@gjsify/webassembly/globals`,"webassembly/register":`@gjsify/empty`,"webassembly/register/promise":`@gjsify/empty`,"@gjsify/webassembly/register":`@gjsify/empty`,"@gjsify/webassembly/register/promise":`@gjsify/empty`}}),setNodeAliasPrefix,getAliasesGeneralForGjs,getAliasesNodeForGjs,getAliasesWebForGjs,getAliasesGeneralForNode,getAliasesGjsForNode,getAliasesWebForNode,getAliasesForGjs,getAliasesForNode,Cv=__esmMin(()=>{Sv(),setNodeAliasPrefix=t=>{for(let n in t){if(n.startsWith(`node:`))continue;let S=`node:${n}`;t[S]||(t[S]=t[n])}return t},getAliasesGeneralForGjs=t=>pv,getAliasesNodeForGjs=t=>setNodeAliasPrefix(mv),getAliasesWebForGjs=t=>vv,getAliasesGeneralForNode=t=>yv,getAliasesGjsForNode=t=>bv,getAliasesWebForNode=t=>xv,getAliasesForGjs=t=>({...getDerivedAliasesSync(`gjs`),...getAliasesGeneralForGjs(t),...getAliasesNodeForGjs(t),...getAliasesWebForGjs(t)}),getAliasesForNode=t=>({...getDerivedAliasesSync(`node`),...getAliasesGeneralForNode(t),...getAliasesGjsForNode(t),...getAliasesWebForNode(t)}),[...dv,...dv.map(t=>`node:${t}`)],[...fv]}),wv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.splitWhen=t.flatten=void 0;function flatten(t){return t.reduce((t,n)=>[].concat(t,n),[])}t.flatten=flatten;function splitWhen(t,n){let S=[[]],C=0;for(let N of t)n(N)?(C++,S[C]=[]):S[C].push(N);return S}t.splitWhen=splitWhen})),Tv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEnoentCodeError=void 0;function isEnoentCodeError(t){return t.code===`ENOENT`}t.isEnoentCodeError=isEnoentCodeError})),Ev=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDirentFromStats=void 0;var DirentFromStats=class{constructor(t,n){this.name=t,this.isBlockDevice=n.isBlockDevice.bind(n),this.isCharacterDevice=n.isCharacterDevice.bind(n),this.isDirectory=n.isDirectory.bind(n),this.isFIFO=n.isFIFO.bind(n),this.isFile=n.isFile.bind(n),this.isSocket=n.isSocket.bind(n),this.isSymbolicLink=n.isSymbolicLink.bind(n)}};function createDirentFromStats(t,n){return new DirentFromStats(t,n)}t.createDirentFromStats=createDirentFromStats})),Dv=__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertPosixPathToPattern=t.convertWindowsPathToPattern=t.convertPathToPattern=t.escapePosixPath=t.escapeWindowsPath=t.escape=t.removeLeadingDotSegment=t.makeAbsolute=t.unixify=void 0;let n=(Hg(),__toCommonJS(Pg)),S=(zn(),__toCommonJS(wn)),C=n.platform()===`win32`,N=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,F=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,I=/^\\\\([.?])/,H=/\\(?![!()+@[\]{}])/g;function unixify(t){return t.replace(/\\/g,`/`)}t.unixify=unixify;function makeAbsolute(t,n){return S.resolve(t,n)}t.makeAbsolute=makeAbsolute;function removeLeadingDotSegment(t){if(t.charAt(0)===`.`){let n=t.charAt(1);if(n===`/`||n===`\\`)return t.slice(2)}return t}t.removeLeadingDotSegment=removeLeadingDotSegment,t.escape=C?escapeWindowsPath:escapePosixPath;function escapeWindowsPath(t){return t.replace(F,`\\$2`)}t.escapeWindowsPath=escapeWindowsPath;function escapePosixPath(t){return t.replace(N,`\\$2`)}t.escapePosixPath=escapePosixPath,t.convertPathToPattern=C?convertWindowsPathToPattern:convertPosixPathToPattern;function convertWindowsPathToPattern(t){return escapeWindowsPath(t).replace(I,`//$1`).replace(H,`/`)}t.convertWindowsPathToPattern=convertWindowsPathToPattern;function convertPosixPathToPattern(t){return escapePosixPath(t)}t.convertPosixPathToPattern=convertPosixPathToPattern})),Ov=__commonJSMin(((t,n)=>{
652
652
  /*!
653
653
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
654
654
  *
@@ -696,7 +696,7 @@ Defaulting to 2020, but this will stop working in the future.`)),n.ecmaVersion=1
696
696
  `;break;default:t+=String.fromCharCode(S);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),n=this.pos}else++this.pos}},Hx.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(pb.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
697
697
  `&&++this.pos;case`
698
698
  `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},Hx.readEscapedChar=function(t){var n=this.input.charCodeAt(++this.pos);switch(++this.pos,n){case 110:return`
699
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),t){var S=this.pos-1;this.invalidStringToken(S,`Invalid escape sequence in template string`)}default:if(n>=48&&n<=55){var C=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],N=parseInt(C,8);return N>255&&(C=C.slice(0,-1),N=parseInt(C,8)),this.pos+=C.length-1,n=this.input.charCodeAt(this.pos),(C!==`0`||n===56||n===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-C.length,t?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(N)}return isNewLine(n)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(n)}},Hx.readHexChar=function(t){var n=this.pos,S=this.readInt(16,t);return S===null&&this.invalidStringToken(n,`Bad character escape sequence`),S},Hx.readWord1=function(){this.containsEsc=!1;for(var t=``,n=!0,S=this.pos,C=this.options.ecmaVersion>=6;this.pos<this.input.length;){var N=this.fullCharCodeAtPos();if(isIdentifierChar(N,C))this.pos+=N<=65535?1:2;else if(N===92){this.containsEsc=!0,t+=this.input.slice(S,this.pos);var F=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var I=this.readCodePoint();(n?isIdentifierStart:isIdentifierChar)(I,C)||this.invalidStringToken(F,`Invalid Unicode escape`),t+=codePointToString(I),S=this.pos}else break;n=!1}return t+this.input.slice(S,this.pos)},Hx.readWord=function(){var t=this.readWord1(),n=pb.name;return this.keywords.test(t)&&(n=fb[t]),this.finishToken(n,t)},Wx=`8.17.0`,qb.acorn={Parser:qb,version:Wx,defaultOptions:Db,Position:Tb,SourceLocation:Eb,getLineInfo,Node:mx,TokenType:lb,tokTypes:pb,keywordTypes:fb,TokContext:ox,tokContexts:sx,isIdentifierChar,isIdentifierStart,Token:Vx,isNewLine,lineBreak:mb,lineBreakG:hb,nonASCIIwhitespace:gb},__name$1(parse$2,`parse`)});function simple(t,n,S,C,N){S||=Kx,(function c(t,C,N){var F=N||t.type;visitNode$1(S,F,t,C,c),n[F]&&n[F](t,C)})(t,C,N)}function ancestor(t,n,S,C,N){var F=[];S||=Kx,(function c(t,C,N){var I=N||t.type,H=t!==F[F.length-1];H&&F.push(t),visitNode$1(S,I,t,C,c),n[I]&&n[I](t,C||F,F),H&&F.pop()})(t,C,N)}function full(t,n,S,C,N){S||=Kx;var F;(function c(t,C,N){var I=N||t.type;visitNode$1(S,I,t,C,c),F!==t&&(n(t,C,I),F=t)})(t,C,N)}function skipThrough(t,n,S){S(t,n)}function ignore(t,n,S){}function visitNode$1(t,n,S,C,N){if(t[n]==null)throw Error(`No walker function defined for node type `+n);t[n](S,C,N)}var Kx,qx=__esmMin(()=>{__name$1(visitNode$1,`visitNode`),Kx={},Kx.Program=Kx.BlockStatement=Kx.StaticBlock=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},Kx.Statement=skipThrough,Kx.EmptyStatement=ignore,Kx.ExpressionStatement=Kx.ParenthesizedExpression=Kx.ChainExpression=function(t,n,S){return S(t.expression,n,`Expression`)},Kx.IfStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Statement`),t.alternate&&S(t.alternate,n,`Statement`)},Kx.LabeledStatement=function(t,n,S){return S(t.body,n,`Statement`)},Kx.BreakStatement=Kx.ContinueStatement=ignore,Kx.WithStatement=function(t,n,S){S(t.object,n,`Expression`),S(t.body,n,`Statement`)},Kx.SwitchStatement=function(t,n,S){S(t.discriminant,n,`Expression`);for(var C=0,N=t.cases;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.SwitchCase=function(t,n,S){t.test&&S(t.test,n,`Expression`);for(var C=0,N=t.consequent;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},Kx.ReturnStatement=Kx.YieldExpression=Kx.AwaitExpression=function(t,n,S){t.argument&&S(t.argument,n,`Expression`)},Kx.ThrowStatement=Kx.SpreadElement=function(t,n,S){return S(t.argument,n,`Expression`)},Kx.TryStatement=function(t,n,S){S(t.block,n,`Statement`),t.handler&&S(t.handler,n),t.finalizer&&S(t.finalizer,n,`Statement`)},Kx.CatchClause=function(t,n,S){t.param&&S(t.param,n,`Pattern`),S(t.body,n,`Statement`)},Kx.WhileStatement=Kx.DoWhileStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.body,n,`Statement`)},Kx.ForStatement=function(t,n,S){t.init&&S(t.init,n,`ForInit`),t.test&&S(t.test,n,`Expression`),t.update&&S(t.update,n,`Expression`),S(t.body,n,`Statement`)},Kx.ForInStatement=Kx.ForOfStatement=function(t,n,S){S(t.left,n,`ForInit`),S(t.right,n,`Expression`),S(t.body,n,`Statement`)},Kx.ForInit=function(t,n,S){t.type===`VariableDeclaration`?S(t,n):S(t,n,`Expression`)},Kx.DebuggerStatement=ignore,Kx.FunctionDeclaration=function(t,n,S){return S(t,n,`Function`)},Kx.VariableDeclaration=function(t,n,S){for(var C=0,N=t.declarations;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.VariableDeclarator=function(t,n,S){S(t.id,n,`Pattern`),t.init&&S(t.init,n,`Expression`)},Kx.Function=function(t,n,S){t.id&&S(t.id,n,`Pattern`);for(var C=0,N=t.params;C<N.length;C+=1){var F=N[C];S(F,n,`Pattern`)}S(t.body,n,t.expression?`Expression`:`Statement`)},Kx.Pattern=function(t,n,S){t.type===`Identifier`?S(t,n,`VariablePattern`):t.type===`MemberExpression`?S(t,n,`MemberPattern`):S(t,n)},Kx.VariablePattern=ignore,Kx.MemberPattern=skipThrough,Kx.RestElement=function(t,n,S){return S(t.argument,n,`Pattern`)},Kx.ArrayPattern=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Pattern`)}},Kx.ObjectPattern=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];F.type===`Property`?(F.computed&&S(F.key,n,`Expression`),S(F.value,n,`Pattern`)):F.type===`RestElement`&&S(F.argument,n,`Pattern`)}},Kx.Expression=skipThrough,Kx.ThisExpression=Kx.Super=Kx.MetaProperty=ignore,Kx.ArrayExpression=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Expression`)}},Kx.ObjectExpression=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.FunctionExpression=Kx.ArrowFunctionExpression=Kx.FunctionDeclaration,Kx.SequenceExpression=function(t,n,S){for(var C=0,N=t.expressions;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},Kx.TemplateLiteral=function(t,n,S){for(var C=0,N=t.quasis;C<N.length;C+=1){var F=N[C];S(F,n)}for(var I=0,H=t.expressions;I<H.length;I+=1){var W=H[I];S(W,n,`Expression`)}},Kx.TemplateElement=ignore,Kx.UnaryExpression=Kx.UpdateExpression=function(t,n,S){S(t.argument,n,`Expression`)},Kx.BinaryExpression=Kx.LogicalExpression=function(t,n,S){S(t.left,n,`Expression`),S(t.right,n,`Expression`)},Kx.AssignmentExpression=Kx.AssignmentPattern=function(t,n,S){S(t.left,n,`Pattern`),S(t.right,n,`Expression`)},Kx.ConditionalExpression=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Expression`),S(t.alternate,n,`Expression`)},Kx.NewExpression=Kx.CallExpression=function(t,n,S){if(S(t.callee,n,`Expression`),t.arguments)for(var C=0,N=t.arguments;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},Kx.MemberExpression=function(t,n,S){S(t.object,n,`Expression`),t.computed&&S(t.property,n,`Expression`)},Kx.ExportNamedDeclaration=Kx.ExportDefaultDeclaration=function(t,n,S){if(t.declaration&&S(t.declaration,n,t.type===`ExportNamedDeclaration`||t.declaration.id?`Statement`:`Expression`),t.source&&S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.ExportAllDeclaration=function(t,n,S){if(t.exported&&S(t.exported,n),S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.ImportAttribute=function(t,n,S){S(t.value,n,`Expression`)},Kx.ImportDeclaration=function(t,n,S){for(var C=0,N=t.specifiers;C<N.length;C+=1){var F=N[C];S(F,n)}if(S(t.source,n,`Expression`),t.attributes)for(var I=0,H=t.attributes;I<H.length;I+=1){var W=H[I];S(W,n)}},Kx.ImportExpression=function(t,n,S){S(t.source,n,`Expression`),t.options&&S(t.options,n,`Expression`)},Kx.ImportSpecifier=Kx.ImportDefaultSpecifier=Kx.ImportNamespaceSpecifier=Kx.Identifier=Kx.PrivateIdentifier=Kx.Literal=ignore,Kx.TaggedTemplateExpression=function(t,n,S){S(t.tag,n,`Expression`),S(t.quasi,n,`Expression`)},Kx.ClassDeclaration=Kx.ClassExpression=function(t,n,S){return S(t,n,`Class`)},Kx.Class=function(t,n,S){t.id&&S(t.id,n,`Pattern`),t.superClass&&S(t.superClass,n,`Expression`),S(t.body,n)},Kx.ClassBody=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.MethodDefinition=Kx.PropertyDefinition=Kx.Property=function(t,n,S){t.computed&&S(t.key,n,`Expression`),t.value&&S(t.value,n,`Expression`)}}),Jx,Yx,Xx,Zx,Qx=__esmMin(()=>{Jx={node:[`Buffer`,`Blob`,`File`,`process`,`setImmediate`,`clearImmediate`,`queueMicrotask`,`structuredClone`,`btoa`,`atob`,`URL`,`URLSearchParams`,`navigator`],web:`self.fetch.Headers.Request.Response.FormData.ReadableStream.WritableStream.TransformStream.ReadableStreamBYOBReader.ReadableStreamBYOBRequest.ReadableByteStreamController.ReadableStreamDefaultController.ReadableStreamDefaultReader.TextEncoderStream.TextDecoderStream.ByteLengthQueuingStrategy.CountQueuingStrategy.CompressionStream.DecompressionStream.crypto.AbortController.AbortSignal.MessageChannel.MessagePort.Event.EventTarget.CustomEvent.MessageEvent.ErrorEvent.CloseEvent.ProgressEvent.UIEvent.MouseEvent.PointerEvent.KeyboardEvent.WheelEvent.FocusEvent.addEventListener.removeEventListener.dispatchEvent.EventSource.WebSocket.WebAssembly.DOMException.performance.PerformanceObserver.XMLHttpRequest.XMLHttpRequestUpload.DOMParser.AudioContext.webkitAudioContext.Audio.HTMLAudioElement.GamepadEvent.MediaDevices.RTCPeerConnection.RTCSessionDescription.RTCIceCandidate.RTCPeerConnectionIceEvent.RTCDataChannel.RTCDataChannelEvent.RTCError.RTCErrorEvent.MediaStream.MediaStreamTrack.RTCTrackEvent`.split(`.`),dom:[`document`,`Image`,`HTMLCanvasElement`,`HTMLImageElement`,`HTMLElement`,`MutationObserver`,`ResizeObserver`,`IntersectionObserver`,`FontFace`,`matchMedia`,`location`]},Yx={Buffer:`@gjsify/node-globals/register/buffer`,process:`@gjsify/node-globals/register/process`,setTimeout:`@gjsify/node-globals/register/timers`,setInterval:`@gjsify/node-globals/register/timers`,clearTimeout:`@gjsify/node-globals/register/timers`,clearInterval:`@gjsify/node-globals/register/timers`,setImmediate:`@gjsify/node-globals/register/timers`,clearImmediate:`@gjsify/node-globals/register/timers`,queueMicrotask:`@gjsify/node-globals/register/microtask`,structuredClone:`@gjsify/node-globals/register/structured-clone`,btoa:`@gjsify/node-globals/register/encoding`,atob:`@gjsify/node-globals/register/encoding`,navigator:`@gjsify/node-globals/register/navigator`,Navigator:`@gjsify/node-globals/register/navigator`,URL:`@gjsify/node-globals/register/url`,URLSearchParams:`@gjsify/node-globals/register/url`,Blob:`@gjsify/buffer/register`,File:`@gjsify/buffer/register`,fetch:`fetch/register/fetch`,Headers:`fetch/register/fetch`,Request:`fetch/register/fetch`,Response:`fetch/register/fetch`,FormData:`@gjsify/web-globals/register/formdata`,self:`@gjsify/web-globals/register/self`,ReadableStream:`web-streams/register/readable`,ReadableStreamBYOBReader:`web-streams/register/readable`,ReadableStreamBYOBRequest:`web-streams/register/readable`,ReadableByteStreamController:`web-streams/register/readable`,ReadableStreamDefaultController:`web-streams/register/readable`,ReadableStreamDefaultReader:`web-streams/register/readable`,WritableStream:`web-streams/register/writable`,TransformStream:`web-streams/register/transform`,TextEncoderStream:`web-streams/register/text-streams`,TextDecoderStream:`web-streams/register/text-streams`,ByteLengthQueuingStrategy:`web-streams/register/queuing`,CountQueuingStrategy:`web-streams/register/queuing`,CompressionStream:`compression-streams/register`,DecompressionStream:`compression-streams/register`,crypto:`webcrypto/register`,AbortController:`abort-controller/register`,AbortSignal:`abort-controller/register`,MessageChannel:`message-channel/register`,MessagePort:`message-channel/register`,Event:`dom-events/register/event-target`,EventTarget:`dom-events/register/event-target`,CustomEvent:`dom-events/register/custom-events`,MessageEvent:`dom-events/register/custom-events`,ErrorEvent:`dom-events/register/custom-events`,CloseEvent:`dom-events/register/custom-events`,ProgressEvent:`dom-events/register/custom-events`,UIEvent:`dom-events/register/ui-events`,MouseEvent:`dom-events/register/ui-events`,PointerEvent:`dom-events/register/ui-events`,KeyboardEvent:`dom-events/register/ui-events`,WheelEvent:`dom-events/register/ui-events`,FocusEvent:`dom-events/register/ui-events`,addEventListener:`dom-events/register/global-event-target`,removeEventListener:`dom-events/register/global-event-target`,dispatchEvent:`dom-events/register/global-event-target`,EventSource:`eventsource/register`,WebSocket:`websocket/register`,WebAssembly:`webassembly/register/promise`,performance:`@gjsify/web-globals/register/performance`,PerformanceObserver:`@gjsify/web-globals/register/performance`,DOMException:`dom-exception/register`,XMLHttpRequest:`fetch/register/xhr`,XMLHttpRequestUpload:`fetch/register/xhr`,DOMParser:`@gjsify/domparser/register`,AudioContext:`@gjsify/webaudio/register`,webkitAudioContext:`@gjsify/webaudio/register`,Audio:`@gjsify/webaudio/register`,HTMLAudioElement:`@gjsify/webaudio/register`,GamepadEvent:`@gjsify/gamepad/register`,MediaDevices:`@gjsify/webrtc/register/media-devices`,RTCPeerConnection:`@gjsify/webrtc/register/peer-connection`,RTCSessionDescription:`@gjsify/webrtc/register/peer-connection`,RTCIceCandidate:`@gjsify/webrtc/register/peer-connection`,RTCPeerConnectionIceEvent:`@gjsify/webrtc/register/peer-connection`,RTCDataChannel:`@gjsify/webrtc/register/data-channel`,RTCDataChannelEvent:`@gjsify/webrtc/register/data-channel`,RTCError:`@gjsify/webrtc/register/error`,RTCErrorEvent:`@gjsify/webrtc/register/error`,MediaStream:`@gjsify/webrtc/register/media`,MediaStreamTrack:`@gjsify/webrtc/register/media`,RTCTrackEvent:`@gjsify/webrtc/register/media`,document:`@gjsify/dom-elements/register/document`,Image:`@gjsify/dom-elements/register/image`,HTMLCanvasElement:`@gjsify/dom-elements/register/canvas`,HTMLImageElement:`@gjsify/dom-elements/register/image`,HTMLElement:`@gjsify/dom-elements/register/document`,MutationObserver:`@gjsify/dom-elements/register/observers`,ResizeObserver:`@gjsify/dom-elements/register/observers`,IntersectionObserver:`@gjsify/dom-elements/register/observers`,FontFace:`@gjsify/dom-elements/register/font-face`,matchMedia:`@gjsify/dom-elements/register/match-media`,location:`@gjsify/dom-elements/register/location`,ImageData:`@gjsify/canvas2d/register`,Path2D:`@gjsify/canvas2d/register`,HTMLIFrameElement:`@gjsify/iframe/register`,WebGLRenderingContext:`@gjsify/webgl/register`,WebGL2RenderingContext:`@gjsify/webgl/register`},Xx=[`fetch`,`Headers`,`Request`,`Response`],Zx={"@gjsify/dom-elements/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/webaudio/register":[`Gst`,`GstApp`],"@gjsify/webrtc/register":[`Gst`,`GstWebRTC`,`GstSdp`],"@gjsify/gamepad/register":[`Manette`],"@gjsify/canvas2d/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/iframe/register":[`WebKit`],"@gjsify/webgl/register":[`GdkPixbuf`,`Gwebgl`]}});function excerptAt(t,n){let S=Math.max(0,n-eS),C=Math.min(t.length,n+eS),N=t.slice(S,C).replace(/[\r\n\t]+/g,` `);return`${S>0?`…`:``}${N}${C<t.length?`…`:``}`}function classifyJsxParseFailure(t,n){let S=n.pos,C=n.loc;return typeof S!=`number`||typeof C?.line!=`number`||typeof C.column!=`number`||t[S]!==`<`||!$x.test(t.slice(S+1,S+2))?null:{line:C.line,column:C.column,excerpt:excerptAt(t,S)}}function locateSurvivingJsx(t){try{return parse$2(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0}),null}catch(n){return classifyJsxParseFailure(t,n)}}function formatSurvivingJsx(t,n){return[`gjsify build: ${n} still contains raw JSX at ${t.line}:${t.column} — it is not valid JavaScript, so GJS aborts at load with "SyntaxError: expected expression, got '<'" before one line runs.`,` ${t.excerpt}`,``,'JSX reaches an artifact only when the transform was told to PRESERVE it (`jsx: "preserve"` in `gjsify.bundler.transform.jsx` or in tsconfig `compilerOptions.jsx`) and nothing compiled it afterwards. Either:'," - register the framework compiler that consumes preserved JSX (`babel-preset-solid` for Solid, the Vue SFC compiler) under `gjsify.bundler.plugins`, or",' - drop `preserve` and give the automatic runtime an import source that resolves AND runs: `bundler.transform.jsx: { "importSource": "<pkg exporting ./jsx-runtime>" }`, or tsconfig `"jsx": "react-jsx"` + `"jsxImportSource"`. Not `@gjsify/gtk-host` — its `/jsx-runtime` is a TYPE surface and throws when called.'].join(`
699
+ `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),t){var S=this.pos-1;this.invalidStringToken(S,`Invalid escape sequence in template string`)}default:if(n>=48&&n<=55){var C=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],N=parseInt(C,8);return N>255&&(C=C.slice(0,-1),N=parseInt(C,8)),this.pos+=C.length-1,n=this.input.charCodeAt(this.pos),(C!==`0`||n===56||n===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-C.length,t?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(N)}return isNewLine(n)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(n)}},Hx.readHexChar=function(t){var n=this.pos,S=this.readInt(16,t);return S===null&&this.invalidStringToken(n,`Bad character escape sequence`),S},Hx.readWord1=function(){this.containsEsc=!1;for(var t=``,n=!0,S=this.pos,C=this.options.ecmaVersion>=6;this.pos<this.input.length;){var N=this.fullCharCodeAtPos();if(isIdentifierChar(N,C))this.pos+=N<=65535?1:2;else if(N===92){this.containsEsc=!0,t+=this.input.slice(S,this.pos);var F=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var I=this.readCodePoint();(n?isIdentifierStart:isIdentifierChar)(I,C)||this.invalidStringToken(F,`Invalid Unicode escape`),t+=codePointToString(I),S=this.pos}else break;n=!1}return t+this.input.slice(S,this.pos)},Hx.readWord=function(){var t=this.readWord1(),n=pb.name;return this.keywords.test(t)&&(n=fb[t]),this.finishToken(n,t)},Wx=`8.17.0`,qb.acorn={Parser:qb,version:Wx,defaultOptions:Db,Position:Tb,SourceLocation:Eb,getLineInfo,Node:mx,TokenType:lb,tokTypes:pb,keywordTypes:fb,TokContext:ox,tokContexts:sx,isIdentifierChar,isIdentifierStart,Token:Vx,isNewLine,lineBreak:mb,lineBreakG:hb,nonASCIIwhitespace:gb},__name$1(parse$2,`parse`)});function simple(t,n,S,C,N){S||=Kx,(function c(t,C,N){var F=N||t.type;visitNode$1(S,F,t,C,c),n[F]&&n[F](t,C)})(t,C,N)}function ancestor(t,n,S,C,N){var F=[];S||=Kx,(function c(t,C,N){var I=N||t.type,H=t!==F[F.length-1];H&&F.push(t),visitNode$1(S,I,t,C,c),n[I]&&n[I](t,C||F,F),H&&F.pop()})(t,C,N)}function full(t,n,S,C,N){S||=Kx;var F;(function c(t,C,N){var I=N||t.type;visitNode$1(S,I,t,C,c),F!==t&&(n(t,C,I),F=t)})(t,C,N)}function skipThrough(t,n,S){S(t,n)}function ignore(t,n,S){}function visitNode$1(t,n,S,C,N){if(t[n]==null)throw Error(`No walker function defined for node type `+n);t[n](S,C,N)}var Kx,qx=__esmMin(()=>{__name$1(visitNode$1,`visitNode`),Kx={},Kx.Program=Kx.BlockStatement=Kx.StaticBlock=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},Kx.Statement=skipThrough,Kx.EmptyStatement=ignore,Kx.ExpressionStatement=Kx.ParenthesizedExpression=Kx.ChainExpression=function(t,n,S){return S(t.expression,n,`Expression`)},Kx.IfStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Statement`),t.alternate&&S(t.alternate,n,`Statement`)},Kx.LabeledStatement=function(t,n,S){return S(t.body,n,`Statement`)},Kx.BreakStatement=Kx.ContinueStatement=ignore,Kx.WithStatement=function(t,n,S){S(t.object,n,`Expression`),S(t.body,n,`Statement`)},Kx.SwitchStatement=function(t,n,S){S(t.discriminant,n,`Expression`);for(var C=0,N=t.cases;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.SwitchCase=function(t,n,S){t.test&&S(t.test,n,`Expression`);for(var C=0,N=t.consequent;C<N.length;C+=1){var F=N[C];S(F,n,`Statement`)}},Kx.ReturnStatement=Kx.YieldExpression=Kx.AwaitExpression=function(t,n,S){t.argument&&S(t.argument,n,`Expression`)},Kx.ThrowStatement=Kx.SpreadElement=function(t,n,S){return S(t.argument,n,`Expression`)},Kx.TryStatement=function(t,n,S){S(t.block,n,`Statement`),t.handler&&S(t.handler,n),t.finalizer&&S(t.finalizer,n,`Statement`)},Kx.CatchClause=function(t,n,S){t.param&&S(t.param,n,`Pattern`),S(t.body,n,`Statement`)},Kx.WhileStatement=Kx.DoWhileStatement=function(t,n,S){S(t.test,n,`Expression`),S(t.body,n,`Statement`)},Kx.ForStatement=function(t,n,S){t.init&&S(t.init,n,`ForInit`),t.test&&S(t.test,n,`Expression`),t.update&&S(t.update,n,`Expression`),S(t.body,n,`Statement`)},Kx.ForInStatement=Kx.ForOfStatement=function(t,n,S){S(t.left,n,`ForInit`),S(t.right,n,`Expression`),S(t.body,n,`Statement`)},Kx.ForInit=function(t,n,S){t.type===`VariableDeclaration`?S(t,n):S(t,n,`Expression`)},Kx.DebuggerStatement=ignore,Kx.FunctionDeclaration=function(t,n,S){return S(t,n,`Function`)},Kx.VariableDeclaration=function(t,n,S){for(var C=0,N=t.declarations;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.VariableDeclarator=function(t,n,S){S(t.id,n,`Pattern`),t.init&&S(t.init,n,`Expression`)},Kx.Function=function(t,n,S){t.id&&S(t.id,n,`Pattern`);for(var C=0,N=t.params;C<N.length;C+=1){var F=N[C];S(F,n,`Pattern`)}S(t.body,n,t.expression?`Expression`:`Statement`)},Kx.Pattern=function(t,n,S){t.type===`Identifier`?S(t,n,`VariablePattern`):t.type===`MemberExpression`?S(t,n,`MemberPattern`):S(t,n)},Kx.VariablePattern=ignore,Kx.MemberPattern=skipThrough,Kx.RestElement=function(t,n,S){return S(t.argument,n,`Pattern`)},Kx.ArrayPattern=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Pattern`)}},Kx.ObjectPattern=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];F.type===`Property`?(F.computed&&S(F.key,n,`Expression`),S(F.value,n,`Pattern`)):F.type===`RestElement`&&S(F.argument,n,`Pattern`)}},Kx.Expression=skipThrough,Kx.ThisExpression=Kx.Super=Kx.MetaProperty=ignore,Kx.ArrayExpression=function(t,n,S){for(var C=0,N=t.elements;C<N.length;C+=1){var F=N[C];F&&S(F,n,`Expression`)}},Kx.ObjectExpression=function(t,n,S){for(var C=0,N=t.properties;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.FunctionExpression=Kx.ArrowFunctionExpression=Kx.FunctionDeclaration,Kx.SequenceExpression=function(t,n,S){for(var C=0,N=t.expressions;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},Kx.TemplateLiteral=function(t,n,S){for(var C=0,N=t.quasis;C<N.length;C+=1){var F=N[C];S(F,n)}for(var I=0,H=t.expressions;I<H.length;I+=1){var W=H[I];S(W,n,`Expression`)}},Kx.TemplateElement=ignore,Kx.UnaryExpression=Kx.UpdateExpression=function(t,n,S){S(t.argument,n,`Expression`)},Kx.BinaryExpression=Kx.LogicalExpression=function(t,n,S){S(t.left,n,`Expression`),S(t.right,n,`Expression`)},Kx.AssignmentExpression=Kx.AssignmentPattern=function(t,n,S){S(t.left,n,`Pattern`),S(t.right,n,`Expression`)},Kx.ConditionalExpression=function(t,n,S){S(t.test,n,`Expression`),S(t.consequent,n,`Expression`),S(t.alternate,n,`Expression`)},Kx.NewExpression=Kx.CallExpression=function(t,n,S){if(S(t.callee,n,`Expression`),t.arguments)for(var C=0,N=t.arguments;C<N.length;C+=1){var F=N[C];S(F,n,`Expression`)}},Kx.MemberExpression=function(t,n,S){S(t.object,n,`Expression`),t.computed&&S(t.property,n,`Expression`)},Kx.ExportNamedDeclaration=Kx.ExportDefaultDeclaration=function(t,n,S){if(t.declaration&&S(t.declaration,n,t.type===`ExportNamedDeclaration`||t.declaration.id?`Statement`:`Expression`),t.source&&S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.ExportAllDeclaration=function(t,n,S){if(t.exported&&S(t.exported,n),S(t.source,n,`Expression`),t.attributes)for(var C=0,N=t.attributes;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.ImportAttribute=function(t,n,S){S(t.value,n,`Expression`)},Kx.ImportDeclaration=function(t,n,S){for(var C=0,N=t.specifiers;C<N.length;C+=1){var F=N[C];S(F,n)}if(S(t.source,n,`Expression`),t.attributes)for(var I=0,H=t.attributes;I<H.length;I+=1){var W=H[I];S(W,n)}},Kx.ImportExpression=function(t,n,S){S(t.source,n,`Expression`),t.options&&S(t.options,n,`Expression`)},Kx.ImportSpecifier=Kx.ImportDefaultSpecifier=Kx.ImportNamespaceSpecifier=Kx.Identifier=Kx.PrivateIdentifier=Kx.Literal=ignore,Kx.TaggedTemplateExpression=function(t,n,S){S(t.tag,n,`Expression`),S(t.quasi,n,`Expression`)},Kx.ClassDeclaration=Kx.ClassExpression=function(t,n,S){return S(t,n,`Class`)},Kx.Class=function(t,n,S){t.id&&S(t.id,n,`Pattern`),t.superClass&&S(t.superClass,n,`Expression`),S(t.body,n)},Kx.ClassBody=function(t,n,S){for(var C=0,N=t.body;C<N.length;C+=1){var F=N[C];S(F,n)}},Kx.MethodDefinition=Kx.PropertyDefinition=Kx.Property=function(t,n,S){t.computed&&S(t.key,n,`Expression`),t.value&&S(t.value,n,`Expression`)}}),Jx,Yx,Xx,Zx,Qx=__esmMin(()=>{Jx={node:[`Buffer`,`Blob`,`File`,`process`,`setImmediate`,`clearImmediate`,`queueMicrotask`,`structuredClone`,`btoa`,`atob`,`URL`,`URLSearchParams`,`navigator`],web:`self.fetch.Headers.Request.Response.FormData.ReadableStream.WritableStream.TransformStream.ReadableStreamBYOBReader.ReadableStreamBYOBRequest.ReadableByteStreamController.ReadableStreamDefaultController.ReadableStreamDefaultReader.TextEncoderStream.TextDecoderStream.ByteLengthQueuingStrategy.CountQueuingStrategy.CompressionStream.DecompressionStream.crypto.AbortController.AbortSignal.MessageChannel.MessagePort.Event.EventTarget.CustomEvent.MessageEvent.ErrorEvent.CloseEvent.ProgressEvent.UIEvent.MouseEvent.PointerEvent.KeyboardEvent.WheelEvent.FocusEvent.addEventListener.removeEventListener.dispatchEvent.EventSource.WebSocket.WebAssembly.DOMException.performance.PerformanceObserver.XMLHttpRequest.XMLHttpRequestUpload.DOMParser.AudioContext.webkitAudioContext.Audio.HTMLAudioElement.GamepadEvent.speechSynthesis.SpeechSynthesis.SpeechSynthesisUtterance.SpeechSynthesisVoice.SpeechSynthesisEvent.SpeechSynthesisErrorEvent.MediaDevices.RTCPeerConnection.RTCSessionDescription.RTCIceCandidate.RTCPeerConnectionIceEvent.RTCDataChannel.RTCDataChannelEvent.RTCError.RTCErrorEvent.MediaStream.MediaStreamTrack.RTCTrackEvent`.split(`.`),dom:[`document`,`Image`,`HTMLCanvasElement`,`HTMLImageElement`,`HTMLElement`,`MutationObserver`,`ResizeObserver`,`IntersectionObserver`,`FontFace`,`matchMedia`,`location`]},Yx={Buffer:`@gjsify/node-globals/register/buffer`,process:`@gjsify/node-globals/register/process`,setTimeout:`@gjsify/node-globals/register/timers`,setInterval:`@gjsify/node-globals/register/timers`,clearTimeout:`@gjsify/node-globals/register/timers`,clearInterval:`@gjsify/node-globals/register/timers`,setImmediate:`@gjsify/node-globals/register/timers`,clearImmediate:`@gjsify/node-globals/register/timers`,queueMicrotask:`@gjsify/node-globals/register/microtask`,structuredClone:`@gjsify/node-globals/register/structured-clone`,btoa:`@gjsify/node-globals/register/encoding`,atob:`@gjsify/node-globals/register/encoding`,navigator:`@gjsify/node-globals/register/navigator`,Navigator:`@gjsify/node-globals/register/navigator`,URL:`@gjsify/node-globals/register/url`,URLSearchParams:`@gjsify/node-globals/register/url`,Blob:`@gjsify/buffer/register`,File:`@gjsify/buffer/register`,fetch:`fetch/register/fetch`,Headers:`fetch/register/fetch`,Request:`fetch/register/fetch`,Response:`fetch/register/fetch`,FormData:`@gjsify/web-globals/register/formdata`,self:`@gjsify/web-globals/register/self`,ReadableStream:`web-streams/register/readable`,ReadableStreamBYOBReader:`web-streams/register/readable`,ReadableStreamBYOBRequest:`web-streams/register/readable`,ReadableByteStreamController:`web-streams/register/readable`,ReadableStreamDefaultController:`web-streams/register/readable`,ReadableStreamDefaultReader:`web-streams/register/readable`,WritableStream:`web-streams/register/writable`,TransformStream:`web-streams/register/transform`,TextEncoderStream:`web-streams/register/text-streams`,TextDecoderStream:`web-streams/register/text-streams`,ByteLengthQueuingStrategy:`web-streams/register/queuing`,CountQueuingStrategy:`web-streams/register/queuing`,CompressionStream:`compression-streams/register`,DecompressionStream:`compression-streams/register`,crypto:`webcrypto/register`,AbortController:`abort-controller/register`,AbortSignal:`abort-controller/register`,MessageChannel:`message-channel/register`,MessagePort:`message-channel/register`,Event:`dom-events/register/event-target`,EventTarget:`dom-events/register/event-target`,CustomEvent:`dom-events/register/custom-events`,MessageEvent:`dom-events/register/custom-events`,ErrorEvent:`dom-events/register/custom-events`,CloseEvent:`dom-events/register/custom-events`,ProgressEvent:`dom-events/register/custom-events`,UIEvent:`dom-events/register/ui-events`,MouseEvent:`dom-events/register/ui-events`,PointerEvent:`dom-events/register/ui-events`,KeyboardEvent:`dom-events/register/ui-events`,WheelEvent:`dom-events/register/ui-events`,FocusEvent:`dom-events/register/ui-events`,addEventListener:`dom-events/register/global-event-target`,removeEventListener:`dom-events/register/global-event-target`,dispatchEvent:`dom-events/register/global-event-target`,EventSource:`eventsource/register`,WebSocket:`websocket/register`,WebAssembly:`webassembly/register/promise`,performance:`@gjsify/web-globals/register/performance`,PerformanceObserver:`@gjsify/web-globals/register/performance`,DOMException:`dom-exception/register`,XMLHttpRequest:`fetch/register/xhr`,XMLHttpRequestUpload:`fetch/register/xhr`,DOMParser:`@gjsify/domparser/register`,AudioContext:`@gjsify/webaudio/register`,webkitAudioContext:`@gjsify/webaudio/register`,Audio:`@gjsify/webaudio/register`,HTMLAudioElement:`@gjsify/webaudio/register`,GamepadEvent:`@gjsify/gamepad/register`,speechSynthesis:`@gjsify/speech-synthesis/register`,SpeechSynthesis:`@gjsify/speech-synthesis/register`,SpeechSynthesisUtterance:`@gjsify/speech-synthesis/register`,SpeechSynthesisVoice:`@gjsify/speech-synthesis/register`,SpeechSynthesisEvent:`@gjsify/speech-synthesis/register`,SpeechSynthesisErrorEvent:`@gjsify/speech-synthesis/register`,MediaDevices:`@gjsify/webrtc/register/media-devices`,RTCPeerConnection:`@gjsify/webrtc/register/peer-connection`,RTCSessionDescription:`@gjsify/webrtc/register/peer-connection`,RTCIceCandidate:`@gjsify/webrtc/register/peer-connection`,RTCPeerConnectionIceEvent:`@gjsify/webrtc/register/peer-connection`,RTCDataChannel:`@gjsify/webrtc/register/data-channel`,RTCDataChannelEvent:`@gjsify/webrtc/register/data-channel`,RTCError:`@gjsify/webrtc/register/error`,RTCErrorEvent:`@gjsify/webrtc/register/error`,MediaStream:`@gjsify/webrtc/register/media`,MediaStreamTrack:`@gjsify/webrtc/register/media`,RTCTrackEvent:`@gjsify/webrtc/register/media`,document:`@gjsify/dom-elements/register/document`,Image:`@gjsify/dom-elements/register/image`,HTMLCanvasElement:`@gjsify/dom-elements/register/canvas`,HTMLImageElement:`@gjsify/dom-elements/register/image`,HTMLElement:`@gjsify/dom-elements/register/document`,MutationObserver:`@gjsify/dom-elements/register/observers`,ResizeObserver:`@gjsify/dom-elements/register/observers`,IntersectionObserver:`@gjsify/dom-elements/register/observers`,FontFace:`@gjsify/dom-elements/register/font-face`,matchMedia:`@gjsify/dom-elements/register/match-media`,location:`@gjsify/dom-elements/register/location`,ImageData:`@gjsify/canvas2d/register`,Path2D:`@gjsify/canvas2d/register`,HTMLIFrameElement:`@gjsify/iframe/register`,WebGLRenderingContext:`@gjsify/webgl/register`,WebGL2RenderingContext:`@gjsify/webgl/register`},Xx=[`fetch`,`Headers`,`Request`,`Response`],Zx={"@gjsify/dom-elements/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/webaudio/register":[`Gst`,`GstApp`],"@gjsify/webrtc/register":[`Gst`,`GstWebRTC`,`GstSdp`],"@gjsify/gamepad/register":[`Manette`],"@gjsify/speech-synthesis/register":[`Spiel`],"@gjsify/canvas2d/register":[`Gdk`,`GdkPixbuf`,`Pango`,`PangoCairo`],"@gjsify/iframe/register":[`WebKit`],"@gjsify/webgl/register":[`GdkPixbuf`,`Gwebgl`]}});function excerptAt(t,n){let S=Math.max(0,n-eS),C=Math.min(t.length,n+eS),N=t.slice(S,C).replace(/[\r\n\t]+/g,` `);return`${S>0?`…`:``}${N}${C<t.length?`…`:``}`}function classifyJsxParseFailure(t,n){let S=n.pos,C=n.loc;return typeof S!=`number`||typeof C?.line!=`number`||typeof C.column!=`number`||t[S]!==`<`||!$x.test(t.slice(S+1,S+2))?null:{line:C.line,column:C.column,excerpt:excerptAt(t,S)}}function locateSurvivingJsx(t){try{return parse$2(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0}),null}catch(n){return classifyJsxParseFailure(t,n)}}function formatSurvivingJsx(t,n){return[`gjsify build: ${n} still contains raw JSX at ${t.line}:${t.column} — it is not valid JavaScript, so GJS aborts at load with "SyntaxError: expected expression, got '<'" before one line runs.`,` ${t.excerpt}`,``,'JSX reaches an artifact only when the transform was told to PRESERVE it (`jsx: "preserve"` in `gjsify.bundler.transform.jsx` or in tsconfig `compilerOptions.jsx`) and nothing compiled it afterwards. Either:'," - register the framework compiler that consumes preserved JSX (`babel-preset-solid` for Solid, the Vue SFC compiler) under `gjsify.bundler.plugins`, or",' - drop `preserve` and give the automatic runtime an import source that resolves AND runs: `bundler.transform.jsx: { "importSource": "<pkg exporting ./jsx-runtime>" }`, or tsconfig `"jsx": "react-jsx"` + `"jsxImportSource"`. Not `@gjsify/gtk-host` — its `/jsx-runtime` is a TYPE surface and throws when called.'].join(`
700
700
  `)}var $x,eS,tS=__esmMin(()=>{Gx(),$x=/^[A-Za-z_$>/]/,eS=60});function wbgJsNameFor(t){return t.match(aS)?.[1]??null}function extractBindingNames(t){if(!t)return[];switch(t.type){case`Identifier`:return[t.name];case`ObjectPattern`:return t.properties.flatMap(t=>t.type===`RestElement`?extractBindingNames(t.argument):extractBindingNames(t.value));case`ArrayPattern`:return t.elements.flatMap(t=>t?t.type===`RestElement`?extractBindingNames(t.argument):extractBindingNames(t):[]);case`AssignmentPattern`:return extractBindingNames(t.left);case`RestElement`:return extractBindingNames(t.argument);default:return[]}}function parseAnalysisChunk(t){try{return parse$2(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0})}catch(n){let S=classifyJsxParseFailure(t,n);throw S===null?n:Error(formatSurvivingJsx(S,`the analysis bundle`),{cause:n})}}function scanFreeGlobals(t,n){let S=n.knownGlobals,C=n.methodMarkers??{},N=n.wasmMarkers??{},F=parseAnalysisChunk(t),I=new Set;simple(F,{VariableDeclarator(t){for(let n of extractBindingNames(t.id))I.add(n)},FunctionDeclaration(t){t.id&&I.add(t.id.name);for(let n of t.params)for(let t of extractBindingNames(n))I.add(t)},FunctionExpression(t){t.id&&I.add(t.id.name);for(let n of t.params)for(let t of extractBindingNames(n))I.add(t)},ArrowFunctionExpression(t){for(let n of t.params)for(let t of extractBindingNames(n))I.add(t)},ClassDeclaration(t){t.id&&I.add(t.id.name)},ImportSpecifier(t){I.add(t.local.name)},ImportDefaultSpecifier(t){I.add(t.local.name)},ImportNamespaceSpecifier(t){I.add(t.local.name)},CatchClause(t){if(t.param)for(let n of extractBindingNames(t.param))I.add(n)}});let H=new Set,W=new Set,q=new Set([`globalThis`,`global`,`window`,`self`,`globalObject`]);return ancestor(F,{MemberExpression(t){if(t.computed||t.object.type!==`Identifier`||t.property.type!==`Identifier`)return;let N=t.object.name,F=t.property.name;if(q.has(N)){if(n.ignoreHostMembers)return;S.has(F)&&H.add(F);return}let I=`${N}.${F}`,W=C[I];W&&S.has(W)&&H.add(W)},FunctionDeclaration(t){if(!t.id)return;let n=wbgJsNameFor(t.id.name);if(!n)return;let C=N[n];C&&S.has(C)&&H.add(C)},Identifier(t,n){let C=t.name;if(!S.has(C)||I.has(C))return;let N=n[n.length-2];if(!N){H.add(C);return}switch(N.type){case`MemberExpression`:{let n=N;if(n.property===t&&!n.computed)return;break}case`Property`:{let n=N;if(n.key===t&&!n.computed)return;break}case`MethodDefinition`:case`PropertyDefinition`:{let n=N;if(n.key===t&&!n.computed)return;break}case`LabeledStatement`:if(N.label===t)return;break;case`ExportSpecifier`:if(N.exported===t)return;break;case`FunctionDeclaration`:case`FunctionExpression`:case`ClassDeclaration`:case`ClassExpression`:if(N.id===t)return;break;case`VariableDeclarator`:if(N.id===t)return;break;case`ImportSpecifier`:case`ImportDefaultSpecifier`:case`ImportNamespaceSpecifier`:return;case`UnaryExpression`:if(N.operator===`typeof`){H.has(C)||W.add(C);return}break}W.delete(C),H.add(C)}}),H}function detectFreeGlobals(t){return scanFreeGlobals(t,{knownGlobals:nS,methodMarkers:rS,wasmMarkers:iS})}function detectGjsAmbientGlobals(t){return scanFreeGlobals(t,{knownGlobals:oS,ignoreHostMembers:!0})}function isNodeGiSpecifier(t){return typeof t==`string`?t===sS||t.startsWith(`${sS}/`)?!0:cS.has(t):!1}function detectNodeGiModuleImports(t){let n=parse$2(t,{ecmaVersion:`latest`,sourceType:`module`,allowHashBang:!0});for(let t of n.body)if(t.type===`ImportDeclaration`&&isNodeGiSpecifier(t.source.value)||(t.type===`ExportNamedDeclaration`||t.type===`ExportAllDeclaration`)&&t.source&&isNodeGiSpecifier(t.source.value))return!0;return!1}var nS,rS,iS,aS,oS,sS,cS,lS=__esmMin(()=>{Gx(),qx(),Qx(),tS(),Sv(),nS=new Set(Object.keys(Yx)),rS={"navigator.getGamepads":`GamepadEvent`,"navigator.mediaDevices":`MediaDevices`,"WebAssembly.compile":`WebAssembly`,"WebAssembly.compileStreaming":`WebAssembly`,"WebAssembly.instantiate":`WebAssembly`,"WebAssembly.instantiateStreaming":`WebAssembly`,"WebAssembly.validate":`WebAssembly`},iS={crypto:`crypto`,getRandomValues:`crypto`,msCrypto:`crypto`},aS=/^__wbg_([A-Za-z][A-Za-z0-9]*)_[A-Za-z0-9]+$/,oS=new Set([`print`,`printerr`,`log`,`logError`,`ARGV`,`imports`]),sS=`@gjsify/node-gi`,cS=new Set(Object.keys(bv))});function resolveGlobalsList(t){let n=new Set,S=t.trim();if(!S)return n;for(let t of S.split(`,`)){let S=t.trim();if(!S)continue;let C=dS[S];if(C)for(let t of C){let S=uS[t];S&&n.add(S)}else{let t=uS[S];t&&n.add(t)}}return n}function packageNameFromRegisterPath(t){return t.startsWith(`@`)?t.split(`/`).slice(0,2).join(`/`):t.split(`/`)[0]??t}function resolveRegisterAlias(t){if(pS[t])return pS[t];let n=packageNameFromRegisterPath(t),S=pS[n];return S&&!t.startsWith(`@`)?S+t.slice(n.length):t}function isRegisterPathResolvable(t,n){let S=packageNameFromRegisterPath(resolveRegisterAlias(t)).split(`/`);for(let t of typeof n==`string`?[n]:n){let n=t,C=n.slice(0,n.indexOf(`/`)+1)||`/`;for(;;){if(existsSync(On(n,`node_modules`,...S,`package.json`)))return!0;if(n===C)break;let t=On(n,`..`);if(t===n)break;n=t}}return!1}function filterResolvableRegisterPaths(t,n){let S=new Set;for(let C of t)isRegisterPathResolvable(C,n)?S.add(C):ge.warn(`[gjsify] --globals auto: skipping register import '${C}' — package '${packageNameFromRegisterPath(C)}' is not installed in this project. If you need this global, add the package as a dependency or use --exclude-globals to suppress this warning.`);return S}function nativeOverrideIdentsFor(t){let n=[];for(let S of fS){let C=uS[S];C&&t.has(C)&&n.push(S)}return n}async function writeRegisterInjectFile(t,n=process.cwd(),S={}){if(t.size===0)return null;let C=On(n,`node_modules`,`.cache`,`gjsify`);await mkdir$1(C,{recursive:!0});let N=[...t].sort(),F=[],I=S.reverseBridgeOverride?nativeOverrideIdentsFor(t):[];if(I.length>0){let t=`// gjsify --app node reverse-bridge: clear runtime-native web globals so the
701
701
  // injected @gjsify/* register bodies install their GJS-semantics versions.
702
702
  for (const __k of ${JSON.stringify(I.sort())}) { try { delete globalThis[__k]; } catch {} }\n`,n=`auto-globals-override-${createHash(`sha1`).update(t).digest(`hex`).slice(0,10)}.mjs`;await writeFile$1(On(C,n),t,`utf-8`),F.push(`import './${n}';`)}for(let t of N)F.push(`import '${t}';`);let H=F.join(`
@@ -787,7 +787,7 @@ var S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,N=Object.pr
787
787
  `)[0]??t)),process.platform===`win32`&&t.push(checkMsvcRuntime()),t}function checkGwebgl(t){return checkNpmPackage(`gwebgl`,`gwebgl (@gjsify/webgl)`,`@gjsify/webgl`,t,`optional`,[`@gjsify/webgl`])}function runRequiredChecks(t){let n=[];return n.push(checkBinary(`pkg-config`,`pkg-config`,`pkg-config`,[`--version`],`required`)),n.push(checkBinary(`meson`,`Meson`,`meson`,[`--version`],`required`)),n.push(checkGiLibrary(`gtk4`,`GTK4`,`Gtk`,`4.0`,`gtk4`,`required`)),n.push(checkGiLibrary(`libadwaita`,`libadwaita`,`Adw`,`1`,`libadwaita-1`,`required`)),n.push(checkGiLibrary(`libsoup3`,`libsoup3`,`Soup`,`3.0`,`libsoup-3.0`,`required`)),n.push(checkPkgConfig(`gobject-introspection`,`GObject Introspection`,`gobject-introspection-1.0`,`required`)),n}function runNativeBuildToolchainChecks(){let t=[`@gjsify/http-soup-bridge`,`@gjsify/http2-native`,`@gjsify/lightningcss-native`,`@gjsify/oxfmt-native`,`@gjsify/rolldown-native`,`@gjsify/sab-native`,`@gjsify/terminal-native`,`@gjsify/tls-native`,`@gjsify/webgl`,`@gjsify/webrtc-native`];return[checkBinary(`ninja`,`Ninja`,`ninja`,[`--version`],`optional`,void 0,t),checkBinary(`vala`,`Vala`,`valac`,[`--version`],`optional`,t=>t.replace(/^Vala\s+/i,``),t),checkBinary(`cargo`,`Cargo (Rust)`,`cargo`,[`--version`],`optional`,t=>t.replace(/^cargo\s+/i,``).split(` `)[0]??t,[`@gjsify/lightningcss-native`,`@gjsify/oxfmt-native`,`@gjsify/rolldown-native`])]}function runOptionalChecks(t,n){let S=[];for(let[n,C]of Object.entries(vF)){if(t!==null&&!t.has(n))continue;let N=Object.entries(yF).filter(([,t])=>t.includes(n)).map(([t])=>t);S.push(checkPkgConfig(C.id,C.name,C.pkgName,`optional`,N))}return(t===null||t.has(`gwebgl`))&&S.push(checkGwebgl(n)),S}function buildInstallCommand(t,n){if(t===`unknown`)return null;let S=bF[t],C=[],N=[];for(let t of n){if(t.id===`gwebgl`){N.push(`@gjsify/webgl`);continue}let n=S[t.id];n&&C.push(n)}let F=[];return C.length>0&&F.push(`${xF[t]} ${[...new Set(C)].join(` `)}`),N.length>0&&F.push(`npm install ${N.join(` `)}`),F.length>0?F.join(`
788
788
  `):null}function readGirsLibraryVersion(t,n){for(let S of[pathToFileURL(On(t,`_girs_.js`)).href,import.meta.url]){let t;try{t=jn(createRequire(S).resolve(n))}catch{continue}for(let S=0;S<5;S++){let S=On(t,`package.json`);if(existsSync(S))try{let t=JSON.parse(readFileSync(S,`utf-8`));if(t.name===n)return t.libraryVersion??null}catch{return null}let C=jn(t);if(C===t)break;t=C}}return null}function majorMinor(t){let n=/^(\d+)\.(\d+)/.exec(t.trim());return n?[Number(n[1]),Number(n[2])]:null}function isDegenerate(t,n){let S=t.trim(),C=n.split(`.`);for(let t=C.length;t<=3;t++)if(S===[...C,...Array(t-C.length).fill(`0`)].join(`.`))return!0;return!1}function checkTypeSkew(t,n={}){let S=n.readDeclared??readGirsLibraryVersion,C=n.readInstalled??(t=>tryExecFile(`pkg-config`,[`--modversion`,t])),N=[];for(let n of SF){let F=S(t,n.typePackage);if(F===null||isDegenerate(F,n.namespaceVersion))continue;let I=C(n.pkgConfig);if(I===null)continue;let H=majorMinor(F),W=majorMinor(I.split(`
789
789
  `)[0]??I);!H||!W||H[0]===W[0]&&H[1]===W[1]||N.push({typePackage:n.typePackage,pkgConfig:n.pkgConfig,declared:F,installed:I.split(`
790
- `)[0]??I,relation:H[0]>W[0]||H[0]===W[0]&&H[1]>W[1]?`ahead`:`behind`})}return N}var vF,yF,bF,xF,SF,CF=__esmMin(()=>{z_(),zn(),Vl(),Xn(),Ud(),g_(),_F(),K_(),W_(),__name$1(detectPackageManager$1,`detectPackageManager`),vF={manette:{id:`manette`,name:`libmanette`,pkgName:`manette-0.2`},gstreamer:{id:`gstreamer`,name:`GStreamer`,pkgName:`gstreamer-1.0`},"gst-app":{id:`gst-app`,name:`GStreamer App`,pkgName:`gstreamer-app-1.0`},"gdk-pixbuf":{id:`gdk-pixbuf`,name:`GdkPixbuf`,pkgName:`gdk-pixbuf-2.0`},pango:{id:`pango`,name:`Pango`,pkgName:`pango`},pangocairo:{id:`pangocairo`,name:`PangoCairo`,pkgName:`pangocairo`},webkitgtk:{id:`webkitgtk`,name:`WebKitGTK`,pkgName:`webkitgtk-6.0`},cairo:{id:`cairo`,name:`Cairo`,pkgName:`cairo`},gnutls:{id:`gnutls`,name:`GnuTLS`,pkgName:`gnutls`},nghttp2:{id:`nghttp2`,name:`libnghttp2`,pkgName:`libnghttp2`},"json-glib":{id:`json-glib`,name:`JSON-GLib`,pkgName:`json-glib-1.0`},epoxy:{id:`epoxy`,name:`libepoxy`,pkgName:`epoxy`},"gst-webrtc":{id:`gst-webrtc`,name:`GStreamer WebRTC`,pkgName:`gstreamer-webrtc-1.0`}},yF={"@gjsify/gamepad":[`manette`],"@gjsify/webaudio":[`gstreamer`,`gst-app`],"@gjsify/iframe":[`webkitgtk`],"@gjsify/canvas2d":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/canvas2d-core":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/dom-elements":[`gdk-pixbuf`],"@gjsify/webgl":[`gwebgl`,`gdk-pixbuf`,`epoxy`],"@gjsify/tls-native":[`gnutls`],"@gjsify/http2-native":[`nghttp2`],"@gjsify/rolldown-native":[`json-glib`],"@gjsify/webrtc-native":[`gstreamer`,`gst-webrtc`]},bF={apt:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`valac`,cargo:`cargo`,gtk4:`libgtk-4-dev`,libadwaita:`libadwaita-1-dev`,libsoup3:`libsoup-3.0-dev`,webkitgtk:`libwebkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection libgirepository1.0-dev`,manette:`libmanette-0.2-0 gir1.2-manette-0.2`,gstreamer:`libgstreamer1.0-dev`,"gst-app":`libgstreamer-plugins-base1.0-dev gir1.2-gst-plugins-base-1.0`,"gdk-pixbuf":`libgdk-pixbuf-2.0-dev`,pango:`libpango1.0-dev`,pangocairo:`libpango1.0-dev`,cairo:`libcairo2-dev`,gnutls:`libgnutls28-dev`,nghttp2:`libnghttp2-dev`,"json-glib":`libjson-glib-dev`,epoxy:`libepoxy-dev`},dnf:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf-pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup3-devel`,webkitgtk:`webkitgtk6.0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-devel`,gstreamer:`gstreamer1-devel`,"gst-app":`gstreamer1-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf2-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`gnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},pacman:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup3`,webkitgtk:`webkitgtk-6.0`,"gobject-introspection":`gobject-introspection`,manette:`libmanette`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf2`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`libnghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},zypper:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup-3_0-devel`,webkitgtk:`webkitgtk6_0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-0_2-0-devel`,gstreamer:`gstreamer-devel`,"gst-app":`gstreamer-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`libgnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},apk:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4.0-dev`,libadwaita:`libadwaita-dev`,libsoup3:`libsoup3-dev`,webkitgtk:`webkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection-dev`,manette:`libmanette-dev`,gstreamer:`gstreamer-dev`,"gst-app":`gst-plugins-base-dev`,"gdk-pixbuf":`gdk-pixbuf-dev`,pango:`pango-dev`,pangocairo:`pango-dev`,cairo:`cairo-dev`,gnutls:`gnutls-dev`,nghttp2:`nghttp2-dev`,"json-glib":`json-glib-dev`,epoxy:`libepoxy-dev`},brew:{nodejs:`node`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup`,"gobject-introspection":`gobject-introspection`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`nghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},winget:{"msvc-runtime":`Microsoft.VCRedist.2015+.x64`},unknown:{}},xF={apt:`sudo apt install`,dnf:`sudo dnf install`,pacman:`sudo pacman -S`,zypper:`sudo zypper install`,apk:`sudo apk add`,brew:`brew install`,winget:`winget install --id`,unknown:``},SF=[{pkgConfig:`gtk4`,typePackage:`@girs/gtk-4.0`,namespaceVersion:`4.0`},{pkgConfig:`libadwaita-1`,typePackage:`@girs/adw-1`,namespaceVersion:`1`},{pkgConfig:`libsoup-3.0`,typePackage:`@girs/soup-3.0`,namespaceVersion:`3.0`},{pkgConfig:`glib-2.0`,typePackage:`@girs/glib-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gobject-2.0`,typePackage:`@girs/gobject-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gio-2.0`,typePackage:`@girs/gio-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gstreamer-1.0`,typePackage:`@girs/gst-1.0`,namespaceVersion:`1.0`},{pkgConfig:`webkitgtk-6.0`,typePackage:`@girs/webkit-6.0`,namespaceVersion:`6.0`},{pkgConfig:`manette-0.2`,typePackage:`@girs/manette-0.2`,namespaceVersion:`0.2`},{pkgConfig:`pango`,typePackage:`@girs/pango-1.0`,namespaceVersion:`1.0`},{pkgConfig:`harfbuzz`,typePackage:`@girs/harfbuzz-0.0`,namespaceVersion:`0.0`}]});function parsePlatformToken(t){let n=t.endsWith(EF),S=n?t.slice(0,-5):t,C=S.indexOf(`-`),N=C<0?S:S.slice(0,C);return{os:N,arch:C<0?``:S.slice(C+1),libc:n&&N===`linux`?`musl`:null}}function canonicalPlatformToken(t){let{os:n,arch:S,libc:C}=parsePlatformToken(t);if(!S)return t;let N=`${n}-${TF[S]??S}`;return C===`musl`||t.endsWith(EF)?`${N}${EF}`:N}function hostPlatformTokens(t,n,S){let C=`${t}-${n}`;return S===`musl`&&t===`linux`?[`${C}${EF}`,C]:[C]}function prebuildDirCandidates(t,n,S,C){let N=hostPlatformTokens(t,n,C),F=wF[n]??n,I=[],push=t=>{I.includes(t)||I.push(t)};for(let t of N){for(let n of S??[])typeof n==`string`&&canonicalPlatformToken(n)===t&&push(n);push(t)}return push(`${t}-${F}`),I}function resolvePrebuildDirName(t){let{platform:n,arch:S,declaredPlatforms:C,existingDirs:N,libc:F}=t;for(let t of prebuildDirCandidates(n,S,C,F))if(N.includes(t))return t;return null}function platformPackageName(t,n){return`${t}-${n}`}function scanNodeModules(t,n){let S=[],C=[];if(!existsSync(t))return{resolved:S,declared:C};let N;try{N=readdirSync(t)}catch{return{resolved:S,declared:C}}let take=t=>{t&&(t.kind===`resolved`?S.push(t.pkg):C.push(t.candidate))};for(let S of N)if(!S.startsWith(`.`))if(S.startsWith(`@`)){let C=On(t,S),N;try{N=readdirSync(C)}catch{continue}for(let t of N)take(checkPackage(On(C,t),`${S}/${t}`,n))}else take(checkPackage(On(t,S),S,n));return{resolved:S,declared:C}}function checkPackage(t,n,S){let C=readPackageJson$2(On(t,`package.json`));if(!C)return null;let N=C.gjsify;if(!N||typeof N!=`object`)return null;let F=N,I=F.prebuilds;if(typeof I!=`string`)return null;let H=F.platforms,W=Array.isArray(H)?H.filter(t=>typeof t==`string`):void 0,q=On(t,I),Y;try{Y=readdirSync(q,{withFileTypes:!0}).filter(t=>t.isDirectory()||t.isSymbolicLink()).map(t=>t.name)}catch{return{kind:`declared`,candidate:{name:n,pkgDir:t}}}let X=resolvePrebuildDirName({platform:S.platform,arch:S.arch,declaredPlatforms:W,existingDirs:Y,libc:S.libc});return X?{kind:`resolved`,pkg:{name:n,prebuildsDir:On(q,X)}}:{kind:`declared`,candidate:{name:n,pkgDir:t}}}function resolvePlatformSibling(t,n){let S=hostPlatformTokens(n.platform,n.arch,n.libc),C=$(t.pkgDir);for(;;){for(let N of S){let S=platformPackageName(t.name,N),F=checkPackage(On(C,`node_modules`,...S.split(`/`)),S,n);if(F?.kind===`resolved`)return F.pkg}let N=$(C,`..`);if(N===C)return null;C=N}}function detectNativePackages(t,n={}){let S={platform:n.platform??process.platform,arch:n.arch??process.arch,libc:n.libc===void 0?detectHostLibc(n.platform??process.platform):n.libc},C=[],N=new Set,F=[],I=$(t);for(;;){let t=On(I,`node_modules`);if(existsSync(t)){let n=scanNodeModules(t,S);for(let t of n.resolved)N.has(t.name)||(N.add(t.name),C.push(t));for(let t of n.declared)F.some(n=>n.name===t.name)||F.push(t)}let n=$(I,`..`);if(n===I)break;I=n}for(let t of F){if(N.has(t.name))continue;let n=resolvePlatformSibling(t,S);!n||N.has(n.name)||(N.add(n.name),C.push(n))}return C}function resolveHostLibc(t){return t.platform===`linux`?typeof t.glibcVersionRuntime==`string`&&t.glibcVersionRuntime.length>0?`glibc`:t.muslLoaderPresent?`musl`:`glibc`:null}function detectHostLibc(t){if(t!==`linux`)return null;let n=process.report?.getReport()?.header;return resolveHostLibc({platform:t,glibcVersionRuntime:typeof n?.glibcVersionRuntime==`string`?n.glibcVersionRuntime:void 0,muslLoaderPresent:existsSync(`/lib`)&&readdirSync(`/lib`).some(t=>t.startsWith(`ld-musl-`))})}function muslPrebuildFallbacks(t,n){return t===`musl`?n.filter(t=>parsePlatformToken(Mn(t.prebuildsDir)).libc!==`musl`).map(t=>t.name):[]}function libraryPathVar(t){return t===`darwin`?{name:`DYLD_LIBRARY_PATH`,separator:`:`}:t===`win32`?{name:`PATH`,separator:`;`}:{name:`LD_LIBRARY_PATH`,separator:`:`}}function buildNativeEnv(t,n={}){let S=n.platform??process.platform,C=n.env??process.env,N=t.map(t=>t.prebuildsDir),F=S===`win32`?`;`:`:`,{name:I,separator:H}=libraryPathVar(S),W=S===`win32`?Object.keys(C).find(t=>t.toLowerCase()===I.toLowerCase())??I:I,prepend=(t,n)=>[...N,...t?[t]:[]].join(n),q={GI_TYPELIB_PATH:prepend(C.GI_TYPELIB_PATH,F)};q[W]=prepend(C[W],H);let Y=(n.systemGiDirs??systemGiLibraryDirs)({platform:S,env:C});return Y.length>0&&(q[DF]=composeDyldFallback(Y,C)),q}var wF,TF,EF,DF,OF=__esmMin(()=>{Ud(),zn(),iF(),mF(),wF={x64:`x86_64`,arm64:`aarch64`,arm:`armv7`,ia32:`i686`},TF={x86_64:`x64`,amd64:`x64`,aarch64:`arm64`},EF=`-musl`,DF=`DYLD_FALLBACK_LIBRARY_PATH`});function defaultRepository(){let t=(globalThis.imports?.gi)?.GIRepository?.Repository;return typeof t?.dup_default==`function`?t.dup_default():null}function activateNativePrebuilds(){if(kF)return kF;kF=[];try{let t=defaultRepository();if(!t)return kF;let n=detectNativePackages(process.cwd()),S=new Set(n.map(t=>t.name)),C=detectNativePackages(jn(fileURLToPath(import.meta.url))),N=[...n,...C.filter(t=>!S.has(t.name))];for(let n of N)t.prepend_search_path(n.prebuildsDir),t.prepend_library_path(n.prebuildsDir);kF=N}catch{}return kF}var kF,AF=__esmMin(()=>{zn(),Xn(),OF(),kF=null});async function loadNpmRolldown(){if(isGjs())throw Error("gjsify build: no usable bundler engine under GJS — `@gjsify/rolldown-native` is not loadable, and the npm `rolldown` engine is a Rust napi crate that cannot run under GJS.\n"+diagnoseNativeEngine());return(await import(resolveImportTargetForGjs(`rolldown`))).rolldown}function diagnoseNativeEngine(){let t=null;try{let n=jn(fileURLToPath(import.meta.url));t=findRolldownNativeDir(process.cwd(),n)}catch{t=null}if(t===null)return`\`@gjsify/rolldown-native\` is NOT INSTALLED — no node_modules/@gjsify/rolldown-native was found walking up from ${process.cwd()} or from the CLI bundle's own directory.\nInstall it: \`gjsify install @gjsify/rolldown-native\` (in the gjsify repo: \`gjsify install\`). Running the build under Node also works — there the npm \`rolldown\` crate is used instead.`;let n=On(t,`lib`,`esm`,`index.js`);if(!existsSync(n))return`The engine's JS facade is NOT BUILT: ${n} does not exist.\nIt is a BUILD OUTPUT, so this is almost certainly a clone of the gjsify REPOSITORY rather than a consumer install: in a clone, node_modules/@gjsify/rolldown-native is a symlink to the workspace package, whose \`lib/\` no \`gjsify install\` produces. An installed package from npm is NOT affected — the published tarball does contain \`lib/esm/index.js\` (verified against 0.26.1), so a consumer that hit this message should report it.
790
+ `)[0]??I,relation:H[0]>W[0]||H[0]===W[0]&&H[1]>W[1]?`ahead`:`behind`})}return N}var vF,yF,bF,xF,SF,CF=__esmMin(()=>{z_(),zn(),Vl(),Xn(),Ud(),g_(),_F(),K_(),W_(),__name$1(detectPackageManager$1,`detectPackageManager`),vF={manette:{id:`manette`,name:`libmanette`,pkgName:`manette-0.2`},spiel:{id:`spiel`,name:`libspiel`,pkgName:`spiel-1.0`},gstreamer:{id:`gstreamer`,name:`GStreamer`,pkgName:`gstreamer-1.0`},"gst-app":{id:`gst-app`,name:`GStreamer App`,pkgName:`gstreamer-app-1.0`},"gdk-pixbuf":{id:`gdk-pixbuf`,name:`GdkPixbuf`,pkgName:`gdk-pixbuf-2.0`},pango:{id:`pango`,name:`Pango`,pkgName:`pango`},pangocairo:{id:`pangocairo`,name:`PangoCairo`,pkgName:`pangocairo`},webkitgtk:{id:`webkitgtk`,name:`WebKitGTK`,pkgName:`webkitgtk-6.0`},cairo:{id:`cairo`,name:`Cairo`,pkgName:`cairo`},gnutls:{id:`gnutls`,name:`GnuTLS`,pkgName:`gnutls`},nghttp2:{id:`nghttp2`,name:`libnghttp2`,pkgName:`libnghttp2`},"json-glib":{id:`json-glib`,name:`JSON-GLib`,pkgName:`json-glib-1.0`},epoxy:{id:`epoxy`,name:`libepoxy`,pkgName:`epoxy`},"gst-webrtc":{id:`gst-webrtc`,name:`GStreamer WebRTC`,pkgName:`gstreamer-webrtc-1.0`}},yF={"@gjsify/gamepad":[`manette`],"@gjsify/speech-synthesis":[`spiel`],"@gjsify/webaudio":[`gstreamer`,`gst-app`],"@gjsify/iframe":[`webkitgtk`],"@gjsify/canvas2d":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/canvas2d-core":[`gdk-pixbuf`,`pango`,`pangocairo`,`cairo`],"@gjsify/dom-elements":[`gdk-pixbuf`],"@gjsify/webgl":[`gwebgl`,`gdk-pixbuf`,`epoxy`],"@gjsify/tls-native":[`gnutls`],"@gjsify/http2-native":[`nghttp2`],"@gjsify/rolldown-native":[`json-glib`],"@gjsify/webrtc-native":[`gstreamer`,`gst-webrtc`]},bF={apt:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`valac`,cargo:`cargo`,gtk4:`libgtk-4-dev`,libadwaita:`libadwaita-1-dev`,libsoup3:`libsoup-3.0-dev`,webkitgtk:`libwebkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection libgirepository1.0-dev`,manette:`libmanette-0.2-0 gir1.2-manette-0.2`,gstreamer:`libgstreamer1.0-dev`,"gst-app":`libgstreamer-plugins-base1.0-dev gir1.2-gst-plugins-base-1.0`,"gdk-pixbuf":`libgdk-pixbuf-2.0-dev`,pango:`libpango1.0-dev`,pangocairo:`libpango1.0-dev`,cairo:`libcairo2-dev`,gnutls:`libgnutls28-dev`,nghttp2:`libnghttp2-dev`,"json-glib":`libjson-glib-dev`,epoxy:`libepoxy-dev`},dnf:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf-pkg-config`,meson:`meson`,ninja:`ninja-build`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup3-devel`,webkitgtk:`webkitgtk6.0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-devel`,gstreamer:`gstreamer1-devel`,"gst-app":`gstreamer1-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf2-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`gnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},pacman:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup3`,webkitgtk:`webkitgtk-6.0`,"gobject-introspection":`gobject-introspection`,manette:`libmanette`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf2`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`libnghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},zypper:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkg-config`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4-devel`,libadwaita:`libadwaita-devel`,libsoup3:`libsoup-3_0-devel`,webkitgtk:`webkitgtk6_0-devel`,"gobject-introspection":`gobject-introspection-devel`,manette:`libmanette-0_2-0-devel`,gstreamer:`gstreamer-devel`,"gst-app":`gstreamer-plugins-base-devel`,"gdk-pixbuf":`gdk-pixbuf-devel`,pango:`pango-devel`,pangocairo:`pango-devel`,cairo:`cairo-devel`,gnutls:`libgnutls-devel`,nghttp2:`libnghttp2-devel`,"json-glib":`json-glib-devel`,epoxy:`libepoxy-devel`},apk:{nodejs:`nodejs`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`cargo`,gtk4:`gtk4.0-dev`,libadwaita:`libadwaita-dev`,libsoup3:`libsoup3-dev`,webkitgtk:`webkit2gtk-6.0-dev`,"gobject-introspection":`gobject-introspection-dev`,manette:`libmanette-dev`,gstreamer:`gstreamer-dev`,"gst-app":`gst-plugins-base-dev`,"gdk-pixbuf":`gdk-pixbuf-dev`,pango:`pango-dev`,pangocairo:`pango-dev`,cairo:`cairo-dev`,gnutls:`gnutls-dev`,nghttp2:`nghttp2-dev`,"json-glib":`json-glib-dev`,epoxy:`libepoxy-dev`},brew:{nodejs:`node`,gjs:`gjs`,"pkg-config":`pkgconf`,meson:`meson`,ninja:`ninja`,vala:`vala`,cargo:`rust`,gtk4:`gtk4`,libadwaita:`libadwaita`,libsoup3:`libsoup`,"gobject-introspection":`gobject-introspection`,gstreamer:`gstreamer`,"gst-app":`gst-plugins-base`,"gdk-pixbuf":`gdk-pixbuf`,pango:`pango`,pangocairo:`pango`,cairo:`cairo`,gnutls:`gnutls`,nghttp2:`nghttp2`,"json-glib":`json-glib`,epoxy:`libepoxy`},winget:{"msvc-runtime":`Microsoft.VCRedist.2015+.x64`},unknown:{}},xF={apt:`sudo apt install`,dnf:`sudo dnf install`,pacman:`sudo pacman -S`,zypper:`sudo zypper install`,apk:`sudo apk add`,brew:`brew install`,winget:`winget install --id`,unknown:``},SF=[{pkgConfig:`gtk4`,typePackage:`@girs/gtk-4.0`,namespaceVersion:`4.0`},{pkgConfig:`libadwaita-1`,typePackage:`@girs/adw-1`,namespaceVersion:`1`},{pkgConfig:`libsoup-3.0`,typePackage:`@girs/soup-3.0`,namespaceVersion:`3.0`},{pkgConfig:`glib-2.0`,typePackage:`@girs/glib-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gobject-2.0`,typePackage:`@girs/gobject-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gio-2.0`,typePackage:`@girs/gio-2.0`,namespaceVersion:`2.0`},{pkgConfig:`gstreamer-1.0`,typePackage:`@girs/gst-1.0`,namespaceVersion:`1.0`},{pkgConfig:`webkitgtk-6.0`,typePackage:`@girs/webkit-6.0`,namespaceVersion:`6.0`},{pkgConfig:`manette-0.2`,typePackage:`@girs/manette-0.2`,namespaceVersion:`0.2`},{pkgConfig:`pango`,typePackage:`@girs/pango-1.0`,namespaceVersion:`1.0`},{pkgConfig:`harfbuzz`,typePackage:`@girs/harfbuzz-0.0`,namespaceVersion:`0.0`}]});function parsePlatformToken(t){let n=t.endsWith(EF),S=n?t.slice(0,-5):t,C=S.indexOf(`-`),N=C<0?S:S.slice(0,C);return{os:N,arch:C<0?``:S.slice(C+1),libc:n&&N===`linux`?`musl`:null}}function canonicalPlatformToken(t){let{os:n,arch:S,libc:C}=parsePlatformToken(t);if(!S)return t;let N=`${n}-${TF[S]??S}`;return C===`musl`||t.endsWith(EF)?`${N}${EF}`:N}function hostPlatformTokens(t,n,S){let C=`${t}-${n}`;return S===`musl`&&t===`linux`?[`${C}${EF}`,C]:[C]}function prebuildDirCandidates(t,n,S,C){let N=hostPlatformTokens(t,n,C),F=wF[n]??n,I=[],push=t=>{I.includes(t)||I.push(t)};for(let t of N){for(let n of S??[])typeof n==`string`&&canonicalPlatformToken(n)===t&&push(n);push(t)}return push(`${t}-${F}`),I}function resolvePrebuildDirName(t){let{platform:n,arch:S,declaredPlatforms:C,existingDirs:N,libc:F}=t;for(let t of prebuildDirCandidates(n,S,C,F))if(N.includes(t))return t;return null}function platformPackageName(t,n){return`${t}-${n}`}function scanNodeModules(t,n){let S=[],C=[];if(!existsSync(t))return{resolved:S,declared:C};let N;try{N=readdirSync(t)}catch{return{resolved:S,declared:C}}let take=t=>{t&&(t.kind===`resolved`?S.push(t.pkg):C.push(t.candidate))};for(let S of N)if(!S.startsWith(`.`))if(S.startsWith(`@`)){let C=On(t,S),N;try{N=readdirSync(C)}catch{continue}for(let t of N)take(checkPackage(On(C,t),`${S}/${t}`,n))}else take(checkPackage(On(t,S),S,n));return{resolved:S,declared:C}}function checkPackage(t,n,S){let C=readPackageJson$2(On(t,`package.json`));if(!C)return null;let N=C.gjsify;if(!N||typeof N!=`object`)return null;let F=N,I=F.prebuilds;if(typeof I!=`string`)return null;let H=F.platforms,W=Array.isArray(H)?H.filter(t=>typeof t==`string`):void 0,q=On(t,I),Y;try{Y=readdirSync(q,{withFileTypes:!0}).filter(t=>t.isDirectory()||t.isSymbolicLink()).map(t=>t.name)}catch{return{kind:`declared`,candidate:{name:n,pkgDir:t}}}let X=resolvePrebuildDirName({platform:S.platform,arch:S.arch,declaredPlatforms:W,existingDirs:Y,libc:S.libc});return X?{kind:`resolved`,pkg:{name:n,prebuildsDir:On(q,X)}}:{kind:`declared`,candidate:{name:n,pkgDir:t}}}function resolvePlatformSibling(t,n){let S=hostPlatformTokens(n.platform,n.arch,n.libc),C=$(t.pkgDir);for(;;){for(let N of S){let S=platformPackageName(t.name,N),F=checkPackage(On(C,`node_modules`,...S.split(`/`)),S,n);if(F?.kind===`resolved`)return F.pkg}let N=$(C,`..`);if(N===C)return null;C=N}}function detectNativePackages(t,n={}){let S={platform:n.platform??process.platform,arch:n.arch??process.arch,libc:n.libc===void 0?detectHostLibc(n.platform??process.platform):n.libc},C=[],N=new Set,F=[],I=$(t);for(;;){let t=On(I,`node_modules`);if(existsSync(t)){let n=scanNodeModules(t,S);for(let t of n.resolved)N.has(t.name)||(N.add(t.name),C.push(t));for(let t of n.declared)F.some(n=>n.name===t.name)||F.push(t)}let n=$(I,`..`);if(n===I)break;I=n}for(let t of F){if(N.has(t.name))continue;let n=resolvePlatformSibling(t,S);!n||N.has(n.name)||(N.add(n.name),C.push(n))}return C}function resolveHostLibc(t){return t.platform===`linux`?typeof t.glibcVersionRuntime==`string`&&t.glibcVersionRuntime.length>0?`glibc`:t.muslLoaderPresent?`musl`:`glibc`:null}function detectHostLibc(t){if(t!==`linux`)return null;let n=process.report?.getReport()?.header;return resolveHostLibc({platform:t,glibcVersionRuntime:typeof n?.glibcVersionRuntime==`string`?n.glibcVersionRuntime:void 0,muslLoaderPresent:existsSync(`/lib`)&&readdirSync(`/lib`).some(t=>t.startsWith(`ld-musl-`))})}function muslPrebuildFallbacks(t,n){return t===`musl`?n.filter(t=>parsePlatformToken(Mn(t.prebuildsDir)).libc!==`musl`).map(t=>t.name):[]}function libraryPathVar(t){return t===`darwin`?{name:`DYLD_LIBRARY_PATH`,separator:`:`}:t===`win32`?{name:`PATH`,separator:`;`}:{name:`LD_LIBRARY_PATH`,separator:`:`}}function buildNativeEnv(t,n={}){let S=n.platform??process.platform,C=n.env??process.env,N=t.map(t=>t.prebuildsDir),F=S===`win32`?`;`:`:`,{name:I,separator:H}=libraryPathVar(S),W=S===`win32`?Object.keys(C).find(t=>t.toLowerCase()===I.toLowerCase())??I:I,prepend=(t,n)=>[...N,...t?[t]:[]].join(n),q={GI_TYPELIB_PATH:prepend(C.GI_TYPELIB_PATH,F)};q[W]=prepend(C[W],H);let Y=(n.systemGiDirs??systemGiLibraryDirs)({platform:S,env:C});return Y.length>0&&(q[DF]=composeDyldFallback(Y,C)),q}var wF,TF,EF,DF,OF=__esmMin(()=>{Ud(),zn(),iF(),mF(),wF={x64:`x86_64`,arm64:`aarch64`,arm:`armv7`,ia32:`i686`},TF={x86_64:`x64`,amd64:`x64`,aarch64:`arm64`},EF=`-musl`,DF=`DYLD_FALLBACK_LIBRARY_PATH`});function defaultRepository(){let t=(globalThis.imports?.gi)?.GIRepository?.Repository;return typeof t?.dup_default==`function`?t.dup_default():null}function activateNativePrebuilds(){if(kF)return kF;kF=[];try{let t=defaultRepository();if(!t)return kF;let n=detectNativePackages(process.cwd()),S=new Set(n.map(t=>t.name)),C=detectNativePackages(jn(fileURLToPath(import.meta.url))),N=[...n,...C.filter(t=>!S.has(t.name))];for(let n of N)t.prepend_search_path(n.prebuildsDir),t.prepend_library_path(n.prebuildsDir);kF=N}catch{}return kF}var kF,AF=__esmMin(()=>{zn(),Xn(),OF(),kF=null});async function loadNpmRolldown(){if(isGjs())throw Error("gjsify build: no usable bundler engine under GJS — `@gjsify/rolldown-native` is not loadable, and the npm `rolldown` engine is a Rust napi crate that cannot run under GJS.\n"+diagnoseNativeEngine());return(await import(resolveImportTargetForGjs(`rolldown`))).rolldown}function diagnoseNativeEngine(){let t=null;try{let n=jn(fileURLToPath(import.meta.url));t=findRolldownNativeDir(process.cwd(),n)}catch{t=null}if(t===null)return`\`@gjsify/rolldown-native\` is NOT INSTALLED — no node_modules/@gjsify/rolldown-native was found walking up from ${process.cwd()} or from the CLI bundle's own directory.\nInstall it: \`gjsify install @gjsify/rolldown-native\` (in the gjsify repo: \`gjsify install\`). Running the build under Node also works — there the npm \`rolldown\` crate is used instead.`;let n=On(t,`lib`,`esm`,`index.js`);if(!existsSync(n))return`The engine's JS facade is NOT BUILT: ${n} does not exist.\nIt is a BUILD OUTPUT, so this is almost certainly a clone of the gjsify REPOSITORY rather than a consumer install: in a clone, node_modules/@gjsify/rolldown-native is a symlink to the workspace package, whose \`lib/\` no \`gjsify install\` produces. An installed package from npm is NOT affected — the published tarball does contain \`lib/esm/index.js\` (verified against 0.26.1), so a consumer that hit this message should report it.
791
791
  Build it from the gjsify repo root — both are idempotent and skip already-built facades in seconds, and NEITHER requires Node any more:
792
792
  gjsify run build:infra # the full cold-tree chain
793
793
  gjsify run --node-script scripts/bootstrap-native-facades.mjs # just the facades
@@ -194,6 +194,7 @@ export function checkMsvcRuntime() {
194
194
  /** Optional system deps keyed by their DepCheck id. Exported for the spec's declaration invariant. */
195
195
  export const OPTIONAL_DEPS = {
196
196
  manette: { id: 'manette', name: 'libmanette', pkgName: 'manette-0.2' },
197
+ spiel: { id: 'spiel', name: 'libspiel', pkgName: 'spiel-1.0' },
197
198
  gstreamer: { id: 'gstreamer', name: 'GStreamer', pkgName: 'gstreamer-1.0' },
198
199
  'gst-app': { id: 'gst-app', name: 'GStreamer App', pkgName: 'gstreamer-app-1.0' },
199
200
  'gdk-pixbuf': { id: 'gdk-pixbuf', name: 'GdkPixbuf', pkgName: 'gdk-pixbuf-2.0' },
@@ -278,6 +279,7 @@ export function missingSystemDepsFor(packageName) {
278
279
  */
279
280
  export const PACKAGE_DEPS = {
280
281
  '@gjsify/gamepad': ['manette'],
282
+ '@gjsify/speech-synthesis': ['spiel'],
281
283
  '@gjsify/webaudio': ['gstreamer', 'gst-app'],
282
284
  '@gjsify/iframe': ['webkitgtk'],
283
285
  '@gjsify/canvas2d': ['gdk-pixbuf', 'pango', 'pangocairo', 'cairo'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cli",
3
- "version": "0.64.12-next.279",
3
+ "version": "0.64.12-next.280",
4
4
  "description": "CLI for Gjsify",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -142,22 +142,22 @@
142
142
  "cli"
143
143
  ],
144
144
  "dependencies": {
145
- "@gjsify/blueprint": "0.64.12-next.279",
146
- "@gjsify/buffer": "0.64.12-next.279",
147
- "@gjsify/create-app": "0.64.12-next.279",
148
- "@gjsify/node-globals": "0.64.12-next.279",
149
- "@gjsify/node-polyfills": "0.64.12-next.279",
150
- "@gjsify/npm-registry": "0.64.12-next.279",
151
- "@gjsify/resolve-npm": "0.64.12-next.279",
152
- "@gjsify/rolldown-plugin-gjsify": "0.64.12-next.279",
153
- "@gjsify/vite-plugin-blueprint": "0.64.12-next.279",
154
- "@gjsify/rolldown-plugin-pnp": "0.64.12-next.279",
155
- "@gjsify/semver": "0.64.12-next.279",
156
- "@gjsify/tar": "0.64.12-next.279",
157
- "@gjsify/tsc": "0.64.12-next.279",
158
- "@gjsify/utils": "0.64.12-next.279",
159
- "@gjsify/web-polyfills": "0.64.12-next.279",
160
- "@gjsify/workspace": "0.64.12-next.279",
145
+ "@gjsify/blueprint": "0.64.12-next.280",
146
+ "@gjsify/buffer": "0.64.12-next.280",
147
+ "@gjsify/create-app": "0.64.12-next.280",
148
+ "@gjsify/node-globals": "0.64.12-next.280",
149
+ "@gjsify/node-polyfills": "0.64.12-next.280",
150
+ "@gjsify/npm-registry": "0.64.12-next.280",
151
+ "@gjsify/resolve-npm": "0.64.12-next.280",
152
+ "@gjsify/rolldown-plugin-gjsify": "0.64.12-next.280",
153
+ "@gjsify/vite-plugin-blueprint": "0.64.12-next.280",
154
+ "@gjsify/rolldown-plugin-pnp": "0.64.12-next.280",
155
+ "@gjsify/semver": "0.64.12-next.280",
156
+ "@gjsify/tar": "0.64.12-next.280",
157
+ "@gjsify/tsc": "0.64.12-next.280",
158
+ "@gjsify/utils": "0.64.12-next.280",
159
+ "@gjsify/web-polyfills": "0.64.12-next.280",
160
+ "@gjsify/workspace": "0.64.12-next.280",
161
161
  "acorn": "^8.17.0",
162
162
  "cosmiconfig": "^9.0.2",
163
163
  "get-tsconfig": "^4.14.0",
@@ -166,13 +166,13 @@
166
166
  "yargs": "^18.0.0"
167
167
  },
168
168
  "devDependencies": {
169
- "@gjsify/unit": "0.64.12-next.279",
169
+ "@gjsify/unit": "0.64.12-next.280",
170
170
  "@types/yargs": "^17.0.35",
171
171
  "typescript": "^6.0.3"
172
172
  },
173
173
  "peerDependencies": {
174
- "@gjsify/oxfmt-native": "0.64.12-next.279",
175
- "@gjsify/rolldown-native": "0.64.12-next.279"
174
+ "@gjsify/oxfmt-native": "0.64.12-next.280",
175
+ "@gjsify/rolldown-native": "0.64.12-next.280"
176
176
  },
177
177
  "peerDependenciesMeta": {
178
178
  "@gjsify/oxfmt-native": {
@@ -192,5 +192,5 @@
192
192
  "url": "https://github.com/gjsify/gjsify/issues"
193
193
  },
194
194
  "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/cli#readme",
195
- "gitHead": "e9026ad9f11b386102628e9e6fb93cb8b6cbd5ee"
195
+ "gitHead": "0a9185d91127072fce6aa54dc126e87e6ecd0c3d"
196
196
  }