@upstart.gg/sdk 0.0.78 → 0.0.80
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/node/cli/api.js +3 -3
- package/dist/node/cli/commands/build/cmd-build.js +1 -1
- package/dist/node/cli/commands/login/cmd-login.js +8 -8
- package/dist/node/cli/commands/logout/cmd-logout.js +3 -3
- package/dist/node/cli/commands/publish/cmd-publish.js +19 -19
- package/dist/node/cli/commands/publish/parse-gitignore.d.ts +1 -1
- package/dist/node/cli/commands/publish/parse-gitignore.js +2 -2
- package/dist/node/cli/commands/publish/uploader.js +6 -6
- package/dist/node/cli/constants.d.ts +2 -2
- package/dist/node/cli/constants.d.ts.map +1 -1
- package/dist/node/cli/constants.js +2 -2
- package/dist/node/cli/is-logged-in.js +3 -3
- package/dist/node/cli/program.js +16 -16
- package/dist/node/cli/store.js +2 -2
- package/dist/node/cli/types.js +1 -1
- package/dist/node/cli/utils.js +1 -1
- package/dist/node/shared/config.d.ts +1 -1
- package/dist/node/shared/config.d.ts.map +1 -1
- package/dist/node/shared/config.js +6 -6
- package/dist/node/shared/logger.d.ts +2 -2
- package/dist/node/shared/logger.d.ts.map +1 -1
- package/dist/node/shared/logger.js +3 -3
- package/dist/shared/ajv.d.ts +1 -0
- package/dist/shared/ajv.d.ts.map +1 -1
- package/dist/shared/ajv.js +2 -2
- package/dist/shared/analytics/init.js +1 -1
- package/dist/shared/analytics/track.js +1 -1
- package/dist/shared/analytics/types.js +1 -1
- package/dist/shared/attributes.d.ts +18 -13
- package/dist/shared/attributes.d.ts.map +1 -1
- package/dist/shared/attributes.js +2 -2
- package/dist/shared/brick-manifest.d.ts +95 -46
- package/dist/shared/brick-manifest.d.ts.map +1 -1
- package/dist/shared/brick-manifest.js +2 -2
- package/dist/shared/bricks/manifests/all-manifests.d.ts +2 -3
- package/dist/shared/bricks/manifests/all-manifests.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/all-manifests.js +2 -2
- package/dist/shared/bricks/manifests/button.manifest.d.ts +43 -124
- package/dist/shared/bricks/manifests/button.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/button.manifest.js +2 -2
- package/dist/shared/bricks/manifests/card.manifest.d.ts +76 -137
- package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/card.manifest.js +2 -2
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts +40 -124
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/carousel.manifest.js +2 -2
- package/dist/shared/bricks/manifests/container.manifest.d.ts +205 -123
- package/dist/shared/bricks/manifests/container.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/container.manifest.js +2 -2
- package/dist/shared/bricks/manifests/countdown.manifest.d.ts +40 -76
- package/dist/shared/bricks/manifests/countdown.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/countdown.manifest.js +2 -2
- package/dist/shared/bricks/manifests/footer.manifest.d.ts +64 -75
- package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/footer.manifest.js +2 -2
- package/dist/shared/bricks/manifests/form.manifest.d.ts +40 -78
- package/dist/shared/bricks/manifests/form.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/form.manifest.js +2 -2
- package/dist/shared/bricks/manifests/generic-component.manifest.d.ts +43 -124
- package/dist/shared/bricks/manifests/generic-component.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/generic-component.manifest.js +2 -2
- package/dist/shared/bricks/manifests/header.manifest.d.ts +257 -75
- package/dist/shared/bricks/manifests/header.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/header.manifest.js +2 -2
- package/dist/shared/bricks/manifests/hero.manifest.d.ts +100 -113
- package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/hero.manifest.js +2 -2
- package/dist/shared/bricks/manifests/icon.manifest.d.ts +40 -76
- package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/icon.manifest.js +2 -2
- package/dist/shared/bricks/manifests/image.manifest.d.ts +84 -77
- package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/image.manifest.js +2 -2
- package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts +184 -0
- package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/images-gallery.manifest.js +3 -0
- package/dist/shared/bricks/manifests/map.manifest.d.ts +40 -74
- package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/map.manifest.js +2 -2
- package/dist/shared/bricks/manifests/sidebar.manifest.d.ts +57 -0
- package/dist/shared/bricks/manifests/sidebar.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/sidebar.manifest.js +3 -0
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts +40 -76
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/social-links.manifest.js +2 -2
- package/dist/shared/bricks/manifests/tests/header.manifest.test.d.ts +2 -0
- package/dist/shared/bricks/manifests/tests/header.manifest.test.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/text.manifest.d.ts +87 -118
- package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/text.manifest.js +2 -2
- package/dist/shared/bricks/manifests/video.manifest.d.ts +40 -78
- package/dist/shared/bricks/manifests/video.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/video.manifest.js +2 -2
- package/dist/shared/bricks/props/_docs-common-styles.d.ts +59 -0
- package/dist/shared/bricks/props/_docs-common-styles.d.ts.map +1 -0
- package/dist/shared/bricks/props/_docs-common-styles.js +3 -0
- package/dist/shared/bricks/props/_style-presets.d.ts +18 -0
- package/dist/shared/bricks/props/_style-presets.d.ts.map +1 -0
- package/dist/shared/bricks/props/_style-presets.js +3 -0
- package/dist/shared/bricks/props/align.d.ts +15 -0
- package/dist/shared/bricks/props/align.d.ts.map +1 -0
- package/dist/shared/bricks/props/align.js +3 -0
- package/dist/shared/bricks/props/background.d.ts +23 -0
- package/dist/shared/bricks/props/background.d.ts.map +1 -0
- package/dist/shared/bricks/props/background.js +3 -0
- package/dist/shared/bricks/props/boolean.d.ts +4 -0
- package/dist/shared/bricks/props/boolean.d.ts.map +1 -0
- package/dist/shared/bricks/props/boolean.js +3 -0
- package/dist/shared/bricks/props/border.d.ts +27 -0
- package/dist/shared/bricks/props/border.d.ts.map +1 -0
- package/dist/shared/bricks/props/border.js +3 -0
- package/dist/shared/bricks/props/common.d.ts +5 -39
- package/dist/shared/bricks/props/common.d.ts.map +1 -1
- package/dist/shared/bricks/props/common.js +2 -2
- package/dist/shared/bricks/props/container.d.ts +73 -0
- package/dist/shared/bricks/props/container.d.ts.map +1 -0
- package/dist/shared/bricks/props/container.js +3 -0
- package/dist/shared/bricks/props/datasource.d.ts +18 -0
- package/dist/shared/bricks/props/datasource.d.ts.map +1 -0
- package/dist/shared/bricks/props/datasource.js +3 -0
- package/dist/shared/bricks/props/effects.d.ts +39 -0
- package/dist/shared/bricks/props/effects.d.ts.map +1 -0
- package/dist/shared/bricks/props/effects.js +3 -0
- package/dist/shared/bricks/props/helpers.d.ts +29 -0
- package/dist/shared/bricks/props/helpers.d.ts.map +1 -0
- package/dist/shared/bricks/props/helpers.js +3 -0
- package/dist/shared/bricks/props/image.d.ts +15 -0
- package/dist/shared/bricks/props/image.d.ts.map +1 -0
- package/dist/shared/bricks/props/image.js +3 -0
- package/dist/shared/bricks/props/number.d.ts +6 -0
- package/dist/shared/bricks/props/number.d.ts.map +1 -0
- package/dist/shared/bricks/props/number.js +3 -0
- package/dist/shared/bricks/props/padding.d.ts +4 -0
- package/dist/shared/bricks/props/padding.d.ts.map +1 -0
- package/dist/shared/bricks/props/padding.js +3 -0
- package/dist/shared/bricks/props/position.d.ts +6 -0
- package/dist/shared/bricks/props/position.d.ts.map +1 -0
- package/dist/shared/bricks/props/position.js +3 -0
- package/dist/shared/bricks/props/string.d.ts +11 -0
- package/dist/shared/bricks/props/string.d.ts.map +1 -0
- package/dist/shared/bricks/props/string.js +3 -0
- package/dist/shared/bricks/props/tests/align.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/align.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/background.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/background.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/border.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/border.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/container.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/container.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/effects.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/effects.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/helpers.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/helpers.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/image.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/image.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/padding.d.ts +2 -0
- package/dist/shared/bricks/props/tests/padding.d.ts.map +1 -0
- package/dist/shared/bricks/props/tests/string.test.d.ts +2 -0
- package/dist/shared/bricks/props/tests/string.test.d.ts.map +1 -0
- package/dist/shared/bricks/props/text.d.ts +14 -0
- package/dist/shared/bricks/props/text.d.ts.map +1 -0
- package/dist/shared/bricks/props/text.js +3 -0
- package/dist/shared/bricks/props/types.d.ts +43 -0
- package/dist/shared/bricks/props/types.d.ts.map +1 -0
- package/dist/shared/bricks/props/types.js +2 -0
- package/dist/shared/bricks.d.ts +88 -1527
- package/dist/shared/bricks.d.ts.map +1 -1
- package/dist/shared/bricks.js +2 -2
- package/dist/shared/chunk-3CY6AZG7.js +3 -0
- package/dist/shared/chunk-3YDMOB7M.js +3 -0
- package/dist/shared/{chunk-X7ABR5GQ.js → chunk-6GYFUI5C.js} +2 -2
- package/dist/shared/chunk-6I4PY5WS.js +3 -0
- package/dist/shared/{chunk-KXVIWTJN.js → chunk-7XTKGW6E.js} +1 -1
- package/dist/shared/chunk-AZ63RF3K.js +3 -0
- package/dist/shared/chunk-BK6LBWDI.js +3 -0
- package/dist/shared/chunk-BMDB2V7J.js +3 -0
- package/dist/shared/chunk-CSBX76ZN.js +3 -0
- package/dist/shared/chunk-DAPQ4JPP.js +3 -0
- package/dist/shared/chunk-EFJQECVB.js +3 -0
- package/dist/shared/chunk-F2ZVIFHO.js +3 -0
- package/dist/shared/chunk-FGU4BGP4.js +3 -0
- package/dist/shared/chunk-H6L4KRCJ.js +3 -0
- package/dist/shared/chunk-HIZPJNEM.js +3 -0
- package/dist/shared/chunk-HW5TY2QW.js +3 -0
- package/dist/shared/chunk-IWSVY2VC.js +3 -0
- package/dist/shared/chunk-JVDUEZYO.js +3 -0
- package/dist/shared/chunk-KB4HY432.js +3 -0
- package/dist/shared/chunk-LDOM2LJF.js +3 -0
- package/dist/shared/chunk-NFU5BF6G.js +3 -0
- package/dist/shared/{chunk-A3ACTIE3.js → chunk-NNVPTAAH.js} +1 -1
- package/dist/shared/chunk-P5FVZ5PL.js +3 -0
- package/dist/shared/chunk-P7WL7MYK.js +3 -0
- package/dist/shared/chunk-PD7P5KSV.js +3 -0
- package/dist/shared/chunk-PJ6HA55L.js +3 -0
- package/dist/shared/chunk-PSSJMWGU.js +3 -0
- package/dist/shared/chunk-Q4MXTCE4.js +8 -0
- package/dist/shared/chunk-QRBMK5UX.js +3 -0
- package/dist/shared/chunk-RBYYMUOZ.js +3 -0
- package/dist/shared/chunk-SO5M7CYA.js +3 -0
- package/dist/shared/chunk-SQVL4WSX.js +3 -0
- package/dist/shared/chunk-TQ23UATQ.js +3 -0
- package/dist/shared/chunk-U44NTSIO.js +3 -0
- package/dist/shared/chunk-U4R5EGBK.js +3 -0
- package/dist/shared/chunk-WJ5CDDXW.js +3 -0
- package/dist/shared/chunk-WOEBR25A.js +3 -0
- package/dist/shared/chunk-WPTVLIYS.js +3 -0
- package/dist/shared/{chunk-XGI243DO.js → chunk-WXKRIUTA.js} +1 -1
- package/dist/shared/chunk-XBX6II3M.js +3 -0
- package/dist/shared/chunk-XEQ2XZLQ.js +3 -0
- package/dist/shared/chunk-XGCBIXOO.js +3 -0
- package/dist/shared/chunk-XYID4ZEA.js +3 -0
- package/dist/shared/chunk-ZWVJMSTT.js +3 -0
- package/dist/shared/datarecords/external/google/oauth/config.js +1 -1
- package/dist/shared/datarecords/types.d.ts +2 -2
- package/dist/shared/datarecords/types.js +1 -1
- package/dist/shared/datarecords.js +1 -1
- package/dist/shared/datasources/external/meta/oauth/config.js +2 -2
- package/dist/shared/datasources/external/tiktok/oauth/config.js +2 -2
- package/dist/shared/datasources/external/youtube/oauth/config.js +2 -2
- package/dist/shared/datasources/internal/job-board/schema.d.ts +87 -0
- package/dist/shared/datasources/internal/job-board/schema.d.ts.map +1 -0
- package/dist/shared/datasources/schemas.js +2 -2
- package/dist/shared/datasources/types.d.ts +2 -2
- package/dist/shared/datasources/types.js +2 -2
- package/dist/shared/datasources.js +1 -1
- package/dist/shared/env.d.ts +6 -6
- package/dist/shared/env.d.ts.map +1 -1
- package/dist/shared/env.js +1 -1
- package/dist/shared/errors.js +1 -1
- package/dist/shared/layout-constants.js +2 -2
- package/dist/shared/oauth.js +2 -2
- package/dist/shared/page.d.ts +155 -2331
- package/dist/shared/page.d.ts.map +1 -1
- package/dist/shared/page.js +2 -2
- package/dist/shared/responsive.js +1 -1
- package/dist/shared/template.d.ts +31 -0
- package/dist/shared/template.d.ts.map +1 -0
- package/dist/shared/template.js +3 -0
- package/dist/shared/tests/test-config.d.ts +1 -1
- package/dist/shared/tests/test-config.d.ts.map +1 -1
- package/dist/shared/theme.d.ts.map +1 -1
- package/dist/shared/theme.js +2 -2
- package/dist/shared/themes/all-themes.js +1 -1
- package/dist/shared/themes/color-system.d.ts +3 -5
- package/dist/shared/themes/color-system.d.ts.map +1 -1
- package/dist/shared/themes/color-system.js +2 -2
- package/dist/shared/utils/canvas-data-uri.d.ts +2 -0
- package/dist/shared/utils/canvas-data-uri.d.ts.map +1 -0
- package/dist/shared/utils/invariant.js +2 -2
- package/dist/shared/utils/merge.d.ts +2 -0
- package/dist/shared/utils/merge.d.ts.map +1 -0
- package/dist/shared/utils/merge.js +3 -0
- package/dist/shared/utils/object-hash.d.ts +2 -0
- package/dist/shared/utils/object-hash.d.ts.map +1 -0
- package/dist/shared/utils/try-catch.d.ts +7 -0
- package/dist/shared/utils/try-catch.d.ts.map +1 -0
- package/package.json +6 -5
- package/dist/shared/bricks/manifests/images-wall.manifest.d.ts +0 -95
- package/dist/shared/bricks/manifests/images-wall.manifest.d.ts.map +0 -1
- package/dist/shared/bricks/manifests/images-wall.manifest.js +0 -3
- package/dist/shared/bricks/manifests/loop.manifest.d.ts +0 -105
- package/dist/shared/bricks/manifests/loop.manifest.d.ts.map +0 -1
- package/dist/shared/bricks/manifests/loop.manifest.js +0 -3
- package/dist/shared/bricks/props/style-presets.d.ts +0 -10
- package/dist/shared/bricks/props/style-presets.d.ts.map +0 -1
- package/dist/shared/bricks/props/style-presets.js +0 -3
- package/dist/shared/bricks/props/style-props.d.ts +0 -90
- package/dist/shared/bricks/props/style-props.d.ts.map +0 -1
- package/dist/shared/bricks/props/style-props.js +0 -3
- package/dist/shared/chunk-3PPIJUXG.js +0 -32
- package/dist/shared/chunk-3T2OW4FE.js +0 -14
- package/dist/shared/chunk-5PE57DBS.js +0 -15
- package/dist/shared/chunk-6G2OUITX.js +0 -3
- package/dist/shared/chunk-6PCNIIO5.js +0 -3
- package/dist/shared/chunk-AVHF4FLR.js +0 -3
- package/dist/shared/chunk-G42AE2ZC.js +0 -13
- package/dist/shared/chunk-G4K7GJZO.js +0 -3
- package/dist/shared/chunk-GBKDJDGW.js +0 -3
- package/dist/shared/chunk-GUOQD446.js +0 -22
- package/dist/shared/chunk-MEMG6QPT.js +0 -3
- package/dist/shared/chunk-NYPOZ5T2.js +0 -13
- package/dist/shared/chunk-PXAK7ZJ3.js +0 -3
- package/dist/shared/chunk-PZCWP77P.js +0 -3
- package/dist/shared/chunk-QQ7YEIHB.js +0 -3
- package/dist/shared/chunk-RRTB52G4.js +0 -9
- package/dist/shared/chunk-UIKVMZNI.js +0 -13
- package/dist/shared/chunk-WGWJHVOE.js +0 -20
- package/dist/shared/chunk-WX4P2YIR.js +0 -11
- package/dist/shared/chunk-WXSQ2ZEK.js +0 -16
- package/dist/shared/chunk-XS5WCEA6.js +0 -16
- package/dist/shared/chunk-Y3TOGUNY.js +0 -9
- package/dist/shared/chunk-YSMFNK4R.js +0 -20
- package/dist/shared/chunk-YXGFGLKH.js +0 -16
- package/dist/shared/chunk-ZDZXB45C.js +0 -7
- package/dist/shared/chunk-ZWYM64YA.js +0 -8
- package/dist/shared/chunk-ZYVXEGAM.js +0 -11
package/dist/node/cli/program.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/
|
|
2
|
+
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
3
3
|
|
|
4
|
-
var Ur=Object.create;var ze=Object.defineProperty;var $r=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Br=Object.getPrototypeOf,zr=Object.prototype.hasOwnProperty;var pt=(i,t)=>()=>(i&&(t=i(i=0)),t);var _s=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Gr=(i,t)=>{for(var e in t)ze(i,e,{get:t[e],enumerable:!0})},Hr=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Wr(t))!zr.call(i,r)&&r!==e&&ze(i,r,{get:()=>t[r],enumerable:!(s=$r(t,r))||s.enumerable});return i};var qr=(i,t,e)=>(e=i!=null?Ur(Br(i)):{},Hr(t||!i||!i.__esModule?ze(e,"default",{value:i,enumerable:!0}):e,i));function ae(){let i;if(process.env.npm_config_user_agent){let t=process.env.npm_config_user_agent.split(" ")[0];i=t.slice(0,t.lastIndexOf("/"))}return i||(console.log("Warning: could not detect package manager"),i="npm"),i}function ks(i){return`[${i.error}]${i.error_description?`: ${i.error_description}`:""}`}var Ge=pt(()=>{"use strict"});var Ns,He,lt,Ec,Ds,Ps,Ls,Fs,
|
|
5
|
-
`)),{...s,success:(r,n)=>s.info(wt.green(r),n),error:(r,n)=>s.error(wt.red(r),n),warn:(r,n)=>s.warn(wt.yellow(r),n),warnOnce:(r,n)=>s.warnOnce(wt.yellow(r),n),debug:(r,n)=>{i==="debug"&&s.info(wt.gray(r),n)}}}var k,jt=pt(()=>{"use strict";js();k=qe()});var Gs={};Gr(Gs,{get:()=>mn,post:()=>it});async function it(i,t,e={}){
|
|
4
|
+
var Ur=Object.create;var ze=Object.defineProperty;var $r=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Br=Object.getPrototypeOf,zr=Object.prototype.hasOwnProperty;var pt=(i,t)=>()=>(i&&(t=i(i=0)),t);var _s=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Gr=(i,t)=>{for(var e in t)ze(i,e,{get:t[e],enumerable:!0})},Hr=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Wr(t))!zr.call(i,r)&&r!==e&&ze(i,r,{get:()=>t[r],enumerable:!(s=$r(t,r))||s.enumerable});return i};var qr=(i,t,e)=>(e=i!=null?Ur(Br(i)):{},Hr(t||!i||!i.__esModule?ze(e,"default",{value:i,enumerable:!0}):e,i));function ae(){let i;if(process.env.npm_config_user_agent){let t=process.env.npm_config_user_agent.split(" ")[0];i=t.slice(0,t.lastIndexOf("/"))}return i||(console.log("Warning: could not detect package manager"),i="npm"),i}function ks(i){return`[${i.error}]${i.error_description?`: ${i.error_description}`:""}`}var Ge=pt(()=>{"use strict"});var Ns,He,lt,Ec,Ds,Ps,Ls,Ms,Fs,ft=pt(()=>{"use strict";Ns="upstart-cli",He=process.env.PUBLIC_UPSTART_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",lt=process.env.PUBLIC_UPSTART_API_BASE_URL??"https://api.upstart.gg",Ec=process.env.PUBLIC_UPSTART_EDITOR_BASE_URL??"https://upstart.gg",Ds=10,Ps="oauth/devicecode",Ls="oauth/token",Ms="oauth/userinfo",Fs="v1/templates"});import Vr from"conf";import It from"node:path";import Kr from"node:crypto";import mt from"node:fs";import{fileURLToPath as Yr}from"node:url";import Jr from"chalk";function Is(){let i=F.get("access_token");if(!i){let t=ae();throw new Error(`Access token not found. Please run ${Jr.cyan(`${t} run enpage:login`)} to authenticate.`)}return i}function Qr(){let i=Xr;for(;i!==It.parse(i).root;){let t=It.join(i,"node_modules");if(mt.existsSync(t))return t;i=It.dirname(i)}return null}function tn(){let i=Qr();if(!i)throw new Error("Could not find nearest node_modules directory.");let t=It.join(i,".enpage-tmp");mt.existsSync(t)||mt.mkdirSync(t,{recursive:!0,mode:448});let e=It.join(t,".enpage-key");if(!mt.existsSync(e)){let r=Kr.randomBytes(32).toString("hex");return mt.writeFileSync(e,r,{mode:384,flush:!0}),r}return mt.readFileSync(e,"utf8")}var Xr,Zr,F,gt=pt(()=>{"use strict";ft();Ge();Xr=Yr(new URL(".",import.meta.url)),Zr=tn(),F=new Vr({projectName:Ns,encryptionKey:Zr,clearInvalidConfig:!0})});var Us,js=pt(()=>{Us="0.0.80"});import{createLogger as sn}from"vite";import wt from"chalk";function qe(i,t,e=!1){let s=sn(i==="debug"?"info":i,{prefix:"[upstart]",allowClearScreen:t});return e&&s.info(wt.hex("#7270c6").bold(`\u{1F680} Upstart v${Us}
|
|
5
|
+
`)),{...s,success:(r,n)=>s.info(wt.green(r),n),error:(r,n)=>s.error(wt.red(r),n),warn:(r,n)=>s.warn(wt.yellow(r),n),warnOnce:(r,n)=>s.warnOnce(wt.yellow(r),n),debug:(r,n)=>{i==="debug"&&s.info(wt.gray(r),n)}}}var k,jt=pt(()=>{"use strict";js();k=qe()});var Gs={};Gr(Gs,{get:()=>mn,post:()=>it});async function it(i,t,e={}){F.get("access_token")&&(e.Authorization=`Bearer ${F.get("access_token")}`);let s=await fetch(Bs(i),{method:"POST",headers:{"Content-Type":t instanceof URLSearchParams?"application/x-www-form-urlencoded":"application/json",...e},body:t instanceof URLSearchParams?t:JSON.stringify(t)}).catch(r=>{k.error(`Fatal Error requesting API: ${r.message} (${r.cause.code})`),k.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return zs(s)}async function mn(i,t={}){F.get("access_token")&&(t.Authorization=`Bearer ${F.get("access_token")}`);let e=await fetch(Bs(i),{headers:t,method:"GET"}).catch(s=>{k.error(`Fatal Error requesting API: ${s.message} (${s.cause.code})`),k.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return zs(e)}function Bs(i){let t=new URL(lt.endsWith("/")?lt:`${lt}/`);return new URL(i,t)}async function zs(i){let t=i.headers.get("content-type")?.startsWith("application/json")?await i.json():await i.text();return i.ok?{isSuccess:!0,isError:!1,status:i.status,statusText:i.statusText,data:t}:{isSuccess:!1,isError:!0,status:i.status,statusText:i.statusText,data:t}}var Ut=pt(()=>{"use strict";jt();ft();gt()});var oi=_s((Ih,ni)=>{"use strict";ni.exports=ii;function ii(i,t,e){i instanceof RegExp&&(i=si(i,e)),t instanceof RegExp&&(t=si(t,e));var s=ri(i,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+i.length,s[1]),post:e.slice(s[1]+t.length)}}function si(i,t){var e=t.match(i);return e?e[0]:null}ii.range=ri;function ri(i,t,e){var s,r,n,o,a,c=e.indexOf(i),h=e.indexOf(t,c+1),l=c;if(c>=0&&h>0){if(i===t)return[c,h];for(s=[],n=e.length;l>=0&&!a;)l==c?(s.push(l),c=e.indexOf(i,l+1)):s.length==1?a=[s.pop(),h]:(r=s.pop(),r<n&&(n=r,o=h),h=e.indexOf(t,l+1)),l=c<h&&c>=0?c:h;s.length&&(a=[n,o])}return a}});var pi=_s((jh,di)=>{"use strict";var ai=oi();di.exports=Kn;var ci="\0SLASH"+Math.random()+"\0",hi="\0OPEN"+Math.random()+"\0",Ke="\0CLOSE"+Math.random()+"\0",li="\0COMMA"+Math.random()+"\0",fi="\0PERIOD"+Math.random()+"\0";function Ve(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}function qn(i){return i.split("\\\\").join(ci).split("\\{").join(hi).split("\\}").join(Ke).split("\\,").join(li).split("\\.").join(fi)}function Vn(i){return i.split(ci).join("\\").split(hi).join("{").split(Ke).join("}").split(li).join(",").split(fi).join(".")}function ui(i){if(!i)return[""];var t=[],e=ai("{","}",i);if(!e)return i.split(",");var s=e.pre,r=e.body,n=e.post,o=s.split(",");o[o.length-1]+="{"+r+"}";var a=ui(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function Kn(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),zt(qn(i),!0).map(Vn)):[]}function Yn(i){return"{"+i+"}"}function Jn(i){return/^-?0\d/.test(i)}function Xn(i,t){return i<=t}function Zn(i,t){return i>=t}function zt(i,t){var e=[],s=ai("{","}",i);if(!s)return[i];var r=s.pre,n=s.post.length?zt(s.post,!1):[""];if(/\$$/.test(s.pre))for(var o=0;o<n.length;o++){var a=r+"{"+s.body+"}"+n[o];e.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),l=c||h,f=s.body.indexOf(",")>=0;if(!l&&!f)return s.post.match(/,.*\}/)?(i=s.pre+"{"+s.body+Ke+s.post,zt(i)):[i];var u;if(l)u=s.body.split(/\.\./);else if(u=ui(s.body),u.length===1&&(u=zt(u[0],!1).map(Yn),u.length===1))return n.map(function(oe){return s.pre+u[0]+oe});var d;if(l){var g=Ve(u[0]),p=Ve(u[1]),y=Math.max(u[0].length,u[1].length),m=u.length==3?Math.abs(Ve(u[2])):1,b=Xn,w=p<g;w&&(m*=-1,b=Zn);var S=u.some(Jn);d=[];for(var E=g;b(E,p);E+=m){var v;if(h)v=String.fromCharCode(E),v==="\\"&&(v="");else if(v=String(E),S){var C=y-v.length;if(C>0){var K=new Array(C+1).join("0");E<0?v="-"+K+v.slice(1):v=K+v}}d.push(v)}}else{d=[];for(var B=0;B<u.length;B++)d.push.apply(d,zt(u[B],!1))}for(var B=0;B<d.length;B++)for(var o=0;o<n.length;o++){var a=r+d[B]+n[o];(!t||l||a)&&e.push(a)}}return e}});import{program as Ft}from"commander";Ge();gt();import{resolve as X}from"node:path";import{existsSync as Bt,readFileSync as jn,writeFileSync as Un}from"node:fs";import rt from"chalk";ft();jt();import $t from"node:path";import Wt from"node:fs";import gn from"node:crypto";import wn from"fast-glob";import qs from"node:http";import yn from"node:https";import{pipeline as Sn}from"node:stream";import Hs from"chalk";import bn from"form-data";import*as ce from"node:fs";var rn=/[<>"|?*\n\r\t\f\x00-\x1F]/,nn=/(?:^|\/)[*]{2}($|\/)/,on=248,an=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),cn=i=>typeof i=="string"&&i.length<=on&&!rn.test(i),hn=i=>i.split(/\r\n?|\n/);var ln=i=>an(i)&&Array.isArray(i.patterns)&&Array.isArray(i.sections);var he=(i,t={})=>{let e=t.path;if(ln(i))return i;cn(i)&&ce.existsSync(i)&&(e=i,i=ce.readFileSync(i,"utf8"));let s=hn(i),r=new Map,n={sections:[],patterns:[]},o={name:"default",patterns:[]},a=null;for(let c of s){let h=c.trim();if(h.startsWith("#")){let[,l]=/^#+\s*(.*)\s*$/.exec(h)||[];if(a){r.delete(a.name),a.comment=a.comment?`${a.comment}
|
|
6
6
|
${h}`:h,a.name=l?`${a.name.trim()}
|
|
7
7
|
${l.trim()}`:a.name.trim(),r.set(a.name.toLowerCase().trim(),a);continue}o={name:l?.trim()||"",comment:h,patterns:[]},r.set(o.name.toLowerCase(),o),n.sections.push(o),a=o;continue}h!==""&&(o.patterns.push(h),n.patterns.push(h)),a=null}return(t.dedupe===!0||t.unique===!0)&&(n=$s(n,{...t,format:!1})),n.path=e,n.input=Buffer.from(i),n.format=c=>pn(n,{...t,...c}),n.dedupe=c=>$s(n,{...t,...c}),n.globs=c=>un(n,{path:e,...t,...c}),n};var $s=(i,t)=>{let e=he(i,{...t,dedupe:!1}),s=new Map,r={sections:[],patterns:[]},n;for(let o of e.sections){let{name:a="",comment:c,patterns:h}=o,l=a.trim().toLowerCase();for(let f of h)r.patterns.includes(f)||r.patterns.push(f);a&&s.has(l)?(n=s.get(l),n.patterns=[...n.patterns,...h]):(n={name:a,comment:c,patterns:h},r.sections.push(n),s.set(l,n))}for(let o of r.sections)o.patterns=[...new Set(o.patterns)];return r},fn=i=>{if(nn.test(i))return i;let t=!1;return i.startsWith("/")?(i=i.slice(1),t=!0):i.slice(1,i.length-1).includes("/")&&(t=!0),i+=i.endsWith("/")?"**/":"/**",t?i:`**/${i}`},un=(i,t={})=>{let e=he(i,t),s=[],r=0,n=e.patterns.concat(t.ignore||[]).concat((t.unignore||[]).map(a=>a.startsWith("!")?a:`!${a}`)),o=(a,c)=>{let h=s[s.length-1],l=a?"unignore":"ignore";h&&h.type===l?h.patterns.includes(c)||h.patterns.push(c):(s.push({type:l,path:t.path||null,patterns:[c],index:r}),r++)};for(let a of n){let c="";a.startsWith("!")&&(a=a.slice(1),c="!"),o(c,a.startsWith("/")?a.slice(1):a),o(c,fn(a))}return s},dn=(i={name:"",patterns:[]})=>{let t=[i.comment||""];return i.patterns?.length&&(t.push(i.patterns.join(`
|
|
8
8
|
`)),t.push("")),t.join(`
|
|
9
9
|
`)},pn=(i,t={})=>{let e=he(i,t),s=t.formatSection||dn,r=e.sections||e,n=[];for(let o of[].concat(r))n.push(s(o));return n.join(`
|
|
10
|
-
`)};var Ws=he;Ut();import En from"p-queue";import xn from"ora";import{customAlphabet as vn}from"nanoid";var yt=class extends Error{constructor(e,s,r){super(`${e}: ${s}`);this.error=e;this.error_description=s;this.filename=r;this.name="UploadError"}},Tn={maxDataSize:12*1024*1024,retryAttempts:2,retryDelay:1e3},Rn=new qs.Agent({keepAlive:!0,maxSockets:10,keepAliveMsecs:3e3});async function On(i){let t=$t.join(i,".gitignore"),s=Wt.existsSync(t)?Ws(Wt.readFileSync(t,"utf-8")).patterns:[];return wn("**/*",{cwd:i,onlyFiles:!0,dot:!0,absolute:!0,ignore:["node_modules/**",".cache/**","**/.DS_Store",".gitignore",".env",".env.*",".git/**","dist/**",...s]})}async function An(i,t,e,s,r,n,o){let a=async c=>{try{return await Cn(i,t,e,s,r,n,o)}catch(h){if(c<o.retryAttempts)return k.warn(`Retrying upload for ${t} (attempt ${c+1})`),await new Promise(l=>setTimeout(l,o.retryDelay)),a(c+1);throw h}};return a(0)}async function Cn(i,t,e,s,r,n,o){return new Promise((a,c)=>{let h=Wt.statSync(i),l=$t.basename(i),f=Date.now(),u=new bn({maxDataSize:o.maxDataSize}),d=Wt.createReadStream(i),g=0,p=w=>{g+=w.length};d.on("data",p),u.append("file",d,{filename:l,knownLength:h.size});let y={agent:Rn,method:"POST",headers:{authorization:`Bearer ${n}`,"x-
|
|
10
|
+
`)};var Ws=he;Ut();import En from"p-queue";import xn from"ora";import{customAlphabet as vn}from"nanoid";var yt=class extends Error{constructor(e,s,r){super(`${e}: ${s}`);this.error=e;this.error_description=s;this.filename=r;this.name="UploadError"}},Tn={maxDataSize:12*1024*1024,retryAttempts:2,retryDelay:1e3},Rn=new qs.Agent({keepAlive:!0,maxSockets:10,keepAliveMsecs:3e3});async function On(i){let t=$t.join(i,".gitignore"),s=Wt.existsSync(t)?Ws(Wt.readFileSync(t,"utf-8")).patterns:[];return wn("**/*",{cwd:i,onlyFiles:!0,dot:!0,absolute:!0,ignore:["node_modules/**",".cache/**","**/.DS_Store",".gitignore",".env",".env.*",".git/**","dist/**",...s]})}async function An(i,t,e,s,r,n,o){let a=async c=>{try{return await Cn(i,t,e,s,r,n,o)}catch(h){if(c<o.retryAttempts)return k.warn(`Retrying upload for ${t} (attempt ${c+1})`),await new Promise(l=>setTimeout(l,o.retryDelay)),a(c+1);throw h}};return a(0)}async function Cn(i,t,e,s,r,n,o){return new Promise((a,c)=>{let h=Wt.statSync(i),l=$t.basename(i),f=Date.now(),u=new bn({maxDataSize:o.maxDataSize}),d=Wt.createReadStream(i),g=0,p=w=>{g+=w.length};d.on("data",p),u.append("file",d,{filename:l,knownLength:h.size});let y={agent:Rn,method:"POST",headers:{authorization:`Bearer ${n}`,"x-upstart-template-file-path":t,"x-upstart-template-id":s,...u.getHeaders()}},b=(e.startsWith("https")?yn:qs).request(e,y,w=>{let S="";w.on("data",E=>{S+=E}),w.on("end",()=>{let E=Date.now(),v={fileName:l,fileSize:h.size,uploadDuration:E-f,statusCode:w.statusCode??0,serverResponse:S};if(w.statusCode&&w.statusCode>=200&&w.statusCode<300)r.text=`Uploaded ${t}`,a(v);else{let C;if(w.headers["content-type"]?.startsWith("application/json")){let K=JSON.parse(S);C=new yt(K.error||"unknown_error",K.error_description||"Unknown error occurred",t)}else C=new yt("unknown_error",S||"Unknown error occurred",t);r.fail(`Failed to upload ${t} [${C.error}] ${C.error_description}`),c(C)}})});b.on("error",w=>{c(new yt("request_error",w.message,t))}),Sn(u,b,w=>{w&&c(new yt("pipeline_error",`Pipeline failed for ${l}: ${w.message}`,t))})})}function _n(i,t,e){e.length>0?(k.error(Hs.red(`Failed to upload ${e.length} files:`)),e.forEach(s=>{let r=s.reason;k.error(`- ${r.filename}: ${r.error_description} (${r.error})`)})):k.info(Hs.green(`Uploaded ${t.length} files successfully for template ${i}.
|
|
11
11
|
`))}async function Vs(i,t,e,s=!1,r={}){let n={...Tn,...r},o=new En({concurrency:Ds}),a=await On(t),c=a.length,h={},l=Nn(),f=0;for(let m of a){let b=$t.relative(t,m),w=await kn(m);h[b]=w}s&&(k.info(`Dry run mode enabled. Skipping upload.
|
|
12
|
-
`),k.info("The following files would have been uploaded:"),a.forEach(m=>k.info(`- ${m}`)),process.exit(0));let u=xn(`Uploading ${c} files...`).start(),d=a.map(m=>{let b=$t.resolve(t,m),w=$t.relative(t,m),S=`${lt}/v1/templates/${i}/upload/${l}`;return o.add(async()=>{let E=await An(b,w,S,i,u,e,n);return f++,E})}),g=await Promise.allSettled(d);u.stop();let p=g.filter(m=>m.status==="fulfilled"),y=g.filter(m=>m.status==="rejected");if(_n(i,p.map(m=>m.value),y),!y.length&&p.length){let m=`${lt}/v1/templates/${i}/upload/${l}/finalize`,w=await it(m,{signatures:h});if(w.isError)return k.error(`Failed to finalize upload: ${w.data.error_description} (${w.data.error})`),{filesCount:c,uploadedFiles:p.map(S=>S.value),failedFiles:[],success:!1}}return{filesCount:c,uploadedFiles:p.map(m=>m.value),failedFiles:y,success:y.length===0}}async function kn(i){let t=await gn.subtle.digest("SHA-1",Wt.readFileSync(i));return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}function Nn(){let i=vn("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",5),t=new Date,e=t.getUTCFullYear(),s=(t.getUTCMonth()+1).toString().padStart(2,"0"),r=t.getUTCDate().toString().padStart(2,"0"),n=t.getUTCHours().toString().padStart(2,"0"),o=t.getUTCMinutes().toString().padStart(2,"0"),a=t.getUTCSeconds().toString().padStart(2,"0");return`${e}${s}${r}${n}${o}${a}_${i()}`}Ut();ft();import Qs from"node:path";import{Type as T}from"@sinclair/typebox";var Ks=T.Object({id:T.Optional(T.String({title:"Template ID",description:"A unique identifier for the template. Can be any string, but should be unique."})),name:T.String({title:"Template Name"}),description:T.Optional(T.String({title:"Show template description"})),readme:T.Optional(T.Record(T.RegExp(/^[a-z]{2}$/),T.String(),{title:"Readme texts.",description:"A dictionary of readme files for different languages (iso 2 letters code). Currently on supported for 'en' and 'fr'."})),tags:T.Optional(T.Array(T.String(),{title:"Tags"})),author:T.Optional(T.String({title:"Author name"})),thumbnail:T.Optional(T.String({title:"Thumbnail",description:"A URL to the thumbnail image for the template."})),homepage:T.Optional(T.String({title:"Homepage",description:"A URL to the homepage of the template."}))});jt();import Dn from"node:fs";import{readFile as Pn}from"node:fs/promises";import Ln from"fast-glob";import{fromError as
|
|
12
|
+
`),k.info("The following files would have been uploaded:"),a.forEach(m=>k.info(`- ${m}`)),process.exit(0));let u=xn(`Uploading ${c} files...`).start(),d=a.map(m=>{let b=$t.resolve(t,m),w=$t.relative(t,m),S=`${lt}/v1/templates/${i}/upload/${l}`;return o.add(async()=>{let E=await An(b,w,S,i,u,e,n);return f++,E})}),g=await Promise.allSettled(d);u.stop();let p=g.filter(m=>m.status==="fulfilled"),y=g.filter(m=>m.status==="rejected");if(_n(i,p.map(m=>m.value),y),!y.length&&p.length){let m=`${lt}/v1/templates/${i}/upload/${l}/finalize`,w=await it(m,{signatures:h});if(w.isError)return k.error(`Failed to finalize upload: ${w.data.error_description} (${w.data.error})`),{filesCount:c,uploadedFiles:p.map(S=>S.value),failedFiles:[],success:!1}}return{filesCount:c,uploadedFiles:p.map(m=>m.value),failedFiles:y,success:y.length===0}}async function kn(i){let t=await gn.subtle.digest("SHA-1",Wt.readFileSync(i));return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}function Nn(){let i=vn("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",5),t=new Date,e=t.getUTCFullYear(),s=(t.getUTCMonth()+1).toString().padStart(2,"0"),r=t.getUTCDate().toString().padStart(2,"0"),n=t.getUTCHours().toString().padStart(2,"0"),o=t.getUTCMinutes().toString().padStart(2,"0"),a=t.getUTCSeconds().toString().padStart(2,"0");return`${e}${s}${r}${n}${o}${a}_${i()}`}Ut();ft();import Qs from"node:path";import{Type as T}from"@sinclair/typebox";var Ks=T.Object({id:T.Optional(T.String({title:"Template ID",description:"A unique identifier for the template. Can be any string, but should be unique."})),name:T.String({title:"Template Name"}),description:T.Optional(T.String({title:"Show template description"})),readme:T.Optional(T.Record(T.RegExp(/^[a-z]{2}$/),T.String(),{title:"Readme texts.",description:"A dictionary of readme files for different languages (iso 2 letters code). Currently on supported for 'en' and 'fr'."})),tags:T.Optional(T.Array(T.String(),{title:"Tags"})),author:T.Optional(T.String({title:"Author name"})),thumbnail:T.Optional(T.String({title:"Thumbnail",description:"A URL to the thumbnail image for the template."})),homepage:T.Optional(T.String({title:"Homepage",description:"A URL to the homepage of the template."}))});jt();import Dn from"node:fs";import{readFile as Pn}from"node:fs/promises";import Ln from"fast-glob";import{fromError as Mn}from"zod-validation-error";import{basename as Ys,dirname as Fn,extname as In}from"node:path";async function Js(i,t=k){Dn.existsSync(i)||(t.error(`\u{1F534} No enpage.config.js found!
|
|
13
13
|
Your project must have an enpage.config.js file in the root directory.
|
|
14
14
|
|
|
15
|
-
`),process.exit(1));let e=await import(i),s=
|
|
16
|
-
`);let s=
|
|
15
|
+
`),process.exit(1));let e=await import(i),s=Fn(i),r={},n=await Ln(["README.enpage.md","README.enpage.*.md"],{cwd:s,onlyFiles:!0,absolute:!0,caseSensitiveMatch:!1});for(let o of n){let a=Ys(o,".md"),c=In(a),h=(c===".enpage"?"en":c.substring(1)).toLowerCase();t.debug(`Found template readme file (${h}): ${Ys(o)}`),r[h]=await Pn(o,"utf-8")}return e.manifest&&(e.manifest.readme=r),e}function Xs(i,t){for(let s in i.datasources)if(i.datasources[s].provider==="json"&&!i.datasources[s].sampleData)throw t.error(`\u{1F534} Error: Datasource "${s}" is missing sample data - nothing will be rendered during development! Please check your enpage.config.js file and add a "sampleData" key to your ${s} datasource.`),new Error(`Missing sample data for datasource "${s}"`);let e=Ks.safeParse(i.manifest);if(!e.success){t.error(`\u{1F534} Error: template manifest is invalid. Check your call to defineManifest().
|
|
16
|
+
`);let s=Mn(e.error);t.error(`Hint: ${s.toString()}
|
|
17
17
|
|
|
18
|
-
`),process.exit(1)}return i}ft();gt();async function Zs(i=!1){let t=
|
|
18
|
+
`),process.exit(1)}return i}ft();gt();async function Zs(i=!1){let t=F.get("access_token"),e=F.get("expires_at");if(!t)return!1;if(e&&e<Date.now())return console.log("Seems like your token expired..."),!1;if(!i)return!0;let{get:s}=await Promise.resolve().then(()=>(Ut(),Gs)),{isSuccess:r}=await s(Ms);return r}async function ti({options:i,args:t,logger:e}){if(!await Zs(!0)){let f=ae();e.error(` ${rt.redBright("Error")}: User token not found. Please run ${rt.cyan(`${f} run enpage:login`)} to authenticate or set the ${rt.cyan("ENPAGE_API_TOKEN")} environment variable.
|
|
19
19
|
`),process.exit(1)}let s=t.length?Qs.isAbsolute(t[0])?t[0]:X(process.cwd(),t[0]):process.cwd();Bt(s)||(e.error(` Template directory not found: ${s}. Aborting.
|
|
20
20
|
`),process.exit(1));let r=t.length>1?Qs.isAbsolute(t[1])?t[1]:X(process.cwd(),t[1]):X(s,"dist");Bt(r)||(e.error(` Dist directory not found: ${r}.
|
|
21
21
|
Please run 'build' before publishing. Aborting.
|
|
22
22
|
`),process.exit(1)),Bt(X(s,"enpage.config.js"))||(e.error(` ${rt.redBright("Error")}: file enpage.config.js not found in ${s}. Aborting.
|
|
23
23
|
`),process.exit(1));let n=await Js(X(s,"enpage.config.js"),e);Xs(n,e);let o=Is(),a=$n(s);a||(e.error(` ${rt.redBright("Error")}: package.json file not found in ${s}. Aborting.
|
|
24
24
|
`),process.exit(1));let c=await Wn(a);if(c||(e.error(` ${rt.redBright("Error")}: cannot read/parse package.json file in ${s}. Aborting.
|
|
25
|
-
`),process.exit(1)),!c.enpage?.id){let{data:f,isError:u,status:d}=await it(
|
|
25
|
+
`),process.exit(1)),!c.enpage?.id){let{data:f,isError:u,status:d}=await it(Fs,{manifest:n.manifest});u&&(e.error(` ${rt.redBright("Error")}: Cannot register template: ${ks(f)}
|
|
26
26
|
`),process.exit(1)),c.enpage??={},c.enpage.id=f.template.id;try{i.dryRun||Un(a,JSON.stringify(c,null,2))}catch{e.error(` ${rt.redBright("Error")}: Cannot update template id in package.json file located in ${s}. Aborting.
|
|
27
27
|
`),process.exit(1)}}let h=c.enpage.id;e.info(`Submitting template to Enpage...
|
|
28
28
|
`),(await Vs(h,s,o,i.dryRun)).success||(e.error(`
|
|
@@ -34,18 +34,18 @@ Please visit the following URL to login:
|
|
|
34
34
|
${r}
|
|
35
35
|
`),t.info(Bn.gray(`
|
|
36
36
|
Waiting for login...
|
|
37
|
-
`));let a=await Hn(n,t);a||(t.error("Login failed. Please try again."),process.exit(1)),
|
|
38
|
-
`),process.exitCode=0}import{build as Os}from"vite";import gc,{resolve as Fr}from"node:path";import{fileURLToPath as wc}from"node:url";var xi=qr(pi(),1);var Gt=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var Qn={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ht=i=>i.replace(/[[\]\\-]/g,"\\$&"),to=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mi=i=>i.join(""),gi=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=e+1,o=!1,a=!1,c=!1,h=!1,l=e,f="";t:for(;n<i.length;){let p=i.charAt(n);if((p==="!"||p==="^")&&n===e+1){h=!0,n++;continue}if(p==="]"&&o&&!c){l=n+1;break}if(o=!0,p==="\\"&&!c){c=!0,n++;continue}if(p==="["&&!c){for(let[y,[m,b,w]]of Object.entries(Qn))if(i.startsWith(y,n)){if(f)return["$.",!1,i.length-e,!0];n+=y.length,w?r.push(m):s.push(m),a=a||b;continue t}}if(c=!1,f){p>f?s.push(Ht(f)+"-"+Ht(p)):p===f&&s.push(Ht(p)),f="",n++;continue}if(i.startsWith("-]",n+1)){s.push(Ht(p+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=p,n+=2;continue}s.push(Ht(p)),n++}if(l<n)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,i.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!h){let p=s[0].length===2?s[0].slice(-1):s[0];return[to(p),!1,l-e,!1]}let u="["+(h?"^":"")+mi(s)+"]",d="["+(h?"":"^")+mi(r)+"]";return[s.length&&r.length?"("+u+"|"+d+")":s.length?u:d,a,l-e,!0]};var z=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var eo=new Set(["!","?","+","*","@"]),wi=i=>eo.has(i),so="(?!(?:^|/)\\.\\.?(?:$|/))",le="(?!\\.)",io=new Set(["[","."]),ro=new Set(["..","."]),no=new Set("().*{}+?[]^$\\!"),oo=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye="[^/]",yi=Ye+"*?",Si=Ye+"+?",St=class i{type;#t;#e;#n=!1;#i=[];#o;#b;#h;#f=!1;#a;#c;#r=!1;constructor(t,e,s={}){this.type=t,t&&(this.#e=!0),this.#o=e,this.#t=this.#o?this.#o.#t:this,this.#a=this.#t===this?s:this.#t.#a,this.#h=this.#t===this?[]:this.#t.#h,t==="!"&&!this.#t.#f&&this.#h.push(this),this.#b=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let t of this.#i)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(t=>String(t)).join("|")+")":this.#c=this.#i.map(t=>String(t)).join("")}#g(){if(this!==this.#t)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let t;for(;t=this.#h.pop();){if(t.type!=="!")continue;let e=t,s=e.#o;for(;s;){for(let r=e.#b+1;!s.type&&r<s.#i.length;r++)for(let n of t.#i){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#i[r])}e=s,s=e.#o}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof i&&e.#o===this))throw new Error("invalid part: "+e);this.#i.push(e)}}toJSON(){let t=this.type===null?this.#i.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#i.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#f&&this.#o?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let t=this.#o;for(let e=0;e<this.#b;e++){let s=t.#i[e];if(!(s instanceof i&&s.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let t=this.#o?this.#o.#i.length:0;return this.#b===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new i(this.type,t);for(let s of this.#i)e.copyIn(s);return e}static#w(t,e,s,r){let n=!1,o=!1,a=-1,c=!1;if(e.type===null){let d=s,g="";for(;d<t.length;){let p=t.charAt(d++);if(n||p==="\\"){n=!n,g+=p;continue}if(o){d===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(d===a+2&&c)&&(o=!1),g+=p;continue}else if(p==="["){o=!0,a=d,c=!1,g+=p;continue}if(!r.noext&&wi(p)&&t.charAt(d)==="("){e.push(g),g="";let y=new i(p,e);d=i.#w(t,y,d,r),e.push(y);continue}g+=p}return e.push(g),d}let h=s+1,l=new i(null,e),f=[],u="";for(;h<t.length;){let d=t.charAt(h++);if(n||d==="\\"){n=!n,u+=d;continue}if(o){h===a+1?(d==="^"||d==="!")&&(c=!0):d==="]"&&!(h===a+2&&c)&&(o=!1),u+=d;continue}else if(d==="["){o=!0,a=h,c=!1,u+=d;continue}if(wi(d)&&t.charAt(h)==="("){l.push(u),u="";let g=new i(d,l);l.push(g),h=i.#w(t,g,h,r);continue}if(d==="|"){l.push(u),u="",f.push(l),l=new i(null,e);continue}if(d===")")return u===""&&e.#i.length===0&&(e.#r=!0),l.push(u),u="",e.push(...f,l),h;u+=d}return e.type=null,e.#e=void 0,e.#i=[t.substring(s-1)],h}static fromGlob(t,e={}){let s=new i(null,void 0,e);return i.#w(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,s,r,n]=this.toRegExpSource();if(!(r||this.#e||this.#a.nocase&&!this.#a.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let a=(this.#a.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,a),{_src:e,_glob:t})}get options(){return this.#a}toRegExpSource(t){let e=t??!!this.#a.dot;if(this.#t===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),h=this.#i.map(d=>{let[g,p,y,m]=typeof d=="string"?i.#u(d,this.#e,c):d.toRegExpSource(t);return this.#e=this.#e||y,this.#n=this.#n||m,g}).join(""),l="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&ro.has(this.#i[0]))){let g=io,p=e&&g.has(h.charAt(0))||h.startsWith("\\.")&&g.has(h.charAt(2))||h.startsWith("\\.\\.")&&g.has(h.charAt(4)),y=!e&&!t&&g.has(h.charAt(0));l=p?so:y?le:""}let f="";return this.isEnd()&&this.#t.#f&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[l+h+f,z(h),this.#e=!!this.#e,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#d(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#e=void 0,[c,z(this.toString()),!1,!1]}let o=!s||t||e||!le?"":this.#d(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&this.#r)a=(this.isStart()&&!e?le:"")+Si;else{let c=this.type==="!"?"))"+(this.isStart()&&!e&&!t?le:"")+yi+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+n+c}return[a,z(n),this.#e=!!this.#e,this.#n]}#d(t){return this.#i.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,r,n,o]=e.toRegExpSource(t);return this.#n=this.#n||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#u(t,e,s=!1){let r=!1,n="",o=!1;for(let a=0;a<t.length;a++){let c=t.charAt(a);if(r){r=!1,n+=(no.has(c)?"\\":"")+c;continue}if(c==="\\"){a===t.length-1?n+="\\\\":r=!0;continue}if(c==="["){let[h,l,f,u]=gi(t,a);if(f){n+=h,o=o||l,a+=f-1,e=e||u;continue}}if(c==="*"){s&&t==="*"?n+=Si:n+=yi,e=!0;continue}if(c==="?"){n+=Ye,e=!0;continue}n+=oo(c)}return[n,z(t),!!e,o]}};var bt=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var P=(i,t,e={})=>(Gt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new I(t,e).match(i)),ao=/^\*+([^+@!?\*\[\(]*)$/,co=i=>t=>!t.startsWith(".")&&t.endsWith(i),ho=i=>t=>t.endsWith(i),lo=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),fo=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),uo=/^\*+\.\*+$/,po=i=>!i.startsWith(".")&&i.includes("."),mo=i=>i!=="."&&i!==".."&&i.includes("."),go=/^\.\*+$/,wo=i=>i!=="."&&i!==".."&&i.startsWith("."),yo=/^\*+$/,So=i=>i.length!==0&&!i.startsWith("."),bo=i=>i.length!==0&&i!=="."&&i!=="..",Eo=/^\?+([^+@!?\*\[\(]*)?$/,xo=([i,t=""])=>{let e=vi([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},vo=([i,t=""])=>{let e=Ti([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},To=([i,t=""])=>{let e=Ti([i]);return t?s=>e(s)&&s.endsWith(t):e},Ro=([i,t=""])=>{let e=vi([i]);return t?s=>e(s)&&s.endsWith(t):e},vi=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},Ti=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},Ri=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bi={win32:{sep:"\\"},posix:{sep:"/"}},Oo=Ri==="win32"?bi.win32.sep:bi.posix.sep;P.sep=Oo;var _=Symbol("globstar **");P.GLOBSTAR=_;var Ao="[^/]",Co=Ao+"*?",_o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ko="(?:(?!(?:\\/|^)\\.).)*?",No=(i,t={})=>e=>P(e,i,t);P.filter=No;var U=(i,t={})=>Object.assign({},i,t),Do=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return P;let t=P;return Object.assign((s,r,n={})=>t(s,r,U(i,n)),{Minimatch:class extends t.Minimatch{constructor(r,n={}){super(r,U(i,n))}static defaults(r){return t.defaults(U(i,r)).Minimatch}},AST:class extends t.AST{constructor(r,n,o={}){super(r,n,U(i,o))}static fromGlob(r,n={}){return t.AST.fromGlob(r,U(i,n))}},unescape:(s,r={})=>t.unescape(s,U(i,r)),escape:(s,r={})=>t.escape(s,U(i,r)),filter:(s,r={})=>t.filter(s,U(i,r)),defaults:s=>t.defaults(U(i,s)),makeRe:(s,r={})=>t.makeRe(s,U(i,r)),braceExpand:(s,r={})=>t.braceExpand(s,U(i,r)),match:(s,r,n={})=>t.match(s,r,U(i,n)),sep:t.sep,GLOBSTAR:_})};P.defaults=Do;var Oi=(i,t={})=>(Gt(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,xi.default)(i));P.braceExpand=Oi;var Po=(i,t={})=>new I(i,t).makeRe();P.makeRe=Po;var Lo=(i,t,e={})=>{let s=new I(t,e);return i=i.filter(r=>s.match(r)),s.options.nonull&&!i.length&&i.push(t),i};P.match=Lo;var Ei=/[?*]|[+@!]\(.*?\)|\[|\]/,Fo=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),I=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){Gt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Ri,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((n,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Ei.test(n[2]))&&!Ei.test(n[3]),h=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(h)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{let n=s[s.length-1];return r==="**"&&n==="**"?s:r===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let n=t[r];r===1&&n===""&&t[0]===""||(n==="."||n==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let a=s[r+1],c=s[r+2],h=s[r+3];if(a!==".."||!c||c==="."||c===".."||!h||h==="."||h==="..")continue;e=!0,s.splice(r,1);let l=s.slice(0);l[r]="**",t.push(l),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let o=s[n-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let c=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...c),s.length===0&&s.push(""),n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,n=0,o=[],a="";for(;r<t.length&&n<e.length;)if(t[r]===e[n])o.push(a==="b"?e[n]:t[r]),r++,n++;else if(s&&t[r]==="**"&&e[n]===t[r+1])o.push(t[r]),r++;else if(s&&e[n]==="**"&&t[r]===e[n+1])o.push(e[n]),n++;else if(t[r]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(a==="b")return!1;a="a",o.push(t[r]),r++,n++}else if(e[n]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="a")return!1;a="b",o.push(e[n]),r++,n++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let r=this.options;if(this.isWindows){let p=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),y=!p&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),w=y?3:p?0:void 0,S=b?3:m?0:void 0;if(typeof w=="number"&&typeof S=="number"){let[E,v]=[t[w],e[S]];E.toLowerCase()===v.toLowerCase()&&(e[S]=E,S>w?e=e.slice(S):w>S&&(t=t.slice(w)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,c=t.length,h=e.length;o<c&&a<h;o++,a++){this.debug("matchOne loop");var l=e[a],f=t[o];if(this.debug(e,l,f),l===!1)return!1;if(l===_){this.debug("GLOBSTAR",[e,l,f]);var u=o,d=a+1;if(d===h){for(this.debug("** at the end");o<c;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<c;){var g=t[u];if(this.debug(`
|
|
37
|
+
`));let a=await Hn(n,t);a||(t.error("Login failed. Please try again."),process.exit(1)),F.set({...a,...a.expires_in?{expires_at:Date.now()+a.expires_in*1e3}:{}}),t.info(`Login successful!
|
|
38
|
+
`),process.exitCode=0}import{build as Os}from"vite";import gc,{resolve as Mr}from"node:path";import{fileURLToPath as wc}from"node:url";var xi=qr(pi(),1);var Gt=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var Qn={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ht=i=>i.replace(/[[\]\\-]/g,"\\$&"),to=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mi=i=>i.join(""),gi=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=e+1,o=!1,a=!1,c=!1,h=!1,l=e,f="";t:for(;n<i.length;){let p=i.charAt(n);if((p==="!"||p==="^")&&n===e+1){h=!0,n++;continue}if(p==="]"&&o&&!c){l=n+1;break}if(o=!0,p==="\\"&&!c){c=!0,n++;continue}if(p==="["&&!c){for(let[y,[m,b,w]]of Object.entries(Qn))if(i.startsWith(y,n)){if(f)return["$.",!1,i.length-e,!0];n+=y.length,w?r.push(m):s.push(m),a=a||b;continue t}}if(c=!1,f){p>f?s.push(Ht(f)+"-"+Ht(p)):p===f&&s.push(Ht(p)),f="",n++;continue}if(i.startsWith("-]",n+1)){s.push(Ht(p+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=p,n+=2;continue}s.push(Ht(p)),n++}if(l<n)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,i.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!h){let p=s[0].length===2?s[0].slice(-1):s[0];return[to(p),!1,l-e,!1]}let u="["+(h?"^":"")+mi(s)+"]",d="["+(h?"":"^")+mi(r)+"]";return[s.length&&r.length?"("+u+"|"+d+")":s.length?u:d,a,l-e,!0]};var z=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var eo=new Set(["!","?","+","*","@"]),wi=i=>eo.has(i),so="(?!(?:^|/)\\.\\.?(?:$|/))",le="(?!\\.)",io=new Set(["[","."]),ro=new Set(["..","."]),no=new Set("().*{}+?[]^$\\!"),oo=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye="[^/]",yi=Ye+"*?",Si=Ye+"+?",St=class i{type;#t;#e;#n=!1;#i=[];#o;#b;#h;#f=!1;#a;#c;#r=!1;constructor(t,e,s={}){this.type=t,t&&(this.#e=!0),this.#o=e,this.#t=this.#o?this.#o.#t:this,this.#a=this.#t===this?s:this.#t.#a,this.#h=this.#t===this?[]:this.#t.#h,t==="!"&&!this.#t.#f&&this.#h.push(this),this.#b=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let t of this.#i)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(t=>String(t)).join("|")+")":this.#c=this.#i.map(t=>String(t)).join("")}#g(){if(this!==this.#t)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let t;for(;t=this.#h.pop();){if(t.type!=="!")continue;let e=t,s=e.#o;for(;s;){for(let r=e.#b+1;!s.type&&r<s.#i.length;r++)for(let n of t.#i){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#i[r])}e=s,s=e.#o}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof i&&e.#o===this))throw new Error("invalid part: "+e);this.#i.push(e)}}toJSON(){let t=this.type===null?this.#i.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#i.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#f&&this.#o?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let t=this.#o;for(let e=0;e<this.#b;e++){let s=t.#i[e];if(!(s instanceof i&&s.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let t=this.#o?this.#o.#i.length:0;return this.#b===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new i(this.type,t);for(let s of this.#i)e.copyIn(s);return e}static#w(t,e,s,r){let n=!1,o=!1,a=-1,c=!1;if(e.type===null){let d=s,g="";for(;d<t.length;){let p=t.charAt(d++);if(n||p==="\\"){n=!n,g+=p;continue}if(o){d===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(d===a+2&&c)&&(o=!1),g+=p;continue}else if(p==="["){o=!0,a=d,c=!1,g+=p;continue}if(!r.noext&&wi(p)&&t.charAt(d)==="("){e.push(g),g="";let y=new i(p,e);d=i.#w(t,y,d,r),e.push(y);continue}g+=p}return e.push(g),d}let h=s+1,l=new i(null,e),f=[],u="";for(;h<t.length;){let d=t.charAt(h++);if(n||d==="\\"){n=!n,u+=d;continue}if(o){h===a+1?(d==="^"||d==="!")&&(c=!0):d==="]"&&!(h===a+2&&c)&&(o=!1),u+=d;continue}else if(d==="["){o=!0,a=h,c=!1,u+=d;continue}if(wi(d)&&t.charAt(h)==="("){l.push(u),u="";let g=new i(d,l);l.push(g),h=i.#w(t,g,h,r);continue}if(d==="|"){l.push(u),u="",f.push(l),l=new i(null,e);continue}if(d===")")return u===""&&e.#i.length===0&&(e.#r=!0),l.push(u),u="",e.push(...f,l),h;u+=d}return e.type=null,e.#e=void 0,e.#i=[t.substring(s-1)],h}static fromGlob(t,e={}){let s=new i(null,void 0,e);return i.#w(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,s,r,n]=this.toRegExpSource();if(!(r||this.#e||this.#a.nocase&&!this.#a.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let a=(this.#a.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,a),{_src:e,_glob:t})}get options(){return this.#a}toRegExpSource(t){let e=t??!!this.#a.dot;if(this.#t===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),h=this.#i.map(d=>{let[g,p,y,m]=typeof d=="string"?i.#u(d,this.#e,c):d.toRegExpSource(t);return this.#e=this.#e||y,this.#n=this.#n||m,g}).join(""),l="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&ro.has(this.#i[0]))){let g=io,p=e&&g.has(h.charAt(0))||h.startsWith("\\.")&&g.has(h.charAt(2))||h.startsWith("\\.\\.")&&g.has(h.charAt(4)),y=!e&&!t&&g.has(h.charAt(0));l=p?so:y?le:""}let f="";return this.isEnd()&&this.#t.#f&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[l+h+f,z(h),this.#e=!!this.#e,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#d(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#e=void 0,[c,z(this.toString()),!1,!1]}let o=!s||t||e||!le?"":this.#d(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&this.#r)a=(this.isStart()&&!e?le:"")+Si;else{let c=this.type==="!"?"))"+(this.isStart()&&!e&&!t?le:"")+yi+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+n+c}return[a,z(n),this.#e=!!this.#e,this.#n]}#d(t){return this.#i.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,r,n,o]=e.toRegExpSource(t);return this.#n=this.#n||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#u(t,e,s=!1){let r=!1,n="",o=!1;for(let a=0;a<t.length;a++){let c=t.charAt(a);if(r){r=!1,n+=(no.has(c)?"\\":"")+c;continue}if(c==="\\"){a===t.length-1?n+="\\\\":r=!0;continue}if(c==="["){let[h,l,f,u]=gi(t,a);if(f){n+=h,o=o||l,a+=f-1,e=e||u;continue}}if(c==="*"){s&&t==="*"?n+=Si:n+=yi,e=!0;continue}if(c==="?"){n+=Ye,e=!0;continue}n+=oo(c)}return[n,z(t),!!e,o]}};var bt=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var P=(i,t,e={})=>(Gt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new I(t,e).match(i)),ao=/^\*+([^+@!?\*\[\(]*)$/,co=i=>t=>!t.startsWith(".")&&t.endsWith(i),ho=i=>t=>t.endsWith(i),lo=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),fo=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),uo=/^\*+\.\*+$/,po=i=>!i.startsWith(".")&&i.includes("."),mo=i=>i!=="."&&i!==".."&&i.includes("."),go=/^\.\*+$/,wo=i=>i!=="."&&i!==".."&&i.startsWith("."),yo=/^\*+$/,So=i=>i.length!==0&&!i.startsWith("."),bo=i=>i.length!==0&&i!=="."&&i!=="..",Eo=/^\?+([^+@!?\*\[\(]*)?$/,xo=([i,t=""])=>{let e=vi([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},vo=([i,t=""])=>{let e=Ti([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},To=([i,t=""])=>{let e=Ti([i]);return t?s=>e(s)&&s.endsWith(t):e},Ro=([i,t=""])=>{let e=vi([i]);return t?s=>e(s)&&s.endsWith(t):e},vi=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},Ti=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},Ri=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bi={win32:{sep:"\\"},posix:{sep:"/"}},Oo=Ri==="win32"?bi.win32.sep:bi.posix.sep;P.sep=Oo;var _=Symbol("globstar **");P.GLOBSTAR=_;var Ao="[^/]",Co=Ao+"*?",_o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ko="(?:(?!(?:\\/|^)\\.).)*?",No=(i,t={})=>e=>P(e,i,t);P.filter=No;var U=(i,t={})=>Object.assign({},i,t),Do=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return P;let t=P;return Object.assign((s,r,n={})=>t(s,r,U(i,n)),{Minimatch:class extends t.Minimatch{constructor(r,n={}){super(r,U(i,n))}static defaults(r){return t.defaults(U(i,r)).Minimatch}},AST:class extends t.AST{constructor(r,n,o={}){super(r,n,U(i,o))}static fromGlob(r,n={}){return t.AST.fromGlob(r,U(i,n))}},unescape:(s,r={})=>t.unescape(s,U(i,r)),escape:(s,r={})=>t.escape(s,U(i,r)),filter:(s,r={})=>t.filter(s,U(i,r)),defaults:s=>t.defaults(U(i,s)),makeRe:(s,r={})=>t.makeRe(s,U(i,r)),braceExpand:(s,r={})=>t.braceExpand(s,U(i,r)),match:(s,r,n={})=>t.match(s,r,U(i,n)),sep:t.sep,GLOBSTAR:_})};P.defaults=Do;var Oi=(i,t={})=>(Gt(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,xi.default)(i));P.braceExpand=Oi;var Po=(i,t={})=>new I(i,t).makeRe();P.makeRe=Po;var Lo=(i,t,e={})=>{let s=new I(t,e);return i=i.filter(r=>s.match(r)),s.options.nonull&&!i.length&&i.push(t),i};P.match=Lo;var Ei=/[?*]|[+@!]\(.*?\)|\[|\]/,Mo=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),I=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){Gt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Ri,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((n,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Ei.test(n[2]))&&!Ei.test(n[3]),h=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(h)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{let n=s[s.length-1];return r==="**"&&n==="**"?s:r===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let n=t[r];r===1&&n===""&&t[0]===""||(n==="."||n==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let a=s[r+1],c=s[r+2],h=s[r+3];if(a!==".."||!c||c==="."||c===".."||!h||h==="."||h==="..")continue;e=!0,s.splice(r,1);let l=s.slice(0);l[r]="**",t.push(l),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let o=s[n-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let c=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...c),s.length===0&&s.push(""),n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,n=0,o=[],a="";for(;r<t.length&&n<e.length;)if(t[r]===e[n])o.push(a==="b"?e[n]:t[r]),r++,n++;else if(s&&t[r]==="**"&&e[n]===t[r+1])o.push(t[r]),r++;else if(s&&e[n]==="**"&&t[r]===e[n+1])o.push(e[n]),n++;else if(t[r]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(a==="b")return!1;a="a",o.push(t[r]),r++,n++}else if(e[n]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="a")return!1;a="b",o.push(e[n]),r++,n++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let r=this.options;if(this.isWindows){let p=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),y=!p&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),w=y?3:p?0:void 0,S=b?3:m?0:void 0;if(typeof w=="number"&&typeof S=="number"){let[E,v]=[t[w],e[S]];E.toLowerCase()===v.toLowerCase()&&(e[S]=E,S>w?e=e.slice(S):w>S&&(t=t.slice(w)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,c=t.length,h=e.length;o<c&&a<h;o++,a++){this.debug("matchOne loop");var l=e[a],f=t[o];if(this.debug(e,l,f),l===!1)return!1;if(l===_){this.debug("GLOBSTAR",[e,l,f]);var u=o,d=a+1;if(d===h){for(this.debug("** at the end");o<c;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<c;){var g=t[u];if(this.debug(`
|
|
39
39
|
globstar while`,t,u,e,d,g),this.matchOne(t.slice(u),e.slice(d),s))return this.debug("globstar found match!",u,c,g),!0;if(g==="."||g===".."||!r.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,u,e,d);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(s&&(this.debug(`
|
|
40
|
-
>>> no match, partial?`,t,u,e,d),u===c))}let p;if(typeof l=="string"?(p=f===l,this.debug("string match",l,f,p)):(p=l.test(f),this.debug("pattern match",l,f,p)),!p)return!1}if(o===c&&a===h)return!0;if(o===c)return s;if(a===h)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Oi(this.pattern,this.options)}parse(t){Gt(t);let e=this.options;if(t==="**")return _;if(t==="")return"";let s,r=null;(s=t.match(yo))?r=e.dot?bo:So:(s=t.match(ao))?r=(e.nocase?e.dot?fo:lo:e.dot?ho:co)(s[1]):(s=t.match(Eo))?r=(e.nocase?e.dot?vo:xo:e.dot?To:Ro)(s):(s=t.match(uo))?r=e.dot?mo:po:(s=t.match(go))&&(r=wo);let n=St.fromGlob(t,this.options).toMMPattern();return r&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:r}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Co:e.dot?_o:ko,r=new Set(e.nocase?["i"]:[]),n=t.map(c=>{let h=c.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))r.add(f);return typeof l=="string"?Fo(l):l===_?_:l._src});return h.forEach((l,f)=>{let u=h[f+1],d=h[f-1];l!==_||d===_||(d===void 0?u!==void 0&&u!==_?h[f+1]="(?:\\/|"+s+"\\/)?"+u:h[f]=s:u===void 0?h[f-1]=d+"(?:\\/|"+s+")?":u!==_&&(h[f-1]=d+"(?:\\/|\\/"+s+"\\/)"+u,h[f+1]=_))}),h.filter(l=>l!==_).join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];n="^"+o+n+a+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let n=this.set;this.debug(this.pattern,"set",n);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<n.length;a++){let c=n[a],h=r;if(s.matchBase&&c.length===1&&(h=[o]),this.matchOne(h,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return P.defaults(t).Minimatch}};P.AST=St;P.Minimatch=I;P.escape=bt;P.unescape=z;import{fileURLToPath as da}from"node:url";var Et=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ci=new Set,Je=typeof process=="object"&&process?process:{},_i=(i,t,e,s)=>{typeof Je.emitWarning=="function"?Je.emitWarning(i,t,e,s):console.error(`[${e}] ${t}: ${i}`)},fe=globalThis.AbortController,Ai=globalThis.AbortSignal;if(typeof fe>"u"){Ai=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,r){this._onabort.push(r)}},fe=class{constructor(){t()}signal=new Ai;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let r of this.signal._onabort)r(s);this.signal.onabort?.(s)}}};let i=Je.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=!1,_i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Mo=i=>!Ci.has(i),rl=Symbol("type"),nt=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),ki=i=>nt(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?xt:null:null,xt=class extends Array{constructor(t){super(t),this.fill(0)}},Xe=class i{heap;length;static#t=!1;static create(t){let e=ki(t);if(!e)return[];i.#t=!0;let s=new i(t,e);return i.#t=!1,s}constructor(t,e){if(!i.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},qt=class i{#t;#e;#n;#i;#o;#b;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#h;#f;#a;#c;#r;#g;#w;#d;#u;#v;#m;#T;#R;#S;#E;#x;#p;static unsafeExposeInternals(t){return{starts:t.#R,ttls:t.#S,sizes:t.#T,keyMap:t.#a,keyList:t.#c,valList:t.#r,next:t.#g,prev:t.#w,get head(){return t.#d},get tail(){return t.#u},free:t.#v,isBackgroundFetch:e=>t.#l(e),backgroundFetch:(e,s,r,n)=>t.#j(e,s,r,n),moveToTail:e=>t.#$(e),indexes:e=>t.#A(e),rindexes:e=>t.#C(e),isStale:e=>t.#y(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#f}get size(){return this.#h}get fetchMethod(){return this.#o}get memoMethod(){return this.#b}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(t){let{max:e=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:h,disposeAfter:l,noDisposeOnSet:f,noUpdateTTL:u,maxSize:d=0,maxEntrySize:g=0,sizeCalculation:p,fetchMethod:y,memoMethod:m,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:E,ignoreFetchAbort:v}=t;if(e!==0&&!nt(e))throw new TypeError("max option must be a nonnegative integer");let C=e?ki(e):Array;if(!C)throw new Error("invalid max value: "+e);if(this.#t=e,this.#e=d,this.maxEntrySize=g||this.#e,this.sizeCalculation=p,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#b=m,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=y,this.#x=!!y,this.#a=new Map,this.#c=new Array(e).fill(void 0),this.#r=new Array(e).fill(void 0),this.#g=new C(e),this.#w=new C(e),this.#d=0,this.#u=0,this.#v=Xe.create(e),this.#h=0,this.#f=0,typeof h=="function"&&(this.#n=h),typeof l=="function"?(this.#i=l,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#E=!!this.#n,this.#p=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#e!==0&&!nt(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!nt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=nt(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!nt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#_()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let K="LRU_CACHE_UNBOUNDED";Mo(K)&&(Ci.add(K),_i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",K,i))}}getRemainingTTL(t){return this.#a.has(t)?1/0:0}#_(){let t=new xt(this.#t),e=new xt(this.#t);this.#S=t,this.#R=e,this.#D=(n,o,a=Et.now())=>{if(e[n]=o!==0?a:0,t[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#y(n)&&this.#N(this.#c[n],"expire")},o+1);c.unref&&c.unref()}},this.#O=n=>{e[n]=t[n]!==0?Et.now():0},this.#s=(n,o)=>{if(t[o]){let a=t[o],c=e[o];if(!a||!c)return;n.ttl=a,n.start=c,n.now=s||r();let h=n.now-c;n.remainingTTL=a-h}};let s=0,r=()=>{let n=Et.now();if(this.ttlResolution>0){s=n;let o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{let o=this.#a.get(n);if(o===void 0)return 0;let a=t[o],c=e[o];if(!a||!c)return 1/0;let h=(s||r())-c;return a-h},this.#y=n=>{let o=e[n],a=t[n];return!!a&&!!o&&(s||r())-o>a}}#O=()=>{};#s=()=>{};#D=()=>{};#y=()=>!1;#k(){let t=new xt(this.#t);this.#f=0,this.#T=t,this.#P=e=>{this.#f-=t[e],t[e]=0},this.#F=(e,s,r,n)=>{if(this.#l(s))return 0;if(!nt(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,e),!nt(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(e,s,r)=>{if(t[e]=s,this.#e){let n=this.#e-t[e];for(;this.#f>n;)this.#I(!0)}this.#f+=t[e],r&&(r.entrySize=s,r.totalCalculatedSize=this.#f)}}#P=t=>{};#L=(t,e,s)=>{};#F=(t,e,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#u;!(!this.#M(e)||((t||!this.#y(e))&&(yield e),e===this.#d));)e=this.#w[e]}*#C({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#d;!(!this.#M(e)||((t||!this.#y(e))&&(yield e),e===this.#u));)e=this.#g[e]}#M(t){return t!==void 0&&this.#a.get(this.#c[t])===t}*entries(){for(let t of this.#A())this.#r[t]!==void 0&&this.#c[t]!==void 0&&!this.#l(this.#r[t])&&(yield[this.#c[t],this.#r[t]])}*rentries(){for(let t of this.#C())this.#r[t]!==void 0&&this.#c[t]!==void 0&&!this.#l(this.#r[t])&&(yield[this.#c[t],this.#r[t]])}*keys(){for(let t of this.#A()){let e=this.#c[t];e!==void 0&&!this.#l(this.#r[t])&&(yield e)}}*rkeys(){for(let t of this.#C()){let e=this.#c[t];e!==void 0&&!this.#l(this.#r[t])&&(yield e)}}*values(){for(let t of this.#A())this.#r[t]!==void 0&&!this.#l(this.#r[t])&&(yield this.#r[t])}*rvalues(){for(let t of this.#C())this.#r[t]!==void 0&&!this.#l(this.#r[t])&&(yield this.#r[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#A()){let r=this.#r[s],n=this.#l(r)?r.__staleWhileFetching:r;if(n!==void 0&&t(n,this.#c[s],this))return this.get(this.#c[s],e)}}forEach(t,e=this){for(let s of this.#A()){let r=this.#r[s],n=this.#l(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#c[s],this)}}rforEach(t,e=this){for(let s of this.#C()){let r=this.#r[s],n=this.#l(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#c[s],this)}}purgeStale(){let t=!1;for(let e of this.#C({allowStale:!0}))this.#y(e)&&(this.#N(this.#c[e],"expire"),t=!0);return t}info(t){let e=this.#a.get(t);if(e===void 0)return;let s=this.#r[e],r=this.#l(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#S&&this.#R){let o=this.#S[e],a=this.#R[e];if(o&&a){let c=o-(Et.now()-a);n.ttl=c,n.start=Date.now()}}return this.#T&&(n.size=this.#T[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let s=this.#c[e],r=this.#r[e],n=this.#l(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#S&&this.#R){o.ttl=this.#S[e];let a=Et.now()-this.#R[e];o.start=Math.floor(Date.now()-a)}this.#T&&(o.size=this.#T[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let r=Date.now()-s.start;s.start=Et.now()-r}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=s,{noUpdateTTL:h=this.noUpdateTTL}=s,l=this.#F(t,e,s.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#N(t,"set"),this;let f=this.#h===0?void 0:this.#a.get(t);if(f===void 0)f=this.#h===0?this.#u:this.#v.length!==0?this.#v.pop():this.#h===this.#t?this.#I(!1):this.#h,this.#c[f]=t,this.#r[f]=e,this.#a.set(t,f),this.#g[this.#u]=f,this.#w[f]=this.#u,this.#u=f,this.#h++,this.#L(f,l,c),c&&(c.set="add"),h=!1;else{this.#$(f);let u=this.#r[f];if(e!==u){if(this.#x&&this.#l(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=u;d!==void 0&&!o&&(this.#E&&this.#n?.(d,t,"set"),this.#p&&this.#m?.push([d,t,"set"]))}else o||(this.#E&&this.#n?.(u,t,"set"),this.#p&&this.#m?.push([u,t,"set"]));if(this.#P(f),this.#L(f,l,c),this.#r[f]=e,c){c.set="replace";let d=u&&this.#l(u)?u.__staleWhileFetching:u;d!==void 0&&(c.oldValue=d)}}else c&&(c.set="update")}if(r!==0&&!this.#S&&this.#_(),this.#S&&(h||this.#D(f,r,n),c&&this.#s(c,f)),!o&&this.#p&&this.#m){let u=this.#m,d;for(;d=u?.shift();)this.#i?.(...d)}return this}pop(){try{for(;this.#h;){let t=this.#r[this.#d];if(this.#I(!0),this.#l(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#p&&this.#m){let t=this.#m,e;for(;e=t?.shift();)this.#i?.(...e)}}}#I(t){let e=this.#d,s=this.#c[e],r=this.#r[e];return this.#x&&this.#l(r)?r.__abortController.abort(new Error("evicted")):(this.#E||this.#p)&&(this.#E&&this.#n?.(r,s,"evict"),this.#p&&this.#m?.push([r,s,"evict"])),this.#P(e),t&&(this.#c[e]=void 0,this.#r[e]=void 0,this.#v.push(e)),this.#h===1?(this.#d=this.#u=0,this.#v.length=0):this.#d=this.#g[e],this.#a.delete(s),this.#h--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=e,n=this.#a.get(t);if(n!==void 0){let o=this.#r[n];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#y(n))r&&(r.has="stale",this.#s(r,n));else return s&&this.#O(n),r&&(r.has="hit",this.#s(r,n)),!0}else r&&(r.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,r=this.#a.get(t);if(r===void 0||!s&&this.#y(r))return;let n=this.#r[r];return this.#l(n)?n.__staleWhileFetching:n}#j(t,e,s,r){let n=e===void 0?void 0:this.#r[e];if(this.#l(n))return n;let o=new fe,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:r},h=(p,y=!1)=>{let{aborted:m}=o.signal,b=s.ignoreFetchAbort&&p!==void 0;if(s.status&&(m&&!y?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,b&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!b&&!y)return f(o.signal.reason);let w=d;return this.#r[e]===d&&(p===void 0?w.__staleWhileFetching?this.#r[e]=w.__staleWhileFetching:this.#N(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,c.options))),p},l=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),f(p)),f=p=>{let{aborted:y}=o.signal,m=y&&s.allowStaleOnFetchAbort,b=m||s.allowStaleOnFetchRejection,w=b||s.noDeleteOnFetchRejection,S=d;if(this.#r[e]===d&&(!w||S.__staleWhileFetching===void 0?this.#N(t,"fetch"):m||(this.#r[e]=S.__staleWhileFetching)),b)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw p},u=(p,y)=>{let m=this.#o?.(t,n,c);m&&m instanceof Promise&&m.then(b=>p(b===void 0?void 0:b),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=b=>h(b,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(u).then(h,l),g=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,g,{...c.options,status:void 0}),e=this.#a.get(t)):this.#r[e]=g,g}#l(t){if(!this.#x)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof fe}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:p,forceRefresh:y=!1,status:m,signal:b}=e;if(!this.#x)return m&&(m.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:m});let w={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:h,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:m,signal:b},S=this.#a.get(t);if(S===void 0){m&&(m.fetch="miss");let E=this.#j(t,S,w,p);return E.__returned=E}else{let E=this.#r[S];if(this.#l(E)){let oe=s&&E.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",oe&&(m.returnedStale=!0)),oe?E.__staleWhileFetching:E.__returned=E}let v=this.#y(S);if(!y&&!v)return m&&(m.fetch="hit"),this.#$(S),r&&this.#O(S),m&&this.#s(m,S),E;let C=this.#j(t,S,w,p),B=C.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=v?"stale":"refresh",B&&v&&(m.returnedStale=!0)),B?C.__staleWhileFetching:C.__returned=C}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=this.#b;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=e,a=this.get(t,o);if(!n&&a!==void 0)return a;let c=s(t,a,{options:o,context:r});return this.set(t,c,o),c}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,a=this.#a.get(t);if(a!==void 0){let c=this.#r[a],h=this.#l(c);return o&&this.#s(o,a),this.#y(a)?(o&&(o.get="stale"),h?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?c.__staleWhileFetching:void 0):(n||this.#N(t,"expire"),o&&s&&(o.returnedStale=!0),s?c:void 0)):(o&&(o.get="hit"),h?c.__staleWhileFetching:(this.#$(a),r&&this.#O(a),c))}else o&&(o.get="miss")}#U(t,e){this.#w[e]=t,this.#g[t]=e}#$(t){t!==this.#u&&(t===this.#d?this.#d=this.#g[t]:this.#U(this.#w[t],this.#g[t]),this.#U(this.#u,t),this.#u=t)}delete(t){return this.#N(t,"delete")}#N(t,e){let s=!1;if(this.#h!==0){let r=this.#a.get(t);if(r!==void 0)if(s=!0,this.#h===1)this.#W(e);else{this.#P(r);let n=this.#r[r];if(this.#l(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#p)&&(this.#E&&this.#n?.(n,t,e),this.#p&&this.#m?.push([n,t,e])),this.#a.delete(t),this.#c[r]=void 0,this.#r[r]=void 0,r===this.#u)this.#u=this.#w[r];else if(r===this.#d)this.#d=this.#g[r];else{let o=this.#w[r];this.#g[o]=this.#g[r];let a=this.#g[r];this.#w[a]=this.#w[r]}this.#h--,this.#v.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,n;for(;n=r?.shift();)this.#i?.(...n)}return s}clear(){return this.#W("delete")}#W(t){for(let e of this.#C({allowStale:!0})){let s=this.#r[e];if(this.#l(s))s.__abortController.abort(new Error("deleted"));else{let r=this.#c[e];this.#E&&this.#n?.(s,r,t),this.#p&&this.#m?.push([s,r,t])}}if(this.#a.clear(),this.#r.fill(void 0),this.#c.fill(void 0),this.#S&&this.#R&&(this.#S.fill(0),this.#R.fill(0)),this.#T&&this.#T.fill(0),this.#d=0,this.#u=0,this.#v.length=0,this.#f=0,this.#h=0,this.#p&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#i?.(...s)}}};import{posix as Vo,win32 as as}from"node:path";import{fileURLToPath as Ko}from"node:url";import{lstatSync as Yo,readdir as Jo,readdirSync as Xo,readlinkSync as Zo,realpathSync as Qo}from"fs";import*as ta from"node:fs";import{lstat as sa,readdir as ia,readlink as ra,realpath as na}from"node:fs/promises";import{EventEmitter as rs}from"node:events";import Fi from"node:stream";import{StringDecoder as Io}from"node:string_decoder";var Ni=typeof process=="object"&&process?process:{stdout:null,stderr:null},jo=i=>!!i&&typeof i=="object"&&(i instanceof at||i instanceof Fi||Uo(i)||$o(i)),Uo=i=>!!i&&typeof i=="object"&&i instanceof rs&&typeof i.pipe=="function"&&i.pipe!==Fi.Writable.prototype.pipe,$o=i=>!!i&&typeof i=="object"&&i instanceof rs&&typeof i.write=="function"&&typeof i.end=="function",Z=Symbol("EOF"),Q=Symbol("maybeEmitEnd"),ot=Symbol("emittedEnd"),ue=Symbol("emittingEnd"),Vt=Symbol("emittedError"),de=Symbol("closed"),Di=Symbol("read"),pe=Symbol("flush"),Pi=Symbol("flushChunk"),G=Symbol("encoding"),vt=Symbol("decoder"),R=Symbol("flowing"),Kt=Symbol("paused"),Tt=Symbol("resume"),O=Symbol("buffer"),L=Symbol("pipes"),A=Symbol("bufferLength"),Ze=Symbol("bufferPush"),me=Symbol("bufferShift"),N=Symbol("objectMode"),x=Symbol("destroyed"),Qe=Symbol("error"),ts=Symbol("emitData"),Li=Symbol("emitEnd"),es=Symbol("emitEnd2"),Y=Symbol("async"),ss=Symbol("abort"),ge=Symbol("aborted"),Yt=Symbol("signal"),ut=Symbol("dataListeners"),j=Symbol("discarded"),Jt=i=>Promise.resolve().then(i),Wo=i=>i(),Bo=i=>i==="end"||i==="finish"||i==="prefinish",zo=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,Go=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),we=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[Tt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},is=class extends we{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=r=>e.emit("error",r),t.on("error",this.proxyErrors)}},Ho=i=>!!i.objectMode,qo=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",at=class extends rs{[R]=!1;[Kt]=!1;[L]=[];[O]=[];[N];[G];[Y];[vt];[Z]=!1;[ot]=!1;[ue]=!1;[de]=!1;[Vt]=null;[A]=0;[x]=!1;[Yt];[ge]=!1;[ut]=0;[j]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Ho(e)?(this[N]=!0,this[G]=null):qo(e)?(this[G]=e.encoding,this[N]=!1):(this[N]=!1,this[G]=null),this[Y]=!!e.async,this[vt]=this[G]?new Io(this[G]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[O]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[L]});let{signal:s}=e;s&&(this[Yt]=s,s.aborted?this[ss]():s.addEventListener("abort",()=>this[ss]()))}get bufferLength(){return this[A]}get encoding(){return this[G]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[N]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Y]}set async(t){this[Y]=this[Y]||!!t}[ss](){this[ge]=!0,this.emit("abort",this[Yt]?.reason),this.destroy(this[Yt]?.reason)}get aborted(){return this[ge]}set aborted(t){}write(t,e,s){if(this[ge])return!1;if(this[Z])throw new Error("write after end");if(this[x])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let r=this[Y]?Jt:Wo;if(!this[N]&&!Buffer.isBuffer(t)){if(Go(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(zo(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[R]&&this[A]!==0&&this[pe](!0),this[R]?this.emit("data",t):this[Ze](t),this[A]!==0&&this.emit("readable"),s&&r(s),this[R]):t.length?(typeof t=="string"&&!(e===this[G]&&!this[vt]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[G]&&(t=this[vt].write(t)),this[R]&&this[A]!==0&&this[pe](!0),this[R]?this.emit("data",t):this[Ze](t),this[A]!==0&&this.emit("readable"),s&&r(s),this[R]):(this[A]!==0&&this.emit("readable"),s&&r(s),this[R])}read(t){if(this[x])return null;if(this[j]=!1,this[A]===0||t===0||t&&t>this[A])return this[Q](),null;this[N]&&(t=null),this[O].length>1&&!this[N]&&(this[O]=[this[G]?this[O].join(""):Buffer.concat(this[O],this[A])]);let e=this[Di](t||null,this[O][0]);return this[Q](),e}[Di](t,e){if(this[N])this[me]();else{let s=e;t===s.length||t===null?this[me]():typeof s=="string"?(this[O][0]=s.slice(t),e=s.slice(0,t),this[A]-=t):(this[O][0]=s.subarray(t),e=s.subarray(0,t),this[A]-=t)}return this.emit("data",e),!this[O].length&&!this[Z]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[Z]=!0,this.writable=!1,(this[R]||!this[Kt])&&this[Q](),this}[Tt](){this[x]||(!this[ut]&&!this[L].length&&(this[j]=!0),this[Kt]=!1,this[R]=!0,this.emit("resume"),this[O].length?this[pe]():this[Z]?this[Q]():this.emit("drain"))}resume(){return this[Tt]()}pause(){this[R]=!1,this[Kt]=!0,this[j]=!1}get destroyed(){return this[x]}get flowing(){return this[R]}get paused(){return this[Kt]}[Ze](t){this[N]?this[A]+=1:this[A]+=t.length,this[O].push(t)}[me](){return this[N]?this[A]-=1:this[A]-=this[O][0].length,this[O].shift()}[pe](t=!1){do;while(this[Pi](this[me]())&&this[O].length);!t&&!this[O].length&&!this[Z]&&this.emit("drain")}[Pi](t){return this.emit("data",t),this[R]}pipe(t,e){if(this[x])return t;this[j]=!1;let s=this[ot];return e=e||{},t===Ni.stdout||t===Ni.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[L].push(e.proxyErrors?new is(this,t,e):new we(this,t,e)),this[Y]?Jt(()=>this[Tt]()):this[Tt]()),t}unpipe(t){let e=this[L].find(s=>s.dest===t);e&&(this[L].length===1?(this[R]&&this[ut]===0&&(this[R]=!1),this[L]=[]):this[L].splice(this[L].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[j]=!1,this[ut]++,!this[L].length&&!this[R]&&this[Tt]();else if(t==="readable"&&this[A]!==0)super.emit("readable");else if(Bo(t)&&this[ot])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Vt]){let r=e;this[Y]?Jt(()=>r.call(this,this[Vt])):r.call(this,this[Vt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[ut]=this.listeners("data").length,this[ut]===0&&!this[j]&&!this[L].length&&(this[R]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[ut]=0,!this[j]&&!this[L].length&&(this[R]=!1)),e}get emittedEnd(){return this[ot]}[Q](){!this[ue]&&!this[ot]&&!this[x]&&this[O].length===0&&this[Z]&&(this[ue]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[de]&&this.emit("close"),this[ue]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x&&this[x])return!1;if(t==="data")return!this[N]&&!s?!1:this[Y]?(Jt(()=>this[ts](s)),!0):this[ts](s);if(t==="end")return this[Li]();if(t==="close"){if(this[de]=!0,!this[ot]&&!this[x])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[Vt]=s,super.emit(Qe,s);let n=!this[Yt]||this.listeners("error").length?super.emit("error",s):!1;return this[Q](),n}else if(t==="resume"){let n=super.emit("resume");return this[Q](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...e);return this[Q](),r}[ts](t){for(let s of this[L])s.dest.write(t)===!1&&this.pause();let e=this[j]?!1:super.emit("data",t);return this[Q](),e}[Li](){return this[ot]?!1:(this[ot]=!0,this.readable=!1,this[Y]?(Jt(()=>this[es]()),!0):this[es]())}[es](){if(this[vt]){let e=this[vt].end();if(e){for(let s of this[L])s.dest.write(e);this[j]||super.emit("data",e)}}for(let e of this[L])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[N]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[N]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[G]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[j]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Z])return e();let n,o,a=f=>{this.off("data",c),this.off("end",h),this.off(x,l),e(),o(f)},c=f=>{this.off("error",a),this.off("end",h),this.off(x,l),this.pause(),n({value:f,done:!!this[Z]})},h=()=>{this.off("error",a),this.off("data",c),this.off(x,l),e(),n({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((f,u)=>{o=u,n=f,this.once(x,l),this.once("error",a),this.once("end",h),this.once("data",c)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[j]=!1;let t=!1,e=()=>(this.pause(),this.off(Qe,e),this.off(x,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let r=this.read();return r===null?e():{done:!1,value:r}};return this.once("end",e),this.once(Qe,e),this.once(x,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[x])return t?this.emit("error",t):this.emit(x),this;this[x]=!0,this[j]=!0,this[O].length=0,this[A]=0;let e=this;return typeof e.close=="function"&&!this[de]&&e.close(),t?this.emit("error",t):this.emit(x),this}static get isStream(){return jo}};var ea=Qo.native,Zt={lstatSync:Yo,readdir:Jo,readdirSync:Xo,readlinkSync:Zo,realpathSync:ea,promises:{lstat:sa,readdir:ia,readlink:ra,realpath:na}},$i=i=>!i||i===Zt||i===ta?Zt:{...Zt,...i,promises:{...Zt.promises,...i.promises||{}}},Wi=/^\\\\\?\\([a-z]:)\\?$/i,oa=i=>i.replace(/\//g,"\\").replace(Wi,"$1\\"),aa=/[\\\/]/,W=0,Bi=1,zi=2,J=4,Gi=6,Hi=8,dt=10,qi=12,$=15,Xt=~$,ns=16,Mi=32,Qt=64,H=128,ye=256,be=512,Ii=Qt|H|be,ca=1023,os=i=>i.isFile()?Hi:i.isDirectory()?J:i.isSymbolicLink()?dt:i.isCharacterDevice()?zi:i.isBlockDevice()?Gi:i.isSocket()?qi:i.isFIFO()?Bi:W,ji=new Map,te=i=>{let t=ji.get(i);if(t)return t;let e=i.normalize("NFKD");return ji.set(i,e),e},Ui=new Map,Se=i=>{let t=Ui.get(i);if(t)return t;let e=te(i.toLowerCase());return Ui.set(i,e),e},Ee=class extends qt{constructor(){super({max:256})}},cs=class extends qt{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},Vi=Symbol("PathScurry setAsCwd"),D=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#n;get mode(){return this.#n}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#h;get rdev(){return this.#h}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#c;get size(){return this.#c}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#w;get mtimeMs(){return this.#w}#d;get ctimeMs(){return this.#d}#u;get birthtimeMs(){return this.#u}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#T;get ctime(){return this.#T}#R;get birthtime(){return this.#R}#S;#E;#x;#p;#_;#O;#s;#D;#y;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=W,s,r,n,o,a){this.name=t,this.#S=n?Se(t):te(t),this.#s=e&ca,this.nocase=n,this.roots=r,this.root=s||this,this.#D=o,this.#x=a.fullpath,this.#_=a.relative,this.#O=a.relativePosix,this.parent=a.parent,this.parent?this.#t=this.parent.#t:this.#t=$i(a.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#D}resolve(t){if(!t)return this;let e=this.getRootString(t),r=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#P(r):this.#P(r)}#P(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#D.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#D.set(this,e),this.#s&=~ns,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),r=this.nocase?Se(t):te(t);for(let c of s)if(c.#S===r)return c;let n=this.parent?this.sep:"",o=this.#x?this.#x+n+t:void 0,a=this.newChild(t,W,{...e,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=H),s.push(a),a}relative(){if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let t=this.name,e=this.parent;if(!e)return this.#_=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let t=this.name,e=this.parent;if(!e)return this.#O=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#x!==void 0)return this.#x;let t=this.name,e=this.parent;if(!e)return this.#x=this.name;let r=e.fullpath()+(e.parent?this.sep:"")+t;return this.#x=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#p=s}isUnknown(){return(this.#s&$)===W}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&$)===Hi}isDirectory(){return(this.#s&$)===J}isCharacterDevice(){return(this.#s&$)===zi}isBlockDevice(){return(this.#s&$)===Gi}isFIFO(){return(this.#s&$)===Bi}isSocket(){return(this.#s&$)===qi}isSymbolicLink(){return(this.#s&dt)===dt}lstatCached(){return this.#s&Mi?this:void 0}readlinkCached(){return this.#y}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#y)return!0;if(!this.parent)return!1;let t=this.#s&$;return!(t!==W&&t!==dt||this.#s&ye||this.#s&H)}calledReaddir(){return!!(this.#s&ns)}isENOENT(){return!!(this.#s&H)}isNamed(t){return this.nocase?this.#S===Se(t):this.#S===te(t)}async readlink(){let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#y=s}catch(e){this.#l(e.code);return}}readlinkSync(){let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#y=s}catch(e){this.#l(e.code);return}}#L(t){this.#s|=ns;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#F()}}#F(){this.#s&H||(this.#s=(this.#s|H)&Xt,this.#A())}#A(){let t=this.children();t.provisional=0;for(let e of t)e.#F()}#C(){this.#s|=be,this.#M()}#M(){if(this.#s&Qt)return;let t=this.#s;(t&$)===J&&(t&=Xt),this.#s=t|Qt,this.#A()}#I(t=""){t==="ENOTDIR"||t==="EPERM"?this.#M():t==="ENOENT"?this.#F():this.children().provisional=0}#j(t=""){t==="ENOTDIR"?this.parent.#M():t==="ENOENT"&&this.#F()}#l(t=""){let e=this.#s;e|=ye,t==="ENOENT"&&(e|=H),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Xt),this.#s=e,t==="ENOTDIR"&&this.parent&&this.parent.#M()}#U(t,e){return this.#N(t,e)||this.#$(t,e)}#$(t,e){let s=os(t),r=this.newChild(t.name,s,{parent:this}),n=r.#s&$;return n!==J&&n!==dt&&n!==W&&(r.#s|=Qt),e.unshift(r),e.provisional++,r}#N(t,e){for(let s=e.provisional;s<e.length;s++){let r=e[s];if((this.nocase?Se(t.name):te(t.name))===r.#S)return this.#W(t,r,s,e)}}#W(t,e,s,r){let n=e.name;return e.#s=e.#s&Xt|os(t),n!==t.name&&(e.name=t.name),s!==r.provisional&&(s===r.length-1?r.pop():r.splice(s,1),r.unshift(e)),r.provisional++,e}async lstat(){if(!(this.#s&H))try{return this.#H(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#j(t.code)}}lstatSync(){if(!(this.#s&H))try{return this.#H(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#j(t.code)}}#H(t){let{atime:e,atimeMs:s,birthtime:r,birthtimeMs:n,blksize:o,blocks:a,ctime:c,ctimeMs:h,dev:l,gid:f,ino:u,mode:d,mtime:g,mtimeMs:p,nlink:y,rdev:m,size:b,uid:w}=t;this.#v=e,this.#g=s,this.#R=r,this.#u=n,this.#f=o,this.#r=a,this.#T=c,this.#d=h,this.#e=l,this.#b=f,this.#a=u,this.#n=d,this.#m=g,this.#w=p,this.#i=y,this.#h=m,this.#c=b,this.#o=w;let S=os(t);this.#s=this.#s&Xt|S|Mi,S!==W&&S!==J&&S!==dt&&(this.#s|=Qt)}#z=[];#G=!1;#q(t){this.#G=!1;let e=this.#z.slice();this.#z.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#z.push(t),this.#G)return;this.#G=!0;let r=this.fullpath();this.#t.readdir(r,{withFileTypes:!0},(n,o)=>{if(n)this.#I(n.code),s.provisional=0;else{for(let a of o)this.#U(a,s);this.#L(s)}this.#q(s.slice(0,s.provisional))})}#B;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#B)await this.#B;else{let s=()=>{};this.#B=new Promise(r=>s=r);try{for(let r of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#U(r,t);this.#L(t)}catch(r){this.#I(r.code),t.provisional=0}this.#B=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#U(s,t);this.#L(t)}catch(s){this.#I(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#s&Ii)return!1;let t=$&this.#s;return t===W||t===J||t===dt}shouldWalk(t,e){return(this.#s&J)===J&&!(this.#s&Ii)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((be|ye|H)&this.#s))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#C()}}realpathSync(){if(this.#k)return this.#k;if(!((be|ye|H)&this.#s))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#C()}}[Vi](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],r=this;for(;r&&r.parent;)e.add(r),r.#_=s.join(this.sep),r.#O=s.join("/"),r=r.parent,s.push("..");for(r=t;r&&r.parent&&!e.has(r);)r.#_=void 0,r.#O=void 0,r=r.parent}},xe=class i extends D{sep="\\";splitSep=aa;constructor(t,e=W,s,r,n,o,a){super(t,e,s,r,n,o,a)}newChild(t,e=W,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return as.parse(t).root}getRoot(t){if(t=oa(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new Rt(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(Wi,"$1\\"),t===e}},ve=class i extends D{splitSep="/";sep="/";constructor(t,e=W,s,r,n,o,a){super(t,e,s,r,n,o,a)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=W,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Te=class{root;rootPath;roots;cwd;#t;#e;#n;nocase;#i;constructor(t=process.cwd(),e,s,{nocase:r,childrenCacheSize:n=16*1024,fs:o=Zt}={}){this.#i=$i(o),(t instanceof URL||t.startsWith("file://"))&&(t=Ko(t));let a=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#t=new Ee,this.#e=new Ee,this.#n=new cs(n);let c=a.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let h=this.root,l=c.length-1,f=e.sep,u=this.rootPath,d=!1;for(let g of c){let p=l--;h=h.child(g,{relative:new Array(p).fill("..").join(f),relativePosix:new Array(p).fill("..").join("/"),fullpath:u+=(d?"":f)+g}),d=!0}this.cwd=h}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpath();return this.#t.set(e,r),r}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#e.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpathPosix();return this.#e.set(e,r),r}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let r=await t.readdir();return s?r:r.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(r=>r.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=[];(!n||n(t))&&a.push(s?t:t.fullpath());let c=new Set,h=(f,u)=>{c.add(f),f.readdirCB((d,g)=>{if(d)return u(d);let p=g.length;if(!p)return u();let y=()=>{--p===0&&u()};for(let m of g)(!n||n(m))&&a.push(s?m:m.fullpath()),r&&m.isSymbolicLink()?m.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(c,o)?h(b,y):y()):m.shouldWalk(c,o)?h(m,y):y()},!0)},l=t;return new Promise((f,u)=>{h(l,d=>{if(d)return u(d);f(a)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=[];(!n||n(t))&&a.push(s?t:t.fullpath());let c=new Set([t]);for(let h of c){let l=h.readdirSync();for(let f of l){(!n||n(f))&&a.push(s?f:f.fullpath());let u=f;if(f.isSymbolicLink()){if(!(r&&(u=f.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(c,o)&&c.add(u)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let a=new Set([t]);for(let c of a){let h=c.readdirSync();for(let l of h){(!n||n(l))&&(yield s?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(r&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=new at({objectMode:!0});(!n||n(t))&&a.write(s?t:t.fullpath());let c=new Set,h=[t],l=0,f=()=>{let u=!1;for(;!u;){let d=h.shift();if(!d){l===0&&a.end();return}l++,c.add(d);let g=(y,m,b=!1)=>{if(y)return a.emit("error",y);if(r&&!b){let w=[];for(let S of m)S.isSymbolicLink()&&w.push(S.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(w.length){Promise.all(w).then(()=>g(null,m,!0));return}}for(let w of m)w&&(!n||n(w))&&(a.write(s?w:w.fullpath())||(u=!0));l--;for(let w of m){let S=w.realpathCached()||w;S.shouldWalk(c,o)&&h.push(S)}u&&!a.flowing?a.once("drain",f):p||f()},p=!0;d.readdirCB(g,!0),p=!1}};return f(),a}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=new at({objectMode:!0}),c=new Set;(!n||n(t))&&a.write(s?t:t.fullpath());let h=[t],l=0,f=()=>{let u=!1;for(;!u;){let d=h.shift();if(!d){l===0&&a.end();return}l++,c.add(d);let g=d.readdirSync();for(let p of g)(!n||n(p))&&(a.write(s?p:p.fullpath())||(u=!0));l--;for(let p of g){let y=p;if(p.isSymbolicLink()){if(!(r&&(y=p.realpathSync())))continue;y.isUnknown()&&y.lstatSync()}y.shouldWalk(c,o)&&h.push(y)}}u&&!a.flowing&&a.once("drain",f)};return f(),a}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[Vi](e)}},Rt=class extends Te{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,as,"\\",{...e,nocase:s}),this.nocase=s;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(t){return as.parse(t).root.toUpperCase()}newRoot(t){return new xe(this.rootPath,J,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},Ot=class extends Te{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,Vo,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new ve(this.rootPath,J,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},ee=class extends Ot{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},gl=process.platform==="win32"?xe:ve,Ki=process.platform==="win32"?Rt:process.platform==="darwin"?ee:Ot;var ha=i=>i.length>=1,la=i=>i.length>=1,At=class i{#t;#e;#n;length;#i;#o;#b;#h;#f;#a;#c=!0;constructor(t,e,s,r){if(!ha(t))throw new TypeError("empty pattern list");if(!la(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#e=e,this.#n=s,this.#i=r,this.#n===0){if(this.isUNC()){let[n,o,a,c,...h]=this.#t,[l,f,u,d,...g]=this.#e;h[0]===""&&(h.shift(),g.shift());let p=[n,o,a,c,""].join("/"),y=[l,f,u,d,""].join("/");this.#t=[p,...h],this.#e=[y,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[a,...c]=this.#e;o[0]===""&&(o.shift(),c.shift());let h=n+"/",l=a+"/";this.#t=[h,...o],this.#e=[l,...c],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===_}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#b=this.#b||(this.#n===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#t,this.#e,this.#n+1,this.#i),this.#o.#a=this.#a,this.#o.#f=this.#f,this.#o.#h=this.#h,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=this.#i==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#a!==void 0?this.#a:this.#a=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var fa=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ct=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:r,noglobstar:n,platform:o=fa}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:r,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of t)this.add(a)}add(t){let e=new I(t,this.mmopts);for(let s=0;s<e.set.length;s++){let r=e.set[s],n=e.globParts[s];if(!r||!n)throw new Error("invalid pattern object");for(;r[0]==="."&&n[0]===".";)r.shift(),n.shift();let o=new At(r,n,0,this.platform),a=new I(o.globString(),this.mmopts),c=n[n.length-1]==="**",h=o.isAbsolute();h?this.absolute.push(a):this.relative.push(a),c&&(h?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),s=`${e}/`,r=t.relative()||".",n=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(s))return!0;for(let r of this.absoluteChildren)if(r.match(e))return!0;return!1}};var hs=class i{store;constructor(t=new Map){this.store=t}copy(){return new i(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),r=this.store.get(s);r?r.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},ls=class{store=new Map;add(t,e,s){let r=(e?2:0)|(s?1:0),n=this.store.get(t);this.store.set(t,n===void 0?r:r&n)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},fs=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(r=>r.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},se=class i{hasWalkedCache;matches=new ls;subwalks=new fs;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new hs}processPatterns(t,e){this.patterns=e;let s=e.map(r=>[t,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let c,h,l=!1;for(;typeof(c=n.pattern())=="string"&&(h=n.rest());)r=r.resolve(c),n=h,l=!0;if(c=n.pattern(),h=n.rest(),l){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n)}if(typeof c=="string"){let f=c===".."||c===""||c===".";this.matches.add(r.resolve(c),a,f);continue}else if(c===_){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let f=h?.pattern(),u=h?.rest();if(!h||(f===""||f===".")&&!u)this.matches.add(r,a,f===""||f===".");else if(f===".."){let d=r.parent||r;u?this.hasWalkedCache.hasWalked(d,u)||this.subwalks.add(d,u):this.matches.add(d,a,!0)}}else c instanceof RegExp&&this.subwalks.add(r,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),r=this.child();for(let n of e)for(let o of s){let a=o.isAbsolute(),c=o.pattern(),h=o.rest();c===_?r.testGlobstar(n,o,h,a):c instanceof RegExp?r.testRegExp(n,c,h,a):r.testString(n,c,h,a)}return r}testGlobstar(t,e,s,r){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,r,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),r);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),r)}}testRegExp(t,e,s,r){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}testString(t,e,s,r){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}};var ua=(i,t)=>typeof i=="string"?new Ct([i],t):Array.isArray(i)?new Ct(i,t):i,Re=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#n;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#e=ua(s.ignore??[],s),!this.includeChildMatches&&typeof this.#e.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#i(t){return this.seen.has(t)||!!this.#e?.ignored?.(t)}#o(t){return!!this.#e?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#i(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#i(t))return;if(!this.includeChildMatches&&this.#e?.add){let n=`${t.relativePosix()}/**`;this.#e.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let r=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+r)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(n?o+n+r:"."+r)}}async match(t,e,s){let r=await this.matchCheck(t,s);r&&this.matchFinish(r,e)}matchSync(t,e,s){let r=this.matchCheckSync(t,s);r&&this.matchFinish(r,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new se(this.opts),s)}walkCB2(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,h).then(()=>o()));for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,s,o):a.readdirCB((h,l)=>this.walkCB3(a,l,s,o),!0)}o()}walkCB3(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,h).then(()=>o()));for(let[a,c]of s.subwalks.entries())n++,this.walkCB2(a,c,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new se(this.opts),s)}walkCB2Sync(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||this.matchSync(a,c,h);for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirSync();this.walkCB3Sync(a,c,s,o)}o()}walkCB3Sync(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||this.matchSync(a,c,h);for(let[a,c]of s.subwalks.entries())n++,this.walkCB2Sync(a,c,s.child(),o);o()}},ie=class extends Re{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},re=class extends Re{results;constructor(t,e,s){super(t,e,s),this.results=new at({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var pa=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",q=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=da(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=t,this.platform=e.platform||pa,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=e.platform==="win32"?Rt:e.platform==="darwin"?ee:e.platform?Ot:Ki;this.scurry=new c(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",r={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(c=>new I(c,r)),[o,a]=n.reduce((c,h)=>(c[0].push(...h.set),c[1].push(...h.globParts),c),[[],[]]);this.patterns=o.map((c,h)=>{let l=a[h];if(!l)throw new Error("invalid pattern object");return new At(c,l,0,this.platform)})}async walk(){return[...await new ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new re(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new re(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var us=(i,t={})=>{Array.isArray(i)||(i=[i]);for(let e of i)if(new I(e,t).hasMagic())return!0;return!1};function Ae(i,t={}){return new q(i,t).streamSync()}function Ji(i,t={}){return new q(i,t).stream()}function Ce(i,t={}){return new q(i,t).walkSync()}async function Yi(i,t={}){return new q(i,t).walk()}function _e(i,t={}){return new q(i,t).iterateSync()}function Xi(i,t={}){return new q(i,t).iterate()}var ma=Ae,ga=Object.assign(Ji,{sync:Ae}),wa=_e,ya=Object.assign(Xi,{sync:_e}),Sa=Object.assign(Ce,{stream:Ae,iterate:_e}),Oe=Object.assign(Yi,{glob:Yi,globSync:Ce,sync:Sa,globStream:Ji,stream:ga,globStreamSync:Ae,streamSync:ma,globIterate:Xi,iterate:ya,globIterateSync:_e,iterateSync:wa,Glob:q,hasMagic:us,escape:bt,unescape:z});Oe.glob=Oe;var ct=(i,t)=>typeof i>"u"||typeof i===t,Zi=i=>!!i&&typeof i=="object"&&ct(i.preserveRoot,"boolean")&&ct(i.tmp,"string")&&ct(i.maxRetries,"number")&&ct(i.retryDelay,"number")&&ct(i.backoff,"number")&&ct(i.maxBackoff,"number")&&(ct(i.glob,"boolean")||i.glob&&typeof i.glob=="object")&&ct(i.filter,"function"),Qi=i=>{if(!Zi(i))throw new Error("invalid rimraf options")},tr=i=>{Qi(i);let{glob:t,...e}=i;if(!t)return e;let s=t===!0?i.signal?{signal:i.signal}:{}:i.signal?{signal:i.signal,...t}:t;return{...e,glob:{...s,absolute:!0,withFileTypes:!1}}},er=(i={})=>tr(i),sr=(i={})=>tr(i);import{parse as ir,resolve as ba}from"path";import{inspect as Ea}from"util";var V=process.env.__TESTING_RIMRAF_PLATFORM__||process.platform;var xa=(i,t={})=>{let e=typeof i;if(e!=="string"){let r=i&&e==="object"&&i.constructor,o=`The "path" argument must be of type string. Received ${r&&r.name?`an instance of ${r.name}`:e==="object"?Ea(i):`type ${e} ${i}`}`;throw Object.assign(new TypeError(o),{path:i,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(i)){let r="path must be a string without null bytes";throw Object.assign(new TypeError(r),{path:i,code:"ERR_INVALID_ARG_VALUE"})}i=ba(i);let{root:s}=ir(i);if(i===s&&t.preserveRoot!==!1){let r="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(r),{path:i,code:"ERR_PRESERVE_ROOT"})}if(V==="win32"){let r=/[*|"<>?:]/,{root:n}=ir(i);if(r.test(i.substring(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:i,code:"EINVAL"})}return i},ne=xa;import tt from"fs";import{chmodSync as ke,mkdirSync as ef,renameSync as nr,rmdirSync as _t,rmSync as or,statSync as ar,lstatSync as kt,unlinkSync as Nt}from"fs";import{readdirSync as va}from"fs";var rr=i=>va(i,{withFileTypes:!0}),Ta=(i,t)=>new Promise((e,s)=>tt.chmod(i,t,(r,...n)=>r?s(r):e(...n))),Ra=(i,t)=>new Promise((e,s)=>tt.mkdir(i,t,(r,n)=>r?s(r):e(n))),Oa=i=>new Promise((t,e)=>tt.readdir(i,{withFileTypes:!0},(s,r)=>s?e(s):t(r))),Aa=(i,t)=>new Promise((e,s)=>tt.rename(i,t,(r,...n)=>r?s(r):e(...n))),Ca=(i,t)=>new Promise((e,s)=>tt.rm(i,t,(r,...n)=>r?s(r):e(...n))),_a=i=>new Promise((t,e)=>tt.rmdir(i,(s,...r)=>s?e(s):t(...r))),ka=i=>new Promise((t,e)=>tt.stat(i,(s,r)=>s?e(s):t(r))),Na=i=>new Promise((t,e)=>tt.lstat(i,(s,r)=>s?e(s):t(r))),Da=i=>new Promise((t,e)=>tt.unlink(i,(s,...r)=>s?e(s):t(...r))),F={chmod:Ta,mkdir:Ra,readdir:Oa,rename:Aa,rm:Ca,rmdir:_a,stat:ka,lstat:Na,unlink:Da};import{parse as cr,resolve as hr}from"path";var{readdir:Pa}=F,Dt=i=>Pa(i).catch(t=>t),Pt=i=>{try{return rr(i)}catch(t){return t}};var et=async i=>i.catch(t=>{if(t.code!=="ENOENT")throw t}),st=i=>{try{return i()}catch(t){if(t?.code!=="ENOENT")throw t}};var{lstat:La,rmdir:Fa,unlink:Ma}=F,Ne=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await lr(i,t,await La(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},De=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return fr(i,t,kt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},lr=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?await Dt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await et(Ma(i)),!0)}return!(await Promise.all(s.map(n=>lr(hr(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===cr(i).root||t.filter&&!await t.filter(i,e)?!1:(await et(Fa(i)),!0)},fr=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?Pt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!t.filter(i,e)?!1:(st(()=>Nt(i)),!0)}let r=!0;for(let n of s){let o=hr(i,n.name);r=fr(o,t,n)&&r}return t.preserveRoot===!1&&i===cr(i).root||!r||t.filter&&!t.filter(i,e)?!1:(st(()=>_t(i)),!0)};import{parse as br,resolve as Er}from"path";var{chmod:Ia}=F,ds=i=>async t=>{try{return await i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{await Ia(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return await i(t)}throw e}},ps=i=>t=>{try{return i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{ke(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return i(t)}throw e}};var ur=new Set(["EMFILE","ENFILE","EBUSY"]),ms=i=>{let t=async(e,s,r=1,n=0)=>{let o=s.maxBackoff||200,a=s.backoff||1.2,c=s.maxRetries||10,h=0;for(;;)try{return await i(e)}catch(l){let f=l;if(f?.path===e&&f?.code&&ur.has(f.code)){if(r=Math.ceil(r*a),n=r+n,n<o)return new Promise((u,d)=>{setTimeout(()=>{t(e,s,r,n).then(u,d)},r)});if(h<c){h++;continue}}throw l}};return t},gs=i=>(e,s)=>{let r=s.maxRetries||10,n=0;for(;;)try{return i(e)}catch(o){let a=o;if(a?.path===e&&a?.code&&ur.has(a.code)&&n<r){n++;continue}throw o}};import{basename as Ha,parse as Fe,resolve as Me}from"path";import{tmpdir as Le}from"os";import{parse as Pe,resolve as dr}from"path";var{stat:ja}=F,Ua=i=>{try{return ar(i).isDirectory()}catch{return!1}},$a=i=>ja(i).then(t=>t.isDirectory(),()=>!1),Wa=async i=>{let{root:t}=Pe(i),e=Le(),{root:s}=Pe(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=dr(t,"/temp");return await $a(r)?r:t},Ba=i=>{let{root:t}=Pe(i),e=Le(),{root:s}=Pe(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=dr(t,"/temp");return Ua(r)?r:t},za=async()=>Le(),Ga=()=>Le(),pr=V==="win32"?Wa:za,mr=V==="win32"?Ba:Ga;var{lstat:qa,rename:Va,unlink:gr,rmdir:Ka,chmod:Ya}=F,Sr=i=>`.${Ha(i)}.${Math.random()}`,Ja=async i=>gr(i).catch(t=>{if(t.code==="EPERM")return Ya(i,438).then(()=>gr(i),e=>{if(e.code!=="ENOENT")throw t});if(t.code==="ENOENT")return;throw t}),Xa=i=>{try{Nt(i)}catch(t){if(t?.code==="EPERM")try{return ke(i,438)}catch(e){if(e?.code==="ENOENT")return;throw t}else if(t?.code==="ENOENT")return;throw t}},Ie=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await ws(i,t,await qa(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ws=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return ws(i,{...t,tmp:await pr(i)},e);if(i===t.tmp&&Fe(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let s=e.isDirectory()?await Dt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await et(wr(i,t.tmp,Ja)),!0)}return!(await Promise.all(s.map(n=>ws(Me(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===Fe(i).root||t.filter&&!await t.filter(i,e)?!1:(await et(wr(i,t.tmp,Ka)),!0)},wr=async(i,t,e)=>{let s=Me(t,Sr(i));return await Va(i,s),await e(s)},je=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return ys(i,t,kt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ys=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return ys(i,{...t,tmp:mr(i)},e);let s=t.tmp;if(i===t.tmp&&Fe(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let r=e.isDirectory()?Pt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(st(()=>yr(i,s,Xa)),!0)}let n=!0;for(let o of r){let a=Me(i,o.name);n=ys(a,t,o)&&n}return!n||t.preserveRoot===!1&&i===Fe(i).root||t.filter&&!t.filter(i,e)?!1:(st(()=>yr(i,s,_t)),!0)},yr=(i,t,e)=>{let s=Me(t,Sr(i));return nr(i,s),e(s)};var{unlink:Za,rmdir:Qa,lstat:tc}=F,ec=ms(ds(Za)),sc=gs(ps(Nt)),ic=ms(ds(Qa)),rc=gs(ps(_t)),nc=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return await ic(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return await Ie(i,s);throw r}},oc=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return rc(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return je(i,s);throw r}},ht=Symbol("start"),xr=Symbol("child"),Ue=Symbol("finish"),$e=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await Ss(i,t,await tc(i),ht)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},We=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return bs(i,t,kt(i),ht)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},Ss=async(i,t,e,s=ht)=>{if(t?.signal?.aborted)throw t.signal.reason;let r=e.isDirectory()?await Dt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!await t.filter(i,e)?!1:(await et(ec(i,t)),!0)}let n=s===ht?xr:s,o=(await Promise.all(r.map(a=>Ss(Er(i,a.name),t,a,n)))).reduce((a,c)=>a&&c,!0);if(s===ht)return Ss(i,t,e,Ue);if(s===Ue){if(t.preserveRoot===!1&&i===br(i).root||!o||t.filter&&!await t.filter(i,e))return!1;await et(nc(i,t))}return!0},bs=(i,t,e,s=ht)=>{let r=e.isDirectory()?Pt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(st(()=>sc(i,t)),!0)}let n=!0;for(let o of r){let a=s===ht?xr:s,c=Er(i,o.name);n=bs(c,t,o,a)&&n}if(s===ht)return bs(i,t,e,Ue);if(s===Ue){if(t.preserveRoot===!1&&i===br(i).root||!n||t.filter&&!t.filter(i,e))return!1;st(()=>{oc(i,t)})}return!0};var Es=V==="win32"?$e:Ne,xs=V==="win32"?We:De;var{rm:ac}=F,vs=async(i,t)=>(await ac(i,{...t,force:!0,recursive:!0}),!0),Ts=(i,t)=>(or(i,{...t,force:!0,recursive:!0}),!0);var cc=process.env.__TESTING_RIMRAF_NODE_VERSION__||process.version,hc=cc.replace(/^v/,"").split("."),[vr=0,lc=0]=hc.map(i=>parseInt(i,10)),Tr=vr>14||vr===14&&lc>=14,Rr=!Tr||V==="win32"?()=>!1:i=>!i?.signal&&!i?.filter,Or=!Tr||V==="win32"?()=>!1:i=>!i?.signal&&!i?.filter;var Lt=i=>async(t,e)=>{let s=er(e);return s.glob&&(t=await Oe(t,s.glob)),Array.isArray(t)?!!(await Promise.all(t.map(r=>i(ne(r,s),s)))).reduce((r,n)=>r&&n,!0):!!await i(ne(t,s),s)},Ft=i=>(t,e)=>{let s=sr(e);return s.glob&&(t=Ce(t,s.glob)),Array.isArray(t)?!!t.map(r=>i(ne(r,s),s)).reduce((r,n)=>r&&n,!0):!!i(ne(t,s),s)},_r=Ft(Ts),fc=Object.assign(Lt(vs),{sync:_r}),kr=Ft(xs),uc=Object.assign(Lt(Es),{sync:kr}),Nr=Ft(We),dc=Object.assign(Lt($e),{sync:Nr}),Dr=Ft(De),pc=Object.assign(Lt(Ne),{sync:Dr}),Pr=Ft(je),mc=Object.assign(Lt(Ie),{sync:Pr}),Rs=Ft((i,t)=>Or(t)?Ts(i,t):xs(i,t)),Lr=Rs,Ar=Lt((i,t)=>Rr(t)?vs(i,t):Es(i,t)),Cr=Object.assign(Ar,{rimraf:Ar,sync:Rs,rimrafSync:Rs,manual:uc,manualSync:kr,native:fc,nativeSync:_r,posix:pc,posixSync:Dr,windows:dc,windowsSync:Nr,moveRemove:mc,moveRemoveSync:Pr});Cr.rimraf=Cr;var Mr=wc(new URL(".",import.meta.url)),As=Fr(Mr,"../builder/vite-config.js"),yc=Fr(Mr,"../builder/vite-entry-server.js");async function Ir({options:i,logger:t}){t.info(`Building template...
|
|
41
|
-
`),i.clean&&Lr(gc.join(process.cwd(),"dist"));let e="production";i.ssr==="local"&&(e="development",process.env.NODE_ENV=e),i.ssr?(await Os({configFile:As,customLogger:t,mode:e,logLevel:i.logLevel,clearScreen:i.clearScreen,build:{ssrManifest:!0,emptyOutDir:!0}}),await Os({configFile:As,customLogger:t,mode:e,logLevel:i.logLevel,clearScreen:i.clearScreen,ssr:{target:"webworker"},build:{ssr:yc}})):await Os({configFile:As,customLogger:t,logLevel:i.logLevel,clearScreen:i.clearScreen,build:{emptyOutDir:!0}})}jt();gt();async function jr({options:i,logger:t}){t.info("Logging out fom Enpage..."),
|
|
42
|
-
`),process.exit(0)}var Cs;
|
|
40
|
+
>>> no match, partial?`,t,u,e,d),u===c))}let p;if(typeof l=="string"?(p=f===l,this.debug("string match",l,f,p)):(p=l.test(f),this.debug("pattern match",l,f,p)),!p)return!1}if(o===c&&a===h)return!0;if(o===c)return s;if(a===h)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Oi(this.pattern,this.options)}parse(t){Gt(t);let e=this.options;if(t==="**")return _;if(t==="")return"";let s,r=null;(s=t.match(yo))?r=e.dot?bo:So:(s=t.match(ao))?r=(e.nocase?e.dot?fo:lo:e.dot?ho:co)(s[1]):(s=t.match(Eo))?r=(e.nocase?e.dot?vo:xo:e.dot?To:Ro)(s):(s=t.match(uo))?r=e.dot?mo:po:(s=t.match(go))&&(r=wo);let n=St.fromGlob(t,this.options).toMMPattern();return r&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:r}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Co:e.dot?_o:ko,r=new Set(e.nocase?["i"]:[]),n=t.map(c=>{let h=c.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))r.add(f);return typeof l=="string"?Mo(l):l===_?_:l._src});return h.forEach((l,f)=>{let u=h[f+1],d=h[f-1];l!==_||d===_||(d===void 0?u!==void 0&&u!==_?h[f+1]="(?:\\/|"+s+"\\/)?"+u:h[f]=s:u===void 0?h[f-1]=d+"(?:\\/|"+s+")?":u!==_&&(h[f-1]=d+"(?:\\/|\\/"+s+"\\/)"+u,h[f+1]=_))}),h.filter(l=>l!==_).join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];n="^"+o+n+a+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let n=this.set;this.debug(this.pattern,"set",n);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<n.length;a++){let c=n[a],h=r;if(s.matchBase&&c.length===1&&(h=[o]),this.matchOne(h,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return P.defaults(t).Minimatch}};P.AST=St;P.Minimatch=I;P.escape=bt;P.unescape=z;import{fileURLToPath as da}from"node:url";var Et=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ci=new Set,Je=typeof process=="object"&&process?process:{},_i=(i,t,e,s)=>{typeof Je.emitWarning=="function"?Je.emitWarning(i,t,e,s):console.error(`[${e}] ${t}: ${i}`)},fe=globalThis.AbortController,Ai=globalThis.AbortSignal;if(typeof fe>"u"){Ai=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,r){this._onabort.push(r)}},fe=class{constructor(){t()}signal=new Ai;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let r of this.signal._onabort)r(s);this.signal.onabort?.(s)}}};let i=Je.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=!1,_i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Fo=i=>!Ci.has(i),rl=Symbol("type"),nt=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),ki=i=>nt(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?xt:null:null,xt=class extends Array{constructor(t){super(t),this.fill(0)}},Xe=class i{heap;length;static#t=!1;static create(t){let e=ki(t);if(!e)return[];i.#t=!0;let s=new i(t,e);return i.#t=!1,s}constructor(t,e){if(!i.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},qt=class i{#t;#e;#n;#i;#o;#b;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#h;#f;#a;#c;#r;#g;#w;#d;#u;#v;#m;#T;#R;#S;#E;#x;#p;static unsafeExposeInternals(t){return{starts:t.#R,ttls:t.#S,sizes:t.#T,keyMap:t.#a,keyList:t.#c,valList:t.#r,next:t.#g,prev:t.#w,get head(){return t.#d},get tail(){return t.#u},free:t.#v,isBackgroundFetch:e=>t.#l(e),backgroundFetch:(e,s,r,n)=>t.#j(e,s,r,n),moveToTail:e=>t.#$(e),indexes:e=>t.#A(e),rindexes:e=>t.#C(e),isStale:e=>t.#y(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#f}get size(){return this.#h}get fetchMethod(){return this.#o}get memoMethod(){return this.#b}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(t){let{max:e=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:h,disposeAfter:l,noDisposeOnSet:f,noUpdateTTL:u,maxSize:d=0,maxEntrySize:g=0,sizeCalculation:p,fetchMethod:y,memoMethod:m,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:E,ignoreFetchAbort:v}=t;if(e!==0&&!nt(e))throw new TypeError("max option must be a nonnegative integer");let C=e?ki(e):Array;if(!C)throw new Error("invalid max value: "+e);if(this.#t=e,this.#e=d,this.maxEntrySize=g||this.#e,this.sizeCalculation=p,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#b=m,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=y,this.#x=!!y,this.#a=new Map,this.#c=new Array(e).fill(void 0),this.#r=new Array(e).fill(void 0),this.#g=new C(e),this.#w=new C(e),this.#d=0,this.#u=0,this.#v=Xe.create(e),this.#h=0,this.#f=0,typeof h=="function"&&(this.#n=h),typeof l=="function"?(this.#i=l,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#E=!!this.#n,this.#p=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#e!==0&&!nt(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!nt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=nt(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!nt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#_()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let K="LRU_CACHE_UNBOUNDED";Fo(K)&&(Ci.add(K),_i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",K,i))}}getRemainingTTL(t){return this.#a.has(t)?1/0:0}#_(){let t=new xt(this.#t),e=new xt(this.#t);this.#S=t,this.#R=e,this.#D=(n,o,a=Et.now())=>{if(e[n]=o!==0?a:0,t[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#y(n)&&this.#N(this.#c[n],"expire")},o+1);c.unref&&c.unref()}},this.#O=n=>{e[n]=t[n]!==0?Et.now():0},this.#s=(n,o)=>{if(t[o]){let a=t[o],c=e[o];if(!a||!c)return;n.ttl=a,n.start=c,n.now=s||r();let h=n.now-c;n.remainingTTL=a-h}};let s=0,r=()=>{let n=Et.now();if(this.ttlResolution>0){s=n;let o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{let o=this.#a.get(n);if(o===void 0)return 0;let a=t[o],c=e[o];if(!a||!c)return 1/0;let h=(s||r())-c;return a-h},this.#y=n=>{let o=e[n],a=t[n];return!!a&&!!o&&(s||r())-o>a}}#O=()=>{};#s=()=>{};#D=()=>{};#y=()=>!1;#k(){let t=new xt(this.#t);this.#f=0,this.#T=t,this.#P=e=>{this.#f-=t[e],t[e]=0},this.#M=(e,s,r,n)=>{if(this.#l(s))return 0;if(!nt(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,e),!nt(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(e,s,r)=>{if(t[e]=s,this.#e){let n=this.#e-t[e];for(;this.#f>n;)this.#I(!0)}this.#f+=t[e],r&&(r.entrySize=s,r.totalCalculatedSize=this.#f)}}#P=t=>{};#L=(t,e,s)=>{};#M=(t,e,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#u;!(!this.#F(e)||((t||!this.#y(e))&&(yield e),e===this.#d));)e=this.#w[e]}*#C({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#d;!(!this.#F(e)||((t||!this.#y(e))&&(yield e),e===this.#u));)e=this.#g[e]}#F(t){return t!==void 0&&this.#a.get(this.#c[t])===t}*entries(){for(let t of this.#A())this.#r[t]!==void 0&&this.#c[t]!==void 0&&!this.#l(this.#r[t])&&(yield[this.#c[t],this.#r[t]])}*rentries(){for(let t of this.#C())this.#r[t]!==void 0&&this.#c[t]!==void 0&&!this.#l(this.#r[t])&&(yield[this.#c[t],this.#r[t]])}*keys(){for(let t of this.#A()){let e=this.#c[t];e!==void 0&&!this.#l(this.#r[t])&&(yield e)}}*rkeys(){for(let t of this.#C()){let e=this.#c[t];e!==void 0&&!this.#l(this.#r[t])&&(yield e)}}*values(){for(let t of this.#A())this.#r[t]!==void 0&&!this.#l(this.#r[t])&&(yield this.#r[t])}*rvalues(){for(let t of this.#C())this.#r[t]!==void 0&&!this.#l(this.#r[t])&&(yield this.#r[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#A()){let r=this.#r[s],n=this.#l(r)?r.__staleWhileFetching:r;if(n!==void 0&&t(n,this.#c[s],this))return this.get(this.#c[s],e)}}forEach(t,e=this){for(let s of this.#A()){let r=this.#r[s],n=this.#l(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#c[s],this)}}rforEach(t,e=this){for(let s of this.#C()){let r=this.#r[s],n=this.#l(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#c[s],this)}}purgeStale(){let t=!1;for(let e of this.#C({allowStale:!0}))this.#y(e)&&(this.#N(this.#c[e],"expire"),t=!0);return t}info(t){let e=this.#a.get(t);if(e===void 0)return;let s=this.#r[e],r=this.#l(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#S&&this.#R){let o=this.#S[e],a=this.#R[e];if(o&&a){let c=o-(Et.now()-a);n.ttl=c,n.start=Date.now()}}return this.#T&&(n.size=this.#T[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let s=this.#c[e],r=this.#r[e],n=this.#l(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#S&&this.#R){o.ttl=this.#S[e];let a=Et.now()-this.#R[e];o.start=Math.floor(Date.now()-a)}this.#T&&(o.size=this.#T[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let r=Date.now()-s.start;s.start=Et.now()-r}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=s,{noUpdateTTL:h=this.noUpdateTTL}=s,l=this.#M(t,e,s.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#N(t,"set"),this;let f=this.#h===0?void 0:this.#a.get(t);if(f===void 0)f=this.#h===0?this.#u:this.#v.length!==0?this.#v.pop():this.#h===this.#t?this.#I(!1):this.#h,this.#c[f]=t,this.#r[f]=e,this.#a.set(t,f),this.#g[this.#u]=f,this.#w[f]=this.#u,this.#u=f,this.#h++,this.#L(f,l,c),c&&(c.set="add"),h=!1;else{this.#$(f);let u=this.#r[f];if(e!==u){if(this.#x&&this.#l(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=u;d!==void 0&&!o&&(this.#E&&this.#n?.(d,t,"set"),this.#p&&this.#m?.push([d,t,"set"]))}else o||(this.#E&&this.#n?.(u,t,"set"),this.#p&&this.#m?.push([u,t,"set"]));if(this.#P(f),this.#L(f,l,c),this.#r[f]=e,c){c.set="replace";let d=u&&this.#l(u)?u.__staleWhileFetching:u;d!==void 0&&(c.oldValue=d)}}else c&&(c.set="update")}if(r!==0&&!this.#S&&this.#_(),this.#S&&(h||this.#D(f,r,n),c&&this.#s(c,f)),!o&&this.#p&&this.#m){let u=this.#m,d;for(;d=u?.shift();)this.#i?.(...d)}return this}pop(){try{for(;this.#h;){let t=this.#r[this.#d];if(this.#I(!0),this.#l(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#p&&this.#m){let t=this.#m,e;for(;e=t?.shift();)this.#i?.(...e)}}}#I(t){let e=this.#d,s=this.#c[e],r=this.#r[e];return this.#x&&this.#l(r)?r.__abortController.abort(new Error("evicted")):(this.#E||this.#p)&&(this.#E&&this.#n?.(r,s,"evict"),this.#p&&this.#m?.push([r,s,"evict"])),this.#P(e),t&&(this.#c[e]=void 0,this.#r[e]=void 0,this.#v.push(e)),this.#h===1?(this.#d=this.#u=0,this.#v.length=0):this.#d=this.#g[e],this.#a.delete(s),this.#h--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=e,n=this.#a.get(t);if(n!==void 0){let o=this.#r[n];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#y(n))r&&(r.has="stale",this.#s(r,n));else return s&&this.#O(n),r&&(r.has="hit",this.#s(r,n)),!0}else r&&(r.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,r=this.#a.get(t);if(r===void 0||!s&&this.#y(r))return;let n=this.#r[r];return this.#l(n)?n.__staleWhileFetching:n}#j(t,e,s,r){let n=e===void 0?void 0:this.#r[e];if(this.#l(n))return n;let o=new fe,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:r},h=(p,y=!1)=>{let{aborted:m}=o.signal,b=s.ignoreFetchAbort&&p!==void 0;if(s.status&&(m&&!y?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,b&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!b&&!y)return f(o.signal.reason);let w=d;return this.#r[e]===d&&(p===void 0?w.__staleWhileFetching?this.#r[e]=w.__staleWhileFetching:this.#N(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,c.options))),p},l=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),f(p)),f=p=>{let{aborted:y}=o.signal,m=y&&s.allowStaleOnFetchAbort,b=m||s.allowStaleOnFetchRejection,w=b||s.noDeleteOnFetchRejection,S=d;if(this.#r[e]===d&&(!w||S.__staleWhileFetching===void 0?this.#N(t,"fetch"):m||(this.#r[e]=S.__staleWhileFetching)),b)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw p},u=(p,y)=>{let m=this.#o?.(t,n,c);m&&m instanceof Promise&&m.then(b=>p(b===void 0?void 0:b),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=b=>h(b,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(u).then(h,l),g=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,g,{...c.options,status:void 0}),e=this.#a.get(t)):this.#r[e]=g,g}#l(t){if(!this.#x)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof fe}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:p,forceRefresh:y=!1,status:m,signal:b}=e;if(!this.#x)return m&&(m.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:m});let w={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:h,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:m,signal:b},S=this.#a.get(t);if(S===void 0){m&&(m.fetch="miss");let E=this.#j(t,S,w,p);return E.__returned=E}else{let E=this.#r[S];if(this.#l(E)){let oe=s&&E.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",oe&&(m.returnedStale=!0)),oe?E.__staleWhileFetching:E.__returned=E}let v=this.#y(S);if(!y&&!v)return m&&(m.fetch="hit"),this.#$(S),r&&this.#O(S),m&&this.#s(m,S),E;let C=this.#j(t,S,w,p),B=C.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=v?"stale":"refresh",B&&v&&(m.returnedStale=!0)),B?C.__staleWhileFetching:C.__returned=C}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=this.#b;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=e,a=this.get(t,o);if(!n&&a!==void 0)return a;let c=s(t,a,{options:o,context:r});return this.set(t,c,o),c}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,a=this.#a.get(t);if(a!==void 0){let c=this.#r[a],h=this.#l(c);return o&&this.#s(o,a),this.#y(a)?(o&&(o.get="stale"),h?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?c.__staleWhileFetching:void 0):(n||this.#N(t,"expire"),o&&s&&(o.returnedStale=!0),s?c:void 0)):(o&&(o.get="hit"),h?c.__staleWhileFetching:(this.#$(a),r&&this.#O(a),c))}else o&&(o.get="miss")}#U(t,e){this.#w[e]=t,this.#g[t]=e}#$(t){t!==this.#u&&(t===this.#d?this.#d=this.#g[t]:this.#U(this.#w[t],this.#g[t]),this.#U(this.#u,t),this.#u=t)}delete(t){return this.#N(t,"delete")}#N(t,e){let s=!1;if(this.#h!==0){let r=this.#a.get(t);if(r!==void 0)if(s=!0,this.#h===1)this.#W(e);else{this.#P(r);let n=this.#r[r];if(this.#l(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#p)&&(this.#E&&this.#n?.(n,t,e),this.#p&&this.#m?.push([n,t,e])),this.#a.delete(t),this.#c[r]=void 0,this.#r[r]=void 0,r===this.#u)this.#u=this.#w[r];else if(r===this.#d)this.#d=this.#g[r];else{let o=this.#w[r];this.#g[o]=this.#g[r];let a=this.#g[r];this.#w[a]=this.#w[r]}this.#h--,this.#v.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,n;for(;n=r?.shift();)this.#i?.(...n)}return s}clear(){return this.#W("delete")}#W(t){for(let e of this.#C({allowStale:!0})){let s=this.#r[e];if(this.#l(s))s.__abortController.abort(new Error("deleted"));else{let r=this.#c[e];this.#E&&this.#n?.(s,r,t),this.#p&&this.#m?.push([s,r,t])}}if(this.#a.clear(),this.#r.fill(void 0),this.#c.fill(void 0),this.#S&&this.#R&&(this.#S.fill(0),this.#R.fill(0)),this.#T&&this.#T.fill(0),this.#d=0,this.#u=0,this.#v.length=0,this.#f=0,this.#h=0,this.#p&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#i?.(...s)}}};import{posix as Vo,win32 as as}from"node:path";import{fileURLToPath as Ko}from"node:url";import{lstatSync as Yo,readdir as Jo,readdirSync as Xo,readlinkSync as Zo,realpathSync as Qo}from"fs";import*as ta from"node:fs";import{lstat as sa,readdir as ia,readlink as ra,realpath as na}from"node:fs/promises";import{EventEmitter as rs}from"node:events";import Mi from"node:stream";import{StringDecoder as Io}from"node:string_decoder";var Ni=typeof process=="object"&&process?process:{stdout:null,stderr:null},jo=i=>!!i&&typeof i=="object"&&(i instanceof at||i instanceof Mi||Uo(i)||$o(i)),Uo=i=>!!i&&typeof i=="object"&&i instanceof rs&&typeof i.pipe=="function"&&i.pipe!==Mi.Writable.prototype.pipe,$o=i=>!!i&&typeof i=="object"&&i instanceof rs&&typeof i.write=="function"&&typeof i.end=="function",Z=Symbol("EOF"),Q=Symbol("maybeEmitEnd"),ot=Symbol("emittedEnd"),ue=Symbol("emittingEnd"),Vt=Symbol("emittedError"),de=Symbol("closed"),Di=Symbol("read"),pe=Symbol("flush"),Pi=Symbol("flushChunk"),G=Symbol("encoding"),vt=Symbol("decoder"),R=Symbol("flowing"),Kt=Symbol("paused"),Tt=Symbol("resume"),O=Symbol("buffer"),L=Symbol("pipes"),A=Symbol("bufferLength"),Ze=Symbol("bufferPush"),me=Symbol("bufferShift"),N=Symbol("objectMode"),x=Symbol("destroyed"),Qe=Symbol("error"),ts=Symbol("emitData"),Li=Symbol("emitEnd"),es=Symbol("emitEnd2"),Y=Symbol("async"),ss=Symbol("abort"),ge=Symbol("aborted"),Yt=Symbol("signal"),ut=Symbol("dataListeners"),j=Symbol("discarded"),Jt=i=>Promise.resolve().then(i),Wo=i=>i(),Bo=i=>i==="end"||i==="finish"||i==="prefinish",zo=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,Go=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),we=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[Tt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},is=class extends we{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=r=>e.emit("error",r),t.on("error",this.proxyErrors)}},Ho=i=>!!i.objectMode,qo=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",at=class extends rs{[R]=!1;[Kt]=!1;[L]=[];[O]=[];[N];[G];[Y];[vt];[Z]=!1;[ot]=!1;[ue]=!1;[de]=!1;[Vt]=null;[A]=0;[x]=!1;[Yt];[ge]=!1;[ut]=0;[j]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Ho(e)?(this[N]=!0,this[G]=null):qo(e)?(this[G]=e.encoding,this[N]=!1):(this[N]=!1,this[G]=null),this[Y]=!!e.async,this[vt]=this[G]?new Io(this[G]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[O]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[L]});let{signal:s}=e;s&&(this[Yt]=s,s.aborted?this[ss]():s.addEventListener("abort",()=>this[ss]()))}get bufferLength(){return this[A]}get encoding(){return this[G]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[N]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Y]}set async(t){this[Y]=this[Y]||!!t}[ss](){this[ge]=!0,this.emit("abort",this[Yt]?.reason),this.destroy(this[Yt]?.reason)}get aborted(){return this[ge]}set aborted(t){}write(t,e,s){if(this[ge])return!1;if(this[Z])throw new Error("write after end");if(this[x])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let r=this[Y]?Jt:Wo;if(!this[N]&&!Buffer.isBuffer(t)){if(Go(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(zo(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[R]&&this[A]!==0&&this[pe](!0),this[R]?this.emit("data",t):this[Ze](t),this[A]!==0&&this.emit("readable"),s&&r(s),this[R]):t.length?(typeof t=="string"&&!(e===this[G]&&!this[vt]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[G]&&(t=this[vt].write(t)),this[R]&&this[A]!==0&&this[pe](!0),this[R]?this.emit("data",t):this[Ze](t),this[A]!==0&&this.emit("readable"),s&&r(s),this[R]):(this[A]!==0&&this.emit("readable"),s&&r(s),this[R])}read(t){if(this[x])return null;if(this[j]=!1,this[A]===0||t===0||t&&t>this[A])return this[Q](),null;this[N]&&(t=null),this[O].length>1&&!this[N]&&(this[O]=[this[G]?this[O].join(""):Buffer.concat(this[O],this[A])]);let e=this[Di](t||null,this[O][0]);return this[Q](),e}[Di](t,e){if(this[N])this[me]();else{let s=e;t===s.length||t===null?this[me]():typeof s=="string"?(this[O][0]=s.slice(t),e=s.slice(0,t),this[A]-=t):(this[O][0]=s.subarray(t),e=s.subarray(0,t),this[A]-=t)}return this.emit("data",e),!this[O].length&&!this[Z]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[Z]=!0,this.writable=!1,(this[R]||!this[Kt])&&this[Q](),this}[Tt](){this[x]||(!this[ut]&&!this[L].length&&(this[j]=!0),this[Kt]=!1,this[R]=!0,this.emit("resume"),this[O].length?this[pe]():this[Z]?this[Q]():this.emit("drain"))}resume(){return this[Tt]()}pause(){this[R]=!1,this[Kt]=!0,this[j]=!1}get destroyed(){return this[x]}get flowing(){return this[R]}get paused(){return this[Kt]}[Ze](t){this[N]?this[A]+=1:this[A]+=t.length,this[O].push(t)}[me](){return this[N]?this[A]-=1:this[A]-=this[O][0].length,this[O].shift()}[pe](t=!1){do;while(this[Pi](this[me]())&&this[O].length);!t&&!this[O].length&&!this[Z]&&this.emit("drain")}[Pi](t){return this.emit("data",t),this[R]}pipe(t,e){if(this[x])return t;this[j]=!1;let s=this[ot];return e=e||{},t===Ni.stdout||t===Ni.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[L].push(e.proxyErrors?new is(this,t,e):new we(this,t,e)),this[Y]?Jt(()=>this[Tt]()):this[Tt]()),t}unpipe(t){let e=this[L].find(s=>s.dest===t);e&&(this[L].length===1?(this[R]&&this[ut]===0&&(this[R]=!1),this[L]=[]):this[L].splice(this[L].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[j]=!1,this[ut]++,!this[L].length&&!this[R]&&this[Tt]();else if(t==="readable"&&this[A]!==0)super.emit("readable");else if(Bo(t)&&this[ot])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Vt]){let r=e;this[Y]?Jt(()=>r.call(this,this[Vt])):r.call(this,this[Vt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[ut]=this.listeners("data").length,this[ut]===0&&!this[j]&&!this[L].length&&(this[R]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[ut]=0,!this[j]&&!this[L].length&&(this[R]=!1)),e}get emittedEnd(){return this[ot]}[Q](){!this[ue]&&!this[ot]&&!this[x]&&this[O].length===0&&this[Z]&&(this[ue]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[de]&&this.emit("close"),this[ue]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x&&this[x])return!1;if(t==="data")return!this[N]&&!s?!1:this[Y]?(Jt(()=>this[ts](s)),!0):this[ts](s);if(t==="end")return this[Li]();if(t==="close"){if(this[de]=!0,!this[ot]&&!this[x])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[Vt]=s,super.emit(Qe,s);let n=!this[Yt]||this.listeners("error").length?super.emit("error",s):!1;return this[Q](),n}else if(t==="resume"){let n=super.emit("resume");return this[Q](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...e);return this[Q](),r}[ts](t){for(let s of this[L])s.dest.write(t)===!1&&this.pause();let e=this[j]?!1:super.emit("data",t);return this[Q](),e}[Li](){return this[ot]?!1:(this[ot]=!0,this.readable=!1,this[Y]?(Jt(()=>this[es]()),!0):this[es]())}[es](){if(this[vt]){let e=this[vt].end();if(e){for(let s of this[L])s.dest.write(e);this[j]||super.emit("data",e)}}for(let e of this[L])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[N]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[N]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[G]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[j]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Z])return e();let n,o,a=f=>{this.off("data",c),this.off("end",h),this.off(x,l),e(),o(f)},c=f=>{this.off("error",a),this.off("end",h),this.off(x,l),this.pause(),n({value:f,done:!!this[Z]})},h=()=>{this.off("error",a),this.off("data",c),this.off(x,l),e(),n({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((f,u)=>{o=u,n=f,this.once(x,l),this.once("error",a),this.once("end",h),this.once("data",c)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[j]=!1;let t=!1,e=()=>(this.pause(),this.off(Qe,e),this.off(x,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let r=this.read();return r===null?e():{done:!1,value:r}};return this.once("end",e),this.once(Qe,e),this.once(x,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[x])return t?this.emit("error",t):this.emit(x),this;this[x]=!0,this[j]=!0,this[O].length=0,this[A]=0;let e=this;return typeof e.close=="function"&&!this[de]&&e.close(),t?this.emit("error",t):this.emit(x),this}static get isStream(){return jo}};var ea=Qo.native,Zt={lstatSync:Yo,readdir:Jo,readdirSync:Xo,readlinkSync:Zo,realpathSync:ea,promises:{lstat:sa,readdir:ia,readlink:ra,realpath:na}},$i=i=>!i||i===Zt||i===ta?Zt:{...Zt,...i,promises:{...Zt.promises,...i.promises||{}}},Wi=/^\\\\\?\\([a-z]:)\\?$/i,oa=i=>i.replace(/\//g,"\\").replace(Wi,"$1\\"),aa=/[\\\/]/,W=0,Bi=1,zi=2,J=4,Gi=6,Hi=8,dt=10,qi=12,$=15,Xt=~$,ns=16,Fi=32,Qt=64,H=128,ye=256,be=512,Ii=Qt|H|be,ca=1023,os=i=>i.isFile()?Hi:i.isDirectory()?J:i.isSymbolicLink()?dt:i.isCharacterDevice()?zi:i.isBlockDevice()?Gi:i.isSocket()?qi:i.isFIFO()?Bi:W,ji=new Map,te=i=>{let t=ji.get(i);if(t)return t;let e=i.normalize("NFKD");return ji.set(i,e),e},Ui=new Map,Se=i=>{let t=Ui.get(i);if(t)return t;let e=te(i.toLowerCase());return Ui.set(i,e),e},Ee=class extends qt{constructor(){super({max:256})}},cs=class extends qt{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},Vi=Symbol("PathScurry setAsCwd"),D=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#n;get mode(){return this.#n}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#h;get rdev(){return this.#h}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#c;get size(){return this.#c}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#w;get mtimeMs(){return this.#w}#d;get ctimeMs(){return this.#d}#u;get birthtimeMs(){return this.#u}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#T;get ctime(){return this.#T}#R;get birthtime(){return this.#R}#S;#E;#x;#p;#_;#O;#s;#D;#y;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=W,s,r,n,o,a){this.name=t,this.#S=n?Se(t):te(t),this.#s=e&ca,this.nocase=n,this.roots=r,this.root=s||this,this.#D=o,this.#x=a.fullpath,this.#_=a.relative,this.#O=a.relativePosix,this.parent=a.parent,this.parent?this.#t=this.parent.#t:this.#t=$i(a.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#D}resolve(t){if(!t)return this;let e=this.getRootString(t),r=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#P(r):this.#P(r)}#P(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#D.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#D.set(this,e),this.#s&=~ns,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),r=this.nocase?Se(t):te(t);for(let c of s)if(c.#S===r)return c;let n=this.parent?this.sep:"",o=this.#x?this.#x+n+t:void 0,a=this.newChild(t,W,{...e,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=H),s.push(a),a}relative(){if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let t=this.name,e=this.parent;if(!e)return this.#_=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let t=this.name,e=this.parent;if(!e)return this.#O=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#x!==void 0)return this.#x;let t=this.name,e=this.parent;if(!e)return this.#x=this.name;let r=e.fullpath()+(e.parent?this.sep:"")+t;return this.#x=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#p=s}isUnknown(){return(this.#s&$)===W}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&$)===Hi}isDirectory(){return(this.#s&$)===J}isCharacterDevice(){return(this.#s&$)===zi}isBlockDevice(){return(this.#s&$)===Gi}isFIFO(){return(this.#s&$)===Bi}isSocket(){return(this.#s&$)===qi}isSymbolicLink(){return(this.#s&dt)===dt}lstatCached(){return this.#s&Fi?this:void 0}readlinkCached(){return this.#y}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#y)return!0;if(!this.parent)return!1;let t=this.#s&$;return!(t!==W&&t!==dt||this.#s&ye||this.#s&H)}calledReaddir(){return!!(this.#s&ns)}isENOENT(){return!!(this.#s&H)}isNamed(t){return this.nocase?this.#S===Se(t):this.#S===te(t)}async readlink(){let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#y=s}catch(e){this.#l(e.code);return}}readlinkSync(){let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#y=s}catch(e){this.#l(e.code);return}}#L(t){this.#s|=ns;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#M()}}#M(){this.#s&H||(this.#s=(this.#s|H)&Xt,this.#A())}#A(){let t=this.children();t.provisional=0;for(let e of t)e.#M()}#C(){this.#s|=be,this.#F()}#F(){if(this.#s&Qt)return;let t=this.#s;(t&$)===J&&(t&=Xt),this.#s=t|Qt,this.#A()}#I(t=""){t==="ENOTDIR"||t==="EPERM"?this.#F():t==="ENOENT"?this.#M():this.children().provisional=0}#j(t=""){t==="ENOTDIR"?this.parent.#F():t==="ENOENT"&&this.#M()}#l(t=""){let e=this.#s;e|=ye,t==="ENOENT"&&(e|=H),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Xt),this.#s=e,t==="ENOTDIR"&&this.parent&&this.parent.#F()}#U(t,e){return this.#N(t,e)||this.#$(t,e)}#$(t,e){let s=os(t),r=this.newChild(t.name,s,{parent:this}),n=r.#s&$;return n!==J&&n!==dt&&n!==W&&(r.#s|=Qt),e.unshift(r),e.provisional++,r}#N(t,e){for(let s=e.provisional;s<e.length;s++){let r=e[s];if((this.nocase?Se(t.name):te(t.name))===r.#S)return this.#W(t,r,s,e)}}#W(t,e,s,r){let n=e.name;return e.#s=e.#s&Xt|os(t),n!==t.name&&(e.name=t.name),s!==r.provisional&&(s===r.length-1?r.pop():r.splice(s,1),r.unshift(e)),r.provisional++,e}async lstat(){if(!(this.#s&H))try{return this.#H(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#j(t.code)}}lstatSync(){if(!(this.#s&H))try{return this.#H(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#j(t.code)}}#H(t){let{atime:e,atimeMs:s,birthtime:r,birthtimeMs:n,blksize:o,blocks:a,ctime:c,ctimeMs:h,dev:l,gid:f,ino:u,mode:d,mtime:g,mtimeMs:p,nlink:y,rdev:m,size:b,uid:w}=t;this.#v=e,this.#g=s,this.#R=r,this.#u=n,this.#f=o,this.#r=a,this.#T=c,this.#d=h,this.#e=l,this.#b=f,this.#a=u,this.#n=d,this.#m=g,this.#w=p,this.#i=y,this.#h=m,this.#c=b,this.#o=w;let S=os(t);this.#s=this.#s&Xt|S|Fi,S!==W&&S!==J&&S!==dt&&(this.#s|=Qt)}#z=[];#G=!1;#q(t){this.#G=!1;let e=this.#z.slice();this.#z.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#z.push(t),this.#G)return;this.#G=!0;let r=this.fullpath();this.#t.readdir(r,{withFileTypes:!0},(n,o)=>{if(n)this.#I(n.code),s.provisional=0;else{for(let a of o)this.#U(a,s);this.#L(s)}this.#q(s.slice(0,s.provisional))})}#B;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#B)await this.#B;else{let s=()=>{};this.#B=new Promise(r=>s=r);try{for(let r of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#U(r,t);this.#L(t)}catch(r){this.#I(r.code),t.provisional=0}this.#B=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#U(s,t);this.#L(t)}catch(s){this.#I(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#s&Ii)return!1;let t=$&this.#s;return t===W||t===J||t===dt}shouldWalk(t,e){return(this.#s&J)===J&&!(this.#s&Ii)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((be|ye|H)&this.#s))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#C()}}realpathSync(){if(this.#k)return this.#k;if(!((be|ye|H)&this.#s))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#C()}}[Vi](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],r=this;for(;r&&r.parent;)e.add(r),r.#_=s.join(this.sep),r.#O=s.join("/"),r=r.parent,s.push("..");for(r=t;r&&r.parent&&!e.has(r);)r.#_=void 0,r.#O=void 0,r=r.parent}},xe=class i extends D{sep="\\";splitSep=aa;constructor(t,e=W,s,r,n,o,a){super(t,e,s,r,n,o,a)}newChild(t,e=W,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return as.parse(t).root}getRoot(t){if(t=oa(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new Rt(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(Wi,"$1\\"),t===e}},ve=class i extends D{splitSep="/";sep="/";constructor(t,e=W,s,r,n,o,a){super(t,e,s,r,n,o,a)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=W,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Te=class{root;rootPath;roots;cwd;#t;#e;#n;nocase;#i;constructor(t=process.cwd(),e,s,{nocase:r,childrenCacheSize:n=16*1024,fs:o=Zt}={}){this.#i=$i(o),(t instanceof URL||t.startsWith("file://"))&&(t=Ko(t));let a=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#t=new Ee,this.#e=new Ee,this.#n=new cs(n);let c=a.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let h=this.root,l=c.length-1,f=e.sep,u=this.rootPath,d=!1;for(let g of c){let p=l--;h=h.child(g,{relative:new Array(p).fill("..").join(f),relativePosix:new Array(p).fill("..").join("/"),fullpath:u+=(d?"":f)+g}),d=!0}this.cwd=h}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpath();return this.#t.set(e,r),r}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#e.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpathPosix();return this.#e.set(e,r),r}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let r=await t.readdir();return s?r:r.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(r=>r.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=[];(!n||n(t))&&a.push(s?t:t.fullpath());let c=new Set,h=(f,u)=>{c.add(f),f.readdirCB((d,g)=>{if(d)return u(d);let p=g.length;if(!p)return u();let y=()=>{--p===0&&u()};for(let m of g)(!n||n(m))&&a.push(s?m:m.fullpath()),r&&m.isSymbolicLink()?m.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(c,o)?h(b,y):y()):m.shouldWalk(c,o)?h(m,y):y()},!0)},l=t;return new Promise((f,u)=>{h(l,d=>{if(d)return u(d);f(a)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=[];(!n||n(t))&&a.push(s?t:t.fullpath());let c=new Set([t]);for(let h of c){let l=h.readdirSync();for(let f of l){(!n||n(f))&&a.push(s?f:f.fullpath());let u=f;if(f.isSymbolicLink()){if(!(r&&(u=f.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(c,o)&&c.add(u)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let a=new Set([t]);for(let c of a){let h=c.readdirSync();for(let l of h){(!n||n(l))&&(yield s?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(r&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=new at({objectMode:!0});(!n||n(t))&&a.write(s?t:t.fullpath());let c=new Set,h=[t],l=0,f=()=>{let u=!1;for(;!u;){let d=h.shift();if(!d){l===0&&a.end();return}l++,c.add(d);let g=(y,m,b=!1)=>{if(y)return a.emit("error",y);if(r&&!b){let w=[];for(let S of m)S.isSymbolicLink()&&w.push(S.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(w.length){Promise.all(w).then(()=>g(null,m,!0));return}}for(let w of m)w&&(!n||n(w))&&(a.write(s?w:w.fullpath())||(u=!0));l--;for(let w of m){let S=w.realpathCached()||w;S.shouldWalk(c,o)&&h.push(S)}u&&!a.flowing?a.once("drain",f):p||f()},p=!0;d.readdirCB(g,!0),p=!1}};return f(),a}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof D||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,a=new at({objectMode:!0}),c=new Set;(!n||n(t))&&a.write(s?t:t.fullpath());let h=[t],l=0,f=()=>{let u=!1;for(;!u;){let d=h.shift();if(!d){l===0&&a.end();return}l++,c.add(d);let g=d.readdirSync();for(let p of g)(!n||n(p))&&(a.write(s?p:p.fullpath())||(u=!0));l--;for(let p of g){let y=p;if(p.isSymbolicLink()){if(!(r&&(y=p.realpathSync())))continue;y.isUnknown()&&y.lstatSync()}y.shouldWalk(c,o)&&h.push(y)}}u&&!a.flowing&&a.once("drain",f)};return f(),a}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[Vi](e)}},Rt=class extends Te{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,as,"\\",{...e,nocase:s}),this.nocase=s;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(t){return as.parse(t).root.toUpperCase()}newRoot(t){return new xe(this.rootPath,J,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},Ot=class extends Te{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,Vo,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new ve(this.rootPath,J,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},ee=class extends Ot{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},gl=process.platform==="win32"?xe:ve,Ki=process.platform==="win32"?Rt:process.platform==="darwin"?ee:Ot;var ha=i=>i.length>=1,la=i=>i.length>=1,At=class i{#t;#e;#n;length;#i;#o;#b;#h;#f;#a;#c=!0;constructor(t,e,s,r){if(!ha(t))throw new TypeError("empty pattern list");if(!la(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#e=e,this.#n=s,this.#i=r,this.#n===0){if(this.isUNC()){let[n,o,a,c,...h]=this.#t,[l,f,u,d,...g]=this.#e;h[0]===""&&(h.shift(),g.shift());let p=[n,o,a,c,""].join("/"),y=[l,f,u,d,""].join("/");this.#t=[p,...h],this.#e=[y,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[a,...c]=this.#e;o[0]===""&&(o.shift(),c.shift());let h=n+"/",l=a+"/";this.#t=[h,...o],this.#e=[l,...c],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===_}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#b=this.#b||(this.#n===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#t,this.#e,this.#n+1,this.#i),this.#o.#a=this.#a,this.#o.#f=this.#f,this.#o.#h=this.#h,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=this.#i==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#a!==void 0?this.#a:this.#a=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var fa=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ct=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:r,noglobstar:n,platform:o=fa}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:r,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of t)this.add(a)}add(t){let e=new I(t,this.mmopts);for(let s=0;s<e.set.length;s++){let r=e.set[s],n=e.globParts[s];if(!r||!n)throw new Error("invalid pattern object");for(;r[0]==="."&&n[0]===".";)r.shift(),n.shift();let o=new At(r,n,0,this.platform),a=new I(o.globString(),this.mmopts),c=n[n.length-1]==="**",h=o.isAbsolute();h?this.absolute.push(a):this.relative.push(a),c&&(h?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(t){let e=t.fullpath(),s=`${e}/`,r=t.relative()||".",n=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(s))return!0;for(let r of this.absoluteChildren)if(r.match(e))return!0;return!1}};var hs=class i{store;constructor(t=new Map){this.store=t}copy(){return new i(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),r=this.store.get(s);r?r.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},ls=class{store=new Map;add(t,e,s){let r=(e?2:0)|(s?1:0),n=this.store.get(t);this.store.set(t,n===void 0?r:r&n)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},fs=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(r=>r.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},se=class i{hasWalkedCache;matches=new ls;subwalks=new fs;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new hs}processPatterns(t,e){this.patterns=e;let s=e.map(r=>[t,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let c,h,l=!1;for(;typeof(c=n.pattern())=="string"&&(h=n.rest());)r=r.resolve(c),n=h,l=!0;if(c=n.pattern(),h=n.rest(),l){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n)}if(typeof c=="string"){let f=c===".."||c===""||c===".";this.matches.add(r.resolve(c),a,f);continue}else if(c===_){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let f=h?.pattern(),u=h?.rest();if(!h||(f===""||f===".")&&!u)this.matches.add(r,a,f===""||f===".");else if(f===".."){let d=r.parent||r;u?this.hasWalkedCache.hasWalked(d,u)||this.subwalks.add(d,u):this.matches.add(d,a,!0)}}else c instanceof RegExp&&this.subwalks.add(r,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),r=this.child();for(let n of e)for(let o of s){let a=o.isAbsolute(),c=o.pattern(),h=o.rest();c===_?r.testGlobstar(n,o,h,a):c instanceof RegExp?r.testRegExp(n,c,h,a):r.testString(n,c,h,a)}return r}testGlobstar(t,e,s,r){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,r,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),r);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),r)}}testRegExp(t,e,s,r){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}testString(t,e,s,r){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}};var ua=(i,t)=>typeof i=="string"?new Ct([i],t):Array.isArray(i)?new Ct(i,t):i,Re=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#n;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#e=ua(s.ignore??[],s),!this.includeChildMatches&&typeof this.#e.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#i(t){return this.seen.has(t)||!!this.#e?.ignored?.(t)}#o(t){return!!this.#e?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#i(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#i(t))return;if(!this.includeChildMatches&&this.#e?.add){let n=`${t.relativePosix()}/**`;this.#e.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let r=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+r)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(n?o+n+r:"."+r)}}async match(t,e,s){let r=await this.matchCheck(t,s);r&&this.matchFinish(r,e)}matchSync(t,e,s){let r=this.matchCheckSync(t,s);r&&this.matchFinish(r,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new se(this.opts),s)}walkCB2(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,h).then(()=>o()));for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,s,o):a.readdirCB((h,l)=>this.walkCB3(a,l,s,o),!0)}o()}walkCB3(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,h).then(()=>o()));for(let[a,c]of s.subwalks.entries())n++,this.walkCB2(a,c,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new se(this.opts),s)}walkCB2Sync(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||this.matchSync(a,c,h);for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirSync();this.walkCB3Sync(a,c,s,o)}o()}walkCB3Sync(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[a,c,h]of s.matches.entries())this.#i(a)||this.matchSync(a,c,h);for(let[a,c]of s.subwalks.entries())n++,this.walkCB2Sync(a,c,s.child(),o);o()}},ie=class extends Re{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},re=class extends Re{results;constructor(t,e,s){super(t,e,s),this.results=new at({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var pa=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",q=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=da(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=t,this.platform=e.platform||pa,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=e.platform==="win32"?Rt:e.platform==="darwin"?ee:e.platform?Ot:Ki;this.scurry=new c(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",r={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(c=>new I(c,r)),[o,a]=n.reduce((c,h)=>(c[0].push(...h.set),c[1].push(...h.globParts),c),[[],[]]);this.patterns=o.map((c,h)=>{let l=a[h];if(!l)throw new Error("invalid pattern object");return new At(c,l,0,this.platform)})}async walk(){return[...await new ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new re(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new re(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var us=(i,t={})=>{Array.isArray(i)||(i=[i]);for(let e of i)if(new I(e,t).hasMagic())return!0;return!1};function Ae(i,t={}){return new q(i,t).streamSync()}function Ji(i,t={}){return new q(i,t).stream()}function Ce(i,t={}){return new q(i,t).walkSync()}async function Yi(i,t={}){return new q(i,t).walk()}function _e(i,t={}){return new q(i,t).iterateSync()}function Xi(i,t={}){return new q(i,t).iterate()}var ma=Ae,ga=Object.assign(Ji,{sync:Ae}),wa=_e,ya=Object.assign(Xi,{sync:_e}),Sa=Object.assign(Ce,{stream:Ae,iterate:_e}),Oe=Object.assign(Yi,{glob:Yi,globSync:Ce,sync:Sa,globStream:Ji,stream:ga,globStreamSync:Ae,streamSync:ma,globIterate:Xi,iterate:ya,globIterateSync:_e,iterateSync:wa,Glob:q,hasMagic:us,escape:bt,unescape:z});Oe.glob=Oe;var ct=(i,t)=>typeof i>"u"||typeof i===t,Zi=i=>!!i&&typeof i=="object"&&ct(i.preserveRoot,"boolean")&&ct(i.tmp,"string")&&ct(i.maxRetries,"number")&&ct(i.retryDelay,"number")&&ct(i.backoff,"number")&&ct(i.maxBackoff,"number")&&(ct(i.glob,"boolean")||i.glob&&typeof i.glob=="object")&&ct(i.filter,"function"),Qi=i=>{if(!Zi(i))throw new Error("invalid rimraf options")},tr=i=>{Qi(i);let{glob:t,...e}=i;if(!t)return e;let s=t===!0?i.signal?{signal:i.signal}:{}:i.signal?{signal:i.signal,...t}:t;return{...e,glob:{...s,absolute:!0,withFileTypes:!1}}},er=(i={})=>tr(i),sr=(i={})=>tr(i);import{parse as ir,resolve as ba}from"path";import{inspect as Ea}from"util";var V=process.env.__TESTING_RIMRAF_PLATFORM__||process.platform;var xa=(i,t={})=>{let e=typeof i;if(e!=="string"){let r=i&&e==="object"&&i.constructor,o=`The "path" argument must be of type string. Received ${r&&r.name?`an instance of ${r.name}`:e==="object"?Ea(i):`type ${e} ${i}`}`;throw Object.assign(new TypeError(o),{path:i,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(i)){let r="path must be a string without null bytes";throw Object.assign(new TypeError(r),{path:i,code:"ERR_INVALID_ARG_VALUE"})}i=ba(i);let{root:s}=ir(i);if(i===s&&t.preserveRoot!==!1){let r="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(r),{path:i,code:"ERR_PRESERVE_ROOT"})}if(V==="win32"){let r=/[*|"<>?:]/,{root:n}=ir(i);if(r.test(i.substring(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:i,code:"EINVAL"})}return i},ne=xa;import tt from"fs";import{chmodSync as ke,mkdirSync as ef,renameSync as nr,rmdirSync as _t,rmSync as or,statSync as ar,lstatSync as kt,unlinkSync as Nt}from"fs";import{readdirSync as va}from"fs";var rr=i=>va(i,{withFileTypes:!0}),Ta=(i,t)=>new Promise((e,s)=>tt.chmod(i,t,(r,...n)=>r?s(r):e(...n))),Ra=(i,t)=>new Promise((e,s)=>tt.mkdir(i,t,(r,n)=>r?s(r):e(n))),Oa=i=>new Promise((t,e)=>tt.readdir(i,{withFileTypes:!0},(s,r)=>s?e(s):t(r))),Aa=(i,t)=>new Promise((e,s)=>tt.rename(i,t,(r,...n)=>r?s(r):e(...n))),Ca=(i,t)=>new Promise((e,s)=>tt.rm(i,t,(r,...n)=>r?s(r):e(...n))),_a=i=>new Promise((t,e)=>tt.rmdir(i,(s,...r)=>s?e(s):t(...r))),ka=i=>new Promise((t,e)=>tt.stat(i,(s,r)=>s?e(s):t(r))),Na=i=>new Promise((t,e)=>tt.lstat(i,(s,r)=>s?e(s):t(r))),Da=i=>new Promise((t,e)=>tt.unlink(i,(s,...r)=>s?e(s):t(...r))),M={chmod:Ta,mkdir:Ra,readdir:Oa,rename:Aa,rm:Ca,rmdir:_a,stat:ka,lstat:Na,unlink:Da};import{parse as cr,resolve as hr}from"path";var{readdir:Pa}=M,Dt=i=>Pa(i).catch(t=>t),Pt=i=>{try{return rr(i)}catch(t){return t}};var et=async i=>i.catch(t=>{if(t.code!=="ENOENT")throw t}),st=i=>{try{return i()}catch(t){if(t?.code!=="ENOENT")throw t}};var{lstat:La,rmdir:Ma,unlink:Fa}=M,Ne=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await lr(i,t,await La(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},De=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return fr(i,t,kt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},lr=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?await Dt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await et(Fa(i)),!0)}return!(await Promise.all(s.map(n=>lr(hr(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===cr(i).root||t.filter&&!await t.filter(i,e)?!1:(await et(Ma(i)),!0)},fr=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?Pt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!t.filter(i,e)?!1:(st(()=>Nt(i)),!0)}let r=!0;for(let n of s){let o=hr(i,n.name);r=fr(o,t,n)&&r}return t.preserveRoot===!1&&i===cr(i).root||!r||t.filter&&!t.filter(i,e)?!1:(st(()=>_t(i)),!0)};import{parse as br,resolve as Er}from"path";var{chmod:Ia}=M,ds=i=>async t=>{try{return await i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{await Ia(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return await i(t)}throw e}},ps=i=>t=>{try{return i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{ke(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return i(t)}throw e}};var ur=new Set(["EMFILE","ENFILE","EBUSY"]),ms=i=>{let t=async(e,s,r=1,n=0)=>{let o=s.maxBackoff||200,a=s.backoff||1.2,c=s.maxRetries||10,h=0;for(;;)try{return await i(e)}catch(l){let f=l;if(f?.path===e&&f?.code&&ur.has(f.code)){if(r=Math.ceil(r*a),n=r+n,n<o)return new Promise((u,d)=>{setTimeout(()=>{t(e,s,r,n).then(u,d)},r)});if(h<c){h++;continue}}throw l}};return t},gs=i=>(e,s)=>{let r=s.maxRetries||10,n=0;for(;;)try{return i(e)}catch(o){let a=o;if(a?.path===e&&a?.code&&ur.has(a.code)&&n<r){n++;continue}throw o}};import{basename as Ha,parse as Me,resolve as Fe}from"path";import{tmpdir as Le}from"os";import{parse as Pe,resolve as dr}from"path";var{stat:ja}=M,Ua=i=>{try{return ar(i).isDirectory()}catch{return!1}},$a=i=>ja(i).then(t=>t.isDirectory(),()=>!1),Wa=async i=>{let{root:t}=Pe(i),e=Le(),{root:s}=Pe(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=dr(t,"/temp");return await $a(r)?r:t},Ba=i=>{let{root:t}=Pe(i),e=Le(),{root:s}=Pe(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=dr(t,"/temp");return Ua(r)?r:t},za=async()=>Le(),Ga=()=>Le(),pr=V==="win32"?Wa:za,mr=V==="win32"?Ba:Ga;var{lstat:qa,rename:Va,unlink:gr,rmdir:Ka,chmod:Ya}=M,Sr=i=>`.${Ha(i)}.${Math.random()}`,Ja=async i=>gr(i).catch(t=>{if(t.code==="EPERM")return Ya(i,438).then(()=>gr(i),e=>{if(e.code!=="ENOENT")throw t});if(t.code==="ENOENT")return;throw t}),Xa=i=>{try{Nt(i)}catch(t){if(t?.code==="EPERM")try{return ke(i,438)}catch(e){if(e?.code==="ENOENT")return;throw t}else if(t?.code==="ENOENT")return;throw t}},Ie=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await ws(i,t,await qa(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ws=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return ws(i,{...t,tmp:await pr(i)},e);if(i===t.tmp&&Me(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let s=e.isDirectory()?await Dt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await et(wr(i,t.tmp,Ja)),!0)}return!(await Promise.all(s.map(n=>ws(Fe(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===Me(i).root||t.filter&&!await t.filter(i,e)?!1:(await et(wr(i,t.tmp,Ka)),!0)},wr=async(i,t,e)=>{let s=Fe(t,Sr(i));return await Va(i,s),await e(s)},je=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return ys(i,t,kt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ys=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return ys(i,{...t,tmp:mr(i)},e);let s=t.tmp;if(i===t.tmp&&Me(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let r=e.isDirectory()?Pt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(st(()=>yr(i,s,Xa)),!0)}let n=!0;for(let o of r){let a=Fe(i,o.name);n=ys(a,t,o)&&n}return!n||t.preserveRoot===!1&&i===Me(i).root||t.filter&&!t.filter(i,e)?!1:(st(()=>yr(i,s,_t)),!0)},yr=(i,t,e)=>{let s=Fe(t,Sr(i));return nr(i,s),e(s)};var{unlink:Za,rmdir:Qa,lstat:tc}=M,ec=ms(ds(Za)),sc=gs(ps(Nt)),ic=ms(ds(Qa)),rc=gs(ps(_t)),nc=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return await ic(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return await Ie(i,s);throw r}},oc=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return rc(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return je(i,s);throw r}},ht=Symbol("start"),xr=Symbol("child"),Ue=Symbol("finish"),$e=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await Ss(i,t,await tc(i),ht)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},We=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return bs(i,t,kt(i),ht)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},Ss=async(i,t,e,s=ht)=>{if(t?.signal?.aborted)throw t.signal.reason;let r=e.isDirectory()?await Dt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!await t.filter(i,e)?!1:(await et(ec(i,t)),!0)}let n=s===ht?xr:s,o=(await Promise.all(r.map(a=>Ss(Er(i,a.name),t,a,n)))).reduce((a,c)=>a&&c,!0);if(s===ht)return Ss(i,t,e,Ue);if(s===Ue){if(t.preserveRoot===!1&&i===br(i).root||!o||t.filter&&!await t.filter(i,e))return!1;await et(nc(i,t))}return!0},bs=(i,t,e,s=ht)=>{let r=e.isDirectory()?Pt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(st(()=>sc(i,t)),!0)}let n=!0;for(let o of r){let a=s===ht?xr:s,c=Er(i,o.name);n=bs(c,t,o,a)&&n}if(s===ht)return bs(i,t,e,Ue);if(s===Ue){if(t.preserveRoot===!1&&i===br(i).root||!n||t.filter&&!t.filter(i,e))return!1;st(()=>{oc(i,t)})}return!0};var Es=V==="win32"?$e:Ne,xs=V==="win32"?We:De;var{rm:ac}=M,vs=async(i,t)=>(await ac(i,{...t,force:!0,recursive:!0}),!0),Ts=(i,t)=>(or(i,{...t,force:!0,recursive:!0}),!0);var cc=process.env.__TESTING_RIMRAF_NODE_VERSION__||process.version,hc=cc.replace(/^v/,"").split("."),[vr=0,lc=0]=hc.map(i=>parseInt(i,10)),Tr=vr>14||vr===14&&lc>=14,Rr=!Tr||V==="win32"?()=>!1:i=>!i?.signal&&!i?.filter,Or=!Tr||V==="win32"?()=>!1:i=>!i?.signal&&!i?.filter;var Lt=i=>async(t,e)=>{let s=er(e);return s.glob&&(t=await Oe(t,s.glob)),Array.isArray(t)?!!(await Promise.all(t.map(r=>i(ne(r,s),s)))).reduce((r,n)=>r&&n,!0):!!await i(ne(t,s),s)},Mt=i=>(t,e)=>{let s=sr(e);return s.glob&&(t=Ce(t,s.glob)),Array.isArray(t)?!!t.map(r=>i(ne(r,s),s)).reduce((r,n)=>r&&n,!0):!!i(ne(t,s),s)},_r=Mt(Ts),fc=Object.assign(Lt(vs),{sync:_r}),kr=Mt(xs),uc=Object.assign(Lt(Es),{sync:kr}),Nr=Mt(We),dc=Object.assign(Lt($e),{sync:Nr}),Dr=Mt(De),pc=Object.assign(Lt(Ne),{sync:Dr}),Pr=Mt(je),mc=Object.assign(Lt(Ie),{sync:Pr}),Rs=Mt((i,t)=>Or(t)?Ts(i,t):xs(i,t)),Lr=Rs,Ar=Lt((i,t)=>Rr(t)?vs(i,t):Es(i,t)),Cr=Object.assign(Ar,{rimraf:Ar,sync:Rs,rimrafSync:Rs,manual:uc,manualSync:kr,native:fc,nativeSync:_r,posix:pc,posixSync:Dr,windows:dc,windowsSync:Nr,moveRemove:mc,moveRemoveSync:Pr});Cr.rimraf=Cr;var Fr=wc(new URL(".",import.meta.url)),As=Mr(Fr,"../builder/vite-config.js"),yc=Mr(Fr,"../builder/vite-entry-server.js");async function Ir({options:i,logger:t}){t.info(`Building template...
|
|
41
|
+
`),i.clean&&Lr(gc.join(process.cwd(),"dist"));let e="production";i.ssr==="local"&&(e="development",process.env.NODE_ENV=e),i.ssr?(await Os({configFile:As,customLogger:t,mode:e,logLevel:i.logLevel,clearScreen:i.clearScreen,build:{ssrManifest:!0,emptyOutDir:!0}}),await Os({configFile:As,customLogger:t,mode:e,logLevel:i.logLevel,clearScreen:i.clearScreen,ssr:{target:"webworker"},build:{ssr:yc}})):await Os({configFile:As,customLogger:t,logLevel:i.logLevel,clearScreen:i.clearScreen,build:{emptyOutDir:!0}})}jt();gt();async function jr({options:i,logger:t}){t.info("Logging out fom Enpage..."),F.clear(),t.info(`Done.
|
|
42
|
+
`),process.exit(0)}var Cs;Ft.name("enpage").option("-l, --logLevel <level>","[string] info | warn | error | silent | debug").option("--clearScreen","[boolean] allow/disable clear screen when logging").option("--dry-run","[boolean] run command without making changes").hook("preAction",i=>{Cs=qe(i.optsWithGlobals().logLevel,i.optsWithGlobals().clearScreen,!0),process.removeAllListeners("warning"),process.on("warning",t=>{t.name==="DeprecationWarning"&&t.message.includes("util.isArray")||Cs.warnOnce(`Warning: ${t.name} - ${t.message}`)})});Ft.command("build").description("Build template").option("--ssr [type]",`Enable server side rendering.
|
|
43
43
|
Pass --ssr to generate a SSR-enabled build.
|
|
44
|
-
Pass --ssr=local to generate a SSR-enabled build that can be tested locally.`,Boolean,!1).option("--no-clean","Don't clean directory before buidling").action(function(){Ir(Be(this))});
|
|
44
|
+
Pass --ssr=local to generate a SSR-enabled build that can be tested locally.`,Boolean,!1).option("--no-clean","Don't clean directory before buidling").action(function(){Ir(Be(this))});Ft.command("publish").description("Publish a template to Enpage").argument("[directory]","Directory to publish").option("--no-check","Don't check for required files").action(function(){ti(Be(this))});Ft.command("login").description("Login to Enpage").action(function(){ei(Be(this))});Ft.command("logout").description("Logout from Enpage").action(function(){jr(Be(this))});Ft.parse();function Be(i){return{options:i.optsWithGlobals(),args:i.args,logger:Cs}}
|
|
45
45
|
/*!
|
|
46
46
|
* parse-gitignore <https://github.com/jonschlinkert/parse-gitignore>
|
|
47
47
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
48
48
|
* Released under the MIT License.
|
|
49
49
|
*
|
|
50
|
-
* Converted to typescript by Matthias E. <matthias@
|
|
50
|
+
* Converted to typescript by Matthias E. <matthias@upstart.gg>
|
|
51
51
|
*/
|