@beyondwork/wb-cli 0.1.50 → 0.1.51
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/CHANGELOG.md +5 -0
- package/out/cli.js +350 -160
- package/out/extension.js +3 -3
- package/package.json +1 -1
package/out/extension.js
CHANGED
|
@@ -149,7 +149,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
149
149
|
`).map(e=>e.trim()).join(" ")};Db.O=function(s){return this.inspectOpts.colors=this.useColors,ra.inspect(s,this.inspectOpts)}});var qb=E((cD,kd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?kd.exports=Cb():kd.exports=Pb()});var ys,xd,Fb,Mb,Lb,Bb=B(()=>{wn();ys={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},xd={get(s){return{signature:j.get(s,0),compressedSize:j.get(s,8),uncompressedSize:j.get(s,12)}},len:16},Fb={get(s){let e=z.get(s,6);return{signature:j.get(s,0),minVersion:z.get(s,4),dataDescriptor:!!(e&8),compressedMethod:z.get(s,8),compressedSize:j.get(s,18),uncompressedSize:j.get(s,22),filenameLength:z.get(s,26),extraFieldLength:z.get(s,28),filename:null}},len:30},Mb={get(s){return{signature:j.get(s,0),nrOfThisDisk:z.get(s,4),nrOfThisDiskWithTheStart:z.get(s,6),nrOfEntriesOnThisDisk:z.get(s,8),nrOfEntriesOfSize:z.get(s,10),sizeOfCd:j.get(s,12),offsetOfStartOfCd:j.get(s,16),zipFileCommentLength:z.get(s,20)}},len:22},Lb={get(s){let e=z.get(s,8);return{signature:j.get(s,0),minVersion:z.get(s,6),dataDescriptor:!!(e&8),compressedMethod:z.get(s,10),compressedSize:j.get(s,20),uncompressedSize:j.get(s,24),filenameLength:z.get(s,28),extraFieldLength:z.get(s,30),fileCommentLength:z.get(s,32),relativeOffsetOfLocalHeader:j.get(s,42),filename:null}},len:46}});function $b(s){let e=new Uint8Array(j.len);return j.put(e,0,s),e}function UE(s,e){let t=s.length,i=e.length;if(i>t)return-1;for(let n=0;n<=t-i;n++){let r=!0;for(let o=0;o<i;o++)if(s[n+o]!==e[o]){r=!1;break}if(r)return n}return-1}function VE(s){let e=s.reduce((n,r)=>n+r.length,0),t=new Uint8Array(e),i=0;for(let n of s)t.set(n,i),i+=n.length;return t}var Wb,tt,_d,zE,aa,vs,jb=B(()=>{wn();Wb=F(qb(),1);Bb();tt=(0,Wb.default)("tokenizer:inflate"),_d=256*1024,zE=$b(ys.DataDescriptor),aa=$b(ys.EndOfCentralDirectory),vs=class s{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(_d)}async isZip(){return await this.peekSignature()===ys.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(j)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),i=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(i,{position:e.fileInfo.size-t});for(let n=i.length-4;n>=0;n--)if(i[n]===aa[0]&&i[n+1]===aa[1]&&i[n+2]===aa[2]&&i[n+3]===aa[3])return e.fileInfo.size-t+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){tt("Cannot reading central-directory without random-read support");return}tt("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){tt("Central-directory 32-bit signature found");let i=await this.tokenizer.readToken(Mb,t),n=[];this.tokenizer.setPosition(i.offsetOfStartOfCd);for(let r=0;r<i.nrOfEntriesOfSize;++r){let o=await this.tokenizer.readToken(Lb);if(o.signature!==ys.CentralFileHeader)throw new Error("Expected Central-File-Header signature");o.filename=await this.tokenizer.readToken(new ke(o.filenameLength,"utf-8")),await this.tokenizer.ignore(o.extraFieldLength),await this.tokenizer.ignore(o.fileCommentLength),n.push(o),tt(`Add central-directory file-entry: n=${r+1}/${n.length}: filename=${n[r].filename}`)}return this.tokenizer.setPosition(e),n}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let i=!1;do{let n=await this.readLocalFileHeader();if(!n)break;let r=e(n);i=!!r.stop;let o;if(await this.tokenizer.ignore(n.extraFieldLength),n.dataDescriptor&&n.compressedSize===0){let a=[],c=_d;tt("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let u=-1;for(;u<0&&c===_d;){c=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),u=UE(this.syncBuffer.subarray(0,c),zE);let l=u>=0?u:c;if(r.handler){let d=new Uint8Array(l);await this.tokenizer.readBuffer(d),a.push(d)}else await this.tokenizer.ignore(l)}tt(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),r.handler&&await this.inflate(n,VE(a),r.handler)}else r.handler?(tt(`Reading compressed-file-data: ${n.compressedSize} bytes`),o=new Uint8Array(n.compressedSize),await this.tokenizer.readBuffer(o),await this.inflate(n,o,r.handler)):(tt(`Ignoring compressed-file-data: ${n.compressedSize} bytes`),await this.tokenizer.ignore(n.compressedSize));if(tt(`Reading data-descriptor at pos=${this.tokenizer.position}`),n.dataDescriptor&&(await this.tokenizer.readToken(xd)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-xd.len}`)}while(!i)}async iterateOverCentralDirectory(e,t){for(let i of e){let n=t(i);if(n.handler){this.tokenizer.setPosition(i.relativeOffsetOfLocalHeader);let r=await this.readLocalFileHeader();if(r){await this.tokenizer.ignore(r.extraFieldLength);let o=new Uint8Array(i.compressedSize);await this.tokenizer.readBuffer(o),await this.inflate(r,o,n.handler)}}if(n.stop)break}}async inflate(e,t,i){if(e.compressedMethod===0)return i(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);tt(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let n=await s.decompressDeflateRaw(t);return i(n)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(r){r.enqueue(e),r.close()}}),i=new DecompressionStream("deflate-raw"),n=t.pipeThrough(i);try{let o=await new Response(n).arrayBuffer();return new Uint8Array(o)}catch(r){let o=r instanceof Error?`Failed to deflate ZIP entry: ${r.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(o)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(j);if(e===ys.LocalFileHeader){let t=await this.tokenizer.readToken(Fb);return t.filename=await this.tokenizer.readToken(new ke(t.filenameLength,"utf-8")),t}if(e===ys.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var yn,zb=B(()=>{yn=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let i=new Uint8Array(1024),n=await e.readBuffer(i,{mayBeLess:!0});if(n===0){t.close();return}t.enqueue(i.subarray(0,n))}}).pipeThrough(new DecompressionStream("gzip"))}}});var Ub=B(()=>{jb();zb()});function wd(s){let{byteLength:e}=s;if(e===6)return s.getUint16(0)*2**32+s.getUint32(2);if(e===5)return s.getUint8(0)*2**32+s.getUint32(1);if(e===4)return s.getUint32(0);if(e===3)return s.getUint8(0)*2**16+s.getUint16(1);if(e===2)return s.getUint16(0);if(e===1)return s.getUint8(0)}var kD,xD,_D,Vb=B(()=>{kD={utf8:new globalThis.TextDecoder("utf8")},xD=new globalThis.TextEncoder,_D=Array.from({length:256},(s,e)=>e.toString(16).padStart(2,"0"))});function Hb(s,e){if(e==="utf-16le"){let t=[];for(let i=0;i<s.length;i++){let n=s.charCodeAt(i);t.push(n&255,n>>8&255)}return t}if(e==="utf-16be"){let t=[];for(let i=0;i<s.length;i++){let n=s.charCodeAt(i);t.push(n>>8&255,n&255)}return t}return[...s].map(t=>t.charCodeAt(0))}function Gb(s,e=0){let t=Number.parseInt(new ke(6).get(s,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let i=256;for(let n=e;n<e+148;n++)i+=s[n];for(let n=e+156;n<e+512;n++)i+=s[n];return t===i}var Kb,Jb=B(()=>{wn();Kb={get:(s,e)=>s[e+3]&127|s[e+2]<<7|s[e+1]<<14|s[e]<<21,len:4}});var Yb,Zb,Qb=B(()=>{Yb=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],Zb=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function rC(s){let e=s?.streamReader;if(e?.constructor?.name!=="WebStreamByobReader")return s;let{reader:t}=e,i=async()=>{await t.cancel(),t.releaseLock()};return e.close=i,e.abort=async()=>{e.interrupted=!0,await i()},s}function Sd(s,e,t){if(!Number.isFinite(s)||s<0||s>e)throw new bt(`${t} has invalid size ${s} (maximum ${e} bytes)`);return s}async function $t(s,e,{maximumLength:t=De,reason:i="skip"}={}){let n=Sd(e,t,i);await s.ignore(n)}async function vd(s,e,t,{maximumLength:i=e.length,reason:n="read"}={}){let r=t?.length??e.length,o=Sd(r,i,n);return s.readBuffer(e,{...t,length:o})}async function oC(s,{maximumLength:e=it}={}){let n=new ReadableStream({start(u){u.enqueue(s),u.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),r=[],o=0;try{for(;;){let{done:u,value:l}=await n.read();if(u)break;if(o+=l.length,o>e)throw await n.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);r.push(l)}}finally{n.releaseLock()}let a=new Uint8Array(o),c=0;for(let u of r)a.set(u,c),c+=u.length;return a}function cC(s,e){if(s.length<ca)return-1;let t=s.length-ca;for(let i=0;i<=t;i++)if(j.get(s,i)===dk&&j.get(s,i+8)===e+i)return i;return-1}function uC(s){return(s.codePointAt(0)&32)!==0}function lC(s,e){let t=new Uint8Array(e),i=0;for(let n of s)t.set(n,i),i+=n.length;return t}async function dC(s,{shouldBuffer:e,maximumLength:t=it}={}){let{syncBuffer:i}=s,{length:n}=i,r=[],o=0;for(;;){let a=await s.tokenizer.peekBuffer(i,{mayBeLess:!0}),c=cC(i.subarray(0,a),o),u=c>=0?0:a===n?Math.min(aC,a-1):0,l=c>=0?c:a-u;if(l===0)break;if(o+=l,o>t)throw new Error(`ZIP entry compressed data exceeds ${t} bytes`);if(e){let d=new Uint8Array(l);await s.tokenizer.readBuffer(d),r.push(d)}else await s.tokenizer.ignore(l);if(c>=0)break}if(de(s.tokenizer)||(s.knownSizeDescriptorScannedBytes+=o),!!e)return lC(r,o)}function pC(s,e){return de(s.tokenizer)?Math.max(0,De-(s.tokenizer.position-e)):Math.max(0,it-s.knownSizeDescriptorScannedBytes)}async function hC(s,e,{shouldBuffer:t,maximumDescriptorLength:i=it}={}){if(e.dataDescriptor&&e.compressedSize===0)return dC(s,{shouldBuffer:t,maximumLength:i});if(!t){await $t(s.tokenizer,e.compressedSize,{maximumLength:de(s.tokenizer)?it:s.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let n=kC(s.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>n)throw new Error(`ZIP entry compressed data exceeds ${n} bytes`);let r=new Uint8Array(e.compressedSize);return await s.tokenizer.readBuffer(r),r}function fC(s,e){let t=s.getReader(),i=0,n=!1,r=!1,o=async a=>{n||r||(r=!0,await t.cancel(a))};return new ReadableStream({async pull(a){if(i>=e){a.close(),await o();return}let{done:c,value:u}=await t.read();if(c||!u){n=!0,a.close();return}let l=e-i;if(u.length>l){a.enqueue(u.subarray(0,l)),i+=l,a.close(),await o();return}a.enqueue(u),i+=u.length},async cancel(a){await o(a)}})}async function pk(s,e){return new Ns(e).fromBuffer(s)}async function hk(s,e){return new Ns(e).fromBlob(s)}function ck(s){switch(s=s.toLowerCase(),s){case"application/epub+zip":return{ext:"epub",mime:s};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:s};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:s};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:s};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:s};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:s};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:s};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:s};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:s};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:s};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:s};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:s};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:s};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:s};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:s};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:s};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function st(s,e,t){t={offset:0,...t};for(let[i,n]of e.entries())if(t.mask){if(n!==(t.mask[i]&s[i+t.offset]))return!1}else if(n!==s[i+t.offset])return!1;return!0}function Nd(s){return Number.isFinite(s)?Math.max(1,Math.trunc(s)):Ss}function mC(s,e,t){return t===void 0?s.read(e):(t.throwIfAborted(),new Promise((i,n)=>{let r=()=>{t.removeEventListener("abort",o)},o=()=>{let a=t.reason;r(),(async()=>{try{await s.cancel(a)}catch{}})(),n(a)};t.addEventListener("abort",o,{once:!0}),(async()=>{try{let a=await s.read(e);r(),i(a)}catch(a){r(),n(a)}})()}))}function gC(s){return Number.isFinite(s)?Math.max(0,Math.min(HE,Math.trunc(s))):0}function bC(s){return Number.isFinite(s)?Math.max(0,s):Number.MAX_SAFE_INTEGER}function de(s){let e=s.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function vn(s,e,t){return de(s)&&s.position-e>t}function kC(s){let e=s.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-s.position):Number.MAX_SAFE_INTEGER;return Math.min(t,GE)}function xC(s){if(s instanceof P||s instanceof bt)return!0;if(!(s instanceof Error))return!1;if(sC.has(s.message)||nC.has(s.code))return!0;for(let e of iC)if(s.message.startsWith(e))return!0;return!1}function uk(s,e=it){let t=[s.compressedSize,s.uncompressedSize];for(let i of t)if(!Number.isFinite(i)||i<0||i>e)return!1;return!0}function _C(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function wC(s,e){e.startsWith("word/")&&(s.hasWordDirectory=!0),e.startsWith("ppt/")&&(s.hasPresentationDirectory=!0),e.startsWith("xl/")&&(s.hasSpreadsheetDirectory=!0),e.startsWith("3D/")&&e.endsWith(".model")&&(s.hasThreeDimensionalModelEntry=!0)}function lk(s){if(!(!s.hasContentTypesEntry||s.hasUnparseableContentTypes||s.isParsingContentTypes||s.hasParsedContentTypesEntry)){if(s.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(s.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(s.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(s.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function yC(s){let e=s.indexOf('.main+xml"');if(e===-1){let n="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return s.includes(`ContentType="${n}"`)?n:void 0}let t=s.slice(0,e),i=t.lastIndexOf('"');return t.slice(i+1)}async function fk(s,e){return new Ns(e).fromTokenizer(s)}var Ss,HE,it,Xb,GE,De,ua,ek,KE,JE,tk,yd,sk,ik,YE,ZE,QE,XE,eC,nk,rk,ok,tC,ak,sC,iC,nC,bt,dk,ca,aC,Ns,mk,gk,Ed=B(()=>{wn();ea();Ub();Vb();Jb();Qb();Ss=4100,HE=Ss-2,it=1024*1024,Xb=1024,GE=2**31-1,De=16*1024*1024,ua=it,ek=it,KE=De,JE=1,tk=100,yd=De,sk=64,ik=ua,YE=256,ZE=512,QE=De,XE=512,eC=512,nk=256,rk=ua,ok=ua,tC=ua,ak=De,sC=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),iC=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],nC=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),bt=class extends Error{};dk=134695760,ca=16,aC=ca-1;vs.prototype.inflate=async function(s,e,t){if(s.compressedMethod===0)return t(e);if(s.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${s.compressedMethod}`);let i=await oC(e,{maximumLength:it});return t(i)};vs.prototype.unzip=async function(s){let e=!1,t=0,i=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(vn(this.tokenizer,i,De))throw new bt(`ZIP stream probing exceeds ${De} bytes`);let n=await this.readLocalFileHeader();if(!n)break;if(t++,t>Xb)throw new Error(`ZIP entry count exceeds ${Xb}`);let r=s(n);e=!!r.stop,await this.tokenizer.ignore(n.extraFieldLength);let o=await hC(this,n,{shouldBuffer:!!r.handler,maximumDescriptorLength:Math.min(it,pC(this,i))});if(r.handler&&await this.inflate(n,o,r.handler),n.dataDescriptor){let a=new Uint8Array(ca);if(await this.tokenizer.readBuffer(a),j.get(a,0)!==dk)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-a.length}`)}if(vn(this.tokenizer,i,De))throw new bt(`ZIP stream probing exceeds ${De} bytes`)}while(!e)};Ns=class s{constructor(e){let t=gC(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return rC(ub(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let i=e.position;for(let n of this.detectors){let r;try{r=await n.detect(e)}catch(o){if(o instanceof P||o instanceof bt)return;throw o}if(r)return r;if(i!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(lb(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=db(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let i=Nd(t?.sampleSize??Ss),n,r,o=e.getReader({mode:"byob"});try{let{value:u,done:l}=await mC(o,new Uint8Array(i),this.options.signal);if(r=u,!l&&u)try{n=await this.fromBuffer(u.subarray(0,i))}catch(d){if(!(d instanceof P))throw d;n=void 0}r=u}finally{o.releaseLock()}let a=new TransformStream({async start(u){u.enqueue(r)},transform(u,l){l.enqueue(u)}}),c=e.pipeThrough(a);return c.fileType=n,c}async detectGzip(e){if(this.gzipProbeDepth>=JE)return{ext:"gz",mime:"application/gzip"};let t=new yn(e),i=fC(t.inflate(),KE),n=de(e),r,o,a,c;if(n){let u=new AbortController;r=setTimeout(()=>{u.abort(new DOMException(`Operation timed out after ${tk} ms`,"TimeoutError"))},tk),o=this.options.signal===void 0?u.signal:AbortSignal.any([this.options.signal,u.signal]),a=new s({...this.options,signal:o}),a.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{c=await(a??this).fromStream(i)}catch(u){if(u?.name==="AbortError"&&o?.reason?.name!=="TimeoutError")throw u}finally{clearTimeout(r),n||this.gzipProbeDepth--}return c?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return st(this.buffer,e,t)}checkString(e,t){return this.check(Hb(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(Ss),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,de(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=nk?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(e));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(e);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await $t(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(Kb),i=de(e);if(!Number.isFinite(t)||t<0||i&&(t>yd||e.position+t>yd))return;if(e.position+t>e.fileInfo.size)return i?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await $t(e,t,{maximumLength:i?yd:e.fileInfo.size,reason:"ID3 payload"})}catch(n){if(n instanceof P)return;throw n}return this.detectionReentryCount>=nk?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let t,i=_C();try{await new vs(e).unzip(n=>{wC(i,n.filename);let r=n.filename==="[Content_Types].xml",o=lk(i);if(!r&&o)return t=o,{stop:!0};switch(n.filename){case"META-INF/mozilla.rsa":return t={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return t={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return uk(n,ek)?{async handler(a){let c=new TextDecoder("utf-8").decode(a).trim();t=ck(c)},stop:!0}:{};case"[Content_Types].xml":return i.hasContentTypesEntry=!0,uk(n,ek)?(i.isParsingContentTypes=!0,{async handler(a){let c=new TextDecoder("utf-8").decode(a),u=yC(c);u&&(t=ck(u)),i.hasParsedContentTypesEntry=!0,i.isParsingContentTypes=!1},stop:!0}):(i.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(n.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(n){if(!xC(n))throw n;i.isParsingContentTypes&&(i.isParsingContentTypes=!1,i.hasUnparseableContentTypes=!0)}return t??lk(i)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),st(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:st(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:st(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:st(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:st(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:st(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){let t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){let c=await e.peekNumber(wb),u=128,l=0;for(;(c&u)===0&&u!==0;)++l,u>>=1;let d=new Uint8Array(l+1);return await vd(e,d,void 0,{maximumLength:d.length,reason:"EBML field"}),d}async function i(){let c=await t(),u=await t();u[0]^=128>>u.length-1;let l=Math.min(6,u.length),d=new DataView(c.buffer),p=new DataView(u.buffer,u.length-l,l);return{id:wd(d),len:wd(p)}}async function n(c){let u=0;for(;c>0;){if(u++,u>YE||vn(e,o,De))return;let l=e.position,d=await i();if(d.id===17026){if(d.len>sk)return;let p=Sd(d.len,sk,"EBML DocType");return(await e.readToken(new ke(p))).replaceAll(/\00.*$/g,"")}if(de(e)&&(!Number.isFinite(d.len)||d.len<0||d.len>ik)||(await $t(e,d.len,{maximumLength:de(e)?ik:e.fileInfo.size,reason:"EBML payload"}),--c,e.position<=l))return}}let r=await i(),o=e.position;switch(await n(r.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let t=md.get(this.buffer,4),i=_s.get(this.buffer,6);if(t>0&&t<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(i>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let t=new ke(4,"latin1").get(this.buffer,2);if(t.match("^d*")&&t>=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new ke(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
|
|
150
150
|
`,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:"png",mime:"image/png"},i={ext:"apng",mime:"image/apng"};await e.ignore(8);async function n(){return{length:await e.readToken(yb),type:await e.readToken(new ke(4,"latin1"))}}let r=de(e),o=e.position,a=0,c=!1;do{if(a++,a>ZE||vn(e,o,QE))break;let u=e.position,l=await n();if(l.length<0)return;if(l.type==="IHDR"){if(l.length!==13)return;c=!0}switch(l.type){case"IDAT":return t;case"acTL":return i;default:if(!c&&l.type!=="CgBI")return;if(r&&l.length>rk)return c&&uC(l.type)?t:void 0;try{await $t(e,l.length+4,{maximumLength:r?rk+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(d){if(!r&&(d instanceof bt||d instanceof P))return t;throw d}}if(e.position<=u)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let t=new ke(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
|
|
151
151
|
`))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let t=!1;try{async function i(){let a=new Uint8Array(16);return await vd(e,a,void 0,{maximumLength:a.length,reason:"ASF header GUID"}),{id:a,size:Number(await e.readToken(vb))}}await $t(e,30,{maximumLength:30,reason:"ASF header prelude"});let n=de(e),r=e.position,o=0;for(;e.position+24<e.fileInfo.size&&(o++,!(o>XE||vn(e,r,De)));){let a=e.position,c=await i(),u=c.size-24;if(!Number.isFinite(u)||u<0){t=!0;break}if(st(c.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let l=new Uint8Array(16);if(u-=await vd(e,l,void 0,{maximumLength:l.length,reason:"ASF stream type GUID"}),st(l,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(st(l,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(n&&u>ok){t=!0;break}if(await $t(e,u,{maximumLength:n?ok:e.fileInfo.size,reason:"ASF header payload"}),e.position<=a){t=!0;break}}}catch(i){if(i instanceof P||i instanceof bt)de(e)&&(t=!0);else throw i}return t?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new ke(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{let i=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(i).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&Gb(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let t="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:t})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:t})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
|
|
152
|
-
`,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(Ss);let t=bC(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let i=0;i<=this.options.mpegOffsetTolerance;++i){let n=this.scanMpeg(i);if(n)return n}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?_s:z);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?_s:z);if(!(t>eC)&&!(de(this.tokenizer)&&2+t*12>ak))for(let i=0;i<t;++i){let n=await this.readTiffTag(e);if(n)return n}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},i=(e?_s:z).get(this.buffer,2),n=(e?md:j).get(this.buffer,4);if(i===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let a=(e?_s:z).get(this.buffer,8),c=(e?_s:z).get(this.buffer,10);if(a===28&&c===254||a===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(de(this.tokenizer)&&n>tC)return t;let r=de(this.tokenizer)?ak:this.tokenizer.fileInfo.size;try{await $t(this.tokenizer,n,{maximumLength:r,reason:"TIFF IFD offset"})}catch(a){if(a instanceof P)return;throw a}let o;try{o=await this.readTiffIFD(e)}catch(a){if(a instanceof P)return;throw a}return o??t}if(i===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},mk=new Set(Yb),gk=new Set(Zb)});var xk={};Ps(xk,{FileTypeParser:()=>gi,fileTypeFromBlob:()=>hk,fileTypeFromBuffer:()=>pk,fileTypeFromFile:()=>SC,fileTypeFromStream:()=>NC,fileTypeFromTokenizer:()=>fk,fileTypeStream:()=>EC,supportedExtensions:()=>mk,supportedMimeTypes:()=>gk});function vC(s){return!(s instanceof RangeError)||s.message!=="offset is out of bounds"||typeof s.stack!="string"?!1:/strtok3[/\\]lib[/\\]stream[/\\]/.test(s.stack)}async function SC(s,e){return new gi(e).fromFile(s,e)}async function NC(s,e){return new gi(e).fromStream(s)}async function EC(s,e={}){return new gi(e).toDetectionStream(s,e)}var bk,jt,kk,Cd,gi,_k=B(()=>{bk=require("node:stream/web"),jt=require("node:stream"),kk=F(require("node:fs/promises"),1),Cd=require("node:fs");mb();Ed();Ed();gi=class extends Ns{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof bk.ReadableStream?this.createTokenizerFromWebStream(e):fb(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(i){if(vC(i))return;throw i}finally{e instanceof jt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await kk.default.open(e,Cd.constants.O_RDONLY|Cd.constants.O_NONBLOCK),i=await t.stat();if(!i.isFile()){await t.close();return}let n=new xs(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:i.size}});return super.fromTokenizer(n)}async toDetectionStream(e,t={}){if(!(e instanceof jt.Readable))return super.toDetectionStream(e,t);let{sampleSize:i=Ss}=t,{signal:n}=this.options,r=Nd(i);return n?.throwIfAborted(),new Promise((o,a)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",h),n?.removeEventListener("abort",p)},l=(f,m)=>{c||(c=!0,u(),f(m))},d=f=>{l(a,f)},p=()=>{e.destroyed||e.destroy(),l(a,n.reason)},h=()=>{(async()=>{try{let f=new jt.PassThrough,m=jt.pipeline?(0,jt.pipeline)(e,f,()=>{}):e.pipe(f),g=e.read(r)??e.read()??new Uint8Array(0);try{f.fileType=await this.fromBuffer(g)}catch(b){b instanceof P?f.fileType=void 0:l(a,b)}l(o,m)}catch(f){l(a,f)}})()};e.on("error",d),e.once("readable",h),n?.addEventListener("abort",p,{once:!0})})}}});var NR={};Ps(NR,{activate:()=>vR,connectToHost:()=>Wa,deactivate:()=>SR});module.exports=o_(NR);var N=F(require("vscode"));var dr=F(require("vscode"));var Cw=F(ch(),1),Rw=F(sr(),1),Aw=F(Ms(),1),Iw=F(Za(),1),Tw=F(ec(),1),Ow=F(oc(),1),bh=F(or(),1),Dw=F(gh(),1);var cr=bh.default;var cc=s=>s.replace("work_block","workblock"),ur=["module_id","parent_task_def_id","parent_task_id","run_id","stream_id","wcb_id"],Pw={ask_agent:["conversation_id","message_id","run_id"],authz_schema_apply:["version_id"],authz_schema_draft_emit_event:["workblock_id"],authz_schema_force_apply:["version_id"],authz_schema_initialize_for_workblock:["schema_id"],authz_schema_propose:["draft_id"],cancel_child:ur,complete_child:ur,continue_from_message:["thread_id"],convert_legacy_stream:["editing_task_id","id","parent_id"],create_access_token:["access_token"],create_group:["id"],create_oauth_client:["client"],create_oauth_registration_token:["registration_token"],create_stream:["run_id","stream_id"],create_studio_workspace:["stream","workspace"],create_user:["id"],create_workblock:["stream","workspace"],create_workblock_schedule:["id","user","wcb_id"],create_workblock_version:["stream","workspace"],discard_permission_request:["request_id"],get_edit_stream:["editing_task_id","id","parent_id"],get_space_stream:["run_id","stream_id"],initiate_credential_oauth:["attempt_id"],initiate_task_credential_oauth:["attempt_id"],interrupt_child:ur,message_child:ur,publish_to_registry:["id"],recreate_edit_stream:["stream"],register_workblock_event:["id","stream_id","workblock_id"],remix_workblock_v2:["workblock_id"],rename_data_environment:["environment"],request_permission:["request_id"],restart_studio_workspace_thread:["previous_thread_id","thread_id"],run_module:["run_id"],run_workblock_replay_tests:["workflow_id"],set_legal_hold:["run_id"],set_retention_policy:["workblock_id"],set_work_block:["work_block"],set_work_block_v2:["work_block"],start_branch_thread:["thread_id"],update_task:["task"],update_workblock_schedule:["id","user","wcb_id"],upsert_space:["id"]},lr=class{constructor(e,t){this.client=e,this.analyticsClient=t??null}async acceptThreadWorkblock(e,t){return await this.requestWithTracking("accept_thread_workblock",e,t)}async acceptTos(e,t){return await this.requestWithTracking("accept_tos",e,t)}async addGroupMember(e,t){return await this.requestWithTracking("add_group_member",e,t)}async applyWorkblockDataModelDraft(e,t){return await this.requestWithTracking("apply_workblock_data_model_draft",e,t)}async applyWorkblockDeployedUpdates(e,t){return await this.requestWithTracking("apply_workblock_deployed_updates",e,t)}async applyWorkblockVersionUpdates(e,t){return await this.requestWithTracking("apply_workblock_version_updates",e,t)}async approveLearningData(e,t){return await this.requestWithTracking("approve_learning_data",e,t)}async askAgent(e,t){return await this.requestWithTracking("ask_agent",e,t)}async assign(e,t){return await this.requestWithTracking("assign",e,t)}async assignEditStream(e,t){return await this.requestWithTracking("assign_edit_stream",e,t)}async assignWorkBlockRuns(e,t){return await this.requestWithTracking("assign_work_block_runs",e,t)}async authzSchemaApply(e,t){return await this.requestWithTracking("authz_schema_apply",e,t)}async authzSchemaDiscardPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_discard_policy_draft",e,t)}async authzSchemaDraftEmitAwarenessEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_awareness_event",e,t)}async authzSchemaDraftEmitEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_event",e,t)}async authzSchemaForceApply(e,t){return await this.requestWithTracking("authz_schema_force_apply",e,t)}async authzSchemaGrantRoleMembership(e,t){return await this.requestWithTracking("authz_schema_grant_role_membership",e,t)}async authzSchemaImportPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_import_policy_draft",e,t)}async authzSchemaInitializeForWorkblock(e,t){return await this.requestWithTracking("authz_schema_initialize_for_workblock",e,t)}async authzSchemaOpenPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_open_policy_draft",e,t)}async authzSchemaPropose(e,t){return await this.requestWithTracking("authz_schema_propose",e,t)}async authzSchemaRevokeRoleMembership(e,t){return await this.requestWithTracking("authz_schema_revoke_role_membership",e,t)}async authzSchemaSavePolicyDraft(e,t){return await this.requestWithTracking("authz_schema_save_policy_draft",e,t)}async bulkTagLearningExamples(e,t){return await this.requestWithTracking("bulk_tag_learning_examples",e,t)}async cancelAgent(e,t){return await this.requestWithTracking("cancel_agent",e,t)}async cancelChild(e,t){return await this.requestWithTracking("cancel_child",e,t)}async cancelWb(e,t){return await this.requestWithTracking("cancel_wb",e,t)}async cancelWorkblockDataEnvironmentCloneOperation(e,t){return await this.requestWithTracking("cancel_workblock_data_environment_clone_operation",e,t)}async cancelWorkblockNotification(e,t){return await this.requestWithTracking("cancel_workblock_notification",e,t)}async changelogMarkSeen(e,t){return await this.requestWithTracking("changelog_mark_seen",e,t)}async chatQueue(e,t){return await this.requestWithTracking("chat_queue",e,t)}async cloneWorkblockDataEnvironment(e,t){return await this.requestWithTracking("clone_workblock_data_environment",e,t)}async closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",e,t)}async completeConfigCredentialOauth(e,t){return await this.requestWithTracking("complete_config_credential_oauth",e,t)}async completeCredentialOauth(e,t){return await this.requestWithTracking("complete_credential_oauth",e,t)}async completeRunCredentialOauth(e,t){return await this.requestWithTracking("complete_run_credential_oauth",e,t)}async continueFromMessage(e,t){return await this.requestWithTracking("continue_from_message",e,t)}async continueUi(e,t){return await this.requestWithTracking("continue_ui",e,t)}async convertLegacyStream(e,t){return await this.requestWithTracking("convert_legacy_stream",e,t)}async createAccessToken(e,t){return await this.requestWithTracking("create_access_token",e,t)}async createCredential(e,t){return await this.requestWithTracking("create_credential",e,t)}async createGroup(e,t){return await this.requestWithTracking("create_group",e,t)}async createOauthClient(e,t){return await this.requestWithTracking("create_oauth_client",e,t)}async createOauthRegistrationToken(e,t){return await this.requestWithTracking("create_oauth_registration_token",e,t)}async createStream(e,t){return await this.requestWithTracking("create_stream",e,t)}async createStudioWorkspace(e,t){return await this.requestWithTracking("create_studio_workspace",e,t)}async createUser(e,t){return await this.requestWithTracking("create_user",e,t)}async createWorkblock(e,t){return await this.requestWithTracking("create_workblock",e,t)}async createWorkblockDataEnvironment(e,t){return await this.requestWithTracking("create_workblock_data_environment",e,t)}async createWorkblockSchedule(e,t){return await this.requestWithTracking("create_workblock_schedule",e,t)}async createWorkblockVersion(e,t){return await this.requestWithTracking("create_workblock_version",e,t)}async createWorkblockVersionUpdate(e,t){return await this.requestWithTracking("create_workblock_version_update",e,t)}async dataEnvironmentRequestApply(e,t){return await this.requestWithTracking("data_environment_request_apply",e,t)}async deleteAccessToken(e,t){return await this.requestWithTracking("delete_access_token",e,t)}async deleteAllWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("delete_all_workblock_registration_events",e,t)}async deleteCredential(e,t){return await this.requestWithTracking("delete_credential",e,t)}async deleteDataEnvironment(e,t){return await this.requestWithTracking("delete_data_environment",e,t)}async deleteGroup(e,t){return await this.requestWithTracking("delete_group",e,t)}async deleteLearningExample(e,t){return await this.requestWithTracking("delete_learning_example",e,t)}async deleteOauthClient(e,t){return await this.requestWithTracking("delete_oauth_client",e,t)}async deleteSpace(e,t){return await this.requestWithTracking("delete_space",e,t)}async deleteStudioWorkspace(e,t){return await this.requestWithTracking("delete_studio_workspace",e,t)}async deleteWorkblock(e,t){return await this.requestWithTracking("delete_workblock",e,t)}async deleteWorkblockBranch(e,t){return await this.requestWithTracking("delete_workblock_branch",e,t)}async deleteWorkblockRegistration(e,t){return await this.requestWithTracking("delete_workblock_registration",e,t)}async deleteWorkblockRegistrationEvent(e,t){return await this.requestWithTracking("delete_workblock_registration_event",e,t)}async deleteWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("delete_workblock_run_data_truncation",e,t)}async deleteWorkblockSchedule(e,t){return await this.requestWithTracking("delete_workblock_schedule",e,t)}async deployWorkblockVersion(e,t){return await this.requestWithTracking("deploy_workblock_version",e,t)}async disableWorkblockRegistration(e,t){return await this.requestWithTracking("disable_workblock_registration",e,t)}async discardPermissionRequest(e,t){return await this.requestWithTracking("discard_permission_request",e,t)}async dismissAllNotifications(e,t){return await this.requestWithTracking("dismiss_all_notifications",e,t)}async dismissNotification(e,t){return await this.requestWithTracking("dismiss_notification",e,t)}async enableWorkblockRegistration(e,t){return await this.requestWithTracking("enable_workblock_registration",e,t)}async ensureDefaultWorkblockDataEnvironments(e,t){return await this.requestWithTracking("ensure_default_workblock_data_environments",e,t)}async ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",e,t)}async ensureWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("ensure_workblock_data_environment_namespace",e,t)}async executeWorkblockEntityStore(e,t){return await this.requestWithTracking("execute_workblock_entity_store",e,t)}async getEditStream(e,t){return await this.requestWithTracking("get_edit_stream",e,t)}async getSpaceStream(e,t){return await this.requestWithTracking("get_space_stream",e,t)}async grantWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("grant_workblock_data_environment_start",e,t)}async initiateConfigCredentialOauth(e,t){return await this.requestWithTracking("initiate_config_credential_oauth",e,t)}async initiateCredentialOauth(e,t){return await this.requestWithTracking("initiate_credential_oauth",e,t)}async initiateTaskCredentialOauth(e,t){return await this.requestWithTracking("initiate_task_credential_oauth",e,t)}async insertTasks(e,t){return await this.requestWithTracking("insert_tasks",e,t)}async installWorkblock(e,t){return await this.requestWithTracking("install_workblock",e,t)}async interruptChild(e,t){return await this.requestWithTracking("interrupt_child",e,t)}async invokeRunTask(e,t){return await this.requestWithTracking("invoke_run_task",e,t)}async invokeWorkblockTask(e,t){return await this.requestWithTracking("invoke_workblock_task",e,t)}async join(e,t){return await this.requestWithTracking("join",e,t)}async leave(e,t){return await this.requestWithTracking("leave",e,t)}async markAllNotificationsRead(e,t){return await this.requestWithTracking("mark_all_notifications_read",e,t)}async markNotificationRead(e,t){return await this.requestWithTracking("mark_notification_read",e,t)}async mergeWorkblockBranch(e,t){return await this.requestWithTracking("merge_workblock_branch",e,t)}async messageChild(e,t){return await this.requestWithTracking("message_child",e,t)}async peekWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("peek_workblock_registration_events",e,t)}async permissionsGrant(e,t){return await this.requestWithTracking("permissions_grant",e,t)}async permissionsRevoke(e,t){return await this.requestWithTracking("permissions_revoke",e,t)}async promoteWorkblockDataModel(e,t){return await this.requestWithTracking("promote_workblock_data_model",e,t)}async publishToRegistry(e,t){return await this.requestWithTracking("publish_to_registry",e,t)}async recreateEditStream(e,t){return await this.requestWithTracking("recreate_edit_stream",e,t)}async reembedValidationSet(e,t){return await this.requestWithTracking("reembed_validation_set",e,t)}async registerWorkblockEvent(e,t){return await this.requestWithTracking("register_workblock_event",e,t)}async registrySearch(e,t){return await this.requestWithTracking("registry_search",e,t)}async registrySetParameters(e,t){return await this.requestWithTracking("registry_set_parameters",e,t)}async registrySetTags(e,t){return await this.requestWithTracking("registry_set_tags",e,t)}async rejectLearningData(e,t){return await this.requestWithTracking("reject_learning_data",e,t)}async rejectThreadWorkblock(e,t){return await this.requestWithTracking("reject_thread_workblock",e,t)}async remixWorkblockV2(e,t){return await this.requestWithTracking("remix_workblock_v2",e,t)}async removeGroupMember(e,t){return await this.requestWithTracking("remove_group_member",e,t)}async removeThread(e,t){return await this.requestWithTracking("remove_thread",e,t)}async removeWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("remove_workblock_data_environment_namespace",e,t)}async renameDataEnvironment(e,t){return await this.requestWithTracking("rename_data_environment",e,t)}async requestPermission(e,t){return await this.requestWithTracking("request_permission",e,t)}async resetTask(e,t){return await this.requestWithTracking("reset_task",e,t)}async resetWorkblockBranch(e,t){return await this.requestWithTracking("reset_workblock_branch",e,t)}async resetWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("reset_workblock_data_environment_namespace",e,t)}async resolveWorkblockMergeConflicts(e,t){return await this.requestWithTracking("resolve_workblock_merge_conflicts",e,t)}async restartStudioWorkspaceThread(e,t){return await this.requestWithTracking("restart_studio_workspace_thread",e,t)}async restartWorkblock(e,t){return await this.requestWithTracking("restart_workblock",e,t)}async resumeRetry(e,t){return await this.requestWithTracking("resume_retry",e,t)}async retryWorkblockDataModelApply(e,t){return await this.requestWithTracking("retry_workblock_data_model_apply",e,t)}async revertWorkblockCommit(e,t){return await this.requestWithTracking("revert_workblock_commit",e,t)}async revokeAllOauthConsents(e,t){return await this.requestWithTracking("revoke_all_oauth_consents",e,t)}async revokeOauthConsent(e,t){return await this.requestWithTracking("revoke_oauth_consent",e,t)}async revokeOauthRegistrationToken(e,t){return await this.requestWithTracking("revoke_oauth_registration_token",e,t)}async revokeWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("revoke_workblock_data_environment_start",e,t)}async rotateOauthClientSecret(e,t){return await this.requestWithTracking("rotate_oauth_client_secret",e,t)}async runModule(e,t){return await this.requestWithTracking("run_module",e,t)}async runSingleTask(e,t){return await this.requestWithTracking("run_single_task",e,t)}async runSubgraph(e,t){return await this.requestWithTracking("run_subgraph",e,t)}async runTask(e,t){return await this.requestWithTracking("run_task",e,t)}async runWorkblockReplayTests(e,t){return await this.requestWithTracking("run_workblock_replay_tests",e,t)}async runtimeAuthzAttachRole(e,t){return await this.requestWithTracking("runtime_authz_attach_role",e,t)}async runtimeAuthzDeleteRelation(e,t){return await this.requestWithTracking("runtime_authz_delete_relation",e,t)}async runtimeAuthzDetachRole(e,t){return await this.requestWithTracking("runtime_authz_detach_role",e,t)}async runtimeAuthzStoreRelation(e,t){return await this.requestWithTracking("runtime_authz_store_relation",e,t)}async sendMessage(e,t){return await this.requestWithTracking("send_message",e,t)}async sendWorkblockNotification(e,t){return await this.requestWithTracking("send_workblock_notification",e,t)}async setActiveWorkblockSetting(e,t){return await this.requestWithTracking("set_active_workblock_setting",e,t)}async setAutoApproveConfig(e,t){return await this.requestWithTracking("set_auto_approve_config",e,t)}async setConsumptionLimits(e,t){return await this.requestWithTracking("set_consumption_limits",e,t)}async setEditing(e,t){return await this.requestWithTracking("set_editing",e,t)}async setKeepOpenOnComplete(e,t){return await this.requestWithTracking("set_keep_open_on_complete",e,t)}async setLegalHold(e,t){return await this.requestWithTracking("set_legal_hold",e,t)}async setLogging(e,t){return await this.requestWithTracking("set_logging",e,t)}async setNotificationChannelMuted(e,t){return await this.requestWithTracking("set_notification_channel_muted",e,t)}async setOauthClientEnabled(e,t){return await this.requestWithTracking("set_oauth_client_enabled",e,t)}async setRetentionPolicy(e,t){return await this.requestWithTracking("set_retention_policy",e,t)}async setStudioWorkspaceArchived(e,t){return await this.requestWithTracking("set_studio_workspace_archived",e,t)}async setStudioWorkspaceThread(e,t){return await this.requestWithTracking("set_studio_workspace_thread",e,t)}async setUserSetting(e,t){return await this.requestWithTracking("set_user_setting",e,t)}async setWorkBlock(e,t){return await this.requestWithTracking("set_work_block",e,t)}async setWorkBlockV2(e,t){return await this.requestWithTracking("set_work_block_v2",e,t)}async setWorkblockCommitMessage(e,t){return await this.requestWithTracking("set_workblock_commit_message",e,t)}async setWorkblockConfig(e,t){return await this.requestWithTracking("set_workblock_config",e,t)}async setWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("set_workblock_run_data_truncation",e,t)}async setWorkblockSchedulePaused(e,t){return await this.requestWithTracking("set_workblock_schedule_paused",e,t)}async startBranchThread(e,t){return await this.requestWithTracking("start_branch_thread",e,t)}async startChild(e,t){return await this.requestWithTracking("start_child",e,t)}async startWb(e,t){return await this.requestWithTracking("start_wb",e,t)}async storeWorkBlock(e,t){return await this.requestWithTracking("store_work_block",e,t)}async switchStreamBranch(e,t){return await this.requestWithTracking("switch_stream_branch",e,t)}async syncWorkblock(e,t){return await this.requestWithTracking("sync_workblock",e,t)}async syncWorkblockVersion(e,t){return await this.requestWithTracking("sync_workblock_version",e,t)}async temporalCancelWorkflow(e,t){return await this.requestWithTracking("temporal_cancel_workflow",e,t)}async temporalResetWorkflow(e,t){return await this.requestWithTracking("temporal_reset_workflow",e,t)}async temporalSignalWorkflow(e,t){return await this.requestWithTracking("temporal_signal_workflow",e,t)}async temporalTerminateWorkflow(e,t){return await this.requestWithTracking("temporal_terminate_workflow",e,t)}async transcribeAudio(e,t){return await this.requestWithTracking("transcribe_audio",e,t)}async triggerWorkblockSchedule(e,t){return await this.requestWithTracking("trigger_workblock_schedule",e,t)}async uninstallWorkblock(e,t){return await this.requestWithTracking("uninstall_workblock",e,t)}async updateAccessToken(e,t){return await this.requestWithTracking("update_access_token",e,t)}async updateAccount(e,t){return await this.requestWithTracking("update_account",e,t)}async updateCredential(e,t){return await this.requestWithTracking("update_credential",e,t)}async updateGroup(e,t){return await this.requestWithTracking("update_group",e,t)}async updateLearningExample(e,t){return await this.requestWithTracking("update_learning_example",e,t)}async updateOauthClient(e,t){return await this.requestWithTracking("update_oauth_client",e,t)}async updateProfile(e,t){return await this.requestWithTracking("update_profile",e,t)}async updateStudioWorkspaceTitle(e,t){return await this.requestWithTracking("update_studio_workspace_title",e,t)}async updateTask(e,t){return await this.requestWithTracking("update_task",e,t)}async updateUser(e,t){return await this.requestWithTracking("update_user",e,t)}async updateWorkblockEntityStoreRow(e,t){return await this.requestWithTracking("update_workblock_entity_store_row",e,t)}async updateWorkblockSchedule(e,t){return await this.requestWithTracking("update_workblock_schedule",e,t)}async upsertSpace(e,t){return await this.requestWithTracking("upsert_space",e,t)}async addLearningData(e,t){return await this.client.sendMessage({type:"add_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async addStreamLogs(e,t){return await this.client.sendMessage({type:"add_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDiffVersions(e,t){return await this.client.sendMessage({type:"authz_schema_diff_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftGetEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGet(e,t){return await this.client.sendMessage({type:"authz_schema_get",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetAppliedEnvelope(e,t){return await this.client.sendMessage({type:"authz_schema_get_applied_envelope",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetDraftState(e,t){return await this.client.sendMessage({type:"authz_schema_get_draft_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetForWorkblock(e,t){return await this.client.sendMessage({type:"authz_schema_get_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetVersion(e,t){return await this.client.sendMessage({type:"authz_schema_get_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaImpactReport(e,t){return await this.client.sendMessage({type:"authz_schema_impact_report",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListOrphanedResources(e,t){return await this.client.sendMessage({type:"authz_schema_list_orphaned_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListRoleMemberships(e,t){return await this.client.sendMessage({type:"authz_schema_list_role_memberships",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListVersions(e,t){return await this.client.sendMessage({type:"authz_schema_list_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaPreviewValidation(e,t){return await this.client.sendMessage({type:"authz_schema_preview_validation",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaQueryAudit(e,t){return await this.client.sendMessage({type:"authz_schema_query_audit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaValidate(e,t){return await this.client.sendMessage({type:"authz_schema_validate",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchCheckWorkblockMergeability(e,t){return await this.client.sendMessage({type:"batch_check_workblock_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchGetEvents(e,t){return await this.client.sendMessage({type:"batch_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async changelogList(e,t){return await this.client.sendMessage({type:"changelog_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkChild(e,t){return await this.client.sendMessage({type:"check_child",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkCredential(e,t){return await this.client.sendMessage({type:"check_credential",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkPermission(e,t){return await this.client.sendMessage({type:"check_permission",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkStreamAccess(e,t){return await this.client.sendMessage({type:"check_stream_access",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkWorkblockBranchMergeability(e,t){return await this.client.sendMessage({type:"check_workblock_branch_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async closeWorkblockRunDataSession(e,t){return await this.client.sendMessage({type:"close_workblock_run_data_session",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async consoleLog(e,t){return await this.client.sendMessage({type:"console_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async countWorkblockRegistrationEvents(e,t){return await this.client.sendMessage({type:"count_workblock_registration_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async createWorkblockTokenUrl(e,t){return await this.client.sendMessage({type:"create_workblock_token_url",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async diffWorkblockReplayTest(e,t){return await this.client.sendMessage({type:"diff_workblock_replay_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async discoverCredentialOauth(e,t){return await this.client.sendMessage({type:"discover_credential_oauth",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async evaluateWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"evaluate_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findLearningDuplicates(e,t){return await this.client.sendMessage({type:"find_learning_duplicates",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findStudioWorkspaceOnBranch(e,t){return await this.client.sendMessage({type:"find_studio_workspace_on_branch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findWorkblockRows(e,t){return await this.client.sendMessage({type:"find_workblock_rows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAccount(e,t){return await this.client.sendMessage({type:"get_account",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getActiveWorkblockSetting(e,t){return await this.client.sendMessage({type:"get_active_workblock_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAffectedRunsCount(e,t){return await this.client.sendMessage({type:"get_affected_runs_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAgentTurn(e,t){return await this.client.sendMessage({type:"get_agent_turn",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAutoApproveConfig(e,t){return await this.client.sendMessage({type:"get_auto_approve_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAvailableModels(e,t){return await this.client.sendMessage({type:"get_available_models",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getBaseWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_base_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getConsumptionStatus(e,t){return await this.client.sendMessage({type:"get_consumption_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getCredentialForEdit(e,t){return await this.client.sendMessage({type:"get_credential_for_edit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDefaultWorkblockRegistration(e,t){return await this.client.sendMessage({type:"get_default_workblock_registration",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDocsContent(e,t){return await this.client.sendMessage({type:"get_docs_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEditStreamId(e,t){return await this.client.sendMessage({type:"get_edit_stream_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEvents(e,t){return await this.client.sendMessage({type:"get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getInstalledWorkblock(e,t){return await this.client.sendMessage({type:"get_installed_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExample(e,t){return await this.client.sendMessage({type:"get_learning_example",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExamples(e,t){return await this.client.sendMessage({type:"get_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLlmRawCall(e,t){return await this.client.sendMessage({type:"get_llm_raw_call",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLoginHistory(e,t){return await this.client.sendMessage({type:"get_login_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getPendingLearningData(e,t){return await this.client.sendMessage({type:"get_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblock(e,t){return await this.client.sendMessage({type:"get_registry_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblockInfo(e,t){return await this.client.sendMessage({type:"get_registry_workblock_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getReplayTestRunState(e,t){return await this.client.sendMessage({type:"get_replay_test_run_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRetentionPolicy(e,t){return await this.client.sendMessage({type:"get_retention_policy",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpace(e,t){return await this.client.sendMessage({type:"get_space",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpaceId(e,t){return await this.client.sendMessage({type:"get_space_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStream(e,t){return await this.client.sendMessage({type:"get_stream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStreamLogs(e,t){return await this.client.sendMessage({type:"get_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspace(e,t){return await this.client.sendMessage({type:"get_studio_workspace",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspacePresence(e,t){return await this.client.sendMessage({type:"get_studio_workspace_presence",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTaskLogs(e,t){return await this.client.sendMessage({type:"get_task_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineAffectedCount(e,t){return await this.client.sendMessage({type:"get_timeline_affected_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineEventTypes(e,t){return await this.client.sendMessage({type:"get_timeline_event_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTos(e,t){return await this.client.sendMessage({type:"get_tos",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUserSetting(e,t){return await this.client.sendMessage({type:"get_user_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUsers(e,t){return await this.client.sendMessage({type:"get_users",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkBlockRuns(e,t){return await this.client.sendMessage({type:"get_work_block_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblock(e,t){return await this.client.sendMessage({type:"get_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockBranchInfo(e,t){return await this.client.sendMessage({type:"get_workblock_branch_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitLog(e,t){return await this.client.sendMessage({type:"get_workblock_commit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitPatch(e,t){return await this.client.sendMessage({type:"get_workblock_commit_patch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockConfig(e,t){return await this.client.sendMessage({type:"get_workblock_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelDeployPreview(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_deploy_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelRunReadiness(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_run_readiness",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelStatus(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataSchema(e,t){return await this.client.sendMessage({type:"get_workblock_data_schema",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockFileContent(e,t){return await this.client.sendMessage({type:"get_workblock_file_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockHistoryBundle(e,t){return await this.client.sendMessage({type:"get_workblock_history_bundle",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockMissingCredentials(e,t){return await this.client.sendMessage({type:"get_workblock_missing_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsConsumption(e,t){return await this.client.sendMessage({type:"get_workblock_operations_consumption",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsCurrent(e,t){return await this.client.sendMessage({type:"get_workblock_operations_current",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsFailures(e,t){return await this.client.sendMessage({type:"get_workblock_operations_failures",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsOutcomes(e,t){return await this.client.sendMessage({type:"get_workblock_operations_outcomes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsRuns(e,t){return await this.client.sendMessage({type:"get_workblock_operations_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRun(e,t){return await this.client.sendMessage({type:"get_workblock_run",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunDataSchemaVersionDetails(e,t){return await this.client.sendMessage({type:"get_workblock_run_data_schema_version_details",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunInputs(e,t){return await this.client.sendMessage({type:"get_workblock_run_inputs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunResult(e,t){return await this.client.sendMessage({type:"get_workblock_run_result",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockSchedule(e,t){return await this.client.sendMessage({type:"get_workblock_schedule",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockTaskErrors(e,t){return await this.client.sendMessage({type:"get_workblock_task_errors",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUi(e,t){return await this.client.sendMessage({type:"get_workblock_ui",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUpstream(e,t){return await this.client.sendMessage({type:"get_workblock_upstream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockV2(e,t){return await this.client.sendMessage({type:"get_workblock_v2",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeCatalog(e,t){return await this.client.sendMessage({type:"graphlake_catalog",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeExplore(e,t){return await this.client.sendMessage({type:"graphlake_explore",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeIntrospect(e,t){return await this.client.sendMessage({type:"graphlake_introspect",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeNode(e,t){return await this.client.sendMessage({type:"graphlake_node",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeQuery(e,t){return await this.client.sendMessage({type:"graphlake_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeSearchNodes(e,t){return await this.client.sendMessage({type:"graphlake_search_nodes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiQuery(e,t){return await this.client.sendMessage({type:"graphlake_ui_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiSubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_subscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiUnsubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_unsubscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async help(e,t){return await this.client.sendMessage({type:"help",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async inspectFile(e,t){return await this.client.sendMessage({type:"inspect_file",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async invokeTask(e,t){return await this.client.sendMessage({type:"invoke_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listAccessTokens(e,t){return await this.client.sendMessage({type:"list_access_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listApprovedLearningSets(e,t){return await this.client.sendMessage({type:"list_approved_learning_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCategories(e,t){return await this.client.sendMessage({type:"list_categories",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentialTypes(e,t){return await this.client.sendMessage({type:"list_credential_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentials(e,t){return await this.client.sendMessage({type:"list_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroupMembers(e,t){return await this.client.sendMessage({type:"list_group_members",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroups(e,t){return await this.client.sendMessage({type:"list_groups",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listInstalledWorkblocks(e,t){return await this.client.sendMessage({type:"list_installed_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningDataSets(e,t){return await this.client.sendMessage({type:"list_learning_data_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamples(e,t){return await this.client.sendMessage({type:"list_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamplesByScore(e,t){return await this.client.sendMessage({type:"list_learning_examples_by_score",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningSetsForWorkblock(e,t){return await this.client.sendMessage({type:"list_learning_sets_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLlmRawCalls(e,t){return await this.client.sendMessage({type:"list_llm_raw_calls",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyOauthConsents(e,t){return await this.client.sendMessage({type:"list_my_oauth_consents",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyPermissionRequests(e,t){return await this.client.sendMessage({type:"list_my_permission_requests",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotificationChannels(e,t){return await this.client.sendMessage({type:"list_notification_channels",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotifications(e,t){return await this.client.sendMessage({type:"list_notifications",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthClients(e,t){return await this.client.sendMessage({type:"list_oauth_clients",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthRegistrationTokens(e,t){return await this.client.sendMessage({type:"list_oauth_registration_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOwnedRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_owned_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listPendingLearningData(e,t){return await this.client.sendMessage({type:"list_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listQdrantCollections(e,t){return await this.client.sendMessage({type:"list_qdrant_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRowstoreCollections(e,t){return await this.client.sendMessage({type:"list_rowstore_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listSpaces(e,t){return await this.client.sendMessage({type:"list_spaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listStudioWorkspaces(e,t){return await this.client.sendMessage({type:"list_studio_workspaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockBranches(e,t){return await this.client.sendMessage({type:"list_workblock_branches",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentCloneOperations(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_clone_operations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartOptions(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_options",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartUsers(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_users",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironments(e,t){return await this.client.sendMessage({type:"list_workblock_data_environments",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDefinitions(e,t){return await this.client.sendMessage({type:"list_workblock_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockEntityStoreSavedQueries(e,t){return await this.client.sendMessage({type:"list_workblock_entity_store_saved_queries",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRegistrations(e,t){return await this.client.sendMessage({type:"list_workblock_registrations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRowCollections(e,t){return await this.client.sendMessage({type:"list_workblock_row_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataSchemaVersions(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_schema_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataTruncations(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_truncations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunners(e,t){return await this.client.sendMessage({type:"list_workblock_runners",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockSchedules(e,t){return await this.client.sendMessage({type:"list_workblock_schedules",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockVersions(e,t){return await this.client.sendMessage({type:"list_workblock_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsCheck(e,t){return await this.client.sendMessage({type:"permissions_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsDefinitions(e,t){return await this.client.sendMessage({type:"permissions_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsListSubjects(e,t){return await this.client.sendMessage({type:"permissions_list_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsLookupResources(e,t){return await this.client.sendMessage({type:"permissions_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async previewContinueFromMessage(e,t){return await this.client.sendMessage({type:"preview_continue_from_message",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryAuditLog(e,t){return await this.client.sendMessage({type:"query_audit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockEntityStore(e,t){return await this.client.sendMessage({type:"query_workblock_entity_store",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockRunData(e,t){return await this.client.sendMessage({type:"query_workblock_run_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async repeatDone(e,t){return await this.client.sendMessage({type:"repeat_done",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockByTask(e,t){return await this.client.sendMessage({type:"resolve_workblock_by_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockContent(e,t){return await this.client.sendMessage({type:"resolve_workblock_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzCheck(e,t){return await this.client.sendMessage({type:"runtime_authz_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupResources(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupSubjects(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTest(e,t){return await this.client.sendMessage({type:"sandbox_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTestResponse(e,t){return await this.client.sendMessage({type:"sandbox_test_response",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async searchLearningExamples(e,t){return await this.client.sendMessage({type:"search_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskProgress(e,t){return await this.client.sendMessage({type:"send_task_progress",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskRunEvent(e,t){return await this.client.sendMessage({type:"send_task_run_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setAgentComplete(e,t){return await this.client.sendMessage({type:"set_agent_complete",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"set_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalExportHistory(e,t){return await this.client.sendMessage({type:"temporal_export_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetStack(e,t){return await this.client.sendMessage({type:"temporal_get_stack",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetWorkflow(e,t){return await this.client.sendMessage({type:"temporal_get_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalListWorkflowTypes(e,t){return await this.client.sendMessage({type:"temporal_list_workflow_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalQueryWorkflow(e,t){return await this.client.sendMessage({type:"temporal_query_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalSearchWorkflows(e,t){return await this.client.sendMessage({type:"temporal_search_workflows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalStreamHistory(e,t){return await this.client.sendMessage({type:"temporal_stream_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async upsertMemo(e,t){return await this.client.sendMessage({type:"upsert_memo",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateTask(e,t){return await this.client.sendMessage({type:"validate_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateWorkblock(e,t){return await this.client.sendMessage({type:"validate_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async wbRunTest(e,t){return await this.client.sendMessage({type:"wb_run_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async workblockReleaseList(e,t){return await this.client.sendMessage({type:"workblock_release_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsGetEvents(e,t){return await this.client.sendMessage({type:"yjs_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsResetEvents(e,t){return await this.client.sendMessage({type:"yjs_reset_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_stream_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async requestWithTracking(e,t,i){let n=Date.now(),r={...this.analyticsClient?.now?.(),...this.requestAnalyticsContext(i),trigger:i?.trigger??"user",stream_id:i?.streamId,thread_id:i?.threadId,...this.sanitizeForAnalytics(t)};try{let o=await this.client.sendMessage({type:e,stream_id:i?.streamId,thread_id:i?.threadId,timeout:i?.timeoutSeconds,task_id:i?.taskId,model:i?.model,reasoning_effort:i?.reasoningEffort,request:t});return this.trackEventSafely(`user-action/${e}`,{...r,...typeof i?.analyticsContext=="function"?this.requestAnalyticsContext(i,o):{},...this.resultIdsForAnalytics(e,o),...this.mergeOutcomeForAnalytics(e,o),success:!0,duration_ms:Date.now()-n}),o}catch(o){throw this.trackEventSafely(`user-action/${e}`,{...r,success:!1,duration_ms:Date.now()-n,error_type:o instanceof Error?o.name:"Unknown",error_code:o instanceof Error&&"code"in o&&typeof o.code=="string"&&o.code?o.code:void 0}),o}}requestAnalyticsContext(e,t){try{return typeof e?.analyticsContext=="function"?e.analyticsContext(t):e?.analyticsContext??{}}catch{return{}}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(i){console.error("Analytics tracking failed:",i)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[i,n]of Object.entries(e))(i.endsWith("_id")||i.endsWith("_ids")||i==="id")&&(t[cc(i)]=n);return t}resultIdsForAnalytics(e,t){if(!t||typeof t!="object"||Array.isArray(t))return{};let i=t,n={},r=Pw[e]??[];for(let o of r){let a=i[o];typeof a=="string"?n[`result_${cc(o)}`]=a:a&&typeof a=="object"&&"id"in a&&typeof a.id=="string"&&(n[`result_${cc(o)}_id`]=a.id)}return n}mergeOutcomeForAnalytics(e,t){if(!t||typeof t!="object")return{};let i={};return"merge_success"in t&&typeof t.merge_success=="boolean"?i.merge_success=t.merge_success:(e==="accept_thread_workblock"||e==="merge_workblock_branch"||e==="revert_workblock_commit")&&"success"in t&&typeof t.success=="boolean"&&(i.merge_success=t.success),"conflict_files"in t&&Array.isArray(t.conflict_files)&&(i.conflict_count=t.conflict_files.length),i}};var zs=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Ae=180,Ii=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];pushHandlers=new Map;ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;runnerStartAllowanceMs=95e3;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new lr({sendMessage:e=>this.send(e)});constructor(e=!1){this.debug=e}addStreamHandler(e){this.streamHandlers.push(e)}addEventHandler(e){this.eventHandlers.push(e)}addCurrentUserHandler(e){this.currentUserHandlers.push(e)}addErrorHandler(e){this.errorHandlers.push(e)}addConnectionErrorHandler(e){this.connectionErrorHandlers.push(e)}addOnDisconnect(e){this.onDisconnect.push(e)}useTokenSource(e){this.tokenSource=e}addPushHandler(e,t){this.pushHandlers.set(e,[...this.pushHandlers.get(e)??[],t])}close(){this.closing=!0,this.ws?.close()}connect(e,t){this.connectionHost=e,this.lastConnectionError=void 0,this.connected=!1,this.closing=!1,e.indexOf("://")===-1&&(e=`https://${e}`),this.token=t;let i=new URL(e);i.protocol==="ws:"?i.protocol="http:":i.protocol==="wss:"&&(i.protocol="https:"),!i.hostname.startsWith("api.")&&!i.hostname.startsWith("localhost")&&(i.hostname=`api.${i.hostname}`),i.pathname=i.pathname.replace("/workblocks/streams",""),i.pathname.endsWith("/")&&(i.pathname=i.pathname.slice(0,-1)),i.pathname=i.pathname+"/blobs",this.blobURL=i.toString();let n=new URL(e);switch(n.protocol){case"https:":n.protocol="wss:";break;case"http:":n.protocol="ws:";break}!n.hostname.startsWith("api.")&&!n.hostname.startsWith("localhost")&&(n.hostname=`api.${n.hostname}`),n.pathname.endsWith("/streams")||(n.pathname="/workblocks/streams"),this.connectionUrl=n.toString();let r=new cr(n.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=r,r.on("open",()=>{this.ws===r&&(this.connected=!0,this.lastConnectionError=void 0)}),r.on("unexpected-response",(o,a)=>{this.ws===r&&this.reportConnectionError(`Unexpected server response: ${a.statusCode}`,a.statusCode),r.terminate()}),r.on("message",o=>{if(this.ws!==r)return;let a=JSON.parse(o.toString());if(this.debug&&console.error("Received message","type"in a?a.type:"error","reply_to"in a?a.reply_to:void 0),"reply_to"in a){if(a.reply_to===void 0)return;let c=this.store[a.reply_to];c&&(delete this.store[a.reply_to],clearTimeout(c.timeoutHandle),"error"in a?c.reject(new zs(a.error,a.error_type??"")):c.resolve(a.response));return}if("error"in a){this.errorHandlers.forEach(c=>c(a.error));return}a.type==="streams"?this.handleListStreams(a.response):a.type==="events"?this.handleEvents(a.response).catch(c=>{console.error(c)}):a.type==="whoami"&&this.handleCurrentUser(a.response),this.pushHandlers.get(a.type)?.forEach(c=>{try{c(a.response)}catch(u){console.error(u)}})}),r.on("close",(o,a)=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(`Connection closed before it was established. Code: ${o}, Reason: ${a||"none"}`),this.rejectAllPending(new Error(`WebSocket disconnected. Code: ${o}, Reason: ${a}`)),this.onDisconnect.forEach(c=>c()))}),r.on("error",async o=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(o.message),this.rejectAllPending(new Error(`WebSocket error: ${o.message}`)))})}waitForOpen(){if(this.connected)return Promise.resolve();let e=this.ws;return e?e.readyState===cr.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,i)=>{let n=()=>{c(),t()},r=u=>{c(),i(new Error(`WebSocket error: ${u.message}`))},o=(u,l)=>{c(),i(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},a=(u,l)=>{c(),i(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",n),e.removeListener("error",r),e.removeListener("unexpected-response",o),e.removeListener("close",a)};e.on("open",n),e.on("error",r),e.on("unexpected-response",o),e.on("close",a)}):Promise.reject(new Error("WebSocket not connected"))}fetchWithCache(e,t){return fetch(e,t)}async _send(e,t){return this.ws&&this.ws.readyState===cr.OPEN?(this.SequenceID++,new Promise((i,n)=>{let r=this.SequenceID,o=(t??this.requestTimeoutMs)+this.runnerStartAllowanceMs,a=setTimeout(()=>{let c=this.store[r];c&&(delete this.store[r],c.reject(new Error(`Request timed out after ${o}ms${c.type?` (type=${c.type})`:""}`)))},o);this.store[r]={resolve:i,reject:n,timeoutHandle:a,type:e.type},this.ws?.send(JSON.stringify({...e,seq:r}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,i={}){let n=i.timeoutSeconds;return await this._send({type:e,stream_id:i.streamId,timeout:n,request:t},n===void 0?void 0:(n+5)*1e3)}async send(e){let t=e.timeout===void 0?void 0:(e.timeout+5)*1e3;return await this._send(e,t)}async setWorkblock(e,t){let i=await this.requests.setWorkBlockV2({workblock:t},{streamId:e,timeoutSeconds:Ae});return{errors:i.errors??[],warnings:i.warnings??[]}}async getWorkblock(e){return await this.requests.getWorkblock({},{streamId:e})??void 0}async getWorkblockById(e){return await this.requests.getWorkblock({id:e})??void 0}async storeWorkblock(e){let t;try{if(t=await this.getWorkblockById(e.id),!t)throw new Error(`Workblock lookup for ${e.id} returned no definition`)}catch(r){if(!(r instanceof zs&&r.code==="NotFound"))throw r;t=void 0}if(!t)return await this.createWorkblock(e);let i=await this.requests.getEditStream({workblock_id:e.id}),n=await this.setWorkblock(i.id,e);if(n.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(n.errors)}`);return{stream:i,warnings:n.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Ae})}async createWorkblock(e,t){let i=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Ae});if(i.errors?.length)throw new Error(`Validation errors: ${JSON.stringify(i.errors)}`);return{stream:i.stream,warnings:i.warnings??[]}}async listWorkblockDefinitions(){return await this.requests.listWorkblockDefinitions({include_branches:!0})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}async listWorkblockDataEnvironments(e){return await this.requests.listWorkblockDataEnvironments({workblock_id:e})}async queryWorkblockEntityStore(e){return await this.requests.queryWorkblockEntityStore(e)}async listWorkblockEntityStoreSavedQueries(e){return await this.requests.listWorkblockEntityStoreSavedQueries(e)}async getSpace(e){return await this.requests.getSpace({slug:e})}async getActiveWorkblockSetting(e){return(await this.requests.getActiveWorkblockSetting({workblock_id:e})).branch}async setActiveWorkblockSetting(e,t){await this.requests.setActiveWorkblockSetting({workblock_id:e,branch:t})}async createStudioWorkspace(e,t,i,n=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:i,create_user_branch:n})).stream}async createWorkblockVersion(e,t,i,n){return(await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,source_ref:i,workspace_name:n},{timeoutSeconds:Ae})).stream}async findStudioWorkspaceOnBranch(e,t){return(await this.requests.findStudioWorkspaceOnBranch({workblock_id:e,target_branch:t})).stream_id}async getStudioWorkspace(e){return(await this.requests.getStudioWorkspace({stream_id:e})).workspace??void 0}async listStudioWorkspaces(e,t){if(!e&&!t)throw new Error("listStudioWorkspaces requires a user id or a workblock id");return(await this.requests.listStudioWorkspaces({user_id:e,workblock_id:t})).workspaces??[]}async getBlob(e){return this.debug&&console.error(`Getting blob ${e}`),e.startsWith("::bw:data:")?(await this.getBlobContent(e)).text:e}async getBlobContent(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",text:await t.text()}}async getBlobBytes(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",bytes:new Uint8Array(await t.arrayBuffer())}}async fetchBlob(e){let t=this.tokenSource?await this.tokenSource():this.token,i=await this.fetchWithCache(`${this.blobURL}?key=${encodeURIComponent(e)}`,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`Failed to fetch blob ${e}: ${i.status} ${i.statusText}`);return i}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,i)=>{let n=setTimeout(()=>i(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(r=>{clearTimeout(n),t(r)})})}async getWorkblockV2ById(e){return await this.requests.getWorkblockV2({id:e,resolve_blobs:!0})??void 0}async resolveWorkblockContent(e,t){return await this.requests.resolveWorkblockContent({workblock_id:e,commit_ref:t})}async setWorkblockV2(e,t,i){return await this.requests.setWorkBlockV2({workblock:t,branch:i.branch,expected_commit_ref:i.expectedCommitRef,advance_version:i.advanceVersion||void 0,commit_message:i.commitMessage},{streamId:e,timeoutSeconds:Ae})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Ae})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Ae})}async checkWorkblockBranchMergeability(e,t,i,n={}){return await this.requests.checkWorkblockBranchMergeability({workblock_id:e,base_branch:t,head_branch:i,compute_file_merges:n.computeFileMerges||void 0},{timeoutSeconds:Ae})}async mergeWorkblockBranch(e,t,i,n={}){return await this.requests.mergeWorkblockBranch({workblock_id:e,base_branch:t,head_branch:i,commit_message:n.commitMessage},{streamId:n.streamId,timeoutSeconds:Ae})}async resolveWorkblockMergeConflicts(e,t,i,n,r){return await this.requests.resolveWorkblockMergeConflicts({workblock_id:e,base_branch:t,head_branch:i,resolved_files:n,base_branch_commit:r.baseBranchCommit,head_branch_commit:r.headBranchCommit,commit_message:r.commitMessage},{streamId:r.streamId,timeoutSeconds:Ae})}async resetWorkblockBranch(e,t,i,n){await this.requests.resetWorkblockBranch({workblock_id:e,branch_name:t,source_ref:i,expected_commit_ref:n})}async setWorkblockCommitMessage(e,t,i){await this.requests.setWorkblockCommitMessage({workblock_id:e,commit_hash:t,title:i.split(`
|
|
152
|
+
`,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(Ss);let t=bC(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let i=0;i<=this.options.mpegOffsetTolerance;++i){let n=this.scanMpeg(i);if(n)return n}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?_s:z);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?_s:z);if(!(t>eC)&&!(de(this.tokenizer)&&2+t*12>ak))for(let i=0;i<t;++i){let n=await this.readTiffTag(e);if(n)return n}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},i=(e?_s:z).get(this.buffer,2),n=(e?md:j).get(this.buffer,4);if(i===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let a=(e?_s:z).get(this.buffer,8),c=(e?_s:z).get(this.buffer,10);if(a===28&&c===254||a===31&&c===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(de(this.tokenizer)&&n>tC)return t;let r=de(this.tokenizer)?ak:this.tokenizer.fileInfo.size;try{await $t(this.tokenizer,n,{maximumLength:r,reason:"TIFF IFD offset"})}catch(a){if(a instanceof P)return;throw a}let o;try{o=await this.readTiffIFD(e)}catch(a){if(a instanceof P)return;throw a}return o??t}if(i===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},mk=new Set(Yb),gk=new Set(Zb)});var xk={};Ps(xk,{FileTypeParser:()=>gi,fileTypeFromBlob:()=>hk,fileTypeFromBuffer:()=>pk,fileTypeFromFile:()=>SC,fileTypeFromStream:()=>NC,fileTypeFromTokenizer:()=>fk,fileTypeStream:()=>EC,supportedExtensions:()=>mk,supportedMimeTypes:()=>gk});function vC(s){return!(s instanceof RangeError)||s.message!=="offset is out of bounds"||typeof s.stack!="string"?!1:/strtok3[/\\]lib[/\\]stream[/\\]/.test(s.stack)}async function SC(s,e){return new gi(e).fromFile(s,e)}async function NC(s,e){return new gi(e).fromStream(s)}async function EC(s,e={}){return new gi(e).toDetectionStream(s,e)}var bk,jt,kk,Cd,gi,_k=B(()=>{bk=require("node:stream/web"),jt=require("node:stream"),kk=F(require("node:fs/promises"),1),Cd=require("node:fs");mb();Ed();Ed();gi=class extends Ns{async fromStream(e){this.options.signal?.throwIfAborted();let t=await(e instanceof bk.ReadableStream?this.createTokenizerFromWebStream(e):fb(e,this.getTokenizerOptions()));try{return await super.fromTokenizer(t)}catch(i){if(vC(i))return;throw i}finally{e instanceof jt.Readable&&!e.destroyed&&e.destroy()}}async fromFile(e){this.options.signal?.throwIfAborted();let t=await kk.default.open(e,Cd.constants.O_RDONLY|Cd.constants.O_NONBLOCK),i=await t.stat();if(!i.isFile()){await t.close();return}let n=new xs(t,{...this.getTokenizerOptions(),fileInfo:{path:e,size:i.size}});return super.fromTokenizer(n)}async toDetectionStream(e,t={}){if(!(e instanceof jt.Readable))return super.toDetectionStream(e,t);let{sampleSize:i=Ss}=t,{signal:n}=this.options,r=Nd(i);return n?.throwIfAborted(),new Promise((o,a)=>{let c=!1,u=()=>{e.off("error",d),e.off("readable",h),n?.removeEventListener("abort",p)},l=(f,m)=>{c||(c=!0,u(),f(m))},d=f=>{l(a,f)},p=()=>{e.destroyed||e.destroy(),l(a,n.reason)},h=()=>{(async()=>{try{let f=new jt.PassThrough,m=jt.pipeline?(0,jt.pipeline)(e,f,()=>{}):e.pipe(f),g=e.read(r)??e.read()??new Uint8Array(0);try{f.fileType=await this.fromBuffer(g)}catch(b){b instanceof P?f.fileType=void 0:l(a,b)}l(o,m)}catch(f){l(a,f)}})()};e.on("error",d),e.once("readable",h),n?.addEventListener("abort",p,{once:!0})})}}});var NR={};Ps(NR,{activate:()=>vR,connectToHost:()=>Wa,deactivate:()=>SR});module.exports=o_(NR);var N=F(require("vscode"));var dr=F(require("vscode"));var Cw=F(ch(),1),Rw=F(sr(),1),Aw=F(Ms(),1),Iw=F(Za(),1),Tw=F(ec(),1),Ow=F(oc(),1),bh=F(or(),1),Dw=F(gh(),1);var cr=bh.default;var cc=s=>s.replace("work_block","workblock"),ur=["module_id","parent_task_def_id","parent_task_id","run_id","stream_id","wcb_id"],Pw={ask_agent:["conversation_id","message_id","run_id"],authz_schema_apply:["version_id"],authz_schema_draft_emit_event:["workblock_id"],authz_schema_force_apply:["version_id"],authz_schema_initialize_for_workblock:["schema_id"],authz_schema_propose:["draft_id"],cancel_child:ur,complete_child:ur,continue_from_message:["thread_id"],convert_legacy_stream:["editing_task_id","id","parent_id"],create_access_token:["access_token"],create_group:["id"],create_oauth_client:["client"],create_oauth_registration_token:["registration_token"],create_stream:["run_id","stream_id"],create_studio_workspace:["stream","workspace"],create_user:["id"],create_workblock:["stream","workspace"],create_workblock_schedule:["id","user","wcb_id"],create_workblock_version:["stream","workspace"],discard_permission_request:["request_id"],get_edit_stream:["editing_task_id","id","parent_id"],get_space_stream:["run_id","stream_id"],initiate_credential_oauth:["attempt_id"],initiate_task_credential_oauth:["attempt_id"],interrupt_child:ur,message_child:ur,publish_to_registry:["id"],recreate_edit_stream:["stream"],register_workblock_event:["id","stream_id","workblock_id"],remix_workblock_v2:["workblock_id"],rename_data_environment:["environment"],request_permission:["request_id"],restart_studio_workspace_thread:["previous_thread_id","thread_id"],run_module:["run_id"],run_workblock_replay_tests:["workflow_id"],set_legal_hold:["run_id"],set_retention_policy:["workblock_id"],set_work_block:["work_block"],set_work_block_v2:["work_block"],start_branch_thread:["thread_id"],update_task:["task"],update_workblock_schedule:["id","user","wcb_id"],upsert_space:["id"]},lr=class{client;analyticsClient;constructor(e,t){this.client=e,this.analyticsClient=t??null}async acceptThreadWorkblock(e,t){return await this.requestWithTracking("accept_thread_workblock",e,t)}async acceptTos(e,t){return await this.requestWithTracking("accept_tos",e,t)}async addGroupMember(e,t){return await this.requestWithTracking("add_group_member",e,t)}async applyWorkblockDataModelDraft(e,t){return await this.requestWithTracking("apply_workblock_data_model_draft",e,t)}async applyWorkblockDeployedUpdates(e,t){return await this.requestWithTracking("apply_workblock_deployed_updates",e,t)}async applyWorkblockVersionUpdates(e,t){return await this.requestWithTracking("apply_workblock_version_updates",e,t)}async approveLearningData(e,t){return await this.requestWithTracking("approve_learning_data",e,t)}async askAgent(e,t){return await this.requestWithTracking("ask_agent",e,t)}async assign(e,t){return await this.requestWithTracking("assign",e,t)}async assignEditStream(e,t){return await this.requestWithTracking("assign_edit_stream",e,t)}async assignWorkBlockRuns(e,t){return await this.requestWithTracking("assign_work_block_runs",e,t)}async authzSchemaApply(e,t){return await this.requestWithTracking("authz_schema_apply",e,t)}async authzSchemaDiscardPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_discard_policy_draft",e,t)}async authzSchemaDraftEmitAwarenessEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_awareness_event",e,t)}async authzSchemaDraftEmitEvent(e,t){return await this.requestWithTracking("authz_schema_draft_emit_event",e,t)}async authzSchemaForceApply(e,t){return await this.requestWithTracking("authz_schema_force_apply",e,t)}async authzSchemaGrantRoleMembership(e,t){return await this.requestWithTracking("authz_schema_grant_role_membership",e,t)}async authzSchemaImportPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_import_policy_draft",e,t)}async authzSchemaInitializeForWorkblock(e,t){return await this.requestWithTracking("authz_schema_initialize_for_workblock",e,t)}async authzSchemaOpenPolicyDraft(e,t){return await this.requestWithTracking("authz_schema_open_policy_draft",e,t)}async authzSchemaPropose(e,t){return await this.requestWithTracking("authz_schema_propose",e,t)}async authzSchemaRevokeRoleMembership(e,t){return await this.requestWithTracking("authz_schema_revoke_role_membership",e,t)}async authzSchemaSavePolicyDraft(e,t){return await this.requestWithTracking("authz_schema_save_policy_draft",e,t)}async bulkTagLearningExamples(e,t){return await this.requestWithTracking("bulk_tag_learning_examples",e,t)}async cancelAgent(e,t){return await this.requestWithTracking("cancel_agent",e,t)}async cancelChild(e,t){return await this.requestWithTracking("cancel_child",e,t)}async cancelWb(e,t){return await this.requestWithTracking("cancel_wb",e,t)}async cancelWorkblockDataEnvironmentCloneOperation(e,t){return await this.requestWithTracking("cancel_workblock_data_environment_clone_operation",e,t)}async cancelWorkblockNotification(e,t){return await this.requestWithTracking("cancel_workblock_notification",e,t)}async changelogMarkSeen(e,t){return await this.requestWithTracking("changelog_mark_seen",e,t)}async chatQueue(e,t){return await this.requestWithTracking("chat_queue",e,t)}async cloneWorkblockDataEnvironment(e,t){return await this.requestWithTracking("clone_workblock_data_environment",e,t)}async closeStream(e,t){return await this.requestWithTracking("close_stream",e,t)}async completeChild(e,t){return await this.requestWithTracking("complete_child",e,t)}async completeConfigCredentialOauth(e,t){return await this.requestWithTracking("complete_config_credential_oauth",e,t)}async completeCredentialOauth(e,t){return await this.requestWithTracking("complete_credential_oauth",e,t)}async completeRunCredentialOauth(e,t){return await this.requestWithTracking("complete_run_credential_oauth",e,t)}async continueFromMessage(e,t){return await this.requestWithTracking("continue_from_message",e,t)}async continueUi(e,t){return await this.requestWithTracking("continue_ui",e,t)}async convertLegacyStream(e,t){return await this.requestWithTracking("convert_legacy_stream",e,t)}async createAccessToken(e,t){return await this.requestWithTracking("create_access_token",e,t)}async createCredential(e,t){return await this.requestWithTracking("create_credential",e,t)}async createGroup(e,t){return await this.requestWithTracking("create_group",e,t)}async createOauthClient(e,t){return await this.requestWithTracking("create_oauth_client",e,t)}async createOauthRegistrationToken(e,t){return await this.requestWithTracking("create_oauth_registration_token",e,t)}async createStream(e,t){return await this.requestWithTracking("create_stream",e,t)}async createStudioWorkspace(e,t){return await this.requestWithTracking("create_studio_workspace",e,t)}async createUser(e,t){return await this.requestWithTracking("create_user",e,t)}async createWorkblock(e,t){return await this.requestWithTracking("create_workblock",e,t)}async createWorkblockDataEnvironment(e,t){return await this.requestWithTracking("create_workblock_data_environment",e,t)}async createWorkblockSchedule(e,t){return await this.requestWithTracking("create_workblock_schedule",e,t)}async createWorkblockVersion(e,t){return await this.requestWithTracking("create_workblock_version",e,t)}async createWorkblockVersionUpdate(e,t){return await this.requestWithTracking("create_workblock_version_update",e,t)}async dataEnvironmentRequestApply(e,t){return await this.requestWithTracking("data_environment_request_apply",e,t)}async deleteAccessToken(e,t){return await this.requestWithTracking("delete_access_token",e,t)}async deleteAllWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("delete_all_workblock_registration_events",e,t)}async deleteCredential(e,t){return await this.requestWithTracking("delete_credential",e,t)}async deleteDataEnvironment(e,t){return await this.requestWithTracking("delete_data_environment",e,t)}async deleteGroup(e,t){return await this.requestWithTracking("delete_group",e,t)}async deleteLearningExample(e,t){return await this.requestWithTracking("delete_learning_example",e,t)}async deleteOauthClient(e,t){return await this.requestWithTracking("delete_oauth_client",e,t)}async deleteSpace(e,t){return await this.requestWithTracking("delete_space",e,t)}async deleteStudioWorkspace(e,t){return await this.requestWithTracking("delete_studio_workspace",e,t)}async deleteWorkblock(e,t){return await this.requestWithTracking("delete_workblock",e,t)}async deleteWorkblockBranch(e,t){return await this.requestWithTracking("delete_workblock_branch",e,t)}async deleteWorkblockRegistration(e,t){return await this.requestWithTracking("delete_workblock_registration",e,t)}async deleteWorkblockRegistrationEvent(e,t){return await this.requestWithTracking("delete_workblock_registration_event",e,t)}async deleteWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("delete_workblock_run_data_truncation",e,t)}async deleteWorkblockSchedule(e,t){return await this.requestWithTracking("delete_workblock_schedule",e,t)}async deployWorkblockVersion(e,t){return await this.requestWithTracking("deploy_workblock_version",e,t)}async disableWorkblockRegistration(e,t){return await this.requestWithTracking("disable_workblock_registration",e,t)}async discardPermissionRequest(e,t){return await this.requestWithTracking("discard_permission_request",e,t)}async dismissAllNotifications(e,t){return await this.requestWithTracking("dismiss_all_notifications",e,t)}async dismissNotification(e,t){return await this.requestWithTracking("dismiss_notification",e,t)}async enableWorkblockRegistration(e,t){return await this.requestWithTracking("enable_workblock_registration",e,t)}async ensureDefaultWorkblockDataEnvironments(e,t){return await this.requestWithTracking("ensure_default_workblock_data_environments",e,t)}async ensureStreamBranchHead(e,t){return await this.requestWithTracking("ensure_stream_branch_head",e,t)}async ensureWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("ensure_workblock_data_environment_namespace",e,t)}async executeWorkblockEntityStore(e,t){return await this.requestWithTracking("execute_workblock_entity_store",e,t)}async getEditStream(e,t){return await this.requestWithTracking("get_edit_stream",e,t)}async getSpaceStream(e,t){return await this.requestWithTracking("get_space_stream",e,t)}async grantWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("grant_workblock_data_environment_start",e,t)}async initiateConfigCredentialOauth(e,t){return await this.requestWithTracking("initiate_config_credential_oauth",e,t)}async initiateCredentialOauth(e,t){return await this.requestWithTracking("initiate_credential_oauth",e,t)}async initiateTaskCredentialOauth(e,t){return await this.requestWithTracking("initiate_task_credential_oauth",e,t)}async insertTasks(e,t){return await this.requestWithTracking("insert_tasks",e,t)}async installWorkblock(e,t){return await this.requestWithTracking("install_workblock",e,t)}async interruptChild(e,t){return await this.requestWithTracking("interrupt_child",e,t)}async invokeRunTask(e,t){return await this.requestWithTracking("invoke_run_task",e,t)}async invokeWorkblockTask(e,t){return await this.requestWithTracking("invoke_workblock_task",e,t)}async join(e,t){return await this.requestWithTracking("join",e,t)}async leave(e,t){return await this.requestWithTracking("leave",e,t)}async markAllNotificationsRead(e,t){return await this.requestWithTracking("mark_all_notifications_read",e,t)}async markNotificationRead(e,t){return await this.requestWithTracking("mark_notification_read",e,t)}async mergeWorkblockBranch(e,t){return await this.requestWithTracking("merge_workblock_branch",e,t)}async messageChild(e,t){return await this.requestWithTracking("message_child",e,t)}async peekWorkblockRegistrationEvents(e,t){return await this.requestWithTracking("peek_workblock_registration_events",e,t)}async permissionsGrant(e,t){return await this.requestWithTracking("permissions_grant",e,t)}async permissionsRevoke(e,t){return await this.requestWithTracking("permissions_revoke",e,t)}async promoteWorkblockDataModel(e,t){return await this.requestWithTracking("promote_workblock_data_model",e,t)}async publishToRegistry(e,t){return await this.requestWithTracking("publish_to_registry",e,t)}async recreateEditStream(e,t){return await this.requestWithTracking("recreate_edit_stream",e,t)}async reembedValidationSet(e,t){return await this.requestWithTracking("reembed_validation_set",e,t)}async registerWorkblockEvent(e,t){return await this.requestWithTracking("register_workblock_event",e,t)}async registrySearch(e,t){return await this.requestWithTracking("registry_search",e,t)}async registrySetParameters(e,t){return await this.requestWithTracking("registry_set_parameters",e,t)}async registrySetTags(e,t){return await this.requestWithTracking("registry_set_tags",e,t)}async rejectLearningData(e,t){return await this.requestWithTracking("reject_learning_data",e,t)}async rejectThreadWorkblock(e,t){return await this.requestWithTracking("reject_thread_workblock",e,t)}async remixWorkblockV2(e,t){return await this.requestWithTracking("remix_workblock_v2",e,t)}async removeGroupMember(e,t){return await this.requestWithTracking("remove_group_member",e,t)}async removeThread(e,t){return await this.requestWithTracking("remove_thread",e,t)}async removeWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("remove_workblock_data_environment_namespace",e,t)}async renameDataEnvironment(e,t){return await this.requestWithTracking("rename_data_environment",e,t)}async requestPermission(e,t){return await this.requestWithTracking("request_permission",e,t)}async resetTask(e,t){return await this.requestWithTracking("reset_task",e,t)}async resetWorkblockBranch(e,t){return await this.requestWithTracking("reset_workblock_branch",e,t)}async resetWorkblockDataEnvironmentNamespace(e,t){return await this.requestWithTracking("reset_workblock_data_environment_namespace",e,t)}async resolveWorkblockMergeConflicts(e,t){return await this.requestWithTracking("resolve_workblock_merge_conflicts",e,t)}async restartStudioWorkspaceThread(e,t){return await this.requestWithTracking("restart_studio_workspace_thread",e,t)}async restartWorkblock(e,t){return await this.requestWithTracking("restart_workblock",e,t)}async resumeRetry(e,t){return await this.requestWithTracking("resume_retry",e,t)}async retryWorkblockDataModelApply(e,t){return await this.requestWithTracking("retry_workblock_data_model_apply",e,t)}async revertWorkblockCommit(e,t){return await this.requestWithTracking("revert_workblock_commit",e,t)}async revokeAllOauthConsents(e,t){return await this.requestWithTracking("revoke_all_oauth_consents",e,t)}async revokeOauthConsent(e,t){return await this.requestWithTracking("revoke_oauth_consent",e,t)}async revokeOauthRegistrationToken(e,t){return await this.requestWithTracking("revoke_oauth_registration_token",e,t)}async revokeWorkblockDataEnvironmentStart(e,t){return await this.requestWithTracking("revoke_workblock_data_environment_start",e,t)}async rotateOauthClientSecret(e,t){return await this.requestWithTracking("rotate_oauth_client_secret",e,t)}async runModule(e,t){return await this.requestWithTracking("run_module",e,t)}async runSingleTask(e,t){return await this.requestWithTracking("run_single_task",e,t)}async runSubgraph(e,t){return await this.requestWithTracking("run_subgraph",e,t)}async runTask(e,t){return await this.requestWithTracking("run_task",e,t)}async runWorkblockReplayTests(e,t){return await this.requestWithTracking("run_workblock_replay_tests",e,t)}async runtimeAuthzAttachRole(e,t){return await this.requestWithTracking("runtime_authz_attach_role",e,t)}async runtimeAuthzDeleteRelation(e,t){return await this.requestWithTracking("runtime_authz_delete_relation",e,t)}async runtimeAuthzDetachRole(e,t){return await this.requestWithTracking("runtime_authz_detach_role",e,t)}async runtimeAuthzStoreRelation(e,t){return await this.requestWithTracking("runtime_authz_store_relation",e,t)}async sendMessage(e,t){return await this.requestWithTracking("send_message",e,t)}async sendWorkblockNotification(e,t){return await this.requestWithTracking("send_workblock_notification",e,t)}async setActiveWorkblockSetting(e,t){return await this.requestWithTracking("set_active_workblock_setting",e,t)}async setAutoApproveConfig(e,t){return await this.requestWithTracking("set_auto_approve_config",e,t)}async setConsumptionLimits(e,t){return await this.requestWithTracking("set_consumption_limits",e,t)}async setEditing(e,t){return await this.requestWithTracking("set_editing",e,t)}async setKeepOpenOnComplete(e,t){return await this.requestWithTracking("set_keep_open_on_complete",e,t)}async setLegalHold(e,t){return await this.requestWithTracking("set_legal_hold",e,t)}async setLogging(e,t){return await this.requestWithTracking("set_logging",e,t)}async setNotificationChannelMuted(e,t){return await this.requestWithTracking("set_notification_channel_muted",e,t)}async setOauthClientEnabled(e,t){return await this.requestWithTracking("set_oauth_client_enabled",e,t)}async setRetentionPolicy(e,t){return await this.requestWithTracking("set_retention_policy",e,t)}async setStudioWorkspaceArchived(e,t){return await this.requestWithTracking("set_studio_workspace_archived",e,t)}async setStudioWorkspaceThread(e,t){return await this.requestWithTracking("set_studio_workspace_thread",e,t)}async setUserSetting(e,t){return await this.requestWithTracking("set_user_setting",e,t)}async setWorkBlock(e,t){return await this.requestWithTracking("set_work_block",e,t)}async setWorkBlockV2(e,t){return await this.requestWithTracking("set_work_block_v2",e,t)}async setWorkblockCommitMessage(e,t){return await this.requestWithTracking("set_workblock_commit_message",e,t)}async setWorkblockConfig(e,t){return await this.requestWithTracking("set_workblock_config",e,t)}async setWorkblockRunDataTruncation(e,t){return await this.requestWithTracking("set_workblock_run_data_truncation",e,t)}async setWorkblockSchedulePaused(e,t){return await this.requestWithTracking("set_workblock_schedule_paused",e,t)}async startBranchThread(e,t){return await this.requestWithTracking("start_branch_thread",e,t)}async startChild(e,t){return await this.requestWithTracking("start_child",e,t)}async startWb(e,t){return await this.requestWithTracking("start_wb",e,t)}async storeWorkBlock(e,t){return await this.requestWithTracking("store_work_block",e,t)}async switchStreamBranch(e,t){return await this.requestWithTracking("switch_stream_branch",e,t)}async syncWorkblock(e,t){return await this.requestWithTracking("sync_workblock",e,t)}async syncWorkblockVersion(e,t){return await this.requestWithTracking("sync_workblock_version",e,t)}async temporalCancelWorkflow(e,t){return await this.requestWithTracking("temporal_cancel_workflow",e,t)}async temporalResetWorkflow(e,t){return await this.requestWithTracking("temporal_reset_workflow",e,t)}async temporalSignalWorkflow(e,t){return await this.requestWithTracking("temporal_signal_workflow",e,t)}async temporalTerminateWorkflow(e,t){return await this.requestWithTracking("temporal_terminate_workflow",e,t)}async transcribeAudio(e,t){return await this.requestWithTracking("transcribe_audio",e,t)}async triggerWorkblockSchedule(e,t){return await this.requestWithTracking("trigger_workblock_schedule",e,t)}async uninstallWorkblock(e,t){return await this.requestWithTracking("uninstall_workblock",e,t)}async updateAccessToken(e,t){return await this.requestWithTracking("update_access_token",e,t)}async updateAccount(e,t){return await this.requestWithTracking("update_account",e,t)}async updateCredential(e,t){return await this.requestWithTracking("update_credential",e,t)}async updateGroup(e,t){return await this.requestWithTracking("update_group",e,t)}async updateLearningExample(e,t){return await this.requestWithTracking("update_learning_example",e,t)}async updateOauthClient(e,t){return await this.requestWithTracking("update_oauth_client",e,t)}async updateProfile(e,t){return await this.requestWithTracking("update_profile",e,t)}async updateStudioWorkspaceTitle(e,t){return await this.requestWithTracking("update_studio_workspace_title",e,t)}async updateTask(e,t){return await this.requestWithTracking("update_task",e,t)}async updateUser(e,t){return await this.requestWithTracking("update_user",e,t)}async updateWorkblockEntityStoreRow(e,t){return await this.requestWithTracking("update_workblock_entity_store_row",e,t)}async updateWorkblockSchedule(e,t){return await this.requestWithTracking("update_workblock_schedule",e,t)}async upsertSpace(e,t){return await this.requestWithTracking("upsert_space",e,t)}async addLearningData(e,t){return await this.client.sendMessage({type:"add_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async addStreamLogs(e,t){return await this.client.sendMessage({type:"add_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDiffVersions(e,t){return await this.client.sendMessage({type:"authz_schema_diff_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftGetEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftSubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_subscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeAwarenessEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_awareness_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeDraftReplacedEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_draft_replaced_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaDraftUnsubscribeValidationEvents(e,t){return await this.client.sendMessage({type:"authz_schema_draft_unsubscribe_validation_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGet(e,t){return await this.client.sendMessage({type:"authz_schema_get",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetAppliedEnvelope(e,t){return await this.client.sendMessage({type:"authz_schema_get_applied_envelope",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetDraftState(e,t){return await this.client.sendMessage({type:"authz_schema_get_draft_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetForWorkblock(e,t){return await this.client.sendMessage({type:"authz_schema_get_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaGetVersion(e,t){return await this.client.sendMessage({type:"authz_schema_get_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaImpactReport(e,t){return await this.client.sendMessage({type:"authz_schema_impact_report",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListOrphanedResources(e,t){return await this.client.sendMessage({type:"authz_schema_list_orphaned_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListRoleMemberships(e,t){return await this.client.sendMessage({type:"authz_schema_list_role_memberships",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaListVersions(e,t){return await this.client.sendMessage({type:"authz_schema_list_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaPreviewValidation(e,t){return await this.client.sendMessage({type:"authz_schema_preview_validation",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaQueryAudit(e,t){return await this.client.sendMessage({type:"authz_schema_query_audit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async authzSchemaValidate(e,t){return await this.client.sendMessage({type:"authz_schema_validate",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchCheckWorkblockMergeability(e,t){return await this.client.sendMessage({type:"batch_check_workblock_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async batchGetEvents(e,t){return await this.client.sendMessage({type:"batch_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async changelogList(e,t){return await this.client.sendMessage({type:"changelog_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkChild(e,t){return await this.client.sendMessage({type:"check_child",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkCredential(e,t){return await this.client.sendMessage({type:"check_credential",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkPermission(e,t){return await this.client.sendMessage({type:"check_permission",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkStreamAccess(e,t){return await this.client.sendMessage({type:"check_stream_access",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async checkWorkblockBranchMergeability(e,t){return await this.client.sendMessage({type:"check_workblock_branch_mergeability",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async closeWorkblockRunDataSession(e,t){return await this.client.sendMessage({type:"close_workblock_run_data_session",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async consoleLog(e,t){return await this.client.sendMessage({type:"console_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async countWorkblockRegistrationEvents(e,t){return await this.client.sendMessage({type:"count_workblock_registration_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async createWorkblockTokenUrl(e,t){return await this.client.sendMessage({type:"create_workblock_token_url",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async diffWorkblockReplayTest(e,t){return await this.client.sendMessage({type:"diff_workblock_replay_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async discoverCredentialOauth(e,t){return await this.client.sendMessage({type:"discover_credential_oauth",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async evaluateWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"evaluate_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findLearningDuplicates(e,t){return await this.client.sendMessage({type:"find_learning_duplicates",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findStudioWorkspaceOnBranch(e,t){return await this.client.sendMessage({type:"find_studio_workspace_on_branch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async findWorkblockRows(e,t){return await this.client.sendMessage({type:"find_workblock_rows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAccount(e,t){return await this.client.sendMessage({type:"get_account",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getActiveWorkblockSetting(e,t){return await this.client.sendMessage({type:"get_active_workblock_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAffectedRunsCount(e,t){return await this.client.sendMessage({type:"get_affected_runs_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAgentTurn(e,t){return await this.client.sendMessage({type:"get_agent_turn",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAutoApproveConfig(e,t){return await this.client.sendMessage({type:"get_auto_approve_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getAvailableModels(e,t){return await this.client.sendMessage({type:"get_available_models",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getBaseWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_base_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getConsumptionStatus(e,t){return await this.client.sendMessage({type:"get_consumption_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getCredentialForEdit(e,t){return await this.client.sendMessage({type:"get_credential_for_edit",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDefaultWorkblockRegistration(e,t){return await this.client.sendMessage({type:"get_default_workblock_registration",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getDocsContent(e,t){return await this.client.sendMessage({type:"get_docs_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEditStreamId(e,t){return await this.client.sendMessage({type:"get_edit_stream_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getEvents(e,t){return await this.client.sendMessage({type:"get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getInstalledWorkblock(e,t){return await this.client.sendMessage({type:"get_installed_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExample(e,t){return await this.client.sendMessage({type:"get_learning_example",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLearningExamples(e,t){return await this.client.sendMessage({type:"get_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLlmRawCall(e,t){return await this.client.sendMessage({type:"get_llm_raw_call",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getLoginHistory(e,t){return await this.client.sendMessage({type:"get_login_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getPendingLearningData(e,t){return await this.client.sendMessage({type:"get_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblock(e,t){return await this.client.sendMessage({type:"get_registry_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRegistryWorkblockInfo(e,t){return await this.client.sendMessage({type:"get_registry_workblock_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getReplayTestRunState(e,t){return await this.client.sendMessage({type:"get_replay_test_run_state",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getRetentionPolicy(e,t){return await this.client.sendMessage({type:"get_retention_policy",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpace(e,t){return await this.client.sendMessage({type:"get_space",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getSpaceId(e,t){return await this.client.sendMessage({type:"get_space_id",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStream(e,t){return await this.client.sendMessage({type:"get_stream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStreamLogs(e,t){return await this.client.sendMessage({type:"get_stream_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspace(e,t){return await this.client.sendMessage({type:"get_studio_workspace",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getStudioWorkspacePresence(e,t){return await this.client.sendMessage({type:"get_studio_workspace_presence",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTaskLogs(e,t){return await this.client.sendMessage({type:"get_task_logs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineAffectedCount(e,t){return await this.client.sendMessage({type:"get_timeline_affected_count",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTimelineEventTypes(e,t){return await this.client.sendMessage({type:"get_timeline_event_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getTos(e,t){return await this.client.sendMessage({type:"get_tos",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUserSetting(e,t){return await this.client.sendMessage({type:"get_user_setting",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getUsers(e,t){return await this.client.sendMessage({type:"get_users",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkBlockRuns(e,t){return await this.client.sendMessage({type:"get_work_block_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblock(e,t){return await this.client.sendMessage({type:"get_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockBranchInfo(e,t){return await this.client.sendMessage({type:"get_workblock_branch_info",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitLog(e,t){return await this.client.sendMessage({type:"get_workblock_commit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockCommitPatch(e,t){return await this.client.sendMessage({type:"get_workblock_commit_patch",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockConfig(e,t){return await this.client.sendMessage({type:"get_workblock_config",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelDeployPreview(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_deploy_preview",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelRunReadiness(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_run_readiness",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataModelStatus(e,t){return await this.client.sendMessage({type:"get_workblock_data_model_status",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockDataSchema(e,t){return await this.client.sendMessage({type:"get_workblock_data_schema",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockFileContent(e,t){return await this.client.sendMessage({type:"get_workblock_file_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockHistoryBundle(e,t){return await this.client.sendMessage({type:"get_workblock_history_bundle",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockMissingCredentials(e,t){return await this.client.sendMessage({type:"get_workblock_missing_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsConsumption(e,t){return await this.client.sendMessage({type:"get_workblock_operations_consumption",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsCurrent(e,t){return await this.client.sendMessage({type:"get_workblock_operations_current",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsFailures(e,t){return await this.client.sendMessage({type:"get_workblock_operations_failures",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsOutcomes(e,t){return await this.client.sendMessage({type:"get_workblock_operations_outcomes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockOperationsRuns(e,t){return await this.client.sendMessage({type:"get_workblock_operations_runs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRun(e,t){return await this.client.sendMessage({type:"get_workblock_run",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunDataSchemaVersionDetails(e,t){return await this.client.sendMessage({type:"get_workblock_run_data_schema_version_details",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunInputs(e,t){return await this.client.sendMessage({type:"get_workblock_run_inputs",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockRunResult(e,t){return await this.client.sendMessage({type:"get_workblock_run_result",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockSchedule(e,t){return await this.client.sendMessage({type:"get_workblock_schedule",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockTaskErrors(e,t){return await this.client.sendMessage({type:"get_workblock_task_errors",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUi(e,t){return await this.client.sendMessage({type:"get_workblock_ui",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockUpstream(e,t){return await this.client.sendMessage({type:"get_workblock_upstream",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockV2(e,t){return await this.client.sendMessage({type:"get_workblock_v2",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async getWorkblockVersion(e,t){return await this.client.sendMessage({type:"get_workblock_version",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeCatalog(e,t){return await this.client.sendMessage({type:"graphlake_catalog",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeExplore(e,t){return await this.client.sendMessage({type:"graphlake_explore",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeIntrospect(e,t){return await this.client.sendMessage({type:"graphlake_introspect",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeNode(e,t){return await this.client.sendMessage({type:"graphlake_node",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeQuery(e,t){return await this.client.sendMessage({type:"graphlake_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeSearchNodes(e,t){return await this.client.sendMessage({type:"graphlake_search_nodes",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiQuery(e,t){return await this.client.sendMessage({type:"graphlake_ui_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiSubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_subscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async graphlakeUiUnsubscribe(e,t){return await this.client.sendMessage({type:"graphlake_ui_unsubscribe",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async help(e,t){return await this.client.sendMessage({type:"help",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async inspectFile(e,t){return await this.client.sendMessage({type:"inspect_file",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async invokeTask(e,t){return await this.client.sendMessage({type:"invoke_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listAccessTokens(e,t){return await this.client.sendMessage({type:"list_access_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listApprovedLearningSets(e,t){return await this.client.sendMessage({type:"list_approved_learning_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCategories(e,t){return await this.client.sendMessage({type:"list_categories",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentialTypes(e,t){return await this.client.sendMessage({type:"list_credential_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listCredentials(e,t){return await this.client.sendMessage({type:"list_credentials",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroupMembers(e,t){return await this.client.sendMessage({type:"list_group_members",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listGroups(e,t){return await this.client.sendMessage({type:"list_groups",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listInstalledWorkblocks(e,t){return await this.client.sendMessage({type:"list_installed_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningDataSets(e,t){return await this.client.sendMessage({type:"list_learning_data_sets",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamples(e,t){return await this.client.sendMessage({type:"list_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningExamplesByScore(e,t){return await this.client.sendMessage({type:"list_learning_examples_by_score",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLearningSetsForWorkblock(e,t){return await this.client.sendMessage({type:"list_learning_sets_for_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listLlmRawCalls(e,t){return await this.client.sendMessage({type:"list_llm_raw_calls",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyOauthConsents(e,t){return await this.client.sendMessage({type:"list_my_oauth_consents",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listMyPermissionRequests(e,t){return await this.client.sendMessage({type:"list_my_permission_requests",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotificationChannels(e,t){return await this.client.sendMessage({type:"list_notification_channels",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listNotifications(e,t){return await this.client.sendMessage({type:"list_notifications",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthClients(e,t){return await this.client.sendMessage({type:"list_oauth_clients",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOauthRegistrationTokens(e,t){return await this.client.sendMessage({type:"list_oauth_registration_tokens",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listOwnedRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_owned_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listPendingLearningData(e,t){return await this.client.sendMessage({type:"list_pending_learning_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listQdrantCollections(e,t){return await this.client.sendMessage({type:"list_qdrant_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRegistryWorkblocks(e,t){return await this.client.sendMessage({type:"list_registry_workblocks",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listRowstoreCollections(e,t){return await this.client.sendMessage({type:"list_rowstore_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listSpaces(e,t){return await this.client.sendMessage({type:"list_spaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listStudioWorkspaces(e,t){return await this.client.sendMessage({type:"list_studio_workspaces",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockBranches(e,t){return await this.client.sendMessage({type:"list_workblock_branches",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentCloneOperations(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_clone_operations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironmentStartOptions(e,t){return await this.client.sendMessage({type:"list_workblock_data_environment_start_options",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDataEnvironments(e,t){return await this.client.sendMessage({type:"list_workblock_data_environments",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockDefinitions(e,t){return await this.client.sendMessage({type:"list_workblock_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockEntityStoreSavedQueries(e,t){return await this.client.sendMessage({type:"list_workblock_entity_store_saved_queries",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRegistrations(e,t){return await this.client.sendMessage({type:"list_workblock_registrations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRowCollections(e,t){return await this.client.sendMessage({type:"list_workblock_row_collections",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataSchemaVersions(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_schema_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunDataTruncations(e,t){return await this.client.sendMessage({type:"list_workblock_run_data_truncations",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockRunners(e,t){return await this.client.sendMessage({type:"list_workblock_runners",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockSchedules(e,t){return await this.client.sendMessage({type:"list_workblock_schedules",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async listWorkblockVersions(e,t){return await this.client.sendMessage({type:"list_workblock_versions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsCheck(e,t){return await this.client.sendMessage({type:"permissions_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsDefinitions(e,t){return await this.client.sendMessage({type:"permissions_definitions",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsListSubjects(e,t){return await this.client.sendMessage({type:"permissions_list_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async permissionsLookupResources(e,t){return await this.client.sendMessage({type:"permissions_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async previewContinueFromMessage(e,t){return await this.client.sendMessage({type:"preview_continue_from_message",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryAuditLog(e,t){return await this.client.sendMessage({type:"query_audit_log",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockEntityStore(e,t){return await this.client.sendMessage({type:"query_workblock_entity_store",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async queryWorkblockRunData(e,t){return await this.client.sendMessage({type:"query_workblock_run_data",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async repeatDone(e,t){return await this.client.sendMessage({type:"repeat_done",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockByTask(e,t){return await this.client.sendMessage({type:"resolve_workblock_by_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async resolveWorkblockContent(e,t){return await this.client.sendMessage({type:"resolve_workblock_content",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzCheck(e,t){return await this.client.sendMessage({type:"runtime_authz_check",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupResources(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_resources",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async runtimeAuthzLookupSubjects(e,t){return await this.client.sendMessage({type:"runtime_authz_lookup_subjects",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTest(e,t){return await this.client.sendMessage({type:"sandbox_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sandboxTestResponse(e,t){return await this.client.sendMessage({type:"sandbox_test_response",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async searchLearningExamples(e,t){return await this.client.sendMessage({type:"search_learning_examples",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskProgress(e,t){return await this.client.sendMessage({type:"send_task_progress",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async sendTaskRunEvent(e,t){return await this.client.sendMessage({type:"send_task_run_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setAgentComplete(e,t){return await this.client.sendMessage({type:"set_agent_complete",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async setWorkblockRunDataTransformQuery(e,t){return await this.client.sendMessage({type:"set_workblock_run_data_transform_query",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalExportHistory(e,t){return await this.client.sendMessage({type:"temporal_export_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetStack(e,t){return await this.client.sendMessage({type:"temporal_get_stack",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalGetWorkflow(e,t){return await this.client.sendMessage({type:"temporal_get_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalListWorkflowTypes(e,t){return await this.client.sendMessage({type:"temporal_list_workflow_types",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalQueryWorkflow(e,t){return await this.client.sendMessage({type:"temporal_query_workflow",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalSearchWorkflows(e,t){return await this.client.sendMessage({type:"temporal_search_workflows",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async temporalStreamHistory(e,t){return await this.client.sendMessage({type:"temporal_stream_history",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async upsertMemo(e,t){return await this.client.sendMessage({type:"upsert_memo",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateTask(e,t){return await this.client.sendMessage({type:"validate_task",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async validateWorkblock(e,t){return await this.client.sendMessage({type:"validate_workblock",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async wbRunTest(e,t){return await this.client.sendMessage({type:"wb_run_test",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async workblockReleaseList(e,t){return await this.client.sendMessage({type:"workblock_release_list",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsGetEvents(e,t){return await this.client.sendMessage({type:"yjs_get_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsResetEvents(e,t){return await this.client.sendMessage({type:"yjs_reset_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamEmitEvent(e,t){return await this.client.sendMessage({type:"yjs_stream_emit_event",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsStreamUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_stream_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsSubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_subscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async yjsUnsubscribeEvents(e,t){return await this.client.sendMessage({type:"yjs_unsubscribe_events",stream_id:t?.streamId,thread_id:t?.threadId,timeout:t?.timeoutSeconds,task_id:t?.taskId,request:e})}async requestWithTracking(e,t,i){let n=Date.now(),r={...this.analyticsClient?.now?.(),...this.requestAnalyticsContext(i),trigger:i?.trigger??"user",stream_id:i?.streamId,thread_id:i?.threadId,...this.sanitizeForAnalytics(t)};try{let o=await this.client.sendMessage({type:e,stream_id:i?.streamId,thread_id:i?.threadId,timeout:i?.timeoutSeconds,task_id:i?.taskId,model:i?.model,reasoning_effort:i?.reasoningEffort,request:t});return this.trackEventSafely(`user-action/${e}`,{...r,...typeof i?.analyticsContext=="function"?this.requestAnalyticsContext(i,o):{},...this.resultIdsForAnalytics(e,o),...this.mergeOutcomeForAnalytics(e,o),success:!0,duration_ms:Date.now()-n}),o}catch(o){throw this.trackEventSafely(`user-action/${e}`,{...r,success:!1,duration_ms:Date.now()-n,error_type:o instanceof Error?o.name:"Unknown",error_code:o instanceof Error&&"code"in o&&typeof o.code=="string"&&o.code?o.code:void 0}),o}}requestAnalyticsContext(e,t){try{return typeof e?.analyticsContext=="function"?e.analyticsContext(t):e?.analyticsContext??{}}catch{return{}}}trackEventSafely(e,t){try{this.analyticsClient?.track?.(e,t)}catch(i){console.error("Analytics tracking failed:",i)}}sanitizeForAnalytics(e){if(!e||typeof e!="object")return{hasContent:!!e};let t={};for(let[i,n]of Object.entries(e))(i.endsWith("_id")||i.endsWith("_ids")||i==="id")&&(t[cc(i)]=n);return t}resultIdsForAnalytics(e,t){if(!t||typeof t!="object"||Array.isArray(t))return{};let i=t,n={},r=Pw[e]??[];for(let o of r){let a=i[o];typeof a=="string"?n[`result_${cc(o)}`]=a:a&&typeof a=="object"&&"id"in a&&typeof a.id=="string"&&(n[`result_${cc(o)}_id`]=a.id)}return n}mergeOutcomeForAnalytics(e,t){if(!t||typeof t!="object")return{};let i={};return"merge_success"in t&&typeof t.merge_success=="boolean"?i.merge_success=t.merge_success:(e==="accept_thread_workblock"||e==="merge_workblock_branch"||e==="revert_workblock_commit")&&"success"in t&&typeof t.success=="boolean"&&(i.merge_success=t.success),"conflict_files"in t&&Array.isArray(t.conflict_files)&&(i.conflict_count=t.conflict_files.length),i}};var zs=class extends Error{code;constructor(e,t){super(e),this.name="BwWebsocketError",this.code=t}},Ae=180,Ii=class{streamHandlers=[];eventHandlers=[];currentUserHandlers=[];onDisconnect=[];errorHandlers=[];connectionErrorHandlers=[];pushHandlers=new Map;ws=null;store={};SequenceID=0;connected;blobURL;token;tokenSource;lastCleanup=0;requestTimeoutMs=3e4;runnerStartAllowanceMs=95e3;connectionHost;connectionUrl;lastConnectionError;closing=!1;debug;currentUser;requests=new lr({sendMessage:e=>this.send(e)});constructor(e=!1){this.debug=e}addStreamHandler(e){this.streamHandlers.push(e)}addEventHandler(e){this.eventHandlers.push(e)}addCurrentUserHandler(e){this.currentUserHandlers.push(e)}addErrorHandler(e){this.errorHandlers.push(e)}addConnectionErrorHandler(e){this.connectionErrorHandlers.push(e)}addOnDisconnect(e){this.onDisconnect.push(e)}useTokenSource(e){this.tokenSource=e}addPushHandler(e,t){this.pushHandlers.set(e,[...this.pushHandlers.get(e)??[],t])}close(){this.closing=!0,this.ws?.close()}connect(e,t){this.connectionHost=e,this.lastConnectionError=void 0,this.connected=!1,this.closing=!1,e.indexOf("://")===-1&&(e=`https://${e}`),this.token=t;let i=new URL(e);i.protocol==="ws:"?i.protocol="http:":i.protocol==="wss:"&&(i.protocol="https:"),!i.hostname.startsWith("api.")&&!i.hostname.startsWith("localhost")&&(i.hostname=`api.${i.hostname}`),i.pathname=i.pathname.replace("/workblocks/streams",""),i.pathname.endsWith("/")&&(i.pathname=i.pathname.slice(0,-1)),i.pathname=i.pathname+"/blobs",this.blobURL=i.toString();let n=new URL(e);switch(n.protocol){case"https:":n.protocol="wss:";break;case"http:":n.protocol="ws:";break}!n.hostname.startsWith("api.")&&!n.hostname.startsWith("localhost")&&(n.hostname=`api.${n.hostname}`),n.pathname.endsWith("/streams")||(n.pathname="/workblocks/streams"),this.connectionUrl=n.toString();let r=new cr(n.toString(),{headers:{Authorization:`Bearer ${t}`}});this.ws=r,r.on("open",()=>{this.ws===r&&(this.connected=!0,this.lastConnectionError=void 0)}),r.on("unexpected-response",(o,a)=>{this.ws===r&&this.reportConnectionError(`Unexpected server response: ${a.statusCode}`,a.statusCode),r.terminate()}),r.on("message",o=>{if(this.ws!==r)return;let a=JSON.parse(o.toString());if(this.debug&&console.error("Received message","type"in a?a.type:"error","reply_to"in a?a.reply_to:void 0),"reply_to"in a){if(a.reply_to===void 0)return;let c=this.store[a.reply_to];c&&(delete this.store[a.reply_to],clearTimeout(c.timeoutHandle),"error"in a?c.reject(new zs(a.error,a.error_type??"")):c.resolve(a.response));return}if("error"in a){this.errorHandlers.forEach(c=>c(a.error));return}a.type==="streams"?this.handleListStreams(a.response):a.type==="events"?this.handleEvents(a.response).catch(c=>{console.error(c)}):a.type==="whoami"&&this.handleCurrentUser(a.response),this.pushHandlers.get(a.type)?.forEach(c=>{try{c(a.response)}catch(u){console.error(u)}})}),r.on("close",(o,a)=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(`Connection closed before it was established. Code: ${o}, Reason: ${a||"none"}`),this.rejectAllPending(new Error(`WebSocket disconnected. Code: ${o}, Reason: ${a}`)),this.onDisconnect.forEach(c=>c()))}),r.on("error",async o=>{this.ws===r&&(this.connected||this.closing||this.lastConnectionError||this.reportConnectionError(o.message),this.rejectAllPending(new Error(`WebSocket error: ${o.message}`)))})}waitForOpen(){if(this.connected)return Promise.resolve();let e=this.ws;return e?e.readyState===cr.OPEN?(this.connected=!0,Promise.resolve()):new Promise((t,i)=>{let n=()=>{c(),t()},r=u=>{c(),i(new Error(`WebSocket error: ${u.message}`))},o=(u,l)=>{c(),i(new Error(`WebSocket error: Unexpected server response: ${l.statusCode}`))},a=(u,l)=>{c(),i(new Error(`WebSocket disconnected. Code: ${u}, Reason: ${l}`))},c=()=>{e.removeListener("open",n),e.removeListener("error",r),e.removeListener("unexpected-response",o),e.removeListener("close",a)};e.on("open",n),e.on("error",r),e.on("unexpected-response",o),e.on("close",a)}):Promise.reject(new Error("WebSocket not connected"))}fetchWithCache(e,t){return fetch(e,t)}async _send(e,t){return this.ws&&this.ws.readyState===cr.OPEN?(this.SequenceID++,new Promise((i,n)=>{let r=this.SequenceID,o=(t??this.requestTimeoutMs)+this.runnerStartAllowanceMs,a=setTimeout(()=>{let c=this.store[r];c&&(delete this.store[r],c.reject(new Error(`Request timed out after ${o}ms${c.type?` (type=${c.type})`:""}`)))},o);this.store[r]={resolve:i,reject:n,timeoutHandle:a,type:e.type},this.ws?.send(JSON.stringify({...e,seq:r}))})):Promise.reject("WebSocket not connected")}async requestRaw(e,t,i={}){let n=i.timeoutSeconds;return await this._send({type:e,stream_id:i.streamId,timeout:n,request:t},n===void 0?void 0:(n+5)*1e3)}async send(e){let t=e.timeout===void 0?void 0:(e.timeout+5)*1e3;return await this._send(e,t)}async setWorkblock(e,t){let i=await this.requests.setWorkBlockV2({workblock:t},{streamId:e,timeoutSeconds:Ae});return{errors:i.errors??[],warnings:i.warnings??[]}}async getWorkblock(e){return await this.requests.getWorkblock({},{streamId:e})??void 0}async getWorkblockById(e){return await this.requests.getWorkblock({id:e})??void 0}async storeWorkblock(e){let t;try{if(t=await this.getWorkblockById(e.id),!t)throw new Error(`Workblock lookup for ${e.id} returned no definition`)}catch(r){if(!(r instanceof zs&&r.code==="NotFound"))throw r;t=void 0}if(!t)return await this.createWorkblock(e);let i=await this.requests.getEditStream({workblock_id:e.id}),n=await this.setWorkblock(i.id,e);if(n.errors.length>0)throw new Error(`Validation errors: ${JSON.stringify(n.errors)}`);return{stream:i,warnings:n.warnings}}async initializeWorkblock(e,t){return await this.requests.createWorkblock({workblock:e,feature_branch:t},{timeoutSeconds:Ae})}async createWorkblock(e,t){let i=await this.requests.createWorkblock(t?{workblock:e,feature_branch:t}:{workblock:e},{timeoutSeconds:Ae});if(i.errors?.length)throw new Error(`Validation errors: ${JSON.stringify(i.errors)}`);return{stream:i.stream,warnings:i.warnings??[]}}async listWorkblockDefinitions(){return await this.requests.listWorkblockDefinitions({include_branches:!0})}async listWorkblockBranches(e){return(await this.requests.listWorkblockBranches({workblock_id:e})).branches}async listWorkblockDataEnvironments(e){return await this.requests.listWorkblockDataEnvironments({workblock_id:e})}async queryWorkblockEntityStore(e){return await this.requests.queryWorkblockEntityStore(e)}async listWorkblockEntityStoreSavedQueries(e){return await this.requests.listWorkblockEntityStoreSavedQueries(e)}async getSpace(e){return await this.requests.getSpace({slug:e})}async getActiveWorkblockSetting(e){return(await this.requests.getActiveWorkblockSetting({workblock_id:e})).branch}async setActiveWorkblockSetting(e,t){await this.requests.setActiveWorkblockSetting({workblock_id:e,branch:t})}async createStudioWorkspace(e,t,i,n=!1){return(await this.requests.createStudioWorkspace({workblock_id:e,branch:t,title:i,create_user_branch:n})).stream}async createWorkblockVersion(e,t,i,n){return(await this.requests.createWorkblockVersion({workblock_id:e,feature_branch:t,source_ref:i,workspace_name:n},{timeoutSeconds:Ae})).stream}async findStudioWorkspaceOnBranch(e,t){return(await this.requests.findStudioWorkspaceOnBranch({workblock_id:e,target_branch:t})).stream_id}async getStudioWorkspace(e){return(await this.requests.getStudioWorkspace({stream_id:e})).workspace??void 0}async listStudioWorkspaces(e,t){if(!e&&!t)throw new Error("listStudioWorkspaces requires a user id or a workblock id");return(await this.requests.listStudioWorkspaces({user_id:e,workblock_id:t})).workspaces??[]}async getBlob(e){return this.debug&&console.error(`Getting blob ${e}`),e.startsWith("::bw:data:")?(await this.getBlobContent(e)).text:e}async getBlobContent(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",text:await t.text()}}async getBlobBytes(e){let t=await this.fetchBlob(e);return{contentType:t.headers.get("content-type")??"",bytes:new Uint8Array(await t.arrayBuffer())}}async fetchBlob(e){let t=this.tokenSource?await this.tokenSource():this.token,i=await this.fetchWithCache(`${this.blobURL}?key=${encodeURIComponent(e)}`,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`Failed to fetch blob ${e}: ${i.status} ${i.statusText}`);return i}waitForCurrentUser(e=1e4){return this.currentUser?Promise.resolve(this.currentUser):new Promise((t,i)=>{let n=setTimeout(()=>i(new Error("The server did not announce the current user")),e);this.currentUserHandlers.push(r=>{clearTimeout(n),t(r)})})}async getWorkblockV2ById(e){return await this.requests.getWorkblockV2({id:e,resolve_blobs:!0})??void 0}async resolveWorkblockContent(e,t){return await this.requests.resolveWorkblockContent({workblock_id:e,commit_ref:t})}async setWorkblockV2(e,t,i){return await this.requests.setWorkBlockV2({workblock:t,branch:i.branch,expected_commit_ref:i.expectedCommitRef,advance_version:i.advanceVersion||void 0,commit_message:i.commitMessage},{streamId:e,timeoutSeconds:Ae})}async validateWorkblock(e){return await this.requests.validateWorkblock(e,{timeoutSeconds:Ae})}async syncWorkblockVersion(e){return await this.requests.syncWorkblockVersion({},{streamId:e,timeoutSeconds:Ae})}async checkWorkblockBranchMergeability(e,t,i,n={}){return await this.requests.checkWorkblockBranchMergeability({workblock_id:e,base_branch:t,head_branch:i,compute_file_merges:n.computeFileMerges||void 0},{timeoutSeconds:Ae})}async mergeWorkblockBranch(e,t,i,n={}){return await this.requests.mergeWorkblockBranch({workblock_id:e,base_branch:t,head_branch:i,commit_message:n.commitMessage},{streamId:n.streamId,timeoutSeconds:Ae})}async resolveWorkblockMergeConflicts(e,t,i,n,r){return await this.requests.resolveWorkblockMergeConflicts({workblock_id:e,base_branch:t,head_branch:i,resolved_files:n,base_branch_commit:r.baseBranchCommit,head_branch_commit:r.headBranchCommit,commit_message:r.commitMessage},{streamId:r.streamId,timeoutSeconds:Ae})}async resetWorkblockBranch(e,t,i,n){await this.requests.resetWorkblockBranch({workblock_id:e,branch_name:t,source_ref:i,expected_commit_ref:n})}async setWorkblockCommitMessage(e,t,i){await this.requests.setWorkblockCommitMessage({workblock_id:e,commit_hash:t,title:i.split(`
|
|
153
153
|
`)[0],message:i})}async getWorkblockCommitLog(e,t,i){return(await this.requests.getWorkblockCommitLog({workblock_id:e,ref:t,max_count:i})).entries}async getWorkblockHistoryBundle(e,t){return await this.requests.getWorkblockHistoryBundle({workblock_id:e,branch:t})}async getWorkspaceWorkblock(e){return await this.requests.getWorkblockV2({},{streamId:e})??void 0}async getWorkspaceWorkblockWithBlobs(e){return await this.requests.getWorkblockV2({resolve_blobs:!0},{streamId:e})??void 0}async getDocsContent(){return(await this.requests.getDocsContent({})).content}async runModule(e,t,i){let n=await this.requests.runModule({module_id:t,inputs:i},{streamId:e});if(!n.run_id)throw new Error(`Module ${t} is UI-only and starts no run. Open it in Studio or in a Space.`);return n.run_id}async runSingleTask(e,t,i,n,r){return await this.requests.runSingleTask({module_id:t,task_id:i,run_id:n,inputs:r},{streamId:e})}async invokeWorkblockTask(e){return(await this.requests.invokeWorkblockTask({workblock_id:e.workblockId,module_id:e.moduleId,task_id:e.taskId,commit_ref:e.commitRef,inputs:e.inputs},{streamId:e.streamId,timeoutSeconds:e.timeoutSeconds})).outputs??{}}async runModuleTests(e,t,i){return(await this.requests.wbRunTest({module_id:i,workblock_id:t},{streamId:e,timeoutSeconds:Ae})).result??[]}async getWorkblockRun(e){return await this.requests.getWorkblockRun({id:e.runId,stream_id:e.runId?void 0:e.streamId,include_ephemeral:!0,nil_on_no_run:!0})??void 0}async getWorkblockUI(e){return await this.requests.getWorkblockUi(e,{timeoutSeconds:Ae})}async getTaskLogs(e,t){return await this.requests.getTaskLogs({run_id:e,task_id:t})??[]}async cancelWorkblockRun(e,t){await this.requests.cancelWb({workblock_run_id:t},{streamId:e})}disconnect(){this.connected=!1,this.closing=!0,this.rejectAllPending(new Error("WebSocket disconnected")),this.ws?.close(),this.streamHandlers=[],this.eventHandlers=[],this.currentUserHandlers=[],this.pushHandlers=new Map,this.store={},this.SequenceID=0}handleListStreams(e){let t=[];(e??[]).forEach(i=>{i.editing&&t.push(i)}),this.streamHandlers.forEach(i=>i(t))}async handleEvents(e){for(let t of this.eventHandlers)await t(e)}handleCurrentUser(e){this.currentUser=e,this.currentUserHandlers.forEach(t=>t(e))}rejectAllPending(e){for(let[t,i]of Object.entries(this.store))i&&(clearTimeout(i.timeoutHandle),i.reject(e),delete this.store[Number(t)])}reportConnectionError(e,t){this.lastConnectionError=e,this.connectionErrorHandlers.forEach(i=>i({host:this.connectionHost,url:this.connectionUrl,reason:e,statusCode:t}))}};var kh=3600*1e3,qw=600*1e3;function Fw(s){return typeof s=="object"&&s!==null&&"data"in s&&typeof s.data=="string"&&"timestamp"in s&&typeof s.timestamp=="number"}var pr=class extends Ii{context;constructor(e=!0){super(e)}connect(e,t,i){this.context=i,super.connect(e,t),this.ws?.on("open",()=>{this.cleanupExpiredCache().catch(console.error),this.lastCleanup=Date.now()}),this.ws?.on("close",(n,r)=>{this.connected&&dr.window.showErrorMessage(`WebSocket disconnected. Code: ${n}, Reason: ${r}`)}),this.ws?.on("error",n=>{this.connected&&dr.window.showErrorMessage(`WebSocket error: ${n.message}`)})}async fetchWithCache(e,t){let i=Date.now();i-this.lastCleanup>qw&&(await this.cleanupExpiredCache(),this.lastCleanup=i);let n=`${e}${JSON.stringify(t)}`;try{let r=this.context?.globalState.get(n);if(r&&Date.now()-r.timestamp<kh)return new Response(r.data);let o=await fetch(e,t),a=await o.text();return o.ok&&await this.context?.globalState.update(n,{data:a,timestamp:Date.now()}),new Response(a,o)}catch(r){return dr.window.showErrorMessage(`Cache error: ${r}`),fetch(e,t)}}async cleanupExpiredCache(){if(!this.context)return;let e=this.context.globalState.keys(),t=Date.now();for(let i of e){let n=this.context.globalState.get(i);Fw(n)&&t-n.timestamp>kh&&await this.context.globalState.update(i,void 0)}}};var W=F(require("vscode"));var lc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Mw=new RegExp(`^(.+)@users/${lc}$`,"i"),Lw=new RegExp(`^.+@stream/${lc}$`,"i"),_h=new RegExp(`@thread/${lc}$`,"i"),Bw="AlreadyExists",Ww="PermissionDenied";var $w="already exists on this branch";function St(s){return s.replace(_h,"")}function jw(s){return _h.test(s)}function Nt(s){return s?Lw.test(St(s)):!1}function Ti(s){return s.startsWith("features/")&&s!=="features/"&&!s.includes("@users/")&&!s.includes("@stream/")&&!s.includes("@thread/")}function es(s){let e=St(s),t=e.lastIndexOf("@stream/");if(t!==-1)return e.slice(0,t);let i=e.lastIndexOf("@users/");return i!==-1?e.slice(0,i):e}function ts(s){return es(s).replace(/^features\//,"")}function hr(s){let e=es(s);return Ti(e)?e:void 0}function zw(s){if(jw(s)||Nt(s))return;let e=s.match(Mw);return e?{branch:e[1],createUserBranch:!0}:{branch:s,createUserBranch:!1}}function wh(s){return!s.archived&&Nt(s.branch)}function Uw(s,e){return s.filter(t=>wh(t)&&es(t.branch??"")===e).reduce((t,i)=>{if(!t)return i;let n=Date.parse(t.updated_at||t.created_at);return Date.parse(i.updated_at||i.created_at)>n?i:t},void 0)}function yh(s,e,t){let i=new Map(e.map(r=>[r.name,r])),n=new Map(s.map(r=>[r.name,r]));for(let r of t){if(!r.branch||!wh(r))continue;let o=i.get(r.branch);o&&n.set(o.name,{...o,workspace:r})}return[...n.values()]}function vh(s){if(typeof s=="object"&&s!==null&&"code"in s){let e=s.code;if(typeof e=="string")return e}}function fr(s){return s instanceof Error?s.message:String(s)}function Sh(s){return vh(s)===Bw||fr(s).includes($w)}function Vw(s){return vh(s)===Ww}async function uc(s,e,t){try{return{ok:!0,value:await s}}catch(i){return e?.(`[workspace] ${t??"request"} failed: ${fr(i)}`),{ok:!1,error:i}}}async function Nh(s,e,t,i){let n=await uc(s,t,i);return n.ok?n.value:e}async function xh(s,e,t){try{await s.getStudioWorkspace(e);return}catch(r){if(!Vw(r)){t.log?.(`[workspace] could not verify access to ${e}: ${fr(r)}`);return}}let i=(await Nh(s.listStudioWorkspaces(void 0,t.workblockId),[],t.log,"list_studio_workspaces")).find(r=>r.id===e),n=i?.title?.trim()?`"${i.title.trim()}"`:e;throw new Error(`Branch ${t.branch} is open in Studio workspace ${n}, which you are not a member of. Ask its owner to share it, or work on your own branch.`)}async function dc(s,e){let{workblockId:t,branch:i,log:n}=e,r=St(i),o=await uc(s.findStudioWorkspaceOnBranch(t,r),n,"find_studio_workspace_on_branch"),a=o.ok?void 0:o.error,c=o.ok?o.value:void 0;if(c)return await xh(s,c,e),{streamId:c,created:!1};let u=zw(i);if(!u)throw a?new Error(`Could not look up the Studio workspace for ${i}: ${fr(a)}`):new Error(`No active Studio workspace on ${i}. Open ${es(i)} instead to start a new conversation on it.`);let l=e.title,d=!u.createUserBranch&&Ti(u.branch);if(d){let p=e.userId?await uc(s.listStudioWorkspaces(e.userId,t),n,"list_studio_workspaces"):{ok:!0,value:[]};if(p.ok){let h=Uw(p.value,u.branch);if(h?.branch){let f=await Nh(s.findStudioWorkspaceOnBranch(t,h.branch),void 0,n,"find_studio_workspace_on_branch");if(f)return{streamId:f,created:!1}}}l=void 0}try{return{streamId:(await s.createStudioWorkspace(t,u.branch,l,u.createUserBranch)).id,created:!0}}catch(p){if(!Sh(p)||d)throw p;let h=await s.findStudioWorkspaceOnBranch(t,r);if(!h)throw p;return await xh(s,h,e),{streamId:h,created:!1}}}async function Eh(s,e,t){if(!Ti(t))throw new Error(`Conversations fork from a version branch; ${t} is not one.`);return s.createStudioWorkspace(e,t)}var Hw="00000000-0000-0000-0000-000000000000";function Oi(s){return s.replace(/^features\//,"").includes("@users/")}function mr(s){let e=new Set(s.filter(t=>t.name.startsWith("features/")).filter(t=>!t.name.includes("@thread/")).filter(t=>!t.name.includes("@stream/")).filter(t=>!Oi(t.name)).map(t=>ts(t.name)));return s.filter(t=>t.name==="main"?!0:!t.name.startsWith("features/")||t.name.includes("@thread/")||t.name.includes("@stream/")?!1:Oi(t.name)?e.has(ts(t.name)):!0)}function Ch(s){let e=St(s),t=e.lastIndexOf("@users/");return t!==-1?e.slice(0,t):e}function pc(s){let e=St(s.name),t=e.lastIndexOf("@users/");if(t!==-1)return e.slice(t+7);if(e.startsWith("users/"))return e.slice(6);if(s.owner_id&&s.owner_id!==Hw)return s.owner_id}function Rh(s,e){return s.filter(t=>t.name.startsWith("features/")||t.name.startsWith("users/")).filter(t=>!t.name.includes("@thread/")).filter(t=>pc(t)===e)}function Gw(s,e){let t=new Set(s.filter(i=>i.name.startsWith("features/")).filter(i=>!i.name.includes("@thread/")).filter(i=>!pc(i)).map(i=>Ch(i.name)));return s.filter(i=>i.name.startsWith("features/")).filter(i=>!i.name.includes("@thread/")).filter(i=>pc(i)===e).filter(i=>t.has(Ch(i.name)))}function Kw(s,e,t){let i=mr(s),n=Gw(s,e);return n.length>0?n:t?i.filter(r=>r.name==="main"):[]}function Ah(s){let e={};for(let t of s)t.archived||!Nt(t.branch)||(e[t.workblock_id]??=[]).push(t);return e}function Ih(s,e,t,i){return yh(Kw(s,t,i),s,e)}var ce={ChooseDirectory:"Choose a directory for the branch",NewConversation:"New conversation",RemoveDirectoryBinding:"Remove directory binding",GetBranch:"Get workblock branch",StoreBranch:"Store workblock branch",EnableSync:"Enable sync",DisableSync:"Disable sync",CompareChanges:"Compare changes"};function hc(s){return s?`Change directory from ${s}`:ce.ChooseDirectory}function Th(s){let e=[hc(s.dir)];return hr(s.branch)&&e.push(ce.NewConversation),s.dir&&(e.push(ce.RemoveDirectoryBinding),e.push(ce.GetBranch),e.push(ce.StoreBranch),e.push(s.syncEnabled?ce.DisableSync:ce.EnableSync),s.modified&&e.push(ce.CompareChanges)),e}function Me(s,e,t){return[s,e,t].map(encodeURIComponent).join("|")}var gr=class extends W.TreeItem{constructor(t){super(t.host,W.TreeItemCollapsibleState.Collapsed);this.connection=t;this.description=t.status,this.contextValue=t.status,this.iconPath=this.getIcon(),this.command={command:"beyondwork.beyondwork.connectToTenant",title:"Connect to Tenant",arguments:[t]}}getIcon(){switch(this.connection.status){case"connected":return new W.ThemeIcon("pass-filled",new W.ThemeColor("charts.blue"));case"disconnected":return new W.ThemeIcon("circle-outline",new W.ThemeColor("charts.red"));case"connecting":return new W.ThemeIcon("sync~spin",new W.ThemeColor("charts.yellow"))}}},br=class extends W.TreeItem{constructor(t,i){super(t.name,W.TreeItemCollapsibleState.Collapsed);this.workblock=t;this.connection=i;this.contextValue="beyondwork.workblock",this.description=t.state,this.iconPath=new W.ThemeIcon("package"),this.tooltip=`${t.name}
|
|
154
154
|
${t.id}`}},fc=class extends W.TreeItem{constructor(t,i,n,r,o,a){let c=Nt(i.name),u=c?i.workspace?.title?.trim()||"New conversation":Oi(i.name)?ts(i.name):i.name;super({label:u,highlights:a?[[0,u.length]]:[]},W.TreeItemCollapsibleState.None);this.workblock=t;this.branch=i;this.connection=r;this.syncEnabled=o;this.modified=a;this.contextValue="beyondwork.branch",this.key=Me(r.host,t.id,i.name),this.dir=n,this.iconPath=this.getIcon(),this.command={command:"beyondwork.beyondwork.showStreamOptions",title:"Show options",arguments:[this]},this.description=c?ts(i.name):Oi(i.name)?"your branch":i.last_changed,n?(this.tooltip=`Bound to ${n}`,a&&(this.tooltip+=" (out of sync)")):this.tooltip=c?`${t.name}
|
|
155
155
|
${u}
|
|
@@ -171,8 +171,8 @@ ${i.head_commit}`}dir;key;getIcon(){return this.dir?this.syncEnabled?new W.Theme
|
|
|
171
171
|
`:">",r};oi.prototype.renderInline=function(s,e,t){let i="",n=this.rules;for(let r=0,o=s.length;r<o;r++){let a=s[r].type;typeof n[a]<"u"?i+=n[a](s,r,e,t,this):i+=this.renderToken(s,r,e)}return i};oi.prototype.renderInlineAsText=function(s,e,t){let i="";for(let n=0,r=s.length;n<r;n++)switch(s[n].type){case"text":i+=s[n].content;break;case"image":i+=this.renderInlineAsText(s[n].children,e,t);break;case"html_inline":case"html_block":i+=s[n].content;break;case"softbreak":case"hardbreak":i+=`
|
|
172
172
|
`;break;default:}return i};oi.prototype.render=function(s,e,t){let i="",n=this.rules;for(let r=0,o=s.length;r<o;r++){let a=s[r].type;a==="inline"?i+=this.renderInline(s[r].children,e,t):typeof n[a]<"u"?i+=n[a](s,r,e,t,this):i+=this.renderToken(s,r,e,t)}return i};var H0=oi;function $e(){this.__rules__=[],this.__cache__=null}$e.prototype.__find__=function(s){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===s)return e;return-1};$e.prototype.__compile__=function(){let s=this,e=[""];s.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(i){e.indexOf(i)<0&&e.push(i)})}),s.__cache__={},e.forEach(function(t){s.__cache__[t]=[],s.__rules__.forEach(function(i){i.enabled&&(t&&i.alt.indexOf(t)<0||s.__cache__[t].push(i.fn))})})};$e.prototype.at=function(s,e,t){let i=this.__find__(s),n=t||{};if(i===-1)throw new Error("Parser rule not found: "+s);this.__rules__[i].fn=e,this.__rules__[i].alt=n.alt||[],this.__cache__=null};$e.prototype.before=function(s,e,t,i){let n=this.__find__(s),r=i||{};if(n===-1)throw new Error("Parser rule not found: "+s);this.__rules__.splice(n,0,{name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null};$e.prototype.after=function(s,e,t,i){let n=this.__find__(s),r=i||{};if(n===-1)throw new Error("Parser rule not found: "+s);this.__rules__.splice(n+1,0,{name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null};$e.prototype.push=function(s,e,t){let i=t||{};this.__rules__.push({name:s,enabled:!0,fn:e,alt:i.alt||[]}),this.__cache__=null};$e.prototype.enable=function(s,e){Array.isArray(s)||(s=[s]);let t=[];return s.forEach(function(i){let n=this.__find__(i);if(n<0){if(e)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[n].enabled=!0,t.push(i)},this),this.__cache__=null,t};$e.prototype.enableOnly=function(s,e){Array.isArray(s)||(s=[s]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(s,e)};$e.prototype.disable=function(s,e){Array.isArray(s)||(s=[s]);let t=[];return s.forEach(function(i){let n=this.__find__(i);if(n<0){if(e)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[n].enabled=!1,t.push(i)},this),this.__cache__=null,t};$e.prototype.getRules=function(s){return this.__cache__===null&&this.__compile__(),this.__cache__[s]||[]};var hs=$e;function ai(s,e,t){this.type=s,this.tag=e,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}ai.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let i=0,n=t.length;i<n;i++)if(t[i][0]===e)return i;return-1};ai.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};ai.prototype.attrSet=function(e,t){let i=this.attrIndex(e),n=[e,t];i<0?this.attrPush(n):this.attrs[i]=n};ai.prototype.attrGet=function(e){let t=this.attrIndex(e),i=null;return t>=0&&(i=this.attrs[t][1]),i};ai.prototype.attrJoin=function(e,t){let i=this.attrIndex(e);i<0?this.attrPush([e,t]):this.attrs[i][1]=this.attrs[i][1]+" "+t};var mt=ai;function G0(s,e,t){this.src=s,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}G0.prototype.Token=mt;var K0=G0;var o3=/\r\n?|\n/g,a3=/\0/g;function al(s){let e;e=s.src.replace(o3,`
|
|
173
173
|
`),e=e.replace(a3,"\uFFFD"),s.src=e}function cl(s){let e;s.inlineMode?(e=new s.Token("inline","",0),e.content=s.src,e.map=[0,1],e.children=[],s.tokens.push(e)):s.md.block.parse(s.src,s.md,s.env,s.tokens)}function ul(s){let e=s.tokens;for(let t=0,i=e.length;t<i;t++){let n=e[t];n.type==="inline"&&s.md.inline.parse(n.content,s.md,s.env,n.children)}}function c3(s){return/^<a[>\s]/i.test(s)}function u3(s){return/^<\/a\s*>/i.test(s)}function ll(s){let e=s.tokens;if(s.md.options.linkify)for(let t=0,i=e.length;t<i;t++){if(e[t].type!=="inline"||!s.md.linkify.pretest(e[t].content))continue;let n=e[t].children,r=[],o=0;for(let a=n.length-1;a>=0;a--){let c=n[a];if(c.type==="link_close"){for(a--;n[a].level!==c.level&&n[a].type!=="link_open";)a--;continue}if(c.type==="html_inline"&&(c3(c.content)&&o>0&&o--,u3(c.content)&&o++),!(o>0)&&c.type==="text"&&s.md.linkify.test(c.content)){let u=c.content,l=s.md.linkify.match(u),d=[],p=c.level,h=0;l.length>0&&l[0].index===0&&a>0&&n[a-1].type==="text_special"&&(l=l.slice(1));for(let f=0;f<l.length;f++){let m=l[f].url,g=s.md.normalizeLink(m);if(!s.md.validateLink(g))continue;let b=l[f].text;l[f].schema?l[f].schema==="mailto:"&&!/^mailto:/i.test(b)?b=s.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=s.md.normalizeLinkText(b):b=s.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");let w=l[f].index;if(w>h){let k=new s.Token("text","",0);k.content=u.slice(h,w),k.level=p,d.push(k)}let y=new s.Token("link_open","a",1);y.attrs=[["href",g]],y.level=p++,y.markup="linkify",y.info="auto",d.push(y);let x=new s.Token("text","",0);x.content=b,x.level=p,d.push(x);let _=new s.Token("link_close","a",-1);_.level=--p,_.markup="linkify",_.info="auto",d.push(_),h=l[f].lastIndex}if(h<u.length){let f=new s.Token("text","",0);f.content=u.slice(h),f.level=p,d.push(f)}r.push({index:a,nodes:d})}}if(r.length>0){let a=n.length;for(let d of r)a+=d.nodes.length-1;let c=new Array(a),u=0,l=0;r.reverse();for(let d=0;d<n.length;d++){let p=r[u];if(p?.index===d){for(let h of p.nodes)c[l++]=h;u++}else c[l++]=n[d]}e[t].children=c}}}var J0=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,l3=/\((c|tm|r)\)/i,d3=/\((c|tm|r)\)/ig,p3={c:"\xA9",r:"\xAE",tm:"\u2122"};function h3(s,e){return p3[e.toLowerCase()]}function f3(s){let e=0;for(let t=s.length-1;t>=0;t--){let i=s[t];i.type==="text"&&!e&&(i.content=i.content.replace(d3,h3)),i.type==="link_open"&&i.info==="auto"&&e--,i.type==="link_close"&&i.info==="auto"&&e++}}function m3(s){let e=0;for(let t=s.length-1;t>=0;t--){let i=s[t];i.type==="text"&&!e&&J0.test(i.content)&&(i.content=i.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),i.type==="link_open"&&i.info==="auto"&&e--,i.type==="link_close"&&i.info==="auto"&&e++}}function dl(s){let e;if(s.md.options.typographer)for(e=s.tokens.length-1;e>=0;e--)s.tokens[e].type==="inline"&&(l3.test(s.tokens[e].content)&&f3(s.tokens[e].children),J0.test(s.tokens[e].content)&&m3(s.tokens[e].children))}var g3=/['"]/,Y0=/['"]/g,Z0="\u2019",b3=1e3;function Q0(s,e,t){for(;s.length>t;){let i=s.pop();i.isSingleQuote?e.single=i.prevSameQuoteIdx:e.double=i.prevSameQuoteIdx}}function Oo(s,e,t,i){s[e]||(s[e]=[]),s[e].push({pos:t,ch:i})}function k3(s,e){let t="",i=0;e.sort((n,r)=>n.pos-r.pos);for(let n=0;n<e.length;n++){let r=e[n];t+=s.slice(i,r.pos)+r.ch,i=r.pos+1}return t+s.slice(i)}function x3(s,e){let t,i=[],n={single:-1,double:-1},r={};for(let o=0;o<s.length;o++){let a=s[o],c=s[o].level;for(t=i.length-1;t>=0&&!(i[t].level<=c);t--);if(Q0(i,n,t+1),a.type!=="text")continue;let u=a.content,l=0,d=u.length;e:for(;l<d;){Y0.lastIndex=l;let p=Y0.exec(u);if(!p)break;let h=!0,f=!0;l=p.index+1;let m=p[0]==="'",g=32;if(p.index-1>=0)g=u.charCodeAt(p.index-1);else for(t=o-1;t>=0&&!(s[t].type==="softbreak"||s[t].type==="hardbreak");t--)if(s[t].content){g=s[t].content.charCodeAt(s[t].content.length-1);break}let b=32;if(l<d)b=u.charCodeAt(l);else for(t=o+1;t<s.length&&!(s[t].type==="softbreak"||s[t].type==="hardbreak");t++)if(s[t].content){b=s[t].content.charCodeAt(0);break}let w=ls(g)||us(g),y=ls(b)||us(b),x=cs(g),_=cs(b);if(_?h=!1:y&&(x||w||(h=!1)),x?f=!1:w&&(_||y||(f=!1)),b===34&&p[0]==='"'&&g>=48&&g<=57&&(f=h=!1),h&&f&&(h=w,f=y),!h&&!f){m&&Oo(r,o,p.index,Z0);continue}if(f&&(t=m?n.single:n.double,t>=0&&i[t].level===c)){let k=i[t],S,v;m?(S=e.md.options.quotes[2],v=e.md.options.quotes[3]):(S=e.md.options.quotes[0],v=e.md.options.quotes[1]),Oo(r,o,p.index,v),Oo(r,k.tokenIdx,k.contentPos,S),Q0(i,n,t);continue e}if(h){if(i.length>=b3)return;i.push({tokenIdx:o,contentPos:p.index,isSingleQuote:m,level:c,prevSameQuoteIdx:m?n.single:n.double}),m?n.single=i.length-1:n.double=i.length-1}else f&&m&&Oo(r,o,p.index,Z0)}}Object.keys(r).forEach(function(o){s[o].content=k3(s[o].content,r[o])})}function pl(s){if(s.md.options.typographer)for(let e=s.tokens.length-1;e>=0;e--)s.tokens[e].type!=="inline"||!g3.test(s.tokens[e].content)||x3(s.tokens[e].children,s)}function hl(s){let e,t,i=s.tokens,n=i.length;for(let r=0;r<n;r++){if(i[r].type!=="inline")continue;let o=i[r].children,a=o.length;for(e=0;e<a;e++)o[e].type==="text_special"&&(o[e].type="text");for(e=t=0;e<a;e++)o[e].type==="text"&&e+1<a&&o[e+1].type==="text"?o[e+1].content=o[e].content+o[e+1].content:(e!==t&&(o[t]=o[e]),t++);e!==t&&(o.length=t)}}var fl=[["normalize",al],["block",cl],["inline",ul],["linkify",ll],["replacements",dl],["smartquotes",pl],["text_join",hl]];function ml(){this.ruler=new hs;for(let s=0;s<fl.length;s++)this.ruler.push(fl[s][0],fl[s][1])}ml.prototype.process=function(s){let e=this.ruler.getRules("");for(let t=0,i=e.length;t<i;t++)e[t](s)};ml.prototype.State=K0;var X0=ml;function Xe(s,e,t,i){this.src=s,this.md=e,this.env=t,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;let n=this.src;for(let r=0,o=0,a=0,c=0,u=n.length,l=!1;o<u;o++){let d=n.charCodeAt(o);if(!l)if(D(d)){a++,d===9?c+=4-c%4:c++;continue}else l=!0;(d===10||o===u-1)&&(d!==10&&o++,this.bMarks.push(r),this.eMarks.push(o),this.tShift.push(a),this.sCount.push(c),this.bsCount.push(0),l=!1,a=0,c=0,r=o+1)}this.bMarks.push(n.length),this.eMarks.push(n.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Xe.prototype.push=function(s,e,t){let i=new mt(s,e,t);return i.block=!0,t<0&&this.level--,i.level=this.level,t>0&&this.level++,this.tokens.push(i),i};Xe.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Xe.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};Xe.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){let i=this.src.charCodeAt(e);if(!D(i))break}return e};Xe.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!D(this.src.charCodeAt(--e)))return e+1;return e};Xe.prototype.skipChars=function(e,t){for(let i=this.src.length;e<i&&this.src.charCodeAt(e)===t;e++);return e};Xe.prototype.skipCharsBack=function(e,t,i){if(e<=i)return e;for(;e>i;)if(t!==this.src.charCodeAt(--e))return e+1;return e};Xe.prototype.getLines=function(e,t,i,n){if(e>=t)return"";let r=new Array(t-e);for(let o=0,a=e;a<t;a++,o++){let c=0,u=this.bMarks[a],l=u,d;for(a+1<t||n?d=this.eMarks[a]+1:d=this.eMarks[a];l<d&&c<i;){let p=this.src.charCodeAt(l);if(D(p))p===9?c+=4-(c+this.bsCount[a])%4:c++;else if(l-u<this.tShift[a])c++;else break;l++}c>i?r[o]=new Array(c-i+1).join(" ")+this.src.slice(l,d):r[o]=this.src.slice(l,d)}return r.join("")};Xe.prototype.Token=mt;var eg=Xe;var _3=65536;function gl(s,e){let t=s.bMarks[e]+s.tShift[e],i=s.eMarks[e];return s.src.slice(t,i)}function tg(s){let e=[],t=s.length,i=0,n=s.charCodeAt(i),r=!1,o=0,a="";for(;i<t;)n===124&&(r?(a+=s.substring(o,i-1),o=i):(e.push(a+s.substring(o,i)),a="",o=i+1)),r=n===92,i++,n=s.charCodeAt(i);return e.push(a+s.substring(o)),e}function bl(s,e,t,i){if(e+2>t)return!1;let n=e+1;if(s.sCount[n]<s.blkIndent||s.sCount[n]-s.blkIndent>=4)return!1;let r=s.bMarks[n]+s.tShift[n];if(r>=s.eMarks[n])return!1;let o=s.src.charCodeAt(r++);if(o!==124&&o!==45&&o!==58||r>=s.eMarks[n])return!1;let a=s.src.charCodeAt(r++);if(a!==124&&a!==45&&a!==58&&!D(a)||o===45&&D(a))return!1;for(;r<s.eMarks[n];){let x=s.src.charCodeAt(r);if(x!==124&&x!==45&&x!==58&&!D(x))return!1;r++}let c=gl(s,e+1),u=c.split("|"),l=[];for(let x=0;x<u.length;x++){let _=u[x].trim();if(!_){if(x===0||x===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;_.charCodeAt(_.length-1)===58?l.push(_.charCodeAt(0)===58?"center":"right"):_.charCodeAt(0)===58?l.push("left"):l.push("")}if(c=gl(s,e).trim(),c.indexOf("|")===-1||s.sCount[e]-s.blkIndent>=4)return!1;u=tg(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();let d=u.length;if(d===0||d!==l.length)return!1;if(i)return!0;let p=s.parentType;s.parentType="table";let h=s.md.block.ruler.getRules("blockquote"),f=s.push("table_open","table",1),m=[e,0];f.map=m;let g=s.push("thead_open","thead",1);g.map=[e,e+1];let b=s.push("tr_open","tr",1);b.map=[e,e+1];for(let x=0;x<u.length;x++){let _=s.push("th_open","th",1);l[x]&&(_.attrs=[["style","text-align:"+l[x]]]);let k=s.push("inline","",0);k.content=u[x].trim(),k.children=[],s.push("th_close","th",-1)}s.push("tr_close","tr",-1),s.push("thead_close","thead",-1);let w,y=0;for(n=e+2;n<t&&!(s.sCount[n]<s.blkIndent);n++){let x=!1;for(let k=0,S=h.length;k<S;k++)if(h[k](s,n,t,!0)){x=!0;break}if(x||(c=gl(s,n).trim(),!c)||s.sCount[n]-s.blkIndent>=4||(u=tg(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),y+=d-u.length,y>_3))break;if(n===e+2){let k=s.push("tbody_open","tbody",1);k.map=w=[e+2,0]}let _=s.push("tr_open","tr",1);_.map=[n,n+1];for(let k=0;k<d;k++){let S=s.push("td_open","td",1);l[k]&&(S.attrs=[["style","text-align:"+l[k]]]);let v=s.push("inline","",0);v.content=u[k]?u[k].trim():"",v.children=[],s.push("td_close","td",-1)}s.push("tr_close","tr",-1)}return w&&(s.push("tbody_close","tbody",-1),w[1]=n),s.push("table_close","table",-1),m[1]=n,s.parentType=p,s.line=n,!0}function kl(s,e,t){if(s.sCount[e]-s.blkIndent<4)return!1;let i=e+1,n=i;for(;i<t;){if(s.isEmpty(i)){i++;continue}if(s.sCount[i]-s.blkIndent>=4){i++,n=i;continue}break}s.line=n;let r=s.push("code_block","code",0);return r.content=s.getLines(e,n,4+s.blkIndent,!1)+`
|
|
174
|
-
`,r.map=[e,s.line],!0}function xl(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4||n+3>r)return!1;let o=s.src.charCodeAt(n);if(o!==126&&o!==96)return!1;let a=n;n=s.skipChars(n,o);let c=n-a;if(c<3)return!1;let u=s.src.slice(a,n),l=s.src.slice(n,r);if(o===96&&l.indexOf(String.fromCharCode(o))>=0)return!1;if(i)return!0;let d=e,p=!1;for(;d++,!(d>=t||(n=a=s.bMarks[d]+s.tShift[d],r=s.eMarks[d],n<r&&s.sCount[d]<s.blkIndent));)if(s.src.charCodeAt(n)===o&&!(s.sCount[d]-s.blkIndent>=4)&&(n=s.skipChars(n,o),!(n-a<c)&&(n=s.skipSpaces(n),!(n<r)))){p=!0;break}c=s.sCount[e],s.line=d+(p?1:0);let h=s.push("fence","code",0);return h.info=l,h.content=s.getLines(e+1,d,c,!0),h.markup=u,h.map=[e,s.line],!0}function _l(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e],o=s.lineMax;if(s.sCount[e]-s.blkIndent>=4||s.src.charCodeAt(n)!==62)return!1;if(i)return!0;let a=[],c=[],u=[],l=[],d=s.md.block.ruler.getRules("blockquote"),p=s.parentType;s.parentType="blockquote";let h=!1,f;for(f=e;f<t;f++){let y=s.sCount[f]<s.blkIndent;if(n=s.bMarks[f]+s.tShift[f],r=s.eMarks[f],n>=r)break;if(s.src.charCodeAt(n++)===62&&!y){let _=s.sCount[f]+1,k,S;s.src.charCodeAt(n)===32?(n++,_++,S=!1,k=!0):s.src.charCodeAt(n)===9?(k=!0,(s.bsCount[f]+_)%4===3?(n++,_++,S=!1):S=!0):k=!1;let v=_;for(a.push(s.bMarks[f]),s.bMarks[f]=n;n<r;){let C=s.src.charCodeAt(n);if(D(C))C===9?v+=4-(v+s.bsCount[f]+(S?1:0))%4:v++;else break;n++}h=n>=r,c.push(s.bsCount[f]),s.bsCount[f]=s.sCount[f]+1+(k?1:0),u.push(s.sCount[f]),s.sCount[f]=v-_,l.push(s.tShift[f]),s.tShift[f]=n-s.bMarks[f];continue}if(h)break;let x=!1;for(let _=0,k=d.length;_<k;_++)if(d[_](s,f,t,!0)){x=!0;break}if(x){s.lineMax=f,s.blkIndent!==0&&(a.push(s.bMarks[f]),c.push(s.bsCount[f]),l.push(s.tShift[f]),u.push(s.sCount[f]),s.sCount[f]-=s.blkIndent);break}a.push(s.bMarks[f]),c.push(s.bsCount[f]),l.push(s.tShift[f]),u.push(s.sCount[f]),s.sCount[f]=-1}let m=s.blkIndent;s.blkIndent=0;let g=s.push("blockquote_open","blockquote",1);g.markup=">";let b=[e,0];g.map=b,s.md.block.tokenize(s,e,f);let w=s.push("blockquote_close","blockquote",-1);w.markup=">",s.lineMax=o,s.parentType=p,b[1]=s.line;for(let y=0;y<l.length;y++)s.bMarks[y+e]=a[y],s.tShift[y+e]=l[y],s.sCount[y+e]=u[y],s.bsCount[y+e]=c[y];return s.blkIndent=m,!0}function wl(s,e,t,i){let n=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4)return!1;let r=s.bMarks[e]+s.tShift[e],o=s.src.charCodeAt(r++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;r<n;){let u=s.src.charCodeAt(r++);if(u!==o&&!D(u))return!1;u===o&&a++}if(a<3)return!1;if(i)return!0;s.line=e+1;let c=s.push("hr","hr",0);return c.map=[e,s.line],c.markup=Array(a+1).join(String.fromCharCode(o)),!0}function sg(s,e){let t=s.eMarks[e],i=s.bMarks[e]+s.tShift[e],n=s.src.charCodeAt(i++);if(n!==42&&n!==45&&n!==43)return-1;if(i<t){let r=s.src.charCodeAt(i);if(!D(r))return-1}return i}function ig(s,e){let t=s.bMarks[e]+s.tShift[e],i=s.eMarks[e],n=t;if(n+1>=i)return-1;let r=s.src.charCodeAt(n++);if(r<48||r>57)return-1;for(;;){if(n>=i)return-1;if(r=s.src.charCodeAt(n++),r>=48&&r<=57){if(n-t>=10)return-1;continue}if(r===41||r===46)break;return-1}return n<i&&(r=s.src.charCodeAt(n),!D(r))?-1:n}function w3(s,e){let t=s.level+2;for(let i=e+2,n=s.tokens.length-2;i<n;i++)s.tokens[i].level===t&&s.tokens[i].type==="paragraph_open"&&(s.tokens[i+2].hidden=!0,s.tokens[i].hidden=!0,i+=2)}function yl(s,e,t,i){let n,r,o,a,c=e,u=!0;if(s.sCount[c]-s.blkIndent>=4||s.listIndent>=0&&s.sCount[c]-s.listIndent>=4&&s.sCount[c]<s.blkIndent)return!1;let l=!1;i&&s.parentType==="paragraph"&&s.sCount[c]>=s.blkIndent&&(l=!0);let d,p,h;if((h=ig(s,c))>=0){if(d=!0,o=s.bMarks[c]+s.tShift[c],p=Number(s.src.slice(o,h-1)),l&&p!==1)return!1}else if((h=sg(s,c))>=0)d=!1;else return!1;if(l&&s.skipSpaces(h)>=s.eMarks[c])return!1;if(i)return!0;let f=s.src.charCodeAt(h-1),m=s.tokens.length;d?(a=s.push("ordered_list_open","ol",1),p!==1&&(a.attrs=[["start",p]])):a=s.push("bullet_list_open","ul",1);let g=[c,0];a.map=g,a.markup=String.fromCharCode(f);let b=!1,w=s.md.block.ruler.getRules("list"),y=s.parentType;for(s.parentType="list";c<t;){r=h,n=s.eMarks[c];let x=s.sCount[c]+h-(s.bMarks[c]+s.tShift[c]),_=x;for(;r<n;){let Ke=s.src.charCodeAt(r);if(Ke===9)_+=4-(_+s.bsCount[c])%4;else if(Ke===32)_++;else break;r++}let k=r,S;k>=n?S=1:S=_-x,S>4&&(S=1);let v=x+S;a=s.push("list_item_open","li",1),a.markup=String.fromCharCode(f);let C=[c,0];a.map=C,d&&(a.info=s.src.slice(o,h-1));let A=s.tight,T=s.tShift[c],L=s.sCount[c],Y=s.listIndent;if(s.listIndent=s.blkIndent,s.blkIndent=v,s.tight=!0,s.tShift[c]=k-s.bMarks[c],s.sCount[c]=_,k>=n&&s.isEmpty(c+1)?s.line=Math.min(s.line+2,t):s.md.block.tokenize(s,c,t,!0),(!s.tight||b)&&(u=!1),b=s.line-c>1&&s.isEmpty(s.line-1),s.blkIndent=s.listIndent,s.listIndent=Y,s.tShift[c]=T,s.sCount[c]=L,s.tight=A,a=s.push("list_item_close","li",-1),a.markup=String.fromCharCode(f),c=s.line,C[1]=c,c>=t||s.sCount[c]<s.blkIndent||s.sCount[c]-s.blkIndent>=4)break;let G=!1;for(let Ke=0,Ds=w.length;Ke<Ds;Ke++)if(w[Ke](s,c,t,!0)){G=!0;break}if(G)break;if(d){if(h=ig(s,c),h<0)break;o=s.bMarks[c]+s.tShift[c]}else if(h=sg(s,c),h<0)break;if(f!==s.src.charCodeAt(h-1))break}return d?a=s.push("ordered_list_close","ol",-1):a=s.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(f),g[1]=c,s.line=c,s.parentType=y,u&&w3(s,m),!0}var vl=999;function y3(s){let e=s.length;for(let t=0;t<s.length-1;t++){let i=s.charCodeAt(t);if(i<55296||i>56319)continue;let n=s.charCodeAt(t+1);n>=56320&&n<=57343&&(e--,t++)}return e}function hn(s,e){return Math.min(s.eMarks[e]+1,s.src.length)}function Do(s,e){let t=s.lineMax;if(e>=t||s.isEmpty(e))return-1;let i=!1;if(s.sCount[e]-s.blkIndent>3&&(i=!0),s.sCount[e]<0&&(i=!0),!i){let n=s.md.block.ruler.getRules("reference"),r=s.parentType;s.parentType="reference";let o=!1;for(let a=0,c=n.length;a<c;a++)if(n[a](s,e,t,!0)){o=!0;break}if(s.parentType=r,o)return-1}return s.bMarks[e]+s.tShift[e]}function Sl(s,e,t,i){let n=s.src,r=s.bMarks[e]+s.tShift[e],o=e+1;if(s.sCount[e]-s.blkIndent>=4||n.charCodeAt(r)!==91)return!1;let a=hn(s,e),c="",u=-1,l=++r;for(;r<a;){if(c.length+r-l>vl*2)return!1;let x=n.charCodeAt(r);if(x===91)return!1;if(x===93){u=r;break}if(x===92&&(x=n.charCodeAt(++r)),x===10&&r<a){let _=Do(s,o);if(_<0)return!1;c+=n.slice(l,a),r=l=_,a=hn(s,o++);continue}r++}if(u<0||n.charCodeAt(u+1)!==58||(c+=n.slice(l,u),c.length>vl&&y3(c)>vl))return!1;for(r=u+2;r<a;){let x=n.charCodeAt(r);if(x===10){let _=Do(s,o);if(_<0)break;r=_,a=hn(s,o++)}else if(D(x))r++;else break}let d=s.md.helpers.parseLinkDestination(n,r,a);if(!d.ok)return!1;let p=s.md.normalizeLink(d.str);if(!s.md.validateLink(p))return!1;r=d.pos;let h=r,f=a,m=o;for(;r<a;){let x=n.charCodeAt(r);if(x===10){let _=Do(s,o);if(_<0)break;r=_,a=hn(s,o++)}else if(D(x))r++;else break}let g=r,b=s.md.helpers.parseLinkTitle(n,r,a);for(;b.can_continue;){let x=Do(s,o);if(x<0)break;r=x,a=hn(s,o++),b=s.md.helpers.parseLinkTitle(n,r,a,b)}let w;for(g!==h&&b.ok?(w=b.str,r=b.pos):(w="",r=h,a=f,o=m);r<a;){let x=n.charCodeAt(r);if(!D(x))break;r++}if(r<a&&n.charCodeAt(r)!==10&&w)for(w="",r=h,a=f,o=m;r<a;){let x=n.charCodeAt(r);if(!D(x))break;r++}if(r<a&&n.charCodeAt(r)!==10)return!1;let y=ds(c);return y?(i||(typeof s.env.references>"u"&&(s.env.references={}),typeof s.env.references[y]>"u"&&(s.env.references[y]={title:w,href:p}),s.line=o),!0):!1}var ng=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];var v3="[a-zA-Z_:][a-zA-Z0-9:._-]*",S3="[^\"'=<>`\\x00-\\x20]+",N3="'[^']*'",E3='"[^"]*"',C3="(?:"+S3+"|"+N3+"|"+E3+")",R3="(?:\\s+"+v3+"(?:\\s*=\\s*"+C3+")?)",rg="<[A-Za-z][A-Za-z0-9\\-]*"+R3+"*\\s*\\/?>",og="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",A3="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",I3="<[?][\\s\\S]*?[?]>",T3="<![A-Za-z][^>]*>",O3="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",p8=new RegExp("^(?:"+rg+"|"+og+"|"+A3+"|"+I3+"|"+T3+"|"+O3+")"),Po=new RegExp("^(?:"+rg+"|"+og+")");var fs=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+ng.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Po.source+"\\s*$"),/^$/,!1]];function Nl(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4||!s.md.options.html||s.src.charCodeAt(n)!==60)return!1;let o=s.src.slice(n,r),a=0;for(;a<fs.length&&!fs[a][0].test(o);a++);if(a===fs.length)return!1;if(i)return fs[a][2];let c=e+1,u=fs[a][1].test("");if(!fs[a][1].test(o)){for(;c<t&&!(s.sCount[c]<s.blkIndent&&(u||!s.isEmpty(c)));c++)if(n=s.bMarks[c]+s.tShift[c],r=s.eMarks[c],o=s.src.slice(n,r),fs[a][1].test(o)){o.length!==0&&c++;break}}s.line=c;let l=s.push("html_block","",0);return l.map=[e,c],l.content=s.getLines(e,c,s.blkIndent,!0),!0}function El(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4)return!1;let o=s.src.charCodeAt(n);if(o!==35||n>=r)return!1;let a=1;for(o=s.src.charCodeAt(++n);o===35&&n<r&&a<=6;)a++,o=s.src.charCodeAt(++n);if(a>6||n<r&&!D(o))return!1;if(i)return!0;r=s.skipSpacesBack(r,n);let c=s.skipCharsBack(r,35,n);c>n&&D(s.src.charCodeAt(c-1))&&(r=c),s.line=e+1;let u=s.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,s.line];let l=s.push("inline","",0);l.content=ps(s.src.slice(n,r)),l.map=[e,s.line],l.children=[];let d=s.push("heading_close","h"+String(a),-1);return d.markup="########".slice(0,a),!0}function Cl(s,e,t){let i=s.md.block.ruler.getRules("paragraph");if(s.sCount[e]-s.blkIndent>=4)return!1;let n=s.parentType;s.parentType="paragraph";let r=0,o,a=e+1;for(;a<t&&!s.isEmpty(a);a++){if(s.sCount[a]-s.blkIndent>3)continue;if(s.sCount[a]>=s.blkIndent){let h=s.bMarks[a]+s.tShift[a],f=s.eMarks[a];if(h<f&&(o=s.src.charCodeAt(h),(o===45||o===61)&&(h=s.skipChars(h,o),h=s.skipSpaces(h),h>=f))){r=o===61?1:2;break}}if(s.sCount[a]<0)continue;let p=!1;for(let h=0,f=i.length;h<f;h++)if(i[h](s,a,t,!0)){p=!0;break}if(p)break}if(!r)return s.parentType=n,!1;let c=ps(s.getLines(e,a,s.blkIndent,!1));s.line=a+1;let u=s.push("heading_open","h"+String(r),1);u.markup=String.fromCharCode(o),u.map=[e,s.line];let l=s.push("inline","",0);l.content=c,l.map=[e,s.line-1],l.children=[];let d=s.push("heading_close","h"+String(r),-1);return d.markup=String.fromCharCode(o),s.parentType=n,!0}function Rl(s,e,t){let i=s.md.block.ruler.getRules("paragraph"),n=s.parentType,r=e+1;for(s.parentType="paragraph";r<t&&!s.isEmpty(r);r++){if(s.sCount[r]-s.blkIndent>3||s.sCount[r]<0)continue;let u=!1;for(let l=0,d=i.length;l<d;l++)if(i[l](s,r,t,!0)){u=!0;break}if(u)break}let o=ps(s.getLines(e,r,s.blkIndent,!1));s.line=r;let a=s.push("paragraph_open","p",1);a.map=[e,s.line];let c=s.push("inline","",0);return c.content=o,c.map=[e,s.line],c.children=[],s.push("paragraph_close","p",-1),s.parentType=n,!0}var qo=[["table",bl,["paragraph","reference"]],["code",kl],["fence",xl,["paragraph","reference","blockquote","list"]],["blockquote",_l,["paragraph","reference","blockquote","list"]],["hr",wl,["paragraph","reference","blockquote","list"]],["list",yl,["paragraph","reference","blockquote"]],["reference",Sl],["html_block",Nl,["paragraph","reference","blockquote"]],["heading",El,["paragraph","reference","blockquote"]],["lheading",Cl],["paragraph",Rl]];function Fo(){this.ruler=new hs;for(let s=0;s<qo.length;s++)this.ruler.push(qo[s][0],qo[s][1],{alt:(qo[s][2]||[]).slice()})}Fo.prototype.tokenize=function(s,e,t){let i=this.ruler.getRules(""),n=i.length,r=s.md.options.maxNesting,o=e,a=!1;for(;o<t&&(s.line=o=s.skipEmptyLines(o),!(o>=t||s.sCount[o]<s.blkIndent));){if(s.level>=r){s.line=t;break}let c=s.line,u=!1;for(let l=0;l<n;l++)if(u=i[l](s,o,t,!1),u){if(c>=s.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");s.tight=!a,s.isEmpty(s.line-1)&&(a=!0),o=s.line,o<t&&s.isEmpty(o)&&(a=!0,o++,s.line=o)}};Fo.prototype.parse=function(s,e,t,i){if(!s)return;let n=new this.State(s,e,t,i);this.tokenize(n,n.line,n.lineMax)};Fo.prototype.State=eg;var ag=Fo;function fn(s,e,t,i){this.src=s,this.env=t,this.md=e,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.skipHtmlSpecial=!1,this.linkLevel=0}fn.prototype.pushPending=function(){let s=new mt("text","",0);return s.content=this.pending,s.level=this.pendingLevel,this.tokens.push(s),this.pending="",s};fn.prototype.push=function(s,e,t){this.pending&&this.pushPending();let i=new mt(s,e,t),n=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(n),i};fn.prototype.scanDelims=function(s,e){let t=this.posMax,i=this.src.charCodeAt(s),n;if(s===0)n=32;else if(s===1)n=this.src.charCodeAt(0),(n&63488)===55296&&(n=65533);else if(n=this.src.charCodeAt(s-1),(n&64512)===56320){let g=this.src.charCodeAt(s-2);n=(g&64512)===55296?65536+(g-55296<<10)+(n-56320):65533}else(n&64512)===55296&&(n=65533);let r=s;for(;r<t&&this.src.charCodeAt(r)===i;)r++;let o=r-s,a=r<t?this.src.charCodeAt(r):32;if((a&64512)===55296){let g=this.src.charCodeAt(r+1);a=(g&64512)===56320?65536+(a-55296<<10)+(g-56320):65533}else(a&64512)===56320&&(a=65533);let c=ls(n)||us(n),u=ls(a)||us(a),l=cs(n),d=cs(a),p=!d&&(!u||l||c),h=!l&&(!c||d||u);return{can_open:p&&(e||!h||c),can_close:h&&(e||!p||u),length:o}};fn.prototype.Token=mt;var cg=fn;function D3(s){switch(s){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Al(s,e){let t=s.pos;for(;t<s.posMax&&!D3(s.src.charCodeAt(t));)t++;return t===s.pos?!1:(e||(s.pending+=s.src.slice(s.pos,t)),s.pos=t,!0)}function P3(s){return s>=65&&s<=90||s>=97&&s<=122}function q3(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===45||s===46}function Il(s,e){if(!s.md.options.linkify||s.linkLevel>0)return!1;let t=s.pos,i=s.posMax;if(t+3>i||s.src.charCodeAt(t)!==58||s.src.charCodeAt(t+1)!==47||s.src.charCodeAt(t+2)!==47)return!1;let n=t-Math.min(10,s.pending.length,t),r=t;for(;r>n&&q3(s.src.charCodeAt(r-1));)r--;if(r===t||!P3(s.src.charCodeAt(r)))return!1;let o=t-r,a=s.md.linkify.matchAtStart(s.src.slice(r));if(!a)return!1;let c=a.url;if(c.length<=o)return!1;let u=c.length;for(;u>0&&c.charCodeAt(u-1)===42;)u--;u!==c.length&&(c=c.slice(0,u));let l=s.md.normalizeLink(c);if(!s.md.validateLink(l))return!1;if(!e){s.pending=s.pending.slice(0,-o);let d=s.push("link_open","a",1);d.attrs=[["href",l]],d.markup="linkify",d.info="auto";let p=s.push("text","",0);p.content=s.md.normalizeLinkText(c);let h=s.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return s.pos+=c.length-o,!0}function Tl(s,e){let t=s.pos;if(s.src.charCodeAt(t)!==10)return!1;let i=s.pending.length-1,n=s.posMax;if(!e)if(i>=0&&s.pending.charCodeAt(i)===32)if(i>=1&&s.pending.charCodeAt(i-1)===32){let r=i-1;for(;r>=1&&s.pending.charCodeAt(r-1)===32;)r--;s.pending=s.pending.slice(0,r),s.push("hardbreak","br",0)}else s.pending=s.pending.slice(0,-1),s.push("softbreak","br",0);else s.push("softbreak","br",0);for(t++;t<n&&D(s.src.charCodeAt(t));)t++;return s.pos=t,!0}var Ol=[];for(let s=0;s<256;s++)Ol.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(s){Ol[s.charCodeAt(0)]=1});function Dl(s,e){let t=s.pos,i=s.posMax;if(s.src.charCodeAt(t)!==92||(t++,t>=i))return!1;let n=s.src.charCodeAt(t);if(n===10){for(e||s.push("hardbreak","br",0),t++;t<i&&(n=s.src.charCodeAt(t),!!D(n));)t++;return s.pos=t,!0}if(n===32){if(!e){let a=s.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return s.pos=t,!0}let r=s.src[t];if(n>=55296&&n<=56319&&t+1<i){let a=s.src.charCodeAt(t+1);a>=56320&&a<=57343&&(r+=s.src[t+1],t++)}let o="\\"+r;if(!e){let a=s.push("text_special","",0);n<256&&Ol[n]!==0?a.content=r:a.content=o,a.markup=o,a.info="escape"}return s.pos=t+1,!0}function Pl(s,e){let t=s.pos;if(s.src.charCodeAt(t)!==96)return!1;let n=t;t++;let r=s.posMax;for(;t<r&&s.src.charCodeAt(t)===96;)t++;let o=s.src.slice(n,t),a=o.length;if(s.backticksScanned&&(s.backticks[a]||0)<=n)return e||(s.pending+=o),s.pos+=a,!0;let c=t,u;for(;(u=s.src.indexOf("`",c))!==-1;){for(c=u+1;c<r&&s.src.charCodeAt(c)===96;)c++;let l=c-u;if(l===a){if(!e){let d=s.push("code_inline","code",0);d.markup=o,d.content=s.src.slice(t,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return s.pos=c,!0}s.backticks[l]=u}return s.backticksScanned=!0,e||(s.pending+=o),s.pos+=a,!0}function F3(s,e){let t=s.pos,i=s.src.charCodeAt(t);if(e||i!==126)return!1;let n=s.scanDelims(s.pos,!0),r=n.length,o=String.fromCharCode(i);if(r<2)return!1;let a;r%2&&(a=s.push("text","",0),a.content=o,r--);for(let c=0;c<r;c+=2)a=s.push("text","",0),a.content=o+o,s.delimiters.push({marker:i,length:0,token:s.tokens.length-1,end:-1,open:n.can_open,close:n.can_close});return s.pos+=n.length,!0}function ug(s,e){let t,i=[],n=e.length;for(let r=0;r<n;r++){let o=e[r];if(o.marker!==126||o.end===-1)continue;let a=e[o.end];t=s.tokens[o.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=s.tokens[a.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",s.tokens[a.token-1].type==="text"&&s.tokens[a.token-1].content==="~"&&i.push(a.token-1)}for(;i.length;){let r=i.pop(),o=r+1;for(;o<s.tokens.length&&s.tokens[o].type==="s_close";)o++;o--,r!==o&&(t=s.tokens[o],s.tokens[o]=s.tokens[r],s.tokens[r]=t)}}function M3(s){let e=s.tokens_meta,t=s.tokens_meta.length;ug(s,s.delimiters);for(let i=0;i<t;i++)e[i]&&e[i].delimiters&&ug(s,e[i].delimiters)}var ql={tokenize:F3,postProcess:M3};function L3(s,e){let t=s.pos,i=s.src.charCodeAt(t);if(e||i!==95&&i!==42)return!1;let n=s.scanDelims(s.pos,i===42);for(let r=0;r<n.length;r++){let o=s.push("text","",0);o.content=String.fromCharCode(i),s.delimiters.push({marker:i,length:n.length,token:s.tokens.length-1,end:-1,open:n.can_open,close:n.can_close})}return s.pos+=n.length,!0}function lg(s,e){let t=e.length;for(let i=t-1;i>=0;i--){let n=e[i];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let r=e[n.end],o=i>0&&e[i-1].end===n.end+1&&e[i-1].marker===n.marker&&e[i-1].token===n.token-1&&e[n.end+1].token===r.token+1,a=String.fromCharCode(n.marker),c=s.tokens[n.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?a+a:a,c.content="";let u=s.tokens[r.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?a+a:a,u.content="",o&&(s.tokens[e[i-1].token].content="",s.tokens[e[n.end+1].token].content="",i--)}}function B3(s){let e=s.tokens_meta,t=s.tokens_meta.length;lg(s,s.delimiters);for(let i=0;i<t;i++)e[i]&&e[i].delimiters&&lg(s,e[i].delimiters)}var Fl={tokenize:L3,postProcess:B3};function Ml(s,e){let t,i,n,r,o="",a="",c=s.pos,u=!0;if(s.src.charCodeAt(s.pos)!==91)return!1;let l=s.pos,d=s.posMax,p=s.pos+1,h=s.md.helpers.parseLinkLabel(s,s.pos,!0);if(h<0)return!1;let f=h+1;if(f<d&&s.src.charCodeAt(f)===40){for(u=!1,f++;f<d&&(t=s.src.charCodeAt(f),!(!D(t)&&t!==10));f++);if(f>=d)return!1;if(c=f,n=s.md.helpers.parseLinkDestination(s.src,f,s.posMax),n.ok){for(o=s.md.normalizeLink(n.str),s.md.validateLink(o)?f=n.pos:o="",c=f;f<d&&(t=s.src.charCodeAt(f),!(!D(t)&&t!==10));f++);if(n=s.md.helpers.parseLinkTitle(s.src,f,s.posMax),f<d&&c!==f&&n.ok)for(a=n.str,f=n.pos;f<d&&(t=s.src.charCodeAt(f),!(!D(t)&&t!==10));f++);}(f>=d||s.src.charCodeAt(f)!==41)&&(u=!0),f++}if(u){if(typeof s.env.references>"u")return!1;if(f<d&&s.src.charCodeAt(f)===91?(c=f+1,f=s.md.helpers.parseLinkLabel(s,f),f>=0?i=s.src.slice(c,f++):f=h+1):f=h+1,i||(i=s.src.slice(p,h)),r=s.env.references[ds(i)],!r)return s.pos=l,!1;o=r.href,a=r.title}if(!e){s.pos=p,s.posMax=h;let m=s.push("link_open","a",1),g=[["href",o]];m.attrs=g,a&&g.push(["title",a]),s.linkLevel++,s.md.inline.tokenize(s),s.linkLevel--,s.push("link_close","a",-1)}return s.pos=f,s.posMax=d,!0}function Ll(s,e){let t,i,n,r,o,a,c,u,l="",d=s.pos,p=s.posMax;if(s.src.charCodeAt(s.pos)!==33||s.src.charCodeAt(s.pos+1)!==91)return!1;let h=s.pos+2,f=s.md.helpers.parseLinkLabel(s,s.pos+1,!1);if(f<0)return!1;if(r=f+1,r<p&&s.src.charCodeAt(r)===40){for(r++;r<p&&(t=s.src.charCodeAt(r),!(!D(t)&&t!==10));r++);if(r>=p)return!1;for(u=r,a=s.md.helpers.parseLinkDestination(s.src,r,s.posMax),a.ok&&(l=s.md.normalizeLink(a.str),s.md.validateLink(l)?r=a.pos:l=""),u=r;r<p&&(t=s.src.charCodeAt(r),!(!D(t)&&t!==10));r++);if(a=s.md.helpers.parseLinkTitle(s.src,r,s.posMax),r<p&&u!==r&&a.ok)for(c=a.str,r=a.pos;r<p&&(t=s.src.charCodeAt(r),!(!D(t)&&t!==10));r++);else c="";if(r>=p||s.src.charCodeAt(r)!==41)return s.pos=d,!1;r++}else{if(typeof s.env.references>"u")return!1;if(r<p&&s.src.charCodeAt(r)===91?(u=r+1,r=s.md.helpers.parseLinkLabel(s,r),r>=0?n=s.src.slice(u,r++):r=f+1):r=f+1,n||(n=s.src.slice(h,f)),o=s.env.references[ds(n)],!o)return s.pos=d,!1;l=o.href,c=o.title}if(!e){i=s.src.slice(h,f);let m=[];s.md.inline.parse(i,s.md,s.env,m);let g=s.push("image","img",0),b=[["src",l],["alt",""]];g.attrs=b,g.children=m,g.content=i,c&&b.push(["title",c])}return s.pos=r,s.posMax=p,!0}var W3=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,$3=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Bl(s,e){let t=s.pos;if(s.src.charCodeAt(t)!==60)return!1;let i=s.pos,n=s.posMax;for(;;){if(++t>=n)return!1;let o=s.src.charCodeAt(t);if(o===60)return!1;if(o===62)break}let r=s.src.slice(i+1,t);if($3.test(r)){let o=s.md.normalizeLink(r);if(!s.md.validateLink(o))return!1;if(!e){let a=s.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";let c=s.push("text","",0);c.content=s.md.normalizeLinkText(r);let u=s.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return s.pos+=r.length+2,!0}if(W3.test(r)){let o=s.md.normalizeLink("mailto:"+r);if(!s.md.validateLink(o))return!1;if(!e){let a=s.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";let c=s.push("text","",0);c.content=s.md.normalizeLinkText(r);let u=s.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return s.pos+=r.length+2,!0}return!1}function j3(s){return/^<a[>\s]/i.test(s)}function z3(s){return/^<\/a\s*>/i.test(s)}function dg(s){let e=s|32;return e>=97&&e<=122}function U3(s,e){let t=s.src,i,n;if(t.startsWith("<!--",e)){if(t.startsWith(">",e+4))return e+5;if(t.startsWith("->",e+4))return e+6;i=e+4,n="-->"}else if(t.startsWith("<![CDATA[",e))i=e+9,n="]]>";else if(t.charCodeAt(e+1)===63)i=e+2,n="?>";else if(dg(t.charCodeAt(e+2)))i=e+3,n=">";else return-1;if(s.skipHtmlSpecial)return-1;let r=t.indexOf(n,i);return r<0?(s.skipHtmlSpecial=!0,-1):r+n.length}function Wl(s,e){if(!s.md.options.html)return!1;let t=s.posMax,i=s.pos;if(s.src.charCodeAt(i)!==60||i+2>=t)return!1;let n,r=s.src.charCodeAt(i+1);if(r===33||r===63)n=U3(s,i);else if(r===47||dg(r)){let o=s.src.slice(i).match(Po);n=o?i+o[0].length:-1}else return!1;if(n<0)return!1;if(!e){let o=s.push("html_inline","",0);o.content=s.src.slice(i,n),j3(o.content)&&s.linkLevel++,z3(o.content)&&s.linkLevel--}return s.pos=n,!0}var V3=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,H3=/^&([a-z][a-z0-9]{1,31});/i;function $l(s,e){let t=s.pos,i=s.posMax;if(s.src.charCodeAt(t)!==38||t+1>=i)return!1;if(s.src.charCodeAt(t+1)===35){let r=s.src.slice(t).match(V3);if(r){if(!e){let o=r[1][0].toLowerCase()==="x"?parseInt(r[1].slice(1),16):parseInt(r[1],10),a=s.push("text_special","",0);a.content=To(o)?ri(o):ri(65533),a.markup=r[0],a.info="entity"}return s.pos+=r[0].length,!0}}else{let r=s.src.slice(t).match(H3);if(r){let o=pn(r[0]);if(o!==r[0]){if(!e){let a=s.push("text_special","",0);a.content=o,a.markup=r[0],a.info="entity"}return s.pos+=r[0].length,!0}}}return!1}function pg(s){let e={},t=s.length;if(!t)return;let i=0,n=-2,r=[];for(let o=0;o<t;o++){let a=s[o];if(r.push(0),(s[i].marker!==a.marker||n!==a.token-1)&&(i=o),n=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);let c=e[a.marker][(a.open?3:0)+a.length%3],u=i-r[i]-1,l=u;for(;u>c;u-=r[u]+1){let d=s[u];if(d.marker===a.marker&&d.open&&d.end<0){let p=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(p=!0),!p){let h=u>0&&!s[u-1].open?r[u-1]+1:0;r[o]=o-u+h,r[u]=h,a.open=!1,d.end=o,d.close=!1,l=-1,n=-2;break}}}l!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=l)}}function jl(s){let e=s.tokens_meta,t=s.tokens_meta.length;pg(s.delimiters);for(let i=0;i<t;i++)e[i]&&e[i].delimiters&&pg(e[i].delimiters)}function zl(s){let e,t,i=0,n=s.tokens,r=s.tokens.length;for(e=t=0;e<r;e++)n[e].nesting<0&&i--,n[e].level=i,n[e].nesting>0&&i++,n[e].type==="text"&&e+1<r&&n[e+1].type==="text"?n[e+1].content=n[e].content+n[e+1].content:(e!==t&&(n[t]=n[e]),t++);e!==t&&(n.length=t)}var Ul=[["text",Al],["linkify",Il],["newline",Tl],["escape",Dl],["backticks",Pl],["strikethrough",ql.tokenize],["emphasis",Fl.tokenize],["link",Ml],["image",Ll],["autolink",Bl],["html_inline",Wl],["entity",$l]],Vl=[["balance_pairs",jl],["strikethrough",ql.postProcess],["emphasis",Fl.postProcess],["fragments_join",zl]];function mn(){this.ruler=new hs;for(let s=0;s<Ul.length;s++)this.ruler.push(Ul[s][0],Ul[s][1]);this.ruler2=new hs;for(let s=0;s<Vl.length;s++)this.ruler2.push(Vl[s][0],Vl[s][1])}mn.prototype.skipToken=function(s){let e=s.pos,t=this.ruler.getRules(""),i=t.length,n=s.md.options.maxNesting,r=s.cache;if(typeof r[e]<"u"){s.pos=r[e];return}let o=!1;if(s.level<n){for(let a=0;a<i;a++)if(s.level++,o=t[a](s,!0),s.level--,o){if(e>=s.pos)throw new Error("inline rule didn't increment state.pos");break}}else s.pos=s.posMax;o||s.pos++,r[e]=s.pos};mn.prototype.tokenize=function(s){let e=this.ruler.getRules(""),t=e.length,i=s.posMax,n=s.md.options.maxNesting;for(;s.pos<i;){let r=s.pos,o=!1;if(s.level<n){for(let a=0;a<t;a++)if(o=e[a](s,!1),o){if(r>=s.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(s.pos>=i)break;continue}s.pending+=s.src[s.pos++]}s.pending&&s.pushPending()};mn.prototype.parse=function(s,e,t,i){let n=new this.State(s,e,t,i);this.tokenize(n);let r=this.ruler2.getRules(""),o=r.length;for(let a=0;a<o;a++)r[a](n)};mn.prototype.State=cg;var hg=mn;function fg(s){let e={};s=s||{},e.src_Any=So.source,e.src_Cc=No.source,e.src_Z=Co.source,e.src_P=si.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");let t="[><\uFF5C]";return e.src_pseudo_letter=`(?:(?!${t}|${e.src_ZPCc})${e.src_Any})`,e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth=`(?:(?:(?!${e.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator=`(?=$|${t}|${e.src_ZPCc})(?!${s["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${e.src_ZPCc}))`,e.src_path=`(?:[/?#](?:(?!${e.src_ZCc}|${t}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${e.src_ZCc}|\\]).)*\\]|\\((?:(?!${e.src_ZCc}|[)]).)*\\)|\\{(?:(?!${e.src_ZCc}|[}]).)*\\}|\\"(?:(?!${e.src_ZCc}|["]).)+\\"|\\'(?:(?!${e.src_ZCc}|[']).)+\\'|\\'(?=${e.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${e.src_ZCc}|[.]|$)|`+(s["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${e.src_ZCc}|$)|;(?!${e.src_ZCc}|$)|\\!+(?!${e.src_ZCc}|[!]|$)|\\?(?!${e.src_ZCc}|[?]|$))+|\\/)?`,e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+`|${e.src_pseudo_letter}{1,63})`,e.src_domain="(?:"+e.src_xn+`|(?:${e.src_pseudo_letter})|(?:${e.src_pseudo_letter}(?:-|${e.src_pseudo_letter}){0,61}${e.src_pseudo_letter}))`,e.src_host=`(?:(?:(?:(?:${e.src_domain})\\.)*${e.src_domain}))`,e.tpl_host_fuzzy="(?:"+e.src_ip4+`|(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%)))`,e.tpl_host_no_ip_fuzzy=`(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%))`,e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${e.src_ZPCc}|>|$))`,e.tpl_email_fuzzy=`(^|${t}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}function Hl(s){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(i){s[i]=t[i]})}),s}function Lo(s){return Object.prototype.toString.call(s)}function G3(s){return Lo(s)==="[object String]"}function K3(s){return Lo(s)==="[object Object]"}function J3(s){return Lo(s)==="[object RegExp]"}function mg(s){return Lo(s)==="[object Function]"}function Y3(s){return s.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var bg={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Z3(s){return Object.keys(s||{}).reduce(function(e,t){return e||bg.hasOwnProperty(t)},!1)}var Q3={"http:":{validate:function(s,e,t){let i=s.slice(e);return t.re.http||(t.re.http=new RegExp(`^\\/\\/${t.re.src_auth}${t.re.src_host_port_strict}${t.re.src_path}`,"i")),t.re.http.test(i)?i.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(s,e,t){let i=s.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+`(?:localhost|(?:(?:${t.re.src_domain})\\.)+${t.re.src_domain_root})`+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(i)?e>=3&&s[e-3]===":"||e>=3&&s[e-3]==="/"?0:i.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(s,e,t){let i=s.slice(e);return t.re.mailto||(t.re.mailto=new RegExp(`^${t.re.src_email_name}@${t.re.src_host_strict}`,"i")),t.re.mailto.test(i)?i.match(t.re.mailto)[0].length:0}}},X3="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",eN="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function tN(s){return function(e,t){let i=e.slice(t);return s.test(i)?i.match(s)[0].length:0}}function gg(){return function(s,e){e.normalize(s)}}function Mo(s){let e=s.re=fg(s.__opts__),t=s.__tlds__.slice();s.onCompile(),s.__tlds_replaced__||t.push(X3),t.push(e.src_xn),e.src_tlds=t.join("|");function i(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(i(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(i(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(i(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(i(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(i(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(i(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(i(e.tpl_host_fuzzy_test),"i");let n=[];s.__compiled__={};function r(a,c){throw new Error(`(LinkifyIt) Invalid schema "${a}": ${c}`)}Object.keys(s.__schemas__).forEach(function(a){let c=s.__schemas__[a];if(c===null)return;let u={validate:null,link:null};if(s.__compiled__[a]=u,K3(c)){J3(c.validate)?u.validate=tN(c.validate):mg(c.validate)?u.validate=c.validate:r(a,c),mg(c.normalize)?u.normalize=c.normalize:c.normalize?r(a,c):u.normalize=gg();return}if(G3(c)){n.push(a);return}r(a,c)}),n.forEach(function(a){s.__compiled__[s.__schemas__[a]]&&(s.__compiled__[a].validate=s.__compiled__[s.__schemas__[a]].validate,s.__compiled__[a].normalize=s.__compiled__[s.__schemas__[a]].normalize)}),s.__compiled__[""]={validate:null,normalize:gg()};let o=Object.keys(s.__compiled__).filter(function(a){return a.length>0&&s.__compiled__[a]}).map(Y3).join("|");s.re.schema_test=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${o})`,"i"),s.re.schema_search=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${o})`,"ig"),s.re.schema_at_start=RegExp(`^${s.re.schema_search.source}`,"i"),s.re.pretest=RegExp(`(${s.re.schema_test.source})|(${s.re.host_fuzzy_test.source})|@`,"i")}function kg(s,e,t,i){let n=s.slice(t,i);this.schema=e.toLowerCase(),this.index=t,this.lastIndex=i,this.raw=n,this.text=n,this.url=n}function ye(s,e){if(!(this instanceof ye))return new ye(s,e);e||Z3(s)&&(e=s,s={}),this.__opts__=Hl({},bg,e),this.__schemas__=Hl({},Q3,s),this.__compiled__={},this.__tlds__=eN,this.__tlds_replaced__=!1,this.re={},Mo(this)}ye.prototype.add=function(e,t){return this.__schemas__[e]=t,Mo(this),this};ye.prototype.set=function(e){return this.__opts__=Hl(this.__opts__,e),this};ye.prototype.test=function(e){if(!e.length)return!1;let t,i;if(this.re.schema_test.test(e)){for(i=this.re.schema_search,i.lastIndex=0;(t=i.exec(e))!==null;)if(this.testSchemaAt(e,t[2],i.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)};ye.prototype.pretest=function(e){return this.re.pretest.test(e)};ye.prototype.testSchemaAt=function(e,t,i){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,i,this):0};ye.prototype.match=function(e){let t=[],i=[],n=[],r=[],o,a,c;function u(p,h){return p?h?p.index!==h.index?p.index<h.index?p:h:p.lastIndex>=h.lastIndex?p:h:p:h}if(!e.length)return null;if(this.re.schema_test.test(e))for(c=this.re.schema_search,c.lastIndex=0;(o=c.exec(e))!==null;)a=this.testSchemaAt(e,o[2],c.lastIndex),a&&i.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(o=c.exec(e))!==null;)n.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(o=c.exec(e))!==null;)r.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});let l=[0,0,0],d=0;for(;;){let p=[i[l[0]],r[l[1]],n[l[2]]],h=u(u(p[0],p[1]),p[2]);if(!h)break;if(h===p[0]?l[0]++:h===p[1]?l[1]++:l[2]++,h.index<d)continue;let f=new kg(e,h.schema,h.index,h.lastIndex);this.__compiled__[f.schema].normalize(f,this),t.push(f),d=h.lastIndex}return t.length?t:null};ye.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let i=this.testSchemaAt(e,t[2],t[0].length);if(!i)return null;let n=new kg(e,t[2],t.index+t[1].length,t.index+t[0].length+i);return this.__compiled__[n.schema].normalize(n,this),n};ye.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(i,n,r){return i!==r[n-1]}).reverse(),Mo(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Mo(this),this)};ye.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)};ye.prototype.onCompile=function(){};var xg=ye;var Jl=F(Cg(),1);var Rg={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}};var Ag={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}};var Ig={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}};var pN={default:Rg,zero:Ag,commonmark:Ig},hN=/^(vbscript|javascript|file|data):/,fN=/^data:image\/(gif|png|jpeg|webp);/;function mN(s){let e=s.trim().toLowerCase();return hN.test(e)?fN.test(e):!0}var Tg=["http:","https:","mailto:"];function gN(s){let e=dn(s,!0);if(e.hostname&&(!e.protocol||Tg.indexOf(e.protocol)>=0))try{e.hostname=Jl.default.toASCII(e.hostname)}catch{}return wo(ti(e))}function bN(s){let e=dn(s,!0);if(e.hostname&&(!e.protocol||Tg.indexOf(e.protocol)>=0))try{e.hostname=Jl.default.toUnicode(e.hostname)}catch{}return ln(ti(e),ln.defaultChars+"%")}function Te(s,e){if(!(this instanceof Te))return new Te(s,e);e||Io(s)||(e=s||{},s="default"),this.inline=new hg,this.block=new ag,this.core=new X0,this.renderer=new H0,this.linkify=new xg,this.validateLink=mN,this.normalizeLink=gN,this.normalizeLinkText=bN,this.utils=sl,this.helpers=ni({},ol),this.options={},this.configure(s),e&&this.set(e)}Te.prototype.set=function(s){return ni(this.options,s),this};Te.prototype.configure=function(s){let e=this;if(Io(s)){let t=s;if(s=pN[t],!s)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!s)throw new Error("Wrong `markdown-it` preset, can't be empty");return s.options&&e.set(s.options),s.components&&Object.keys(s.components).forEach(function(t){s.components[t].rules&&e[t].ruler.enableOnly(s.components[t].rules),s.components[t].rules2&&e[t].ruler2.enableOnly(s.components[t].rules2)}),this};Te.prototype.enable=function(s,e){let t=[];Array.isArray(s)||(s=[s]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.enable(s,!0))},this),t=t.concat(this.inline.ruler2.enable(s,!0));let i=s.filter(function(n){return t.indexOf(n)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};Te.prototype.disable=function(s,e){let t=[];Array.isArray(s)||(s=[s]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.disable(s,!0))},this),t=t.concat(this.inline.ruler2.disable(s,!0));let i=s.filter(function(n){return t.indexOf(n)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};Te.prototype.use=function(s){let e=[this].concat(Array.prototype.slice.call(arguments,1));return s.apply(s,e),this};Te.prototype.parse=function(s,e){if(typeof s!="string")throw new Error("Input data should be a String");let t=new this.core.State(s,this,e);return this.core.process(t),t.tokens};Te.prototype.render=function(s,e){return e=e||{},this.renderer.render(this.parse(s,e),this.options,e)};Te.prototype.parseInline=function(s,e){let t=new this.core.State(s,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};Te.prototype.renderInline=function(s,e){return e=e||{},this.renderer.render(this.parseInline(s,e),this.options,e)};var Yl=Te;var Sk=require("crypto"),I=F(require("fs"));var Zl="data_model/";var Ql=["model.yaml","types.ts","types.py"],Og="data_model/changes/",Dg="data_model/queries/",Pg="data_model/repositories/",kN=new RegExp("^data_model/changes/([0-9]{4})_[a-z][a-z0-9_]{0,49}\\.yaml$"),zT=new RegExp("^data_model/queries/([A-Z][A-Za-z0-9]*)\\.yaml$"),xN=new RegExp("^data_model/repositories/[A-Z][A-Za-z0-9]*\\.(py|ts)$");function ms(s){return Ql.some(e=>Zl+e===s)||xN.test(s)}function Bo(s){let e=kN.exec(s);return e!==null&&Number(e[1])>0}var Nk=F(Wg()),R=F(require("path")),pa=F(ko()),Ek=F(eb());var ks=F(require("path")),rE=F(ko());var JT=5*6e4;var Ko=".bw";var rd=".skills",od=".docs";var ad="AGENTS.md",cd="CLAUDE.md";var iO=ks.join(__dirname,"..","wb-cli","skills","bw-workblock","SKILL.md");var nO=[`${Ko}/`,`${rd}/`,`${od}/`,ad,cd,"node_modules/","__pycache__/"];var Sn="graphlake/schema.json";function En(s){let e=["created_at","updated_at","state","actor","branch_user","storing"],t=s;for(let i of e)delete t[i];for(let i of t.tasks??[])delete i.created_at,delete i.updated_at,delete i.explanation,i.action.value=i.action.value?.trim(),i.assets||(i.assets={});return t.react_components||(t.react_components={}),t.python||(t.python={}),t.library&&(t.library=t.library.trim()),t.graphlake&&!t.graphlake.schema&&delete t.graphlake,t}async function Cn(s){return await CC(s,"manifest.yaml","manifest.yaml")}async function CC(s,e,t){if(!I.existsSync(s))return R.join(s,t);let n=(await I.promises.readdir(s)).find(r=>r.endsWith(e));return n?R.join(s,n):R.join(s,t)}function pe(s){let e=R.basename(s).toLowerCase(),t="",i=!1;for(let n of e)n>="a"&&n<="z"||n>="0"&&n<="9"||n==="."||n==="-"?(t+=n,i=!1):i||(t+="_",i=!0);return t=t.replace(/^_+|_+$/g,"").replace(/^\.+/,""),t===""&&(t="file"),t}function Ad(s){return pe(s.name)+(s.type==="bun"?".test.ts":".py")}function RC(s,e){let t=R.posix.normalize(e.replaceAll("\\","/"));if(R.posix.isAbsolute(t)||t===".."||t.startsWith("../"))throw new Error(`invalid asset path: ${e}`);return R.posix.join(s.replaceAll("\\","/"),t)}function Id(s,e){let t=R.join(s,e+".py");if(I.existsSync(t))return t;if(!I.existsSync(s))return null;let n=I.readdirSync(s).find(r=>r.endsWith(".py"));return n?R.join(s,n):null}var AC=/\.[cm]?ts$/;async function wk(s,e="text/plain"){let{fileTypeFromFile:t}=await Promise.resolve().then(()=>(_k(),xk)),i=R.basename(s),n=(await t(s))?.mime;n||(n=AC.test(i)?"text/plain":Nk.lookup(i)||e);let r=I.readFileSync(s);return IC(r)?{content_type:n,text:r.toString("utf8")}:{content_type:n,data:r.toString("base64")}}function yk(s){return s.text!==void 0?s.text.trim()==="":!s.data}function Rd(s){try{let e=I.statSync(s);return e.size===0||e.size<4096&&I.readFileSync(s,"utf8").trim()===""}catch{return!1}}function IC(s){try{return new TextDecoder("utf-8",{fatal:!0}).decode(s),!0}catch{return!1}}var Ck=new Set(["node_modules",".git","bun.lock","pnpm-lock.yaml","__pycache__"]),kt=Zl.replace(/\/$/,""),Rk=new Set([kt,"graphlake","python","design_docs","react_components"]);var zt=Og.replace(/\/$/,""),Nn=Dg.replace(/\/$/,""),TC=Pg.replace(/\/$/,""),OC=new Set([Ko,rd,od,ad,cd,".gitignore"]);async function bi(s,e,t){let i=m=>t?.add(R.resolve(m)),n=m=>(i(m),I.readFileSync(m,"utf8")),r=await Cn(s);if(!I.existsSync(r)){e.error(`Manifest file ${r} not found`);return}let o=n(r),a=(0,pa.parse)(o);delete a.data_model,a.state="modified",a.updated_at=new Date().toISOString();let c=async(m,g,b,w)=>{let y=R.join(m,b);if(!I.existsSync(y))return;let x=g,_=x[b]=x[b]??{};await l(y,"",_,w),Object.keys(_).length===0&&delete x[b]};for(let m of a.modules??[]){let g=R.join(s,pe(m.name));if(!I.existsSync(g)){e.error(`Module directory ${g} not found`);return}for(let b of m.tasks??[]){let w=pe(b.name),y=R.join(g,w);if(!I.existsSync(y)){e.error(`Task directory ${y} not found`);continue}if(b.action.type==="code"||b.action.type==="python"){let x=Id(y,w);if(!x){e.error(`Task file for ${b.name} not found under ${y}`);return}b.action.value=n(x)}await c(y,b,"assets","text/plain"),await c(y,b,"design_docs","text/markdown")}if(m.tests&&m.tests.length>0){let b=new Map;for(let w of m.tests){let y=pe(w.name),x=b.get(y);if(x!==void 0)throw new Error(`duplicate normalized test filename "${y}" in module "${m.name}": "${w.name}" conflicts with "${x}"`);b.set(y,w.name)}for(let w of m.tests){let y=R.join(g,"tests",Ad(w));I.existsSync(y)&&(w.value=n(y))}}await c(g,m,"design_docs","text/markdown")}for(let[m,g]of[["library.py","library"],["schema.yaml","schema"],["logo.svg","logo"]]){let b=R.join(s,m);I.existsSync(b)&&!Rd(b)&&(a[g]=n(b))}let u=R.join(s,Sn);I.existsSync(u)&&!Rd(u)?a.graphlake={schema:{content_type:"application/json",text:n(u)}}:a.graphlake===void 0&&(a.graphlake={});async function l(m,g,b,w="text/plain"){let y=I.readdirSync(m);for(let x of y){if(Ck.has(x))continue;let _=R.join(m,x);if(await Dd(_,e))continue;let k=I.lstatSync(_);if(k.isSymbolicLink()){e.log(`Skipping symbolic link in workblock assets: ${_}`);continue}let S=R.posix.join(g.replaceAll("\\","/"),x);if(k.isDirectory()){await l(_,S,b,w);continue}let v=R.relative(s,_).split(R.sep).join("/");if(v.startsWith(`${zt}/`)&&!Bo(v))continue;let C=await wk(_,w);if(yk(C)){e.log(`Empty file not stored by the platform, left out: ${_}`);continue}b[S]=C,i(_)}}for(let m of["react_components","python"]){if(!I.existsSync(R.join(s,m)))continue;let g=a[m]=a[m]??{};await l(R.join(s,m),"",g),Object.keys(g).length===0&&delete a[m]}await c(s,a,"design_docs","text/markdown");let d=async m=>{let g=R.join(s,m),b=da(s,g)?await wk(g):void 0;if(!(b===void 0||yk(b)))return i(g),b},p={};for(let m of DC(s)){let g=await d(`${kt}/${m}`);g&&(p.generated={...p.generated,[m]:g})}let h={};da(s,R.join(s,zt))&&await l(R.join(s,zt),"",h),Object.keys(h).length>0&&(p.changes=h);let f={};return da(s,R.join(s,Nn))&&await l(R.join(s,Nn),"",f),Object.keys(f).length>0&&(p.queries=f),Object.keys(p).length>0&&(a.data_model=p),PC(a),a}function da(s,e){if(!I.existsSync(e))return!1;let t=I.realpathSync(s),i=I.realpathSync(e);return i===t||i.startsWith(t+R.sep)}function DC(s){let e=[...Ql],t=R.join(s,TC);if(da(s,t)&&I.statSync(t).isDirectory())for(let i of I.readdirSync(t).sort())e.push(`repositories/${i}`);return e.filter(i=>ms(`${kt}/${i}`))}function vk(s,e){let t=(0,Sk.createHash)("sha1").update(Buffer.from(s.replace(/-/g,""),"hex")).update(e).digest();t[6]=t[6]&15|80,t[8]=t[8]&63|128;let i=t.subarray(0,16).toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20)}`}function PC(s){if(!s.id)return;let e=new Set;for(let i of s.modules??[])for(let n of[i,...i.tasks??[],...i.tests??[]])n.id&&e.add(n.id);let t=(i,n,r)=>{let o=vk(i,`${n}:${r}`);for(let a=2;e.has(o);a++)o=vk(i,`${n}#${a}:${r}`);return e.add(o),o};for(let i of s.modules??[]){i.id||=t(s.id,"module",i.name);for(let n of i.tasks??[])n.id||=t(i.id,"task",n.name);for(let n of i.tests??[])n.id||=t(i.id,"test",n.name)}}function Td(s){let e=s.split("/");return OC.has(e[0])||e.some(t=>Ck.has(t))}function Od(s,e,t,i){let n=new Map;for(let c of e.modules??[])n.set(pe(c.name),{name:c.name,tasks:new Map((c.tasks??[]).map(u=>[pe(u.name),u.name]))});let r="not part of the workblock",o=c=>{let[u,l,d,...p]=c.split("/"),h=n.get(u);if(u==="graphlake")return`only ${Sn} of the graphlake/ folder is part of the workblock`;if(l===void 0||Rk.has(u))return r;if(!h)return`no module in manifest.yaml maps to the directory ${u}/`;if(l==="design_docs")return r;let f=d!==void 0&&p.length===0&&d.endsWith(".py");if(l==="tests")return d!==void 0&&p.length===0&&d.endsWith(".test.ts")?`add a test named ${JSON.stringify(d.slice(0,-8))} with type: bun under tests: of module ${JSON.stringify(h.name)} in manifest.yaml`:f?`add a test named ${JSON.stringify(d.slice(0,-3))} with type: pytest under tests: of module ${JSON.stringify(h.name)} in manifest.yaml`:r;let m=h.tasks.get(l);return m?f?`only the task file of ${JSON.stringify(m)} is read; shared code goes in python/<name>.py or library.py`:r:`no task in module ${JSON.stringify(h.name)} maps to the directory ${u}/${l}/; add a task entry to manifest.yaml or delete it`},a=[];for(let c of i){let u=R.join(s,c);if(Td(c)||t.has(R.resolve(u)))continue;let l=I.lstatSync(u).isSymbolicLink()?"a symbolic link, which is never pushed":Rd(u)?"an empty file; the platform stores none, so it is not pushed":o(c);a.push({path:c,hint:l})}return a}function qC(s){let e=s;for(I.statSync(e).isDirectory()||(e=R.dirname(e));e!==R.parse(e).root;){let t=R.join(e,".gitignore"),i=R.join(e,".git");if(I.existsSync(i))return I.existsSync(t)?e:null;e=R.dirname(e)}return null}async function Dd(s,e){try{let t=qC(s);if(!t)return!1;let i=R.join(t,".gitignore"),n=I.readFileSync(i,"utf8"),r=R.relative(t,s),o=(0,Ek.default)();return o.add(n),o.ignores(r)}catch(t){return e.log(`Error checking gitignore status: ${t}`),!1}}function la(s,e){return R.relative(s,e).split(R.sep).join("/")}function FC(s,e,t,i){let n=R.resolve(s),r=[];for(let o of e??[]){if(t.has(o))continue;let a=R.relative(n,o);if(!a||a.startsWith("..")||R.isAbsolute(a))continue;I.rmSync(o,{force:!0}),r.push(a.split(R.sep).join("/"));let c=R.dirname(o);for(;c!==n&&c.startsWith(n+R.sep)&&!i.has(c)&&!(!I.existsSync(c)||I.readdirSync(c).length>0);)I.rmdirSync(c),c=R.dirname(c)}return r.sort()}async function Rn(s,e,t,i={}){let n=await Cn(s),r=R.resolve(s),o=[],a=(x,_,k=!1)=>{o.push({file:x,key:_,binary:k})},c=(x,_)=>{if(_)for(let[k,S]of Object.entries(_)){let v=RC(x.replaceAll("\\","/"),k),C=R.normalize(v);S.data&&(a(C,S.data,!0),delete S.data),S.text&&(a(C,S.text),delete S.text)}},u=(x,_)=>{_&&c(R.join(x,"design_docs"),_)},l=JSON.parse(JSON.stringify(e)),d=[];delete l.updated_at,delete l.state,delete l.actor,delete l.branch_user,delete l.storing;for(let x of l.modules??[]){let _=R.join(s,pe(x.name));d.push(_);for(let k of x.tasks??[]){let S=k.action.type==="typescript";if(k.action.type!=="code"&&k.action.type!=="python"&&!S)continue;let v=pe(k.name),C=R.join(_,v);if(!S){let T=Id(C,v)??R.join(C,`${v}.py`);a(T,k.action.value??"")}k.assets&&c(R.join(_,v,"assets"),k.assets),delete k.created_at,delete k.updated_at,S||delete k.action.value,delete k.assets,u(C,k.design_docs),delete k.design_docs}if(x.tests&&x.tests.length>0){let k=new Map;for(let S of x.tests){let v=pe(S.name),C=k.get(v);if(C!==void 0)throw new Error(`duplicate normalized test filename "${v}" in module "${x.name}": "${S.name}" conflicts with "${C}"`);if(k.set(v,S.name),S.value&&S.value.trim()!==""){let A=R.join(_,"tests",Ad(S));a(A,S.value),delete S.value}}}u(_,x.design_docs),delete x.design_docs}l.library&&a(R.join(s,"library.py"),l.library),l.schema&&a(R.join(s,"schema.yaml"),l.schema),l.logo&&a(R.join(s,"logo.svg"),l.logo),l.react_components&&c(R.join(s,"react_components"),l.react_components),l.python&&c(R.join(s,"python"),l.python),u(s,l.design_docs);for(let[x,_]of Object.entries(l.data_model?.generated??{}))_&&ms(`${kt}/${x}`)&&c(R.join(s,kt),{[x]:_});c(R.join(s,zt),l.data_model?.changes),c(R.join(s,Nn),l.data_model?.queries);let p=l.graphlake?.schema;p?.data?a(R.join(s,Sn),p.data,!0):p?.text&&a(R.join(s,Sn),p.text);let h=new Set([n,...o.map(x=>x.file)].map(x=>R.resolve(x)));for(let x of d)if(h.has(R.resolve(x)))throw new Error(`module directory "${la(r,R.resolve(x))}" collides with a workblock file`);let f=await Promise.all(o.map(async({file:x,key:_,binary:k})=>{let S=await t.getBlob(_);return{file:x,bytes:k?Buffer.from(S,"base64"):Buffer.from(S,"utf8")}}));for(let x of d)I.mkdirSync(x,{recursive:!0});let m=FC(s,i.previouslyRead,h,new Set(d.map(x=>R.resolve(x)))),g=new Map;for(let{file:x,bytes:_}of f)g.set(la(r,R.resolve(x)),_),!(i.sent?.get(R.resolve(x))?.equals(_)||I.existsSync(x)&&I.readFileSync(x).equals(_))&&(I.mkdirSync(R.dirname(x),{recursive:!0}),I.writeFileSync(x,_));let b=JSON.parse(JSON.stringify(l));delete b.updated_at,delete b.state,delete b.branch_user,delete b.storing,delete b.actor,delete b.library,delete b.logo,delete b.react_components,delete b.python,delete b.schema,delete b.design_docs,delete b.data_model,delete b.graphlake;let w=Buffer.from((0,pa.stringify)(b,{lineWidth:0}),"utf8");return g.set(la(r,R.resolve(n)),w),i.sent?.get(R.resolve(n))?.equals(w)||I.existsSync(n)&&I.readFileSync(n).equals(w)||I.writeFileSync(n,w),{written:[...h].map(x=>la(r,x)).sort(),contents:g,removed:m}}var ha=class{constructor(e){this.outputChannel=e}log(e){this.outputChannel.appendLine(e)}error(e){this.outputChannel.appendLine(`ERROR: ${e}`)}};var Ak=F(require("fs")),An=F(require("path"));var Ik=s=>`${An.posix.basename(s)} is generated from the change files and the query files and cannot change. Put the change in a change file or a query file`,Tk=s=>`${An.posix.basename(s)} is deployed and cannot change. Put the change in a new change file`;function Pd(s,e,t,i){let n=[];for(let{path:o}of i)o.startsWith(`${kt}/`)&&!Bo(o)&&!o.startsWith(`${Nn}/`)&&!ms(o)&&n.push({file:o,code:"unexpected_file",message:`data_model/ holds only model.yaml, types.ts, types.py, change files in changes/, query files in queries/ and the generated files in repositories/. Name a change file like ${zt}/0003_add_region.yaml`});let r=o=>e.has(o)&&Ak.existsSync(An.join(s,o));for(let o of[...e].filter(a=>ms(a)&&r(a)).sort())n.push({file:o,code:"model_file_edited",message:Ik(o)});for(let o of t??[]){let a=`${zt}/${o}`;r(a)&&n.push({file:a,code:"deployed_file_changed",message:Tk(o)})}return n.sort((o,a)=>o.file<a.file?-1:o.file>a.file?1:0)}function Ok(s,e,t){let i=[];for(let n of Object.keys(s?.generated??{}).sort()){let r=`${kt}/${n}`,o=s?.generated?.[n]?.text;ms(r)&&o!==void 0&&o!==e?.generated?.[n]?.text&&i.push({file:r,code:"model_file_edited",message:Ik(r)})}for(let n of t){let r=s?.changes?.[n]?.text;r!==void 0&&r!==e?.changes?.[n]?.text&&i.push({file:`${zt}/${n}`,code:"deployed_file_changed",message:Tk(n)})}return i}function qd(s){return s.path?`${s.file} [${s.code}] ${s.path}: ${s.message}`:`${s.file} [${s.code}] ${s.message}`}var zC=new Set(["waiting","wait_ui","wait_form","wait_form_repeating","wait_ack","wait_secret","suspended_retry_limit"]);var PP=new Set(["started","completed","failed","canceled",...zC]);var wx=require("node:url"),Ta=require("node:diagnostics_channel"),_i=require("node:path"),Nx=require("node:url"),ot=require("fs"),W6=F(require("node:fs"),1),Gt=require("node:fs/promises"),Da=require("node:events"),ap=F(require("node:stream"),1),Ex=require("node:string_decoder"),ax=(s,e,t)=>{let i=s instanceof RegExp?Pk(s,t):s,n=e instanceof RegExp?Pk(e,t):e,r=i!==null&&n!=null&&UC(i,n,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+i.length,r[1]),post:t.slice(r[1]+n.length)}},Pk=(s,e)=>{let t=e.match(s);return t?t[0]:null},UC=(s,e,t)=>{let i,n,r,o,a,c=t.indexOf(s),u=t.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(s===e)return[c,u];for(i=[],r=t.length;l>=0&&!a;){if(l===c)i.push(l),c=t.indexOf(s,l+1);else if(i.length===1){let d=i.pop();d!==void 0&&(a=[d,u])}else n=i.pop(),n!==void 0&&n<r&&(r=n,o=u),u=t.indexOf(e,l+1);l=c<u&&c>=0?c:u}i.length&&o!==void 0&&(a=[r,o])}return a},cx="\0SLASH"+Math.random()+"\0",ux="\0OPEN"+Math.random()+"\0",np="\0CLOSE"+Math.random()+"\0",lx="\0COMMA"+Math.random()+"\0",dx="\0PERIOD"+Math.random()+"\0",VC=new RegExp(cx,"g"),HC=new RegExp(ux,"g"),GC=new RegExp(np,"g"),KC=new RegExp(lx,"g"),JC=new RegExp(dx,"g"),YC=/\\\\/g,ZC=/\\{/g,QC=/\\}/g,XC=/\\,/g,e6=/\\\./g,t6=1e5,s6=4e6,i6=1e3,n6=1e3;function Md(s){return isNaN(s)?s.charCodeAt(0):parseInt(s,10)}function r6(s){return s.replace(YC,cx).replace(ZC,ux).replace(QC,np).replace(XC,lx).replace(e6,dx)}function o6(s){return s.replace(VC,"\\").replace(HC,"{").replace(GC,"}").replace(KC,",").replace(JC,".")}function Ld(s,e){for(let t=0;t<e.length;t++)s.push(e[t])}function a6(s){let e=[],t="";for(;;){let i=ax("{","}",s);if(!i){let c=s.split(",");return c[0]=t+c[0],Ld(e,c),e}let{pre:n,body:r,post:o}=i,a=n.split(",");if(a[0]=t+a[0],a[a.length-1]+="{"+r+"}",!o.length)return Ld(e,a),e;t=a.pop(),Ld(e,a),s=o}}function c6(s,e={}){if(!s)return[];let{max:t=t6,maxLength:i=s6,maxDepth:n=i6,maxRewrites:r=n6}=e;return s.slice(0,2)==="{}"&&(s="\\{\\}"+s.slice(2)),Zd(r6(s),t,i,n,0,r,!0).map(o6)}function u6(s){return"{"+s+"}"}function l6(s){return/^-?0\d/.test(s)}function d6(s,e){return s<=e}function p6(s,e){return s>=e}function In(s,e,t,i,n,r){let o=[],a=0;for(let c=0;c<s.length;c++)for(let u=0;u<t.length;u++){if(o.length>=i)return o;let l=s[c]+e+t[u];if(!(r&&!l)){if(a+l.length>n)return o;o.push(l),a+=l.length}}return o}function h6(s,e,t,i){let n=s.split(/\.\./),r=[];if(n[0]===void 0||n[1]===void 0)return r;let o=Md(n[0]),a=Md(n[1]),c=Math.max(n[0].length,n[1].length),u=n.length===3&&n[2]!==void 0?Math.max(Math.abs(Md(n[2])),1):1,l=d6;a<o&&(u*=-1,l=p6);let d=n.some(l6),p=0;for(let h=o;l(h,a)&&r.length<t;h+=u){let f;if(e)f=String.fromCharCode(h),f==="\\"&&(f="");else if(f=String(h),d){let m=c-f.length;if(m>0){let g=new Array(m+1).join("0");h<0?f="-"+g+f.slice(1):f=g+f}}if(p+f.length>i)break;r.push(f),p+=f.length}return r}function Zd(s,e,t,i,n,r,o){if(n>i)return[s];let a=[""],c=0,u=!1,l=!0;for(;;){let d=ax("{","}",s);if(!d)return In(a,s,[""],e,t,u);let p=d.pre;if(/\$$/.test(p)){if(a=In(a,p+"{"+d.body+"}",[""],e,t,u&&!d.post.length),l=!1,!d.post.length)break;s=d.post;continue}let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),m=h||f,g=d.body.indexOf(",")>=0;if(!m&&!g){if(c<r&&d.post.match(/,(?!,).*\}/)){c++,s=d.pre+"{"+d.body+np+d.post,o=!0;continue}return In(a,p+"{"+d.body+"}"+d.post,[""],e,t,u)}l&&(u=o&&!m,l=!1);let b;if(m)b=h6(d.body,f,e,t);else{let w=a6(d.body);if(w.length===1&&w[0]!==void 0&&(w=Zd(w[0],e,t,i,n+1,r,!1).map(u6),w.length===1)){if(a=In(a,p+w[0],[""],e,t,u&&!d.post.length),!d.post.length)break;s=d.post;continue}let y=u&&!d.post.length&&!p;for(let _=0;y&&_<a.length;_++)a[_]&&(y=!1);b=[];let x=0;e:for(let _=0;_<w.length;_++){let k=Zd(w[_],e,t,i,n+1,r,!1);for(let S=0;S<k.length;S++){let v=k[S];if(!(y&&!v)){if(b.length>=e||x+v.length>t)break e;b.push(v),x+=v.length}}}}if(a=In(a,p,b,e,t,u&&!d.post.length),!d.post.length)break;s=d.post}return a}var f6={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}"],"[:alpha:]":["\\p{L}\\p{Nl}"],"[:ascii:]":["\\x00-\\x7f"],"[:blank:]":["\\p{Zs}\\t"],"[:cntrl:]":["\\p{Cc}"],"[:digit:]":["\\p{Nd}"],"[:graph:]":["\\p{Z}\\p{C}",!0],"[:lower:]":["\\p{Ll}"],"[:print:]":["\\p{C}"],"[:punct:]":["\\p{P}"],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f"],"[:upper:]":["\\p{Lu}"],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],"[:xdigit:]":["A-Fa-f0-9"]},Tn=s=>s.replace(/[[\]\\-]/g,"\\$&"),Bd=/$./,m6=(s,e,t=!1,i)=>{let n=b=>{let w=i?b.normalize(i):b;return[...w].length===1?w:b},r=e;if(s.charAt(r)!=="[")throw new Error("not in a brace expression");let o=[],a=[],c=r+1,u=!1,l=!1,d=!1,p=r,h="";e:for(;c<s.length;){let b=String.fromCodePoint(s.codePointAt(c));if((b==="!"||b==="^")&&c===r+1){d=!0,c++;continue}if(b==="]"&&u&&!l){p=c+1;break}if(u=!0,b==="\\"&&!l){l=!0,c++;continue}if(b==="["&&!l){for(let[y,[x,_]]of Object.entries(f6))if(s.startsWith(y,c)){if(h)return[Bd,s.length-r];c+=y.length,_?a.push(x):o.push(x);continue e}}l=!1;let w=n(b);if(h){w.codePointAt(0)>h.codePointAt(0)?o.push(Tn(h)+"-"+Tn(w)):w===h&&o.push(Tn(w)),h="",c+=b.length;continue}if(s.startsWith("-]",c+b.length)){o.push(Tn(w+"-")),c+=b.length+1;continue}if(s.startsWith("-",c+b.length)){h=w,c+=b.length+1;continue}o.push(Tn(w)),c+=b.length}if(p<c)return[Bd,0];if(!o.length&&!a.length)return[Bd,s.length-r];let f="["+(d?"^":"")+o.join("")+"]",m="["+(d?"":"^")+a.join("")+"]",g="^"+(o.length&&a.length?"("+f+"|"+m+")":o.length?f:m);return[new RegExp(g,t?"iu":"u"),p-r]},Qd={t:"match",id:0},g6="!?+*@",Rs=s=>({t:"lit",ch:s}),b6=s=>s.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&"),Xd=s=>new RegExp(`^${b6(s)}$`,"iu"),rp=(s,e)=>{if(e===s.ch)return!0;if(!s.re)return!1;let t=e.charCodeAt(0);if(t>=128)return s.re.test(e);let i=s.ascii??=new Uint8Array(128);return i[t]||=s.re.test(e)?1:2,i[t]===1},k6=(s,e,t,i)=>{let n=[];for(let r=0;r<s.length;){let o=String.fromCodePoint(s.codePointAt(r));if(o==="\\"){let a=s.codePointAt(r+1),c=a===void 0?o:String.fromCodePoint(a);n.push(Rs(c)),r+=1+c.length;continue}if(o==="["){let[a,c]=m6(s,r,e,i);if(c){n.push({t:"class",re:a}),r+=c;continue}}if(!t&&g6.includes(o)&&s[r+1]==="("){n.push({t:"open",type:o}),r+=2;continue}n.push(!t&&o==="|"?{t:"bar"}:!t&&o===")"?{t:"close"}:o==="*"?{t:"star"}:o==="?"?{t:"any"}:Rs(o)),r+=o.length}return n},x6=s=>{let e=new Map,t=[];return s.forEach((i,n)=>{i.t==="open"?t.push(n):i.t==="close"&&t.length&&e.set(t.pop(),n)}),e},px=(s,e,t,i,n)=>{let r=[],o=[r];for(let a=t;a<i;a++){let c=s[a],u=e.get(a);if(c.t==="open"&&u!==void 0){let l=px(s,e,a+1,u,!1);r.push({t:"ext",type:c.type,alts:l}),a=u}else c.t==="bar"&&!n?o.push(r=[]):c.t==="open"?r.push(Rs(c.type),Rs("(")):c.t==="bar"?r.push(Rs("|")):c.t==="close"?r.push(Rs(")")):r.push(c)}return o},hx=(s,e)=>{let t=[],i="",n=()=>{for(let r of i.normalize(e))t.push(Rs(r));i=""};for(let r of s){if(r.t==="lit"){i+=r.ch;continue}n(),t.push(r.t==="ext"?{...r,alts:r.alts.map(o=>hx(o,e))}:r)}return n(),t},_6=(s,e)=>{let t=1,i=o=>({t:"split",id:t++,out:o}),n=(o,a)=>o.reduceRight((c,u)=>r(u,c),a),r=(o,a)=>{switch(o.t){case"lit":let d=e?Xd(o.ch):void 0;return{t:"lit",id:t++,ch:o.ch,re:d,next:a};case"any":case"star":return{t:o.t,id:t++,next:a};case"class":return{t:"class",id:t++,re:o.re,next:a}}let c=d=>o.alts.map(p=>n(p,d));switch(o.type){case"@":return i(c(a));case"?":return i([a,...c(a)]);case"!":return{t:"neg",id:t++,sub:i(c(Qd)),next:a}}let u=i([]),l=i(c(u));return u.out.push(a,l),o.type==="*"?u:l};return[n(s,Qd),t]},w6=s=>{let e=[],t=new Set,i=r=>r.t==="match"?"match":String(r.id),n=(r,o)=>{if(r.t==="match"||t.has(r))return;t.add(r);let a=c=>e.push(`${o}${r.id}: ${c}`);switch(r.t){case"split":a(`split -> ${r.out.map(i).join(", ")}`);for(let c of r.out)n(c,o);return;case"neg":return a(`!(${i(r.sub)}) -> ${i(r.next)}`),n(r.sub,o+" "),n(r.next,o);case"lit":a(`${JSON.stringify(r.ch)} -> ${i(r.next)}`);break;case"class":a(`${r.re} -> ${i(r.next)}`);break;default:a(`${r.t==="any"?"?":"*"} -> ${i(r.next)}`)}n(r.next,o)};return n(s,""),[`start -> ${i(s)}`,...e].join(`
|
|
175
|
-
`)},y6=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(s){this.gen=s}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},fx=(s,e)=>s.ids.length!==e.ids.length||s.runs.length!==e.runs.length||s.ids.some((t,i)=>t!==e.ids[i])?!1:s.runs.every(t=>e.runs.some(i=>i.neg===t.neg&&fx(i.state,t.state))),qk=s=>({has:new Float64Array(s),seen:new Float64Array(s),gen:0}),ep=class{dots;dotStart;#e;constructor(s,e,t){this.dots=s,this.dotStart=e,this.#e=t}state(){return new y6(++this.#e.gen)}done(s){return s.ids=s.threads.map(e=>e.id).sort((e,t)=>e-t),s.match&&s.ids.unshift(Qd.id),s}#i(s,e){let{seen:t}=this.#e;return t[e.id]===s.gen?!1:(t[e.id]=s.gen,!0)}#t(s,e){let{has:t}=this.#e;return t[e.id]===s.gen?!1:(t[e.id]=s.gen,s.threads.push(e),!0)}restricted(s,e){return e&&(this.dots||this.dotStart&&s===0)}add(s,e,t,i){switch(e.t){case"split":if(!this.#i(s,e))return;for(let r of e.out)this.add(s,r,t,i);return;case"neg":if(!this.#i(s,e))return;let n=this.state();return this.add(n,e.sub,t,!1),this.done(n),this.addRun(s,{t:"run",neg:e,state:n},t,i);case"star":if(this.restricted(t,i))return;this.#t(s,e)&&this.add(s,e.next,t,i);return;case"match":s.match=!0;return;default:this.#t(s,e)}}addRun(s,e,t,i){for(let n of s.runs)if(n.neg===e.neg&&fx(n.state,e.state))return;s.runs.push(e),e.state.match||this.add(s,e.neg.next,t,i)}step(s,e,t,i){let n=this.state();for(let r of s.threads)switch(r.t){case"lit":rp(r,e)&&this.add(n,r.next,t+1,i);break;case"any":this.restricted(t,i)||this.add(n,r.next,t+1,i);break;case"class":!this.restricted(t,i)&&r.re.test(e)&&this.add(n,r.next,t+1,i);break;case"star":this.restricted(t,i)||this.add(n,r,t+1,i)}if(!this.restricted(t,i))for(let r of s.runs){if(r.state.dead){this.addRun(n,r,t+1,i);continue}let o=this.step(r.state,e,t,!1);this.addRun(n,{t:"run",neg:r.neg,state:o},t+1,i)}return this.done(n)}},mx=s=>{let e=s.ids.join();if(!s.runs.length)return e;let t=s.runs.map(i=>`${i.neg.id}(${mx(i.state)})`);return`${e}|${t.sort().join("|")}`},v6=1<<18,S6=class{#e;#i=new Map;#t=0;#o;#r;#h;#l;constructor(s,e){this.#e=s,this.#h=new ep(!1,!1,e),this.#l=new ep(!1,!0,e)}#f(s){return{state:s,match:s.match,dead:s.dead,next:new Map}}#a(s){let e=mx(s),t=this.#i.get(e);if(t)return t;this.#t>v6&&this.#m();let i=this.#f(s);return this.#i.set(e,i),this.#t+=e.length+1,i}#m(){this.#i.clear(),this.#t=0,this.#o=void 0,this.#r=void 0}start(s){if(s){if(this.#r)return this.#r;let t=this.#l.state();return this.#l.add(t,this.#e,0,!0),this.#r=this.#f(this.#l.done(t))}if(this.#o)return this.#o;let e=this.#h.state();return this.#h.add(e,this.#e,0,!0),this.#o=this.#a(this.#h.done(e))}next(s,e){let t=e.charCodeAt(0),i=t<128?void 0:s.next.get(e);if(i)return i;let n=s===this.#r?this.#a(this.#l.step(s.state,e,0,!0)):this.#a(this.#h.step(s.state,e,1,!0));return t<128?(s.ascii||(s.ascii=new Array(128),this.#t+=128),s.ascii[t]=n):s.next.set(e,n),this.#t++,n}},N6=s=>{let e=[];for(let t=s;t.t!=="match";t=t.next){if(t.t==="split"||t.t==="neg")return;e.push(t)}return e},E6=(s,e,t,i)=>{let n=0,r=t,o=-1,a=0;for(;r<i;){let c=s[n];if(c?.t==="star"){o=n++,a=r;continue}let u=e[r];if(c&&(c.t==="any"||c.t==="lit"&&rp(c,u)||c.t==="class"&&c.re.test(u))){n++,r++;continue}if(o===-1)return!1;n=o+1,r=++a}for(;s[n]?.t==="star";)n++;return n===s.length},gx=s=>{let e=0,t=0;for(let i of s){let[n,r]=C6(i);e+=n,t+=r}return[e,t]},C6=s=>{if(s.t==="star")return[0,1/0];if(s.t!=="ext")return[1,1];if(s.type==="!")return[0,1/0];let e=s.alts.map(gx),t=Math.min(...e.map(r=>r[0])),i=Math.max(...e.map(r=>r[1])),n=i===0?0:1/0;return s.type==="@"?[t,i]:s.type==="?"?[0,i]:s.type==="*"?[0,n]:[t,n]},Fk=(s,e,t)=>{for(let i=0;i<s.length;i++)if(!rp(s[i],e[t+i]))return!1;return!0},R6=/[/\ud800-\udfff]/,A6=/[\ud800-\udfff]/,fa=s=>A6.test(s)?[...s]:s,Mk=s=>{if(s.includes("/"))throw new Error("can only match a single path portion, got: "+s)},Lk=class{pattern;options;#e;#i;#t;#o;#r;#h;#l;#f=!1;#a=0;#m=1/0;#c=[];#u=[];#n;#b;#y=!1;#k;#d;constructor(s,e={}){if(s.includes("/"))throw new Error("can only match a single path portion, got pattern: "+s);this.pattern=s,this.options=e;let{nocase:t=!1,noext:i=!1,normalize:n}=e;this.#d=n===!0?"NFC":n||void 0;let r=/^[?*+@]\(\)$/.test(s),o=k6(s,t,i||r,this.#d),[a]=px(o,x6(o),0,o.length,!0);this.#d&&(a=hx(a,this.#d));let[c,u]=_6(a,t);if(this.#e=c,this.#i=u,a.every(l=>l.t==="lit"))this.#r=a.map(l=>l.ch).join(""),t&&(this.#h=Xd(this.#r));else{let l=h=>h.t!=="lit"?void 0:t?{ch:h.ch,re:Xd(h.ch)}:{ch:h.ch};for(let h of a){let f=l(h);if(!f)break;this.#c.push(f)}for(let h=a.length-1;h>=0;h--){let f=l(a[h]);if(!f)break;this.#u.unshift(f)}this.#y=!!(this.#c.length||this.#u.length),t||(this.#n=this.#c.map(h=>h.ch).join(""),this.#b=this.#u.map(h=>h.ch).join("")),this.#l=N6(this.#e)?.slice(this.#c.length,-this.#u.length||void 0),this.#f=!!this.#l?.every(h=>h.t==="star"||h.t==="any");let[d,p]=gx(a);this.#a=d,this.#m=p}}test(s){return this.#d?(Mk(s),this.#w(s.normalize(this.#d))):R6.test(s)?(Mk(s),this.#w(s,[...s])):this.#w(s,s)}testUnchecked(s){return this.#w(this.#d?s.normalize(this.#d):s)}#w(s,e){if(this.#r!==void 0)return this.#h?this.#h.test(s):s===this.#r;let t=this.#a,i=this.#m;if(e===void 0){let u=s.length,l=u+1>>1;if(u<t||l>i)return!1;(l<t||u>i)&&(e=fa(s))}if(e!==void 0&&(e.length<t||e.length>i))return!1;let n=this.#c.length;if(this.#y)if(this.#n!==void 0&&this.#b!==void 0){if(!s.startsWith(this.#n)||!s.endsWith(this.#b))return!1}else{e??=fa(s);let u=e.length-this.#u.length;if(!Fk(this.#c,e,0)||!Fk(this.#u,e,u))return!1}let r=!this.options.dot&&s.startsWith(".");if(this.#l){if(s==="."||s===".."||r&&!n)return!1;if(this.#f)return!0;e??=fa(s);let u=e.length-this.#u.length;return E6(this.#l,e,n,u)}if(e??=fa(s),s==="."||s===".."){this.#t??=qk(this.#i);let u=this.#o??=new ep(!0,!1,this.#t),l=u.state();u.add(l,this.#e,0,!0);let d=u.done(l);for(let p=0;p<e.length;p++)d=u.step(d,e[p],p,!0);return d.match}this.#t??=qk(this.#i);let o=this.#k??=new S6(this.#e,this.#t),a=o.start(r),c=e===s;for(let u=0;u<e.length;u++){if(a.dead)return!1;let l=c?s.charCodeAt(u):e[u].charCodeAt(0);a=a.ascii?.[l]??o.next(a,e[u])}return a.match}toString(){return w6(this.#e)}},Ra=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")},op=(s,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?s.replace(/[?*()[\]{}]/g,"[$&]"):s.replace(/[?*()[\]\\{}]/g,"\\$&"):e?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),bx=(s,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?s.replace(/\[([^/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?s.replace(/\[([^/\\{}])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),Ne=(s,e,t={})=>(Ra(e),!t.nocomment&&e.charAt(0)==="#"?!1:new As(e,t).match(s)),kx=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Bk={win32:{sep:"\\"},posix:{sep:"/"}},I6=kx==="win32"?Bk.win32.sep:Bk.posix.sep;Ne.sep=I6;var U=Symbol("globstar **");Ne.GLOBSTAR=U;var T6=(s,e={})=>t=>Ne(t,s,e);Ne.filter=T6;var xt=(s,e={})=>Object.assign({},s,e),O6=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return Ne;let e=Ne;return Object.assign((t,i,n={})=>e(t,i,xt(s,n)),{Minimatch:class extends e.Minimatch{constructor(t,i={}){super(t,xt(s,i))}static defaults(t){return e.defaults(xt(s,t)).Minimatch}},unescape:(t,i={})=>e.unescape(t,xt(s,i)),escape:(t,i={})=>e.escape(t,xt(s,i)),filter:(t,i={})=>e.filter(t,xt(s,i)),defaults:t=>e.defaults(xt(s,t)),braceExpand:(t,i={})=>e.braceExpand(t,xt(s,i)),match:(t,i,n={})=>e.match(t,i,xt(s,n)),sep:e.sep,GLOBSTAR:U})};Ne.defaults=O6;var xx=(s,e={})=>(Ra(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:c6(s,{max:e.braceExpandMax}));Ne.braceExpand=xx;var D6=(s,e,t={})=>{let i=new As(e,t);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(e),s};Ne.match=D6;var Wk=/[?*]|[+@!]\(.*?\)|\[|\]/,_x=(s,e)=>{let t=e+1;(s.charAt(t)==="!"||s.charAt(t)==="^")&&t++;let i=!1;for(;t<s.length;t++){let n=s.charAt(t);if(n==="]"&&i)return t;i=!0,n==="\\"&&t++}return-1},P6=(s,e)=>{if(!e&&(s==="+()"||s==="@()"))return s;let t="";for(let i=0;i<s.length;i++){let n=s.charAt(i);if(n==="\\")t+=s.charAt(++i)||n;else{if(n==="*"||n==="?")return;if(n==="["){let r=_x(s,i);if(r===-1){t+=n;continue}let o=s.slice(i+1,r);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(s.charAt(i+1)))return;t+=o,i=r}else{if(!e&&"+@!".includes(n)&&s.charAt(i+1)==="("&&s.includes(")",i+2))return;t+=n}}}return t},q6=s=>{if(/^[?*+@]\(\)$/.test(s)||s.includes("[:"))return!1;let e=0;for(let t=0;t<s.length;t++){let i=s.charAt(t);if(i==="\\"){if(++t===s.length)return!1}else if(i==="["){let n=_x(s,t);n!==-1&&(t=n)}else if("+@!?*".includes(i)&&s.charAt(t+1)==="(")e++,t++;else if(i===")"){if(!e--)return!1}else if(i==="|"&&!e)return!1}return!e},Wd,$k,Ht=(s,e)=>typeof s=="string"?e===s:e!==""&&s.testUnchecked(e),jk=(s,e,t,i,n)=>Ht(s,e)?t:i!==void 0&&Ht(s,i)?n:-1,tp=s=>s==="."||s==="..",$d=s=>typeof s=="string"&&/^[a-z]:$/i.test(s),Na=s=>typeof s=="string"&&/^unc$/i.test(s),jd=s=>{if(s[0]!==""||s[1]!=="")return-1;let e=s[2]!=="?"?2:Na(s[3])?4:-1,t=s[e],i=s[e+1];return e!==-1&&t!==void 0&&t!==""&&t!==U&&i!==void 0&&i!==""&&i!==U?e:-1},ma=(s,e)=>!tp(s)&&(e||!s.startsWith(".")),On=(s,e,t,i,n)=>{for(let r=e;r<t;){if(s.charCodeAt(r)===46){if(!i)return!0;let a=s.charCodeAt(r+1)===46?r+2:r+1;if(a>=t||Aa(s.charCodeAt(a),n))return!0}let o=sp(s,r,n);if(o===-1)return!1;for(r=o+1;r<t&&Aa(s.charCodeAt(r),n);)r++}return!1},Aa=(s,e)=>e==="/"?s===47:e==="\\"?s===92:s===47||s===92,sp=(s,e,t)=>{if(t!=="both")return s.indexOf(t,e);let i=s.indexOf("/",e),n=s.indexOf("\\",e);return i===-1?n:n===-1?i:Math.min(i,n)},zk=(s,e,t)=>t!=="both"?s.lastIndexOf(t,e):Math.max(s.lastIndexOf("/",e),s.lastIndexOf("\\",e)),As=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#e;#i;#t;#o;#r=[];#h=[];#l=[];#f=new Map;#a=new WeakMap;constructor(s,e={}){Ra(s),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=s,this.platform=e.platform||kx,this.isWindows=this.platform==="win32";let t="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[t]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,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.#e=!this.preserveMultipleSlashes,this.#t=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#o=i===!0?"NFC":i||void 0,this.make();let n=this.set.map(r=>this.#c(r));this.#l=this.set.map((r,o)=>this.#e&&r.length-1>n[o]),this.#r=this.set.map((r,o)=>{let a=this.#l[o]?r.length-1:r.length,c=r.slice(n[o]+1,a).filter(u=>typeof u=="string"&&!!u);return[...new Set(c)]}),this.#i=this.#r.some(r=>r.length),this.#h=this.set.map((r,o)=>{let[a,c,u]=r;if(this.#l[o]&&r.length===2&&a===U&&c!==U)return"tail";if(this.#l[o]&&e.matchBase&&r.length===1&&a!==U&&a!=="")return"base";if(!(!this.#e||n[o]!==-1)){if(r.length===3&&a===U&&u===U&&c!==U&&c!==""&&this.maxGlobstarRecursion>0)return"mid";if(r.length===2&&c===U&&a!==U&&a!=="")return"head"}})}#m(s){return this.#o?s.normalize(this.#o):s}#c(s){if(!this.isWindows)return-1;if($d(s[0]))return 0;if(s[0]===""&&s[1]===""&&s[2]==="?"&&$d(s[3]))return 3;let e=jd(s);return e===-1?-1:e+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let s of this.set)for(let e of s)if(typeof e!="string")return!0;return!1}make(){let s=this.pattern,e=this.options;if(!e.nocomment&&s.charAt(0)==="#"){this.comment=!0;return}if(!s){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())];let t=this.globSet.map(n=>this.#_(n));this.globParts=this.preprocess(t);let i=this.globParts.map((n,r,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[2]==="?"&&Na(n[3])?6:4,c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Wk.test(n[2]))&&n.slice(3,a).every(l=>!Wk.test(l)),u=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,a).map(l=>this.#m(l)),...n.slice(a).map(l=>this.parse(l))];if(u)return[this.#m(n[0]),...n.slice(1).map(l=>this.parse(l))]}return n.map(a=>this.parse(a))});if(this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let r=this.set[n];r[0]===""&&r[1]===""&&this.globParts[n][2]==="?"&&($d(r[3])||Na(this.globParts[n][3]))&&(Na(this.globParts[n][3])&&(r[3]="UNC"),r[2]="?")}e.noext||this.mergeRows()}mergeRows(){let s=!0;for(;s;){s=!1;let e=Math.max(0,...this.set.map(t=>t.length));for(let t=0;t<e;t++){let i=new Map;this.set.forEach((r,o)=>{if(!(r[t]instanceof Lk)||!q6(this.globParts[o][t]))return;let a=[...this.globParts[o]];a[t]="";let c=`${r.length}/${a.join("/")}`,u=i.get(c);u?u.push(o):i.set(c,[o])});let n=new Set;for(let r of i.values()){if(r.length<2)continue;let[o,...a]=r,c=`@(${r.map(u=>this.globParts[u][t]).join("|")})`;this.globParts[o][t]=c,this.set[o][t]=this.parse(c);for(let u of a)n.add(u)}n.size&&(s=!0,this.set=this.set.filter((r,o)=>!n.has(o)),this.globParts=this.globParts.filter((r,o)=>!n.has(o)))}}}preprocess(s){if(this.options.noglobstar)for(let t of s)for(let i=0;i<t.length;i++)t[i]==="**"&&(t[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(s=this.firstPhasePreProcess(s),s=this.secondPhasePreProcess(s)):e>=1?s=this.levelOneOptimize(s):s=this.adjascentGlobstarOptimize(s),s}adjascentGlobstarOptimize(s){return s.map(e=>{let t=-1;for(;(t=e.indexOf("**",t+1))!==-1;){let i=t;for(;e[i+1]==="**";)i++;i!==t&&e.splice(t,i-t)}return e})}levelOneOptimize(s){return s.map(e=>{let t=this.#c(e)+1;return e=e.reduce((i,n)=>{let r=i[i.length-1];return n==="**"&&r==="**"?i:n===".."&&i.length>t&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e})}#u(s){let e=!this.isWindows||!s.includes("\\")?"/":s.includes("/")?"both":"\\",t=this.#e?0:-1,i="",n=0,r,o=0,a=!!this.options.dot;e:for(let c=0;c<this.set.length;c++){let u=this.set[c],l=u[u.length-1],d=t!==-1&&this.#l[c]&&l!==U;if(d&&t===0){let f=zk(s,s.length,e);if(n=f+1,i=s.slice(n),i===""&&f>=0){let g=f;for(;g>0&&Aa(s.charCodeAt(g-1),e);)g--;o=g===0?0:zk(s,g-1,e)+1,r=s.slice(o,g)}let m=this.#t&&(tp(i)||i===""&&r!==void 0&&tp(r));t=m?-1:1,d=!m}let p=-1;if(d&&typeof l=="string"&&(p=jk(l,i,n,r,o),p===-1))continue;if(this.#i){for(let f of this.#r[c])if(!s.includes(f))continue e}if(d&&typeof l=="object"&&(p=jk(l,i,n,r,o),p===-1))continue;let h=this.#h[c];if(h==="base"&&d)return"yes";if(h==="tail"&&d){if(this.#t&&On(s,0,p,!0,e))return"maybe";if(!On(s,0,p,a,e))return"yes";continue}if(h==="mid"||h==="head"){let f=this.#b(s,u,h==="head",a,e);if(f!=="no")return f;continue}return"maybe"}return"no"}#n(s,e,t){let i=!!this.options.dot,n=s.length;if(t==="head"){if(n<2||!Ht(e[0],s[0]))return!1;for(let o=1;o<n;o++)if(!ma(s[o],i))return!1;return!0}let r=e[1];if(t==="tail"){let o=n-1;if(!Ht(r,s[o])&&(s[o]!==""||n===1||!Ht(r,s[--o])))return!1;for(let a=0;a<o;a++)if(!ma(s[a],i))return!1;return!0}for(let o=0;o<n;o++){if(Ht(r,s[o])&&o+1<n){let a=o+1;for(;a<n&&ma(s[a],i);)a++;if(a===n)return!0}if(!ma(s[o],i))return!1}return!1}#b(s,e,t,i,n){if(this.#t&&On(s,0,s.length,!0,n))return"maybe";let r=e[t?0:1],o=0;for(let a=sp(s,o,n);a!==-1;a=sp(s,o,n)){let c=a+1;for(;c<s.length&&Aa(s.charCodeAt(c),n);)c++;if((typeof r=="string"?a-o===r.length&&s.startsWith(r,o):a>o&&r.testUnchecked(s.slice(o,a)))&&!On(s,c,s.length,i,n))return"yes";if(t||On(s,o,c,i,n))return"no";o=c}return"no"}#y(s){let e=Wd;return e?.f===s&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#k(s){let{isWindows:e,preserveMultipleSlashes:t}=this,i=this.#_(e?s.split("\\").join("/"):s),n=this.#o;return n&&(i=i.map(r=>r.normalize(n))),Wd={f:s,isWindows:e,preserveMultipleSlashes:t,normalize:n,parts:i},Wd}#d(s){let e=[...s],t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let o=e[r];r===1&&o===""&&e[0]===""||(o==="."||o==="")&&(t=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=this.#c(e)+1,n=i;for(;(n=e.indexOf("..",n+1))!==-1;){let r=e[n-1];r&&r!=="."&&r!==".."&&r!=="**"&&(t=!0,e.splice(n-1,2),n=Math.max(n-2,i))}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(s){let e=!1;do{e=!1;for(let t of s){let i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let o=i;for(;t[o+1]==="**";)o++;o>i&&t.splice(i+1,o-i);let a=t[i+1],c=t[i+2],u=t[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;e=!0,t.splice(i,1);let l=t.slice(0);l[i]="**",s.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){let a=t[o];o===1&&a===""&&t[0]===""||(a==="."||a==="")&&(e=!0,t.splice(o,1),o--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let n=this.#c(t)+1,r=n;for(;(r=t.indexOf("..",r+1))!==-1;){let o=t[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let a=r===1&&t[r+1]==="**"?["."]:[];t.splice(r-1,2,...a),t.length===0&&t.push(""),r=Math.max(r-2,n)}}}}while(e);return s}secondPhasePreProcess(s){for(let e=0;e<s.length-1;e++)for(let t=e+1;t<s.length;t++){let i=this.partsMatch(s[e],s[t],!this.preserveMultipleSlashes);if(i){s[e]=[],s[t]=i;break}}return s.filter(e=>e.length)}partsMatch(s,e,t=!1){let i=0,n=0,r=[],o="";for(;i<s.length&&n<e.length;)if(s[i]===e[n])r.push(o==="b"?e[n]:s[i]),i++,n++;else if(t&&s[i]==="**"&&e[n]===s[i+1])r.push(s[i]),i++;else if(t&&e[n]==="**"&&s[i]===e[n+1])r.push(e[n]),n++;else if(s[i]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(o==="b")return!1;o="a",r.push(s[i]),i++,n++}else if(e[n]==="*"&&s[i]&&(this.options.dot||!s[i].startsWith("."))&&s[i]!=="**"){if(o==="a")return!1;o="b",r.push(e[n]),i++,n++}else return!1;return s.length===e.length&&r}parseNegate(){if(this.nonegate)return;let s=this.pattern,e=!1,t=0;for(let i=0;i<s.length&&s.charAt(i)==="!";i++)e=!e,t++;t&&(this.pattern=s.slice(t)),this.negate=e}#w(s,e,t,i){let n=0,r=0,o=this.isWindows?jd(e):-1,a=o===-1?-1:jd(t);if(a!==-1){let c=t[a],u=t[a+1];typeof c!="string"||typeof u!="string"?(n=o,r=a):e[o].toLowerCase()===c.toLowerCase()&&e[o+1].toLowerCase()===u.toLowerCase()&&(n=o+2,r=a+2)}else if(this.isWindows){let c=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),u=!c&&s[0]===""&&s[1]===""&&s[2]==="?"&&/^[a-z]:$/i.test(s[3]),l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),d=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),p=u?3:c?0:void 0,h=d?3:l?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,m]=[s[p],t[h]];f.toLowerCase()===m.toLowerCase()&&(r=h+1,n=p+1)}}return s=e,t.includes(U)?this.#x(s,t,i,n,r):this.#g(s,t,i,n,r)}#x(s,e,t,i,n){let{head:r,body:o,tail:a,segments:c}=this.#v(e,t,n);if(r.length){let l=i+r.length;if(!this.#g(s,r,t,i,0,l))return!1;i+=r.length,n+=r.length}let u=0;if(a.length){if(a.length+i>s.length)return!1;let l=s.length-a.length;if(this.#g(s,a,t,l,0))u=a.length;else{if(s[s.length-1]!==""||i+a.length===s.length||(l--,!this.#g(s,a,t,l,0)))return!1;u=a.length+1}}if(!o.length){let l=!!u;for(let d=i;d<s.length-u;d++){let p=String(s[d]);if(l=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return t||l}return!!this.#S(s,c,s.length-u,i,0,t,0,!!u,new Set)}#v(s,e,t){let i=this.#a.get(s);i||(i=[],this.#a.set(s,i));let n=t*2+(e?1:0),r=i[n];if(r)return r;let o=s.indexOf(U,t),a=s.lastIndexOf(U),c=s.slice(t,o),u=s.slice(o+1,e?void 0:a),l=e?[]:s.slice(a+1),d=[[[],0]],p=d[0],h=0,f=[0];for(let g of u)g===U?(f.push(h),p=[[],0],d.push(p)):(p[0].push(g),h++);d.forEach((g,b)=>{g[1]=h-f[b]});let m={head:c,body:u,tail:l,segments:d};return i[n]=m,m}#S(s,e,t,i,n,r,o,a,c){let u=e[n];if(!u){if(r)return i>=t||i===t-1&&s[i]==="";for(let h=i;h<t;h++){a=!0;let f=s[h];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return a}let[l,d]=u,p=r?t:t-d;for(;i<=p;){let h=n*(s.length+1)+i;if(c.has(h))return!1;if(c.add(h),this.#g(s,l,r,i,0,i+l.length)&&o<this.maxGlobstarRecursion){let m=this.#S(s,e,t,i+l.length,n+1,r,o+1,a,c);if(m!==!1)return m}if(i===p)break;let f=s[i];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1;i++}return r||null}#g(s,e,t,i,n,r=s.length){let o,a,c,u;for(o=i,a=n,u=Math.min(r,s.length),c=e.length;o<u&&a<c;o++,a++){let l=e[a],d=s[o];if(l===!1||l===U||!Ht(l,d))return!1}if(o===u&&a===c)return!0;if(o===u)return t;if(a===c)return o===u-1&&s[o]==="";throw new Error("wtf?")}braceExpand(){return xx(this.pattern,this.options)}parse(s){Ra(s);let e=this.options;if(s==="**")return U;if(s==="")return"";let{nocase:t,nocaseMagicOnly:i,noext:n=!1,dot:r,normalize:o}=e,a=P6(s,n);if(a!==void 0&&!(t&&!i&&s.toUpperCase()!==s.toLowerCase()))return this.#m(a);let c=this.#f.get(s);return c||(c=new Lk(s,{nocase:t,noext:n,dot:r,normalize:o}),this.#f.set(s,c)),c}#_(s){return this.preserveMultipleSlashes?s.split("/"):this.isWindows&&/^\/\/[^/]+/.test(s)?["",...s.split(/\/+/)]:s.split(/\/+/)}match(s,e=this.partial){if(this.comment)return!1;if(this.empty)return s==="";if(s==="/"&&e)return!0;let t=this.options,i=this.#y(s);if(!i){if(!e&&!this.#o&&(this.#e||this.#i)&&$k!==s){$k=s;let c=this.#u(s);if(c==="no")return t.flipNegate?!1:this.negate;if(c==="yes")return t.flipNegate?!0:!this.negate}i=this.#k(s)}let n=i.parts,r=this.#t?i.resolved??=this.#d(n):n,o=this.set,a=n[n.length-1];if(!a)for(let c=n.length-2;!a&&c>=0;c--)a=n[c];for(let c=0;c<o.length;c++){let u=o[c],l=e?void 0:this.#h[c];if(l==="base"?Ht(u[0],a):l?this.#n(r,u,l):t.matchBase&&u.length===1?this.#w([a],[a],u,e):this.#w(n,r,u,e))return t.flipNegate?!0:!this.negate}return t.flipNegate?!1:this.negate}static defaults(s){return Ne.defaults(s).Minimatch}};Ne.Minimatch=As;Ne.escape=op;Ne.unescape=bx;var ae=(0,Ta.channel)("lru-cache:metrics"),Ln=(0,Ta.tracingChannel)("lru-cache"),F6=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,zd=()=>ae.hasSubscribers||Ln.hasSubscribers,yx=new Set,Uk=typeof process=="object"&&process?process:{},M6=(s,e,t,i)=>{typeof Uk.emitWarning=="function"?Uk.emitWarning(s,e,t,i):console.error(`[${t}] ${e}: ${s}`)},L6=s=>!yx.has(s),Vt=s=>!!s&&s===Math.floor(s)&&s>0&&isFinite(s),vx=s=>Vt(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?Ea:null:null,Ea=class extends Array{constructor(s){super(s),this.fill(0)}},B6=class Bn{heap;length;static#e=!1;static create(e){let t=vx(e);if(!t)return[];Bn.#e=!0;let i=new Bn(e,t);return Bn.#e=!1,i}constructor(e,t){if(!Bn.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Oa=class Sx{#e;#i;#t;#o;#r;#h;#l;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#a;#m;#c;#u;#n;#b;#y;#k;#d;#w;#x;#v;#S;#g;#_;#N;#R;#s;#T;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#g,autopurgeTimers:e.#_,sizes:e.#v,keyMap:e.#c,keyList:e.#u,valList:e.#n,next:e.#b,prev:e.#y,get head(){return e.#k},get tail(){return e.#d},free:e.#w,isBackgroundFetch:t=>e.#p(t),backgroundFetch:(t,i,n,r)=>e.#M(t,i,n,r),moveToTail:t=>e.#K(t),indexes:t=>e.#A(t),rindexes:t=>e.#I(t),isStale:t=>e.#E(t)}}get max(){return this.#e}get maxSize(){return this.#i}get calculatedSize(){return this.#m}get size(){return this.#a}get fetchMethod(){return this.#h}get memoMethod(){return this.#l}get dispose(){return this.#t}get onInsert(){return this.#o}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:u,onInsert:l,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:f=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:b,memoMethod:w,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:k,ignoreFetchAbort:S,backgroundFetchSize:v=1,perf:C}=e;if(this.backgroundFetchSize=v,C!==void 0&&typeof C?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=C??F6,t!==0&&!Vt(t))throw new TypeError("max option must be a nonnegative integer");let A=t?vx(t):Array;if(!A)throw new Error("invalid max value: "+t);if(this.#e=t,this.#i=f,this.maxEntrySize=m||this.#i,this.sizeCalculation=g,this.sizeCalculation){if(!this.#i&&!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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=w,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=b,this.#R=!!b,this.#c=new Map,this.#u=Array.from({length:t}).fill(void 0),this.#n=Array.from({length:t}).fill(void 0),this.#b=new A(t),this.#y=new A(t),this.#k=0,this.#d=0,this.#w=B6.create(t),this.#a=0,this.#m=0,typeof u=="function"&&(this.#t=u),typeof l=="function"&&(this.#o=l),typeof d=="function"?(this.#r=d,this.#x=[]):(this.#r=void 0,this.#x=void 0),this.#N=!!this.#t,this.#T=!!this.#o,this.#s=!!this.#r,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.#i!==0&&!Vt(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!Vt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Vt(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!Vt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#e===0&&this.ttl===0&&this.#i===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#i){let T="LRU_CACHE_UNBOUNDED";L6(T)&&(yx.add(T),M6("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",T,Sx))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#O(){let e=new Ea(this.#e),t=new Ea(this.#e);this.#g=e,this.#S=t;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#_=i,this.#B=(c,u,l=this.#f.now())=>{t[c]=u!==0?l:0,e[c]=u,n(c,u)},this.#C=c=>{t[c]=e[c]!==0?this.#f.now():0,n(c,e[c])};let n=this.ttlAutopurge?(c,u)=>{if(i?.[c]&&(clearTimeout(i[c]),i[c]=void 0),u&&u!==0&&i){let l=setTimeout(()=>{this.#E(c)?(this.#L(this.#u[c],"expire"),i[c]=void 0):n(c,a(c))},u+1);l.unref&&l.unref(),i[c]=l}}:()=>{};this.#D=(c,u)=>{if(e[u]){let l=e[u],d=t[u];if(!l||!d)return;c.ttl=l,c.start=d,c.now=r||o();let p=c.now-d;c.remainingTTL=l-p}};let r=0,o=()=>{let c=this.#f.now();if(this.ttlResolution>0){r=c;let u=setTimeout(()=>r=0,this.ttlResolution);u.unref&&u.unref()}return c};this.getRemainingTTL=c=>{let u=this.#c.get(c);return u===void 0?0:a(u)};let a=c=>{let u=e[c],l=t[c];if(!u||!l)return 1/0;let d=(r||o())-l;return u-d};this.#E=c=>{let u=t[c],l=e[c];return!!l&&!!u&&(r||o())-u>l}}#C=()=>{};#D=()=>{};#B=()=>{};#E=()=>!1;#U(){let e=new Ea(this.#e);this.#m=0,this.#v=e,this.#q=t=>{this.#m-=e[t],e[t]=0},this.#W=(t,i,n,r)=>{if(!Vt(n)){if(this.#p(i))return this.backgroundFetchSize;if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(i,t),!Vt(n))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 n},this.#P=(t,i,n)=>{if(e[t]=i,this.#i){let r=this.#i-e[t];for(;this.#m>r;)this.#z(!0)}this.#m+=e[t],n&&(n.entrySize=i,n.totalCalculatedSize=this.#m)}}#q=e=>{};#P=(e,t,i)=>{};#W=(e,t,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#d;this.#$(t)&&((e||!this.#E(t))&&(yield t),t!==this.#k);)t=this.#y[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#k;this.#$(t)&&((e||!this.#E(t))&&(yield t),t!==this.#d);)t=this.#b[t]}#$(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#p(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*rentries(){for(let e of this.#I())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#p(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*keys(){for(let e of this.#A()){let t=this.#u[e];t!==void 0&&!this.#p(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#I()){let t=this.#u[e];t!==void 0&&!this.#p(this.#n[e])&&(yield t)}}*values(){for(let e of this.#A())this.#n[e]!==void 0&&!this.#p(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#I())this.#n[e]!==void 0&&!this.#p(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let n=this.#n[i],r=this.#p(n)?n.__staleWhileFetching:n;if(r!==void 0&&e(r,this.#u[i],this))return this.#G(this.#u[i],t)}}forEach(e,t=this){for(let i of this.#A()){let n=this.#n[i],r=this.#p(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(t,r,this.#u[i],this)}}rforEach(e,t=this){for(let i of this.#I()){let n=this.#n[i],r=this.#p(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(t,r,this.#u[i],this)}}purgeStale(){let e=!1;for(let t of this.#I({allowStale:!0}))this.#E(t)&&(this.#L(this.#u[t],"expire"),e=!0);return e}info(e){let t=this.#c.get(e);if(t===void 0)return;let i=this.#n[t],n=this.#p(i)?i.__staleWhileFetching:i;if(n===void 0)return;let r={value:n};if(this.#g&&this.#S){let o=this.#g[t],a=this.#S[t];if(o&&a){let c=o-(this.#f.now()-a);r.ttl=c,r.start=Date.now()}}return this.#v&&(r.size=this.#v[t]),r}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#u[t],n=this.#n[t],r=this.#p(n)?n.__staleWhileFetching:n;if(r===void 0||i===void 0)continue;let o={value:r};if(this.#g&&this.#S){o.ttl=this.#g[t];let a=this.#f.now()-this.#S[t];o.start=Math.floor(Date.now()-a)}this.#v&&(o.size=this.#v[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let n=Date.now()-i.start;i.start=this.#f.now()-n}this.#F(t,i.value,i)}}set(e,t,i={}){let{status:n=ae.hasSubscribers?{}:void 0}=i;i.status=n,n&&(n.op="set",n.key=e,t!==void 0&&(n.value=t),n.cache=this);let r=this.#F(e,t,i);return n&&ae.hasSubscribers&&ae.publish(n),r}#F(e,t,i,n){let{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=i,l=this.#p(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=i;u&&!l&&(u.value=t);let p=this.#W(e,t,i.size||0,c,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#L(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#a===0?void 0:this.#c.get(e);if(h===void 0)h=this.#a===0?this.#d:this.#w.length!==0?this.#w.pop():this.#a===this.#e?this.#z(!1):this.#a,this.#u[h]=e,this.#n[h]=t,this.#c.set(e,h),this.#b[this.#d]=h,this.#y[h]=this.#d,this.#d=h,this.#a++,this.#P(h,p,u),u&&(u.set="add"),d=!1,this.#T&&!l&&this.#o?.(t,e,"add");else{this.#K(h);let f=this.#n[h];if(t!==f){if(!a)if(this.#p(f)){f!==n&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=f;m!==void 0&&m!==t&&(this.#N&&this.#t?.(m,e,"set"),this.#s&&this.#x?.push([m,e,"set"]))}else this.#N&&this.#t?.(f,e,"set"),this.#s&&this.#x?.push([f,e,"set"]);if(this.#q(h),this.#P(h,p,u),this.#n[h]=t,!l){let m=f&&this.#p(f)?f.__staleWhileFetching:f,g=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=g,m!==void 0&&(u.oldValue=m)),this.#T&&this.onInsert?.(t,e,g)}}else l||(u&&(u.set="update"),this.#T&&this.onInsert?.(t,e,"update"))}if(r!==0&&!this.#g&&this.#O(),this.#g&&(d||this.#B(h,r,o),u&&this.#D(u,h)),!a&&this.#s&&this.#x){let f=this.#x,m;for(;m=f?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#k];if(this.#z(!0),this.#p(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#x){let e=this.#x,t;for(;t=e?.shift();)this.#r?.(...t)}}}#z(e){let t=this.#k,i=this.#u[t],n=this.#n[t],r=this.#p(n);r&&n.__abortController.abort(new Error("evicted"));let o=r?n.__staleWhileFetching:n;return(this.#N||this.#s)&&o!==void 0&&(this.#N&&this.#t?.(o,i,"evict"),this.#s&&this.#x?.push([o,i,"evict"])),this.#q(t),this.#_?.[t]&&(clearTimeout(this.#_[t]),this.#_[t]=void 0),e&&(this.#u[t]=void 0,this.#n[t]=void 0,this.#w.push(t)),this.#a===1?(this.#k=this.#d=0,this.#w.length=0):this.#k=this.#b[t],this.#c.delete(i),this.#a--,t}has(e,t={}){let{status:i=ae.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let n=this.#J(e,t);return ae.hasSubscribers&&ae.publish(i),n}#J(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=t,r=this.#c.get(e);if(r!==void 0){let o=this.#n[r];if(this.#p(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#E(r))n&&(n.has="stale",this.#D(n,r));else return i&&this.#C(r),n&&(n.has="hit",this.#D(n,r)),!0}else n&&(n.has="miss");return!1}peek(e,t={}){let{status:i=zd()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let n=this.#V(e,t);return ae.hasSubscribers&&ae.publish(i),n}#V(e,t){let{status:i,allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#E(r)){i&&(i.peek=r===void 0?"miss":"stale");return}let o=this.#n[r],a=this.#p(o)?o.__staleWhileFetching:o;return i&&(a!==void 0?(i.peek="hit",i.value=a):i.peek="miss"),a}#M(e,t,i,n){let r=t===void 0?void 0:this.#n[t];if(this.#p(r))return r;let o=new AbortController,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:n},u=(m,g=!1)=>{let{aborted:b}=o.signal,w=i.ignoreFetchAbort&&m!==void 0,y=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&m!==void 0);if(i.status&&(b&&!g?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),b&&!w&&!g)return d(o.signal.reason,y);let x=h,_=this.#n[t];return(_===h||_===void 0&&w&&g)&&(m===void 0?x.__staleWhileFetching!==void 0?this.#n[t]=x.__staleWhileFetching:this.#L(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#F(e,m,c.options,x))),m},l=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),d(m,!1)),d=(m,g)=>{let{aborted:b}=o.signal,w=b&&i.allowStaleOnFetchAbort,y=w||i.allowStaleOnFetchRejection,x=y||i.noDeleteOnFetchRejection,_=h;if(this.#n[t]===h&&(!x||!g&&_.__staleWhileFetching===void 0?this.#L(e,"fetch"):w||(this.#n[t]=_.__staleWhileFetching)),y)return i.status&&_.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw m},p=(m,g)=>{let b=this.#h?.(e,r,c);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=w=>u(w,!0)))}),b&&b instanceof Promise?b.then(w=>m(w===void 0?void 0:w),g):b!==void 0&&m(b)};i.status&&(i.status.fetchDispatched=!0);let h=new Promise(p).then(u,l),f=Object.assign(h,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.#F(e,f,{...c.options,status:void 0}),t=this.#c.get(e)):this.#n[t]=f,f}#p(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=Ln.hasSubscribers,{status:n=zd()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#H(e,t);return n&&i&&(n.trace=!0,Ln.tracePromise(()=>r,n).catch(()=>{})),r}async#H(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:b,signal:w}=t;if(b&&(b.op="fetch",b.key=e,g&&(b.forceRefresh=!0),b.cache=this),!this.#R)return b&&(b.fetch="get"),this.#G(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:b});let y={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:f,ignoreFetchAbort:h,status:b,signal:w},x=this.#c.get(e);if(x===void 0){b&&(b.fetch="miss");let _=this.#M(e,x,y,m);return _.__returned=_}else{let _=this.#n[x];if(this.#p(_)){let C=i&&_.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",C&&(b.returnedStale=!0)),C?_.__staleWhileFetching:_.__returned=_}let k=this.#E(x);if(!g&&!k)return b&&(b.fetch="hit"),this.#K(x),n&&this.#C(x),b&&this.#D(b,x),_;let S=this.#M(e,x,y,m),v=S.__staleWhileFetching!==void 0&&i;return b&&(b.fetch=k?"stale":"refresh",v&&k&&(b.returnedStale=!0)),v?S.__staleWhileFetching:S.__returned=S}}forceFetch(e,t={}){let i=Ln.hasSubscribers,{status:n=zd()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#j(e,t);return n&&i&&(n.trace=!0,Ln.tracePromise(()=>r,n).catch(()=>{})),r}async#j(e,t={}){let i=await this.#H(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=ae.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let n=this.#Q(e,t);return i&&(i.value=n),ae.hasSubscribers&&ae.publish(i),n}#Q(e,t={}){let i=this.#l;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,status:r,forceRefresh:o,...a}=t;r&&o&&(r.forceRefresh=!0);let c=this.#G(e,a),u=o||c===void 0;if(r&&(r.memo=u?"miss":"hit",u||(r.value=c)),!u)return c;let l=i(e,c,{options:a,context:n});return r&&(r.value=l),this.#F(e,l,a),l}get(e,t={}){let{status:i=ae.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let n=this.#G(e,t);return i&&(n!==void 0&&(i.value=n),ae.hasSubscribers&&ae.publish(i)),n}#G(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,a=this.#c.get(e);if(a===void 0){o&&(o.get="miss");return}let c=this.#n[a],u=this.#p(c);return o&&this.#D(o,a),this.#E(a)?u?(o&&(o.get="stale-fetching"),i&&c.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),c.__staleWhileFetching):void 0):(r||this.#L(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),c):void 0):(o&&(o.get=u?"fetching":"hit"),this.#K(a),n&&this.#C(a),u?c.__staleWhileFetching:c)}#Y(e,t){this.#y[t]=e,this.#b[e]=t}#K(e){e!==this.#d&&(e===this.#k?this.#k=this.#b[e]:this.#Y(this.#y[e],this.#b[e]),this.#Y(this.#d,e),this.#d=e)}delete(e){return this.#L(e,"delete")}#L(e,t){ae.hasSubscribers&&ae.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#a!==0){let n=this.#c.get(e);if(n!==void 0)if(this.#_?.[n]&&(clearTimeout(this.#_[n]),this.#_[n]=void 0),i=!0,this.#a===1)this.#Z(t);else{this.#q(n);let r=this.#n[n];if(this.#p(r)?r.__abortController.abort(new Error("deleted")):(this.#N||this.#s)&&(this.#N&&this.#t?.(r,e,t),this.#s&&this.#x?.push([r,e,t])),this.#c.delete(e),this.#u[n]=void 0,this.#n[n]=void 0,n===this.#d)this.#d=this.#y[n];else if(n===this.#k)this.#k=this.#b[n];else{let o=this.#y[n];this.#b[o]=this.#b[n];let a=this.#b[n];this.#y[a]=this.#y[n]}this.#a--,this.#w.push(n)}}if(this.#s&&this.#x?.length){let n=this.#x,r;for(;r=n?.shift();)this.#r?.(...r)}return i}clear(){return this.#Z("delete")}#Z(e){for(let t of this.#I({allowStale:!0})){let i=this.#n[t];if(this.#p(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#u[t];this.#N&&this.#t?.(i,n,e),this.#s&&this.#x?.push([i,n,e])}}if(this.#c.clear(),this.#n.fill(void 0),this.#u.fill(void 0),this.#g&&this.#S){this.#g.fill(0),this.#S.fill(0);for(let t of this.#_??[])t!==void 0&&clearTimeout(t);this.#_?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#k=0,this.#d=0,this.#w.length=0,this.#m=0,this.#a=0,this.#s&&this.#x){let t=this.#x,i;for(;i=t?.shift();)this.#r?.(...i)}}},Vk=typeof process=="object"&&process?process:{stdout:null,stderr:null},$6=s=>!!s&&typeof s=="object"&&(s instanceof Ia||s instanceof ap.default||j6(s)||z6(s)),j6=s=>!!s&&typeof s=="object"&&s instanceof Da.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==ap.default.Writable.prototype.pipe,z6=s=>!!s&&typeof s=="object"&&s instanceof Da.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function",_t=Symbol("EOF"),wt=Symbol("maybeEmitEnd"),Ut=Symbol("emittedEnd"),ga=Symbol("emittingEnd"),Dn=Symbol("emittedError"),ba=Symbol("closed"),Hk=Symbol("read"),ka=Symbol("flush"),Gk=Symbol("flushChunk"),Ve=Symbol("encoding"),ki=Symbol("decoder"),ie=Symbol("flowing"),Pn=Symbol("paused"),xi=Symbol("resume"),ne=Symbol("buffer"),he=Symbol("pipes"),re=Symbol("bufferLength"),Ud=Symbol("bufferPush"),xa=Symbol("bufferShift"),le=Symbol("objectMode"),H=Symbol("destroyed"),Vd=Symbol("error"),Hd=Symbol("emitData"),Kk=Symbol("emitEnd"),Gd=Symbol("emitEnd2"),nt=Symbol("async"),Kd=Symbol("abort"),_a=Symbol("aborted"),qn=Symbol("signal"),Es=Symbol("dataListeners"),Se=Symbol("discarded"),Fn=s=>Promise.resolve().then(s),U6=s=>s(),V6=s=>s==="end"||s==="finish"||s==="prefinish",H6=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,G6=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Cx=class{src;dest;opts;ondrain;constructor(s,e,t){this.src=s,this.dest=e,this.opts=t,this.ondrain=()=>s[xi](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(s){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},K6=class extends Cx{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(s,e,t){super(s,e,t),this.proxyErrors=i=>this.dest.emit("error",i),s.on("error",this.proxyErrors)}},J6=s=>!!s.objectMode,Y6=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",Ia=class extends Da.EventEmitter{[ie]=!1;[Pn]=!1;[he]=[];[ne]=[];[le];[Ve];[nt];[ki];[_t]=!1;[Ut]=!1;[ga]=!1;[ba]=!1;[Dn]=null;[re]=0;[H]=!1;[qn];[_a]=!1;[Es]=0;[Se]=!1;writable=!0;readable=!0;constructor(...s){let e=s[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");J6(e)?(this[le]=!0,this[Ve]=null):Y6(e)?(this[Ve]=e.encoding,this[le]=!1):(this[le]=!1,this[Ve]=null),this[nt]=!!e.async,this[ki]=this[Ve]?new Ex.StringDecoder(this[Ve]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ne]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[he]});let{signal:t}=e;t&&(this[qn]=t,t.aborted?this[Kd]():t.addEventListener("abort",()=>this[Kd]()))}get bufferLength(){return this[re]}get encoding(){return this[Ve]}set encoding(s){throw new Error("Encoding must be set at instantiation time")}setEncoding(s){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[le]}set objectMode(s){throw new Error("objectMode must be set at instantiation time")}get async(){return this[nt]}set async(s){this[nt]=this[nt]||!!s}[Kd](){this[_a]=!0,this.emit("abort",this[qn]?.reason),this.destroy(this[qn]?.reason)}get aborted(){return this[_a]}set aborted(s){}write(s,e,t){if(this[_a])return!1;if(this[_t])throw new Error("write after end");if(this[H])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(t=e,e="utf8"),e||(e="utf8");let i=this[nt]?Fn:U6;if(!this[le]&&!Buffer.isBuffer(s)){if(G6(s))s=Buffer.from(s.buffer,s.byteOffset,s.byteLength);else if(H6(s))s=Buffer.from(s);else if(typeof s!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[le]?(this[ie]&&this[re]!==0&&this[ka](!0),this[ie]?this.emit("data",s):this[Ud](s),this[re]!==0&&this.emit("readable"),t&&i(t),this[ie]):s.length?(typeof s=="string"&&!(e===this[Ve]&&!this[ki]?.lastNeed)&&(s=Buffer.from(s,e)),Buffer.isBuffer(s)&&this[Ve]&&(s=this[ki].write(s)),this[ie]&&this[re]!==0&&this[ka](!0),this[ie]?this.emit("data",s):this[Ud](s),this[re]!==0&&this.emit("readable"),t&&i(t),this[ie]):(this[re]!==0&&this.emit("readable"),t&&i(t),this[ie])}read(s){if(this[H])return null;if(this[Se]=!1,this[re]===0||s===0||s&&s>this[re])return this[wt](),null;this[le]&&(s=null),this[ne].length>1&&!this[le]&&(this[ne]=[this[Ve]?this[ne].join(""):Buffer.concat(this[ne],this[re])]);let e=this[Hk](s||null,this[ne][0]);return this[wt](),e}[Hk](s,e){if(this[le])this[xa]();else{let t=e;s===t.length||s===null?this[xa]():typeof t=="string"?(this[ne][0]=t.slice(s),e=t.slice(0,s),this[re]-=s):(this[ne][0]=t.subarray(s),e=t.subarray(0,s),this[re]-=s)}return this.emit("data",e),!this[ne].length&&!this[_t]&&this.emit("drain"),e}end(s,e,t){return typeof s=="function"&&(t=s,s=void 0),typeof e=="function"&&(t=e,e="utf8"),s!==void 0&&this.write(s,e),t&&this.once("end",t),this[_t]=!0,this.writable=!1,(this[ie]||!this[Pn])&&this[wt](),this}[xi](){this[H]||(!this[Es]&&!this[he].length&&(this[Se]=!0),this[Pn]=!1,this[ie]=!0,this.emit("resume"),this[ne].length?this[ka]():this[_t]?this[wt]():this.emit("drain"))}resume(){return this[xi]()}pause(){this[ie]=!1,this[Pn]=!0,this[Se]=!1}get destroyed(){return this[H]}get flowing(){return this[ie]}get paused(){return this[Pn]}[Ud](s){this[le]?this[re]+=1:this[re]+=s.length,this[ne].push(s)}[xa](){return this[le]?this[re]-=1:this[re]-=this[ne][0].length,this[ne].shift()}[ka](s=!1){do;while(this[Gk](this[xa]())&&this[ne].length);!s&&!this[ne].length&&!this[_t]&&this.emit("drain")}[Gk](s){return this.emit("data",s),this[ie]}pipe(s,e){if(this[H])return s;this[Se]=!1;let t=this[Ut];return e=e||{},s===Vk.stdout||s===Vk.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,t?e.end&&s.end():(this[he].push(e.proxyErrors?new K6(this,s,e):new Cx(this,s,e)),this[nt]?Fn(()=>this[xi]()):this[xi]()),s}unpipe(s){let e=this[he].find(t=>t.dest===s);e&&(this[he].length===1?(this[ie]&&this[Es]===0&&(this[ie]=!1),this[he]=[]):this[he].splice(this[he].indexOf(e),1),e.unpipe())}addListener(s,e){return this.on(s,e)}on(s,e){let t=super.on(s,e);if(s==="data")this[Se]=!1,this[Es]++,!this[he].length&&!this[ie]&&this[xi]();else if(s==="readable"&&this[re]!==0)super.emit("readable");else if(V6(s)&&this[Ut])super.emit(s),this.removeAllListeners(s);else if(s==="error"&&this[Dn]){let i=e;this[nt]?Fn(()=>i.call(this,this[Dn])):i.call(this,this[Dn])}return t}removeListener(s,e){return this.off(s,e)}off(s,e){let t=super.off(s,e);return s==="data"&&(this[Es]=this.listeners("data").length,this[Es]===0&&!this[Se]&&!this[he].length&&(this[ie]=!1)),t}removeAllListeners(s){let e=super.removeAllListeners(s);return(s==="data"||s===void 0)&&(this[Es]=0,!this[Se]&&!this[he].length&&(this[ie]=!1)),e}get emittedEnd(){return this[Ut]}[wt](){!this[ga]&&!this[Ut]&&!this[H]&&this[ne].length===0&&this[_t]&&(this[ga]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ba]&&this.emit("close"),this[ga]=!1)}emit(s,...e){let t=e[0];if(s!=="error"&&s!=="close"&&s!==H&&this[H])return!1;if(s==="data")return!this[le]&&!t?!1:this[nt]?(Fn(()=>this[Hd](t)),!0):this[Hd](t);if(s==="end")return this[Kk]();if(s==="close"){if(this[ba]=!0,!this[Ut]&&!this[H])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(s==="error"){this[Dn]=t,super.emit(Vd,t);let n=!this[qn]||this.listeners("error").length?super.emit("error",t):!1;return this[wt](),n}else if(s==="resume"){let n=super.emit("resume");return this[wt](),n}else if(s==="finish"||s==="prefinish"){let n=super.emit(s);return this.removeAllListeners(s),n}let i=super.emit(s,...e);return this[wt](),i}[Hd](s){for(let t of this[he])t.dest.write(s)===!1&&this.pause();let e=this[Se]?!1:super.emit("data",s);return this[wt](),e}[Kk](){return this[Ut]?!1:(this[Ut]=!0,this.readable=!1,this[nt]?(Fn(()=>this[Gd]()),!0):this[Gd]())}[Gd](){if(this[ki]){let e=this[ki].end();if(e){for(let t of this[he])t.dest.write(e);this[Se]||super.emit("data",e)}}for(let e of this[he])e.end();let s=super.emit("end");return this.removeAllListeners("end"),s}async collect(){let s=Object.assign([],{dataLength:0});this[le]||(s.dataLength=0);let e=this.promise();return this.on("data",t=>{s.push(t),this[le]||(s.dataLength+=t.length)}),await e,s}async concat(){if(this[le])throw new Error("cannot concat in objectMode");let s=await this.collect();return this[Ve]?s.join(""):Buffer.concat(s,s.dataLength)}async promise(){return new Promise((s,e)=>{this.on(H,()=>e(new Error("stream destroyed"))),this.on("error",t=>e(t)),this.on("end",()=>s())})}[Symbol.asyncIterator](){this[Se]=!1;let s=!1,e=async()=>(this.pause(),s=!0,{value:void 0,done:!0});return{next:()=>{if(s)return e();let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[_t])return e();let i,n,r=u=>{this.off("data",o),this.off("end",a),this.off(H,c),e(),n(u)},o=u=>{this.off("error",r),this.off("end",a),this.off(H,c),this.pause(),i({value:u,done:!!this[_t]})},a=()=>{this.off("error",r),this.off("data",o),this.off(H,c),e(),i({done:!0,value:void 0})},c=()=>r(new Error("stream destroyed"));return new Promise((u,l)=>{n=l,i=u,this.once(H,c),this.once("error",r),this.once("end",a),this.once("data",o)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Se]=!1;let s=!1,e=()=>(this.pause(),this.off(Vd,e),this.off(H,e),this.off("end",e),s=!0,{done:!0,value:void 0}),t=()=>{if(s)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(Vd,e),this.once(H,e),{next:t,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(s){if(this[H])return s?this.emit("error",s):this.emit(H),this;this[H]=!0,this[Se]=!0,this[ne].length=0,this[re]=0;let e=this;return typeof e.close=="function"&&!this[ba]&&e.close(),s?this.emit("error",s):this.emit(H),this}static get isStream(){return $6}},Z6=ot.realpathSync.native,Wn={lstatSync:ot.lstatSync,readdir:ot.readdir,readdirSync:ot.readdirSync,readlinkSync:ot.readlinkSync,realpathSync:Z6,promises:{lstat:Gt.lstat,readdir:Gt.readdir,readlink:Gt.readlink,realpath:Gt.realpath}},Rx=s=>!s||s===Wn||s===W6?Wn:{...Wn,...s,promises:{...Wn.promises,...s.promises}},Q6=/^\\\\\?\\([a-z]:)\\?$/i,X6=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,eR=/^\\\\[^\\?]+\\[^\\]+$/,Jk=s=>s.replace(/\//g,"\\").replace(Q6,"$1\\").replace(X6,"\\\\$1\\").replace(eR,"$&\\"),tR=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,sR=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,iR=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,nR=/[\\/]/,qe=0,Ax=1,Ix=2,rt=4,Tx=6,Ox=8,Cs=10,Dx=12,Pe=15,Mn=~Pe,Jd=16,Yk=32,$n=64,He=128,wa=256,Ca=512,Zk=$n|He|Ca,rR=1023,Yd=s=>s.isFile()?Ox:s.isDirectory()?rt:s.isSymbolicLink()?Cs:s.isCharacterDevice()?Ix:s.isBlockDevice()?Tx:s.isSocket()?Dx:s.isFIFO()?Ax:qe,Qk=new Oa({max:2**12}),jn=s=>{let e=Qk.get(s);if(e)return e;let t=s.normalize("NFKD");return Qk.set(s,t),t},Xk=new Oa({max:2**12}),ya=s=>{let e=Xk.get(s);if(e)return e;let t=jn(s.toLowerCase());return Xk.set(s,t),t},ex=class extends Oa{constructor(){super({max:256})}},oR=class extends Oa{constructor(s=16*1024){super({maxSize:s,sizeCalculation:e=>e.length+1})}},Px=Symbol("PathScurry setAsCwd"),_e=class{name;root;roots;parent;nocase;isCWD=!1;#e;#i;get dev(){return this.#i}#t;get mode(){return this.#t}#o;get nlink(){return this.#o}#r;get uid(){return this.#r}#h;get gid(){return this.#h}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#m;get size(){return this.#m}#c;get blocks(){return this.#c}#u;get atimeMs(){return this.#u}#n;get mtimeMs(){return this.#n}#b;get ctimeMs(){return this.#b}#y;get birthtimeMs(){return this.#y}#k;get atime(){return this.#k}#d;get mtime(){return this.#d}#w;get ctime(){return this.#w}#x;get birthtime(){return this.#x}#v;#S;#g;#_;#N;#R;#s;#T;#O;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(s,e=qe,t,i,n,r,o){this.name=s,this.#v=n?ya(s):jn(s),this.#s=e&rR,this.nocase=n,this.roots=i,this.root=t||this,this.#T=r,this.#g=o.fullpath,this.#N=o.relative,this.#R=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=Rx(o.fs)}get fs(){return this.#e}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#T}resolve(s){if(!s)return this;let e=this.getRootString(s),t=s.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#D(t):this.#D(t)}#D(s){let e=this;for(let t of s)e=e.child(t);return e}children(){let s=this.#T.get(this);if(s)return s;let e=Object.assign([],{provisional:0});return this.#T.set(this,e),this.#s&=~Jd,e}child(s,e){if(s===""||s===".")return this;if(s==="..")return this.parent||this;let t=this.children(),i=this.nocase?ya(s):jn(s);for(let a of t)if(a.#v===i)return a;let n=this.parent?this.sep:"",r=this.#g?this.#g+n+s:void 0,o=this.newChild(s,qe,{...e,parent:this,fullpath:r});return this.canReaddir()||(o.#s|=He),t.push(o),o}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let s=this.name,e=this.parent;if(!e)return this.#N=this.name;let t=e.relative();return t+(!t||!e.parent?"":this.sep)+s}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let s=this.name,e=this.parent;if(!e)return this.#R=this.fullpathPosix();let t=e.relativePosix();return t+(!t||!e.parent?"":"/")+s}fullpath(){if(this.#g!==void 0)return this.#g;let s=this.name,e=this.parent;if(!e)return this.#g=this.name;let t=e.fullpath()+(e.parent?this.sep:"")+s;return this.#g=t}fullpathPosix(){if(this.#_!==void 0)return this.#_;if(this.sep==="/")return this.#_=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#_=`//?/${i}`:this.#_=i}let s=this.parent,e=s.fullpathPosix(),t=e+(!e||!s.parent?"":"/")+this.name;return this.#_=t}isUnknown(){return(this.#s&Pe)===qe}isType(s){return this[`is${s}`]()}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&Pe)===Ox}isDirectory(){return(this.#s&Pe)===rt}isCharacterDevice(){return(this.#s&Pe)===Ix}isBlockDevice(){return(this.#s&Pe)===Tx}isFIFO(){return(this.#s&Pe)===Ax}isSocket(){return(this.#s&Pe)===Dx}isSymbolicLink(){return(this.#s&Cs)===Cs}lstatCached(){return this.#s&Yk?this:void 0}readlinkCached(){return this.#O}realpathCached(){return this.#C}readdirCached(){let s=this.children();return s.slice(0,s.provisional)}canReadlink(){if(this.#O)return!0;if(!this.parent)return!1;let s=this.#s&Pe;return!(s!==qe&&s!==Cs||this.#s&wa||this.#s&He)}calledReaddir(){return!!(this.#s&Jd)}isENOENT(){return!!(this.#s&He)}isNamed(s){return this.nocase?this.#v===ya(s):this.#v===jn(s)}async readlink(){let s=this.#O;if(s)return s;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#O=t}catch(e){this.#I(e.code);return}}readlinkSync(){let s=this.#O;if(s)return s;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#O=t}catch(e){this.#I(e.code);return}}#B(s){this.#s|=Jd;for(let e=s.provisional;e<s.length;e++){let t=s[e];t&&t.#E()}}#E(){this.#s&He||(this.#s=(this.#s|He)&Mn,this.#U())}#U(){let s=this.children();s.provisional=0;for(let e of s)e.#E()}#q(){this.#s|=Ca,this.#P()}#P(){if(this.#s&$n)return;let s=this.#s;(s&Pe)===rt&&(s&=Mn),this.#s=s|$n,this.#U()}#W(s=""){s==="ENOTDIR"||s==="EPERM"?this.#P():s==="ENOENT"?this.#E():this.children().provisional=0}#A(s=""){s==="ENOTDIR"?this.parent.#P():s==="ENOENT"&&this.#E()}#I(s=""){let e=this.#s;e|=wa,s==="ENOENT"&&(e|=He),(s==="EINVAL"||s==="UNKNOWN")&&(e&=Mn),this.#s=e,s==="ENOTDIR"&&this.parent&&this.parent.#P()}#$(s,e){return this.#z(s,e)||this.#F(s,e)}#F(s,e){let t=Yd(s),i=this.newChild(s.name,t,{parent:this}),n=i.#s&Pe;return n!==rt&&n!==Cs&&n!==qe&&(i.#s|=$n),e.unshift(i),e.provisional++,i}#z(s,e){for(let t=e.provisional;t<e.length;t++){let i=e[t];if((this.nocase?ya(s.name):jn(s.name))===i.#v)return this.#J(s,i,t,e)}}#J(s,e,t,i){let n=e.name;return e.#s=e.#s&Mn|Yd(s),n!==s.name&&(e.name=s.name),t!==i.provisional&&(t===i.length-1?i.pop():i.splice(t,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#s&He)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(s){this.#A(s.code)}}lstatSync(){if((this.#s&He)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(s){this.#A(s.code)}}#V(s){let{atime:e,atimeMs:t,birthtime:i,birthtimeMs:n,blksize:r,blocks:o,ctime:a,ctimeMs:c,dev:u,gid:l,ino:d,mode:p,mtime:h,mtimeMs:f,nlink:m,rdev:g,size:b,uid:w}=s;this.#k=e,this.#u=t,this.#x=i,this.#y=n,this.#f=r,this.#c=o,this.#w=a,this.#b=c,this.#i=u,this.#h=l,this.#a=d,this.#t=p,this.#d=h,this.#n=f,this.#o=m,this.#l=g,this.#m=b,this.#r=w;let y=Yd(s);this.#s=this.#s&Mn|y|Yk,y!==qe&&y!==rt&&y!==Cs&&(this.#s|=$n)}#M=[];#p=!1;#H(s){this.#p=!1;let e=this.#M.slice();this.#M.length=0,e.forEach(t=>t(null,s))}readdirCB(s,e=!1){if(!this.canReaddir()){e?s(null,[]):queueMicrotask(()=>s(null,[]));return}let t=this.children();if(this.calledReaddir()){let n=t.slice(0,t.provisional);e?s(null,n):queueMicrotask(()=>s(null,n));return}if(this.#M.push(s),this.#p)return;this.#p=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,r)=>{if(n)this.#W(n.code),t.provisional=0;else{for(let o of r)this.#$(o,t);this.#B(t)}this.#H(t.slice(0,t.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let e=this.fullpath();if(this.#j)await this.#j;else{let t=()=>{};this.#j=new Promise(i=>t=i);try{for(let i of await this.#e.promises.readdir(e,{withFileTypes:!0}))this.#$(i,s);this.#B(s)}catch(i){this.#W(i.code),s.provisional=0}this.#j=void 0,t()}return s.slice(0,s.provisional)}readdirSync(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let e=this.fullpath();try{for(let t of this.#e.readdirSync(e,{withFileTypes:!0}))this.#$(t,s);this.#B(s)}catch(t){this.#W(t.code),s.provisional=0}return s.slice(0,s.provisional)}canReaddir(){if(this.#s&Zk)return!1;let s=Pe&this.#s;return s===qe||s===rt||s===Cs}shouldWalk(s,e){return(this.#s&rt)===rt&&!(this.#s&Zk)&&!s.has(this)&&(!e||e(this))}async realpath(){if(this.#C)return this.#C;if(!((Ca|wa|He)&this.#s))try{let s=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(s)}catch{this.#q()}}realpathSync(){if(this.#C)return this.#C;if(!((Ca|wa|He)&this.#s))try{let s=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(s)}catch{this.#q()}}[Px](s){if(s===this)return;s.isCWD=!1,this.isCWD=!0;let e=new Set([]),t=[],i=this;for(;i&&i.parent;)e.add(i),i.#N=t.join(this.sep),i.#R=t.join("/"),i=i.parent,t.push("..");for(i=s;i&&i.parent&&!e.has(i);)i.#N=void 0,i.#R=void 0,i=i.parent}},qx=class Fx extends _e{sep="\\";splitSep=nR;constructor(e,t=qe,i,n,r,o,a){super(e,t,i,n,r,o,a)}newChild(e,t=qe,i={}){return new Fx(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return tR.exec(e)?.[0]??_i.win32.parse(e).root}getRoot(e){if(e=Jk(e.toUpperCase()),e===this.root.name||/^[\\/]$/.test(e))return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new cp(e,{nocase:this.nocase,fs:this.fs}).root}sameRoot(e,t=this.root.name){return Jk(e.toUpperCase())===t}},Mx=class Lx extends _e{splitSep="/";sep="/";constructor(e,t=qe,i,n,r,o,a){super(e,t,i,n,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=qe,i={}){return new Lx(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Bx=class{root;rootPath;roots;cwd;#e;#i;#t;nocase;#o;constructor(s=process.cwd(),e,t,{nocase:i,childrenCacheSize:n=16*1024,fs:r=Wn}={}){this.#o=Rx(r),(s instanceof URL||s.startsWith("file://"))&&(s=(0,Nx.fileURLToPath)(s));let o=e.resolve(s);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new ex,this.#i=new ex,this.#t=new oR(n);let a=o.substring(this.rootPath.length).split(t);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let c=this.root,u=a.length-1,l=e.sep,d=this.rootPath,p=!1;for(let h of a){let f=u--;c=c.child(h,{relative:new Array(f).fill("..").join(l),relativePosix:new Array(f).fill("..").join("/"),fullpath:d+=(p?"":l)+h}),p=!0}this.cwd=c}depth(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.depth()}childrenCache(){return this.#t}resolve(...s){let e="";for(let n=s.length-1;n>=0;n--){let r=s[n];if(!(!r||r===".")&&(e=e?`${r}/${e}`:r,this.isAbsolute(r)))break}let t=this.#e.get(e);if(t!==void 0)return t;let i=this.cwd.resolve(e).fullpath();return this.#e.set(e,i),i}resolvePosix(...s){let e="";for(let n=s.length-1;n>=0;n--){let r=s[n];if(!(!r||r===".")&&(e=e?`${r}/${e}`:r,this.isAbsolute(r)))break}let t=this.#i.get(e);if(t!==void 0)return t;let i=this.cwd.resolve(e).fullpathPosix();return this.#i.set(e,i),i}relative(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relative()}relativePosix(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relativePosix()}basename(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.name}dirname(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),(s.parent||s).fullpath()}async readdir(s=this.cwd,e={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t}=e;if(s.canReaddir()){let i=await s.readdir();return t?i:i.map(n=>n.name)}else return[]}readdirSync(s=this.cwd,e={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0}=e;return s.canReaddir()?t?s.readdirSync():s.readdirSync().map(i=>i.name):[]}async lstat(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstat()}lstatSync(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstatSync()}async readlink(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=await s.readlink();return e?t:t?.fullpath()}readlinkSync(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=s.readlinkSync();return e?t:t?.fullpath()}async realpath(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=await s.realpath();return e?t:t?.fullpath()}realpathSync(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=s.realpathSync();return e?t:t?.fullpath()}async walk(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=[];(!n||n(s))&&o.push(t?s:s.fullpath());let a=new Set,c=(l,d)=>{a.add(l),l.readdirCB((p,h)=>{if(p)return d(p);let f=h.length;if(!f)return d();let m=()=>{--f===0&&d()};for(let g of h)(!n||n(g))&&o.push(t?g:g.fullpath()),i&&g.isSymbolicLink()?g.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(a,r)?c(b,m):m()):g.shouldWalk(a,r)?c(g,m):m()},!0)},u=s;return new Promise((l,d)=>{c(u,p=>{if(p)return d(p);l(o)})})}walkSync(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=[];(!n||n(s))&&o.push(t?s:s.fullpath());let a=new Set([s]);for(let c of a){let u=c.readdirSync();for(let l of u){(!n||n(l))&&o.push(t?l:l.fullpath());let d=l;if(l.isSymbolicLink()){if(!(i&&(d=l.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,r)&&a.add(d)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(s=this.cwd,e={}){return typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd),this.stream(s,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e;(!n||n(s))&&(yield t?s:s.fullpath());let o=new Set([s]);for(let a of o){let c=a.readdirSync();for(let u of c){(!n||n(u))&&(yield t?u:u.fullpath());let l=u;if(u.isSymbolicLink()){if(!(i&&(l=u.realpathSync())))continue;l.isUnknown()&&l.lstatSync()}l.shouldWalk(o,r)&&o.add(l)}}}stream(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=new Ia({objectMode:!0});(!n||n(s))&&o.write(t?s:s.fullpath());let a=new Set,c=[s],u=0,l=()=>{let d=!1;for(;!d;){let p=c.shift();if(!p){u===0&&o.end();return}u++,a.add(p);let h=(m,g,b=!1)=>{if(m)return o.emit("error",m);if(i&&!b){let w=[];for(let y of g)y.isSymbolicLink()&&w.push(y.realpath().then(x=>x?.isUnknown()?x.lstat():x));if(w.length){Promise.all(w).then(()=>h(null,g,!0));return}}for(let w of g)w&&(!n||n(w))&&(o.write(t?w:w.fullpath())||(d=!0));u--;for(let w of g){let y=w.realpathCached()||w;y.shouldWalk(a,r)&&c.push(y)}d&&!o.flowing?o.once("drain",l):f||l()},f=!0;p.readdirCB(h,!0),f=!1}};return l(),o}streamSync(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=new Ia({objectMode:!0}),a=new Set;(!n||n(s))&&o.write(t?s:s.fullpath());let c=[s],u=0,l=()=>{let d=!1;for(;!d;){let p=c.shift();if(!p){u===0&&o.end();return}u++,a.add(p);let h=p.readdirSync();for(let f of h)(!n||n(f))&&(o.write(t?f:f.fullpath())||(d=!0));u--;for(let f of h){let m=f;if(f.isSymbolicLink()){if(!(i&&(m=f.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(a,r)&&c.push(m)}}d&&!o.flowing&&o.once("drain",l)};return l(),o}chdir(s=this.cwd){let e=this.cwd;this.cwd=typeof s=="string"?this.cwd.resolve(s):s,this.cwd[Px](e)}},cp=class extends Bx{sep="\\";constructor(s=process.cwd(),e={}){let{nocase:t=!0}=e;typeof s=="string"&&!s.startsWith("file://")&&(s=s.replace(sR,"").replace(iR,"\\")),super(s,_i.win32,"\\",{...e,nocase:t}),this.nocase=t;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(s){return _i.win32.parse(s).root.toUpperCase()}newRoot(s){return new qx(this.rootPath,rt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")||s.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(s)}},up=class extends Bx{sep="/";constructor(s=process.cwd(),e={}){let{nocase:t=!1}=e;super(s,_i.posix,"/",{...e,nocase:t}),this.nocase=t}parseRootPath(s){return"/"}newRoot(s){return new Mx(this.rootPath,rt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")}},Wx=class extends up{constructor(s=process.cwd(),e={}){let{nocase:t=!0}=e;super(s,{...e,nocase:t})}},yq=process.platform==="win32"?qx:Mx,aR=process.platform==="win32"?cp:process.platform==="darwin"?Wx:up,cR=s=>s.length>=1,uR=s=>s.length>=1,lR=Symbol.for("nodejs.util.inspect.custom"),$x=class jx{#e;#i;#t;length;#o;#r;#h;#l;#f;#a;#m=!0;constructor(e,t,i,n){if(!cR(e))throw new TypeError("empty pattern list");if(!uR(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#i=t,this.#t=i,this.#o=n,this.#t===0){if(this.isUNC()){let r=this.#c()?6:4,o=this.#e.slice(0,r),a=this.#i.slice(0,r),c=this.#e.slice(r),u=this.#i.slice(r);c[0]===""&&(c.shift(),u.shift());let l=[...o,""].join("/"),d=[...a,""].join("/");this.#e=[l,...c],this.#i=[d,...u],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...c]=this.#i;o[0]===""&&(o.shift(),c.shift());let u=`${r}/`,l=`${a}/`;this.#e=[u,...o],this.#i=[l,...c],this.length=this.#e.length}}}[lR](){return`Pattern <${this.#i.slice(this.#t).join("/")}>`}pattern(){return this.#e[this.#t]}isString(){return typeof this.#e[this.#t]=="string"}isGlobstar(){return this.#e[this.#t]===U}isMatcher(){return typeof this.#e[this.#t]=="object"}globString(){return this.#h=this.#h||(this.#t===0?this.isAbsolute()?this.#i[0]+this.#i.slice(1).join("/"):this.#i.join("/"):this.#i.slice(this.#t).join("/"))}hasMore(){return this.length>this.#t+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new jx(this.#e,this.#i,this.#t+1,this.#o),this.#r.#a=this.#a,this.#r.#f=this.#f,this.#r.#l=this.#l,this.#r):this.#r=null}#c(){let e=this.#e;return e[2]==="?"&&typeof e[3]=="string"&&/^unc$/i.test(e[3])}isUNC(){let e=this.#e,t=this.#c()?4:2;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#t===0&&e[0]===""&&e[1]===""&&typeof e[t]=="string"&&!!e[t]&&typeof e[t+1]=="string"&&!!e[t+1]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#o==="win32"&&this.#t===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#t===0?e:""}checkFollowGlobstar(){return!(this.#t===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#t===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}},dR=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",tx=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(s,{nobrace:e,nocase:t,noext:i,noglobstar:n,normalize:r,platform:o=dR,root:a,windowsPathsNoEscape:c,allowWindowsEscape:u},l){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,c=!!c||u===!1,this.mmopts={dot:!0,nobrace:e,nocase:t,noext:i,noglobstar:n,normalize:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0,windowsPathsNoEscape:c};let d=l?.resolve(a??"/").fullpath()??"/";this.slashRoot=op(d.replace(/\\/g,"/").replace(/\/$/,""),{windowsPathsNoEscape:c});for(let p of s)this.add(p)}add(s){let e=new As(s,this.mmopts);for(let t=0;t<e.set.length;t++){let i=e.set[t],n=e.globParts[t];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let r=new $x(i,n,0,this.platform),o=r.root()==="/"?`${this.slashRoot}/${r.rest()?.globString()??""}`:r.globString(),a=new As(o,this.mmopts),c=n[n.length-1]==="**",u=r.isAbsolute();u?this.absolute.push(a):this.relative.push(a),c&&(u?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(s){let e=s.fullpath(),t=`${e}/`,i=s.relative()||".",n=`${i}/`;for(let r of this.relative)if(r.match(i)||r.match(n))return!0;for(let r of this.absolute)if(r.match(e)||r.match(t))return!0;return!1}childrenIgnored(s){let e=`${s.fullpath()}/`,t=`${s.relative()||"."}/`;for(let i of this.relativeChildren)if(i.match(t))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}},pR=class zx{parent;store;constructor(e){this.parent=e}copy(){return new zx(this)}#e(e){let t=this.store?.get(e);return t||!this.parent?t:this.parent.#e(e)}hasWalked(e,t){return!!this.#e(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),n=this.#e(i);n?n.add(t.globString()):(this.store??=new Map).set(i,new Set([t.globString()]))}},Ux=class ip{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(e,t,i){let n=(t?ip.ABSOLUTE:0)|(i?ip.IF_DIR:0),r=this.store.get(e);this.store.set(e,r===void 0?n:n&r)}},hR=class{store=new Map;add(s,e){if(!s.canReaddir())return;let t=this.store.get(s);t?t.find(i=>i.globString()===e.globString())||t.push(e):this.store.set(s,[e])}get(s){let e=this.store.get(s);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(s=>[s,this.store.get(s)])}keys(){return[...this.store.keys()].filter(s=>s.canReaddir())}},sx=class Vx{hasWalkedCache;matches=new Ux;subwalks=new hR;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new pR}processPatterns(e,t){this.patterns=t;let i=t.map(n=>[e,n]);for(let[n,r]of i){this.hasWalkedCache.storeWalked(n,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){n=n.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=r.rest();if(d)r=d;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let c,u,l=!1;for(;typeof(c=r.pattern())=="string"&&(u=r.rest());)n=n.resolve(c),r=u,l=!0;if(c=r.pattern(),u=r.rest(),l){if(this.hasWalkedCache.hasWalked(n,r))continue;this.hasWalkedCache.storeWalked(n,r)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(n.resolve(c),a,d);continue}else if(c===U){(!n.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(n,r);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(n,a,d===""||d===".");else if(d===".."){let h=n.parent||n;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,a,!0)}}else typeof c=="object"&&this.subwalks.add(n,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Vx(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),n=this.child();for(let r of t)for(let o of i){let a=o.isAbsolute(),c=o.pattern(),u=o.rest();c===U?n.testGlobstar(r,o,u,a):typeof c=="object"?n.testMatcher(r,c,u,a):n.testString(r,c,u,a)}return n}testGlobstar(e,t,i,n){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let r=i.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,i.rest(),n);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,i)}else typeof r=="object"&&this.testMatcher(e,r,i.rest(),n)}}testMatcher(e,t,i,n){t.testUnchecked(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,t,i,n){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}},{ABSOLUTE:va,IF_DIR:Sa}=Ux,fR=(s,e,t)=>typeof s=="string"?new tx([s],e,t):Array.isArray(s)?new tx(s,e,t):s,Hx=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#i;#t;signal;maxDepth;includeChildMatches;constructor(s,e,t){if(this.patterns=s,this.path=e,this.opts=t,this.#t=!t.posix&&t.platform==="win32"?"\\":"/",this.includeChildMatches=t.includeChildMatches!==!1,(t.ignore||!this.includeChildMatches)&&(this.#i=fR(t.ignore??[],t,e),!this.includeChildMatches&&typeof this.#i.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=t.maxDepth||1/0,t.signal&&(this.signal=t.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#o(s){return this.seen.has(s)||!!this.#i?.ignored?.(s)}#r(s){return!!this.#i?.childrenIgnored?.(s)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let s;for(;!this.paused&&(s=this.#e.shift());)s()}onResume(s){this.paused?this.#e.push(s):s()}async matchCheck(s,e){if(e&&this.opts.nodir)return;let t,i;if(this.opts.realpath){if(t=s.realpathCached()||await s.realpath(),!t)return;i=t}else i=s;let n=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let r=await n.realpath();r&&(r.isUnknown()||this.opts.stat)&&await r.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(s,e){return s&&(this.maxDepth===1/0||s.depth()<=this.maxDepth)&&(!e||s.canReaddir())&&(!this.opts.nodir||!s.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!s.isSymbolicLink()||!s.realpathCached()?.isDirectory())&&!this.#o(s)?s:void 0}matchCheckSync(s,e){if(e&&this.opts.nodir)return;let t,i;if(this.opts.realpath){if(t=s.realpathCached()||s.realpathSync(),!t)return;i=t}else i=s;let n=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let r=n.realpathSync();r&&(r?.isUnknown()||this.opts.stat)&&r.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(s,e){this.#o(s)||this.#h(s,e)}#h(s,e){if(!this.includeChildMatches&&this.#i?.add){let n=`${s.relativePosix()}/**`;this.#i.add(n)}let t=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(s);let i=this.opts.mark&&s.isDirectory()?this.#t:"";if(this.opts.withFileTypes)this.matchEmit(s);else if(t){let n=this.opts.posix?s.fullpathPosix():s.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?s.relativePosix():s.relative(),r=this.opts.dotRelative&&!n.startsWith(`..${this.#t}`)?`.${this.#t}`:"";this.matchEmit(n?r+n+i:`.${i}`)}}async match(s,e,t){let i=await this.matchCheck(s,t);i&&this.matchFinish(i,e)}matchSync(s,e,t){let i=this.matchCheckSync(s,t);i&&this.#h(i,e)}walkCB(s,e,t){if(this.signal?.aborted)return t();this.walkCB2(s,e,new sx(this.opts),t)}walkCB2(s,e,t,i){if(this.#r(s)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2(s,e,t,i));return}t.processPatterns(s,e);let n=1,r=()=>{--n===0&&i()};for(let[o,a]of t.matches.store)this.#o(o)||(n++,this.match(o,!!(a&va),!!(a&Sa)).then(()=>r()));for(let o of t.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,t,r):o.readdirCB((c,u)=>this.walkCB3(o,u,t,r),!0)}r()}walkCB3(s,e,t,i){let n=t.filterEntries(s,e),r=1,o=()=>{--r===0&&i()};for(let[a,c]of n.matches.store)this.#o(a)||(r++,this.match(a,!!(c&va),!!(c&Sa)).then(()=>o()));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(s,e,t){if(this.signal?.aborted)return t();this.walkCB2Sync(s,e,new sx(this.opts),t)}walkCB2Sync(s,e,t,i){if(this.#r(s)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2Sync(s,e,t,i));return}t.processPatterns(s,e);let n=1,r=()=>{--n===0&&i()};for(let[o,a]of t.matches.store)this.#o(o)||this.matchSync(o,!!(a&va),!!(a&Sa));for(let o of t.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let a=o.readdirSync();this.walkCB3Sync(o,a,t,r)}r()}walkCB3Sync(s,e,t,i){let n=t.filterEntries(s,e),r=1,o=()=>{--r===0&&i()};for(let[a,c]of n.matches.store)this.#o(a)||this.matchSync(a,!!(c&va),!!(c&Sa));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2Sync(a,c,n.child(),o);o()}},ix=class extends Hx{matches=[];constructor(s,e,t){super(s,e,t)}matchEmit(s){this.matches.push(s)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):s(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}},nx=class extends Hx{results;constructor(s,e,t){super(s,e,t),this.results=new Ia({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(s){this.results.write(s),this.results.flowing||this.pause()}stream(){let s=this.path;return s.isUnknown()?s.lstat().then(()=>{this.walkCB(s,this.patterns,()=>this.results.end())}):this.walkCB(s,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}},mR=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Is=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(s,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=(0,wx.fileURLToPath)(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");let t=typeof s=="string"?[s]:s;if(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||mR,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"?cp:e.platform==="darwin"?Wx:e.platform?up:aR;this.scurry=new c(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},r=this.pattern.map(c=>new As(c,n)),[o,a]=r.reduce((c,u)=>(c[0].push(...u.set),c[1].push(...u.globParts),c),[[],[]]);this.patterns=o.map((c,u)=>{let l=a[u];if(!l)throw new Error("invalid pattern object");return new $x(c,l,0,this.platform)})}async walk(){return await new ix(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 ix(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 nx(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 nx(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()}},gR=(s,e={})=>{for(let t of Array.isArray(s)?s:[s])if(new As(t,e).hasMagic())return!0;return!1};function Pa(s,e={}){return new Is(s,e).streamSync()}function Gx(s,e={}){return new Is(s,e).stream()}function qa(s,e={}){return new Is(s,e).walkSync()}async function rx(s,e={}){return new Is(s,e).walk()}function Fa(s,e={}){return new Is(s,e).iterateSync()}function Kx(s,e={}){return new Is(s,e).iterate()}var bR=Pa,kR=Object.assign(Gx,{sync:Pa}),xR=Fa,_R=Object.assign(Kx,{sync:Fa}),wR=Object.assign(qa,{stream:Pa,iterate:Fa}),ox=Object.assign(rx,{glob:rx,globSync:qa,sync:wR,globStream:Gx,stream:kR,globStreamSync:Pa,streamSync:bR,globIterate:Kx,iterate:_R,globIterateSync:Fa,iterateSync:xR,Glob:Is,hasMagic:gR,escape:op,unescape:bx});ox.glob=ox;var Jx=F(require("vscode"));function Yx(s,e,t,i){let r=`Could not connect to ${i.url??i.host??"server"}: ${i.reason}. Check the hostname, VPN/network access, and API token.`;e.updateConnectionStatus(s,"disconnected"),t.appendLine(`[connection] ${r}`),Jx.window.showErrorMessage(`Beyond Work: ${r}`)}var V={},Ts,O,Ee,Hn,La,Ba,Ge,wi,Os,yi;async function Ma(s,e,t){if(console.log("onWorkblockChange",s,e?.state),!e)return;let i=Ee[s];if(!i)return;let n=await bi(i,yi);if(!n)return;let r=En(e),o=En(n);t.setSyncStatus(s,JSON.stringify(r)!==JSON.stringify(o))}function yR(s){let[e,t,i]=s.split("|").map(decodeURIComponent);if(!e||!t||!i)throw new Error(`Invalid branch binding key: ${s}`);return{host:e,workblockId:t,branch:i}}async function Un(s,e,t,i){let n=await e.listWorkblockDefinitions(),r=[];try{r=await e.listStudioWorkspaces(i)}catch(u){O.appendLine(`[workspaces] Failed to list Studio workspaces on ${s}: ${u?.message??u}`)}let o={},a=Ah(r);for(let u of n)o[u.id]=u.branches??[];let c=n.filter(u=>u.user_id===i||u.branch_user===i||(a[u.id]??[]).length>0?!0:Rh(o[u.id]??[],i).length>0);t.setWorkblocksForHost(s,c);for(let u of c){let l=u.user_id===i||u.branch_user===i,d=o[u.id]??[],p=Ih(d,a[u.id]??[],i,l);t.setBranchesForWorkblock(s,u.id,p,!1,!1)}t.refresh()}async function Xx(s,e,t,i){let n=Me(s,e,t),r=Ba[n];if(r)return{id:r};let o=V[s];if(!o)throw new Error(`Not connected to ${s}`);let a=await dc(o,{workblockId:e,branch:t,title:i,userId:Os[s]?.id,log:c=>O.appendLine(c)});return e_(s,n,a.streamId)}function e_(s,e,t){return Hn[t]=s,La[t]=e,Ba[e]=t,{id:t}}async function zn(s){return Xx(s.connection.host,s.workblock.id,s.branch.name,`${s.workblock.name} (${s.branch.name})`)}async function Wa(s,e,t){V[s]&&(V[s].disconnect(),delete V[s]);let i=await Dh(e,s);if(!i){let r=`Failed to retrieve token for ${s}.`;throw t.updateConnectionStatus(s,"disconnected"),O.appendLine(`[connection] ${r}`),N.window.showErrorMessage(`Beyond Work: ${r}`),new Error(r)}let n=new pr;n.addCurrentUserHandler(r=>{Os[s]=r,Un(s,n,t,r.id).then(()=>Qx(s,e,t)).catch(o=>{O.appendLine(`${o}`),N.window.showErrorMessage(`Beyond Work: ${o}`)})}),n.addStreamHandler(async r=>{t.updateConnectionStatus(s,"connected");for(let o of r)Hn[o.id]=s;try{let o=Os[s];if(!o)return;await Un(s,n,t,o.id),await Qx(s,e,t)}catch(o){O.appendLine(`${o}`),N.window.showErrorMessage(`Beyond Work: ${o}`)}}),n.addEventHandler(async r=>{for(let o of r){if(o.type==="workblock"){let a=o.stream_id,c=a?La[a]:void 0;if(!c&&o.work_block?.workblock_id&&o.work_block?.branch&&(c=Me(s,o.work_block.workblock_id,o.work_block.branch)),!c)continue;let u=o.work_block?.work_block;if(!u&&a&&o.work_block?.workblock_id&&o.work_block?.commit_ref)try{u=await n.getWorkblock(a)}catch(l){let d=l?.message??String(l);O.appendLine(`[events] Failed to resolve workblock for ${a}: ${d}`)}Ge[c]!==void 0&&u&&await Rn(Ge[c],u,n),await Ma(c,u,t),u&&(wi[c]=u)}if(o.type==="stream"){let a=o.stream?.stream;a?.id&&(Hn[a.id]=s);let c=Os[s];c&&await Un(s,n,t,c.id)}}}),n.addOnDisconnect(()=>{V[s]===n&&t.updateConnectionStatus(s,"disconnected")}),n.addErrorHandler(r=>{O.appendLine(`[ws] ${r}`),N.window.showErrorMessage(`Beyond Work: ${r}`)}),n.addConnectionErrorHandler(r=>{V[s]===n&&(Yx(s,t,O,r),r.statusCode===401&&Ph(e,s,i).then(o=>{if(o&&V[s]===n)return Wa(s,e,t)}).catch(o=>{O.appendLine(`[connection] ${String(o)}`)}))});try{t.updateConnectionStatus(s,"connecting"),n.connect(s,i,e),V[s]=n}catch(r){t.updateConnectionStatus(s,"disconnected");let o=r?.message??String(r);throw O.appendLine(`[connection] Failed to connect to ${s}: ${o}`),N.window.showErrorMessage(`Beyond Work: Failed to connect to ${s}: ${o}`),r}return e.globalState.update("bw_current_connection",s),n}function vR(s){Ts=N.languages.createDiagnosticCollection("validation"),O=N.window.createOutputChannel("Beyond Work"),yi=new ha(O),Ee=s.globalState.get("bw_streams_dir")??{},Ge=s.globalState.get("bw_sync_streams")??{},Hn={},La={},Ba={},wi={},Os={};let e=new kr(s,Ee,Ge),t=N.window.createTreeView("beyondworkConnections",{treeDataProvider:e,showCollapseAll:!1,canSelectMany:!0}),i=new dp,n=N.workspace.registerTextDocumentContentProvider("bw-manifest",i),r=async(k,S)=>{if(!["node_modules/",".git/"].some(C=>k.path.includes(C))){for(let[C,A]of Object.entries(Ee))if(C.includes("|")&&k.fsPath.startsWith(A))try{let{host:T,workblockId:L,branch:Y}=yR(C);if(Ge[C]!==void 0&&S){let G=await Xx(T,L,Y);await lp(A,T,G.id)&&e.setSyncStatus(C,!1)}else await Ma(C,wi[C],e)}catch(T){O.appendLine(`[sync] ${T?.message??T}`)}}},o=N.commands.registerCommand("beyondwork.beyondwork.addConnection",async()=>{let k=await N.window.showInputBox({prompt:"Enter the hostname you want to connect to",placeHolder:"Hostname (eg. acme.prod1-eu1.bworker.ai)",validateInput:S=>{try{new URL(`${S.startsWith("https://")?"":"https://"}${S}`);return}catch{return"Please enter a valid hostname"}}});k&&e.addConnection({host:k,status:"disconnected"})}),a=N.commands.registerCommand("beyondwork.beyondwork.connectToTenant",async k=>{k.status="connecting",e.updateConnectionStatus(k.host,"connecting"),await Wa(k.host,s,e)}),c=N.commands.registerCommand("beyondwork.beyondwork.clearConnections",()=>{qh(s),e.clear();for(let k in V)V[k].disconnect(),delete V[k];N.window.showInformationMessage("All connections cleared.")}),u=N.commands.registerCommand("beyondwork.beyondwork.removeConnection",async k=>{let S;if(k&&(S=k.connection),!S){let C=e.getConnections();if(C.length===0){N.window.showInformationMessage("No connections to remove.");return}S=(await N.window.showQuickPick(C.map(T=>({label:T.host,description:T.status,connection:T})),{placeHolder:"Select a connection to remove"}))?.connection}if(!S)return;await N.window.showWarningMessage(`Are you sure you want to remove the connection to ${S.host}?`,"Yes","No")==="Yes"&&(V[S.host]&&(V[S.host].disconnect(),delete V[S.host]),e.removeConnection(S))}),l=N.commands.registerCommand("beyondwork.beyondwork.storeWorkblock",async k=>{O.appendLine("Store workblock");let S={canSelectFolders:!0,canSelectFiles:!1,canSelectMany:!1,openLabel:"Select folder for the workblock"},v=await N.window.showOpenDialog(S);if(!v?.length)return;if(!await Cn(v[0].fsPath)){N.window.showErrorMessage("No manifest.yaml found in selected directory");return}let A=await bi(v[0].fsPath,yi);if(!A){N.window.showErrorMessage("Failed to assemble workblock from directory");return}let T=k?.connection?.host;if(!T)return;let L=V[T];if(!L){N.window.showErrorMessage(`Not connected to ${T}`);return}O.appendLine(`Storing workblock '${A.name}' on ${T}`);try{let{stream:Y,warnings:G}=await L.storeWorkblock(A);O.appendLine(`Stored workblock '${A.name}' using stream ${Y.id} (${Y.title})`),G.length>0&&(O.appendLine(`Validation warnings: ${JSON.stringify(G)}`),N.window.showWarningMessage(`Stored '${A.name}' with ${G.length} validation warning(s). See "Beyond Work" output for details.`)),Hn[Y.id]=T;let Ke=Y.branch??"main",Ds=Me(T,A.id,Ke);La[Y.id]=Ds,Ba[Ds]=Y.id,Ee[Ds]=v[0].fsPath,s.globalState.update("bw_streams_dir",Ee),wi[Ds]=A;let pp=Os[T];pp&&await Un(T,L,e,pp.id),N.window.showInformationMessage(`Stored and bound '${A.name}' on ${Ke}`)}catch(Y){let G=Y?.message??String(Y);O.appendLine(`Failed to store workblock: ${G}`),N.window.showErrorMessage(`Failed to store workblock: ${G}`)}}),d=N.commands.registerCommand("beyondwork.beyondwork.bindStream",async k=>{O.appendLine(`Binding ${k.workblock.name} ${k.branch.name} ${k.dir}`);let S={canSelectFolders:!0,canSelectFiles:!1,canSelectMany:!1,openLabel:"Select folder for the workblock"};k.dir&&(S.defaultUri=N.Uri.file(k.dir));let v=await N.window.showOpenDialog(S);if(v?.length){Ee[k.key]=v[0].fsPath,s.globalState.update("bw_streams_dir",Ee),e.refresh();try{let C=await zn(k),A=V[k.connection.host],T=await A.getWorkblock(C.id);T?(await Rn(v[0].fsPath,T,A),wi[k.key]=T,await Ma(k.key,T,e),O.appendLine(`Fetched ${k.workblock.name} (${k.branch.name}) into ${v[0].fsPath}`)):O.appendLine(`No remote workblock present for ${k.workblock.name} (${k.branch.name})`)}catch(C){O.appendLine(`Failed to fetch remote workblock for ${k.workblock.name}: ${C?.message??C}`)}}}),p=N.commands.registerCommand("beyondwork.beyondwork.get",async k=>{if(O.show(!0),O.appendLine(`Getting workblock workblockId=${k.workblock.id} branch=${k.branch.name} host=${k.connection.host}`),!k.dir){N.window.showErrorMessage("Please bind a directory to the branch first");return}let S=k.dir,v=V[k.connection.host];if(!v){N.window.showErrorMessage(`Not connected to ${k.connection.host}. Connect first, then retry.`);return}try{await N.window.withProgress({location:N.ProgressLocation.Notification,title:`Beyond Work: Getting ${k.workblock.name} (${k.branch.name})`,cancellable:!0},async(C,A)=>{let T,L=new Promise((Y,G)=>{T=A.onCancellationRequested(()=>G(new Error("Cancelled")))});try{let Y=await zn(k),G=await Promise.race([v.getWorkblock(Y.id),L]);if(O.appendLine(`Got workblock ${k.workblock.id} (${k.branch.name}): ${G?G.id:"none"}`),!G){N.window.showErrorMessage("No workblock in workspace");return}await Rn(S,G,v),wi[k.key]=G,await Ma(k.key,G,e)}finally{T?.dispose()}})}catch(C){let A=C?.message??String(C);O.appendLine(`Failed to get workblock ${k.workblock.id} (${k.branch.name}): ${A}`),N.window.showErrorMessage(`Failed to get workblock: ${A}`)}}),h=N.commands.registerCommand("beyondwork.beyondwork.set",async k=>{if(O.appendLine(`Setting workblock ${k.workblock.id} (${k.branch.name})`),!k.dir){N.window.showErrorMessage("Please bind a directory to the branch first");return}let S=await zn(k);await lp(k.dir,k.connection.host,S.id)&&e.setSyncStatus(k.key,!1)}),f=async k=>{let S=await bi(k.dir,yi),v=await zn(k),C=await V[k.connection.host].getWorkblock(v.id),A=N.Uri.parse("bw-manifest:local.yaml"),T=N.Uri.parse("bw-manifest:stored.yaml");S&&i.setContent(A,(0,Vn.stringify)(En(S))),C&&i.setContent(T,(0,Vn.stringify)(En(C))),N.commands.executeCommand("vscode.diff",A,T,"Local vs stored workblock")},m=async k=>{let S=k.connection.host,v=V[S];if(!v){N.window.showErrorMessage(`Not connected to ${S}`);return}let C=hr(k.branch.name);if(!C){N.window.showErrorMessage(`Beyond Work: ${k.branch.name} has no version branch to start a conversation on.`);return}try{let A=await Eh(v,k.workblock.id,C);A.branch&&e_(S,Me(S,k.workblock.id,A.branch),A.id),O.appendLine(`Created conversation ${A.id} on ${C}${A.branch?` (${A.branch})`:""}`);let T=Os[S];T&&await Un(S,v,e,T.id)}catch(A){let T=A?.message??String(A);O.appendLine(`Failed to create conversation on ${C}: ${T}`),N.window.showErrorMessage(`Beyond Work: Failed to create conversation: ${T}`)}},g=N.commands.registerCommand("beyondwork.beyondwork.showStreamOptions",async k=>{O.appendLine(`Branch options ${k.workblock.id} (${k.branch.name})`);let S=hc(k.dir),v=Th({branch:k.branch.name,dir:k.dir,syncEnabled:Ge[k.key]!==void 0,modified:k.modified});N.window.showQuickPick(v,{placeHolder:"Select an action"}).then(C=>{if(C)switch(C){case S:N.commands.executeCommand("beyondwork.beyondwork.bindStream",k);break;case ce.GetBranch:N.commands.executeCommand("beyondwork.beyondwork.get",k);break;case ce.StoreBranch:N.commands.executeCommand("beyondwork.beyondwork.set",k);break;case ce.EnableSync:Ge[k.key]=k.dir,s.globalState.update("bw_sync_streams",Ge),e.refresh();break;case ce.DisableSync:delete Ge[k.key],s.globalState.update("bw_sync_streams",Ge),e.refresh();break;case ce.NewConversation:m(k);break;case ce.CompareChanges:f(k);break;case ce.RemoveDirectoryBinding:delete Ee[k.key],delete Ge[k.key],s.globalState.update("bw_streams_dir",Ee),e.refresh();break}})}),b=N.commands.registerCommand("beyondwork.beyondwork.storeSelected",async()=>{let k=t.selection.filter(S=>S.contextValue==="beyondwork.branch");for(let S of k){let v=S;if(v.dir){let C=await zn(v);await lp(v.dir,v.connection.host,C.id)}}}),w=N.commands.registerCommand("beyondwork.beyondwork.help",async()=>{let k=N.window.createWebviewPanel("help","Beyond Work Help",N.ViewColumn.One,{enableCommandUris:!0}),S=new Yl({html:!0,linkify:!0,typographer:!0});k.webview.html=S.render(`# Beyond Work VSCode Extension
|
|
174
|
+
`,r.map=[e,s.line],!0}function xl(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4||n+3>r)return!1;let o=s.src.charCodeAt(n);if(o!==126&&o!==96)return!1;let a=n;n=s.skipChars(n,o);let c=n-a;if(c<3)return!1;let u=s.src.slice(a,n),l=s.src.slice(n,r);if(o===96&&l.indexOf(String.fromCharCode(o))>=0)return!1;if(i)return!0;let d=e,p=!1;for(;d++,!(d>=t||(n=a=s.bMarks[d]+s.tShift[d],r=s.eMarks[d],n<r&&s.sCount[d]<s.blkIndent));)if(s.src.charCodeAt(n)===o&&!(s.sCount[d]-s.blkIndent>=4)&&(n=s.skipChars(n,o),!(n-a<c)&&(n=s.skipSpaces(n),!(n<r)))){p=!0;break}c=s.sCount[e],s.line=d+(p?1:0);let h=s.push("fence","code",0);return h.info=l,h.content=s.getLines(e+1,d,c,!0),h.markup=u,h.map=[e,s.line],!0}function _l(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e],o=s.lineMax;if(s.sCount[e]-s.blkIndent>=4||s.src.charCodeAt(n)!==62)return!1;if(i)return!0;let a=[],c=[],u=[],l=[],d=s.md.block.ruler.getRules("blockquote"),p=s.parentType;s.parentType="blockquote";let h=!1,f;for(f=e;f<t;f++){let y=s.sCount[f]<s.blkIndent;if(n=s.bMarks[f]+s.tShift[f],r=s.eMarks[f],n>=r)break;if(s.src.charCodeAt(n++)===62&&!y){let _=s.sCount[f]+1,k,S;s.src.charCodeAt(n)===32?(n++,_++,S=!1,k=!0):s.src.charCodeAt(n)===9?(k=!0,(s.bsCount[f]+_)%4===3?(n++,_++,S=!1):S=!0):k=!1;let v=_;for(a.push(s.bMarks[f]),s.bMarks[f]=n;n<r;){let C=s.src.charCodeAt(n);if(D(C))C===9?v+=4-(v+s.bsCount[f]+(S?1:0))%4:v++;else break;n++}h=n>=r,c.push(s.bsCount[f]),s.bsCount[f]=s.sCount[f]+1+(k?1:0),u.push(s.sCount[f]),s.sCount[f]=v-_,l.push(s.tShift[f]),s.tShift[f]=n-s.bMarks[f];continue}if(h)break;let x=!1;for(let _=0,k=d.length;_<k;_++)if(d[_](s,f,t,!0)){x=!0;break}if(x){s.lineMax=f,s.blkIndent!==0&&(a.push(s.bMarks[f]),c.push(s.bsCount[f]),l.push(s.tShift[f]),u.push(s.sCount[f]),s.sCount[f]-=s.blkIndent);break}a.push(s.bMarks[f]),c.push(s.bsCount[f]),l.push(s.tShift[f]),u.push(s.sCount[f]),s.sCount[f]=-1}let m=s.blkIndent;s.blkIndent=0;let g=s.push("blockquote_open","blockquote",1);g.markup=">";let b=[e,0];g.map=b,s.md.block.tokenize(s,e,f);let w=s.push("blockquote_close","blockquote",-1);w.markup=">",s.lineMax=o,s.parentType=p,b[1]=s.line;for(let y=0;y<l.length;y++)s.bMarks[y+e]=a[y],s.tShift[y+e]=l[y],s.sCount[y+e]=u[y],s.bsCount[y+e]=c[y];return s.blkIndent=m,!0}function wl(s,e,t,i){let n=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4)return!1;let r=s.bMarks[e]+s.tShift[e],o=s.src.charCodeAt(r++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;r<n;){let u=s.src.charCodeAt(r++);if(u!==o&&!D(u))return!1;u===o&&a++}if(a<3)return!1;if(i)return!0;s.line=e+1;let c=s.push("hr","hr",0);return c.map=[e,s.line],c.markup=Array(a+1).join(String.fromCharCode(o)),!0}function sg(s,e){let t=s.eMarks[e],i=s.bMarks[e]+s.tShift[e],n=s.src.charCodeAt(i++);if(n!==42&&n!==45&&n!==43)return-1;if(i<t){let r=s.src.charCodeAt(i);if(!D(r))return-1}return i}function ig(s,e){let t=s.bMarks[e]+s.tShift[e],i=s.eMarks[e],n=t;if(n+1>=i)return-1;let r=s.src.charCodeAt(n++);if(r<48||r>57)return-1;for(;;){if(n>=i)return-1;if(r=s.src.charCodeAt(n++),r>=48&&r<=57){if(n-t>=10)return-1;continue}if(r===41||r===46)break;return-1}return n<i&&(r=s.src.charCodeAt(n),!D(r))?-1:n}function w3(s,e){let t=s.level+2;for(let i=e+2,n=s.tokens.length-2;i<n;i++)s.tokens[i].level===t&&s.tokens[i].type==="paragraph_open"&&(s.tokens[i+2].hidden=!0,s.tokens[i].hidden=!0,i+=2)}function yl(s,e,t,i){let n,r,o,a,c=e,u=!0;if(s.sCount[c]-s.blkIndent>=4||s.listIndent>=0&&s.sCount[c]-s.listIndent>=4&&s.sCount[c]<s.blkIndent)return!1;let l=!1;i&&s.parentType==="paragraph"&&s.sCount[c]>=s.blkIndent&&(l=!0);let d,p,h;if((h=ig(s,c))>=0){if(d=!0,o=s.bMarks[c]+s.tShift[c],p=Number(s.src.slice(o,h-1)),l&&p!==1)return!1}else if((h=sg(s,c))>=0)d=!1;else return!1;if(l&&s.skipSpaces(h)>=s.eMarks[c])return!1;if(i)return!0;let f=s.src.charCodeAt(h-1),m=s.tokens.length;d?(a=s.push("ordered_list_open","ol",1),p!==1&&(a.attrs=[["start",p]])):a=s.push("bullet_list_open","ul",1);let g=[c,0];a.map=g,a.markup=String.fromCharCode(f);let b=!1,w=s.md.block.ruler.getRules("list"),y=s.parentType;for(s.parentType="list";c<t;){r=h,n=s.eMarks[c];let x=s.sCount[c]+h-(s.bMarks[c]+s.tShift[c]),_=x;for(;r<n;){let Ke=s.src.charCodeAt(r);if(Ke===9)_+=4-(_+s.bsCount[c])%4;else if(Ke===32)_++;else break;r++}let k=r,S;k>=n?S=1:S=_-x,S>4&&(S=1);let v=x+S;a=s.push("list_item_open","li",1),a.markup=String.fromCharCode(f);let C=[c,0];a.map=C,d&&(a.info=s.src.slice(o,h-1));let A=s.tight,T=s.tShift[c],L=s.sCount[c],Y=s.listIndent;if(s.listIndent=s.blkIndent,s.blkIndent=v,s.tight=!0,s.tShift[c]=k-s.bMarks[c],s.sCount[c]=_,k>=n&&s.isEmpty(c+1)?s.line=Math.min(s.line+2,t):s.md.block.tokenize(s,c,t,!0),(!s.tight||b)&&(u=!1),b=s.line-c>1&&s.isEmpty(s.line-1),s.blkIndent=s.listIndent,s.listIndent=Y,s.tShift[c]=T,s.sCount[c]=L,s.tight=A,a=s.push("list_item_close","li",-1),a.markup=String.fromCharCode(f),c=s.line,C[1]=c,c>=t||s.sCount[c]<s.blkIndent||s.sCount[c]-s.blkIndent>=4)break;let G=!1;for(let Ke=0,Ds=w.length;Ke<Ds;Ke++)if(w[Ke](s,c,t,!0)){G=!0;break}if(G)break;if(d){if(h=ig(s,c),h<0)break;o=s.bMarks[c]+s.tShift[c]}else if(h=sg(s,c),h<0)break;if(f!==s.src.charCodeAt(h-1))break}return d?a=s.push("ordered_list_close","ol",-1):a=s.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(f),g[1]=c,s.line=c,s.parentType=y,u&&w3(s,m),!0}var vl=999;function y3(s){let e=s.length;for(let t=0;t<s.length-1;t++){let i=s.charCodeAt(t);if(i<55296||i>56319)continue;let n=s.charCodeAt(t+1);n>=56320&&n<=57343&&(e--,t++)}return e}function hn(s,e){return Math.min(s.eMarks[e]+1,s.src.length)}function Do(s,e){let t=s.lineMax;if(e>=t||s.isEmpty(e))return-1;let i=!1;if(s.sCount[e]-s.blkIndent>3&&(i=!0),s.sCount[e]<0&&(i=!0),!i){let n=s.md.block.ruler.getRules("reference"),r=s.parentType;s.parentType="reference";let o=!1;for(let a=0,c=n.length;a<c;a++)if(n[a](s,e,t,!0)){o=!0;break}if(s.parentType=r,o)return-1}return s.bMarks[e]+s.tShift[e]}function Sl(s,e,t,i){let n=s.src,r=s.bMarks[e]+s.tShift[e],o=e+1;if(s.sCount[e]-s.blkIndent>=4||n.charCodeAt(r)!==91)return!1;let a=hn(s,e),c="",u=-1,l=++r;for(;r<a;){if(c.length+r-l>vl*2)return!1;let x=n.charCodeAt(r);if(x===91)return!1;if(x===93){u=r;break}if(x===92&&(x=n.charCodeAt(++r)),x===10&&r<a){let _=Do(s,o);if(_<0)return!1;c+=n.slice(l,a),r=l=_,a=hn(s,o++);continue}r++}if(u<0||n.charCodeAt(u+1)!==58||(c+=n.slice(l,u),c.length>vl&&y3(c)>vl))return!1;for(r=u+2;r<a;){let x=n.charCodeAt(r);if(x===10){let _=Do(s,o);if(_<0)break;r=_,a=hn(s,o++)}else if(D(x))r++;else break}let d=s.md.helpers.parseLinkDestination(n,r,a);if(!d.ok)return!1;let p=s.md.normalizeLink(d.str);if(!s.md.validateLink(p))return!1;r=d.pos;let h=r,f=a,m=o;for(;r<a;){let x=n.charCodeAt(r);if(x===10){let _=Do(s,o);if(_<0)break;r=_,a=hn(s,o++)}else if(D(x))r++;else break}let g=r,b=s.md.helpers.parseLinkTitle(n,r,a);for(;b.can_continue;){let x=Do(s,o);if(x<0)break;r=x,a=hn(s,o++),b=s.md.helpers.parseLinkTitle(n,r,a,b)}let w;for(g!==h&&b.ok?(w=b.str,r=b.pos):(w="",r=h,a=f,o=m);r<a;){let x=n.charCodeAt(r);if(!D(x))break;r++}if(r<a&&n.charCodeAt(r)!==10&&w)for(w="",r=h,a=f,o=m;r<a;){let x=n.charCodeAt(r);if(!D(x))break;r++}if(r<a&&n.charCodeAt(r)!==10)return!1;let y=ds(c);return y?(i||(typeof s.env.references>"u"&&(s.env.references={}),typeof s.env.references[y]>"u"&&(s.env.references[y]={title:w,href:p}),s.line=o),!0):!1}var ng=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];var v3="[a-zA-Z_:][a-zA-Z0-9:._-]*",S3="[^\"'=<>`\\x00-\\x20]+",N3="'[^']*'",E3='"[^"]*"',C3="(?:"+S3+"|"+N3+"|"+E3+")",R3="(?:\\s+"+v3+"(?:\\s*=\\s*"+C3+")?)",rg="<[A-Za-z][A-Za-z0-9\\-]*"+R3+"*\\s*\\/?>",og="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",A3="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",I3="<[?][\\s\\S]*?[?]>",T3="<![A-Za-z][^>]*>",O3="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",p8=new RegExp("^(?:"+rg+"|"+og+"|"+A3+"|"+I3+"|"+T3+"|"+O3+")"),Po=new RegExp("^(?:"+rg+"|"+og+")");var fs=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+ng.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Po.source+"\\s*$"),/^$/,!1]];function Nl(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4||!s.md.options.html||s.src.charCodeAt(n)!==60)return!1;let o=s.src.slice(n,r),a=0;for(;a<fs.length&&!fs[a][0].test(o);a++);if(a===fs.length)return!1;if(i)return fs[a][2];let c=e+1,u=fs[a][1].test("");if(!fs[a][1].test(o)){for(;c<t&&!(s.sCount[c]<s.blkIndent&&(u||!s.isEmpty(c)));c++)if(n=s.bMarks[c]+s.tShift[c],r=s.eMarks[c],o=s.src.slice(n,r),fs[a][1].test(o)){o.length!==0&&c++;break}}s.line=c;let l=s.push("html_block","",0);return l.map=[e,c],l.content=s.getLines(e,c,s.blkIndent,!0),!0}function El(s,e,t,i){let n=s.bMarks[e]+s.tShift[e],r=s.eMarks[e];if(s.sCount[e]-s.blkIndent>=4)return!1;let o=s.src.charCodeAt(n);if(o!==35||n>=r)return!1;let a=1;for(o=s.src.charCodeAt(++n);o===35&&n<r&&a<=6;)a++,o=s.src.charCodeAt(++n);if(a>6||n<r&&!D(o))return!1;if(i)return!0;r=s.skipSpacesBack(r,n);let c=s.skipCharsBack(r,35,n);c>n&&D(s.src.charCodeAt(c-1))&&(r=c),s.line=e+1;let u=s.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,s.line];let l=s.push("inline","",0);l.content=ps(s.src.slice(n,r)),l.map=[e,s.line],l.children=[];let d=s.push("heading_close","h"+String(a),-1);return d.markup="########".slice(0,a),!0}function Cl(s,e,t){let i=s.md.block.ruler.getRules("paragraph");if(s.sCount[e]-s.blkIndent>=4)return!1;let n=s.parentType;s.parentType="paragraph";let r=0,o,a=e+1;for(;a<t&&!s.isEmpty(a);a++){if(s.sCount[a]-s.blkIndent>3)continue;if(s.sCount[a]>=s.blkIndent){let h=s.bMarks[a]+s.tShift[a],f=s.eMarks[a];if(h<f&&(o=s.src.charCodeAt(h),(o===45||o===61)&&(h=s.skipChars(h,o),h=s.skipSpaces(h),h>=f))){r=o===61?1:2;break}}if(s.sCount[a]<0)continue;let p=!1;for(let h=0,f=i.length;h<f;h++)if(i[h](s,a,t,!0)){p=!0;break}if(p)break}if(!r)return s.parentType=n,!1;let c=ps(s.getLines(e,a,s.blkIndent,!1));s.line=a+1;let u=s.push("heading_open","h"+String(r),1);u.markup=String.fromCharCode(o),u.map=[e,s.line];let l=s.push("inline","",0);l.content=c,l.map=[e,s.line-1],l.children=[];let d=s.push("heading_close","h"+String(r),-1);return d.markup=String.fromCharCode(o),s.parentType=n,!0}function Rl(s,e,t){let i=s.md.block.ruler.getRules("paragraph"),n=s.parentType,r=e+1;for(s.parentType="paragraph";r<t&&!s.isEmpty(r);r++){if(s.sCount[r]-s.blkIndent>3||s.sCount[r]<0)continue;let u=!1;for(let l=0,d=i.length;l<d;l++)if(i[l](s,r,t,!0)){u=!0;break}if(u)break}let o=ps(s.getLines(e,r,s.blkIndent,!1));s.line=r;let a=s.push("paragraph_open","p",1);a.map=[e,s.line];let c=s.push("inline","",0);return c.content=o,c.map=[e,s.line],c.children=[],s.push("paragraph_close","p",-1),s.parentType=n,!0}var qo=[["table",bl,["paragraph","reference"]],["code",kl],["fence",xl,["paragraph","reference","blockquote","list"]],["blockquote",_l,["paragraph","reference","blockquote","list"]],["hr",wl,["paragraph","reference","blockquote","list"]],["list",yl,["paragraph","reference","blockquote"]],["reference",Sl],["html_block",Nl,["paragraph","reference","blockquote"]],["heading",El,["paragraph","reference","blockquote"]],["lheading",Cl],["paragraph",Rl]];function Fo(){this.ruler=new hs;for(let s=0;s<qo.length;s++)this.ruler.push(qo[s][0],qo[s][1],{alt:(qo[s][2]||[]).slice()})}Fo.prototype.tokenize=function(s,e,t){let i=this.ruler.getRules(""),n=i.length,r=s.md.options.maxNesting,o=e,a=!1;for(;o<t&&(s.line=o=s.skipEmptyLines(o),!(o>=t||s.sCount[o]<s.blkIndent));){if(s.level>=r){s.line=t;break}let c=s.line,u=!1;for(let l=0;l<n;l++)if(u=i[l](s,o,t,!1),u){if(c>=s.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");s.tight=!a,s.isEmpty(s.line-1)&&(a=!0),o=s.line,o<t&&s.isEmpty(o)&&(a=!0,o++,s.line=o)}};Fo.prototype.parse=function(s,e,t,i){if(!s)return;let n=new this.State(s,e,t,i);this.tokenize(n,n.line,n.lineMax)};Fo.prototype.State=eg;var ag=Fo;function fn(s,e,t,i){this.src=s,this.env=t,this.md=e,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.skipHtmlSpecial=!1,this.linkLevel=0}fn.prototype.pushPending=function(){let s=new mt("text","",0);return s.content=this.pending,s.level=this.pendingLevel,this.tokens.push(s),this.pending="",s};fn.prototype.push=function(s,e,t){this.pending&&this.pushPending();let i=new mt(s,e,t),n=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(n),i};fn.prototype.scanDelims=function(s,e){let t=this.posMax,i=this.src.charCodeAt(s),n;if(s===0)n=32;else if(s===1)n=this.src.charCodeAt(0),(n&63488)===55296&&(n=65533);else if(n=this.src.charCodeAt(s-1),(n&64512)===56320){let g=this.src.charCodeAt(s-2);n=(g&64512)===55296?65536+(g-55296<<10)+(n-56320):65533}else(n&64512)===55296&&(n=65533);let r=s;for(;r<t&&this.src.charCodeAt(r)===i;)r++;let o=r-s,a=r<t?this.src.charCodeAt(r):32;if((a&64512)===55296){let g=this.src.charCodeAt(r+1);a=(g&64512)===56320?65536+(a-55296<<10)+(g-56320):65533}else(a&64512)===56320&&(a=65533);let c=ls(n)||us(n),u=ls(a)||us(a),l=cs(n),d=cs(a),p=!d&&(!u||l||c),h=!l&&(!c||d||u);return{can_open:p&&(e||!h||c),can_close:h&&(e||!p||u),length:o}};fn.prototype.Token=mt;var cg=fn;function D3(s){switch(s){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Al(s,e){let t=s.pos;for(;t<s.posMax&&!D3(s.src.charCodeAt(t));)t++;return t===s.pos?!1:(e||(s.pending+=s.src.slice(s.pos,t)),s.pos=t,!0)}function P3(s){return s>=65&&s<=90||s>=97&&s<=122}function q3(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===45||s===46}function Il(s,e){if(!s.md.options.linkify||s.linkLevel>0)return!1;let t=s.pos,i=s.posMax;if(t+3>i||s.src.charCodeAt(t)!==58||s.src.charCodeAt(t+1)!==47||s.src.charCodeAt(t+2)!==47)return!1;let n=t-Math.min(10,s.pending.length,t),r=t;for(;r>n&&q3(s.src.charCodeAt(r-1));)r--;if(r===t||!P3(s.src.charCodeAt(r)))return!1;let o=t-r,a=s.md.linkify.matchAtStart(s.src.slice(r));if(!a)return!1;let c=a.url;if(c.length<=o)return!1;let u=c.length;for(;u>0&&c.charCodeAt(u-1)===42;)u--;u!==c.length&&(c=c.slice(0,u));let l=s.md.normalizeLink(c);if(!s.md.validateLink(l))return!1;if(!e){s.pending=s.pending.slice(0,-o);let d=s.push("link_open","a",1);d.attrs=[["href",l]],d.markup="linkify",d.info="auto";let p=s.push("text","",0);p.content=s.md.normalizeLinkText(c);let h=s.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return s.pos+=c.length-o,!0}function Tl(s,e){let t=s.pos;if(s.src.charCodeAt(t)!==10)return!1;let i=s.pending.length-1,n=s.posMax;if(!e)if(i>=0&&s.pending.charCodeAt(i)===32)if(i>=1&&s.pending.charCodeAt(i-1)===32){let r=i-1;for(;r>=1&&s.pending.charCodeAt(r-1)===32;)r--;s.pending=s.pending.slice(0,r),s.push("hardbreak","br",0)}else s.pending=s.pending.slice(0,-1),s.push("softbreak","br",0);else s.push("softbreak","br",0);for(t++;t<n&&D(s.src.charCodeAt(t));)t++;return s.pos=t,!0}var Ol=[];for(let s=0;s<256;s++)Ol.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(s){Ol[s.charCodeAt(0)]=1});function Dl(s,e){let t=s.pos,i=s.posMax;if(s.src.charCodeAt(t)!==92||(t++,t>=i))return!1;let n=s.src.charCodeAt(t);if(n===10){for(e||s.push("hardbreak","br",0),t++;t<i&&(n=s.src.charCodeAt(t),!!D(n));)t++;return s.pos=t,!0}if(n===32){if(!e){let a=s.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return s.pos=t,!0}let r=s.src[t];if(n>=55296&&n<=56319&&t+1<i){let a=s.src.charCodeAt(t+1);a>=56320&&a<=57343&&(r+=s.src[t+1],t++)}let o="\\"+r;if(!e){let a=s.push("text_special","",0);n<256&&Ol[n]!==0?a.content=r:a.content=o,a.markup=o,a.info="escape"}return s.pos=t+1,!0}function Pl(s,e){let t=s.pos;if(s.src.charCodeAt(t)!==96)return!1;let n=t;t++;let r=s.posMax;for(;t<r&&s.src.charCodeAt(t)===96;)t++;let o=s.src.slice(n,t),a=o.length;if(s.backticksScanned&&(s.backticks[a]||0)<=n)return e||(s.pending+=o),s.pos+=a,!0;let c=t,u;for(;(u=s.src.indexOf("`",c))!==-1;){for(c=u+1;c<r&&s.src.charCodeAt(c)===96;)c++;let l=c-u;if(l===a){if(!e){let d=s.push("code_inline","code",0);d.markup=o,d.content=s.src.slice(t,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return s.pos=c,!0}s.backticks[l]=u}return s.backticksScanned=!0,e||(s.pending+=o),s.pos+=a,!0}function F3(s,e){let t=s.pos,i=s.src.charCodeAt(t);if(e||i!==126)return!1;let n=s.scanDelims(s.pos,!0),r=n.length,o=String.fromCharCode(i);if(r<2)return!1;let a;r%2&&(a=s.push("text","",0),a.content=o,r--);for(let c=0;c<r;c+=2)a=s.push("text","",0),a.content=o+o,s.delimiters.push({marker:i,length:0,token:s.tokens.length-1,end:-1,open:n.can_open,close:n.can_close});return s.pos+=n.length,!0}function ug(s,e){let t,i=[],n=e.length;for(let r=0;r<n;r++){let o=e[r];if(o.marker!==126||o.end===-1)continue;let a=e[o.end];t=s.tokens[o.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=s.tokens[a.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",s.tokens[a.token-1].type==="text"&&s.tokens[a.token-1].content==="~"&&i.push(a.token-1)}for(;i.length;){let r=i.pop(),o=r+1;for(;o<s.tokens.length&&s.tokens[o].type==="s_close";)o++;o--,r!==o&&(t=s.tokens[o],s.tokens[o]=s.tokens[r],s.tokens[r]=t)}}function M3(s){let e=s.tokens_meta,t=s.tokens_meta.length;ug(s,s.delimiters);for(let i=0;i<t;i++)e[i]&&e[i].delimiters&&ug(s,e[i].delimiters)}var ql={tokenize:F3,postProcess:M3};function L3(s,e){let t=s.pos,i=s.src.charCodeAt(t);if(e||i!==95&&i!==42)return!1;let n=s.scanDelims(s.pos,i===42);for(let r=0;r<n.length;r++){let o=s.push("text","",0);o.content=String.fromCharCode(i),s.delimiters.push({marker:i,length:n.length,token:s.tokens.length-1,end:-1,open:n.can_open,close:n.can_close})}return s.pos+=n.length,!0}function lg(s,e){let t=e.length;for(let i=t-1;i>=0;i--){let n=e[i];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let r=e[n.end],o=i>0&&e[i-1].end===n.end+1&&e[i-1].marker===n.marker&&e[i-1].token===n.token-1&&e[n.end+1].token===r.token+1,a=String.fromCharCode(n.marker),c=s.tokens[n.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?a+a:a,c.content="";let u=s.tokens[r.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?a+a:a,u.content="",o&&(s.tokens[e[i-1].token].content="",s.tokens[e[n.end+1].token].content="",i--)}}function B3(s){let e=s.tokens_meta,t=s.tokens_meta.length;lg(s,s.delimiters);for(let i=0;i<t;i++)e[i]&&e[i].delimiters&&lg(s,e[i].delimiters)}var Fl={tokenize:L3,postProcess:B3};function Ml(s,e){let t,i,n,r,o="",a="",c=s.pos,u=!0;if(s.src.charCodeAt(s.pos)!==91)return!1;let l=s.pos,d=s.posMax,p=s.pos+1,h=s.md.helpers.parseLinkLabel(s,s.pos,!0);if(h<0)return!1;let f=h+1;if(f<d&&s.src.charCodeAt(f)===40){for(u=!1,f++;f<d&&(t=s.src.charCodeAt(f),!(!D(t)&&t!==10));f++);if(f>=d)return!1;if(c=f,n=s.md.helpers.parseLinkDestination(s.src,f,s.posMax),n.ok){for(o=s.md.normalizeLink(n.str),s.md.validateLink(o)?f=n.pos:o="",c=f;f<d&&(t=s.src.charCodeAt(f),!(!D(t)&&t!==10));f++);if(n=s.md.helpers.parseLinkTitle(s.src,f,s.posMax),f<d&&c!==f&&n.ok)for(a=n.str,f=n.pos;f<d&&(t=s.src.charCodeAt(f),!(!D(t)&&t!==10));f++);}(f>=d||s.src.charCodeAt(f)!==41)&&(u=!0),f++}if(u){if(typeof s.env.references>"u")return!1;if(f<d&&s.src.charCodeAt(f)===91?(c=f+1,f=s.md.helpers.parseLinkLabel(s,f),f>=0?i=s.src.slice(c,f++):f=h+1):f=h+1,i||(i=s.src.slice(p,h)),r=s.env.references[ds(i)],!r)return s.pos=l,!1;o=r.href,a=r.title}if(!e){s.pos=p,s.posMax=h;let m=s.push("link_open","a",1),g=[["href",o]];m.attrs=g,a&&g.push(["title",a]),s.linkLevel++,s.md.inline.tokenize(s),s.linkLevel--,s.push("link_close","a",-1)}return s.pos=f,s.posMax=d,!0}function Ll(s,e){let t,i,n,r,o,a,c,u,l="",d=s.pos,p=s.posMax;if(s.src.charCodeAt(s.pos)!==33||s.src.charCodeAt(s.pos+1)!==91)return!1;let h=s.pos+2,f=s.md.helpers.parseLinkLabel(s,s.pos+1,!1);if(f<0)return!1;if(r=f+1,r<p&&s.src.charCodeAt(r)===40){for(r++;r<p&&(t=s.src.charCodeAt(r),!(!D(t)&&t!==10));r++);if(r>=p)return!1;for(u=r,a=s.md.helpers.parseLinkDestination(s.src,r,s.posMax),a.ok&&(l=s.md.normalizeLink(a.str),s.md.validateLink(l)?r=a.pos:l=""),u=r;r<p&&(t=s.src.charCodeAt(r),!(!D(t)&&t!==10));r++);if(a=s.md.helpers.parseLinkTitle(s.src,r,s.posMax),r<p&&u!==r&&a.ok)for(c=a.str,r=a.pos;r<p&&(t=s.src.charCodeAt(r),!(!D(t)&&t!==10));r++);else c="";if(r>=p||s.src.charCodeAt(r)!==41)return s.pos=d,!1;r++}else{if(typeof s.env.references>"u")return!1;if(r<p&&s.src.charCodeAt(r)===91?(u=r+1,r=s.md.helpers.parseLinkLabel(s,r),r>=0?n=s.src.slice(u,r++):r=f+1):r=f+1,n||(n=s.src.slice(h,f)),o=s.env.references[ds(n)],!o)return s.pos=d,!1;l=o.href,c=o.title}if(!e){i=s.src.slice(h,f);let m=[];s.md.inline.parse(i,s.md,s.env,m);let g=s.push("image","img",0),b=[["src",l],["alt",""]];g.attrs=b,g.children=m,g.content=i,c&&b.push(["title",c])}return s.pos=r,s.posMax=p,!0}var W3=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,$3=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Bl(s,e){let t=s.pos;if(s.src.charCodeAt(t)!==60)return!1;let i=s.pos,n=s.posMax;for(;;){if(++t>=n)return!1;let o=s.src.charCodeAt(t);if(o===60)return!1;if(o===62)break}let r=s.src.slice(i+1,t);if($3.test(r)){let o=s.md.normalizeLink(r);if(!s.md.validateLink(o))return!1;if(!e){let a=s.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";let c=s.push("text","",0);c.content=s.md.normalizeLinkText(r);let u=s.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return s.pos+=r.length+2,!0}if(W3.test(r)){let o=s.md.normalizeLink("mailto:"+r);if(!s.md.validateLink(o))return!1;if(!e){let a=s.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";let c=s.push("text","",0);c.content=s.md.normalizeLinkText(r);let u=s.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return s.pos+=r.length+2,!0}return!1}function j3(s){return/^<a[>\s]/i.test(s)}function z3(s){return/^<\/a\s*>/i.test(s)}function dg(s){let e=s|32;return e>=97&&e<=122}function U3(s,e){let t=s.src,i,n;if(t.startsWith("<!--",e)){if(t.startsWith(">",e+4))return e+5;if(t.startsWith("->",e+4))return e+6;i=e+4,n="-->"}else if(t.startsWith("<![CDATA[",e))i=e+9,n="]]>";else if(t.charCodeAt(e+1)===63)i=e+2,n="?>";else if(dg(t.charCodeAt(e+2)))i=e+3,n=">";else return-1;if(s.skipHtmlSpecial)return-1;let r=t.indexOf(n,i);return r<0?(s.skipHtmlSpecial=!0,-1):r+n.length}function Wl(s,e){if(!s.md.options.html)return!1;let t=s.posMax,i=s.pos;if(s.src.charCodeAt(i)!==60||i+2>=t)return!1;let n,r=s.src.charCodeAt(i+1);if(r===33||r===63)n=U3(s,i);else if(r===47||dg(r)){let o=s.src.slice(i).match(Po);n=o?i+o[0].length:-1}else return!1;if(n<0)return!1;if(!e){let o=s.push("html_inline","",0);o.content=s.src.slice(i,n),j3(o.content)&&s.linkLevel++,z3(o.content)&&s.linkLevel--}return s.pos=n,!0}var V3=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,H3=/^&([a-z][a-z0-9]{1,31});/i;function $l(s,e){let t=s.pos,i=s.posMax;if(s.src.charCodeAt(t)!==38||t+1>=i)return!1;if(s.src.charCodeAt(t+1)===35){let r=s.src.slice(t).match(V3);if(r){if(!e){let o=r[1][0].toLowerCase()==="x"?parseInt(r[1].slice(1),16):parseInt(r[1],10),a=s.push("text_special","",0);a.content=To(o)?ri(o):ri(65533),a.markup=r[0],a.info="entity"}return s.pos+=r[0].length,!0}}else{let r=s.src.slice(t).match(H3);if(r){let o=pn(r[0]);if(o!==r[0]){if(!e){let a=s.push("text_special","",0);a.content=o,a.markup=r[0],a.info="entity"}return s.pos+=r[0].length,!0}}}return!1}function pg(s){let e={},t=s.length;if(!t)return;let i=0,n=-2,r=[];for(let o=0;o<t;o++){let a=s[o];if(r.push(0),(s[i].marker!==a.marker||n!==a.token-1)&&(i=o),n=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);let c=e[a.marker][(a.open?3:0)+a.length%3],u=i-r[i]-1,l=u;for(;u>c;u-=r[u]+1){let d=s[u];if(d.marker===a.marker&&d.open&&d.end<0){let p=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(p=!0),!p){let h=u>0&&!s[u-1].open?r[u-1]+1:0;r[o]=o-u+h,r[u]=h,a.open=!1,d.end=o,d.close=!1,l=-1,n=-2;break}}}l!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=l)}}function jl(s){let e=s.tokens_meta,t=s.tokens_meta.length;pg(s.delimiters);for(let i=0;i<t;i++)e[i]&&e[i].delimiters&&pg(e[i].delimiters)}function zl(s){let e,t,i=0,n=s.tokens,r=s.tokens.length;for(e=t=0;e<r;e++)n[e].nesting<0&&i--,n[e].level=i,n[e].nesting>0&&i++,n[e].type==="text"&&e+1<r&&n[e+1].type==="text"?n[e+1].content=n[e].content+n[e+1].content:(e!==t&&(n[t]=n[e]),t++);e!==t&&(n.length=t)}var Ul=[["text",Al],["linkify",Il],["newline",Tl],["escape",Dl],["backticks",Pl],["strikethrough",ql.tokenize],["emphasis",Fl.tokenize],["link",Ml],["image",Ll],["autolink",Bl],["html_inline",Wl],["entity",$l]],Vl=[["balance_pairs",jl],["strikethrough",ql.postProcess],["emphasis",Fl.postProcess],["fragments_join",zl]];function mn(){this.ruler=new hs;for(let s=0;s<Ul.length;s++)this.ruler.push(Ul[s][0],Ul[s][1]);this.ruler2=new hs;for(let s=0;s<Vl.length;s++)this.ruler2.push(Vl[s][0],Vl[s][1])}mn.prototype.skipToken=function(s){let e=s.pos,t=this.ruler.getRules(""),i=t.length,n=s.md.options.maxNesting,r=s.cache;if(typeof r[e]<"u"){s.pos=r[e];return}let o=!1;if(s.level<n){for(let a=0;a<i;a++)if(s.level++,o=t[a](s,!0),s.level--,o){if(e>=s.pos)throw new Error("inline rule didn't increment state.pos");break}}else s.pos=s.posMax;o||s.pos++,r[e]=s.pos};mn.prototype.tokenize=function(s){let e=this.ruler.getRules(""),t=e.length,i=s.posMax,n=s.md.options.maxNesting;for(;s.pos<i;){let r=s.pos,o=!1;if(s.level<n){for(let a=0;a<t;a++)if(o=e[a](s,!1),o){if(r>=s.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(s.pos>=i)break;continue}s.pending+=s.src[s.pos++]}s.pending&&s.pushPending()};mn.prototype.parse=function(s,e,t,i){let n=new this.State(s,e,t,i);this.tokenize(n);let r=this.ruler2.getRules(""),o=r.length;for(let a=0;a<o;a++)r[a](n)};mn.prototype.State=cg;var hg=mn;function fg(s){let e={};s=s||{},e.src_Any=So.source,e.src_Cc=No.source,e.src_Z=Co.source,e.src_P=si.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");let t="[><\uFF5C]";return e.src_pseudo_letter=`(?:(?!${t}|${e.src_ZPCc})${e.src_Any})`,e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth=`(?:(?:(?!${e.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator=`(?=$|${t}|${e.src_ZPCc})(?!${s["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${e.src_ZPCc}))`,e.src_path=`(?:[/?#](?:(?!${e.src_ZCc}|${t}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${e.src_ZCc}|\\]).)*\\]|\\((?:(?!${e.src_ZCc}|[)]).)*\\)|\\{(?:(?!${e.src_ZCc}|[}]).)*\\}|\\"(?:(?!${e.src_ZCc}|["]).)+\\"|\\'(?:(?!${e.src_ZCc}|[']).)+\\'|\\'(?=${e.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${e.src_ZCc}|[.]|$)|`+(s["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${e.src_ZCc}|$)|;(?!${e.src_ZCc}|$)|\\!+(?!${e.src_ZCc}|[!]|$)|\\?(?!${e.src_ZCc}|[?]|$))+|\\/)?`,e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+`|${e.src_pseudo_letter}{1,63})`,e.src_domain="(?:"+e.src_xn+`|(?:${e.src_pseudo_letter})|(?:${e.src_pseudo_letter}(?:-|${e.src_pseudo_letter}){0,61}${e.src_pseudo_letter}))`,e.src_host=`(?:(?:(?:(?:${e.src_domain})\\.)*${e.src_domain}))`,e.tpl_host_fuzzy="(?:"+e.src_ip4+`|(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%)))`,e.tpl_host_no_ip_fuzzy=`(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%))`,e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${e.src_ZPCc}|>|$))`,e.tpl_email_fuzzy=`(^|${t}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}function Hl(s){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(i){s[i]=t[i]})}),s}function Lo(s){return Object.prototype.toString.call(s)}function G3(s){return Lo(s)==="[object String]"}function K3(s){return Lo(s)==="[object Object]"}function J3(s){return Lo(s)==="[object RegExp]"}function mg(s){return Lo(s)==="[object Function]"}function Y3(s){return s.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var bg={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Z3(s){return Object.keys(s||{}).reduce(function(e,t){return e||bg.hasOwnProperty(t)},!1)}var Q3={"http:":{validate:function(s,e,t){let i=s.slice(e);return t.re.http||(t.re.http=new RegExp(`^\\/\\/${t.re.src_auth}${t.re.src_host_port_strict}${t.re.src_path}`,"i")),t.re.http.test(i)?i.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(s,e,t){let i=s.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+`(?:localhost|(?:(?:${t.re.src_domain})\\.)+${t.re.src_domain_root})`+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(i)?e>=3&&s[e-3]===":"||e>=3&&s[e-3]==="/"?0:i.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(s,e,t){let i=s.slice(e);return t.re.mailto||(t.re.mailto=new RegExp(`^${t.re.src_email_name}@${t.re.src_host_strict}`,"i")),t.re.mailto.test(i)?i.match(t.re.mailto)[0].length:0}}},X3="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",eN="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function tN(s){return function(e,t){let i=e.slice(t);return s.test(i)?i.match(s)[0].length:0}}function gg(){return function(s,e){e.normalize(s)}}function Mo(s){let e=s.re=fg(s.__opts__),t=s.__tlds__.slice();s.onCompile(),s.__tlds_replaced__||t.push(X3),t.push(e.src_xn),e.src_tlds=t.join("|");function i(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(i(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(i(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(i(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(i(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(i(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(i(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(i(e.tpl_host_fuzzy_test),"i");let n=[];s.__compiled__={};function r(a,c){throw new Error(`(LinkifyIt) Invalid schema "${a}": ${c}`)}Object.keys(s.__schemas__).forEach(function(a){let c=s.__schemas__[a];if(c===null)return;let u={validate:null,link:null};if(s.__compiled__[a]=u,K3(c)){J3(c.validate)?u.validate=tN(c.validate):mg(c.validate)?u.validate=c.validate:r(a,c),mg(c.normalize)?u.normalize=c.normalize:c.normalize?r(a,c):u.normalize=gg();return}if(G3(c)){n.push(a);return}r(a,c)}),n.forEach(function(a){s.__compiled__[s.__schemas__[a]]&&(s.__compiled__[a].validate=s.__compiled__[s.__schemas__[a]].validate,s.__compiled__[a].normalize=s.__compiled__[s.__schemas__[a]].normalize)}),s.__compiled__[""]={validate:null,normalize:gg()};let o=Object.keys(s.__compiled__).filter(function(a){return a.length>0&&s.__compiled__[a]}).map(Y3).join("|");s.re.schema_test=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${o})`,"i"),s.re.schema_search=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${o})`,"ig"),s.re.schema_at_start=RegExp(`^${s.re.schema_search.source}`,"i"),s.re.pretest=RegExp(`(${s.re.schema_test.source})|(${s.re.host_fuzzy_test.source})|@`,"i")}function kg(s,e,t,i){let n=s.slice(t,i);this.schema=e.toLowerCase(),this.index=t,this.lastIndex=i,this.raw=n,this.text=n,this.url=n}function ye(s,e){if(!(this instanceof ye))return new ye(s,e);e||Z3(s)&&(e=s,s={}),this.__opts__=Hl({},bg,e),this.__schemas__=Hl({},Q3,s),this.__compiled__={},this.__tlds__=eN,this.__tlds_replaced__=!1,this.re={},Mo(this)}ye.prototype.add=function(e,t){return this.__schemas__[e]=t,Mo(this),this};ye.prototype.set=function(e){return this.__opts__=Hl(this.__opts__,e),this};ye.prototype.test=function(e){if(!e.length)return!1;let t,i;if(this.re.schema_test.test(e)){for(i=this.re.schema_search,i.lastIndex=0;(t=i.exec(e))!==null;)if(this.testSchemaAt(e,t[2],i.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)};ye.prototype.pretest=function(e){return this.re.pretest.test(e)};ye.prototype.testSchemaAt=function(e,t,i){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,i,this):0};ye.prototype.match=function(e){let t=[],i=[],n=[],r=[],o,a,c;function u(p,h){return p?h?p.index!==h.index?p.index<h.index?p:h:p.lastIndex>=h.lastIndex?p:h:p:h}if(!e.length)return null;if(this.re.schema_test.test(e))for(c=this.re.schema_search,c.lastIndex=0;(o=c.exec(e))!==null;)a=this.testSchemaAt(e,o[2],c.lastIndex),a&&i.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(o=c.exec(e))!==null;)n.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(o=c.exec(e))!==null;)r.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});let l=[0,0,0],d=0;for(;;){let p=[i[l[0]],r[l[1]],n[l[2]]],h=u(u(p[0],p[1]),p[2]);if(!h)break;if(h===p[0]?l[0]++:h===p[1]?l[1]++:l[2]++,h.index<d)continue;let f=new kg(e,h.schema,h.index,h.lastIndex);this.__compiled__[f.schema].normalize(f,this),t.push(f),d=h.lastIndex}return t.length?t:null};ye.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let i=this.testSchemaAt(e,t[2],t[0].length);if(!i)return null;let n=new kg(e,t[2],t.index+t[1].length,t.index+t[0].length+i);return this.__compiled__[n.schema].normalize(n,this),n};ye.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(i,n,r){return i!==r[n-1]}).reverse(),Mo(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Mo(this),this)};ye.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)};ye.prototype.onCompile=function(){};var xg=ye;var Jl=F(Cg(),1);var Rg={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}};var Ag={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}};var Ig={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}};var pN={default:Rg,zero:Ag,commonmark:Ig},hN=/^(vbscript|javascript|file|data):/,fN=/^data:image\/(gif|png|jpeg|webp);/;function mN(s){let e=s.trim().toLowerCase();return hN.test(e)?fN.test(e):!0}var Tg=["http:","https:","mailto:"];function gN(s){let e=dn(s,!0);if(e.hostname&&(!e.protocol||Tg.indexOf(e.protocol)>=0))try{e.hostname=Jl.default.toASCII(e.hostname)}catch{}return wo(ti(e))}function bN(s){let e=dn(s,!0);if(e.hostname&&(!e.protocol||Tg.indexOf(e.protocol)>=0))try{e.hostname=Jl.default.toUnicode(e.hostname)}catch{}return ln(ti(e),ln.defaultChars+"%")}function Te(s,e){if(!(this instanceof Te))return new Te(s,e);e||Io(s)||(e=s||{},s="default"),this.inline=new hg,this.block=new ag,this.core=new X0,this.renderer=new H0,this.linkify=new xg,this.validateLink=mN,this.normalizeLink=gN,this.normalizeLinkText=bN,this.utils=sl,this.helpers=ni({},ol),this.options={},this.configure(s),e&&this.set(e)}Te.prototype.set=function(s){return ni(this.options,s),this};Te.prototype.configure=function(s){let e=this;if(Io(s)){let t=s;if(s=pN[t],!s)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!s)throw new Error("Wrong `markdown-it` preset, can't be empty");return s.options&&e.set(s.options),s.components&&Object.keys(s.components).forEach(function(t){s.components[t].rules&&e[t].ruler.enableOnly(s.components[t].rules),s.components[t].rules2&&e[t].ruler2.enableOnly(s.components[t].rules2)}),this};Te.prototype.enable=function(s,e){let t=[];Array.isArray(s)||(s=[s]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.enable(s,!0))},this),t=t.concat(this.inline.ruler2.enable(s,!0));let i=s.filter(function(n){return t.indexOf(n)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};Te.prototype.disable=function(s,e){let t=[];Array.isArray(s)||(s=[s]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.disable(s,!0))},this),t=t.concat(this.inline.ruler2.disable(s,!0));let i=s.filter(function(n){return t.indexOf(n)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};Te.prototype.use=function(s){let e=[this].concat(Array.prototype.slice.call(arguments,1));return s.apply(s,e),this};Te.prototype.parse=function(s,e){if(typeof s!="string")throw new Error("Input data should be a String");let t=new this.core.State(s,this,e);return this.core.process(t),t.tokens};Te.prototype.render=function(s,e){return e=e||{},this.renderer.render(this.parse(s,e),this.options,e)};Te.prototype.parseInline=function(s,e){let t=new this.core.State(s,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};Te.prototype.renderInline=function(s,e){return e=e||{},this.renderer.render(this.parseInline(s,e),this.options,e)};var Yl=Te;var Sk=require("crypto"),I=F(require("fs"));var Zl="data_model/";var Ql=["model.yaml","types.ts","types.py"],Og="data_model/changes/",Dg="data_model/queries/",Pg="data_model/repositories/",kN=new RegExp("^data_model/changes/([0-9]{4})_[a-z][a-z0-9_]{0,49}\\.yaml$"),zT=new RegExp("^data_model/queries/([A-Z][A-Za-z0-9]*)\\.yaml$"),xN=new RegExp("^data_model/repositories/[A-Z][A-Za-z0-9]*\\.(py|ts)$");function ms(s){return Ql.some(e=>Zl+e===s)||xN.test(s)}function Bo(s){let e=kN.exec(s);return e!==null&&Number(e[1])>0}var Nk=F(Wg()),R=F(require("path")),pa=F(ko()),Ek=F(eb());var ks=F(require("path")),rE=F(ko());var JT=5*6e4;var Ko=".bw";var rd=".skills",od=".docs";var ad="AGENTS.md",cd="CLAUDE.md";var iO=ks.join(__dirname,"..","wb-cli","skills","bw-workblock","SKILL.md");var nO=[`${Ko}/`,`${rd}/`,`${od}/`,ad,cd,"node_modules/","__pycache__/"];var Sn="graphlake/schema.json";function En(s){let e=["created_at","updated_at","state","actor","branch_user","storing"],t=s;for(let i of e)delete t[i];for(let i of t.tasks??[])delete i.created_at,delete i.updated_at,delete i.explanation,i.action.value=i.action.value?.trim(),i.assets||(i.assets={});return t.react_components||(t.react_components={}),t.python||(t.python={}),t.library&&(t.library=t.library.trim()),t.graphlake&&!t.graphlake.schema&&delete t.graphlake,t}async function Cn(s){return await CC(s,"manifest.yaml","manifest.yaml")}async function CC(s,e,t){if(!I.existsSync(s))return R.join(s,t);let n=(await I.promises.readdir(s)).find(r=>r.endsWith(e));return n?R.join(s,n):R.join(s,t)}function pe(s){let e=R.basename(s).toLowerCase(),t="",i=!1;for(let n of e)n>="a"&&n<="z"||n>="0"&&n<="9"||n==="."||n==="-"?(t+=n,i=!1):i||(t+="_",i=!0);return t=t.replace(/^_+|_+$/g,"").replace(/^\.+/,""),t===""&&(t="file"),t}function Ad(s){return pe(s.name)+(s.type==="bun"?".test.ts":".py")}function RC(s,e){let t=R.posix.normalize(e.replaceAll("\\","/"));if(R.posix.isAbsolute(t)||t===".."||t.startsWith("../"))throw new Error(`invalid asset path: ${e}`);return R.posix.join(s.replaceAll("\\","/"),t)}function Id(s,e){let t=R.join(s,e+".py");if(I.existsSync(t))return t;if(!I.existsSync(s))return null;let n=I.readdirSync(s).find(r=>r.endsWith(".py"));return n?R.join(s,n):null}var AC=/\.[cm]?ts$/;async function wk(s,e="text/plain"){let{fileTypeFromFile:t}=await Promise.resolve().then(()=>(_k(),xk)),i=R.basename(s),n=(await t(s))?.mime;n||(n=AC.test(i)?"text/plain":Nk.lookup(i)||e);let r=I.readFileSync(s);return IC(r)?{content_type:n,text:r.toString("utf8")}:{content_type:n,data:r.toString("base64")}}function yk(s){return s.text!==void 0?s.text.trim()==="":!s.data}function Rd(s){try{let e=I.statSync(s);return e.size===0||e.size<4096&&I.readFileSync(s,"utf8").trim()===""}catch{return!1}}function IC(s){try{return new TextDecoder("utf-8",{fatal:!0}).decode(s),!0}catch{return!1}}var Ck=new Set(["node_modules",".git","bun.lock","pnpm-lock.yaml","__pycache__"]),kt=Zl.replace(/\/$/,""),Rk=new Set([kt,"graphlake","python","design_docs","react_components"]);var zt=Og.replace(/\/$/,""),Nn=Dg.replace(/\/$/,""),TC=Pg.replace(/\/$/,""),OC=new Set([Ko,rd,od,ad,cd,".gitignore"]);async function bi(s,e,t){let i=m=>t?.add(R.resolve(m)),n=m=>(i(m),I.readFileSync(m,"utf8")),r=await Cn(s);if(!I.existsSync(r)){e.error(`Manifest file ${r} not found`);return}let o=n(r),a=(0,pa.parse)(o);delete a.data_model,a.state="modified",a.updated_at=new Date().toISOString();let c=async(m,g,b,w)=>{let y=R.join(m,b);if(!I.existsSync(y))return;let x=g,_=x[b]=x[b]??{};await l(y,"",_,w),Object.keys(_).length===0&&delete x[b]};for(let m of a.modules??[]){let g=R.join(s,pe(m.name));if(!I.existsSync(g)){e.error(`Module directory ${g} not found`);return}for(let b of m.tasks??[]){let w=pe(b.name),y=R.join(g,w);if(!I.existsSync(y)){e.error(`Task directory ${y} not found`);continue}if(b.action.type==="code"||b.action.type==="python"){let x=Id(y,w);if(!x){e.error(`Task file for ${b.name} not found under ${y}`);return}b.action.value=n(x)}await c(y,b,"assets","text/plain"),await c(y,b,"design_docs","text/markdown")}if(m.tests&&m.tests.length>0){let b=new Map;for(let w of m.tests){let y=pe(w.name),x=b.get(y);if(x!==void 0)throw new Error(`duplicate normalized test filename "${y}" in module "${m.name}": "${w.name}" conflicts with "${x}"`);b.set(y,w.name)}for(let w of m.tests){let y=R.join(g,"tests",Ad(w));I.existsSync(y)&&(w.value=n(y))}}await c(g,m,"design_docs","text/markdown")}for(let[m,g]of[["library.py","library"],["schema.yaml","schema"],["logo.svg","logo"]]){let b=R.join(s,m);I.existsSync(b)&&!Rd(b)&&(a[g]=n(b))}let u=R.join(s,Sn);I.existsSync(u)&&!Rd(u)?a.graphlake={schema:{content_type:"application/json",text:n(u)}}:a.graphlake===void 0&&(a.graphlake={});async function l(m,g,b,w="text/plain"){let y=I.readdirSync(m);for(let x of y){if(Ck.has(x))continue;let _=R.join(m,x);if(await Dd(_,e))continue;let k=I.lstatSync(_);if(k.isSymbolicLink()){e.log(`Skipping symbolic link in workblock assets: ${_}`);continue}let S=R.posix.join(g.replaceAll("\\","/"),x);if(k.isDirectory()){await l(_,S,b,w);continue}let v=R.relative(s,_).split(R.sep).join("/");if(v.startsWith(`${zt}/`)&&!Bo(v))continue;let C=await wk(_,w);if(yk(C)){e.log(`Empty file not stored by the platform, left out: ${_}`);continue}b[S]=C,i(_)}}for(let m of["react_components","python"]){if(!I.existsSync(R.join(s,m)))continue;let g=a[m]=a[m]??{};await l(R.join(s,m),"",g),Object.keys(g).length===0&&delete a[m]}await c(s,a,"design_docs","text/markdown");let d=async m=>{let g=R.join(s,m),b=da(s,g)?await wk(g):void 0;if(!(b===void 0||yk(b)))return i(g),b},p={};for(let m of DC(s)){let g=await d(`${kt}/${m}`);g&&(p.generated={...p.generated,[m]:g})}let h={};da(s,R.join(s,zt))&&await l(R.join(s,zt),"",h),Object.keys(h).length>0&&(p.changes=h);let f={};return da(s,R.join(s,Nn))&&await l(R.join(s,Nn),"",f),Object.keys(f).length>0&&(p.queries=f),Object.keys(p).length>0&&(a.data_model=p),PC(a),a}function da(s,e){if(!I.existsSync(e))return!1;let t=I.realpathSync(s),i=I.realpathSync(e);return i===t||i.startsWith(t+R.sep)}function DC(s){let e=[...Ql],t=R.join(s,TC);if(da(s,t)&&I.statSync(t).isDirectory())for(let i of I.readdirSync(t).sort())e.push(`repositories/${i}`);return e.filter(i=>ms(`${kt}/${i}`))}function vk(s,e){let t=(0,Sk.createHash)("sha1").update(Buffer.from(s.replace(/-/g,""),"hex")).update(e).digest();t[6]=t[6]&15|80,t[8]=t[8]&63|128;let i=t.subarray(0,16).toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20)}`}function PC(s){if(!s.id)return;let e=new Set;for(let i of s.modules??[])for(let n of[i,...i.tasks??[],...i.tests??[]])n.id&&e.add(n.id);let t=(i,n,r)=>{let o=vk(i,`${n}:${r}`);for(let a=2;e.has(o);a++)o=vk(i,`${n}#${a}:${r}`);return e.add(o),o};for(let i of s.modules??[]){i.id||=t(s.id,"module",i.name);for(let n of i.tasks??[])n.id||=t(i.id,"task",n.name);for(let n of i.tests??[])n.id||=t(i.id,"test",n.name)}}function Td(s){let e=s.split("/");return OC.has(e[0])||e.some(t=>Ck.has(t))}function Od(s,e,t,i){let n=new Map;for(let c of e.modules??[])n.set(pe(c.name),{name:c.name,tasks:new Map((c.tasks??[]).map(u=>[pe(u.name),u.name]))});let r="not part of the workblock",o=c=>{let[u,l,d,...p]=c.split("/"),h=n.get(u);if(u==="graphlake")return`only ${Sn} of the graphlake/ folder is part of the workblock`;if(l===void 0||Rk.has(u))return r;if(!h)return`no module in manifest.yaml maps to the directory ${u}/`;if(l==="design_docs")return r;let f=d!==void 0&&p.length===0&&d.endsWith(".py");if(l==="tests")return d!==void 0&&p.length===0&&d.endsWith(".test.ts")?`add a test named ${JSON.stringify(d.slice(0,-8))} with type: bun under tests: of module ${JSON.stringify(h.name)} in manifest.yaml`:f?`add a test named ${JSON.stringify(d.slice(0,-3))} with type: pytest under tests: of module ${JSON.stringify(h.name)} in manifest.yaml`:r;let m=h.tasks.get(l);return m?f?`only the task file of ${JSON.stringify(m)} is read; shared code goes in python/<name>.py or library.py`:r:`no task in module ${JSON.stringify(h.name)} maps to the directory ${u}/${l}/; add a task entry to manifest.yaml or delete it`},a=[];for(let c of i){let u=R.join(s,c);if(Td(c)||t.has(R.resolve(u)))continue;let l=I.lstatSync(u).isSymbolicLink()?"a symbolic link, which is never pushed":Rd(u)?"an empty file; the platform stores none, so it is not pushed":o(c);a.push({path:c,hint:l})}return a}function qC(s){let e=s;for(I.statSync(e).isDirectory()||(e=R.dirname(e));e!==R.parse(e).root;){let t=R.join(e,".gitignore"),i=R.join(e,".git");if(I.existsSync(i))return I.existsSync(t)?e:null;e=R.dirname(e)}return null}async function Dd(s,e){try{let t=qC(s);if(!t)return!1;let i=R.join(t,".gitignore"),n=I.readFileSync(i,"utf8"),r=R.relative(t,s),o=(0,Ek.default)();return o.add(n),o.ignores(r)}catch(t){return e.log(`Error checking gitignore status: ${t}`),!1}}function la(s,e){return R.relative(s,e).split(R.sep).join("/")}function FC(s,e,t,i){let n=R.resolve(s),r=[];for(let o of e??[]){if(t.has(o))continue;let a=R.relative(n,o);if(!a||a.startsWith("..")||R.isAbsolute(a))continue;I.rmSync(o,{force:!0}),r.push(a.split(R.sep).join("/"));let c=R.dirname(o);for(;c!==n&&c.startsWith(n+R.sep)&&!i.has(c)&&!(!I.existsSync(c)||I.readdirSync(c).length>0);)I.rmdirSync(c),c=R.dirname(c)}return r.sort()}async function Rn(s,e,t,i={}){let n=await Cn(s),r=R.resolve(s),o=[],a=(x,_,k=!1)=>{o.push({file:x,key:_,binary:k})},c=(x,_)=>{if(_)for(let[k,S]of Object.entries(_)){let v=RC(x.replaceAll("\\","/"),k),C=R.normalize(v);S.data&&(a(C,S.data,!0),delete S.data),S.text&&(a(C,S.text),delete S.text)}},u=(x,_)=>{_&&c(R.join(x,"design_docs"),_)},l=JSON.parse(JSON.stringify(e)),d=[];delete l.updated_at,delete l.state,delete l.actor,delete l.branch_user,delete l.storing;for(let x of l.modules??[]){let _=R.join(s,pe(x.name));d.push(_);for(let k of x.tasks??[]){let S=k.action.type==="typescript";if(k.action.type!=="code"&&k.action.type!=="python"&&!S)continue;let v=pe(k.name),C=R.join(_,v);if(!S){let T=Id(C,v)??R.join(C,`${v}.py`);a(T,k.action.value??"")}k.assets&&c(R.join(_,v,"assets"),k.assets),delete k.created_at,delete k.updated_at,S||delete k.action.value,delete k.assets,u(C,k.design_docs),delete k.design_docs}if(x.tests&&x.tests.length>0){let k=new Map;for(let S of x.tests){let v=pe(S.name),C=k.get(v);if(C!==void 0)throw new Error(`duplicate normalized test filename "${v}" in module "${x.name}": "${S.name}" conflicts with "${C}"`);if(k.set(v,S.name),S.value&&S.value.trim()!==""){let A=R.join(_,"tests",Ad(S));a(A,S.value),delete S.value}}}u(_,x.design_docs),delete x.design_docs}l.library&&a(R.join(s,"library.py"),l.library),l.schema&&a(R.join(s,"schema.yaml"),l.schema),l.logo&&a(R.join(s,"logo.svg"),l.logo),l.react_components&&c(R.join(s,"react_components"),l.react_components),l.python&&c(R.join(s,"python"),l.python),u(s,l.design_docs);for(let[x,_]of Object.entries(l.data_model?.generated??{}))_&&ms(`${kt}/${x}`)&&c(R.join(s,kt),{[x]:_});c(R.join(s,zt),l.data_model?.changes),c(R.join(s,Nn),l.data_model?.queries);let p=l.graphlake?.schema;p?.data?a(R.join(s,Sn),p.data,!0):p?.text&&a(R.join(s,Sn),p.text);let h=new Set([n,...o.map(x=>x.file)].map(x=>R.resolve(x)));for(let x of d)if(h.has(R.resolve(x)))throw new Error(`module directory "${la(r,R.resolve(x))}" collides with a workblock file`);let f=await Promise.all(o.map(async({file:x,key:_,binary:k})=>{let S=await t.getBlob(_);return{file:x,bytes:k?Buffer.from(S,"base64"):Buffer.from(S,"utf8")}}));for(let x of d)I.mkdirSync(x,{recursive:!0});let m=FC(s,i.previouslyRead,h,new Set(d.map(x=>R.resolve(x)))),g=new Map;for(let{file:x,bytes:_}of f)g.set(la(r,R.resolve(x)),_),!(i.sent?.get(R.resolve(x))?.equals(_)||I.existsSync(x)&&I.readFileSync(x).equals(_))&&(I.mkdirSync(R.dirname(x),{recursive:!0}),I.writeFileSync(x,_));let b=JSON.parse(JSON.stringify(l));delete b.updated_at,delete b.state,delete b.branch_user,delete b.storing,delete b.actor,delete b.library,delete b.logo,delete b.react_components,delete b.python,delete b.schema,delete b.design_docs,delete b.data_model,delete b.graphlake;let w=Buffer.from((0,pa.stringify)(b,{lineWidth:0}),"utf8");return g.set(la(r,R.resolve(n)),w),i.sent?.get(R.resolve(n))?.equals(w)||I.existsSync(n)&&I.readFileSync(n).equals(w)||I.writeFileSync(n,w),{written:[...h].map(x=>la(r,x)).sort(),contents:g,removed:m}}var ha=class{constructor(e){this.outputChannel=e}log(e){this.outputChannel.appendLine(e)}error(e){this.outputChannel.appendLine(`ERROR: ${e}`)}};var Ak=F(require("fs")),An=F(require("path"));var Ik=s=>`${An.posix.basename(s)} is generated from the change files and the query files and cannot change. Put the change in a change file or a query file`,Tk=s=>`${An.posix.basename(s)} is deployed and cannot change. Put the change in a new change file`;function Pd(s,e,t,i){let n=[];for(let{path:o}of i)o.startsWith(`${kt}/`)&&!Bo(o)&&!o.startsWith(`${Nn}/`)&&!ms(o)&&n.push({file:o,code:"unexpected_file",message:`data_model/ holds only model.yaml, types.ts, types.py, change files in changes/, query files in queries/ and the generated files in repositories/. Name a change file like ${zt}/0003_add_region.yaml`});let r=o=>e.has(o)&&Ak.existsSync(An.join(s,o));for(let o of[...e].filter(a=>ms(a)&&r(a)).sort())n.push({file:o,code:"model_file_edited",message:Ik(o)});for(let o of t??[]){let a=`${zt}/${o}`;r(a)&&n.push({file:a,code:"deployed_file_changed",message:Tk(o)})}return n.sort((o,a)=>o.file<a.file?-1:o.file>a.file?1:0)}function Ok(s,e,t){let i=[];for(let n of Object.keys(s?.generated??{}).sort()){let r=`${kt}/${n}`,o=s?.generated?.[n]?.text;ms(r)&&o!==void 0&&o!==e?.generated?.[n]?.text&&i.push({file:r,code:"model_file_edited",message:Ik(r)})}for(let n of t){let r=s?.changes?.[n]?.text;r!==void 0&&r!==e?.changes?.[n]?.text&&i.push({file:`${zt}/${n}`,code:"deployed_file_changed",message:Tk(n)})}return i}function qd(s){return s.path?`${s.file} [${s.code}] ${s.path}: ${s.message}`:`${s.file} [${s.code}] ${s.message}`}var zC=new Set(["waiting","wait_ui","wait_form","wait_form_repeating","wait_ack","wait_secret","suspended_retry_limit"]);var PP=new Set(["started","completed","failed","canceled",...zC]);var wx=require("node:url"),Ta=require("node:diagnostics_channel"),_i=require("node:path"),Nx=require("node:url"),ot=require("fs"),W6=F(require("node:fs"),1),Gt=require("node:fs/promises"),Da=require("node:events"),ap=F(require("node:stream"),1),Ex=require("node:string_decoder"),ax=(s,e,t)=>{let i=s instanceof RegExp?Pk(s,t):s,n=e instanceof RegExp?Pk(e,t):e,r=i!==null&&n!=null&&UC(i,n,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+i.length,r[1]),post:t.slice(r[1]+n.length)}},Pk=(s,e)=>{let t=e.match(s);return t?t[0]:null},UC=(s,e,t)=>{let i,n,r,o,a,c=t.indexOf(s),u=t.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(s===e)return[c,u];for(i=[],r=t.length;l>=0&&!a;){if(l===c)i.push(l),c=t.indexOf(s,l+1);else if(i.length===1){let d=i.pop();d!==void 0&&(a=[d,u])}else n=i.pop(),n!==void 0&&n<r&&(r=n,o=u),u=t.indexOf(e,l+1);l=c<u&&c>=0?c:u}i.length&&o!==void 0&&(a=[r,o])}return a},cx="\0SLASH"+Math.random()+"\0",ux="\0OPEN"+Math.random()+"\0",np="\0CLOSE"+Math.random()+"\0",lx="\0COMMA"+Math.random()+"\0",dx="\0PERIOD"+Math.random()+"\0",VC=new RegExp(cx,"g"),HC=new RegExp(ux,"g"),GC=new RegExp(np,"g"),KC=new RegExp(lx,"g"),JC=new RegExp(dx,"g"),YC=/\\\\/g,ZC=/\\{/g,QC=/\\}/g,XC=/\\,/g,e6=/\\\./g,t6=1e5,s6=4e6,i6=1e3,n6=1e3;function Md(s){return isNaN(s)?s.charCodeAt(0):parseInt(s,10)}function r6(s){return s.replace(YC,cx).replace(ZC,ux).replace(QC,np).replace(XC,lx).replace(e6,dx)}function o6(s){return s.replace(VC,"\\").replace(HC,"{").replace(GC,"}").replace(KC,",").replace(JC,".")}function Ld(s,e){for(let t=0;t<e.length;t++)s.push(e[t])}function a6(s){let e=[],t="";for(;;){let i=ax("{","}",s);if(!i){let c=s.split(",");return c[0]=t+c[0],Ld(e,c),e}let{pre:n,body:r,post:o}=i,a=n.split(",");if(a[0]=t+a[0],a[a.length-1]+="{"+r+"}",!o.length)return Ld(e,a),e;t=a.pop(),Ld(e,a),s=o}}function c6(s,e={}){if(!s)return[];let{max:t=t6,maxLength:i=s6,maxDepth:n=i6,maxRewrites:r=n6}=e;return s.slice(0,2)==="{}"&&(s="\\{\\}"+s.slice(2)),Zd(r6(s),t,i,n,0,r,!0).map(o6)}function u6(s){return"{"+s+"}"}function l6(s){return/^-?0\d/.test(s)}function d6(s,e){return s<=e}function p6(s,e){return s>=e}function In(s,e,t,i,n,r){let o=[],a=0;for(let c=0;c<s.length;c++)for(let u=0;u<t.length;u++){if(o.length>=i)return o;let l=s[c]+e+t[u];if(!(r&&!l)){if(a+l.length>n)return o;o.push(l),a+=l.length}}return o}function h6(s,e,t,i){let n=s.split(/\.\./),r=[];if(n[0]===void 0||n[1]===void 0)return r;let o=Md(n[0]),a=Md(n[1]),c=Math.max(n[0].length,n[1].length),u=n.length===3&&n[2]!==void 0?Math.max(Math.abs(Md(n[2])),1):1,l=d6;a<o&&(u*=-1,l=p6);let d=n.some(l6),p=0;for(let h=o;l(h,a)&&r.length<t;h+=u){let f;if(e)f=String.fromCharCode(h),f==="\\"&&(f="");else if(f=String(h),d){let m=c-f.length;if(m>0){let g=new Array(m+1).join("0");h<0?f="-"+g+f.slice(1):f=g+f}}if(p+f.length>i)break;r.push(f),p+=f.length}return r}function Zd(s,e,t,i,n,r,o){if(n>i)return[s];let a=[""],c=0,u=!1,l=!0;for(;;){let d=ax("{","}",s);if(!d)return In(a,s,[""],e,t,u);let p=d.pre;if(/\$$/.test(p)){if(a=In(a,p+"{"+d.body+"}",[""],e,t,u&&!d.post.length),l=!1,!d.post.length)break;s=d.post;continue}let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),m=h||f,g=d.body.indexOf(",")>=0;if(!m&&!g){if(c<r&&d.post.match(/,(?!,).*\}/)){c++,s=d.pre+"{"+d.body+np+d.post,o=!0;continue}return In(a,p+"{"+d.body+"}"+d.post,[""],e,t,u)}l&&(u=o&&!m,l=!1);let b;if(m)b=h6(d.body,f,e,t);else{let w=a6(d.body);if(w.length===1&&w[0]!==void 0&&(w=Zd(w[0],e,t,i,n+1,r,!1).map(u6),w.length===1)){if(a=In(a,p+w[0],[""],e,t,u&&!d.post.length),!d.post.length)break;s=d.post;continue}let y=u&&!d.post.length&&!p;for(let _=0;y&&_<a.length;_++)a[_]&&(y=!1);b=[];let x=0;e:for(let _=0;_<w.length;_++){let k=Zd(w[_],e,t,i,n+1,r,!1);for(let S=0;S<k.length;S++){let v=k[S];if(!(y&&!v)){if(b.length>=e||x+v.length>t)break e;b.push(v),x+=v.length}}}}if(a=In(a,p,b,e,t,u&&!d.post.length),!d.post.length)break;s=d.post}return a}var f6={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}"],"[:alpha:]":["\\p{L}\\p{Nl}"],"[:ascii:]":["\\x00-\\x7f"],"[:blank:]":["\\p{Zs}\\t"],"[:cntrl:]":["\\p{Cc}"],"[:digit:]":["\\p{Nd}"],"[:graph:]":["\\p{Z}\\p{C}",!0],"[:lower:]":["\\p{Ll}"],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}\\p{S}"],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f"],"[:upper:]":["\\p{Lu}"],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],"[:xdigit:]":["A-Fa-f0-9"]},Tn=s=>s.replace(/[[\]\\-]/g,"\\$&"),Bd=/$./,m6=(s,e,t=!1,i)=>{let n=b=>{let w=i?b.normalize(i):b;return[...w].length===1?w:b},r=e;if(s.charAt(r)!=="[")throw new Error("not in a brace expression");let o=[],a=[],c=r+1,u=!1,l=!1,d=!1,p=r,h="";e:for(;c<s.length;){let b=String.fromCodePoint(s.codePointAt(c));if((b==="!"||b==="^")&&c===r+1){d=!0,c++;continue}if(b==="]"&&u&&!l){p=c+1;break}if(u=!0,b==="\\"&&!l){l=!0,c++;continue}if(b==="["&&!l){for(let[y,[x,_]]of Object.entries(f6))if(s.startsWith(y,c)){if(h)return[Bd,s.length-r];c+=y.length,_?a.push(x):o.push(x);continue e}}l=!1;let w=n(b);if(h){w.codePointAt(0)>h.codePointAt(0)?o.push(Tn(h)+"-"+Tn(w)):w===h&&o.push(Tn(w)),h="",c+=b.length;continue}if(s.startsWith("-]",c+b.length)){o.push(Tn(w+"-")),c+=b.length+1;continue}if(s.startsWith("-",c+b.length)){h=w,c+=b.length+1;continue}o.push(Tn(w)),c+=b.length}if(p<c)return[Bd,0];if(!o.length&&!a.length)return[Bd,s.length-r];let f="["+(d?"^":"")+o.join("")+"]",m="["+(d?"":"^")+a.join("")+"]",g="^"+(o.length&&a.length?"("+f+"|"+m+")":o.length?f:m);return[new RegExp(g,t?"iu":"u"),p-r]},Qd={t:"match",id:0},g6="!?+*@",Rs=s=>({t:"lit",ch:s}),b6=s=>s.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&"),Xd=s=>new RegExp(`^${b6(s)}$`,"iu"),rp=(s,e)=>{if(e===s.ch)return!0;if(!s.re)return!1;let t=e.charCodeAt(0);if(t>=128)return s.re.test(e);let i=s.ascii??=new Uint8Array(128);return i[t]||=s.re.test(e)?1:2,i[t]===1},k6=(s,e,t,i)=>{let n=[];for(let r=0;r<s.length;){let o=String.fromCodePoint(s.codePointAt(r));if(o==="\\"){let a=s.codePointAt(r+1),c=a===void 0?o:String.fromCodePoint(a);n.push(Rs(c)),r+=1+c.length;continue}if(o==="["){let[a,c]=m6(s,r,e,i);if(c){n.push({t:"class",re:a}),r+=c;continue}}if(!t&&g6.includes(o)&&s[r+1]==="("){n.push({t:"open",type:o}),r+=2;continue}n.push(!t&&o==="|"?{t:"bar"}:!t&&o===")"?{t:"close"}:o==="*"?{t:"star"}:o==="?"?{t:"any"}:Rs(o)),r+=o.length}return n},x6=s=>{let e=new Map,t=[];return s.forEach((i,n)=>{i.t==="open"?t.push(n):i.t==="close"&&t.length&&e.set(t.pop(),n)}),e},px=(s,e,t,i,n)=>{let r=[],o=[r];for(let a=t;a<i;a++){let c=s[a],u=e.get(a);if(c.t==="open"&&u!==void 0){let l=px(s,e,a+1,u,!1);r.push({t:"ext",type:c.type,alts:l}),a=u}else c.t==="bar"&&!n?o.push(r=[]):c.t==="open"?r.push(Rs(c.type),Rs("(")):c.t==="bar"?r.push(Rs("|")):c.t==="close"?r.push(Rs(")")):r.push(c)}return o},hx=(s,e)=>{let t=[],i="",n=()=>{for(let r of i.normalize(e))t.push(Rs(r));i=""};for(let r of s){if(r.t==="lit"){i+=r.ch;continue}n(),t.push(r.t==="ext"?{...r,alts:r.alts.map(o=>hx(o,e))}:r)}return n(),t},_6=(s,e)=>{let t=1,i=o=>({t:"split",id:t++,out:o}),n=(o,a)=>o.reduceRight((c,u)=>r(u,c),a),r=(o,a)=>{switch(o.t){case"lit":let d=e?Xd(o.ch):void 0;return{t:"lit",id:t++,ch:o.ch,re:d,next:a};case"any":case"star":return{t:o.t,id:t++,next:a};case"class":return{t:"class",id:t++,re:o.re,next:a}}let c=d=>o.alts.map(p=>n(p,d));switch(o.type){case"@":return i(c(a));case"?":return i([a,...c(a)]);case"!":return{t:"neg",id:t++,sub:i(c(Qd)),next:a}}let u=i([]),l=i(c(u));return u.out.push(a,l),o.type==="*"?u:l};return[n(s,Qd),t]},w6=s=>{let e=[],t=new Set,i=r=>r.t==="match"?"match":String(r.id),n=(r,o)=>{if(r.t==="match"||t.has(r))return;t.add(r);let a=c=>e.push(`${o}${r.id}: ${c}`);switch(r.t){case"split":a(`split -> ${r.out.map(i).join(", ")}`);for(let c of r.out)n(c,o);return;case"neg":return a(`!(${i(r.sub)}) -> ${i(r.next)}`),n(r.sub,o+" "),n(r.next,o);case"lit":a(`${JSON.stringify(r.ch)} -> ${i(r.next)}`);break;case"class":a(`${r.re} -> ${i(r.next)}`);break;default:a(`${r.t==="any"?"?":"*"} -> ${i(r.next)}`)}n(r.next,o)};return n(s,""),[`start -> ${i(s)}`,...e].join(`
|
|
175
|
+
`)},y6=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(s){this.gen=s}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},fx=(s,e)=>s.ids.length!==e.ids.length||s.runs.length!==e.runs.length||s.ids.some((t,i)=>t!==e.ids[i])?!1:s.runs.every(t=>e.runs.some(i=>i.neg===t.neg&&fx(i.state,t.state))),qk=s=>({has:new Float64Array(s),seen:new Float64Array(s),gen:0}),ep=class{dots;dotStart;#e;constructor(s,e,t){this.dots=s,this.dotStart=e,this.#e=t}state(){return new y6(++this.#e.gen)}done(s){return s.ids=s.threads.map(e=>e.id).sort((e,t)=>e-t),s.match&&s.ids.unshift(Qd.id),s}#i(s,e){let{seen:t}=this.#e;return t[e.id]===s.gen?!1:(t[e.id]=s.gen,!0)}#t(s,e){let{has:t}=this.#e;return t[e.id]===s.gen?!1:(t[e.id]=s.gen,s.threads.push(e),!0)}restricted(s,e){return e&&(this.dots||this.dotStart&&s===0)}add(s,e,t,i){switch(e.t){case"split":if(!this.#i(s,e))return;for(let r of e.out)this.add(s,r,t,i);return;case"neg":if(!this.#i(s,e))return;let n=this.state();return this.add(n,e.sub,t,!1),this.done(n),this.addRun(s,{t:"run",neg:e,state:n},t,i);case"star":if(this.restricted(t,i))return;this.#t(s,e)&&this.add(s,e.next,t,i);return;case"match":s.match=!0;return;default:this.#t(s,e)}}addRun(s,e,t,i){for(let n of s.runs)if(n.neg===e.neg&&fx(n.state,e.state))return;s.runs.push(e),e.state.match||this.add(s,e.neg.next,t,i)}step(s,e,t,i){let n=this.state();for(let r of s.threads)switch(r.t){case"lit":rp(r,e)&&this.add(n,r.next,t+1,i);break;case"any":this.restricted(t,i)||this.add(n,r.next,t+1,i);break;case"class":!this.restricted(t,i)&&r.re.test(e)&&this.add(n,r.next,t+1,i);break;case"star":this.restricted(t,i)||this.add(n,r,t+1,i)}if(!this.restricted(t,i))for(let r of s.runs){if(r.state.dead){this.addRun(n,r,t+1,i);continue}let o=this.step(r.state,e,t,!1);this.addRun(n,{t:"run",neg:r.neg,state:o},t+1,i)}return this.done(n)}},mx=s=>{let e=s.ids.join();if(!s.runs.length)return e;let t=s.runs.map(i=>`${i.neg.id}(${mx(i.state)})`);return`${e}|${t.sort().join("|")}`},v6=1<<18,S6=class{#e;#i=new Map;#t=0;#o;#r;#h;#l;constructor(s,e){this.#e=s,this.#h=new ep(!1,!1,e),this.#l=new ep(!1,!0,e)}#f(s){return{state:s,match:s.match,dead:s.dead,next:new Map}}#a(s){let e=mx(s),t=this.#i.get(e);if(t)return t;this.#t>v6&&this.#m();let i=this.#f(s);return this.#i.set(e,i),this.#t+=e.length+1,i}#m(){this.#i.clear(),this.#t=0,this.#o=void 0,this.#r=void 0}start(s){if(s){if(this.#r)return this.#r;let t=this.#l.state();return this.#l.add(t,this.#e,0,!0),this.#r=this.#f(this.#l.done(t))}if(this.#o)return this.#o;let e=this.#h.state();return this.#h.add(e,this.#e,0,!0),this.#o=this.#a(this.#h.done(e))}next(s,e){let t=e.charCodeAt(0),i=t<128?void 0:s.next.get(e);if(i)return i;let n=s===this.#r?this.#a(this.#l.step(s.state,e,0,!0)):this.#a(this.#h.step(s.state,e,1,!0));return t<128?(s.ascii||(s.ascii=new Array(128),this.#t+=128),s.ascii[t]=n):s.next.set(e,n),this.#t++,n}},N6=s=>{let e=[];for(let t=s;t.t!=="match";t=t.next){if(t.t==="split"||t.t==="neg")return;e.push(t)}return e},E6=(s,e,t,i)=>{let n=0,r=t,o=-1,a=0;for(;r<i;){let c=s[n];if(c?.t==="star"){o=n++,a=r;continue}let u=e[r];if(c&&(c.t==="any"||c.t==="lit"&&rp(c,u)||c.t==="class"&&c.re.test(u))){n++,r++;continue}if(o===-1)return!1;n=o+1,r=++a}for(;s[n]?.t==="star";)n++;return n===s.length},gx=s=>{let e=0,t=0;for(let i of s){let[n,r]=C6(i);e+=n,t+=r}return[e,t]},C6=s=>{if(s.t==="star")return[0,1/0];if(s.t!=="ext")return[1,1];if(s.type==="!")return[0,1/0];let e=s.alts.map(gx),t=Math.min(...e.map(r=>r[0])),i=Math.max(...e.map(r=>r[1])),n=i===0?0:1/0;return s.type==="@"?[t,i]:s.type==="?"?[0,i]:s.type==="*"?[0,n]:[t,n]},Fk=(s,e,t)=>{for(let i=0;i<s.length;i++)if(!rp(s[i],e[t+i]))return!1;return!0},R6=/[/\ud800-\udfff]/,A6=/[\ud800-\udfff]/,fa=s=>A6.test(s)?[...s]:s,Mk=s=>{if(s.includes("/"))throw new Error("can only match a single path portion, got: "+s)},Lk=class{pattern;options;#e;#i;#t;#o;#r;#h;#l;#f=!1;#a=0;#m=1/0;#c=[];#u=[];#n;#b;#y=!1;#k;#d;constructor(s,e={}){if(s.includes("/"))throw new Error("can only match a single path portion, got pattern: "+s);this.pattern=s,this.options=e;let{nocase:t=!1,noext:i=!1,normalize:n}=e;this.#d=n===!0?"NFC":n||void 0;let r=/^[?*+@]\(\)$/.test(s),o=k6(s,t,i||r,this.#d),[a]=px(o,x6(o),0,o.length,!0);this.#d&&(a=hx(a,this.#d));let[c,u]=_6(a,t);if(this.#e=c,this.#i=u,a.every(l=>l.t==="lit"))this.#r=a.map(l=>l.ch).join(""),t&&(this.#h=Xd(this.#r));else{let l=h=>h.t!=="lit"?void 0:t?{ch:h.ch,re:Xd(h.ch)}:{ch:h.ch};for(let h of a){let f=l(h);if(!f)break;this.#c.push(f)}for(let h=a.length-1;h>=0;h--){let f=l(a[h]);if(!f)break;this.#u.unshift(f)}this.#y=!!(this.#c.length||this.#u.length),t||(this.#n=this.#c.map(h=>h.ch).join(""),this.#b=this.#u.map(h=>h.ch).join("")),this.#l=N6(this.#e)?.slice(this.#c.length,-this.#u.length||void 0),this.#f=!!this.#l?.every(h=>h.t==="star"||h.t==="any");let[d,p]=gx(a);this.#a=d,this.#m=p}}test(s){return this.#d?(Mk(s),this.#w(s.normalize(this.#d))):R6.test(s)?(Mk(s),this.#w(s,[...s])):this.#w(s,s)}testUnchecked(s){return this.#w(this.#d?s.normalize(this.#d):s)}#w(s,e){if(this.#r!==void 0)return this.#h?this.#h.test(s):s===this.#r;let t=this.#a,i=this.#m;if(e===void 0){let u=s.length,l=u+1>>1;if(u<t||l>i)return!1;(l<t||u>i)&&(e=fa(s))}if(e!==void 0&&(e.length<t||e.length>i))return!1;let n=this.#c.length;if(this.#y)if(this.#n!==void 0&&this.#b!==void 0){if(!s.startsWith(this.#n)||!s.endsWith(this.#b))return!1}else{e??=fa(s);let u=e.length-this.#u.length;if(!Fk(this.#c,e,0)||!Fk(this.#u,e,u))return!1}let r=!this.options.dot&&s.startsWith(".");if(this.#l){if(s==="."||s===".."||r&&!n)return!1;if(this.#f)return!0;e??=fa(s);let u=e.length-this.#u.length;return E6(this.#l,e,n,u)}if(e??=fa(s),s==="."||s===".."){this.#t??=qk(this.#i);let u=this.#o??=new ep(!0,!1,this.#t),l=u.state();u.add(l,this.#e,0,!0);let d=u.done(l);for(let p=0;p<e.length;p++)d=u.step(d,e[p],p,!0);return d.match}this.#t??=qk(this.#i);let o=this.#k??=new S6(this.#e,this.#t),a=o.start(r),c=e===s;for(let u=0;u<e.length;u++){if(a.dead)return!1;let l=c?s.charCodeAt(u):e[u].charCodeAt(0);a=a.ascii?.[l]??o.next(a,e[u])}return a.match}toString(){return w6(this.#e)}},Ra=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")},op=(s,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?s.replace(/[?*()[\]{}]/g,"[$&]"):s.replace(/[?*()[\]\\{}]/g,"\\$&"):e?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),bx=(s,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?s.replace(/\[([^/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?s.replace(/\[([^/\\{}])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),Ne=(s,e,t={})=>(Ra(e),!t.nocomment&&e.charAt(0)==="#"?!1:new As(e,t).match(s)),kx=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Bk={win32:{sep:"\\"},posix:{sep:"/"}},I6=kx==="win32"?Bk.win32.sep:Bk.posix.sep;Ne.sep=I6;var U=Symbol("globstar **");Ne.GLOBSTAR=U;var T6=(s,e={})=>t=>Ne(t,s,e);Ne.filter=T6;var xt=(s,e={})=>Object.assign({},s,e),O6=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return Ne;let e=Ne;return Object.assign((t,i,n={})=>e(t,i,xt(s,n)),{Minimatch:class extends e.Minimatch{constructor(t,i={}){super(t,xt(s,i))}static defaults(t){return e.defaults(xt(s,t)).Minimatch}},unescape:(t,i={})=>e.unescape(t,xt(s,i)),escape:(t,i={})=>e.escape(t,xt(s,i)),filter:(t,i={})=>e.filter(t,xt(s,i)),defaults:t=>e.defaults(xt(s,t)),braceExpand:(t,i={})=>e.braceExpand(t,xt(s,i)),match:(t,i,n={})=>e.match(t,i,xt(s,n)),sep:e.sep,GLOBSTAR:U})};Ne.defaults=O6;var xx=(s,e={})=>(Ra(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:c6(s,{max:e.braceExpandMax}));Ne.braceExpand=xx;var D6=(s,e,t={})=>{let i=new As(e,t);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(e),s};Ne.match=D6;var Wk=/[?*]|[+@!]\(.*?\)|\[|\]/,_x=(s,e)=>{let t=e+1;(s.charAt(t)==="!"||s.charAt(t)==="^")&&t++;let i=!1;for(;t<s.length;t++){let n=s.charAt(t);if(n==="]"&&i)return t;i=!0,n==="\\"&&t++}return-1},P6=(s,e)=>{if(!e&&(s==="+()"||s==="@()"))return s;let t="";for(let i=0;i<s.length;i++){let n=s.charAt(i);if(n==="\\")t+=s.charAt(++i)||n;else{if(n==="*"||n==="?")return;if(n==="["){let r=_x(s,i);if(r===-1){t+=n;continue}let o=s.slice(i+1,r);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(s.charAt(i+1)))return;t+=o,i=r}else{if(!e&&"+@!".includes(n)&&s.charAt(i+1)==="("&&s.includes(")",i+2))return;t+=n}}}return t},q6=s=>{if(/^[?*+@]\(\)$/.test(s)||s.includes("[:"))return!1;let e=0;for(let t=0;t<s.length;t++){let i=s.charAt(t);if(i==="\\"){if(++t===s.length)return!1}else if(i==="["){let n=_x(s,t);n!==-1&&(t=n)}else if("+@!?*".includes(i)&&s.charAt(t+1)==="(")e++,t++;else if(i===")"){if(!e--)return!1}else if(i==="|"&&!e)return!1}return!e},Wd,$k,Ht=(s,e)=>typeof s=="string"?e===s:e!==""&&s.testUnchecked(e),jk=(s,e,t,i,n)=>Ht(s,e)?t:i!==void 0&&Ht(s,i)?n:-1,tp=s=>s==="."||s==="..",$d=s=>typeof s=="string"&&/^[a-z]:$/i.test(s),Na=s=>typeof s=="string"&&/^unc$/i.test(s),jd=s=>{if(s[0]!==""||s[1]!=="")return-1;let e=s[2]!=="?"?2:Na(s[3])?4:-1,t=s[e],i=s[e+1];return e!==-1&&t!==void 0&&t!==""&&t!==U&&i!==void 0&&i!==""&&i!==U?e:-1},ma=(s,e)=>!tp(s)&&(e||!s.startsWith(".")),On=(s,e,t,i,n)=>{for(let r=e;r<t;){if(s.charCodeAt(r)===46){if(!i)return!0;let a=s.charCodeAt(r+1)===46?r+2:r+1;if(a>=t||Aa(s.charCodeAt(a),n))return!0}let o=sp(s,r,n);if(o===-1)return!1;for(r=o+1;r<t&&Aa(s.charCodeAt(r),n);)r++}return!1},Aa=(s,e)=>e==="/"?s===47:e==="\\"?s===92:s===47||s===92,sp=(s,e,t)=>{if(t!=="both")return s.indexOf(t,e);let i=s.indexOf("/",e),n=s.indexOf("\\",e);return i===-1?n:n===-1?i:Math.min(i,n)},zk=(s,e,t)=>t!=="both"?s.lastIndexOf(t,e):Math.max(s.lastIndexOf("/",e),s.lastIndexOf("\\",e)),As=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#e;#i;#t;#o;#r=[];#h=[];#l=[];#f=new Map;#a=new WeakMap;constructor(s,e={}){Ra(s),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=s,this.platform=e.platform||kx,this.isWindows=this.platform==="win32";let t="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[t]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,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.#e=!this.preserveMultipleSlashes,this.#t=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#o=i===!0?"NFC":i||void 0,this.make();let n=this.set.map(r=>this.#c(r));this.#l=this.set.map((r,o)=>this.#e&&r.length-1>n[o]),this.#r=this.set.map((r,o)=>{let a=this.#l[o]?r.length-1:r.length,c=r.slice(n[o]+1,a).filter(u=>typeof u=="string"&&!!u);return[...new Set(c)]}),this.#i=this.#r.some(r=>r.length),this.#h=this.set.map((r,o)=>{let[a,c,u]=r;if(this.#l[o]&&r.length===2&&a===U&&c!==U)return"tail";if(this.#l[o]&&e.matchBase&&r.length===1&&a!==U&&a!=="")return"base";if(!(!this.#e||n[o]!==-1)){if(r.length===3&&a===U&&u===U&&c!==U&&c!==""&&this.maxGlobstarRecursion>0)return"mid";if(r.length===2&&c===U&&a!==U&&a!=="")return"head"}})}#m(s){return this.#o?s.normalize(this.#o):s}#c(s){if(!this.isWindows)return-1;if($d(s[0]))return 0;if(s[0]===""&&s[1]===""&&s[2]==="?"&&$d(s[3]))return 3;let e=jd(s);return e===-1?-1:e+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let s of this.set)for(let e of s)if(typeof e!="string")return!0;return!1}make(){let s=this.pattern,e=this.options;if(!e.nocomment&&s.charAt(0)==="#"){this.comment=!0;return}if(!s){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())];let t=this.globSet.map(n=>this.#_(n));this.globParts=this.preprocess(t);let i=this.globParts.map((n,r,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[2]==="?"&&Na(n[3])?6:4,c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Wk.test(n[2]))&&n.slice(3,a).every(l=>!Wk.test(l)),u=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,a).map(l=>this.#m(l)),...n.slice(a).map(l=>this.parse(l))];if(u)return[this.#m(n[0]),...n.slice(1).map(l=>this.parse(l))]}return n.map(a=>this.parse(a))});if(this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let r=this.set[n];r[0]===""&&r[1]===""&&this.globParts[n][2]==="?"&&($d(r[3])||Na(this.globParts[n][3]))&&(Na(this.globParts[n][3])&&(r[3]="UNC"),r[2]="?")}e.noext||this.mergeRows()}mergeRows(){let s=!0;for(;s;){s=!1;let e=Math.max(0,...this.set.map(t=>t.length));for(let t=0;t<e;t++){let i=new Map;this.set.forEach((r,o)=>{if(!(r[t]instanceof Lk)||!q6(this.globParts[o][t]))return;let a=[...this.globParts[o]];a[t]="";let c=`${r.length}/${a.join("/")}`,u=i.get(c);u?u.push(o):i.set(c,[o])});let n=new Set;for(let r of i.values()){if(r.length<2)continue;let[o,...a]=r,c=`@(${r.map(u=>this.globParts[u][t]).join("|")})`;this.globParts[o][t]=c,this.set[o][t]=this.parse(c);for(let u of a)n.add(u)}n.size&&(s=!0,this.set=this.set.filter((r,o)=>!n.has(o)),this.globParts=this.globParts.filter((r,o)=>!n.has(o)))}}}preprocess(s){if(this.options.noglobstar)for(let t of s)for(let i=0;i<t.length;i++)t[i]==="**"&&(t[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(s=this.firstPhasePreProcess(s),s=this.secondPhasePreProcess(s)):e>=1?s=this.levelOneOptimize(s):s=this.adjascentGlobstarOptimize(s),s}adjascentGlobstarOptimize(s){return s.map(e=>{let t=-1;for(;(t=e.indexOf("**",t+1))!==-1;){let i=t;for(;e[i+1]==="**";)i++;i!==t&&e.splice(t,i-t)}return e})}levelOneOptimize(s){return s.map(e=>{let t=this.#c(e)+1;return e=e.reduce((i,n)=>{let r=i[i.length-1];return n==="**"&&r==="**"?i:n===".."&&i.length>t&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e})}#u(s){let e=!this.isWindows||!s.includes("\\")?"/":s.includes("/")?"both":"\\",t=this.#e?0:-1,i="",n=0,r,o=0,a=!!this.options.dot;e:for(let c=0;c<this.set.length;c++){let u=this.set[c],l=u[u.length-1],d=t!==-1&&this.#l[c]&&l!==U;if(d&&t===0){let f=zk(s,s.length,e);if(n=f+1,i=s.slice(n),i===""&&f>=0){let g=f;for(;g>0&&Aa(s.charCodeAt(g-1),e);)g--;o=g===0?0:zk(s,g-1,e)+1,r=s.slice(o,g)}let m=this.#t&&(tp(i)||i===""&&r!==void 0&&tp(r));t=m?-1:1,d=!m}let p=-1;if(d&&typeof l=="string"&&(p=jk(l,i,n,r,o),p===-1))continue;if(this.#i){for(let f of this.#r[c])if(!s.includes(f))continue e}if(d&&typeof l=="object"&&(p=jk(l,i,n,r,o),p===-1))continue;let h=this.#h[c];if(h==="base"&&d)return"yes";if(h==="tail"&&d){if(this.#t&&On(s,0,p,!0,e))return"maybe";if(!On(s,0,p,a,e))return"yes";continue}if(h==="mid"||h==="head"){let f=this.#b(s,u,h==="head",a,e);if(f!=="no")return f;continue}return"maybe"}return"no"}#n(s,e,t){let i=!!this.options.dot,n=s.length;if(t==="head"){if(n<2||!Ht(e[0],s[0]))return!1;for(let o=1;o<n;o++)if(!ma(s[o],i))return!1;return!0}let r=e[1];if(t==="tail"){let o=n-1;if(!Ht(r,s[o])&&(s[o]!==""||n===1||!Ht(r,s[--o])))return!1;for(let a=0;a<o;a++)if(!ma(s[a],i))return!1;return!0}for(let o=0;o<n;o++){if(Ht(r,s[o])&&o+1<n){let a=o+1;for(;a<n&&ma(s[a],i);)a++;if(a===n)return!0}if(!ma(s[o],i))return!1}return!1}#b(s,e,t,i,n){if(this.#t&&On(s,0,s.length,!0,n))return"maybe";let r=e[t?0:1],o=0;for(let a=sp(s,o,n);a!==-1;a=sp(s,o,n)){let c=a+1;for(;c<s.length&&Aa(s.charCodeAt(c),n);)c++;if((typeof r=="string"?a-o===r.length&&s.startsWith(r,o):a>o&&r.testUnchecked(s.slice(o,a)))&&!On(s,c,s.length,i,n))return"yes";if(t||On(s,o,c,i,n))return"no";o=c}return"no"}#y(s){let e=Wd;return e?.f===s&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#o?e:void 0}#k(s){let{isWindows:e,preserveMultipleSlashes:t}=this,i=this.#_(e?s.split("\\").join("/"):s),n=this.#o;return n&&(i=i.map(r=>r.normalize(n))),Wd={f:s,isWindows:e,preserveMultipleSlashes:t,normalize:n,parts:i},Wd}#d(s){let e=[...s],t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let o=e[r];r===1&&o===""&&e[0]===""||(o==="."||o==="")&&(t=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=this.#c(e)+1,n=i;for(;(n=e.indexOf("..",n+1))!==-1;){let r=e[n-1];r&&r!=="."&&r!==".."&&r!=="**"&&(t=!0,e.splice(n-1,2),n=Math.max(n-2,i))}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(s){let{braceExpandMax:e=1e5}=this.options,t=!1;do{t=!1;for(let i of s){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let a=n;for(;i[a+1]==="**";)a++;a>n&&i.splice(n+1,a-n);let c=i[n+1],u=i[n+2],l=i[n+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l===".."||s.length>=e)continue;t=!0,i.splice(n,1);let d=i.slice(0);d[n]="**",s.push(d),n--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let c=i[a];a===1&&c===""&&i[0]===""||(c==="."||c==="")&&(t=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let r=this.#c(i)+1,o=r;for(;(o=i.indexOf("..",o+1))!==-1;){let a=i[o-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let c=o===1&&i[o+1]==="**"?["."]:[];i.splice(o-1,2,...c),i.length===0&&i.push(""),o=Math.max(o-2,r)}}}}while(t);return s}secondPhasePreProcess(s){if(s.length>1e3)return s;for(let e=0;e<s.length-1;e++)for(let t=e+1;t<s.length;t++){let i=this.partsMatch(s[e],s[t],!this.preserveMultipleSlashes);if(i){s[e]=[],s[t]=i;break}}return s.filter(e=>e.length)}partsMatch(s,e,t=!1){let i=0,n=0,r=[],o="";for(;i<s.length&&n<e.length;)if(s[i]===e[n])r.push(o==="b"?e[n]:s[i]),i++,n++;else if(t&&s[i]==="**"&&e[n]===s[i+1])r.push(s[i]),i++;else if(t&&e[n]==="**"&&s[i]===e[n+1])r.push(e[n]),n++;else if(s[i]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(o==="b")return!1;o="a",r.push(s[i]),i++,n++}else if(e[n]==="*"&&s[i]&&(this.options.dot||!s[i].startsWith("."))&&s[i]!=="**"){if(o==="a")return!1;o="b",r.push(e[n]),i++,n++}else return!1;return s.length===e.length&&r}parseNegate(){if(this.nonegate)return;let s=this.pattern,e=!1,t=0;for(let i=0;i<s.length&&s.charAt(i)==="!";i++)e=!e,t++;t&&(this.pattern=s.slice(t)),this.negate=e}#w(s,e,t,i){let n=0,r=0,o=this.isWindows?jd(e):-1,a=o===-1?-1:jd(t);if(a!==-1){let c=t[a],u=t[a+1];typeof c!="string"||typeof u!="string"?(n=o,r=a):e[o].toLowerCase()===c.toLowerCase()&&e[o+1].toLowerCase()===u.toLowerCase()&&(n=o+2,r=a+2)}else if(this.isWindows){let c=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),u=!c&&s[0]===""&&s[1]===""&&s[2]==="?"&&/^[a-z]:$/i.test(s[3]),l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),d=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),p=u?3:c?0:void 0,h=d?3:l?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,m]=[s[p],t[h]];f.toLowerCase()===m.toLowerCase()&&(r=h+1,n=p+1)}}return s=e,t.includes(U)?this.#x(s,t,i,n,r):this.#g(s,t,i,n,r)}#x(s,e,t,i,n){let{head:r,body:o,tail:a,segments:c}=this.#v(e,t,n);if(r.length){let l=i+r.length;if(!this.#g(s,r,t,i,0,l))return!1;i+=r.length,n+=r.length}let u=0;if(a.length){if(a.length+i>s.length)return!1;let l=s.length-a.length;if(this.#g(s,a,t,l,0))u=a.length;else{if(s[s.length-1]!==""||i+a.length===s.length||(l--,!this.#g(s,a,t,l,0)))return!1;u=a.length+1}}if(!o.length){let l=!!u;for(let d=i;d<s.length-u;d++){let p=String(s[d]);if(l=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return t||l}return!!this.#S(s,c,s.length-u,i,0,t,0,!!u,new Set)}#v(s,e,t){let i=this.#a.get(s);i||(i=[],this.#a.set(s,i));let n=t*2+(e?1:0),r=i[n];if(r)return r;let o=s.indexOf(U,t),a=s.lastIndexOf(U),c=s.slice(t,o),u=s.slice(o+1,e?void 0:a),l=e?[]:s.slice(a+1),d=[[[],0]],p=d[0],h=0,f=[0];for(let g of u)g===U?(f.push(h),p=[[],0],d.push(p)):(p[0].push(g),h++);d.forEach((g,b)=>{g[1]=h-f[b]});let m={head:c,body:u,tail:l,segments:d};return i[n]=m,m}#S(s,e,t,i,n,r,o,a,c){let u=e[n];if(!u){if(r)return i>=t||i===t-1&&s[i]==="";for(let h=i;h<t;h++){a=!0;let f=s[h];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return a}let[l,d]=u,p=r?t:t-d;for(;i<=p;){let h=n*(s.length+1)+i;if(c.has(h))return!1;if(c.add(h),this.#g(s,l,r,i,0,i+l.length)&&o<this.maxGlobstarRecursion){let m=this.#S(s,e,t,i+l.length,n+1,r,o+1,a,c);if(m!==!1)return m}if(i===p)break;let f=s[i];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1;i++}return r||null}#g(s,e,t,i,n,r=s.length){let o,a,c,u;for(o=i,a=n,u=Math.min(r,s.length),c=e.length;o<u&&a<c;o++,a++){let l=e[a],d=s[o];if(l===!1||l===U||!Ht(l,d))return!1}if(o===u&&a===c)return!0;if(o===u)return t;if(a===c)return o===u-1&&s[o]==="";throw new Error("wtf?")}braceExpand(){return xx(this.pattern,this.options)}parse(s){Ra(s);let e=this.options;if(s==="**")return U;if(s==="")return"";let{nocase:t,nocaseMagicOnly:i,noext:n=!1,dot:r,normalize:o}=e,a=P6(s,n);if(a!==void 0&&!(t&&!i&&s.toUpperCase()!==s.toLowerCase()))return this.#m(a);let c=this.#f.get(s);return c||(c=new Lk(s,{nocase:t,noext:n,dot:r,normalize:o}),this.#f.set(s,c)),c}#_(s){return this.preserveMultipleSlashes?s.split("/"):this.isWindows&&/^\/\/[^/]+/.test(s)?["",...s.split(/\/+/)]:s.split(/\/+/)}match(s,e=this.partial){if(this.comment)return!1;if(this.empty)return s==="";if(s==="/"&&e)return!0;let t=this.options,i=this.#y(s);if(!i){if(!e&&!this.#o&&(this.#e||this.#i)&&$k!==s){$k=s;let c=this.#u(s);if(c==="no")return t.flipNegate?!1:this.negate;if(c==="yes")return t.flipNegate?!0:!this.negate}i=this.#k(s)}let n=i.parts,r=this.#t?i.resolved??=this.#d(n):n,o=this.set,a=n[n.length-1];if(!a)for(let c=n.length-2;!a&&c>=0;c--)a=n[c];for(let c=0;c<o.length;c++){let u=o[c],l=e?void 0:this.#h[c];if(l==="base"?Ht(u[0],a):l?this.#n(r,u,l):t.matchBase&&u.length===1?this.#w([a],[a],u,e):this.#w(n,r,u,e))return t.flipNegate?!0:!this.negate}return t.flipNegate?!1:this.negate}static defaults(s){return Ne.defaults(s).Minimatch}};Ne.Minimatch=As;Ne.escape=op;Ne.unescape=bx;var ae=(0,Ta.channel)("lru-cache:metrics"),Ln=(0,Ta.tracingChannel)("lru-cache"),F6=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,zd=()=>ae.hasSubscribers||Ln.hasSubscribers,yx=new Set,Uk=typeof process=="object"&&process?process:{},M6=(s,e,t,i)=>{typeof Uk.emitWarning=="function"?Uk.emitWarning(s,e,t,i):console.error(`[${t}] ${e}: ${s}`)},L6=s=>!yx.has(s),Vt=s=>!!s&&s===Math.floor(s)&&s>0&&isFinite(s),vx=s=>Vt(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?Ea:null:null,Ea=class extends Array{constructor(s){super(s),this.fill(0)}},B6=class Bn{heap;length;static#e=!1;static create(e){let t=vx(e);if(!t)return[];Bn.#e=!0;let i=new Bn(e,t);return Bn.#e=!1,i}constructor(e,t){if(!Bn.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Oa=class Sx{#e;#i;#t;#o;#r;#h;#l;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#a;#m;#c;#u;#n;#b;#y;#k;#d;#w;#x;#v;#S;#g;#_;#N;#R;#s;#T;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#g,autopurgeTimers:e.#_,sizes:e.#v,keyMap:e.#c,keyList:e.#u,valList:e.#n,next:e.#b,prev:e.#y,get head(){return e.#k},get tail(){return e.#d},free:e.#w,isBackgroundFetch:t=>e.#p(t),backgroundFetch:(t,i,n,r)=>e.#M(t,i,n,r),moveToTail:t=>e.#K(t),indexes:t=>e.#A(t),rindexes:t=>e.#I(t),isStale:t=>e.#E(t)}}get max(){return this.#e}get maxSize(){return this.#i}get calculatedSize(){return this.#m}get size(){return this.#a}get fetchMethod(){return this.#h}get memoMethod(){return this.#l}get dispose(){return this.#t}get onInsert(){return this.#o}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:u,onInsert:l,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:f=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:b,memoMethod:w,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:k,ignoreFetchAbort:S,backgroundFetchSize:v=1,perf:C}=e;if(this.backgroundFetchSize=v,C!==void 0&&typeof C?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=C??F6,t!==0&&!Vt(t))throw new TypeError("max option must be a nonnegative integer");let A=t?vx(t):Array;if(!A)throw new Error("invalid max value: "+t);if(this.#e=t,this.#i=f,this.maxEntrySize=m||this.#i,this.sizeCalculation=g,this.sizeCalculation){if(!this.#i&&!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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=w,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=b,this.#R=!!b,this.#c=new Map,this.#u=Array.from({length:t}).fill(void 0),this.#n=Array.from({length:t}).fill(void 0),this.#b=new A(t),this.#y=new A(t),this.#k=0,this.#d=0,this.#w=B6.create(t),this.#a=0,this.#m=0,typeof u=="function"&&(this.#t=u),typeof l=="function"&&(this.#o=l),typeof d=="function"?(this.#r=d,this.#x=[]):(this.#r=void 0,this.#x=void 0),this.#N=!!this.#t,this.#T=!!this.#o,this.#s=!!this.#r,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.#i!==0&&!Vt(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!Vt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Vt(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!Vt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#e===0&&this.ttl===0&&this.#i===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#i){let T="LRU_CACHE_UNBOUNDED";L6(T)&&(yx.add(T),M6("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",T,Sx))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#O(){let e=new Ea(this.#e),t=new Ea(this.#e);this.#g=e,this.#S=t;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#_=i,this.#B=(c,u,l=this.#f.now())=>{t[c]=u!==0?l:0,e[c]=u,n(c,u)},this.#C=c=>{t[c]=e[c]!==0?this.#f.now():0,n(c,e[c])};let n=this.ttlAutopurge?(c,u)=>{if(i?.[c]&&(clearTimeout(i[c]),i[c]=void 0),u&&u!==0&&i){let l=setTimeout(()=>{this.#E(c)?(this.#L(this.#u[c],"expire"),i[c]=void 0):n(c,a(c))},u+1);l.unref&&l.unref(),i[c]=l}}:()=>{};this.#D=(c,u)=>{if(e[u]){let l=e[u],d=t[u];if(!l||!d)return;c.ttl=l,c.start=d,c.now=r||o();let p=c.now-d;c.remainingTTL=l-p}};let r=0,o=()=>{let c=this.#f.now();if(this.ttlResolution>0){r=c;let u=setTimeout(()=>r=0,this.ttlResolution);u.unref&&u.unref()}return c};this.getRemainingTTL=c=>{let u=this.#c.get(c);return u===void 0?0:a(u)};let a=c=>{let u=e[c],l=t[c];if(!u||!l)return 1/0;let d=(r||o())-l;return u-d};this.#E=c=>{let u=t[c],l=e[c];return!!l&&!!u&&(r||o())-u>l}}#C=()=>{};#D=()=>{};#B=()=>{};#E=()=>!1;#U(){let e=new Ea(this.#e);this.#m=0,this.#v=e,this.#q=t=>{this.#m-=e[t],e[t]=0},this.#W=(t,i,n,r)=>{if(!Vt(n)){if(this.#p(i))return this.backgroundFetchSize;if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(i,t),!Vt(n))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 n},this.#P=(t,i,n)=>{if(e[t]=i,this.#i){let r=this.#i-e[t];for(;this.#m>r;)this.#z(!0)}this.#m+=e[t],n&&(n.entrySize=i,n.totalCalculatedSize=this.#m)}}#q=e=>{};#P=(e,t,i)=>{};#W=(e,t,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#d;this.#$(t)&&((e||!this.#E(t))&&(yield t),t!==this.#k);)t=this.#y[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#k;this.#$(t)&&((e||!this.#E(t))&&(yield t),t!==this.#d);)t=this.#b[t]}#$(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#p(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*rentries(){for(let e of this.#I())this.#n[e]!==void 0&&this.#u[e]!==void 0&&!this.#p(this.#n[e])&&(yield[this.#u[e],this.#n[e]])}*keys(){for(let e of this.#A()){let t=this.#u[e];t!==void 0&&!this.#p(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#I()){let t=this.#u[e];t!==void 0&&!this.#p(this.#n[e])&&(yield t)}}*values(){for(let e of this.#A())this.#n[e]!==void 0&&!this.#p(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#I())this.#n[e]!==void 0&&!this.#p(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let n=this.#n[i],r=this.#p(n)?n.__staleWhileFetching:n;if(r!==void 0&&e(r,this.#u[i],this))return this.#G(this.#u[i],t)}}forEach(e,t=this){for(let i of this.#A()){let n=this.#n[i],r=this.#p(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(t,r,this.#u[i],this)}}rforEach(e,t=this){for(let i of this.#I()){let n=this.#n[i],r=this.#p(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(t,r,this.#u[i],this)}}purgeStale(){let e=!1;for(let t of this.#I({allowStale:!0}))this.#E(t)&&(this.#L(this.#u[t],"expire"),e=!0);return e}info(e){let t=this.#c.get(e);if(t===void 0)return;let i=this.#n[t],n=this.#p(i)?i.__staleWhileFetching:i;if(n===void 0)return;let r={value:n};if(this.#g&&this.#S){let o=this.#g[t],a=this.#S[t];if(o&&a){let c=o-(this.#f.now()-a);r.ttl=c,r.start=Date.now()}}return this.#v&&(r.size=this.#v[t]),r}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#u[t],n=this.#n[t],r=this.#p(n)?n.__staleWhileFetching:n;if(r===void 0||i===void 0)continue;let o={value:r};if(this.#g&&this.#S){o.ttl=this.#g[t];let a=this.#f.now()-this.#S[t];o.start=Math.floor(Date.now()-a)}this.#v&&(o.size=this.#v[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let n=Date.now()-i.start;i.start=this.#f.now()-n}this.#F(t,i.value,i)}}set(e,t,i={}){let{status:n=ae.hasSubscribers?{}:void 0}=i;i.status=n,n&&(n.op="set",n.key=e,t!==void 0&&(n.value=t),n.cache=this);let r=this.#F(e,t,i);return n&&ae.hasSubscribers&&ae.publish(n),r}#F(e,t,i,n){let{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=i,l=this.#p(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=i;u&&!l&&(u.value=t);let p=this.#W(e,t,i.size||0,c,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#L(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#a===0?void 0:this.#c.get(e);if(h===void 0)h=this.#a===0?this.#d:this.#w.length!==0?this.#w.pop():this.#a===this.#e?this.#z(!1):this.#a,this.#u[h]=e,this.#n[h]=t,this.#c.set(e,h),this.#b[this.#d]=h,this.#y[h]=this.#d,this.#d=h,this.#a++,this.#P(h,p,u),u&&(u.set="add"),d=!1,this.#T&&!l&&this.#o?.(t,e,"add");else{this.#K(h);let f=this.#n[h];if(t!==f){if(!a)if(this.#p(f)){f!==n&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=f;m!==void 0&&m!==t&&(this.#N&&this.#t?.(m,e,"set"),this.#s&&this.#x?.push([m,e,"set"]))}else this.#N&&this.#t?.(f,e,"set"),this.#s&&this.#x?.push([f,e,"set"]);if(this.#q(h),this.#P(h,p,u),this.#n[h]=t,!l){let m=f&&this.#p(f)?f.__staleWhileFetching:f,g=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=g,m!==void 0&&(u.oldValue=m)),this.#T&&this.onInsert?.(t,e,g)}}else l||(u&&(u.set="update"),this.#T&&this.onInsert?.(t,e,"update"))}if(r!==0&&!this.#g&&this.#O(),this.#g&&(d||this.#B(h,r,o),u&&this.#D(u,h)),!a&&this.#s&&this.#x){let f=this.#x,m;for(;m=f?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#k];if(this.#z(!0),this.#p(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#x){let e=this.#x,t;for(;t=e?.shift();)this.#r?.(...t)}}}#z(e){let t=this.#k,i=this.#u[t],n=this.#n[t],r=this.#p(n);r&&n.__abortController.abort(new Error("evicted"));let o=r?n.__staleWhileFetching:n;return(this.#N||this.#s)&&o!==void 0&&(this.#N&&this.#t?.(o,i,"evict"),this.#s&&this.#x?.push([o,i,"evict"])),this.#q(t),this.#_?.[t]&&(clearTimeout(this.#_[t]),this.#_[t]=void 0),e&&(this.#u[t]=void 0,this.#n[t]=void 0,this.#w.push(t)),this.#a===1?(this.#k=this.#d=0,this.#w.length=0):this.#k=this.#b[t],this.#c.delete(i),this.#a--,t}has(e,t={}){let{status:i=ae.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let n=this.#J(e,t);return ae.hasSubscribers&&ae.publish(i),n}#J(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=t,r=this.#c.get(e);if(r!==void 0){let o=this.#n[r];if(this.#p(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#E(r))n&&(n.has="stale",this.#D(n,r));else return i&&this.#C(r),n&&(n.has="hit",this.#D(n,r)),!0}else n&&(n.has="miss");return!1}peek(e,t={}){let{status:i=zd()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let n=this.#V(e,t);return ae.hasSubscribers&&ae.publish(i),n}#V(e,t){let{status:i,allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#E(r)){i&&(i.peek=r===void 0?"miss":"stale");return}let o=this.#n[r],a=this.#p(o)?o.__staleWhileFetching:o;return i&&(a!==void 0?(i.peek="hit",i.value=a):i.peek="miss"),a}#M(e,t,i,n){let r=t===void 0?void 0:this.#n[t];if(this.#p(r))return r;let o=new AbortController,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:n},u=(m,g=!1)=>{let{aborted:b}=o.signal,w=i.ignoreFetchAbort&&m!==void 0,y=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&m!==void 0);if(i.status&&(b&&!g?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),b&&!w&&!g)return d(o.signal.reason,y);let x=h,_=this.#n[t];return(_===h||_===void 0&&w&&g)&&(m===void 0?x.__staleWhileFetching!==void 0?this.#n[t]=x.__staleWhileFetching:this.#L(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#F(e,m,c.options,x))),m},l=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),d(m,!1)),d=(m,g)=>{let{aborted:b}=o.signal,w=b&&i.allowStaleOnFetchAbort,y=w||i.allowStaleOnFetchRejection,x=y||i.noDeleteOnFetchRejection,_=h;if(this.#n[t]===h&&(!x||!g&&_.__staleWhileFetching===void 0?this.#L(e,"fetch"):w||(this.#n[t]=_.__staleWhileFetching)),y)return i.status&&_.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),_.__staleWhileFetching;if(_.__returned===_)throw m},p=(m,g)=>{let b=this.#h?.(e,r,c);o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=w=>u(w,!0)))}),b&&b instanceof Promise?b.then(w=>m(w===void 0?void 0:w),g):b!==void 0&&m(b)};i.status&&(i.status.fetchDispatched=!0);let h=new Promise(p).then(u,l),f=Object.assign(h,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.#F(e,f,{...c.options,status:void 0}),t=this.#c.get(e)):this.#n[t]=f,f}#p(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=Ln.hasSubscribers,{status:n=zd()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#H(e,t);return n&&i&&(n.trace=!0,Ln.tracePromise(()=>r,n).catch(()=>{})),r}async#H(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:b,signal:w}=t;if(b&&(b.op="fetch",b.key=e,g&&(b.forceRefresh=!0),b.cache=this),!this.#R)return b&&(b.fetch="get"),this.#G(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:b});let y={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:u,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:f,ignoreFetchAbort:h,status:b,signal:w},x=this.#c.get(e);if(x===void 0){b&&(b.fetch="miss");let _=this.#M(e,x,y,m);return _.__returned=_}else{let _=this.#n[x];if(this.#p(_)){let C=i&&_.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",C&&(b.returnedStale=!0)),C?_.__staleWhileFetching:_.__returned=_}let k=this.#E(x);if(!g&&!k)return b&&(b.fetch="hit"),this.#K(x),n&&this.#C(x),b&&this.#D(b,x),_;let S=this.#M(e,x,y,m),v=S.__staleWhileFetching!==void 0&&i;return b&&(b.fetch=k?"stale":"refresh",v&&k&&(b.returnedStale=!0)),v?S.__staleWhileFetching:S.__returned=S}}forceFetch(e,t={}){let i=Ln.hasSubscribers,{status:n=zd()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#j(e,t);return n&&i&&(n.trace=!0,Ln.tracePromise(()=>r,n).catch(()=>{})),r}async#j(e,t={}){let i=await this.#H(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=ae.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let n=this.#Q(e,t);return i&&(i.value=n),ae.hasSubscribers&&ae.publish(i),n}#Q(e,t={}){let i=this.#l;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,status:r,forceRefresh:o,...a}=t;r&&o&&(r.forceRefresh=!0);let c=this.#G(e,a),u=o||c===void 0;if(r&&(r.memo=u?"miss":"hit",u||(r.value=c)),!u)return c;let l=i(e,c,{options:a,context:n});return r&&(r.value=l),this.#F(e,l,a),l}get(e,t={}){let{status:i=ae.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let n=this.#G(e,t);return i&&(n!==void 0&&(i.value=n),ae.hasSubscribers&&ae.publish(i)),n}#G(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,a=this.#c.get(e);if(a===void 0){o&&(o.get="miss");return}let c=this.#n[a],u=this.#p(c);return o&&this.#D(o,a),this.#E(a)?u?(o&&(o.get="stale-fetching"),i&&c.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),c.__staleWhileFetching):void 0):(r||this.#L(e,"expire"),o&&(o.get="stale"),i?(o&&(o.returnedStale=!0),c):void 0):(o&&(o.get=u?"fetching":"hit"),this.#K(a),n&&this.#C(a),u?c.__staleWhileFetching:c)}#Y(e,t){this.#y[t]=e,this.#b[e]=t}#K(e){e!==this.#d&&(e===this.#k?this.#k=this.#b[e]:this.#Y(this.#y[e],this.#b[e]),this.#Y(this.#d,e),this.#d=e)}delete(e){return this.#L(e,"delete")}#L(e,t){ae.hasSubscribers&&ae.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#a!==0){let n=this.#c.get(e);if(n!==void 0)if(this.#_?.[n]&&(clearTimeout(this.#_[n]),this.#_[n]=void 0),i=!0,this.#a===1)this.#Z(t);else{this.#q(n);let r=this.#n[n];if(this.#p(r)?r.__abortController.abort(new Error("deleted")):(this.#N||this.#s)&&(this.#N&&this.#t?.(r,e,t),this.#s&&this.#x?.push([r,e,t])),this.#c.delete(e),this.#u[n]=void 0,this.#n[n]=void 0,n===this.#d)this.#d=this.#y[n];else if(n===this.#k)this.#k=this.#b[n];else{let o=this.#y[n];this.#b[o]=this.#b[n];let a=this.#b[n];this.#y[a]=this.#y[n]}this.#a--,this.#w.push(n)}}if(this.#s&&this.#x?.length){let n=this.#x,r;for(;r=n?.shift();)this.#r?.(...r)}return i}clear(){return this.#Z("delete")}#Z(e){for(let t of this.#I({allowStale:!0})){let i=this.#n[t];if(this.#p(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#u[t];this.#N&&this.#t?.(i,n,e),this.#s&&this.#x?.push([i,n,e])}}if(this.#c.clear(),this.#n.fill(void 0),this.#u.fill(void 0),this.#g&&this.#S){this.#g.fill(0),this.#S.fill(0);for(let t of this.#_??[])t!==void 0&&clearTimeout(t);this.#_?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#k=0,this.#d=0,this.#w.length=0,this.#m=0,this.#a=0,this.#s&&this.#x){let t=this.#x,i;for(;i=t?.shift();)this.#r?.(...i)}}},Vk=typeof process=="object"&&process?process:{stdout:null,stderr:null},$6=s=>!!s&&typeof s=="object"&&(s instanceof Ia||s instanceof ap.default||j6(s)||z6(s)),j6=s=>!!s&&typeof s=="object"&&s instanceof Da.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==ap.default.Writable.prototype.pipe,z6=s=>!!s&&typeof s=="object"&&s instanceof Da.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function",_t=Symbol("EOF"),wt=Symbol("maybeEmitEnd"),Ut=Symbol("emittedEnd"),ga=Symbol("emittingEnd"),Dn=Symbol("emittedError"),ba=Symbol("closed"),Hk=Symbol("read"),ka=Symbol("flush"),Gk=Symbol("flushChunk"),Ve=Symbol("encoding"),ki=Symbol("decoder"),ie=Symbol("flowing"),Pn=Symbol("paused"),xi=Symbol("resume"),ne=Symbol("buffer"),he=Symbol("pipes"),re=Symbol("bufferLength"),Ud=Symbol("bufferPush"),xa=Symbol("bufferShift"),le=Symbol("objectMode"),H=Symbol("destroyed"),Vd=Symbol("error"),Hd=Symbol("emitData"),Kk=Symbol("emitEnd"),Gd=Symbol("emitEnd2"),nt=Symbol("async"),Kd=Symbol("abort"),_a=Symbol("aborted"),qn=Symbol("signal"),Es=Symbol("dataListeners"),Se=Symbol("discarded"),Fn=s=>Promise.resolve().then(s),U6=s=>s(),V6=s=>s==="end"||s==="finish"||s==="prefinish",H6=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,G6=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Cx=class{src;dest;opts;ondrain;constructor(s,e,t){this.src=s,this.dest=e,this.opts=t,this.ondrain=()=>s[xi](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(s){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},K6=class extends Cx{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(s,e,t){super(s,e,t),this.proxyErrors=i=>this.dest.emit("error",i),s.on("error",this.proxyErrors)}},J6=s=>!!s.objectMode,Y6=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",Ia=class extends Da.EventEmitter{[ie]=!1;[Pn]=!1;[he]=[];[ne]=[];[le];[Ve];[nt];[ki];[_t]=!1;[Ut]=!1;[ga]=!1;[ba]=!1;[Dn]=null;[re]=0;[H]=!1;[qn];[_a]=!1;[Es]=0;[Se]=!1;writable=!0;readable=!0;constructor(...s){let e=s[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");J6(e)?(this[le]=!0,this[Ve]=null):Y6(e)?(this[Ve]=e.encoding,this[le]=!1):(this[le]=!1,this[Ve]=null),this[nt]=!!e.async,this[ki]=this[Ve]?new Ex.StringDecoder(this[Ve]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ne]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[he]});let{signal:t}=e;t&&(this[qn]=t,t.aborted?this[Kd]():t.addEventListener("abort",()=>this[Kd]()))}get bufferLength(){return this[re]}get encoding(){return this[Ve]}set encoding(s){throw new Error("Encoding must be set at instantiation time")}setEncoding(s){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[le]}set objectMode(s){throw new Error("objectMode must be set at instantiation time")}get async(){return this[nt]}set async(s){this[nt]=this[nt]||!!s}[Kd](){this[_a]=!0,this.emit("abort",this[qn]?.reason),this.destroy(this[qn]?.reason)}get aborted(){return this[_a]}set aborted(s){}write(s,e,t){if(this[_a])return!1;if(this[_t])throw new Error("write after end");if(this[H])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(t=e,e="utf8"),e||(e="utf8");let i=this[nt]?Fn:U6;if(!this[le]&&!Buffer.isBuffer(s)){if(G6(s))s=Buffer.from(s.buffer,s.byteOffset,s.byteLength);else if(H6(s))s=Buffer.from(s);else if(typeof s!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[le]?(this[ie]&&this[re]!==0&&this[ka](!0),this[ie]?this.emit("data",s):this[Ud](s),this[re]!==0&&this.emit("readable"),t&&i(t),this[ie]):s.length?(typeof s=="string"&&!(e===this[Ve]&&!this[ki]?.lastNeed)&&(s=Buffer.from(s,e)),Buffer.isBuffer(s)&&this[Ve]&&(s=this[ki].write(s)),this[ie]&&this[re]!==0&&this[ka](!0),this[ie]?this.emit("data",s):this[Ud](s),this[re]!==0&&this.emit("readable"),t&&i(t),this[ie]):(this[re]!==0&&this.emit("readable"),t&&i(t),this[ie])}read(s){if(this[H])return null;if(this[Se]=!1,this[re]===0||s===0||s&&s>this[re])return this[wt](),null;this[le]&&(s=null),this[ne].length>1&&!this[le]&&(this[ne]=[this[Ve]?this[ne].join(""):Buffer.concat(this[ne],this[re])]);let e=this[Hk](s||null,this[ne][0]);return this[wt](),e}[Hk](s,e){if(this[le])this[xa]();else{let t=e;s===t.length||s===null?this[xa]():typeof t=="string"?(this[ne][0]=t.slice(s),e=t.slice(0,s),this[re]-=s):(this[ne][0]=t.subarray(s),e=t.subarray(0,s),this[re]-=s)}return this.emit("data",e),!this[ne].length&&!this[_t]&&this.emit("drain"),e}end(s,e,t){return typeof s=="function"&&(t=s,s=void 0),typeof e=="function"&&(t=e,e="utf8"),s!==void 0&&this.write(s,e),t&&this.once("end",t),this[_t]=!0,this.writable=!1,(this[ie]||!this[Pn])&&this[wt](),this}[xi](){this[H]||(!this[Es]&&!this[he].length&&(this[Se]=!0),this[Pn]=!1,this[ie]=!0,this.emit("resume"),this[ne].length?this[ka]():this[_t]?this[wt]():this.emit("drain"))}resume(){return this[xi]()}pause(){this[ie]=!1,this[Pn]=!0,this[Se]=!1}get destroyed(){return this[H]}get flowing(){return this[ie]}get paused(){return this[Pn]}[Ud](s){this[le]?this[re]+=1:this[re]+=s.length,this[ne].push(s)}[xa](){return this[le]?this[re]-=1:this[re]-=this[ne][0].length,this[ne].shift()}[ka](s=!1){do;while(this[Gk](this[xa]())&&this[ne].length);!s&&!this[ne].length&&!this[_t]&&this.emit("drain")}[Gk](s){return this.emit("data",s),this[ie]}pipe(s,e){if(this[H])return s;this[Se]=!1;let t=this[Ut];return e=e||{},s===Vk.stdout||s===Vk.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,t?e.end&&s.end():(this[he].push(e.proxyErrors?new K6(this,s,e):new Cx(this,s,e)),this[nt]?Fn(()=>this[xi]()):this[xi]()),s}unpipe(s){let e=this[he].find(t=>t.dest===s);e&&(this[he].length===1?(this[ie]&&this[Es]===0&&(this[ie]=!1),this[he]=[]):this[he].splice(this[he].indexOf(e),1),e.unpipe())}addListener(s,e){return this.on(s,e)}on(s,e){let t=super.on(s,e);if(s==="data")this[Se]=!1,this[Es]++,!this[he].length&&!this[ie]&&this[xi]();else if(s==="readable"&&this[re]!==0)super.emit("readable");else if(V6(s)&&this[Ut])super.emit(s),this.removeAllListeners(s);else if(s==="error"&&this[Dn]){let i=e;this[nt]?Fn(()=>i.call(this,this[Dn])):i.call(this,this[Dn])}return t}removeListener(s,e){return this.off(s,e)}off(s,e){let t=super.off(s,e);return s==="data"&&(this[Es]=this.listeners("data").length,this[Es]===0&&!this[Se]&&!this[he].length&&(this[ie]=!1)),t}removeAllListeners(s){let e=super.removeAllListeners(s);return(s==="data"||s===void 0)&&(this[Es]=0,!this[Se]&&!this[he].length&&(this[ie]=!1)),e}get emittedEnd(){return this[Ut]}[wt](){!this[ga]&&!this[Ut]&&!this[H]&&this[ne].length===0&&this[_t]&&(this[ga]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ba]&&this.emit("close"),this[ga]=!1)}emit(s,...e){let t=e[0];if(s!=="error"&&s!=="close"&&s!==H&&this[H])return!1;if(s==="data")return!this[le]&&!t?!1:this[nt]?(Fn(()=>this[Hd](t)),!0):this[Hd](t);if(s==="end")return this[Kk]();if(s==="close"){if(this[ba]=!0,!this[Ut]&&!this[H])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(s==="error"){this[Dn]=t,super.emit(Vd,t);let n=!this[qn]||this.listeners("error").length?super.emit("error",t):!1;return this[wt](),n}else if(s==="resume"){let n=super.emit("resume");return this[wt](),n}else if(s==="finish"||s==="prefinish"){let n=super.emit(s);return this.removeAllListeners(s),n}let i=super.emit(s,...e);return this[wt](),i}[Hd](s){for(let t of this[he])t.dest.write(s)===!1&&this.pause();let e=this[Se]?!1:super.emit("data",s);return this[wt](),e}[Kk](){return this[Ut]?!1:(this[Ut]=!0,this.readable=!1,this[nt]?(Fn(()=>this[Gd]()),!0):this[Gd]())}[Gd](){if(this[ki]){let e=this[ki].end();if(e){for(let t of this[he])t.dest.write(e);this[Se]||super.emit("data",e)}}for(let e of this[he])e.end();let s=super.emit("end");return this.removeAllListeners("end"),s}async collect(){let s=Object.assign([],{dataLength:0});this[le]||(s.dataLength=0);let e=this.promise();return this.on("data",t=>{s.push(t),this[le]||(s.dataLength+=t.length)}),await e,s}async concat(){if(this[le])throw new Error("cannot concat in objectMode");let s=await this.collect();return this[Ve]?s.join(""):Buffer.concat(s,s.dataLength)}async promise(){return new Promise((s,e)=>{this.on(H,()=>e(new Error("stream destroyed"))),this.on("error",t=>e(t)),this.on("end",()=>s())})}[Symbol.asyncIterator](){this[Se]=!1;let s=!1,e=async()=>(this.pause(),s=!0,{value:void 0,done:!0});return{next:()=>{if(s)return e();let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[_t])return e();let i,n,r=u=>{this.off("data",o),this.off("end",a),this.off(H,c),e(),n(u)},o=u=>{this.off("error",r),this.off("end",a),this.off(H,c),this.pause(),i({value:u,done:!!this[_t]})},a=()=>{this.off("error",r),this.off("data",o),this.off(H,c),e(),i({done:!0,value:void 0})},c=()=>r(new Error("stream destroyed"));return new Promise((u,l)=>{n=l,i=u,this.once(H,c),this.once("error",r),this.once("end",a),this.once("data",o)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Se]=!1;let s=!1,e=()=>(this.pause(),this.off(Vd,e),this.off(H,e),this.off("end",e),s=!0,{done:!0,value:void 0}),t=()=>{if(s)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(Vd,e),this.once(H,e),{next:t,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(s){if(this[H])return s?this.emit("error",s):this.emit(H),this;this[H]=!0,this[Se]=!0,this[ne].length=0,this[re]=0;let e=this;return typeof e.close=="function"&&!this[ba]&&e.close(),s?this.emit("error",s):this.emit(H),this}static get isStream(){return $6}},Z6=ot.realpathSync.native,Wn={lstatSync:ot.lstatSync,readdir:ot.readdir,readdirSync:ot.readdirSync,readlinkSync:ot.readlinkSync,realpathSync:Z6,promises:{lstat:Gt.lstat,readdir:Gt.readdir,readlink:Gt.readlink,realpath:Gt.realpath}},Rx=s=>!s||s===Wn||s===W6?Wn:{...Wn,...s,promises:{...Wn.promises,...s.promises}},Q6=/^\\\\\?\\([a-z]:)\\?$/i,X6=/^\\\\\?\\UNC\\([^\\]+\\[^\\]+)\\?$/i,eR=/^\\\\[^\\?]+\\[^\\]+$/,Jk=s=>s.replace(/\//g,"\\").replace(Q6,"$1\\").replace(X6,"\\\\$1\\").replace(eR,"$&\\"),tR=/^[\\/]{2}\?[\\/]unc[\\/][^\\/]+[\\/][^\\/]+(?:[\\/]|$)/i,sR=/^[\\/]{2}\?[\\/](?=[a-z]:)/i,iR=/^[\\/]{2}\?[\\/]unc(?=[\\/][^\\/]+[\\/][^\\/])/i,nR=/[\\/]/,qe=0,Ax=1,Ix=2,rt=4,Tx=6,Ox=8,Cs=10,Dx=12,Pe=15,Mn=~Pe,Jd=16,Yk=32,$n=64,He=128,wa=256,Ca=512,Zk=$n|He|Ca,rR=1023,Yd=s=>s.isFile()?Ox:s.isDirectory()?rt:s.isSymbolicLink()?Cs:s.isCharacterDevice()?Ix:s.isBlockDevice()?Tx:s.isSocket()?Dx:s.isFIFO()?Ax:qe,Qk=new Oa({max:2**12}),jn=s=>{let e=Qk.get(s);if(e)return e;let t=s.normalize("NFKD");return Qk.set(s,t),t},Xk=new Oa({max:2**12}),ya=s=>{let e=Xk.get(s);if(e)return e;let t=jn(s.toLowerCase());return Xk.set(s,t),t},ex=class extends Oa{constructor(){super({max:256})}},oR=class extends Oa{constructor(s=16*1024){super({maxSize:s,sizeCalculation:e=>e.length+1})}},Px=Symbol("PathScurry setAsCwd"),_e=class{name;root;roots;parent;nocase;isCWD=!1;#e;#i;get dev(){return this.#i}#t;get mode(){return this.#t}#o;get nlink(){return this.#o}#r;get uid(){return this.#r}#h;get gid(){return this.#h}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#m;get size(){return this.#m}#c;get blocks(){return this.#c}#u;get atimeMs(){return this.#u}#n;get mtimeMs(){return this.#n}#b;get ctimeMs(){return this.#b}#y;get birthtimeMs(){return this.#y}#k;get atime(){return this.#k}#d;get mtime(){return this.#d}#w;get ctime(){return this.#w}#x;get birthtime(){return this.#x}#v;#S;#g;#_;#N;#R;#s;#T;#O;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(s,e=qe,t,i,n,r,o){this.name=s,this.#v=n?ya(s):jn(s),this.#s=e&rR,this.nocase=n,this.roots=i,this.root=t||this,this.#T=r,this.#g=o.fullpath,this.#N=o.relative,this.#R=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=Rx(o.fs)}get fs(){return this.#e}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#T}resolve(s){if(!s)return this;let e=this.getRootString(s),t=s.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#D(t):this.#D(t)}#D(s){let e=this;for(let t of s)e=e.child(t);return e}children(){let s=this.#T.get(this);if(s)return s;let e=Object.assign([],{provisional:0});return this.#T.set(this,e),this.#s&=~Jd,e}child(s,e){if(s===""||s===".")return this;if(s==="..")return this.parent||this;let t=this.children(),i=this.nocase?ya(s):jn(s);for(let a of t)if(a.#v===i)return a;let n=this.parent?this.sep:"",r=this.#g?this.#g+n+s:void 0,o=this.newChild(s,qe,{...e,parent:this,fullpath:r});return this.canReaddir()||(o.#s|=He),t.push(o),o}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let s=this.name,e=this.parent;if(!e)return this.#N=this.name;let t=e.relative();return t+(!t||!e.parent?"":this.sep)+s}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let s=this.name,e=this.parent;if(!e)return this.#R=this.fullpathPosix();let t=e.relativePosix();return t+(!t||!e.parent?"":"/")+s}fullpath(){if(this.#g!==void 0)return this.#g;let s=this.name,e=this.parent;if(!e)return this.#g=this.name;let t=e.fullpath()+(e.parent?this.sep:"")+s;return this.#g=t}fullpathPosix(){if(this.#_!==void 0)return this.#_;if(this.sep==="/")return this.#_=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#_=`//?/${i}`:this.#_=i}let s=this.parent,e=s.fullpathPosix(),t=e+(!e||!s.parent?"":"/")+this.name;return this.#_=t}isUnknown(){return(this.#s&Pe)===qe}isType(s){return this[`is${s}`]()}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&Pe)===Ox}isDirectory(){return(this.#s&Pe)===rt}isCharacterDevice(){return(this.#s&Pe)===Ix}isBlockDevice(){return(this.#s&Pe)===Tx}isFIFO(){return(this.#s&Pe)===Ax}isSocket(){return(this.#s&Pe)===Dx}isSymbolicLink(){return(this.#s&Cs)===Cs}lstatCached(){return this.#s&Yk?this:void 0}readlinkCached(){return this.#O}realpathCached(){return this.#C}readdirCached(){let s=this.children();return s.slice(0,s.provisional)}canReadlink(){if(this.#O)return!0;if(!this.parent)return!1;let s=this.#s&Pe;return!(s!==qe&&s!==Cs||this.#s&wa||this.#s&He)}calledReaddir(){return!!(this.#s&Jd)}isENOENT(){return!!(this.#s&He)}isNamed(s){return this.nocase?this.#v===ya(s):this.#v===jn(s)}async readlink(){let s=this.#O;if(s)return s;if(this.canReadlink()&&this.parent)try{let e=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#O=t}catch(e){this.#I(e.code);return}}readlinkSync(){let s=this.#O;if(s)return s;if(this.canReadlink()&&this.parent)try{let e=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#O=t}catch(e){this.#I(e.code);return}}#B(s){this.#s|=Jd;for(let e=s.provisional;e<s.length;e++){let t=s[e];t&&t.#E()}}#E(){this.#s&He||(this.#s=(this.#s|He)&Mn,this.#U())}#U(){let s=this.children();s.provisional=0;for(let e of s)e.#E()}#q(){this.#s|=Ca,this.#P()}#P(){if(this.#s&$n)return;let s=this.#s;(s&Pe)===rt&&(s&=Mn),this.#s=s|$n,this.#U()}#W(s=""){s==="ENOTDIR"||s==="EPERM"?this.#P():s==="ENOENT"?this.#E():this.children().provisional=0}#A(s=""){s==="ENOTDIR"?this.parent.#P():s==="ENOENT"&&this.#E()}#I(s=""){let e=this.#s;e|=wa,s==="ENOENT"&&(e|=He),(s==="EINVAL"||s==="UNKNOWN")&&(e&=Mn),this.#s=e,s==="ENOTDIR"&&this.parent&&this.parent.#P()}#$(s,e){return this.#z(s,e)||this.#F(s,e)}#F(s,e){let t=Yd(s),i=this.newChild(s.name,t,{parent:this}),n=i.#s&Pe;return n!==rt&&n!==Cs&&n!==qe&&(i.#s|=$n),e.unshift(i),e.provisional++,i}#z(s,e){for(let t=e.provisional;t<e.length;t++){let i=e[t];if((this.nocase?ya(s.name):jn(s.name))===i.#v)return this.#J(s,i,t,e)}}#J(s,e,t,i){let n=e.name;return e.#s=e.#s&Mn|Yd(s),n!==s.name&&(e.name=s.name),t!==i.provisional&&(t===i.length-1?i.pop():i.splice(t,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#s&He)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(s){this.#A(s.code)}}lstatSync(){if((this.#s&He)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(s){this.#A(s.code)}}#V(s){let{atime:e,atimeMs:t,birthtime:i,birthtimeMs:n,blksize:r,blocks:o,ctime:a,ctimeMs:c,dev:u,gid:l,ino:d,mode:p,mtime:h,mtimeMs:f,nlink:m,rdev:g,size:b,uid:w}=s;this.#k=e,this.#u=t,this.#x=i,this.#y=n,this.#f=r,this.#c=o,this.#w=a,this.#b=c,this.#i=u,this.#h=l,this.#a=d,this.#t=p,this.#d=h,this.#n=f,this.#o=m,this.#l=g,this.#m=b,this.#r=w;let y=Yd(s);this.#s=this.#s&Mn|y|Yk,y!==qe&&y!==rt&&y!==Cs&&(this.#s|=$n)}#M=[];#p=!1;#H(s){this.#p=!1;let e=this.#M.slice();this.#M.length=0,e.forEach(t=>t(null,s))}readdirCB(s,e=!1){if(!this.canReaddir()){e?s(null,[]):queueMicrotask(()=>s(null,[]));return}let t=this.children();if(this.calledReaddir()){let n=t.slice(0,t.provisional);e?s(null,n):queueMicrotask(()=>s(null,n));return}if(this.#M.push(s),this.#p)return;this.#p=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,r)=>{if(n)this.#W(n.code),t.provisional=0;else{for(let o of r)this.#$(o,t);this.#B(t)}this.#H(t.slice(0,t.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let e=this.fullpath();if(this.#j)await this.#j;else{let t=()=>{};this.#j=new Promise(i=>t=i);try{for(let i of await this.#e.promises.readdir(e,{withFileTypes:!0}))this.#$(i,s);this.#B(s)}catch(i){this.#W(i.code),s.provisional=0}this.#j=void 0,t()}return s.slice(0,s.provisional)}readdirSync(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let e=this.fullpath();try{for(let t of this.#e.readdirSync(e,{withFileTypes:!0}))this.#$(t,s);this.#B(s)}catch(t){this.#W(t.code),s.provisional=0}return s.slice(0,s.provisional)}canReaddir(){if(this.#s&Zk)return!1;let s=Pe&this.#s;return s===qe||s===rt||s===Cs}shouldWalk(s,e){return(this.#s&rt)===rt&&!(this.#s&Zk)&&!s.has(this)&&(!e||e(this))}async realpath(){if(this.#C)return this.#C;if(!((Ca|wa|He)&this.#s))try{let s=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(s)}catch{this.#q()}}realpathSync(){if(this.#C)return this.#C;if(!((Ca|wa|He)&this.#s))try{let s=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(s)}catch{this.#q()}}[Px](s){if(s===this)return;s.isCWD=!1,this.isCWD=!0;let e=new Set([]),t=[],i=this;for(;i&&i.parent;)e.add(i),i.#N=t.join(this.sep),i.#R=t.join("/"),i=i.parent,t.push("..");for(i=s;i&&i.parent&&!e.has(i);)i.#N=void 0,i.#R=void 0,i=i.parent}},qx=class Fx extends _e{sep="\\";splitSep=nR;constructor(e,t=qe,i,n,r,o,a){super(e,t,i,n,r,o,a)}newChild(e,t=qe,i={}){return new Fx(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return tR.exec(e)?.[0]??_i.win32.parse(e).root}getRoot(e){if(e=Jk(e.toUpperCase()),e===this.root.name||/^[\\/]$/.test(e))return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new cp(e,{nocase:this.nocase,fs:this.fs}).root}sameRoot(e,t=this.root.name){return Jk(e.toUpperCase())===t}},Mx=class Lx extends _e{splitSep="/";sep="/";constructor(e,t=qe,i,n,r,o,a){super(e,t,i,n,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=qe,i={}){return new Lx(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Bx=class{root;rootPath;roots;cwd;#e;#i;#t;nocase;#o;constructor(s=process.cwd(),e,t,{nocase:i,childrenCacheSize:n=16*1024,fs:r=Wn}={}){this.#o=Rx(r),(s instanceof URL||s.startsWith("file://"))&&(s=(0,Nx.fileURLToPath)(s));let o=e.resolve(s);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new ex,this.#i=new ex,this.#t=new oR(n);let a=o.substring(this.rootPath.length).split(t);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let c=this.root,u=a.length-1,l=e.sep,d=this.rootPath,p=!1;for(let h of a){let f=u--;c=c.child(h,{relative:new Array(f).fill("..").join(l),relativePosix:new Array(f).fill("..").join("/"),fullpath:d+=(p?"":l)+h}),p=!0}this.cwd=c}depth(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.depth()}childrenCache(){return this.#t}resolve(...s){let e="";for(let n=s.length-1;n>=0;n--){let r=s[n];if(!(!r||r===".")&&(e=e?`${r}/${e}`:r,this.isAbsolute(r)))break}let t=this.#e.get(e);if(t!==void 0)return t;let i=this.cwd.resolve(e).fullpath();return this.#e.set(e,i),i}resolvePosix(...s){let e="";for(let n=s.length-1;n>=0;n--){let r=s[n];if(!(!r||r===".")&&(e=e?`${r}/${e}`:r,this.isAbsolute(r)))break}let t=this.#i.get(e);if(t!==void 0)return t;let i=this.cwd.resolve(e).fullpathPosix();return this.#i.set(e,i),i}relative(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relative()}relativePosix(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relativePosix()}basename(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.name}dirname(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),(s.parent||s).fullpath()}async readdir(s=this.cwd,e={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t}=e;if(s.canReaddir()){let i=await s.readdir();return t?i:i.map(n=>n.name)}else return[]}readdirSync(s=this.cwd,e={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0}=e;return s.canReaddir()?t?s.readdirSync():s.readdirSync().map(i=>i.name):[]}async lstat(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstat()}lstatSync(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstatSync()}async readlink(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=await s.readlink();return e?t:t?.fullpath()}readlinkSync(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=s.readlinkSync();return e?t:t?.fullpath()}async realpath(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=await s.realpath();return e?t:t?.fullpath()}realpathSync(s=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s.withFileTypes,s=this.cwd);let t=s.realpathSync();return e?t:t?.fullpath()}async walk(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=[];(!n||n(s))&&o.push(t?s:s.fullpath());let a=new Set,c=(l,d)=>{a.add(l),l.readdirCB((p,h)=>{if(p)return d(p);let f=h.length;if(!f)return d();let m=()=>{--f===0&&d()};for(let g of h)(!n||n(g))&&o.push(t?g:g.fullpath()),i&&g.isSymbolicLink()?g.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(a,r)?c(b,m):m()):g.shouldWalk(a,r)?c(g,m):m()},!0)},u=s;return new Promise((l,d)=>{c(u,p=>{if(p)return d(p);l(o)})})}walkSync(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=[];(!n||n(s))&&o.push(t?s:s.fullpath());let a=new Set([s]);for(let c of a){let u=c.readdirSync();for(let l of u){(!n||n(l))&&o.push(t?l:l.fullpath());let d=l;if(l.isSymbolicLink()){if(!(i&&(d=l.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,r)&&a.add(d)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(s=this.cwd,e={}){return typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd),this.stream(s,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e;(!n||n(s))&&(yield t?s:s.fullpath());let o=new Set([s]);for(let a of o){let c=a.readdirSync();for(let u of c){(!n||n(u))&&(yield t?u:u.fullpath());let l=u;if(u.isSymbolicLink()){if(!(i&&(l=u.realpathSync())))continue;l.isUnknown()&&l.lstatSync()}l.shouldWalk(o,r)&&o.add(l)}}}stream(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=new Ia({objectMode:!0});(!n||n(s))&&o.write(t?s:s.fullpath());let a=new Set,c=[s],u=0,l=()=>{let d=!1;for(;!d;){let p=c.shift();if(!p){u===0&&o.end();return}u++,a.add(p);let h=(m,g,b=!1)=>{if(m)return o.emit("error",m);if(i&&!b){let w=[];for(let y of g)y.isSymbolicLink()&&w.push(y.realpath().then(x=>x?.isUnknown()?x.lstat():x));if(w.length){Promise.all(w).then(()=>h(null,g,!0));return}}for(let w of g)w&&(!n||n(w))&&(o.write(t?w:w.fullpath())||(d=!0));u--;for(let w of g){let y=w.realpathCached()||w;y.shouldWalk(a,r)&&c.push(y)}d&&!o.flowing?o.once("drain",l):f||l()},f=!0;p.readdirCB(h,!0),f=!1}};return l(),o}streamSync(s=this.cwd,e={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof _e||(e=s,s=this.cwd);let{withFileTypes:t=!0,follow:i=!1,filter:n,walkFilter:r}=e,o=new Ia({objectMode:!0}),a=new Set;(!n||n(s))&&o.write(t?s:s.fullpath());let c=[s],u=0,l=()=>{let d=!1;for(;!d;){let p=c.shift();if(!p){u===0&&o.end();return}u++,a.add(p);let h=p.readdirSync();for(let f of h)(!n||n(f))&&(o.write(t?f:f.fullpath())||(d=!0));u--;for(let f of h){let m=f;if(f.isSymbolicLink()){if(!(i&&(m=f.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(a,r)&&c.push(m)}}d&&!o.flowing&&o.once("drain",l)};return l(),o}chdir(s=this.cwd){let e=this.cwd;this.cwd=typeof s=="string"?this.cwd.resolve(s):s,this.cwd[Px](e)}},cp=class extends Bx{sep="\\";constructor(s=process.cwd(),e={}){let{nocase:t=!0}=e;typeof s=="string"&&!s.startsWith("file://")&&(s=s.replace(sR,"").replace(iR,"\\")),super(s,_i.win32,"\\",{...e,nocase:t}),this.nocase=t;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(s){return _i.win32.parse(s).root.toUpperCase()}newRoot(s){return new qx(this.rootPath,rt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")||s.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(s)}},up=class extends Bx{sep="/";constructor(s=process.cwd(),e={}){let{nocase:t=!1}=e;super(s,_i.posix,"/",{...e,nocase:t}),this.nocase=t}parseRootPath(s){return"/"}newRoot(s){return new Mx(this.rootPath,rt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")}},Wx=class extends up{constructor(s=process.cwd(),e={}){let{nocase:t=!0}=e;super(s,{...e,nocase:t})}},yq=process.platform==="win32"?qx:Mx,aR=process.platform==="win32"?cp:process.platform==="darwin"?Wx:up,cR=s=>s.length>=1,uR=s=>s.length>=1,lR=Symbol.for("nodejs.util.inspect.custom"),$x=class jx{#e;#i;#t;length;#o;#r;#h;#l;#f;#a;#m=!0;constructor(e,t,i,n){if(!cR(e))throw new TypeError("empty pattern list");if(!uR(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#i=t,this.#t=i,this.#o=n,this.#t===0){if(this.isUNC()){let r=this.#c()?6:4,o=this.#e.slice(0,r),a=this.#i.slice(0,r),c=this.#e.slice(r),u=this.#i.slice(r);c[0]===""&&(c.shift(),u.shift());let l=[...o,""].join("/"),d=[...a,""].join("/");this.#e=[l,...c],this.#i=[d,...u],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...c]=this.#i;o[0]===""&&(o.shift(),c.shift());let u=`${r}/`,l=`${a}/`;this.#e=[u,...o],this.#i=[l,...c],this.length=this.#e.length}}}[lR](){return`Pattern <${this.#i.slice(this.#t).join("/")}>`}pattern(){return this.#e[this.#t]}isString(){return typeof this.#e[this.#t]=="string"}isGlobstar(){return this.#e[this.#t]===U}isMatcher(){return typeof this.#e[this.#t]=="object"}globString(){return this.#h=this.#h||(this.#t===0?this.isAbsolute()?this.#i[0]+this.#i.slice(1).join("/"):this.#i.join("/"):this.#i.slice(this.#t).join("/"))}hasMore(){return this.length>this.#t+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new jx(this.#e,this.#i,this.#t+1,this.#o),this.#r.#a=this.#a,this.#r.#f=this.#f,this.#r.#l=this.#l,this.#r):this.#r=null}#c(){let e=this.#e;return e[2]==="?"&&typeof e[3]=="string"&&/^unc$/i.test(e[3])}isUNC(){let e=this.#e,t=this.#c()?4:2;return this.#f!==void 0?this.#f:this.#f=this.#o==="win32"&&this.#t===0&&e[0]===""&&e[1]===""&&typeof e[t]=="string"&&!!e[t]&&typeof e[t+1]=="string"&&!!e[t+1]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#o==="win32"&&this.#t===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#t===0?e:""}checkFollowGlobstar(){return!(this.#t===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#t===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}},dR=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",tx=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;slashRoot;constructor(s,{nobrace:e,nocase:t,noext:i,noglobstar:n,normalize:r,platform:o=dR,root:a,windowsPathsNoEscape:c,allowWindowsEscape:u},l){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,c=!!c||u===!1,this.mmopts={dot:!0,nobrace:e,nocase:t,noext:i,noglobstar:n,normalize:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0,windowsPathsNoEscape:c};let d=l?.resolve(a??"/").fullpath()??"/";this.slashRoot=op(d.replace(/\\/g,"/").replace(/\/$/,""),{windowsPathsNoEscape:c});for(let p of s)this.add(p)}add(s){let e=new As(s,this.mmopts);for(let t=0;t<e.set.length;t++){let i=e.set[t],n=e.globParts[t];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let r=new $x(i,n,0,this.platform),o=r.root()==="/"?`${this.slashRoot}/${r.rest()?.globString()??""}`:r.globString(),a=new As(o,this.mmopts),c=n[n.length-1]==="**",u=r.isAbsolute();u?this.absolute.push(a):this.relative.push(a),c&&(u?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(s){let e=s.fullpath(),t=`${e}/`,i=s.relative()||".",n=`${i}/`;for(let r of this.relative)if(r.match(i)||r.match(n))return!0;for(let r of this.absolute)if(r.match(e)||r.match(t))return!0;return!1}childrenIgnored(s){let e=`${s.fullpath()}/`,t=`${s.relative()||"."}/`;for(let i of this.relativeChildren)if(i.match(t))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}},pR=class zx{parent;store;constructor(e){this.parent=e}copy(){return new zx(this)}#e(e){let t=this.store?.get(e);return t||!this.parent?t:this.parent.#e(e)}hasWalked(e,t){return!!this.#e(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),n=this.#e(i);n?n.add(t.globString()):(this.store??=new Map).set(i,new Set([t.globString()]))}},Ux=class ip{static ABSOLUTE=2;static IF_DIR=1;store=new Map;add(e,t,i){let n=(t?ip.ABSOLUTE:0)|(i?ip.IF_DIR:0),r=this.store.get(e);this.store.set(e,r===void 0?n:n&r)}},hR=class{store=new Map;add(s,e){if(!s.canReaddir())return;let t=this.store.get(s);t?t.find(i=>i.globString()===e.globString())||t.push(e):this.store.set(s,[e])}get(s){let e=this.store.get(s);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(s=>[s,this.store.get(s)])}keys(){return[...this.store.keys()].filter(s=>s.canReaddir())}},sx=class Vx{hasWalkedCache;matches=new Ux;subwalks=new hR;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new pR}processPatterns(e,t){this.patterns=t;let i=t.map(n=>[e,n]);for(let[n,r]of i){this.hasWalkedCache.storeWalked(n,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){n=n.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=r.rest();if(d)r=d;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let c,u,l=!1;for(;typeof(c=r.pattern())=="string"&&(u=r.rest());)n=n.resolve(c),r=u,l=!0;if(c=r.pattern(),u=r.rest(),l){if(this.hasWalkedCache.hasWalked(n,r))continue;this.hasWalkedCache.storeWalked(n,r)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(n.resolve(c),a,d);continue}else if(c===U){(!n.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(n,r);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(n,a,d===""||d===".");else if(d===".."){let h=n.parent||n;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,a,!0)}}else typeof c=="object"&&this.subwalks.add(n,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Vx(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),n=this.child();for(let r of t)for(let o of i){let a=o.isAbsolute(),c=o.pattern(),u=o.rest();c===U?n.testGlobstar(r,o,u,a):typeof c=="object"?n.testMatcher(r,c,u,a):n.testString(r,c,u,a)}return n}testGlobstar(e,t,i,n){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let r=i.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,i.rest(),n);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,i)}else typeof r=="object"&&this.testMatcher(e,r,i.rest(),n)}}testMatcher(e,t,i,n){t.testUnchecked(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,t,i,n){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}},{ABSOLUTE:va,IF_DIR:Sa}=Ux,fR=(s,e,t)=>typeof s=="string"?new tx([s],e,t):Array.isArray(s)?new tx(s,e,t):s,Hx=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#i;#t;signal;maxDepth;includeChildMatches;constructor(s,e,t){if(this.patterns=s,this.path=e,this.opts=t,this.#t=!t.posix&&t.platform==="win32"?"\\":"/",this.includeChildMatches=t.includeChildMatches!==!1,(t.ignore||!this.includeChildMatches)&&(this.#i=fR(t.ignore??[],t,e),!this.includeChildMatches&&typeof this.#i.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=t.maxDepth||1/0,t.signal&&(this.signal=t.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#o(s){return this.seen.has(s)||!!this.#i?.ignored?.(s)}#r(s){return!!this.#i?.childrenIgnored?.(s)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let s;for(;!this.paused&&(s=this.#e.shift());)s()}onResume(s){this.paused?this.#e.push(s):s()}async matchCheck(s,e){if(e&&this.opts.nodir)return;let t,i;if(this.opts.realpath){if(t=s.realpathCached()||await s.realpath(),!t)return;i=t}else i=s;let n=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let r=await n.realpath();r&&(r.isUnknown()||this.opts.stat)&&await r.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(s,e){return s&&(this.maxDepth===1/0||s.depth()<=this.maxDepth)&&(!e||s.canReaddir())&&(!this.opts.nodir||!s.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!s.isSymbolicLink()||!s.realpathCached()?.isDirectory())&&!this.#o(s)?s:void 0}matchCheckSync(s,e){if(e&&this.opts.nodir)return;let t,i;if(this.opts.realpath){if(t=s.realpathCached()||s.realpathSync(),!t)return;i=t}else i=s;let n=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let r=n.realpathSync();r&&(r?.isUnknown()||this.opts.stat)&&r.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(s,e){this.#o(s)||this.#h(s,e)}#h(s,e){if(!this.includeChildMatches&&this.#i?.add){let n=`${s.relativePosix()}/**`;this.#i.add(n)}let t=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(s);let i=this.opts.mark&&s.isDirectory()?this.#t:"";if(this.opts.withFileTypes)this.matchEmit(s);else if(t){let n=this.opts.posix?s.fullpathPosix():s.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?s.relativePosix():s.relative(),r=this.opts.dotRelative&&!n.startsWith(`..${this.#t}`)?`.${this.#t}`:"";this.matchEmit(n?r+n+i:`.${i}`)}}async match(s,e,t){let i=await this.matchCheck(s,t);i&&this.matchFinish(i,e)}matchSync(s,e,t){let i=this.matchCheckSync(s,t);i&&this.#h(i,e)}walkCB(s,e,t){if(this.signal?.aborted)return t();this.walkCB2(s,e,new sx(this.opts),t)}walkCB2(s,e,t,i){if(this.#r(s)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2(s,e,t,i));return}t.processPatterns(s,e);let n=1,r=()=>{--n===0&&i()};for(let[o,a]of t.matches.store)this.#o(o)||(n++,this.match(o,!!(a&va),!!(a&Sa)).then(()=>r()));for(let o of t.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,t,r):o.readdirCB((c,u)=>this.walkCB3(o,u,t,r),!0)}r()}walkCB3(s,e,t,i){let n=t.filterEntries(s,e),r=1,o=()=>{--r===0&&i()};for(let[a,c]of n.matches.store)this.#o(a)||(r++,this.match(a,!!(c&va),!!(c&Sa)).then(()=>o()));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(s,e,t){if(this.signal?.aborted)return t();this.walkCB2Sync(s,e,new sx(this.opts),t)}walkCB2Sync(s,e,t,i){if(this.#r(s)||this.signal?.aborted)return i();if(this.paused){this.onResume(()=>this.walkCB2Sync(s,e,t,i));return}t.processPatterns(s,e);let n=1,r=()=>{--n===0&&i()};for(let[o,a]of t.matches.store)this.#o(o)||this.matchSync(o,!!(a&va),!!(a&Sa));for(let o of t.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let a=o.readdirSync();this.walkCB3Sync(o,a,t,r)}r()}walkCB3Sync(s,e,t,i){let n=t.filterEntries(s,e),r=1,o=()=>{--r===0&&i()};for(let[a,c]of n.matches.store)this.#o(a)||this.matchSync(a,!!(c&va),!!(c&Sa));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2Sync(a,c,n.child(),o);o()}},ix=class extends Hx{matches=[];constructor(s,e,t){super(s,e,t)}matchEmit(s){this.matches.push(s)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):s(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}},nx=class extends Hx{results;constructor(s,e,t){super(s,e,t),this.results=new Ia({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(s){this.results.write(s),this.results.flowing||this.pause()}stream(){let s=this.path;return s.isUnknown()?s.lstat().then(()=>{this.walkCB(s,this.patterns,()=>this.results.end())}):this.walkCB(s,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}},mR=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Is=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(s,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=(0,wx.fileURLToPath)(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");let t=typeof s=="string"?[s]:s;if(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||mR,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"?cp:e.platform==="darwin"?Wx:e.platform?up:aR;this.scurry=new c(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape},r=this.pattern.map(c=>new As(c,n)),[o,a]=r.reduce((c,u)=>(c[0].push(...u.set),c[1].push(...u.globParts),c),[[],[]]);this.patterns=o.map((c,u)=>{let l=a[u];if(!l)throw new Error("invalid pattern object");return new $x(c,l,0,this.platform)})}async walk(){return await new ix(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 ix(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 nx(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 nx(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()}},gR=(s,e={})=>{for(let t of Array.isArray(s)?s:[s])if(new As(t,e).hasMagic())return!0;return!1};function Pa(s,e={}){return new Is(s,e).streamSync()}function Gx(s,e={}){return new Is(s,e).stream()}function qa(s,e={}){return new Is(s,e).walkSync()}async function rx(s,e={}){return new Is(s,e).walk()}function Fa(s,e={}){return new Is(s,e).iterateSync()}function Kx(s,e={}){return new Is(s,e).iterate()}var bR=Pa,kR=Object.assign(Gx,{sync:Pa}),xR=Fa,_R=Object.assign(Kx,{sync:Fa}),wR=Object.assign(qa,{stream:Pa,iterate:Fa}),ox=Object.assign(rx,{glob:rx,globSync:qa,sync:wR,globStream:Gx,stream:kR,globStreamSync:Pa,streamSync:bR,globIterate:Kx,iterate:_R,globIterateSync:Fa,iterateSync:xR,Glob:Is,hasMagic:gR,escape:op,unescape:bx});ox.glob=ox;var Jx=F(require("vscode"));function Yx(s,e,t,i){let r=`Could not connect to ${i.url??i.host??"server"}: ${i.reason}. Check the hostname, VPN/network access, and API token.`;e.updateConnectionStatus(s,"disconnected"),t.appendLine(`[connection] ${r}`),Jx.window.showErrorMessage(`Beyond Work: ${r}`)}var V={},Ts,O,Ee,Hn,La,Ba,Ge,wi,Os,yi;async function Ma(s,e,t){if(console.log("onWorkblockChange",s,e?.state),!e)return;let i=Ee[s];if(!i)return;let n=await bi(i,yi);if(!n)return;let r=En(e),o=En(n);t.setSyncStatus(s,JSON.stringify(r)!==JSON.stringify(o))}function yR(s){let[e,t,i]=s.split("|").map(decodeURIComponent);if(!e||!t||!i)throw new Error(`Invalid branch binding key: ${s}`);return{host:e,workblockId:t,branch:i}}async function Un(s,e,t,i){let n=await e.listWorkblockDefinitions(),r=[];try{r=await e.listStudioWorkspaces(i)}catch(u){O.appendLine(`[workspaces] Failed to list Studio workspaces on ${s}: ${u?.message??u}`)}let o={},a=Ah(r);for(let u of n)o[u.id]=u.branches??[];let c=n.filter(u=>u.user_id===i||u.branch_user===i||(a[u.id]??[]).length>0?!0:Rh(o[u.id]??[],i).length>0);t.setWorkblocksForHost(s,c);for(let u of c){let l=u.user_id===i||u.branch_user===i,d=o[u.id]??[],p=Ih(d,a[u.id]??[],i,l);t.setBranchesForWorkblock(s,u.id,p,!1,!1)}t.refresh()}async function Xx(s,e,t,i){let n=Me(s,e,t),r=Ba[n];if(r)return{id:r};let o=V[s];if(!o)throw new Error(`Not connected to ${s}`);let a=await dc(o,{workblockId:e,branch:t,title:i,userId:Os[s]?.id,log:c=>O.appendLine(c)});return e_(s,n,a.streamId)}function e_(s,e,t){return Hn[t]=s,La[t]=e,Ba[e]=t,{id:t}}async function zn(s){return Xx(s.connection.host,s.workblock.id,s.branch.name,`${s.workblock.name} (${s.branch.name})`)}async function Wa(s,e,t){V[s]&&(V[s].disconnect(),delete V[s]);let i=await Dh(e,s);if(!i){let r=`Failed to retrieve token for ${s}.`;throw t.updateConnectionStatus(s,"disconnected"),O.appendLine(`[connection] ${r}`),N.window.showErrorMessage(`Beyond Work: ${r}`),new Error(r)}let n=new pr;n.addCurrentUserHandler(r=>{Os[s]=r,Un(s,n,t,r.id).then(()=>Qx(s,e,t)).catch(o=>{O.appendLine(`${o}`),N.window.showErrorMessage(`Beyond Work: ${o}`)})}),n.addStreamHandler(async r=>{t.updateConnectionStatus(s,"connected");for(let o of r)Hn[o.id]=s;try{let o=Os[s];if(!o)return;await Un(s,n,t,o.id),await Qx(s,e,t)}catch(o){O.appendLine(`${o}`),N.window.showErrorMessage(`Beyond Work: ${o}`)}}),n.addEventHandler(async r=>{for(let o of r){if(o.type==="workblock"){let a=o.stream_id,c=a?La[a]:void 0;if(!c&&o.work_block?.workblock_id&&o.work_block?.branch&&(c=Me(s,o.work_block.workblock_id,o.work_block.branch)),!c)continue;let u=o.work_block?.work_block;if(!u&&a&&o.work_block?.workblock_id&&o.work_block?.commit_ref)try{u=await n.getWorkblock(a)}catch(l){let d=l?.message??String(l);O.appendLine(`[events] Failed to resolve workblock for ${a}: ${d}`)}Ge[c]!==void 0&&u&&await Rn(Ge[c],u,n),await Ma(c,u,t),u&&(wi[c]=u)}if(o.type==="stream"){let a=o.stream?.stream;a?.id&&(Hn[a.id]=s);let c=Os[s];c&&await Un(s,n,t,c.id)}}}),n.addOnDisconnect(()=>{V[s]===n&&t.updateConnectionStatus(s,"disconnected")}),n.addErrorHandler(r=>{O.appendLine(`[ws] ${r}`),N.window.showErrorMessage(`Beyond Work: ${r}`)}),n.addConnectionErrorHandler(r=>{V[s]===n&&(Yx(s,t,O,r),r.statusCode===401&&Ph(e,s,i).then(o=>{if(o&&V[s]===n)return Wa(s,e,t)}).catch(o=>{O.appendLine(`[connection] ${String(o)}`)}))});try{t.updateConnectionStatus(s,"connecting"),n.connect(s,i,e),V[s]=n}catch(r){t.updateConnectionStatus(s,"disconnected");let o=r?.message??String(r);throw O.appendLine(`[connection] Failed to connect to ${s}: ${o}`),N.window.showErrorMessage(`Beyond Work: Failed to connect to ${s}: ${o}`),r}return e.globalState.update("bw_current_connection",s),n}function vR(s){Ts=N.languages.createDiagnosticCollection("validation"),O=N.window.createOutputChannel("Beyond Work"),yi=new ha(O),Ee=s.globalState.get("bw_streams_dir")??{},Ge=s.globalState.get("bw_sync_streams")??{},Hn={},La={},Ba={},wi={},Os={};let e=new kr(s,Ee,Ge),t=N.window.createTreeView("beyondworkConnections",{treeDataProvider:e,showCollapseAll:!1,canSelectMany:!0}),i=new dp,n=N.workspace.registerTextDocumentContentProvider("bw-manifest",i),r=async(k,S)=>{if(!["node_modules/",".git/"].some(C=>k.path.includes(C))){for(let[C,A]of Object.entries(Ee))if(C.includes("|")&&k.fsPath.startsWith(A))try{let{host:T,workblockId:L,branch:Y}=yR(C);if(Ge[C]!==void 0&&S){let G=await Xx(T,L,Y);await lp(A,T,G.id)&&e.setSyncStatus(C,!1)}else await Ma(C,wi[C],e)}catch(T){O.appendLine(`[sync] ${T?.message??T}`)}}},o=N.commands.registerCommand("beyondwork.beyondwork.addConnection",async()=>{let k=await N.window.showInputBox({prompt:"Enter the hostname you want to connect to",placeHolder:"Hostname (eg. acme.prod1-eu1.bworker.ai)",validateInput:S=>{try{new URL(`${S.startsWith("https://")?"":"https://"}${S}`);return}catch{return"Please enter a valid hostname"}}});k&&e.addConnection({host:k,status:"disconnected"})}),a=N.commands.registerCommand("beyondwork.beyondwork.connectToTenant",async k=>{k.status="connecting",e.updateConnectionStatus(k.host,"connecting"),await Wa(k.host,s,e)}),c=N.commands.registerCommand("beyondwork.beyondwork.clearConnections",()=>{qh(s),e.clear();for(let k in V)V[k].disconnect(),delete V[k];N.window.showInformationMessage("All connections cleared.")}),u=N.commands.registerCommand("beyondwork.beyondwork.removeConnection",async k=>{let S;if(k&&(S=k.connection),!S){let C=e.getConnections();if(C.length===0){N.window.showInformationMessage("No connections to remove.");return}S=(await N.window.showQuickPick(C.map(T=>({label:T.host,description:T.status,connection:T})),{placeHolder:"Select a connection to remove"}))?.connection}if(!S)return;await N.window.showWarningMessage(`Are you sure you want to remove the connection to ${S.host}?`,"Yes","No")==="Yes"&&(V[S.host]&&(V[S.host].disconnect(),delete V[S.host]),e.removeConnection(S))}),l=N.commands.registerCommand("beyondwork.beyondwork.storeWorkblock",async k=>{O.appendLine("Store workblock");let S={canSelectFolders:!0,canSelectFiles:!1,canSelectMany:!1,openLabel:"Select folder for the workblock"},v=await N.window.showOpenDialog(S);if(!v?.length)return;if(!await Cn(v[0].fsPath)){N.window.showErrorMessage("No manifest.yaml found in selected directory");return}let A=await bi(v[0].fsPath,yi);if(!A){N.window.showErrorMessage("Failed to assemble workblock from directory");return}let T=k?.connection?.host;if(!T)return;let L=V[T];if(!L){N.window.showErrorMessage(`Not connected to ${T}`);return}O.appendLine(`Storing workblock '${A.name}' on ${T}`);try{let{stream:Y,warnings:G}=await L.storeWorkblock(A);O.appendLine(`Stored workblock '${A.name}' using stream ${Y.id} (${Y.title})`),G.length>0&&(O.appendLine(`Validation warnings: ${JSON.stringify(G)}`),N.window.showWarningMessage(`Stored '${A.name}' with ${G.length} validation warning(s). See "Beyond Work" output for details.`)),Hn[Y.id]=T;let Ke=Y.branch??"main",Ds=Me(T,A.id,Ke);La[Y.id]=Ds,Ba[Ds]=Y.id,Ee[Ds]=v[0].fsPath,s.globalState.update("bw_streams_dir",Ee),wi[Ds]=A;let pp=Os[T];pp&&await Un(T,L,e,pp.id),N.window.showInformationMessage(`Stored and bound '${A.name}' on ${Ke}`)}catch(Y){let G=Y?.message??String(Y);O.appendLine(`Failed to store workblock: ${G}`),N.window.showErrorMessage(`Failed to store workblock: ${G}`)}}),d=N.commands.registerCommand("beyondwork.beyondwork.bindStream",async k=>{O.appendLine(`Binding ${k.workblock.name} ${k.branch.name} ${k.dir}`);let S={canSelectFolders:!0,canSelectFiles:!1,canSelectMany:!1,openLabel:"Select folder for the workblock"};k.dir&&(S.defaultUri=N.Uri.file(k.dir));let v=await N.window.showOpenDialog(S);if(v?.length){Ee[k.key]=v[0].fsPath,s.globalState.update("bw_streams_dir",Ee),e.refresh();try{let C=await zn(k),A=V[k.connection.host],T=await A.getWorkblock(C.id);T?(await Rn(v[0].fsPath,T,A),wi[k.key]=T,await Ma(k.key,T,e),O.appendLine(`Fetched ${k.workblock.name} (${k.branch.name}) into ${v[0].fsPath}`)):O.appendLine(`No remote workblock present for ${k.workblock.name} (${k.branch.name})`)}catch(C){O.appendLine(`Failed to fetch remote workblock for ${k.workblock.name}: ${C?.message??C}`)}}}),p=N.commands.registerCommand("beyondwork.beyondwork.get",async k=>{if(O.show(!0),O.appendLine(`Getting workblock workblockId=${k.workblock.id} branch=${k.branch.name} host=${k.connection.host}`),!k.dir){N.window.showErrorMessage("Please bind a directory to the branch first");return}let S=k.dir,v=V[k.connection.host];if(!v){N.window.showErrorMessage(`Not connected to ${k.connection.host}. Connect first, then retry.`);return}try{await N.window.withProgress({location:N.ProgressLocation.Notification,title:`Beyond Work: Getting ${k.workblock.name} (${k.branch.name})`,cancellable:!0},async(C,A)=>{let T,L=new Promise((Y,G)=>{T=A.onCancellationRequested(()=>G(new Error("Cancelled")))});try{let Y=await zn(k),G=await Promise.race([v.getWorkblock(Y.id),L]);if(O.appendLine(`Got workblock ${k.workblock.id} (${k.branch.name}): ${G?G.id:"none"}`),!G){N.window.showErrorMessage("No workblock in workspace");return}await Rn(S,G,v),wi[k.key]=G,await Ma(k.key,G,e)}finally{T?.dispose()}})}catch(C){let A=C?.message??String(C);O.appendLine(`Failed to get workblock ${k.workblock.id} (${k.branch.name}): ${A}`),N.window.showErrorMessage(`Failed to get workblock: ${A}`)}}),h=N.commands.registerCommand("beyondwork.beyondwork.set",async k=>{if(O.appendLine(`Setting workblock ${k.workblock.id} (${k.branch.name})`),!k.dir){N.window.showErrorMessage("Please bind a directory to the branch first");return}let S=await zn(k);await lp(k.dir,k.connection.host,S.id)&&e.setSyncStatus(k.key,!1)}),f=async k=>{let S=await bi(k.dir,yi),v=await zn(k),C=await V[k.connection.host].getWorkblock(v.id),A=N.Uri.parse("bw-manifest:local.yaml"),T=N.Uri.parse("bw-manifest:stored.yaml");S&&i.setContent(A,(0,Vn.stringify)(En(S))),C&&i.setContent(T,(0,Vn.stringify)(En(C))),N.commands.executeCommand("vscode.diff",A,T,"Local vs stored workblock")},m=async k=>{let S=k.connection.host,v=V[S];if(!v){N.window.showErrorMessage(`Not connected to ${S}`);return}let C=hr(k.branch.name);if(!C){N.window.showErrorMessage(`Beyond Work: ${k.branch.name} has no version branch to start a conversation on.`);return}try{let A=await Eh(v,k.workblock.id,C);A.branch&&e_(S,Me(S,k.workblock.id,A.branch),A.id),O.appendLine(`Created conversation ${A.id} on ${C}${A.branch?` (${A.branch})`:""}`);let T=Os[S];T&&await Un(S,v,e,T.id)}catch(A){let T=A?.message??String(A);O.appendLine(`Failed to create conversation on ${C}: ${T}`),N.window.showErrorMessage(`Beyond Work: Failed to create conversation: ${T}`)}},g=N.commands.registerCommand("beyondwork.beyondwork.showStreamOptions",async k=>{O.appendLine(`Branch options ${k.workblock.id} (${k.branch.name})`);let S=hc(k.dir),v=Th({branch:k.branch.name,dir:k.dir,syncEnabled:Ge[k.key]!==void 0,modified:k.modified});N.window.showQuickPick(v,{placeHolder:"Select an action"}).then(C=>{if(C)switch(C){case S:N.commands.executeCommand("beyondwork.beyondwork.bindStream",k);break;case ce.GetBranch:N.commands.executeCommand("beyondwork.beyondwork.get",k);break;case ce.StoreBranch:N.commands.executeCommand("beyondwork.beyondwork.set",k);break;case ce.EnableSync:Ge[k.key]=k.dir,s.globalState.update("bw_sync_streams",Ge),e.refresh();break;case ce.DisableSync:delete Ge[k.key],s.globalState.update("bw_sync_streams",Ge),e.refresh();break;case ce.NewConversation:m(k);break;case ce.CompareChanges:f(k);break;case ce.RemoveDirectoryBinding:delete Ee[k.key],delete Ge[k.key],s.globalState.update("bw_streams_dir",Ee),e.refresh();break}})}),b=N.commands.registerCommand("beyondwork.beyondwork.storeSelected",async()=>{let k=t.selection.filter(S=>S.contextValue==="beyondwork.branch");for(let S of k){let v=S;if(v.dir){let C=await zn(v);await lp(v.dir,v.connection.host,C.id)}}}),w=N.commands.registerCommand("beyondwork.beyondwork.help",async()=>{let k=N.window.createWebviewPanel("help","Beyond Work Help",N.ViewColumn.One,{enableCommandUris:!0}),S=new Yl({html:!0,linkify:!0,typographer:!0});k.webview.html=S.render(`# Beyond Work VSCode Extension
|
|
176
176
|
|
|
177
177
|
Use this to edit workblocks via VSCode. The extension allows you to connect to Beyond Work and bind workblocks to directories on your local machine.
|
|
178
178
|
The workblocks in those workspaces can then be stored as files on your local machine.
|