@visulima/storage 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/adapter/nuxt/module.d.ts +8 -8
  3. package/dist/ai/ai-sdk/index.d.ts +51 -59
  4. package/dist/ai/claude/index.d.ts +104 -119
  5. package/dist/ai/openai/index.d.ts +86 -99
  6. package/dist/ai/tanstack/index.d.ts +53 -61
  7. package/dist/handler/http/fetch/index.d.ts +201 -201
  8. package/dist/handler/http/hono/index.d.ts +59 -59
  9. package/dist/handler/http/nextjs/index.d.ts +54 -54
  10. package/dist/handler/http/node/index.d.ts +233 -246
  11. package/dist/handler/http/solid-start/index.d.ts +54 -54
  12. package/dist/index.d.ts +70 -70
  13. package/dist/index.js +1 -1
  14. package/dist/packem_shared/{AwsLightStorage-BK-WPL0h.js → AwsLightStorage-EsqkAtU5.js} +1 -1
  15. package/dist/packem_shared/{AzureStorage-1UvDIQZd.js → AzureStorage-DL-U7qFG.js} +1 -1
  16. package/dist/packem_shared/BoxMetaStorage-CHWrhgg2.js +1 -0
  17. package/dist/packem_shared/{BoxStorage-DbGqBLux.js → BoxStorage-B8_oCz27.js} +1 -1
  18. package/dist/packem_shared/BunS3MetaStorage-CHWrhgg2.js +1 -0
  19. package/dist/packem_shared/{BunS3Storage-DNvimm9e.js → BunS3Storage-_PVXu_na.js} +1 -1
  20. package/dist/packem_shared/BunnyMetaStorage-CHWrhgg2.js +1 -0
  21. package/dist/packem_shared/{BunnyStorage-C7d0opLL.js → BunnyStorage-BsoWjScH.js} +1 -1
  22. package/dist/packem_shared/CloudinaryMetaStorage-BI9YXcwU.js +1 -0
  23. package/dist/packem_shared/{CloudinaryStorage-Dc3XA2lP.js → CloudinaryStorage-BNwiLF9V.js} +1 -1
  24. package/dist/packem_shared/{DiskStorage-CI07TVNu.js → DiskStorage-D-NtQDms.js} +1 -1
  25. package/dist/packem_shared/{DiskStorageWithChecksum-vFCubS6K.js → DiskStorageWithChecksum-UnCtyEvs.js} +1 -1
  26. package/dist/packem_shared/DropboxMetaStorage-CHWrhgg2.js +1 -0
  27. package/dist/packem_shared/{DropboxStorage-CY9Ggu3m.js → DropboxStorage-BS9kj0nH.js} +1 -1
  28. package/dist/packem_shared/FirebaseMetaStorage-BI9YXcwU.js +1 -0
  29. package/dist/packem_shared/{FirebaseStorage-D6O9CJXN.js → FirebaseStorage-DNquii2p.js} +1 -1
  30. package/dist/packem_shared/FtpMetaStorage-CHWrhgg2.js +1 -0
  31. package/dist/packem_shared/{FtpStorage-DbEjbq8z.js → FtpStorage-Bd004--s.js} +1 -1
  32. package/dist/packem_shared/{GCSMetaStorage-C8dxa9A7.js → GCSMetaStorage-Bf4qDFB1.js} +1 -1
  33. package/dist/packem_shared/{GCStorage-DE-XFSBe.js → GCStorage-ChqEpgqR.js} +1 -1
  34. package/dist/packem_shared/GoogleDriveMetaStorage-xlHfKwmR.js +1 -0
  35. package/dist/packem_shared/{GoogleDriveStorage-Bklsz7Bh.js → GoogleDriveStorage-v1glykjd.js} +1 -1
  36. package/dist/packem_shared/{LocalMetaStorage-BhicZnNl.js → LocalMetaStorage-YWPBYEe7.js} +1 -1
  37. package/dist/packem_shared/NetlifyBlobMetaStorage-BI9YXcwU.js +1 -0
  38. package/dist/packem_shared/{NetlifyBlobStorage-CkpCCoN1.js → NetlifyBlobStorage-BPyEWSnx.js} +1 -1
  39. package/dist/packem_shared/OneDriveMetaStorage-xlHfKwmR.js +1 -0
  40. package/dist/packem_shared/{OneDriveStorage-CP6MvGAa.js → OneDriveStorage-BJ3Kzxc5.js} +1 -1
  41. package/dist/packem_shared/PocketBaseMetaStorage-DnrxOQhO.js +1 -0
  42. package/dist/packem_shared/{PocketBaseStorage-2qhbI2PW.js → PocketBaseStorage-DqKHbbvn.js} +1 -1
  43. package/dist/packem_shared/{S3Storage-YGeNk3Tt.js → S3Storage-BiI2k6d1.js} +1 -1
  44. package/dist/packem_shared/SftpMetaStorage-CHWrhgg2.js +1 -0
  45. package/dist/packem_shared/{SftpStorage-2Hz396Xr.js → SftpStorage-w8XdtZtw.js} +1 -1
  46. package/dist/packem_shared/SharePointMetaStorage-CHWrhgg2.js +1 -0
  47. package/dist/packem_shared/{SharePointStorage-CrX2Pk6C.js → SharePointStorage-DpDpI7Ln.js} +1 -1
  48. package/dist/packem_shared/SupabaseMetaStorage-xlHfKwmR.js +1 -0
  49. package/dist/packem_shared/{SupabaseStorage-Dc_DBX29.js → SupabaseStorage-B_ugUCs7.js} +1 -1
  50. package/dist/packem_shared/UploadThingMetaStorage-BI9YXcwU.js +1 -0
  51. package/dist/packem_shared/{UploadThingStorage-BChykYSe.js → UploadThingStorage-_H45IVqX.js} +1 -1
  52. package/dist/packem_shared/VercelBlobMetaStorage-CHWrhgg2.js +1 -0
  53. package/dist/packem_shared/{VercelBlobStorage-CsRyPfw3.js → VercelBlobStorage-U1YMKeHs.js} +1 -1
  54. package/dist/packem_shared/{approval.d-CMAYH9GF.d.ts → approval.d-C-d-t94D.d.ts} +6 -6
  55. package/dist/packem_shared/disk-storage-BwPk2IRa.js +1 -0
  56. package/dist/packem_shared/disk-storage-with-checksum.d-CQucFacO.d.ts +146 -0
  57. package/dist/packem_shared/{executors.d-BZP2rWo3.d.ts → executors.d-DeDH3Ilt.d.ts} +2 -2
  58. package/dist/packem_shared/files.d-D8H_ge9Y.d.ts +655 -0
  59. package/dist/packem_shared/{gcs-meta-storage-DpkPEXso.js → gcs-meta-storage-DQGu_cHq.js} +1 -1
  60. package/dist/packem_shared/local-meta-storage-DJDcuxf1.js +11 -0
  61. package/dist/packem_shared/{local-meta-storage.d-D9PBfkn6.d.ts → local-meta-storage.d-DuTEzyii.d.ts} +7 -7
  62. package/dist/packem_shared/media-transformer.d-CvMFjINm.d.ts +331 -0
  63. package/dist/packem_shared/{memory-storage.d-4EU1cMt1.d.ts → memory-storage.d-BRdTiY8y.d.ts} +32 -40
  64. package/dist/packem_shared/{s3-base-storage-BoTyhuzO.js → s3-base-storage-CMUui93V.js} +1 -1
  65. package/dist/packem_shared/{s3-base-storage.d-BQgP5B-t.d.ts → s3-base-storage.d-Cg7m4FuH.d.ts} +64 -70
  66. package/dist/packem_shared/storage.d-DIav_lF1.d.ts +1163 -0
  67. package/dist/packem_shared/tus-base.d-BiEg5t4t.d.ts +102 -0
  68. package/dist/packem_shared/{types.d-CrUWY4On.d.ts → types.d-CAAzKiI6.d.ts} +134 -134
  69. package/dist/packem_shared/types.d-DgHhkCAl.d.ts +104 -0
  70. package/dist/packem_shared/{types.d-CggTCgXr.d.ts → types.d-jAs_Rp_v.d.ts} +3 -3
  71. package/dist/storage/aws/clients/index.d.ts +388 -388
  72. package/dist/storage/aws/index.d.ts +109 -113
  73. package/dist/storage/aws/index.js +1 -1
  74. package/dist/storage/aws-light/index.d.ts +63 -67
  75. package/dist/storage/aws-light/index.js +1 -1
  76. package/dist/storage/azure/index.d.ts +133 -139
  77. package/dist/storage/azure/index.js +1 -1
  78. package/dist/storage/box/index.d.ts +88 -92
  79. package/dist/storage/box/index.js +1 -1
  80. package/dist/storage/bun-s3/index.d.ts +70 -76
  81. package/dist/storage/bun-s3/index.js +1 -1
  82. package/dist/storage/bunny/index.d.ts +51 -55
  83. package/dist/storage/bunny/index.js +1 -1
  84. package/dist/storage/cloudinary/index.d.ts +53 -59
  85. package/dist/storage/cloudinary/index.js +1 -1
  86. package/dist/storage/dropbox/index.d.ts +58 -62
  87. package/dist/storage/dropbox/index.js +1 -1
  88. package/dist/storage/firebase/index.d.ts +73 -79
  89. package/dist/storage/firebase/index.js +1 -1
  90. package/dist/storage/ftp/index.d.ts +37 -43
  91. package/dist/storage/ftp/index.js +1 -1
  92. package/dist/storage/gcs/index.d.ts +89 -95
  93. package/dist/storage/gcs/index.js +1 -1
  94. package/dist/storage/google-drive/index.d.ts +68 -72
  95. package/dist/storage/google-drive/index.js +1 -1
  96. package/dist/storage/local/index.d.ts +3 -3
  97. package/dist/storage/local/index.js +1 -1
  98. package/dist/storage/memory/index.d.ts +2 -2
  99. package/dist/storage/netlify-blob/index.d.ts +85 -93
  100. package/dist/storage/netlify-blob/index.js +1 -1
  101. package/dist/storage/onedrive/index.d.ts +43 -53
  102. package/dist/storage/onedrive/index.js +1 -1
  103. package/dist/storage/pocketbase/index.d.ts +66 -72
  104. package/dist/storage/pocketbase/index.js +1 -1
  105. package/dist/storage/sftp/index.d.ts +39 -45
  106. package/dist/storage/sftp/index.js +1 -1
  107. package/dist/storage/sharepoint/index.d.ts +95 -95
  108. package/dist/storage/sharepoint/index.js +1 -1
  109. package/dist/storage/supabase/index.d.ts +49 -55
  110. package/dist/storage/supabase/index.js +1 -1
  111. package/dist/storage/uploadthing/index.d.ts +33 -37
  112. package/dist/storage/uploadthing/index.js +1 -1
  113. package/dist/storage/vercel-blob/index.d.ts +109 -115
  114. package/dist/storage/vercel-blob/index.js +1 -1
  115. package/dist/transformer/audio-transformer.d.ts +96 -96
  116. package/dist/transformer/image-transformer.d.ts +422 -422
  117. package/dist/transformer/index.d.ts +34 -34
  118. package/dist/transformer/video-transformer.d.ts +111 -111
  119. package/package.json +1 -1
  120. package/dist/packem_shared/BoxMetaStorage-BSn6Qfnf.js +0 -1
  121. package/dist/packem_shared/BunS3MetaStorage-BSn6Qfnf.js +0 -1
  122. package/dist/packem_shared/BunnyMetaStorage-BSn6Qfnf.js +0 -1
  123. package/dist/packem_shared/CloudinaryMetaStorage-DPVnmNe5.js +0 -1
  124. package/dist/packem_shared/DropboxMetaStorage-BSn6Qfnf.js +0 -1
  125. package/dist/packem_shared/FirebaseMetaStorage-DPVnmNe5.js +0 -1
  126. package/dist/packem_shared/FtpMetaStorage-BSn6Qfnf.js +0 -1
  127. package/dist/packem_shared/GoogleDriveMetaStorage-Cbwa1CHV.js +0 -1
  128. package/dist/packem_shared/NetlifyBlobMetaStorage-DPVnmNe5.js +0 -1
  129. package/dist/packem_shared/OneDriveMetaStorage-Cbwa1CHV.js +0 -1
  130. package/dist/packem_shared/PocketBaseMetaStorage-DOTLwVE7.js +0 -1
  131. package/dist/packem_shared/SftpMetaStorage-BSn6Qfnf.js +0 -1
  132. package/dist/packem_shared/SharePointMetaStorage-BSn6Qfnf.js +0 -1
  133. package/dist/packem_shared/SupabaseMetaStorage-Cbwa1CHV.js +0 -1
  134. package/dist/packem_shared/UploadThingMetaStorage-DPVnmNe5.js +0 -1
  135. package/dist/packem_shared/VercelBlobMetaStorage-BSn6Qfnf.js +0 -1
  136. package/dist/packem_shared/disk-storage-CsQcYW3s.js +0 -1
  137. package/dist/packem_shared/disk-storage-with-checksum.d-B-VGEsfl.d.ts +0 -156
  138. package/dist/packem_shared/files.d-CH0iLBNC.d.ts +0 -655
  139. package/dist/packem_shared/local-meta-storage-iuJnu90B.js +0 -11
  140. package/dist/packem_shared/media-transformer.d-Quf4ai47.d.ts +0 -331
  141. package/dist/packem_shared/storage.d-CEM1upWM.d.ts +0 -1176
  142. package/dist/packem_shared/tus-base.d-DLzKE54M.d.ts +0 -106
  143. package/dist/packem_shared/types.d-Bon9GVVe.d.ts +0 -104
@@ -1,11 +0,0 @@
1
- import{utimes as tr}from"node:fs/promises";import{tmpdir as rr}from"node:os";import{createRequire as C}from"node:module";import{v as or,H as ge,B as mt,m as Ut,W as yt,J as sr}from"./path-0oTTdkvl-DvWvbDbh.js";import{throwErrorCode as nt,ERRORS as it}from"./ERRORS-BIBxE2oR.js";import nr from"./MetaStorage-DPEUyWgN.js";import{stringifyMetadata as ir,parseMetadata as ur}from"./Metadata-B7CcBueg.js";const Xt=0,ar=C(import.meta.url),be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lr=t=>{if(typeof be<"u"&&be.versions&&be.versions.node){const[e,r]=be.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return be.getBuiltinModule(t)}return ar(t)},{fileURLToPath:pr}=lr("node:url");function cr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tt,xt;function fr(){return xt||(xt=1,Tt=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Tt}var dr=fr();const gr=cr(dr);new Set(gr);const ye=t=>or(t instanceof URL?pr(t):t);let hr=class extends Error{constructor(e){super(`EEXIST: ${e}`)}get code(){return"EEXIST"}set code(e){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(e){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const he=t=>{if(!t||!(t instanceof URL)&&typeof t!="string")throw new TypeError("Path must be a non-empty string or URL.")},mr=C(import.meta.url),$e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yr=t=>{if(typeof $e<"u"&&$e.versions&&$e.versions.node){const[e,r]=$e.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return $e.getBuiltinModule(t)}return mr(t)};yr("node:fs/promises");const br=C(import.meta.url),ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$r=t=>{if(typeof ve<"u"&&ve.versions&&ve.versions.node){const[e,r]=ve.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ve.getBuiltinModule(t)}return br(t)};$r("node:fs");const bt=t=>{if(t.isFile())return"file";if(t.isDirectory())return"dir";if(t.isSymbolicLink())return"symlink"},vr=C(import.meta.url),Ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Er=t=>{if(typeof Ee<"u"&&Ee.versions&&Ee.versions.node){const[e,r]=Ee.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ee.getBuiltinModule(t)}return vr(t)},{lstat:wt,mkdir:Ar}=Er("node:fs/promises"),zt=async t=>{he(t);try{const e=await wt(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bt(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await Ar(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=await wt(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bt(r))}'`,{cause:e})}},Rr=C(import.meta.url),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tr=t=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[e,r]=Ae.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ae.getBuiltinModule(t)}return Rr(t)};Tr("node:fs");const xr=C(import.meta.url),Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wr=t=>{if(typeof Re<"u"&&Re.versions&&Re.versions.node){const[e,r]=Re.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Re.getBuiltinModule(t)}return xr(t)},{lstat:_r,writeFile:Sr}=wr("node:fs/promises"),Hs=async t=>{he(t);try{const e=await _r(t);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(bt(e))}'`)}catch(e){if(e.code==="ENOENT"){await zt(ge(ye(t))),await Sr(t,new Uint8Array);return}throw e}},Cr=C(import.meta.url),Te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kr=t=>{if(typeof Te<"u"&&Te.versions&&Te.versions.node){const[e,r]=Te.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Te.getBuiltinModule(t)}return Cr(t)};kr("node:fs");const Or=C(import.meta.url),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nr=t=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[e,r]=xe.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return xe.getBuiltinModule(t)}return Or(t)};Nr("node:fs/promises");const Lr=C(import.meta.url),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Hr=t=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[e,r]=we.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return we.getBuiltinModule(t)}return Lr(t)};Hr("node:fs");const Mr=C(import.meta.url),_e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Br=t=>{if(typeof _e<"u"&&_e.versions&&_e.versions.node){const[e,r]=_e.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return _e.getBuiltinModule(t)}return Mr(t)};Br("node:fs/promises");const Ir=C(import.meta.url),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Dr=t=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[e,r]=Se.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Se.getBuiltinModule(t)}return Ir(t)};Dr("node:fs");C(import.meta.url);let _t=class extends Error{root;constructor(e,r){super(`${e instanceof Error?e.message:String(e)} for path "${r}"`),this.cause=e,this.root=r}get name(){return"WalkError"}set name(e){throw new Error("Cannot overwrite name of WalkError")}};const St=t=>{const e=t.replace(/[$()+\\^]/g,String.raw`\$&`).replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");try{return new RegExp(`^${e}$`)}catch(r){throw new Error(`Invalid glob pattern: ${t}`,{cause:r})}};let Pr=class{name;path;#e;constructor(e,r,y){this.#e=e,this.name=r,this.path=y}isDirectory(){return this.#e.isDirectory()}isFile(){return this.#e.isFile()}isSymbolicLink(){return this.#e.isSymbolicLink()}};const $t=(t,e,r)=>new Pr(t,e,r),rt=(t,e,r,y)=>{if(Array.isArray(e)&&e.length>0&&!e.some(o=>t.endsWith(o)))return!1;const p=t.includes("\\")?t.replaceAll("\\","/"):t;return r&&!r.some(o=>o.test(p))?!1:!y?.some(o=>o.test(p))},Fr=C(import.meta.url),Ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gr=t=>{if(typeof Ce<"u"&&Ce.versions&&Ce.versions.node){const[e,r]=Ce.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ce.getBuiltinModule(t)}return Fr(t)},{readdir:Ur,realpath:Xr,stat:Kt}=Gr("node:fs/promises"),zr=async t=>{const e=yt(t),r=sr(e),y=await Kt(e);return $t(y,r,e)};async function*Kr(t,e={}){const{extensions:r,followSymlinks:y=!1,includeDirs:p=!0,includeFiles:o=!0,includeSymlinks:a=!0,match:f,maxDepth:l=Number.POSITIVE_INFINITY,skip:A}=e;if(he(t),l<0)return;const g=e.visited??new Set,T=f?f.map(b=>typeof b=="string"?St(b):b):void 0,w=A?A.map(b=>typeof b=="string"?St(b):b):void 0;if(t=mt(ye(t)),p&&rt(t,r,T,w)&&(yield await zr(t)),!(l<1||!rt(t,void 0,void 0,w)))try{const b=await Ur(t,{withFileTypes:!0});for(const k of b){let X=Ut(t,k.name),K=k.isDirectory(),W=k.isFile();if(k.isSymbolicLink())if(y){const L=await Xr(X);if(g.has(L))continue;X=L;const h=await Kt(L);K=h.isDirectory(),W=h.isFile()}else if(a&&rt(X,r,T,w)){yield $t(k,k.name,X);continue}else continue;K?(y&&g.add(X),yield*Kr(X,{extensions:r,followSymlinks:y,includeDirs:p,includeFiles:o,includeSymlinks:a,match:T,maxDepth:l-1,skip:w,visited:g})):W&&o&&rt(X,r,T,w)&&(yield $t(k,k.name,X))}}catch(b){throw b instanceof _t?b:new _t(b,t)}}const Wr=C(import.meta.url),ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jr=t=>{if(typeof ke<"u"&&ke.versions&&ke.versions.node){const[e,r]=ke.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ke.getBuiltinModule(t)}return Wr(t)};jr("node:fs");const Qr=C(import.meta.url),Oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qr=t=>{if(typeof Oe<"u"&&Oe.versions&&Oe.versions.node){const[e,r]=Oe.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Oe.getBuiltinModule(t)}return Qr(t)};qr("node:fs/promises");const Vr=C(import.meta.url),Ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yr=t=>{if(typeof Ne<"u"&&Ne.versions&&Ne.versions.node){const[e,r]=Ne.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ne.getBuiltinModule(t)}return Vr(t)};Yr("node:fs");function Et(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ct={},ut,kt;function ot(){if(kt)return ut;kt=1;const t="[^\\\\/]",e=Symbol("unignore"),r="\\.",y="\\+",p="\\?",o="\\/",a="(?=.)",f="[^/]",l=`(?:${o}|$)`,A=`(?:^|${o})`,g=`${r}{1,2}${l}`,T=`(?!${r})`,w=`(?!${A}${g})`,b=`(?!${r}{0,1}${l})`,k=`(?!${g})`,X=`[^.${o}]`,K=`${f}*?`,W="/",L={DOT_LITERAL:r,PLUS_LITERAL:y,QMARK_LITERAL:p,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:f,END_ANCHOR:l,DOTS_SLASH:g,NO_DOT:T,NO_DOTS:w,NO_DOT_SLASH:b,NO_DOTS_SLASH:k,QMARK_NO_DOT:X,STAR:K,START_ANCHOR:A,SEP:W},h={...L,SLASH_LITERAL:"[\\\\/]",QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},m={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return ut={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:m,UNIGNORE:e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?h:L}},ut}var Ot;function st(){return Ot||(Ot=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:y,REGEX_SPECIAL_CHARS_GLOBAL:p}=ot();t.isObject=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),t.hasRegexChars=o=>y.test(o),t.isRegexChar=o=>o.length===1&&t.hasRegexChars(o),t.escapeRegex=o=>o.replace(p,"\\$1"),t.toPosixSlashes=o=>o.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const o=navigator.platform.toLowerCase();return o==="win32"||o==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=o=>o.replace(r,a=>a==="\\"?"":a),t.escapeLast=(o,a,f)=>{const l=o.lastIndexOf(a,f);return l===-1?o:o[l-1]==="\\"?t.escapeLast(o,a,l-1):`${o.slice(0,l)}\\${o.slice(l)}`},t.removePrefix=(o,a={})=>{let f=o;return f.startsWith("./")&&(f=f.slice(2),a.prefix="./"),f},t.wrapOutput=(o,a={},f={})=>{const l=f.contains?"":"^",A=f.contains?"":"$";let g=`${l}(?:${o})${A}`;return a.negated===!0&&(g=`(?:^(?!${g}).*$)`),g},t.basename=(o,{windows:a}={})=>{const f=o.split(a?/[\\/]/:"/"),l=f[f.length-1];return l===""?f[f.length-2]:l}})(Ct)),Ct}var at,Nt;function Zr(){if(Nt)return at;Nt=1;const t=st(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:y,CHAR_COMMA:p,CHAR_DOT:o,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:f,CHAR_LEFT_CURLY_BRACE:l,CHAR_LEFT_PARENTHESES:A,CHAR_LEFT_SQUARE_BRACKET:g,CHAR_PLUS:T,CHAR_QUESTION_MARK:w,CHAR_RIGHT_CURLY_BRACE:b,CHAR_RIGHT_PARENTHESES:k,CHAR_RIGHT_SQUARE_BRACKET:X}=ot(),K=L=>L===f||L===y,W=L=>{L.isPrefix!==!0&&(L.depth=L.isGlobstar?1/0:1)};return at=(L,h)=>{const m=h||{},s=L.length-1,R=m.parts===!0||m.scanToEnd===!0,O=[],$=[],x=[];let v=L,j=-1,G=0,J=0,le=!1,ee=!1,U=!1,te=!1,pe=!1,se=!1,re=!1,P=!1,ne=!1,q=!1,ce=0,V,E,H={value:"",depth:0,isGlob:!1};const Q=()=>j>=s,u=()=>v.charCodeAt(j+1),I=()=>(V=E,v.charCodeAt(++j));for(;j<s;){E=I();let Y;if(E===y){re=H.backslashes=!0,E=I(),E===l&&(se=!0);continue}if(se===!0||E===l){for(ce++;Q()!==!0&&(E=I());){if(E===y){re=H.backslashes=!0,I();continue}if(E===l){ce++;continue}if(se!==!0&&E===o&&(E=I())===o){if(le=H.isBrace=!0,U=H.isGlob=!0,q=!0,R===!0)continue;break}if(se!==!0&&E===p){if(le=H.isBrace=!0,U=H.isGlob=!0,q=!0,R===!0)continue;break}if(E===b&&(ce--,ce===0)){se=!1,le=H.isBrace=!0,q=!0;break}}if(R===!0)continue;break}if(E===f){if(O.push(j),$.push(H),H={value:"",depth:0,isGlob:!1},q===!0)continue;if(V===o&&j===G+1){G+=2;continue}J=j+1;continue}if(m.noext!==!0&&(E===T||E===r||E===e||E===w||E===a)&&u()===A){if(U=H.isGlob=!0,te=H.isExtglob=!0,q=!0,E===a&&j===G&&(ne=!0),R===!0){for(;Q()!==!0&&(E=I());){if(E===y){re=H.backslashes=!0,E=I();continue}if(E===k){U=H.isGlob=!0,q=!0;break}}continue}break}if(E===e){if(V===e&&(pe=H.isGlobstar=!0),U=H.isGlob=!0,q=!0,R===!0)continue;break}if(E===w){if(U=H.isGlob=!0,q=!0,R===!0)continue;break}if(E===g){for(;Q()!==!0&&(Y=I());){if(Y===y){re=H.backslashes=!0,I();continue}if(Y===X){ee=H.isBracket=!0,U=H.isGlob=!0,q=!0;break}}if(R===!0)continue;break}if(m.nonegate!==!0&&E===a&&j===G){P=H.negated=!0,G++;continue}if(m.noparen!==!0&&E===A){if(U=H.isGlob=!0,R===!0){for(;Q()!==!0&&(E=I());){if(E===A){re=H.backslashes=!0,E=I();continue}if(E===k){q=!0;break}}continue}break}if(U===!0){if(q=!0,R===!0)continue;break}}m.noext===!0&&(te=!1,U=!1);let B=v,fe="",n="";G>0&&(fe=v.slice(0,G),v=v.slice(G),J-=G),B&&U===!0&&J>0?(B=v.slice(0,J),n=v.slice(J)):U===!0?(B="",n=v):B=v,B&&B!==""&&B!=="/"&&B!==v&&K(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),m.unescape===!0&&(n&&(n=t.removeBackslashes(n)),B&&re===!0&&(B=t.removeBackslashes(B)));const i={prefix:fe,input:L,start:G,base:B,glob:n,isBrace:le,isBracket:ee,isGlob:U,isExtglob:te,isGlobstar:pe,negated:P,negatedExtglob:ne};if(m.tokens===!0&&(i.maxDepth=0,K(E)||$.push(H),i.tokens=$),m.parts===!0||m.tokens===!0){let Y;for(let N=0;N<O.length;N++){const oe=Y?Y+1:G,ie=O[N],Z=L.slice(oe,ie);m.tokens&&(N===0&&G!==0?($[N].isPrefix=!0,$[N].value=fe):$[N].value=Z,W($[N]),i.maxDepth+=$[N].depth),(N!==0||Z!=="")&&x.push(Z),Y=ie}if(Y&&Y+1<L.length){const N=L.slice(Y+1);x.push(N),m.tokens&&($[$.length-1].value=N,W($[$.length-1]),i.maxDepth+=$[$.length-1].depth)}i.slashes=O,i.parts=x}return i},at}var lt,Lt;function Jr(){if(Lt)return lt;Lt=1;const t=ot(),e=st(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:y,REGEX_NON_SPECIAL_CHARS:p,REGEX_SPECIAL_CHARS_BACKREF:o,REPLACEMENTS:a}=t,f=(h,m)=>typeof m.expandRange=="function"?m.expandRange(...h,m):(h.sort(),`[${h.join("-")}]`),l=(h,m)=>`Missing ${h}: "${m}" - use "\\\\${m}" to match literal characters`,A=h=>{const m=[];let s=0,R=0,O=0,$="",x=!1;for(const v of h){if(x===!0){$+=v,x=!1;continue}if(v==="\\"){$+=v,x=!0;continue}if(v==='"'){O=O===1?0:1,$+=v;continue}if(O===0){if(v==="[")s++;else if(v==="]"&&s>0)s--;else if(s===0){if(v==="(")R++;else if(v===")"&&R>0)R--;else if(v==="|"&&R===0){m.push($),$="";continue}}}$+=v}return m.push($),m},g=h=>{let m=!1;for(const s of h){if(m===!0){m=!1;continue}if(s==="\\"){m=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},T=h=>{let m=h.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(m)&&(m=m.slice(2,-1),s=!0);if(g(m))return m.replace(/\\(.)/g,"$1")},w=h=>{const m=h.map(T).filter(Boolean);for(let s=0;s<m.length;s++)for(let R=s+1;R<m.length;R++){const O=m[s],$=m[R],x=O[0];if(!(!x||O!==x.repeat(O.length)||$!==x.repeat($.length))&&(O===$||O.startsWith($)||$.startsWith(O)))return!0}return!1},b=(h,m=!0)=>{if(h[0]!=="+"&&h[0]!=="*"||h[1]!=="(")return;let s=0,R=0,O=0,$=!1;for(let x=1;x<h.length;x++){const v=h[x];if($===!0){$=!1;continue}if(v==="\\"){$=!0;continue}if(v==='"'){O=O===1?0:1;continue}if(O!==1){if(v==="["){s++;continue}if(v==="]"&&s>0){s--;continue}if(!(s>0)){if(v==="("){R++;continue}if(v===")"&&(R--,R===0))return m===!0&&x!==h.length-1?void 0:{type:h[0],body:h.slice(2,x),end:x}}}}},k=h=>`${h.length===1?e.escapeRegex(h[0]):`[${h.map(m=>e.escapeRegex(m)).join("")}]`}*`,X=h=>{let m=0;const s=[];for(;m<h.length;){const R=b(h.slice(m),!1);if(!R||R.type!=="*")return;const O=A(R.body).map(x=>x.trim());if(O.length!==1)return;const $=T(O[0]);if(!$||$.length!==1)return;s.push($),m+=R.end+1}if(!(s.length<1))return s},K=h=>{let m=0,s=h.trim(),R=b(s);for(;R;)m++,s=R.body.trim(),R=b(s);return m},W=(h,m)=>{if(m.maxExtglobRecursion===!1)return{risky:!1};const s=typeof m.maxExtglobRecursion=="number"?m.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,R=A(h).map(v=>v.trim());if(R.length>1&&(R.some(v=>v==="")||R.some(v=>/^[*?]+$/.test(v))||w(R)))return{risky:!0};const O=[];let $=!1,x=!0;for(const v of R){const j=X(v);if(j){$=!0,O.push(...j);continue}const G=T(v);if(G&&G.length===1){O.push(G);continue}if(x=!1,K(v)>s)return{risky:!0}}return $?x?{risky:!0,safeOutput:k([...new Set(O)])}:{risky:!0}:{risky:!1}},L=(h,m)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=a[h]||h;const s={...m},R=typeof s.maxLength=="number"?Math.min(r,s.maxLength):r;let O=h.length;if(O>R)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${R}`);const $={type:"bos",value:"",output:s.prepend||""},x=[$],v=s.capture?"":"?:",j=t.globChars(s.windows),G=t.extglobChars(j),{DOT_LITERAL:J,PLUS_LITERAL:le,SLASH_LITERAL:ee,ONE_CHAR:U,DOTS_SLASH:te,NO_DOT:pe,NO_DOT_SLASH:se,NO_DOTS_SLASH:re,QMARK:P,QMARK_NO_DOT:ne,STAR:q,START_ANCHOR:ce}=j,V=d=>`(${v}(?:(?!${ce}${d.dot?te:J}).)*?)`,E=s.dot?"":pe,H=s.dot?P:ne;let Q=s.bash===!0?V(s):q;s.capture&&(Q=`(${Q})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const u={input:h,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:x};h=e.removePrefix(h,u),O=h.length;const I=[],B=[],fe=[];let n=$,i;const Y=()=>u.index===O-1,N=u.peek=(d=1)=>h[u.index+d],oe=u.advance=()=>h[++u.index]||"",ie=()=>h.slice(u.index+1),Z=(d="",D=0)=>{u.consumed+=d,u.index+=D},Je=d=>{u.output+=d.output!=null?d.output:d.value,Z(d.value)},Jt=()=>{let d=1;for(;N()==="!"&&(N(2)!=="("||N(3)==="?");)oe(),u.start++,d++;return d%2===0?!1:(u.negated=!0,u.start++,!0)},et=d=>{u[d]++,fe.push(d)},de=d=>{u[d]--,fe.pop()},_=d=>{if(n.type==="globstar"){const D=u.braces>0&&(d.type==="comma"||d.type==="brace"),c=d.extglob===!0||I.length&&(d.type==="pipe"||d.type==="paren");d.type!=="slash"&&d.type!=="paren"&&!D&&!c&&(u.output=u.output.slice(0,-n.output.length),n.type="star",n.value="*",n.output=Q,u.output+=n.output)}if(I.length&&d.type!=="paren"&&(I[I.length-1].inner+=d.value),(d.value||d.output)&&Je(d),n&&n.type==="text"&&d.type==="text"){n.output=(n.output||n.value)+d.value,n.value+=d.value;return}d.prev=n,x.push(d),n=d},tt=(d,D)=>{const c={...G[D],conditions:1,inner:""};c.prev=n,c.parens=u.parens,c.output=u.output,c.startIndex=u.index,c.tokensIndex=x.length;const S=(s.capture?"(":"")+c.open;et("parens"),_({type:d,value:D,output:u.output?"":U}),_({type:"paren",extglob:!0,value:oe(),output:S}),I.push(c)},er=d=>{const D=h.slice(d.startIndex,u.index+1),c=h.slice(d.startIndex+2,u.index),S=W(c,s);if((d.type==="plus"||d.type==="star")&&S.risky){const M=S.safeOutput?(d.output?"":U)+(s.capture?`(${S.safeOutput})`:S.safeOutput):void 0,ue=x[d.tokensIndex];ue.type="text",ue.value=D,ue.output=M||e.escapeRegex(D);for(let ae=d.tokensIndex+1;ae<x.length;ae++)x[ae].value="",x[ae].output="",delete x[ae].suffix;u.output=d.output+ue.output,u.backtrack=!0,_({type:"paren",extglob:!0,value:i,output:""}),de("parens");return}let F=d.close+(s.capture?")":""),z;if(d.type==="negate"){let M=Q;if(d.inner&&d.inner.length>1&&d.inner.includes("/")&&(M=V(s)),(M!==Q||Y()||/^\)+$/.test(ie()))&&(F=d.close=`)$))${M}`),d.inner.includes("*")&&(z=ie())&&/^\.[^\\/.]+$/.test(z)){const ue=L(z,{...m,fastpaths:!1}).output;F=d.close=`)${ue})${M})`}d.prev.type==="bos"&&(u.negatedExtglob=!0)}_({type:"paren",extglob:!0,value:i,output:F}),de("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let d=!1,D=h.replace(o,(c,S,F,z,M,ue)=>z==="\\"?(d=!0,c):z==="?"?S?S+z+(M?P.repeat(M.length):""):ue===0?H+(M?P.repeat(M.length):""):P.repeat(F.length):z==="."?J.repeat(F.length):z==="*"?S?S+z+(M?Q:""):Q:S?c:`\\${c}`);return d===!0&&(s.unescape===!0?D=D.replace(/\\/g,""):D=D.replace(/\\+/g,c=>c.length%2===0?"\\\\":c?"\\":"")),D===h&&s.contains===!0?(u.output=h,u):(u.output=e.wrapOutput(D,u,m),u)}for(;!Y();){if(i=oe(),i==="\0")continue;if(i==="\\"){const c=N();if(c==="/"&&s.bash!==!0||c==="."||c===";")continue;if(!c){i+="\\",_({type:"text",value:i});continue}const S=/^\\+/.exec(ie());let F=0;if(S&&S[0].length>2&&(F=S[0].length,u.index+=F,F%2!==0&&(i+="\\")),s.unescape===!0?i=oe():i+=oe(),u.brackets===0){_({type:"text",value:i});continue}}if(u.brackets>0&&(i!=="]"||n.value==="["||n.value==="[^")){if(s.posix!==!1&&i===":"){const c=n.value.slice(1);if(c.includes("[")&&(n.posix=!0,c.includes(":"))){const S=n.value.lastIndexOf("["),F=n.value.slice(0,S),z=n.value.slice(S+2),M=y[z];if(M){n.value=F+M,u.backtrack=!0,oe(),!$.output&&x.indexOf(n)===1&&($.output=U);continue}}}(i==="["&&N()!==":"||i==="-"&&N()==="]")&&(i=`\\${i}`),i==="]"&&(n.value==="["||n.value==="[^")&&(i=`\\${i}`),s.posix===!0&&i==="!"&&n.value==="["&&(i="^"),n.value+=i,Je({value:i});continue}if(u.quotes===1&&i!=='"'){i=e.escapeRegex(i),n.value+=i,Je({value:i});continue}if(i==='"'){u.quotes=u.quotes===1?0:1,s.keepQuotes===!0&&_({type:"text",value:i});continue}if(i==="("){et("parens"),_({type:"paren",value:i});continue}if(i===")"){if(u.parens===0&&s.strictBrackets===!0)throw new SyntaxError(l("opening","("));const c=I[I.length-1];if(c&&u.parens===c.parens+1){er(I.pop());continue}_({type:"paren",value:i,output:u.parens?")":"\\)"}),de("parens");continue}if(i==="["){if(s.nobracket===!0||!ie().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(l("closing","]"));i=`\\${i}`}else et("brackets");_({type:"bracket",value:i});continue}if(i==="]"){if(s.nobracket===!0||n&&n.type==="bracket"&&n.value.length===1){_({type:"text",value:i,output:`\\${i}`});continue}if(u.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(l("opening","["));_({type:"text",value:i,output:`\\${i}`});continue}de("brackets");const c=n.value.slice(1);if(n.posix!==!0&&c[0]==="^"&&!c.includes("/")&&(i=`/${i}`),n.value+=i,Je({value:i}),s.literalBrackets===!1||e.hasRegexChars(c))continue;const S=e.escapeRegex(n.value);if(u.output=u.output.slice(0,-n.value.length),s.literalBrackets===!0){u.output+=S,n.value=S;continue}n.value=`(${v}${S}|${n.value})`,u.output+=n.value;continue}if(i==="{"&&s.nobrace!==!0){et("braces");const c={type:"brace",value:i,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};B.push(c),_(c);continue}if(i==="}"){const c=B[B.length-1];if(s.nobrace===!0||!c){_({type:"text",value:i,output:i});continue}let S=")";if(c.dots===!0){const F=x.slice(),z=[];for(let M=F.length-1;M>=0&&(x.pop(),F[M].type!=="brace");M--)F[M].type!=="dots"&&z.unshift(F[M].value);S=f(z,s),u.backtrack=!0}if(c.comma!==!0&&c.dots!==!0){const F=u.output.slice(0,c.outputIndex),z=u.tokens.slice(c.tokensIndex);c.value=c.output="\\{",i=S="\\}",u.output=F;for(const M of z)u.output+=M.output||M.value}_({type:"brace",value:i,output:S}),de("braces"),B.pop();continue}if(i==="|"){I.length>0&&I[I.length-1].conditions++,_({type:"text",value:i});continue}if(i===","){let c=i;const S=B[B.length-1];S&&fe[fe.length-1]==="braces"&&(S.comma=!0,c="|"),_({type:"comma",value:i,output:c});continue}if(i==="/"){if(n.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",x.pop(),n=$;continue}_({type:"slash",value:i,output:ee});continue}if(i==="."){if(u.braces>0&&n.type==="dot"){n.value==="."&&(n.output=J);const c=B[B.length-1];n.type="dots",n.output+=i,n.value+=i,c.dots=!0;continue}if(u.braces+u.parens===0&&n.type!=="bos"&&n.type!=="slash"){_({type:"text",value:i,output:J});continue}_({type:"dot",value:i,output:J});continue}if(i==="?"){if(!(n&&n.value==="(")&&s.noextglob!==!0&&N()==="("&&N(2)!=="?"){tt("qmark",i);continue}if(n&&n.type==="paren"){const c=N();let S=i;(n.value==="("&&!/[!=<:]/.test(c)||c==="<"&&!/<([!=]|\w+>)/.test(ie()))&&(S=`\\${i}`),_({type:"text",value:i,output:S});continue}if(s.dot!==!0&&(n.type==="slash"||n.type==="bos")){_({type:"qmark",value:i,output:ne});continue}_({type:"qmark",value:i,output:P});continue}if(i==="!"){if(s.noextglob!==!0&&N()==="("&&(N(2)!=="?"||!/[!=<:]/.test(N(3)))){tt("negate",i);continue}if(s.nonegate!==!0&&u.index===0){Jt();continue}}if(i==="+"){if(s.noextglob!==!0&&N()==="("&&N(2)!=="?"){tt("plus",i);continue}if(n&&n.value==="("||s.regex===!1){_({type:"plus",value:i,output:le});continue}if(n&&(n.type==="bracket"||n.type==="paren"||n.type==="brace")||u.parens>0){_({type:"plus",value:i});continue}_({type:"plus",value:le});continue}if(i==="@"){if(s.noextglob!==!0&&N()==="("&&N(2)!=="?"){_({type:"at",extglob:!0,value:i,output:""});continue}_({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const c=p.exec(ie());c&&(i+=c[0],u.index+=c[0].length),_({type:"text",value:i});continue}if(n&&(n.type==="globstar"||n.star===!0)){n.type="star",n.star=!0,n.value+=i,n.output=Q,u.backtrack=!0,u.globstar=!0,Z(i);continue}let d=ie();if(s.noextglob!==!0&&/^\([^?]/.test(d)){tt("star",i);continue}if(n.type==="star"){if(s.noglobstar===!0){Z(i);continue}const c=n.prev,S=c.prev,F=c.type==="slash"||c.type==="bos",z=S&&(S.type==="star"||S.type==="globstar");if(s.bash===!0&&(!F||d[0]&&d[0]!=="/")){_({type:"star",value:i,output:""});continue}const M=u.braces>0&&(c.type==="comma"||c.type==="brace"),ue=I.length&&(c.type==="pipe"||c.type==="paren");if(!F&&c.type!=="paren"&&!M&&!ue){_({type:"star",value:i,output:""});continue}for(;d.slice(0,3)==="/**";){const ae=h[u.index+4];if(ae&&ae!=="/")break;d=d.slice(3),Z("/**",3)}if(c.type==="bos"&&Y()){n.type="globstar",n.value+=i,n.output=V(s),u.output=n.output,u.globstar=!0,Z(i);continue}if(c.type==="slash"&&c.prev.type!=="bos"&&!z&&Y()){u.output=u.output.slice(0,-(c.output+n.output).length),c.output=`(?:${c.output}`,n.type="globstar",n.output=V(s)+(s.strictSlashes?")":"|$)"),n.value+=i,u.globstar=!0,u.output+=c.output+n.output,Z(i);continue}if(c.type==="slash"&&c.prev.type!=="bos"&&d[0]==="/"){const ae=d[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(c.output+n.output).length),c.output=`(?:${c.output}`,n.type="globstar",n.output=`${V(s)}${ee}|${ee}${ae})`,n.value+=i,u.output+=c.output+n.output,u.globstar=!0,Z(i+oe()),_({type:"slash",value:"/",output:""});continue}if(c.type==="bos"&&d[0]==="/"){n.type="globstar",n.value+=i,n.output=`(?:^|${ee}|${V(s)}${ee})`,u.output=n.output,u.globstar=!0,Z(i+oe()),_({type:"slash",value:"/",output:""});continue}if(M&&d[0]==="/"){n.type="globstar",n.value+=i,n.output=`(?:^|${ee}|${V(s)}${ee})`,u.output+=n.output,u.globstar=!0,Z(i+oe()),_({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-n.output.length),n.type="globstar",n.output=V(s),n.value+=i,u.output+=n.output,u.globstar=!0,Z(i);continue}const D={type:"star",value:i,output:Q};if(s.bash===!0){D.output=".*?",(n.type==="bos"||n.type==="slash")&&(D.output=E+D.output),_(D);continue}if(n&&(n.type==="bracket"||n.type==="paren")&&s.regex===!0){D.output=i,_(D);continue}(u.index===u.start||n.type==="slash"||n.type==="dot")&&(n.type==="dot"?(u.output+=se,n.output+=se):s.dot===!0?(u.output+=re,n.output+=re):(u.output+=E,n.output+=E),N()!=="*"&&(u.output+=U,n.output+=U)),_(D)}for(;u.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(l("closing","]"));u.output=e.escapeLast(u.output,"["),de("brackets")}for(;u.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(l("closing",")"));u.output=e.escapeLast(u.output,"("),de("parens")}for(;u.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(l("closing","}"));u.output=e.escapeLast(u.output,"{"),de("braces")}if(s.strictSlashes!==!0&&(n.type==="star"||n.type==="bracket")&&_({type:"maybe_slash",value:"",output:`${ee}?`}),u.backtrack===!0){u.output="";for(const d of u.tokens)u.output+=d.output!=null?d.output:d.value,d.suffix&&(u.output+=d.suffix)}return u};return L.fastpaths=(h,m)=>{const s={...m},R=typeof s.maxLength=="number"?Math.min(r,s.maxLength):r,O=h.length;if(O>R)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${R}`);h=a[h]||h;const{DOT_LITERAL:$,SLASH_LITERAL:x,ONE_CHAR:v,DOTS_SLASH:j,NO_DOT:G,NO_DOTS:J,NO_DOTS_SLASH:le,STAR:ee,START_ANCHOR:U}=t.globChars(s.windows),te=s.dot?J:G,pe=s.dot?le:G,se=s.capture?"":"?:",re={negated:!1,prefix:""};let P=s.bash===!0?".*?":ee;s.capture&&(P=`(${P})`);const ne=E=>E.noglobstar===!0?P:`(${se}(?:(?!${U}${E.dot?j:$}).)*?)`,q=E=>{switch(E){case"*":return`${te}${v}${P}`;case".*":return`${$}${v}${P}`;case"*.*":return`${te}${P}${$}${v}${P}`;case"*/*":return`${te}${P}${x}${v}${pe}${P}`;case"**":return te+ne(s);case"**/*":return`(?:${te}${ne(s)}${x})?${pe}${v}${P}`;case"**/*.*":return`(?:${te}${ne(s)}${x})?${pe}${P}${$}${v}${P}`;case"**/.*":return`(?:${te}${ne(s)}${x})?${$}${v}${P}`;default:{const H=/^(.*?)\.(\w+)$/.exec(E);if(!H)return;const Q=q(H[1]);return Q?Q+$+H[2]:void 0}}},ce=e.removePrefix(h,re);let V=q(ce);return V&&s.strictSlashes!==!0&&(V+=`${x}?`),V},lt=L,lt}var pt,Ht;function eo(){if(Ht)return pt;Ht=1;const t=Zr(),e=Jr(),r=st(),y=ot(),p=a=>a&&typeof a=="object"&&!Array.isArray(a),o=(a,f,l=!1)=>{if(Array.isArray(a)){const K=a.map(W=>o(W,f,l));return W=>{for(const L of K){const h=L(W);if(h)return h}return!1}}const A=p(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!A)throw new TypeError("Expected pattern to be a non-empty string");const g=f||{},T=g.windows,w=A?o.compileRe(a,f):o.makeRe(a,f,!1,!0),b=w.state;delete w.state;let k=()=>!1;if(g.ignore){const K={...f,ignore:null,onMatch:null,onResult:null};k=o(g.ignore,K,l)}const X=(K,W=!1)=>{const{isMatch:L,match:h,output:m}=o.test(K,w,f,{glob:a,posix:T}),s={glob:a,state:b,regex:w,posix:T,input:K,output:m,match:h,isMatch:L};if(typeof g.onResult=="function"&&g.onResult(s),L===!1)return s.isMatch=!1,W?s:!1;e:if(k(K)){if(typeof g.onIgnore=="function"&&g.onIgnore(s)===y.UNIGNORE){s.isMatch=!0;break e}return s.isMatch=!1,W?s:!1}return typeof g.onMatch=="function"&&g.onMatch(s),W?s:!0};return l&&(X.state=b),X};return o.test=(a,f,l,{glob:A,posix:g}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const T=l||{},w=T.format||(g?r.toPosixSlashes:null);let b=a===A,k=b&&w?w(a):a;return b===!1&&(k=w?w(a):a,b=k===A),(b===!1||T.capture===!0)&&(T.matchBase===!0||T.basename===!0?b=o.matchBase(a,f,l,g):b=f.exec(k)),{isMatch:!!b,match:b,output:k}},o.matchBase=(a,f,l,A=l&&l.windows)=>(f instanceof RegExp?f:o.makeRe(f,l)).test(r.basename(a,{windows:A})),o.isMatch=(a,f,l)=>o(f,l)(a),o.parse=(a,f)=>Array.isArray(a)?a.map(l=>o.parse(l,f)):e(a,{...f,fastpaths:!1}),o.scan=(a,f)=>t(a,f),o.compileRe=(a,f,l=!1,A=!1)=>{if(l===!0)return a.output;const g=f||{},T=g.contains?"":"^",w=g.contains?"":"$";let b=`${T}(?:${a.output})${w}`;a&&a.negated===!0&&(b=`^(?!${b}).*$`);const k=o.toRegex(b,f);return A===!0&&(k.state=a),k},o.makeRe=(a,f={},l=!1,A=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-empty string");let g={negated:!1,fastpaths:!0};return f.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(g.output=e.fastpaths(a,f)),g.output||(g=e(a,f)),o.compileRe(g,f,l,A)},o.toRegex=(a,f)=>{try{const l=f||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(f&&f.debug===!0)throw l;return/$^/}},o.constants=y,pt=o,pt}var ct,Mt;function to(){if(Mt)return ct;Mt=1;const t=eo(),e=st();function r(y,p,o=!1){return p&&(p.windows===null||p.windows===void 0)&&(p={...p,windows:e.isWindows()}),t(y,p,o)}return Object.assign(r,t),ct=r,ct}var ro=to();Et(ro);const oo=C(import.meta.url),Le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ze=t=>{if(typeof Le<"u"&&Le.versions&&Le.versions.node){const[e,r]=Le.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Le.getBuiltinModule(t)}return oo(t)};Ze("fs");Ze("fs");Ze("path");Ze("url");const{createRequire:so}=Ze("module");var Bt=so(import.meta.url);try{Bt.resolve("picomatch"),Bt("picomatch")}catch{}var ft,It;function no(){if(It)return ft;It=1;/*!
2
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
3
- *
4
- * Copyright (c) 2014-2016, Jon Schlinkert.
5
- * Licensed under the MIT License.
6
- */return ft=function(t){if(typeof t!="string"||t==="")return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1},ft}var dt,Dt;function Wt(){if(Dt)return dt;Dt=1;/*!
7
- * is-glob <https://github.com/jonschlinkert/is-glob>
8
- *
9
- * Copyright (c) 2014-2017, Jon Schlinkert.
10
- * Released under the MIT License.
11
- */var t=no(),e={"{":"}","(":")","[":"]"},r=function(p){if(p[0]==="!")return!0;for(var o=0,a=-2,f=-2,l=-2,A=-2,g=-2;o<p.length;){if(p[o]==="*"||p[o+1]==="?"&&/[\].+)]/.test(p[o])||f!==-1&&p[o]==="["&&p[o+1]!=="]"&&(f<o&&(f=p.indexOf("]",o)),f>o&&(g===-1||g>f||(g=p.indexOf("\\",o),g===-1||g>f)))||l!==-1&&p[o]==="{"&&p[o+1]!=="}"&&(l=p.indexOf("}",o),l>o&&(g=p.indexOf("\\",o),g===-1||g>l))||A!==-1&&p[o]==="("&&p[o+1]==="?"&&/[:!=]/.test(p[o+2])&&p[o+3]!==")"&&(A=p.indexOf(")",o),A>o&&(g=p.indexOf("\\",o),g===-1||g>A))||a!==-1&&p[o]==="("&&p[o+1]!=="|"&&(a<o&&(a=p.indexOf("|",o)),a!==-1&&p[a+1]!==")"&&(A=p.indexOf(")",a),A>a&&(g=p.indexOf("\\",a),g===-1||g>A))))return!0;if(p[o]==="\\"){var T=p[o+1];o+=2;var w=e[T];if(w){var b=p.indexOf(w,o);b!==-1&&(o=b+1)}if(p[o]==="!")return!0}else o++}return!1},y=function(p){if(p[0]==="!")return!0;for(var o=0;o<p.length;){if(/[*?{}()[\]]/.test(p[o]))return!0;if(p[o]==="\\"){var a=p[o+1];o+=2;var f=e[a];if(f){var l=p.indexOf(f,o);l!==-1&&(o=l+1)}if(p[o]==="!")return!0}else o++}return!1};return dt=function(p,o){if(typeof p!="string"||p==="")return!1;if(t(p))return!0;var a=r;return o&&o.strict===!1&&(a=y),a(p)},dt}const io=C(import.meta.url),He=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jt=t=>{if(typeof He<"u"&&He.versions&&He.versions.node){const[e,r]=He.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return He.getBuiltinModule(t)}return io(t)},uo=jt("path"),ao=jt("os");var gt,Pt;function lo(){if(Pt)return gt;Pt=1;var t=Wt(),e=uo.posix.dirname,r=ao.platform()==="win32",y="/",p=/\\/g,o=/\\([!*?|[\](){}])/g;gt=function(l,A){var g=Object.assign({flipBackslashes:!0},A);g.flipBackslashes&&r&&l.indexOf(y)<0&&(l=l.replace(p,y)),a(l)&&(l+=y),l+="a";do l=e(l);while(f(l));return l.replace(o,"$1")};function a(l){var A=l.slice(-1),g;switch(A){case"}":g="{";break;case"]":g="[";break;default:return!1}var T=l.indexOf(g);return T<0?!1:l.slice(T+1,-1).includes(y)}function f(l){return/\([^()]+$/.test(l)||l[0]==="{"||l[0]==="["||/[^\\][{[]/.test(l)?!0:t(l)}return gt}var po=lo();Et(po);const co=C(import.meta.url),Me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fo=t=>{if(typeof Me<"u"&&Me.versions&&Me.versions.node){const[e,r]=Me.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Me.getBuiltinModule(t)}return co(t)},{access:go}=fo("node:fs/promises");async function vt(t,e=Xt){he(t),t=ye(t);try{return await go(t,e),!0}catch{return!1}}const ho=C(import.meta.url),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mo=t=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[e,r]=Be.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Be.getBuiltinModule(t)}return ho(t)};mo("node:fs");var yo=Wt();Et(yo);const bo=C(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qt=t=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[e,r]=me.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return me.getBuiltinModule(t)}return bo(t)},{cwd:$o}=me,{mkdir:vo,rename:Eo,copyFile:Ao,unlink:Ro}=Qt("node:fs/promises");Qt("node:fs");class To extends Error{constructor(e,r){super(`Source directory "${ge(e)}" does not match destination directory "${ge(r)}"`),this.name="SameDirectoryError"}}const xo=(t,e)=>{if(!t||!e)throw new Error("Source and destination paths must not be empty");if(ge(t)!==ge(e))throw new To(t,e)},wo=async(t,e,{cwd:r,directoryMode:y,overwrite:p,validateDirectory:o})=>{if(r&&(t=mt(r,t),e=mt(r,e)),o&&xo(t,e),!p&&await vt(e))throw new Error(`The destination file exists: ${e}`);await vo(ge(e),{mode:y,recursive:!0});try{await Eo(t,e)}catch(a){if(a.code==="EXDEV")await Ao(t,e),await Ro(t);else throw a}},Is=async(t,e,r={})=>{const y={overwrite:!0,validateDirectory:!1,...r,cwd:r.cwd?ye(r.cwd):$o()};await wo(t,e,y)};let _o=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}},So=class extends Error{constructor(e){super(`EPERM: Operation not permitted, ${e}`)}get code(){return"EPERM"}set code(e){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(e){throw new Error("Cannot overwrite name of PermissionError")}};const Co=(t,e)=>{const r=t?.code;return r==="ENOENT"?new _o(`no such file or directory, open '${e}'`):r==="EACCES"||r==="EPERM"?new So(`unable to read the non-readable file: ${e}`):t},ko=C(import.meta.url),Ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qt=t=>{if(typeof Ie<"u"&&Ie.versions&&Ie.versions.node){const[e,r]=Ie.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ie.getBuiltinModule(t)}return ko(t)},{readFile:Oo}=qt("node:fs/promises"),{unzip:No,brotliDecompress:Lo}=qt("node:zlib"),Ho={brotli:Lo,gzip:No,none:(t,e)=>{e(null,t)}},Mo=async(t,e)=>{he(t),t=ye(t);const{buffer:r,compression:y,encoding:p,flag:o}=e??{};let a;try{a=await Oo(t,o?{flag:o}:{})}catch(f){throw Co(f,t)}return await new Promise((f,l)=>{Ho[y??"none"](a,(A,g)=>{A?l(A):f(r?g:g.toString(p??"utf8"))})})},Bo=C(import.meta.url),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vt=t=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[e,r]=De.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return De.getBuiltinModule(t)}return Bo(t)};Vt("node:fs");Vt("node:zlib");const Io=C(import.meta.url),Pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Do=t=>{if(typeof Pe<"u"&&Pe.versions&&Pe.versions.node){const[e,r]=Pe.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Pe.getBuiltinModule(t)}return Io(t)},{createRequire:Yt}=Do("node:module"),Po=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&Po.set("AggregateError",AggregateError);const Fo=Yt(import.meta.url),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Go=t=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[e,r]=Fe.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Fe.getBuiltinModule(t)}return Fo(t)};Go("node:util");const Uo=Yt(import.meta.url),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,At=t=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[e,r]=Ge.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ge.getBuiltinModule(t)}return Uo(t)};At("node:fs");At("node:path");At("node:url");const Xo=t=>{const e={force:!0,recursive:!0};return t?.maxRetries!==void 0&&(e.maxRetries=t.maxRetries),t?.retryDelay!==void 0&&(e.retryDelay=t.retryDelay),e},zo=C(import.meta.url),Ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zt=t=>{if(typeof Ue<"u"&&Ue.versions&&Ue.versions.node){const[e,r]=Ue.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ue.getBuiltinModule(t)}return zo(t)};Zt("node:fs");Zt("node:fs/promises");const Ko=C(import.meta.url),Xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wo=t=>{if(typeof Xe<"u"&&Xe.versions&&Xe.versions.node){const[e,r]=Xe.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Xe.getBuiltinModule(t)}return Ko(t)};Wo("node:fs");const jo=C(import.meta.url),ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qo=t=>{if(typeof ze<"u"&&ze.versions&&ze.versions.node){const[e,r]=ze.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ze.getBuiltinModule(t)}return jo(t)},{rm:qo}=Qo("node:fs/promises"),Vo=async(t,e={})=>{he(t),await qo(t,Xo(e))},Yo=C(import.meta.url),Ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zo=t=>{if(typeof Ke<"u"&&Ke.versions&&Ke.versions.node){const[e,r]=Ke.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ke.getBuiltinModule(t)}return Yo(t)};Zo("node:fs");C(import.meta.url);const Jo=t=>{if(typeof t!="string"&&!(t instanceof ArrayBuffer)&&!ArrayBuffer.isView(t))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},es=C(import.meta.url),We=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ts=t=>{if(typeof We<"u"&&We.versions&&We.versions.node){const[e,r]=We.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return We.getBuiltinModule(t)}return es(t)},{randomBytes:rs}=ts("node:crypto"),os=t=>`${t}.${process.pid.toString(36)}.${rs(6).toString("hex")}.tmp`,ss=new TextEncoder,ns=t=>{if(t instanceof Uint8Array)return t;if(typeof t=="string")return ss.encode(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t)){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(e)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},is=C(import.meta.url),je=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,us=t=>{if(typeof je<"u"&&je.versions&&je.versions.node){const[e,r]=je.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return je.getBuiltinModule(t)}return is(t)},{mkdir:as,writeFile:ls,stat:ps,rename:Ft,chown:cs,chmod:fs,unlink:ds}=us("node:fs/promises"),gs=async(t,e,r)=>{r={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},he(t),Jo(e),t=ye(t);const y=await vt(t,Xt);if(y&&!r.overwrite)throw new hr(`file already exists, open '${t}'`);const p=os(t);try{!y&&r.recursive&&await as(ge(t),{recursive:!0});let o;if(await ls(p,typeof e=="string"?Buffer.from(e,r.encoding??"utf8"):ns(e),{flag:"wx"}),y&&r.backup&&(o=await ps(t),r.chown??={gid:o.gid,uid:o.uid},await Ft(t,`${t}.bak`)),r.chown)try{await cs(p,r.chown.uid,r.chown.gid)}catch{}await fs(p,o&&!r.mode?o.mode:r.mode??438),await Ft(p,t)}catch(o){throw new Error(`Failed to write file at: ${t} - ${o.message}`,{cause:o})}finally{await vt(p)&&await ds(p)}},hs=C(import.meta.url),Qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ms=t=>{if(typeof Qe<"u"&&Qe.versions&&Qe.versions.node){const[e,r]=Qe.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Qe.getBuiltinModule(t)}return hs(t)};ms("node:fs");const ys=C(import.meta.url),qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bs=t=>{if(typeof qe<"u"&&qe.versions&&qe.versions.node){const[e,r]=qe.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return qe.getBuiltinModule(t)}return ys(t)};bs("node:fs/promises");const $s=C(import.meta.url),Ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vs=t=>{if(typeof Ve<"u"&&Ve.versions&&Ve.versions.node){const[e,r]=Ve.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ve.getBuiltinModule(t)}return $s(t)};vs("node:fs");const Es=C(import.meta.url),Ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rt=t=>{if(typeof Ye<"u"&&Ye.versions&&Ye.versions.node){const[e,r]=Ye.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ye.getBuiltinModule(t)}return Es(t)},As=Rt("fs"),Rs=Rt("os"),Ts=Rt("path");var ht={},Gt;function xs(){if(Gt)return ht;Gt=1;var t=Object.defineProperty,e=(g,T)=>t(g,"name",{value:T,configurable:!0}),r=As,y=Rs,p=Ts;const o=e(g=>{let T="";for(let w=0;w<g.length;w+=1){const b=g[w],k=b.toUpperCase();T+=b===k?b.toLowerCase():k}return T},"invertCase"),a=new Map,f=e((g,T)=>{const w=p.join(g,`.is-fs-case-sensitive-test-${process.pid}`);try{return T.writeFileSync(w,""),!T.existsSync(o(w))}finally{try{T.unlinkSync(w)}catch{}}},"checkDirectoryCaseWithWrite"),l=e((g,T,w)=>{try{return f(g,w)}catch(b){if(T===void 0)return f(y.tmpdir(),w);throw b}},"checkDirectoryCaseWithFallback"),A=e((g,T=r,w=!0)=>{const b=g??process.cwd();if(w&&a.has(b))return a.get(b);let k;const X=o(b);return X!==b&&T.existsSync(b)?k=!T.existsSync(X):k=l(b,g,T),w&&a.set(b,k),k},"isFsCaseSensitive");return ht.isFsCaseSensitive=A,ht}xs();class Fs extends nr{directory;constructor(e){super(e),this.directory=yt(e?.directory||Ut(rr(),"Upload_meta")),this.accessCheck().catch(r=>{this.logger?.error("Metadata storage access check failed: %O",r)})}getMetaPath=e=>{const r=yt(`${this.directory}/${this.prefix}${e}${this.suffix}`),y=this.directory.endsWith("/")?this.directory:`${this.directory}/`;return r.startsWith(y)?r:nt(it.INVALID_FILE_NAME,`Invalid id: "${e}" resolves outside the meta directory`)};getIdFromPath=e=>e.slice(`${this.directory}/${this.prefix}`.length,-this.suffix.length);async save(e,r){await this.accessCheck();const y={...r};return y.metadata&&(y.metadata=ir(r.metadata)),await gs(this.getMetaPath(e),JSON.stringify(y),{recursive:!0}),r}async touch(e,r){const y=new Date;return await tr(this.getMetaPath(e),y,y),r}async get(e){try{const r=await Mo(this.getMetaPath(e));if(r===void 0)throw nt(it.FILE_NOT_FOUND);const y=JSON.parse(r);return y.metadata&&typeof y.metadata=="string"&&(y.metadata=ur(y.metadata)),y}catch(r){const y=r,p=r instanceof SyntaxError;throw y.code==="ENOENT"||p?nt(it.FILE_NOT_FOUND):r}}async delete(e){await Vo(this.getMetaPath(e))}async accessCheck(){await zt(this.directory)}}export{Is as V,Hs as d,zt as f,Vo as l,Kr as x,Fs as y,Mo as z};
@@ -1,331 +0,0 @@
1
- import { F as File, g as FileReturn, B as BaseStorage } from "./storage.d-CEM1upWM.js";
2
- import { M as MediaTransformerConfig, a as MediaTransformResult } from "./types.d-CrUWY4On.js";
3
- /**
4
- * Unified media transformer that automatically detects media type and routes to appropriate transformer.
5
- * @template TFile The file type used by this transformer.
6
- * @template TFileReturn The return type for file retrieval operations.
7
- *
8
- * Supports transformations via query parameters for on-demand media processing across all supported formats.
9
- * @example
10
- * // eslint-disable-next-line jsdoc/match-description
11
- * ```ts
12
- * const transformer = new MediaTransformer(storage, {
13
- * maxImageSize: 10 * 1024 * 1024, // 10MB
14
- * maxVideoSize: 100 * 1024 * 1024, // 100MB
15
- * maxAudioSize: 50 * 1024 * 1024, // 50MB
16
- * cache: new MapCache(), // In-memory caching
17
- * saveTransformedFiles: true // Persist transformed files to storage
18
- * });
19
- *
20
- * // Handle transformation via query parameters
21
- * const result = await transformer.handle('file-id', {
22
- * width: 800,
23
- * height: 600,
24
- * fit: 'cover',
25
- * format: 'webp',
26
- * quality: 80
27
- * });
28
- *
29
- * // Fetch with URL query string
30
- * const result = await transformer.fetch('file-id', 'width=1280&height=720&codec=avc&bitrate=2000000');
31
- *
32
- * // Clear all cached transformed files
33
- * transformer.clearSavedTransformedFiles();
34
- * ```
35
- *
36
- * ## Configuration Options
37
- *
38
- * - `saveTransformedFiles`: Persist transformed files to storage for reuse (default: false)
39
- * - `cache`: Cache instance for in-memory caching (optional)
40
- * - `maxImageSize/maxVideoSize/maxAudioSize`: Size limits for processing
41
- * - `cacheTtl`: Cache time-to-live in seconds
42
- *
43
- * ## Supported Query Parameters
44
- *
45
- * ### Common Parameters
46
- * - `format`: Output format (jpeg/png/webp/avif/mp4/webm/mkv/mp3/wav/ogg/aac/flac)
47
- * - `quality`: Quality for images (0-100), bitrate for video/audio
48
- *
49
- * ### Image Parameters
50
- * - `width`: Width in pixels
51
- * - `height`: Height in pixels
52
- * - `fit`: Resize fit mode - cover/contain/fill/inside/outside
53
- * - `position`: Position for cover/contain fits
54
- * - `withoutEnlargement`: Avoid enlarging smaller images (boolean)
55
- * - `withoutReduction`: Avoid reducing larger images (boolean)
56
- * - `kernel`: Resize kernel - nearest/cubic/mitchell/lanczos2/lanczos3
57
- * - `fastShrinkOnLoad`: Fast shrink on load (boolean)
58
- * - `left/top/cropWidth/cropHeight`: Crop parameters
59
- * - `angle`: Rotation angle in degrees (any number, but angles other than 90°/180°/270° use interpolation and may affect quality)
60
- * - `background`: Background color for rotation
61
- * - `blur`: Apply blur effect (boolean)
62
- * - `sharpen`: Apply sharpening (boolean)
63
- * - `median`: Apply median filter with size (number)
64
- * // eslint-disable-next-line jsdoc/match-description
65
- * - `clahe`: Apply CLAHE (Contrast Limited Adaptive Histogram Equalization) (boolean)
66
- * - `threshold`: Apply thresholding with value (0-255)
67
- * - `gamma`: Apply gamma correction (boolean)
68
- * - `negate`: Negate (invert) the image (boolean)
69
- * - `normalise/normalize`: Normalise the image (boolean)
70
- * - `flatten`: Flatten alpha channel (boolean)
71
- * - `unflatten`: Unflatten alpha channel (boolean)
72
- * - `flip`: Flip image vertically (boolean)
73
- * - `flop`: Flop image horizontally (boolean)
74
- * - `greyscale/grayscale`: Convert to greyscale (boolean)
75
- * - `modulate`: Apply modulation effects (boolean)
76
- * - `brightness`: Brightness multiplier for modulation (number)
77
- * - `saturation`: Saturation multiplier for modulation (number)
78
- * - `hue`: Hue rotation in degrees for modulation (number)
79
- * // eslint-disable-next-line jsdoc/match-description
80
- * - `lightness`: Lightness adjustment for modulation (number)
81
- * - `tint`: Apply tinting (boolean)
82
- * - `colourspace`: Convert colourspace - srgb/rgb/cmyk/lab/b-w
83
- *
84
- * ### Video Parameters
85
- * - `width/height/fit`: Same as images
86
- * - `codec`: Video codec - avc/hevc/vp8/vp9/av1
87
- * - `bitrate`: Video bitrate in bits per second
88
- * - `frameRate`: Frame rate in Hz
89
- * - `keyFrameInterval`: Key frame interval in seconds
90
- * - `angle`: Rotation angle in degrees (any number, but angles other than 90°/180°/270° use interpolation and may affect quality)
91
- * - `background`: Background color for rotation
92
- *
93
- * ### Audio Parameters
94
- * - `sampleRate`: Sample rate in Hz
95
- * - `numberOfChannels`: Number of channels
96
- * - `codec`: Audio codec - aac/opus/mp3/vorbis/flac
97
- * - `bitrate`: Audio bitrate in bits per second
98
- *
99
- * ## File Persistence
100
- *
101
- * When `saveTransformedFiles` is enabled, transformed files are automatically saved to storage
102
- * with deterministic IDs based on the original file and transformation parameters. Subsequent
103
- * requests for the same transformation will serve the cached file directly, improving performance
104
- * and reducing processing costs.
105
- */
106
- declare class MediaTransformer<TFile extends File = File, TFileReturn extends FileReturn = FileReturn> {
107
- private readonly storage;
108
- private readonly imageTransformer?;
109
- private readonly videoTransformer?;
110
- private readonly audioTransformer?;
111
- private readonly config;
112
- private readonly logger;
113
- /**
114
- * Creates a new MediaTransformer instance.
115
- * @param storage The storage backend for retrieving and storing media files.
116
- * @param config Configuration options for the media transformer including transformer classes and settings.
117
- * @throws Error if no transformer classes are provided in the configuration.
118
- */
119
- constructor(storage: BaseStorage<TFile, TFileReturn>, config?: MediaTransformerConfig<TFile, TFileReturn>);
120
- supportedFormats(): string[];
121
- /**
122
- * Handles media transformation based on query parameters.
123
- * @param fileId File identifier.
124
- * @param query Query parameters for transformation.
125
- * @returns Unified transformation result.
126
- */
127
- handle(fileId: string, query: Record<string, string | undefined> | URLSearchParams | string): Promise<MediaTransformResult>;
128
- /**
129
- * Fetches media transformation with URL query string support.
130
- * @param fileId File identifier.
131
- * @param queryString URL query string (e.g., "width=800&amp;height=600&amp;format=webp").
132
- * @returns Unified transformation result.
133
- */
134
- fetch(fileId: string, queryString: string): Promise<MediaTransformResult>;
135
- /**
136
- * Clears cache for a specific file across all transformers.
137
- * @param fileId Optional file identifier to clear cache for. If omitted, clears all cache.
138
- */
139
- clearCache(fileId?: string): void;
140
- /**
141
- * Clears all saved transformed files from storage.
142
- * @remarks This is a maintenance operation and may take time for large numbers of files.
143
- */
144
- clearSavedTransformedFiles(): Promise<void>;
145
- /**
146
- * Clears saved transformed files for a specific original file.
147
- * @param originalFileId Original file identifier to clear transformed files for.
148
- */
149
- clearSavedTransformedFilesForFile(originalFileId: string): Promise<void>;
150
- /**
151
- * Gets cache statistics (combined from all transformers).
152
- * @returns Cache statistics for audio, image, and video transformers.
153
- */
154
- getCacheStats(): {
155
- audio?: {
156
- maxSize: number;
157
- size: number;
158
- };
159
- image?: {
160
- maxSize: number;
161
- size: number;
162
- };
163
- video?: {
164
- maxSize: number;
165
- size: number;
166
- };
167
- };
168
- /**
169
- * Validates query parameters for the given media type.
170
- * @param query The query parameters to validate.
171
- * @param mediaType The media type being validated ('image', 'video', or 'audio').
172
- * @throws {ValidationError} When invalid parameters are provided.
173
- */
174
- private validateQueryParameters;
175
- /**
176
- * Validates query parameters for image transformations. Checks for invalid video/audio-only parameters, invalid fit values, invalid rotation angles, invalid formats, and incomplete crop parameter sets.
177
- * @param query Query parameters to validate.
178
- * @throws {ValidationError} When validation fails.
179
- */
180
- private validateImageQueryParameters;
181
- /**
182
- * Validates query parameters for video transformations. Checks for invalid audio-only parameters, invalid fit values, invalid rotation angles, invalid codecs, invalid formats, incomplete crop parameter sets, and invalid numeric values.
183
- * @param query Query parameters to validate.
184
- * @throws {ValidationError} When validation fails.
185
- */
186
- private validateVideoQueryParameters;
187
- /**
188
- * Generates a unique ID for transformed files based on original file and transformations.
189
- * @param originalFileId The original file identifier.
190
- * @param query The transformation query parameters.
191
- * @param mediaType The media type (image, video, audio).
192
- * @returns Unique deterministic identifier for the transformed file.
193
- * @private
194
- */
195
- private generateTransformedFileId;
196
- /**
197
- * Checks if the query contains any transformations.
198
- * @param query The transformation query parameters.
199
- * @returns True if any transformations are requested.
200
- * @private
201
- */
202
- private hasTransformations;
203
- /**
204
- * Creates a MediaTransformResult from a stored transformed file.
205
- * @param storedFile The stored transformed file.
206
- * @param mediaType The media type (image, video, audio).
207
- * @param originalFile The original file information.
208
- * @returns Media transformation result with metadata.
209
- * @private
210
- */
211
- private createMediaTransformResult;
212
- /**
213
- * Extracts format from content type.
214
- * @param contentType MIME content type string.
215
- * @returns Format string extracted from content type.
216
- * @private
217
- */
218
- private getFormatFromContentType;
219
- /**
220
- * Saves transformed file to storage.
221
- * @param result The transformation result to save.
222
- * @param originalFileId The original file identifier.
223
- * @param query The transformation query parameters.
224
- * @param mediaType The media type (image, video, audio).
225
- * @returns Promise that resolves when file is saved.
226
- * @private
227
- */
228
- private saveTransformedFile;
229
- /**
230
- * Validates query parameters for audio transformations. Checks for invalid video-only parameters, invalid codecs, invalid formats, and invalid numeric values.
231
- * @param query Query parameters to validate.
232
- * @throws {ValidationError} When validation fails.
233
- */
234
- private validateAudioQueryParameters;
235
- /**
236
- * Handles image transformation.
237
- * @param fileId The file identifier.
238
- * @param query The transformation query parameters.
239
- * @returns Promise resolving to media transformation result.
240
- * @private
241
- */
242
- private handleImageTransformation;
243
- /**
244
- * Handles video transformation.
245
- * @param fileId The file identifier.
246
- * @param query The transformation query parameters.
247
- * @returns Promise resolving to media transformation result.
248
- * @private
249
- */
250
- private handleVideoTransformation;
251
- /**
252
- * Handles audio transformation.
253
- * @param fileId The file identifier.
254
- * @param query The transformation query parameters.
255
- * @returns Promise resolving to media transformation result.
256
- * @private
257
- */
258
- private handleAudioTransformation;
259
- /**
260
- * Parses query parameters from various input formats.
261
- * @param query Query parameters in various formats.
262
- * @returns Normalized MediaTransformQuery object.
263
- * @private
264
- */
265
- private parseQuery;
266
- /**
267
- * Parses boolean parameter from string.
268
- * @param value String value to parse.
269
- * @returns Boolean value or undefined.
270
- * @private
271
- */
272
- private parseBooleanParameter;
273
- /**
274
- * Parses URLSearchParams into MediaTransformQuery.
275
- * @param parameters URL search parameters object.
276
- * @returns MediaTransformQuery object with parsed parameters.
277
- * @private
278
- */
279
- private parseURLSearchParams;
280
- /**
281
- * Detects media type from MIME type.
282
- * @param contentType MIME content type string.
283
- * @returns Detected media type.
284
- * @throws Error if content type is missing or unsupported.
285
- * @private
286
- */
287
- private detectMediaType;
288
- /**
289
- * Checks if query has image transformations.
290
- * @param query The transformation query parameters.
291
- * @returns True if image transformations are requested.
292
- * @private
293
- */
294
- private hasImageTransformations;
295
- /**
296
- * Checks if query has video transformations.
297
- * @param query The transformation query parameters.
298
- * @returns True if video transformations are requested.
299
- * @private
300
- */
301
- private hasVideoTransformations;
302
- /**
303
- * Checks if query has audio transformations.
304
- * @param query The transformation query parameters.
305
- * @returns True if audio transformations are requested.
306
- * @private
307
- */
308
- private hasAudioTransformations;
309
- /**
310
- * Converts ImageTransformer result to unified format.
311
- * @param result The image transformation result.
312
- * @returns Unified media transformation result.
313
- * @private
314
- */
315
- private convertImageResult;
316
- /**
317
- * Converts VideoTransformer result to unified format.
318
- * @param result The video transformation result.
319
- * @returns Unified media transformation result.
320
- * @private
321
- */
322
- private convertVideoResult;
323
- /**
324
- * Converts AudioTransformer result to unified format.
325
- * @param result The audio transformation result.
326
- * @returns Unified media transformation result.
327
- * @private
328
- */
329
- private convertAudioResult;
330
- }
331
- export { MediaTransformer as M };