Merge pull request #146 from yunyingk/skill-time
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled

feat: multi-host AI agent skill bridging and workspace filtering
This commit is contained in:
yunyingk authored and GitHub committed 2026-09-18 22:33:15 +08:00
commit 2116bf6141
10 files changed
+975 -182

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
{
"skill": {
"/Users/yingqing/.agents/skills/dws/SKILL.md": { "enable": false },
"/Users/yingqing/.agents/skills/lark-suite/SKILL.md": { "enable": false }
}
}
+178 -175
View File
@@ -1,30 +1,30 @@
import{createRequire as ig0}from"node:module";var hg0=Object.create;var{getPrototypeOf:Sg0,defineProperty:iT,getOwnPropertyNames:gg0}=Object;var yg0=Object.prototype.hasOwnProperty;function kg0($){return this[$]}var xg0,fg0,Q6=($,Y,z)=>{var U=$!=null&&typeof $==="object";if(U){var I=Y?xg0??=new WeakMap:fg0??=new WeakMap,Q=I.get($);if(Q)return Q}z=$!=null?hg0(Sg0($)):{};let J=Y||!$||!$.__esModule?iT(z,"default",{value:$,enumerable:!0}):z;for(let K of gg0($))if(!yg0.call(J,K))iT(J,K,{get:kg0.bind($,K),enumerable:!0});if(U)I.set($,J);return J};var E=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports);var ug0=($)=>$;function bg0($,Y){this[$]=ug0.bind(null,Y)}var x8=($,Y)=>{for(var z in Y)iT($,z,{get:Y[z],enumerable:!0,configurable:!0,set:bg0.bind(Y,z)})};var o=($,Y)=>()=>($&&(Y=$($=0)),Y);var J0=ig0(import.meta.url);var cg0,xq,ng0,pg0,dg0,mg0,R0=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports),Bo=($,Y)=>{let z={};for(var U in $)xq(z,U,{get:$[U],enumerable:!0});if(Y)xq(z,Symbol.toStringTag,{value:"Module"});return z},lg0=($,Y,z,U)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var I=pg0(Y),Q=0,J=I.length,K;Q<J;Q++)if(K=I[Q],!mg0.call($,K)&&K!==z)xq($,K,{get:((G)=>Y[G]).bind(null,K),enumerable:!(U=ng0(Y,K))||U.enumerable})}return $},fq=($,Y,z)=>(z=$!=null?cg0(dg0($)):{},lg0(Y||!$||!$.__esModule?xq(z,"default",{value:$,enumerable:!0}):z,$));var cT=o(()=>{cg0=Object.create,xq=Object.defineProperty,ng0=Object.getOwnPropertyDescriptor,pg0=Object.getOwnPropertyNames,dg0=Object.getPrototypeOf,mg0=Object.prototype.hasOwnProperty});function To($){return typeof $==="string"&&Ao.has($.replace(/#$/,""))}function jo($,Y){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let z=$.$schema.replace(/#$/,"");if(og0.has(z))return"2020-12";if(Ao.has(z))return"2019-09";if(rg0.has(z)||sg0.has(z))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${Y}`)}var og0,Ao,rg0,sg0;var nT=o(()=>{og0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ao=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),rg0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),sg0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function W0($,Y,z){function U(K,G){if(!K._zod)Object.defineProperty(K,"_zod",{value:{def:G,constr:J,traits:new Set},enumerable:!1});if(K._zod.traits.has($))return;K._zod.traits.add($),Y(K,G);let W=J.prototype,H=Object.keys(W);for(let X=0;X<H.length;X++){let Z=H[X];if(!(Z in K))K[Z]=W[Z].bind(K)}}let I=z?.Parent??Object;class Q extends I{}Object.defineProperty(Q,"name",{value:$});function J(K){var G;let W=z?.Parent?new Q:this;U(W,K),(G=W._zod).deferred??(G.deferred=[]);for(let H of W._zod.deferred)H();return W}return Object.defineProperty(J,"init",{value:U}),Object.defineProperty(J,Symbol.hasInstance,{value:(K)=>{if(z?.Parent&&K instanceof z.Parent)return!0;return K?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}function a4($){if($)Object.assign(NY,$);return NY}var Eo,nK,pT,f5,DY,NY;var PY=o(()=>{nK=Object.freeze({status:"aborted"});pT=Symbol("zod_brand");f5=class f5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};DY=class DY extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(Eo=globalThis).__zod_globalConfig??(Eo.__zod_globalConfig={});NY=globalThis.__zod_globalConfig});var y0={};x8(y0,{unwrapMessage:()=>pK,uint8ArrayToHex:()=>Dy0,uint8ArrayToBase64url:()=>Oy0,uint8ArrayToBase64:()=>_o,stringifyPrimitive:()=>v0,slugify:()=>lT,shallowClone:()=>rT,safeExtend:()=>qy0,required:()=>Fy0,randomString:()=>Jy0,propertyKeyTypes:()=>lK,promiseAllObject:()=>Qy0,primitiveTypes:()=>sT,prefixIssues:()=>f8,pick:()=>Hy0,partial:()=>Ly0,parsedType:()=>S0,optionalKeys:()=>aT,omit:()=>Xy0,objectClone:()=>zy0,numKeys:()=>Ky0,nullish:()=>I7,normalizeParams:()=>x0,mergeDefs:()=>i9,merge:()=>Vy0,jsonStringifyReplacer:()=>xU,joinValues:()=>N0,issue:()=>uU,isPlainObject:()=>J7,isObject:()=>BY,hexToUint8Array:()=>Ny0,getSizableOrigin:()=>oK,getParsedType:()=>Gy0,getLengthableOrigin:()=>rK,getEnumValues:()=>dK,getElementAtPath:()=>Iy0,floatSafeRemainder:()=>mT,finalizeIssue:()=>P8,extend:()=>Zy0,explicitlyAborted:()=>$j,escapeRegex:()=>N$,esc:()=>uq,defineLazy:()=>T1,createTransparentProxy:()=>Wy0,cloneDef:()=>Uy0,clone:()=>D8,cleanRegex:()=>mK,cleanEnum:()=>wy0,captureStackTrace:()=>bq,cached:()=>fU,base64urlToUint8Array:()=>My0,base64ToUint8Array:()=>Ro,assignProp:()=>Q7,assertNotEqual:()=>tg0,assertNever:()=>$y0,assertIs:()=>eg0,assertEqual:()=>ag0,assert:()=>Yy0,allowsEval:()=>oT,aborted:()=>K7,NUMBER_FORMAT_RANGES:()=>tT,Class:()=>voLine truncated
`)}var ho=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,xU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},sK,u8;var Uj=o(()=>{PY();$1();sK=W0("$ZodError",ho),u8=W0("$ZodError",ho,{Parent:Error})});var bU=($)=>(Y,z,U,I)=>{let Q=U?{...U,async:!1}:{async:!1},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)throw new f5;if(J.issues.length){let K=new(I?.Err??$)(J.issues.map((G)=>P8(G,Q,a4())));throw bq(K,I?.callee),K}return J.value},iq,iU=($)=>async(Y,z,U,I)=>{let Q=U?{...U,async:!0}:{async:!0},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)J=await J;if(J.issues.length){let K=new(I?.Err??$)(J.issues.map((G)=>P8(G,Q,a4())));throw bq(K,I?.callee),K}return J.value},cq,cU=($)=>(Y,z,U)=>{let I=U?{...U,async:!1}:{async:!1},Q=Y._zod.run({value:z,issues:[]},I);if(Q instanceof Promise)throw new f5;return Q.issues.length?{success:!1,error:new($??sK)(Q.issues.map((J)=>P8(J,I,a4())))}:{success:!0,data:Q.value}},Ij,nU=($)=>async(Y,z,U)=>{let I=U?{...U,async:!0}:{async:!0},Q=Y._zod.run({value:z,issues:[]},I);if(Q instanceof Promise)Q=await Q;return Q.issues.length?{success:!1,error:new $(Q.issues.map((J)=>P8(J,I,a4())))}:{success:!0,data:Q.value}},Qj,nq=($)=>(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return bU($)(Y,z,I)},By0,pq=($)=>(Y,z,U)=>{return bU($)(Y,z,U)},Ay0,dq=($)=>async(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return iU($)(Y,z,I)},Ty0,mq=($)=>async(Y,z,U)=>{return iU($)(Y,z,U)},jy0,lq=($)=>(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return cU($)(Y,z,I)},Ey0,oq=($)=>(Y,z,U)=>{return cU($)(Y,z,U)},Cy0,rq=($)=>async(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return nU($)(Y,z,I)},Ry0,sq=($)=>async(Y,z,U)=>{return nU($)(Y,z,U)},_y0;var Jj=o(()=>{PY();Uj();$1();iq=bU(u8),cq=iU(u8),Ij=cU(u8),Qj=nU(u8),By0=nq(u8),Ay0=pq(u8),Ty0=dq(u8),jy0=mq(u8),Ey0=lq(u8),Cy0=oq(u8),Ry0=rq(u8),_y0=sq(u8)});var Y$={};x8(Y$,{xid:()=>Hj,uuid7:()=>gy0,uuid6:()=>Sy0,uuid4:()=>hy0,uuid:()=>AY,uppercase:()=>yj,unicodeEmail:()=>go,undefined:()=>Sj,ulid:()=>Wj,time:()=>jj,string:()=>Cj,sha512_hex:()=>Yk0,sha512_base64url:()=>Uk0,sha512_base64:()=>zk0,sha384_hex:()=>ty0,sha384_base64url:()=>$k0,sha384_base64:()=>ey0,sha256_hex:()=>ry0,sha256_base64url:()=>ay0,sha256_base64:()=>sy0,sha1_hex:()=>my0,sha1_base64url:()=>oy0,sha1_base64:()=>ly0,rfc5322Email:()=>ky0,number:()=>eK,null:()=>hj,nanoid:()=>Zj,md5_hex:()=>ny0,md5_base64url:()=>dy0,md5_base64:()=>py0,mac:()=>Oj,lowercase:()=>gj,ksuid:()=>Xj,ipv6:()=>Mj,ipv4:()=>wj,integer:()=>_j,idnEmail:()=>xy0,httpProtocol:()=>Bj,html5Email:()=>yy0,hostname:()=>by0,hex:()=>cy0,guid:()=>Vj,extendedDuration:()=>vy0,emoji:()=>Fj,email:()=>Lj,e164:()=>Aj,duration:()=>qj,domain:()=>iy0,datetime:()=>Ej,date:()=>Tj,cuid2:()=>Gj,cuid:()=>Kj,cidrv6:()=>Dj,cidrv4:()=>Nj,browserEmail:()=>fy0,boolean:()=>vj,bigint:()=>Rj,base64url:()=>aq,base64:()=>Pj});function Fj(){return new RegExp(uy0,"u")}function ko($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function jj($){return new RegExp(`^${ko($)}$`)}function Ej($){let Y=ko({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${Y}(?:${z.join("|")})`;return new RegExp(`^${yo}T(?:${U})$`)}function $G($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function YG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Kj,Gj,Wj,Hj,Xj,Zj,qj,vy0,Vj,AY=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},hy0,Sy0,gy0,Lj,yy0,ky0,go,xy0,fy0,uy0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wj,Mj,Oj=($)=>{let Y=N$($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},Nj,Dj,Pj,aq,by0,iy0,Bj,Aj,yo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Tj,Cj=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},Rj,_j,eK,vj,hj,Sj,gj,yj,cy0,ny0,py0,dy0,my0,ly0,oy0,ry0,sy0,ay0,ty0,ey0,$k0,Yk0,zk0,Uk0;var tq=o(()=>{$1();Kj=/^[cC][0-9a-z]{6,}$/,Gj=/^[0-9a-z]+$/,Wj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Hj=/^[0-9a-vA-V]{20}$/,Xj=/^[A-Za-z0-9]{27}$/,Zj=/^[a-zA-Z0-9_-]{21}$/,qj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
import{createRequire as Wy0}from"node:module";var Yy0=Object.create;var{getPrototypeOf:zy0,defineProperty:mT,getOwnPropertyNames:Uy0}=Object;var Iy0=Object.prototype.hasOwnProperty;function Qy0($){return this[$]}var Jy0,Ky0,Q6=($,Y,z)=>{var U=$!=null&&typeof $==="object";if(U){var I=Y?Jy0??=new WeakMap:Ky0??=new WeakMap,Q=I.get($);if(Q)return Q}z=$!=null?Yy0(zy0($)):{};let J=Y||!$||!$.__esModule?mT(z,"default",{value:$,enumerable:!0}):z;for(let K of Uy0($))if(!Iy0.call(J,K))mT(J,K,{get:Qy0.bind($,K),enumerable:!0});if(U)I.set($,J);return J};var E=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports);var Gy0=($)=>$;function Hy0($,Y){this[$]=Gy0.bind(null,Y)}var x8=($,Y)=>{for(var z in Y)mT($,z,{get:Y[z],enumerable:!0,configurable:!0,set:Hy0.bind(Y,z)})};var o=($,Y)=>()=>($&&(Y=$($=0)),Y);var J0=Wy0(import.meta.url);var Xy0,cq,Zy0,qy0,Vy0,Ly0,R0=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports),xo=($,Y)=>{let z={};for(var U in $)cq(z,U,{get:$[U],enumerable:!0});if(Y)cq(z,Symbol.toStringTag,{value:"Module"});return z},Fy0=($,Y,z,U)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var I=qy0(Y),Q=0,J=I.length,K;Q<J;Q++)if(K=I[Q],!Ly0.call($,K)&&K!==z)cq($,K,{get:((G)=>Y[G]).bind(null,K),enumerable:!(U=Zy0(Y,K))||U.enumerable})}return $},nq=($,Y,z)=>(z=$!=null?Xy0(Vy0($)):{},Fy0(Y||!$||!$.__esModule?cq(z,"default",{value:$,enumerable:!0}):z,$));var lT=o(()=>{Xy0=Object.create,cq=Object.defineProperty,Zy0=Object.getOwnPropertyDescriptor,qy0=Object.getOwnPropertyNames,Vy0=Object.getPrototypeOf,Ly0=Object.prototype.hasOwnProperty});function uo($){return typeof $==="string"&&fo.has($.replace(/#$/,""))}function bo($,Y){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let z=$.$schema.replace(/#$/,"");if(wy0.has(z))return"2020-12";if(fo.has(z))return"2019-09";if(My0.has(z)||Oy0.has(z))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${Y}`)}var wy0,fo,My0,Oy0;var oT=o(()=>{wy0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),fo=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),My0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Oy0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function H0($,Y,z){function U(K,G){if(!K._zod)Object.defineProperty(K,"_zod",{value:{def:G,constr:J,traits:new Set},enumerable:!1});if(K._zod.traits.has($))return;K._zod.traits.add($),Y(K,G);let H=J.prototype,W=Object.keys(H);for(let X=0;X<W.length;X++){let Z=W[X];if(!(Z in K))K[Z]=H[Z].bind(K)}}let I=z?.Parent??Object;class Q extends I{}Object.defineProperty(Q,"name",{value:$});function J(K){var G;let H=z?.Parent?new Q:this;U(H,K),(G=H._zod).deferred??(G.deferred=[]);for(let W of H._zod.deferred)W();return H}return Object.defineProperty(J,"init",{value:U}),Object.defineProperty(J,Symbol.hasInstance,{value:(K)=>{if(z?.Parent&&K instanceof z.Parent)return!0;return K?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}function a4($){if($)Object.assign(AY,$);return AY}var io,mK,rT,f5,PY,AY;var BY=o(()=>{mK=Object.freeze({status:"aborted"});rT=Symbol("zod_brand");f5=class f5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};PY=class PY extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(io=globalThis).__zod_globalConfig??(io.__zod_globalConfig={});AY=globalThis.__zod_globalConfig});var y0={};x8(y0,{unwrapMessage:()=>lK,uint8ArrayToHex:()=>py0,uint8ArrayToBase64url:()=>cy0,uint8ArrayToBase64:()=>po,stringifyPrimitive:()=>v0,slugify:()=>tT,shallowClone:()=>$j,safeExtend:()=>ky0,required:()=>uy0,randomString:()=>Ry0,propertyKeyTypes:()=>sK,promiseAllObject:()=>Cy0,primitiveTypes:()=>Yj,prefixIssues:()=>f8,pick:()=>Sy0,partial:()=>fy0,parsedType:()=>S0,optionalKeys:()=>zj,omit:()=>gy0,objectClone:()=>Ty0,numKeys:()=>_y0,nullish:()=>I7,normalizeParams:()=>x0,mergeDefs:()=>i9,merge:()=>xy0,jsonStringifyReplacer:()=>uU,joinValues:()=>N0,issue:()=>iU,isPlainObject:()=>J7,isObject:()=>TY,hexToUint8Array:()=>ny0,getSizableOrigin:()=>aK,getParsedType:()=>vy0,getLengthableOrigin:()=>tK,getEnumValues:()=>oK,getElementAtPath:()=>Ey0,floatSafeRemainder:()=>aT,finalizeIssue:()=>A8,extend:()=>yy0,explicitlyAborted:()=>Qj,escapeRegex:()=>N$,esc:()=>pq,defineLazy:()=>T1,createTransparentProxy:()=>hy0,cloneDef:()=>jy0,clone:()=>D8,cleanRegex:()=>rK,cleanEnum:()=>by0,captureStackTrace:()=>dq,cached:()=>bU,base64urlToUint8Array:()=>iy0,base64ToUint8Array:()=>no,assignProp:()=>Q7,assertNotEqual:()=>Dy0,assertNever:()=>Py0,assertIs:()=>Ay0,assertEqual:()=>Ny0,assert:()=>By0,allowsEval:()=>eT,aborted:()=>K7,NUMBER_FORMAT_RANGES:()=>Uj,Class:()=>moLine truncated
`)}var lo=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,uU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},eK,u8;var Gj=o(()=>{BY();$1();eK=H0("$ZodError",lo),u8=H0("$ZodError",lo,{Parent:Error})});var cU=($)=>(Y,z,U,I)=>{let Q=U?{...U,async:!1}:{async:!1},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)throw new f5;if(J.issues.length){let K=new(I?.Err??$)(J.issues.map((G)=>A8(G,Q,a4())));throw dq(K,I?.callee),K}return J.value},mq,nU=($)=>async(Y,z,U,I)=>{let Q=U?{...U,async:!0}:{async:!0},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)J=await J;if(J.issues.length){let K=new(I?.Err??$)(J.issues.map((G)=>A8(G,Q,a4())));throw dq(K,I?.callee),K}return J.value},lq,pU=($)=>(Y,z,U)=>{let I=U?{...U,async:!1}:{async:!1},Q=Y._zod.run({value:z,issues:[]},I);if(Q instanceof Promise)throw new f5;return Q.issues.length?{success:!1,error:new($??eK)(Q.issues.map((J)=>A8(J,I,a4())))}:{success:!0,data:Q.value}},Hj,dU=($)=>async(Y,z,U)=>{let I=U?{...U,async:!0}:{async:!0},Q=Y._zod.run({value:z,issues:[]},I);if(Q instanceof Promise)Q=await Q;return Q.issues.length?{success:!1,error:new $(Q.issues.map((J)=>A8(J,I,a4())))}:{success:!0,data:Q.value}},Wj,oq=($)=>(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return cU($)(Y,z,I)},my0,rq=($)=>(Y,z,U)=>{return cU($)(Y,z,U)},ly0,sq=($)=>async(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return nU($)(Y,z,I)},oy0,aq=($)=>async(Y,z,U)=>{return nU($)(Y,z,U)},ry0,tq=($)=>(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return pU($)(Y,z,I)},sy0,eq=($)=>(Y,z,U)=>{return pU($)(Y,z,U)},ay0,$V=($)=>async(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return dU($)(Y,z,I)},ty0,YV=($)=>async(Y,z,U)=>{return dU($)(Y,z,U)},ey0;var Xj=o(()=>{BY();Gj();$1();mq=cU(u8),lq=nU(u8),Hj=pU(u8),Wj=dU(u8),my0=oq(u8),ly0=rq(u8),oy0=sq(u8),ry0=aq(u8),sy0=tq(u8),ay0=eq(u8),ty0=$V(u8),ey0=YV(u8)});var Y$={};x8(Y$,{xid:()=>Lj,uuid7:()=>Uk0,uuid6:()=>zk0,uuid4:()=>Yk0,uuid:()=>jY,uppercase:()=>bj,unicodeEmail:()=>ro,undefined:()=>fj,ulid:()=>Vj,time:()=>vj,string:()=>Sj,sha512_hex:()=>Bk0,sha512_base64url:()=>jk0,sha512_base64:()=>Tk0,sha384_hex:()=>Dk0,sha384_base64url:()=>Pk0,sha384_base64:()=>Ak0,sha256_hex:()=>Mk0,sha256_base64url:()=>Nk0,sha256_base64:()=>Ok0,sha1_hex:()=>Lk0,sha1_base64url:()=>wk0,sha1_base64:()=>Fk0,rfc5322Email:()=>Qk0,number:()=>zG,null:()=>xj,nanoid:()=>wj,md5_hex:()=>Zk0,md5_base64url:()=>Vk0,md5_base64:()=>qk0,mac:()=>Bj,lowercase:()=>uj,ksuid:()=>Fj,ipv6:()=>Pj,ipv4:()=>Aj,integer:()=>yj,idnEmail:()=>Jk0,httpProtocol:()=>Cj,html5Email:()=>Ik0,hostname:()=>Hk0,hex:()=>Xk0,guid:()=>Oj,extendedDuration:()=>$k0,emoji:()=>Dj,email:()=>Nj,e164:()=>Rj,duration:()=>Mj,domain:()=>Wk0,datetime:()=>hj,date:()=>_j,cuid2:()=>qj,cuid:()=>Zj,cidrv6:()=>jj,cidrv4:()=>Tj,browserEmail:()=>Kk0,boolean:()=>kj,bigint:()=>gj,base64url:()=>zV,base64:()=>Ej});function Dj(){return new RegExp(Gk0,"u")}function ao($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function vj($){return new RegExp(`^${ao($)}$`)}function hj($){let Y=ao({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${Y}(?:${z.join("|")})`;return new RegExp(`^${so}T(?:${U})$`)}function UG($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function IG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Zj,qj,Vj,Lj,Fj,wj,Mj,$k0,Oj,jY=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Yk0,zk0,Uk0,Nj,Ik0,Qk0,ro,Jk0,Kk0,Gk0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Aj,Pj,Bj=($)=>{let Y=N$($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},Tj,jj,Ej,zV,Hk0,Wk0,Cj,Rj,so="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_j,Sj=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},gj,yj,zG,kj,xj,fj,uj,bj,Xk0,Zk0,qk0,Vk0,Lk0,Fk0,wk0,Mk0,Ok0,Nk0,Dk0,Ak0,Pk0,Bk0,Tk0,jk0;var UV=o(()=>{$1();Zj=/^[cC][0-9a-z]{6,}$/,qj=/^[0-9a-z]+$/,Vj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Lj=/^[0-9a-vA-V]{20}$/,Fj=/^[A-Za-z0-9]{27}$/,wj=/^[a-zA-Z0-9_-]{21}$/,Mj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
`).filter((Q)=>Q),U=Math.min(...z.map((Q)=>Q.length-Q.trimStart().length)),I=z.map((Q)=>Q.slice(U)).map((Q)=>" ".repeat(this.indent*2)+Q);for(let Q of I)this.content.push(Q)}compile(){let $=Function,Y=this?.args,U=[...(this?.content??[""]).map((I)=>` ${I}`)];return new $(...Y,U.join(`
`))}}var $E;var YE=o(()=>{$E={major:4,minor:4,patch:3}});function BE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Yr($){if(!aq.test($))return!1;let Y=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),z=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return BE(z)}function zr($,Y=null){try{let z=$.split(".");if(z.length!==3)return!1;let[U]=z;if(!U)return!1;let I=JSON.parse(atob(U));if("typ"in I&&I?.typ!=="JWT")return!1;if(!I.alg)return!1;if(Y&&(!("alg"in I)||I.alg!==Y))return!1;return!0}catch{return!1}}function bo($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function JV($,Y,z,U,I,Q){let J=z in U;if($.issues.length){if(I&&Q&&!J)return;Y.issues.push(...f8(z,$.issues))}if(!J&&!I){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(J)Y.value[z]=void 0}else Y.value[z]=$.value}function Ur($){let Y=Object.keys($.shape);for(let U of Y)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let z=aT($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(z)}}function Ir($,Y,z,U,I,Q){let J=[],K=I.keySet,G=I.catchall._zod,W=G.def.type,H=G.optin==="optional",X=G.optout==="optional";for(let Z in Y){if(Z==="__proto__")continue;if(K.has(Z))continue;if(W==="never"){J.push(Z);continue}let q=G.run({value:Y[Z],issues:[]},U);if(q instanceof Promise)$.push(q.then((V)=>JV(V,z,Z,Y,H,X)));else JV(q,z,Z,Y,H,X)}if(J.length)z.issues.push({code:"unrecognized_keys",keys:J,input:Y,inst:Q});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function io($,Y,z,U){for(let Q of $)if(Q.issues.length===0)return Y.value=Q.value,Y;let I=$.filter((Q)=>!K7(Q));if(I.length===1)return Y.value=I[0].value,I[0];return Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((Q)=>Q.issues.map((J)=>P8(J,U,a4())))}),Y}function co($,Y,z,U){let I=$.filter((Q)=>Q.issues.length===0);if(I.length===1)return Y.value=I[0].value,Y;if(I.length===0)Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((Q)=>Q.issues.map((J)=>P8(J,U,a4())))});else Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:[],inclusive:!1});return Y}function zE($,Y){if($===Y)return{valid:!0,data:$};if($ instanceof Date&&Y instanceof Date&&+$===+Y)return{valid:!0,data:$};if(J7($)&&J7(Y)){let z=Object.keys(Y),U=Object.keys($).filter((Q)=>z.indexOf(Q)!==-1),I={...$,...Y};for(let Q of U){let J=zE($[Q],Y[Q]);if(!J.valid)return{valid:!1,mergeErrorPath:[Q,...J.mergeErrorPath]};I[Q]=J.data}return{valid:!0,data:I}}if(Array.isArray($)&&Array.isArray(Y)){if($.length!==Y.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let U=0;U<$.length;U++){let I=$[U],Q=Y[U],J=zE(I,Q);if(!J.valid)return{valid:!1,mergeErrorPath:[U,...J.mergeErrorPath]};z.push(J.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function no($,Y,z){let U=new Map,I;for(let K of Y.issues)if(K.code==="unrecognized_keys"){I??(I=K);for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).l=!0}}else $.issues.push(K);for(let K of z.issues)if(K.code==="unrecognized_keys")for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).r=!0}else $.issues.push(K);let Q=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(Q.length&&I)$.issues.push({...I,keys:Q});if(K7($))return $;let J=zE(Y.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}function po($,Y){for(let z=$.length-1;z>=0;z--)if($[z]._zod[Y]!=="optional")return z+1;return 0}function mo($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function lo($,Y,z,U,I){for(let Q=0;Q<z.length;Q++){let J=$[Q],K=Q<U.length;if(J.issues.length){if(!K&&Q>=I){Y.value.length=Q;break}Y.issues.push(...f8(Q,J.issues))}Y.value[Q]=J.value}for(let Q=Y.value.length-1;Q>=U.length;Q--)if(z[Q]._zod.optout==="optional"&&Y.value[Q]===void 0)Y.value.length=Q;else break;return Y}function oo($,Y,z,U,I,Q,J){if($.issues.length)if(lK.has(typeof U))z.issues.push(...f8(U,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:I,inst:Q,issues:$.issues.map((K)=>P8(K,J,a4()))});if(Y.issues.length)if(lK.has(typeof U))z.issues.push(...f8(U,Y.issues));else z.issues.push({origin:"map",code:"invalid_element",input:I,inst:Q,key:U,issues:Y.issues.map((K)=>P8(K,J,a4()))});z.value.set($.value,Y.value)}function ro($,Y){if($.issues.length)Y.issues.push(...$.issues);Y.value.add($.value)}function so($,Y){if(Y===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function ao($,Y){if($.value===void 0)$.value=Y.defaultValue;return $}function to($,Y){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:Y});return $}function UV($,Y,z){if($.issues.length)return $.aborted=!0,$;return Y._zod.run({value:$.value,issues:$.issues,fa Line truncated
`))}}var QE;var JE=o(()=>{QE={major:4,minor:4,patch:3}});function CE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Lr($){if(!zV.test($))return!1;let Y=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),z=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return CE(z)}function Fr($,Y=null){try{let z=$.split(".");if(z.length!==3)return!1;let[U]=z;if(!U)return!1;let I=JSON.parse(atob(U));if("typ"in I&&I?.typ!=="JWT")return!1;if(!I.alg)return!1;if(Y&&(!("alg"in I)||I.alg!==Y))return!1;return!0}catch{return!1}}function Yr($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function XV($,Y,z,U,I,Q){let J=z in U;if($.issues.length){if(I&&Q&&!J)return;Y.issues.push(...f8(z,$.issues))}if(!J&&!I){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(J)Y.value[z]=void 0}else Y.value[z]=$.value}function wr($){let Y=Object.keys($.shape);for(let U of Y)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let z=zj($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(z)}}function Mr($,Y,z,U,I,Q){let J=[],K=I.keySet,G=I.catchall._zod,H=G.def.type,W=G.optin==="optional",X=G.optout==="optional";for(let Z in Y){if(Z==="__proto__")continue;if(K.has(Z))continue;if(H==="never"){J.push(Z);continue}let q=G.run({value:Y[Z],issues:[]},U);if(q instanceof Promise)$.push(q.then((V)=>XV(V,z,Z,Y,W,X)));else XV(q,z,Z,Y,W,X)}if(J.length)z.issues.push({code:"unrecognized_keys",keys:J,input:Y,inst:Q});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function zr($,Y,z,U){for(let Q of $)if(Q.issues.length===0)return Y.value=Q.value,Y;let I=$.filter((Q)=>!K7(Q));if(I.length===1)return Y.value=I[0].value,I[0];return Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((Q)=>Q.issues.map((J)=>A8(J,U,a4())))}),Y}function Ur($,Y,z,U){let I=$.filter((Q)=>Q.issues.length===0);if(I.length===1)return Y.value=I[0].value,Y;if(I.length===0)Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((Q)=>Q.issues.map((J)=>A8(J,U,a4())))});else Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:[],inclusive:!1});return Y}function KE($,Y){if($===Y)return{valid:!0,data:$};if($ instanceof Date&&Y instanceof Date&&+$===+Y)return{valid:!0,data:$};if(J7($)&&J7(Y)){let z=Object.keys(Y),U=Object.keys($).filter((Q)=>z.indexOf(Q)!==-1),I={...$,...Y};for(let Q of U){let J=KE($[Q],Y[Q]);if(!J.valid)return{valid:!1,mergeErrorPath:[Q,...J.mergeErrorPath]};I[Q]=J.data}return{valid:!0,data:I}}if(Array.isArray($)&&Array.isArray(Y)){if($.length!==Y.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let U=0;U<$.length;U++){let I=$[U],Q=Y[U],J=KE(I,Q);if(!J.valid)return{valid:!1,mergeErrorPath:[U,...J.mergeErrorPath]};z.push(J.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function Ir($,Y,z){let U=new Map,I;for(let K of Y.issues)if(K.code==="unrecognized_keys"){I??(I=K);for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).l=!0}}else $.issues.push(K);for(let K of z.issues)if(K.code==="unrecognized_keys")for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).r=!0}else $.issues.push(K);let Q=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(Q.length&&I)$.issues.push({...I,keys:Q});if(K7($))return $;let J=KE(Y.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}function Qr($,Y){for(let z=$.length-1;z>=0;z--)if($[z]._zod[Y]!=="optional")return z+1;return 0}function Jr($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function Kr($,Y,z,U,I){for(let Q=0;Q<z.length;Q++){let J=$[Q],K=Q<U.length;if(J.issues.length){if(!K&&Q>=I){Y.value.length=Q;break}Y.issues.push(...f8(Q,J.issues))}Y.value[Q]=J.value}for(let Q=Y.value.length-1;Q>=U.length;Q--)if(z[Q]._zod.optout==="optional"&&Y.value[Q]===void 0)Y.value.length=Q;else break;return Y}function Gr($,Y,z,U,I,Q,J){if($.issues.length)if(sK.has(typeof U))z.issues.push(...f8(U,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:I,inst:Q,issues:$.issues.map((K)=>A8(K,J,a4()))});if(Y.issues.length)if(sK.has(typeof U))z.issues.push(...f8(U,Y.issues));else z.issues.push({origin:"map",code:"invalid_element",input:I,inst:Q,key:U,issues:Y.issues.map((K)=>A8(K,J,a4()))});z.value.set($.value,Y.value)}function Hr($,Y){if($.issues.length)Y.issues.push(...$.issues);Y.value.add($.value)}function Wr($,Y){if(Y===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Xr($,Y){if($.value===void 0)$.value=Y.defaultValue;return $}function Zr($,Y){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:Y});return $}function GV($,Y,z){if($.issues.length)return $.aborted=!0,$;return Y._zod.run({value:$.value,issues:$.issues,fa Line truncated
if (${N}.issues.length) {
if (${A} in input) {
if (${B} in input) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
...iss,
path: iss.path ? [${A}, ...iss.path] : [${A}]
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
}
if (${N}.value === undefined) {
if (${A} in input) {
newResult[${A}] = undefined;
if (${B} in input) {
newResult[${B}] = undefined;
}
} else {
newResult[${A}] = ${N}.value;
newResult[${B}] = ${N}.value;
}
`);else if(!P)q.write(`
const ${N}_present = ${A} in input;
`);else if(!A)q.write(`
const ${N}_present = ${B} in input;
if (${N}.issues.length) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
...iss,
path: iss.path ? [${A}, ...iss.path] : [${A}]
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
if (!${N}_present && !${N}.issues.length) {
@@ -32,15 +32,15 @@ import{createRequire as ig0}from"node:module";var hg0=Object.create;var{getProto
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${A}]
path: [${B}]
});
}
if (${N}_present) {
if (${N}.value === undefined) {
newResult[${A}] = undefined;
newResult[${B}] = undefined;
} else {
newResult[${A}] = ${N}.value;
newResult[${B}] = ${N}.value;
}
}
@@ -48,120 +48,120 @@ import{createRequire as ig0}from"node:module";var hg0=Object.create;var{getProto
if (${N}.issues.length) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
...iss,
path: iss.path ? [${A}, ...iss.path] : [${A}]
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
if (${N}.value === undefined) {
if (${A} in input) {
newResult[${A}] = undefined;
if (${B} in input) {
newResult[${B}] = undefined;
}
} else {
newResult[${A}] = ${N}.value;
newResult[${B}] = ${N}.value;
}
`)}q.write("payload.value = newResult;"),q.write("return payload;");let O=q.compile();return(D,N)=>O(Z,D,N)},Q,J=BY,K=!NY.jitless,W=K&&oT.value,H=Y.catchall,X;$._zod.parse=(Z,q)=>{X??(X=U.value);let V=Z.value;if(!J(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(K&&W&&q?.async===!1&&q.jitless!==!0){if(!Q)Q=I(Y.shape);if(Z=Q(Z,q),!H)return Z;return Ir([],V,Z,q,X,$)}return z(Z,q)}});UG=W0("$ZodUnion",($,Y)=>{q1.init($,Y),T1($._zod,"optin",()=>Y.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),T1($._zod,"optout",()=>Y.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),T1($._zod,"values",()=>{if(Y.options.every((U)=>U._zod.values))return new Set(Y.options.flatMap((U)=>Array.from(U._zod.values)));return}),T1($._zod,"pattern",()=>{if(Y.options.every((U)=>U._zod.pattern)){let U=Y.options.map((I)=>I._zod.pattern);return new RegExp(`^(${U.map((I)=>mK(I.source)).join("|")})$`)}return});let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,I)=>{if(z)return z(U,I);let Q=!1,J=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},I);if(G instanceof Promise)J.push(G),Q=!0;else{if(G.issues.length===0)return G;J.push(G)}}if(!Q)return io(J,U,$,I);return Promise.all(J).then((K)=>{return io(K,U,$,I)})}});iE=W0("$ZodXor",($,Y)=>{UG.init($,Y),Y.inclusive=!1;let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,I)=>{if(z)return z(U,I);let Q=!1,J=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},I);if(G instanceof Promise)J.push(G),Q=!0;else J.push(G)}if(!Q)return co(J,U,$,I);return Promise.all(J).then((K)=>{return co(K,U,$,I)})}}),cE=W0("$ZodDiscriminatedUnion",($,Y)=>{Y.inclusive=!1,UG.init($,Y);let z=$._zod.parse;T1($._zod,"propValues",()=>{let I={};for(let Q of Y.options){let J=Q._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(Q)}"`);for(let[K,G]of Object.entries(J)){if(!I[K])I[K]=new Set;for(let W of G)I[K].add(W)}}return I});let U=fU(()=>{let I=Y.options,Q=new Map;for(let J of I){let K=J._zod.propValues?.[Y.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(J)}"`);for(let G of K){if(Q.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);Q.set(G,J)}}return Q});$._zod.parse=(I,Q)=>{let J=I.value;if(!BY(J))return I.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),I;let K=U.value.get(J?.[Y.discriminator]);if(K)return K._zod.run(I,Q);if(Y.unionFallback||Q.direction==="backward")return z(I,Q);return I.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Y.discriminator,options:Array.from(U.value.keys()),input:J,path:[Y.discriminator],inst:$}),I}}),nE=W0("$ZodIntersection",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let I=z.value,Q=Y.left._zod.run({value:I,issues:[]},U),J=Y.right._zod.run({value:I,issues:[]},U);if(Q instanceof Promise||J instanceof Promise)return Promise.all([Q,J]).then(([G,W])=>{return no(z,G,W)});return no(z,Q,J)}});WV=W0("$ZodTuple",($,Y)=>{q1.init($,Y);let z=Y.items;$._zod.parse=(U,I)=>{let Q=U.value;if(!Array.isArray(Q))return U.issues.push({input:Q,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let J=[],K=po(z,"optin"),G=po(z,"optout");if(!Y.rest){if(Q.length<K)return U.issues.push({code:"too_small",minimum:K,inclusive:!0,input:Q,inst:$,origin:"array"}),U;if(Q.length>z.length)U.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:Q,inst:$,origin:"array"})}let W=Array(z.length);for(let H=0;H<z.length;H++){let X=z[H]._zod.run({value:Q[H],issues:[]},I);if(X instanceof Promise)J.push(X.then((Z)=>{W[H]=Z}));else W[H]=X}if(Y.rest){let H=z.length-1,X=Q.slice(z.length);for(let Z of X){H++;let q=Y.rest._zod.run({value:Z,issues:[]},I);if(q instanceof Promise)J.push(q.then((V)=>mo(V,U,H)));else mo(q,U,H)}}if(J.length)return Promise.all(J).then(()=>lo(W,U,z,Q,G));return lo(W,U,z,Q,G)}});pE=W0("$ZodRecord",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let I=z.value;if(!J7(I))return z.issues.push({expected:"record",code:"invalid_type",input:I,inst:$}),z;let Q=[],J=Y.keyType._zod.values;if(J){z.value={};let K=new Set;for(let W of J)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){K.add(typeof W==="number"?W.toString():W);let H=Y.keyType._zod.run({value:W,issues:[]},U);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map((q)=>P8(q,U,a4())),input:W,path:[W],inst:$});continue}let X=H.value,Z=Y.valueType._zod.run({value:I[W],issues:[]},U);if(Z instanceof Promise)Q.push(Z.then((q)=>{if(q.issues.length)z.issues.push(...f8(W,q.issues));z.value[X]=q.value}));else{if(Z.issues.length)z.issues.push(...f8(W,Z.issues));z.value[X]=Z.value}}let G;for(let W in I)if(!K.has(W))G=G??[],G.push(W);if(G&&G.length>0)z.issues.push({code:"unrec Line truncated
`)}q.write("payload.value = newResult;"),q.write("return payload;");let O=q.compile();return(D,N)=>O(Z,D,N)},Q,J=TY,K=!AY.jitless,H=K&&eT.value,W=Y.catchall,X;$._zod.parse=(Z,q)=>{X??(X=U.value);let V=Z.value;if(!J(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(K&&H&&q?.async===!1&&q.jitless!==!0){if(!Q)Q=I(Y.shape);if(Z=Q(Z,q),!W)return Z;return Mr([],V,Z,q,X,$)}return z(Z,q)}});JG=H0("$ZodUnion",($,Y)=>{q1.init($,Y),T1($._zod,"optin",()=>Y.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),T1($._zod,"optout",()=>Y.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),T1($._zod,"values",()=>{if(Y.options.every((U)=>U._zod.values))return new Set(Y.options.flatMap((U)=>Array.from(U._zod.values)));return}),T1($._zod,"pattern",()=>{if(Y.options.every((U)=>U._zod.pattern)){let U=Y.options.map((I)=>I._zod.pattern);return new RegExp(`^(${U.map((I)=>rK(I.source)).join("|")})$`)}return});let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,I)=>{if(z)return z(U,I);let Q=!1,J=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},I);if(G instanceof Promise)J.push(G),Q=!0;else{if(G.issues.length===0)return G;J.push(G)}}if(!Q)return zr(J,U,$,I);return Promise.all(J).then((K)=>{return zr(K,U,$,I)})}});mE=H0("$ZodXor",($,Y)=>{JG.init($,Y),Y.inclusive=!1;let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,I)=>{if(z)return z(U,I);let Q=!1,J=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},I);if(G instanceof Promise)J.push(G),Q=!0;else J.push(G)}if(!Q)return Ur(J,U,$,I);return Promise.all(J).then((K)=>{return Ur(K,U,$,I)})}}),lE=H0("$ZodDiscriminatedUnion",($,Y)=>{Y.inclusive=!1,JG.init($,Y);let z=$._zod.parse;T1($._zod,"propValues",()=>{let I={};for(let Q of Y.options){let J=Q._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(Q)}"`);for(let[K,G]of Object.entries(J)){if(!I[K])I[K]=new Set;for(let H of G)I[K].add(H)}}return I});let U=bU(()=>{let I=Y.options,Q=new Map;for(let J of I){let K=J._zod.propValues?.[Y.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(J)}"`);for(let G of K){if(Q.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);Q.set(G,J)}}return Q});$._zod.parse=(I,Q)=>{let J=I.value;if(!TY(J))return I.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),I;let K=U.value.get(J?.[Y.discriminator]);if(K)return K._zod.run(I,Q);if(Y.unionFallback||Q.direction==="backward")return z(I,Q);return I.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Y.discriminator,options:Array.from(U.value.keys()),input:J,path:[Y.discriminator],inst:$}),I}}),oE=H0("$ZodIntersection",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let I=z.value,Q=Y.left._zod.run({value:I,issues:[]},U),J=Y.right._zod.run({value:I,issues:[]},U);if(Q instanceof Promise||J instanceof Promise)return Promise.all([Q,J]).then(([G,H])=>{return Ir(z,G,H)});return Ir(z,Q,J)}});VV=H0("$ZodTuple",($,Y)=>{q1.init($,Y);let z=Y.items;$._zod.parse=(U,I)=>{let Q=U.value;if(!Array.isArray(Q))return U.issues.push({input:Q,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let J=[],K=Qr(z,"optin"),G=Qr(z,"optout");if(!Y.rest){if(Q.length<K)return U.issues.push({code:"too_small",minimum:K,inclusive:!0,input:Q,inst:$,origin:"array"}),U;if(Q.length>z.length)U.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:Q,inst:$,origin:"array"})}let H=Array(z.length);for(let W=0;W<z.length;W++){let X=z[W]._zod.run({value:Q[W],issues:[]},I);if(X instanceof Promise)J.push(X.then((Z)=>{H[W]=Z}));else H[W]=X}if(Y.rest){let W=z.length-1,X=Q.slice(z.length);for(let Z of X){W++;let q=Y.rest._zod.run({value:Z,issues:[]},I);if(q instanceof Promise)J.push(q.then((V)=>Jr(V,U,W)));else Jr(q,U,W)}}if(J.length)return Promise.all(J).then(()=>Kr(H,U,z,Q,G));return Kr(H,U,z,Q,G)}});rE=H0("$ZodRecord",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let I=z.value;if(!J7(I))return z.issues.push({expected:"record",code:"invalid_type",input:I,inst:$}),z;let Q=[],J=Y.keyType._zod.values;if(J){z.value={};let K=new Set;for(let H of J)if(typeof H==="string"||typeof H==="number"||typeof H==="symbol"){K.add(typeof H==="number"?H.toString():H);let W=Y.keyType._zod.run({value:H,issues:[]},U);if(W instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(W.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:W.issues.map((q)=>A8(q,U,a4())),input:H,path:[H],inst:$});continue}let X=W.value,Z=Y.valueType._zod.run({value:I[H],issues:[]},U);if(Z instanceof Promise)Q.push(Z.then((q)=>{if(q.issues.length)z.issues.push(...f8(H,q.issues));z.value[X]=q.value}));else{if(Z.issues.length)z.issues.push(...f8(H,Z.issues));z.value[X]=Z.value}}let G;for(let H in I)if(!K.has(H))G=G??[],G.push(H);if(G&&G.length>0)z.issues.push({code:"unrec Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let K=J[1];if(Y===J[0]){Q(J);continue}if($.external){let W=$.external.registry.get(J[0])?.id;if(Y!==J[0]&&W){Q(J);continue}}if($.metadataRegistry.get(J[0])?.id){Q(J);continue}if(K.cycle){Q(J);continue}if(K.count>1){if($.reused==="ref"){Q(J);continue}}}}function Z7($,Y){let z=$.seen.get(Y);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let G=$.seen.get(K);if(G.ref===null)return;let W=G.def??G.schema,H={...W},X=G.ref;if(G.ref=null,X){U(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(V);else Object.assign(W,V);if(Object.assign(W,H),K._zod.parent===X)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(!(M in H))delete W[M]}if(V.$ref&&q.def)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(M in q.def&&JSON.stringify(W[M])===JSON.stringify(q.def[M]))delete W[M]}}let Z=K._zod.parent;if(Z&&Z!==X){U(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(W.$ref=q.schema.$ref,q.def)for(let V in W){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(W[V])===JSON.stringify(q.def[V]))delete W[V]}}}$.override({zodSchema:K,jsonSchema:W,path:G.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let I={};if($.target==="draft-2020-12")I.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")I.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")I.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(Y)?.id;if(!K)throw Error("Schema is missing an `id` property");I.$id=$.external.uri(K)}Object.assign(I,z.def??z.schema);let Q=$.metadataRegistry.get(Y)?.id;if(Q!==void 0&&I.id===Q)delete I.id;let J=$.external?.defs??{};for(let K of $.seen.entries()){let G=K[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;J[G.defId]=G.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")I.$defs=J;else I.definitions=J;try{let K=JSON.parse(JSON.stringify(I));return Object.defineProperty(K,"~standard",{value:{...Y["~standard"],jsonSchema:{input:QI(Y,"input",$.processors),output:QI(Y,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function A8($,Y){let z=Y??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return A8(U.element,z);if(U.type==="set")return A8(U.valueType,z);if(U.type==="lazy")return A8(U.getter(),z);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return A8(U.innerType,z);if(U.type==="intersection")return A8(U.left,z)||A8(U.right,z);if(U.type==="record"||U.type==="map")return A8(U.keyType,z)||A8(U.valueType,z);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return A8(U.in,z)||A8(U.out,z)}if(U.type==="object"){for(let I in U.shape)if(A8(U.shape[I],z))return!0;return!1}if(U.type==="union"){for(let I of U.options)if(A8(I,z))return!0;return!1}if(U.type==="tuple"){for(let I of U.items)if(A8(I,z))return!0;if(U.rest&&A8(U.rest,z))return!0;return!1}return!1}var $_=($,Y={})=>(z)=>{let U=H7({...z,processors:Y});return J4($,U),X7(U,$),Z7(U,$)},QI=($,Y,z={})=>(U)=>{let{libraryOptions:I,target:Q}=U??{},J=H7({...I??{},target:Q,io:Y,processors:z});return J4($,J),X7(J,$),Z7(J,$)};var qG=o(()=>{HG()});function RY($,Y){if("_idmap"in $){let U=$,I=H7({...Y,processors:fV}),Q={};for(let G of U._idmap.entries()){let[W,H]=G;J4(H,I)}let J={},K={registry:U,uri:Y?.uri,defs:Q};I.external=K;for(let G of U._idmap.entries()){let[W,H]=G;X7(I,H),J[W]=Z7(I,H)}if(Object.keys(Q).length>0){let G=I.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[G]:Q}}return{schemas:J}}let z=H7({...Y,processors:fV});return J4($,z),X7(z,$),Z7(z,$)}var Tx0,Y_=($,Y,z,U)=>{let I=z;I.type="string";let{minimum:Q,maximum:J,format:K,patterns:G,contentEncoding:W}=$._zod.bag;if(typeof Q==="number")I.minLength=Q;if(typeof J==="number")I.maxLength=J;if(K){if(I.format=Tx0[K]??K,I.format==="")delete I.format;if(K==="time")delete I.format}if(W)I.contentEncoding=W;if(G&&G.size>0){let H=[...G];if(H.length===1)I.pattern=H[0].source;else if(H.length>1)I.allOf=[...H.map((X)=>({...Y.target==="draft-07"||Y.target==="draft-04"||Y.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},z_=($,Y,z,U)=>{let I=z,{minimum:Q,maximum:J,format:K,multipleOf:G,exclusiveMaximum:W,exclusiveMinimum:H}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))I.type="integer";else I.type="number";let X=typeof H==="number"&&H>=(Q??Number.NEGATIVE_INFINITY),Z=typeof W==="number"&&W<=(J??Number.POSITIVE_INFINITY),q=Y.target==="draft-04"||Y.target==="openapi-3.0";if(X)if(q)I.minimum=H,I.exclusiveMinimum=!0;else I.exclusiveMinimuLine truncated
`}function Qu0($){let Y=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))Y.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))Y.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))Y.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))Y.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Iu0.test($)){let z=[...$].filter((U)=>!/[A-Za-z0-9._-]/.test(U)).filter((U,I,Q)=>Q.indexOf(U)===I);return Y.push(`Tool name contains invalid characters: ${z.map((U)=>`"${U}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:Y}}return{isValid:!0,warnings:Y}}function Ju0($,Y){if(Y.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let z of Y)console.warn(` - ${z}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function ah($){let Y=Qu0($);return Ju0($,Y.warnings),Y.isValid}function Ku0($){return typeof $==="object"&&$!==null&&"_zod"in $}function Gu0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function Wu0($){if(typeof $!=="object"||$===null)return!1;if(CI($))return!1;let Y=Object.getPrototypeOf($);if(Y!==Object.prototype&&Y!==null)return!1;return Object.values($).every((z)=>Ku0(z))}function Aw($){if($===void 0)return;if(Wu0($))return z0($);if(typeof $==="object"&&$!==null&&!CI($)&&Object.values($).some((Y)=>Gu0(Y)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!CI($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var Th,ix0,P1,V1,cx0,ta="2026-07-28",T7,Yt,dx0,mx0,lx0,It,Qt,rx0,Gw,Qf1,Jf1,ba,Sh,Yf0,zf0,jI,n0,Q1,ww,Gt,_I,Mw,Qf0=0,Jf0="private",Kf0,Lf0,Hw,xh,Xt,Kf1,Gf1,Df0,Pf0,fh,Xw,GW="2026-07-28",Vt,Tf0,D$=($)=>gG.safeParse($).success,j7=($)=>yG.safeParse($).success,JW=($)=>LI.safeParse($).success,Pw=($)=>FI.safeParse($).success,r9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",da="x-mcp-header",jf0,Ef0,Cf0,Rf0,Vw=-32020,Wf1,_f0,ma=!1,Eh="draft-2020-12",Sf0,ff0,uf0,la,bf0,mf0,wt=250,lf0,of0,Dt,Pt,rf0,sf0,At=60000,tf0,ef0,$u0,Tt,lh,Uu0,Hf1,jt=10485760,rh=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??jt}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
`);if($===-1)return null;let Y=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return Et(Y)}catch(z){if(z instanceof SyntaxError)continue;throw z}}return null}clear(){this._buffer=void 0}},Iu0;var Tw=o(()=>{cT();nT();xa();pv();Th=Symbol.for("mcp.sdk.errorBrands");ix0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](Y){return EI(this,Y)}static isInstance(Y){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return EI(this,Y)}constructor(Y,z,U){super(z);this.code=Y,this.errorUri=U,this.name="OAuthError",Rh(this,new.target)}toResponseObject(){let Y={error:this.code,error_description:this.message};if(this.errorUri)Y.error_uri=this.errorUri;return Y}static fromResponse(Y){return new $(Y.error,Y.error_description??Y.error,Y.error_uri)}},P1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),V1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return EI(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return EI(this,$)}constructor($,Y,z){super(Y);this.code=$,this.data=z,this.name="SdkError",Rh(this,new.target)}},cx0=class extends V1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,Y,z){super($,Y,z);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};T7=[ta];Yt=["task","inputRequests","requestState"];mx0=new Set(["const","enum","default","examples"]),lx0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);It={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Qt={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},rx0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};Qf1=Object.keys(It),Jf1=Object.keys(Qt);ba={ok:!1,reason:"not-in-era"};Sh={era:"2025-11-25",hasRequestMethod:Jt,hasNotificationMethod:Kt,validateRequest:($,Y)=>Ww(tx0($),Y),validateResult:($,Y)=>Ww(ax0($),Y),validateNotification:($,Y)=>Ww(ex0($),Y),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ba,validateInputResponse:()=>ba,samplingResultVariant:($,Y)=>{let z=zt();return Ww($?z.CreateMessageResultWithToolsSchema:z.CreateMessageResultSchema,Y)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,Y){let z=$t($),U=z.structuredContent;if(U===void 0)return z;let I=typeof U!=="object"||U===null||Array.isArray(U),Q=Y!==void 0&&Ut(Y);if(!I&&!Q)return z;return{...z,structuredContent:{result:U}}},decodeResult($,Y){if(jh(Y)&&"resultType"in Y){let z={...Y};return delete z.resultType,{kind:"complete",result:ca(z)}}return{kind:"complete",result:ca(Y)}},encodeResult($,Y){if($!=="tools/list")return Y;l Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let K=J[1];if(Y===J[0]){Q(J);continue}if($.external){let H=$.external.registry.get(J[0])?.id;if(Y!==J[0]&&H){Q(J);continue}}if($.metadataRegistry.get(J[0])?.id){Q(J);continue}if(K.cycle){Q(J);continue}if(K.count>1){if($.reused==="ref"){Q(J);continue}}}}function Z7($,Y){let z=$.seen.get(Y);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let G=$.seen.get(K);if(G.ref===null)return;let H=G.def??G.schema,W={...H},X=G.ref;if(G.ref=null,X){U(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))H.allOf=H.allOf??[],H.allOf.push(V);else Object.assign(H,V);if(Object.assign(H,W),K._zod.parent===X)for(let M in H){if(M==="$ref"||M==="allOf")continue;if(!(M in W))delete H[M]}if(V.$ref&&q.def)for(let M in H){if(M==="$ref"||M==="allOf")continue;if(M in q.def&&JSON.stringify(H[M])===JSON.stringify(q.def[M]))delete H[M]}}let Z=K._zod.parent;if(Z&&Z!==X){U(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(H.$ref=q.schema.$ref,q.def)for(let V in H){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(H[V])===JSON.stringify(q.def[V]))delete H[V]}}}$.override({zodSchema:K,jsonSchema:H,path:G.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let I={};if($.target==="draft-2020-12")I.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")I.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")I.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(Y)?.id;if(!K)throw Error("Schema is missing an `id` property");I.$id=$.external.uri(K)}Object.assign(I,z.def??z.schema);let Q=$.metadataRegistry.get(Y)?.id;if(Q!==void 0&&I.id===Q)delete I.id;let J=$.external?.defs??{};for(let K of $.seen.entries()){let G=K[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;J[G.defId]=G.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")I.$defs=J;else I.definitions=J;try{let K=JSON.parse(JSON.stringify(I));return Object.defineProperty(K,"~standard",{value:{...Y["~standard"],jsonSchema:{input:KI(Y,"input",$.processors),output:KI(Y,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function B8($,Y){let z=Y??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return B8(U.element,z);if(U.type==="set")return B8(U.valueType,z);if(U.type==="lazy")return B8(U.getter(),z);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return B8(U.innerType,z);if(U.type==="intersection")return B8(U.left,z)||B8(U.right,z);if(U.type==="record"||U.type==="map")return B8(U.keyType,z)||B8(U.valueType,z);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return B8(U.in,z)||B8(U.out,z)}if(U.type==="object"){for(let I in U.shape)if(B8(U.shape[I],z))return!0;return!1}if(U.type==="union"){for(let I of U.options)if(B8(I,z))return!0;return!1}if(U.type==="tuple"){for(let I of U.items)if(B8(I,z))return!0;if(U.rest&&B8(U.rest,z))return!0;return!1}return!1}var Q_=($,Y={})=>(z)=>{let U=W7({...z,processors:Y});return J4($,U),X7(U,$),Z7(U,$)},KI=($,Y,z={})=>(U)=>{let{libraryOptions:I,target:Q}=U??{},J=W7({...I??{},target:Q,io:Y,processors:z});return J4($,J),X7(J,$),Z7(J,$)};var FG=o(()=>{qG()});function vY($,Y){if("_idmap"in $){let U=$,I=W7({...Y,processors:nV}),Q={};for(let G of U._idmap.entries()){let[H,W]=G;J4(W,I)}let J={},K={registry:U,uri:Y?.uri,defs:Q};I.external=K;for(let G of U._idmap.entries()){let[H,W]=G;X7(I,W),J[H]=Z7(I,W)}if(Object.keys(Q).length>0){let G=I.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[G]:Q}}return{schemas:J}}let z=W7({...Y,processors:nV});return J4($,z),X7(z,$),Z7(z,$)}var ox0,J_=($,Y,z,U)=>{let I=z;I.type="string";let{minimum:Q,maximum:J,format:K,patterns:G,contentEncoding:H}=$._zod.bag;if(typeof Q==="number")I.minLength=Q;if(typeof J==="number")I.maxLength=J;if(K){if(I.format=ox0[K]??K,I.format==="")delete I.format;if(K==="time")delete I.format}if(H)I.contentEncoding=H;if(G&&G.size>0){let W=[...G];if(W.length===1)I.pattern=W[0].source;else if(W.length>1)I.allOf=[...W.map((X)=>({...Y.target==="draft-07"||Y.target==="draft-04"||Y.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},K_=($,Y,z,U)=>{let I=z,{minimum:Q,maximum:J,format:K,multipleOf:G,exclusiveMaximum:H,exclusiveMinimum:W}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))I.type="integer";else I.type="number";let X=typeof W==="number"&&W>=(Q??Number.NEGATIVE_INFINITY),Z=typeof H==="number"&&H<=(J??Number.POSITIVE_INFINITY),q=Y.target==="draft-04"||Y.target==="openapi-3.0";if(X)if(q)I.minimum=W,I.exclusiveMinimum=!0;else I.exclusiveMinimuLine truncated
`}function Cu0($){let Y=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))Y.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))Y.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))Y.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))Y.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Eu0.test($)){let z=[...$].filter((U)=>!/[A-Za-z0-9._-]/.test(U)).filter((U,I,Q)=>Q.indexOf(U)===I);return Y.push(`Tool name contains invalid characters: ${z.map((U)=>`"${U}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:Y}}return{isValid:!0,warnings:Y}}function Ru0($,Y){if(Y.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let z of Y)console.warn(` - ${z}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function zS($){let Y=Cu0($);return Ru0($,Y.warnings),Y.isValid}function _u0($){return typeof $==="object"&&$!==null&&"_zod"in $}function vu0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function hu0($){if(typeof $!=="object"||$===null)return!1;if(_I($))return!1;let Y=Object.getPrototypeOf($);if(Y!==Object.prototype&&Y!==null)return!1;return Object.values($).every((z)=>_u0(z))}function Rw($){if($===void 0)return;if(hu0($))return z0($);if(typeof $==="object"&&$!==null&&!_I($)&&Object.values($).some((Y)=>vu0(Y)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!_I($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var _h,Wf0,A1,V1,Xf0,Zt="2026-07-28",T7,Lt,Vf0,Lf0,Ff0,Mt,Ot,Mf0,qw,kf1,xf1,$t,fh,Bf0,Tf0,CI,n0,Q1,Aw,At,hI,Pw,Cf0=0,Rf0="private",_f0,ff0,Lw,ch,Tt,ff1,uf1,pf0,df0,nh,Fw,XH="2026-07-28",Ct,of0,D$=($)=>xG.safeParse($).success,j7=($)=>fG.safeParse($).success,HH=($)=>wI.safeParse($).success,Ew=($)=>MI.safeParse($).success,r9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",Qt="x-mcp-header",rf0,sf0,af0,tf0,Ow=-32020,bf1,ef0,Jt=!1,hh="draft-2020-12",zu0,Ku0,Gu0,Kt,Hu0,Lu0,vt=250,Fu0,wu0,yt,kt,Mu0,Ou0,ft=60000,Du0,Au0,Pu0,ut,th,ju0,if1,bt=10485760,$S=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??bt}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
`);if($===-1)return null;let Y=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return it(Y)}catch(z){if(z instanceof SyntaxError)continue;throw z}}return null}clear(){this._buffer=void 0}},Eu0;var _w=o(()=>{lT();oT();aa();rv();_h=Symbol.for("mcp.sdk.errorBrands");Wf0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](Y){return RI(this,Y)}static isInstance(Y){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return RI(this,Y)}constructor(Y,z,U){super(z);this.code=Y,this.errorUri=U,this.name="OAuthError",gh(this,new.target)}toResponseObject(){let Y={error:this.code,error_description:this.message};if(this.errorUri)Y.error_uri=this.errorUri;return Y}static fromResponse(Y){return new $(Y.error,Y.error_description??Y.error,Y.error_uri)}},A1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),V1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return RI(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return RI(this,$)}constructor($,Y,z){super(Y);this.code=$,this.data=z,this.name="SdkError",gh(this,new.target)}},Xf0=class extends V1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,Y,z){super($,Y,z);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};T7=[Zt];Lt=["task","inputRequests","requestState"];Lf0=new Set(["const","enum","default","examples"]),Ff0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);Mt={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ot={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Mf0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};kf1=Object.keys(Mt),xf1=Object.keys(Ot);$t={ok:!1,reason:"not-in-era"};fh={era:"2025-11-25",hasRequestMethod:Nt,hasNotificationMethod:Dt,validateRequest:($,Y)=>Vw(Df0($),Y),validateResult:($,Y)=>Vw(Nf0($),Y),validateNotification:($,Y)=>Vw(Af0($),Y),hasInputRequestMethod:()=>!1,validateInputRequest:()=>$t,validateInputResponse:()=>$t,samplingResultVariant:($,Y)=>{let z=Ft();return Vw($?z.CreateMessageResultWithToolsSchema:z.CreateMessageResultSchema,Y)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,Y){let z=Vt($),U=z.structuredContent;if(U===void 0)return z;let I=typeof U!=="object"||U===null||Array.isArray(U),Q=Y!==void 0&&wt(Y);if(!I&&!Q)return z;return{...z,structuredContent:{result:U}}},decodeResult($,Y){if(vh(Y)&&"resultType"in Y){let z={...Y};return delete z.resultType,{kind:"complete",result:zt(z)}}return{kind:"complete",result:zt(Y)}},encodeResult($,Y){if($!=="tools/list")return Y;l Line truncated
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/Uu0=R0(($)=>{var Y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,z=/\\([\u000b\u0020-\u00ff])/g,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=I;function I(K){if(!K)throw TypeError("argument string is required");var G=typeof K==="object"?Q(K):K;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var W=G.indexOf(";"),H=W!==-1?G.slice(0,W).trim():G.trim();if(!U.test(H))throw TypeError("invalid media type");var X=new J(H.toLowerCase());if(W!==-1){var Z,q,V;Y.lastIndex=W;while(q=Y.exec(G)){if(q.index!==W)throw TypeError("invalid parameter format");if(W+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(z,"$1")}X.parameters[Z]=V}if(W!==G.length)throw TypeError("invalid parameter format")}return X}function Q(K){var G;if(typeof K.getHeader==="function")G=K.getHeader("content-type");else if(typeof K.headers==="object")G=K.headers&&K.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function J(K){this.parameters=Object.create(null),this.type=K}}),Hf1=fq(Uu0(),1);Iu0=/^[A-Za-z0-9._-]{1,128}$/});function th($){let Y=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Tb0(Y),Y}var jw,Ct,L1,v1,U5,Cw,Hu0,Rt,_t,Ew,Xu0,I5,Zu0,qu0,vt,Vu0,Rw,vI,HW,hI,_w,Lu0,ht,Fu0,wu0,Mu0,eh,Ou0,$S,St,Nu0,Du0,Pu0,Bu0,Au0,Tu0,ju0,Eu0,YS,Cu0,Ru0,_u0,gt,yt,kt,vu0,hu0,Su0,zS,gu0,xt,yu0,ku0,xu0,fu0,uu0,bu0,iu0,cu0,ft,nu0,ut,bt,it,pu0,US,du0,ct,nt,pt,mu0,lu0,dt,ou0,ru0,su0,mt,au0,tu0,lt,eu0,$b0,Yb0,zb0,Ub0,Ib0,Qb0,Jb0,Kb0,Gb0,Wb0,Hb0,Xb0,Zb0,qb0,Vb0,Lb0,Fb0,wb0,Mb0,Ob0,Nb0,Db0,ot,Pb0,Bb0,Ab0,Tb0,vw=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=th(Bb0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let Y=jo($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(Y==="2020-12")return this.ajv;if(Y==="2019-09")return this._ajv2019??=th(Pb0.Ajv2019);return this._ajvDraft7??=th(ot.Ajv)}getValidator($){let Y=this._engineFor($),z="$id"in $&&typeof $.$id==="string"?Y.getSchema($.$id)??Y.compile($):Y.compile($);return(U)=>{return z(U)?{valid:!0,data:U,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:Y.errorsText(z.errors)}}}},Pf1;var rt=o(()=>{cT();nT();jw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var Y=class{};$._CodeOrName=Y,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var z=class extends Y{constructor(w){super();if(!$.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=z;var U=class extends Y{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((O,D)=>`${O}${D}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((O,D)=>{if(D instanceof z)O[D.str]=(O[D.str]||0)+1;return O},{})}};$._Code=U,$.nil=new U("");function I(w,...O){let D=[w[0]],N=0;while(N<O.length)K(D,O[N]),D.push(w[++N]);return new U(D)}$._=I;let Q=new U("+");function J(w,...O){let D=[q(w[0])],N=0;while(N<O.length)D.push(Q),K(D,O[N]),D.push(Q,q(w[++N]));return G(D),new U(D)}$.str=J;function K(w,O){if(O instanceof U)w.push(...O._items);else if(O instanceof z)w.push(O);else w.push(X(O))}$.addCodeArg=K;function G(w){let O=1;while(O<w.length-1){if(w[O]===Q){let D=W(w[O-1],w[O+1]);if(D!==void 0){w.splice(O-1,3,D);continue}w[O++]="+"}O++}}function W(w,O){if(O==='""')return w;if(w==='""')return O;if(typeof w=="string"){if(O instanceof z||w[w.length-1]!=='"')return;if(typeof O!="string")return`${w.slice(0,-1)}${O}"`;if(O[0]==='"')return w.slice(0,-1)+O.slice(1);return}if(typeof O=="string"&&O[0]==='"'&&!(w instanceof z))return`"${w}${O.slice(1)}`}function H(w,O){return O.emptyStr()?w:w.emptyStr()?O:J`${w}${O}`}$.strConcat=H;function X(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:q(Array.isArray(w)?w.join(","):w)}function Z(w){return new U(q(w))}$.stringify=Z;function q(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(w){return typeof w=="string"&&$.IDENTIFIER.test(w)?new U(`.${w}`):I`[${w}]`}$.getProperty=V;function F(w){if(typeof w=="string"&&$.IDENTIFIER.test(w))return new U(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}$.getEsmExportName=F;function M(w){return new U(w.toStringLine truncated
`:""},this._extScope=y,this._scope=new z.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let Y0=this._extScope.value(y,s);return(this._values[Y0.prefix]||(this._values[Y0.prefix]=new Set)).add(Y0),Y0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,Y0,M0){let E0=this._scope.toName(s);if(Y0!==void 0&&M0)this._constants[E0.str]=Y0;return this._leafNode(new J(y,E0,Y0)),E0}const(y,s,Y0){return this._def(z.varKinds.const,y,s,Y0)}let(y,s,Y0){return this._def(z.varKinds.let,y,s,Y0)}var(y,s,Y0){return this._def(z.varKinds.var,y,s,Y0)}assign(y,s,Y0){return this._leafNode(new K(y,s,Y0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==Y.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[Y0,M0]of y){if(s.length>1)s.push(",");if(s.push(Y0),Y0!==M0||this.opts.es5)s.push(":"),(0,Y.addCodeArg)(s,M0)}return s.push("}"),new Y._Code(s)}if(y,s,Y0){if(this._blockNode(new w(y)),s&&Y0)this.code(s).else().code(Y0).endIf();else if(s)this.code(s).endIf();else if(Y0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new w(y))}else(){return this._elseNode(new M)}endIf(){return this._endBlockNode(w,M)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new D(y),s)}forRange(y,s,Y0,M0,E0=this.opts.es5?z.varKinds.var:z.varKinds.let){let G0=this._scope.toName(y);return this._for(new N(E0,G0,s,Y0),()=>M0(G0))}forOf(y,s,Y0,M0=z.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof Y.Name?s:this.var("_arr",s);return this.forRange("_i",0,Y._`${G0}.length`,(T0)=>{this.var(E0,Y._`${G0}[${T0}]`),Y0(E0)})}return this._for(new A("of",M0,E0,s),()=>Y0(E0))}forIn(y,s,Y0,M0=this.opts.es5?z.varKinds.var:z.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,Y._`Object.keys(${s})`,Y0);let E0=this._scope.toName(y);return this._for(new A("in",M0,E0,s),()=>Y0(E0))}endFor(){return this._endBlockNode(O)}label(y){return this._leafNode(new W(y))}break(y){return this._leafNode(new H(y))}return(y){let s=new P;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(y,s,Y0){if(!s&&!Y0)throw Error('CodeGen: "try" without "catch" and "finally"');let M0=new j;if(this._blockNode(M0),this.code(y),s){let E0=this.name("e");this._currNode=M0.catch=new C(E0),s(E0)}if(Y0)this._currNode=M0.finally=new b,this.code(Y0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let Y0=this._nodes.length-s;if(Y0<0||y!==void 0&&Y0!==y)throw Error(`CodeGen: wrong number of nodes: ${Y0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=Y.nil,Y0,M0){if(this._blockNode(new T(y,s,Y0)),M0)this.code(M0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let Y0=this._currNode;if(Y0 instanceof y||s&&Y0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=k;function h(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)+(s[Y0]||0);return y}function i(y,s){return s instanceof Y._CodeOrName?h(y,s.names):y}function c(y,s,Y0){if(y instanceof Y.Name)return M0(y);if(!E0(y))return y;return new Y._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof Y.Name)T0=M0(T0);if(T0 instanceof Y._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function M0(G0){let T0=Y0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof Y._Code&&G0._items.some((T0)=>T0 instanceof Y.Name&&s[T0.str]===1&&Y0[T0.str]!==void 0)}}function U0(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)-(s[Y0]||0)}function x(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:Y._`!${e(y)}`}$.not=x;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,Y0)=>s===Y.nil?Y0:Y0===Y.nil?s:Y._`${e(s)} ${y} ${e(Y0)}`}function Line truncated
|| (${C} == "string" && ${P} && ${P} == +${P})`).assign(b,I._`+${P}`);return;case"integer":T.elseIf(I._`${C} === "boolean" || ${P} === null
|| (${C} === "string" && ${P} && ${P} == +${P} && !(${P} % 1))`).assign(b,I._`+${P}`);return;case"boolean":T.elseIf(I._`${P} === "false" || ${P} === 0 || ${P} === null`).assign(b,!1).elseIf(I._`${P} === "true" || ${P} === 1`).assign(b,!0);return;case"null":T.elseIf(I._`${P} === "" || ${P} === 0 || ${P} === false`),T.assign(b,null);return;case"array":T.elseIf(I._`${C} === "string" || ${C} === "number"
|| ${C} === "boolean" || ${P} === null`).assign(b,I._`[${P}]`)}}}function q({gen:D,parentData:N,parentDataProperty:A},T){D.if(I._`${N} !== undefined`,()=>D.assign(I._`${N}[${A}]`,T))}function V(D,N,A,T=J.Correct){let P=T===J.Correct?I.operators.EQ:I.operators.NEQ,j;switch(D){case"null":return I._`${N} ${P} null`;case"array":j=I._`Array.isArray(${N})`;break;case"object":j=I._`${N} && typeof ${N} == "object" && !Array.isArray(${N})`;break;case"integer":j=C(I._`!(${N} % 1) && !isNaN(${N})`);break;case"number":j=C();break;default:return I._`typeof ${N} ${P} ${D}`}return T===J.Correct?j:(0,I.not)(j);function C(b=I.nil){return(0,I.and)(I._`typeof ${N} == "number"`,b,A?I._`isFinite(${N})`:I.nil)}}$.checkDataType=V;function F(D,N,A,T){if(D.length===1)return V(D[0],N,A,T);let P,j=(0,Q.toHash)(D);if(j.array&&j.object){let C=I._`typeof ${N} != "object"`;P=j.null?C:I._`!${N} || ${C}`,delete j.null,delete j.array,delete j.object}else P=I.nil;if(j.number)delete j.integer;for(let C in j)P=(0,I.and)(P,V(C,N,A,T));return P}$.checkDataTypes=F;let M={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:N})=>typeof D=="string"?I._`{type: ${D}}`:I._`{type: ${N}}`};function w(D){let N=O(D);(0,U.reportError)(N,M)}$.reportTypeError=w;function O(D){let{gen:N,data:A,schema:T}=D,P=(0,Q.schemaRefOrVal)(D,T,"type");return{gen:N,keyword:"type",data:A,schema:T.type,schemaCode:P,schemaValue:P,parentSchema:T,params:{},it:D}}}),Xu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=L1(),z=v1();function U(Q,J){let{properties:K,items:G}=Q.schema;if(J==="object"&&K)for(let W in K)I(Q,W,K[W].default);else if(J==="array"&&Array.isArray(G))G.forEach((W,H)=>I(Q,H,W.default))}$.assignDefaults=U;function I(Q,J,K){let{gen:G,compositeRule:W,data:H,opts:X}=Q;if(K===void 0)return;let Z=Y._`${H}${(0,Y.getProperty)(J)}`;if(W){(0,z.checkStrictMode)(Q,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(K)}`)}}),I5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=L1(),z=v1(),U=U5(),I=v1();function Q(D,N){let{gen:A,data:T,it:P}=D;A.if(X(A,T,N,P.opts.ownProperties),()=>{D.setParams({missingProperty:Y._`${N}`},!0),D.error()})}$.checkReportMissingProp=Q;function J({gen:D,data:N,it:{opts:A}},T,P){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(D,N,j,A.ownProperties),Y._`${P} = ${j}`)))}$.checkMissingProp=J;function K(D,N){D.setParams({missingProperty:N},!0),D.error()}$.reportMissingProp=K;function G(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function W(D,N,A){return Y._`${G(D)}.call(${N}, ${A})`}$.isOwnProperty=W;function H(D,N,A,T){let P=Y._`${N}${(0,Y.getProperty)(A)} !== undefined`;return T?Y._`${P} && ${W(D,N,A)}`:P}$.propertyInData=H;function X(D,N,A,T){let P=Y._`${N}${(0,Y.getProperty)(A)} === undefined`;return T?(0,Y.or)(P,(0,Y.not)(W(D,N,A))):P}$.noPropertyInData=X;function Z(D){return D?Object.keys(D).filter((N)=>N!=="__proto__"):[]}$.allSchemaProperties=Z;function q(D,N){return Z(N).filter((A)=>!(0,z.alwaysValidSchema)(D,N[A]))}$.schemaProperties=q;function V({schemaCode:D,data:N,it:{gen:A,topSchemaRef:T,schemaPath:P,errorPath:j},it:C},b,k,h){let i=h?Y._`${D}, ${N}, ${T}${P}`:N,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${A.object(...c)}`;return k!==Y.nil?Y._`${b}.call(${k}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:D,it:{opts:N}},A){let T=N.unicodeRegExp?"u":"",{regExp:P}=N.code,j=P(A,T);return D.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${P.code==="new RegExp"?F:(0,I.useFunc)(D,P)}(${A}, ${T})`})}$.usePattern=M;function w(D){let{gen:N,data:A,keyword:T,it:P}=D,j=N.name("valid");if(P.allErrors){let b=N.let("valid",!0);return C(()=>N.assign(b,!1)),b}return N.var(j,!0),C(()=>N.break()),j;function C(b){let k=N.const("len",Y._`${A}.length`);N.forRange("i",0,k,(h)=>{D.subschema({keyword:T,dataProp:h,dataPropType:z.Type.Num},j),N.if((0,Y.not)(j),b)})}}$.validateArray=w;function O(D){let{gen:N,schema:A,keyword:T,it:P}=D;if(!Array.isArray(A))throw Error("ajv implementation error");if(A.some((b)=>(0,z.alwaysValidSchema)(P,b))&&!P.opts.unevaluated)return;let j=N.let("valid",!1),C=N.name("_valid");N.block(()=>A.forEach((b,k)=>{let h=D.subschema({keyword:T,schemaProp:k,compositeRule:!0},C);if(N.assign(j,Y._`${j} || ${C}`),!D.mergeValidEvaluated(h,C) Line truncated
*/ju0=R0(($)=>{var Y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,z=/\\([\u000b\u0020-\u00ff])/g,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=I;function I(K){if(!K)throw TypeError("argument string is required");var G=typeof K==="object"?Q(K):K;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var H=G.indexOf(";"),W=H!==-1?G.slice(0,H).trim():G.trim();if(!U.test(W))throw TypeError("invalid media type");var X=new J(W.toLowerCase());if(H!==-1){var Z,q,V;Y.lastIndex=H;while(q=Y.exec(G)){if(q.index!==H)throw TypeError("invalid parameter format");if(H+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(z,"$1")}X.parameters[Z]=V}if(H!==G.length)throw TypeError("invalid parameter format")}return X}function Q(K){var G;if(typeof K.getHeader==="function")G=K.getHeader("content-type");else if(typeof K.headers==="object")G=K.headers&&K.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function J(K){this.parameters=Object.create(null),this.type=K}}),if1=nq(ju0(),1);Eu0=/^[A-Za-z0-9._-]{1,128}$/});function US($){let Y=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return ob0(Y),Y}var vw,ct,L1,v1,U5,Sw,Su0,nt,pt,hw,gu0,I5,yu0,ku0,dt,xu0,gw,SI,qH,gI,yw,fu0,mt,uu0,bu0,iu0,IS,cu0,QS,lt,nu0,pu0,du0,mu0,lu0,ou0,ru0,su0,JS,au0,tu0,eu0,ot,rt,st,$b0,Yb0,zb0,KS,Ub0,at,Ib0,Qb0,Jb0,Kb0,Gb0,Hb0,Wb0,Xb0,tt,Zb0,et,$e,Ye,qb0,GS,Vb0,ze,Ue,Ie,Lb0,Fb0,Qe,wb0,Mb0,Ob0,Je,Nb0,Db0,Ke,Ab0,Pb0,Bb0,Tb0,jb0,Eb0,Cb0,Rb0,_b0,vb0,hb0,Sb0,gb0,yb0,kb0,xb0,fb0,ub0,bb0,ib0,cb0,nb0,pb0,Ge,db0,mb0,lb0,ob0,kw=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=US(mb0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let Y=bo($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(Y==="2020-12")return this.ajv;if(Y==="2019-09")return this._ajv2019??=US(db0.Ajv2019);return this._ajvDraft7??=US(Ge.Ajv)}getValidator($){let Y=this._engineFor($),z="$id"in $&&typeof $.$id==="string"?Y.getSchema($.$id)??Y.compile($):Y.compile($);return(U)=>{return z(U)?{valid:!0,data:U,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:Y.errorsText(z.errors)}}}},ef1;var He=o(()=>{lT();oT();vw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var Y=class{};$._CodeOrName=Y,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var z=class extends Y{constructor(w){super();if(!$.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=z;var U=class extends Y{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((O,D)=>`${O}${D}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((O,D)=>{if(D instanceof z)O[D.str]=(O[D.str]||0)+1;return O},{})}};$._Code=U,$.nil=new U("");function I(w,...O){let D=[w[0]],N=0;while(N<O.length)K(D,O[N]),D.push(w[++N]);return new U(D)}$._=I;let Q=new U("+");function J(w,...O){let D=[q(w[0])],N=0;while(N<O.length)D.push(Q),K(D,O[N]),D.push(Q,q(w[++N]));return G(D),new U(D)}$.str=J;function K(w,O){if(O instanceof U)w.push(...O._items);else if(O instanceof z)w.push(O);else w.push(X(O))}$.addCodeArg=K;function G(w){let O=1;while(O<w.length-1){if(w[O]===Q){let D=H(w[O-1],w[O+1]);if(D!==void 0){w.splice(O-1,3,D);continue}w[O++]="+"}O++}}function H(w,O){if(O==='""')return w;if(w==='""')return O;if(typeof w=="string"){if(O instanceof z||w[w.length-1]!=='"')return;if(typeof O!="string")return`${w.slice(0,-1)}${O}"`;if(O[0]==='"')return w.slice(0,-1)+O.slice(1);return}if(typeof O=="string"&&O[0]==='"'&&!(w instanceof z))return`"${w}${O.slice(1)}`}function W(w,O){return O.emptyStr()?w:w.emptyStr()?O:J`${w}${O}`}$.strConcat=W;function X(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:q(Array.isArray(w)?w.join(","):w)}function Z(w){return new U(q(w))}$.stringify=Z;function q(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(w){return typeof w=="string"&&$.IDENTIFIER.test(w)?new U(`.${w}`):I`[${w}]`}$.getProperty=V;function F(w){if(typeof w=="string"&&$.IDENTIFIER.test(w))return new U(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}$.getEsmExportName=F;function M(w){return new U(w.toStringLine truncated
`:""},this._extScope=y,this._scope=new z.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let Y0=this._extScope.value(y,s);return(this._values[Y0.prefix]||(this._values[Y0.prefix]=new Set)).add(Y0),Y0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,Y0,M0){let E0=this._scope.toName(s);if(Y0!==void 0&&M0)this._constants[E0.str]=Y0;return this._leafNode(new J(y,E0,Y0)),E0}const(y,s,Y0){return this._def(z.varKinds.const,y,s,Y0)}let(y,s,Y0){return this._def(z.varKinds.let,y,s,Y0)}var(y,s,Y0){return this._def(z.varKinds.var,y,s,Y0)}assign(y,s,Y0){return this._leafNode(new K(y,s,Y0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==Y.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[Y0,M0]of y){if(s.length>1)s.push(",");if(s.push(Y0),Y0!==M0||this.opts.es5)s.push(":"),(0,Y.addCodeArg)(s,M0)}return s.push("}"),new Y._Code(s)}if(y,s,Y0){if(this._blockNode(new w(y)),s&&Y0)this.code(s).else().code(Y0).endIf();else if(s)this.code(s).endIf();else if(Y0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new w(y))}else(){return this._elseNode(new M)}endIf(){return this._endBlockNode(w,M)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new D(y),s)}forRange(y,s,Y0,M0,E0=this.opts.es5?z.varKinds.var:z.varKinds.let){let G0=this._scope.toName(y);return this._for(new N(E0,G0,s,Y0),()=>M0(G0))}forOf(y,s,Y0,M0=z.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof Y.Name?s:this.var("_arr",s);return this.forRange("_i",0,Y._`${G0}.length`,(T0)=>{this.var(E0,Y._`${G0}[${T0}]`),Y0(E0)})}return this._for(new B("of",M0,E0,s),()=>Y0(E0))}forIn(y,s,Y0,M0=this.opts.es5?z.varKinds.var:z.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,Y._`Object.keys(${s})`,Y0);let E0=this._scope.toName(y);return this._for(new B("in",M0,E0,s),()=>Y0(E0))}endFor(){return this._endBlockNode(O)}label(y){return this._leafNode(new H(y))}break(y){return this._leafNode(new W(y))}return(y){let s=new A;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(y,s,Y0){if(!s&&!Y0)throw Error('CodeGen: "try" without "catch" and "finally"');let M0=new j;if(this._blockNode(M0),this.code(y),s){let E0=this.name("e");this._currNode=M0.catch=new C(E0),s(E0)}if(Y0)this._currNode=M0.finally=new b,this.code(Y0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let Y0=this._nodes.length-s;if(Y0<0||y!==void 0&&Y0!==y)throw Error(`CodeGen: wrong number of nodes: ${Y0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=Y.nil,Y0,M0){if(this._blockNode(new T(y,s,Y0)),M0)this.code(M0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let Y0=this._currNode;if(Y0 instanceof y||s&&Y0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=k;function h(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)+(s[Y0]||0);return y}function i(y,s){return s instanceof Y._CodeOrName?h(y,s.names):y}function c(y,s,Y0){if(y instanceof Y.Name)return M0(y);if(!E0(y))return y;return new Y._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof Y.Name)T0=M0(T0);if(T0 instanceof Y._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function M0(G0){let T0=Y0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof Y._Code&&G0._items.some((T0)=>T0 instanceof Y.Name&&s[T0.str]===1&&Y0[T0.str]!==void 0)}}function U0(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)-(s[Y0]||0)}function x(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:Y._`!${e(y)}`}$.not=x;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,Y0)=>s===Y.nil?Y0:Y0===Y.nil?s:Y._`${e(s)} ${y} ${e(Y0)}`}function Line truncated
|| (${C} == "string" && ${A} && ${A} == +${A})`).assign(b,I._`+${A}`);return;case"integer":T.elseIf(I._`${C} === "boolean" || ${A} === null
|| (${C} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(b,I._`+${A}`);return;case"boolean":T.elseIf(I._`${A} === "false" || ${A} === 0 || ${A} === null`).assign(b,!1).elseIf(I._`${A} === "true" || ${A} === 1`).assign(b,!0);return;case"null":T.elseIf(I._`${A} === "" || ${A} === 0 || ${A} === false`),T.assign(b,null);return;case"array":T.elseIf(I._`${C} === "string" || ${C} === "number"
|| ${C} === "boolean" || ${A} === null`).assign(b,I._`[${A}]`)}}}function q({gen:D,parentData:N,parentDataProperty:B},T){D.if(I._`${N} !== undefined`,()=>D.assign(I._`${N}[${B}]`,T))}function V(D,N,B,T=J.Correct){let A=T===J.Correct?I.operators.EQ:I.operators.NEQ,j;switch(D){case"null":return I._`${N} ${A} null`;case"array":j=I._`Array.isArray(${N})`;break;case"object":j=I._`${N} && typeof ${N} == "object" && !Array.isArray(${N})`;break;case"integer":j=C(I._`!(${N} % 1) && !isNaN(${N})`);break;case"number":j=C();break;default:return I._`typeof ${N} ${A} ${D}`}return T===J.Correct?j:(0,I.not)(j);function C(b=I.nil){return(0,I.and)(I._`typeof ${N} == "number"`,b,B?I._`isFinite(${N})`:I.nil)}}$.checkDataType=V;function F(D,N,B,T){if(D.length===1)return V(D[0],N,B,T);let A,j=(0,Q.toHash)(D);if(j.array&&j.object){let C=I._`typeof ${N} != "object"`;A=j.null?C:I._`!${N} || ${C}`,delete j.null,delete j.array,delete j.object}else A=I.nil;if(j.number)delete j.integer;for(let C in j)A=(0,I.and)(A,V(C,N,B,T));return A}$.checkDataTypes=F;let M={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:N})=>typeof D=="string"?I._`{type: ${D}}`:I._`{type: ${N}}`};function w(D){let N=O(D);(0,U.reportError)(N,M)}$.reportTypeError=w;function O(D){let{gen:N,data:B,schema:T}=D,A=(0,Q.schemaRefOrVal)(D,T,"type");return{gen:N,keyword:"type",data:B,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:D}}}),gu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=L1(),z=v1();function U(Q,J){let{properties:K,items:G}=Q.schema;if(J==="object"&&K)for(let H in K)I(Q,H,K[H].default);else if(J==="array"&&Array.isArray(G))G.forEach((H,W)=>I(Q,W,H.default))}$.assignDefaults=U;function I(Q,J,K){let{gen:G,compositeRule:H,data:W,opts:X}=Q;if(K===void 0)return;let Z=Y._`${W}${(0,Y.getProperty)(J)}`;if(H){(0,z.checkStrictMode)(Q,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(K)}`)}}),I5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=L1(),z=v1(),U=U5(),I=v1();function Q(D,N){let{gen:B,data:T,it:A}=D;B.if(X(B,T,N,A.opts.ownProperties),()=>{D.setParams({missingProperty:Y._`${N}`},!0),D.error()})}$.checkReportMissingProp=Q;function J({gen:D,data:N,it:{opts:B}},T,A){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(D,N,j,B.ownProperties),Y._`${A} = ${j}`)))}$.checkMissingProp=J;function K(D,N){D.setParams({missingProperty:N},!0),D.error()}$.reportMissingProp=K;function G(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(D,N,B){return Y._`${G(D)}.call(${N}, ${B})`}$.isOwnProperty=H;function W(D,N,B,T){let A=Y._`${N}${(0,Y.getProperty)(B)} !== undefined`;return T?Y._`${A} && ${H(D,N,B)}`:A}$.propertyInData=W;function X(D,N,B,T){let A=Y._`${N}${(0,Y.getProperty)(B)} === undefined`;return T?(0,Y.or)(A,(0,Y.not)(H(D,N,B))):A}$.noPropertyInData=X;function Z(D){return D?Object.keys(D).filter((N)=>N!=="__proto__"):[]}$.allSchemaProperties=Z;function q(D,N){return Z(N).filter((B)=>!(0,z.alwaysValidSchema)(D,N[B]))}$.schemaProperties=q;function V({schemaCode:D,data:N,it:{gen:B,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,k,h){let i=h?Y._`${D}, ${N}, ${T}${A}`:N,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${B.object(...c)}`;return k!==Y.nil?Y._`${b}.call(${k}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:D,it:{opts:N}},B){let T=N.unicodeRegExp?"u":"",{regExp:A}=N.code,j=A(B,T);return D.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${A.code==="new RegExp"?F:(0,I.useFunc)(D,A)}(${B}, ${T})`})}$.usePattern=M;function w(D){let{gen:N,data:B,keyword:T,it:A}=D,j=N.name("valid");if(A.allErrors){let b=N.let("valid",!0);return C(()=>N.assign(b,!1)),b}return N.var(j,!0),C(()=>N.break()),j;function C(b){let k=N.const("len",Y._`${B}.length`);N.forRange("i",0,k,(h)=>{D.subschema({keyword:T,dataProp:h,dataPropType:z.Type.Num},j),N.if((0,Y.not)(j),b)})}}$.validateArray=w;function O(D){let{gen:N,schema:B,keyword:T,it:A}=D;if(!Array.isArray(B))throw Error("ajv implementation error");if(B.some((b)=>(0,z.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=N.let("valid",!1),C=N.name("_valid");N.block(()=>B.forEach((b,k)=>{let h=D.subschema({keyword:T,schemaProp:k,compositeRule:!0},C);if(N.assign(j,Y._`${j} || ${C}`),!D.mergeValidEvaluated(h,C) Line truncated
missingProperty: ${X},
depsCount: ${W},
deps: ${H}}`};let I={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[W,H]=Q(G);J(G,W),K(G,H)}};function Q({schema:G}){let W={},H={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?W:H;Z[X]=G[X]}return[W,H]}function J(G,W=G.schema){let{gen:H,data:X,it:Z}=G;if(Object.keys(W).length===0)return;let q=H.let("missing");for(let V in W){let F=W[V];if(F.length===0)continue;let M=(0,U.propertyInData)(H,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)H.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else H.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.reportMissingProp)(G,q),H.else()}}$.validatePropertyDeps=J;function K(G,W=G.schema){let{gen:H,data:X,keyword:Z,it:q}=G,V=H.name("valid");for(let F in W){if((0,z.alwaysValidSchema)(q,W[F]))continue;H.if((0,U.propertyInData)(H,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>H.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=I}),gu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:I})=>Y._`{propertyName: ${I.propertyName}}`},code(I){let{gen:Q,schema:J,data:K,it:G}=I;if((0,z.alwaysValidSchema)(G,J))return;let W=Q.name("valid");Q.forIn("key",K,(H)=>{I.setParams({propertyName:H}),I.subschema({keyword:"propertyNames",data:H,dataTypes:["string"],propertyName:H,compositeRule:!0},W),Q.if((0,Y.not)(W),()=>{if(I.error(!0),!G.allErrors)Q.break()})}),I.ok(W)}};$.default=U}),xt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=U5(),I=v1(),Q={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:J})=>z._`{additionalProperty: ${J.additionalProperty}}`},code(J){let{gen:K,schema:G,parentSchema:W,data:H,errsCount:X,it:Z}=J;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,I.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(W.properties),M=(0,Y.allSchemaProperties)(W.patternProperties);w(),J.ok(z._`${X} === ${U.default.errors}`);function w(){K.forIn("key",H,(T)=>{if(!F.length&&!M.length)N(T);else K.if(O(T),()=>N(T))})}function O(T){let P;if(F.length>8){let j=(0,I.schemaRefOrVal)(Z,W.properties,"properties");P=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)P=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else P=z.nil;if(M.length)P=(0,z.or)(P,...M.map((j)=>z._`${(0,Y.usePattern)(J,j)}.test(${T})`));return(0,z.not)(P)}function D(T){K.code(z._`delete ${H}[${T}]`)}function N(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){D(T);return}if(G===!1){if(J.setParams({additionalProperty:T}),J.error(),!q)K.break();return}if(typeof G=="object"&&!(0,I.alwaysValidSchema)(Z,G)){let P=K.name("valid");if(V.removeAdditional==="failing")A(T,P,!1),K.if((0,z.not)(P),()=>{J.reset(),D(T)});else if(A(T,P),!q)K.if((0,z.not)(P),()=>K.break())}}function A(T,P,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:I.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});J.subschema(C,P)}}};$.default=Q}),yu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=vI(),z=I5(),U=v1(),I=xt(),Q={keyword:"properties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,parentSchema:W,data:H,it:X}=J;if(X.opts.removeAdditional==="all"&&W.additionalProperties===void 0)I.default.code(new Y.KeywordCxt(X,I.default,"additionalProperties"));let Z=(0,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,z.propertyInData)(K,H,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}J.it.definedProperties.add(w),J.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){J.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=Q}),ku0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=v1(),I=v1(),Q={keyword:"patternProperties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,data:W,parentSchema:H,it:X}=J,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((A)=>(0,U.alwaysValidSchema)(X,G[A]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&H.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,I.evaluatedPropsToName)(K,X.props);let{props:w}=X;O();function O(){for(let A of q){if(F)D(A);if(X.allErrors) Line truncated
\x00`,k+=O4(j,2),k+=K.magic,k+=O4(M,2),k+=O4(w,2),k+=O4(P.crc32,4),k+=O4(P.compressedSize,4),k+=O4(P.uncompressedSize,4),k+=O4(W.length,2),k+=O4(O.length,2);var h=qO.LOCAL_FILE_HEADER+k+W+O,i=qO.CENTRAL_FILE_HEADER+O4(b,2)+k+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+W+O+Z;return{fileRecord:h,dirRecord:i}},uo0=function($,Y,z,U,I){var Q="",J=ZQ.transformTo("string",I(U));return Q=qO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(J.length,2)+J,Q},bo0=function($){var Y="";return Y=qO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){qQ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}ZQ.inherits(X5,qQ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,qQ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=F50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=F50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:bo0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y<this.dirRecords.length;Y++)this.push({data:this.dirRecords[Y],meta:{percent:100}});var z=this.bytesWritten-$,U=uo0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var Y=this;return $.on("data",function(z){Y.processChunk(z)}),$.on("end",function(){if(Y.closedSource(Y.previous.streamInfo),Y._sources.length)Y.prepareNextSource();else Y.end()}),$.on("error",function(z){Y.error(z)}),this};X5.prototype.resume=function(){if(!qQ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var Y=this._sources;if(!qQ.prototype.error.call(this,$))return!1;for(var z=0;z<Y.length;z++)try{Y[z].error($)}catch(U){}return!0};X5.prototype.lock=function(){qQ.prototype.lock.call(this);var $=this._sources;for(var Y=0;Y<$.length;Y++)$[Y].lock()};w50.exports=X5});var O50=E((po0)=>{var io0=Sy(),co0=M50(),no0=function($,Y){var z=$||Y,U=io0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};po0.generateWorker=function($,Y,z){var U=new co0(Y.streamFiles,z,Y.platform,Y.encodeFileName),I=0;try{$.forEach(function(Q,J){I++;var K=no0(J.options.compression,Y.compression),G=J.options.compressionOptions||Y.compressionOptions||{},W=J.dir,H=J.date;J._compressWorker(K,G).withStreamInfo("file",{name:Q,dir:W,date:H,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(U)}),U.entriesCount=I}catch(Q){U.error(Q)}return U}});var D50=E((Zp1,N50)=>{var mo0=c4(),VO=J$();function VH($,Y){VO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}mo0.inherits(VH,VO);VH.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};VH.prototype.pause=function(){if(!VO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};VH.prototype.resume=function(){if(!VO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};N50.exports=VH});var v50=E((qp1,_50)=>{var lo0=zQ(),LH=c4(),T50=J$(),oo0=ug(),j50=bg(),P50=rM(),ro0=B80(),so0=O50(),B50=lW(),ao0=D50(),E50=function($,Y,z){var U=LH.getTypeOf(Y),I,Q=LH.extend(z||{},j50);if(Q.date=Q.date||new Date,Q.compression!==null)Q.compression=Q.compression.toUpperCase();if(typeof Q.unixPermissions==="string")Q.unixPermissions=parseInt(Q.unixPermissions,8);if(Q.unixPermissions&&Q.unixPermissions&16384)Q.dir=!0;if(Q.dosPermissions&&Q.dosPermission Line truncated
`)}openNode($,Y){let z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),Fk(U,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)D30(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Fk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(N30.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("</"),Y.push($),Y.push(">");this.open=!1,this.leaf=!1}leafNode($,Y,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}wk.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};P30.exports=wk});var Mk=E((ca0)=>{var B30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function ia0($){if(typeof $==="string")return $;if(B30)return B30.decode($);return $.toString()}ca0.bufferToString=ia0});var C30=E((T30)=>{Object.defineProperty(T30,"__esModule",{value:!0});T30.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;T30.S=` \r
`;T30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";T30.NAME_CHAR="-"+T30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";T30.CHAR_RE=new RegExp("^["+T30.CHAR+"]$","u");T30.S_RE=new RegExp("^["+T30.S+"]+$","u");T30.NAME_START_CHAR_RE=new RegExp("^["+T30.NAME_START_CHAR+"]$","u");T30.NAME_CHAR_RE=new RegExp("^["+T30.NAME_CHAR+"]$","u");T30.NAME_RE=new RegExp("^["+T30.NAME_START_CHAR+"]["+T30.NAME_CHAR+"]*$","u");T30.NMTOKEN_RE=new RegExp("^["+T30.NAME_CHAR+"]+$","u");var Ok=9,Nk=10,Dk=13,Pk=32;T30.S_LIST=[Pk,Nk,Dk,Ok];function pa0($){return $>=Pk&&$<=55295||$===Nk||$===Dk||$===Ok||$>=57344&&$<=65533||$>=65536&&$<=1114111}T30.isChar=pa0;function da0($){return $===Pk||$===Nk||$===Dk||$===Ok}T30.isS=da0;function A30($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}T30.isNameStartChar=A30;function ma0($){return A30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}T30.isNameChar=ma0});var f30=E((g30)=>{Object.defineProperty(g30,"__esModule",{value:!0});g30.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";g30.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";g30.S=` \r
`;g30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";g30.NAME_CHAR="-"+g30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";g30.CHAR_RE=new RegExp("^["+g30.CHAR+"]$","u");g30.RESTRICTED_CHAR_RE=new RegExp("^["+g30.RESTRICTED_CHAR+"]$","u");g30.S_RE=new RegExp("^["+g30.S+"]+$","u");g30.NAME_START_CHAR_RE=new RegExp("^["+g30.NAME_START_CHAR+"]$","u");g30.NAME_CHAR_RE=new RegExp("^["+g30.NAME_CHAR+"]$","u");g30.NAME_RE=new RegExp("^["+g30.NAME_START_CHAR+"]["+g30.NAME_CHAR+"]*$","u");g30.NMTOKEN_RE=new RegExp("^["+g30.NAME_CHAR+"]+$","u");var R30=9,_30=10,v30=13,h30=32;g30.S_LIST=[h30,_30,v30,R30];function It0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}g30.isChar=It0;function Qt0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}g30.isRestrictedChar=Qt0;function Jt0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}g30.isCharAndNotRestricted=Jt0;function Kt0($){return $===h30||$===_30||$===v30||$===R30}g30.isS=Kt0;function S30($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}g30.isNameStartChar=S30;function Gt0($){return S30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}g30.isNameChar=Gt0});var i30=E((b30)=>{Object.defineProperty(b30,"__esModule",{value:!0});b30.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";b30.NC_NAME_CHAR="-"+b30.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";b30.NC_NAME_START_CHAR_RE=new RegExp("^["+b30.NC_NAME_START_CHAR+"]$","u");b30.NC_NAME_CHAR_RE=new RegExp("^["+b30.NC_NAME_CHAR+"]$","u");b30.NC_NAME_RE=new RegExp("^["+b30.NC_NAME_START_CHAR+"]["+b30.NC_NAME_CHAR+"]*$","u");function u30($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}b30.isNCNameStartChar=u30;function Bt0($){return u30($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}b30.isNCNameChar=Bt0});var W70=E((G70)=>{Object.defineProperty(G70,"__esModule",{value:!0});var TQ=C30(),Rt0=f30(),kk=i30(),p8=TQ.isS,_t0=TQ.isChar,CH=TQ.isNameStartChar,c30=TQ.isNameChar,z70=TQ.S_LIST,vt0=TQ.NAME_RE,ht0=Rt0.isChar,St0=kk.isNCNameStartChar,gt0=kk.isNCNameChar,yt0=kk.NC_NAME_RE,nO="http://www.w3.org/XML/1998/namespace",AQ="http://www.w3.org/2000/xmlns/",kt0={__proto__:null,xml:nO,xmlns:AQ},xt0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,Q9=-2,n30=0,ft0=1,Ak=2,ut0=3,DQ=4,bt0=5,it0=6,ct0=7,Tk=8,nt0=9,pt0=10,dt0=11,mt0=12,C8=13,fO=14,jk=15,lt0=16,Ek=17,ot0=18,rt0=19,Ck=20,st0=21,at0=22,tt0=23,p30=24,Rk=25,uO=26,d30=27,et0=28,$e0=29,m30=30,Ye0=31,ze0=32,Jz=33,Ue0=34,_k=35,RH=36,vk=37,Ie0=38,l30=39,o30=40,Qe0=41,r30=42,Je0=43,Ke0=44,hk=9,q5=10,Sk=13,s30=32,a30=33,U70=34,_H=38,I70=39,bO=45,iO=47,Ge0=59,r7=60,PQ=61,A6=62,o6=63,Q70=91,BQ=93,t30=133,e30=8232,cO=($)=>$===U70||$===I70,J70=[U70,I70],We0=[...J70,Q70,A6],He0=[...J70,r7,BQ],Xe0=[PQ,o6,...z70],Ze0=[...z70,A6,_H,r7];function yk($,Y,z){switch(Y){case"xml":if(z!==nO)$.fail(`xml prefix must be bound to ${nO}.`);break;case"xmlns":if(z!==AQ)$.fail(`xmlns prefix must be bound to ${AQ}.`);break;default:}switch(z){case AQ:$.fail(Y===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${AQ}.`);break;case nO:switch(Y){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function qe0($,Y){for(let z of Object.keys(Y))yk($,z,Y[z])}var Ve0=($)=>yt0.test($),Le0=($)=>vt0.test($),Kz=0,$70=1,gk=2;G70.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var Y70={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class K70{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let Y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,Y){this.nameStartCheck=St0,this.nameCheck=gt0,this.isName=Ve0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},kt0);let z=this.opt.additionalNamesp Line truncated
depsCount: ${H},
deps: ${W}}`};let I={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=Q(G);J(G,H),K(G,W)}};function Q({schema:G}){let H={},W={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?H:W;Z[X]=G[X]}return[H,W]}function J(G,H=G.schema){let{gen:W,data:X,it:Z}=G;if(Object.keys(H).length===0)return;let q=W.let("missing");for(let V in H){let F=H[V];if(F.length===0)continue;let M=(0,U.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else W.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=J;function K(G,H=G.schema){let{gen:W,data:X,keyword:Z,it:q}=G,V=W.name("valid");for(let F in H){if((0,z.alwaysValidSchema)(q,H[F]))continue;W.if((0,U.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=I}),Ub0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:I})=>Y._`{propertyName: ${I.propertyName}}`},code(I){let{gen:Q,schema:J,data:K,it:G}=I;if((0,z.alwaysValidSchema)(G,J))return;let H=Q.name("valid");Q.forIn("key",K,(W)=>{I.setParams({propertyName:W}),I.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),Q.if((0,Y.not)(H),()=>{if(I.error(!0),!G.allErrors)Q.break()})}),I.ok(H)}};$.default=U}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=U5(),I=v1(),Q={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:J})=>z._`{additionalProperty: ${J.additionalProperty}}`},code(J){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=J;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,I.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);w(),J.ok(z._`${X} === ${U.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!M.length)N(T);else K.if(O(T),()=>N(T))})}function O(T){let A;if(F.length>8){let j=(0,I.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)A=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else A=z.nil;if(M.length)A=(0,z.or)(A,...M.map((j)=>z._`${(0,Y.usePattern)(J,j)}.test(${T})`));return(0,z.not)(A)}function D(T){K.code(z._`delete ${W}[${T}]`)}function N(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){D(T);return}if(G===!1){if(J.setParams({additionalProperty:T}),J.error(),!q)K.break();return}if(typeof G=="object"&&!(0,I.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")B(T,A,!1),K.if((0,z.not)(A),()=>{J.reset(),D(T)});else if(B(T,A),!q)K.if((0,z.not)(A),()=>K.break())}}function B(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:I.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});J.subschema(C,A)}}};$.default=Q}),Ib0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=SI(),z=I5(),U=v1(),I=at(),Q={keyword:"properties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=J;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)I.default.code(new Y.KeywordCxt(X,I.default,"additionalProperties"));let Z=(0,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,z.propertyInData)(K,W,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}J.it.definedProperties.add(w),J.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){J.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=Q}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=v1(),I=v1(),Q={keyword:"patternProperties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=J,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((B)=>(0,U.alwaysValidSchema)(X,G[B]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,I.evaluatedPropsToName)(K,X.props);let{props:w}=X;O();function O(){for(let B of q){if(F)D(B);if(X.allErrors) Line truncated
\x00`,k+=O4(j,2),k+=K.magic,k+=O4(M,2),k+=O4(w,2),k+=O4(A.crc32,4),k+=O4(A.compressedSize,4),k+=O4(A.uncompressedSize,4),k+=O4(H.length,2),k+=O4(O.length,2);var h=MO.LOCAL_FILE_HEADER+k+H+O,i=MO.CENTRAL_FILE_HEADER+O4(b,2)+k+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+H+O+Z;return{fileRecord:h,dirRecord:i}},Gr0=function($,Y,z,U,I){var Q="",J=VQ.transformTo("string",I(U));return Q=MO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(J.length,2)+J,Q},Hr0=function($){var Y="";return Y=MO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){LQ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}VQ.inherits(X5,LQ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,LQ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=_50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=_50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:Hr0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y<this.dirRecords.length;Y++)this.push({data:this.dirRecords[Y],meta:{percent:100}});var z=this.bytesWritten-$,U=Gr0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var Y=this;return $.on("data",function(z){Y.processChunk(z)}),$.on("end",function(){if(Y.closedSource(Y.previous.streamInfo),Y._sources.length)Y.prepareNextSource();else Y.end()}),$.on("error",function(z){Y.error(z)}),this};X5.prototype.resume=function(){if(!LQ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var Y=this._sources;if(!LQ.prototype.error.call(this,$))return!1;for(var z=0;z<Y.length;z++)try{Y[z].error($)}catch(U){}return!0};X5.prototype.lock=function(){LQ.prototype.lock.call(this);var $=this._sources;for(var Y=0;Y<$.length;Y++)$[Y].lock()};v50.exports=X5});var S50=E((qr0)=>{var Wr0=fy(),Xr0=h50(),Zr0=function($,Y){var z=$||Y,U=Wr0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};qr0.generateWorker=function($,Y,z){var U=new Xr0(Y.streamFiles,z,Y.platform,Y.encodeFileName),I=0;try{$.forEach(function(Q,J){I++;var K=Zr0(J.options.compression,Y.compression),G=J.options.compressionOptions||Y.compressionOptions||{},H=J.dir,W=J.date;J._compressWorker(K,G).withStreamInfo("file",{name:Q,dir:H,date:W,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(U)}),U.entriesCount=I}catch(Q){U.error(Q)}return U}});var y50=E((np1,g50)=>{var Lr0=c4(),OO=J$();function wW($,Y){OO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}Lr0.inherits(wW,OO);wW.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};wW.prototype.pause=function(){if(!OO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wW.prototype.resume=function(){if(!OO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};g50.exports=wW});var d50=E((pp1,p50)=>{var Fr0=IQ(),MW=c4(),u50=J$(),wr0=pg(),b50=dg(),k50=$O(),Mr0=x80(),Or0=S50(),x50=sH(),Nr0=y50(),i50=function($,Y,z){var U=MW.getTypeOf(Y),I,Q=MW.extend(z||{},b50);if(Q.date=Q.date||new Date,Q.compression!==null)Q.compression=Q.compression.toUpperCase();if(typeof Q.unixPermissions==="string")Q.unixPermissions=parseInt(Q.unixPermissions,8);if(Q.unixPermissions&&Q.unixPermissions&16384)Q.dir=!0;if(Q.dosPermissions&&Q.dosPermission Line truncated
`)}openNode($,Y){let z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),Dk(U,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)y30(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Dk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(g30.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("</"),Y.push($),Y.push(">");this.open=!1,this.leaf=!1}leafNode($,Y,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}Ak.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};k30.exports=Ak});var Pk=E((Xt0)=>{var x30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Wt0($){if(typeof $==="string")return $;if(x30)return x30.decode($);return $.toString()}Xt0.bufferToString=Wt0});var c30=E((u30)=>{Object.defineProperty(u30,"__esModule",{value:!0});u30.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;u30.S=` \r
`;u30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";u30.NAME_CHAR="-"+u30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";u30.CHAR_RE=new RegExp("^["+u30.CHAR+"]$","u");u30.S_RE=new RegExp("^["+u30.S+"]+$","u");u30.NAME_START_CHAR_RE=new RegExp("^["+u30.NAME_START_CHAR+"]$","u");u30.NAME_CHAR_RE=new RegExp("^["+u30.NAME_CHAR+"]$","u");u30.NAME_RE=new RegExp("^["+u30.NAME_START_CHAR+"]["+u30.NAME_CHAR+"]*$","u");u30.NMTOKEN_RE=new RegExp("^["+u30.NAME_CHAR+"]+$","u");var Bk=9,Tk=10,jk=13,Ek=32;u30.S_LIST=[Ek,Tk,jk,Bk];function qt0($){return $>=Ek&&$<=55295||$===Tk||$===jk||$===Bk||$>=57344&&$<=65533||$>=65536&&$<=1114111}u30.isChar=qt0;function Vt0($){return $===Ek||$===Tk||$===jk||$===Bk}u30.isS=Vt0;function f30($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}u30.isNameStartChar=f30;function Lt0($){return f30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}u30.isNameChar=Lt0});var t30=E((o30)=>{Object.defineProperty(o30,"__esModule",{value:!0});o30.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";o30.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";o30.S=` \r
`;o30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";o30.NAME_CHAR="-"+o30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";o30.CHAR_RE=new RegExp("^["+o30.CHAR+"]$","u");o30.RESTRICTED_CHAR_RE=new RegExp("^["+o30.RESTRICTED_CHAR+"]$","u");o30.S_RE=new RegExp("^["+o30.S+"]+$","u");o30.NAME_START_CHAR_RE=new RegExp("^["+o30.NAME_START_CHAR+"]$","u");o30.NAME_CHAR_RE=new RegExp("^["+o30.NAME_CHAR+"]$","u");o30.NAME_RE=new RegExp("^["+o30.NAME_START_CHAR+"]["+o30.NAME_CHAR+"]*$","u");o30.NMTOKEN_RE=new RegExp("^["+o30.NAME_CHAR+"]+$","u");var n30=9,p30=10,d30=13,m30=32;o30.S_LIST=[m30,p30,d30,n30];function Et0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}o30.isChar=Et0;function Ct0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}o30.isRestrictedChar=Ct0;function Rt0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}o30.isCharAndNotRestricted=Rt0;function _t0($){return $===m30||$===p30||$===d30||$===n30}o30.isS=_t0;function l30($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}o30.isNameStartChar=l30;function vt0($){return l30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}o30.isNameChar=vt0});var Y70=E(($70)=>{Object.defineProperty($70,"__esModule",{value:!0});$70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";$70.NC_NAME_CHAR="-"+$70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";$70.NC_NAME_START_CHAR_RE=new RegExp("^["+$70.NC_NAME_START_CHAR+"]$","u");$70.NC_NAME_CHAR_RE=new RegExp("^["+$70.NC_NAME_CHAR+"]$","u");$70.NC_NAME_RE=new RegExp("^["+$70.NC_NAME_START_CHAR+"]["+$70.NC_NAME_CHAR+"]*$","u");function e30($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}$70.isNCNameStartChar=e30;function mt0($){return e30($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}$70.isNCNameChar=mt0});var P70=E((A70)=>{Object.defineProperty(A70,"__esModule",{value:!0});var EQ=c30(),tt0=t30(),ik=Y70(),p8=EQ.isS,et0=EQ.isChar,vW=EQ.isNameStartChar,z70=EQ.isNameChar,F70=EQ.S_LIST,$e0=EQ.NAME_RE,Ye0=tt0.isChar,ze0=ik.isNCNameStartChar,Ue0=ik.isNCNameChar,Ie0=ik.NC_NAME_RE,oO="http://www.w3.org/XML/1998/namespace",jQ="http://www.w3.org/2000/xmlns/",Qe0={__proto__:null,xml:oO,xmlns:jQ},Je0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,Q9=-2,U70=0,Ke0=1,Rk=2,Ge0=3,PQ=4,He0=5,We0=6,Xe0=7,_k=8,Ze0=9,qe0=10,Ve0=11,Le0=12,C8=13,nO=14,vk=15,Fe0=16,hk=17,we0=18,Me0=19,Sk=20,Oe0=21,Ne0=22,De0=23,I70=24,gk=25,pO=26,Q70=27,Ae0=28,Pe0=29,J70=30,Be0=31,Te0=32,Gz=33,je0=34,yk=35,hW=36,kk=37,Ee0=38,K70=39,G70=40,Ce0=41,H70=42,Re0=43,_e0=44,xk=9,q5=10,fk=13,W70=32,X70=33,w70=34,SW=38,M70=39,dO=45,mO=47,ve0=59,r7=60,BQ=61,B6=62,o6=63,O70=91,TQ=93,Z70=133,q70=8232,lO=($)=>$===w70||$===M70,N70=[w70,M70],he0=[...N70,O70,B6],Se0=[...N70,r7,TQ],ge0=[BQ,o6,...F70],ye0=[...F70,B6,SW,r7];function bk($,Y,z){switch(Y){case"xml":if(z!==oO)$.fail(`xml prefix must be bound to ${oO}.`);break;case"xmlns":if(z!==jQ)$.fail(`xmlns prefix must be bound to ${jQ}.`);break;default:}switch(z){case jQ:$.fail(Y===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${jQ}.`);break;case oO:switch(Y){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function ke0($,Y){for(let z of Object.keys(Y))bk($,z,Y[z])}var xe0=($)=>Ie0.test($),fe0=($)=>$e0.test($),Hz=0,V70=1,uk=2;A70.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var L70={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class D70{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let Y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,Y){this.nameStartCheck=ze0,this.nameCheck=Ue0,this.isName=xe0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Qe0);let z=this.opt.additionalNamesp Line truncated
`,Y=this.i}}captureToChar($){let{i:Y}=this,{chunk:z}=this;while(!0){let U=this.getCode();switch(U){case Q9:this.text+=`${z.slice(Y,this.prevI)}
`,Y=this.i,U=q5;break;case k4:return this.text+=z.slice(Y),!1;default:}if(U===$)return this.text+=z.slice(Y,this.prevI),!0}}captureNameChars(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCode();if(z===k4)return this.name+=$.slice(Y),k4;if(!c30(z))return this.name+=$.slice(Y,this.prevI),z===Q9?q5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!p8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=_t0,this.getCode=this.getCode10;else this.isChar=ht0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=ft0}sBeginWhitespace(){let $=this.i,Y=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(Y){case r7:if(this.state=jk,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let Y=this.captureTo(We0);switch(Y){case A6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(Y),Y===Q70)this.state=DQ;else if(cO(Y))this.state=ut0,this.q=Y}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Ak}sDTD(){let $=this.captureTo(He0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===BQ)this.state=Ak;else if($===r7)this.state=it0;else if(cO($))this.state=bt0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=DQ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case a30:this.state=ct0,this.openWakaBang="";break;case o6:this.state=dt0;break;default:this.state=DQ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),Y=this.openWakaBang+=$;if(this.text+=$,Y!=="-")this.state=Y==="--"?Tk:DQ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(bO))this.text+="-",this.state=nt0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===bO?pt0:Tk}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===A6)this.state=DQ;else this.fail("malformed comment."),this.state=Tk}sDTDPI(){if(this.captureToChar(o6))this.text+="?",this.state=mt0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===A6)this.state=DQ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:Y}=this;$:while(!0)switch(this.getCode()){case Q9:this.entity+=`${Y.slice($,this.prevI)}
`,$=this.i;break;case Ge0:{let{entityReturnState:z}=this,U=this.entity+Y.slice($,this.prevI);this.state=z;let I;if(U==="")this.fail("empty entity name."),I="&;";else I=this.parseEntity(U),this.entity="";if(z!==C8||this.textHandler!==void 0)this.text+=I;break $}case k4:this.entity+=Y.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(CH($))this.state=Ue0,this.unget(),this.xmlDeclPossible=!1;else switch($){case iO:this.state=Je0,this.xmlDeclPossible=!1;break;case a30:this.state=lt0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case o6:this.state=tt0;break;default:this.fail("disallowed character in tag name"),this.state=C8,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=Ck,this.openWakaBang="";break;case"--":this.state=Ek,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Ak,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(bO))this.state=ot0}sCommentEnding(){var $;let Y=this.getCodeNorm();if(Y===bO)this.state=rt0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(Y)}`,this.state=Ek}sCommentEnded(){let $=this.getCodeNorm();if($!==A6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=Ek;else this.state=C8}sCData(){if(this.captureToChar(BQ))this.state=st0}sCDataEnding(){let $=this.getCodeNorm();if($===BQ)this.state=at0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Ck}sCDataEnding2(){var $;let Y=this.getCodeNorm();switch(Y){case A6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case BQ:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(Y)}`,this.state=Ck}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=p30;else if($===o6||p8($))this.fail("processing instruction without a target."),this.state=$===o6?uO:Rk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=p30}sPIRest(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCodeNorm();if(z===k4){this.piTarget+=$.slice(Y);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(Y,this.prevI);let U=z===o6;if(U||p8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?Jz:d30}else this.state=U?uO:Rk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===o6)this.state=uO;else if(!p8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(o6))this.state=uO}sPIEnding(){var $;let Y=this.getCodeNorm();if(Y===A6){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(Y===o6)this.text+="?";else this.text+=`?${String.fromCodePoint(Y)}`,this.state=Rk;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===o6){this.state=Jz;return}if($!==k4)this.state=et0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(Xe0);if($===o6){this.state=Jz,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p8($)||$===PQ))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===PQ?m30:$e0}sXMLDeclEq(){let $=this.getCodeNorm();if($===o6){this.state=Jz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if($!==PQ)this.fail("value required.");this.state=m30}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===o6){this.state=Jz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if(!cO($))this.fail("value must be quoted."),this.q=s30;else this.q=$;this.state=Ye0}sXMLDeclValue(){let $=this.captureTo([this.q,o6]);if($===o6){this.state=Jz,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let Y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=Y;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver Line truncated
`;$=this.i,Y=Kz;break;case k4:if(U!==void 0)this.text+=z.slice($);break $;default:Y=Kz}this.forbiddenState=Y}handleTextOutsideRoot(){let{i:$}=this,{chunk:Y,textHandler:z}=this,U=!1;$:while(!0){let I=this.getCode();switch(I){case r7:{if(this.state=jk,z!==void 0){let{text:Q}=this,J=Y.slice($,this.prevI);if(Q.length!==0)z(Q+J),this.text="";else if(J.length!==0)z(J)}break $}case _H:if(this.state=fO,this.entityReturnState=C8,z!==void 0)this.text+=Y.slice($,this.prevI);U=!0;break $;case Q9:if(z!==void 0)this.text+=`${Y.slice($,this.prevI)}
`;$=this.i;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:if(!p8(I))U=!0}}if(!U)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,Y){var z;let{prefix:U,local:I}=this.qname($),Q={name:$,prefix:U,local:I,value:Y};if(this.attribList.push(Q),(z=this.attributeHandler)===null||z===void 0||z.call(this,Q),U==="xmlns"){let J=Y.trim();if(this.currentXMLVersion==="1.0"&&J==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[I]=J,yk(this,I,J)}else if($==="xmlns"){let J=Y.trim();this.topNS[""]=J,yk(this,"",J)}}pushAttribPlain($,Y){var z;let U={name:$,value:Y};this.attribList.push(U),(z=this.attributeHandler)===null||z===void 0||z.call(this,U)}end(){var $,Y;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let I=z.pop();this.fail(`unclosed tag: ${I.name}`)}if(this.state!==n30&&this.state!==C8)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(Y=this.endHandler)===null||Y===void 0||Y.call(this),this._init(),this}resolve($){var Y,z;let U=this.topNS[$];if(U!==void 0)return U;let{tags:I}=this;for(let Q=I.length-1;Q>=0;Q--)if(U=I[Q].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(z=(Y=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(Y,$)}qname($){let Y=$.indexOf(":");if(Y===-1)return{prefix:"",local:$};let z=$.slice(Y+1),U=$.slice(0,Y);if(U===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:z}}processAttribsNS(){var $;let{attribList:Y}=this,z=this.tag;{let{prefix:Q,local:J}=this.qname(z.name);z.prefix=Q,z.local=J;let K=z.uri=($=this.resolve(Q))!==null&&$!==void 0?$:"";if(Q!==""){if(Q==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),z.uri=Q}}if(Y.length===0)return;let{attributes:U}=z,I=new Set;for(let Q of Y){let{name:J,prefix:K,local:G}=Q,W,H;if(K==="")W=J==="xmlns"?AQ:"",H=J;else{if(W=this.resolve(K),W===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),W=K;H=`{${W}}${G}`}if(I.has(H))this.fail(`duplicate attribute: ${H}.`);I.add(H),Q.uri=W,U[J]=Q}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,Y=this.tag.attributes;for(let{name:z,value:U}of $){if(Y[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);Y[z]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:Y}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),Y.push(z),this.state=C8,this.name=""}openSelfClosingTag(){var $,Y,z;this.processAttribs();let{tags:U}=this,I=this.tag;if(I.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,I),(Y=this.closeTagHandler)===null||Y===void 0||Y.call(this,I),(this.tag=(z=U[U.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:Y}=this;if(this.state=C8,this.name="",Y===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,U=$.length;while(U-- >0){let I=this.tag=$.pop();if(this.topNS=I.ns,z===null||z===void 0||z(I),I.name===Y)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${Y}.`),this.text+=`</${Y}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let Y=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))Y=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))Y=parseInt($.slice(1),10);if(!this.isChar(Y))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(Y)}}G70.SaxesParser=K70});var vH=E((sp1,H70)=>{var{SaxesParser:Me0}=W70(),{PassThrough:Oe0}=E8(),{bufferToString:Ne0}=Mk();H70.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new Oe0);let Y=new Me0,z;Y.on("error",(I)=>{z=I});let U=[];Y.on("opentag",(I)=>U.push({eventType:"opentag",value:I})),Y.on("text",(I)=>U.push({eventType:"text",value:I})),Y.on("closetag",(I)=>U.push({eventType:"closetag",value:I}));for await(let I of $){if(Y.write(Ne0(I)),z)throw z;yield U,U=[]}}});var g0=E((ap1,X70)=>{var De0=vH(),Pe0=l6();class jQ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,Y){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof jQ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let Y of $)for(let{eventType:z,value:U}of Y)if(z==="opentag")this.parseOpen(U);else if(z==="text")this.parseText(U);else if(z==="closetag"){if(!this.parseClose(U.name))return thLine truncated
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((Y=$.writeHeaders)!==null&&Y!==void 0?Y:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}iQ0.FormatterOptions=bQ0});var PN=E((Pl1,mQ0)=>{var h$1="[object AsyncFunction]",S$1="[object Function]",g$1="[object GeneratorFunction]",y$1="[object Null]",k$1="[object Proxy]",x$1="[object Undefined]",f$1=typeof global=="object"&&global&&global.Object===Object&&global,u$1=typeof self=="object"&&self&&self.Object===Object&&self,b$1=f$1||u$1||Function("return this")(),pQ0=Object.prototype,i$1=pQ0.hasOwnProperty,dQ0=pQ0.toString,nQ0=b$1.Symbol,Vz=nQ0?nQ0.toStringTag:void 0;function c$1($){if($==null)return $===void 0?x$1:y$1;return Vz&&Vz in Object($)?n$1($):p$1($)}function n$1($){var Y=i$1.call($,Vz),z=$[Vz];try{$[Vz]=void 0;var U=!0}catch(Q){}var I=dQ0.call($);if(U)if(Y)$[Vz]=z;else delete $[Vz];return I}function p$1($){return dQ0.call($)}function d$1($){if(!m$1($))return!1;var Y=c$1($);return Y==S$1||Y==g$1||Y==h$1||Y==k$1}function m$1($){var Y=typeof $;return $!=null&&(Y=="object"||Y=="function")}mQ0.exports=d$1});var EJ0=E((BN,kQ)=>{var l$1=200,Qf="__lodash_hash_undefined__",vN=1,IJ0=2,QJ0=9007199254740991,AN="[object Arguments]",tx="[object Array]",o$1="[object AsyncFunction]",JJ0="[object Boolean]",KJ0="[object Date]",GJ0="[object Error]",WJ0="[object Function]",r$1="[object GeneratorFunction]",TN="[object Map]",HJ0="[object Number]",s$1="[object Null]",yQ="[object Object]",lQ0="[object Promise]",a$1="[object Proxy]",XJ0="[object RegExp]",jN="[object Set]",ZJ0="[object String]",t$1="[object Symbol]",e$1="[object Undefined]",ex="[object WeakMap]",qJ0="[object ArrayBuffer]",EN="[object DataView]",$51="[object Float32Array]",Y51="[object Float64Array]",z51="[object Int8Array]",U51="[object Int16Array]",I51="[object Int32Array]",Q51="[object Uint8Array]",J51="[object Uint8ClampedArray]",K51="[object Uint16Array]",G51="[object Uint32Array]",W51=/[\\^$.*+?()[\]{}|]/g,H51=/^\[object .+?Constructor\]$/,X51=/^(?:0|[1-9]\d*)$/,A4={};A4[$51]=A4[Y51]=A4[z51]=A4[U51]=A4[I51]=A4[Q51]=A4[J51]=A4[K51]=A4[G51]=!0;A4[AN]=A4[tx]=A4[qJ0]=A4[JJ0]=A4[EN]=A4[KJ0]=A4[GJ0]=A4[WJ0]=A4[TN]=A4[HJ0]=A4[yQ]=A4[XJ0]=A4[jN]=A4[ZJ0]=A4[ex]=!1;var VJ0=typeof global=="object"&&global&&global.Object===Object&&global,Z51=typeof self=="object"&&self&&self.Object===Object&&self,Z3=VJ0||Z51||Function("return this")(),LJ0=typeof BN=="object"&&BN&&!BN.nodeType&&BN,oQ0=LJ0&&typeof kQ=="object"&&kQ&&!kQ.nodeType&&kQ,FJ0=oQ0&&oQ0.exports===LJ0,rx=FJ0&&VJ0.process,rQ0=function(){try{return rx&&rx.binding&&rx.binding("util")}catch($){}}(),sQ0=rQ0&&rQ0.isTypedArray;function q51($,Y){var z=-1,U=$==null?0:$.length,I=0,Q=[];while(++z<U){var J=$[z];if(Y(J,z,$))Q[I++]=J}return Q}function V51($,Y){var z=-1,U=Y.length,I=$.length;while(++z<U)$[I+z]=Y[z];return $}function L51($,Y){var z=-1,U=$==null?0:$.length;while(++z<U)if(Y($[z],z,$))return!0;return!1}function F51($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}function w51($){return function(Y){return $(Y)}}function M51($,Y){return $.has(Y)}function O51($,Y){return $==null?void 0:$[Y]}function N51($){var Y=-1,z=Array($.size);return $.forEach(function(U,I){z[++Y]=[I,U]}),z}function D51($,Y){return function(z){return $(Y(z))}}function P51($){var Y=-1,z=Array($.size);return $.forEach(function(U){z[++Y]=U}),z}var B51=Array.prototype,A51=Function.prototype,hN=Object.prototype,sx=Z3["__core-js_shared__"],wJ0=A51.toString,K9=hN.hasOwnProperty,aQ0=function(){var $=/[^.]+$/.exec(sx&&sx.keys&&sx.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),MJ0=hN.toString,T51=RegExp("^"+wJ0.call(K9).replace(W51,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tQ0=FJ0?Z3.Buffer:void 0,CN=Z3.Symbol,eQ0=Z3.Uint8Array,OJ0=hN.propertyIsEnumerable,j51=B51.splice,Lz=CN?CN.toStringTag:void 0,$J0=Object.getOwnPropertySymbols,E51=tQ0?tQ0.isBuffer:void 0,C51=D51(Object.keys,Object),$f=xQ(Z3,"DataView"),fH=xQ(Z3,"Map"),Yf=xQ(Z3,"Promise"),zf=xQ(Z3,"Set"),Uf=xQ(Z3,"WeakMap"),uH=xQ(Object,"create"),R51=Mz($f),_51=Mz(fH),v51=Mz(Yf),h51=Mz(zf),S51=Mz(Uf),YJ0=CN?CN.prototype:void 0,ax=YJ0?YJ0.valueOf:void 0;function Fz($){var Y=-1,z=$==null?0:$.length;this.clear();while(++Y<z){var U=$[Y];this.set(U[0],U[1])}}function g51(){this.__data__=uH?uH(null):{},this.size=0}function y51($){var Y=this.has($)&&delete this.__data__[$];return this.size-=Y?1:0,Y}function k51($){var Y=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(Y)}set headers($){this._headers=$}shouldQuote($,Y){let z=Y?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(c91.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,Y,z){let U=`${n91.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:I}=this;if(I.quote!==""){if(U.indexOf(I.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,I.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(Y,z))return this.quoteField(U);return U}quoteField($){let{quote:Y}=this.formatterOptions;return`${Y}${$}${Y}`}}fQ.FieldFormatter=kJ0});var Hf=E((xJ0)=>{Object.defineProperty(xJ0,"__esModule",{value:!0});xJ0.isSyncTransform=void 0;xJ0.isSyncTransform=($)=>$.length===1});var bJ0=E((uQ)=>{var uJ0=uQ&&uQ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(uQ,"__esModule",{value:!0});uQ.RowFormatter=void 0;var d91=uJ0(PN()),m91=uJ0(EJ0()),l91=Wf(),o91=Hf();class Oz{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new l91.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(Oz.isRowHashArray($))return $.map((Y)=>Y[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(o91.isSyncTransform($))return(Y,z)=>{let U=null;try{U=$(Y)}catch(I){return z(I)}return z(null,U)};return(Y,z)=>{$(Y,z)}}set rowTransform($){if(!d91.default($))throw TypeError("The transform should be a function");this._rowTransform=Oz.createTransform($)}format($,Y){this.callTransformer($,(z,U)=>{if(z)return Y(z);if(!$)return Y(null);let I=[];if(U){let{shouldFormatColumns:Q,headers:J}=this.checkHeaders(U);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)I.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Q){let K=this.gatherColumns(U);I.push(this.formatColumns(K,!1))}}return Y(null,I)})}finish($){let Y=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));Y.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)Y.push(this.formatterOptions.rowDelimiter);return $(null,Y)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let Y=Oz.gatherHeaders($);if(this.headers=Y,this.fieldFormatter.headers=Y,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!m91.default(Y,$),headers:Y}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((Y)=>$[Y]);if(Oz.isRowHashArray($))return this.headers.map((Y,z)=>{let U=$[z];if(U)return U[1];return""});if(Oz.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((Y,z)=>$[z])}callTransformer($,Y){if(!this._rowTransform)return Y(null,$);return this._rowTransform($,Y)}formatColumns($,Y){let z=$.map((I,Q)=>this.fieldFormatter.format(I,Q,Y)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,z].join("");return z}}uQ.RowFormatter=Oz});var iJ0=E((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});yN.FieldFormatter=yN.RowFormatter=void 0;var r91=bJ0();Object.defineProperty(yN,"RowFormatter",{enumerable:!0,get:function(){return r91.RowFormatter}});var s91=Wf();Object.defineProperty(yN,"FieldFormatter",{enumerable:!0,get:function(){return s91.FieldFormatter}})});var Xf=E((nJ0)=>{Object.defineProperty(nJ0,"__esModule",{value:!0});nJ0.CsvFormatterStream=void 0;var t91=J0("stream"),e91=iJ0();class cJ0 extends t91.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new e91.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,Y,z){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(I,Q)=>{if(I)return U=!0,z(I);if(Q)Q.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return U=!0,z()})}catch(I){if(U)throw I;z(I)}}_flush($){this.rowFormatter.finish((Y,z)=>{if(Y)return $(Y);if(z)z.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}nJ0.CsvFormatterStream=cJ0});var mJ0=E((s1)=>{var dJ0=s1&&s1.__createBinding||(Object.create?function($,Y,z,U){if(U===void 0)U=z;Object.defineProperty($,U,{enumerable:!0,get:function(){return Y[z]}})}:function($,Y,z,U){if(U===void 0)U=z;$[U]=Y[z]}),$31=s1&&s1.__setModuleDefault||(Object.create?function($,Y){O Line truncated
`,Y=this.i,U=q5;break;case k4:return this.text+=z.slice(Y),!1;default:}if(U===$)return this.text+=z.slice(Y,this.prevI),!0}}captureNameChars(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCode();if(z===k4)return this.name+=$.slice(Y),k4;if(!z70(z))return this.name+=$.slice(Y,this.prevI),z===Q9?q5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!p8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=et0,this.getCode=this.getCode10;else this.isChar=Ye0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Ke0}sBeginWhitespace(){let $=this.i,Y=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(Y){case r7:if(this.state=vk,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let Y=this.captureTo(he0);switch(Y){case B6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(Y),Y===O70)this.state=PQ;else if(lO(Y))this.state=Ge0,this.q=Y}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Rk}sDTD(){let $=this.captureTo(Se0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===TQ)this.state=Rk;else if($===r7)this.state=We0;else if(lO($))this.state=He0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=PQ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case X70:this.state=Xe0,this.openWakaBang="";break;case o6:this.state=Ve0;break;default:this.state=PQ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),Y=this.openWakaBang+=$;if(this.text+=$,Y!=="-")this.state=Y==="--"?_k:PQ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(dO))this.text+="-",this.state=Ze0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===dO?qe0:_k}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===B6)this.state=PQ;else this.fail("malformed comment."),this.state=_k}sDTDPI(){if(this.captureToChar(o6))this.text+="?",this.state=Le0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===B6)this.state=PQ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:Y}=this;$:while(!0)switch(this.getCode()){case Q9:this.entity+=`${Y.slice($,this.prevI)}
`,$=this.i;break;case ve0:{let{entityReturnState:z}=this,U=this.entity+Y.slice($,this.prevI);this.state=z;let I;if(U==="")this.fail("empty entity name."),I="&;";else I=this.parseEntity(U),this.entity="";if(z!==C8||this.textHandler!==void 0)this.text+=I;break $}case k4:this.entity+=Y.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(vW($))this.state=je0,this.unget(),this.xmlDeclPossible=!1;else switch($){case mO:this.state=Re0,this.xmlDeclPossible=!1;break;case X70:this.state=Fe0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case o6:this.state=De0;break;default:this.fail("disallowed character in tag name"),this.state=C8,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=Sk,this.openWakaBang="";break;case"--":this.state=hk,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Rk,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(dO))this.state=we0}sCommentEnding(){var $;let Y=this.getCodeNorm();if(Y===dO)this.state=Me0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(Y)}`,this.state=hk}sCommentEnded(){let $=this.getCodeNorm();if($!==B6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=hk;else this.state=C8}sCData(){if(this.captureToChar(TQ))this.state=Oe0}sCDataEnding(){let $=this.getCodeNorm();if($===TQ)this.state=Ne0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Sk}sCDataEnding2(){var $;let Y=this.getCodeNorm();switch(Y){case B6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case TQ:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(Y)}`,this.state=Sk}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=I70;else if($===o6||p8($))this.fail("processing instruction without a target."),this.state=$===o6?pO:gk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=I70}sPIRest(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCodeNorm();if(z===k4){this.piTarget+=$.slice(Y);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(Y,this.prevI);let U=z===o6;if(U||p8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?Gz:Q70}else this.state=U?pO:gk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===o6)this.state=pO;else if(!p8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(o6))this.state=pO}sPIEnding(){var $;let Y=this.getCodeNorm();if(Y===B6){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(Y===o6)this.text+="?";else this.text+=`?${String.fromCodePoint(Y)}`,this.state=gk;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===o6){this.state=Gz;return}if($!==k4)this.state=Ae0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(ge0);if($===o6){this.state=Gz,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p8($)||$===BQ))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===BQ?J70:Pe0}sXMLDeclEq(){let $=this.getCodeNorm();if($===o6){this.state=Gz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if($!==BQ)this.fail("value required.");this.state=J70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===o6){this.state=Gz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if(!lO($))this.fail("value must be quoted."),this.q=W70;else this.q=$;this.state=Be0}sXMLDeclValue(){let $=this.captureTo([this.q,o6]);if($===o6){this.state=Gz,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let Y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=Y;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver Line truncated
`;$=this.i,Y=Hz;break;case k4:if(U!==void 0)this.text+=z.slice($);break $;default:Y=Hz}this.forbiddenState=Y}handleTextOutsideRoot(){let{i:$}=this,{chunk:Y,textHandler:z}=this,U=!1;$:while(!0){let I=this.getCode();switch(I){case r7:{if(this.state=vk,z!==void 0){let{text:Q}=this,J=Y.slice($,this.prevI);if(Q.length!==0)z(Q+J),this.text="";else if(J.length!==0)z(J)}break $}case SW:if(this.state=nO,this.entityReturnState=C8,z!==void 0)this.text+=Y.slice($,this.prevI);U=!0;break $;case Q9:if(z!==void 0)this.text+=`${Y.slice($,this.prevI)}
`;$=this.i;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:if(!p8(I))U=!0}}if(!U)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,Y){var z;let{prefix:U,local:I}=this.qname($),Q={name:$,prefix:U,local:I,value:Y};if(this.attribList.push(Q),(z=this.attributeHandler)===null||z===void 0||z.call(this,Q),U==="xmlns"){let J=Y.trim();if(this.currentXMLVersion==="1.0"&&J==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[I]=J,bk(this,I,J)}else if($==="xmlns"){let J=Y.trim();this.topNS[""]=J,bk(this,"",J)}}pushAttribPlain($,Y){var z;let U={name:$,value:Y};this.attribList.push(U),(z=this.attributeHandler)===null||z===void 0||z.call(this,U)}end(){var $,Y;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let I=z.pop();this.fail(`unclosed tag: ${I.name}`)}if(this.state!==U70&&this.state!==C8)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(Y=this.endHandler)===null||Y===void 0||Y.call(this),this._init(),this}resolve($){var Y,z;let U=this.topNS[$];if(U!==void 0)return U;let{tags:I}=this;for(let Q=I.length-1;Q>=0;Q--)if(U=I[Q].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(z=(Y=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(Y,$)}qname($){let Y=$.indexOf(":");if(Y===-1)return{prefix:"",local:$};let z=$.slice(Y+1),U=$.slice(0,Y);if(U===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:z}}processAttribsNS(){var $;let{attribList:Y}=this,z=this.tag;{let{prefix:Q,local:J}=this.qname(z.name);z.prefix=Q,z.local=J;let K=z.uri=($=this.resolve(Q))!==null&&$!==void 0?$:"";if(Q!==""){if(Q==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),z.uri=Q}}if(Y.length===0)return;let{attributes:U}=z,I=new Set;for(let Q of Y){let{name:J,prefix:K,local:G}=Q,H,W;if(K==="")H=J==="xmlns"?jQ:"",W=J;else{if(H=this.resolve(K),H===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),H=K;W=`{${H}}${G}`}if(I.has(W))this.fail(`duplicate attribute: ${W}.`);I.add(W),Q.uri=H,U[J]=Q}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,Y=this.tag.attributes;for(let{name:z,value:U}of $){if(Y[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);Y[z]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:Y}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),Y.push(z),this.state=C8,this.name=""}openSelfClosingTag(){var $,Y,z;this.processAttribs();let{tags:U}=this,I=this.tag;if(I.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,I),(Y=this.closeTagHandler)===null||Y===void 0||Y.call(this,I),(this.tag=(z=U[U.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:Y}=this;if(this.state=C8,this.name="",Y===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,U=$.length;while(U-- >0){let I=this.tag=$.pop();if(this.topNS=I.ns,z===null||z===void 0||z(I),I.name===Y)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${Y}.`),this.text+=`</${Y}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let Y=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))Y=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))Y=parseInt($.slice(1),10);if(!this.isChar(Y))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(Y)}}A70.SaxesParser=D70});var gW=E((Ed1,B70)=>{var{SaxesParser:ie0}=P70(),{PassThrough:ce0}=E8(),{bufferToString:ne0}=Pk();B70.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new ce0);let Y=new ie0,z;Y.on("error",(I)=>{z=I});let U=[];Y.on("opentag",(I)=>U.push({eventType:"opentag",value:I})),Y.on("text",(I)=>U.push({eventType:"text",value:I})),Y.on("closetag",(I)=>U.push({eventType:"closetag",value:I}));for await(let I of $){if(Y.write(ne0(I)),z)throw z;yield U,U=[]}}});var g0=E((Cd1,T70)=>{var pe0=gW(),de0=l6();class CQ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,Y){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof CQ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let Y of $)for(let{eventType:z,value:U}of Y)if(z==="opentag")this.parseOpen(U);else if(z==="text")this.parseText(U);else if(z==="closetag"){if(!this.parseClose(U.name))return thLine truncated
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((Y=$.writeHeaders)!==null&&Y!==void 0?Y:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}YJ0.FormatterOptions=$J0});var EN=E((el1,JJ0)=>{var Y51="[object AsyncFunction]",z51="[object Function]",U51="[object GeneratorFunction]",I51="[object Null]",Q51="[object Proxy]",J51="[object Undefined]",K51=typeof global=="object"&&global&&global.Object===Object&&global,G51=typeof self=="object"&&self&&self.Object===Object&&self,H51=K51||G51||Function("return this")(),IJ0=Object.prototype,W51=IJ0.hasOwnProperty,QJ0=IJ0.toString,UJ0=H51.Symbol,Fz=UJ0?UJ0.toStringTag:void 0;function X51($){if($==null)return $===void 0?J51:I51;return Fz&&Fz in Object($)?Z51($):q51($)}function Z51($){var Y=W51.call($,Fz),z=$[Fz];try{$[Fz]=void 0;var U=!0}catch(Q){}var I=QJ0.call($);if(U)if(Y)$[Fz]=z;else delete $[Fz];return I}function q51($){return QJ0.call($)}function V51($){if(!L51($))return!1;var Y=X51($);return Y==z51||Y==U51||Y==Y51||Y==Q51}function L51($){var Y=typeof $;return $!=null&&(Y=="object"||Y=="function")}JJ0.exports=V51});var iJ0=E((CN,fQ)=>{var F51=200,Wf="__lodash_hash_undefined__",kN=1,MJ0=2,OJ0=9007199254740991,RN="[object Arguments]",Uf="[object Array]",w51="[object AsyncFunction]",NJ0="[object Boolean]",DJ0="[object Date]",AJ0="[object Error]",PJ0="[object Function]",M51="[object GeneratorFunction]",_N="[object Map]",BJ0="[object Number]",O51="[object Null]",xQ="[object Object]",KJ0="[object Promise]",N51="[object Proxy]",TJ0="[object RegExp]",vN="[object Set]",jJ0="[object String]",D51="[object Symbol]",A51="[object Undefined]",If="[object WeakMap]",EJ0="[object ArrayBuffer]",hN="[object DataView]",P51="[object Float32Array]",B51="[object Float64Array]",T51="[object Int8Array]",j51="[object Int16Array]",E51="[object Int32Array]",C51="[object Uint8Array]",R51="[object Uint8ClampedArray]",_51="[object Uint16Array]",v51="[object Uint32Array]",h51=/[\\^$.*+?()[\]{}|]/g,S51=/^\[object .+?Constructor\]$/,g51=/^(?:0|[1-9]\d*)$/,B4={};B4[P51]=B4[B51]=B4[T51]=B4[j51]=B4[E51]=B4[C51]=B4[R51]=B4[_51]=B4[v51]=!0;B4[RN]=B4[Uf]=B4[EJ0]=B4[NJ0]=B4[hN]=B4[DJ0]=B4[AJ0]=B4[PJ0]=B4[_N]=B4[BJ0]=B4[xQ]=B4[TJ0]=B4[vN]=B4[jJ0]=B4[If]=!1;var CJ0=typeof global=="object"&&global&&global.Object===Object&&global,y51=typeof self=="object"&&self&&self.Object===Object&&self,Z3=CJ0||y51||Function("return this")(),RJ0=typeof CN=="object"&&CN&&!CN.nodeType&&CN,GJ0=RJ0&&typeof fQ=="object"&&fQ&&!fQ.nodeType&&fQ,_J0=GJ0&&GJ0.exports===RJ0,$f=_J0&&CJ0.process,HJ0=function(){try{return $f&&$f.binding&&$f.binding("util")}catch($){}}(),WJ0=HJ0&&HJ0.isTypedArray;function k51($,Y){var z=-1,U=$==null?0:$.length,I=0,Q=[];while(++z<U){var J=$[z];if(Y(J,z,$))Q[I++]=J}return Q}function x51($,Y){var z=-1,U=Y.length,I=$.length;while(++z<U)$[I+z]=Y[z];return $}function f51($,Y){var z=-1,U=$==null?0:$.length;while(++z<U)if(Y($[z],z,$))return!0;return!1}function u51($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}function b51($){return function(Y){return $(Y)}}function i51($,Y){return $.has(Y)}function c51($,Y){return $==null?void 0:$[Y]}function n51($){var Y=-1,z=Array($.size);return $.forEach(function(U,I){z[++Y]=[I,U]}),z}function p51($,Y){return function(z){return $(Y(z))}}function d51($){var Y=-1,z=Array($.size);return $.forEach(function(U){z[++Y]=U}),z}var m51=Array.prototype,l51=Function.prototype,xN=Object.prototype,Yf=Z3["__core-js_shared__"],vJ0=l51.toString,K9=xN.hasOwnProperty,XJ0=function(){var $=/[^.]+$/.exec(Yf&&Yf.keys&&Yf.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),hJ0=xN.toString,o51=RegExp("^"+vJ0.call(K9).replace(h51,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ZJ0=_J0?Z3.Buffer:void 0,SN=Z3.Symbol,qJ0=Z3.Uint8Array,SJ0=xN.propertyIsEnumerable,r51=m51.splice,wz=SN?SN.toStringTag:void 0,VJ0=Object.getOwnPropertySymbols,s51=ZJ0?ZJ0.isBuffer:void 0,a51=p51(Object.keys,Object),Qf=uQ(Z3,"DataView"),iW=uQ(Z3,"Map"),Jf=uQ(Z3,"Promise"),Kf=uQ(Z3,"Set"),Gf=uQ(Z3,"WeakMap"),cW=uQ(Object,"create"),t51=Nz(Qf),e51=Nz(iW),$91=Nz(Jf),Y91=Nz(Kf),z91=Nz(Gf),LJ0=SN?SN.prototype:void 0,zf=LJ0?LJ0.valueOf:void 0;function Mz($){var Y=-1,z=$==null?0:$.length;this.clear();while(++Y<z){var U=$[Y];this.set(U[0],U[1])}}function U91(){this.__data__=cW?cW(null):{},this.size=0}function I91($){var Y=this.has($)&&delete this.__data__[$];return this.size-=Y?1:0,Y}function Q91($){var Y=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(Y)}set headers($){this._headers=$}shouldQuote($,Y){let z=Y?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(X31.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,Y,z){let U=`${Z31.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:I}=this;if(I.quote!==""){if(U.indexOf(I.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,I.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(Y,z))return this.quoteField(U);return U}quoteField($){let{quote:Y}=this.formatterOptions;return`${Y}${$}${Y}`}}bQ.FieldFormatter=sJ0});var Lf=E((aJ0)=>{Object.defineProperty(aJ0,"__esModule",{value:!0});aJ0.isSyncTransform=void 0;aJ0.isSyncTransform=($)=>$.length===1});var $K0=E((iQ)=>{var eJ0=iQ&&iQ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(iQ,"__esModule",{value:!0});iQ.RowFormatter=void 0;var V31=eJ0(EN()),L31=eJ0(iJ0()),F31=Vf(),w31=Lf();class Dz{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new F31.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(Dz.isRowHashArray($))return $.map((Y)=>Y[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(w31.isSyncTransform($))return(Y,z)=>{let U=null;try{U=$(Y)}catch(I){return z(I)}return z(null,U)};return(Y,z)=>{$(Y,z)}}set rowTransform($){if(!V31.default($))throw TypeError("The transform should be a function");this._rowTransform=Dz.createTransform($)}format($,Y){this.callTransformer($,(z,U)=>{if(z)return Y(z);if(!$)return Y(null);let I=[];if(U){let{shouldFormatColumns:Q,headers:J}=this.checkHeaders(U);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)I.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Q){let K=this.gatherColumns(U);I.push(this.formatColumns(K,!1))}}return Y(null,I)})}finish($){let Y=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));Y.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)Y.push(this.formatterOptions.rowDelimiter);return $(null,Y)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let Y=Dz.gatherHeaders($);if(this.headers=Y,this.fieldFormatter.headers=Y,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!L31.default(Y,$),headers:Y}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((Y)=>$[Y]);if(Dz.isRowHashArray($))return this.headers.map((Y,z)=>{let U=$[z];if(U)return U[1];return""});if(Dz.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((Y,z)=>$[z])}callTransformer($,Y){if(!this._rowTransform)return Y(null,$);return this._rowTransform($,Y)}formatColumns($,Y){let z=$.map((I,Q)=>this.fieldFormatter.format(I,Q,Y)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,z].join("");return z}}iQ.RowFormatter=Dz});var YK0=E((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});bN.FieldFormatter=bN.RowFormatter=void 0;var M31=$K0();Object.defineProperty(bN,"RowFormatter",{enumerable:!0,get:function(){return M31.RowFormatter}});var O31=Vf();Object.defineProperty(bN,"FieldFormatter",{enumerable:!0,get:function(){return O31.FieldFormatter}})});var Ff=E((UK0)=>{Object.defineProperty(UK0,"__esModule",{value:!0});UK0.CsvFormatterStream=void 0;var D31=J0("stream"),A31=YK0();class zK0 extends D31.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new A31.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,Y,z){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(I,Q)=>{if(I)return U=!0,z(I);if(Q)Q.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return U=!0,z()})}catch(I){if(U)throw I;z(I)}}_flush($){this.rowFormatter.finish((Y,z)=>{if(Y)return $(Y);if(z)z.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}UK0.CsvFormatterStream=zK0});var JK0=E((s1)=>{var QK0=s1&&s1.__createBinding||(Object.create?function($,Y,z,U){if(U===void 0)U=z;Object.defineProperty($,U,{enumerable:!0,get:function(){return Y[z]}})}:function($,Y,z,U){if(U===void 0)U=z;$[U]=Y[z]}),P31=s1&&s1.__setModuleDefault||(Object.create?function($,Y){O Line truncated
`||Y===`\r
`}static isTokenCarriageReturn($,Y){return $.token===Y.carriageReturn}static isTokenComment($,Y){return Y.supportsComments&&!!$&&$.token===Y.comment}static isTokenEscapeCharacter($,Y){return $.token===Y.escapeChar}static isTokenQuote($,Y){return $.token===Y.quote}static isTokenDelimiter($,Y){return $.token===Y.delimiter}}lK0.Token=mK0});var yf=E((aK0)=>{Object.defineProperty(aK0,"__esModule",{value:!0});aK0.Scanner=void 0;var rK0=J2(),GY1=/((?:\r\n)|\n|\r)/;class sK0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,Y=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(Y)===-1)return null;let z=Y.exec($);if(z==null)return null;let U=z[1],I=this.cursor+(z.index||0);return new rK0.Token({token:U,startCursor:I,endCursor:I+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:Y}=this;if(Y<=$)return null;return new rK0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=GY1.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}aK0.Scanner=sK0});var ID=E(($G0)=>{Object.defineProperty($G0,"__esModule",{value:!0});$G0.ColumnFormatter=void 0;class eK0{constructor($){if($.trim)this.format=(Y)=>Y.trim();else if($.ltrim)this.format=(Y)=>Y.trimLeft();else if($.rtrim)this.format=(Y)=>Y.trimRight();else this.format=(Y)=>Y}}$G0.ColumnFormatter=eK0});var kf=E((IG0)=>{Object.defineProperty(IG0,"__esModule",{value:!0});IG0.NonQuotedColumnParser=void 0;var WY1=ID(),zG0=J2();class UG0{constructor($){this.parserOptions=$,this.columnFormatter=new WY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:Y}=this,z=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(zG0.Token.isTokenDelimiter(U,Y)||zG0.Token.isTokenRowDelimiter(U))break;z.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(z.join(""))}}IG0.NonQuotedColumnParser=UG0});var xf=E((KG0)=>{Object.defineProperty(KG0,"__esModule",{value:!0});KG0.QuotedColumnParser=void 0;var HY1=ID(),sQ=J2();class JG0{constructor($){this.parserOptions=$,this.columnFormatter=new HY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let Y=$.cursor,{foundClosingQuote:z,col:U}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(Y),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:Y}=this,z=!1,U=!1,I=[],Q=$.nextCharacterToken;for(;!U&&Q!==null;Q=$.nextCharacterToken){let J=sQ.Token.isTokenQuote(Q,Y);if(!z&&J)z=!0;else if(z)if(sQ.Token.isTokenEscapeCharacter(Q,Y)){$.advancePastToken(Q);let K=$.nextCharacterToken;if(K!==null&&(sQ.Token.isTokenQuote(K,Y)||sQ.Token.isTokenEscapeCharacter(K,Y)))I.push(K.token),Q=K;else if(J)U=!0;else I.push(Q.token)}else if(J)U=!0;else I.push(Q.token);$.advancePastToken(Q)}return{col:this.columnFormatter.format(I.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:Y}=this,{nextNonSpaceToken:z}=$;if(z){let U=sQ.Token.isTokenDelimiter(z,Y),I=sQ.Token.isTokenRowDelimiter(z);if(!(U||I)){let Q=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${Y.escapedDelimiter}' OR new line got: '${z.token}'. at '${Q}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}KG0.QuotedColumnParser=JG0});var ZG0=E((HG0)=>{Object.defineProperty(HG0,"__esModule",{value:!0});HG0.ColumnParser=void 0;var XY1=kf(),ZY1=xf(),qY1=J2();class WG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new ZY1.QuotedColumnParser($),this.nonQuotedColumnParser=new XY1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:Y}=$;if(Y!==null&&qY1.Token.isTokenQuote(Y,this.parserOptions))return $.advanceToToken(Y),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}HG0.ColumnParser=WG0});var ff=E((aQ)=>{Object.defineProperty(aQ,"__esModule",{value:!0});aQ.ColumnFormatter=aQ.QuotedColumnParser=aQ.NonQuotedColumnParser=aQ.ColumnParser=void 0;var VY1=ZG0();Object.defineProperty(aQ,"ColumnParser",{enumerable:!0,get:function(){return VY1.ColumnParser}});var LY1=kf();Object.defineProperty(aQ,"NonQuotedColumnParser",{enumerable:!0,get:function(){return LY1.NonQuotedColumnParser}});var FY1=xf();Object.defineProperty(aQ,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,T,T,q,U);let P=q.type==="*"?$u:q.type==="?"?Uu:"\\"+q.type;I=!0,U=U.slice(0,q.reStart)+P+"\\("+T}if(D(),Q)U+="\\\\";let N=Kz1[U.charAt(0)];for(let T=K.length-1;T>-1;T--){let P=K[T],j=U.slice(0,P.reStart),C=U.slice(P.reStart,P.reEnd-8),b=U.slice(P.reEnd),k=U.slice(P.reEnd-8,P.reEnd)+b,h=j.split(")").length,i=j.split("(").length-h,c=b;for(let x=0;x<i;x++)c=c.replace(/\)[+*?]?/,"");b=c;let U0=b===""&&Y!==Yu?"(?:$|\\/)":"";U=j+C+b+U0+k}if(U!==""&&I)U="(?=.)"+U;if(N)U=w()+U;if(Y===Yu)return[U,I];if(z.nocase&&!I)I=$.toUpperCase()!==$.toLowerCase();if(!I)return Wz1($);let A=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",A),{_glob:$,_src:U})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,z=Y.noglobstar?$u:Y.dot?Qz1:Jz1,U=Y.nocase?"i":"",I=$.map((Q)=>{return Q=Q.map((J)=>typeof J==="string"?Xz1(J):J===R8?R8:J._src).reduce((J,K)=>{if(!(J[J.length-1]===R8&&K===R8))J.push(K);return J},[]),Q.forEach((J,K)=>{if(J!==R8||Q[K-1]===R8)return;if(K===0)if(Q.length>1)Q[K+1]="(?:\\/|"+z+"\\/)?"+Q[K+1];else Q[K]=z;else if(K===Q.length-1)Q[K-1]+="(?:\\/|"+z+")?";else Q[K-1]+="(?:\\/|\\/"+z+"\\/)"+Q[K+1],Q[K+1]=R8}),Q.filter((J)=>J!==R8).join("/")}).join("|");if(I="^(?:"+I+")$",this.negate)I="^(?!"+I+").*$";try{this.regexp=new RegExp(I,U)}catch(Q){this.regexp=!1}return this.regexp}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let z=this.options;if(zu.sep!=="/")$=$.split(zu.sep).join("/");$=$.split(QW0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let I;for(let Q=$.length-1;Q>=0;Q--)if(I=$[Q],I)break;for(let Q=0;Q<U.length;Q++){let J=U[Q],K=$;if(z.matchBase&&J.length===1)K=[I];if(this.matchOne(K,J,Y)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return W$.defaults($).Minimatch}}W$.Minimatch=lH});var qW0=E((vo1,ZW0)=>{ZW0.exports=XW0;var Ju=J0("fs"),{EventEmitter:qz1}=J0("events"),{Minimatch:Qu}=GW0(),{resolve:Vz1}=J0("path");function Lz1($,Y){return new Promise((z,U)=>{Ju.readdir($,{withFileTypes:!0},(I,Q)=>{if(I)switch(I.code){case"ENOTDIR":if(Y)U(I);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:U(I);break}else z(Q)})})}function WW0($,Y){return new Promise((z,U)=>{(Y?Ju.stat:Ju.lstat)($,(Q,J)=>{if(Q)switch(Q.code){case"ENOENT":if(Y)z(WW0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*HW0($,Y,z,U,I,Q){let J=await Lz1(Y+$,Q);for(let K of J){let G=K.name;if(G===void 0)G=K,U=!0;let W=$+"/"+G,H=W.slice(1),X=Y+"/"+H,Z=null;if(U||z)Z=await WW0(X,z);if(!Z&&K.name!==void 0)Z=K;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!I(H))yield{relative:H,absolute:X,stats:Z},yield*HW0(W,Y,z,U,I,!1)}else yield{relative:H,absolute:X,stats:Z}}}async function*Fz1($,Y,z,U){yield*HW0("",$,Y,z,U,!0)}function wz1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class Ku extends qz1{constructor($,Y,z){super();if(typeof Y==="function")z=Y,Y=null;if(this.options=wz1(Y||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((I)=>new Qu(I,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((I)=>new Qu(I,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((I)=>new Qu(I,{dot:!0}))}if(this.iterator=Fz1(Vz1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>z(U)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((Y)=>Y.match($))}_fileMatches($,Y){let z=$+(Y?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(z)))&&!this.ignoreMatchers.some((U)=>U.match(z))&&(!this.options.nodir||!Y)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let Y=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,Y)){let z=$.value.relative,U=$.value.absolute;if(this.options.mark&&Y)z+="/",U+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:U,stat:$.value.stats});else this.emit("match",{relative:z Line truncated
`,m);m=w0===-1?f.length:w0}else if(K0!==-1&&f[m]==="/"&&f[m+1]==="*"){let w0=f.indexOf("*/",m);if(w0!==-1)m=w0+2,K0=f.indexOf("*/",m);else n+=f[m],m++}else n+=f[m],m++;return n}function i0(f){let n=u0(f.toString()),m=n.match(a);if(!m)m=n.match(H0);if(!m)throw Error(`could not parse args in autoInject
`}static isTokenCarriageReturn($,Y){return $.token===Y.carriageReturn}static isTokenComment($,Y){return Y.supportsComments&&!!$&&$.token===Y.comment}static isTokenEscapeCharacter($,Y){return $.token===Y.escapeChar}static isTokenQuote($,Y){return $.token===Y.quote}static isTokenDelimiter($,Y){return $.token===Y.delimiter}}KG0.Token=JG0});var bf=E((XG0)=>{Object.defineProperty(XG0,"__esModule",{value:!0});XG0.Scanner=void 0;var HG0=J2(),vY1=/((?:\r\n)|\n|\r)/;class WG0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,Y=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(Y)===-1)return null;let z=Y.exec($);if(z==null)return null;let U=z[1],I=this.cursor+(z.index||0);return new HG0.Token({token:U,startCursor:I,endCursor:I+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:Y}=this;if(Y<=$)return null;return new HG0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=vY1.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}XG0.Scanner=WG0});var HD=E((VG0)=>{Object.defineProperty(VG0,"__esModule",{value:!0});VG0.ColumnFormatter=void 0;class qG0{constructor($){if($.trim)this.format=(Y)=>Y.trim();else if($.ltrim)this.format=(Y)=>Y.trimLeft();else if($.rtrim)this.format=(Y)=>Y.trimRight();else this.format=(Y)=>Y}}VG0.ColumnFormatter=qG0});var cf=E((MG0)=>{Object.defineProperty(MG0,"__esModule",{value:!0});MG0.NonQuotedColumnParser=void 0;var hY1=HD(),FG0=J2();class wG0{constructor($){this.parserOptions=$,this.columnFormatter=new hY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:Y}=this,z=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(FG0.Token.isTokenDelimiter(U,Y)||FG0.Token.isTokenRowDelimiter(U))break;z.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(z.join(""))}}MG0.NonQuotedColumnParser=wG0});var nf=E((DG0)=>{Object.defineProperty(DG0,"__esModule",{value:!0});DG0.QuotedColumnParser=void 0;var SY1=HD(),tQ=J2();class NG0{constructor($){this.parserOptions=$,this.columnFormatter=new SY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let Y=$.cursor,{foundClosingQuote:z,col:U}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(Y),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:Y}=this,z=!1,U=!1,I=[],Q=$.nextCharacterToken;for(;!U&&Q!==null;Q=$.nextCharacterToken){let J=tQ.Token.isTokenQuote(Q,Y);if(!z&&J)z=!0;else if(z)if(tQ.Token.isTokenEscapeCharacter(Q,Y)){$.advancePastToken(Q);let K=$.nextCharacterToken;if(K!==null&&(tQ.Token.isTokenQuote(K,Y)||tQ.Token.isTokenEscapeCharacter(K,Y)))I.push(K.token),Q=K;else if(J)U=!0;else I.push(Q.token)}else if(J)U=!0;else I.push(Q.token);$.advancePastToken(Q)}return{col:this.columnFormatter.format(I.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:Y}=this,{nextNonSpaceToken:z}=$;if(z){let U=tQ.Token.isTokenDelimiter(z,Y),I=tQ.Token.isTokenRowDelimiter(z);if(!(U||I)){let Q=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${Y.escapedDelimiter}' OR new line got: '${z.token}'. at '${Q}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}DG0.QuotedColumnParser=NG0});var jG0=E((BG0)=>{Object.defineProperty(BG0,"__esModule",{value:!0});BG0.ColumnParser=void 0;var gY1=cf(),yY1=nf(),kY1=J2();class PG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new yY1.QuotedColumnParser($),this.nonQuotedColumnParser=new gY1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:Y}=$;if(Y!==null&&kY1.Token.isTokenQuote(Y,this.parserOptions))return $.advanceToToken(Y),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}BG0.ColumnParser=PG0});var pf=E((eQ)=>{Object.defineProperty(eQ,"__esModule",{value:!0});eQ.ColumnFormatter=eQ.QuotedColumnParser=eQ.NonQuotedColumnParser=eQ.ColumnParser=void 0;var xY1=jG0();Object.defineProperty(eQ,"ColumnParser",{enumerable:!0,get:function(){return xY1.ColumnParser}});var fY1=cf();Object.defineProperty(eQ,"NonQuotedColumnParser",{enumerable:!0,get:function(){return fY1.NonQuotedColumnParser}});var uY1=nf();Object.defineProperty(eQ,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,T,T,q,U);let A=q.type==="*"?Qu:q.type==="?"?Gu:"\\"+q.type;I=!0,U=U.slice(0,q.reStart)+A+"\\("+T}if(D(),Q)U+="\\\\";let N=_z1[U.charAt(0)];for(let T=K.length-1;T>-1;T--){let A=K[T],j=U.slice(0,A.reStart),C=U.slice(A.reStart,A.reEnd-8),b=U.slice(A.reEnd),k=U.slice(A.reEnd-8,A.reEnd)+b,h=j.split(")").length,i=j.split("(").length-h,c=b;for(let x=0;x<i;x++)c=c.replace(/\)[+*?]?/,"");b=c;let U0=b===""&&Y!==Ju?"(?:$|\\/)":"";U=j+C+b+U0+k}if(U!==""&&I)U="(?=.)"+U;if(N)U=w()+U;if(Y===Ju)return[U,I];if(z.nocase&&!I)I=$.toUpperCase()!==$.toLowerCase();if(!I)return hz1($);let B=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",B),{_glob:$,_src:U})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,z=Y.noglobstar?Qu:Y.dot?Cz1:Rz1,U=Y.nocase?"i":"",I=$.map((Q)=>{return Q=Q.map((J)=>typeof J==="string"?gz1(J):J===R8?R8:J._src).reduce((J,K)=>{if(!(J[J.length-1]===R8&&K===R8))J.push(K);return J},[]),Q.forEach((J,K)=>{if(J!==R8||Q[K-1]===R8)return;if(K===0)if(Q.length>1)Q[K+1]="(?:\\/|"+z+"\\/)?"+Q[K+1];else Q[K]=z;else if(K===Q.length-1)Q[K-1]+="(?:\\/|"+z+")?";else Q[K-1]+="(?:\\/|\\/"+z+"\\/)"+Q[K+1],Q[K+1]=R8}),Q.filter((J)=>J!==R8).join("/")}).join("|");if(I="^(?:"+I+")$",this.negate)I="^(?!"+I+").*$";try{this.regexp=new RegExp(I,U)}catch(Q){this.regexp=!1}return this.regexp}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let z=this.options;if(Ku.sep!=="/")$=$.split(Ku.sep).join("/");$=$.split(OH0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let I;for(let Q=$.length-1;Q>=0;Q--)if(I=$[Q],I)break;for(let Q=0;Q<U.length;Q++){let J=U[Q],K=$;if(z.matchBase&&J.length===1)K=[I];if(this.matchOne(K,J,Y)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return H$.defaults($).Minimatch}}H$.Minimatch=sW});var EH0=E((Gr1,jH0)=>{jH0.exports=TH0;var Xu=J0("fs"),{EventEmitter:kz1}=J0("events"),{Minimatch:Wu}=AH0(),{resolve:xz1}=J0("path");function fz1($,Y){return new Promise((z,U)=>{Xu.readdir($,{withFileTypes:!0},(I,Q)=>{if(I)switch(I.code){case"ENOTDIR":if(Y)U(I);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:U(I);break}else z(Q)})})}function PH0($,Y){return new Promise((z,U)=>{(Y?Xu.stat:Xu.lstat)($,(Q,J)=>{if(Q)switch(Q.code){case"ENOENT":if(Y)z(PH0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*BH0($,Y,z,U,I,Q){let J=await fz1(Y+$,Q);for(let K of J){let G=K.name;if(G===void 0)G=K,U=!0;let H=$+"/"+G,W=H.slice(1),X=Y+"/"+W,Z=null;if(U||z)Z=await PH0(X,z);if(!Z&&K.name!==void 0)Z=K;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!I(W))yield{relative:W,absolute:X,stats:Z},yield*BH0(H,Y,z,U,I,!1)}else yield{relative:W,absolute:X,stats:Z}}}async function*uz1($,Y,z,U){yield*BH0("",$,Y,z,U,!0)}function bz1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class Zu extends kz1{constructor($,Y,z){super();if(typeof Y==="function")z=Y,Y=null;if(this.options=bz1(Y||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((I)=>new Wu(I,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((I)=>new Wu(I,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((I)=>new Wu(I,{dot:!0}))}if(this.iterator=uz1(xz1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>z(U)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((Y)=>Y.match($))}_fileMatches($,Y){let z=$+(Y?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(z)))&&!this.ignoreMatchers.some((U)=>U.match(z))&&(!this.options.nodir||!Y)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let Y=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,Y)){let z=$.value.relative,U=$.value.absolute;if(this.options.mark&&Y)z+="/",U+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:U,stat:$.value.stats});else this.emit("match",{relative:z Line truncated
`,m);m=w0===-1?f.length:w0}else if(K0!==-1&&f[m]==="/"&&f[m+1]==="*"){let w0=f.indexOf("*/",m);if(w0!==-1)m=w0+2,K0=f.indexOf("*/",m);else n+=f[m],m++}else n+=f[m],m++;return n}function i0(f){let n=u0(f.toString()),m=n.match(a);if(!m)m=n.match(W0);if(!m)throw Error(`could not parse args in autoInject
Source:
`+n);let[,K0]=m;return K0.replace(/\s/g,"").split(F0).map((w0)=>w0.replace(f0,"").trim())}function D1(f,n){var m={};return Object.keys(f).forEach((K0)=>{var w0=f[K0],D0,A0=q(w0),j0=!A0&&w0.length===1||A0&&w0.length===0;if(Array.isArray(w0))D0=[...w0],w0=D0.pop(),m[K0]=D0.concat(D0.length>0?h0:w0);else if(j0)m[K0]=w0;else{if(D0=i0(w0),w0.length===0&&!A0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!A0)D0.pop();m[K0]=D0.concat(h0)}function h0(z1,x1){var m1=D0.map((i1)=>z1[i1]);m1.push(x1),M(w0)(...m1)}}),Y1(m,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:m}=n;if(f(n))this.removeLink(n);n=m}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,m){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var K0=M(f),w0=0,D0=[];let A0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){A0[G1].push(e0)}function h0(G1,e0){let W1=(...c1)=>{z1(G1,W1),e0(...c1)};A0[G1].push(W1)}function z1(G1,e0){if(!G1)return Object.keys(A0).forEach((W1)=>A0[W1]=[]);if(!e0)return A0[G1]=[];A0[G1]=A0[G1].filter((W1)=>W1!==e0)}function x1(G1,...e0){A0[G1].forEach((W1)=>W1(...e0))}var m1=!1;function i1(G1,e0,W1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function O$(OY,...cK){if(OY)return W1?v6(OY):g4();if(cK.length<=1)return g4(cK[0]);g4(cK)}var kU=l1._createTaskItem(G1,W1?O$:c1||O$);if(e0)l1._tasks.unshift(kU);else l1._tasks.push(kU);if(!m1)m1=!0,W(()=>{m1=!1,l1.process()});if(W1||!c1)return new Promise((OY,cK)=>{g4=OY,v6=cK})}function M$(G1){return function(e0,...W1){w0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],O$=D0.indexOf(v6);if(O$===0)D0.shift();else if(O$>0)D0.splice(O$,1);if(v6.callback(e0,...W1),e0!=null)x1("error",e0,v6.data)}if(w0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function yU(G1){if(G1.length===0&&l1.idle())return W(()=>x1("drain")),!0;return!1}let MY=(G1)=>(e0)=>{if(!e0)return new Promise((W1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);W1(v6)})});z1(G1),j0(G1,e0)};var iK=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:m,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(yU(G1))return;return G1.map((W1)=>i1(W1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(yU(G1))return;return G1.map((W1)=>i1(W1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){z1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(yU(G1))return;return G1.map((W1)=>i1(W1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(yU(G1))return;return G1.map((W1)=>i1(W1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(iK)return;iK=!0;while(!l1.paused&&w0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],W1=l1._tasks.length;if(l1.payload)W1=Math.min(W1,l1.payload);for(var c1=0;c1<W1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(w0+=1,l1._tasks.length===0)x1("empty");if(w0===l1.concurrency)x1("saturated");var v6=h(M$(G1));K0(e0,v6)}iK=!1},length(){return l1._tasks.length},running(){return w0},workersList(){return D0},idle(){return l1._tasks.length+w0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,W(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:MY("saturated")},unsaturated:{writable:!1,value:MY("unsaturated")},empty:{writable:!1,value:MY("empty")},drain:{writable:!1,value:MY("drain")},error:{writable:!1,value:MY("error")}}),l1}function P0(f,n){return b1(f,1,n)}function I0(f,n,m){return b1(f,n,m)}function B(f,n,m,K0){K0=T(K0);var w0=M(m);return Y0(f,(D0,A0,j0)=>{w0(n,D0,(h0,z1)=>{n=z1,j0(h0)})},(D0)=>K0(D0,n))}var v=w(B,4);function u(...f){var n=f.map(M);return function(...m){var K0=this,w0=m[m.length-1];if(typeof w0=="function")m.pop();else w0=b0();return v(n,m,(D0,A0,j0)=>{A0.apply(K0,D0.concat((h0,...z1)=>{j0(h0,z1)}))},(D0,A0)=>w0(D0,...A0)),w0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,m,K0){return D(c(n),f,m,K0)}var Q Line truncated
GFS4: `),console.error($)};if(!p4[s6]){if(Wu=global[s6]||[],BW0(p4,Wu),p4.close=function($){function Y(z,U){return $.call(p4,z,function(I){if(!I)PW0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(Y,VD,{value:$}),Y}(p4.close),p4.closeSync=function($){function Y(z){$.apply(p4,arguments),PW0()}return Object.defineProperty(Y,VD,{value:$}),Y}(p4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Bz(p4[s6]),J0("assert").equal(p4[s6].length,0)})}var Wu;if(!global[s6])BW0(global,p4[s6]);Zu.exports=Hu(jz1(p4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!p4.__patched)Zu.exports=Hu(p4),p4.__patched=!0;function Hu($){Az1($),$.gracefulify=Hu,$.createReadStream=A,$.createWriteStream=T;var Y=$.readFile;$.readFile=z;function z(C,b,k){if(typeof b==="function")k=b,b=null;return h(C,b,k);function h(i,c,U0,x){return Y(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))$J([h,[i,c,U0],d,x||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=I;function I(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return U(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))$J([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var Q=$.appendFile;if(Q)$.appendFile=J;function J(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return Q(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))$J([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=G;function G(C,b,k,h){if(typeof k==="function")h=k,k=0;return i(C,b,k,h);function i(c,U0,x,d,t){return K(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))$J([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var W=$.readdir;$.readdir=X;var H=/^v[0-5]\./;function X(C,b,k){if(typeof b==="function")k=b,b=null;var h=H.test(process.version)?function(U0,x,d,t){return W(U0,i(U0,x,d,t))}:function(U0,x,d,t){return W(U0,x,i(U0,x,d,t))};return h(C,b,k);function i(c,U0,x,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))$J([h,[c,U0,x],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof x==="function")x.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=Tz1($);w=Z.ReadStream,D=Z.WriteStream}var q=$.ReadStream;if(q)w.prototype=Object.create(q.prototype),w.prototype.open=O;var V=$.WriteStream;if(V)D.prototype=Object.create(V.prototype),D.prototype.open=N;Object.defineProperty($,"ReadStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return D},set:function(C){D=C},enumerable:!0,configurable:!0});var F=w;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var M=D;Object.defineProperty($,"FileWriteStream",{get:function(){return M},set:function(C){M=C},enumerable:!0,configurable:!0});function w(C,b){if(this instanceof w)return q.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function O(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=k,C.emit("open",k),C.read()})}function D(C,b){if(this instanceof D)return V.apply(this,arguments),this;else return D.apply(Object.create(D.prototype),arguments)}function N(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b)C.destroy(),C.emit("error",b);else C.fd=k,C.emit("open",k)})}function A(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var P=$.open;$.open=j;function j(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return P(c,U0,x,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))$J([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function $J($){Bz("ENQUEUE",$[0].name,$[1]),p4[s6].push($),Xu()}var qD;function PW0(){var $=Date.now();for(var Y=0;Y<p4[s6].length;++Y)if(p4[s6][Y].length>2)p4[s6][Y][3]=$,p4[s6][Y][4]=$;Xu()}function Xu(){if(clearTimeout(qD),qD=void 0,p4[s6].length===0)return;var $=p4[s6].shift(),Y=$[0],z=$[1],U=$[2],I=$[3],Q=$[4];if(I===void 0)Bz("RETRY",Y.name,z),Y.apply(null,z);else if(Date.now()-I>=60000){Bz("TIMEOUT",Y.name,z);var J=z.pop();if(typeof J==="function")J.call(null,U)}else{var K=Date.now()-Q,G=Math.max(Q-I,1),W=Math.min(G*1.2,100);if(K>=W)Bz("RETRY",Y.name,z),Y.apply(null,z.concat([I]));else p4[s6].push($)}if(qD===void 0)qD=setTimeout(Xu,0)}});var TW0=E((ko1,qu)=>{function Cz1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var AW0=K6().Buffer,oH=J0("util");function Rz1($,Y,z){$.copy(Y,z)}qu.exports=function(){function $(){Cz1(this,$),this.h Line truncated
`+n);let[,K0]=m;return K0.replace(/\s/g,"").split(F0).map((w0)=>w0.replace(f0,"").trim())}function D1(f,n){var m={};return Object.keys(f).forEach((K0)=>{var w0=f[K0],D0,B0=q(w0),j0=!B0&&w0.length===1||B0&&w0.length===0;if(Array.isArray(w0))D0=[...w0],w0=D0.pop(),m[K0]=D0.concat(D0.length>0?h0:w0);else if(j0)m[K0]=w0;else{if(D0=i0(w0),w0.length===0&&!B0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!B0)D0.pop();m[K0]=D0.concat(h0)}function h0(z1,x1){var m1=D0.map((i1)=>z1[i1]);m1.push(x1),M(w0)(...m1)}}),Y1(m,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:m}=n;if(f(n))this.removeLink(n);n=m}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,m){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var K0=M(f),w0=0,D0=[];let B0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){B0[G1].push(e0)}function h0(G1,e0){let H1=(...c1)=>{z1(G1,H1),e0(...c1)};B0[G1].push(H1)}function z1(G1,e0){if(!G1)return Object.keys(B0).forEach((H1)=>B0[H1]=[]);if(!e0)return B0[G1]=[];B0[G1]=B0[G1].filter((H1)=>H1!==e0)}function x1(G1,...e0){B0[G1].forEach((H1)=>H1(...e0))}var m1=!1;function i1(G1,e0,H1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function O$(DY,...dK){if(DY)return H1?v6(DY):g4();if(dK.length<=1)return g4(dK[0]);g4(dK)}var fU=l1._createTaskItem(G1,H1?O$:c1||O$);if(e0)l1._tasks.unshift(fU);else l1._tasks.push(fU);if(!m1)m1=!0,H(()=>{m1=!1,l1.process()});if(H1||!c1)return new Promise((DY,dK)=>{g4=DY,v6=dK})}function M$(G1){return function(e0,...H1){w0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],O$=D0.indexOf(v6);if(O$===0)D0.shift();else if(O$>0)D0.splice(O$,1);if(v6.callback(e0,...H1),e0!=null)x1("error",e0,v6.data)}if(w0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function xU(G1){if(G1.length===0&&l1.idle())return H(()=>x1("drain")),!0;return!1}let NY=(G1)=>(e0)=>{if(!e0)return new Promise((H1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);H1(v6)})});z1(G1),j0(G1,e0)};var pK=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:m,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){z1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(pK)return;pK=!0;while(!l1.paused&&w0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],H1=l1._tasks.length;if(l1.payload)H1=Math.min(H1,l1.payload);for(var c1=0;c1<H1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(w0+=1,l1._tasks.length===0)x1("empty");if(w0===l1.concurrency)x1("saturated");var v6=h(M$(G1));K0(e0,v6)}pK=!1},length(){return l1._tasks.length},running(){return w0},workersList(){return D0},idle(){return l1._tasks.length+w0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,H(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:NY("saturated")},unsaturated:{writable:!1,value:NY("unsaturated")},empty:{writable:!1,value:NY("empty")},drain:{writable:!1,value:NY("drain")},error:{writable:!1,value:NY("error")}}),l1}function A0(f,n){return b1(f,1,n)}function I0(f,n,m){return b1(f,n,m)}function P(f,n,m,K0){K0=T(K0);var w0=M(m);return Y0(f,(D0,B0,j0)=>{w0(n,D0,(h0,z1)=>{n=z1,j0(h0)})},(D0)=>K0(D0,n))}var v=w(P,4);function u(...f){var n=f.map(M);return function(...m){var K0=this,w0=m[m.length-1];if(typeof w0=="function")m.pop();else w0=b0();return v(n,m,(D0,B0,j0)=>{B0.apply(K0,D0.concat((h0,...z1)=>{j0(h0,z1)}))},(D0,B0)=>w0(D0,...B0)),w0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,m,K0){return D(c(n),f,m,K0)}var Q Line truncated
GFS4: `),console.error($)};if(!p4[s6]){if(Vu=global[s6]||[],xH0(p4,Vu),p4.close=function($){function Y(z,U){return $.call(p4,z,function(I){if(!I)kH0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(Y,OD,{value:$}),Y}(p4.close),p4.closeSync=function($){function Y(z){$.apply(p4,arguments),kH0()}return Object.defineProperty(Y,OD,{value:$}),Y}(p4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Tz(p4[s6]),J0("assert").equal(p4[s6].length,0)})}var Vu;if(!global[s6])xH0(global,p4[s6]);wu.exports=Lu(rz1(p4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!p4.__patched)wu.exports=Lu(p4),p4.__patched=!0;function Lu($){lz1($),$.gracefulify=Lu,$.createReadStream=B,$.createWriteStream=T;var Y=$.readFile;$.readFile=z;function z(C,b,k){if(typeof b==="function")k=b,b=null;return h(C,b,k);function h(i,c,U0,x){return Y(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))zJ([h,[i,c,U0],d,x||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=I;function I(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return U(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var Q=$.appendFile;if(Q)$.appendFile=J;function J(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return Q(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=G;function G(C,b,k,h){if(typeof k==="function")h=k,k=0;return i(C,b,k,h);function i(c,U0,x,d,t){return K(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var H=$.readdir;$.readdir=X;var W=/^v[0-5]\./;function X(C,b,k){if(typeof b==="function")k=b,b=null;var h=W.test(process.version)?function(U0,x,d,t){return H(U0,i(U0,x,d,t))}:function(U0,x,d,t){return H(U0,x,i(U0,x,d,t))};return h(C,b,k);function i(c,U0,x,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))zJ([h,[c,U0,x],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof x==="function")x.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=oz1($);w=Z.ReadStream,D=Z.WriteStream}var q=$.ReadStream;if(q)w.prototype=Object.create(q.prototype),w.prototype.open=O;var V=$.WriteStream;if(V)D.prototype=Object.create(V.prototype),D.prototype.open=N;Object.defineProperty($,"ReadStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return D},set:function(C){D=C},enumerable:!0,configurable:!0});var F=w;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var M=D;Object.defineProperty($,"FileWriteStream",{get:function(){return M},set:function(C){M=C},enumerable:!0,configurable:!0});function w(C,b){if(this instanceof w)return q.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function O(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=k,C.emit("open",k),C.read()})}function D(C,b){if(this instanceof D)return V.apply(this,arguments),this;else return D.apply(Object.create(D.prototype),arguments)}function N(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b)C.destroy(),C.emit("error",b);else C.fd=k,C.emit("open",k)})}function B(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var A=$.open;$.open=j;function j(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return A(c,U0,x,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function zJ($){Tz("ENQUEUE",$[0].name,$[1]),p4[s6].push($),Fu()}var MD;function kH0(){var $=Date.now();for(var Y=0;Y<p4[s6].length;++Y)if(p4[s6][Y].length>2)p4[s6][Y][3]=$,p4[s6][Y][4]=$;Fu()}function Fu(){if(clearTimeout(MD),MD=void 0,p4[s6].length===0)return;var $=p4[s6].shift(),Y=$[0],z=$[1],U=$[2],I=$[3],Q=$[4];if(I===void 0)Tz("RETRY",Y.name,z),Y.apply(null,z);else if(Date.now()-I>=60000){Tz("TIMEOUT",Y.name,z);var J=z.pop();if(typeof J==="function")J.call(null,U)}else{var K=Date.now()-Q,G=Math.max(Q-I,1),H=Math.min(G*1.2,100);if(K>=H)Tz("RETRY",Y.name,z),Y.apply(null,z.concat([I]));else p4[s6].push($)}if(MD===void 0)MD=setTimeout(Fu,0)}});var uH0=E((qr1,Mu)=>{function az1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var fH0=K6().Buffer,aW=J0("util");function tz1($,Y,z){$.copy(Y,z)}Mu.exports=function(){function $(){az1(this,$),this.h Line truncated
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/XH0.exports=function($,Y){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var U="";if(z>4&&$[3]==="\\"){var I=$[2];if((I==="?"||I===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var Q=$.split(/[/\\]+/);if(Y!==!1&&Q[Q.length-1]==="")Q.pop();return U+Q.join("/")}});var hu=E((oo1,MH0)=>{var qH0=9007199254740991,yU1="[object Arguments]",kU1="[object Function]",xU1="[object GeneratorFunction]",fU1=/^(?:0|[1-9]\d*)$/;function VH0($,Y,z){switch(z.length){case 0:return $.call(Y);case 1:return $.call(Y,z[0]);case 2:return $.call(Y,z[0],z[1]);case 3:return $.call(Y,z[0],z[1],z[2])}return $.apply(Y,z)}function uU1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}var UX=Object.prototype,IX=UX.hasOwnProperty,LH0=UX.toString,bU1=UX.propertyIsEnumerable,ZH0=Math.max;function iU1($,Y){var z=aU1($)||sU1($)?uU1($.length,String):[],U=z.length,I=!!U;for(var Q in $)if((Y||IX.call($,Q))&&!(I&&(Q=="length"||wH0(Q,U))))z.push(Q);return z}function cU1($,Y,z,U){if($===void 0||Ru($,UX[z])&&!IX.call(U,z))return Y;return $}function nU1($,Y,z){var U=$[Y];if(!(IX.call($,Y)&&Ru(U,z))||z===void 0&&!(Y in $))$[Y]=z}function pU1($){if(!vu($))return rU1($);var Y=oU1($),z=[];for(var U in $)if(!(U=="constructor"&&(Y||!IX.call($,U))))z.push(U);return z}function FH0($,Y){return Y=ZH0(Y===void 0?$.length-1:Y,0),function(){var z=arguments,U=-1,I=ZH0(z.length-Y,0),Q=Array(I);while(++U<I)Q[U]=z[Y+U];U=-1;var J=Array(Y+1);while(++U<Y)J[U]=z[U];return J[Y]=Q,VH0($,this,J)}}function dU1($,Y,z,U){z||(z={});var I=-1,Q=Y.length;while(++I<Q){var J=Y[I],K=U?U(z[J],$[J],J,z,$):void 0;nU1(z,J,K===void 0?$[J]:K)}return z}function mU1($){return FH0(function(Y,z){var U=-1,I=z.length,Q=I>1?z[I-1]:void 0,J=I>2?z[2]:void 0;if(Q=$.length>3&&typeof Q=="function"?(I--,Q):void 0,J&&lU1(z[0],z[1],J))Q=I<3?void 0:Q,I=1;Y=Object(Y);while(++U<I){var K=z[U];if(K)$(Y,K,U,Q)}return Y})}function wH0($,Y){return Y=Y==null?qH0:Y,!!Y&&(typeof $=="number"||fU1.test($))&&($>-1&&$%1==0&&$<Y)}function lU1($,Y,z){if(!vu(z))return!1;var U=typeof Y;if(U=="number"?_u(z)&&wH0(Y,z.length):U=="string"&&(Y in z))return Ru(z[Y],$);return!1}function oU1($){var Y=$&&$.constructor,z=typeof Y=="function"&&Y.prototype||UX;return $===z}function rU1($){var Y=[];if($!=null)for(var z in Object($))Y.push(z);return Y}function Ru($,Y){return $===Y||$!==$&&Y!==Y}function sU1($){return tU1($)&&IX.call($,"callee")&&(!bU1.call($,"callee")||LH0.call($)==yU1)}var aU1=Array.isArray;function _u($){return $!=null&&$I1($.length)&&!eU1($)}function tU1($){return YI1($)&&_u($)}function eU1($){var Y=vu($)?LH0.call($):"";return Y==kU1||Y==xU1}function $I1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=qH0}function vu($){var Y=typeof $;return!!$&&(Y=="object"||Y=="function")}function YI1($){return!!$&&typeof $=="object"}var zI1=mU1(function($,Y,z,U){dU1(Y,II1(Y),$,U)}),UI1=FH0(function($){return $.push(void 0,cU1),VH0(zI1,void 0,$)});function II1($){return _u($)?iU1($,!0):pU1($)}MH0.exports=UI1});var NH0=E((ro1,Su)=>{function QI1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var OH0=K6().Buffer,QX=J0("util");function JI1($,Y,z){$.copy(Y,z)}Su.exports=function(){function $(){QI1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,I=""+U.data;while(U=U.next)I+=z+U.data;return I},$.prototype.concat=function(z){if(this.length===0)return OH0.alloc(0);var U=OH0.allocUnsafe(z>>>0),I=this.head,Q=0;while(I)JI1(I.data,U,Q),Q+=I.data.length,I=I.next;return U},$}();if(QX&&QX.inspect&&QX.inspect.custom)Su.exports.prototype[QX.inspect.custom]=function(){var $=QX.inspect({length:this.length});return this.constructor.name+" "+$}});var gu=E((so1,DH0)=>{var ED=J6();function KI1($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(U||I){if(Y)Y($);else if($){if(!this._writableState)ED.nextTick(CD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,ED.nextTick(CD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Q){if(!Y&&Q){if(!z._writableState)ED.nextTick(CD,z,Q);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,ED.nextTick(CD,z,Q)}else if(Y)Y(Q)}),this}function GI1(){if(this._readableState)this._readabl Line truncated
%s`,A,A,O,U);var T=O.type==="*"?Mb:O.type==="?"?wb:"\\"+O.type;I=!0,U=U.slice(0,O.reStart)+T+"\\("+A}if(V(),Q)U+="\\\\";var P=!1;switch(U.charAt(0)){case"[":case".":case"(":P=!0}for(var j=K.length-1;j>-1;j--){var C=K[j],b=U.slice(0,C.reStart),k=U.slice(C.reStart,C.reEnd-8),h=U.slice(C.reEnd-8,C.reEnd),i=U.slice(C.reEnd);h+=i;var c=b.split("(").length-1,U0=i;for(F=0;F<c;F++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var x="";if(i===""&&Y!==pD)x="$";var d=b+k+i+x+h;U=d}if(U!==""&&I)U="(?=.)"+U;if(P)U=Z+U;if(Y===pD)return[U,I];if(!I)return EG1($);var t=z.nocase?"i":"";try{var $0=new RegExp("^"+U+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=U,$0}H$.makeRe=function($,Y){return new L6($,Y||{}).makeRe()};L6.prototype.makeRe=jG1;function jG1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var Y=this.options,z=Y.noglobstar?Mb:Y.dot?MG1:OG1,U=Y.nocase?"i":"",I=$.map(function(Q){return Q.map(function(J){return J===hz?z:typeof J==="string"?CG1(J):J._src}).join("\\/")}).join("|");if(I="^(?:"+I+")$",this.negate)I="^(?!"+I+").*$";try{this.regexp=new RegExp(I,U)}catch(Q){this.regexp=!1}return this.regexp}H$.match=function($,Y,z){z=z||{};var U=new L6(Y,z);if($=$.filter(function(I){return U.match(I)}),U.options.nonull&&!$.length)$.push(Y);return $};L6.prototype.match=function(Y,z){if(typeof z>"u")z=this.partial;if(this.debug("match",Y,this.pattern),this.comment)return!1;if(this.empty)return Y==="";if(Y==="/"&&z)return!0;var U=this.options;if(wX.sep!=="/")Y=Y.split(wX.sep).join("/");Y=Y.split($Z0),this.debug(this.pattern,"split",Y);var I=this.set;this.debug(this.pattern,"set",I);var Q,J;for(J=Y.length-1;J>=0;J--)if(Q=Y[J],Q)break;for(J=0;J<I.length;J++){var K=I[J],G=Y;if(U.matchBase&&K.length===1)G=[Q];var W=this.matchOne(G,K,z);if(W){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};L6.prototype.matchOne=function($,Y,z){if(Y.indexOf(hz)!==-1)return this._matchGlobstar($,Y,z,0,0);return this._matchOne($,Y,z,0,0)};L6.prototype._matchGlobstar=function($,Y,z,U,I){var Q,J=-1;for(Q=I;Q<Y.length;Q++)if(Y[Q]===hz){J=Q;break}var K=-1;for(Q=Y.length-1;Q>=0;Q--)if(Y[Q]===hz){K=Q;break}var G=Y.slice(I,J),W=z?Y.slice(J+1):Y.slice(J+1,K),H=z?[]:Y.slice(K+1);if(G.length){var X=$.slice(U,U+G.length);if(!this._matchOne(X,G,z,0,0))return!1;U+=G.length}var Z=0;if(H.length){if(H.length+U>$.length)return!1;var q=$.length-H.length;if(this._matchOne($,H,z,q,0))Z=H.length;else{if($[$.length-1]!==""||U+H.length===$.length)return!1;if(q--,!this._matchOne($,H,z,q,0))return!1;Z=H.length+1}}if(!W.length){var V=!!Z;for(Q=U;Q<$.length-Z;Q++){var F=String($[Q]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return z||V}var M=[[[],0]],w=M[0],O=0,D=[0];for(var N=0;N<W.length;N++){var A=W[N];if(A===hz)D.push(O),w=[[],0],M.push(w);else w[0].push(A),O++}var T=M.length-1,P=$.length-Z;for(var j=0;j<M.length;j++)M[j][1]=P-(D[T--]+M[j][0].length);return!!this._matchGlobStarBodySections($,M,U,0,z,0,!!Z)};L6.prototype._matchGlobStarBodySections=function($,Y,z,U,I,Q,J){var K=Y[U];if(!K){for(var G=z;G<$.length;G++){J=!0;var W=$[G];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1}return J}var H=K[0],X=K[1];while(z<=X){var Z=this._matchOne($.slice(0,z+H.length),H,I,z,0);if(Z&&Q<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,Y,z+H.length,U+1,I,Q+1,J);if(q!==!1)return q}var W=$[z];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1;z++}return I||null};L6.prototype._matchOne=function($,Y,z,U,I){var Q,J,K,G;for(Q=U,J=I,K=$.length,G=Y.length;Q<K&&J<G;Q++,J++){this.debug("matchOne loop");var W=Y[J],H=$[Q];if(this.debug(Y,W,H),W===!1||W===hz)return!1;var X;if(typeof W==="string")X=H===W,this.debug("string match",W,H,X);else X=H.match(W),this.debug("pattern match",W,H,X);if(!X)return!1}if(Q===K&&J===G)return!0;else if(Q===K)return z;else if(J===G)return Q===K-1&&$[Q]==="";throw Error("wtf?")};function EG1($){return $.replace(/\\(.)/g,"$1")}function CG1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var oD=E((Fr1,lD)=>{function UZ0($){return $.charAt(0)==="/"}function IZ0($){var Y=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=Y.exec($),U=z[1]||"",I=Boolean(U&&U.charAt(1)!==":");return Boolean(z[2]||I)}lD.exports=process.platform==="win32"?IZ0:UZ0;lD.exports.posix=UZ0;lD.exports.win32=IZ0});var Nb=E((fG1)=>{fG1.setopts=gG1;fG1.ownProp=QZ0;fG1.makeAbs=MX;fG1.finish=yG1;fG1.mark=kG1;fG1.isIgnored=KZ0;fG1.childrenIgnored=xG1;function QZ0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}var RG1=J0("fs"),qJ=J0("path"),_G1=mD(),JZ0=oD(),Ob=_G1.Minimatch;function vG1($,Y){return $.localeCompare(Y,"en")}function hG1($,Y){if($.ignore=Y.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(SG1)}function SG1($){var Y=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");Y=new Ob(z,{dot:!0})}return{ma Line truncated
*/TW0.exports=function($,Y){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var U="";if(z>4&&$[3]==="\\"){var I=$[2];if((I==="?"||I===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var Q=$.split(/[/\\]+/);if(Y!==!1&&Q[Q.length-1]==="")Q.pop();return U+Q.join("/")}});var xu=E((Tr1,hW0)=>{var EW0=9007199254740991,II1="[object Arguments]",QI1="[object Function]",JI1="[object GeneratorFunction]",KI1=/^(?:0|[1-9]\d*)$/;function CW0($,Y,z){switch(z.length){case 0:return $.call(Y);case 1:return $.call(Y,z[0]);case 2:return $.call(Y,z[0],z[1]);case 3:return $.call(Y,z[0],z[1],z[2])}return $.apply(Y,z)}function GI1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}var JX=Object.prototype,KX=JX.hasOwnProperty,RW0=JX.toString,HI1=JX.propertyIsEnumerable,jW0=Math.max;function WI1($,Y){var z=NI1($)||OI1($)?GI1($.length,String):[],U=z.length,I=!!U;for(var Q in $)if((Y||KX.call($,Q))&&!(I&&(Q=="length"||vW0(Q,U))))z.push(Q);return z}function XI1($,Y,z,U){if($===void 0||gu($,JX[z])&&!KX.call(U,z))return Y;return $}function ZI1($,Y,z){var U=$[Y];if(!(KX.call($,Y)&&gu(U,z))||z===void 0&&!(Y in $))$[Y]=z}function qI1($){if(!ku($))return MI1($);var Y=wI1($),z=[];for(var U in $)if(!(U=="constructor"&&(Y||!KX.call($,U))))z.push(U);return z}function _W0($,Y){return Y=jW0(Y===void 0?$.length-1:Y,0),function(){var z=arguments,U=-1,I=jW0(z.length-Y,0),Q=Array(I);while(++U<I)Q[U]=z[Y+U];U=-1;var J=Array(Y+1);while(++U<Y)J[U]=z[U];return J[Y]=Q,CW0($,this,J)}}function VI1($,Y,z,U){z||(z={});var I=-1,Q=Y.length;while(++I<Q){var J=Y[I],K=U?U(z[J],$[J],J,z,$):void 0;ZI1(z,J,K===void 0?$[J]:K)}return z}function LI1($){return _W0(function(Y,z){var U=-1,I=z.length,Q=I>1?z[I-1]:void 0,J=I>2?z[2]:void 0;if(Q=$.length>3&&typeof Q=="function"?(I--,Q):void 0,J&&FI1(z[0],z[1],J))Q=I<3?void 0:Q,I=1;Y=Object(Y);while(++U<I){var K=z[U];if(K)$(Y,K,U,Q)}return Y})}function vW0($,Y){return Y=Y==null?EW0:Y,!!Y&&(typeof $=="number"||KI1.test($))&&($>-1&&$%1==0&&$<Y)}function FI1($,Y,z){if(!ku(z))return!1;var U=typeof Y;if(U=="number"?yu(z)&&vW0(Y,z.length):U=="string"&&(Y in z))return gu(z[Y],$);return!1}function wI1($){var Y=$&&$.constructor,z=typeof Y=="function"&&Y.prototype||JX;return $===z}function MI1($){var Y=[];if($!=null)for(var z in Object($))Y.push(z);return Y}function gu($,Y){return $===Y||$!==$&&Y!==Y}function OI1($){return DI1($)&&KX.call($,"callee")&&(!HI1.call($,"callee")||RW0.call($)==II1)}var NI1=Array.isArray;function yu($){return $!=null&&PI1($.length)&&!AI1($)}function DI1($){return BI1($)&&yu($)}function AI1($){var Y=ku($)?RW0.call($):"";return Y==QI1||Y==JI1}function PI1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=EW0}function ku($){var Y=typeof $;return!!$&&(Y=="object"||Y=="function")}function BI1($){return!!$&&typeof $=="object"}var TI1=LI1(function($,Y,z,U){VI1(Y,EI1(Y),$,U)}),jI1=_W0(function($){return $.push(void 0,XI1),CW0(TI1,void 0,$)});function EI1($){return yu($)?WI1($,!0):qI1($)}hW0.exports=jI1});var gW0=E((jr1,fu)=>{function CI1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var SW0=K6().Buffer,GX=J0("util");function RI1($,Y,z){$.copy(Y,z)}fu.exports=function(){function $(){CI1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,I=""+U.data;while(U=U.next)I+=z+U.data;return I},$.prototype.concat=function(z){if(this.length===0)return SW0.alloc(0);var U=SW0.allocUnsafe(z>>>0),I=this.head,Q=0;while(I)RI1(I.data,U,Q),Q+=I.data.length,I=I.next;return U},$}();if(GX&&GX.inspect&&GX.inspect.custom)fu.exports.prototype[GX.inspect.custom]=function(){var $=GX.inspect({length:this.length});return this.constructor.name+" "+$}});var uu=E((Er1,yW0)=>{var hD=J6();function _I1($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(U||I){if(Y)Y($);else if($){if(!this._writableState)hD.nextTick(SD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,hD.nextTick(SD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Q){if(!Y&&Q){if(!z._writableState)hD.nextTick(SD,z,Q);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,hD.nextTick(SD,z,Q)}else if(Y)Y(Q)}),this}function vI1(){if(this._readableState)this._readabl Line truncated
%s`,B,B,O,U);var T=O.type==="*"?Pb:O.type==="?"?Ab:"\\"+O.type;I=!0,U=U.slice(0,O.reStart)+T+"\\("+B}if(V(),Q)U+="\\\\";var A=!1;switch(U.charAt(0)){case"[":case".":case"(":A=!0}for(var j=K.length-1;j>-1;j--){var C=K[j],b=U.slice(0,C.reStart),k=U.slice(C.reStart,C.reEnd-8),h=U.slice(C.reEnd-8,C.reEnd),i=U.slice(C.reEnd);h+=i;var c=b.split("(").length-1,U0=i;for(F=0;F<c;F++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var x="";if(i===""&&Y!==rD)x="$";var d=b+k+i+x+h;U=d}if(U!==""&&I)U="(?=.)"+U;if(A)U=Z+U;if(Y===rD)return[U,I];if(!I)return sG1($);var t=z.nocase?"i":"";try{var $0=new RegExp("^"+U+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=U,$0}W$.makeRe=function($,Y){return new L6($,Y||{}).makeRe()};L6.prototype.makeRe=rG1;function rG1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var Y=this.options,z=Y.noglobstar?Pb:Y.dot?iG1:cG1,U=Y.nocase?"i":"",I=$.map(function(Q){return Q.map(function(J){return J===gz?z:typeof J==="string"?aG1(J):J._src}).join("\\/")}).join("|");if(I="^(?:"+I+")$",this.negate)I="^(?!"+I+").*$";try{this.regexp=new RegExp(I,U)}catch(Q){this.regexp=!1}return this.regexp}W$.match=function($,Y,z){z=z||{};var U=new L6(Y,z);if($=$.filter(function(I){return U.match(I)}),U.options.nonull&&!$.length)$.push(Y);return $};L6.prototype.match=function(Y,z){if(typeof z>"u")z=this.partial;if(this.debug("match",Y,this.pattern),this.comment)return!1;if(this.empty)return Y==="";if(Y==="/"&&z)return!0;var U=this.options;if(NX.sep!=="/")Y=Y.split(NX.sep).join("/");Y=Y.split(VZ0),this.debug(this.pattern,"split",Y);var I=this.set;this.debug(this.pattern,"set",I);var Q,J;for(J=Y.length-1;J>=0;J--)if(Q=Y[J],Q)break;for(J=0;J<I.length;J++){var K=I[J],G=Y;if(U.matchBase&&K.length===1)G=[Q];var H=this.matchOne(G,K,z);if(H){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};L6.prototype.matchOne=function($,Y,z){if(Y.indexOf(gz)!==-1)return this._matchGlobstar($,Y,z,0,0);return this._matchOne($,Y,z,0,0)};L6.prototype._matchGlobstar=function($,Y,z,U,I){var Q,J=-1;for(Q=I;Q<Y.length;Q++)if(Y[Q]===gz){J=Q;break}var K=-1;for(Q=Y.length-1;Q>=0;Q--)if(Y[Q]===gz){K=Q;break}var G=Y.slice(I,J),H=z?Y.slice(J+1):Y.slice(J+1,K),W=z?[]:Y.slice(K+1);if(G.length){var X=$.slice(U,U+G.length);if(!this._matchOne(X,G,z,0,0))return!1;U+=G.length}var Z=0;if(W.length){if(W.length+U>$.length)return!1;var q=$.length-W.length;if(this._matchOne($,W,z,q,0))Z=W.length;else{if($[$.length-1]!==""||U+W.length===$.length)return!1;if(q--,!this._matchOne($,W,z,q,0))return!1;Z=W.length+1}}if(!H.length){var V=!!Z;for(Q=U;Q<$.length-Z;Q++){var F=String($[Q]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return z||V}var M=[[[],0]],w=M[0],O=0,D=[0];for(var N=0;N<H.length;N++){var B=H[N];if(B===gz)D.push(O),w=[[],0],M.push(w);else w[0].push(B),O++}var T=M.length-1,A=$.length-Z;for(var j=0;j<M.length;j++)M[j][1]=A-(D[T--]+M[j][0].length);return!!this._matchGlobStarBodySections($,M,U,0,z,0,!!Z)};L6.prototype._matchGlobStarBodySections=function($,Y,z,U,I,Q,J){var K=Y[U];if(!K){for(var G=z;G<$.length;G++){J=!0;var H=$[G];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1}return J}var W=K[0],X=K[1];while(z<=X){var Z=this._matchOne($.slice(0,z+W.length),W,I,z,0);if(Z&&Q<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,Y,z+W.length,U+1,I,Q+1,J);if(q!==!1)return q}var H=$[z];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1;z++}return I||null};L6.prototype._matchOne=function($,Y,z,U,I){var Q,J,K,G;for(Q=U,J=I,K=$.length,G=Y.length;Q<K&&J<G;Q++,J++){this.debug("matchOne loop");var H=Y[J],W=$[Q];if(this.debug(Y,H,W),H===!1||H===gz)return!1;var X;if(typeof H==="string")X=W===H,this.debug("string match",H,W,X);else X=W.match(H),this.debug("pattern match",H,W,X);if(!X)return!1}if(Q===K&&J===G)return!0;else if(Q===K)return z;else if(J===G)return Q===K-1&&$[Q]==="";throw Error("wtf?")};function sG1($){return $.replace(/\\(.)/g,"$1")}function aG1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var eD=E((lr1,tD)=>{function wZ0($){return $.charAt(0)==="/"}function MZ0($){var Y=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=Y.exec($),U=z[1]||"",I=Boolean(U&&U.charAt(1)!==":");return Boolean(z[2]||I)}tD.exports=process.platform==="win32"?MZ0:wZ0;tD.exports.posix=wZ0;tD.exports.win32=MZ0});var Tb=E((KH1)=>{KH1.setopts=UH1;KH1.ownProp=OZ0;KH1.makeAbs=DX;KH1.finish=IH1;KH1.mark=QH1;KH1.isIgnored=DZ0;KH1.childrenIgnored=JH1;function OZ0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}var tG1=J0("fs"),LJ=J0("path"),eG1=aD(),NZ0=eD(),Bb=eG1.Minimatch;function $H1($,Y){return $.localeCompare(Y,"en")}function YH1($,Y){if($.ignore=Y.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(zH1)}function zH1($){var Y=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");Y=new Bb(z,{dot:!0})}return{ma Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new T6($,Y).found}function T6($,Y){if(!$)throw Error("must provide pattern");if(typeof Y==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,Y);if(lG1(this,$,Y),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var U=0;U<z;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}T6.prototype._finish=function(){if(WZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(Y,z){var U=$.matches[z]=Object.create(null);for(var I in Y)try{I=$._makeAbs(I);var Q=mG1.realpathSync(I,$.realpathCache);U[Q]=!0}catch(J){if(J.syscall==="stat")U[$._makeAbs(I)]=!0;else throw J}})}Sz.finish(this)};T6.prototype._process=function($,Y,z){WZ0.ok(this instanceof T6);var U=0;while(typeof $[U]==="string")U++;var I;switch(U){case $.length:this._processSimple($.join("/"),Y);return;case 0:I=null;break;default:I=$.slice(0,U).join("/");break}var Q=$.slice(U),J;if(I===null)J=".";else if(rD(I)||rD($.map(function(W){return typeof W==="string"?W:"[*]"}).join("/"))){if(!I||!rD(I))I="/"+I;J=I}else J=I;var K=this._makeAbs(J);if(oG1(this,J))return;var G=Q[0]===GZ0.GLOBSTAR;if(G)this._processGlobStar(I,J,K,Q,Y,z);else this._processReaddir(I,J,K,Q,Y,z)};T6.prototype._processReaddir=function($,Y,z,U,I,Q){var J=this._readdir(z,Q);if(!J)return;var K=U[0],G=!!this.minimatch.negate,W=K._glob,H=this.dot||W.charAt(0)===".",X=[];for(var Z=0;Z<J.length;Z++){var q=J[Z];if(q.charAt(0)!=="."||H){var V;if(G&&!$)V=!q.match(K);else V=q.match(K);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[I])this.matches[I]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=Db.join(this.root,q);this._emitMatch(I,q)}return}U.shift();for(var Z=0;Z<F;Z++){var q=X[Z],M;if($)M=[$,q];else M=[q];this._process(M.concat(U),I,Q)}};T6.prototype._emitMatch=function($,Y){if(rG1(this,Y))return;var z=this._makeAbs(Y);if(this.mark)Y=this._mark(Y);if(this.absolute)Y=z;if(this.matches[$][Y])return;if(this.nodir){var U=this.cache[z];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][Y]=!0,this.stat)this._stat(Y)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var Y,z,U;try{z=this.fs.lstatSync($)}catch(Q){if(Q.code==="ENOENT")return null}var I=z&&z.isSymbolicLink();if(this.symlinks[$]=I,!I&&z&&!z.isDirectory())this.cache[$]="FILE";else Y=this._readdir($,!1);return Y};T6.prototype._readdir=function($,Y){var z;if(Y&&!Pb(this.symlinks,$))return this._readdirInGlobStar($);if(Pb(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(I){return this._readdirError($,I),null}};T6.prototype._readdirEntries=function($,Y){if(!this.mark&&!this.stat)for(var z=0;z<Y.length;z++){var U=Y[z];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=Y,Y};T6.prototype._readdirError=function($,Y){switch(Y.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var U=Error(Y.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=Y.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw Y;if(!this.silent)console.error("glob error",Y);break}};T6.prototype._processGlobStar=function($,Y,z,U,I,Q){var J=this._readdir(z,Q);if(!J)return;var K=U.slice(1),G=$?[$]:[],W=G.concat(K);this._process(W,I,!1);var H=J.length,X=this.symlinks[z];if(X&&Q)return;for(var Z=0;Z<H;Z++){var q=J[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(J[Z],K);this._process(V,I,!0);var F=G.concat(J[Z],U);this._process(F,I,!0)}};T6.prototype._processSimple=function($,Y){var z=this._stat($);if(!this.matches[Y])this.matches[Y]=Object.create(null);if(!z)return;if($&&rD($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=Db.join(this.root,$);else if($=Db.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(Y,$)};T6.prototype._stat=function($){var Y=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Pb(this.cache,Y)){var J=this.cache[Y];if(Array.isArray(J))J="DIR";if(!z||J==="DIR")return J;if(z&&J==="FILE")return!1}var U,I=this.statCache[Y];if(!I){var Q;try{Q=this.fs.lstatSync(Y)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[Y]=!1,!1}if(Q&&Q.isSymbolicLink())try{I=this.fs.statSync(Y)}catch(K){I=Q}else I=Q}this.statCache[Y]=I;var J=!0;if(I)J=I.isDirectory()?"DIR":"FILE";if(this.cache[Y]=this.cache[Y]||J,z&&J==="FILE")return!1;return J};T6.prototype._mark=function($){return Sz.mark(this,$)};T6.prototype._makeAbs=function($){return Sz.makeAbs(this,$)}});var Bb=E((Pr1,VZ0)=>{VZ0.exports=qZ0;function qZ0($,Y){if($&&Y)return qZ0($)(Y);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){z[U]=$[U]}),z;f Line truncated
`);if($.linkname)Y+=Di(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var U in z)Y+=Di(" "+U+"="+z[U]+`
`);return Buffer.from(Y)};QZ1.decodePax=function($){var Y={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var U=parseInt($.slice(0,z).toString(),10);if(!U)return Y;var I=$.slice(z+1,U-1).toString(),Q=I.indexOf("=");if(Q===-1)return Y;Y[I.slice(0,Q)]=I.slice(Q+1),$=$.slice(U)}return Y};QZ1.encode=function($){var Y=oX1(512),z=$.name,U="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var I=z.indexOf("/");if(I===-1)return null;U+=U?"/"+z.slice(0,I):z.slice(0,I),z=z.slice(I+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(Y.write(z),Y.write(D2($.mode&$Z1,6),100),Y.write(D2($.uid,6),108),Y.write(D2($.gid,6),116),Y.write(D2($.size,11),124),Y.write(D2($.mtime.getTime()/1000|0,11),136),Y[156]=CV0+UZ1($.type),$.linkname)Y.write($.linkname,157);if(RV0.copy(Y,gX),aX1.copy(Y,Pi),$.uname)Y.write($.uname,265);if($.gname)Y.write($.gname,297);if(Y.write(D2($.devmajor||0,6),329),Y.write(D2($.devminor||0,6),337),U)Y.write(U,345);return Y.write(D2(vV0(Y),6),148),Y};QZ1.decode=function($,Y,z){var U=$[156]===0?0:$[156]-CV0,I=PJ($,0,100,Y),Q=P2($,100,8),J=P2($,108,8),K=P2($,116,8),G=P2($,124,12),W=P2($,136,12),H=zZ1(U),X=$[157]===0?null:PJ($,157,100,Y),Z=PJ($,265,32),q=PJ($,297,32),V=P2($,329,8),F=P2($,337,8),M=vV0($);if(M===256)return null;if(M!==P2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(RV0.compare($,gX,gX+6)===0){if($[345])I=PJ($,345,155,Y)+"/"+I}else if(tX1.compare($,gX,gX+6)===0&&eX1.compare($,Pi,Pi+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(U===0&&I&&I[I.length-1]==="/")U=5;return{name:I,mode:Q,uid:J,gid:K,size:G,mtime:new Date(1000*W),type:H,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var fV0=E((Fs1,xV0)=>{var SV0=J0("util"),XZ1=EV0(),yX=Bi(),gV0=E8().Writable,yV0=E8().PassThrough,kV0=function(){},hV0=function($){return $&=511,$&&512-$},ZZ1=function($,Y){var z=new LP($,Y);return z.end(),z},qZ1=function($,Y){if(Y.path)$.name=Y.path;if(Y.linkpath)$.linkname=Y.linkpath;if(Y.size)$.size=parseInt(Y.size,10);return $.pax=Y,$},LP=function($,Y){this._parent=$,this.offset=Y,yV0.call(this,{autoDestroy:!1})};SV0.inherits(LP,yV0);LP.prototype.destroy=function($){this._parent.destroy($)};var B3=function($){if(!(this instanceof B3))return new B3($);gV0.call(this,$),$=$||{},this._offset=0,this._buffer=XZ1(),this._missing=0,this._partial=!1,this._onparse=kV0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var Y=this,z=Y._buffer,U=function(){Y._continue()},I=function(Z){if(Y._locked=!1,Z)return Y.destroy(Z);if(!Y._stream)U()},Q=function(){Y._stream=null;var Z=hV0(Y._header.size);if(Z)Y._parse(Z,J);else Y._parse(512,X);if(!Y._locked)U()},J=function(){Y._buffer.consume(hV0(Y._header.size)),Y._parse(512,X),U()},K=function(){var Z=Y._header.size;Y._paxGlobal=yX.decodePax(z.slice(0,Z)),z.consume(Z),Q()},G=function(){var Z=Y._header.size;if(Y._pax=yX.decodePax(z.slice(0,Z)),Y._paxGlobal)Y._pax=Object.assign({},Y._paxGlobal,Y._pax);z.consume(Z),Q()},W=function(){var Z=Y._header.size;this._gnuLongPath=yX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),Q()},H=function(){var Z=Y._header.size;this._gnuLongLinkPath=yX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),Q()},X=function(){var Z=Y._offset,q;try{q=Y._header=yX.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){Y.emit("error",V)}if(z.consume(512),!q){Y._parse(512,X),U();return}if(q.type==="gnu-long-path"){Y._parse(q.size,W),U();return}if(q.type==="gnu-long-link-path"){Y._parse(q.size,H),U();return}if(q.type==="pax-global-header"){Y._parse(q.size,K),U();return}if(q.type==="pax-header"){Y._parse(q.size,G),U();return}if(Y._gnuLongPath)q.name=Y._gnuLongPath,Y._gnuLongPath=null;if(Y._gnuLongLinkPath)q.linkname=Y._gnuLongLinkPath,Y._gnuLongLinkPath=null;if(Y._pax)Y._header=q=qZ1(q,Y._pax),Y._pax=null;if(Y._locked=!0,!q.size||q.type==="directory"){Y._parse(512,X),Y.emit("entry",q,ZZ1(Y,Z),I);return}Y._stream=new LP(Y,Z),Y.emit("entry",q,Y._stream,I),Y._parse(q.size,Q),U()};this._onheader=X,this._parse(512,X)};SV0.inherits(B3,gV0);B3.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};B3.prototype._parse=function($,Y){if(this._destroyed)return;if(this._offset+=$,this._missing=$,Y===this._onheader)this._partial=!1;this._onparse=Y};B3.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=kV0,this._overflow)this._write(this._overflow,void 0,$);else $()};B3.prototype._write=function($,Y,z){if(this._destroyed)return;var U=this._stream,I=this._buffer,Q=this._missing;if($.length)this._partial=!0;if($.length<Q) Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let Y=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${hZ1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${$.Target}"/>`);return Y}_writeClose(){this.stream.write("</Relationships>")}}HL0.exports=WL0});var FL0=E((js1,LL0)=>{var ZL0=l6(),qL0=e7(),gZ1=i4(),yZ1=kx(),kZ1=fx();class VL0{constructor($,Y,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=Y}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:qL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let Y={Type:qL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(Y)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,Y){let z=new yZ1,U=new ZL0;z.render(U,$),this.commentsStream.write(U.xml);let I=new kZ1,Q=new ZL0;I.render(Q,$,Y),this.vmlStream.write(Q.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((Y)=>{Y.refAddress=gZ1.decodeAddress(Y.ref)}),$.forEach((Y)=>{this._writeComment(Y,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}LL0.exports=VL0});var PL0=E((Es1,DL0)=>{var xZ1=Y6(),fZ1=e7(),ji=i4(),wL0=Yg(),ML0=$3(),uZ1=Lk(),OL0=NM(),Ei=PM(),bZ1=XL0(),iZ1=FL0(),cZ1=eS(),y6=new uZ1,Ci=s7(),nZ1=Hx(),pZ1=Xx(),dZ1=Zx(),mZ1=Jx(),lZ1=Ix(),oZ1=Kx(),rZ1=qx(),sZ1=Vx(),aZ1=Lx(),tZ1=Fx(),eZ1=wx(),$q1=Mx(),Yq1=Bx(),zq1=Nx(),Uq1=Ox(),k6={dataValidations:new nZ1,sheetProperties:new pZ1,sheetFormatProperties:new dZ1,columns:new Ci({tag:"cols",length:!1,childXform:new mZ1}),row:new lZ1,hyperlinks:new Ci({tag:"hyperlinks",length:!1,childXform:new oZ1}),sheetViews:new Ci({tag:"sheetViews",length:!1,childXform:new rZ1}),sheetProtection:new sZ1,pageMargins:new aZ1,pageSeteup:new tZ1,autoFilter:new eZ1,picture:new $q1,conditionalFormattings:new Yq1,headerFooter:new zq1,rowBreaks:new Uq1};class NL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new bZ1($),this._sheetCommentsWriter=new iZ1(this,this._sheetRelsWriter,$),this._dimensions=new ML0,this._rowZero=1,this.committed=!1,this.dataValidations=new cZ1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,Y);if(FH1(this,$,Y),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var U=0;U<z;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}T6.prototype._finish=function(){if(PZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(Y,z){var U=$.matches[z]=Object.create(null);for(var I in Y)try{I=$._makeAbs(I);var Q=LH1.realpathSync(I,$.realpathCache);U[Q]=!0}catch(J){if(J.syscall==="stat")U[$._makeAbs(I)]=!0;else throw J}})}yz.finish(this)};T6.prototype._process=function($,Y,z){PZ0.ok(this instanceof T6);var U=0;while(typeof $[U]==="string")U++;var I;switch(U){case $.length:this._processSimple($.join("/"),Y);return;case 0:I=null;break;default:I=$.slice(0,U).join("/");break}var Q=$.slice(U),J;if(I===null)J=".";else if($A(I)||$A($.map(function(H){return typeof H==="string"?H:"[*]"}).join("/"))){if(!I||!$A(I))I="/"+I;J=I}else J=I;var K=this._makeAbs(J);if(wH1(this,J))return;var G=Q[0]===AZ0.GLOBSTAR;if(G)this._processGlobStar(I,J,K,Q,Y,z);else this._processReaddir(I,J,K,Q,Y,z)};T6.prototype._processReaddir=function($,Y,z,U,I,Q){var J=this._readdir(z,Q);if(!J)return;var K=U[0],G=!!this.minimatch.negate,H=K._glob,W=this.dot||H.charAt(0)===".",X=[];for(var Z=0;Z<J.length;Z++){var q=J[Z];if(q.charAt(0)!=="."||W){var V;if(G&&!$)V=!q.match(K);else V=q.match(K);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[I])this.matches[I]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=jb.join(this.root,q);this._emitMatch(I,q)}return}U.shift();for(var Z=0;Z<F;Z++){var q=X[Z],M;if($)M=[$,q];else M=[q];this._process(M.concat(U),I,Q)}};T6.prototype._emitMatch=function($,Y){if(MH1(this,Y))return;var z=this._makeAbs(Y);if(this.mark)Y=this._mark(Y);if(this.absolute)Y=z;if(this.matches[$][Y])return;if(this.nodir){var U=this.cache[z];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][Y]=!0,this.stat)this._stat(Y)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var Y,z,U;try{z=this.fs.lstatSync($)}catch(Q){if(Q.code==="ENOENT")return null}var I=z&&z.isSymbolicLink();if(this.symlinks[$]=I,!I&&z&&!z.isDirectory())this.cache[$]="FILE";else Y=this._readdir($,!1);return Y};T6.prototype._readdir=function($,Y){var z;if(Y&&!Eb(this.symlinks,$))return this._readdirInGlobStar($);if(Eb(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(I){return this._readdirError($,I),null}};T6.prototype._readdirEntries=function($,Y){if(!this.mark&&!this.stat)for(var z=0;z<Y.length;z++){var U=Y[z];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=Y,Y};T6.prototype._readdirError=function($,Y){switch(Y.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var U=Error(Y.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=Y.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw Y;if(!this.silent)console.error("glob error",Y);break}};T6.prototype._processGlobStar=function($,Y,z,U,I,Q){var J=this._readdir(z,Q);if(!J)return;var K=U.slice(1),G=$?[$]:[],H=G.concat(K);this._process(H,I,!1);var W=J.length,X=this.symlinks[z];if(X&&Q)return;for(var Z=0;Z<W;Z++){var q=J[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(J[Z],K);this._process(V,I,!0);var F=G.concat(J[Z],U);this._process(F,I,!0)}};T6.prototype._processSimple=function($,Y){var z=this._stat($);if(!this.matches[Y])this.matches[Y]=Object.create(null);if(!z)return;if($&&$A($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=jb.join(this.root,$);else if($=jb.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(Y,$)};T6.prototype._stat=function($){var Y=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Eb(this.cache,Y)){var J=this.cache[Y];if(Array.isArray(J))J="DIR";if(!z||J==="DIR")return J;if(z&&J==="FILE")return!1}var U,I=this.statCache[Y];if(!I){var Q;try{Q=this.fs.lstatSync(Y)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[Y]=!1,!1}if(Q&&Q.isSymbolicLink())try{I=this.fs.statSync(Y)}catch(K){I=Q}else I=Q}this.statCache[Y]=I;var J=!0;if(I)J=I.isDirectory()?"DIR":"FILE";if(this.cache[Y]=this.cache[Y]||J,z&&J==="FILE")return!1;return J};T6.prototype._mark=function($){return yz.mark(this,$)};T6.prototype._makeAbs=function($){return yz.makeAbs(this,$)}});var Cb=E((er1,CZ0)=>{CZ0.exports=EZ0;function EZ0($,Y){if($&&Y)return EZ0($)(Y);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){z[U]=$[U]}),z;f Line truncated
`);if($.linkname)Y+=ji(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var U in z)Y+=ji(" "+U+"="+z[U]+`
`);return Buffer.from(Y)};CZ1.decodePax=function($){var Y={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var U=parseInt($.slice(0,z).toString(),10);if(!U)return Y;var I=$.slice(z+1,U-1).toString(),Q=I.indexOf("=");if(Q===-1)return Y;Y[I.slice(0,Q)]=I.slice(Q+1),$=$.slice(U)}return Y};CZ1.encode=function($){var Y=wZ1(512),z=$.name,U="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var I=z.indexOf("/");if(I===-1)return null;U+=U?"/"+z.slice(0,I):z.slice(0,I),z=z.slice(I+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(Y.write(z),Y.write(D2($.mode&PZ1,6),100),Y.write(D2($.uid,6),108),Y.write(D2($.gid,6),116),Y.write(D2($.size,11),124),Y.write(D2($.mtime.getTime()/1000|0,11),136),Y[156]=cV0+jZ1($.type),$.linkname)Y.write($.linkname,157);if(nV0.copy(Y,xX),NZ1.copy(Y,Ei),$.uname)Y.write($.uname,265);if($.gname)Y.write($.gname,297);if(Y.write(D2($.devmajor||0,6),329),Y.write(D2($.devminor||0,6),337),U)Y.write(U,345);return Y.write(D2(dV0(Y),6),148),Y};CZ1.decode=function($,Y,z){var U=$[156]===0?0:$[156]-cV0,I=BJ($,0,100,Y),Q=A2($,100,8),J=A2($,108,8),K=A2($,116,8),G=A2($,124,12),H=A2($,136,12),W=TZ1(U),X=$[157]===0?null:BJ($,157,100,Y),Z=BJ($,265,32),q=BJ($,297,32),V=A2($,329,8),F=A2($,337,8),M=dV0($);if(M===256)return null;if(M!==A2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(nV0.compare($,xX,xX+6)===0){if($[345])I=BJ($,345,155,Y)+"/"+I}else if(DZ1.compare($,xX,xX+6)===0&&AZ1.compare($,Ei,Ei+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(U===0&&I&&I[I.length-1]==="/")U=5;return{name:I,mode:Q,uid:J,gid:K,size:G,mtime:new Date(1000*H),type:W,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var tV0=E((ls1,aV0)=>{var lV0=J0("util"),gZ1=iV0(),fX=Ci(),oV0=E8().Writable,rV0=E8().PassThrough,sV0=function(){},mV0=function($){return $&=511,$&&512-$},yZ1=function($,Y){var z=new NA($,Y);return z.end(),z},kZ1=function($,Y){if(Y.path)$.name=Y.path;if(Y.linkpath)$.linkname=Y.linkpath;if(Y.size)$.size=parseInt(Y.size,10);return $.pax=Y,$},NA=function($,Y){this._parent=$,this.offset=Y,rV0.call(this,{autoDestroy:!1})};lV0.inherits(NA,rV0);NA.prototype.destroy=function($){this._parent.destroy($)};var P3=function($){if(!(this instanceof P3))return new P3($);oV0.call(this,$),$=$||{},this._offset=0,this._buffer=gZ1(),this._missing=0,this._partial=!1,this._onparse=sV0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var Y=this,z=Y._buffer,U=function(){Y._continue()},I=function(Z){if(Y._locked=!1,Z)return Y.destroy(Z);if(!Y._stream)U()},Q=function(){Y._stream=null;var Z=mV0(Y._header.size);if(Z)Y._parse(Z,J);else Y._parse(512,X);if(!Y._locked)U()},J=function(){Y._buffer.consume(mV0(Y._header.size)),Y._parse(512,X),U()},K=function(){var Z=Y._header.size;Y._paxGlobal=fX.decodePax(z.slice(0,Z)),z.consume(Z),Q()},G=function(){var Z=Y._header.size;if(Y._pax=fX.decodePax(z.slice(0,Z)),Y._paxGlobal)Y._pax=Object.assign({},Y._paxGlobal,Y._pax);z.consume(Z),Q()},H=function(){var Z=Y._header.size;this._gnuLongPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),Q()},W=function(){var Z=Y._header.size;this._gnuLongLinkPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),Q()},X=function(){var Z=Y._offset,q;try{q=Y._header=fX.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){Y.emit("error",V)}if(z.consume(512),!q){Y._parse(512,X),U();return}if(q.type==="gnu-long-path"){Y._parse(q.size,H),U();return}if(q.type==="gnu-long-link-path"){Y._parse(q.size,W),U();return}if(q.type==="pax-global-header"){Y._parse(q.size,K),U();return}if(q.type==="pax-header"){Y._parse(q.size,G),U();return}if(Y._gnuLongPath)q.name=Y._gnuLongPath,Y._gnuLongPath=null;if(Y._gnuLongLinkPath)q.linkname=Y._gnuLongLinkPath,Y._gnuLongLinkPath=null;if(Y._pax)Y._header=q=kZ1(q,Y._pax),Y._pax=null;if(Y._locked=!0,!q.size||q.type==="directory"){Y._parse(512,X),Y.emit("entry",q,yZ1(Y,Z),I);return}Y._stream=new NA(Y,Z),Y.emit("entry",q,Y._stream,I),Y._parse(q.size,Q),U()};this._onheader=X,this._parse(512,X)};lV0.inherits(P3,oV0);P3.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};P3.prototype._parse=function($,Y){if(this._destroyed)return;if(this._offset+=$,this._missing=$,Y===this._onheader)this._partial=!1;this._onparse=Y};P3.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=sV0,this._overflow)this._write(this._overflow,void 0,$);else $()};P3.prototype._write=function($,Y,z){if(this._destroyed)return;var U=this._stream,I=this._buffer,Q=this._missing;if($.length)this._partial=!0;if($.length<Q) Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let Y=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${Yq1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${$.Target}"/>`);return Y}_writeClose(){this.stream.write("</Relationships>")}}BL0.exports=PL0});var _L0=E((Ua1,RL0)=>{var jL0=l6(),EL0=e7(),Uq1=i4(),Iq1=ix(),Qq1=nx();class CL0{constructor($,Y,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=Y}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:EL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let Y={Type:EL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(Y)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,Y){let z=new Iq1,U=new jL0;z.render(U,$),this.commentsStream.write(U.xml);let I=new Qq1,Q=new jL0;I.render(Q,$,Y),this.vmlStream.write(Q.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((Y)=>{Y.refAddress=Uq1.decodeAddress(Y.ref)}),$.forEach((Y)=>{this._writeComment(Y,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}RL0.exports=CL0});var kL0=E((Ia1,yL0)=>{var Jq1=Y6(),Kq1=e7(),vi=i4(),vL0=Jg(),hL0=$3(),Gq1=Nk(),SL0=TM(),hi=EM(),Hq1=TL0(),Wq1=_L0(),Xq1=Ig(),y6=new Gq1,Si=s7(),Zq1=Lx(),qq1=Fx(),Vq1=wx(),Lq1=Xx(),Fq1=Hx(),wq1=Zx(),Mq1=Mx(),Oq1=Ox(),Nq1=Nx(),Dq1=Dx(),Aq1=Ax(),Pq1=Px(),Bq1=Cx(),Tq1=Tx(),jq1=Bx(),k6={dataValidations:new Zq1,sheetProperties:new qq1,sheetFormatProperties:new Vq1,columns:new Si({tag:"cols",length:!1,childXform:new Lq1}),row:new Fq1,hyperlinks:new Si({tag:"hyperlinks",length:!1,childXform:new wq1}),sheetViews:new Si({tag:"sheetViews",length:!1,childXform:new Mq1}),sheetProtection:new Oq1,pageMargins:new Nq1,pageSeteup:new Dq1,autoFilter:new Aq1,picture:new Pq1,conditionalFormattings:new Bq1,headerFooter:new Tq1,rowBreaks:new jq1};class gL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new Hq1($),this._sheetCommentsWriter=new Wq1(this,this._sheetRelsWriter,$),this._dimensions=new hL0,this._rowZero=1,this.committed=!1,this.dataValidations=new Xq1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
See http://goo.gl/MqrFmX
`)},mi=li.getNativePromise();if(li.isNode&&typeof MutationObserver>"u")oi=global.setImmediate,ri=process.nextTick,dz=li.isRecentNode?function($){oi.call(global,$)}:function($){ri.call(process,$)};else if(typeof mi==="function"&&typeof mi.resolve==="function")si=mi.resolve(),dz=function($){si.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))dz=function(){var $=document.createElement("div"),Y={attributes:!0},z=!1,U=document.createElement("div"),I=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});I.observe(U,Y);var Q=function(){if(z)return;z=!0,U.classList.toggle("foo")};return function(K){var G=new MutationObserver(function(){G.disconnect(),K()});G.observe($,Y),Q()}}();else if(typeof setImmediate<"u")dz=function($){setImmediate($)};else if(typeof setTimeout<"u")dz=function($){setTimeout($,0)};else dz=oq1;var oi,ri,si;YF0.exports=dz});var IF0=E((us1,UF0)=>{function rq1($,Y,z,U,I){for(var Q=0;Q<I;++Q)z[Q+U]=$[Q+Y],$[Q+Y]=void 0}function T2($){this._capacity=$,this._length=0,this._front=0}T2.prototype._willBeOverCapacity=function($){return this._capacity<$};T2.prototype._pushOne=function($){var Y=this.length();this._checkCapacity(Y+1);var z=this._front+Y&this._capacity-1;this[z]=$,this._length=Y+1};T2.prototype.push=function($,Y,z){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(Y),this._pushOne(z);return}var I=this._front+U-3;this._checkCapacity(U);var Q=this._capacity-1;this[I+0&Q]=$,this[I+1&Q]=Y,this[I+2&Q]=z,this._length=U};T2.prototype.shift=function(){var $=this._front,Y=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,Y};T2.prototype.length=function(){return this._length};T2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};T2.prototype._resizeTo=function($){var Y=this._capacity;this._capacity=$;var z=this._front,U=this._length,I=z+U&Y-1;rq1(this,0,this,Y,I)};UF0.exports=T2});var XF0=E((bs1,ai)=>{var WF0;try{throw Error()}catch($){WF0=$}var sq1=zF0(),QF0=IF0(),HF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new QF0(16),this._normalQueue=new QF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=sq1}x6.prototype.setScheduler=function($){var Y=this._schedule;return this._schedule=$,this._customScheduler=!0,Y};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(HF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,Y){if(Y)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`)},ai=ti.getNativePromise();if(ti.isNode&&typeof MutationObserver>"u")ei=global.setImmediate,$c=process.nextTick,lz=ti.isRecentNode?function($){ei.call(global,$)}:function($){$c.call(process,$)};else if(typeof ai==="function"&&typeof ai.resolve==="function")Yc=ai.resolve(),lz=function($){Yc.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))lz=function(){var $=document.createElement("div"),Y={attributes:!0},z=!1,U=document.createElement("div"),I=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});I.observe(U,Y);var Q=function(){if(z)return;z=!0,U.classList.toggle("foo")};return function(K){var G=new MutationObserver(function(){G.disconnect(),K()});G.observe($,Y),Q()}}();else if(typeof setImmediate<"u")lz=function($){setImmediate($)};else if(typeof setTimeout<"u")lz=function($){setTimeout($,0)};else lz=wV1;var ei,$c,Yc;LF0.exports=lz});var MF0=E((Fa1,wF0)=>{function MV1($,Y,z,U,I){for(var Q=0;Q<I;++Q)z[Q+U]=$[Q+Y],$[Q+Y]=void 0}function T2($){this._capacity=$,this._length=0,this._front=0}T2.prototype._willBeOverCapacity=function($){return this._capacity<$};T2.prototype._pushOne=function($){var Y=this.length();this._checkCapacity(Y+1);var z=this._front+Y&this._capacity-1;this[z]=$,this._length=Y+1};T2.prototype.push=function($,Y,z){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(Y),this._pushOne(z);return}var I=this._front+U-3;this._checkCapacity(U);var Q=this._capacity-1;this[I+0&Q]=$,this[I+1&Q]=Y,this[I+2&Q]=z,this._length=U};T2.prototype.shift=function(){var $=this._front,Y=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,Y};T2.prototype.length=function(){return this._length};T2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};T2.prototype._resizeTo=function($){var Y=this._capacity;this._capacity=$;var z=this._front,U=this._length,I=z+U&Y-1;MV1(this,0,this,Y,I)};wF0.exports=T2});var TF0=E((wa1,zc)=>{var PF0;try{throw Error()}catch($){PF0=$}var OV1=FF0(),OF0=MF0(),BF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new OF0(16),this._normalQueue=new OF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=OV1}x6.prototype.setScheduler=function($){var Y=this._schedule;return this._schedule=$,this._customScheduler=!0,Y};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(BF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,Y){if(Y)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};x6.prototype.throwLater=function($,Y){if(arguments.length===1)Y=$,$=function(){throw Y};if(typeof setTimeout<"u")setTimeout(function(){$(Y)},0);else try{this._schedule(function(){$(Y)})}catch(z){throw Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function JF0($,Y,z){this._lateQueue.push($,Y,z),this._queueTick()}function KF0($,Y,z){this._normalQueue.push($,Y,z),this._queueTick()}function GF0($){this._normalQueue._pushOne($),this._queueTick()}if(!HF0.hasDevTools)x6.prototype.invokeLater=JF0,x6.prototype.invoke=KF0,x6.prototype.settlePromises=GF0;else x6.prototype.invokeLater=function($,Y,z){if(this._trampolineEnabled)JF0.call(this,$,Y,z);else this._schedule(function(){setTimeout(function(){$.call(Y,z)},100)})},x6.prototype.invoke=function($,Y,z){if(this._trampolineEnabled)KF0.call(this,$,Y,z);else this._schedule(function(){$.call(Y,z)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)GF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var Y=$.shift();if(typeof Y!=="function"){Y._settlePromises();continue}var z=$.shift(),U=$.shift();Y.call(z,U)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};ai.exports=x6;ai.exports.firstLineError=WF0});var T3=E((is1,VF0)=>{var $c=pz(),aq1=$c.freeze,ZF0=F4(),qF0=ZF0.inherits,EJ=ZF0.notEnumerableProp;function CJ($,Y){function z(U){if(!(this instanceof z))return new z(U);if(EJ(this,"message",typeof U==="string"?U:Y),EJ(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return qF0(z,Error),z}var ti,ei,tq1=CJ("Warning","warning"),eq1=CJ("CancellationError","cancellation error"),$V1=CJ("TimeoutError","timeout error"),iX=CJ("AggregateError","aggregate error");try{ti=TypeError,ei=RangeError}catch($){ti=CJ("TypeError","type error"),ei=CJ("RangeError","range error")}var AP="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(mz=0;mz<AP.length;++mz)if(typeof Array.prototype[AP[mz]]==="function")iX.prototype[AP[mz]]=Array.prototype[AP[mz]];var mz;$c.defineProperty(iX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});iX.prototype.isOperational=!0;var TP=0;iX.prototype.toString=function(){var $=Array(TP*4+1).join(" "),Y=`
`)}};function NF0($,Y,z){this._lateQueue.push($,Y,z),this._queueTick()}function DF0($,Y,z){this._normalQueue.push($,Y,z),this._queueTick()}function AF0($){this._normalQueue._pushOne($),this._queueTick()}if(!BF0.hasDevTools)x6.prototype.invokeLater=NF0,x6.prototype.invoke=DF0,x6.prototype.settlePromises=AF0;else x6.prototype.invokeLater=function($,Y,z){if(this._trampolineEnabled)NF0.call(this,$,Y,z);else this._schedule(function(){setTimeout(function(){$.call(Y,z)},100)})},x6.prototype.invoke=function($,Y,z){if(this._trampolineEnabled)DF0.call(this,$,Y,z);else this._schedule(function(){$.call(Y,z)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)AF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var Y=$.shift();if(typeof Y!=="function"){Y._settlePromises();continue}var z=$.shift(),U=$.shift();Y.call(z,U)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};zc.exports=x6;zc.exports.firstLineError=PF0});var T3=E((Ma1,CF0)=>{var Qc=mz(),NV1=Qc.freeze,jF0=F4(),EF0=jF0.inherits,RJ=jF0.notEnumerableProp;function _J($,Y){function z(U){if(!(this instanceof z))return new z(U);if(RJ(this,"message",typeof U==="string"?U:Y),RJ(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return EF0(z,Error),z}var Uc,Ic,DV1=_J("Warning","warning"),AV1=_J("CancellationError","cancellation error"),PV1=_J("TimeoutError","timeout error"),pX=_J("AggregateError","aggregate error");try{Uc=TypeError,Ic=RangeError}catch($){Uc=_J("TypeError","type error"),Ic=_J("RangeError","range error")}var RA="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(oz=0;oz<RA.length;++oz)if(typeof Array.prototype[RA[oz]]==="function")pX.prototype[RA[oz]]=Array.prototype[RA[oz]];var oz;Qc.defineProperty(pX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});pX.prototype.isOperational=!0;var _A=0;pX.prototype.toString=function(){var $=Array(_A*4+1).join(" "),Y=`
`+$+`AggregateError of:
`;TP++,$=Array(TP*4+1).join(" ");for(var z=0;z<this.length;++z){var U=this[z]===this?"[Circular AggregateError]":this[z]+"",I=U.split(`
`;_A++,$=Array(_A*4+1).join(" ");for(var z=0;z<this.length;++z){var U=this[z]===this?"[Circular AggregateError]":this[z]+"",I=U.split(`
`);for(var Q=0;Q<I.length;++Q)I[Q]=$+I[Q];U=I.join(`
`),Y+=U+`
`}return TP--,Y};function bX($){if(!(this instanceof bX))return new bX($);if(EJ(this,"name","OperationalError"),EJ(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)EJ(this,"message",$.message),EJ(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}qF0(bX,Error);var lz=Error.__BluebirdErrorTypes__;if(!lz)lz=aq1({CancellationError:eq1,TimeoutError:$V1,OperationalError:bX,RejectionError:bX,AggregateError:iX}),$c.defineProperty(Error,"__BluebirdErrorTypes__",{value:lz,writable:!1,enumerable:!1,configurable:!1});VF0.exports={Error,TypeError:ti,RangeError:ei,CancellationError:lz.CancellationError,OperationalError:lz.OperationalError,TimeoutError:lz.TimeoutError,AggregateError:lz.AggregateError,Warning:tq1}});var FF0=E((cs1,LF0)=>{LF0.exports=function($,Y){var z=F4(),U=z.errorObj,I=z.isObject;function Q(X,Z){if(I(X)){if(X instanceof $)return X;var q=K(X);if(q===U){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(W(X)){var V=new $(Y);return X._then(V._fulfill,V._reject,void 0,V,null),V}return H(X,q,Z)}}return X}function J(X){return X.then}function K(X){try{return J(X)}catch(Z){return U.e=Z,U}}var G={}.hasOwnProperty;function W(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function H(X,Z,q){var V=new $(Y),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var M=!0,w=z.tryCatch(Z).call(X,O,D);if(M=!1,V&&w===U)V._rejectCallback(w.e,!0,!0),V=null;function O(N){if(!V)return;V._resolveCallback(N),V=null}function D(N){if(!V)return;V._rejectCallback(N,M,!0),V=null}return F}return Q}});var MF0=E((ns1,wF0)=>{wF0.exports=function($,Y,z,U,I){var Q=F4(),J=Q.isArray;function K(W){switch(W){case-2:return[];case-3:return{}}}function G(W){var H=this._promise=new $(Y);if(W instanceof $)H._propagateFrom(W,3);H._setOnCancel(this),this._values=W,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Q.inherits(G,I),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function W(H,X){var Z=z(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(W,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=Q.asArray(Z),Z===null){var V=U("expecting an array or an iterable object but got "+Q.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(K(X));return}this._iterate(Z)},G.prototype._iterate=function(W){var H=this.getActualLength(W.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<H;++V){var F=z(W[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(W){this._values=null,this._promise._fulfill(W)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(W){this._values=null,this._promise._rejectCallback(W,!1)},G.prototype._promiseFulfilled=function(W,H){this._values[H]=W;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(W){return this._totalResolved++,this._reject(W),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var W=this._values;if(this._cancel(),W instanceof $)W.cancel();else for(var H=0;H<W.length;++H)if(W[H]instanceof $)W[H].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(W){return W},G}});var NF0=E((ps1,OF0)=>{OF0.exports=function($){var Y=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(Q())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var J=z.pop(),K=J._promiseCreated;return J._promiseCreated=null,K}return null};function I(){if(Y)return new U}function Q(){var J=z.length-1;if(J>=0)return z[J];return}return U.CapturedTrace=null,U.create=I,U.deactivateLong Line truncated
`}return _A--,Y};function nX($){if(!(this instanceof nX))return new nX($);if(RJ(this,"name","OperationalError"),RJ(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)RJ(this,"message",$.message),RJ(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}EF0(nX,Error);var rz=Error.__BluebirdErrorTypes__;if(!rz)rz=NV1({CancellationError:AV1,TimeoutError:PV1,OperationalError:nX,RejectionError:nX,AggregateError:pX}),Qc.defineProperty(Error,"__BluebirdErrorTypes__",{value:rz,writable:!1,enumerable:!1,configurable:!1});CF0.exports={Error,TypeError:Uc,RangeError:Ic,CancellationError:rz.CancellationError,OperationalError:rz.OperationalError,TimeoutError:rz.TimeoutError,AggregateError:rz.AggregateError,Warning:DV1}});var _F0=E((Oa1,RF0)=>{RF0.exports=function($,Y){var z=F4(),U=z.errorObj,I=z.isObject;function Q(X,Z){if(I(X)){if(X instanceof $)return X;var q=K(X);if(q===U){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(H(X)){var V=new $(Y);return X._then(V._fulfill,V._reject,void 0,V,null),V}return W(X,q,Z)}}return X}function J(X){return X.then}function K(X){try{return J(X)}catch(Z){return U.e=Z,U}}var G={}.hasOwnProperty;function H(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function W(X,Z,q){var V=new $(Y),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var M=!0,w=z.tryCatch(Z).call(X,O,D);if(M=!1,V&&w===U)V._rejectCallback(w.e,!0,!0),V=null;function O(N){if(!V)return;V._resolveCallback(N),V=null}function D(N){if(!V)return;V._rejectCallback(N,M,!0),V=null}return F}return Q}});var hF0=E((Na1,vF0)=>{vF0.exports=function($,Y,z,U,I){var Q=F4(),J=Q.isArray;function K(H){switch(H){case-2:return[];case-3:return{}}}function G(H){var W=this._promise=new $(Y);if(H instanceof $)W._propagateFrom(H,3);W._setOnCancel(this),this._values=H,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Q.inherits(G,I),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function H(W,X){var Z=z(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(H,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=Q.asArray(Z),Z===null){var V=U("expecting an array or an iterable object but got "+Q.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(K(X));return}this._iterate(Z)},G.prototype._iterate=function(H){var W=this.getActualLength(H.length);this._length=W,this._values=this.shouldCopyValues()?Array(W):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<W;++V){var F=z(H[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(H){this._values=null,this._promise._fulfill(H)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(H){this._values=null,this._promise._rejectCallback(H,!1)},G.prototype._promiseFulfilled=function(H,W){this._values[W]=H;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(H){return this._totalResolved++,this._reject(H),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var H=this._values;if(this._cancel(),H instanceof $)H.cancel();else for(var W=0;W<H.length;++W)if(H[W]instanceof $)H[W].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(H){return H},G}});var gF0=E((Da1,SF0)=>{SF0.exports=function($){var Y=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(Q())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var J=z.pop(),K=J._promiseCreated;return J._promiseCreated=null,K}return null};function I(){if(Y)return new U}function Q(){var J=z.length-1;if(J>=0)return z[J];return}return U.CapturedTrace=null,U.create=I,U.deactivateLong Line truncated
See http://goo.gl/MqrFmX
`);if(!P0.longStackTraces&&f0()){var I0=$.prototype._captureStackTrace,B=$.prototype._attachExtraTrace;P0.longStackTraces=!0,N=function(){if(U.haveItemsQueued()&&!P0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
`);if(!A0.longStackTraces&&f0()){var I0=$.prototype._captureStackTrace,P=$.prototype._attachExtraTrace;A0.longStackTraces=!0,N=function(){if(U.haveItemsQueued()&&!A0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=I0,$.prototype._attachExtraTrace=B,Y.deactivateLongStackTraces(),U.enableTrampoline(),P0.longStackTraces=!1},$.prototype._captureStackTrace=g,$.prototype._attachExtraTrace=p,Y.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return P0.longStackTraces&&f0()};var A=function(){try{if(typeof CustomEvent==="function"){var I0=new CustomEvent("CustomEvent");return Q.global.dispatchEvent(I0),function(B,v){var u=new CustomEvent(B.toLowerCase(),{detail:v,cancelable:!0});return!Q.global.dispatchEvent(u)}}else if(typeof Event==="function"){var I0=new Event("CustomEvent");return Q.global.dispatchEvent(I0),function(v,u){var r=new Event(v.toLowerCase(),{cancelable:!0});return r.detail=u,!Q.global.dispatchEvent(r)}}else{var I0=document.createEvent("CustomEvent");return I0.initCustomEvent("testingtheevent",!1,!0,{}),Q.global.dispatchEvent(I0),function(v,u){var r=document.createEvent("CustomEvent");return r.initCustomEvent(v.toLowerCase(),!1,!0,u),!Q.global.dispatchEvent(r)}}}catch(B){}return function(){return!1}}(),T=function(){if(Q.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Q.global)return function(){return!1};return function(I0){var B="on"+I0.toLowerCase(),v=Q.global[B];if(!v)return!1;return v.apply(Q.global,[].slice.call(arguments,1)),!0}}}();function P(I0,B){return{promise:B}}var j={promiseCreated:P,promiseFulfilled:P,promiseRejected:P,promiseResolved:P,promiseCancelled:P,promiseChained:function(I0,B,v){return{promise:B,child:v}},warning:function(I0,B){return{warning:B}},unhandledRejection:function(I0,B,v){return{reason:B,promise:v}},rejectionHandled:P},C=function(I0){var B=!1;try{B=T.apply(null,arguments)}catch(u){U.throwLater(u),B=!0}var v=!1;try{v=A(I0,j[I0].apply(null,arguments))}catch(u){U.throwLater(u),v=!0}return v||B};$.config=function(I0){if(I0=Object(I0),"longStackTraces"in I0){if(I0.longStackTraces)$.longStackTraces();else if(!I0.longStackTraces&&$.hasLongStackTraces())N()}if("warnings"in I0){var B=I0.warnings;if(P0.warnings=!!B,D=P0.warnings,Q.isObject(B)){if("wForgottenReturn"in B)D=!!B.wForgottenReturn}}if("cancellation"in I0&&I0.cancellation&&!P0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=U0,$.prototype._propagateFrom=x,$.prototype._onCancel=i,$.prototype._setOnCancel=c,$.prototype._attachCancellationCallback=h,$.prototype._execute=k,t=x,P0.cancellation=!0}if("monitoring"in I0){if(I0.monitoring&&!P0.monitoring)P0.monitoring=!0,$.prototype._fireEvent=C;else if(!I0.monitoring&&P0.monitoring)P0.monitoring=!1,$.prototype._fireEvent=b}return $};function b(){return!1}$.prototype._fireEvent=b,$.prototype._execute=function(I0,B,v){try{I0(B,v)}catch(u){return u}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(I0){},$.prototype._attachCancellationCallback=function(I0){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(I0,B){};function k(I0,B,v){var u=this;try{I0(B,v,function(r){if(typeof r!=="function")throw TypeError("onCancel must be a function, got: "+Q.toString(r));u._attachCancellationCallback(r)})}catch(r){return r}}function h(I0){if(!this._isCancellable())return this;var B=this._onCancel();if(B!==void 0)if(Q.isArray(B))B.push(I0);else this._setOnCancel([B,I0]);else this._setOnCancel(I0)}function i(){return this._onCancelField}function c(I0){this._onCancelField=I0}function U0(){this._cancellationParent=void 0,this._onCancelField=void 0}function x(I0,B){if((B&1)!==0){this._cancellationParent=I0;var v=I0._branchesRemainingToCancel;if(v===void 0)v=0;I0._branchesRemainingToCancel=v+1}if((B&2)!==0&&I0._isBound())this._setBoundTo(I0._boundTo)}function d(I0,B){if((B&2)!==0&&I0._isBound())this._setBoundTo(I0._boundTo)}var t=d;function $0(){var I0=this._boundTo;if(I0!==void 0){if(I0 instanceof $)if(I0.isFulfilled())return I0.value();else return}return I0}function g(){this._trace=new u1(this._peekContext())}function p(I0,B){if(J(I0)){var v=this._trace;if(v!==void 0){if(B)v=v._parent}if(v!==void 0)v.attachExtraTrace(I0);else if(!I0.__stackCleaned__){var u=b0(I0);Q.notEnumerableProp(I0,"stack",u.message+`
`);$.prototype._captureStackTrace=I0,$.prototype._attachExtraTrace=P,Y.deactivateLongStackTraces(),U.enableTrampoline(),A0.longStackTraces=!1},$.prototype._captureStackTrace=g,$.prototype._attachExtraTrace=p,Y.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return A0.longStackTraces&&f0()};var B=function(){try{if(typeof CustomEvent==="function"){var I0=new CustomEvent("CustomEvent");return Q.global.dispatchEvent(I0),function(P,v){var u=new CustomEvent(P.toLowerCase(),{detail:v,cancelable:!0});return!Q.global.dispatchEvent(u)}}else if(typeof Event==="function"){var I0=new Event("CustomEvent");return Q.global.dispatchEvent(I0),function(v,u){var r=new Event(v.toLowerCase(),{cancelable:!0});return r.detail=u,!Q.global.dispatchEvent(r)}}else{var I0=document.createEvent("CustomEvent");return I0.initCustomEvent("testingtheevent",!1,!0,{}),Q.global.dispatchEvent(I0),function(v,u){var r=document.createEvent("CustomEvent");return r.initCustomEvent(v.toLowerCase(),!1,!0,u),!Q.global.dispatchEvent(r)}}}catch(P){}return function(){return!1}}(),T=function(){if(Q.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Q.global)return function(){return!1};return function(I0){var P="on"+I0.toLowerCase(),v=Q.global[P];if(!v)return!1;return v.apply(Q.global,[].slice.call(arguments,1)),!0}}}();function A(I0,P){return{promise:P}}var j={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(I0,P,v){return{promise:P,child:v}},warning:function(I0,P){return{warning:P}},unhandledRejection:function(I0,P,v){return{reason:P,promise:v}},rejectionHandled:A},C=function(I0){var P=!1;try{P=T.apply(null,arguments)}catch(u){U.throwLater(u),P=!0}var v=!1;try{v=B(I0,j[I0].apply(null,arguments))}catch(u){U.throwLater(u),v=!0}return v||P};$.config=function(I0){if(I0=Object(I0),"longStackTraces"in I0){if(I0.longStackTraces)$.longStackTraces();else if(!I0.longStackTraces&&$.hasLongStackTraces())N()}if("warnings"in I0){var P=I0.warnings;if(A0.warnings=!!P,D=A0.warnings,Q.isObject(P)){if("wForgottenReturn"in P)D=!!P.wForgottenReturn}}if("cancellation"in I0&&I0.cancellation&&!A0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=U0,$.prototype._propagateFrom=x,$.prototype._onCancel=i,$.prototype._setOnCancel=c,$.prototype._attachCancellationCallback=h,$.prototype._execute=k,t=x,A0.cancellation=!0}if("monitoring"in I0){if(I0.monitoring&&!A0.monitoring)A0.monitoring=!0,$.prototype._fireEvent=C;else if(!I0.monitoring&&A0.monitoring)A0.monitoring=!1,$.prototype._fireEvent=b}return $};function b(){return!1}$.prototype._fireEvent=b,$.prototype._execute=function(I0,P,v){try{I0(P,v)}catch(u){return u}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(I0){},$.prototype._attachCancellationCallback=function(I0){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(I0,P){};function k(I0,P,v){var u=this;try{I0(P,v,function(r){if(typeof r!=="function")throw TypeError("onCancel must be a function, got: "+Q.toString(r));u._attachCancellationCallback(r)})}catch(r){return r}}function h(I0){if(!this._isCancellable())return this;var P=this._onCancel();if(P!==void 0)if(Q.isArray(P))P.push(I0);else this._setOnCancel([P,I0]);else this._setOnCancel(I0)}function i(){return this._onCancelField}function c(I0){this._onCancelField=I0}function U0(){this._cancellationParent=void 0,this._onCancelField=void 0}function x(I0,P){if((P&1)!==0){this._cancellationParent=I0;var v=I0._branchesRemainingToCancel;if(v===void 0)v=0;I0._branchesRemainingToCancel=v+1}if((P&2)!==0&&I0._isBound())this._setBoundTo(I0._boundTo)}function d(I0,P){if((P&2)!==0&&I0._isBound())this._setBoundTo(I0._boundTo)}var t=d;function $0(){var I0=this._boundTo;if(I0!==void 0){if(I0 instanceof $)if(I0.isFulfilled())return I0.value();else return}return I0}function g(){this._trace=new u1(this._peekContext())}function p(I0,P){if(J(I0)){var v=this._trace;if(v!==void 0){if(P)v=v._parent}if(v!==void 0)v.attachExtraTrace(I0);else if(!I0.__stackCleaned__){var u=b0(I0);Q.notEnumerableProp(I0,"stack",u.message+`
`+u.stack.join(`
`)),Q.notEnumerableProp(I0,"__stackCleaned__",!0)}}}function e(I0,B,v,u,r){if(I0===void 0&&B!==null&&D){if(r!==void 0&&r._returnedNonUndefined())return;if((u._bitField&65535)===0)return;if(v)v=v+" ";var X0="",Q0="";if(B._trace){var Z0=B._trace.stack.split(`
`),O0=G0(Z0);for(var B0=O0.length-1;B0>=0;--B0){var r0=O0[B0];if(!H.test(r0)){var J1=r0.match(X);if(J1)X0="at "+J1[1]+":"+J1[2]+":"+J1[3]+" ";break}}if(O0.length>0){var U1=O0[0];for(var B0=0;B0<Z0.length;++B0)if(Z0[B0]===U1){if(B0>0)Q0=`
`+Z0[B0-1];break}}}var N1="a promise was created in a "+v+"handler "+X0+"but was not returned from it, see http://goo.gl/rRqMUw"+Q0;u._warn(N1,!0,B)}}function y(I0,B){var v=I0+" is deprecated and will be removed in a future version.";if(B)v+=" Use "+B+" instead.";return s(v)}function s(I0,B,v){if(!P0.warnings)return;var u=new I(I0),r;if(B)v._attachExtraTrace(u);else if(P0.longStackTraces&&(r=$._peekContext()))r.attachExtraTrace(u);else{var X0=b0(u);u.stack=X0.message+`
`)),Q.notEnumerableProp(I0,"__stackCleaned__",!0)}}}function e(I0,P,v,u,r){if(I0===void 0&&P!==null&&D){if(r!==void 0&&r._returnedNonUndefined())return;if((u._bitField&65535)===0)return;if(v)v=v+" ";var X0="",Q0="";if(P._trace){var Z0=P._trace.stack.split(`
`),O0=G0(Z0);for(var P0=O0.length-1;P0>=0;--P0){var r0=O0[P0];if(!W.test(r0)){var J1=r0.match(X);if(J1)X0="at "+J1[1]+":"+J1[2]+":"+J1[3]+" ";break}}if(O0.length>0){var U1=O0[0];for(var P0=0;P0<Z0.length;++P0)if(Z0[P0]===U1){if(P0>0)Q0=`
`+Z0[P0-1];break}}}var N1="a promise was created in a "+v+"handler "+X0+"but was not returned from it, see http://goo.gl/rRqMUw"+Q0;u._warn(N1,!0,P)}}function y(I0,P){var v=I0+" is deprecated and will be removed in a future version.";if(P)v+=" Use "+P+" instead.";return s(v)}function s(I0,P,v){if(!A0.warnings)return;var u=new I(I0),r;if(P)v._attachExtraTrace(u);else if(A0.longStackTraces&&(r=$._peekContext()))r.attachExtraTrace(u);else{var X0=b0(u);u.stack=X0.message+`
`+X0.stack.join(`
`)}if(!C("warning",u))Y1(u,"",!0)}function Y0(I0,B){for(var v=0;v<B.length-1;++v)B[v].push("From previous event:"),B[v]=B[v].join(`
`);if(v<B.length)B[v]=B[v].join(`
`)}if(!C("warning",u))Y1(u,"",!0)}function Y0(I0,P){for(var v=0;v<P.length-1;++v)P[v].push("From previous event:"),P[v]=P[v].join(`
`);if(v<P.length)P[v]=P[v].join(`
`);return I0+`
`+B.join(`
`)}function M0(I0){for(var B=0;B<I0.length;++B)if(I0[B].length===0||B+1<I0.length&&I0[B][0]===I0[B+1][0])I0.splice(B,1),B--}function E0(I0){var B=I0[0];for(var v=1;v<I0.length;++v){var u=I0[v],r=B.length-1,X0=B[r],Q0=-1;for(var Z0=u.length-1;Z0>=0;--Z0)if(u[Z0]===X0){Q0=Z0;break}for(var Z0=Q0;Z0>=0;--Z0){var O0=u[Z0];if(B[r]===O0)B.pop(),r--;else break}B=u}}function G0(I0){var B=[];for(var v=0;v<I0.length;++v){var u=I0[v],r=u===" (No stack trace)"||Z.test(u),X0=r&&u0(u);if(r&&!X0){if(V&&u.charAt(0)!==" ")u=" "+u;B.push(u)}}return B}function T0(I0){var B=I0.stack.replace(/\s+$/g,"").split(`
`);for(var v=0;v<B.length;++v){var u=B[v];if(u===" (No stack trace)"||Z.test(u))break}if(v>0&&I0.name!="SyntaxError")B=B.slice(v);return B}function b0(I0){var B=I0.stack,v=I0.toString();return B=typeof B==="string"&&B.length>0?T0(I0):[" (No stack trace)"],{message:v,stack:I0.name=="SyntaxError"?B:G0(B)}}function Y1(I0,B,v){if(typeof console<"u"){var u;if(Q.isObject(I0)){var r=I0.stack;u=B+q(r,I0)}else u=B+String(I0);if(typeof F==="function")F(u,v);else if(typeof console.log==="function"||typeof console.log==="object")console.log(u)}}function a(I0,B,v,u){var r=!1;try{if(typeof B==="function")if(r=!0,I0==="rejectionHandled")B(u);else B(v,u)}catch(X0){U.throwLater(X0)}if(I0==="unhandledRejection"){if(!C(I0,v,u)&&!r)Y1(v,"Unhandled rejection ")}else C(I0,u)}function H0(I0){var B;if(typeof I0==="function")B="[function "+(I0.name||"anonymous")+"]";else{B=I0&&typeof I0.toString==="function"?I0.toString():Q.toString(I0);var v=/\[object [a-zA-Z0-9$_]+\]/;if(v.test(B))try{var u=JSON.stringify(I0);B=u}catch(r){}if(B.length===0)B="(empty array)"}return"(<"+F0(B)+">, no stack trace)"}function F0(I0){var B=41;if(I0.length<B)return I0;return I0.substr(0,B-3)+"..."}function f0(){return typeof b1==="function"}var u0=function(){return!1},i0=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function D1(I0){var B=I0.match(i0);if(B)return{fileName:B[1],line:parseInt(B[2],10)}}function k1(I0,B){if(!f0())return;var v=I0.stack.split(`
`),u=B.stack.split(`
`),r=-1,X0=-1,Q0,Z0;for(var O0=0;O0<v.length;++O0){var B0=D1(v[O0]);if(B0){Q0=B0.fileName,r=B0.line;break}}for(var O0=0;O0<u.length;++O0){var B0=D1(u[O0]);if(B0){Z0=B0.fileName,X0=B0.line;break}}if(r<0||X0<0||!Q0||!Z0||Q0!==Z0||r>=X0)return;u0=function(r0){if(W.test(r0))return!0;var J1=D1(r0);if(J1){if(J1.fileName===Q0&&(r<=J1.line&&J1.line<=X0))return!0}return!1}}function u1(I0){this._parent=I0,this._promisesCreated=0;var B=this._length=1+(I0===void 0?0:I0._length);if(b1(this,u1),B>32)this.uncycle()}Q.inherits(u1,Error),Y.CapturedTrace=u1,u1.prototype.uncycle=function(){var I0=this._length;if(I0<2)return;var B=[],v={};for(var u=0,r=this;r!==void 0;++u)B.push(r),r=r._parent;I0=this._length=u;for(var u=I0-1;u>=0;--u){var X0=B[u].stack;if(v[X0]===void 0)v[X0]=u}for(var u=0;u<I0;++u){var Q0=B[u].stack,Z0=v[Q0];if(Z0!==void 0&&Z0!==u){if(Z0>0)B[Z0-1]._parent=void 0,B[Z0-1]._length=1;B[u]._parent=void 0,B[u]._length=1;var O0=u>0?B[u-1]:this;if(Z0<I0-1)O0._parent=B[Z0+1],O0._parent.uncycle(),O0._length=O0._parent._length+1;else O0._parent=void 0,O0._length=1;var B0=O0._length+1;for(var r0=u-2;r0>=0;--r0)B[r0]._length=B0,B0++;return}}},u1.prototype.attachExtraTrace=function(I0){if(I0.__stackCleaned__)return;this.uncycle();var B=b0(I0),v=B.message,u=[B.stack],r=this;while(r!==void 0)u.push(G0(r.stack.split(`
`))),r=r._parent;E0(u),M0(u),Q.notEnumerableProp(I0,"stack",Y0(v,u)),Q.notEnumerableProp(I0,"__stackCleaned__",!0)};var b1=function(){var B=/^\s*at\s*/,v=function(Q0,Z0){if(typeof Q0==="string")return Q0;if(Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return H0(Z0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,Z=B,q=v;var u=Error.captureStackTrace;return u0=function(Q0){return W.test(Q0)},function(Q0,Z0){Error.stackTraceLimit+=6,u(Q0,Z0),Error.stackTraceLimit-=6}}var r=Error();if(typeof r.stack==="string"&&r.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,q=v,V=!0,function(Z0){Z0.stack=Error().stack};var X0;try{throw Error()}catch(Q0){X0="stack"in Q0}if(!("stack"in r)&&X0&&typeof Error.stackTraceLimit==="number")return Z=B,q=v,function(Z0){Error.stackTraceLimit+=6;try{throw Error()}catch(O0){Z0.stack=O0.stack}Error.stackTraceLimit-=6};return q=function(Q0,Z0){if(typeof Q0==="string")return Q0;if((typeof Z0==="object"||typeof Z0==="function")&&Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return H0(Z0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(F=function(I0){console.warn(I0)},Q.isNode&&process.stderr.isTTY)F=function(I0,B){var v=B?"\x1B[33m":"\x1B[31m";console.warn(v+I0+`\x1B[0m
`)};else if(!Q.isNode&&typeof Error().stack==="string")F=function(I0,B){console.warn("%c"+I0,B?"color: darkorange":"color: red")}}var P0={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};if(O)$.longStackTraces();return{longStackTraces:function(){return P0.longStackTraces},warnings:function(){return P0.warnings},cancellation:function(){return P0.cancellation},monitoring:function(){return P0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:A,fireGlobalEvent:T}}});var AF0=E((ms1,BF0)=>{BF0.exports=function($,Y){var z=F4(),U=$.CancellationError,I=z.errorObj;function Q(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}Q.prototype.isFinallyHandler=function(){return this.type===0};function J(X){this.finallyHandler=X}J.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return H.call(this,this.promise._target()._settledValue())}function W(X){if(K(this,X))return;return I.e=X,I}function H(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=Y(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var M=new U("late cancellation observer");return Z._attachExtraTrace(M),I.e=M,I}else if(F.isPending())F._attachCancellationCallback(new J(this))}return F._then(G,W,void 0,this,void 0)}}}if(Z.isRejected())return K(this),I.e=X,I;else return K(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new Q(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,H,H)},$.prototype.tap=function(X){return this._passThrough(X,1,H)},Q}});var jF0=E((ls1,TF0)=>{TF0.exports=function($){var Y=F4(),z=pz().keys,U=Y.tryCatch,I=Y.errorObj;function Q(J,K,G){return function(W){var H=G._boundValue();$:for(var X=0;X<J.length;++X){var Z=J[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(W instanceof Z)return U(K).call(H,W)}else if(typeof Z==="function"){var q=U(Z).call(H,W);if(q===I)return q;else if(q)return U(K).call(H,W)}else if(Y.isObject(W)){var V=z(Z);for(var F=0;F<V.length;++F){var M=V[F];if(Z[M]!=W[M])continue $}return U(K).call(H,W)}}return $}}return Q}});var Yc=E((os1,RF0)=>{var EF0=F4(),YV1=EF0.maybeWrapAsError,zV1=T3(),UV1=zV1.OperationalError,CF0=pz();function IV1($){return $ instanceof Error&&CF0.getPrototypeOf($)===Error.prototype}var QV1=/^(?:name|message|stack|cause)$/;function JV1($){var Y;if(IV1($)){Y=new UV1($),Y.name=$.name,Y.message=$.message,Y.stack=$.stack;var z=CF0.keys($);for(var U=0;U<z.length;++U){var I=z[U];if(!QV1.test(I))Y[I]=$[I]}return Y}return EF0.markAsOriginatingFromRejection($),$}function KV1($,Y){return function(z,U){if($===null)return;if(z){var I=JV1(YV1(z));$._attachExtraTrace(I),$._reject(I)}else if(!Y)$._fulfill(U);else{var Q=arguments.length,J=Array(Math.max(Q-1,0));for(var K=1;K<Q;++K)J[K-1]=arguments[K];$._fulfill(J)}$=null}}RF0.exports=KV1});var vF0=E((rs1,_F0)=>{_F0.exports=function($,Y,z,U,I){var Q=F4(),J=Q.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+Q.classString(K));return function(){var G=new $(Y);G._captureStackTrace(),G._pushContext();var W=J(K).apply(this,arguments),H=G._popContext();return I.checkForgottenReturns(W,H,"Promise.method",G),G._resolveFromSyncValue(W),G}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+Q.classString(K));var G=new $(Y);G._captureStackTrace(),G._pushContext();var W;if(arguments.length>1){I.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],X=arguments[2];W=Q.isArray(H)?J(K).apply(X,H):J(K).call(X,H)}else W=J(K)();var Z=G._popContext();return I.checkForgottenReturns(W,Z,"Promise.try",G),G._resolveFromSyncValue(W),G},$.prototype._resolveFromSyncValue=function(K){if(K===Q.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var SF0=E((ss1,hF0)=>{hF0.exports=function($,Y,z,U){var I=!1,Q=function(W,H){this._reject(H)},J=function(W,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(Q,Q,null,this,W)},K=function(W,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},G=function(W,H){if(!H.promiseRejectionQueued)this._reject(W)};$.prototype.bind=function(W){if(!I)I=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var H=z(W),X=new $(Y);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(H),H instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:H};Z._then(Y,J,voi Line truncated
`+P.join(`
`)}function M0(I0){for(var P=0;P<I0.length;++P)if(I0[P].length===0||P+1<I0.length&&I0[P][0]===I0[P+1][0])I0.splice(P,1),P--}function E0(I0){var P=I0[0];for(var v=1;v<I0.length;++v){var u=I0[v],r=P.length-1,X0=P[r],Q0=-1;for(var Z0=u.length-1;Z0>=0;--Z0)if(u[Z0]===X0){Q0=Z0;break}for(var Z0=Q0;Z0>=0;--Z0){var O0=u[Z0];if(P[r]===O0)P.pop(),r--;else break}P=u}}function G0(I0){var P=[];for(var v=0;v<I0.length;++v){var u=I0[v],r=u===" (No stack trace)"||Z.test(u),X0=r&&u0(u);if(r&&!X0){if(V&&u.charAt(0)!==" ")u=" "+u;P.push(u)}}return P}function T0(I0){var P=I0.stack.replace(/\s+$/g,"").split(`
`);for(var v=0;v<P.length;++v){var u=P[v];if(u===" (No stack trace)"||Z.test(u))break}if(v>0&&I0.name!="SyntaxError")P=P.slice(v);return P}function b0(I0){var P=I0.stack,v=I0.toString();return P=typeof P==="string"&&P.length>0?T0(I0):[" (No stack trace)"],{message:v,stack:I0.name=="SyntaxError"?P:G0(P)}}function Y1(I0,P,v){if(typeof console<"u"){var u;if(Q.isObject(I0)){var r=I0.stack;u=P+q(r,I0)}else u=P+String(I0);if(typeof F==="function")F(u,v);else if(typeof console.log==="function"||typeof console.log==="object")console.log(u)}}function a(I0,P,v,u){var r=!1;try{if(typeof P==="function")if(r=!0,I0==="rejectionHandled")P(u);else P(v,u)}catch(X0){U.throwLater(X0)}if(I0==="unhandledRejection"){if(!C(I0,v,u)&&!r)Y1(v,"Unhandled rejection ")}else C(I0,u)}function W0(I0){var P;if(typeof I0==="function")P="[function "+(I0.name||"anonymous")+"]";else{P=I0&&typeof I0.toString==="function"?I0.toString():Q.toString(I0);var v=/\[object [a-zA-Z0-9$_]+\]/;if(v.test(P))try{var u=JSON.stringify(I0);P=u}catch(r){}if(P.length===0)P="(empty array)"}return"(<"+F0(P)+">, no stack trace)"}function F0(I0){var P=41;if(I0.length<P)return I0;return I0.substr(0,P-3)+"..."}function f0(){return typeof b1==="function"}var u0=function(){return!1},i0=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function D1(I0){var P=I0.match(i0);if(P)return{fileName:P[1],line:parseInt(P[2],10)}}function k1(I0,P){if(!f0())return;var v=I0.stack.split(`
`),u=P.stack.split(`
`),r=-1,X0=-1,Q0,Z0;for(var O0=0;O0<v.length;++O0){var P0=D1(v[O0]);if(P0){Q0=P0.fileName,r=P0.line;break}}for(var O0=0;O0<u.length;++O0){var P0=D1(u[O0]);if(P0){Z0=P0.fileName,X0=P0.line;break}}if(r<0||X0<0||!Q0||!Z0||Q0!==Z0||r>=X0)return;u0=function(r0){if(H.test(r0))return!0;var J1=D1(r0);if(J1){if(J1.fileName===Q0&&(r<=J1.line&&J1.line<=X0))return!0}return!1}}function u1(I0){this._parent=I0,this._promisesCreated=0;var P=this._length=1+(I0===void 0?0:I0._length);if(b1(this,u1),P>32)this.uncycle()}Q.inherits(u1,Error),Y.CapturedTrace=u1,u1.prototype.uncycle=function(){var I0=this._length;if(I0<2)return;var P=[],v={};for(var u=0,r=this;r!==void 0;++u)P.push(r),r=r._parent;I0=this._length=u;for(var u=I0-1;u>=0;--u){var X0=P[u].stack;if(v[X0]===void 0)v[X0]=u}for(var u=0;u<I0;++u){var Q0=P[u].stack,Z0=v[Q0];if(Z0!==void 0&&Z0!==u){if(Z0>0)P[Z0-1]._parent=void 0,P[Z0-1]._length=1;P[u]._parent=void 0,P[u]._length=1;var O0=u>0?P[u-1]:this;if(Z0<I0-1)O0._parent=P[Z0+1],O0._parent.uncycle(),O0._length=O0._parent._length+1;else O0._parent=void 0,O0._length=1;var P0=O0._length+1;for(var r0=u-2;r0>=0;--r0)P[r0]._length=P0,P0++;return}}},u1.prototype.attachExtraTrace=function(I0){if(I0.__stackCleaned__)return;this.uncycle();var P=b0(I0),v=P.message,u=[P.stack],r=this;while(r!==void 0)u.push(G0(r.stack.split(`
`))),r=r._parent;E0(u),M0(u),Q.notEnumerableProp(I0,"stack",Y0(v,u)),Q.notEnumerableProp(I0,"__stackCleaned__",!0)};var b1=function(){var P=/^\s*at\s*/,v=function(Q0,Z0){if(typeof Q0==="string")return Q0;if(Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return W0(Z0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,Z=P,q=v;var u=Error.captureStackTrace;return u0=function(Q0){return H.test(Q0)},function(Q0,Z0){Error.stackTraceLimit+=6,u(Q0,Z0),Error.stackTraceLimit-=6}}var r=Error();if(typeof r.stack==="string"&&r.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,q=v,V=!0,function(Z0){Z0.stack=Error().stack};var X0;try{throw Error()}catch(Q0){X0="stack"in Q0}if(!("stack"in r)&&X0&&typeof Error.stackTraceLimit==="number")return Z=P,q=v,function(Z0){Error.stackTraceLimit+=6;try{throw Error()}catch(O0){Z0.stack=O0.stack}Error.stackTraceLimit-=6};return q=function(Q0,Z0){if(typeof Q0==="string")return Q0;if((typeof Z0==="object"||typeof Z0==="function")&&Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return W0(Z0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(F=function(I0){console.warn(I0)},Q.isNode&&process.stderr.isTTY)F=function(I0,P){var v=P?"\x1B[33m":"\x1B[31m";console.warn(v+I0+`\x1B[0m
`)};else if(!Q.isNode&&typeof Error().stack==="string")F=function(I0,P){console.warn("%c"+I0,P?"color: darkorange":"color: red")}}var A0={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};if(O)$.longStackTraces();return{longStackTraces:function(){return A0.longStackTraces},warnings:function(){return A0.warnings},cancellation:function(){return A0.cancellation},monitoring:function(){return A0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:B,fireGlobalEvent:T}}});var fF0=E((Pa1,xF0)=>{xF0.exports=function($,Y){var z=F4(),U=$.CancellationError,I=z.errorObj;function Q(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}Q.prototype.isFinallyHandler=function(){return this.type===0};function J(X){this.finallyHandler=X}J.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return W.call(this,this.promise._target()._settledValue())}function H(X){if(K(this,X))return;return I.e=X,I}function W(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=Y(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var M=new U("late cancellation observer");return Z._attachExtraTrace(M),I.e=M,I}else if(F.isPending())F._attachCancellationCallback(new J(this))}return F._then(G,H,void 0,this,void 0)}}}if(Z.isRejected())return K(this),I.e=X,I;else return K(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new Q(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,W,W)},$.prototype.tap=function(X){return this._passThrough(X,1,W)},Q}});var bF0=E((Ba1,uF0)=>{uF0.exports=function($){var Y=F4(),z=mz().keys,U=Y.tryCatch,I=Y.errorObj;function Q(J,K,G){return function(H){var W=G._boundValue();$:for(var X=0;X<J.length;++X){var Z=J[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(H instanceof Z)return U(K).call(W,H)}else if(typeof Z==="function"){var q=U(Z).call(W,H);if(q===I)return q;else if(q)return U(K).call(W,H)}else if(Y.isObject(H)){var V=z(Z);for(var F=0;F<V.length;++F){var M=V[F];if(Z[M]!=H[M])continue $}return U(K).call(W,H)}}return $}}return Q}});var Jc=E((Ta1,nF0)=>{var iF0=F4(),BV1=iF0.maybeWrapAsError,TV1=T3(),jV1=TV1.OperationalError,cF0=mz();function EV1($){return $ instanceof Error&&cF0.getPrototypeOf($)===Error.prototype}var CV1=/^(?:name|message|stack|cause)$/;function RV1($){var Y;if(EV1($)){Y=new jV1($),Y.name=$.name,Y.message=$.message,Y.stack=$.stack;var z=cF0.keys($);for(var U=0;U<z.length;++U){var I=z[U];if(!CV1.test(I))Y[I]=$[I]}return Y}return iF0.markAsOriginatingFromRejection($),$}function _V1($,Y){return function(z,U){if($===null)return;if(z){var I=RV1(BV1(z));$._attachExtraTrace(I),$._reject(I)}else if(!Y)$._fulfill(U);else{var Q=arguments.length,J=Array(Math.max(Q-1,0));for(var K=1;K<Q;++K)J[K-1]=arguments[K];$._fulfill(J)}$=null}}nF0.exports=_V1});var dF0=E((ja1,pF0)=>{pF0.exports=function($,Y,z,U,I){var Q=F4(),J=Q.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+Q.classString(K));return function(){var G=new $(Y);G._captureStackTrace(),G._pushContext();var H=J(K).apply(this,arguments),W=G._popContext();return I.checkForgottenReturns(H,W,"Promise.method",G),G._resolveFromSyncValue(H),G}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+Q.classString(K));var G=new $(Y);G._captureStackTrace(),G._pushContext();var H;if(arguments.length>1){I.deprecated("calling Promise.try with more than 1 argument");var W=arguments[1],X=arguments[2];H=Q.isArray(W)?J(K).apply(X,W):J(K).call(X,W)}else H=J(K)();var Z=G._popContext();return I.checkForgottenReturns(H,Z,"Promise.try",G),G._resolveFromSyncValue(H),G},$.prototype._resolveFromSyncValue=function(K){if(K===Q.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var lF0=E((Ea1,mF0)=>{mF0.exports=function($,Y,z,U){var I=!1,Q=function(H,W){this._reject(W)},J=function(H,W){W.promiseRejectionQueued=!0,W.bindingPromise._then(Q,Q,null,this,H)},K=function(H,W){if((this._bitField&50397184)===0)this._resolveCallback(W.target)},G=function(H,W){if(!W.promiseRejectionQueued)this._reject(H)};$.prototype.bind=function(H){if(!I)I=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var W=z(H),X=new $(Y);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(W),W instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:W};Z._then(Y,J,voi Line truncated
See http://goo.gl/MqrFmX
`);return this._settledValue()},U=Y.prototype.error=Y.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
See http://goo.gl/MqrFmX
`);return this._settledValue()},I=Y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Q=Y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},J=Y.prototype.isPending=function(){return(this._bitField&50397184)===0},K=Y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};Y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return J.call(this._target())},$.prototype.isRejected=function(){return Q.call(this._target())},$.prototype.isFulfilled=function(){return I.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),U.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=Y}});var iF0=E(($a1,bF0)=>{bF0.exports=function($,Y,z,U,I,Q){var J=F4(),K=J.canEvaluate,G=J.tryCatch,W=J.errorObj,H;if(K){var X=function(O){return Function("value","holder",`
`);return this._settledValue()},I=Y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Q=Y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},J=Y.prototype.isPending=function(){return(this._bitField&50397184)===0},K=Y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};Y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return J.call(this._target())},$.prototype.isRejected=function(){return Q.call(this._target())},$.prototype.isFulfilled=function(){return I.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),U.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=Y}});var Yw0=E((va1,$w0)=>{$w0.exports=function($,Y,z,U,I,Q){var J=F4(),K=J.canEvaluate,G=J.tryCatch,H=J.errorObj,W;if(K){var X=function(O){return Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
`.replace(/Index/g,O))},Z=function(O){return Function("promise","holder",`
'use strict';
holder.pIndex = promise;
`.replace(/Index/g,O))},q=function(O){var D=Array(O);for(var N=0;N<D.length;++N)D[N]="this.p"+(N+1);var A=D.join(" = ")+" = null;",T=`var promise;
`.replace(/Index/g,O))},q=function(O){var D=Array(O);for(var N=0;N<D.length;++N)D[N]="this.p"+(N+1);var B=D.join(" = ")+" = null;",T=`var promise;
`+D.map(function(b){return`
promise = `+b+`;
if (promise instanceof Promise) {
promise.cancel();
}
`}).join(`
`),P=D.join(", "),j="Holder$"+O,C=`return function(tryCatch, errorObj, Promise, async) {
`),A=D.join(", "),j="Holder$"+O,C=`return function(tryCatch, errorObj, Promise, async) {
'use strict';
function [TheName](fn) {
[TheProperties]
@@ -199,7 +199,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,O).replace(/\[ThePassedArguments\]/g,P).replace(/\[TheProperties\]/g,A).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,W,$,I)},V=[],F=[],M=[];for(var w=0;w<8;++w)V.push(q(w+1)),F.push(X(w+1)),M.push(Z(w+1));H=function(O){this._reject(O)}}$.join=function(){var O=arguments.length-1,D;if(O>0&&typeof arguments[O]==="function"){if(D=arguments[O],O<=8&&K){var c=new $(U);c._captureStackTrace();var N=V[O-1],A=new N(D),T=F;for(var P=0;P<O;++P){var j=z(arguments[P],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[P],H,void 0,c,A),M[P](j,A),A.asyncNeeded=!1;else if((C&33554432)!==0)T[P].call(c,j._value(),A);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[P].call(c,j,A)}if(!c._isFateSealed()){if(A.asyncNeeded){var b=Q();if(b!==null)A.fn=J.domainBind(b,A.fn)}c._setAsyncGuaranteed(),c._setOnCancel(A)}return c}}var k=arguments.length,h=Array(k);for(var i=0;i<k;++i)h[i]=arguments[i];if(D)h.pop();var c=new Y(h).promise();return D!==void 0?c.spread(D):c}}});var nF0=E((Ya1,cF0)=>{cF0.exports=function($,Y,z,U,I,Q){var J=$._getDomain,K=F4(),G=K.tryCatch,W=K.errorObj,H=$._async;function X(q,V,F,M){this.constructor$(q),this._promise._captureStackTrace();var w=J();this._callback=w===null?V:K.domainBind(w,V),this._preservedValues=M===I?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}K.inherits(X,Y),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,M=this.length(),w=this._preservedValues,O=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,O>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(O>=1&&this._inFlight>=O)return F[V]=q,this._queue.push(V),!1;if(w!==null)w[V]=q;var D=this._promise,N=this._callback,A=D._boundValue();D._pushContext();var T=G(N).call(A,q,V,M),P=D._popContext();if(Q.checkForgottenReturns(T,P,w!==null?"Promise.filter":"Promise.map",D),T===W)return this._reject(T.e),!0;var j=U(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(O>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=M){if(w!==null)this._filter(F,w);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var M=q.pop();this._promiseFulfilled(F[M],M)}},X.prototype._filter=function(q,V){var F=V.length,M=Array(F),w=0;for(var O=0;O<F;++O)if(q[O])M[w++]=V[O];M.length=w,this._resolve(M)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,M){if(typeof V!=="function")return z("expecting a function but got "+K.classString(V));var w=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(F.concurrency)));w=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(F)));return w=typeof w==="number"&&isFinite(w)&&w>=1?w:0,new X(q,V,w,M).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,M){return Z(q,V,F,M)}}});var dF0=E((za1,pF0)=>{var zc=Object.create;if(zc)jP=zc(null),EP=zc(null),jP[" size"]=EP[" size"]=0;var jP,EP;pF0.exports=function($){var Y=F4(),z=Y.canEvaluate,U=Y.isIdentifier,I,Q,J=function(q){return Function("ensureMethod",`
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,O).replace(/\[ThePassedArguments\]/g,A).replace(/\[TheProperties\]/g,B).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,H,$,I)},V=[],F=[],M=[];for(var w=0;w<8;++w)V.push(q(w+1)),F.push(X(w+1)),M.push(Z(w+1));W=function(O){this._reject(O)}}$.join=function(){var O=arguments.length-1,D;if(O>0&&typeof arguments[O]==="function"){if(D=arguments[O],O<=8&&K){var c=new $(U);c._captureStackTrace();var N=V[O-1],B=new N(D),T=F;for(var A=0;A<O;++A){var j=z(arguments[A],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[A],W,void 0,c,B),M[A](j,B),B.asyncNeeded=!1;else if((C&33554432)!==0)T[A].call(c,j._value(),B);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[A].call(c,j,B)}if(!c._isFateSealed()){if(B.asyncNeeded){var b=Q();if(b!==null)B.fn=J.domainBind(b,B.fn)}c._setAsyncGuaranteed(),c._setOnCancel(B)}return c}}var k=arguments.length,h=Array(k);for(var i=0;i<k;++i)h[i]=arguments[i];if(D)h.pop();var c=new Y(h).promise();return D!==void 0?c.spread(D):c}}});var Uw0=E((ha1,zw0)=>{zw0.exports=function($,Y,z,U,I,Q){var J=$._getDomain,K=F4(),G=K.tryCatch,H=K.errorObj,W=$._async;function X(q,V,F,M){this.constructor$(q),this._promise._captureStackTrace();var w=J();this._callback=w===null?V:K.domainBind(w,V),this._preservedValues=M===I?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],W.invoke(this._asyncInit,this,void 0)}K.inherits(X,Y),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,M=this.length(),w=this._preservedValues,O=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,O>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(O>=1&&this._inFlight>=O)return F[V]=q,this._queue.push(V),!1;if(w!==null)w[V]=q;var D=this._promise,N=this._callback,B=D._boundValue();D._pushContext();var T=G(N).call(B,q,V,M),A=D._popContext();if(Q.checkForgottenReturns(T,A,w!==null?"Promise.filter":"Promise.map",D),T===H)return this._reject(T.e),!0;var j=U(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(O>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=M){if(w!==null)this._filter(F,w);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var M=q.pop();this._promiseFulfilled(F[M],M)}},X.prototype._filter=function(q,V){var F=V.length,M=Array(F),w=0;for(var O=0;O<F;++O)if(q[O])M[w++]=V[O];M.length=w,this._resolve(M)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,M){if(typeof V!=="function")return z("expecting a function but got "+K.classString(V));var w=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(F.concurrency)));w=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(F)));return w=typeof w==="number"&&isFinite(w)&&w>=1?w:0,new X(q,V,w,M).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,M){return Z(q,V,F,M)}}});var Qw0=E((Sa1,Iw0)=>{var Kc=Object.create;if(Kc)vA=Kc(null),hA=Kc(null),vA[" size"]=hA[" size"]=0;var vA,hA;Iw0.exports=function($){var Y=F4(),z=Y.canEvaluate,U=Y.isIdentifier,I,Q,J=function(q){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
@@ -213,10 +213,10 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
return obj.methodName.apply(obj, this);
}
};
`.replace(/methodName/g,q))(W)},K=function(q){return Function("obj",`
`.replace(/methodName/g,q))(H)},K=function(q){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",q))},G=function(q,V,F){var M=F[q];if(typeof M!=="function"){if(!U(q))return null;if(M=V(q),F[q]=M,F[" size"]++,F[" size"]>512){var w=Object.keys(F);for(var O=0;O<256;++O)delete F[w[O]];F[" size"]=w.length-256}}return M};I=function(q){return G(q,J,jP)},Q=function(q){return G(q,K,EP)};function W(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var M="Object "+Y.classString(q)+" has no method '"+Y.toString(V)+"'";throw new $.TypeError(M)}return F}function H(q){var V=this.pop(),F=W(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var M=1;M<V;++M)F[M-1]=arguments[M];if(z){var w=I(q);if(w!==null)return this._then(w,void 0,void 0,F,void 0)}return F.push(q),this._then(H,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(z){var M=Q(q);F=M!==null?M:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var lF0=E((Ua1,mF0)=>{mF0.exports=function($,Y,z,U,I,Q){var J=F4(),K=T3().TypeError,G=F4().inherits,W=J.errorObj,H=J.tryCatch,X={};function Z(D){setTimeout(function(){throw D},0)}function q(D){var N=z(D);if(N!==D&&typeof D._isDisposable==="function"&&typeof D._getDisposer==="function"&&D._isDisposable())N._setDisposable(D._getDisposer());return N}function V(D,N){var A=0,T=D.length,P=new $(I);function j(){if(A>=T)return P._fulfill();var C=q(D[A++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(N),D.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),P}function F(D,N,A){this._data=D,this._promise=N,this._context=A}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(D){var N=this.resource(),A=this._context;if(A!==void 0)A._pushContext();var T=N!==X?this.doDispose(N,D):null;if(A!==void 0)A._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(D){return D!=null&&typeof D.resource==="function"&&typeof D.tryDispose==="function"};function M(D,N,A){this.constructor$(D,N,A)}G(M,F),M.prototype.doDispose=function(D,N){var A=this.data();return A.call(D,D,N)};function w(D){if(F.isDisposer(D))return this.resources[this.index]._setDisposable(D),D.promise();return D}function O(D){this.length=D,this.promise=null,this[D-1]=null}O.prototype._resultCancelled=function(){var D=this.length;for(var N=0;N<D;++N){var A=this[N];if(A instanceof $)A.cancel()}},$.using=function(){var D=arguments.length;if(D<2)return Y("you must pass at least 2 arguments to Promise.using");var N=arguments[D-1];if(typeof N!=="function")return Y("expecting a function but got "+J.classString(N));var A,T=!0;if(D===2&&Array.isArray(arguments[0]))A=arguments[0],D=A.length,T=!1;else A=arguments,D--;var P=new O(D);for(var j=0;j<D;++j){var C=A[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var k=z(C);if(k instanceof $)C=k._then(w,null,null,{resources:P,index:j},void 0)}P[j]=C}var h=Array(P.length);for(var j=0;j<h.length;++j)h[j]=$.resolve(P[j]).reflect();var i=$.all(h).then(function(U0){for(var x=0;x<U0.length;++x){var d=U0[x];if(d.isRejected())return W.e=d.error(),W;else if(!d.isFulfilled()){i.cancel();return}U0[x]=d.value()}c._pushContext(),N=H(N);var t=T?N.apply(void 0,U0):N(U0),$0=c._popContext();return Q.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var U0=new $.PromiseInspection(i);return V(P,U0)});return P.promise=c,c._setOnCancel(P),c},$.prototype._setDisposable=function(D){this._bitField=this._bitField|131072,this._disposer=D},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(D){if(typeof D==="function")return new M(D,this,U());throw new K}}});var rF0=E((Ia1,oF0)=>{oF0.exports=function($,Y,z){var U=F4(),I=$.TimeoutError;function Q(X){this.handle=X}Q.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(X){return K(+this).thenReturn(X)},K=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(J,null,null,X,void 0),z.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(Y),V=setTimeout(function(){q._fulfill()},+X),z.cancellation())q._setOnCancel(new Q(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return K(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new I("operation timed out");else V=new I(Z);if(U.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function W(X){return clearTimeout(this.handle),X Line truncated
`.replace("propertyName",q))},G=function(q,V,F){var M=F[q];if(typeof M!=="function"){if(!U(q))return null;if(M=V(q),F[q]=M,F[" size"]++,F[" size"]>512){var w=Object.keys(F);for(var O=0;O<256;++O)delete F[w[O]];F[" size"]=w.length-256}}return M};I=function(q){return G(q,J,vA)},Q=function(q){return G(q,K,hA)};function H(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var M="Object "+Y.classString(q)+" has no method '"+Y.toString(V)+"'";throw new $.TypeError(M)}return F}function W(q){var V=this.pop(),F=H(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var M=1;M<V;++M)F[M-1]=arguments[M];if(z){var w=I(q);if(w!==null)return this._then(w,void 0,void 0,F,void 0)}return F.push(q),this._then(W,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(z){var M=Q(q);F=M!==null?M:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var Kw0=E((ga1,Jw0)=>{Jw0.exports=function($,Y,z,U,I,Q){var J=F4(),K=T3().TypeError,G=F4().inherits,H=J.errorObj,W=J.tryCatch,X={};function Z(D){setTimeout(function(){throw D},0)}function q(D){var N=z(D);if(N!==D&&typeof D._isDisposable==="function"&&typeof D._getDisposer==="function"&&D._isDisposable())N._setDisposable(D._getDisposer());return N}function V(D,N){var B=0,T=D.length,A=new $(I);function j(){if(B>=T)return A._fulfill();var C=q(D[B++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(N),D.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),A}function F(D,N,B){this._data=D,this._promise=N,this._context=B}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(D){var N=this.resource(),B=this._context;if(B!==void 0)B._pushContext();var T=N!==X?this.doDispose(N,D):null;if(B!==void 0)B._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(D){return D!=null&&typeof D.resource==="function"&&typeof D.tryDispose==="function"};function M(D,N,B){this.constructor$(D,N,B)}G(M,F),M.prototype.doDispose=function(D,N){var B=this.data();return B.call(D,D,N)};function w(D){if(F.isDisposer(D))return this.resources[this.index]._setDisposable(D),D.promise();return D}function O(D){this.length=D,this.promise=null,this[D-1]=null}O.prototype._resultCancelled=function(){var D=this.length;for(var N=0;N<D;++N){var B=this[N];if(B instanceof $)B.cancel()}},$.using=function(){var D=arguments.length;if(D<2)return Y("you must pass at least 2 arguments to Promise.using");var N=arguments[D-1];if(typeof N!=="function")return Y("expecting a function but got "+J.classString(N));var B,T=!0;if(D===2&&Array.isArray(arguments[0]))B=arguments[0],D=B.length,T=!1;else B=arguments,D--;var A=new O(D);for(var j=0;j<D;++j){var C=B[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var k=z(C);if(k instanceof $)C=k._then(w,null,null,{resources:A,index:j},void 0)}A[j]=C}var h=Array(A.length);for(var j=0;j<h.length;++j)h[j]=$.resolve(A[j]).reflect();var i=$.all(h).then(function(U0){for(var x=0;x<U0.length;++x){var d=U0[x];if(d.isRejected())return H.e=d.error(),H;else if(!d.isFulfilled()){i.cancel();return}U0[x]=d.value()}c._pushContext(),N=W(N);var t=T?N.apply(void 0,U0):N(U0),$0=c._popContext();return Q.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var U0=new $.PromiseInspection(i);return V(A,U0)});return A.promise=c,c._setOnCancel(A),c},$.prototype._setDisposable=function(D){this._bitField=this._bitField|131072,this._disposer=D},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(D){if(typeof D==="function")return new M(D,this,U());throw new K}}});var Hw0=E((ya1,Gw0)=>{Gw0.exports=function($,Y,z){var U=F4(),I=$.TimeoutError;function Q(X){this.handle=X}Q.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(X){return K(+this).thenReturn(X)},K=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(J,null,null,X,void 0),z.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(Y),V=setTimeout(function(){q._fulfill()},+X),z.cancellation())q._setOnCancel(new Q(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return K(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new I("operation timed out");else V=new I(Z);if(U.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function H(X){return clearTimeout(this.handle),X Line truncated
See http://goo.gl/MqrFmX
@@ -226,13 +226,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
`)));return}}w=w._target();var O=w._bitField;if((O&50397184)===0)this._yieldedPromise=w,w._proxy(this,null);else if((O&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,w._value());else if((O&16777216)!==0)$._async.invoke(this._promiseRejected,this,w._reason());else this._promiseCancelled()}},$.coroutine=function(V,F){if(typeof V!=="function")throw new K(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var M=Object(F).yieldHandler,w=q,O=Error().stack;return function(){var D=V.apply(this,arguments),N=new w(void 0,void 0,M,O),A=N.promise();return N._generator=D,N._promiseFulfilled(void 0),A}},$.coroutine.addYieldHandler=function(V){if(typeof V!=="function")throw new K("expecting a function but got "+G.classString(V));X.push(V)},$.spawn=function(V){if(Q.deprecated("Promise.spawn()","Promise.coroutine()"),typeof V!=="function")return Y(`generatorFunction must be a function
`);var M=Object(F).yieldHandler,w=q,O=Error().stack;return function(){var D=V.apply(this,arguments),N=new w(void 0,void 0,M,O),B=N.promise();return N._generator=D,N._promiseFulfilled(void 0),B}},$.coroutine.addYieldHandler=function(V){if(typeof V!=="function")throw new K("expecting a function but got "+G.classString(V));X.push(V)},$.spawn=function(V){if(Q.deprecated("Promise.spawn()","Promise.coroutine()"),typeof V!=="function")return Y(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var F=new q(V,this),M=F.promise();return F._run($.spawn),M}}});var eF0=E((Ja1,tF0)=>{tF0.exports=function($){var Y=F4(),z=$._async,U=Y.tryCatch,I=Y.errorObj;function Q(G,W){var H=this;if(!Y.isArray(G))return J.call(H,G,W);var X=U(W).apply(H._boundValue(),[null].concat(G));if(X===I)z.throwLater(X.e)}function J(G,W){var H=this,X=H._boundValue(),Z=G===void 0?U(W).call(X,null):U(W).call(X,null,G);if(Z===I)z.throwLater(Z.e)}function K(G,W){var H=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=U(W).call(H._boundValue(),G);if(Z===I)z.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,W){if(typeof G=="function"){var H=J;if(W!==void 0&&Object(W).spread)H=Q;this._then(H,K,void 0,this,G)}return this}}});var Yw0=E((Ka1,$w0)=>{$w0.exports=function($,Y){var z={},U=F4(),I=Yc(),Q=U.withAppended,J=U.maybeWrapAsError,K=U.canEvaluate,G=T3().TypeError,W="Async",H={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return U.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function M(i,c,U0){var x=U.getDataPropertyOrDefault(i,c+U0,H);return x?F(x):!1}function w(i,c,U0){for(var x=0;x<i.length;x+=2){var d=i[x];if(U0.test(d)){var t=d.replace(U0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
`);var F=new q(V,this),M=F.promise();return F._run($.spawn),M}}});var qw0=E((xa1,Zw0)=>{Zw0.exports=function($){var Y=F4(),z=$._async,U=Y.tryCatch,I=Y.errorObj;function Q(G,H){var W=this;if(!Y.isArray(G))return J.call(W,G,H);var X=U(H).apply(W._boundValue(),[null].concat(G));if(X===I)z.throwLater(X.e)}function J(G,H){var W=this,X=W._boundValue(),Z=G===void 0?U(H).call(X,null):U(H).call(X,null,G);if(Z===I)z.throwLater(Z.e)}function K(G,H){var W=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=U(H).call(W._boundValue(),G);if(Z===I)z.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,H){if(typeof G=="function"){var W=J;if(H!==void 0&&Object(H).spread)W=Q;this._then(W,K,void 0,this,G)}return this}}});var Lw0=E((fa1,Vw0)=>{Vw0.exports=function($,Y){var z={},U=F4(),I=Jc(),Q=U.withAppended,J=U.maybeWrapAsError,K=U.canEvaluate,G=T3().TypeError,H="Async",W={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return U.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function M(i,c,U0){var x=U.getDataPropertyOrDefault(i,c+U0,W);return x?F(x):!1}function w(i,c,U0){for(var x=0;x<i.length;x+=2){var d=i[x];if(U0.test(d)){var t=d.replace(U0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",c))}}}function O(i,c,U0,x){var d=U.inheritedDataKeys(i),t=[];for(var $0=0;$0<d.length;++$0){var g=d[$0],p=i[g],e=x===q?!0:q(g,p,i);if(typeof p==="function"&&!F(p)&&!M(i,g,c)&&x(g,p,i,e))t.push(g,p)}return w(t,c,U0),t}var D=function(i){return i.replace(/([$])/,"\\$")},N,A=function(i){var c=[i],U0=Math.max(0,i-1-3);for(var x=i-1;x>=U0;--x)c.push(x);for(var x=i+1;x<=3;++x)c.push(x);return c},T=function(i){return U.filledRange(i,"_arg","")},P=function(i){return U.filledRange(Math.max(i,3),"_arg","")},j=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};N=function(i,c,U0,x,d,t){var $0=Math.max(0,j(x)-1),g=A($0),p=typeof i==="string"||c===z;function e(M0){var E0=T(M0).join(", "),G0=M0>0?", ":"",T0;if(p)T0=`ret = callback.call(this, {{args}}, nodeback); break;
`.replace("%s",c))}}}function O(i,c,U0,x){var d=U.inheritedDataKeys(i),t=[];for(var $0=0;$0<d.length;++$0){var g=d[$0],p=i[g],e=x===q?!0:q(g,p,i);if(typeof p==="function"&&!F(p)&&!M(i,g,c)&&x(g,p,i,e))t.push(g,p)}return w(t,c,U0),t}var D=function(i){return i.replace(/([$])/,"\\$")},N,B=function(i){var c=[i],U0=Math.max(0,i-1-3);for(var x=i-1;x>=U0;--x)c.push(x);for(var x=i+1;x<=3;++x)c.push(x);return c},T=function(i){return U.filledRange(i,"_arg","")},A=function(i){return U.filledRange(Math.max(i,3),"_arg","")},j=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};N=function(i,c,U0,x,d,t){var $0=Math.max(0,j(x)-1),g=B($0),p=typeof i==="string"||c===z;function e(M0){var E0=T(M0).join(", "),G0=M0>0?", ":"",T0;if(p)T0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else T0=c===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return T0.replace("{{args}}",E0).replace(", ",G0)}function y(){var M0="";for(var E0=0;E0<g.length;++E0)M0+="case "+g[E0]+":"+e(g[E0]);return M0+=`
@@ -267,25 +267,25 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
};
notEnumerableProp(ret, '__isPromisified__', true);
return ret;
`.replace("[CodeForSwitchCase]",y()).replace("[GetFunctionCode]",s);return Y0=Y0.replace("Parameters",P($0)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",Y0)($,x,c,Q,J,I,U.tryCatch,U.errorObj,U.notEnumerableProp,Y)};function C(i,c,U0,x,d,t){var $0=function(){return this}(),g=i;if(typeof g==="string")i=x;function p(){var e=c;if(c===z)e=this;var y=new $(Y);y._captureStackTrace();var s=typeof g==="string"&&this!==$0?this[g]:i,Y0=I(y,t);try{s.apply(e,Q(arguments,Y0))}catch(M0){y._rejectCallback(J(M0),!0,!0)}if(!y._isFateSealed())y._setAsyncGuaranteed();return y}return U.notEnumerableProp(p,"__isPromisified__",!0),p}var b=K?N:C;function k(i,c,U0,x,d){var t=new RegExp(D(c)+"$"),$0=O(i,c,t,U0);for(var g=0,p=$0.length;g<p;g+=2){var e=$0[g],y=$0[g+1],s=e+c;if(x===b)i[s]=b(e,z,e,y,c,d);else{var Y0=x(y,function(){return b(e,z,e,y,c,d)});U.notEnumerableProp(Y0,"__isPromisified__",!0),i[s]=Y0}}return U.toFastProperties(i),i}function h(i,c,U0){return b(i,c,void 0,i,null,U0)}$.promisify=function(i,c){if(typeof i!=="function")throw new G("expecting a function but got "+U.classString(i));if(F(i))return i;c=Object(c);var U0=c.context===void 0?z:c.context,x=!!c.multiArgs,d=h(i,U0,x);return U.copyDescriptors(i,d,V),d},$.promisifyAll=function(i,c){if(typeof i!=="function"&&typeof i!=="object")throw new G(`the target of promisifyAll must be an object or a function
`.replace("[CodeForSwitchCase]",y()).replace("[GetFunctionCode]",s);return Y0=Y0.replace("Parameters",A($0)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",Y0)($,x,c,Q,J,I,U.tryCatch,U.errorObj,U.notEnumerableProp,Y)};function C(i,c,U0,x,d,t){var $0=function(){return this}(),g=i;if(typeof g==="string")i=x;function p(){var e=c;if(c===z)e=this;var y=new $(Y);y._captureStackTrace();var s=typeof g==="string"&&this!==$0?this[g]:i,Y0=I(y,t);try{s.apply(e,Q(arguments,Y0))}catch(M0){y._rejectCallback(J(M0),!0,!0)}if(!y._isFateSealed())y._setAsyncGuaranteed();return y}return U.notEnumerableProp(p,"__isPromisified__",!0),p}var b=K?N:C;function k(i,c,U0,x,d){var t=new RegExp(D(c)+"$"),$0=O(i,c,t,U0);for(var g=0,p=$0.length;g<p;g+=2){var e=$0[g],y=$0[g+1],s=e+c;if(x===b)i[s]=b(e,z,e,y,c,d);else{var Y0=x(y,function(){return b(e,z,e,y,c,d)});U.notEnumerableProp(Y0,"__isPromisified__",!0),i[s]=Y0}}return U.toFastProperties(i),i}function h(i,c,U0){return b(i,c,void 0,i,null,U0)}$.promisify=function(i,c){if(typeof i!=="function")throw new G("expecting a function but got "+U.classString(i));if(F(i))return i;c=Object(c);var U0=c.context===void 0?z:c.context,x=!!c.multiArgs,d=h(i,U0,x);return U.copyDescriptors(i,d,V),d},$.promisifyAll=function(i,c){if(typeof i!=="function"&&typeof i!=="object")throw new G(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);c=Object(c);var U0=!!c.multiArgs,x=c.suffix;if(typeof x!=="string")x=W;var d=c.filter;if(typeof d!=="function")d=q;var t=c.promisifier;if(typeof t!=="function")t=b;if(!U.isIdentifier(x))throw RangeError(`suffix must be a valid identifier
`);c=Object(c);var U0=!!c.multiArgs,x=c.suffix;if(typeof x!=="string")x=H;var d=c.filter;if(typeof d!=="function")d=q;var t=c.promisifier;if(typeof t!=="function")t=b;if(!U.isIdentifier(x))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var $0=U.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&U.isClass(p))k(p.prototype,x,d,t,U0),k(p,x,d,t,U0)}return k(i,x,d,t,U0)}}});var Uw0=E((Ga1,zw0)=>{zw0.exports=function($,Y,z,U){var I=F4(),Q=I.isObject,J=pz(),K;if(typeof Map==="function")K=Map;var G=function(){var Z=0,q=0;function V(F,M){this[Z]=F,this[Z+q]=M,Z++}return function(M){q=M.size,Z=0;var w=Array(M.size*2);return M.forEach(V,w),w}}(),W=function(Z){var q=new K,V=Z.length/2|0;for(var F=0;F<V;++F){var M=Z[V+F],w=Z[F];q.set(M,w)}return q};function H(Z){var q=!1,V;if(K!==void 0&&Z instanceof K)V=G(Z),q=!0;else{var F=J.keys(Z),M=F.length;V=Array(M*2);for(var w=0;w<M;++w){var O=F[w];V[w]=Z[O],V[w+M]=O}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}I.inherits(H,Y),H.prototype._init=function(){},H.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=W(this._values);else{F={};var M=this.length();for(var w=0,O=this.length();w<O;++w)F[this._values[w+M]]=this._values[w]}return this._resolve(F),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=z(Z);if(!Q(V))return U(`cannot await properties of a non-object
`);var $0=U.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&U.isClass(p))k(p.prototype,x,d,t,U0),k(p,x,d,t,U0)}return k(i,x,d,t,U0)}}});var ww0=E((ua1,Fw0)=>{Fw0.exports=function($,Y,z,U){var I=F4(),Q=I.isObject,J=mz(),K;if(typeof Map==="function")K=Map;var G=function(){var Z=0,q=0;function V(F,M){this[Z]=F,this[Z+q]=M,Z++}return function(M){q=M.size,Z=0;var w=Array(M.size*2);return M.forEach(V,w),w}}(),H=function(Z){var q=new K,V=Z.length/2|0;for(var F=0;F<V;++F){var M=Z[V+F],w=Z[F];q.set(M,w)}return q};function W(Z){var q=!1,V;if(K!==void 0&&Z instanceof K)V=G(Z),q=!0;else{var F=J.keys(Z),M=F.length;V=Array(M*2);for(var w=0;w<M;++w){var O=F[w];V[w]=Z[O],V[w+M]=O}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}I.inherits(W,Y),W.prototype._init=function(){},W.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=H(this._values);else{F={};var M=this.length();for(var w=0,O=this.length();w<O;++w)F[this._values[w+M]]=this._values[w]}return this._resolve(F),!0}return!1},W.prototype.shouldCopyValues=function(){return!1},W.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=z(Z);if(!Q(V))return U(`cannot await properties of a non-object
See http://goo.gl/MqrFmX
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new H(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var Qw0=E((Wa1,Iw0)=>{Iw0.exports=function($,Y,z,U){var I=F4(),Q=function(K){return K.then(function(G){return J(G,K)})};function J(K,G){var W=z(K);if(W instanceof $)return Q(W);else if(K=I.asArray(K),K===null)return U("expecting an array or an iterable object but got "+I.classString(K));var H=new $(Y);if(G!==void 0)H._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=H;for(var q=0,V=K.length;q<V;++q){var F=K[q];if(F===void 0&&!(q in K))continue;$.cast(F)._then(X,Z,void 0,H,null)}return H}$.race=function(K){return J(K,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var Kw0=E((Ha1,Jw0)=>{Jw0.exports=function($,Y,z,U,I,Q){var J=$._getDomain,K=F4(),G=K.tryCatch;function W(V,F,M,w){this.constructor$(V);var O=J();if(this._fn=O===null?F:K.domainBind(O,F),M!==void 0)M=$.resolve(M),M._attachCancellationCallback(this);if(this._initialValue=M,this._currentCancellable=null,w===I)this._eachValues=Array(this._length);else if(w===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(W,Y),W.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==I)this._eachValues.push(V)},W.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},W.prototype._init=function(){},W.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},W.prototype.shouldCopyValues=function(){return!1},W.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},W.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},W.prototype._iterate=function(V){this._values=V;var F,M,w=V.length;if(this._initialValue!==void 0)F=this._initialValue,M=0;else F=$.resolve(V[0]),M=1;if(this._currentCancellable=F,!F.isRejected())for(;M<w;++M){var O={accum:null,value:V[M],index:M,length:w,array:this};F=F._then(Z,void 0,void 0,O,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(H,H,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,M,w){return X(V,F,M,w)};function H(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,M,w){if(typeof F!=="function")return z("expecting a function but got "+K.classString(F));var O=new W(V,F,M,w);return O.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=U(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,M=F._promise,w=G(F._fn);M._pushContext();var O;if(F._eachValues!==void 0)O=w.call(M._boundValue(),V,this.index,this.length);else O=w.call(M._boundValue(),this.accum,V,this.index,this.length);if(O instanceof $)F._currentCancellable=O;var D=M._popContext();return Q.checkForgottenReturns(O,D,F._eachValues!==void 0?"Promise.each":"Promise.reduce",M),O}}});var Ww0=E((Xa1,Gw0)=>{Gw0.exports=function($,Y,z){var U=$.PromiseInspection,I=F4();function Q(J){this.constructor$(J)}I.inherits(Q,Y),Q.prototype._promiseResolved=function(J,K){this._values[J]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},Q.prototype._promiseFulfilled=function(J,K){var G=new U;return G._bitField=33554432,G._settledValueField=J,this._promiseResolved(K,G)},Q.prototype._promiseRejected=function(J,K){var G=new U;return G._bitField=16777216,G._settledValueField=J,this._promiseResolved(K,G)},$.settle=function(J){return z.deprecated(".settle()",".reflect()"),new Q(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Xw0=E((Za1,Hw0)=>{Hw0.exports=function($,Y,z){var U=F4(),I=T3().RangeError,Q=T3().AggregateError,J=U.isArray,K={};function G(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(G,Y),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var H=J(this._values);if(!this._isResolved()&&H&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(H){this._howMany=H},G.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new W(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var Ow0=E((ba1,Mw0)=>{Mw0.exports=function($,Y,z,U){var I=F4(),Q=function(K){return K.then(function(G){return J(G,K)})};function J(K,G){var H=z(K);if(H instanceof $)return Q(H);else if(K=I.asArray(K),K===null)return U("expecting an array or an iterable object but got "+I.classString(K));var W=new $(Y);if(G!==void 0)W._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=W;for(var q=0,V=K.length;q<V;++q){var F=K[q];if(F===void 0&&!(q in K))continue;$.cast(F)._then(X,Z,void 0,W,null)}return W}$.race=function(K){return J(K,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var Dw0=E((ia1,Nw0)=>{Nw0.exports=function($,Y,z,U,I,Q){var J=$._getDomain,K=F4(),G=K.tryCatch;function H(V,F,M,w){this.constructor$(V);var O=J();if(this._fn=O===null?F:K.domainBind(O,F),M!==void 0)M=$.resolve(M),M._attachCancellationCallback(this);if(this._initialValue=M,this._currentCancellable=null,w===I)this._eachValues=Array(this._length);else if(w===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(H,Y),H.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==I)this._eachValues.push(V)},H.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},H.prototype._init=function(){},H.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},H.prototype.shouldCopyValues=function(){return!1},H.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},H.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},H.prototype._iterate=function(V){this._values=V;var F,M,w=V.length;if(this._initialValue!==void 0)F=this._initialValue,M=0;else F=$.resolve(V[0]),M=1;if(this._currentCancellable=F,!F.isRejected())for(;M<w;++M){var O={accum:null,value:V[M],index:M,length:w,array:this};F=F._then(Z,void 0,void 0,O,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(W,W,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,M,w){return X(V,F,M,w)};function W(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,M,w){if(typeof F!=="function")return z("expecting a function but got "+K.classString(F));var O=new H(V,F,M,w);return O.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=U(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,M=F._promise,w=G(F._fn);M._pushContext();var O;if(F._eachValues!==void 0)O=w.call(M._boundValue(),V,this.index,this.length);else O=w.call(M._boundValue(),this.accum,V,this.index,this.length);if(O instanceof $)F._currentCancellable=O;var D=M._popContext();return Q.checkForgottenReturns(O,D,F._eachValues!==void 0?"Promise.each":"Promise.reduce",M),O}}});var Pw0=E((ca1,Aw0)=>{Aw0.exports=function($,Y,z){var U=$.PromiseInspection,I=F4();function Q(J){this.constructor$(J)}I.inherits(Q,Y),Q.prototype._promiseResolved=function(J,K){this._values[J]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},Q.prototype._promiseFulfilled=function(J,K){var G=new U;return G._bitField=33554432,G._settledValueField=J,this._promiseResolved(K,G)},Q.prototype._promiseRejected=function(J,K){var G=new U;return G._bitField=16777216,G._settledValueField=J,this._promiseResolved(K,G)},$.settle=function(J){return z.deprecated(".settle()",".reflect()"),new Q(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Tw0=E((na1,Bw0)=>{Bw0.exports=function($,Y,z){var U=F4(),I=T3().RangeError,Q=T3().AggregateError,J=U.isArray,K={};function G(W){this.constructor$(W),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(G,Y),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var W=J(this._values);if(!this._isResolved()&&W&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(W){this._howMany=W},G.prototype._promiseFulfilled=function(W){if(this._addFulfilled(W),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
See http://goo.gl/MqrFmX
`);var Z=new G(H),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(H,X){return W(H,X)},$.prototype.some=function(H){return W(this,H)},$._SomePromiseArray=G}});var qw0=E((qa1,Zw0)=>{Zw0.exports=function($,Y){var z=$.map;$.prototype.filter=function(U,I){return z(this,U,I,Y)},$.filter=function(U,I,Q){return z(U,I,Q,Y)}}});var Lw0=E((Va1,Vw0)=>{Vw0.exports=function($,Y){var{reduce:z,all:U}=$;function I(){return U(this)}function Q(J,K){return z(J,K,Y,Y)}$.prototype.each=function(J){return z(this,J,Y,0)._then(I,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return z(this,J,Y,Y)},$.each=function(J,K){return z(J,K,Y,0)._then(I,void 0,void 0,J,void 0)},$.mapSeries=Q}});var ww0=E((La1,Fw0)=>{Fw0.exports=function($){var Y=$._SomePromiseArray;function z(U){var I=new Y(U),Q=I.promise();return I.setHowMany(1),I.setUnwrap(),I.init(),Q}$.any=function(U){return z(U)},$.prototype.any=function(){return z(this)}}});var Mw0=E((Fa1,Uc)=>{Uc.exports=function(){var $=function(){return new X(`circular promise resolution chain
`);var Z=new G(W),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(W,X){return H(W,X)},$.prototype.some=function(W){return H(this,W)},$._SomePromiseArray=G}});var Ew0=E((pa1,jw0)=>{jw0.exports=function($,Y){var z=$.map;$.prototype.filter=function(U,I){return z(this,U,I,Y)},$.filter=function(U,I,Q){return z(U,I,Q,Y)}}});var Rw0=E((da1,Cw0)=>{Cw0.exports=function($,Y){var{reduce:z,all:U}=$;function I(){return U(this)}function Q(J,K){return z(J,K,Y,Y)}$.prototype.each=function(J){return z(this,J,Y,0)._then(I,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return z(this,J,Y,Y)},$.each=function(J,K){return z(J,K,Y,0)._then(I,void 0,void 0,J,void 0)},$.mapSeries=Q}});var vw0=E((ma1,_w0)=>{_w0.exports=function($){var Y=$._SomePromiseArray;function z(U){var I=new Y(U),Q=I.promise();return I.setHowMany(1),I.setUnwrap(),I.init(),Q}$.any=function(U){return z(U)},$.prototype.any=function(){return z(this)}}});var hw0=E((la1,Gc)=>{Gc.exports=function(){var $=function(){return new X(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},Y=function(){return new h.PromiseInspection(this._target())},z=function(x){return h.reject(new X(x))};function U(){}var I={},Q=F4(),J;if(Q.isNode)J=function(){var x=process.domain;if(x===void 0)x=null;return x};else J=function(){return null};Q.notEnumerableProp(h,"_getDomain",J);var K=pz(),G=XF0(),W=new G;K.defineProperty(h,"_async",{value:W});var H=T3(),X=h.TypeError=H.TypeError;h.RangeError=H.RangeError;var Z=h.CancellationError=H.CancellationError;h.TimeoutError=H.TimeoutError,h.OperationalError=H.OperationalError,h.RejectionError=H.OperationalError,h.AggregateError=H.AggregateError;var q=function(){},V={},F={},M=FF0()(h,q),w=MF0()(h,q,M,z,U),O=NF0()(h),D=O.create,N=PF0()(h,O),A=N.CapturedTrace,T=AF0()(h,M),P=jF0()(F),j=Yc(),C=Q.errorObj,b=Q.tryCatch;function k(x,d){if(typeof d!=="function")throw new X("expecting a function but got "+Q.classString(d));if(x.constructor!==h)throw new X(`the promise constructor cannot be invoked directly
`)},Y=function(){return new h.PromiseInspection(this._target())},z=function(x){return h.reject(new X(x))};function U(){}var I={},Q=F4(),J;if(Q.isNode)J=function(){var x=process.domain;if(x===void 0)x=null;return x};else J=function(){return null};Q.notEnumerableProp(h,"_getDomain",J);var K=mz(),G=TF0(),H=new G;K.defineProperty(h,"_async",{value:H});var W=T3(),X=h.TypeError=W.TypeError;h.RangeError=W.RangeError;var Z=h.CancellationError=W.CancellationError;h.TimeoutError=W.TimeoutError,h.OperationalError=W.OperationalError,h.RejectionError=W.OperationalError,h.AggregateError=W.AggregateError;var q=function(){},V={},F={},M=_F0()(h,q),w=hF0()(h,q,M,z,U),O=gF0()(h),D=O.create,N=kF0()(h,O),B=N.CapturedTrace,T=fF0()(h,M),A=bF0()(F),j=Jc(),C=Q.errorObj,b=Q.tryCatch;function k(x,d){if(typeof d!=="function")throw new X("expecting a function but got "+Q.classString(d));if(x.constructor!==h)throw new X(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function h(x){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,x!==q)k(this,x),this._resolveFromExecutor(x);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(x){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(Q.isObject(p))t[$0++]=p;else return z("expecting an object but got A catch statement predicate "+Q.classString(p))}return t.length=$0,x=arguments[g],this.then(void 0,P(t,x,this))}return this.then(void 0,x)},h.prototype.reflect=function(){return this._then(Y,Y,void 0,this,void 0)},h.prototype.then=function(x,d){if(N.warnings()&&arguments.length>0&&typeof x!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+Q.classString(x);if(arguments.length>1)t+=", "+Q.classString(d);this._warn(t)}return this._then(x,d,void 0,void 0,void 0)},h.prototype.done=function(x,d){var t=this._then(x,d,void 0,void 0,void 0);t._setIsFinal()},h.prototype.spread=function(x){if(typeof x!=="function")return z("expecting a function but got "+Q.classString(x));return this.all()._then(x,void 0,void 0,V,void 0)},h.prototype.toJSON=function(){var x={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())x.fulfillmentValue=this.value(),x.isFulfilled=!0;else if(this.isRejected())x.rejectionReason=this.reason(),x.isRejected=!0;return x},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new w(this).promise()},h.prototype.error=function(x){return this.caught(Q.originatesFromRejection,x)},h.getNewLibraryCopy=Uc.exports,h.is=function(x){return x instanceof h},h.fromNode=h.fromCallback=function(x){var d=new h(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(x)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},h.all=function(x){return new w(x).promise()},h.cast=function(x){var d=M(x);if(!(d instanceof h))d=new h(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=x;return d},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(x){var d=new h(q);return d._captureStackTrace(),d._rejectCallback(x,!0),d},h.setScheduler=function(x){if(typeof x!=="function")throw new X("expecting a function but got "+Q.classString(x));return W.setScheduler(x)},h.prototype._then=function(x,d,t,$0,g){var p=g!==void 0,e=p?g:new h(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var Y0=J();if((s&50397184)!==0){var M0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,M0=x;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,M0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),M0=d;W.invoke(G0,y,{handler:Y0===null?M0:typeof M0==="function"&&Q.domainBind(Y0,M0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(x,d,e,$0,Y0);return e},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(x){this._bitField=this._bitField&-65536|x&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(W.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(x){var d=x===0?this._receiver0:this[x*4-4+3];if(d===I)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},h.prototype._promiseAt=function(x){return this[x*4-4+2]},h.prototype._fulfillmentHandlerAt=function(x){return this[x*4-4+0]},h.prototype._rejectionHandlerAt=function(x){return this[x*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(x){var{_bitField:d,_fulfillmentHandler Line truncated
`)}function h(x){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,x!==q)k(this,x),this._resolveFromExecutor(x);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(x){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(Q.isObject(p))t[$0++]=p;else return z("expecting an object but got A catch statement predicate "+Q.classString(p))}return t.length=$0,x=arguments[g],this.then(void 0,A(t,x,this))}return this.then(void 0,x)},h.prototype.reflect=function(){return this._then(Y,Y,void 0,this,void 0)},h.prototype.then=function(x,d){if(N.warnings()&&arguments.length>0&&typeof x!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+Q.classString(x);if(arguments.length>1)t+=", "+Q.classString(d);this._warn(t)}return this._then(x,d,void 0,void 0,void 0)},h.prototype.done=function(x,d){var t=this._then(x,d,void 0,void 0,void 0);t._setIsFinal()},h.prototype.spread=function(x){if(typeof x!=="function")return z("expecting a function but got "+Q.classString(x));return this.all()._then(x,void 0,void 0,V,void 0)},h.prototype.toJSON=function(){var x={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())x.fulfillmentValue=this.value(),x.isFulfilled=!0;else if(this.isRejected())x.rejectionReason=this.reason(),x.isRejected=!0;return x},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new w(this).promise()},h.prototype.error=function(x){return this.caught(Q.originatesFromRejection,x)},h.getNewLibraryCopy=Gc.exports,h.is=function(x){return x instanceof h},h.fromNode=h.fromCallback=function(x){var d=new h(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(x)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},h.all=function(x){return new w(x).promise()},h.cast=function(x){var d=M(x);if(!(d instanceof h))d=new h(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=x;return d},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(x){var d=new h(q);return d._captureStackTrace(),d._rejectCallback(x,!0),d},h.setScheduler=function(x){if(typeof x!=="function")throw new X("expecting a function but got "+Q.classString(x));return H.setScheduler(x)},h.prototype._then=function(x,d,t,$0,g){var p=g!==void 0,e=p?g:new h(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var Y0=J();if((s&50397184)!==0){var M0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,M0=x;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,M0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),M0=d;H.invoke(G0,y,{handler:Y0===null?M0:typeof M0==="function"&&Q.domainBind(Y0,M0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(x,d,e,$0,Y0);return e},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(x){this._bitField=this._bitField&-65536|x&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(H.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(x){var d=x===0?this._receiver0:this[x*4-4+3];if(d===I)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},h.prototype._promiseAt=function(x){return this[x*4-4+2]},h.prototype._fulfillmentHandlerAt=function(x){return this[x*4-4+0]},h.prototype._rejectionHandlerAt=function(x){return this[x*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(x){var{_bitField:d,_fulfillmentHandler Line truncated
path = %s
syscall = %s
fstream_type = %s
@@ -295,25 +295,25 @@ fstream_class = %s
fstream_stack =
%s
`,Y||"UNKNOWN",U.stack,U.path,U.syscall,U.fstream_type,U.fstream_path,U.fstream_unc_path,U.fstream_class,U.fstream_stack.join(`
`));else z.emit("warn",U)};C2.prototype.info=function($,Y){this.emit("info",$,Y)};C2.prototype.error=function($,Y,z){var U=aM0($,Y,this);if(z)throw U;else this.emit("error",U)};function aM0($,Y,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||Y,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var HZ=E((ma1,eM0)=>{eM0.exports=bF1;function bF1($){var Y=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&Y.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,I=Y.length;U<I;U++){z=Y[U];var Q=$[z]||$["is"+z];if(typeof Q==="function")Q=Q.call($);if(Q)return $[z]=!0,$.type=z,z}return null}});var nc=E((la1,$O0)=>{$O0.exports=XZ;var iF1=l8(),cF1=X1(),cc=ez();cF1(XZ,cc);function XZ($){var Y=this;if(!(Y instanceof XZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);cc.call(Y,$)}XZ.prototype._stat=function($){var Y=this;iF1.readlink(Y._path,function(z,U){if(z)return Y.error(z);Y.linkpath=Y.props.linkpath=U,Y.emit("linkpath",U),cc.prototype._stat.call(Y,$)})};XZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var dc=E((oa1,UO0)=>{UO0.exports=w9;var zO0=l8(),nF1=X1(),ZZ=J0("path"),pc=ez(),YO0=J0("assert").ok;nF1(w9,pc);function w9($){var Y=this;if(!(Y instanceof w9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(Y.entries=null,Y._index=-1,Y._paused=!1,Y._length=-1,$.sort)this.sort=$.sort;pc.call(this,$)}w9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,zO0.readdir($._path,function(Y,z){if(Y)return $.error(Y);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};w9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var Y=ZZ.resolve($._path,$.entries[$._index]);YO0(Y!==$._path),YO0($.entries[$._index]),$._currentEntry=Y,zO0[$.props.follow?"stat":"lstat"](Y,function(z,U){if(z)return $.error(z);var I=$._proxy||$;U.path=Y,U.basename=ZZ.basename(Y),U.dirname=ZZ.dirname(Y);var Q=$.getChildProps.call(I,U);Q.path=Y,Q.basename=ZZ.basename(Y),Q.dirname=ZZ.dirname(Y);var J=pc(Q,U);$._currentEntry=J,J.on("pause",function(W){if(!$._paused&&!J._disowned)$.pause(W)}),J.on("resume",function(W){if($._paused&&!J._disowned)$.resume(W)}),J.on("stat",function(W){if($.emit("_entryStat",J,W),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,W)});else $.emit("entryStat",J,W)}),J.on("ready",function W(){if($._paused)return J.pause($),$.once("resume",W);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var K=!1;J.on("close",G),J.on("disown",G);function G(){if(K)return;if(K=!0,$.emit("childEnd",J),$.emit("entryEnd",J),$._currentEntry=null,!$._paused)$._read()}J.on("error",function(W){if(J._swallowErrors)$.warn(W),J.emit("end"),J.emit("close");else $.emit("error",W)}),["child","childEnd","warn"].forEach(function(W){J.on(W,$.emit.bind($,W))})})};w9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};w9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};w9.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._currentEntry&&Y._currentEntry.pause)Y._currentEntry.pause($);Y.emit("pause",$)};w9.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y._paused=!1,Y.emit("resume",$),Y._paused)return;if(Y._currentEntry){if(Y._currentEntry.resume)Y._currentEntry.resume($)}else Y._read()};w9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var mc=E((ra1,KO0)=>{KO0.exports=$U;var pF1=l8(),dF1=X1(),IO0=ez(),QO0={EOF:!0},JO0={CLOSE:!0};dF1($U,IO0);function $U($){var Y=this;if(!(Y instanceof $U))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);Y._buffer=[],Y._bytesEmitted=0,IO0.call(Y,$)}$U.prototype._getStream=function(){var $=this,Y=$._stream=pF1.createReadStream($._path,$.p Line truncated
`));else z.emit("warn",U)};C2.prototype.info=function($,Y){this.emit("info",$,Y)};C2.prototype.error=function($,Y,z){var U=XO0($,Y,this);if(z)throw U;else this.emit("error",U)};function XO0($,Y,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||Y,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var qZ=E((Pt1,qO0)=>{qO0.exports=Hw1;function Hw1($){var Y=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&Y.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,I=Y.length;U<I;U++){z=Y[U];var Q=$[z]||$["is"+z];if(typeof Q==="function")Q=Q.call($);if(Q)return $[z]=!0,$.type=z,z}return null}});var oc=E((Bt1,VO0)=>{VO0.exports=VZ;var Ww1=l8(),Xw1=X1(),lc=YU();Xw1(VZ,lc);function VZ($){var Y=this;if(!(Y instanceof VZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);lc.call(Y,$)}VZ.prototype._stat=function($){var Y=this;Ww1.readlink(Y._path,function(z,U){if(z)return Y.error(z);Y.linkpath=Y.props.linkpath=U,Y.emit("linkpath",U),lc.prototype._stat.call(Y,$)})};VZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var sc=E((Tt1,wO0)=>{wO0.exports=w9;var FO0=l8(),Zw1=X1(),LZ=J0("path"),rc=YU(),LO0=J0("assert").ok;Zw1(w9,rc);function w9($){var Y=this;if(!(Y instanceof w9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(Y.entries=null,Y._index=-1,Y._paused=!1,Y._length=-1,$.sort)this.sort=$.sort;rc.call(this,$)}w9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,FO0.readdir($._path,function(Y,z){if(Y)return $.error(Y);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};w9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var Y=LZ.resolve($._path,$.entries[$._index]);LO0(Y!==$._path),LO0($.entries[$._index]),$._currentEntry=Y,FO0[$.props.follow?"stat":"lstat"](Y,function(z,U){if(z)return $.error(z);var I=$._proxy||$;U.path=Y,U.basename=LZ.basename(Y),U.dirname=LZ.dirname(Y);var Q=$.getChildProps.call(I,U);Q.path=Y,Q.basename=LZ.basename(Y),Q.dirname=LZ.dirname(Y);var J=rc(Q,U);$._currentEntry=J,J.on("pause",function(H){if(!$._paused&&!J._disowned)$.pause(H)}),J.on("resume",function(H){if($._paused&&!J._disowned)$.resume(H)}),J.on("stat",function(H){if($.emit("_entryStat",J,H),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,H)});else $.emit("entryStat",J,H)}),J.on("ready",function H(){if($._paused)return J.pause($),$.once("resume",H);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var K=!1;J.on("close",G),J.on("disown",G);function G(){if(K)return;if(K=!0,$.emit("childEnd",J),$.emit("entryEnd",J),$._currentEntry=null,!$._paused)$._read()}J.on("error",function(H){if(J._swallowErrors)$.warn(H),J.emit("end"),J.emit("close");else $.emit("error",H)}),["child","childEnd","warn"].forEach(function(H){J.on(H,$.emit.bind($,H))})})};w9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};w9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};w9.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._currentEntry&&Y._currentEntry.pause)Y._currentEntry.pause($);Y.emit("pause",$)};w9.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y._paused=!1,Y.emit("resume",$),Y._paused)return;if(Y._currentEntry){if(Y._currentEntry.resume)Y._currentEntry.resume($)}else Y._read()};w9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var ac=E((jt1,DO0)=>{DO0.exports=zU;var qw1=l8(),Vw1=X1(),MO0=YU(),OO0={EOF:!0},NO0={CLOSE:!0};Vw1(zU,MO0);function zU($){var Y=this;if(!(Y instanceof zU))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);Y._buffer=[],Y._bytesEmitted=0,MO0.call(Y,$)}zU.prototype._getStream=function(){var $=this,Y=$._stream=qw1.createReadStream($._path,$.p Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),Y.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(JO0),$._read();else $.emit("close")}),Y.on("error",function(z){$.emit("error",z)}),$._read()};$U.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var Y=$._buffer;for(var z=0,U=Y.length;z<U;z++){var I=Y[z];if(I===QO0)$.emit("end");else if(I===JO0)$.emit("close");else $.emit("data",I);if($._paused){$._buffer=Y.slice(z);return}}$._buffer.length=0}};$U.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._stream)Y._stream.pause();Y.emit("pause",$)};$U.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y.emit("resume",$),Y._paused=!1,Y._stream)Y._stream.resume();Y._read()}});var HO0=E((sa1,WO0)=>{WO0.exports=eP;var mF1=X1(),GO0=ez();mF1(eP,GO0);function eP($){var Y=this;if(!(Y instanceof eP))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);GO0.call(Y,$)}eP.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var oc=E((aa1,XO0)=>{XO0.exports=YU;var lc=ez(),lF1=HZ(),oF1=X1(),rF1=l8();oF1(YU,lc);function YU($){var Y=this;if(!(Y instanceof YU))throw Error("ProxyReader must be called as constructor.");Y.props=$,Y._buffer=[],Y.ready=!1,lc.call(Y,$)}YU.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";rF1[z](Y.path,function(U,I){var Q;if(U||!I)Q="File";else Q=lF1(I);Y[Q]=!0,Y.type=$.type=Q,$._old=I,$._addProxy(lc(Y,I))})};YU.prototype._addProxy=function($){var Y=this;if(Y._proxyTarget)return Y.error("proxy already set");Y._proxyTarget=$,$._proxy=Y,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$),$.on("ready",function(){Y.ready=!0,Y.emit("ready")});var z=Y._buffer;Y._buffer.length=0,z.forEach(function(U){$[U[0]].apply($,U[1])})};YU.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};YU.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var ez=E((ta1,VO0)=>{VO0.exports=O5;var sF1=l8(),aF1=J0("stream").Stream,tF1=X1(),rc=J0("path"),sc=HZ(),$B=O5.hardLinks={},ZO0=tP();tF1(O5,ZO0);var qO0=nc();function O5($,Y){var z=this;if(!(z instanceof O5))return new O5($,Y);if(typeof $==="string")$={path:$};var U,I;if($.type&&typeof $.type==="function")U=$.type,I=U;else U=sc($),I=O5;if(Y&&!U)U=sc(Y),$[U]=!0,$.type=U;switch(U){case"Directory":I=dc();break;case"Link":case"File":I=mc();break;case"SymbolicLink":I=qO0;break;case"Socket":I=HO0();break;case null:I=oc();break}if(!(z instanceof I))return new I($);if(ZO0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=U,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=rc.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=rc.basename(z.path),z.dirname=$.dirname=rc.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=eF1;z._stat(Y)}function eF1($,Y){return $===Y?0:$.toLowerCase()>Y.toLowerCase()?1:$.toLowerCase()<Y.toLowerCase()?-1:$>Y?1:-1}O5.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat";if($)process.nextTick(I.bind(null,null,$));else sF1[U](Y._path,I);function I(Q,J){if(Q)return Y.error(Q);if(Object.keys(J).forEach(function(q){z[q]=J[q]}),Y.size!==void 0&&z.size!==Y.size)return Y.error("incorrect size");Y.size=z.size;var K=sc(z),G=z.hardlinks!==!1;if(G&&K!=="Directory"&&z.nlink&&z.nlink>1){var W=z.dev+":"+z.ino;if($B[W]===Y._path||!$B[W])$B[W]=Y._path;else K=Y.type=Y.props.type="Link",Y.Link=Y.props.Link=!0,Y.linkpath=Y.props.linkpath=$B[W],Y._stat=Y._read=qO0.prototype._read}if(Y.type&&Y.type!==K)Y.error("Unexpected type: "+K);if(Y.filter){var H=Y._proxy||Y;if(!Y.filter.call(H,H,z)){if(!Y._disowned)Y.abort(),Y.emit("end"),Y.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(Y._aborted){Y.emit("end"),Y.emit("close");return}if(Y._paused&&Y.type!=="Directory"){Y.once("resume",q);return}var V=X[Z++];if(!V)return Y._read();Y.emit(V,z),q()})()}};O5.prototype.pipe=function($){var Y=this;if(typeof $.add==="function")Y.on("entry",function(z){var U=$.add(z);if(U===!1)Y.pause()});return aF1.prototype.pipe.apply(this,arguments)};O5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};O5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};O5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var $n=E((ea1,PO0)=> Line truncated
actual: `+$._bytesEmitted)}),Y.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(NO0),$._read();else $.emit("close")}),Y.on("error",function(z){$.emit("error",z)}),$._read()};zU.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var Y=$._buffer;for(var z=0,U=Y.length;z<U;z++){var I=Y[z];if(I===OO0)$.emit("end");else if(I===NO0)$.emit("close");else $.emit("data",I);if($._paused){$._buffer=Y.slice(z);return}}$._buffer.length=0}};zU.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._stream)Y._stream.pause();Y.emit("pause",$)};zU.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y.emit("resume",$),Y._paused=!1,Y._stream)Y._stream.resume();Y._read()}});var BO0=E((Et1,PO0)=>{PO0.exports=IP;var Lw1=X1(),AO0=YU();Lw1(IP,AO0);function IP($){var Y=this;if(!(Y instanceof IP))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);AO0.call(Y,$)}IP.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var ec=E((Ct1,TO0)=>{TO0.exports=UU;var tc=YU(),Fw1=qZ(),ww1=X1(),Mw1=l8();ww1(UU,tc);function UU($){var Y=this;if(!(Y instanceof UU))throw Error("ProxyReader must be called as constructor.");Y.props=$,Y._buffer=[],Y.ready=!1,tc.call(Y,$)}UU.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";Mw1[z](Y.path,function(U,I){var Q;if(U||!I)Q="File";else Q=Fw1(I);Y[Q]=!0,Y.type=$.type=Q,$._old=I,$._addProxy(tc(Y,I))})};UU.prototype._addProxy=function($){var Y=this;if(Y._proxyTarget)return Y.error("proxy already set");Y._proxyTarget=$,$._proxy=Y,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$),$.on("ready",function(){Y.ready=!0,Y.emit("ready")});var z=Y._buffer;Y._buffer.length=0,z.forEach(function(U){$[U[0]].apply($,U[1])})};UU.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};UU.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var YU=E((Rt1,CO0)=>{CO0.exports=O5;var Ow1=l8(),Nw1=J0("stream").Stream,Dw1=X1(),$n=J0("path"),Yn=qZ(),QP=O5.hardLinks={},jO0=UP();Dw1(O5,jO0);var EO0=oc();function O5($,Y){var z=this;if(!(z instanceof O5))return new O5($,Y);if(typeof $==="string")$={path:$};var U,I;if($.type&&typeof $.type==="function")U=$.type,I=U;else U=Yn($),I=O5;if(Y&&!U)U=Yn(Y),$[U]=!0,$.type=U;switch(U){case"Directory":I=sc();break;case"Link":case"File":I=ac();break;case"SymbolicLink":I=EO0;break;case"Socket":I=BO0();break;case null:I=ec();break}if(!(z instanceof I))return new I($);if(jO0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=U,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=$n.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=$n.basename(z.path),z.dirname=$.dirname=$n.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=Aw1;z._stat(Y)}function Aw1($,Y){return $===Y?0:$.toLowerCase()>Y.toLowerCase()?1:$.toLowerCase()<Y.toLowerCase()?-1:$>Y?1:-1}O5.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat";if($)process.nextTick(I.bind(null,null,$));else Ow1[U](Y._path,I);function I(Q,J){if(Q)return Y.error(Q);if(Object.keys(J).forEach(function(q){z[q]=J[q]}),Y.size!==void 0&&z.size!==Y.size)return Y.error("incorrect size");Y.size=z.size;var K=Yn(z),G=z.hardlinks!==!1;if(G&&K!=="Directory"&&z.nlink&&z.nlink>1){var H=z.dev+":"+z.ino;if(QP[H]===Y._path||!QP[H])QP[H]=Y._path;else K=Y.type=Y.props.type="Link",Y.Link=Y.props.Link=!0,Y.linkpath=Y.props.linkpath=QP[H],Y._stat=Y._read=EO0.prototype._read}if(Y.type&&Y.type!==K)Y.error("Unexpected type: "+K);if(Y.filter){var W=Y._proxy||Y;if(!Y.filter.call(W,W,z)){if(!Y._disowned)Y.abort(),Y.emit("end"),Y.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(Y._aborted){Y.emit("end"),Y.emit("close");return}if(Y._paused&&Y.type!=="Directory"){Y.once("resume",q);return}var V=X[Z++];if(!V)return Y._read();Y.emit(V,z),q()})()}};O5.prototype.pipe=function($){var Y=this;if(typeof $.add==="function")Y.on("entry",function(z){var U=$.add(z);if(U===!1)Y.pause()});return Nw1.prototype.pipe.apply(this,arguments)};O5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};O5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};O5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Qn=E((_t1,kO0)=> Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);XB.prototype._finish.call($)}});var Xn=E((wt1,XN0)=>{XN0.exports=S2;var Hn=bJ(),jw1=HZ(),Ew1=X1(),Cw1=WB(),Rw1=J0("fs");Ew1(S2,Hn);function S2($){var Y=this;if(!(Y instanceof S2))throw Error("ProxyWriter must be called as constructor.");Y.props=$,Y._needDrain=!1,Hn.call(Y,$)}S2.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";Rw1[z](Y.path,function(U,I){var Q;if(U||!I)Q="File";else Q=jw1(I);Y[Q]=!0,Y.type=$.type=Q,$._old=I,$._addProxy(Hn(Y,I))})};S2.prototype._addProxy=function($){var Y=this;if(Y._proxy)return Y.error("proxy already set");Y._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$);var z=Y._buffer;if(z.forEach(function(U){$[U[0]].apply($,U[1])}),Y._buffer.length=0,Y._needsDrain)Y.emit("drain")};S2.prototype.add=function($){if(Cw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};S2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};S2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var bJ=E((Mt1,NN0)=>{NN0.exports=f$;var x$=l8(),_w1=X1(),vw1=$n(),hw1=Qn(),FZ=J0("path"),qN0=process.platform==="win32"?0:process.umask(),VN0=HZ(),LN0=tP();_w1(f$,LN0);f$.dirmode=parseInt("0777",8)&~qN0;f$.filemode=parseInt("0666",8)&~qN0;var Sw1=Kn(),gw1=Gn(),yw1=Wn(),kw1=Xn();function f$($,Y){var z=this;if(typeof $==="string")$={path:$};var U=VN0($),I=f$;switch(U){case"Directory":I=Sw1;break;case"File":I=yw1;break;case"Link":case"SymbolicLink":I=gw1;break;case null:default:I=kw1;break}if(!(z instanceof I))return new I($);if(LN0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=FZ.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=FZ.basename($.path),z.dirname=FZ.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(Y)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(Y){if(Y)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat",I=Y._proxy||Y;if($)Q(null,$);else x$[U](Y._path,Q);function Q(J,K){if(Y.filter&&!Y.filter.call(I,I,K)){Y._aborted=!0,Y.emit("end"),Y.emit("close");return}if(J||!K)return Zn(Y);Y._old=K;var G=VN0(K);if(G!==Y.type||Y.type==="File"&&K.nlink>1)return vw1(Y._path,function(W){if(W)return Y.error(W);Y._old=null,Zn(Y)});Zn(Y)}};function Zn($){hw1(FZ.dirname($._path),f$.dirmode,function(Y,z){if(Y)return $.error(Y);return $._madeDir=z,$._create()})}function FN0($,Y,z,U,I){var Q=Y.mode,J=Y.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[J])return I();if(typeof Q!=="number")return I();var K=z.mode&parseInt("0777",8);if(Q=Q&parseInt("0777",8),Q===K)return I();x$[J](U,Q,I)}function wN0($,Y,z,U,I){if(process.platform==="win32")return I();if(!process.getuid||process.getuid()!==0)return I();if(typeof Y.uid!=="number"&&typeof Y.gid!=="number")return I();if(z.uid===Y.uid&&z.gid===Y.gid)return I();var Q=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[Q])return I();if(typeof Y.uid!=="number")Y.uid=z.uid;if(typeof Y.gid!=="number")Y.gid=z.gid;x$[Q](U,Y.uid,Y.gid,I)}function MN0($,Y,z,U,I){if(!x$.utimes||process.platform==="win32")return I();var Q=Y.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Q==="lutimes"&&!x$[Q])Q="utimes";if(!x$[Q])return I();var{atime:J,mtime:K}=z,G=Y.atime,W=Y.mtime;if(G===void 0)G=J;if(W===void 0)W=K;if(!ZN0(G))G=new Date(G);if(!ZN0(W))G=new Date(W);if(G.getTime()===J.getTime()&&W.getTime()===K.getTime())return I();x$[Q](U,G,W,I)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var Y=0,z=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Q($._old);else{var I=$.props.follow?"stat":"lstat";x$[I]($._path,function(K,G){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);Q($._old=G)})}return;function Q(K){Y+=3,FN0($,$.props,K,$._path,J("chmod")),wN0($,$.props,K,$._path,J("chown")),MN0($,$.props,K,$._path,J("utimes"))}function J(K){return function(G){if(z)return;if(G)return G.fstream_finish_call=K,$.error(z=G);if(--Y>0)return;if(U)return;if(U=!0,!$._madeDir)return W();else ON0($,$._path,W);function W(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function ON0($,Y,z){var U=$._madeDir,I=FZ.dirname(Y);xw1($,I,function(Q){if(Q)return z(Q);if(I===U)return z();ON0($,I,z)})}function xw1($,Y,z){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var I=3,Q=null;x$.stat(Y,function(K,G){if(K)return z(Q=K);FN0($,U,G,Y,J),wN0($,U,G,Y,J),MN0($,U,G,Y,J)});function J(K){if(Q)return;if(K)return z(Q=K);if(--I===0)return z()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function fw1($){return Object.prototype.toString.call($)}function ZN0($){return typeof $==="object"&&fw1($)==="[object Date]"}});var wn=E((uw1)=>{uw1.Abstract=tP();uw1.Reader=ez();uw1.Writer=bJ();uw1.File={Reader:mc(),Writer:Wn()};uw1.Dir={Reader:dc(),Writer:Kn()};uw1.Link={Reader:nc(),Writer:Gn()};uw1.Proxy={Reader:oc(),Writer:Xn()};uw1.Reader.Dir=uw1.DirReader=uw1.Dir.Reader;uw1.Reader.File=uw1.FileReader=uw1.File.Reader;uw1.Reader.Link=uw1.LinkReader=uw1.Link.Reader;uw1.Reader.Proxy=uw1.ProxyReader=uw1.Proxy.Reader;uw1.Writer.Dir=uw1.DirWriter=uw1.Dir.Writer;uw1.Writer.File=uw1.FileWriter=uw1.File.Writer;uw1.Writer.Link=uw1.LinkWriter=uw1.Link.Writer;uw1.Writer.Proxy=uw1.ProxyWriter=uw1.Proxy.Writer;uw1.collect=WB()});var PN0=E((Ct1,DN0)=>{DN0.exports=lw1;var cw1=nP(),nw1=wn().Writer,Mn=J0("path"),pw1=J0("stream"),dw1=bc(),mw1=j2();function lw1($){$.path=Mn.resolve(Mn.normalize($.path));var Y=new cw1($),z=new pw1.Writable({objectMode:!0});z._write=function(I,Q,J){if(I.type=="Directory")return J();var K=Mn.join($.path,I.path);if(K.indexOf($.path)!=0)return J();let G=$.getWriter?$.getWriter({path:K}):nw1({path:K});I.pipe(G).on("error",J).on("close",J)};var U=dw1(Y,z);return Y.once("crx-header",function(I){U.crxHeader=I}),Y.pipe(z).on("finish",function(){U.emit("close")}),U.promise=function(){return new mw1(function(I,Q){U.on("close",I),U.on("error",Q)})},U}});var BN0=E((Rt1,ZB)=>{var j6=function($){var Y=1e7,z=7,U=9007199254740992,I=Z(U),Q="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function K(B,v,u,r){if(typeof B>"u")return K[0];if(typeof v<"u")return+v===10&&!u?P0(B):f0(B,v,u,r);return P0(B)}function G(B,v){this.value=B,this.sign=v,this.isSmall=!1}G.prototype=Object.create(K.prototype);function W(B){this.value=B,this.sign=B<0,this.isSmall=!0}W.prototype=Object.create(K.prototype);function H(B){ Line truncated
actual: `+$._bytesWritten);FP.prototype._finish.call($)}});var Fn=E((ot1,TN0)=>{TN0.exports=S2;var Ln=cJ(),rw1=qZ(),sw1=X1(),aw1=VP(),tw1=J0("fs");sw1(S2,Ln);function S2($){var Y=this;if(!(Y instanceof S2))throw Error("ProxyWriter must be called as constructor.");Y.props=$,Y._needDrain=!1,Ln.call(Y,$)}S2.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";tw1[z](Y.path,function(U,I){var Q;if(U||!I)Q="File";else Q=rw1(I);Y[Q]=!0,Y.type=$.type=Q,$._old=I,$._addProxy(Ln(Y,I))})};S2.prototype._addProxy=function($){var Y=this;if(Y._proxy)return Y.error("proxy already set");Y._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$);var z=Y._buffer;if(z.forEach(function(U){$[U[0]].apply($,U[1])}),Y._buffer.length=0,Y._needsDrain)Y.emit("drain")};S2.prototype.add=function($){if(aw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};S2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};S2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var cJ=E((rt1,gN0)=>{gN0.exports=f$;var x$=l8(),ew1=X1(),$M1=Qn(),YM1=Wn(),OZ=J0("path"),EN0=process.platform==="win32"?0:process.umask(),CN0=qZ(),RN0=UP();ew1(f$,RN0);f$.dirmode=parseInt("0777",8)&~EN0;f$.filemode=parseInt("0666",8)&~EN0;var zM1=Zn(),UM1=qn(),IM1=Vn(),QM1=Fn();function f$($,Y){var z=this;if(typeof $==="string")$={path:$};var U=CN0($),I=f$;switch(U){case"Directory":I=zM1;break;case"File":I=IM1;break;case"Link":case"SymbolicLink":I=UM1;break;case null:default:I=QM1;break}if(!(z instanceof I))return new I($);if(RN0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=OZ.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=OZ.basename($.path),z.dirname=OZ.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(Y)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(Y){if(Y)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat",I=Y._proxy||Y;if($)Q(null,$);else x$[U](Y._path,Q);function Q(J,K){if(Y.filter&&!Y.filter.call(I,I,K)){Y._aborted=!0,Y.emit("end"),Y.emit("close");return}if(J||!K)return wn(Y);Y._old=K;var G=CN0(K);if(G!==Y.type||Y.type==="File"&&K.nlink>1)return $M1(Y._path,function(H){if(H)return Y.error(H);Y._old=null,wn(Y)});wn(Y)}};function wn($){YM1(OZ.dirname($._path),f$.dirmode,function(Y,z){if(Y)return $.error(Y);return $._madeDir=z,$._create()})}function _N0($,Y,z,U,I){var Q=Y.mode,J=Y.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[J])return I();if(typeof Q!=="number")return I();var K=z.mode&parseInt("0777",8);if(Q=Q&parseInt("0777",8),Q===K)return I();x$[J](U,Q,I)}function vN0($,Y,z,U,I){if(process.platform==="win32")return I();if(!process.getuid||process.getuid()!==0)return I();if(typeof Y.uid!=="number"&&typeof Y.gid!=="number")return I();if(z.uid===Y.uid&&z.gid===Y.gid)return I();var Q=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[Q])return I();if(typeof Y.uid!=="number")Y.uid=z.uid;if(typeof Y.gid!=="number")Y.gid=z.gid;x$[Q](U,Y.uid,Y.gid,I)}function hN0($,Y,z,U,I){if(!x$.utimes||process.platform==="win32")return I();var Q=Y.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Q==="lutimes"&&!x$[Q])Q="utimes";if(!x$[Q])return I();var{atime:J,mtime:K}=z,G=Y.atime,H=Y.mtime;if(G===void 0)G=J;if(H===void 0)H=K;if(!jN0(G))G=new Date(G);if(!jN0(H))G=new Date(H);if(G.getTime()===J.getTime()&&H.getTime()===K.getTime())return I();x$[Q](U,G,H,I)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var Y=0,z=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Q($._old);else{var I=$.props.follow?"stat":"lstat";x$[I]($._path,function(K,G){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);Q($._old=G)})}return;function Q(K){Y+=3,_N0($,$.props,K,$._path,J("chmod")),vN0($,$.props,K,$._path,J("chown")),hN0($,$.props,K,$._path,J("utimes"))}function J(K){return function(G){if(z)return;if(G)return G.fstream_finish_call=K,$.error(z=G);if(--Y>0)return;if(U)return;if(U=!0,!$._madeDir)return H();else SN0($,$._path,H);function H(W){if(W)return W.fstream_finish_call="setupMadeDir",$.error(W);$.emit("end"),$.emit("close")}}}};function SN0($,Y,z){var U=$._madeDir,I=OZ.dirname(Y);JM1($,I,function(Q){if(Q)return z(Q);if(I===U)return z();SN0($,I,z)})}function JM1($,Y,z){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var I=3,Q=null;x$.stat(Y,function(K,G){if(K)return z(Q=K);_N0($,U,G,Y,J),vN0($,U,G,Y,J),hN0($,U,G,Y,J)});function J(K){if(Q)return;if(K)return z(Q=K);if(--I===0)return z()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function KM1($){return Object.prototype.toString.call($)}function jN0($){return typeof $==="object"&&KM1($)==="[object Date]"}});var An=E((GM1)=>{GM1.Abstract=UP();GM1.Reader=YU();GM1.Writer=cJ();GM1.File={Reader:ac(),Writer:Vn()};GM1.Dir={Reader:sc(),Writer:Zn()};GM1.Link={Reader:oc(),Writer:qn()};GM1.Proxy={Reader:ec(),Writer:Fn()};GM1.Reader.Dir=GM1.DirReader=GM1.Dir.Reader;GM1.Reader.File=GM1.FileReader=GM1.File.Reader;GM1.Reader.Link=GM1.LinkReader=GM1.Link.Reader;GM1.Reader.Proxy=GM1.ProxyReader=GM1.Proxy.Reader;GM1.Writer.Dir=GM1.DirWriter=GM1.Dir.Writer;GM1.Writer.File=GM1.FileWriter=GM1.File.Writer;GM1.Writer.Link=GM1.LinkWriter=GM1.Link.Writer;GM1.Writer.Proxy=GM1.ProxyWriter=GM1.Proxy.Writer;GM1.collect=VP()});var kN0=E((Qe1,yN0)=>{yN0.exports=FM1;var XM1=oA(),ZM1=An().Writer,Pn=J0("path"),qM1=J0("stream"),VM1=dc(),LM1=j2();function FM1($){$.path=Pn.resolve(Pn.normalize($.path));var Y=new XM1($),z=new qM1.Writable({objectMode:!0});z._write=function(I,Q,J){if(I.type=="Directory")return J();var K=Pn.join($.path,I.path);if(K.indexOf($.path)!=0)return J();let G=$.getWriter?$.getWriter({path:K}):ZM1({path:K});I.pipe(G).on("error",J).on("close",J)};var U=VM1(Y,z);return Y.once("crx-header",function(I){U.crxHeader=I}),Y.pipe(z).on("finish",function(){U.emit("close")}),U.promise=function(){return new LM1(function(I,Q){U.on("close",I),U.on("error",Q)})},U}});var xN0=E((Je1,wP)=>{var j6=function($){var Y=1e7,z=7,U=9007199254740992,I=Z(U),Q="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function K(P,v,u,r){if(typeof P>"u")return K[0];if(typeof v<"u")return+v===10&&!u?A0(P):f0(P,v,u,r);return A0(P)}function G(P,v){this.value=P,this.sign=v,this.isSmall=!1}G.prototype=Object.create(K.prototype);function H(P){this.value=P,this.sign=P<0,this.isSmall=!0}H.prototype=Object.create(K.prototype);function W(P){ Line truncated
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var q4=J0("fs"),MB=J0("os"),E6=J0("path"),kN0=J0("crypto"),M9={fs:q4.constants,os:MB.constants},bN0=/XXXXXX/,iN0=(M9.O_CREAT||M9.fs.O_CREAT)|(M9.O_EXCL||M9.fs.O_EXCL)|(M9.O_RDWR||M9.fs.O_RDWR),wM1=MB.platform()==="win32",MM1=M9.EBADF||M9.os.errno.EBADF,OM1=M9.ENOENT||M9.os.errno.ENOENT,cJ=[],cN0=q4.rmdirSync.bind(q4),nN0=!1;function NM1($,Y){return q4.rm($,{recursive:!0},Y)}function pN0($){return q4.rmSync($,{recursive:!0})}function Bn($,Y){let z=nJ($,Y),U=z[0],I=z[1];_M1(U,function(Q,J){if(Q)return I(Q);let K=J.tries;(function G(){try{let W=mN0(J);q4.stat(W,function(H){if(!H){if(K-- >0)return G();return I(Error("Could not get a unique tmp filename, max tries reached "+W))}I(null,W)})}catch(W){I(W)}})()})}function An($){let Y=nJ($),z=Y[0],U=vM1(z),I=U.tries;do{let Q=mN0(U);try{q4.statSync(Q)}catch(J){return Q}}while(I-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function DM1($,Y){let z=nJ($,Y),U=z[0],I=z[1];Bn(U,function(J,K){if(J)return I(J);q4.open(K,iN0,U.mode||384,function(W,H){if(W)return I(W);if(U.discardDescriptor)return q4.close(H,function(Z){return I(Z,K,void 0,Dn(K,-1,U,!1))});else{let X=U.discardDescriptor||U.detachDescriptor;I(null,K,H,Dn(K,X?-1:H,U,!1))}})})}function PM1($){let Y=nJ($),z=Y[0],U=z.discardDescriptor||z.detachDescriptor,I=An(z),Q=q4.openSync(I,iN0,z.mode||384);if(z.discardDescriptor)q4.closeSync(Q),Q=void 0;return{name:I,fd:Q,removeCallback:Dn(I,U?-1:Q,z,!0)}}function BM1($,Y){let z=nJ($,Y),U=z[0],I=z[1];Bn(U,function(J,K){if(J)return I(J);q4.mkdir(K,U.mode||448,function(W){if(W)return I(W);I(null,K,dN0(K,U,!1))})})}function AM1($){let Y=nJ($),z=Y[0],U=An(z);return q4.mkdirSync(U,z.mode||448),{name:U,removeCallback:dN0(U,z,!0)}}function TM1($,Y){let z=function(U){if(U&&!Pn(U))return Y(U);Y()};if(0<=$[0])q4.close($[0],function(){q4.unlink($[1],z)});else q4.unlink($[1],z)}function jM1($){let Y=null;try{if(0<=$[0])q4.closeSync($[0])}catch(z){if(!hM1(z)&&!Pn(z))throw z}finally{try{q4.unlinkSync($[1])}catch(z){if(!Pn(z))Y=z}}if(Y!==null)throw Y}function Dn($,Y,z,U){let I=wB(jM1,[Y,$],U),Q=wB(TM1,[Y,$],U,I);if(!z.keep)cJ.unshift(I);return U?I:Q}function dN0($,Y,z){let U=Y.unsafeCleanup?NM1:q4.rmdir.bind(q4),I=Y.unsafeCleanup?pN0:cN0,Q=wB(I,$,z),J=wB(U,$,z,Q);if(!Y.keep)cJ.unshift(Q);return z?Q:J}function wB($,Y,z,U){let I=!1;return function Q(J){if(!I){let K=U||Q,G=cJ.indexOf(K);if(G>=0)cJ.splice(G,1);if(I=!0,z||$===cN0||$===pN0)return $(Y);else return $(Y,J||function(){})}}}function EM1(){if(!nN0)return;while(cJ.length)try{cJ[0]()}catch($){}}function xN0($){let Y=[],z=null;try{z=kN0.randomBytes($)}catch(U){z=kN0.pseudoRandomBytes($)}for(let U=0;U<$;U++)Y.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[U]%62]);return Y.join("")}function r8($){return typeof $>"u"}function nJ($,Y){if(typeof $==="function")return[{},$];if(r8($))return[{},Y];let z={};for(let U of Object.getOwnPropertyNames($))z[U]=$[U];return[z,Y]}function CM1($,Y,z){let U=E6.isAbsolute($)?$:E6.join(Y,$);q4.stat(U,function(I){if(I)q4.realpath(E6.dirname(U),function(Q,J){if(Q)return z(Q);z(null,E6.join(J,E6.basename(U)))});else q4.realpath(U,z)})}function RM1($,Y){let z=E6.isAbsolute($)?$:E6.join(Y,$);try{return q4.statSync(z),q4.realpathSync(z)}catch(U){let I=q4.realpathSync(E6.dirname(z));return E6.join(I,E6.basename(z))}}function mN0($){let Y=$.tmpdir;if(!r8($.name))return E6.join(Y,$.dir,$.name);if(!r8($.template))return E6.join(Y,$.dir,$.template).replace(bN0,xN0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",xN0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(Y,$.dir,z)}function Nn($,Y){if(typeof Y!=="string")throw Error(`${$} option must be a string, got "${typeof Y}".`);if(Y.includes(".."))throw Error("Relative value not allowed");return Y}function lN0($){if(!r8($.name)){let Y=$.name;if(E6.isAbsolute(Y))throw Error(`name option must not contain an absolute path, found "${Y}".`);let z=E6.basename(Y);if(z===".."||z==="."||z!==Y)throw Error(`name option must not contain a path, found "${Y}".`)}if(!r8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(bN0))throw Error(`Invalid template, found "${$.template}".`)}if(!r8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r8($.prefix)?"":Nn("prefix",$.prefix),$.postfix=r8($.postfix)?"":Nn("postfix",$.postfix),$.template=r8($.template)?void 0:Nn("template",$.template)}function fN0($,Y,z,U){if(r8(Y))return U(null);CM1(Y,z,function(I,Q){if(I)return U(I);let J=E6.relative(z,Q);if(J.startsWith("..")||E6.isAbsolute(J))return U(Error(`${$} option must be relative to "${z}", found "${J}".`));U(null,J)})}function uN0($,Y,z){if(r8(Y))return;let U=RM1(Y,z),I=E6.relative(z,U);if(I.startsWith("..")||E6.isAbsolute(I))thrLine truncated
*/var V4=J0("fs"),PP=J0("os"),E6=J0("path"),sN0=J0("crypto"),M9={fs:V4.constants,os:PP.constants},$D0=/XXXXXX/,YD0=(M9.O_CREAT||M9.fs.O_CREAT)|(M9.O_EXCL||M9.fs.O_EXCL)|(M9.O_RDWR||M9.fs.O_RDWR),bM1=PP.platform()==="win32",iM1=M9.EBADF||M9.os.errno.EBADF,cM1=M9.ENOENT||M9.os.errno.ENOENT,pJ=[],zD0=V4.rmdirSync.bind(V4),UD0=!1;function nM1($,Y){return V4.rm($,{recursive:!0},Y)}function ID0($){return V4.rmSync($,{recursive:!0})}function Cn($,Y){let z=dJ($,Y),U=z[0],I=z[1];eM1(U,function(Q,J){if(Q)return I(Q);let K=J.tries;(function G(){try{let H=JD0(J);V4.stat(H,function(W){if(!W){if(K-- >0)return G();return I(Error("Could not get a unique tmp filename, max tries reached "+H))}I(null,H)})}catch(H){I(H)}})()})}function Rn($){let Y=dJ($),z=Y[0],U=$O1(z),I=U.tries;do{let Q=JD0(U);try{V4.statSync(Q)}catch(J){return Q}}while(I-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function pM1($,Y){let z=dJ($,Y),U=z[0],I=z[1];Cn(U,function(J,K){if(J)return I(J);V4.open(K,YD0,U.mode||384,function(H,W){if(H)return I(H);if(U.discardDescriptor)return V4.close(W,function(Z){return I(Z,K,void 0,jn(K,-1,U,!1))});else{let X=U.discardDescriptor||U.detachDescriptor;I(null,K,W,jn(K,X?-1:W,U,!1))}})})}function dM1($){let Y=dJ($),z=Y[0],U=z.discardDescriptor||z.detachDescriptor,I=Rn(z),Q=V4.openSync(I,YD0,z.mode||384);if(z.discardDescriptor)V4.closeSync(Q),Q=void 0;return{name:I,fd:Q,removeCallback:jn(I,U?-1:Q,z,!0)}}function mM1($,Y){let z=dJ($,Y),U=z[0],I=z[1];Cn(U,function(J,K){if(J)return I(J);V4.mkdir(K,U.mode||448,function(H){if(H)return I(H);I(null,K,QD0(K,U,!1))})})}function lM1($){let Y=dJ($),z=Y[0],U=Rn(z);return V4.mkdirSync(U,z.mode||448),{name:U,removeCallback:QD0(U,z,!0)}}function oM1($,Y){let z=function(U){if(U&&!En(U))return Y(U);Y()};if(0<=$[0])V4.close($[0],function(){V4.unlink($[1],z)});else V4.unlink($[1],z)}function rM1($){let Y=null;try{if(0<=$[0])V4.closeSync($[0])}catch(z){if(!YO1(z)&&!En(z))throw z}finally{try{V4.unlinkSync($[1])}catch(z){if(!En(z))Y=z}}if(Y!==null)throw Y}function jn($,Y,z,U){let I=AP(rM1,[Y,$],U),Q=AP(oM1,[Y,$],U,I);if(!z.keep)pJ.unshift(I);return U?I:Q}function QD0($,Y,z){let U=Y.unsafeCleanup?nM1:V4.rmdir.bind(V4),I=Y.unsafeCleanup?ID0:zD0,Q=AP(I,$,z),J=AP(U,$,z,Q);if(!Y.keep)pJ.unshift(Q);return z?Q:J}function AP($,Y,z,U){let I=!1;return function Q(J){if(!I){let K=U||Q,G=pJ.indexOf(K);if(G>=0)pJ.splice(G,1);if(I=!0,z||$===zD0||$===ID0)return $(Y);else return $(Y,J||function(){})}}}function sM1(){if(!UD0)return;while(pJ.length)try{pJ[0]()}catch($){}}function aN0($){let Y=[],z=null;try{z=sN0.randomBytes($)}catch(U){z=sN0.pseudoRandomBytes($)}for(let U=0;U<$;U++)Y.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[U]%62]);return Y.join("")}function r8($){return typeof $>"u"}function dJ($,Y){if(typeof $==="function")return[{},$];if(r8($))return[{},Y];let z={};for(let U of Object.getOwnPropertyNames($))z[U]=$[U];return[z,Y]}function aM1($,Y,z){let U=E6.isAbsolute($)?$:E6.join(Y,$);V4.stat(U,function(I){if(I)V4.realpath(E6.dirname(U),function(Q,J){if(Q)return z(Q);z(null,E6.join(J,E6.basename(U)))});else V4.realpath(U,z)})}function tM1($,Y){let z=E6.isAbsolute($)?$:E6.join(Y,$);try{return V4.statSync(z),V4.realpathSync(z)}catch(U){let I=V4.realpathSync(E6.dirname(z));return E6.join(I,E6.basename(z))}}function JD0($){let Y=$.tmpdir;if(!r8($.name))return E6.join(Y,$.dir,$.name);if(!r8($.template))return E6.join(Y,$.dir,$.template).replace($D0,aN0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",aN0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(Y,$.dir,z)}function Tn($,Y){if(typeof Y!=="string")throw Error(`${$} option must be a string, got "${typeof Y}".`);if(Y.includes(".."))throw Error("Relative value not allowed");return Y}function KD0($){if(!r8($.name)){let Y=$.name;if(E6.isAbsolute(Y))throw Error(`name option must not contain an absolute path, found "${Y}".`);let z=E6.basename(Y);if(z===".."||z==="."||z!==Y)throw Error(`name option must not contain a path, found "${Y}".`)}if(!r8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match($D0))throw Error(`Invalid template, found "${$.template}".`)}if(!r8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r8($.prefix)?"":Tn("prefix",$.prefix),$.postfix=r8($.postfix)?"":Tn("postfix",$.postfix),$.template=r8($.template)?void 0:Tn("template",$.template)}function tN0($,Y,z,U){if(r8(Y))return U(null);aM1(Y,z,function(I,Q){if(I)return U(I);let J=E6.relative(z,Q);if(J.startsWith("..")||E6.isAbsolute(J))return U(Error(`${$} option must be relative to "${z}", found "${J}".`));U(null,J)})}function eN0($,Y,z){if(r8(Y))return;let U=tM1(Y,z),I=E6.relative(z,U);if(I.startsWith("..")||E6.isAbsolute(I))thrLine truncated
`)}let U=[];Y.forEach((I,Q)=>{let J=$.length+Q+1,K=Q===0?"⏳ ":"";U.push(`${K}${J}. ${I}`)});for(let I=$.length-1;I>=0;I--){let Q=I+1;U.push(`${Q}. ${$[I]}`)}return U.join(`
`)}function yn($,Y,z,U,I){let Q=$?.operator||Y?.operator||z?.operator,J=Q?.name||Q?.id||z?.operatorName||"",K=($?.nodeName||Y?.fromNodeName||Y?.nodeName||z?.nodeName||"").trim();if(K==="合思审批节点"||K==="外部审批节点"||K.includes("合思审批")||K.includes("外部审批"))K="";if((!K||K==="提交人"||K==="审批节点")&&J&&U){let M=U.find((w)=>w.operator?.name===J&&w.nodeName&&w.nodeName.trim()!=="提交人"&&!w.isEbot&&w.rawAction!=="freeflow.reject");if(M?.nodeName)K=M.nodeName.trim()}let W=$?.comment||Y?.reason||z?.rejectComment||"修改";if(W.includes(":")){let M=W.split(":");if(M.length>1)W=M.slice(1).join(":").trim()}let H=W;if(K&&J)H=`${K}(${J}) ❌: ${W}`;else if(J)H=`${J} ❌: ${W}`;else if(K)H=`${K} ❌: ${W}`;else H=W;let X=$?.rejectTargetNodeName||Y?.targetNodeName||"提交人",Z=$?.rejectTargetOperator?.name||Y?.targetOperator?.name||I?.submitter?.name,q=Z?`${X}(${Z})`:X,V=$?.resubmitRuleText||Y?.resubmitRuleText||(J?`重新提交后由${J}继续审批`:"重新提交后继续审批");return{comment:`${H}
`)}function bn($,Y,z,U,I){let Q=$?.operator||Y?.operator||z?.operator,J=Q?.name||Q?.id||z?.operatorName||"",K=($?.nodeName||Y?.fromNodeName||Y?.nodeName||z?.nodeName||"").trim();if(K==="合思审批节点"||K==="外部审批节点"||K.includes("合思审批")||K.includes("外部审批"))K="";if((!K||K==="提交人"||K==="审批节点")&&J&&U){let M=U.find((w)=>w.operator?.name===J&&w.nodeName&&w.nodeName.trim()!=="提交人"&&!w.isEbot&&w.rawAction!=="freeflow.reject");if(M?.nodeName)K=M.nodeName.trim()}let H=$?.comment||Y?.reason||z?.rejectComment||"修改";if(H.includes(":")){let M=H.split(":");if(M.length>1)H=M.slice(1).join(":").trim()}let W=H;if(K&&J)W=`${K}(${J}) ❌: ${H}`;else if(J)W=`${J} ❌: ${H}`;else if(K)W=`${K} ❌: ${H}`;else W=H;let X=$?.rejectTargetNodeName||Y?.targetNodeName||"提交人",Z=$?.rejectTargetOperator?.name||Y?.targetOperator?.name||I?.submitter?.name,q=Z?`${X}(${Z})`:X,V=$?.resubmitRuleText||Y?.resubmitRuleText||(J?`重新提交后由${J}继续审批`:"重新提交后继续审批");return{comment:`${W}
↳ 驳回至: ${q}
↳ ${V}`,operator:Q}}function _D0($){if(!$)return[];let Y=$.pending||[],z=String($.rawState||"").toUpperCase(),U=String($.state||"").toUpperCase(),I=[];if(Y.length>0)for(let Q of Y){let J=Q.approver?.name||Q.approver?.id||"待定",K=(Q.name||$.currentNode||"").trim(),G=K?`${K}(${J})`:J,H=Q.type?.toUpperCase()==="PAYING"||K.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";I.push(`${G}: ${H}`)}else if($.currentNode?.trim()){let J=$.currentNode.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";I.push(`${$.currentNode.trim()}: ${J}`)}return I}function IU($,Y){let z=new Map;if(!$||$.length===0)return z;if(!Y){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";z.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:RD0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return z}let U=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),I=Y.history||[],Q=String(Y.rawState||"").toUpperCase(),J=String(Y.state||"").toUpperCase(),K=Q==="DRAFT"||Q==="REVOKED"||Q==="CANCELED"||Q==="CANCELLED"||J==="草稿"||J==="已撤回"||J==="已取消",G=Q==="REJECTED"||Q==="TERMINATED"||J==="审批驳回"||J==="已驳回",W=!K&&!G&&(Q==="PAID"||J==="已支付"||I.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),H=!K&&!G&&!W&&(Q==="PAYING"||J==="支付中"||(Y.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||Y.currentNode?.includes("支付")===!0),Z=W||!K&&!G&&!H&&(Q==="COMPLETED"||Q==="APPROVED"||J==="已完成"||J==="审批通过");for(let q=0;q<U.length;q++){let V=U[q];if(!V)continue;let F=Number(V.createdAt)||0,M=V.document||{},w=V.manualApprovalRecord||V.result?.manualApprovalRecord||M.manualApprovalRecord||{},O=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,D=typeof w.nodeId==="string"?String(w.nodeId):void 0,N=D?decodeURIComponent(D).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,A=O||N,T=A?I.find((P0)=>P0.nodeId&&(P0.nodeId===A||A.includes(P0.nodeId))):void 0,P=T?.time??F,j=U[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===U.length-1,k=I.find((P0)=>(P0.time??0)>P+5000&&P0.isEbot&&(P0.nodeName?.includes("智能")||P0.nodeName?.includes("AI")||P0.action?.includes("智能")||P0.comment?.includes("AI")||P0.comment?.includes("approval-result"))&&!P0.nodeName?.includes("费用标准检查")&&!P0.nodeName?.includes("标准检查")&&!P0.nodeName?.includes("预算"));if(k){if(b=!1,(k.time??1/0)<C)C=k.time}let h=V.result||{},i=h.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",U0=c.toUpperCase(),x=U0==="REJECT"||U0==="驳回",d=U0==="APPROVE"||U0==="通过",t=U0==="EXEMPT_APPROVE"||U0==="免审通过"||U0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(x)e=p?"驳回":"添加评论";else if(U0==="REVIEW"||U0==="转交复核")e="转交复核";let y=typeof w.status==="object"&&w.status!==null?String(w.status.type||w.status.label||"").toUpperCase():"",s=typeof w.status==="object"&&w.status!==null?String(w.status.sourceStatus||""):"",Y0=M.manualApprovalStatus||h.manualApprovalStatus||V.manualApprovalStatus,M0=typeof Y0==="string"?Y0.toUpperCase():"",E0=M0==="CANCELLED"||M0==="CANCELED"||M0==="已取消"||M0==="已撤回"||M0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=M0==="APPROVED"||M0==="已支付/审批完成"||M0==="已通过"||M0==="已完成"||M0==="已支付"||y==="APPROVED",b0=!(s.includes("补偿")||s.includes("已支付"))&&(M0==="TERMINATED"||M0==="REJECTED"||M0==="REJECT"||M0==="已驳回"||M0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),Y1=T?1000:60000,a=I.filter((P0)=>{let I0=P0.time??0;return I0>=P-Y1&&I0<C}),H0="-",F0="-",f0=!1,u0,i0,D1=d||t,k1=I.filter((P0)=>(P0.time??0)>P+5000),u1=k1.some((P0)=>P0.rawAction==="freeflow.retract"||P0.action==="单据撤回"),b1=k1.some((P0)=>P0.rawAction==="freeflow.submit"||P0.action==="提交送审");if(D1&&b&&(u1||b1))f0=!0,u0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&x)H0="无操作",F0="-";else{let P0=a.filter((v)=>(v.time??0)>=P-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),I0=P0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),B=P0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(B||!Y&&b0){H0="审批驳回",f0=!1,u0=void 0;let v=yn(B,void 0,w,I,Y);F0=v.commen Line truncated
`,{mode:384}),Y}function sn($){let Y=rD0();for(let z of Y){if(!V$(z))continue;for(let U of vB(z).filter((I)=>I.endsWith(".json")).filter((I)=>!I.startsWith("example."))){let I=N9(z,U);try{let Q=SB(I,"utf-8"),J=JSON.parse(Q);if(J&&typeof J==="object"&&J.id===$)return I}catch{}}}return}function x2($,Y){let z=sn($);if(!z)throw Error(`Enterprise config not found: ${$}`);let I={...JSON.parse(SB(z,"utf-8")),...Y};for(let J of Object.keys(Y))if(Y[J]===void 0)delete I[J];let Q=mn.parse(I);return nD0(z,`${JSON.stringify(Q,null,2)}
`,"utf-8"),Q}var on="SEAL_USE_ENTERPRISES_DIR",pD0="SEAL_HOME_ENTERPRISES_DIR",dD0="SEAL_USE_USER_ENTERPRISES_DIR",mD0="SEAL_HOME_USER_ENTERPRISES_DIR",lD0="SEAL_USE_CONFIG_FILE",oD0="SEAL_HOME_CONFIG_FILE",lJ,hB,_B,iD0;var S3=o(()=>{ln();lJ=N9(gB(),".config","seal-use","enterprises"),hB=N9(gB(),".config","seal-home","enterprises"),_B=N9(gB(),".config","seal-use","config.json"),iD0=N9(gB(),".config","seal-home","config.json")});function f2($,Y,z=[]){let U=Y.corpId?.trim()||void 0,I=Y.stateful?Y.defaultCorpId?.trim()||void 0:void 0,Q=U??I;if(Q){let K=$.find((H)=>H.id===Q);if(K)return K;let G=$.find((H)=>H.id.toLowerCase()===Q.toLowerCase());if(G)return G;let W=$.find((H)=>H.name.toLowerCase()===Q.toLowerCase());if(W)return W;throw Error(`No enterprise config found for ${Q}`)}if(!Y.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let J=$[0];if(J)return J;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{existsSync as an,mkdirSync as XN1,readFileSync as ZN1,renameSync as qN1,unlinkSync as VN1,writeFileSync as LN1}from"node:fs";import{homedir as FN1}from"node:os";import{dirname as wN1,join as MN1}from"node:path";function EZ(){let $=process.env[ON1]?.trim();if($)return $;return NN1}function sD0($=new Date){return $.toISOString().slice(0,10)}function aD0($=tn,Y=new Date){let z=Y.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function tD0($=EZ()){if(!an($))return{};try{let Y=ZN1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function DN1($,Y){let z={};for(let[U,I]of Object.entries($)){if(!I||typeof I!=="object")continue;let Q={},J=!1;for(let[K,G]of Object.entries(I))if(typeof G==="number"&&G>0&&K>=Y)Q[K]=G,J=!0;if(J)z[U]=Q}return z}function PN1($,Y=EZ()){let z=wN1(Y);if(!an(z))XN1(z,{recursive:!0,mode:448});let U=`${Y}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{LN1(U,JSON.stringify($,null,2),{encoding:"utf-8",mode:384}),qN1(U,Y)}catch(I){try{if(an(U))VN1(U)}catch{}throw I}}function eD0($,Y=new Date){if(!$||typeof $!=="string")return;try{let z=EZ(),U=tD0(z),I=sD0(Y),Q=aD0(tn,Y),J=DN1(U,Q);J[$]=J[$]||{},J[$][I]=(J[$][I]??0)+1,PN1(J,z)}catch{}}function BN1($,Y=tn,z=new Date){let U=new Map;try{let I=tD0(),Q=aD0(Y,z),J=sD0(z),K=$??Object.keys(I);for(let G of K){let W=I[G];if(!W){U.set(G,0);continue}let H=0;for(let[X,Z]of Object.entries(W))if(X>=Q&&X<=J&&typeof Z==="number")H+=Z;U.set(G,H)}}catch{if($)for(let I of $)U.set(I,0)}return U}function $P0($,Y,z){let U=z??BN1($.map((I)=>I.id));return[...$].sort((I,Q)=>{if(Y){if(I.id===Y&&Q.id!==Y)return-1;if(Q.id===Y&&I.id!==Y)return 1}let J=U.get(I.id)??0,K=U.get(Q.id)??0;if(J!==K)return K-J;let G=I.name??I.id,W=Q.name??Q.id,H=G.localeCompare(W,"zh-CN");if(H!==0)return H;return I.id.localeCompare(Q.id)})}var ON1="SEAL_USE_USAGE_FILE",NN1,tn=7;var yB=o(()=>{NN1=MN1(FN1(),".config","seal-use","usage.json")});function AN1($,Y){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>Y?z:z.toLowerCase())}function TN1($,Y){return Y?$:$.toLowerCase()}function jN1($,Y,z,U){let I=TN1($,U),Q=Y.filter((J)=>I.includes(J));if(z==="all"&&Q.length!==Y.length)return[];return Q}function EN1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function CN1($,Y){if(Y.fields&&!Y.fields.has($.field))return[];let z=EN1($.value),U=[];return z.forEach((I,Q)=>{let J=jN1(I,Y.keywords,Y.matchMode,Y.caseSensitive);if(J.length===0)return;let K=Math.max(0,Q-Y.contextLines),G=Math.min(z.length,Q+Y.contextLines+1),W={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Q+1,matchedKeywords:J,matchedText:kB(I,Y.maxChars),context:{before:Y.snippetOnly?[]:z.slice(K,Q).map((H)=>kB(H,Y.maxChars)),line:kB(I,Y.maxChars),after:Y.snippetOnly?[]:z.slice(Q+1,G).map((H)=>kB(H,Y.maxChars))},metadata:$.metadata};if(Y.snippetOnly)W.context={before:[],line:W.context.line,after:[]};U.push(W)}),U}function kB($,Y){if(!Y||$.length<=Y)return $;return`${$.slice(0,Math.max(0,Y))}...`}function RN1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function zP0($){return $.rules.flatMap((Y,z)=>{let U=`${$.id}:${Y.description.slice(0,32)}`,I={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:Y.scope,strictness:Y.strictness,code:"code"in Y?Y.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:U,title:`${$.versionName} / ${Y.scope}`,field:"h Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==U.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:U}}async function Yp($,Y,z){let U=Y.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",I=await Q$($,U);if(z||I.length>0)return KP0(I,z,Y.id);if(Y.environment==="test"||Y.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${Y.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let Q=(Y.seal.url??Y.source?.sealUrl??`https://${Y.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await HM($,Q,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${Q}/api/v1/integrations/webhook/replay-mock-callback`},Y.seal.endpoints.approvalStylePreferences)}throw new w4(`当前租户「${Y.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`)}async function oJ($){let{query:Y,sourceClient:z,targetClient:U,sourceCorp:I,targetCorp:Q,webhookSelector:J,snPrefix:K,snSuffix:G,docIdPrefix:W,docIdSuffix:H,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(Y.recordId){let A=await G4(z,Y.recordId);q.push(A)}else if(Y.recordIds&&Y.recordIds.length>0)for(let A of Y.recordIds)q.push(await G4(z,A));else if(Y.sn){let A=await b4(z,{sourceDocumentSN:Y.sn,limit:1});if(!A.records.length)throw Error(`在企业「${I.name}」中未找到单据编号为「${Y.sn}」的审批记录。`);q.push(A.records[0])}else if(Y.sns&&Y.sns.length>0)for(let A of Y.sns){let T=await b4(z,{sourceDocumentSN:A,limit:1});if(!T.records.length)throw Error(`在企业「${I.name}」中未找到单据编号为「${A}」的审批记录。`);q.push(T.records[0])}else if(Y.limit!==void 0){let A=await b4(z,{limit:Y.limit,status:Y.status,startDate:Y.startDate,endDate:Y.endDate});if(!A.records.length)throw Error(`在企业「${I.name}」中未检索到符合条件的审批记录。`);q=A.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((A)=>({run:A,doc:en(A,{snPrefix:K,snSuffix:G,docIdPrefix:W,docIdSuffix:H})}));if(X){let A={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Q.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await Q$(U,Q.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=KP0(j,J,Q.id);A={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),P=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:I.id,name:I.name,environment:I.environment},targetCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetWebhook:A,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:P?T[0].originalRecord:void 0,document:P?T[0].document:void 0,records:T}}let F=await Yp(U,Q,J),M={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},w=[],O=0,D=0;for(let{run:A,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let P=await $p(F.incomingDocumentWebhook.url,F.secret,T,Z,P6(Q.seal));w.push({originalRecord:{id:A.id,sourceSystem:A.sourceSystem,sourceDocumentSN:A.sourceDocumentSN,sourceDocumentId:A.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:P,success:!0}),O+=1}catch(P){let j=P instanceof Error?P.message:String(P);w.push({originalRecord:{id:A.id,sourceSystem:A.sourceSystem,sourceDocumentSN:A.sourceDocumentSN,sourceDocumentId:A.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),D+=1}}let N=w.length===1;return{success:D===0,dryRun:!1,sourceCorp:{id:I.id,name:I.name,environment:I.environment},targetCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetWebhook:M,totalCount:w.length,successCount:O,failureCount:D,originalRecord:N?w[0].originalRecord:void 0,replayedDocument:N?w[0].replayedDocument:void 0,pushResult:N?w[0].pushResult:void 0,records:w}}var uN1;var _Z=o(()=>{xB();L$();X6();uN1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var GP0,F04,iN1,w04;var WP0=o(()=>{P$();GP0=L.object({level:L.enum(["error","warning","info"]),code:L.string(),message:L.string(),snippet:L.string().optional(),suggestion:L.string().optional()}),F04=L.object({score:L.number().min(0).max(100),passed:L.boolean(),issues:L.array(GP0)}),iN1=L.object({ruleId:L.string Line truncated
↳ ${V}`,operator:Q}}function pD0($){if(!$)return[];let Y=$.pending||[],z=String($.rawState||"").toUpperCase(),U=String($.state||"").toUpperCase(),I=[];if(Y.length>0)for(let Q of Y){let J=Q.approver?.name||Q.approver?.id||"待定",K=(Q.name||$.currentNode||"").trim(),G=K?`${K}(${J})`:J,W=Q.type?.toUpperCase()==="PAYING"||K.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";I.push(`${G}: ${W}`)}else if($.currentNode?.trim()){let J=$.currentNode.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";I.push(`${$.currentNode.trim()}: ${J}`)}return I}function JU($,Y){let z=new Map;if(!$||$.length===0)return z;if(!Y){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";z.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:nD0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return z}let U=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),I=Y.history||[],Q=String(Y.rawState||"").toUpperCase(),J=String(Y.state||"").toUpperCase(),K=Q==="DRAFT"||Q==="REVOKED"||Q==="CANCELED"||Q==="CANCELLED"||J==="草稿"||J==="已撤回"||J==="已取消",G=Q==="REJECTED"||Q==="TERMINATED"||J==="审批驳回"||J==="已驳回",H=!K&&!G&&(Q==="PAID"||J==="已支付"||I.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),W=!K&&!G&&!H&&(Q==="PAYING"||J==="支付中"||(Y.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||Y.currentNode?.includes("支付")===!0),Z=H||!K&&!G&&!W&&(Q==="COMPLETED"||Q==="APPROVED"||J==="已完成"||J==="审批通过");for(let q=0;q<U.length;q++){let V=U[q];if(!V)continue;let F=Number(V.createdAt)||0,M=V.document||{},w=V.manualApprovalRecord||V.result?.manualApprovalRecord||M.manualApprovalRecord||{},O=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,D=typeof w.nodeId==="string"?String(w.nodeId):void 0,N=D?decodeURIComponent(D).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,B=O||N,T=B?I.find((A0)=>A0.nodeId&&(A0.nodeId===B||B.includes(A0.nodeId))):void 0,A=T?.time??F,j=U[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===U.length-1,k=I.find((A0)=>(A0.time??0)>A+5000&&A0.isEbot&&(A0.nodeName?.includes("智能")||A0.nodeName?.includes("AI")||A0.action?.includes("智能")||A0.comment?.includes("AI")||A0.comment?.includes("approval-result"))&&!A0.nodeName?.includes("费用标准检查")&&!A0.nodeName?.includes("标准检查")&&!A0.nodeName?.includes("预算"));if(k){if(b=!1,(k.time??1/0)<C)C=k.time}let h=V.result||{},i=h.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",U0=c.toUpperCase(),x=U0==="REJECT"||U0==="驳回",d=U0==="APPROVE"||U0==="通过",t=U0==="EXEMPT_APPROVE"||U0==="免审通过"||U0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(x)e=p?"驳回":"添加评论";else if(U0==="REVIEW"||U0==="转交复核")e="转交复核";let y=typeof w.status==="object"&&w.status!==null?String(w.status.type||w.status.label||"").toUpperCase():"",s=typeof w.status==="object"&&w.status!==null?String(w.status.sourceStatus||""):"",Y0=M.manualApprovalStatus||h.manualApprovalStatus||V.manualApprovalStatus,M0=typeof Y0==="string"?Y0.toUpperCase():"",E0=M0==="CANCELLED"||M0==="CANCELED"||M0==="已取消"||M0==="已撤回"||M0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=M0==="APPROVED"||M0==="已支付/审批完成"||M0==="已通过"||M0==="已完成"||M0==="已支付"||y==="APPROVED",b0=!(s.includes("补偿")||s.includes("已支付"))&&(M0==="TERMINATED"||M0==="REJECTED"||M0==="REJECT"||M0==="已驳回"||M0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),Y1=T?1000:60000,a=I.filter((A0)=>{let I0=A0.time??0;return I0>=A-Y1&&I0<C}),W0="-",F0="-",f0=!1,u0,i0,D1=d||t,k1=I.filter((A0)=>(A0.time??0)>A+5000),u1=k1.some((A0)=>A0.rawAction==="freeflow.retract"||A0.action==="单据撤回"),b1=k1.some((A0)=>A0.rawAction==="freeflow.submit"||A0.action==="提交送审");if(D1&&b&&(u1||b1))f0=!0,u0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&x)W0="无操作",F0="-";else{let A0=a.filter((v)=>(v.time??0)>=A-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),I0=A0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),P=A0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(P||!Y&&b0){W0="审批驳回",f0=!1,u0=void 0;let v=bn(P,void 0,w,I,Y);F0=v.commen Line truncated
`,{mode:384}),Y}function Yp($){let Y=HA0();for(let z of Y){if(!V$(z))continue;for(let U of kP(z).filter((I)=>I.endsWith(".json")).filter((I)=>!I.startsWith("example."))){let I=N9(z,U);try{let Q=fP(I,"utf-8"),J=JSON.parse(Q);if(J&&typeof J==="object"&&J.id===$)return I}catch{}}}return}function x2($,Y){let z=Yp($);if(!z)throw Error(`Enterprise config not found: ${$}`);let I={...JSON.parse(fP(z,"utf-8")),...Y};for(let J of Object.keys(Y))if(Y[J]===void 0)delete I[J];let Q=an.parse(I);return UA0(z,`${JSON.stringify(Q,null,2)}
`,"utf-8"),Q}var en="SEAL_USE_ENTERPRISES_DIR",IA0="SEAL_HOME_ENTERPRISES_DIR",QA0="SEAL_USE_USER_ENTERPRISES_DIR",JA0="SEAL_HOME_USER_ENTERPRISES_DIR",KA0="SEAL_USE_CONFIG_FILE",GA0="SEAL_HOME_CONFIG_FILE",rJ,xP,yP,YA0;var S3=o(()=>{tn();rJ=N9(uP(),".config","seal-use","enterprises"),xP=N9(uP(),".config","seal-home","enterprises"),yP=N9(uP(),".config","seal-use","config.json"),YA0=N9(uP(),".config","seal-home","config.json")});function f2($,Y,z=[]){let U=Y.corpId?.trim()||void 0,I=Y.stateful?Y.defaultCorpId?.trim()||void 0:void 0,Q=U??I;if(Q){let K=$.find((W)=>W.id===Q);if(K)return K;let G=$.find((W)=>W.id.toLowerCase()===Q.toLowerCase());if(G)return G;let H=$.find((W)=>W.name.toLowerCase()===Q.toLowerCase());if(H)return H;throw Error(`No enterprise config found for ${Q}`)}if(!Y.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let J=$[0];if(J)return J;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{existsSync as zp,mkdirSync as gN1,readFileSync as yN1,renameSync as kN1,unlinkSync as xN1,writeFileSync as fN1}from"node:fs";import{homedir as uN1}from"node:os";import{dirname as bN1,join as iN1}from"node:path";function _Z(){let $=process.env[cN1]?.trim();if($)return $;return nN1}function WA0($=new Date){return $.toISOString().slice(0,10)}function XA0($=Up,Y=new Date){let z=Y.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function ZA0($=_Z()){if(!zp($))return{};try{let Y=yN1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function pN1($,Y){let z={};for(let[U,I]of Object.entries($)){if(!I||typeof I!=="object")continue;let Q={},J=!1;for(let[K,G]of Object.entries(I))if(typeof G==="number"&&G>0&&K>=Y)Q[K]=G,J=!0;if(J)z[U]=Q}return z}function dN1($,Y=_Z()){let z=bN1(Y);if(!zp(z))gN1(z,{recursive:!0,mode:448});let U=`${Y}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{fN1(U,JSON.stringify($,null,2),{encoding:"utf-8",mode:384}),kN1(U,Y)}catch(I){try{if(zp(U))xN1(U)}catch{}throw I}}function qA0($,Y=new Date){if(!$||typeof $!=="string")return;try{let z=_Z(),U=ZA0(z),I=WA0(Y),Q=XA0(Up,Y),J=pN1(U,Q);J[$]=J[$]||{},J[$][I]=(J[$][I]??0)+1,dN1(J,z)}catch{}}function mN1($,Y=Up,z=new Date){let U=new Map;try{let I=ZA0(),Q=XA0(Y,z),J=WA0(z),K=$??Object.keys(I);for(let G of K){let H=I[G];if(!H){U.set(G,0);continue}let W=0;for(let[X,Z]of Object.entries(H))if(X>=Q&&X<=J&&typeof Z==="number")W+=Z;U.set(G,W)}}catch{if($)for(let I of $)U.set(I,0)}return U}function VA0($,Y,z){let U=z??mN1($.map((I)=>I.id));return[...$].sort((I,Q)=>{if(Y){if(I.id===Y&&Q.id!==Y)return-1;if(Q.id===Y&&I.id!==Y)return 1}let J=U.get(I.id)??0,K=U.get(Q.id)??0;if(J!==K)return K-J;let G=I.name??I.id,H=Q.name??Q.id,W=G.localeCompare(H,"zh-CN");if(W!==0)return W;return I.id.localeCompare(Q.id)})}var cN1="SEAL_USE_USAGE_FILE",nN1,Up=7;var bP=o(()=>{nN1=iN1(uN1(),".config","seal-use","usage.json")});function lN1($,Y){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>Y?z:z.toLowerCase())}function oN1($,Y){return Y?$:$.toLowerCase()}function rN1($,Y,z,U){let I=oN1($,U),Q=Y.filter((J)=>I.includes(J));if(z==="all"&&Q.length!==Y.length)return[];return Q}function sN1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function aN1($,Y){if(Y.fields&&!Y.fields.has($.field))return[];let z=sN1($.value),U=[];return z.forEach((I,Q)=>{let J=rN1(I,Y.keywords,Y.matchMode,Y.caseSensitive);if(J.length===0)return;let K=Math.max(0,Q-Y.contextLines),G=Math.min(z.length,Q+Y.contextLines+1),H={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Q+1,matchedKeywords:J,matchedText:iP(I,Y.maxChars),context:{before:Y.snippetOnly?[]:z.slice(K,Q).map((W)=>iP(W,Y.maxChars)),line:iP(I,Y.maxChars),after:Y.snippetOnly?[]:z.slice(Q+1,G).map((W)=>iP(W,Y.maxChars))},metadata:$.metadata};if(Y.snippetOnly)H.context={before:[],line:H.context.line,after:[]};U.push(H)}),U}function iP($,Y){if(!Y||$.length<=Y)return $;return`${$.slice(0,Math.max(0,Y))}...`}function tN1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function FA0($){return $.rules.flatMap((Y,z)=>{let U=`${$.id}:${Y.description.slice(0,32)}`,I={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:Y.scope,strictness:Y.strictness,code:"code"in Y?Y.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:U,title:`${$.versionName} / ${Y.scope}`,field:"h Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==U.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:U}}async function Jp($,Y,z){let U=Y.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",I=await Q$($,U);if(z||I.length>0)return DA0(I,z,Y.id);if(Y.environment==="test"||Y.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${Y.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let Q=(Y.seal.url??Y.source?.sealUrl??`https://${Y.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await LM($,Q,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${Q}/api/v1/integrations/webhook/replay-mock-callback`},Y.seal.endpoints.approvalStylePreferences)}throw new w4(`当前租户「${Y.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`)}async function sJ($){let{query:Y,sourceClient:z,targetClient:U,sourceCorp:I,targetCorp:Q,webhookSelector:J,snPrefix:K,snSuffix:G,docIdPrefix:H,docIdSuffix:W,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(Y.recordId){let B=await H4(z,Y.recordId);q.push(B)}else if(Y.recordIds&&Y.recordIds.length>0)for(let B of Y.recordIds)q.push(await H4(z,B));else if(Y.sn){let B=await b4(z,{sourceDocumentSN:Y.sn,limit:1});if(!B.records.length)throw Error(`在企业「${I.name}」中未找到单据编号为「${Y.sn}」的审批记录。`);q.push(B.records[0])}else if(Y.sns&&Y.sns.length>0)for(let B of Y.sns){let T=await b4(z,{sourceDocumentSN:B,limit:1});if(!T.records.length)throw Error(`在企业「${I.name}」中未找到单据编号为「${B}」的审批记录。`);q.push(T.records[0])}else if(Y.limit!==void 0){let B=await b4(z,{limit:Y.limit,status:Y.status,startDate:Y.startDate,endDate:Y.endDate});if(!B.records.length)throw Error(`在企业「${I.name}」中未检索到符合条件的审批记录。`);q=B.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((B)=>({run:B,doc:Ip(B,{snPrefix:K,snSuffix:G,docIdPrefix:H,docIdSuffix:W})}));if(X){let B={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Q.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await Q$(U,Q.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=DA0(j,J,Q.id);B={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),A=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:I.id,name:I.name,environment:I.environment},targetCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetWebhook:B,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:A?T[0].originalRecord:void 0,document:A?T[0].document:void 0,records:T}}let F=await Jp(U,Q,J),M={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},w=[],O=0,D=0;for(let{run:B,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let A=await Qp(F.incomingDocumentWebhook.url,F.secret,T,Z,A6(Q.seal));w.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:A,success:!0}),O+=1}catch(A){let j=A instanceof Error?A.message:String(A);w.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),D+=1}}let N=w.length===1;return{success:D===0,dryRun:!1,sourceCorp:{id:I.id,name:I.name,environment:I.environment},targetCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetWebhook:M,totalCount:w.length,successCount:O,failureCount:D,originalRecord:N?w[0].originalRecord:void 0,replayedDocument:N?w[0].replayedDocument:void 0,pushResult:N?w[0].pushResult:void 0,records:w}}var GD1;var SZ=o(()=>{cP();L$();X6();GD1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var AA0,l04,WD1,o04;var PA0=o(()=>{A$();AA0=L.object({level:L.enum(["error","warning","info"]),code:L.string(),message:L.string(),snippet:L.string().optional(),suggestion:L.string().optional()}),l04=L.object({score:L.number().min(0).max(100),passed:L.boolean(),issues:L.array(AA0)}),WD1=L.object({ruleId:L.string Line truncated
* ==============================================================================
* Seal 官方标准规则校验器 (Official Standard Rule Linter)
* ==============================================================================
@@ -876,62 +876,62 @@ export function lintRule(rule: RuleLintTarget): RuleLintResult {
}
export default lintRule;
`}});import{existsSync as KU,mkdirSync as YD1,readFileSync as zD1,readdirSync as VP0,rmSync as UD1,unlinkSync as ID1,writeFileSync as QD1}from"node:fs";import{homedir as JD1}from"node:os";import{isAbsolute as KD1,join as f6,resolve as GD1}from"node:path";import{pathToFileURL as ZP0}from"node:url";function LP0($=i$){let Y=[],z=[];try{if(!KU($))YD1($,{recursive:!0});let U=Object.keys(Qp);for(let[Q,J]of Object.entries(Qp)){let K=f6($,Q),G=!0;if(KU(K))try{if(zD1(K,"utf8")===J)G=!1}catch{G=!0}if(G)QD1(K,J,"utf8");Y.push(Q)}let I=VP0($,{withFileTypes:!0});for(let Q of I)if(!U.includes(Q.name)){let J=f6($,Q.name);try{if(Q.isDirectory())UD1(J,{recursive:!0,force:!0});else ID1(J);z.push(Q.name)}catch{}}}catch{}return{synced:Y,pruned:z}}function FP0($={syncOfficial:!0}){if($.syncOfficial!==!1)LP0();let Y=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[b$,bB];for(let U of z)if(KU(U))try{let I=VP0(U,{withFileTypes:!0});for(let Q of I){if(Q.isDirectory())continue;let J=Q.name;if(J.endsWith(".ts")||J.endsWith(".js")||J.endsWith(".mjs")){let K=J.replace(/\.(ts|js|mjs)$/,"");if(!Y.some((G)=>G.name===K))Y.push({name:K,type:"custom",path:f6(U,J),description:`用户自定义规则校验器 (${J})`})}}}catch{}return Y}function HD1($){let Y=($||"").trim();if(!Y||Y==="builtin"||Y==="default"||Y==="official/builtin"||Y==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(Y==="strict"||Y==="official/strict"||Y==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(Y==="hlab"||Y==="hlab-sop"||Y==="hlab-rules"||Y==="hlab-standard"||Y==="official/hlab"||Y==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(KD1(Y)||Y.startsWith("./")||Y.startsWith("../")){let U=GD1(Y);if(KU(U))return{path:U};for(let I of[".ts",".js",".mjs"])if(KU(`${U}${I}`))return{path:`${U}${I}`}}let z=[f6(b$,`${Y}.ts`),f6(b$,`${Y}.js`),f6(b$,`${Y}.mjs`),f6(bB,`${Y}.ts`),f6(bB,`${Y}.js`),f6(bB,`${Y}.mjs`)];for(let U of z)if(KU(U))return{path:U};return{}}async function Kp($){LP0();let Y=HD1($??"builtin");if(Y.isOfficial){let U=Y.officialKind==="strict"?HP0:Y.officialKind==="hlab"?XP0:rJ,I=Y.officialKind==="builtin"?"builtin":"official",Q=Y.path;if(Q&&KU(Q))try{let K=await import(ZP0(Q).href),G=K.default??K.lintRule??K.linter??K.lint;if(typeof G==="function")return{name:Y.officialKind??"builtin",type:I,filePath:Q,linter:qP0(G,U)}}catch{}return{name:Y.officialKind??"builtin",type:I,filePath:Q,linter:U}}let z=Y.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:rJ};try{let I=await import(ZP0(z).href),Q=I.default??I.lintRule??I.linter??I.lint;if(typeof Q!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:rJ};return{name:$??"custom",type:"custom",filePath:z,linter:qP0(Q,rJ)}}catch(U){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${U?.message??U}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:rJ}}}function qP0($,Y){return async(z,U)=>{try{let I=await $(z,U);if(I&&typeof I==="object"&&typeof I.score==="number"&&Array.isArray(I.issues))return I;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),Y(z,U)}catch(I){return console.error("⚠️ [linter] 自定义校验器执行异常:",I),Y(z,U)}}}var b$,WD1="official",i$,bB;var Gp=o(()=>{zp();Ip();Jp();Up();b$=f6(JD1(),".config","seal-use","linters"),i$=f6(b$,WD1),bB=f6(process.cwd(),"linters")});async function Wp($,Y,z){let U=await Y.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:U.score,passed:U.passed,issues:U.issues,description:$.description}}async function wP0($,Y,z,U){let I=U?.minScore??0,Q=U?.level??"all",J=[],K=0;for(let q of $){let V=await Wp(q,Y,z);K+=V.score;let F=V.issues;if(Q==="error")F=V.issues.filter((w)=>w.level==="error");else if(Q==="warning")F=V.issues.filter((w)=>w.level==="warning"||w.level==="error");let M=F.every((w)=>w.level!=="error");if(U?.summary){if(F.length>0)J.push({...V,passed:M,issues:F})}else J.push({...V,passed:M,issues:F})}let G=$.length,W=G===0?100:Math.round(K/G),H=J.filter((q)=>q.issues.length>0).length,X=G-Line truncated
`,"utf8"),z}function DP0($){return $.map((Y,z)=>{let U;if(typeof Y.code==="number")U=`#${String(Y.code).padStart(4,"0")}`;else if(typeof Y.code==="string")U=Y.code.startsWith("#")?Y.code:`#${Y.code}`;else U=`#${String(z+1).padStart(4,"0")}`;return{id:Y.id,code:U,name:Y.name,description:Y.description,scope:Y.scope,strictness:Y.strictness}})}var PP0=()=>{};var BP0,D5;var sJ=o(()=>{BP0=class BP0 extends Error{errors;warnings;constructor($,Y=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=Y;this.name="ResourcePackValidationError"}};D5=BP0});var EP0=E((d04,jP0)=>{jP0.exports=iB;function iB(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}iB.prototype.go=function($){if(this.pending<this.max)TP0(this,$);else this.waiting.push($)};iB.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};iB.prototype.hold=function(){return AP0(this)};function AP0($){$.pending+=1;var Y=!1;return z;function z(I){if(Y)throw Error("callback called twice");if(Y=!0,$.error=$.error||I,$.pending-=1,$.waiting.length>0&&$.pending<$.max)TP0($,$.waiting.shift());else if($.pending===0){var Q=$.listeners;$.listeners=[],Q.forEach(U)}}function U(I){I($.error)}}function TP0($,Y){Y(AP0($))}});var _P0=E((OD1)=>{var Zp=J0("fs"),qp=J0("util"),CP0=J0("stream"),RP0=CP0.Readable,wD1=CP0.PassThrough,MD1=EP0(),cB=J0("events").EventEmitter;OD1.BufferSlicer=tJ;OD1.FdSlicer=aJ;qp.inherits(aJ,cB);function aJ($){cB.call(this),this.fd=$,this.pend=new MD1,this.pend.max=1,this.refCount=0}aJ.prototype.read=function($,Y,z,U,I){var Q=this;Q.pend.go(function(J){Zp.read(Q.fd,$,Y,z,U,function(K,G,W){J(),I(K,G,W)})})};aJ.prototype.createReadStream=function($){return new vZ(this,$)};aJ.prototype.ref=function(){this.refCount+=1};aJ.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Zp.close($.fd,Y);function Y(z){if(z)$.emit("error",z);else $.emit("close")}};qp.inherits(vZ,RP0);function vZ($,Y){Y=Y||{},RP0.call(this,Y),this.context=$,this.context.ref(),this.start=Y.start||0,this.endOffset=Y.end,this.pos=this.start}vZ.prototype._read=function($){var Y=this,z=Math.min(Y._readableState.highWaterMark,$);if(Y.endOffset!=null)z=Math.min(z,Y.endOffset-Y.pos);if(z<=0){Y.push(null),this._cleanup();return}Y.context.pend.go(function(U){var I=Buffer.allocUnsafe(z);Zp.read(Y.context.fd,I,0,z,Y.pos,function(Q,J){if(Q)Y.destroy(Q);else if(J===0)Y.push(null),Y._cleanup();else Y.pos+=J,Y.push(I.slice(0,J));U()})})};vZ.prototype._destroy=function($,Y){this._cleanup(),Y($)};vZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};qp.inherits(tJ,cB);function tJ($){cB.call(this),this.refCount=0,this.buffer=$}tJ.prototype.read=function($,Y,z,U,I){if(!(0<=Y&&Y<=$.length))throw RangeError("offset outside buffer: 0 <= "+Y+" <= "+$.length);if(U<0)throw RangeError("position is negative: "+U);if(Y+z>$.length)z=$.length-Y;if(U+z>this.buffer.length)z=this.buffer.length-U;if(z<=0){setImmediate(function(){I(null,0)});return}this.buffer.copy($,Y,U,U+z),setImmediate(function(){I(null,z)})};tJ.prototype.createReadStream=function($){$=$||{};var Y=new wD1($);Y.start=$.start||0,Y.endOffset=$.end,Y.pos=Y.endOffset||this.buffer.length;var z=this.buffer.slice(Y.start,Y.pos),U=65536,I=0;while(!0){var Q=I+U;if(Q>=z.length){if(I<z.length)Y.write(z.slice(I,z.length));break}Y.write(z.slice(I,Q)),I=Q}return Y.end(),Y};tJ.prototype.ref=function(){this.refCount+=1};tJ.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var hP0=E((l04,vP0)=>{var PD1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462, Line truncated
`}});import{existsSync as HU,mkdirSync as BD1,readFileSync as TD1,readdirSync as CA0,rmSync as jD1,unlinkSync as ED1,writeFileSync as CD1}from"node:fs";import{homedir as RD1}from"node:os";import{isAbsolute as _D1,join as f6,resolve as vD1}from"node:path";import{pathToFileURL as jA0}from"node:url";function RA0($=i$){let Y=[],z=[];try{if(!HU($))BD1($,{recursive:!0});let U=Object.keys(Wp);for(let[Q,J]of Object.entries(Wp)){let K=f6($,Q),G=!0;if(HU(K))try{if(TD1(K,"utf8")===J)G=!1}catch{G=!0}if(G)CD1(K,J,"utf8");Y.push(Q)}let I=CA0($,{withFileTypes:!0});for(let Q of I)if(!U.includes(Q.name)){let J=f6($,Q.name);try{if(Q.isDirectory())jD1(J,{recursive:!0,force:!0});else ED1(J);z.push(Q.name)}catch{}}}catch{}return{synced:Y,pruned:z}}function _A0($={syncOfficial:!0}){if($.syncOfficial!==!1)RA0();let Y=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[b$,dP];for(let U of z)if(HU(U))try{let I=CA0(U,{withFileTypes:!0});for(let Q of I){if(Q.isDirectory())continue;let J=Q.name;if(J.endsWith(".ts")||J.endsWith(".js")||J.endsWith(".mjs")){let K=J.replace(/\.(ts|js|mjs)$/,"");if(!Y.some((G)=>G.name===K))Y.push({name:K,type:"custom",path:f6(U,J),description:`用户自定义规则校验器 (${J})`})}}}catch{}return Y}function SD1($){let Y=($||"").trim();if(!Y||Y==="builtin"||Y==="default"||Y==="official/builtin"||Y==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(Y==="strict"||Y==="official/strict"||Y==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(Y==="hlab"||Y==="hlab-sop"||Y==="hlab-rules"||Y==="hlab-standard"||Y==="official/hlab"||Y==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(_D1(Y)||Y.startsWith("./")||Y.startsWith("../")){let U=vD1(Y);if(HU(U))return{path:U};for(let I of[".ts",".js",".mjs"])if(HU(`${U}${I}`))return{path:`${U}${I}`}}let z=[f6(b$,`${Y}.ts`),f6(b$,`${Y}.js`),f6(b$,`${Y}.mjs`),f6(dP,`${Y}.ts`),f6(dP,`${Y}.js`),f6(dP,`${Y}.mjs`)];for(let U of z)if(HU(U))return{path:U};return{}}async function Zp($){RA0();let Y=SD1($??"builtin");if(Y.isOfficial){let U=Y.officialKind==="strict"?BA0:Y.officialKind==="hlab"?TA0:aJ,I=Y.officialKind==="builtin"?"builtin":"official",Q=Y.path;if(Q&&HU(Q))try{let K=await import(jA0(Q).href),G=K.default??K.lintRule??K.linter??K.lint;if(typeof G==="function")return{name:Y.officialKind??"builtin",type:I,filePath:Q,linter:EA0(G,U)}}catch{}return{name:Y.officialKind??"builtin",type:I,filePath:Q,linter:U}}let z=Y.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aJ};try{let I=await import(jA0(z).href),Q=I.default??I.lintRule??I.linter??I.lint;if(typeof Q!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aJ};return{name:$??"custom",type:"custom",filePath:z,linter:EA0(Q,aJ)}}catch(U){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${U?.message??U}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aJ}}}function EA0($,Y){return async(z,U)=>{try{let I=await $(z,U);if(I&&typeof I==="object"&&typeof I.score==="number"&&Array.isArray(I.issues))return I;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),Y(z,U)}catch(I){return console.error("⚠️ [linter] 自定义校验器执行异常:",I),Y(z,U)}}}var b$,hD1="official",i$,dP;var qp=o(()=>{Kp();Hp();Xp();Gp();b$=f6(RD1(),".config","seal-use","linters"),i$=f6(b$,hD1),dP=f6(process.cwd(),"linters")});async function Vp($,Y,z){let U=await Y.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:U.score,passed:U.passed,issues:U.issues,description:$.description}}async function vA0($,Y,z,U){let I=U?.minScore??0,Q=U?.level??"all",J=[],K=0;for(let q of $){let V=await Vp(q,Y,z);K+=V.score;let F=V.issues;if(Q==="error")F=V.issues.filter((w)=>w.level==="error");else if(Q==="warning")F=V.issues.filter((w)=>w.level==="warning"||w.level==="error");let M=F.every((w)=>w.level!=="error");if(U?.summary){if(F.length>0)J.push({...V,passed:M,issues:F})}else J.push({...V,passed:M,issues:F})}let G=$.length,H=G===0?100:Math.round(K/G),W=J.filter((q)=>q.issues.length>0).length,X=G-Line truncated
`,"utf8"),z}function yA0($){return $.map((Y,z)=>{let U;if(typeof Y.code==="number")U=`#${String(Y.code).padStart(4,"0")}`;else if(typeof Y.code==="string")U=Y.code.startsWith("#")?Y.code:`#${Y.code}`;else U=`#${String(z+1).padStart(4,"0")}`;return{id:Y.id,code:U,name:Y.name,description:Y.description,scope:Y.scope,strictness:Y.strictness}})}var kA0=()=>{};var xA0,D5;var tJ=o(()=>{xA0=class xA0 extends Error{errors;warnings;constructor($,Y=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=Y;this.name="ResourcePackValidationError"}};D5=xA0});var iA0=E((A14,bA0)=>{bA0.exports=mP;function mP(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}mP.prototype.go=function($){if(this.pending<this.max)uA0(this,$);else this.waiting.push($)};mP.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};mP.prototype.hold=function(){return fA0(this)};function fA0($){$.pending+=1;var Y=!1;return z;function z(I){if(Y)throw Error("callback called twice");if(Y=!0,$.error=$.error||I,$.pending-=1,$.waiting.length>0&&$.pending<$.max)uA0($,$.waiting.shift());else if($.pending===0){var Q=$.listeners;$.listeners=[],Q.forEach(U)}}function U(I){I($.error)}}function uA0($,Y){Y(fA0($))}});var pA0=E((cD1)=>{var wp=J0("fs"),Mp=J0("util"),cA0=J0("stream"),nA0=cA0.Readable,bD1=cA0.PassThrough,iD1=iA0(),lP=J0("events").EventEmitter;cD1.BufferSlicer=$K;cD1.FdSlicer=eJ;Mp.inherits(eJ,lP);function eJ($){lP.call(this),this.fd=$,this.pend=new iD1,this.pend.max=1,this.refCount=0}eJ.prototype.read=function($,Y,z,U,I){var Q=this;Q.pend.go(function(J){wp.read(Q.fd,$,Y,z,U,function(K,G,H){J(),I(K,G,H)})})};eJ.prototype.createReadStream=function($){return new gZ(this,$)};eJ.prototype.ref=function(){this.refCount+=1};eJ.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;wp.close($.fd,Y);function Y(z){if(z)$.emit("error",z);else $.emit("close")}};Mp.inherits(gZ,nA0);function gZ($,Y){Y=Y||{},nA0.call(this,Y),this.context=$,this.context.ref(),this.start=Y.start||0,this.endOffset=Y.end,this.pos=this.start}gZ.prototype._read=function($){var Y=this,z=Math.min(Y._readableState.highWaterMark,$);if(Y.endOffset!=null)z=Math.min(z,Y.endOffset-Y.pos);if(z<=0){Y.push(null),this._cleanup();return}Y.context.pend.go(function(U){var I=Buffer.allocUnsafe(z);wp.read(Y.context.fd,I,0,z,Y.pos,function(Q,J){if(Q)Y.destroy(Q);else if(J===0)Y.push(null),Y._cleanup();else Y.pos+=J,Y.push(I.slice(0,J));U()})})};gZ.prototype._destroy=function($,Y){this._cleanup(),Y($)};gZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};Mp.inherits($K,lP);function $K($){lP.call(this),this.refCount=0,this.buffer=$}$K.prototype.read=function($,Y,z,U,I){if(!(0<=Y&&Y<=$.length))throw RangeError("offset outside buffer: 0 <= "+Y+" <= "+$.length);if(U<0)throw RangeError("position is negative: "+U);if(Y+z>$.length)z=$.length-Y;if(U+z>this.buffer.length)z=this.buffer.length-U;if(z<=0){setImmediate(function(){I(null,0)});return}this.buffer.copy($,Y,U,U+z),setImmediate(function(){I(null,z)})};$K.prototype.createReadStream=function($){$=$||{};var Y=new bD1($);Y.start=$.start||0,Y.endOffset=$.end,Y.pos=Y.endOffset||this.buffer.length;var z=this.buffer.slice(Y.start,Y.pos),U=65536,I=0;while(!0){var Q=I+U;if(Q>=z.length){if(I<z.length)Y.write(z.slice(I,z.length));break}Y.write(z.slice(I,Q)),I=Q}return Y.end(),Y};$K.prototype.ref=function(){this.refCount+=1};$K.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var mA0=E((B14,dA0)=>{var dD1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462, Line truncated
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csiLine truncated
\v\f\r\x0E\x0F\x10ỨỰỲỶỸÝỴ\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:`\x00\x01Ẳ\x03\x04ẴẪ\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13Ỷ\x15\x16\x17\x18Ỹ\x1A\x1B\x1C\x1DỴ\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ`},iso646cn:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},iso646jp:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var HB0=E((NP1)=>{var rp=y3().Buffer;NP1._dbcs=x3;var z8=-1,WB0=-2,p$=-10,h8=-1000,QK=Array(256),gZ=-1;for(SZ=0;SZ<256;SZ++)QK[SZ]=z8;var SZ;function x3($,Y){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=QK.slice(0),this.decodeTableSeq=[];for(var U=0;U<z.length;U++)this._addDecodeChunk(z[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var I=this.decodeTables.length;this.decodeTables.push(QK.slice(0));var Q=this.decodeTables.length;this.decodeTables.push(QK.slice(0));var J=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[h8-J[U]];for(var G=48;G<=57;G++){if(K[G]===z8)K[G]=h8-I;else if(K[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var W=this.decodeTables[h8-K[G]];for(var H=129;H<=254;H++){if(W[H]===z8)W[H]=h8-Q;else if(W[H]===h8-Q)continue;else if(W[H]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-W[H]];for(var Z=48;Z<=57;Z++)if(X[Z]===z8)X[Z]=WB0}}}}this.defaultCharUnicode=Y.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var V=$.encodeSkipVals[U];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][Y.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===z8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===z8)this.defCharSB=63}x3.prototype.encoder=YA;x3.prototype.decoder=sp;x3.prototype._getDecodeTrieNode=function($){var Y=[];for(;$>0;$>>>=8)Y.push($&255);if(Y.length==0)Y.push(0);var z=this.decodeTables[0];for(var U=Y.length-1;U>0;U--){var I=z[Y[U]];if(I==z8)z[Y[U]]=h8-this.decodeTables.length,this.decodeTables.push(z=QK.slice(0));else if(I<=h8)z=this.decodeTables[h8-I];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};x3.prototype._addDecodeChunk=function($){var Y=parseInt($[0],16),z=this._getDecodeTrieNode(Y);Y=Y&255;for(var U=1;U<$.length;U++){var I=$[U];if(typeof I==="string")for(var Q=0;Q<I.length;){var J=I.charCodeAt(Q++);if(J>=55296&&J<56320){var K=I.charCodeAt(Q++);if(K>=56320&&K<57344)z[Y++]=65536+(J-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(J>4080&&J<=4095){var G=4095-J+2,W=[];for(var H=0;H<G;H++)W.push(I.charCodeAt(Q++));z[Y++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(W)}else z[Y++]=J}else if(typeof I==="number"){var X=z[Y-1]+1;for(var Q=0;Q<I;Q++)z[Y++]=X++}else throw Error("Incorrect type '"+typeof I+"' given in "+this.encodingName+" at chunk "+$[0])}if(Y>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`;super(Y);this.name="AggregateError",this.errors=$}}OA0.exports={AggregateError:MA0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,Y){return $.includes(Y)},ArrayPrototypeIndexOf($,Y){return $.indexOf(Y)},ArrayPrototypeJoin($,Y){return $.join(Y)},ArrayPrototypeMap($,Y){return $.map(Y)},ArrayPrototypePop($,Y){return $.pop(Y)},ArrayPrototypePush($,Y){return $.push(Y)},ArrayPrototypeSlice($,Y,z){return $.slice(Y,z)},Error,FunctionPrototypeCall($,Y,...z){return $.call(Y,...z)},FunctionPrototypeSymbolHasInstance($,Y){return Function.prototype[Symbol.hasInstance].call($,Y)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,Y){return Object.defineProperties($,Y)},ObjectDefineProperty($,Y,z){return Object.defineProperty($,Y,z)},ObjectGetOwnPropertyDescriptor($,Y){return Object.getOwnPropertyDescriptor($,Y)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,Y){return Object.setPrototypeOf($,Y)},Promise,PromisePrototypeCatch($,Y){return $.catch(Y)},PromisePrototypeThen($,Y,z){return $.then(Y,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,Y){return $.test(Y)},SafeSet:Set,String,StringPrototypeSlice($,Y,z){return $.slice(Y,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,Y,z){return $.set(Y,z)},Boolean,Uint8Array}});var Od=E((a14,NA0)=>{NA0.exports={format($,...Y){return $.replace(/%([sdifj])/g,function(...[z,U]){let I=Y.shift();if(U==="f")return I.toFixed(6);else if(U==="j")return JSON.stringify(I);else if(U==="s"&&typeof I==="object")return`${I.constructor!==Object?I.constructor.name:""} {}`.trim();else return I.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var M8=E((t14,AA0)=>{var{format:qA1,inspect:KA}=Od(),{AggregateError:VA1}=x4(),LA1=globalThis.AggregateError||VA1,FA1=Symbol("kIsNodeError"),wA1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],MA1=/^([A-Z][a-z0-9]*)+$/,GA={};function HU($,Y){if(!$)throw new GA.ERR_INTERNAL_ASSERTION(Y)}function DA0($){let Y="",z=$.length,U=$[0]==="-"?1:0;for(;z>=U+4;z-=3)Y=`_${$.slice(z-3,z)}${Y}`;return`${$.slice(0,z)}${Y}`}function OA1($,Y,z){if(typeof Y==="function")return HU(Y.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${Y.length}).`),Y(...z);let U=(Y.match(/%[dfijoOs]/g)||[]).length;if(HU(U===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${U}).`),z.length===0)return Y;return qA1(Y,...z)}function U8($,Y,z){if(!z)z=Error;class U extends z{constructor(...I){super(OA1($,Y,I))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(U.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),U.prototype.code=$,U.prototype[FA1]=!0,GA[$]=U}function PA0($){let Y="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:Y}),$}function NA1($,Y){if($&&Y&&$!==Y){if(Array.isArray(Y.errors))return Y.errors.push($),Y;let z=new LA1([Y,$],Y.message);return z.code=Y.code,z}return $||Y}class BA0 extends Error{constructor($="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw new GA.ERR_INVALID_ARG_TYPE("options","Object",Y);super($,Y);this.code="ABORT_ERR",this.name="AbortError"}}U8("ERR_ASSERTION","%s",Error);U8("ERR_INVALID_ARG_TYPE",($,Y,z)=>{if(HU(typeof $==="string","'name' must be a string"),!Array.isArray(Y))Y=[Y];let U="The ";if($.endsWith(" argument"))U+=`${$} `;else U+=`"${$}" ${$.includes(".")?"property":"argument"} `;U+="must be ";let I=[],Q=[],J=[];for(let G of Y)if(HU(typeof G==="string","All expected entries have to be of type string"),wA1.includes(G))I.push(G.toLowerCase());else if(MA1.test(G))Q.push(G);else HU(G!=="object",'The value "object" should be written as "Object"'),J.push(G);if(Q.length>0){let G=I.indexOf("object");if(G!==-1)I.splice(I,G,1),Q.push("Object")}if(I.length>0){switch(I.length){case 1:U+=`of type ${I[Line truncated
`);if(Y.linkname)z+=rm(" linkpath="+Y.linkname+`
`);let U=Y.pax;if(U)for(let I in U)z+=rm(" "+I+"="+U[I]+`
`);return n1.from(z)};wv1.decodePax=function(Y){let z={};while(Y.length){let U=0;while(U<Y.length&&Y[U]!==32)U++;let I=parseInt(n1.toString(Y.subarray(0,U)),10);if(!I)return z;let Q=n1.toString(Y.subarray(U+1,I-1)),J=Q.indexOf("=");if(J===-1)return z;z[Q.slice(0,J)]=Q.slice(J+1),Y=Y.subarray(I)}return z};wv1.encode=function(Y){let z=n1.alloc(512),U=Y.name,I="";if(Y.typeflag===5&&U[U.length-1]!=="/")U+="/";if(n1.byteLength(U)!==U.length)return null;while(n1.byteLength(U)>100){let Q=U.indexOf("/");if(Q===-1)return null;I+=I?"/"+U.slice(0,Q):U.slice(0,Q),U=U.slice(Q+1)}if(n1.byteLength(U)>100||n1.byteLength(I)>155)return null;if(Y.linkname&&n1.byteLength(Y.linkname)>100)return null;if(n1.write(z,U),n1.write(z,m2(Y.mode&4095,6),100),n1.write(z,m2(Y.uid,6),108),n1.write(z,m2(Y.gid,6),116),Lv1(Y.size,z,124),n1.write(z,m2(Y.mtime.getTime()/1000|0,11),136),z[156]=48+qv1(Y.type),Y.linkname)n1.write(z,Y.linkname,157);if(n1.copy(oC0,z,257),n1.copy(Jv1,z,263),Y.uname)n1.write(z,Y.uname,265);if(Y.gname)n1.write(z,Y.gname,297);if(n1.write(z,m2(Y.devmajor||0,6),329),n1.write(z,m2(Y.devminor||0,6),337),I)n1.write(z,I,345);return n1.write(z,m2(sC0(z),6),148),z};wv1.decode=function(Y,z,U){let I=Y[156]===0?0:Y[156]-48,Q=TK(Y,0,100,z),J=d2(Y,100,8),K=d2(Y,108,8),G=d2(Y,116,8),W=d2(Y,124,12),H=d2(Y,136,12),X=Zv1(I),Z=Y[157]===0?null:TK(Y,157,100,z),q=TK(Y,265,32),V=TK(Y,297,32),F=d2(Y,329,8),M=d2(Y,337,8),w=sC0(Y);if(w===256)return null;if(w!==d2(Y,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(Wv1(Y)){if(Y[345])Q=TK(Y,345,155,z)+"/"+Q}else if(Hv1(Y));else if(!U)throw Error("Invalid tar header: unknown format.");if(I===0&&Q&&Q[Q.length-1]==="/")I=5;return{name:Q,mode:J,uid:K,gid:G,size:W,byteOffset:0,mtime:new Date(1000*H),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:M,pax:null}};function Wv1($){return n1.equals(oC0,$.subarray(257,263))}function Hv1($){return n1.equals(Kv1,$.subarray(257,263))&&n1.equals(Gv1,$.subarray(263,265))}function Xv1($,Y,z){if(typeof $!=="number")return z;if($=~~$,$>=Y)return Y;if($>=0)return $;if($+=Y,$>=0)return $;return 0}function Zv1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function qv1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function rC0($,Y,z,U){for(;z<U;z++)if($[z]===Y)return z;return U}function sC0($){let Y=256;for(let z=0;z<148;z++)Y+=$[z];for(let z=156;z<512;z++)Y+=$[z];return Y}function m2($,Y){if($=$.toString(8),$.length>Y)return"7777777777777777777".slice(0,Y)+" ";return"0000000000000000000".slice(0,Y-$.length)+$+" "}function Vv1($,Y,z){Y[z]=128;for(let U=11;U>0;U--)Y[z+U]=$&255,$=Math.floor($/256)}function Lv1($,Y,z){if($.toString(8).length>11)Vv1($,Y,z);else n1.write(Y,m2($,11),z)}function Fv1($){let Y;if($[0]===128)Y=!0;else if($[0]===255)Y=!1;else return null;let z=[],U;for(U=$.length-1;U>0;U--){let J=$[U];if(Y)z.push(J);else z.push(255-J)}let I=0,Q=z.length;for(U=0;U<Q;U++)I+=z[U]*Math.pow(256,U);return Y?I:-1*I}function d2($,Y,z){if($=$.subarray(Y,Y+z),Y=0,$[Y]&128)return Fv1($);else{while(Y<$.length&&$[Y]===32)Y++;let U=Xv1(rC0($,32,Y,$.length),$.length,$.length);while(Y<U&&$[Y]===0)Y++;if(U===Y)return 0;return parseInt(n1.toString($.subarray(Y,U)),8)}}function TK($,Y,z,U){return n1.toString($.subarray(Y,rC0($,0,Y,Y+z)),U)}function rm($){let Y=n1.byteLength($),z=Math.floor(Math.log(Y)/Math.log(10))+1;if(Y+z>=Math.pow(10,z))z++;return Y+z+$}});var IR0=E((c64,UR0)=>{var{Writable:Bv1,Readable:Av1,getStreamError:aC0}=om(),Tv1=bm(),tC0=AK(),jK=sm(),jv1=tC0.alloc(0);class eC0{constructor(){this.buffered=0,this.shifted=0,this.queue=new Tv1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return jv1;let Y=this._next($);if($===Y.byteLength)return Y;let z=[Y];while(($-=Y.byteLength)>0)Y=this._next($),z.push(Y);return tC0.concat(z)}_next($){let Y=this.queue.peek(),z=Y.byteLength-this._offset;if($>=z){let U=this._offset?Y.subarray(this._offset,Y.byteLength):Y;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,U}return this.buffered-=$,this.shifted+=$,Y.subarray(this._offset,this._offset+=$)}}class $R0 extends Av1{constructor($,Y,z){super();this.header=Y,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(aC0(this))}_detach(){if(this._parent._stream= Line truncated
`),U=[await G4($,z.recordId)];else if(z.recordIds&&z.recordIds.length>0)process.stderr.write(`\uD83D\uDD0D 批量查询 ${z.recordIds.length} 条单据记录...
`),U=await Promise.all(z.recordIds.map((w)=>G4($,w)));else{let w=z.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${Y.name}」(${Y.id}) 的线上审核记录 (限制 ${w} 条)...
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var BP0=E((nA1)=>{var $d=y3().Buffer;nA1._dbcs=x3;var z8=-1,PP0=-2,p$=-10,h8=-1000,KK=Array(256),xZ=-1;for(kZ=0;kZ<256;kZ++)KK[kZ]=z8;var kZ;function x3($,Y){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=KK.slice(0),this.decodeTableSeq=[];for(var U=0;U<z.length;U++)this._addDecodeChunk(z[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var I=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var Q=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var J=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[h8-J[U]];for(var G=48;G<=57;G++){if(K[G]===z8)K[G]=h8-I;else if(K[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var H=this.decodeTables[h8-K[G]];for(var W=129;W<=254;W++){if(H[W]===z8)H[W]=h8-Q;else if(H[W]===h8-Q)continue;else if(H[W]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-H[W]];for(var Z=48;Z<=57;Z++)if(X[Z]===z8)X[Z]=PP0}}}}this.defaultCharUnicode=Y.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var V=$.encodeSkipVals[U];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][Y.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===z8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===z8)this.defCharSB=63}x3.prototype.encoder=JB;x3.prototype.decoder=Yd;x3.prototype._getDecodeTrieNode=function($){var Y=[];for(;$>0;$>>>=8)Y.push($&255);if(Y.length==0)Y.push(0);var z=this.decodeTables[0];for(var U=Y.length-1;U>0;U--){var I=z[Y[U]];if(I==z8)z[Y[U]]=h8-this.decodeTables.length,this.decodeTables.push(z=KK.slice(0));else if(I<=h8)z=this.decodeTables[h8-I];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};x3.prototype._addDecodeChunk=function($){var Y=parseInt($[0],16),z=this._getDecodeTrieNode(Y);Y=Y&255;for(var U=1;U<$.length;U++){var I=$[U];if(typeof I==="string")for(var Q=0;Q<I.length;){var J=I.charCodeAt(Q++);if(J>=55296&&J<56320){var K=I.charCodeAt(Q++);if(K>=56320&&K<57344)z[Y++]=65536+(J-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(J>4080&&J<=4095){var G=4095-J+2,H=[];for(var W=0;W<G;W++)H.push(I.charCodeAt(Q++));z[Y++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(H)}else z[Y++]=J}else if(typeof I==="number"){var X=z[Y-1]+1;for(var Q=0;Q<I;Q++)z[Y++]=X++}else throw Error("Incorrect type '"+typeof I+"' given in "+this.encodingName+" at chunk "+$[0])}if(Y>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`;super(Y);this.name="AggregateError",this.errors=$}}SB0.exports={AggregateError:hB0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,Y){return $.includes(Y)},ArrayPrototypeIndexOf($,Y){return $.indexOf(Y)},ArrayPrototypeJoin($,Y){return $.join(Y)},ArrayPrototypeMap($,Y){return $.map(Y)},ArrayPrototypePop($,Y){return $.pop(Y)},ArrayPrototypePush($,Y){return $.push(Y)},ArrayPrototypeSlice($,Y,z){return $.slice(Y,z)},Error,FunctionPrototypeCall($,Y,...z){return $.call(Y,...z)},FunctionPrototypeSymbolHasInstance($,Y){return Function.prototype[Symbol.hasInstance].call($,Y)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,Y){return Object.defineProperties($,Y)},ObjectDefineProperty($,Y,z){return Object.defineProperty($,Y,z)},ObjectGetOwnPropertyDescriptor($,Y){return Object.getOwnPropertyDescriptor($,Y)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,Y){return Object.setPrototypeOf($,Y)},Promise,PromisePrototypeCatch($,Y){return $.catch(Y)},PromisePrototypeThen($,Y,z){return $.then(Y,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,Y){return $.test(Y)},SafeSet:Set,String,StringPrototypeSlice($,Y,z){return $.slice(Y,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,Y,z){return $.set(Y,z)},Boolean,Uint8Array}});var Bd=E((C44,gB0)=>{gB0.exports={format($,...Y){return $.replace(/%([sdifj])/g,function(...[z,U]){let I=Y.shift();if(U==="f")return I.toFixed(6);else if(U==="j")return JSON.stringify(I);else if(U==="s"&&typeof I==="object")return`${I.constructor!==Object?I.constructor.name:""} {}`.trim();else return I.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var M8=E((R44,fB0)=>{var{format:kB1,inspect:ZB}=Bd(),{AggregateError:xB1}=x4(),fB1=globalThis.AggregateError||xB1,uB1=Symbol("kIsNodeError"),bB1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],iB1=/^([A-Z][a-z0-9]*)+$/,qB={};function ZU($,Y){if(!$)throw new qB.ERR_INTERNAL_ASSERTION(Y)}function yB0($){let Y="",z=$.length,U=$[0]==="-"?1:0;for(;z>=U+4;z-=3)Y=`_${$.slice(z-3,z)}${Y}`;return`${$.slice(0,z)}${Y}`}function cB1($,Y,z){if(typeof Y==="function")return ZU(Y.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${Y.length}).`),Y(...z);let U=(Y.match(/%[dfijoOs]/g)||[]).length;if(ZU(U===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${U}).`),z.length===0)return Y;return kB1(Y,...z)}function U8($,Y,z){if(!z)z=Error;class U extends z{constructor(...I){super(cB1($,Y,I))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(U.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),U.prototype.code=$,U.prototype[uB1]=!0,qB[$]=U}function kB0($){let Y="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:Y}),$}function nB1($,Y){if($&&Y&&$!==Y){if(Array.isArray(Y.errors))return Y.errors.push($),Y;let z=new fB1([Y,$],Y.message);return z.code=Y.code,z}return $||Y}class xB0 extends Error{constructor($="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw new qB.ERR_INVALID_ARG_TYPE("options","Object",Y);super($,Y);this.code="ABORT_ERR",this.name="AbortError"}}U8("ERR_ASSERTION","%s",Error);U8("ERR_INVALID_ARG_TYPE",($,Y,z)=>{if(ZU(typeof $==="string","'name' must be a string"),!Array.isArray(Y))Y=[Y];let U="The ";if($.endsWith(" argument"))U+=`${$} `;else U+=`"${$}" ${$.includes(".")?"property":"argument"} `;U+="must be ";let I=[],Q=[],J=[];for(let G of Y)if(ZU(typeof G==="string","All expected entries have to be of type string"),bB1.includes(G))I.push(G.toLowerCase());else if(iB1.test(G))Q.push(G);else ZU(G!=="object",'The value "object" should be written as "Object"'),J.push(G);if(Q.length>0){let G=I.indexOf("object");if(G!==-1)I.splice(I,G,1),Q.push("Object")}if(I.length>0){switch(I.length){case 1:U+=`of type ${I[Line truncated
`);if(Y.linkname)z+=$l(" linkpath="+Y.linkname+`
`);let U=Y.pax;if(U)for(let I in U)z+=$l(" "+I+"="+U[I]+`
`);return n1.from(z)};bv1.decodePax=function(Y){let z={};while(Y.length){let U=0;while(U<Y.length&&Y[U]!==32)U++;let I=parseInt(n1.toString(Y.subarray(0,U)),10);if(!I)return z;let Q=n1.toString(Y.subarray(U+1,I-1)),J=Q.indexOf("=");if(J===-1)return z;z[Q.slice(0,J)]=Q.slice(J+1),Y=Y.subarray(I)}return z};bv1.encode=function(Y){let z=n1.alloc(512),U=Y.name,I="";if(Y.typeflag===5&&U[U.length-1]!=="/")U+="/";if(n1.byteLength(U)!==U.length)return null;while(n1.byteLength(U)>100){let Q=U.indexOf("/");if(Q===-1)return null;I+=I?"/"+U.slice(0,Q):U.slice(0,Q),U=U.slice(Q+1)}if(n1.byteLength(U)>100||n1.byteLength(I)>155)return null;if(Y.linkname&&n1.byteLength(Y.linkname)>100)return null;if(n1.write(z,U),n1.write(z,m2(Y.mode&4095,6),100),n1.write(z,m2(Y.uid,6),108),n1.write(z,m2(Y.gid,6),116),fv1(Y.size,z,124),n1.write(z,m2(Y.mtime.getTime()/1000|0,11),136),z[156]=48+kv1(Y.type),Y.linkname)n1.write(z,Y.linkname,157);if(n1.copy(GR0,z,257),n1.copy(Rv1,z,263),Y.uname)n1.write(z,Y.uname,265);if(Y.gname)n1.write(z,Y.gname,297);if(n1.write(z,m2(Y.devmajor||0,6),329),n1.write(z,m2(Y.devminor||0,6),337),I)n1.write(z,I,345);return n1.write(z,m2(WR0(z),6),148),z};bv1.decode=function(Y,z,U){let I=Y[156]===0?0:Y[156]-48,Q=EK(Y,0,100,z),J=d2(Y,100,8),K=d2(Y,108,8),G=d2(Y,116,8),H=d2(Y,124,12),W=d2(Y,136,12),X=yv1(I),Z=Y[157]===0?null:EK(Y,157,100,z),q=EK(Y,265,32),V=EK(Y,297,32),F=d2(Y,329,8),M=d2(Y,337,8),w=WR0(Y);if(w===256)return null;if(w!==d2(Y,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(hv1(Y)){if(Y[345])Q=EK(Y,345,155,z)+"/"+Q}else if(Sv1(Y));else if(!U)throw Error("Invalid tar header: unknown format.");if(I===0&&Q&&Q[Q.length-1]==="/")I=5;return{name:Q,mode:J,uid:K,gid:G,size:H,byteOffset:0,mtime:new Date(1000*W),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:M,pax:null}};function hv1($){return n1.equals(GR0,$.subarray(257,263))}function Sv1($){return n1.equals(_v1,$.subarray(257,263))&&n1.equals(vv1,$.subarray(263,265))}function gv1($,Y,z){if(typeof $!=="number")return z;if($=~~$,$>=Y)return Y;if($>=0)return $;if($+=Y,$>=0)return $;return 0}function yv1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function kv1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function HR0($,Y,z,U){for(;z<U;z++)if($[z]===Y)return z;return U}function WR0($){let Y=256;for(let z=0;z<148;z++)Y+=$[z];for(let z=156;z<512;z++)Y+=$[z];return Y}function m2($,Y){if($=$.toString(8),$.length>Y)return"7777777777777777777".slice(0,Y)+" ";return"0000000000000000000".slice(0,Y-$.length)+$+" "}function xv1($,Y,z){Y[z]=128;for(let U=11;U>0;U--)Y[z+U]=$&255,$=Math.floor($/256)}function fv1($,Y,z){if($.toString(8).length>11)xv1($,Y,z);else n1.write(Y,m2($,11),z)}function uv1($){let Y;if($[0]===128)Y=!0;else if($[0]===255)Y=!1;else return null;let z=[],U;for(U=$.length-1;U>0;U--){let J=$[U];if(Y)z.push(J);else z.push(255-J)}let I=0,Q=z.length;for(U=0;U<Q;U++)I+=z[U]*Math.pow(256,U);return Y?I:-1*I}function d2($,Y,z){if($=$.subarray(Y,Y+z),Y=0,$[Y]&128)return uv1($);else{while(Y<$.length&&$[Y]===32)Y++;let U=gv1(HR0($,32,Y,$.length),$.length,$.length);while(Y<U&&$[Y]===0)Y++;if(U===Y)return 0;return parseInt(n1.toString($.subarray(Y,U)),8)}}function EK($,Y,z,U){return n1.toString($.subarray(Y,HR0($,0,Y,Y+z)),U)}function $l($){let Y=n1.byteLength($),z=Math.floor(Math.log(Y)/Math.log(10))+1;if(Y+z>=Math.pow(10,z))z++;return Y+z+$}});var MR0=E((O84,wR0)=>{var{Writable:mv1,Readable:lv1,getStreamError:XR0}=em(),ov1=dm(),ZR0=jK(),CK=Yl(),rv1=ZR0.alloc(0);class qR0{constructor(){this.buffered=0,this.shifted=0,this.queue=new ov1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return rv1;let Y=this._next($);if($===Y.byteLength)return Y;let z=[Y];while(($-=Y.byteLength)>0)Y=this._next($),z.push(Y);return ZR0.concat(z)}_next($){let Y=this.queue.peek(),z=Y.byteLength-this._offset;if($>=z){let U=this._offset?Y.subarray(this._offset,Y.byteLength):Y;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,U}return this.buffered-=$,this.shifted+=$,Y.subarray(this._offset,this._offset+=$)}}class VR0 extends lv1{constructor($,Y,z){super();this.header=Y,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(XR0(this))}_detach(){if(this._parent._stream= Line truncated
`),U=[await H4($,z.recordId)];else if(z.recordIds&&z.recordIds.length>0)process.stderr.write(`\uD83D\uDD0D 批量查询 ${z.recordIds.length} 条单据记录...
`),U=await Promise.all(z.recordIds.map((w)=>H4($,w)));else{let w=z.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${Y.name}」(${Y.id}) 的线上审核记录 (限制 ${w} 条)...
`);let D=(await b4($,{limit:w,status:z.status,startDate:z.startDate!==void 0?String(z.startDate):void 0,endDate:z.endDate!==void 0?String(z.endDate):void 0})).records??[];if(D.length===0)throw Error("未检索到符合条件的线上审核记录,无法导出 webhook 资源包。");process.stderr.write(`\uD83D\uDCE5 正在拉取 ${D.length} 条审核记录完整详情...
`),U=await Promise.all(D.map((N)=>G4($,N.id)))}let I=new Map,Q=0;for(let w of U){let O=w.document,D=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,N=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,A=[];if(z.includeAttachments!==!1){let P=k2(w,{summary:!1}).attachments,j=new Set;for(let C of P){let b=C.ossSignedUrl??C.url;if(!b)continue;let k=C.fileName??C.fileId??"attachment",h=nn(k),i=h,c=h.lastIndexOf("."),U0=c>0?h.slice(0,c):h,x=c>0?h.slice(c):"",d=1;while(j.has(i.toLowerCase()))i=`${U0}_${d}${x}`,d++;j.add(i.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${N}」附件: ${k}...
`);let t=await fetch(b);if(t.ok){let $0=await t.arrayBuffer(),g=Buffer.from($0);A.push({fileName:i,zipPath:`${N}/${i}`,buffer:g,sourceField:C.sourceField??"附件"}),Q++}}catch(t){process.stderr.write(`⚠️ [跳过附件] 下载失败 ${k}: ${t}
`)}}}I.set(N,A)}let J=new PR0.default.Workbook;J.creator="seal-use",J.created=new Date;let K=new Set;for(let w of I.values())for(let O of w)K.add(O.sourceField);if(K.size===0)K.add("附件");let G=new Set;for(let w of U){let O=w.document,D=Array.isArray(O?.fields)?O.fields:[];for(let N of D)if(N&&typeof N==="object"){let A=N,T=typeof A.label==="string"?A.label.trim():typeof A.key==="string"?A.key.trim():"",P=typeof A.type==="string"?A.type.toUpperCase():"";if(T&&P!=="ATTACHMENT"&&P!=="LIST")G.add(T)}}let W=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],H=Array.from(G).filter((w)=>!W.includes(w)&&w!=="单据编号"&&w!=="单号"),X=Array.from(K).map((w)=>`[附件]${w}`),Z=[...W,...H,...X],q=J.addWorksheet("主表");q.addRow(Z),q.getRow(1).font={bold:!0};for(let w of U){let O=w.document,D=w.sourceDocumentSN??(typeof O?.sn==="string"?O.sn:void 0)??(typeof O?.sourceDocumentSN==="string"?O.sourceDocumentSN:void 0)??w.id,N=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,A=`${z.docIdPrefix??""}${N}${z.docIdSuffix??""}`,T=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,P=(typeof O?.title==="string"?O.title:void 0)??(typeof O?.name==="string"?O.name:void 0)??T,j="";if(typeof O?.sourceStartTime==="number")j=new Date(O.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="number")j=new Date(w.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="string")j=w.createdAt.slice(0,10);let C=new Map,b=Array.isArray(O?.fields)?O.fields:[];for(let U0 of b)if(U0&&typeof U0==="object"){let x=U0,d=typeof x.label==="string"?x.label.trim():typeof x.key==="string"?x.key.trim():"";if(d)C.set(d,x.value)}let k,h=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof h==="number")k=h;else if(h&&typeof h==="object"&&"amount"in h&&typeof h.amount==="number")k=h.amount;let i=[];i.push(A),i.push(P),i.push(w.status??"已审批"),i.push(k??""),i.push(C.get("报销事由")??C.get("事由")??P),i.push(j);for(let U0 of H){let x=C.get(U0);if(x===void 0||x===null)i.push("");else if(typeof x==="object")if("amount"in x)i.push(x.amount);else i.push(JSON.stringify(x));else i.push(x)}let c=I.get(A)??[];for(let U0 of K){let x=c.filter((d)=>d.sourceField===U0||K.size===1);if(x.length>0)i.push(x.map((d)=>d.zipPath).join(`
`));else i.push("")}q.addRow(i)}let V=dv1(z,Y);bv1(nv1(V),{recursive:!0});let F=await J.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
`),await new Promise((w,O)=>{let D=uv1(V),N=new Yl({zlib:{level:9}});D.on("close",()=>w()),N.on("error",(A)=>O(A)),N.pipe(D),N.append(Buffer.from(F),{name:"信息表.xlsx"});for(let A of I.values())for(let T of A)N.append(T.buffer,{name:T.zipPath});N.finalize()});let M=iv1(V);return{filePath:V,corpId:Y.id,corpName:Y.name,recordCount:U.length,attachmentCount:Q,fileSizeBytes:M.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var PR0;var zl=o(()=>{NR0();X6();CB();PR0=Q6(AZ(),1)});import{readFileSync as mv1}from"node:fs";function lv1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${Y.protocol}//${Y.host}`,webhookId:z[1]}}function ov1($,Y){return Y.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!Y.toLowerCase().endsWith(".xlsx")}function rv1($,Y){if(!$.length)return;let z=new Set($.map((Q)=>{let J=Q.fileName.split("/")[0],K=J.indexOf("@");return K>=0?J.slice(0,K):J}).filter((Q)=>Q!=="信息表.xlsx")),U=[];for(let Q of Y){let J=Q.document.documentId;if((Q.documentAttachments.length>0||Object.values(Q.expenseAttachments).some((G)=>G.length>0)||Object.values(Q.personAttachments).some((G)=>G.length>0))&&!z.has(J))U.push(`Excel 会议编号「${J}」声明了附件,但在 ZIP 中找不到对应的根目录「${J}/」或「${J}@.../」。`)}let I=new Set(Y.map((Q)=>Q.document.documentId));for(let Q of z)if(!I.has(Q))U.push(`ZIP 根目录对应的编号「${Q}」在信息表中找不到对应的会议编号。`);if(U.length)throw new D5(U)}async function BR0($,Y,z){let U=[],I=$;if(ov1($,Y)){U=await SB0($),yB0(U,z);let G=U.find((W)=>W.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");I=await zd($,G)}let Q=await cB0(I);rv1(U,Q);let J=nB0(U,Q),K=Q.map((G)=>G.document);return{entries:U,parsed:Q,plans:J,documents:K,fileBuffer:$}}async function CU($,Y,z){let U=await BR0($,Y,z),I=U.parsed.map((Q,J)=>Gd(Q.document,U.plans[J],new Map));return{warnings:[],documents:I,attachmentPlan:U.plans}}async function aA($,Y,z){let U=await BR0($,Y,z.materialPackFilePolicy),{baseUrl:I,webhookId:Q}=lv1(z.webhookUrl),J=[];for(let K=0;K<U.parsed.length;K+=1){let G=U.parsed[K],W=U.plans[K],H=new Map,X=[...W.categoryFields,...Object.values(W.personAttachments).flat(),...Object.values(W.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(H.has(F))continue;let M=U.entries.find((T)=>T.fileName===F);if(!M)continue;process.stderr.write(`⬆ 上传附件: ${F}
`);let w=new FormData,O=await zd(U.fileBuffer,M),D=F.split("/").pop()??F;w.append("files",new File([new Uint8Array(O)],D));let N=await fetch(`${I}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...CZ({},z.secret)},body:w});if(!N.ok)throw Error(`附件上传失败 ${N.status}: ${await N.text()}`);let A=await N.json();H.set(F,A.attachments?.map((T)=>T.data)??(A.data===void 0?[]:[A.data])),process.stderr.write(`✓ 附件上传成功: ${F}
`),U=await Promise.all(D.map((N)=>H4($,N.id)))}let I=new Map,Q=0;for(let w of U){let O=w.document,D=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,N=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,B=[];if(z.includeAttachments!==!1){let A=k2(w,{summary:!1}).attachments,j=new Set;for(let C of A){let b=C.ossSignedUrl??C.url;if(!b)continue;let k=C.fileName??C.fileId??"attachment",h=on(k),i=h,c=h.lastIndexOf("."),U0=c>0?h.slice(0,c):h,x=c>0?h.slice(c):"",d=1;while(j.has(i.toLowerCase()))i=`${U0}_${d}${x}`,d++;j.add(i.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${N}」附件: ${k}...
`);let t=await fetch(b);if(t.ok){let $0=await t.arrayBuffer(),g=Buffer.from($0);B.push({fileName:i,zipPath:`${N}/${i}`,buffer:g,sourceField:C.sourceField??"附件"}),Q++}}catch(t){process.stderr.write(`⚠️ [跳过附件] 下载失败 ${k}: ${t}
`)}}}I.set(N,B)}let J=new kR0.default.Workbook;J.creator="seal-use",J.created=new Date;let K=new Set;for(let w of I.values())for(let O of w)K.add(O.sourceField);if(K.size===0)K.add("附件");let G=new Set;for(let w of U){let O=w.document,D=Array.isArray(O?.fields)?O.fields:[];for(let N of D)if(N&&typeof N==="object"){let B=N,T=typeof B.label==="string"?B.label.trim():typeof B.key==="string"?B.key.trim():"",A=typeof B.type==="string"?B.type.toUpperCase():"";if(T&&A!=="ATTACHMENT"&&A!=="LIST")G.add(T)}}let H=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],W=Array.from(G).filter((w)=>!H.includes(w)&&w!=="单据编号"&&w!=="单号"),X=Array.from(K).map((w)=>`[附件]${w}`),Z=[...H,...W,...X],q=J.addWorksheet("主表");q.addRow(Z),q.getRow(1).font={bold:!0};for(let w of U){let O=w.document,D=w.sourceDocumentSN??(typeof O?.sn==="string"?O.sn:void 0)??(typeof O?.sourceDocumentSN==="string"?O.sourceDocumentSN:void 0)??w.id,N=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,B=`${z.docIdPrefix??""}${N}${z.docIdSuffix??""}`,T=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,A=(typeof O?.title==="string"?O.title:void 0)??(typeof O?.name==="string"?O.name:void 0)??T,j="";if(typeof O?.sourceStartTime==="number")j=new Date(O.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="number")j=new Date(w.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="string")j=w.createdAt.slice(0,10);let C=new Map,b=Array.isArray(O?.fields)?O.fields:[];for(let U0 of b)if(U0&&typeof U0==="object"){let x=U0,d=typeof x.label==="string"?x.label.trim():typeof x.key==="string"?x.key.trim():"";if(d)C.set(d,x.value)}let k,h=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof h==="number")k=h;else if(h&&typeof h==="object"&&"amount"in h&&typeof h.amount==="number")k=h.amount;let i=[];i.push(B),i.push(A),i.push(w.status??"已审批"),i.push(k??""),i.push(C.get("报销事由")??C.get("事由")??A),i.push(j);for(let U0 of W){let x=C.get(U0);if(x===void 0||x===null)i.push("");else if(typeof x==="object")if("amount"in x)i.push(x.amount);else i.push(JSON.stringify(x));else i.push(x)}let c=I.get(B)??[];for(let U0 of K){let x=c.filter((d)=>d.sourceField===U0||K.size===1);if(x.length>0)i.push(x.map((d)=>d.zipPath).join(`
`));else i.push("")}q.addRow(i)}let V=Vh1(z,Y);Hh1(Zh1(V),{recursive:!0});let F=await J.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
`),await new Promise((w,O)=>{let D=Gh1(V),N=new Jl({zlib:{level:9}});D.on("close",()=>w()),N.on("error",(B)=>O(B)),N.pipe(D),N.append(Buffer.from(F),{name:"信息表.xlsx"});for(let B of I.values())for(let T of B)N.append(T.buffer,{name:T.zipPath});N.finalize()});let M=Wh1(V);return{filePath:V,corpId:Y.id,corpName:Y.name,recordCount:U.length,attachmentCount:Q,fileSizeBytes:M.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var kR0;var Kl=o(()=>{gR0();X6();SP();kR0=Q6(EZ(),1)});import{readFileSync as Lh1}from"node:fs";function Fh1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${Y.protocol}//${Y.host}`,webhookId:z[1]}}function wh1($,Y){return Y.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!Y.toLowerCase().endsWith(".xlsx")}function Mh1($,Y){if(!$.length)return;let z=new Set($.map((Q)=>{let J=Q.fileName.split("/")[0],K=J.indexOf("@");return K>=0?J.slice(0,K):J}).filter((Q)=>Q!=="信息表.xlsx")),U=[];for(let Q of Y){let J=Q.document.documentId;if((Q.documentAttachments.length>0||Object.values(Q.expenseAttachments).some((G)=>G.length>0)||Object.values(Q.personAttachments).some((G)=>G.length>0))&&!z.has(J))U.push(`Excel 会议编号「${J}」声明了附件,但在 ZIP 中找不到对应的根目录「${J}/」或「${J}@.../」。`)}let I=new Set(Y.map((Q)=>Q.document.documentId));for(let Q of z)if(!I.has(Q))U.push(`ZIP 根目录对应的编号「${Q}」在信息表中找不到对应的会议编号。`);if(U.length)throw new D5(U)}async function xR0($,Y,z){let U=[],I=$;if(wh1($,Y)){U=await lP0($),rP0(U,z);let G=U.find((H)=>H.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");I=await Kd($,G)}let Q=await zB0(I);Mh1(U,Q);let J=UB0(U,Q),K=Q.map((G)=>G.document);return{entries:U,parsed:Q,plans:J,documents:K,fileBuffer:$}}async function _U($,Y,z){let U=await xR0($,Y,z),I=U.parsed.map((Q,J)=>qd(Q.document,U.plans[J],new Map));return{warnings:[],documents:I,attachmentPlan:U.plans}}async function zT($,Y,z){let U=await xR0($,Y,z.materialPackFilePolicy),{baseUrl:I,webhookId:Q}=Fh1(z.webhookUrl),J=[];for(let K=0;K<U.parsed.length;K+=1){let G=U.parsed[K],H=U.plans[K],W=new Map,X=[...H.categoryFields,...Object.values(H.personAttachments).flat(),...Object.values(H.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(W.has(F))continue;let M=U.entries.find((T)=>T.fileName===F);if(!M)continue;process.stderr.write(`⬆ 上传附件: ${F}
`);let w=new FormData,O=await Kd(U.fileBuffer,M),D=F.split("/").pop()??F;w.append("files",new File([new Uint8Array(O)],D));let N=await fetch(`${I}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...vZ({},z.secret)},body:w});if(!N.ok)throw Error(`附件上传失败 ${N.status}: ${await N.text()}`);let B=await N.json();W.set(F,B.attachments?.map((T)=>T.data)??(B.data===void 0?[]:[B.data])),process.stderr.write(`✓ 附件上传成功: ${F}
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${G.document.documentId}
`);let Z=Gd(G.document,W,H),q=await fetch(`${I}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...CZ({webhookId:Q,...Z},z.secret)},body:JSON.stringify(Z)});if(!q.ok)throw Error(`Webhook 单据推送失败 ${q.status}: ${await q.text()}`);J.push({documentId:Z.documentId,document:Z,pushResult:await q.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
`)}return{warnings:[],results:J}}function RU($){return{fileBuffer:mv1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Ul=o(()=>{xB();Wd();Kd();Ud();sJ();zl()});import{existsSync as sv1}from"node:fs";async function tA($,Y,z={}){let I=_4().stateful?"stateful":"stateless",Q="ok",J,K,G;try{let N=await H8($);G={id:N.user.id,name:N.user.name,isAdmin:N.user.isAdmin},K={id:N.tenant.id,name:N.tenant.name,tenantSlug:N.tenant.tenantSlug,corporationName:N.tenant.hoseCorpConfig?.corporationName}}catch(N){Q="error",J=N instanceof Error?N.message:String(N)}let W=[];if(Q==="ok")try{W=await Q$($,Y.seal.endpoints.approvalStylePreferences)}catch(N){Q="error",J=`读取 Webhook 配置失败: ${N instanceof Error?N.message:String(N)}`}let H=W.length===1,X=W.map((N)=>({id:N.id,name:N.name,mode:N.mode,incomingDocumentWebhookUrl:N.incomingDocumentWebhook.url,outgoingResultWebhookUrl:N.outgoingResultWebhook,autoApprovalRate:N.autoApprovalRate,...H?{isDefault:!0}:{}})),Z=H?{id:W[0].id,name:W[0].name,mode:W[0].mode}:null,q=z.webhook?v7(W,z.webhook):H?W[0]:void 0,V;if(z.filePath)if(!sv1(z.filePath))V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let N=RU(z.filePath),A=await CU(N.fileBuffer,N.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:z.filePath,fileName:N.fileName,documentCount:A.documents.length,warnings:A.warnings}}catch(N){V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[N instanceof Error?N.message:String(N)]}}let F=V?V.valid:!0,M=Q==="ok"&&X.length>0&&F,w=I==="stateful"?"":` --corp ${Y.id}`,O="",D="";if(Q!=="ok")D=`凭证鉴权异常: ${J}`,O=`seal-use auth diagnose${w}`;else if(X.length===0)D="当前企业尚未配置任何 Webhook 集成通道",O=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${w}`;else if(V&&!V.valid)D=`资源包预检失败: ${V.errors?.join("; ")}`,O=`seal-use webhook resource-pack preview ${V.filePath}${w}`;else{D=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let N=V?.filePath??"<资源包.zip>",A=H?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;O=`seal-use webhook resource-pack push ${N}${A}${w}`}return{ready:M,corp:{id:Y.id,name:Y.name,sourceType:Y.source.type,tenant:K,user:G},stateMode:I,authStatus:Q,authError:J,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:D,nextAction:O}}var AR0=o(()=>{S3();X6();Ul()});var Il=o(()=>{sJ();cI();xB();Ud();Kd();Wd();Ul();AR0();zl()});import{existsSync as TR0,mkdirSync as jR0,statSync as av1}from"node:fs";import{homedir as tv1}from"node:os";import{dirname as ev1,resolve as eA}from"node:path";function $h1($){if($.outputFile){let J=eA($.outputFile),K=ev1(J);if(!TR0(K))jR0(K,{recursive:!0});return J}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",U=$.dateTag||new Date().toISOString().slice(0,10),I=`${z}_智能洞察报告_${U}.xlsx`,Q;if($.toDownloads)Q=eA(tv1(),"Downloads");else Q=eA(process.cwd(),"exports");if(!TR0(Q))jR0(Q,{recursive:!0});return eA(Q,I)}async function $T($,Y,z={}){let U=Y.name||Y.id,I=un({startDate:z.startDate,endDate:z.endDate,force:z.force}),Q=new Date().toISOString(),[J,K]=await Promise.all([LM($,{startDate:I.startDateStr,endDate:I.endDateStr,limit:z.limit??100}),wM($,{startDate:I.startDateStr,endDate:I.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=J.tagStats||[],W=[],H=Math.min(G.length,z.limit??50);for(let C=0;C<H;C++){let b=G[C];if(!b?.tagId)continue;try{let k=await FM($,{tagId:b.tagId,startDate:I.startDateStr,endDate:I.endDateStr});for(let h of k.risks||[])W.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:h.documentSN||"-",documentType:h.documentType||"-",riskLevel:h.riskLevel||"warning",confidence:h.confidence??0,riskDetails:h.riskDetails||"-",reasoning:h.reasoning||"-",sourceDocumentURL:h.sourceDocumentURL,createdAt:h.createdAt})}catch{}}let X=new ER0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let M=K.metrics||{},w=[{c Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:CK({id:Y?.id,sn:Y?.sn??Y?.sourceDocumentSN??$.sourceDocumentSN,title:Y?.title??Y?.name,template:JT(Y,["template.name","templateName","form.name","formName","formTitle"]),amount:zT(z,["金额","报销金额","付款金额","合计","价税合计"])??JT(Y,["amount","totalAmount","expenseAmount"]),expenseType:zT(z,["费用类型","费用类别","报销类型"]),costCompany:zT(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:zT(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:Mh1($),attachments:k2($,{summary:!0}).attachments,aiResult:GT($),manualResult:vU($)?.value,hints:CK({amountMentions:vR0(U,["金额","合计","税率"],8),partyMentions:vR0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function Vh1($){let Y=[["result.citedRules",n3($,"result.citedRules")],["result.matchedRules",n3($,"result.matchedRules")],["result.ruleResults",n3($,"result.ruleResults")],["result.rules",n3($,"result.rules")],["pipelineData.citedRules",n3($,"pipelineData.citedRules")],["pipelineData.matchedRules",n3($,"pipelineData.matchedRules")]],z=[],U=new Set;for(let[I,Q]of Y)(Array.isArray(Q)?Q:Q&&typeof Q==="object"?Object.values(Q):[]).forEach((K,G)=>{let W=Zq(K);if(!W)return;let H=S4(W.runtimeRuleId)??S4(W.runtimeId)??S4(W.id)??S4(W.ruleId),X=S4(W.ruleCode)??S4(W.code)??(H?Dh1(H):void 0),Z=CK({runtimeRuleId:H,ruleCode:X,versionNumber:Fh1(W.versionNumber)??$.ruleSetVersionNumber,scope:S4(W.scope),strictness:S4(W.strictness),appliedAnalysis:W.appliedAnalysis??W.analysis??W.reasoning,checkResult:W.checkResult??W.result??W.decision,findings:W.findings??W.riskPoints??W.evidence,sourcePath:`${I}.${G}`}),q=JSON.stringify(Z);if(!U.has(q))U.add(q),z.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function JT($,Y){if(!$)return;for(let z of Y){let U=n3($,z);if(U!==void 0)return U}return}function _R0($,Y){if(!$)return 0;for(let z of Y){let U=n3($,z);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function n3($,Y){return Y.split(".").reduce((z,U)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let I=Number(U);return Number.isInteger(I)?z[I]:void 0}if(typeof z==="object")return z[U];return},$)}function Lh1($,Y,z){let U=Y.split("."),I=$;for(let Q of U.slice(0,-1)){let J=I[Q];if(!J||typeof J!=="object"||Array.isArray(J))I[Q]={};I=I[Q]}I[U[U.length-1]??Y]=z}function CK($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}function Zq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function Fh1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function wh1($){let Y=[];return Gl($,"document",Y),Y}function Gl($,Y,z){if(Array.isArray($)){$.forEach((J,K)=>Gl(J,`${Y}.${K}`,z));return}let U=Zq($);if(!U)return;let I=S4(U.label)??S4(U.name)??S4(U.title)??S4(U.fieldName),Q=U.value??U.displayValue??U.text??U.content;if(I&&Q!==void 0&&typeof Q!=="object")z.push(CK({path:Y,label:I,value:Q,type:S4(U.type)??S4(U.fieldType)}));for(let[J,K]of Object.entries(U)){if(J==="attachments")continue;Gl(K,`${Y}.${J}`,z)}}function zT($,Y){return $.find((U)=>{let I=S4(U.label)??"";return Y.some((Q)=>I.includes(Q))})?.value}function Mh1($){let Y=[];return KT($.result,"result",Y),KT($.document,"document",Y),Y.slice(0,20)}function KT($,Y,z){if(Array.isArray($)){$.forEach((I,Q)=>KT(I,`${Y}.${Q}`,z));return}let U=Zq($);if(!U)return;if(/invoice|发票/i.test(Y))z.push(CK({path:Y,fileName:S4(U.fileName)??S4(U.filename)??S4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[I,Q]of Object.entries(U))KT(Q,`${Y}.${I}`,z)}function vR0($,Y,z){return $.split(/\r?\n/).filter((U)=>Y.some((I)=>U.includes(I))).slice(0,z)}function UT($){return $.map((Y)=>{let z=_U(Y);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Jl($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function Oh1($,Y){if(Y.recordId&&!Y.versionId&&!Y.versionNumber&&!Y.latest){let z=await G4($,Y.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`);let Z=qd(G.document,H,W),q=await fetch(`${I}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...vZ({webhookId:Q,...Z},z.secret)},body:JSON.stringify(Z)});if(!q.ok)throw Error(`Webhook 单据推送失败 ${q.status}: ${await q.text()}`);J.push({documentId:Z.documentId,document:Z,pushResult:await q.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
`)}return{warnings:[],results:J}}function vU($){return{fileBuffer:Lh1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Gl=o(()=>{cP();Vd();Zd();Gd();tJ();Kl()});import{existsSync as Oh1}from"node:fs";async function UT($,Y,z={}){let I=_4().stateful?"stateful":"stateless",Q="ok",J,K,G;try{let N=await W8($);G={id:N.user.id,name:N.user.name,isAdmin:N.user.isAdmin},K={id:N.tenant.id,name:N.tenant.name,tenantSlug:N.tenant.tenantSlug,corporationName:N.tenant.hoseCorpConfig?.corporationName}}catch(N){Q="error",J=N instanceof Error?N.message:String(N)}let H=[];if(Q==="ok")try{H=await Q$($,Y.seal.endpoints.approvalStylePreferences)}catch(N){Q="error",J=`读取 Webhook 配置失败: ${N instanceof Error?N.message:String(N)}`}let W=H.length===1,X=H.map((N)=>({id:N.id,name:N.name,mode:N.mode,incomingDocumentWebhookUrl:N.incomingDocumentWebhook.url,outgoingResultWebhookUrl:N.outgoingResultWebhook,autoApprovalRate:N.autoApprovalRate,...W?{isDefault:!0}:{}})),Z=W?{id:H[0].id,name:H[0].name,mode:H[0].mode}:null,q=z.webhook?v7(H,z.webhook):W?H[0]:void 0,V;if(z.filePath)if(!Oh1(z.filePath))V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let N=vU(z.filePath),B=await _U(N.fileBuffer,N.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:z.filePath,fileName:N.fileName,documentCount:B.documents.length,warnings:B.warnings}}catch(N){V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[N instanceof Error?N.message:String(N)]}}let F=V?V.valid:!0,M=Q==="ok"&&X.length>0&&F,w=I==="stateful"?"":` --corp ${Y.id}`,O="",D="";if(Q!=="ok")D=`凭证鉴权异常: ${J}`,O=`seal-use auth diagnose${w}`;else if(X.length===0)D="当前企业尚未配置任何 Webhook 集成通道",O=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${w}`;else if(V&&!V.valid)D=`资源包预检失败: ${V.errors?.join("; ")}`,O=`seal-use webhook resource-pack preview ${V.filePath}${w}`;else{D=W?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let N=V?.filePath??"<资源包.zip>",B=W?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;O=`seal-use webhook resource-pack push ${N}${B}${w}`}return{ready:M,corp:{id:Y.id,name:Y.name,sourceType:Y.source.type,tenant:K,user:G},stateMode:I,authStatus:Q,authError:J,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:D,nextAction:O}}var fR0=o(()=>{S3();X6();Gl()});var Hl=o(()=>{tJ();pI();cP();Gd();Zd();Vd();Gl();fR0();Kl()});import{existsSync as uR0,mkdirSync as bR0,statSync as Nh1}from"node:fs";import{homedir as Dh1}from"node:os";import{dirname as Ah1,resolve as IT}from"node:path";function Ph1($){if($.outputFile){let J=IT($.outputFile),K=Ah1(J);if(!uR0(K))bR0(K,{recursive:!0});return J}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",U=$.dateTag||new Date().toISOString().slice(0,10),I=`${z}_智能洞察报告_${U}.xlsx`,Q;if($.toDownloads)Q=IT(Dh1(),"Downloads");else Q=IT(process.cwd(),"exports");if(!uR0(Q))bR0(Q,{recursive:!0});return IT(Q,I)}async function QT($,Y,z={}){let U=Y.name||Y.id,I=dn({startDate:z.startDate,endDate:z.endDate,force:z.force}),Q=new Date().toISOString(),[J,K]=await Promise.all([NM($,{startDate:I.startDateStr,endDate:I.endDateStr,limit:z.limit??100}),AM($,{startDate:I.startDateStr,endDate:I.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=J.tagStats||[],H=[],W=Math.min(G.length,z.limit??50);for(let C=0;C<W;C++){let b=G[C];if(!b?.tagId)continue;try{let k=await DM($,{tagId:b.tagId,startDate:I.startDateStr,endDate:I.endDateStr});for(let h of k.risks||[])H.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:h.documentSN||"-",documentType:h.documentType||"-",riskLevel:h.riskLevel||"warning",confidence:h.confidence??0,riskDetails:h.riskDetails||"-",reasoning:h.reasoning||"-",sourceDocumentURL:h.sourceDocumentURL,createdAt:h.createdAt})}catch{}}let X=new iR0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let M=K.metrics||{},w=[{c Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:_K({id:Y?.id,sn:Y?.sn??Y?.sourceDocumentSN??$.sourceDocumentSN,title:Y?.title??Y?.name,template:XT(Y,["template.name","templateName","form.name","formName","formTitle"]),amount:KT(z,["金额","报销金额","付款金额","合计","价税合计"])??XT(Y,["amount","totalAmount","expenseAmount"]),expenseType:KT(z,["费用类型","费用类别","报销类型"]),costCompany:KT(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:KT(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:ih1($),attachments:k2($,{summary:!0}).attachments,aiResult:qT($),manualResult:SU($)?.value,hints:_K({amountMentions:dR0(U,["金额","合计","税率"],8),partyMentions:dR0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function xh1($){let Y=[["result.citedRules",n3($,"result.citedRules")],["result.matchedRules",n3($,"result.matchedRules")],["result.ruleResults",n3($,"result.ruleResults")],["result.rules",n3($,"result.rules")],["pipelineData.citedRules",n3($,"pipelineData.citedRules")],["pipelineData.matchedRules",n3($,"pipelineData.matchedRules")]],z=[],U=new Set;for(let[I,Q]of Y)(Array.isArray(Q)?Q:Q&&typeof Q==="object"?Object.values(Q):[]).forEach((K,G)=>{let H=Lq(K);if(!H)return;let W=S4(H.runtimeRuleId)??S4(H.runtimeId)??S4(H.id)??S4(H.ruleId),X=S4(H.ruleCode)??S4(H.code)??(W?ph1(W):void 0),Z=_K({runtimeRuleId:W,ruleCode:X,versionNumber:uh1(H.versionNumber)??$.ruleSetVersionNumber,scope:S4(H.scope),strictness:S4(H.strictness),appliedAnalysis:H.appliedAnalysis??H.analysis??H.reasoning,checkResult:H.checkResult??H.result??H.decision,findings:H.findings??H.riskPoints??H.evidence,sourcePath:`${I}.${G}`}),q=JSON.stringify(Z);if(!U.has(q))U.add(q),z.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function XT($,Y){if(!$)return;for(let z of Y){let U=n3($,z);if(U!==void 0)return U}return}function pR0($,Y){if(!$)return 0;for(let z of Y){let U=n3($,z);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function n3($,Y){return Y.split(".").reduce((z,U)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let I=Number(U);return Number.isInteger(I)?z[I]:void 0}if(typeof z==="object")return z[U];return},$)}function fh1($,Y,z){let U=Y.split("."),I=$;for(let Q of U.slice(0,-1)){let J=I[Q];if(!J||typeof J!=="object"||Array.isArray(J))I[Q]={};I=I[Q]}I[U[U.length-1]??Y]=z}function _K($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}function Lq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function uh1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function bh1($){let Y=[];return ql($,"document",Y),Y}function ql($,Y,z){if(Array.isArray($)){$.forEach((J,K)=>ql(J,`${Y}.${K}`,z));return}let U=Lq($);if(!U)return;let I=S4(U.label)??S4(U.name)??S4(U.title)??S4(U.fieldName),Q=U.value??U.displayValue??U.text??U.content;if(I&&Q!==void 0&&typeof Q!=="object")z.push(_K({path:Y,label:I,value:Q,type:S4(U.type)??S4(U.fieldType)}));for(let[J,K]of Object.entries(U)){if(J==="attachments")continue;ql(K,`${Y}.${J}`,z)}}function KT($,Y){return $.find((U)=>{let I=S4(U.label)??"";return Y.some((Q)=>I.includes(Q))})?.value}function ih1($){let Y=[];return ZT($.result,"result",Y),ZT($.document,"document",Y),Y.slice(0,20)}function ZT($,Y,z){if(Array.isArray($)){$.forEach((I,Q)=>ZT(I,`${Y}.${Q}`,z));return}let U=Lq($);if(!U)return;if(/invoice|发票/i.test(Y))z.push(_K({path:Y,fileName:S4(U.fileName)??S4(U.filename)??S4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[I,Q]of Object.entries(U))ZT(Q,`${Y}.${I}`,z)}function dR0($,Y,z){return $.split(/\r?\n/).filter((U)=>Y.some((I)=>U.includes(I))).slice(0,z)}function GT($){return $.map((Y)=>{let z=hU(Y);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Xl($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function ch1($,Y){if(Y.recordId&&!Y.versionId&&!Y.versionNumber&&!Y.latest){let z=await H4($,Y.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`+`• 身份主体:${w}${O}
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
`+`• 时效性:换票凭证有效时间 ${q} 秒(${Math.round(q/60)} 分钟),在浏览器打开后将保留 30 天会话
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:Y.sso?H:W,sealResultUrl:W,ssoUrl:H,type:Y.sso?"sso_link":"deep_link",expiresIn:Y.sso?q:void 0,identity:X,warning:Z,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Q.type==="hose"?Th1(Q.domain):void 0,documentUrl:K,recordId:I?.id,sourceDocumentSN:I?.sourceDocumentSN,sourceDocumentId:I?.sourceDocumentId,sourceSystem:I?.sourceSystem,missing:{enterpriseAssistUrl:J?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:U&&!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,Y)=>{let z=Y.sn??Y.query;if(!z)throw Error("query or sn is required");let U=await jh1($,{query:z,sn:Y.sn,batchId:Y.batchId,latest:Y.latest,limit:Y.latest?1:Y.limit??20,maxScan:Y.maxScan??1000}),I=await Promise.all(U.records.map((K)=>G4($,K.id))),Q=RR0(Y.fields),J=I.map((K)=>Ph1(K,Q));return{query:z,sourceDocumentSN:Y.sn,simulationBatchId:Y.batchId,latest:Y.latest??!1,total:U.total,scanned:U.scanned,matched:J.length,records:J,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...Y.includeBridge?{bridge:UT(I)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,Y)=>{let z=Vl(await mS($,Y.batchId),Y.query);return{batchId:Y.batchId,count:z.length,records:z.map(_U),bridge:UT(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,Y)=>{let z=Y.mode??"hosecloud",U=Y.signKey;if(z==="hosecloud"&&!U){if(U=(await oS($)).find((K)=>K.signKey)?.signKey,!U)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`)}function kh1($){let Y=[];if(Y.push(`seal-use ${$.area} - ${$.title}`),$.description)Y.push($.description);Y.push(""),Y.push("Usage:");for(let z of $.commands)for(let U of z.usage)Y.push(` ${U}`);if($.commands.some((z)=>z.name))Y.push(""),Y.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return Y.join(`
`)}function rR0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let Y of sR0)for(let z of Y.commands)for(let U of z.usage)$.push(` ${U}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var sR0;var Nl=o(()=>{L$();sR0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",description:"Production enterprise ID (default: active enterprise)"},{flag:"--record-id <id>",description:"Replay a specific approval run ID"},{flag:"--sn <sn>",description:"Replay a specific document SN"},{flag:"--limit <n>",description:"Batch replay latest N records from production (default: 1)"},{flag:"--status <status>",descripti Line truncated
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:Y.sso?W:H,sealResultUrl:H,ssoUrl:W,type:Y.sso?"sso_link":"deep_link",expiresIn:Y.sso?q:void 0,identity:X,warning:Z,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Q.type==="hose"?oh1(Q.domain):void 0,documentUrl:K,recordId:I?.id,sourceDocumentSN:I?.sourceDocumentSN,sourceDocumentId:I?.sourceDocumentId,sourceSystem:I?.sourceSystem,missing:{enterpriseAssistUrl:J?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:U&&!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,Y)=>{let z=Y.sn??Y.query;if(!z)throw Error("query or sn is required");let U=await rh1($,{query:z,sn:Y.sn,batchId:Y.batchId,latest:Y.latest,limit:Y.latest?1:Y.limit??20,maxScan:Y.maxScan??1000}),I=await Promise.all(U.records.map((K)=>H4($,K.id))),Q=nR0(Y.fields),J=I.map((K)=>dh1(K,Q));return{query:z,sourceDocumentSN:Y.sn,simulationBatchId:Y.batchId,latest:Y.latest??!1,total:U.total,scanned:U.scanned,matched:J.length,records:J,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...Y.includeBridge?{bridge:GT(I)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,Y)=>{let z=Ol(await aS($,Y.batchId),Y.query);return{batchId:Y.batchId,count:z.length,records:z.map(hU),bridge:GT(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,Y)=>{let z=Y.mode??"hosecloud",U=Y.signKey;if(z==="hosecloud"&&!U){if(U=(await eS($)).find((K)=>K.signKey)?.signKey,!U)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`)}function QS1($){let Y=[];if(Y.push(`seal-use ${$.area} - ${$.title}`),$.description)Y.push($.description);Y.push(""),Y.push("Usage:");for(let z of $.commands)for(let U of z.usage)Y.push(` ${U}`);if($.commands.some((z)=>z.name))Y.push(""),Y.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return Y.join(`
`)}function H_0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let Y of W_0)for(let z of Y.commands)for(let U of z.usage)$.push(` ${U}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var W_0;var Tl=o(()=>{L$();W_0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",description:"Production enterprise ID (default: active enterprise)"},{flag:"--record-id <id>",description:"Replay a specific approval run ID"},{flag:"--sn <sn>",description:"Replay a specific document SN"},{flag:"--limit <n>",description:"Batch replay latest N records from production (default: 1)"},{flag:"--status <status>",descripti Line truncated
`)}
`}function Fq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function c0($,Y={}){ih1($,Y);let z=`${JSON.stringify($,null,2)}
`;if(Y.outputFile){xh1(Y.outputFile,z),console.log(JSON.stringify({outputFile:Y.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function ih1($,Y={}){if(Y.allowFull||Y.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>bh1)throw new fB(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function $_0($,Y){if(Y)return;let z=$&&typeof $==="object"?$:{},U=typeof z.count==="number"?z.count:void 0,I=Array.isArray(z.rules)?z.rules.length:void 0,Q=Buffer.byteLength(JSON.stringify($),"utf-8"),J=U??I??0;if(J>fh1||Q>uh1)throw new fB(`Rule list is large (${J} rules, ${Q} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:V0($.full)===!0,outputFile:S($.outputFile)??S($["output-file"])}}function Y_0($=[]){console.log(tR0($))}var fh1=100,uh1=120000,eR0,bh1=200000;var Q4=o(()=>{D4();L$();Nl();eR0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var z_0={};x8(z_0,{selectCorp:()=>E1,runToolResult:()=>o2,runTool:()=>k0,globalConfigSummary:()=>l2});function E1($){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},h3());return eD0(U.id),U}function l2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:QU()}}async function k0($,Y,z,U,I={}){c0(await o2($,Y,z,U),I)}async function o2($,Y,z,U){let I=Xq.find((K)=>K.name===$);if(!I)throw Error(`Unknown Seal tool: ${$}`);let Q=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),J=I.handler;return J(Y,Q,{corp:z})}var o4=o(()=>{S3();yB();qq();Q4()});import{existsSync as U_0}from"node:fs";async function I_0($,Y){if(!U_0($))throw Error(`File not found: ${$}`);let z=RU($);console.log(JSON.stringify(await CU(z.fileBuffer,z.fileName,Y),null,2))}async function qT($,Y,z,U,I){if($==="ready"||$==="status"){let Q=Y??S(I.options.file)??S(I.options.input),J=await tA(z,U,{filePath:Q,webhook:S(I.options.webhook)??S(I.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${J.corp.name} (${J.corp.id}) [${J.stateMode}]`),J.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${J.corp.tenant.name} (${J.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${J.authStatus==="ok"?"OK":`异常 (${J.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${J.activeWebhooks.length} 个可用`);for(let K of J.activeWebhooks){let G=K.isDefault?" [默认通道]":"";console.error(` - ${K.name} (${K.id}) mode=${K.mode}${G}`)}if(J.materialPack)console.error(`[webhook-ready] 材料包预检: ${J.materialPack.valid?`通过 (${J.materialPack.documentCount} 单)`:`失败 (${J.materialPack.errors?.join("; ")})`}`);if(J.ready)console.error(`\uD83D\uDFE2 ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);console.log(JSON.stringify(J,null,2));return}if($==="replay"){let Q=Y??S(I.options.recordId)??S(I.options["record-id"])??S(I.options.id),J=S(I.options.recordIds)??S(I.options["record-ids"]),K=J?J.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=S(I.options.sn)??S(I.options.documentSn)??S(I.options["document-sn"]),W=S(I.options.sns)??S(I.options["document-sns"]),H=W?W.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(I.options.limit),Z=S(I.options.status),q=S(I.options.startDate)??S(I.options["start-date"]),V=S(I.options.endDate)??S(I.options["end-date"]);if(!Q&&!K&&!G&&!H&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=S(I.options.sourceCorp)??S(I.options["source-corp"])??S(I.options.prodCorp)??S(I.options["prod-corp"]),M=S(I.options.targetCorp)??S(I.options["target-corp"])??S(I.options.testCorp)??S(I.options["test-corp"]),w=V0(I.options.force)===!0,{sourceCorp:O,targetCorp:D}=uB({sourceCorpId:F,targetCorpId:M,activeCorp:U,force:w},E1),N=O.id===U.id?z:await j1(O),A=D.id===U.id?z:await j1(D),T=S(I.options.webhook)??S(I.options.selector),P=S(I.options.snSuffix)??S(I.options["sn-suffix"]),j=S(I.options.snPrefix)??S(I.options["sn-prefix"]),C=S(I.options.docIdSuffix)??S(I.options["doc-id-suffix"]),b=S(I.options.docIdPrefix)??S(I.options["doc-id-prefix"]),k=V0(I.options.dryRun)??V0(I.options["dry-run"]),i=await oJ({query:{recordId:Q,recordIds:K,sn:G,sns:H,limit:X,status:Z,startDate:q,endDate:V},sourceClient:N,targetClient:A,sourceCorp:O,targetCorp:D,webhookSelector:T,snPrefix:j,snSuffix:P,docIdPrefix:b,docIdSuffix:C Line truncated
`}function Oq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function c0($,Y={}){WS1($,Y);let z=`${JSON.stringify($,null,2)}
`;if(Y.outputFile){JS1(Y.outputFile,z),console.log(JSON.stringify({outputFile:Y.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function WS1($,Y={}){if(Y.allowFull||Y.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>HS1)throw new nP(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function V_0($,Y){if(Y)return;let z=$&&typeof $==="object"?$:{},U=typeof z.count==="number"?z.count:void 0,I=Array.isArray(z.rules)?z.rules.length:void 0,Q=Buffer.byteLength(JSON.stringify($),"utf-8"),J=U??I??0;if(J>KS1||Q>GS1)throw new nP(`Rule list is large (${J} rules, ${Q} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:V0($.full)===!0,outputFile:S($.outputFile)??S($["output-file"])}}function L_0($=[]){console.log(Z_0($))}var KS1=100,GS1=120000,q_0,HS1=200000;var Q4=o(()=>{D4();L$();Tl();q_0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var F_0={};x8(F_0,{selectCorp:()=>E1,runToolResult:()=>o2,runTool:()=>k0,globalConfigSummary:()=>l2});function E1($){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},h3());return qA0(U.id),U}function l2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:KU()}}async function k0($,Y,z,U,I={}){c0(await o2($,Y,z,U),I)}async function o2($,Y,z,U){let I=Vq.find((K)=>K.name===$);if(!I)throw Error(`Unknown Seal tool: ${$}`);let Q=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),J=I.handler;return J(Y,Q,{corp:z})}var o4=o(()=>{S3();bP();Fq();Q4()});import{existsSync as w_0}from"node:fs";async function M_0($,Y){if(!w_0($))throw Error(`File not found: ${$}`);let z=vU($);console.log(JSON.stringify(await _U(z.fileBuffer,z.fileName,Y),null,2))}async function MT($,Y,z,U,I){if($==="ready"||$==="status"){let Q=Y??S(I.options.file)??S(I.options.input),J=await UT(z,U,{filePath:Q,webhook:S(I.options.webhook)??S(I.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${J.corp.name} (${J.corp.id}) [${J.stateMode}]`),J.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${J.corp.tenant.name} (${J.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${J.authStatus==="ok"?"OK":`异常 (${J.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${J.activeWebhooks.length} 个可用`);for(let K of J.activeWebhooks){let G=K.isDefault?" [默认通道]":"";console.error(` - ${K.name} (${K.id}) mode=${K.mode}${G}`)}if(J.materialPack)console.error(`[webhook-ready] 材料包预检: ${J.materialPack.valid?`通过 (${J.materialPack.documentCount} 单)`:`失败 (${J.materialPack.errors?.join("; ")})`}`);if(J.ready)console.error(`\uD83D\uDFE2 ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);console.log(JSON.stringify(J,null,2));return}if($==="replay"){let Q=Y??S(I.options.recordId)??S(I.options["record-id"])??S(I.options.id),J=S(I.options.recordIds)??S(I.options["record-ids"]),K=J?J.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=S(I.options.sn)??S(I.options.documentSn)??S(I.options["document-sn"]),H=S(I.options.sns)??S(I.options["document-sns"]),W=H?H.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(I.options.limit),Z=S(I.options.status),q=S(I.options.startDate)??S(I.options["start-date"]),V=S(I.options.endDate)??S(I.options["end-date"]);if(!Q&&!K&&!G&&!W&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=S(I.options.sourceCorp)??S(I.options["source-corp"])??S(I.options.prodCorp)??S(I.options["prod-corp"]),M=S(I.options.targetCorp)??S(I.options["target-corp"])??S(I.options.testCorp)??S(I.options["test-corp"]),w=V0(I.options.force)===!0,{sourceCorp:O,targetCorp:D}=pP({sourceCorpId:F,targetCorpId:M,activeCorp:U,force:w},E1),N=O.id===U.id?z:await j1(O),B=D.id===U.id?z:await j1(D),T=S(I.options.webhook)??S(I.options.selector),A=S(I.options.snSuffix)??S(I.options["sn-suffix"]),j=S(I.options.snPrefix)??S(I.options["sn-prefix"]),C=S(I.options.docIdSuffix)??S(I.options["doc-id-suffix"]),b=S(I.options.docIdPrefix)??S(I.options["doc-id-prefix"]),k=V0(I.options.dryRun)??V0(I.options["dry-run"]),i=await sJ({query:{recordId:Q,recordIds:K,sn:G,sns:W,limit:X,status:Z,startDate:q,endDate:V},sourceClient:N,targetClient:B,sourceCorp:O,targetCorp:D,webhookSelector:T,snPrefix:j,snSuffix:A,docIdPrefix:b,docIdSuffix:C Line truncated
`+`\uD83D\uDC49 查看全部请添加: seal-use corps list --all
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}c0(w.map((O)=>({id:O.id,name:O.name,environment:O.environment??"production",sourceType:O.source.type,provider:O.source.provider??O.source.type,staffId:O.source.staffId,testCorpId:O.testCorpId,prodCorpId:O.prodCorpId,current:O.id===W})));return}if($==="get"||$==="show"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps get <corpId>");let I=E1(U),Q=sn(I.id),J=LS1(I);c0({id:I.id,name:I.name,environment:I.environment??"production",configFile:Q,seal:{url:J,tenantSlug:I.seal.tenantSlug??I.source.tenantSlug,customHeaderNames:I.seal.headers?Object.keys(I.seal.headers):[],customCookieNames:I.seal.cookies?Object.keys(I.seal.cookies):[],endpoints:I.seal.endpoints},source:FS1(I.source),relations:{testCorpId:I.testCorpId,prodCorpId:I.prodCorpId},auth:{refreshTtl:I.auth.refreshTtl}});return}if($==="current"){let U=E1(S(z.options.corp));c0({id:U.id,name:U.name,environment:U.environment??"production",sourceType:U.source.type,provider:U.source.provider??U.source.type,staffId:U.source.staffId,testCorpId:U.testCorpId,prodCorpId:U.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let I=E1(U),Q=$==="mark-test"?"test":$==="mark-prod"?"production":S(z.options.env)??S(z.options.environment);if(Q!=="production"&&Q!=="test")throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw D9(`Refusing to change environment tag of enterprise '${I.name}' (${I.id}) to '${Q}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${I.id} --env ${Q} --confirm`);let K=x2(I.id,{environment:Q});c0({id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId,prodCorpId:K.prodCorpId});return}if($==="bind-test"){let U,I;if(Y&&z.command[3])U=Y,I=z.command[3];else if(Y){let X=S(z.options.corp),Z=S(z.options["test-corp"])??S(z.options.testCorp);if(X)U=X,I=Y;else if(Z)U=Y,I=Z}if(!U||!I)throw d4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Q=E1(U),J=E1(I);if(Q.id===J.id)throw d4(`Cannot bind enterprise '${Q.id}' to itself.`);if(Q.prodCorpId&&Q.prodCorpId!==J.id)throw d4(`Cannot use '${Q.id}' as a production enterprise because it is already registered as a test enterprise for '${Q.prodCorpId}'. Multi-tier chaining is not permitted.`);if(J.testCorpId&&J.testCorpId!==Q.id)throw d4(`Cannot bind '${J.id}' as a test enterprise because it already has a bound test enterprise '${J.testCorpId}'. Multi-tier chaining is not permitted.`);let K=V0(z.options.force)===!0;if(Q.testCorpId&&Q.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Q.id){if(!K)throw D9(`Enterprise binding conflict: production enterprise '${Q.id}' is bound to '${Q.testCorpId??"none"}', and test enterprise '${J.id}' is bound to '${J.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${Q.id} ${J.id} --confirm --force`)}if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0)){let X=K?" --force":"";throw D9(`Refusing to bind test enterprise '${J.name}' (${J.id}) to production enterprise '${Q.name}' (${Q.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${J.id}' as a test environment.`,`seal-use corps bind-test ${Q.id} ${J.id} --confirm${X}`)}if(Q.testCorpId&&Q.testCorpId!==J.id)try{x2(Q.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Q.id)try{x2(J.prodCorpId,{testCorpId:void 0})}catch{}let W=x2(Q.id,{environment:"production",testCorpId:J.id}),H=x2(J.id,{environment:"test",prodCorpId:Q.id});c0({success:!0,productionEnterprise:{id:W.id,name:W.name,environment:W.environment,testCorpId:W.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let U=Y??S(z.options.corp),I=E1(U);if(!I.testCorpId&&!I.prodCorpId){c0({unbound:!1,message:`Enterprise '${I.name}' (${I.id}) does not have an active test enterprise binding.`});return}let Q=I.testCorpId?I.id:I.prodCorpId,J=I.testCorpId?I.testCorpId:I.id;if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw D9(`Refusing to unbind production enterprise '${Q}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${I.id} --confirm`);x2(Q,{testCorpId:void 0});try{x2(J,{prodCorpId:void 0})}catch{}c0({success:!0,unboundProduction:Q,unboundTest:J});return}if($==="sync-test"){let U=Y??S(z.options.corp),I=E1(U);if(!I.testCorpId)throw d4(`Production enterprise '${I.name}' (${I.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${I.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Q=E1(I.testCorpId);if(Q.environment!=="test")throw Error(`Target enterprise '${Q.name}' (${Q.id}) is marked as '${Q.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let J=await j1(I),K=await j1(Q),[G,W,H,X,Z,q,V,F]=await Promise.all([o1(J,I.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(K,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),p6(J),p6(K),A$(J).catch(()=>[]),A$(K).catch(()=>[]),_7(J,{limit:100}).catch(()=>({articles:[]})),_7(K,{limit:100}).catch(()=>({articles:[]}))]),M=(V.articles||[]).filter((G0)=>!G0.isDeleted),w=(F.articles||[]).filter((G0)=>!G0.isDeleted),O=new Map(w.map((G0)=>[G0.title.trim(),G0])),D=[],N=[],A=new Set(M.map((G0)=>G0.title.trim()));for(let G0 of M){let T0=G0.title.trim(),b0=O.get(T0);if(!b0)D.push(G0);else{let Y1=b0.content!==G0.content,a=(b0.purpose??"")!==(G0.purpose??""),H0=b0.enabled!==G0.enabled,F0=b0.contentType!==G0.contentType,f0=(b0.status??"")!==(G0.status??""),u0=JSON.stringify([...b0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),i0=JSON.stringify([...b0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(Y1||a||H0||F0||f0||u0||i0)N.push({testId:b0.id,prodDoc:G0,reasons:[...Y1?["content"]:[],...a?["purpose"]:[],...H0?["enabled"]:[],...F0?["contentType"]:[],...f0?["status"]:[],...u0?["scenarios"]:[],...i0?["tags"]:[]]})}}let T=w.filter((G0)=>!A.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,k=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,h=_v0(I.name,C,q),c=S(z.options["version-name"])??S(z.options.versionName)??vv0(I.name,C,h,k),U0={...W,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(V0(z.options["dry-run"])===!0||V0(z.options.dryRun)===!0){c0({dryRun:!0,source:{id:I.id,name:I.name,environment:I.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:M.length},target:{id:Q.id,name:Q.name,environment:Q.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:k,targetTestPublishVersionName:c,iteration:h},preferencesDiff:{decisionPreferences:{before:W.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:W.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:M.length,targetExistingDocumentCount:w.length,toCreateCount:D.length,toCreate:D.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:N.length,toUpdate:N.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:Q.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(I.source.type!=="hose")return{sourceType:I.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((Y1)=>Y1.type==="hosecloud"),T0=new Set,b0=G0.filter((Y1)=>{let a=Y1.corporationId??I.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:xv0(I.name),targetMode:"assisted",integrationsCount:b0.length,integrations:b0.map((Y1)=>({corporationId:Y1.corporationId,apiOrigin:Y1.apiOrigin,customApiUrl:Y1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(V0(z.options.yes)===!0||V0(z.options.confirm)===!0))throw D9(`Refusing to overwrite test enterprise '${Q.name}' (${Q.id}) with preferences, ${H.rules.length} draft rules, and ${M.length} knowledge documents from production enterprise '${I.name}' (${I.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${I.id} --yes`);await m5(K,U0,Q.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await WM(K,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of N)await GM(K,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled, Line truncated
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}c0(w.map((O)=>({id:O.id,name:O.name,environment:O.environment??"production",sourceType:O.source.type,provider:O.source.provider??O.source.type,staffId:O.source.staffId,testCorpId:O.testCorpId,prodCorpId:O.prodCorpId,current:O.id===H})));return}if($==="get"||$==="show"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps get <corpId>");let I=E1(U),Q=Yp(I.id),J=fS1(I);c0({id:I.id,name:I.name,environment:I.environment??"production",configFile:Q,seal:{url:J,tenantSlug:I.seal.tenantSlug??I.source.tenantSlug,customHeaderNames:I.seal.headers?Object.keys(I.seal.headers):[],customCookieNames:I.seal.cookies?Object.keys(I.seal.cookies):[],endpoints:I.seal.endpoints},source:uS1(I.source),relations:{testCorpId:I.testCorpId,prodCorpId:I.prodCorpId},auth:{refreshTtl:I.auth.refreshTtl}});return}if($==="current"){let U=E1(S(z.options.corp));c0({id:U.id,name:U.name,environment:U.environment??"production",sourceType:U.source.type,provider:U.source.provider??U.source.type,staffId:U.source.staffId,testCorpId:U.testCorpId,prodCorpId:U.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let I=E1(U),Q=$==="mark-test"?"test":$==="mark-prod"?"production":S(z.options.env)??S(z.options.environment);if(Q!=="production"&&Q!=="test")throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw D9(`Refusing to change environment tag of enterprise '${I.name}' (${I.id}) to '${Q}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${I.id} --env ${Q} --confirm`);let K=x2(I.id,{environment:Q});c0({id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId,prodCorpId:K.prodCorpId});return}if($==="bind-test"){let U,I;if(Y&&z.command[3])U=Y,I=z.command[3];else if(Y){let X=S(z.options.corp),Z=S(z.options["test-corp"])??S(z.options.testCorp);if(X)U=X,I=Y;else if(Z)U=Y,I=Z}if(!U||!I)throw d4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Q=E1(U),J=E1(I);if(Q.id===J.id)throw d4(`Cannot bind enterprise '${Q.id}' to itself.`);if(Q.prodCorpId&&Q.prodCorpId!==J.id)throw d4(`Cannot use '${Q.id}' as a production enterprise because it is already registered as a test enterprise for '${Q.prodCorpId}'. Multi-tier chaining is not permitted.`);if(J.testCorpId&&J.testCorpId!==Q.id)throw d4(`Cannot bind '${J.id}' as a test enterprise because it already has a bound test enterprise '${J.testCorpId}'. Multi-tier chaining is not permitted.`);let K=V0(z.options.force)===!0;if(Q.testCorpId&&Q.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Q.id){if(!K)throw D9(`Enterprise binding conflict: production enterprise '${Q.id}' is bound to '${Q.testCorpId??"none"}', and test enterprise '${J.id}' is bound to '${J.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${Q.id} ${J.id} --confirm --force`)}if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0)){let X=K?" --force":"";throw D9(`Refusing to bind test enterprise '${J.name}' (${J.id}) to production enterprise '${Q.name}' (${Q.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${J.id}' as a test environment.`,`seal-use corps bind-test ${Q.id} ${J.id} --confirm${X}`)}if(Q.testCorpId&&Q.testCorpId!==J.id)try{x2(Q.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Q.id)try{x2(J.prodCorpId,{testCorpId:void 0})}catch{}let H=x2(Q.id,{environment:"production",testCorpId:J.id}),W=x2(J.id,{environment:"test",prodCorpId:Q.id});c0({success:!0,productionEnterprise:{id:H.id,name:H.name,environment:H.environment,testCorpId:H.testCorpId},testEnterprise:{id:W.id,name:W.name,environment:W.environment,prodCorpId:W.prodCorpId}});return}if($==="unbind-test"){let U=Y??S(z.options.corp),I=E1(U);if(!I.testCorpId&&!I.prodCorpId){c0({unbound:!1,message:`Enterprise '${I.name}' (${I.id}) does not have an active test enterprise binding.`});return}let Q=I.testCorpId?I.id:I.prodCorpId,J=I.testCorpId?I.testCorpId:I.id;if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw D9(`Refusing to unbind production enterprise '${Q}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${I.id} --confirm`);x2(Q,{testCorpId:void 0});try{x2(J,{prodCorpId:void 0})}catch{}c0({success:!0,unboundProduction:Q,unboundTest:J});return}if($==="sync-test"){let U=Y??S(z.options.corp),I=E1(U);if(!I.testCorpId)throw d4(`Production enterprise '${I.name}' (${I.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${I.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Q=E1(I.testCorpId);if(Q.environment!=="test")throw Error(`Target enterprise '${Q.name}' (${Q.id}) is marked as '${Q.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let J=await j1(I),K=await j1(Q),[G,H,W,X,Z,q,V,F]=await Promise.all([o1(J,I.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(K,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),p6(J),p6(K),B$(J).catch(()=>[]),B$(K).catch(()=>[]),_7(J,{limit:100}).catch(()=>({articles:[]})),_7(K,{limit:100}).catch(()=>({articles:[]}))]),M=(V.articles||[]).filter((G0)=>!G0.isDeleted),w=(F.articles||[]).filter((G0)=>!G0.isDeleted),O=new Map(w.map((G0)=>[G0.title.trim(),G0])),D=[],N=[],B=new Set(M.map((G0)=>G0.title.trim()));for(let G0 of M){let T0=G0.title.trim(),b0=O.get(T0);if(!b0)D.push(G0);else{let Y1=b0.content!==G0.content,a=(b0.purpose??"")!==(G0.purpose??""),W0=b0.enabled!==G0.enabled,F0=b0.contentType!==G0.contentType,f0=(b0.status??"")!==(G0.status??""),u0=JSON.stringify([...b0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),i0=JSON.stringify([...b0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(Y1||a||W0||F0||f0||u0||i0)N.push({testId:b0.id,prodDoc:G0,reasons:[...Y1?["content"]:[],...a?["purpose"]:[],...W0?["enabled"]:[],...F0?["contentType"]:[],...f0?["status"]:[],...u0?["scenarios"]:[],...i0?["tags"]:[]]})}}let T=w.filter((G0)=>!B.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,k=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,h=pv0(I.name,C,q),c=S(z.options["version-name"])??S(z.options.versionName)??dv0(I.name,C,h,k),U0={...H,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(V0(z.options["dry-run"])===!0||V0(z.options.dryRun)===!0){c0({dryRun:!0,source:{id:I.id,name:I.name,environment:I.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:M.length},target:{id:Q.id,name:Q.name,environment:Q.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:k,targetTestPublishVersionName:c,iteration:h},preferencesDiff:{decisionPreferences:{before:H.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:H.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:W.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:W.rules.length,rulesToSync:W.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:M.length,targetExistingDocumentCount:w.length,toCreateCount:D.length,toCreate:D.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:N.length,toUpdate:N.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:Q.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(I.source.type!=="hose")return{sourceType:I.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((Y1)=>Y1.type==="hosecloud"),T0=new Set,b0=G0.filter((Y1)=>{let a=Y1.corporationId??I.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:av0(I.name),targetMode:"assisted",integrationsCount:b0.length,integrations:b0.map((Y1)=>({corporationId:Y1.corporationId,apiOrigin:Y1.apiOrigin,customApiUrl:Y1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(V0(z.options.yes)===!0||V0(z.options.confirm)===!0))throw D9(`Refusing to overwrite test enterprise '${Q.name}' (${Q.id}) with preferences, ${W.rules.length} draft rules, and ${M.length} knowledge documents from production enterprise '${I.name}' (${I.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${I.id} --yes`);await m5(K,U0,Q.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await VM(K,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of N)await qM(K,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled, Line truncated
Run 'seal-use corps bind-test ${I.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association,
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);J=I}else if(J=E1(I.testCorpId),J.environment!=="test"&&!Q)throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let K=S(z.options.recordId)??S(z.options["record-id"])??S(z.options.id),G=S(z.options.recordIds)??S(z.options["record-ids"]),W=G?G.split(",").map((k)=>k.trim()).filter(Boolean):void 0,H=S(z.options.sn)??S(z.options.documentSn)??S(z.options["document-sn"]),X=S(z.options.sns)??S(z.options["document-sns"]),Z=X?X.split(",").map((k)=>k.trim()).filter(Boolean):void 0,q=s0(z.options.limit)??(!K&&!W&&!H&&!Z?1:void 0),V=S(z.options.status),F=S(z.options.startDate)??S(z.options["start-date"]),M=S(z.options.endDate)??S(z.options["end-date"]),w=await j1(I),O=I.id===J.id?w:await j1(J),D=S(z.options.webhook)??S(z.options.selector),N=S(z.options.snSuffix)??S(z.options["sn-suffix"]),A=S(z.options.snPrefix)??S(z.options["sn-prefix"]),T=S(z.options.docIdSuffix)??S(z.options["doc-id-suffix"]),P=S(z.options.docIdPrefix)??S(z.options["doc-id-prefix"]),j=V0(z.options.dryRun)??V0(z.options["dry-run"]),C={recordId:K,recordIds:W,sn:H,sns:Z,limit:q,status:V,startDate:F,endDate:M};console.error(`[corps-replay-test] 正式企业「${I.name}」(${I.id}) -> 测试企业「${J.name}」(${J.id})`);let b=await oJ({query:C,sourceClient:w,targetClient:O,sourceCorp:I,targetCorp:J,webhookSelector:D,snPrefix:A,snSuffix:N,docIdPrefix:P,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${I.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${J.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${I.name}」)至「${J.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let U=Y;if(!U)throw Error("Usage: seal-use corps switch <corpId>");let I=_4();if(!I.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let Q=E1(U);JU({...I,stateful:!0,defaultCorpId:Q.id}),c0({current:!0,id:Q.id,name:Q.name});return}if($==="probe-hose"){await MS1(y8(z.json));return}if($==="hose-staffs"){await OS1(y8(z.json));return}if($==="add-hose"){await kl(y8(z.json));return}if($==="add-seal"){await NS1(y8(z.json));return}if($==="add-link"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(V0(z.options["as-hose"])===!0||V0(z.options.hose)===!0){await PS1(U,S(z.options.name),V0(z.options.overwrite)===!0,V0(z.options.force)===!0,{appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await DS1(U,S(z.options.name),V0(z.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]");let I=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0,Q=V0(z.options.save)===!0||V0(z.options.add)===!0;await BT(U,{reveal:I,save:Q,name:S(z.options.name),overwrite:V0(z.options.overwrite)===!0,force:V0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}if($==="keys"){let U=Y??S(z.options.link)??S(z.options.url)??S(z.options.corp),I=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0;if(U&&(U.startsWith("http://")||U.startsWith("https://"))){let Q=V0(z.options.save)===!0||V0(z.options.add)===!0;await BT(U,{reveal:I,save:Q,name:S(z.options.name),overwrite:V0(z.options.overwrite)===!0,force:V0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await xl(U,{reveal:I});return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function xv0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function wS1($,Y,z,U){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud creden Line truncated
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);J=I}else if(J=E1(I.testCorpId),J.environment!=="test"&&!Q)throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let K=S(z.options.recordId)??S(z.options["record-id"])??S(z.options.id),G=S(z.options.recordIds)??S(z.options["record-ids"]),H=G?G.split(",").map((k)=>k.trim()).filter(Boolean):void 0,W=S(z.options.sn)??S(z.options.documentSn)??S(z.options["document-sn"]),X=S(z.options.sns)??S(z.options["document-sns"]),Z=X?X.split(",").map((k)=>k.trim()).filter(Boolean):void 0,q=s0(z.options.limit)??(!K&&!H&&!W&&!Z?1:void 0),V=S(z.options.status),F=S(z.options.startDate)??S(z.options["start-date"]),M=S(z.options.endDate)??S(z.options["end-date"]),w=await j1(I),O=I.id===J.id?w:await j1(J),D=S(z.options.webhook)??S(z.options.selector),N=S(z.options.snSuffix)??S(z.options["sn-suffix"]),B=S(z.options.snPrefix)??S(z.options["sn-prefix"]),T=S(z.options.docIdSuffix)??S(z.options["doc-id-suffix"]),A=S(z.options.docIdPrefix)??S(z.options["doc-id-prefix"]),j=V0(z.options.dryRun)??V0(z.options["dry-run"]),C={recordId:K,recordIds:H,sn:W,sns:Z,limit:q,status:V,startDate:F,endDate:M};console.error(`[corps-replay-test] 正式企业「${I.name}」(${I.id}) -> 测试企业「${J.name}」(${J.id})`);let b=await sJ({query:C,sourceClient:w,targetClient:O,sourceCorp:I,targetCorp:J,webhookSelector:D,snPrefix:B,snSuffix:N,docIdPrefix:A,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${I.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${J.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${I.name}」)至「${J.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let U=Y;if(!U)throw Error("Usage: seal-use corps switch <corpId>");let I=_4();if(!I.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let Q=E1(U);GU({...I,stateful:!0,defaultCorpId:Q.id}),c0({current:!0,id:Q.id,name:Q.name});return}if($==="probe-hose"){await iS1(y8(z.json));return}if($==="hose-staffs"){await cS1(y8(z.json));return}if($==="add-hose"){await il(y8(z.json));return}if($==="add-seal"){await nS1(y8(z.json));return}if($==="add-link"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(V0(z.options["as-hose"])===!0||V0(z.options.hose)===!0){await dS1(U,S(z.options.name),V0(z.options.overwrite)===!0,V0(z.options.force)===!0,{appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await pS1(U,S(z.options.name),V0(z.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]");let I=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0,Q=V0(z.options.save)===!0||V0(z.options.add)===!0;await CT(U,{reveal:I,save:Q,name:S(z.options.name),overwrite:V0(z.options.overwrite)===!0,force:V0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}if($==="keys"){let U=Y??S(z.options.link)??S(z.options.url)??S(z.options.corp),I=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0;if(U&&(U.startsWith("http://")||U.startsWith("https://"))){let Q=V0(z.options.save)===!0||V0(z.options.add)===!0;await CT(U,{reveal:I,save:Q,name:S(z.options.name),overwrite:V0(z.options.overwrite)===!0,force:V0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await cl(U,{reveal:I});return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function av0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function bS1($,Y,z,U){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud creden Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${C.length} candidate administrators:
- ${b}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!F)if(!H&&Q)F=Q;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let M=H4($,"id")??Z,w=q??Z,O=H4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,D={id:M,name:w,environment:"production",seal:{url:O,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:z,appSecurity:U,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(H)mw(M),await SK(D);let N=rn();Sv0(N,{recursive:!0,mode:448});let A=yv0(N,`${WT(M)}.json`);if(hv0(A)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${A}. Pass "overwrite": true to replace it.`);gv0(A,`${JSON.stringify(D,null,2)}
`,{mode:384}),c0({id:M,name:w,corpId:Z,domain:X,staffId:F,verified:H,path:A})}async function NS1($){let Y=p3($,"token"),z=(H4($,"sealUrl")??H4($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let U=Ll($,"expiresIn")??2592000,I=$.force===!0||$.verify===!1?!1:!0,Q=fv0($),J=I?await BS1(z,Y,P6(Q)):void 0;bv0($,{token:Y,sealUrl:z,expiresIn:U,verify:I,remote:J,custom:Q})}function fv0($){return{headers:pn.parse($.headers),cookies:dn.parse($.cookies)}}async function DS1($,Y,z){let U=await lw($),I=T8(U.sealUrl,U.token),Q=await H8(I),J={user:Q.user,tenant:Q.tenant};ow(U.corpId,J.tenant),bv0({id:U.corpId,corpId:U.corpId,name:Y,provider:"hosecloud",overwrite:z},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:J})}function uv0($,Y,z,U){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${Y}] 的 OpenAPI 密钥凭据。
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!F)if(!W&&Q)F=Q;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let M=X4($,"id")??Z,w=q??Z,O=X4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,D={id:M,name:w,environment:"production",seal:{url:O,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:z,appSecurity:U,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(W)aw(M),await yK(D);let N=$p();lv0(N,{recursive:!0,mode:448});let B=rv0(N,`${VT(M)}.json`);if(mv0(B)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${B}. Pass "overwrite": true to replace it.`);ov0(B,`${JSON.stringify(D,null,2)}
`,{mode:384}),c0({id:M,name:w,corpId:Z,domain:X,staffId:F,verified:W,path:B})}async function nS1($){let Y=p3($,"token"),z=(X4($,"sealUrl")??X4($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let U=Nl($,"expiresIn")??2592000,I=$.force===!0||$.verify===!1?!1:!0,Q=tv0($),J=I?await mS1(z,Y,A6(Q)):void 0;$h0($,{token:Y,sealUrl:z,expiresIn:U,verify:I,remote:J,custom:Q})}function tv0($){return{headers:rn.parse($.headers),cookies:sn.parse($.cookies)}}async function pS1($,Y,z){let U=await tw($),I=T8(U.sealUrl,U.token),Q=await W8(I),J={user:Q.user,tenant:Q.tenant};ew(U.corpId,J.tenant),$h0({id:U.corpId,corpId:U.corpId,name:Y,provider:"hosecloud",overwrite:z},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:J})}function ev0($,Y,z,U){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${Y}] 的 OpenAPI 密钥凭据。
`+"\uD83D\uDCA1 说明:此能力专属于合思 (Hose) 子域,用于将临时会话提权为标准 OpenAPI 开发者接入。需要企业管理员已在合思开放平台创建应用并生成 appKey/appSecurity。");if(z.keyId||z.appKey){let I=$.find((Q)=>z.keyId&&Q.id===z.keyId||z.appKey&&Q.appKey===z.appKey);if(!I){console.error(`
❌ 未找到指定的合思 OpenAPI 密钥 (${z.appKey??z.keyId})。`),console.error(`ℹ️ 该合思企业当前存在以下 ${$.length} 套候选密钥:`);for(let Q of $){let J=Q.active?"\uD83D\uDFE2 启用":"⚪ 停用";console.error(` • "${Q.name||"未命名应用"}" (appKey: ${Q.appKey}, keyId: ${Q.id}, 状态: ${J})`)}throw new w4("指定的合思密钥不存在,请从上述候选列表中选择正确的 appKey 或 keyId。",2,`${U} --app-key ${$[0].appKey}`)}return I}if($.length===1)return $[0];console.error(`
ℹ️ [合思子域提权] 合思企业 [${Y}] 存在多套 (${$.length} 套) OpenAPI 应用密钥凭据:`);for(let I=0;I<$.length;I++){let Q=$[I],J=Q.active?"\uD83D\uDFE2 启用":"⚪ 停用",K=Q.name||"未命名应用";console.error(` [${I+1}] "${K}" (appKey: ${Q.appKey}, keyId: ${Q.id}, 状态: ${J})`)}throw console.error(`
\uD83D\uDC49 为确保权限提权绑定正确的业务应用,请显式指定要使用的密钥套件:`),console.error(` 在命令后追加 --app-key <key> 或 --key-id <id> 参数。
`),new w4(`合思企业 [${Y}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${U} --app-key ${$[0].appKey}`)}async function PS1($,Y,z,U=!1,I){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let Q=await RS($),J=uv0(Q.keys,Q.corpId,I??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${J.appKey}, 应用: "${J.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await kl({domain:Q.baseUrl,appKey:J.appKey,appSecurity:J.appSecurity,corpId:Q.corpId,name:Y??Q.corpName??Q.corpId,staffId:Q.staffId,overwrite:z,force:U})}async function BT($,Y){let z=await RS($),U=Y.reveal===!0;if(Y.save){let I=uv0(z.keys,z.corpId,{appKey:Y.appKey,keyId:Y.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${I.appKey}, 应用: "${I.name||"未命名应用"}") 保存为标准合思企业配置...`),await kl({domain:z.baseUrl,appKey:I.appKey,appSecurity:I.appSecurity,corpId:z.corpId,name:Y.name??z.corpName??z.corpId,staffId:z.staffId,overwrite:Y.overwrite,force:Y.force});return}if(!U)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
`),new w4(`合思企业 [${Y}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${U} --app-key ${$[0].appKey}`)}async function dS1($,Y,z,U=!1,I){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let Q=await gS($),J=ev0(Q.keys,Q.corpId,I??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${J.appKey}, 应用: "${J.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await il({domain:Q.baseUrl,appKey:J.appKey,appSecurity:J.appSecurity,corpId:Q.corpId,name:Y??Q.corpName??Q.corpId,staffId:Q.staffId,overwrite:z,force:U})}async function CT($,Y){let z=await gS($),U=Y.reveal===!0;if(Y.save){let I=ev0(z.keys,z.corpId,{appKey:Y.appKey,keyId:Y.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${I.appKey}, 应用: "${I.name||"未命名应用"}") 保存为标准合思企业配置...`),await il({domain:z.baseUrl,appKey:I.appKey,appSecurity:I.appSecurity,corpId:z.corpId,name:Y.name??z.corpName??z.corpId,staffId:z.staffId,overwrite:Y.overwrite,force:Y.force});return}if(!U)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
`);else console.error(`⚠️ [合思子域提权] 正在以明文展示合思 (Hose) appSecurity 接入密码,请妥善保管敏感凭据。
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.corpId,corpName:z.corpName??z.corpId,baseUrl:z.baseUrl,staffId:z.staffId,keyCount:z.keys.length,keys:z.keys.map((I)=>({id:I.id,name:I.name||"-",appKey:I.appKey,appSecurity:U?I.appSecurity:CS(I.appSecurity),active:I.active,createTime:I.createTime,updateTime:I.updateTime}))})}async function xl($,Y){let z=E1($),U=Y.reveal===!0;if(z.source.type!=="hose")throw new w4(`【合思子域专享能力】当前企业「${z.name}」(id: ${z.id}) 为原生 Seal (${z.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.corpId,corpName:z.corpName??z.corpId,baseUrl:z.baseUrl,staffId:z.staffId,keyCount:z.keys.length,keys:z.keys.map((I)=>({id:I.id,name:I.name||"-",appKey:I.appKey,appSecurity:U?I.appSecurity:SS(I.appSecurity),active:I.active,createTime:I.createTime,updateTime:I.updateTime}))})}async function cl($,Y){let z=E1($),U=Y.reveal===!0;if(z.source.type!=="hose")throw new w4(`【合思子域专享能力】当前企业「${z.name}」(id: ${z.id}) 为原生 Seal (${z.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。
`+"OpenAPI 密钥查询与提权能力专属于合思生态租户(用于从合思协助链接或合思凭据中提取开发者密钥提升权限等级),非合思渠道企业不支持此能力。",2);let I=z.source.appKey??z.source.key,Q=z.source.appSecurity??z.source.password;if(!U)console.error(`\uD83D\uDCA1 [合思子域] 接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文。
`);else console.error(`⚠️ [合思子域] 正在以明文展示合思 appSecurity 接入密码,请妥善保管敏感凭据。
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.id,corpName:z.name,domain:z.source.domain,staffId:z.source.staffId,appKey:I??"-",appSecurity:Q?U?Q:CS(Q):"-",active:!0})}function bv0($,Y){let{token:z,sealUrl:U,expiresIn:I,verify:Q,remote:J}=Y,K=Y.custom??fv0($),G=J?.user,W=J?.tenant,H=H4($,"tenantSlug")??s2(W?.tenantSlug),X=H4($,"tenantId")??s2(W?.id),Z=H4($,"tenantName")??s2(W?.name),q=H4($,"id")??H??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=H4($,"staffId")??s2(G?.providerUserId)??s2(G?.id)??"seal",F=H4($,"provider")??s2(G?.provider)??s2(W?.providerConfig?.provider),M=H4($,"corpId")??H??X??q,w={id:q,name:H4($,"name")??Z??q,environment:"production",seal:{url:U,tenantSlug:H,headers:K.headers,cookies:K.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:U,expiresIn:I,staffId:V,corpId:M,tenantId:X,tenantSlug:H,tenantName:Z,providerUserId:s2(G?.providerUserId),provider:F},auth:{refreshTtl:300}},O=rn();Sv0(O,{recursive:!0,mode:448});let D=yv0(O,`${WT(q)}.json`);if(hv0(D)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${D}. Pass "overwrite": true to replace it.`);gv0(D,`${JSON.stringify(w,null,2)}
`,{mode:384}),c0({id:q,name:w.name,tenantId:X,tenantSlug:H,verified:Q,path:D})}async function BS1($,Y,z={}){let U=T8($,Y,z),I=await H8(U);return{user:I.user??{},tenant:I.tenant??{}}}function s2($){return typeof $==="string"&&$?$:void 0}var fl=o(()=>{a9();DW();i8();S3();Av0();yB();ln();X6();X6();gl();_Z();PT();o4();L$();D4();Q4()});async function cv0($,Y){let z=$??S(Y.options.link)??S(Y.options.url);if(!z)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let U=V0(Y.options.reveal)===!0||V0(Y.options.r)===!0||V0(Y.options.plain)===!0,I=V0(Y.options.save)===!0||V0(Y.options.add)===!0;await BT(z,{reveal:U,save:I,name:S(Y.options.name),overwrite:V0(Y.options.overwrite)===!0,force:V0(Y.options.force)===!0,appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)})}async function nv0($,Y,z){if($==="diagnose"){c0(await AS1(Y));return}if($==="hose-link"){let U=z.options.expire,I=U!==void 0?s0(U):7200;if(I===void 0||I<=0)throw Error(`Invalid --expire: ${String(U)}. Must be a positive number of seconds (e.g. --expire 7200 or --expire 86400).`);let Q=V0(z.options.force)===!0||V0(z.options.refresh)===!0||V0(z.options.f)===!0;c0(await W00(Y,I,{force:Q}));return}if($==="keys"){let U=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0;await xl(Y.id,{reveal:U});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function AS1($){if($.source.type!=="hose"){let F=await j1($),M=await H8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:M.user,tenant:M.tenant}]}}mw($.id);let Y=$.source,z=Y.appKey??Y.key,U=Y.appSecurity??Y.password,I=($.seal.url??Y.sealUrl??`https://${Y.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),Q=Y.staffId.includes(":")?Y.staffId:`${Y.corpId}:${Y.staffId}`,J=[];if(!z||!U)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let K=await AT("hose.openapi",async()=>{let F=await iv0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:z,appSecurity:U}),M=d3(F.value),w=b6(M.accessToken)??b6(F.accessToken)??b6(F.token);if(!w)throw Error("Hose login did not return an access token");return{token:w,public:{corporationId:b6(M.corporationId)??b6(d3(M.corporation).id),expireTime:Dq(M.expireTime)}}});J.push(K.public);let G=K.private?.token,W=G?await AT("hose.provisional",async()=>{let F=await iv0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:Q,pageType:"home",expireDate:7200}),M=b6(d3(F.value).message);if(!M)throw Error("Hose CloseAPI did not return a provisional auth URL");let w=new URL(M).searchParams.get("accessToken");if(!w)throw Error("Hose provisional auth URL did not include accessToken");return{token:w,public:{uid:Q,enterpriseUrl:Fq(M)}}}):ul("hose.provisional");J.push(W.public);let H=P6($.seal),X=W.private?.token,Z=X?await AT("seal.sso",async()=>{let M=await T8(I,void 0,H).get(`api/auth/oauth2/session/oem-hosecloud?token=${encodeURIComponent(X)}&returnToken=1`).json(),w=d3(M.data),O=b6(M.token)??b6(M.accessToken)??b6(w.token)??b6(w.accessToken);if(!O)throw Error("Seal SSO did not return a bearer token");return{token:O,public:{sealUrl:I,expiresIn:Dq(M.expiresIn)??Dq(M.expires_in)??Dq(w.expiresIn)??Dq(w.expires_in)}}}):ul("seal.sso");J.push(Z.public);let q=Z.private?.token,V=q?await AT("seal.whoami",async()=>{let M=await T8(I,q,H).get("api/v1/auth/me").json(),w=d3(M.data),O=d3(w.user??M.user),D=d3(w.tenant??M.tenant);return{public:{user:{id:b6(O.id),name:b6(O.name),isAdmin:jS1(O.isAdmin),providerUserId:b6(O.providerUserId)},tenant:{id:b6(D.id),name:b6(D.name),tenantSlug:b6(D.tenantSlug),hoseCorpConfig:ES1(D.hoseCorpConfig)}}}}):ul("seal.whoami");return J.push(V.public),{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:J.every((F)=>F.ok===!0),stages:J}}async function AT($,Y){try{let z=await Y();return{public:{name:$,ok:!0,...pv0(z.public)},private:z.token?{token:z.token}:void 0}}catch(z){return{public:{name:$,ok:!1,error:Fq(z instanceof Error?z.message:String(z))}}}}function ul($){return{public:{name:$,ok:!1,skipped:!0}}}async function iv0($,Y){let z=await fetch($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Y)});return TS1(z)}async function TS1($){let Y=await $.text();if(!$.ok)throw Error(`${$.status} ${Y}`);let z=JSON.parse(Y);return d3(z)}function d3($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function b6($){return typeof $==="string"&&$?$:void 0}function Dq($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function jS1($){return typeof $==="boolean"?$:void 0}function ES1($){let Y=d3($);return pv0({corporationId:b6(Y.corporationId),corporationName:b6(Y.corporationName)})}f Line truncated
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.id,corpName:z.name,domain:z.source.domain,staffId:z.source.staffId,appKey:I??"-",appSecurity:Q?U?Q:SS(Q):"-",active:!0})}function $h0($,Y){let{token:z,sealUrl:U,expiresIn:I,verify:Q,remote:J}=Y,K=Y.custom??tv0($),G=J?.user,H=J?.tenant,W=X4($,"tenantSlug")??s2(H?.tenantSlug),X=X4($,"tenantId")??s2(H?.id),Z=X4($,"tenantName")??s2(H?.name),q=X4($,"id")??W??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=X4($,"staffId")??s2(G?.providerUserId)??s2(G?.id)??"seal",F=X4($,"provider")??s2(G?.provider)??s2(H?.providerConfig?.provider),M=X4($,"corpId")??W??X??q,w={id:q,name:X4($,"name")??Z??q,environment:"production",seal:{url:U,tenantSlug:W,headers:K.headers,cookies:K.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:U,expiresIn:I,staffId:V,corpId:M,tenantId:X,tenantSlug:W,tenantName:Z,providerUserId:s2(G?.providerUserId),provider:F},auth:{refreshTtl:300}},O=$p();lv0(O,{recursive:!0,mode:448});let D=rv0(O,`${VT(q)}.json`);if(mv0(D)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${D}. Pass "overwrite": true to replace it.`);ov0(D,`${JSON.stringify(w,null,2)}
`,{mode:384}),c0({id:q,name:w.name,tenantId:X,tenantSlug:W,verified:Q,path:D})}async function mS1($,Y,z={}){let U=T8($,Y,z),I=await W8(U);return{user:I.user??{},tenant:I.tenant??{}}}function s2($){return typeof $==="string"&&$?$:void 0}var nl=o(()=>{a9();BH();i8();S3();fv0();bP();tn();X6();X6();ul();SZ();ET();o4();L$();D4();Q4()});async function zh0($,Y){let z=$??S(Y.options.link)??S(Y.options.url);if(!z)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let U=V0(Y.options.reveal)===!0||V0(Y.options.r)===!0||V0(Y.options.plain)===!0,I=V0(Y.options.save)===!0||V0(Y.options.add)===!0;await CT(z,{reveal:U,save:I,name:S(Y.options.name),overwrite:V0(Y.options.overwrite)===!0,force:V0(Y.options.force)===!0,appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)})}async function Uh0($,Y,z){if($==="diagnose"){c0(await lS1(Y));return}if($==="hose-link"){let U=z.options.expire,I=U!==void 0?s0(U):7200;if(I===void 0||I<=0)throw Error(`Invalid --expire: ${String(U)}. Must be a positive number of seconds (e.g. --expire 7200 or --expire 86400).`);let Q=V0(z.options.force)===!0||V0(z.options.refresh)===!0||V0(z.options.f)===!0;c0(await P00(Y,I,{force:Q}));return}if($==="keys"){let U=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0;await cl(Y.id,{reveal:U});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function lS1($){if($.source.type!=="hose"){let F=await j1($),M=await W8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:M.user,tenant:M.tenant}]}}aw($.id);let Y=$.source,z=Y.appKey??Y.key,U=Y.appSecurity??Y.password,I=($.seal.url??Y.sealUrl??`https://${Y.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),Q=Y.staffId.includes(":")?Y.staffId:`${Y.corpId}:${Y.staffId}`,J=[];if(!z||!U)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let K=await RT("hose.openapi",async()=>{let F=await Yh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:z,appSecurity:U}),M=d3(F.value),w=b6(M.accessToken)??b6(F.accessToken)??b6(F.token);if(!w)throw Error("Hose login did not return an access token");return{token:w,public:{corporationId:b6(M.corporationId)??b6(d3(M.corporation).id),expireTime:Bq(M.expireTime)}}});J.push(K.public);let G=K.private?.token,H=G?await RT("hose.provisional",async()=>{let F=await Yh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:Q,pageType:"home",expireDate:7200}),M=b6(d3(F.value).message);if(!M)throw Error("Hose CloseAPI did not return a provisional auth URL");let w=new URL(M).searchParams.get("accessToken");if(!w)throw Error("Hose provisional auth URL did not include accessToken");return{token:w,public:{uid:Q,enterpriseUrl:Oq(M)}}}):pl("hose.provisional");J.push(H.public);let W=A6($.seal),X=H.private?.token,Z=X?await RT("seal.sso",async()=>{let M=await T8(I,void 0,W).get(`api/auth/oauth2/session/oem-hosecloud?token=${encodeURIComponent(X)}&returnToken=1`).json(),w=d3(M.data),O=b6(M.token)??b6(M.accessToken)??b6(w.token)??b6(w.accessToken);if(!O)throw Error("Seal SSO did not return a bearer token");return{token:O,public:{sealUrl:I,expiresIn:Bq(M.expiresIn)??Bq(M.expires_in)??Bq(w.expiresIn)??Bq(w.expires_in)}}}):pl("seal.sso");J.push(Z.public);let q=Z.private?.token,V=q?await RT("seal.whoami",async()=>{let M=await T8(I,q,W).get("api/v1/auth/me").json(),w=d3(M.data),O=d3(w.user??M.user),D=d3(w.tenant??M.tenant);return{public:{user:{id:b6(O.id),name:b6(O.name),isAdmin:rS1(O.isAdmin),providerUserId:b6(O.providerUserId)},tenant:{id:b6(D.id),name:b6(D.name),tenantSlug:b6(D.tenantSlug),hoseCorpConfig:sS1(D.hoseCorpConfig)}}}}):pl("seal.whoami");return J.push(V.public),{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:J.every((F)=>F.ok===!0),stages:J}}async function RT($,Y){try{let z=await Y();return{public:{name:$,ok:!0,...Ih0(z.public)},private:z.token?{token:z.token}:void 0}}catch(z){return{public:{name:$,ok:!1,error:Oq(z instanceof Error?z.message:String(z))}}}}function pl($){return{public:{name:$,ok:!1,skipped:!0}}}async function Yh0($,Y){let z=await fetch($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Y)});return oS1(z)}async function oS1($){let Y=await $.text();if(!$.ok)throw Error(`${$.status} ${Y}`);let z=JSON.parse(Y);return d3(z)}function d3($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function b6($){return typeof $==="string"&&$?$:void 0}function Bq($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function rS1($){return typeof $==="boolean"?$:void 0}function sS1($){let Y=d3($);return Ih0({corporationId:b6(Y.corporationId),corporationName:b6(Y.corporationName)})}f Line truncated
`+`支持的审批系统与发布目标:
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
@@ -939,18 +939,18 @@ Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an a
`+` • feishu (飞书审批): 建议使用 Webhook 模式对接
`+` • weaver (泛微 OA): 建议使用 Webhook 模式对接
`+` • helios (汇联易): 建议使用 Webhook 模式对接
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let W=$==="maycur"?"每刻报销":"汇联易";throw Error(`${W}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${W}' --result-url <url> --corp <corpId>`)}let J=$==="hosecloud",K=$==="hosecloud"?Y:$,G=$==="hosecloud"?z:Y;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await k0("seal_deploy_hosecloud_requirements",U,I,{},C0(Q.options));return}if(K==="list"){await k0("seal_deploy_hosecloud_list",U,I,{},C0(Q.options));return}if(K==="get"){let W=G??S(Q.options.signKey)??S(Q.options["sign-key"]);if(!W){let X=((await o1(U)).integrations??[]).filter((Z)=>Z.type==="hosecloud");if(X.length===0)throw Error(`当前企业 (${I.name}) 尚未添加合思发布配置。
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let H=$==="maycur"?"每刻报销":"汇联易";throw Error(`${H}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${H}' --result-url <url> --corp <corpId>`)}let J=$==="hosecloud",K=$==="hosecloud"?Y:$,G=$==="hosecloud"?z:Y;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await k0("seal_deploy_hosecloud_requirements",U,I,{},C0(Q.options));return}if(K==="list"){await k0("seal_deploy_hosecloud_list",U,I,{},C0(Q.options));return}if(K==="get"){let H=G??S(Q.options.signKey)??S(Q.options["sign-key"]);if(!H){let X=((await o1(U)).integrations??[]).filter((Z)=>Z.type==="hosecloud");if(X.length===0)throw Error(`当前企业 (${I.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${I.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${I.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let Z of X){let q=Z.outboundName??"SealAI 审批",V=Z.signKey,F=Z.apiOrigin??"production";console.error(` • "${q}" (signKey: ${V}, 环境: ${F})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${V} --corp ${I.id}
`)}throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${I.id}`:void 0)}await k0("seal_deploy_hosecloud_get",U,I,{signKey:W},C0(Q.options));return}if(K==="status"){await k0("seal_deploy_hosecloud_status",U,I,{},C0(Q.options));return}if(K==="configure"){let W=S(Q.options.input),H=W?JSON.parse(CS1(W,"utf8")):y8(Q.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",U,I,{...H,dryRun:V0(Q.options.dryRun)??V0(Q.options["dry-run"])},C0(Q.options));return}if(K==="sync"){let W=G??S(Q.options.signKey)??S(Q.options["sign-key"]),H=V0(Q.options.auto)??V0(Q.options.yes);if(!W){let Z=((await o1(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${I.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${I.id}`);let q=Z[0];if(q&&Z.length===1&&H){let V=q.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${V})`),await k0("seal_deploy_hosecloud_sync",U,I,{signKey:V},C0(Q.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${I.id}]
`)}throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${I.id}`:void 0)}await k0("seal_deploy_hosecloud_get",U,I,{signKey:H},C0(Q.options));return}if(K==="status"){await k0("seal_deploy_hosecloud_status",U,I,{},C0(Q.options));return}if(K==="configure"){let H=S(Q.options.input),W=H?JSON.parse(aS1(H,"utf8")):y8(Q.json);if(!W||Object.keys(W).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",U,I,{...W,dryRun:V0(Q.options.dryRun)??V0(Q.options["dry-run"])},C0(Q.options));return}if(K==="sync"){let H=G??S(Q.options.signKey)??S(Q.options["sign-key"]),W=V0(Q.options.auto)??V0(Q.options.yes);if(!H){let Z=((await o1(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${I.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${I.id}`);let q=Z[0];if(q&&Z.length===1&&W){let V=q.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${V})`),await k0("seal_deploy_hosecloud_sync",U,I,{signKey:V},C0(Q.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${I.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of Z){let F=V.outboundName??"SealAI 审批",M=V.signKey,w=V.apiOrigin??"production";console.error(` • "${F}" (signKey: ${M}, 环境: ${w})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${M} --corp ${I.id}
`)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${I.id}
`);throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${I.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,I,{signKey:W},C0(Q.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var Jh0=o(()=>{o4();D4();Q4();X6();L$()});var Gh0=`interface:
`);throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${I.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,I,{signKey:H},C0(Q.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var Nh0=o(()=>{o4();D4();Q4();X6();L$()});var Ah0=`interface:
display_name: "Seal Use"
short_description: "Diagnose approval feedback and publish minimal rule fixes"
default_prompt: "Use $seal-use to resolve a customer feedback package to the correct tenant, diagnose the approval run, propose a minimal rule diff, and publish only after explicit confirmation."
`;var Kh0=()=>{};var Hh0=`# Approval Attachment Trace Investigation
`;var Dh0=()=>{};var Bh0=`# Approval Attachment Trace Investigation
Use this workflow when a customer disputes an AI approval finding about an attachment, invoice, receipt, OCR result, or a UI-highlighted audit result.
@@ -1171,7 +1171,7 @@ Manual image check:
- The customer's objection that they were receipts rather than invoices was reasonable.
However, the final rejection also had an independent rule-37 reason: payment screenshots totaled 699.48 while reimbursement was 700.00.
`;var Wh0=()=>{};var Zh0=`# Approval Bad Case Catalog
`;var Ph0=()=>{};var jh0=`# Approval Bad Case Catalog
Use this file only as a comparison catalog after inspecting the current trace. Do not treat any case below as a default diagnosis.
@@ -1221,7 +1221,7 @@ Important nuance:
- This is a bad-case pattern, not a general rule that every amount-total dispute is caused by \`pre_analysis\`.
- Use it when the current trace shows recognized amounts being excluded downstream or duplicate attachments producing inconsistent conclusions.
`;var Xh0=()=>{};var Vh0="# Approval Run Lightweight Queries\n\nUse this reference when the user gives a 合思/易快报单号, source document SN, record ID, simulation batch ID, or asks for an approval decision without needing the full raw run payload.\n\n## Locate A Run By Document Number\n\nPrefer `pick` before broad search + bridge + get.\n\n```bash\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --batch <batchId> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest --fields recordId,sourceDocumentSN,status,aiDecision,aiSummary\n```\n\nDefault output is intentionally small: `recordId`, `sourceDocumentSN`, `sourceDocumentId`, `simulationBatchId`, `status`, `taskMode`, `ruleSetVersionNumber`, `langfuseTraceId`, `manualResult`, `aiDecision`, and `aiSummary`.\n\nIf there are multiple candidates and `--latest` was not used, report the candidates and ask which one to inspect.\n\n## Read Compact Run Detail\n\nUse `--summary` for most diagnosis and support questions.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --summary\n```\n\nUse `--fields` when the user needs a particular slice.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --fields metadata\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.fields,result.summary\nseal-use approval-runs get <recordId> --corp <corpId> --fields result.summary,result.decision,result.riskPoints\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.keyFields,result,manualApprovalRecord,ruleSetVersionNumber\n```\n\nAvoid full `approval-runs get <recordId>` unless the user specifically needs raw document fields, pipeline logs, invoice rawData, or signed URLs. Prefer `--output-file` for full payloads.\n\n## Understand The Case First\n\nBefore pulling the full document, use:\n\n```bash\nseal-use approval-runs document-summary <recordId> --corp <corpId>\n```\n\nThis is for quick case reading: template/title, key fields, amount, expense type, cost company, payee, invoice summary, attachment names, AI result, and manual result.\n\n## Extract AI-Cited Rules\n\nUse this when the user asks \"AI 用了哪条规则\", \"为什么命中这条\", or needs the rule evidence for a specific run.\n\n```bash\nseal-use approval-runs cited-rules <recordId> --corp <corpId>\n```\n\nReturn and discuss `runtimeRuleId`, `ruleCode`, `versionNumber`, `scope`, `strictness`, `appliedAnalysis`, `checkResult`, and `findings` when present.\n\nIf the user then wants the full text of one cited rule, use `rules get --record-id <recordId> --runtime-id rule-205` from `rule-lightweight.md`.\n\n## Attachments Without Raw Payloads\n\nUse:\n\n```bash\n# 查看附件列表摘要(包含文件名、类型、大小及直链可用性)\nseal-use approval-runs attachments <recordId> --corp <corpId> --summary\n\n# 下载全部附件到本地目录(优先使用 ossSignedUrl 签名直链)\nseal-use approval-runs attachments download <recordId> --all --out-dir ./downloads --corp <corpId>\n\n# 按名称或 fileId 过滤下载单个附件\nseal-use approval-runs attachments download <recordId> --name 发票 --corp <corpId>\n```\n\nThis should be enough for file names, file IDs, mime types, positions, invoice/attachment grouping, and links when available. For customer disputes about OCR, receipt/invoice classification, or image content, switch to `approval-attachment-trace.md`.\n\n## Result Summary\n\nUse:\n\n```bash\nseal-use approval-runs result <recordId> --corp <corpId> --summary\n```\n\nThis is for decision, summary, risk point count, matched rule count, trace ID, and record ID.\n\n## Approval Run Web Links & SSO Links\n\nUse this when the user asks for a link to an approval run or wants to open the run directly in their browser:\n\n```bash\n# 默认推荐:生成干净的深度链接(无凭证、无越权风险,用户在已有登录状态的浏览器中直接打开)\nseal-use approval-runs url <recordId> --corp <corpId>\nseal-use approval-runs url --sn <sourceDocumentSN> --corp <corpId>\n\n# 仅当用户明确要求免密/跨浏览器/无登录直达且确认知晓安全风险时:生成携带单次临时票据的 SSO 直登链接\nseal-use approval-runs url <recordId> --sso [--expire 7200] --corp <corpId>\n```\n\n### SSO 链接安全与声明规范\n当向用户返回 `--sso` 链接时,Agent **必须**在回答中明确说明以下 4 点:\n1. **身份主体**:该链接代表哪个具体员工身份(如管理员姓名)登录。\n2. **权限范围**:该身份在 Seal AI 平台的全部权限范围(如完全操作权限)。\n3. **时效性**:临时 Ticket 换票时效(默认 2 小时,换票登录后会话有效 30 天)。\n4. **安全与防扩散边界**:该链接仅在 Seal AI 租户内生效,不代表合思主系统权限;严禁在公开或外部群聊中传播。\n\n> Line truncated
`;var Th0=()=>{};var Ch0="# Approval Run Lightweight Queries\n\nUse this reference when the user gives a 合思/易快报单号, source document SN, record ID, simulation batch ID, or asks for an approval decision without needing the full raw run payload.\n\n## Locate A Run By Document Number\n\nPrefer `pick` before broad search + bridge + get.\n\n```bash\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --batch <batchId> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest --fields recordId,sourceDocumentSN,status,aiDecision,aiSummary\n```\n\nDefault output is intentionally small: `recordId`, `sourceDocumentSN`, `sourceDocumentId`, `simulationBatchId`, `status`, `taskMode`, `ruleSetVersionNumber`, `langfuseTraceId`, `manualResult`, `aiDecision`, and `aiSummary`.\n\nIf there are multiple candidates and `--latest` was not used, report the candidates and ask which one to inspect.\n\n## Read Compact Run Detail\n\nUse `--summary` for most diagnosis and support questions.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --summary\n```\n\nUse `--fields` when the user needs a particular slice.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --fields metadata\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.fields,result.summary\nseal-use approval-runs get <recordId> --corp <corpId> --fields result.summary,result.decision,result.riskPoints\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.keyFields,result,manualApprovalRecord,ruleSetVersionNumber\n```\n\nAvoid full `approval-runs get <recordId>` unless the user specifically needs raw document fields, pipeline logs, invoice rawData, or signed URLs. Prefer `--output-file` for full payloads.\n\n## Understand The Case First\n\nBefore pulling the full document, use:\n\n```bash\nseal-use approval-runs document-summary <recordId> --corp <corpId>\n```\n\nThis is for quick case reading: template/title, key fields, amount, expense type, cost company, payee, invoice summary, attachment names, AI result, and manual result.\n\n## Extract AI-Cited Rules\n\nUse this when the user asks \"AI 用了哪条规则\", \"为什么命中这条\", or needs the rule evidence for a specific run.\n\n```bash\nseal-use approval-runs cited-rules <recordId> --corp <corpId>\n```\n\nReturn and discuss `runtimeRuleId`, `ruleCode`, `versionNumber`, `scope`, `strictness`, `appliedAnalysis`, `checkResult`, and `findings` when present.\n\nIf the user then wants the full text of one cited rule, use `rules get --record-id <recordId> --runtime-id rule-205` from `rule-lightweight.md`.\n\n## Attachments Without Raw Payloads\n\nUse:\n\n```bash\n# 查看附件列表摘要(包含文件名、类型、大小及直链可用性)\nseal-use approval-runs attachments <recordId> --corp <corpId> --summary\n\n# 下载全部附件到本地目录(优先使用 ossSignedUrl 签名直链)\nseal-use approval-runs attachments download <recordId> --all --out-dir ./downloads --corp <corpId>\n\n# 按名称或 fileId 过滤下载单个附件\nseal-use approval-runs attachments download <recordId> --name 发票 --corp <corpId>\n```\n\nThis should be enough for file names, file IDs, mime types, positions, invoice/attachment grouping, and links when available. For customer disputes about OCR, receipt/invoice classification, or image content, switch to `approval-attachment-trace.md`.\n\n## Result Summary\n\nUse:\n\n```bash\nseal-use approval-runs result <recordId> --corp <corpId> --summary\n```\n\nThis is for decision, summary, risk point count, matched rule count, trace ID, and record ID.\n\n## Approval Run Web Links & SSO Links\n\nUse this when the user asks for a link to an approval run or wants to open the run directly in their browser:\n\n```bash\n# 默认推荐:生成干净的深度链接(无凭证、无越权风险,用户在已有登录状态的浏览器中直接打开)\nseal-use approval-runs url <recordId> --corp <corpId>\nseal-use approval-runs url --sn <sourceDocumentSN> --corp <corpId>\n\n# 仅当用户明确要求免密/跨浏览器/无登录直达且确认知晓安全风险时:生成携带单次临时票据的 SSO 直登链接\nseal-use approval-runs url <recordId> --sso [--expire 7200] --corp <corpId>\n```\n\n### SSO 链接安全与声明规范\n当向用户返回 `--sso` 链接时,Agent **必须**在回答中明确说明以下 4 点:\n1. **身份主体**:该链接代表哪个具体员工身份(如管理员姓名)登录。\n2. **权限范围**:该身份在 Seal AI 平台的全部权限范围(如完全操作权限)。\n3. **时效性**:临时 Ticket 换票时效(默认 2 小时,换票登录后会话有效 30 天)。\n4. **安全与防扩散边界**:该链接仅在 Seal AI 租户内生效,不代表合思主系统权限;严禁在公开或外部群聊中传播。\n\n> Line truncated
Use this low-freedom workflow when the user provides packaged customer feedback from WeChat, screenshots, rejection notifications, a document number, or expected business behavior and wants diagnosis or an approval-rule change.
@@ -1494,7 +1494,7 @@ Do not automatically rerun or resubmit the customer's production document. Run a
- **系统调用凭证账号**:显式说明“周晚容(系统调用凭证账号,由智能助手代执行)”
- **全量规则总数**:核对总数是否变化
- **规则一致性校验**:确认目标规则文本与确认内容 100% 逐字吻合
`;var wh0=()=>{};var Nh0=`# Enterprise Onboarding
`;var vh0=()=>{};var gh0=`# Enterprise Onboarding
Read this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.
@@ -1682,7 +1682,7 @@ seal-use auth diagnose --corp <discovered-id> # Hose source
Report the human enterprise name, identity provider, credential method, and whether verification succeeded. Do not expose internal IDs unless they help with troubleshooting. Do not perform approval, rule, document, simulation, publishing, or other business mutations just because onboarding succeeded; continue only with the user's requested task and its normal confirmation rules.
If a temporary assistance-link or browser session expires, explain that it must be renewed or recaptured. Recommend standard Hose app credentials when the user needs durable unattended access.
`;var Oh0=()=>{};var Ph0=`# 第一次接入:看图找到材料
`;var Sh0=()=>{};var kh0=`# 第一次接入:看图找到材料
这份说明给第一次使用 Seal Use、还不熟悉“合思”“Seal”“appKey”“cURL”等词的用户。
@@ -1764,7 +1764,7 @@ macOS 也可以使用 \`Option + Command + I\`;Windows 常见快捷键是 \`F1
## 安全提醒
协助平台、网页登录、SSO 和浏览器 cURL 都可能携带当前用户的访问权限。只把材料交给正在处理本机接入的可信助手,并在接入完成后关闭或刷新该网页会话。不要把原始 cURL、接入密码或完整截图发送到外部渠道。
`;var Dh0=()=>{};var Ah0=`# Hose Enterprise Auth
`;var yh0=()=>{};var fh0=`# Hose Enterprise Auth
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
@@ -1830,7 +1830,7 @@ Important:
- **Formatting Requirement**: When returning a Hose authorization link to the user, ALWAYS provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
- **Dedicated CLI Command**: Use \`seal-use auth hose-link --corp <corpId> [--expire <seconds>] [--force]\`. This command directly generates an independent provisional auth link without reading or mutating internal CLI session cache. It supports \`--expire\` (default 7200, e.g. 86400 for 1 day). Note: this link cannot be listed via \`seal-use delegation list\` (the latter only tracks Seal audit platform delegations).
`;var Bh0=()=>{};var jh0=`# Seal AI 智能审核发布到合思费控 (HoseCloud Deployment)
`;var xh0=()=>{};var bh0=`# Seal AI 智能审核发布到合思费控 (HoseCloud Deployment)
Use this reference when configuring, deploying, or troubleshooting Seal AI smart approval integrations with Hose/合思费控 (界面路径:【智能审核】 $\\to$ 【发布】 $\\to$ 【合思费控】).
@@ -1928,7 +1928,7 @@ seal-use deploy hosecloud status --corp <corpId>
| \`signKey\` | string | 否 | 随机生成 | 集成配置卡片唯一标识,编辑时传入以更新对应配置 |
| \`apiOrigin\` | string | 否 | 自动探测 | \`production\` / \`custom\` |
| \`customApiUrl\` | string | 否 | - | 专属私有云 API 地址(当 \`apiOrigin=custom\` 时必填) |
`;var Th0=()=>{};var Ch0=`# Hose Enterprise Initialization & Automated Discovery
`;var uh0=()=>{};var ch0=`# Hose Enterprise Initialization & Automated Discovery
Use this reference for automated Hose/合思 enterprise onboarding, multi-domain probing (including dedicated private cloud domains like 美年大健康), OpenAPI role and staff discovery, and non-TUI safe administrator selection.
@@ -2034,7 +2034,7 @@ seal-use corps hose-staffs --json '{
}'
\`\`\`
* 直接使用指定 ID 完成接入并进行连通性验证。
`;var Eh0=()=>{};var _h0=`# Rule Lightweight Queries
`;var ih0=()=>{};var ph0=`# Rule Lightweight Queries
Use this reference when the user wants rule counts, compact rule lists, one rule from a historical version, or approval knowledge search without dumping hundreds of rule descriptions.
@@ -2145,7 +2145,7 @@ Use current search only when the question is about current draft/current knowled
## Output Discipline
If a rule command would return many descriptions or more than about 20 rules, use \`rules count\`, \`rules list --summary\`, \`fields\`, \`snippetOnly\`, or \`--output-file\`. Use \`--full\` only for deliberate exports.
`;var Rh0=()=>{};var hh0="# Seal Approval Rule Linter & Quality Validation\n\nUse this reference when analyzing, validating, or linting Seal AI approval rules to detect vague phrasing, missing exception evidence, or formatting defects before publishing.\n\n## Key Principles\n\n- **Default State**: Linter is **disabled by default** in global configuration (`lint.enabled: false`) to avoid unsolicited noise during standard operations.\n- **Doctor Visibility**: `seal-use doctor` audits the rule linter configuration state and active linter name in its health checks, and surfaces a one-click hint (`seal-use config lint enable`) when disabled.\n- **Explicit Triggering**: `seal-use rules lint` always runs regardless of global configuration.\n- **Draft Hook**: When `seal-use config lint enable` is set, `seal_approval_rule_update` outputs real-time diagnostic warnings to `stderr` without mutating `stdout` payloads.\n- **Fault-Tolerant Fallback**: If a custom `.ts` linter file has syntax errors, runtime exceptions, or is missing, the engine logs a warning to `stderr` and **silently falls back to the built-in heuristic linter without failing**.\n\n## CLI Commands\n\n### 1. Lint Current Draft Rules (Whole-RuleSet Scan)\n\n```bash\nseal-use rules lint --corp <corpId>\n```\n\n### 2. Lint Specific Historical Version or Single Rule\n\n```bash\n# Lint rules in published version 16\nseal-use rules lint --version 16 --corp <corpId>\n\n# Lint a specific rule by code (#0038)\nseal-use rules lint --code '#0038' --corp <corpId>\n\n# Summary mode (only show rules with issues)\nseal-use rules lint --summary --corp <corpId>\n```\n\n### 3. Quality Gate for CI / Release\n\n```bash\n# If overall score is below 85, terminates with exit code 1\nseal-use rules lint --min-score 85 --level error --corp <corpId>\n```\n\n### 4. Configure Global Linter Settings\n\n```bash\n# Check status\nseal-use config lint status\n\n# Enable auto lint on rule updates\nseal-use config lint enable --linter builtin --min-score 80\n\n# Disable auto lint\nseal-use config lint disable\n```\n\n## Official Linters\n\n| Linter Name | Scope & Purpose | Aliases |\n| :--- | :--- | :--- |\n| `builtin` | Seal 官方标准校验器:拦截过短描述、主观模糊词与悬空例外条款。 | `default`, `official/builtin` |\n| `strict` | Seal 官方严格风控校验器:强校验字数、刚性定量约束、凭证依据与具体审批人角色。 | `official/strict` |\n| `hlab` | 合思实验室 (HLab) 结构化规则校验器:SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判。 | `hlab-sop`, `hlab-rules`, `hlab-standard`, `official/hlab` |\n\n```bash\n# Inspect available linters\nseal-use rules linters\n\n# Lint rules using HLab SOP standard\nseal-use rules lint --linter hlab --corp <corpId>\n\n# Lint local rule workspace offline with HLab standard\nseal-use rules lint --linter hlab --file ./rules.local.json\n```\n\n## Built-In Detection Rules (`builtin`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `TOO_SHORT` | `error` | Rule description is under 5 characters. | Add concrete conditions and criteria. |\n| `VAGUE_WORD` | `error` | Contains subjective/fuzziness words (`原则上`, `尽量`, `适当`, `酌情`, `一般情况下`, `合理控制`). | Replace with rigid thresholds, enums, or criteria. |\n| `HANGING_EXCEPTION` | `warning` | Exception trigger found (`除非`, `特殊情况`, `经批准`) without verifiable evidence keyword (`备注`, `附件`, `证明`, `邮件`, `截图`). | Specify exact evidence source in invoice/document. |\n\n## HLab SOP Detection Rules (`hlab`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `MISSING_CHECK_METHOD` | `error` | Missing `**检查方法**` section in rule description. | Add `**检查方法**:` specifying fields, vouchers, and normalization logic. |\n| `MISSING_EVAL_STANDARD` | `error` | Missing `**判定标准**` section in rule description. | Add `**判定标准**:` with standard branches. |\n| `INCOMPLETE_TERNARY_BRANCH` | `error` | Incomplete ternary branch under evaluation criteria (missing `PASS`, `FAIL`, or `证据不足`). | Provide complete ternary closure: `- PASS:`, `- FAIL:`, `- 证据不足:`. |\n| `INSUFFICIENT_WITHOUT_MANUAL_REVIEW` | `warning` | `证据不足` branch does not specify escalating to `人工复核`. | Add `转人工复核` at the end of `证据不足` branch. |\n| `DISPOSAL_ACTION_LEAK` | `warning` | Contains whole-bill workflow disposal actions (`驳回单据`, `直接驳回`, `进行提醒`, `退回单据`). | Decouple disposal actions from rule text; rely on rule strictness or platform workflow. |\n| `SCOPE_FALSE_SKIP_PRONE` | `warning` | Scope contains material upload conditions (`若上传了`, `若提供了`, `附件需上传`). | Keep scope pure to business triggers; handle missing materials explicitly in FAIL branch to prevent silent SKIP. |\n| `RISK_SUPPRESSION` | `erroLine truncated
`;var nh0=()=>{};var mh0="# Seal Approval Rule Linter & Quality Validation\n\nUse this reference when analyzing, validating, or linting Seal AI approval rules to detect vague phrasing, missing exception evidence, or formatting defects before publishing.\n\n## Key Principles\n\n- **Default State**: Linter is **disabled by default** in global configuration (`lint.enabled: false`) to avoid unsolicited noise during standard operations.\n- **Doctor Visibility**: `seal-use doctor` audits the rule linter configuration state and active linter name in its health checks, and surfaces a one-click hint (`seal-use config lint enable`) when disabled.\n- **Explicit Triggering**: `seal-use rules lint` always runs regardless of global configuration.\n- **Draft Hook**: When `seal-use config lint enable` is set, `seal_approval_rule_update` outputs real-time diagnostic warnings to `stderr` without mutating `stdout` payloads.\n- **Fault-Tolerant Fallback**: If a custom `.ts` linter file has syntax errors, runtime exceptions, or is missing, the engine logs a warning to `stderr` and **silently falls back to the built-in heuristic linter without failing**.\n\n## CLI Commands\n\n### 1. Lint Current Draft Rules (Whole-RuleSet Scan)\n\n```bash\nseal-use rules lint --corp <corpId>\n```\n\n### 2. Lint Specific Historical Version or Single Rule\n\n```bash\n# Lint rules in published version 16\nseal-use rules lint --version 16 --corp <corpId>\n\n# Lint a specific rule by code (#0038)\nseal-use rules lint --code '#0038' --corp <corpId>\n\n# Summary mode (only show rules with issues)\nseal-use rules lint --summary --corp <corpId>\n```\n\n### 3. Quality Gate for CI / Release\n\n```bash\n# If overall score is below 85, terminates with exit code 1\nseal-use rules lint --min-score 85 --level error --corp <corpId>\n```\n\n### 4. Configure Global Linter Settings\n\n```bash\n# Check status\nseal-use config lint status\n\n# Enable auto lint on rule updates\nseal-use config lint enable --linter builtin --min-score 80\n\n# Disable auto lint\nseal-use config lint disable\n```\n\n## Official Linters\n\n| Linter Name | Scope & Purpose | Aliases |\n| :--- | :--- | :--- |\n| `builtin` | Seal 官方标准校验器:拦截过短描述、主观模糊词与悬空例外条款。 | `default`, `official/builtin` |\n| `strict` | Seal 官方严格风控校验器:强校验字数、刚性定量约束、凭证依据与具体审批人角色。 | `official/strict` |\n| `hlab` | 合思实验室 (HLab) 结构化规则校验器:SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判。 | `hlab-sop`, `hlab-rules`, `hlab-standard`, `official/hlab` |\n\n```bash\n# Inspect available linters\nseal-use rules linters\n\n# Lint rules using HLab SOP standard\nseal-use rules lint --linter hlab --corp <corpId>\n\n# Lint local rule workspace offline with HLab standard\nseal-use rules lint --linter hlab --file ./rules.local.json\n```\n\n## Built-In Detection Rules (`builtin`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `TOO_SHORT` | `error` | Rule description is under 5 characters. | Add concrete conditions and criteria. |\n| `VAGUE_WORD` | `error` | Contains subjective/fuzziness words (`原则上`, `尽量`, `适当`, `酌情`, `一般情况下`, `合理控制`). | Replace with rigid thresholds, enums, or criteria. |\n| `HANGING_EXCEPTION` | `warning` | Exception trigger found (`除非`, `特殊情况`, `经批准`) without verifiable evidence keyword (`备注`, `附件`, `证明`, `邮件`, `截图`). | Specify exact evidence source in invoice/document. |\n\n## HLab SOP Detection Rules (`hlab`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `MISSING_CHECK_METHOD` | `error` | Missing `**检查方法**` section in rule description. | Add `**检查方法**:` specifying fields, vouchers, and normalization logic. |\n| `MISSING_EVAL_STANDARD` | `error` | Missing `**判定标准**` section in rule description. | Add `**判定标准**:` with standard branches. |\n| `INCOMPLETE_TERNARY_BRANCH` | `error` | Incomplete ternary branch under evaluation criteria (missing `PASS`, `FAIL`, or `证据不足`). | Provide complete ternary closure: `- PASS:`, `- FAIL:`, `- 证据不足:`. |\n| `INSUFFICIENT_WITHOUT_MANUAL_REVIEW` | `warning` | `证据不足` branch does not specify escalating to `人工复核`. | Add `转人工复核` at the end of `证据不足` branch. |\n| `DISPOSAL_ACTION_LEAK` | `warning` | Contains whole-bill workflow disposal actions (`驳回单据`, `直接驳回`, `进行提醒`, `退回单据`). | Decouple disposal actions from rule text; rely on rule strictness or platform workflow. |\n| `SCOPE_FALSE_SKIP_PRONE` | `warning` | Scope contains material upload conditions (`若上传了`, `若提供了`, `附件需上传`). | Keep scope pure to business triggers; handle missing materials explicitly in FAIL branch to prevent silent SKIP. |\n| `RISK_SUPPRESSION` | `erroLine truncated
本文档面向 AI Agent 与运维人员,规范从**生产/测试环境搭配接入**、**配置与合思集成自动同步**、**测试环境单据模拟验证**,到**生产规则安全投产**的端到端标准工作流。
@@ -2352,7 +2352,7 @@ flowchart TD
seal-use tool seal_approval_rules_publish --corp <prodCorpId> --json '{"versionName":"审核规则 版本N"}'
\`\`\`
发布后核实版本状态,完成业务安全闭环。
`;var Sh0=()=>{};var kh0=`---
`;var lh0=()=>{};var sh0=`---
name: seal-use
description: "v0.10.29: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
metadata:
@@ -2563,7 +2563,10 @@ seal-use tool seal_approval_search --corp <corpId> --json '{"keywords":["差旅"
## Safety
Rule, document, style preference, and publish actions mutate Seal configuration. Make the target enterprise explicit, show the intended payload, and verify after the write. Never send real \`enterprises/*.json\` files, tokens, signed URLs, or full raw documents to GitHub, tickets, logs, or chat unless the user explicitly requests a safe export.
`;var yh0=()=>{};var pS1="iVBORw0KGgoAAAANSUhEUgAADVgAAAdwCAYAAACUWcTmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAANWKADAAQAAAABAAAHcAAAAAD4n9OGAABAAElEQVR4AeydB4AdVfX/z246pNAD0hK6dOki0rsU+dMJJVIFRYoUFUFAQUCqgHSkxx8gTRCpFkB6CU06SQi9BEhC+u7/fu7b83J3dt7bt33f5nuStzNz5947M583c+fOvPO9p6Y+mMlEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4kUDsHHrMOWQREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQigd7jxo8TChEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYIwkogtUc+bXroEVABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCBQUx9MKERABERABERABERABERABERABERABERABERABERABERABERABESgqwiMHz/eBgwY0FWb13ZFQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQATmcAKKYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwn0npMPXscuAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAj2RwP8+n26vfjbd3vpyho2fPN0+mjLTJs+qs/qaOhvYp8YWGtDLFh/U25YZ3NdWnr+/rTDvgJ6IQcckAhURqKkPVlFOZRIBERABERABERABERABERABERABERABERABERABERABERABERCBDiAwfvx4GzBAP9p2AFpVKQIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiMIcR+GhSnT347lT713tT7eOpM4OYqj5+LEzNEFdZ+MyKU5Zr4jLp9fat/r1ss28NtM0WG2KLzN1nDiOnw53TCUhgNaefATp+ERABERABERABERABERABERABERABERABERABERABERABEehiAhJYdfEXoM2LgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAhUPYFJ08z+7+Updsc7U8OxFARURKqyIKAqCKnqbVYQUdU2CK7iOiuIr4oirLBcgxArfHZZcrDttcwCNnefXlXPRgcgApUQkMCqEkrKIwIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0GEEJLDqMLSqWAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4g8MR7M+2Cp6fY5JmFSFQhRlUQStUVBVUsF0VUCKiSSFZEsKqLkawa5yH/oN5mP195qK0/dPAcQFGHOKcTkMBqTj8DdPwiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0MUEJLDq4i+gCzY/ZcqUuNUBAwZ0wda1SREQAREQAREQAREQAREQAREQAREQAREQAREQARHoHAKd8S501AszbNT/psXIUwWhVDi2IK6qj5GriGRVEE4RlSoVWlUayYry+w2fx0Yst1DnQNNWRKCLCAQ9oUwEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKCaCFz035n20JgZ1stqQowqs9qaWmJVBR1VbRBZkdLLakN0qiCzCtMGgVXMURfW1YQsTHsFEdasMC0UCSWjOIvcbte++6V9MX2mHb7ytzypS6e/+93v7H//+1/uPuy888727W9/O35yMyhRBEoQ4NyXiYAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiECPIXDbbbfZiBEjGh0PP7aSxif90dXzks68G3k8P2VTYznNm67TvAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BoGLHp1lD74zM6qh6kK4qprwqW+YMl9TR1pYHcRWtUFHhZaqLi6TFsJbhflCOYRVtbG818H6+KGOhnr+9v4ku/DlDzrj0Mpug/fz6Xv+bOa//vWvxkcmAi0loAhWLSWm/CIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAt2WAD+sdvQPp/xwy0cjYHbb00A7JgIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAI9msCo5+rt4XdDVKoaIlfVxChVHHCMPtXoyIO4KuSoy0ayqifOFeWJUxVqSCJZfW/hwfbox1/FuqiKHF4zIqt5+39qey+zYEztij/pbwC8p0/NhVc+TddpXgSaIyCBVXOEtF4EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKBqCLz66qudtq/8iPvrX/+607aX3VBniMluvPHG7Ga1LAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiUIJAzT+vi2vqN9m3RA4li0DbCTw5xuyWl+qMIFQWIk8Rpqo+Cq1YDlKokL7m4v2D7IrFOgurwvqwoiaEsIpyKebNHv9wki+FdERaSKlq7fytlrEj73vLHvvoq7gNUkM4q1BPKBTque7tCbbUoH62/tDBrOkyQ1yVfUf/u9/9rmx0qy7b2VZu2H8H4FhXXHFF+3//7/+1siYVq4RATX2wSjIqjwiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BIHx48fbgAEDOqLqHlun/6ja0QfYUQKrKVOmxF3X997R36DqFwEREAEREAEREAEREAEREAEREAEREAER6EwCs074btxcr9Me78zNalvdmEB7vwudNM3ssFvNJs2oi0KqWUE0FQVUUUiF6KreLtx5QVtt0X5lqYz+cIodevfYkKcg1KpHfBXKHvadobbvdxay0R9NsgPveyOsD3KTWiQniLjCNHyYDgqhfq7bcCmbu0+vsttpy0rEUlgqLErfje+8885NBEepwMrXE83Ko16ldbVl3zqjbHqsvj0EZdmoXb5O07YTUASrtjNUDSIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiLQqQQ6M1JXpx5YD96Yj3sZR3ntwcdZyaHNmDHDPv74Y1t00UULo95WUqiL8syaNct69eo4J5EuOqwu3Szff58+fZrsg66RJkiU0MkEGJ4YhzSZCHQmAdpEjHtNbW0Ydb4djHvX9OnTNYBBA0ucWfv169dufNvhK+oxVUydOtXq6upsrrnm6jHHpAMRAREQAREQgbYS8OhV1FN/1VFWc8B5ba2yWJ6+45gxY+ytt96y/v3729JLL22LLbZYbj+H9y4u6ilWUGJm7rnntgUXXDCu/frrr+2LL74okbNxMv3XJZZYonFia5fGjLaad0e3tnSx3JwSNezmZ2ts8vQQTSr8C9KoOA2Sp8ChJvyttQPXG9SsuMqh1VEslIviqTBdf5G5o7iK1NUWHmg/XW1Ru/iF960+aK8QVbE1j2SFwOumtz6zg749lOztbqlQygVSCIuYL2cIqDwPoirepfsy5ZgnLRv5qlydXbUu73cAjqka9h1mCMSw1kbdamv5uPEW/pHAqoXAlF0EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEuppA+oNwR0WZ6upj7Enbf+ONN+yUU06Jh3Tsscfa6quv3pMOLx7Lhx9+aMcff3yc33vvvW3LLbfMPcZbbrnF7rjjjrjuF7/4ha2yyiq5+dLEyZMn24QJE2zhhRe23r1720svvWTnn39+zPLLX/7SlllmmTR77jyORb/61a/iuv3339++973v5eZLE99++2076aSTbNlll7UtttiiojJp+WqZHz16dBQ84XziNnPmTPv00099sUVTHLMGDx6cW2bcuHHRAWSzzTazHXfc0eaZZ56Y7/HHH7eLLroozh933HG21FJL2Zlnnmm77LJLm6+Xb775xr766qvc/ckmzjvvvNFJLZveluWzzz7b3nrzTVty2DDjfG2JTZs2ze677z7bZpttGonSvvzyy4od5bLb4zqqJqHnxxNmWcHZK3skLV/u16fG5huUL2B5cPRUO Line truncated
`;var rh0=()=>{};var qg1="iVBORw0KGgoAAAANSUhEUgAADVgAAAdwCAYAAACUWcTmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAANWKADAAQAAAABAAAHcAAAAAD4n9OGAABAAElEQVR4AeydB4AdVfX/z246pNAD0hK6dOki0rsU+dMJJVIFRYoUFUFAQUCqgHSkxx8gTRCpFkB6CU06SQi9BEhC+u7/fu7b83J3dt7bt33f5nuStzNz5947M583c+fOvPO9p6Y+mMlEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4kUDsHHrMOWQREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQigd7jxo8TChEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYIwkogtUc+bXroEVABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCBQUx9MKERABERABERABERABERABERABERABERABERABERABERABERABESgqwiMHz/eBgwY0FWb13ZFQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQATmcAKKYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwn0npMPXscuAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAj2RwP8+n26vfjbd3vpyho2fPN0+mjLTJs+qs/qaOhvYp8YWGtDLFh/U25YZ3NdWnr+/rTDvgJ6IQcckAhURqKkPVlFOZRIBERABERABERABERABERABERABERABERABERABERABERABERCBDiAwfvx4GzBAP9p2AFpVKQIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiMIcR+GhSnT347lT713tT7eOpM4OYqj5+LEzNEFdZ+MyKU5Zr4jLp9fat/r1ss28NtM0WG2KLzN1nDiOnw53TCUhgNaefATp+ERABERABERABERABERABERABERABERABERABERABERABEehiAhJYdfEXoM2LgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAhUPYFJ08z+7+Updsc7U8OxFARURKqyIKAqCKnqbVYQUdU2CK7iOiuIr4oirLBcgxArfHZZcrDttcwCNnefXlXPRgcgApUQkMCqEkrKIwIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0GEEJLDqMLSqWAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4g8MR7M+2Cp6fY5JmFSFQhRlUQStUVBVUsF0VUCKiSSFZEsKqLkawa5yH/oN5mP195qK0/dPAcQFGHOKcTkMBqTj8DdPwiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0MUEJLDq4i+gCzY/ZcqUuNUBAwZ0wda1SREQAREQAREQAREQAREQAREQAREQAREQAREQARHoHAKd8S501AszbNT/psXIUwWhVDi2IK6qj5GriGRVEE4RlSoVWlUayYry+w2fx0Yst1DnQNNWRKCLCAQ9oUwEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKCaCFz035n20JgZ1stqQowqs9qaWmJVBR1VbRBZkdLLakN0qiCzCtMGgVXMURfW1YQsTHsFEdasMC0UCSWjOIvcbte++6V9MX2mHb7ytzypS6e/+93v7H//+1/uPuy888727W9/O35yMyhRBEoQ4NyXiYAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiECPIXDbbbfZiBEjGh0PP7aSxif90dXzks68G3k8P2VTYznNm67TvAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BoGLHp1lD74zM6qh6kK4qprwqW+YMl9TR1pYHcRWtUFHhZaqLi6TFsJbhflCOYRVtbG818H6+KGOhnr+9v4ku/DlDzrj0Mpug/fz6Xv+bOa//vWvxkcmAi0loAhWLSWm/CIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAt2WAD+sdvQPp/xwy0cjYHbb00A7JgIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAI9msCo5+rt4XdDVKoaIlfVxChVHHCMPtXoyIO4KuSoy0ayqifOFeWJUxVqSCJZfW/hwfbox1/FuqiKHF4zIqt5+39qey+zYEztij/pbwC8p0/NhVc+TddpXgSaIyCBVXOEtF4EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKBqCLz66qudtq/8iPvrX/+607aX3VBniMluvPHG7Ga1LAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiUIJAzT+vi2vqN9m3RA4li0DbCTw5xuyWl+qMIFQWIk8Rpqo+Cq1YDlKokL7m4v2D7IrFOgurwvqwoiaEsIpyKebNHv9wki+FdERaSKlq7fytlrEj73vLHvvoq7gNUkM4q1BPKBTque7tCbbUoH62/tDBrOkyQ1yVfUf/u9/9rmx0qy7b2VZu2H8H4FhXXHFF+3//7/+1siYVq4RATX2wSjIqjwiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BIHx48fbgAEDOqLqHlun/6ja0QfYUQKrKVOmxF3X997R36DqFwEREAEREAEREAEREAEREAEREAEREAER6EwCs074btxcr9Me78zNalvdmEB7vwudNM3ssFvNJs2oi0KqWUE0FQVUUUiF6KreLtx5QVtt0X5lqYz+cIodevfYkKcg1KpHfBXKHvadobbvdxay0R9NsgPveyOsD3KTWiQniLjCNHyYDgqhfq7bcCmbu0+vsttpy0rEUlgqLErfje+8885NBEepwMrXE83Ko16ldbVl3zqjbHqsvj0EZdmoXb5O07YTUASrtjNUDSIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiLQqQQ6M1JXpx5YD96Yj3sZR3ntwcdZyaHNmDHDPv74Y1t00UULo95WUqiL8syaNct69eo4J5EuOqwu3Szff58+fZrsg66RJkiU0MkEGJ4YhzSZCHQmAdpEjHtNbW0Ydb4djHvX9OnTNYBBA0ucWfv169dufNvhK+oxVUydOtXq6upsrrnm6jHHpAMRAREQAREQgbYS8OhV1FN/1VFWc8B5ba2yWJ6+45gxY+ytt96y/v3729JLL22LLbZYbj+H9y4u6ilWUGJm7rnntgUXXDCu/frrr+2LL74okbNxMv3XJZZYonFia5fGjLaad0e3tnSx3JwSNezmZ2ts8vQQTSr8C9KoOA2Sp8ChJvyttQPXG9SsuMqh1VEslIviqTBdf5G5o7iK1NUWHmg/XW1Ru/iF960+aK8QVbE1j2SFwOumtz6zg749lOztbqlQygVSCIuYL2cIqDwPoirepfsy5ZgnLRv5qlydXbUu73cAjqka9h1mCMSw1kbdamv5uPEW/pHAqoXAlF0EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEuppA+oNwR0WZ6upj7Enbf+ONN+yUU06Jh3Tsscfa6quv3pMOLx7Lhx9+aMcff3yc33vvvW3LLbfMPcZbbrnF7rjjjrjuF7/4ha2yyiq5+dLEyZMn24QJE2zhhRe23r1720svvWTnn39+zPLLX/7SlllmmTR77jyORb/61a/iuv3339++973v5eZLE99++2076aSTbNlll7UtttiiojJp+WqZHz16dBQ84XziNnPmTPv00099sUVTHLMGDx6cW2bcuHHRAWSzzTazHXfc0eaZZ56Y7/HHH7eLLroozh933HG21FJL2Zlnnmm77LJLm6+Xb775xr766qvc/ckmzjvvvNFJLZveluWzzz7b3nrzTVty2DDjfG2JTZs2ze677z7bZpttGonSvvzyy4od5bLb4zqqJqHnxxNmWcHZK3skLV/u16fG5huUL2B5cPRUO Line truncated
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"created"};let I={};try{I=JSON.parse(eh0(z,"utf8"))}catch{I={entries:[]}}if(!Array.isArray(I.entries))I.entries=[];if(I.entries.findIndex((K)=>K&&typeof K.path==="string"&&K.path===Y)!==-1)return{detected:U,configured:!0,configPath:z,targetDir:Y,action:"already_present"};let J=I.entries.findIndex((K)=>K&&typeof K.path==="string"&&(K.path==="~/.agents/skills"||K.path==="~/.agents/skills/"));if(J!==-1)return I.entries[J]={...I.entries[J],path:Y},ml(z,JSON.stringify(I,null,2)+`
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"updated_tilde"};return I.entries.unshift({path:Y}),ml(z,JSON.stringify(I,null,2)+`
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"prepended"}}function rl($){let Y=$?.targetSkillsDir??$S0(),z=$?.configFile??YS0(),U=zS0(),I=!1;if(Tq(z))try{let Q=JSON.parse(eh0(z,"utf8"));if(Array.isArray(Q?.entries))I=Q.entries.some((J)=>J?.path===Y)}catch{}return{detected:U,configured:I,configPath:z,targetDir:Y}}var sl=()=>{};import{cpSync as Dg1,existsSync as kK,lstatSync as IS0,mkdirSync as Ag1,realpathSync as a2,rmSync as Pg1,symlinkSync as Bg1,unlinkSync as US0}from"node:fs";import{homedir as QS0}from"node:os";import{dirname as JS0,join as t2}from"node:path";function Tg1($,Y){let z=Y?.baseHomeDir??QS0(),U=t2(z,$.rootDirName),I=Y?.sourceSkillDir??t2(z,".agents","skills","seal-use"),Q=JS0(I),J=t2(U,"skills"),K=t2(J,"seal-use");if(!kK(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"skipped_not_detected"};if(kK(J)&&kK(Q))try{if(a2(J)===a2(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:J}}catch{}Ag1(J,{recursive:!0});let G;try{G=IS0(K)}catch{G=void 0}let H=!1;if(G)if(G.isSymbolicLink()){try{if(a2(K)===a2(I))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"already_linked",targetPath:K}}catch{}try{US0(K)}catch{}}else if(G.isDirectory())Pg1(K,{recursive:!0,force:!0}),H=!0;else US0(K);let W=process.platform==="win32"?"junction":"dir";try{return Bg1(I,K,W),{id:$.id,name:$.name,detected:!0,configured:!0,mode:H?"replaced_real_dir":"linked",targetPath:K}}catch{try{return Dg1(I,K,{recursive:!0}),{id:$.id,name:$.name,detected:!0,configured:!0,mode:"fallback_copied",targetPath:K}}catch(X){return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"error",targetPath:K,error:X?.message||String(X)}}}}function jg1($,Y){let z=Y?.baseHomeDir??QS0(),U=t2(z,$.rootDirName),I=Y?.sourceSkillDir??t2(z,".agents","skills","seal-use"),Q=JS0(I),J=t2(U,"skills"),K=t2(J,"seal-use");if(!kK(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"not_detected"};if(kK(J)&&kK(Q))try{if(a2(J)===a2(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:J}}catch{}let G;try{G=IS0(K)}catch{G=void 0}if(G){if(G.isSymbolicLink())try{if(a2(K)===a2(I))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"single_symlinked",targetPath:K}}catch{}else if(G.isDirectory())return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"real_directory",targetPath:K}}return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"not_configured",targetPath:K}}function al($){return KS0.map((Y)=>Tg1(Y,$))}function tl($){return KS0.map((Y)=>jg1(Y,$))}var KS0;var el=o(()=>{KS0=[{id:"workbuddy",name:"WorkBuddy",rootDirName:".workbuddy"},{id:"claude",name:"Claude",rootDirName:".claude"},{id:"qoder",name:"Qoder",rootDirName:".qoder"}]});var $o=o(()=>{sl();el();sl();el()});import{existsSync as Eg1,mkdirSync as Yo,readFileSync as Cg1,rmSync as Rg1,writeFileSync as GS0}from"node:fs";import{homedir as WS0}from"node:os";import{dirname as HS0,join as Eq}from"node:path";function zo(){return XS0["SKILL.md"]||""}function ZS0($){return $.match(/^\s*version:\s*(\S+)\s*$/m)?.[1]}function qS0($=Eq(gU(),"SKILL.md")){try{return ZS0(Cg1($,"utf8"))}catch{return}}function gU(){return Eq(WS0(),".agents","skills","seal-use")}function vg1(){return Eq(WS0(),".agents","skills","seal-home")}function hg1(){let $=vg1();if(Eg1($))try{return Rg1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function VS0($=gU()){hg1(),Yo($,{recursive:!0});let Y=[];for(let[z,U]of Object.entries(XS0)){let I=Eq($,z);Yo(HS0(I),{recursive:!0}),GS0(I,U,"utf8"),Y.push(z)}for(let[z,U]of Object.entries(_g1)){let I=Eq($,z);Yo(HS0(I),{recursive:!0}),GS0(I,U),Y.push(z)}return{targetDir:$,files:Y}}var XS0,_g1,D24;var Cq=o(()=>{dl();dl();$o();XS0=ah0,_g1=Object.fromEntries(Object.entries(th0).map(([$,Y])=>[$,Buffer.from(Y,"base64")]));D24=ZS0(zo())});function LS0(){return`# Seal Use 系统架构与运行规范白皮书
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
@@ -2586,14 +2589,14 @@ Rule, document, style preference, and publish actions mutate Seal configuration.
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
| :--- | :--- | :--- | :--- |
${nl.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
${Uo.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
`)}
---
## 3. 安全与数据隐私保证
${pl.map(($,Y)=>`### 3.${Y+1} ${$.topic}
${Io.map(($,Y)=>`### 3.${Y+1} ${$.topic}
- **安全承诺**:${$.guarantee}
- **实现约束**:${$.enforcement}
`).join(`
@@ -2603,7 +2606,7 @@ ${pl.map(($,Y)=>`### 3.${Y+1} ${$.topic}
## 4. 业务域能力图谱
${dl.map(($)=>`### \`seal-use ${$.domain}\`
${Qo.map(($)=>`### \`seal-use ${$.domain}\`
* **能力定位**:${$.summary}
* **核心命令**:${$.primaryCommands.map((Y)=>`\`seal-use ${Y}\``).join("、")}
`).join(`
@@ -2616,19 +2619,19 @@ ${dl.map(($)=>`### \`seal-use ${$.domain}\`
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
`}var nl,pl,dl;var ml=o(()=>{nl=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],pl=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],dl=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs url"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材 Line truncated
`)}var ah0=o(()=>{Gp();t9();S3();Bq();yB();ml()});var th0={};x8(th0,{formatTenantDoctorDashboard:()=>Gg1,diagnoseTenantContract:()=>Kg1});async function Kg1($,Y){let z=[],U=Y.environment==="test"?"test":"production",I=U==="test"?Y.prodCorpId:Y.testCorpId,Q=U==="test"?"prodParent":"testTarget",J=null,K=null;try{let M=await H8($);if(J=M.user,K=M.tenant,Boolean(J?.isAdmin||J?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${J.name??"未知"}」(${J.id??""}),具备完整操作权限`,details:{userId:J.id,userName:J.name,isAdmin:!0,tenantSlug:K?.tenantSlug,permissions:J.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${J.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:J.id,userName:J.name,isAdmin:!1,permissions:J.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(M){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let G={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},W={used:0,remaining:0};try{let M=await bY($),w=Array.isArray(M.features)?M.features:[],O=w.find((N)=>N?.code==="ai-approval");if(O){let N=typeof O.balance==="number"?O.balance:0,A=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,T=Math.floor(N/A);if(G.balance=N,G.deductionAmount=A,G.estimatedRuns=T,N<=0)G.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:N,deductionAmount:A,estimatedRuns:T},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(T<10)G.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${N} 点 (单笔扣除 ${A} 点),仅可支持约 ${T} 笔审核`,details:{balance:N,deductionAmount:A,estimatedRuns:T},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else G.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${N} 点,预估可支持 ${T} 笔审核单据`,details:{balance:N,deductionAmount:A,estimatedRuns:T}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:w.map((N)=>N?.code)}});let D=w.find((N)=>N?.code==="approval-rules");if(D)W.used=typeof D.used==="number"?D.used:0,W.remaining=typeof D.remaining==="number"?D.remaining:0}catch(M){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let H={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let M=await p6($),w=Array.isArray(M.rules)?M.rules:[];if(H.totalCount=w.length,H.activeCount=w.filter((O)=>O.status==="ACTIVE").length,w.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&I?`可运行 seal-use corps sync-test --corp ${I} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${H.totalCount} 条规则,其中生效活跃 ${H.activeCount} 条`,details:{totalCount:H.totalCount,activeCount:H.activeCount,quotaUsed:W.used,quotaRemaining:W.remaining}})}catch(M){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let X={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let M=await Q$($);X.integrationCount=M.length;let w=M.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(X.hasReplayChannel=Boolean(w),X.activeWebhookId=w?.id??M[0]?.id,M.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook add --name (回放通道) 手动注册专属通道"});else z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${M.length} 个通道${w?` (含专属回放通道「${w.name}」)`:""}`,details:{integrationCount:M.length Line truncated
`)}var eh0=o(()=>{X6()});async function $S0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(mh0());return}if(U==="paths"||U==="dirs"||U==="directories"){let J=ll();c0(J.directories);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (o4(),z_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),L00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),oR0)),{diagnoseTenantContract:W,formatTenantDoctorDashboard:H}=await Promise.resolve().then(() => (eh0(),th0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=J(X),q=await K(Z),V=await W(q,Z);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(H(V));c0(V);return}let I=ll();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(sh0(I));c0(I)}var YS0=o(()=>{ah0();ml();D4();Q4()});var US0;var zS0=o(()=>{US0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.29",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local Line truncated
`}var Uo,Io,Qo;var Jo=o(()=>{Uo=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Io=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],Qo=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs url"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材 Line truncated
`)}var NS0=o(()=>{qp();t9();S3();Cq();bP();Jo()});var DS0={};x8(DS0,{formatTenantDoctorDashboard:()=>ug1,diagnoseTenantContract:()=>fg1});async function fg1($,Y){let z=[],U=Y.environment==="test"?"test":"production",I=U==="test"?Y.prodCorpId:Y.testCorpId,Q=U==="test"?"prodParent":"testTarget",J=null,K=null;try{let M=await W8($);if(J=M.user,K=M.tenant,Boolean(J?.isAdmin||J?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${J.name??"未知"}」(${J.id??""}),具备完整操作权限`,details:{userId:J.id,userName:J.name,isAdmin:!0,tenantSlug:K?.tenantSlug,permissions:J.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${J.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:J.id,userName:J.name,isAdmin:!1,permissions:J.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(M){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let G={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},H={used:0,remaining:0};try{let M=await cY($),w=Array.isArray(M.features)?M.features:[],O=w.find((N)=>N?.code==="ai-approval");if(O){let N=typeof O.balance==="number"?O.balance:0,B=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,T=Math.floor(N/B);if(G.balance=N,G.deductionAmount=B,G.estimatedRuns=T,N<=0)G.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:N,deductionAmount:B,estimatedRuns:T},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(T<10)G.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${N} 点 (单笔扣除 ${B} 点),仅可支持约 ${T} 笔审核`,details:{balance:N,deductionAmount:B,estimatedRuns:T},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else G.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${N} 点,预估可支持 ${T} 笔审核单据`,details:{balance:N,deductionAmount:B,estimatedRuns:T}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:w.map((N)=>N?.code)}});let D=w.find((N)=>N?.code==="approval-rules");if(D)H.used=typeof D.used==="number"?D.used:0,H.remaining=typeof D.remaining==="number"?D.remaining:0}catch(M){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let W={totalCount:0,activeCount:0,quotaUsed:H.used,quotaRemaining:H.remaining};try{let M=await p6($),w=Array.isArray(M.rules)?M.rules:[];if(W.totalCount=w.length,W.activeCount=w.filter((O)=>O.status==="ACTIVE").length,w.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&I?`可运行 seal-use corps sync-test --corp ${I} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${W.totalCount} 条规则,其中生效活跃 ${W.activeCount} 条`,details:{totalCount:W.totalCount,activeCount:W.activeCount,quotaUsed:H.used,quotaRemaining:H.remaining}})}catch(M){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let X={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let M=await Q$($);X.integrationCount=M.length;let w=M.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(X.hasReplayChannel=Boolean(w),X.activeWebhookId=w?.id??M[0]?.id,M.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook add --name (回放通道) 手动注册专属通道"});else z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${M.length} 个通道${w?` (含专属回放通道「${w.name}」)`:""}`,details:{integrationCount:M.length Line truncated
`)}var AS0=o(()=>{X6()});async function PS0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(LS0());return}if(U==="paths"||U==="dirs"||U==="directories"){let J=Ko();c0(J.directories);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (o4(),F_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),R00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),G_0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (AS0(),DS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=J(X),q=await K(Z),V=await H(q,Z);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(W(V));c0(V);return}let I=Ko();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(OS0(I));c0(I)}var BS0=o(()=>{NS0();Jo();D4();Q4()});var jS0;var TS0=o(()=>{jS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.29",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local Line truncated
the credentials already stored on this machine for the selected enterprise. Keep it bound
to loopback (\`--host 127.0.0.1\`) and do not expose the port to a network or an origin you
do not control.
`}},parameters:{CorpId:{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},Offset:{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},Limit:{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},RuleId:{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."},VersionId:{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."},DocumentId:{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."},RecordId:{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."},BatchId:{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}},responses:{BadRequest:{description:"Invalid request.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},Unauthorized:{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},NotFound:{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}},schemas:{ErrorResponse:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}},CorpSummary:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}},SwitchCorpRequest:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}},SwitchCorpResponse:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}},SourceConfig:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."},AuthStage:{type:"object",additionalProperties:!0,required:["name","ok"],properties:{name:{type:"string",examples:["hose.openapi","hose.provisional","seal.sso","seal.whoami"]},ok:{type:"boolean"},error:{type:"string"}}},AuthDiagnosis:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}},SealUser:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},tenantId:{type:"string"},name:{type:"string"},isAdmin:{type:"boolean"},permissions:{type:"array",items:{type:"string"}}}},SealTenant:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},name:{type:"string"},tenantSlug:{type:"string"}}},WhoamiResponse:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}},SessionResponse:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}},ApprovalRule:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}},ApprovalRuleInput:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulePatch:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulesResponse:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}},RuleSetVersion:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}},PublishRuleVersionRequest:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}},ApprovalDocument:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},t Line truncated
`}},parameters:{CorpId:{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},Offset:{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},Limit:{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},RuleId:{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."},VersionId:{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."},DocumentId:{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."},RecordId:{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."},BatchId:{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}},responses:{BadRequest:{description:"Invalid request.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},Unauthorized:{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},NotFound:{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}},schemas:{ErrorResponse:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}},CorpSummary:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}},SwitchCorpRequest:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}},SwitchCorpResponse:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}},SourceConfig:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."},AuthStage:{type:"object",additionalProperties:!0,required:["name","ok"],properties:{name:{type:"string",examples:["hose.openapi","hose.provisional","seal.sso","seal.whoami"]},ok:{type:"boolean"},error:{type:"string"}}},AuthDiagnosis:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}},SealUser:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},tenantId:{type:"string"},name:{type:"string"},isAdmin:{type:"boolean"},permissions:{type:"array",items:{type:"string"}}}},SealTenant:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},name:{type:"string"},tenantSlug:{type:"string"}}},WhoamiResponse:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}},SessionResponse:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}},ApprovalRule:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}},ApprovalRuleInput:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulePatch:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulesResponse:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}},RuleSetVersion:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}},PublishRuleVersionRequest:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}},ApprovalDocument:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},t Line truncated
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Seal Home API Docs (v${B1})</title>
<title>Seal Home API Docs (v${P1})</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>\uD83E\uDDAD</text></svg>" />
<style>
body {
@@ -2647,22 +2650,22 @@ do not control.
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
></script>
</body>
</html>`}var JS0=o(()=>{t9()});import{URL as Hg1}from"node:url";async function _6($,Y,z,U){let I=$.handler;return I(Y,z,{corp:U})}async function KS0($,Y){if(Y.setHeader("Access-Control-Allow-Origin","*"),Y.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),Y.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){Y.writeHead(204),Y.end();return}let z=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",I=new Hg1($.url||"/",`${U}://${z}`),Q=I.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Q==="/"){P4(Y,200,{name:"seal-use",version:B1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(J==="GET"&&Q==="/docs"){Zg1(Y,200,QS0());return}if(J==="GET"&&Q==="/openapi.json"){P4(Y,200,jT());return}if(J==="GET"&&Q==="/health"){P4(Y,200,{status:"ok",version:B1,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Q==="/shutdown"||Q==="/api/shutdown")){P4(Y,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(J==="POST"&&Q==="/api/cli"){let K=await CT($),G=(typeof K?.command==="string"?K.command:"").trim();if(!G){ET(Y,400,"Missing 'command' property in request body");return}let W=Aq(G),H=W[0]==="seal-use"||W[0]==="seal-home"||W[0]?.endsWith("/seal-use")||W[0]?.endsWith("/seal-home")?W.slice(1):W,X=await Tq(H),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}P4(Y,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(J==="POST"&&Q.startsWith("/api/tool/")){let K=Q.slice(10).trim(),G=M6(K);if(!G){ET(Y,404,`Tool not found: '${K}'`);return}let W=await CT($)||{},H=k8($,I,W),X=E1(H),Z=await j1(X),q={...W};delete q.corp;let V=await _6(G,Z,q,X);P4(Y,200,V);return}if(Q.startsWith("/v1/")){if(await Xg1($,Y,J,Q,I))return}ET(Y,404,`Cannot ${J} ${Q}. Visit /docs for available endpoints.`)}catch(K){let G=K instanceof Error?K.message:String(K);ET(Y,500,G)}}async function Xg1($,Y,z,U,I){let Q=Object.fromEntries(I.searchParams.entries());if(z==="GET"&&U==="/v1/corps"){let J=s8(),K=_4();return P4(Y,200,{count:J.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:J.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(z==="GET"&&U==="/v1/whoami"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_whoami"),H=await _6(W,G,{},K);return P4(Y,200,H),!0}if(z==="GET"&&U==="/v1/session"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_session_get"),H=await _6(W,G,{},K);return P4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/summary"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_approval_runs_summary"),H=await _6(W,G,Q,K);return P4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/stats"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_approval_runs_stats"),H=await _6(W,G,Q,K);return P4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/pick"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_approval_run_pick"),H=await _6(W,G,Q,K);return P4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/url"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_approval_run_url_get"),H=await _6(W,G,Q,K);return P4(Y,200,H),!0}if(U.startsWith("/v1/approval-runs/")){let J=U.slice(18).split("/"),K=J[0],G=J[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let W=k8($,I,Q),H=E1(W),X=await j1(H);if(!G){let Z=M6("seal_approval_run_get"),q=await _6(Z,X,{recordId:K,...Q},H);return P4(Y,200,q),!0}if(G==="attachments"){let Z=M6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:K,...Q},H);return P4(Y,200,q),!0}if(G==="cited-rules"){let Z=M6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:K,...Q},H);return P4(Y,200,q),!0}if(G==="document-summary"){let Z=M6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:K,...Q},H);return P4(Y,200,q),!0}if(G==="result"){let Z=M6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:K,...Q},H);return P4(Y,200,q),!0}}}if(z==="GET"&&U==="/v1/approval-runs"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_approval_runs_search"),H=await _6(W,G,{...Q,limit:Q.limit?Number(Q.limit):void 0,offset:Q.offset?Number(Q.offset):void 0,includeBridge:Q.includeBridge==="true"},K);return P4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval/rules"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_approval_rules_list"),H=await _6(W,G,Q,K);return P4(Y,200,H),!0}if(z==="GET"&&U==="/v1/simulation/batches"){let J=k8($,I,Q),K=E1(J),G=await j1(K),W=M6("seal_simulation_batches_list"),H=await _6(W,G,Q,K);return P4(Y,200,H),!0}if(z==="POST"&&U==="/v1/simulation/create-batchLine truncated
\uD83D\uDE80 seal-use HTTP Server (v${B1}) started`),console.error(` URL: http://${z}:${Y}`),console.error(` Docs: http://${z}:${Y}/docs`),console.error(` OpenAPI: http://${z}:${Y}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${Y}/api/cli`),console.error(` REST API: http://${z}:${Y}/v1/...
`);I(U)})})}var RT=8787,_T="127.0.0.1";var sl=o(()=>{GS0();t9()});async function WS0($){let Y=s0($.options.port)??s0($.options.p),z=S($.options.host)??S($.options.h),U=await vT({port:Y,host:z}),I=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",I),process.on("SIGTERM",I),await new Promise(()=>{})}var HS0=o(()=>{D4();sl()});async function XS0($,Y,z,U){if($==="config"||$==="get"){await k0("seal_llm_config_get",Y,z,{},C0(U.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",Y,z,{},C0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var ZS0=o(()=>{o4();Q4()});async function qS0($,Y){if($==="config"||$==="json"){al();return}let{startServer:z}=await FS0().then(() => LS0);z()}function al(){c0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var VS0=o(()=>{Q4()});function wS0($){let Y=jT();c0(Y,{...C0($.options),allowFull:!0})}var MS0=o(()=>{ol();Q4()});async function OS0($,Y,z,U){if($==="available"){await k0("seal_permissions_available_list",Y,z,{},C0(U.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",Y,z,{},C0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var NS0=o(()=>{o4();Q4()});import{readFileSync as DS0}from"node:fs";async function PS0($,Y,z,U,I,Q,J){if(!$||$==="get"){await k0("seal_preference_get",I,Q,{},C0(J.options));return}if($==="decision"){if(Y==="update"||!Y){let K=S(J.options.input),G=K?JSON.parse(DS0(K,"utf8")):y8(J.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",I,Q,{...G,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(Y==="set"){let K=S(J.options.default)??S(J.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",I,Q,{defaultLevel:K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}if(Y==="policies"){if(z==="list"||!z){await k0("seal_preference_thinking_depth_policies_list",I,Q,{},C0(J.options));return}if(z==="upsert"){let K=S(J.options.input),G=K?JSON.parse(DS0(K,"utf8")):y8(J.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",I,Q,{...G,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}if(z==="remove"||z==="delete"){let K=U??S(J.options.id)??S(J.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",I,Q,{policyId:K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var BS0=o(()=>{o4();D4();Q4()});async function AS0($={}){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},h3());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let I=await SK(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(I,null,2));let Q=await j1(U),J=await qM(Q,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:J.rules.rules.length,hasPendingRuleDeletes:J.rules.hasPendingDeletes,documents:J.documents.articles.length,documentsTotal:J.documents.total,stylePreferences:J.stylePreferences.ok?"ok":`error: ${J.stylePreferences.error}`},null,2))}var TS0=o(()=>{S3();i8();PT();X6()});async function jS0($,Y,z){let U=Y??S(z.options.corp)??($&&$!=="--corp"?$:void 0);await AS0({corpId:U})}var ES0=o(()=>{TS0();D4()});async function tl($,Y,z,U,I){if($==="count"){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(I.options));return}if($==="list"){if(V0(I.options.count)){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(I.options));return}let Q=s0(I.options.limit),J=s0(I.options.offset);if(V0(I.options.summary)){await k0("seal_approval_rules_list",z,U,{fields:eR0,limit:Q,offset:J},C0(I.options));return}let K=await o2("seal_approval_rules_list",z,U,{limit:Q,offset:J});$_0(K,V0(I.options.full)===!0),c0(K);return}if($==="clear"){let Q=V0(I.options.yes)===!0,J=V0(I.options.dryRun)??V0(I.options["dry-run"])??!Q;if(!Q&&!J)throw D9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${U.id} --dry-run`);let K=await o2("seal_approval_rules_clear",z,U,{dryRun:J,recode:V0(I.options.recode)});if(!Q&&J&&K&&typeof K==="object"){c0({...K, Line truncated
`).filter(Boolean),Q=I.slice(-Y);return{logFile:z,lines:Q,totalLines:I.length}}async function Mg1($){let Y=yT($),z=Yo($),U=jq($);hS0($.stateDir);let I=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):RT),Q=$.host??(process.env.HOST?process.env.HOST:_T);ST(Y,`${process.pid}
`,{mode:384}),ST(z,JSON.stringify({pid:process.pid,port:I,host:Q,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),gK(U,`service starting on http://${Q}:${I} pid=${process.pid}`);let J=null;try{J=await vT({port:I,host:Q,silent:!0}),gK(U,`service listening pid=${process.pid}`)}catch(G){if(gK(U,`service failed to bind port ${I}: ${G instanceof Error?G.message:String(G)}`),gT(Y)===process.pid)v9(Y,{force:!0}),v9(z,{force:!0});throw G}let K=()=>{if(J)J.close(),J=null;if(gT(Y)===process.pid)v9(Y,{force:!0}),v9(z,{force:!0});gK(U,`stopped pid=${process.pid}`)};await new Promise((G)=>{let W=!1,H=()=>{if(W)return;W=!0,K(),process.off("SIGTERM",H),process.off("SIGINT",H),G()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function RS0($){hS0($.stateDir);let Y=yK($);if(Y.running)return Y;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...z.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let I=Vg1(z.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});I.unref();let Q=yT($);return ST(Q,`${I.pid}
`,{mode:384}),gK(jq($),`started pid=${I.pid}`),{started:!0,...yK($)}}function _S0($,Y={}){let z=yT($),U=Yo($),I=gT(z);if(!I||!vS0(I,$.appRoot))return v9(z,{force:!0}),v9(U,{force:!0}),Y.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(I,"SIGTERM"),v9(z,{force:!0}),v9(U,{force:!0}),gK(jq($),`stop requested pid=${I}`),Y.quiet?void 0:{stopped:!0,pid:I}}function vS0($,Y){if(!Og1($))return!1;try{let z=Lg1("ps",["-p",String($),"-o","command="],{encoding:"utf8"}),U=z.trim().split(/\s+/).filter(Boolean),I=U.indexOf("service"),Q=I!==-1&&U[I+1]==="run",J=z.includes(Y)||U.some((K)=>/(^|[\\/])(seal-use|seal-home)(\.exe)?$/.test(K));return Q&&J}catch{return!1}}function Og1($){try{return process.kill($,0),!0}catch{return!1}}function yT($){return $o($.stateDir,"service.pid")}function Yo($){return $o($.stateDir,"service.json")}function jq($){return $o($.stateDir,"service.log")}function gT($){if(!hT($))return;let Y=Number(el($,"utf8").trim());return Number.isInteger(Y)&&Y>0?Y:void 0}function hS0($){Fg1($,{recursive:!0,mode:448})}function gK($,Y){ST($,`${new Date().toISOString()} ${Y}
`,{flag:"a",mode:384})}var zo=o(()=>{sl()});import{homedir as Ng1}from"node:os";import{join as Dg1}from"node:path";async function Io($,Y,z){let U=z?s0(z.options.port)??s0(z.options.p):void 0,I=z?S(z.options.host)??S(z.options.h):void 0,Q=z?s0(z.options.lines)??s0(z.options.n):void 0,J=await SU($,{appRoot:Y.appRoot,entryFile:Y.entryFile,stateDir:Uo,version:B1,launcher:Y.launcher,port:U,host:I},{maxLines:Q});if(J!==void 0)c0(J)}var Uo;var Qo=o(()=>{t9();zo();Q4();D4();Uo=Dg1(Ng1(),".config","seal-use")});import{existsSync as Pg1,readFileSync as SS0}from"node:fs";async function gS0($,Y,z,U,I){if($==="batch-records"||$==="records"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",z,U,{batchId:Q,query:S(I.options.query)},C0(I.options));return}if($==="create"||$==="run"){let Q=S(I.options.mode)??S(I.options.sourceSystem)??S(I.options["source-system"])??"hosecloud",J=Q==="material-pack"?"material_pack":Q,K=S(I.options.schemaConfig)??S(I.options["schema-config"]),G=K?JSON.parse(SS0(K,"utf8")):void 0,W=S(I.options.input),H=W?JSON.parse(SS0(W,"utf8")):y8(I.json),X=S(I.options.packageId)??S(I.options["package-id"]),Z=u6(I.options.packageIds)??u6(I.options["package-ids"])??(X?[X]:void 0),q=u6(I.options.flowIds)??u6(I.options["flow-ids"])??u6(I.options.documentSn)??u6(I.options["document-sn"]),V=S(I.options.signKey)??S(I.options["sign-key"])??S(I.options.integration),F=V0(I.options.noWait)??V0(I.options["no-wait"]);await k0("seal_simulation_batch_create",z,U,{mode:J,sourceSystem:J,flowIds:q,documentSn:q,rejectNodeName:S(I.options.rejectNode)??S(I.options["reject-node"])??null,thinkingDepthOverride:S(I.options.thinkingDepth)??S(I.options["thinking-depth"]),skipInvoiceGeneration:V0(I.options.skipInvoiceGeneration)??V0(I.options["skip-invoice-generation"]),skipExpenseExtraction:V0(I.options.skipExpenseExtraction)??V0(I.options["skip-expense-extraction"]),disableAttachmentCache:V0(I.options.disableAttachmentCache)??V0(I.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:S(I.options.templateId)??S(I.options["template-id"]),schemaConfig:G,requestIds:u6(I.options.requestIds)??u6(I.options["request-ids"]),workflowTypeId:S(I.options.workflowTypeId)??S(I.options["workflow-type-id"]),flowStatusList:u6(I.options.flowStatusList)?.map(Number)??u6(I.options["flow-status-list"])?.map(Number),businessCodes:u6(I.options.businessCodes)??u6(I.options["business-codes"]),documentType:S(I.options.documentType)??S(I.options["document-type"]),startTime:s0(I.options.startTime)??s0(I.options["start-time"]),endTime:s0(I.options.endTime)??s0(I.options["end-time"]),status:u6(I.options.status),limit:s0(I.options.limit),noWait:F,rawParams:H},C0(I.options));return}if($==="wait"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",z,U,{batchId:Q,timeout:S(I.options.timeout),pollInterval:S(I.options.pollInterval)??S(I.options["poll-interval"])},C0(I.options));return}if($==="status"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",z,U,{batchId:Q},C0(I.options));return}if($==="clean"||$==="delete"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",z,U,{batchId:Q},C0(I.options));return}if($==="specifications"){let Q=Y??S(I.options.integration)??S(I.options.signKey)??S(I.options["sign-key"]);await k0("seal_simulation_specifications_list",z,U,{signKey:Q},C0(I.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",z,U,{},C0(I.options));return}if($==="list"){await k0("seal_simulation_batches_list",z,U,{limit:s0(I.options.limit)},C0(I.options));return}if($==="get"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",z,U,{batchId:Q},C0(I.options));return}if($==="templates"){await k0("seal_simulation_templates_get",z,U,{},C0(I.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",z,U,{},C0(I.options));return}if($==="package-upload"){let Q=Y??S(I.options.file);if(!Q)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!Pg1(Q))throw Error(`File not found: ${Q}`);await k0("seal_simulation_material_package_upload",z,U,{filePath:Q},C0(I.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var yS0=o(()=>{o4();D4();Q4()});import{existsSync as kS0}from"node:fs";import{join as kT}from"node:path";function xS0($,Y,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${clLine truncated
`);return}if($==="install"||$==="init"||$==="sync"){let U=V0(z.options.local)||V0(z.options.workspace),I=S(z.options.dir)??S(z.options.target)??Y,Q=I?I:U?kT(process.cwd(),".agents","skills","seal-use"):hU(),J=dh0(Q);c0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let U=hU(),I=kT(process.cwd(),".agents","skills","seal-use");c0({global:{dir:U,installed:kS0(kT(U,"SKILL.md"))},local:{dir:I,installed:kS0(kT(I,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var fS0=o(()=>{Bq();D4();Q4()});async function uS0($,Y){if($==="config"){c0(await SK(Y));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var bS0=o(()=>{PT();Q4()});function Jo($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let Y=$.toUpperCase().trim();if(Y==="APPROVE"||Y==="PASS")return"APPROVE";if(Y==="REJECT"||Y==="DENIED")return"REJECT";if(Y==="MANUAL"||Y==="ASSISTED")return"MANUAL";if(Y==="ERROR"||Y==="FAILED")return"ERROR";return Y}async function iS0($){let{sourceCorp:Y,targetCorp:z,sourceClient:U,targetClient:I,samples:Q=10,dryRun:J=!1,pollIntervalMs:K=2000,timeoutMs:G=45000,snPrefix:W="REG_",fetchFn:H=fetch}=$;if(z.environment!=="test")throw new w4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);let X=await bY(I),q=(Array.isArray(X.features)?X.features:[]).find((d)=>d?.code==="ai-approval"),V=typeof q?.balance==="number"?q.balance:0,F=typeof q?.deductionAmount==="number"&&q.deductionAmount>0?q.deductionAmount:120,M=Q*F;if(V<M)throw new w4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${V} 点,本次回归抽样 ${Q} 笔需要约 ${M} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let w=await b4(U,{limit:Q,status:"completed"}),O=Array.isArray(w.records)?w.records:[];if(O.length===0){let d=await b4(U,{limit:Q});O=Array.isArray(d.records)?d.records:[]}if(O.length===0)throw new w4(`在母企业「${Y.name}」(${Y.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(O=O.slice(0,Q),J){let d=O.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=Jo(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let D=await Yp(I,z),N=[];for(let d of O){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=Jo(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await G4(U,d.id),y=`${W}${$0}`,s=en(e,{snPrefix:W,docIdPrefix:W});await $p(D.incomingDocumentWebhook.url,D.secret,s,H,P6(z.seal));let Y0=null,M0=Date.now();while(Date.now()-M0<G){await new Promise((H0)=>setTimeout(H0,K));let a=await b4(I,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let H0=a.records[0];if(H0.status==="completed"||H0.status==="failed"){Y0=H0;break}}}if(!Y0){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=Jo(Y0?.result?.decision??Y0.aiDecision??Y0?.decision??(Y0.status==="completed"?"APPROVE":"ERROR")),G0=Y0?.result?.summary??Y0.aiSummary,T0=g===E0,b0=T0?"MATCHED":"FLIPPED",Y1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:Y0.id,testDecision:E0,testSummary:G0,status:b0,durationMs:Date.now()-t};if(!T0)Y1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};N.push(Y1)}catch(e){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let A=N.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=N.filter((d)=>d.status==="MATCHED"),P=N.filter((d)=>d.status==="FLIPPED"),j=N.filter((d)=>d.status==="FAILED").length,C=T.length,b=P.length,k=C+b,h=k>0?C/k:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",U0=!i&&j===0,x;try{let d=await bY(I),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")x=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:U0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M,balanceAfter:x},metrics:{sampleCount:N.length,successCount:A.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(h.toFixed(4))},flips:P,records:N}}function cS0($){let{sourceCorp:Y,targetCorp:z,verdict:U,safeToPublish:I,metrics:Q,quota:J,flips:K,records:G}=$,W=U==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":U==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",H=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${Y.name}」-> 测试靶场「${z.name}」`,` 判定: ${W} · 准许发布: ${I?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${Q.sampleCount} | 一致通过: ${Q.matchCount} | 决策翻转: ${Q.flipCount} | 异常失败: ${Q.failureCount}`,` 一致率: ${(Q.concordanceRate*100).toFixed(1)}% | 消耗预估: ${J.estimatedRequired} 点 (余量: ${J.balanceBefore}${J.balanceAfter!==void 0?` -> ${J.balanceAfter}`:""})`," "+"─".repeat(65)];if(K.length>0){H.push(` ⚠️ 决策翻转清单 (${K.length} 笔单据在新规则下结果改变):`);for(let X of K)if(H.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)H.push(` 理由差异: ${X.diff.reasonDiff}`);H.push(" "+"─".repeat(65)),H.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(U==="CLEAN")H.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% 吻合,无任 Line truncated
`)}var nS0=o(()=>{L$();X6();_Z()});async function Ko($,Y,z){let U=($??Y??"regression").toLowerCase();if(U==="regression"||U==="regress"||U==="matrix"){let I=S(z.options.corp)??(Y&&Y!==U?Y:void 0),Q=E1(I),J=Q,K=Q;if(Q.environment==="test"){K=Q;let O=S(z.options["prod-corp"])??S(z.options.prod)??Q.prodCorpId;if(!O)throw new w4(`测试企业「${Q.name}」(${Q.id}) 未绑定生产母企业,无法拉取历史样本。
</html>`}var RS0=o(()=>{t9()});import{URL as ig1}from"node:url";async function _6($,Y,z,U){let I=$.handler;return I(Y,z,{corp:U})}async function _S0($,Y){if(Y.setHeader("Access-Control-Allow-Origin","*"),Y.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),Y.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){Y.writeHead(204),Y.end();return}let z=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",I=new ig1($.url||"/",`${U}://${z}`),Q=I.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Q==="/"){A4(Y,200,{name:"seal-use",version:P1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(J==="GET"&&Q==="/docs"){ng1(Y,200,CS0());return}if(J==="GET"&&Q==="/openapi.json"){A4(Y,200,vT());return}if(J==="GET"&&Q==="/health"){A4(Y,200,{status:"ok",version:P1,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Q==="/shutdown"||Q==="/api/shutdown")){A4(Y,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(J==="POST"&&Q==="/api/cli"){let K=await ST($),G=(typeof K?.command==="string"?K.command:"").trim();if(!G){hT(Y,400,"Missing 'command' property in request body");return}let H=Rq(G),W=H[0]==="seal-use"||H[0]==="seal-home"||H[0]?.endsWith("/seal-use")||H[0]?.endsWith("/seal-home")?H.slice(1):H,X=await _q(W),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}A4(Y,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(J==="POST"&&Q.startsWith("/api/tool/")){let K=Q.slice(10).trim(),G=M6(K);if(!G){hT(Y,404,`Tool not found: '${K}'`);return}let H=await ST($)||{},W=k8($,I,H),X=E1(W),Z=await j1(X),q={...H};delete q.corp;let V=await _6(G,Z,q,X);A4(Y,200,V);return}if(Q.startsWith("/v1/")){if(await cg1($,Y,J,Q,I))return}hT(Y,404,`Cannot ${J} ${Q}. Visit /docs for available endpoints.`)}catch(K){let G=K instanceof Error?K.message:String(K);hT(Y,500,G)}}async function cg1($,Y,z,U,I){let Q=Object.fromEntries(I.searchParams.entries());if(z==="GET"&&U==="/v1/corps"){let J=s8(),K=_4();return A4(Y,200,{count:J.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:J.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(z==="GET"&&U==="/v1/whoami"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_whoami"),W=await _6(H,G,{},K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/session"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_session_get"),W=await _6(H,G,{},K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/summary"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_runs_summary"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/stats"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_runs_stats"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/pick"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_run_pick"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/url"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_run_url_get"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(U.startsWith("/v1/approval-runs/")){let J=U.slice(18).split("/"),K=J[0],G=J[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let H=k8($,I,Q),W=E1(H),X=await j1(W);if(!G){let Z=M6("seal_approval_run_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="attachments"){let Z=M6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="cited-rules"){let Z=M6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="document-summary"){let Z=M6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="result"){let Z=M6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}}}if(z==="GET"&&U==="/v1/approval-runs"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_runs_search"),W=await _6(H,G,{...Q,limit:Q.limit?Number(Q.limit):void 0,offset:Q.offset?Number(Q.offset):void 0,includeBridge:Q.includeBridge==="true"},K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval/rules"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_rules_list"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/simulation/batches"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_simulation_batches_list"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="POST"&&U==="/v1/simulation/create-batchLine truncated
\uD83D\uDE80 seal-use HTTP Server (v${P1}) started`),console.error(` URL: http://${z}:${Y}`),console.error(` Docs: http://${z}:${Y}/docs`),console.error(` OpenAPI: http://${z}:${Y}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${Y}/api/cli`),console.error(` REST API: http://${z}:${Y}/v1/...
`);I(U)})})}var gT=8787,yT="127.0.0.1";var Wo=o(()=>{vS0();t9()});async function hS0($){let Y=s0($.options.port)??s0($.options.p),z=S($.options.host)??S($.options.h),U=await kT({port:Y,host:z}),I=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",I),process.on("SIGTERM",I),await new Promise(()=>{})}var SS0=o(()=>{D4();Wo()});async function gS0($,Y,z,U){if($==="config"||$==="get"){await k0("seal_llm_config_get",Y,z,{},C0(U.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",Y,z,{},C0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var yS0=o(()=>{o4();Q4()});async function kS0($,Y){if($==="config"||$==="json"){Xo();return}let{startServer:z}=await uS0().then(() => fS0);z()}function Xo(){c0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var xS0=o(()=>{Q4()});function bS0($){let Y=vT();c0(Y,{...C0($.options),allowFull:!0})}var iS0=o(()=>{Go();Q4()});async function cS0($,Y,z,U){if($==="available"){await k0("seal_permissions_available_list",Y,z,{},C0(U.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",Y,z,{},C0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var nS0=o(()=>{o4();Q4()});import{readFileSync as pS0}from"node:fs";async function dS0($,Y,z,U,I,Q,J){if(!$||$==="get"){await k0("seal_preference_get",I,Q,{},C0(J.options));return}if($==="decision"){if(Y==="update"||!Y){let K=S(J.options.input),G=K?JSON.parse(pS0(K,"utf8")):y8(J.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",I,Q,{...G,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(Y==="set"){let K=S(J.options.default)??S(J.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",I,Q,{defaultLevel:K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}if(Y==="policies"){if(z==="list"||!z){await k0("seal_preference_thinking_depth_policies_list",I,Q,{},C0(J.options));return}if(z==="upsert"){let K=S(J.options.input),G=K?JSON.parse(pS0(K,"utf8")):y8(J.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",I,Q,{...G,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}if(z==="remove"||z==="delete"){let K=U??S(J.options.id)??S(J.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",I,Q,{policyId:K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var mS0=o(()=>{o4();D4();Q4()});async function lS0($={}){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},h3());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let I=await yK(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(I,null,2));let Q=await j1(U),J=await MM(Q,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:J.rules.rules.length,hasPendingRuleDeletes:J.rules.hasPendingDeletes,documents:J.documents.articles.length,documentsTotal:J.documents.total,stylePreferences:J.stylePreferences.ok?"ok":`error: ${J.stylePreferences.error}`},null,2))}var oS0=o(()=>{S3();i8();ET();X6()});async function rS0($,Y,z){let U=Y??S(z.options.corp)??($&&$!=="--corp"?$:void 0);await lS0({corpId:U})}var sS0=o(()=>{oS0();D4()});async function Zo($,Y,z,U,I){if($==="count"){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(I.options));return}if($==="list"){if(V0(I.options.count)){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(I.options));return}let Q=s0(I.options.limit),J=s0(I.options.offset);if(V0(I.options.summary)){await k0("seal_approval_rules_list",z,U,{fields:q_0,limit:Q,offset:J},C0(I.options));return}let K=await o2("seal_approval_rules_list",z,U,{limit:Q,offset:J});V_0(K,V0(I.options.full)===!0),c0(K);return}if($==="clear"){let Q=V0(I.options.yes)===!0,J=V0(I.options.dryRun)??V0(I.options["dry-run"])??!Q;if(!Q&&!J)throw D9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${U.id} --dry-run`);let K=await o2("seal_approval_rules_clear",z,U,{dryRun:J,recode:V0(I.options.recode)});if(!Q&&J&&K&&typeof K==="object"){c0({...K, Line truncated
`).filter(Boolean),Q=I.slice(-Y);return{logFile:z,lines:Q,totalLines:I.length}}async function rg1($){let Y=bT($),z=Lo($),U=vq($);Yg0($.stateDir);let I=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):gT),Q=$.host??(process.env.HOST?process.env.HOST:yT);fT(Y,`${process.pid}
`,{mode:384}),fT(z,JSON.stringify({pid:process.pid,port:I,host:Q,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),xK(U,`service starting on http://${Q}:${I} pid=${process.pid}`);let J=null;try{J=await kT({port:I,host:Q,silent:!0}),xK(U,`service listening pid=${process.pid}`)}catch(G){if(xK(U,`service failed to bind port ${I}: ${G instanceof Error?G.message:String(G)}`),uT(Y)===process.pid)v9(Y,{force:!0}),v9(z,{force:!0});throw G}let K=()=>{if(J)J.close(),J=null;if(uT(Y)===process.pid)v9(Y,{force:!0}),v9(z,{force:!0});xK(U,`stopped pid=${process.pid}`)};await new Promise((G)=>{let H=!1,W=()=>{if(H)return;H=!0,K(),process.off("SIGTERM",W),process.off("SIGINT",W),G()};process.once("SIGTERM",W),process.once("SIGINT",W)})}function tS0($){Yg0($.stateDir);let Y=fK($);if(Y.running)return Y;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...z.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let I=dg1(z.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});I.unref();let Q=bT($);return fT(Q,`${I.pid}
`,{mode:384}),xK(vq($),`started pid=${I.pid}`),{started:!0,...fK($)}}function eS0($,Y={}){let z=bT($),U=Lo($),I=uT(z);if(!I||!$g0(I,$.appRoot))return v9(z,{force:!0}),v9(U,{force:!0}),Y.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(I,"SIGTERM"),v9(z,{force:!0}),v9(U,{force:!0}),xK(vq($),`stop requested pid=${I}`),Y.quiet?void 0:{stopped:!0,pid:I}}function $g0($,Y){if(!sg1($))return!1;try{let z=mg1("ps",["-p",String($),"-o","command="],{encoding:"utf8"}),U=z.trim().split(/\s+/).filter(Boolean),I=U.indexOf("service"),Q=I!==-1&&U[I+1]==="run",J=z.includes(Y)||U.some((K)=>/(^|[\\/])(seal-use|seal-home)(\.exe)?$/.test(K));return Q&&J}catch{return!1}}function sg1($){try{return process.kill($,0),!0}catch{return!1}}function bT($){return Vo($.stateDir,"service.pid")}function Lo($){return Vo($.stateDir,"service.json")}function vq($){return Vo($.stateDir,"service.log")}function uT($){if(!xT($))return;let Y=Number(qo($,"utf8").trim());return Number.isInteger(Y)&&Y>0?Y:void 0}function Yg0($){lg1($,{recursive:!0,mode:448})}function xK($,Y){fT($,`${new Date().toISOString()} ${Y}
`,{flag:"a",mode:384})}var Fo=o(()=>{Wo()});import{homedir as ag1}from"node:os";import{join as tg1}from"node:path";async function Mo($,Y,z){let U=z?s0(z.options.port)??s0(z.options.p):void 0,I=z?S(z.options.host)??S(z.options.h):void 0,Q=z?s0(z.options.lines)??s0(z.options.n):void 0,J=await yU($,{appRoot:Y.appRoot,entryFile:Y.entryFile,stateDir:wo,version:P1,launcher:Y.launcher,port:U,host:I},{maxLines:Q});if(J!==void 0)c0(J)}var wo;var Oo=o(()=>{t9();Fo();Q4();D4();wo=tg1(ag1(),".config","seal-use")});import{existsSync as eg1,readFileSync as zg0}from"node:fs";async function Ug0($,Y,z,U,I){if($==="batch-records"||$==="records"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",z,U,{batchId:Q,query:S(I.options.query)},C0(I.options));return}if($==="create"||$==="run"){let Q=S(I.options.mode)??S(I.options.sourceSystem)??S(I.options["source-system"])??"hosecloud",J=Q==="material-pack"?"material_pack":Q,K=S(I.options.schemaConfig)??S(I.options["schema-config"]),G=K?JSON.parse(zg0(K,"utf8")):void 0,H=S(I.options.input),W=H?JSON.parse(zg0(H,"utf8")):y8(I.json),X=S(I.options.packageId)??S(I.options["package-id"]),Z=u6(I.options.packageIds)??u6(I.options["package-ids"])??(X?[X]:void 0),q=u6(I.options.flowIds)??u6(I.options["flow-ids"])??u6(I.options.documentSn)??u6(I.options["document-sn"]),V=S(I.options.signKey)??S(I.options["sign-key"])??S(I.options.integration),F=V0(I.options.noWait)??V0(I.options["no-wait"]);await k0("seal_simulation_batch_create",z,U,{mode:J,sourceSystem:J,flowIds:q,documentSn:q,rejectNodeName:S(I.options.rejectNode)??S(I.options["reject-node"])??null,thinkingDepthOverride:S(I.options.thinkingDepth)??S(I.options["thinking-depth"]),skipInvoiceGeneration:V0(I.options.skipInvoiceGeneration)??V0(I.options["skip-invoice-generation"]),skipExpenseExtraction:V0(I.options.skipExpenseExtraction)??V0(I.options["skip-expense-extraction"]),disableAttachmentCache:V0(I.options.disableAttachmentCache)??V0(I.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:S(I.options.templateId)??S(I.options["template-id"]),schemaConfig:G,requestIds:u6(I.options.requestIds)??u6(I.options["request-ids"]),workflowTypeId:S(I.options.workflowTypeId)??S(I.options["workflow-type-id"]),flowStatusList:u6(I.options.flowStatusList)?.map(Number)??u6(I.options["flow-status-list"])?.map(Number),businessCodes:u6(I.options.businessCodes)??u6(I.options["business-codes"]),documentType:S(I.options.documentType)??S(I.options["document-type"]),startTime:s0(I.options.startTime)??s0(I.options["start-time"]),endTime:s0(I.options.endTime)??s0(I.options["end-time"]),status:u6(I.options.status),limit:s0(I.options.limit),noWait:F,rawParams:W},C0(I.options));return}if($==="wait"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",z,U,{batchId:Q,timeout:S(I.options.timeout),pollInterval:S(I.options.pollInterval)??S(I.options["poll-interval"])},C0(I.options));return}if($==="status"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",z,U,{batchId:Q},C0(I.options));return}if($==="clean"||$==="delete"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",z,U,{batchId:Q},C0(I.options));return}if($==="specifications"){let Q=Y??S(I.options.integration)??S(I.options.signKey)??S(I.options["sign-key"]);await k0("seal_simulation_specifications_list",z,U,{signKey:Q},C0(I.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",z,U,{},C0(I.options));return}if($==="list"){await k0("seal_simulation_batches_list",z,U,{limit:s0(I.options.limit)},C0(I.options));return}if($==="get"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",z,U,{batchId:Q},C0(I.options));return}if($==="templates"){await k0("seal_simulation_templates_get",z,U,{},C0(I.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",z,U,{},C0(I.options));return}if($==="package-upload"){let Q=Y??S(I.options.file);if(!Q)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!eg1(Q))throw Error(`File not found: ${Q}`);await k0("seal_simulation_material_package_upload",z,U,{filePath:Q},C0(I.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var Ig0=o(()=>{o4();D4();Q4()});import{existsSync as Qg0}from"node:fs";import{join as iT}from"node:path";function Jg0($,Y,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${zoLine truncated
`);return}if($==="install"||$==="init"||$==="sync"){let U=V0(z.options.local)||V0(z.options.workspace),I=S(z.options.dir)??S(z.options.target)??Y,Q=I?I:U?iT(process.cwd(),".agents","skills","seal-use"):gU(),J=VS0(Q),K=!U&&!I,G=K?ol():void 0,H=K?al():void 0;c0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files,...G?{antigravity:G}:{},...H?{hosts:H}:{}});return}if($==="status"||$==="get"||!$){let U=gU(),I=iT(process.cwd(),".agents","skills","seal-use"),Q=rl(),J=tl();c0({global:{dir:U,installed:Qg0(iT(U,"SKILL.md"))},local:{dir:I,installed:Qg0(iT(I,"SKILL.md"))},antigravity:Q,hosts:J});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var Kg0=o(()=>{$o();Cq();D4();Q4()});async function Gg0($,Y){if($==="config"){c0(await yK(Y));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var Hg0=o(()=>{ET();Q4()});function No($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let Y=$.toUpperCase().trim();if(Y==="APPROVE"||Y==="PASS")return"APPROVE";if(Y==="REJECT"||Y==="DENIED")return"REJECT";if(Y==="MANUAL"||Y==="ASSISTED")return"MANUAL";if(Y==="ERROR"||Y==="FAILED")return"ERROR";return Y}async function Wg0($){let{sourceCorp:Y,targetCorp:z,sourceClient:U,targetClient:I,samples:Q=10,dryRun:J=!1,pollIntervalMs:K=2000,timeoutMs:G=45000,snPrefix:H="REG_",fetchFn:W=fetch}=$;if(z.environment!=="test")throw new w4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);let X=await cY(I),q=(Array.isArray(X.features)?X.features:[]).find((d)=>d?.code==="ai-approval"),V=typeof q?.balance==="number"?q.balance:0,F=typeof q?.deductionAmount==="number"&&q.deductionAmount>0?q.deductionAmount:120,M=Q*F;if(V<M)throw new w4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${V} 点,本次回归抽样 ${Q} 笔需要约 ${M} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let w=await b4(U,{limit:Q,status:"completed"}),O=Array.isArray(w.records)?w.records:[];if(O.length===0){let d=await b4(U,{limit:Q});O=Array.isArray(d.records)?d.records:[]}if(O.length===0)throw new w4(`在母企业「${Y.name}」(${Y.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(O=O.slice(0,Q),J){let d=O.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=No(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let D=await Jp(I,z),N=[];for(let d of O){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=No(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await H4(U,d.id),y=`${H}${$0}`,s=Ip(e,{snPrefix:H,docIdPrefix:H});await Qp(D.incomingDocumentWebhook.url,D.secret,s,W,A6(z.seal));let Y0=null,M0=Date.now();while(Date.now()-M0<G){await new Promise((W0)=>setTimeout(W0,K));let a=await b4(I,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let W0=a.records[0];if(W0.status==="completed"||W0.status==="failed"){Y0=W0;break}}}if(!Y0){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=No(Y0?.result?.decision??Y0.aiDecision??Y0?.decision??(Y0.status==="completed"?"APPROVE":"ERROR")),G0=Y0?.result?.summary??Y0.aiSummary,T0=g===E0,b0=T0?"MATCHED":"FLIPPED",Y1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:Y0.id,testDecision:E0,testSummary:G0,status:b0,durationMs:Date.now()-t};if(!T0)Y1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};N.push(Y1)}catch(e){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let B=N.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=N.filter((d)=>d.status==="MATCHED"),A=N.filter((d)=>d.status==="FLIPPED"),j=N.filter((d)=>d.status==="FAILED").length,C=T.length,b=A.length,k=C+b,h=k>0?C/k:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",U0=!i&&j===0,x;try{let d=await cY(I),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")x=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:U0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M,balanceAfter:x},metrics:{sampleCount:N.length,successCount:B.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(h.toFixed(4))},flips:A,records:N}}function Xg0($){let{sourceCorp:Y,targetCorp:z,verdict:U,safeToPublish:I,metrics:Q,quota:J,flips:K,records:G}=$,H=U==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":U==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",W=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${Y.name}」-> 测试靶场「${z.name}」`,` 判定: ${H} · 准许发布: ${I?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${Q.sampleCount} | 一致通过: ${Q.matchCount} | 决策翻转: ${Q.flipCount} | 异常失败: ${Q.failureCount}`,` 一致率: ${(Q.concordanceRate*100).toFixed(1)}% | 消耗预估: ${J.estimatedRequired} 点 (余量: ${J.balanceBefore}${J.balanceAfter!==void 0?` -> ${J.balanceAfter}`:""})`," "+"─".repeat(65)];if(K.length>0){W.push(` ⚠️ 决策翻转清单 (${K.length} 笔单据在新规则下结果改变):`);for(let X of K)if(W.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)W.push(` 理由差异: ${X.diff.reasonDiff}`);W.push(" "+"─".repeat(65)),W.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(U==="CLEAN")W.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% 吻合,无任 Line truncated
`)}var Zg0=o(()=>{L$();X6();SZ()});async function Do($,Y,z){let U=($??Y??"regression").toLowerCase();if(U==="regression"||U==="regress"||U==="matrix"){let I=S(z.options.corp)??(Y&&Y!==U?Y:void 0),Q=E1(I),J=Q,K=Q;if(Q.environment==="test"){K=Q;let O=S(z.options["prod-corp"])??S(z.options.prod)??Q.prodCorpId;if(!O)throw new w4(`测试企业「${Q.name}」(${Q.id}) 未绑定生产母企业,无法拉取历史样本。
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${Q.id}`);J=E1(O)}else{J=Q;let O=S(z.options["test-corp"])??S(z.options.test)??Q.testCorpId;if(!O)throw new w4(`生产企业「${Q.name}」(${Q.id}) 未绑定测试靶场企业。
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Q.id} <testCorpId>`);K=E1(O)}let G=await j1(J),W=await j1(K),H=s0(z.options.samples)??s0(z.options.limit)??s0(z.options.n)??10,X=V0(z.options["dry-run"]),Z=V0(z.options["fail-on-flips"]),q=s0(z.options["poll-interval"])??2000,V=s0(z.options.timeout)??45000,F=S(z.options["sn-prefix"])??"REG_",M=await iS0({sourceCorp:J,targetCorp:K,sourceClient:G,targetClient:W,samples:H,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z});if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(cS0(M));if(c0(M),Z&&!M.ok)throw new w4(`回归测试发现 ${M.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new w4(`未知的 test 子命令: "${U}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var pS0=o(()=>{L$();o4();D4();Q4();i8();nS0()});async function dS0($,Y,z,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,Y,z,y8(U.json),C0(U.options))}var mS0=o(()=>{o4();D4();Q4()});function lS0(){c0(Xq.map(($)=>({name:$.name,description:$.description})))}var oS0=o(()=>{qq();Q4()});function xT($=process.execPath,Y=import.meta.url){if(Y.includes("/$bunfs/")||Y.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var rS0=o(()=>{Bq()});import{chmodSync as Bg1,mkdirSync as Ag1,readdirSync as Tg1,renameSync as Go,rmSync as jg1,unlinkSync as eS0,writeFileSync as sS0}from"node:fs";import{basename as Eg1,dirname as Cg1,join as uT}from"node:path";import{spawnSync as kK}from"node:child_process";async function Yg0($,Y={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Uo,version:B1,launcher:$.launcher},U=Y.repo||process.env[Rg1]?.trim()||process.env[_g1]?.trim()||$g0,I=Y.targetVersion?.trim(),Q=I&&I.toLowerCase()!=="latest"?I:void 0;if(Q){let N=Q.replace(/^v/,""),A=Qg0(N,B1);if(A<0)if(!hS&&Y.force);else{c0({updated:!1,currentVersion:B1,targetVersion:N,mode:xT()?"binary":"source",message:!hS?`Cannot downgrade seal-use from dev build v${B1} to release v${N}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${B1} to older version v${N}. Updates must be forward-only.`});return}if(A===0&&!Y.force){c0({updated:!1,currentVersion:B1,targetVersion:N,mode:xT()?"binary":"source",message:`seal-use is already at version v${B1}. Use --force to reinstall.`});return}}if(Y.changelogOnly){let N=await Wo(U,Y.limit??10);c0({currentVersion:B1,totalQueried:N.length,releases:N.map((A)=>({version:A.version,tagName:A.tagName,publishedAt:A.publishedAt,author:A.author,releaseNotes:A.notes,releaseUrl:A.htmlUrl,isCurrent:A.version===B1,isNewer:Eq(A.version,B1)}))});return}if(!xT()){if(Y.checkOnly){let A=await Wo(U,30),T=A[0],P=T?.version??B1,j=A.find((k)=>k.version===B1),C=Eq(P,B1),b=A.filter((k)=>Eq(k.version,B1));c0({updated:!1,updateAvailable:C,currentVersion:B1,currentVersionPublishedAt:j?.publishedAt,latestVersion:P,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((k)=>({version:k.version,tagName:k.tagName,publishedAt:k.publishedAt,author:k.author,releaseNotes:k.notes,releaseUrl:k.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let N=yK(z).running;if(N)await SU("stop",z);try{tS0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(A){console.error(`git pull skipped: ${A instanceof Error?A.message:String(A)}`)}if(tS0("bun",["install"],{cwd:$.appRoot}),N)await SU("start",z);c0({updated:!0,serviceRestarted:N,version:B1,mode:"source"});return}let J=hg1(),K=Sg1(),G=await Wo(U,30),W=Q?G.find((N)=>N.version===Q||N.tagName===Q||N.tagName===`v${Q}`)??await aS0(U,Q):G[0]??await aS0(U);if(!W){c0({updated:!1,currentVersion:B1,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let H=W.version,X=G.find((N)=>N.version===B1),Z=Eq(H,B1),q=Z||Boolean(Y.force),V=G.filter((N)=>Eq(N.version,B1));if(Y.checkOnly){c0({updated:!1,updateAvailable:Z,currentVersion:B1,currentVersionPublishedAt:X?.publishedAt,latestVersion:H,latestVersionPublishedAt:W.publishedAt,behindCount:V.length,pendingReleases:V.map((N)=>({version:N.version,tagName:N.tagName,publishedAt:N.publishedAt,author:N.author,releaseNotes:N.notes,releaseUrl:N.htmlUrl})),releaseNotes:W.notes,releaseUrl:W.htmlUrl,mode:"binary"});return}if(!q){c0({updated:!1,currentVersion:B1,currentVersionPublishedAt:X?.publishedAt,latestVersion:H,latestVersionPublishedAt:W.publishedAt,mode:"binary",message:`seal-use is already up to date (v${B1})`});return}let F=yg1(W.assets,J,K);if(!F)throw Error(`No compatible binary found for ${J}-${K} in release v${H}. Available assets: ${W.assets.map((N)=>N.name).join(", ")}`);let M=yK(z).running;if(M)await SU("stop",z);let w=process.execPath,O=Cg1(w),D=uT(O,`.tmp-update-${Date.now()}`);Ag1(D,{recursive:!0});try{let N=uT(D,F.name);await kg1(F.downloadUrl,N,W.tagName,F.name);let A=N;if(F.name.endsWith(".tar.gz")||F.name.endsWith(".tgz"))A=xg1(N,D,J);else if(F.name.endsWith(".zip"))A=fg1(N,D,J);if(Bg1(A,493),process.platform==="darwin")try{kK("/usr/bin/codesign",["--remove-signature",A],{stdio:"ignore"}),kK("/usr/bin/codesign",["--force","--sign","-",A],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let P=`${w}.old.${Date.now()}`;try{Go(w,P)}catch{}Go(A,w)}else Go(A,w);if(M)await SU("start",z);let T=vg1(w,H);c0({updated:!0,fromVersion:B1,toVersion:H,serviceRestarted:M,skillSynced:T.targetDir??!1,skillVersion:T.version??!1,mode:"binary"})}finally{try{jg1(D,{recursive:!0,force:!0})}catch{}}}function Line truncated
`)}catch{}}async function kg1($,Y,z,U){let I=Ho(),Q=[],J=z?z.startsWith("v")?z:`v${z}`:void 0,K=U||$.split("/").pop()||"";if(I!=="github"){if(J&&K)Q.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${J}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${J}/${K}`);if($.startsWith("https://git.ying-qing.cn"))Q.push($)}if(I!=="gitea")if(J&&K){let F=`https://github.com/${$g0}/releases/download/${J}/${K}`;if(!process.env.CI)Q.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);Q.push(F)}else if($.includes("github.com")){if(!process.env.CI)Q.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Q.push($)}else Q.push($);let G=Array.from(new Set(Q)),W,H=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let M=G[F],w=new AbortController,O="",D=(P)=>{O=P;try{w.abort()}catch{}},N=setTimeout(()=>{D("Connection timed out (no response headers within 6s)")},H),A,T;try{fT(`==> [${F+1}/${G.length}] Downloading via: ${M}`);let P=await fetch(M,{signal:w.signal});if(N)clearTimeout(N),N=void 0;if(!P.ok)throw Error(`HTTP ${P.status} ${P.statusText}`);A=setTimeout(()=>{D("Overall download time exceeded 3 minutes")},V);let j=Number(P.headers.get("content-length"))||0,C=P.body?.getReader();if(!C){let c=Buffer.from(await P.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);sS0(Y,c),fT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],k=0,h=0;T=setTimeout(()=>{if(k<Z){let c=(k/1024).toFixed(1);D(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),U0,x=new Promise((g,p)=>{U0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,x])}finally{if(U0)clearTimeout(U0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),k+=$0.length,T&&k>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-h>200){h=g;let p=j?Math.round(k/j*100):0,e=(k/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);sS0(Y,i),fT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(P){if(N)clearTimeout(N);if(T)clearTimeout(T);if(A)clearTimeout(A);let j=O||(P instanceof Error?P.message:String(P));W=Error(j),fT(`
↳ Mirror failed: ${W.message}`)}finally{if(N)clearTimeout(N);if(T)clearTimeout(T);if(A)clearTimeout(A)}}throw Error(`Failed to download asset from all mirrors: ${W?.message}`)}function Ug0($){let Y;try{Y=Tg1($,{withFileTypes:!0})}catch{return[]}let z=[];for(let U of Y){let I=uT($,U.name);if(U.isDirectory())z.push(...Ug0(I));else if(U.isFile())z.push(I)}return z}function Ig0($,Y,z){let U=Y==="windows"?"seal-use.exe":"seal-use",I=Ug0($);return I.find((Q)=>Eg1(Q)===U)??I[0]??z}function xg1($,Y,z){let U=kK("tar",["-xzf",$,"-C",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);return eS0($),Ig0(Y,z,$)}function fg1($,Y,z){let U=kK("unzip",["-q","-o",$,"-d",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);return eS0($),Ig0(Y,z,$)}function Qg0($,Y){let z=$.replace(/^v/,"").split(".").map((I)=>Number.parseInt(I,10)||0),U=Y.replace(/^v/,"").split(".").map((I)=>Number.parseInt(I,10)||0);for(let I=0;I<Math.max(z.length,U.length);I++){let Q=z[I]??0,J=U[I]??0;if(Q>J)return 1;if(Q<J)return-1}return 0}function Eq($,Y){return Qg0($,Y)>0}function tS0($,Y,z={}){let U=kK($,Y,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${Y.join(" ")} failed with status ${U.status}`)}var $g0="yunyingk/seal-use",Cq="yunyingk/seal-home",Rg1="SEAL_USE_GITHUB_REPO",_g1="SEAL_HOME_GITHUB_REPO";var Jg0=o(()=>{rS0();Bq();t9();zo();Q4();Qo()});async function Kg0($,Y,z,U,I){if($==="create"){let Q=S(I.options.name)??Y,J=S(I.options.phone);if(!Q||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=S(I.options.dept)??S(I.options.departmentId);await k0("seal_user_create",z,U,{name:Q,phone:J,departmentIds:K?[K]:void 0},C0(I.options));return}if($==="reset-password"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",z,U,{userId:Q},C0(I.options));return}if($==="search"||$==="list"){let Q=Y??S(I.options.keyword)??S(I.options.query)??"";await k0("seal_user_search",z,U,{keyword:Q},C0(I.options));return}if($==="get"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",z,U,{userId:Q},C0(I.options));return}if($==="delete"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",z,U,{userId:Q},C0(I.options));return}if($==="activate"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",z,U,{userId:Q},C0(I.options));return}if($==="delegation"||$==="impersonate"){let Q=Y??S(I.options.userId)??S(I.options.phone);if(!Q)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=S(I.options.note);await k0("seal_user_delegation_create",z,U,{userIdOrPhone:Q,note:J},C0(I.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var Gg0=o(()=>{o4();D4();Q4()});import{dirname as Xo,join as ug1}from"node:path";import{fileURLToPath as bg1}from"node:url";function pg1($){if(!$.length)return!1;let Y=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(Y&&ng1.has(Y))return!0;if((Y==="service"||Y==="daemon")&&z==="run")return!0;return!1}function Tq($,Y={}){if(pg1($))return Xg0($,Y);let z=Hg0.then(()=>Xg0($,Y));return Hg0=z.then(()=>{return},()=>{return}),z}async function Xg0($,Y){let z=[],U=[],I=console.log,Q=console.error,J={appRoot:Y.appRoot??Wg0,entryFile:Y.entryFile??ug1(Y.appRoot??Wg0,"src","cli.ts"),launcher:Y.launcher};console.log=(...K)=>{z.push(Dl(K))},console.error=(...K)=>{U.push(Dl(K))};try{return await dg1($,J),{stdout:Lq(z),stderr:Lq(U),isError:!1,exitCode:0}}catch(K){let G=Fq(K instanceof Error?K.message:String(K)),W=RZ(K);if(U.push(G),W.nextAction&&!G.includes("Next action:"))U.push(`\uD83D\uDC49 Next action: ${W.nextAction}`);return{stdout:Lq(z),stderr:Lq(U),isError:!0,exitCode:W.exitCode}}finally{console.log=I,console.error=Q}}async function dg1($,Y){let z=Vq($),[U,I,Q]=z.command,J=U?.toLowerCase(),K=J?ig1.has(J):!1,G=K?"update":J;if(G==="version"||G==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){c0(AW);return}let W=aR0(z);if(W.isHelp){Y_0(W.target);return}if(!G||!cg1.has(G))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(G==="webhook"&&(I==="resource-pack"||I==="pack"||I==="material-pack")&&Q==="preview"){let Z=z.command[3]??S(z.options.file)??S(z.options.input);if(!Z)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await I_0(Z,_K(z.options));return}if(G==="openapi"){wS0(z);return}if(G==="mcp-config"){al();return}if(G==="skill"){xS0(I,Q,z);return}if(G==="mcp"||G==="server"){await qS0(I,z);return}if(G==="probe"){await jS0(I, Line truncated
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Q.id} <testCorpId>`);K=E1(O)}let G=await j1(J),H=await j1(K),W=s0(z.options.samples)??s0(z.options.limit)??s0(z.options.n)??10,X=V0(z.options["dry-run"]),Z=V0(z.options["fail-on-flips"]),q=s0(z.options["poll-interval"])??2000,V=s0(z.options.timeout)??45000,F=S(z.options["sn-prefix"])??"REG_",M=await Wg0({sourceCorp:J,targetCorp:K,sourceClient:G,targetClient:H,samples:W,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z});if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(Xg0(M));if(c0(M),Z&&!M.ok)throw new w4(`回归测试发现 ${M.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new w4(`未知的 test 子命令: "${U}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var qg0=o(()=>{L$();o4();D4();Q4();i8();Zg0()});async function Vg0($,Y,z,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,Y,z,y8(U.json),C0(U.options))}var Lg0=o(()=>{o4();D4();Q4()});function Fg0(){c0(Vq.map(($)=>({name:$.name,description:$.description})))}var wg0=o(()=>{Fq();Q4()});function cT($=process.execPath,Y=import.meta.url){if(Y.includes("/$bunfs/")||Y.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var Mg0=o(()=>{Cq()});import{chmodSync as $y1,mkdirSync as Yy1,readdirSync as zy1,renameSync as Ao,rmSync as Uy1,unlinkSync as Ag0,writeFileSync as Og0}from"node:fs";import{basename as Iy1,dirname as Qy1,join as pT}from"node:path";import{spawnSync as uK}from"node:child_process";async function Bg0($,Y={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:wo,version:P1,launcher:$.launcher},U=Y.repo||process.env[Jy1]?.trim()||process.env[Ky1]?.trim()||Pg0,I=Y.targetVersion?.trim(),Q=I&&I.toLowerCase()!=="latest"?I:void 0;if(Q){let N=Q.replace(/^v/,""),B=Cg0(N,P1);if(B<0)if(!xS&&Y.force);else{c0({updated:!1,currentVersion:P1,targetVersion:N,mode:cT()?"binary":"source",message:!xS?`Cannot downgrade seal-use from dev build v${P1} to release v${N}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${P1} to older version v${N}. Updates must be forward-only.`});return}if(B===0&&!Y.force){c0({updated:!1,currentVersion:P1,targetVersion:N,mode:cT()?"binary":"source",message:`seal-use is already at version v${P1}. Use --force to reinstall.`});return}}if(Y.changelogOnly){let N=await Po(U,Y.limit??10);c0({currentVersion:P1,totalQueried:N.length,releases:N.map((B)=>({version:B.version,tagName:B.tagName,publishedAt:B.publishedAt,author:B.author,releaseNotes:B.notes,releaseUrl:B.htmlUrl,isCurrent:B.version===P1,isNewer:hq(B.version,P1)}))});return}if(!cT()){if(Y.checkOnly){let B=await Po(U,30),T=B[0],A=T?.version??P1,j=B.find((k)=>k.version===P1),C=hq(A,P1),b=B.filter((k)=>hq(k.version,P1));c0({updated:!1,updateAvailable:C,currentVersion:P1,currentVersionPublishedAt:j?.publishedAt,latestVersion:A,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((k)=>({version:k.version,tagName:k.tagName,publishedAt:k.publishedAt,author:k.author,releaseNotes:k.notes,releaseUrl:k.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let N=fK(z).running;if(N)await yU("stop",z);try{Dg0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(B){console.error(`git pull skipped: ${B instanceof Error?B.message:String(B)}`)}if(Dg0("bun",["install"],{cwd:$.appRoot}),N)await yU("start",z);c0({updated:!0,serviceRestarted:N,version:P1,mode:"source"});return}let J=Hy1(),K=Wy1(),G=await Po(U,30),H=Q?G.find((N)=>N.version===Q||N.tagName===Q||N.tagName===`v${Q}`)??await Ng0(U,Q):G[0]??await Ng0(U);if(!H){c0({updated:!1,currentVersion:P1,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let W=H.version,X=G.find((N)=>N.version===P1),Z=hq(W,P1),q=Z||Boolean(Y.force),V=G.filter((N)=>hq(N.version,P1));if(Y.checkOnly){c0({updated:!1,updateAvailable:Z,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,behindCount:V.length,pendingReleases:V.map((N)=>({version:N.version,tagName:N.tagName,publishedAt:N.publishedAt,author:N.author,releaseNotes:N.notes,releaseUrl:N.htmlUrl})),releaseNotes:H.notes,releaseUrl:H.htmlUrl,mode:"binary"});return}if(!q){c0({updated:!1,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,mode:"binary",message:`seal-use is already up to date (v${P1})`});return}let F=Zy1(H.assets,J,K);if(!F)throw Error(`No compatible binary found for ${J}-${K} in release v${W}. Available assets: ${H.assets.map((N)=>N.name).join(", ")}`);let M=fK(z).running;if(M)await yU("stop",z);let w=process.execPath,O=Qy1(w),D=pT(O,`.tmp-update-${Date.now()}`);Yy1(D,{recursive:!0});try{let N=pT(D,F.name);await qy1(F.downloadUrl,N,H.tagName,F.name);let B=N;if(F.name.endsWith(".tar.gz")||F.name.endsWith(".tgz"))B=Vy1(N,D,J);else if(F.name.endsWith(".zip"))B=Ly1(N,D,J);if($y1(B,493),process.platform==="darwin")try{uK("/usr/bin/codesign",["--remove-signature",B],{stdio:"ignore"}),uK("/usr/bin/codesign",["--force","--sign","-",B],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let A=`${w}.old.${Date.now()}`;try{Ao(w,A)}catch{}Ao(B,w)}else Ao(B,w);if(M)await yU("start",z);let T=Gy1(w,W);c0({updated:!0,fromVersion:P1,toVersion:W,serviceRestarted:M,skillSynced:T.targetDir??!1,skillVersion:T.version??!1,mode:"binary"})}finally{try{Uy1(D,{recursive:!0,force:!0})}catch{}}}function Line truncated
`)}catch{}}async function qy1($,Y,z,U){let I=Bo(),Q=[],J=z?z.startsWith("v")?z:`v${z}`:void 0,K=U||$.split("/").pop()||"";if(I!=="github"){if(J&&K)Q.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${J}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${J}/${K}`);if($.startsWith("https://git.ying-qing.cn"))Q.push($)}if(I!=="gitea")if(J&&K){let F=`https://github.com/${Pg0}/releases/download/${J}/${K}`;if(!process.env.CI)Q.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);Q.push(F)}else if($.includes("github.com")){if(!process.env.CI)Q.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Q.push($)}else Q.push($);let G=Array.from(new Set(Q)),H,W=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let M=G[F],w=new AbortController,O="",D=(A)=>{O=A;try{w.abort()}catch{}},N=setTimeout(()=>{D("Connection timed out (no response headers within 6s)")},W),B,T;try{nT(`==> [${F+1}/${G.length}] Downloading via: ${M}`);let A=await fetch(M,{signal:w.signal});if(N)clearTimeout(N),N=void 0;if(!A.ok)throw Error(`HTTP ${A.status} ${A.statusText}`);B=setTimeout(()=>{D("Overall download time exceeded 3 minutes")},V);let j=Number(A.headers.get("content-length"))||0,C=A.body?.getReader();if(!C){let c=Buffer.from(await A.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);Og0(Y,c),nT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],k=0,h=0;T=setTimeout(()=>{if(k<Z){let c=(k/1024).toFixed(1);D(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),U0,x=new Promise((g,p)=>{U0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,x])}finally{if(U0)clearTimeout(U0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),k+=$0.length,T&&k>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-h>200){h=g;let p=j?Math.round(k/j*100):0,e=(k/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);Og0(Y,i),nT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(A){if(N)clearTimeout(N);if(T)clearTimeout(T);if(B)clearTimeout(B);let j=O||(A instanceof Error?A.message:String(A));H=Error(j),nT(`
↳ Mirror failed: ${H.message}`)}finally{if(N)clearTimeout(N);if(T)clearTimeout(T);if(B)clearTimeout(B)}}throw Error(`Failed to download asset from all mirrors: ${H?.message}`)}function jg0($){let Y;try{Y=zy1($,{withFileTypes:!0})}catch{return[]}let z=[];for(let U of Y){let I=pT($,U.name);if(U.isDirectory())z.push(...jg0(I));else if(U.isFile())z.push(I)}return z}function Eg0($,Y,z){let U=Y==="windows"?"seal-use.exe":"seal-use",I=jg0($);return I.find((Q)=>Iy1(Q)===U)??I[0]??z}function Vy1($,Y,z){let U=uK("tar",["-xzf",$,"-C",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);return Ag0($),Eg0(Y,z,$)}function Ly1($,Y,z){let U=uK("unzip",["-q","-o",$,"-d",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);return Ag0($),Eg0(Y,z,$)}function Cg0($,Y){let z=$.replace(/^v/,"").split(".").map((I)=>Number.parseInt(I,10)||0),U=Y.replace(/^v/,"").split(".").map((I)=>Number.parseInt(I,10)||0);for(let I=0;I<Math.max(z.length,U.length);I++){let Q=z[I]??0,J=U[I]??0;if(Q>J)return 1;if(Q<J)return-1}return 0}function hq($,Y){return Cg0($,Y)>0}function Dg0($,Y,z={}){let U=uK($,Y,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${Y.join(" ")} failed with status ${U.status}`)}var Pg0="yunyingk/seal-use",Sq="yunyingk/seal-home",Jy1="SEAL_USE_GITHUB_REPO",Ky1="SEAL_HOME_GITHUB_REPO";var Rg0=o(()=>{Mg0();Cq();t9();Fo();Q4();Oo()});async function _g0($,Y,z,U,I){if($==="create"){let Q=S(I.options.name)??Y,J=S(I.options.phone);if(!Q||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=S(I.options.dept)??S(I.options.departmentId);await k0("seal_user_create",z,U,{name:Q,phone:J,departmentIds:K?[K]:void 0},C0(I.options));return}if($==="reset-password"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",z,U,{userId:Q},C0(I.options));return}if($==="search"||$==="list"){let Q=Y??S(I.options.keyword)??S(I.options.query)??"";await k0("seal_user_search",z,U,{keyword:Q},C0(I.options));return}if($==="get"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",z,U,{userId:Q},C0(I.options));return}if($==="delete"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",z,U,{userId:Q},C0(I.options));return}if($==="activate"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",z,U,{userId:Q},C0(I.options));return}if($==="delegation"||$==="impersonate"){let Q=Y??S(I.options.userId)??S(I.options.phone);if(!Q)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=S(I.options.note);await k0("seal_user_delegation_create",z,U,{userIdOrPhone:Q,note:J},C0(I.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var vg0=o(()=>{o4();D4();Q4()});import{dirname as To,join as Fy1}from"node:path";import{fileURLToPath as wy1}from"node:url";function Dy1($){if(!$.length)return!1;let Y=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(Y&&Ny1.has(Y))return!0;if((Y==="service"||Y==="daemon")&&z==="run")return!0;return!1}function _q($,Y={}){if(Dy1($))return gg0($,Y);let z=Sg0.then(()=>gg0($,Y));return Sg0=z.then(()=>{return},()=>{return}),z}async function gg0($,Y){let z=[],U=[],I=console.log,Q=console.error,J={appRoot:Y.appRoot??hg0,entryFile:Y.entryFile??Fy1(Y.appRoot??hg0,"src","cli.ts"),launcher:Y.launcher};console.log=(...K)=>{z.push(jl(K))},console.error=(...K)=>{U.push(jl(K))};try{return await Ay1($,J),{stdout:Mq(z),stderr:Mq(U),isError:!1,exitCode:0}}catch(K){let G=Oq(K instanceof Error?K.message:String(K)),H=hZ(K);if(U.push(G),H.nextAction&&!G.includes("Next action:"))U.push(`\uD83D\uDC49 Next action: ${H.nextAction}`);return{stdout:Mq(z),stderr:Mq(U),isError:!0,exitCode:H.exitCode}}finally{console.log=I,console.error=Q}}async function Ay1($,Y){let z=wq($),[U,I,Q]=z.command,J=U?.toLowerCase(),K=J?My1.has(J):!1,G=K?"update":J;if(G==="version"||G==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){c0(EH);return}let H=X_0(z);if(H.isHelp){L_0(H.target);return}if(!G||!Oy1.has(G))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(G==="webhook"&&(I==="resource-pack"||I==="pack"||I==="material-pack")&&Q==="preview"){let Z=z.command[3]??S(z.options.file)??S(z.options.input);if(!Z)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await M_0(Z,hK(z.options));return}if(G==="openapi"){bS0(z);return}if(G==="mcp-config"){Xo();return}if(G==="skill"){Jg0(I,Q,z);return}if(G==="mcp"||G==="server"){await kS0(I,z);return}if(G==="probe"){await rS0(I, Line truncated
`)?"":`
`}`);process.exitCode=$.exitCode}var m3,Fg0,bT="seal_cli",vq="seal_cli_write",wg0="SEAL_USE_MCP_ENABLED",Mg0="SEAL_HOME_MCP_ENABLED",tg1;var FS0=o(async()=>{He();qe();P$();rl();qg0();L$();t9();m3=sg1(import.meta.url),Fg0=m3.includes("/dist/mcp/")||m3.includes("\\dist\\mcp\\")?Rq(Rq(Rq(m3))):Rq(Rq(m3));tg1=Boolean(J0.main==J0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&Vg0(process.argv[1])===Vg0(m3));if(tg1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await ag1();else try{Dg0()}catch($){console.error($),process.exitCode=1}});await FS0();export{Aq as tokenizeCommand,Dg0 as startServer,Og0 as resolveMcpEnabled,Ng0 as createServer,wg0 as SEAL_MCP_ENABLED_ENV,vq as SEAL_CLI_WRITE_TOOL_NAME,bT as SEAL_CLI_TOOL_NAME,Mg0 as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var m3,ug0,dT="seal_cli",kq="seal_cli_write",bg0="SEAL_USE_MCP_ENABLED",ig0="SEAL_HOME_MCP_ENABLED",Ry1;var uS0=o(async()=>{Be();Ee();A$();Ho();kg0();L$();t9();m3=Ey1(import.meta.url),ug0=m3.includes("/dist/mcp/")||m3.includes("\\dist\\mcp\\")?gq(gq(gq(m3))):gq(gq(m3));Ry1=Boolean(J0.main==J0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&xg0(process.argv[1])===xg0(m3));if(Ry1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await Cy1();else try{pg0()}catch($){console.error($),process.exitCode=1}});await uS0();export{Rq as tokenizeCommand,pg0 as startServer,cg0 as resolveMcpEnabled,ng0 as createServer,bg0 as SEAL_MCP_ENABLED_ENV,kq as SEAL_CLI_WRITE_TOOL_NAME,dT as SEAL_CLI_TOOL_NAME,ig0 as LEGACY_SEAL_MCP_ENABLED_ENV};
+18 -2
View File
@@ -1,5 +1,11 @@
import { existsSync } from "node:fs";
import { join } from "node:path";
import {
getAllLinkableHostsStatus,
getAntigravitySkillsStatus,
syncAllLinkableHosts,
syncAntigravitySkillsConfig
} from "../../core/agent-hosts/index.js";
import {
getDefaultGlobalSkillDir,
getSkillContent,
@@ -25,11 +31,17 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
: getDefaultGlobalSkillDir();
const result = installSkillFiles(targetDir);
const isGlobal = !isLocal && !customDir;
const antigravity = isGlobal ? syncAntigravitySkillsConfig() : undefined;
const hosts = isGlobal ? syncAllLinkableHosts() : undefined;
printJson({
installed: true,
targetDir: result.targetDir,
fileCount: result.files.length,
files: result.files
files: result.files,
...(antigravity ? { antigravity } : {}),
...(hosts ? { hosts } : {})
});
return;
}
@@ -37,6 +49,8 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
if (action === "status" || action === "get" || !action) {
const globalDir = getDefaultGlobalSkillDir();
const localDir = join(process.cwd(), ".agents", "skills", "seal-use");
const antigravity = getAntigravitySkillsStatus();
const hosts = getAllLinkableHostsStatus();
printJson({
global: {
dir: globalDir,
@@ -45,7 +59,9 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
local: {
dir: localDir,
installed: existsSync(join(localDir, "SKILL.md"))
}
},
antigravity,
hosts
});
return;
}
+295
View File
@@ -0,0 +1,295 @@
import { describe, expect, test } from "bun:test";
import {
existsSync,
lstatSync,
mkdirSync,
mkdtempSync,
readFileSync,
realpathSync,
rmSync,
symlinkSync,
writeFileSync
} from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import {
getAllAgentHostsStatus,
getAllLinkableHostsStatus,
getAntigravitySkillsStatus,
getHostSkillsStatus,
KNOWN_LINKABLE_HOSTS,
syncAllAgentHosts,
syncAntigravitySkillsConfig,
syncHostSkills
} from "./index.js";
describe("antigravity skills config sync", () => {
test("creates skills.json when it does not exist", () => {
const tmp = mkdtempSync(join(tmpdir(), "agy-config-"));
const configFile = join(tmp, "skills.json");
const targetDir = "/custom/test/path/.agents/skills";
try {
const res = syncAntigravitySkillsConfig({ configFile, targetSkillsDir: targetDir });
expect(res.configured).toBe(true);
expect(res.action).toBe("created");
expect(res.targetDir).toBe(targetDir);
const status = getAntigravitySkillsStatus({ configFile, targetSkillsDir: targetDir });
expect(status.configured).toBe(true);
const content = JSON.parse(readFileSync(configFile, "utf8"));
expect(content.entries).toEqual([{ path: targetDir }]);
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("does nothing when target directory is already present", () => {
const tmp = mkdtempSync(join(tmpdir(), "agy-config-"));
const configFile = join(tmp, "skills.json");
const targetDir = "/custom/test/path/.agents/skills";
try {
const initial = {
entries: [
{ path: "/other/skill/dir" },
{ path: targetDir }
]
};
writeFileSync(configFile, JSON.stringify(initial, null, 2));
const res = syncAntigravitySkillsConfig({ configFile, targetSkillsDir: targetDir });
expect(res.configured).toBe(true);
expect(res.action).toBe("already_present");
const content = JSON.parse(readFileSync(configFile, "utf8"));
expect(content.entries.length).toBe(2);
expect(content.entries[1].path).toBe(targetDir);
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("prepends target directory to first position when absent", () => {
const tmp = mkdtempSync(join(tmpdir(), "agy-config-"));
const configFile = join(tmp, "skills.json");
const targetDir = "/custom/test/path/.agents/skills";
try {
const initial = {
entries: [
{ path: "/existing/first/dir" },
{ path: "/existing/second/dir" }
]
};
writeFileSync(configFile, JSON.stringify(initial, null, 2));
const res = syncAntigravitySkillsConfig({ configFile, targetSkillsDir: targetDir });
expect(res.configured).toBe(true);
expect(res.action).toBe("prepended");
const content = JSON.parse(readFileSync(configFile, "utf8"));
expect(content.entries.length).toBe(3);
expect(content.entries[0].path).toBe(targetDir);
expect(content.entries[1].path).toBe("/existing/first/dir");
expect(content.entries[2].path).toBe("/existing/second/dir");
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("updates legacy tilde path to absolute target directory", () => {
const tmp = mkdtempSync(join(tmpdir(), "agy-config-"));
const configFile = join(tmp, "skills.json");
const targetDir = "/custom/test/path/.agents/skills";
try {
const initial = {
entries: [
{ path: "~/.agents/skills" },
{ path: "/other/dir" }
]
};
writeFileSync(configFile, JSON.stringify(initial, null, 2));
const res = syncAntigravitySkillsConfig({ configFile, targetSkillsDir: targetDir });
expect(res.configured).toBe(true);
expect(res.action).toBe("updated_tilde");
const content = JSON.parse(readFileSync(configFile, "utf8"));
expect(content.entries.length).toBe(2);
expect(content.entries[0].path).toBe(targetDir);
expect(content.entries[1].path).toBe("/other/dir");
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
});
describe("symlink-based host skill bridge", () => {
const host = KNOWN_LINKABLE_HOSTS.find((h) => h.id === "workbuddy")!;
test("skips host cleanly if host root directory does not exist", () => {
const tmp = mkdtempSync(join(tmpdir(), "host-test-"));
try {
const res = syncHostSkills(host, { baseHomeDir: tmp });
expect(res.detected).toBe(false);
expect(res.configured).toBe(false);
expect(res.mode).toBe("skipped_not_detected");
const status = getHostSkillsStatus(host, { baseHomeDir: tmp });
expect(status.detected).toBe(false);
expect(status.mode).toBe("not_detected");
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("detects parent directory symlink (~/<host>/skills -> ~/.agents/skills) and does not mutate", () => {
const tmp = mkdtempSync(join(tmpdir(), "host-parent-"));
try {
const agentsSkillsDir = join(tmp, ".agents", "skills");
const sourceSkill = join(agentsSkillsDir, "seal-use");
mkdirSync(sourceSkill, { recursive: true });
const hostRoot = join(tmp, host.rootDirName);
mkdirSync(hostRoot, { recursive: true });
const hostSkills = join(hostRoot, "skills");
symlinkSync(agentsSkillsDir, hostSkills, "dir");
const res = syncHostSkills(host, {
baseHomeDir: tmp,
sourceSkillDir: sourceSkill
});
expect(res.detected).toBe(true);
expect(res.configured).toBe(true);
expect(res.mode).toBe("parent_symlinked");
const status = getHostSkillsStatus(host, {
baseHomeDir: tmp,
sourceSkillDir: sourceSkill
});
expect(status.configured).toBe(true);
expect(status.mode).toBe("parent_symlinked");
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("creates child symlink when host skills is an independent directory", () => {
const tmp = mkdtempSync(join(tmpdir(), "host-child-"));
try {
const sourceSkill = join(tmp, ".agents", "skills", "seal-use");
mkdirSync(sourceSkill, { recursive: true });
writeFileSync(join(sourceSkill, "SKILL.md"), "# Seal Skill");
const hostRoot = join(tmp, host.rootDirName);
mkdirSync(join(hostRoot, "skills"), { recursive: true });
const res = syncHostSkills(host, {
baseHomeDir: tmp,
sourceSkillDir: sourceSkill
});
expect(res.detected).toBe(true);
expect(res.configured).toBe(true);
expect(res.mode).toBe("linked");
const linkPath = join(hostRoot, "skills", "seal-use");
expect(lstatSync(linkPath).isSymbolicLink()).toBe(true);
expect(realpathSync(linkPath)).toBe(realpathSync(sourceSkill));
// Running sync again should be idempotent
const resAgain = syncHostSkills(host, {
baseHomeDir: tmp,
sourceSkillDir: sourceSkill
});
expect(resAgain.mode).toBe("already_linked");
const status = getHostSkillsStatus(host, {
baseHomeDir: tmp,
sourceSkillDir: sourceSkill
});
expect(status.configured).toBe(true);
expect(status.mode).toBe("single_symlinked");
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("heals broken dead symlinks by unlinking and recreating", () => {
const tmp = mkdtempSync(join(tmpdir(), "host-broken-"));
try {
const sourceSkill = join(tmp, ".agents", "skills", "seal-use");
mkdirSync(sourceSkill, { recursive: true });
const hostRoot = join(tmp, host.rootDirName);
const hostSkills = join(hostRoot, "skills");
mkdirSync(hostSkills, { recursive: true });
// Create broken link
const targetLink = join(hostSkills, "seal-use");
symlinkSync(join(tmp, "non-existent-old-target"), targetLink, "dir");
const res = syncHostSkills(host, {
baseHomeDir: tmp,
sourceSkillDir: sourceSkill
});
expect(res.detected).toBe(true);
expect(res.configured).toBe(true);
expect(res.mode).toBe("linked");
expect(realpathSync(targetLink)).toBe(realpathSync(sourceSkill));
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("safely replaces legacy real directory with symlink to prevent version drift", () => {
const tmp = mkdtempSync(join(tmpdir(), "host-realdir-"));
try {
const sourceSkill = join(tmp, ".agents", "skills", "seal-use");
mkdirSync(sourceSkill, { recursive: true });
const hostRoot = join(tmp, host.rootDirName);
const targetDir = join(hostRoot, "skills", "seal-use");
mkdirSync(targetDir, { recursive: true });
writeFileSync(join(targetDir, "SKILL.md"), "# Old Stale Skill");
const res = syncHostSkills(host, {
baseHomeDir: tmp,
sourceSkillDir: sourceSkill
});
expect(res.detected).toBe(true);
expect(res.configured).toBe(true);
expect(res.mode).toBe("replaced_real_dir");
expect(lstatSync(targetDir).isSymbolicLink()).toBe(true);
expect(realpathSync(targetDir)).toBe(realpathSync(sourceSkill));
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
test("syncAllAgentHosts aggregates Antigravity and all known hosts", () => {
const tmp = mkdtempSync(join(tmpdir(), "all-hosts-"));
try {
const result = syncAllAgentHosts({
baseHomeDir: tmp,
antigravityConfigFile: join(tmp, "gemini-skills.json")
});
expect(result.antigravity.configured).toBe(true);
expect(result.hosts.length).toBe(KNOWN_LINKABLE_HOSTS.length);
expect(result.hosts.every((h) => h.mode === "skipped_not_detected")).toBe(true);
const status = getAllAgentHostsStatus({
baseHomeDir: tmp,
antigravityConfigFile: join(tmp, "gemini-skills.json")
});
expect(status.antigravity.configured).toBe(true);
expect(status.hosts.length).toBe(KNOWN_LINKABLE_HOSTS.length);
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
});
+127
View File
@@ -0,0 +1,127 @@
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { homedir } from "node:os";
import { dirname, join } from "node:path";
import type { AntigravitySkillsStatus, AntigravitySkillsSyncResult } from "./types.js";
export function getGlobalAgentsSkillsDir(): string {
return join(homedir(), ".agents", "skills");
}
export function getAntigravitySkillsConfigFile(): string {
return join(homedir(), ".gemini", "config", "skills.json");
}
export function isAntigravityDetected(): boolean {
const home = homedir();
return (
existsSync(join(home, ".gemini", "antigravity")) ||
existsSync(join(home, ".gemini", "antigravity-cli")) ||
existsSync(join(home, ".local", "bin", "agy"))
);
}
export function syncAntigravitySkillsConfig(options?: {
configFile?: string;
targetSkillsDir?: string;
}): AntigravitySkillsSyncResult {
const targetDir = options?.targetSkillsDir ?? getGlobalAgentsSkillsDir();
const configPath = options?.configFile ?? getAntigravitySkillsConfigFile();
const detected = isAntigravityDetected();
if (!existsSync(configPath)) {
mkdirSync(dirname(configPath), { recursive: true });
const initialConfig = {
entries: [{ path: targetDir }]
};
writeFileSync(configPath, JSON.stringify(initialConfig, null, 2) + "\n", "utf8");
return {
detected,
configured: true,
configPath,
targetDir,
action: "created"
};
}
let parsed: { entries?: Array<{ path?: string; [key: string]: unknown }>; [key: string]: unknown } = {};
try {
parsed = JSON.parse(readFileSync(configPath, "utf8"));
} catch {
parsed = { entries: [] };
}
if (!Array.isArray(parsed.entries)) {
parsed.entries = [];
}
const exactIndex = parsed.entries.findIndex(
(entry) => entry && typeof entry.path === "string" && entry.path === targetDir
);
if (exactIndex !== -1) {
return {
detected,
configured: true,
configPath,
targetDir,
action: "already_present"
};
}
const tildeIndex = parsed.entries.findIndex(
(entry) =>
entry &&
typeof entry.path === "string" &&
(entry.path === "~/.agents/skills" || entry.path === "~/.agents/skills/")
);
if (tildeIndex !== -1) {
parsed.entries[tildeIndex] = { ...parsed.entries[tildeIndex], path: targetDir };
writeFileSync(configPath, JSON.stringify(parsed, null, 2) + "\n", "utf8");
return {
detected,
configured: true,
configPath,
targetDir,
action: "updated_tilde"
};
}
parsed.entries.unshift({ path: targetDir });
writeFileSync(configPath, JSON.stringify(parsed, null, 2) + "\n", "utf8");
return {
detected,
configured: true,
configPath,
targetDir,
action: "prepended"
};
}
export function getAntigravitySkillsStatus(options?: {
configFile?: string;
targetSkillsDir?: string;
}): AntigravitySkillsStatus {
const targetDir = options?.targetSkillsDir ?? getGlobalAgentsSkillsDir();
const configPath = options?.configFile ?? getAntigravitySkillsConfigFile();
const detected = isAntigravityDetected();
let configured = false;
if (existsSync(configPath)) {
try {
const parsed = JSON.parse(readFileSync(configPath, "utf8"));
if (Array.isArray(parsed?.entries)) {
configured = parsed.entries.some(
(e: { path?: string }) => e?.path === targetDir
);
}
} catch {
// ignore
}
}
return {
detected,
configured,
configPath,
targetDir
};
}
+48
View File
@@ -0,0 +1,48 @@
export * from "./types.js";
export * from "./antigravity.js";
export * from "./symlink-hosts.js";
import {
getAntigravitySkillsStatus,
syncAntigravitySkillsConfig
} from "./antigravity.js";
import {
getAllLinkableHostsStatus,
syncAllLinkableHosts
} from "./symlink-hosts.js";
import type { AllAgentHostsStatus, AllAgentHostsSyncResult } from "./types.js";
export function syncAllAgentHosts(options?: {
baseHomeDir?: string;
sourceSkillDir?: string;
antigravityConfigFile?: string;
}): AllAgentHostsSyncResult {
const antigravity = syncAntigravitySkillsConfig({
configFile: options?.antigravityConfigFile,
targetSkillsDir: options?.sourceSkillDir
? undefined
: undefined
});
const hosts = syncAllLinkableHosts(options);
return {
antigravity,
hosts
};
}
export function getAllAgentHostsStatus(options?: {
baseHomeDir?: string;
sourceSkillDir?: string;
antigravityConfigFile?: string;
}): AllAgentHostsStatus {
const antigravity = getAntigravitySkillsStatus({
configFile: options?.antigravityConfigFile
});
const hosts = getAllLinkableHostsStatus(options);
return {
antigravity,
hosts
};
}
+241
View File
@@ -0,0 +1,241 @@
import {
cpSync,
existsSync,
lstatSync,
mkdirSync,
realpathSync,
rmSync,
symlinkSync,
unlinkSync
} from "node:fs";
import { homedir } from "node:os";
import { dirname, join } from "node:path";
import type {
HostSkillsStatus,
HostSkillsSyncResult,
LinkableHostDefinition
} from "./types.js";
export const KNOWN_LINKABLE_HOSTS: LinkableHostDefinition[] = [
{ id: "workbuddy", name: "WorkBuddy", rootDirName: ".workbuddy" },
{ id: "claude", name: "Claude", rootDirName: ".claude" },
{ id: "qoder", name: "Qoder", rootDirName: ".qoder" }
];
export function syncHostSkills(
host: LinkableHostDefinition,
options?: { baseHomeDir?: string; sourceSkillDir?: string }
): HostSkillsSyncResult {
const home = options?.baseHomeDir ?? homedir();
const hostRootDir = join(home, host.rootDirName);
const sourceSkill = options?.sourceSkillDir ?? join(home, ".agents", "skills", "seal-use");
const agentsSkillsDir = dirname(sourceSkill);
const hostSkillsDir = join(hostRootDir, "skills");
const targetSkillLink = join(hostSkillsDir, "seal-use");
// Rule 1: No dotfile pollution. Skip if host root directory doesn't exist.
if (!existsSync(hostRootDir)) {
return {
id: host.id,
name: host.name,
detected: false,
configured: false,
mode: "skipped_not_detected"
};
}
// Rule 2: Check parent directory symlink (~/<host>/skills -> ~/.agents/skills)
if (existsSync(hostSkillsDir) && existsSync(agentsSkillsDir)) {
try {
if (realpathSync(hostSkillsDir) === realpathSync(agentsSkillsDir)) {
return {
id: host.id,
name: host.name,
detected: true,
configured: true,
mode: "parent_symlinked",
targetPath: hostSkillsDir
};
}
} catch {
// ignore
}
}
// Ensure ~/<host>/skills directory exists
mkdirSync(hostSkillsDir, { recursive: true });
// Rule 3: Inspect child entry ~/<host>/skills/seal-use (dead symlink, real dir, etc.)
let stat: ReturnType<typeof lstatSync> | undefined;
try {
stat = lstatSync(targetSkillLink);
} catch {
stat = undefined;
}
let replacedRealDir = false;
if (stat) {
if (stat.isSymbolicLink()) {
try {
if (realpathSync(targetSkillLink) === realpathSync(sourceSkill)) {
return {
id: host.id,
name: host.name,
detected: true,
configured: true,
mode: "already_linked",
targetPath: targetSkillLink
};
}
} catch {
// Dead symlink: target disappeared or broken
}
try {
unlinkSync(targetSkillLink);
} catch {
// ignore
}
} else if (stat.isDirectory()) {
// Rule 4: Existing real directory: replace with symlink to prevent version drift
rmSync(targetSkillLink, { recursive: true, force: true });
replacedRealDir = true;
} else {
// Stray file or other artifact
unlinkSync(targetSkillLink);
}
}
// Rule 5: Create symlink with Windows junction fallback for non-admin privileges
const symlinkType = process.platform === "win32" ? "junction" : "dir";
try {
symlinkSync(sourceSkill, targetSkillLink, symlinkType);
return {
id: host.id,
name: host.name,
detected: true,
configured: true,
mode: replacedRealDir ? "replaced_real_dir" : "linked",
targetPath: targetSkillLink
};
} catch {
try {
cpSync(sourceSkill, targetSkillLink, { recursive: true });
return {
id: host.id,
name: host.name,
detected: true,
configured: true,
mode: "fallback_copied",
targetPath: targetSkillLink
};
} catch (cpErr: any) {
return {
id: host.id,
name: host.name,
detected: true,
configured: false,
mode: "error",
targetPath: targetSkillLink,
error: cpErr?.message || String(cpErr)
};
}
}
}
export function getHostSkillsStatus(
host: LinkableHostDefinition,
options?: { baseHomeDir?: string; sourceSkillDir?: string }
): HostSkillsStatus {
const home = options?.baseHomeDir ?? homedir();
const hostRootDir = join(home, host.rootDirName);
const sourceSkill = options?.sourceSkillDir ?? join(home, ".agents", "skills", "seal-use");
const agentsSkillsDir = dirname(sourceSkill);
const hostSkillsDir = join(hostRootDir, "skills");
const targetSkillLink = join(hostSkillsDir, "seal-use");
if (!existsSync(hostRootDir)) {
return {
id: host.id,
name: host.name,
detected: false,
configured: false,
mode: "not_detected"
};
}
if (existsSync(hostSkillsDir) && existsSync(agentsSkillsDir)) {
try {
if (realpathSync(hostSkillsDir) === realpathSync(agentsSkillsDir)) {
return {
id: host.id,
name: host.name,
detected: true,
configured: true,
mode: "parent_symlinked",
targetPath: hostSkillsDir
};
}
} catch {
// ignore
}
}
let stat: ReturnType<typeof lstatSync> | undefined;
try {
stat = lstatSync(targetSkillLink);
} catch {
stat = undefined;
}
if (stat) {
if (stat.isSymbolicLink()) {
try {
if (realpathSync(targetSkillLink) === realpathSync(sourceSkill)) {
return {
id: host.id,
name: host.name,
detected: true,
configured: true,
mode: "single_symlinked",
targetPath: targetSkillLink
};
}
} catch {
// dead symlink
}
} else if (stat.isDirectory()) {
return {
id: host.id,
name: host.name,
detected: true,
configured: true,
mode: "real_directory",
targetPath: targetSkillLink
};
}
}
return {
id: host.id,
name: host.name,
detected: true,
configured: false,
mode: "not_configured",
targetPath: targetSkillLink
};
}
export function syncAllLinkableHosts(options?: {
baseHomeDir?: string;
sourceSkillDir?: string;
}): HostSkillsSyncResult[] {
return KNOWN_LINKABLE_HOSTS.map((host) => syncHostSkills(host, options));
}
export function getAllLinkableHostsStatus(options?: {
baseHomeDir?: string;
sourceSkillDir?: string;
}): HostSkillsStatus[] {
return KNOWN_LINKABLE_HOSTS.map((host) => getHostSkillsStatus(host, options));
}
+58
View File
@@ -0,0 +1,58 @@
export type AntigravitySkillsSyncResult = {
detected: boolean;
configured: boolean;
configPath: string;
targetDir: string;
action: "created" | "prepended" | "already_present" | "updated_tilde";
};
export type AntigravitySkillsStatus = {
detected: boolean;
configured: boolean;
configPath: string;
targetDir: string;
};
export type LinkableHostId = "workbuddy" | "claude" | "qoder";
export type LinkableHostDefinition = {
id: LinkableHostId;
name: string;
rootDirName: string;
};
export type HostSkillsSyncResult = {
id: LinkableHostId;
name: string;
detected: boolean;
configured: boolean;
mode:
| "skipped_not_detected"
| "parent_symlinked"
| "linked"
| "already_linked"
| "replaced_real_dir"
| "fallback_copied"
| "error";
targetPath?: string;
error?: string;
};
export type HostSkillsStatus = {
id: LinkableHostId;
name: string;
detected: boolean;
configured: boolean;
mode: "not_detected" | "parent_symlinked" | "single_symlinked" | "real_directory" | "not_configured";
targetPath?: string;
};
export type AllAgentHostsSyncResult = {
antigravity: AntigravitySkillsSyncResult;
hosts: HostSkillsSyncResult[];
};
export type AllAgentHostsStatus = {
antigravity: AntigravitySkillsStatus;
hosts: HostSkillsStatus[];
};
+1 -5
View File
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import { mkdtempSync, rmSync, existsSync } from "node:fs";
import { existsSync, mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import packageJson from "../../package.json" with { type: "json" };
@@ -44,10 +44,6 @@ describe("embedded-skill", () => {
});
describe("embedded-skill version contract", () => {
// A version-tagged document that nothing asserts on drifts silently: `seal-use update` shipped
// the previous release's skill for several versions, because "the file was written" looked like
// success from every angle. Keeping the skill and the package in step is a failing test now
// rather than a discovery.
test("the skill's version matches the package version", () => {
expect(EMBEDDED_SKILL_VERSION).toBe(packageJson.version);
});
+3
View File
@@ -104,3 +104,6 @@ export function syncGlobalSkillIfPresent(): { synced: boolean; targetDir?: strin
return { synced: false };
}
// Re-export agent host skill bridging capabilities
export * from "./agent-hosts/index.js";