Fix export filename date tag and add time range to approval-runs count

This commit is contained in:
gitea committed 2026-09-14 10:01:20 +08:00
1 parent 45a576a18e
commit c7433db265
10 files changed
+302 -154

No files matched your search

+128 -126
View File
@@ -1,7 +1,7 @@
import{createRequire as LM0}from"node:module";var QM0=Object.create;var{getPrototypeOf:KM0,defineProperty:OF,getOwnPropertyNames:wM0}=Object;var GM0=Object.prototype.hasOwnProperty;function HM0($){return this[$]}var WM0,VM0,$3=($,I,z)=>{var q=$!=null&&typeof $==="object";if(q){var U=I?WM0??=new WeakMap:VM0??=new WeakMap,Y=U.get($);if(Y)return Y}z=$!=null?QM0(KM0($)):{};let J=I||!$||!$.__esModule?OF(z,"default",{value:$,enumerable:!0}):z;for(let Q of wM0($))if(!GM0.call(J,Q))OF(J,Q,{get:HM0.bind($,Q),enumerable:!0});if(q)U.set($,J);return J};var F=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var ZM0=($)=>$;function XM0($,I){this[$]=ZM0.bind(null,I)}var A$=($,I)=>{for(var z in I)OF($,z,{get:I[z],enumerable:!0,configurable:!0,set:XM0.bind(I,z)})};var K0=($,I)=>()=>($&&(I=$($=0)),I);var t=LM0(import.meta.url);function r($,I,z){function q(Q,K){if(!Q._zod)Object.defineProperty(Q,"_zod",{value:{def:K,constr:J,traits:new Set},enumerable:!1});if(Q._zod.traits.has($))return;Q._zod.traits.add($),I(Q,K);let w=J.prototype,G=Object.keys(w);for(let H=0;H<G.length;H++){let W=G[H];if(!(W in Q))Q[W]=w[W].bind(Q)}}let U=z?.Parent??Object;class Y extends U{}Object.defineProperty(Y,"name",{value:$});function J(Q){var K;let w=z?.Parent?new Y:this;q(w,Q),(K=w._zod).deferred??(K.deferred=[]);for(let G of w._zod.deferred)G();return w}return Object.defineProperty(J,"init",{value:q}),Object.defineProperty(J,Symbol.hasInstance,{value:(Q)=>{if(z?.Parent&&Q instanceof z.Parent)return!0;return Q?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}function E4($){if($)Object.assign(I3,$);return I3}var rf,FF,NF,S8,z3,I3;var q3=K0(()=>{FF=Object.freeze({status:"aborted"});NF=Symbol("zod_brand");S8=class S8 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};z3=class z3 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(rf=globalThis).__zod_globalConfig??(rf.__zod_globalConfig={});I3=globalThis.__zod_globalConfig});var F0={};A$(F0,{unwrapMessage:()=>PY,uint8ArrayToHex:()=>nM0,uint8ArrayToBase64url:()=>fM0,uint8ArrayToBase64:()=>sf,stringifyPrimitive:()=>X0,slugify:()=>PF,shallowClone:()=>EF,safeExtend:()=>hM0,required:()=>uM0,randomString:()=>BM0,propertyKeyTypes:()=>BY,promiseAllObject:()=>EM0,primitiveTypes:()=>BF,prefixIssues:()=>I$,pick:()=>gM0,partial:()=>yM0,parsedType:()=>D0,optionalKeys:()=>jF,omit:()=>_M0,objectClone:()=>AM0,numKeys:()=>jM0,nullish:()=>A9,normalizeParams:()=>P0,mergeDefs:()=>M5,merge:()=>SM0,jsonStringifyReplacer:()=>oI,joinValues:()=>z0,issue:()=>tI,isPlainObject:()=>T9,isObject:()=>U3,hexToUint8Array:()=>bM0,getSizableOrigin:()=>jY,getParsedType:()=>vM0,getLengthableOrigin:()=>vY,getEnumValues:()=>TY,getElementAtPath:()=>TM0,floatSafeRemainder:()=>AF,finalizeIssue:()=>b6,extend:()=>CM0,explicitlyAborted:()=>gF,escapeRegex:()=>c$,esc:()=>bw,defineLazy:()=>U1,createTransparentProxy:()=>RM0,cloneDef:()=>PM0,clone:()=>f6,cleanRegex:()=>EY,cleanEnum:()=>xM0,captureStackTrace:()=>nw,cached:()=>rI,base64urlToUint8Array:()=>kM0,base64ToUint8Array:()=>af,assignProp:()=>P9,assertNotEqual:()=>OM0,assertNever:()=>NM0,assertIs:()=>FM0,assertEqual:()=>DM0,assert:()=>MM0,allowsEval:()=>TF,aborted:()=>E9,NUMBER_FORMAT_RANGES:()=>vF,Class:()=>ef,BIGINT_FORMAT_RANGES:()=>RF});function DM0($){return $}function OM0($){return $}function FM0($){}function NM0($){throw Error("Unexpected value in exhaustive check")}function MM0($){}function TY($){let I=Object.values($).filter((q)=>typeof q==="number");return Object.entries($).filter(([q,U])=>I.indexOf(+q)===-1).map(([q,U])=>U)}function z0($,I="|"){return $.map((z)=>X0(z)).join(I)}function oI($,I){if(typeof I==="bigint")return I.toString();return I}function rI($){return{get value(){{let z=$();return Object.defineProperty(this,"value",{value:z}),z}throw Error("cached value already set")}}}function A9($){return $===null||$===void 0}function EY($){let I=$.startsWith("^")?1:0,z=$.endsWith("$")?$.length-1:$.length;return $.slice(I,z)}function AF($,I){let z=$/I,q=Math.round(z),U=Number.EPSILON*Math.max(Math.abs(z),1);if(Math.abs(z-q)<U)return 0;return z-q}function U1($,I,z){let q=void 0;Object.defineProperty($,I,{get(){if(q===tf)return;if(q===void 0)q=tf,q=z();return q},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function AM0($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function P9($,I,z){Object.defineProperty($,I,{value:z,writable:!0,enumerable:!0,configurable:!0})}function M5(...$){let I={};for(let z of $){let q=Object.getOwnPropertyDescriptors(z);Object.assign(I,q)}return Object.defineProperties({},I)}function PM0($){return M5($._zod.def)}function TM0($,I){if(!I)return $;return I.reduce((z,q)=>z?.[q],$)}function EM0($){let I=Object.keys($),z=I.map((q)=>$[q]);return Promise.all(z).then((q)=>{let U={};for(let Y=0;Y<I.length;Y++)U[I[Y]]=q[Y];return U})}function BM0($=10){let z=Line truncated
`)}var $b=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,oI,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},RY,z$;var hF=K0(()=>{q3();h0();RY=r("$ZodError",$b),z$=r("$ZodError",$b,{Parent:Error})});var aI=($)=>(I,z,q,U)=>{let Y=q?{...q,async:!1}:{async:!1},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)throw new S8;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((K)=>b6(K,Y,E4())));throw nw(Q,U?.callee),Q}return J.value},CY,sI=($)=>async(I,z,q,U)=>{let Y=q?{...q,async:!0}:{async:!0},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)J=await J;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((K)=>b6(K,Y,E4())));throw nw(Q,U?.callee),Q}return J.value},hY,eI=($)=>(I,z,q)=>{let U=q?{...q,async:!1}:{async:!1},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)throw new S8;return Y.issues.length?{success:!1,error:new($??RY)(Y.issues.map((J)=>b6(J,U,E4())))}:{success:!0,data:Y.value}},$z,Iz=($)=>async(I,z,q)=>{let U=q?{...q,async:!0}:{async:!0},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)Y=await Y;return Y.issues.length?{success:!1,error:new $(Y.issues.map((J)=>b6(J,U,E4())))}:{success:!0,data:Y.value}},SY,iw=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return aI($)(I,z,U)},zb,pw=($)=>(I,z,q)=>{return aI($)(I,z,q)},qb,cw=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return sI($)(I,z,U)},Ub,dw=($)=>async(I,z,q)=>{return sI($)(I,z,q)},Yb,mw=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return eI($)(I,z,U)},Jb,lw=($)=>(I,z,q)=>{return eI($)(I,z,q)},Qb,ow=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return Iz($)(I,z,U)},Kb,rw=($)=>async(I,z,q)=>{return Iz($)(I,z,q)},wb;var SF=K0(()=>{q3();hF();h0();CY=aI(z$),hY=sI(z$),$z=eI(z$),SY=Iz(z$),zb=iw(z$),qb=pw(z$),Ub=cw(z$),Yb=dw(z$),Jb=mw(z$),Qb=lw(z$),Kb=ow(z$),wb=rw(z$)});var P$={};A$(P$,{xid:()=>kF,uuid7:()=>mM0,uuid6:()=>dM0,uuid4:()=>cM0,uuid:()=>Y3,uppercase:()=>wN,unicodeEmail:()=>Gb,undefined:()=>QN,ulid:()=>xF,time:()=>$N,string:()=>zN,sha512_hex:()=>VA0,sha512_base64url:()=>XA0,sha512_base64:()=>ZA0,sha384_hex:()=>GA0,sha384_base64url:()=>WA0,sha384_base64:()=>HA0,sha256_hex:()=>QA0,sha256_base64url:()=>wA0,sha256_base64:()=>KA0,sha1_hex:()=>UA0,sha1_base64url:()=>JA0,sha1_base64:()=>YA0,rfc5322Email:()=>oM0,number:()=>yY,null:()=>JN,nanoid:()=>bF,md5_hex:()=>IA0,md5_base64url:()=>qA0,md5_base64:()=>zA0,mac:()=>lF,lowercase:()=>KN,ksuid:()=>fF,ipv6:()=>mF,ipv4:()=>dF,integer:()=>UN,idnEmail:()=>rM0,httpProtocol:()=>aF,html5Email:()=>lM0,hostname:()=>sM0,hex:()=>$A0,guid:()=>iF,extendedDuration:()=>pM0,emoji:()=>cF,email:()=>pF,e164:()=>sF,duration:()=>nF,domain:()=>eM0,datetime:()=>IN,date:()=>eF,cuid2:()=>uF,cuid:()=>yF,cidrv6:()=>rF,cidrv4:()=>oF,browserEmail:()=>tM0,boolean:()=>YN,bigint:()=>qN,base64url:()=>tw,base64:()=>tF});function cF(){return new RegExp(aM0,"u")}function Wb($){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 $N($){return new RegExp(`^${Wb($)}$`)}function IN($){let I=Wb({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let q=`${I}(?:${z.join("|")})`;return new RegExp(`^${Hb}T(?:${q})$`)}function uY($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function xY($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var yF,uF,xF,kF,fF,bF,nF,pM0,iF,Y3=($)=>{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})$`)},cM0,dM0,mM0,pF,lM0,oM0,Gb,rM0,tM0,aM0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dF,mF,lF=($)=>{let I=c$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},oF,rF,tF,tw,sM0,eM0,aF,sF,Hb="(?:(?:\\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])))",eF,zN=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},qN,UN,yY,YN,JN,QN,KN,wN,$A0,IA0,zA0,qA0,UA0,YA0,JA0,QA0,KA0,wA0,GA0,HA0,WA0,VA0,ZA0,XA0;var aw=K0(()=>{h0();yF=/^[cC][0-9a-z]{6,}$/,uF=/^[0-9a-z]+$/,xF=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kF=/^[0-9a-vA-V]{20}$/,fF=/^[A-Za-z0-9]{27}$/,bF=/^[a-zA-Z0-9_-]{21}$/,nF=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\dLine truncated
import{createRequire as jM0}from"node:module";var OM0=Object.create;var{getPrototypeOf:FM0,defineProperty:NF,getOwnPropertyNames:NM0}=Object;var MM0=Object.prototype.hasOwnProperty;function AM0($){return this[$]}var PM0,TM0,I3=($,I,z)=>{var q=$!=null&&typeof $==="object";if(q){var U=I?PM0??=new WeakMap:TM0??=new WeakMap,Y=U.get($);if(Y)return Y}z=$!=null?OM0(FM0($)):{};let J=I||!$||!$.__esModule?NF(z,"default",{value:$,enumerable:!0}):z;for(let Q of NM0($))if(!MM0.call(J,Q))NF(J,Q,{get:AM0.bind($,Q),enumerable:!0});if(q)U.set($,J);return J};var F=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var EM0=($)=>$;function BM0($,I){this[$]=EM0.bind(null,I)}var A$=($,I)=>{for(var z in I)NF($,z,{get:I[z],enumerable:!0,configurable:!0,set:BM0.bind(I,z)})};var K0=($,I)=>()=>($&&(I=$($=0)),I);var t=jM0(import.meta.url);function r($,I,z){function q(Q,K){if(!Q._zod)Object.defineProperty(Q,"_zod",{value:{def:K,constr:J,traits:new Set},enumerable:!1});if(Q._zod.traits.has($))return;Q._zod.traits.add($),I(Q,K);let w=J.prototype,G=Object.keys(w);for(let H=0;H<G.length;H++){let W=G[H];if(!(W in Q))Q[W]=w[W].bind(Q)}}let U=z?.Parent??Object;class Y extends U{}Object.defineProperty(Y,"name",{value:$});function J(Q){var K;let w=z?.Parent?new Y:this;q(w,Q),(K=w._zod).deferred??(K.deferred=[]);for(let G of w._zod.deferred)G();return w}return Object.defineProperty(J,"init",{value:q}),Object.defineProperty(J,Symbol.hasInstance,{value:(Q)=>{if(z?.Parent&&Q instanceof z.Parent)return!0;return Q?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}function E4($){if($)Object.assign(z3,$);return z3}var Ib,MF,AF,S8,q3,z3;var U3=K0(()=>{MF=Object.freeze({status:"aborted"});AF=Symbol("zod_brand");S8=class S8 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};q3=class q3 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(Ib=globalThis).__zod_globalConfig??(Ib.__zod_globalConfig={});z3=globalThis.__zod_globalConfig});var F0={};A$(F0,{unwrapMessage:()=>TY,uint8ArrayToHex:()=>sM0,uint8ArrayToBase64url:()=>tM0,uint8ArrayToBase64:()=>Ub,stringifyPrimitive:()=>X0,slugify:()=>EF,shallowClone:()=>jF,safeExtend:()=>cM0,required:()=>lM0,randomString:()=>xM0,propertyKeyTypes:()=>jY,promiseAllObject:()=>uM0,primitiveTypes:()=>vF,prefixIssues:()=>I$,pick:()=>nM0,partial:()=>mM0,parsedType:()=>D0,optionalKeys:()=>RF,omit:()=>iM0,objectClone:()=>hM0,numKeys:()=>kM0,nullish:()=>A9,normalizeParams:()=>P0,mergeDefs:()=>M5,merge:()=>dM0,jsonStringifyReplacer:()=>rI,joinValues:()=>z0,issue:()=>aI,isPlainObject:()=>T9,isObject:()=>Y3,hexToUint8Array:()=>aM0,getSizableOrigin:()=>vY,getParsedType:()=>fM0,getLengthableOrigin:()=>RY,getEnumValues:()=>EY,getElementAtPath:()=>yM0,floatSafeRemainder:()=>TF,finalizeIssue:()=>b6,extend:()=>pM0,explicitlyAborted:()=>CF,escapeRegex:()=>c$,esc:()=>nw,defineLazy:()=>U1,createTransparentProxy:()=>bM0,cloneDef:()=>SM0,clone:()=>f6,cleanRegex:()=>BY,cleanEnum:()=>oM0,captureStackTrace:()=>iw,cached:()=>tI,base64urlToUint8Array:()=>rM0,base64ToUint8Array:()=>qb,assignProp:()=>P9,assertNotEqual:()=>RM0,assertNever:()=>_M0,assertIs:()=>gM0,assertEqual:()=>vM0,assert:()=>CM0,allowsEval:()=>BF,aborted:()=>E9,NUMBER_FORMAT_RANGES:()=>gF,Class:()=>Yb,BIGINT_FORMAT_RANGES:()=>_F});function vM0($){return $}function RM0($){return $}function gM0($){}function _M0($){throw Error("Unexpected value in exhaustive check")}function CM0($){}function EY($){let I=Object.values($).filter((q)=>typeof q==="number");return Object.entries($).filter(([q,U])=>I.indexOf(+q)===-1).map(([q,U])=>U)}function z0($,I="|"){return $.map((z)=>X0(z)).join(I)}function rI($,I){if(typeof I==="bigint")return I.toString();return I}function tI($){return{get value(){{let z=$();return Object.defineProperty(this,"value",{value:z}),z}throw Error("cached value already set")}}}function A9($){return $===null||$===void 0}function BY($){let I=$.startsWith("^")?1:0,z=$.endsWith("$")?$.length-1:$.length;return $.slice(I,z)}function TF($,I){let z=$/I,q=Math.round(z),U=Number.EPSILON*Math.max(Math.abs(z),1);if(Math.abs(z-q)<U)return 0;return z-q}function U1($,I,z){let q=void 0;Object.defineProperty($,I,{get(){if(q===zb)return;if(q===void 0)q=zb,q=z();return q},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function hM0($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function P9($,I,z){Object.defineProperty($,I,{value:z,writable:!0,enumerable:!0,configurable:!0})}function M5(...$){let I={};for(let z of $){let q=Object.getOwnPropertyDescriptors(z);Object.assign(I,q)}return Object.defineProperties({},I)}function SM0($){return M5($._zod.def)}function yM0($,I){if(!I)return $;return I.reduce((z,q)=>z?.[q],$)}function uM0($){let I=Object.keys($),z=I.map((q)=>$[q]);return Promise.all(z).then((q)=>{let U={};for(let Y=0;Y<I.length;Y++)U[I[Y]]=q[Y];return U})}function xM0($=10){let z=Line truncated
`)}var Jb=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,rI,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},gY,z$;var yF=K0(()=>{U3();h0();gY=r("$ZodError",Jb),z$=r("$ZodError",Jb,{Parent:Error})});var sI=($)=>(I,z,q,U)=>{let Y=q?{...q,async:!1}:{async:!1},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)throw new S8;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((K)=>b6(K,Y,E4())));throw iw(Q,U?.callee),Q}return J.value},hY,eI=($)=>async(I,z,q,U)=>{let Y=q?{...q,async:!0}:{async:!0},J=I._zod.run({value:z,issues:[]},Y);if(J instanceof Promise)J=await J;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((K)=>b6(K,Y,E4())));throw iw(Q,U?.callee),Q}return J.value},SY,$z=($)=>(I,z,q)=>{let U=q?{...q,async:!1}:{async:!1},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)throw new S8;return Y.issues.length?{success:!1,error:new($??gY)(Y.issues.map((J)=>b6(J,U,E4())))}:{success:!0,data:Y.value}},Iz,zz=($)=>async(I,z,q)=>{let U=q?{...q,async:!0}:{async:!0},Y=I._zod.run({value:z,issues:[]},U);if(Y instanceof Promise)Y=await Y;return Y.issues.length?{success:!1,error:new $(Y.issues.map((J)=>b6(J,U,E4())))}:{success:!0,data:Y.value}},yY,pw=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return sI($)(I,z,U)},Kb,cw=($)=>(I,z,q)=>{return sI($)(I,z,q)},wb,dw=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return eI($)(I,z,U)},Gb,mw=($)=>async(I,z,q)=>{return eI($)(I,z,q)},Hb,lw=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return $z($)(I,z,U)},Wb,ow=($)=>(I,z,q)=>{return $z($)(I,z,q)},Vb,rw=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return zz($)(I,z,U)},Zb,tw=($)=>async(I,z,q)=>{return zz($)(I,z,q)},Xb;var uF=K0(()=>{U3();yF();h0();hY=sI(z$),SY=eI(z$),Iz=$z(z$),yY=zz(z$),Kb=pw(z$),wb=cw(z$),Gb=dw(z$),Hb=mw(z$),Wb=lw(z$),Vb=ow(z$),Zb=rw(z$),Xb=tw(z$)});var P$={};A$(P$,{xid:()=>bF,uuid7:()=>qA0,uuid6:()=>zA0,uuid4:()=>IA0,uuid:()=>J3,uppercase:()=>HN,unicodeEmail:()=>Lb,undefined:()=>wN,ulid:()=>fF,time:()=>zN,string:()=>UN,sha512_hex:()=>TA0,sha512_base64url:()=>BA0,sha512_base64:()=>EA0,sha384_hex:()=>MA0,sha384_base64url:()=>PA0,sha384_base64:()=>AA0,sha256_hex:()=>OA0,sha256_base64url:()=>NA0,sha256_base64:()=>FA0,sha1_hex:()=>XA0,sha1_base64url:()=>DA0,sha1_base64:()=>LA0,rfc5322Email:()=>YA0,number:()=>uY,null:()=>KN,nanoid:()=>iF,md5_hex:()=>WA0,md5_base64url:()=>ZA0,md5_base64:()=>VA0,mac:()=>rF,lowercase:()=>GN,ksuid:()=>nF,ipv6:()=>oF,ipv4:()=>lF,integer:()=>JN,idnEmail:()=>JA0,httpProtocol:()=>eF,html5Email:()=>UA0,hostname:()=>wA0,hex:()=>HA0,guid:()=>cF,extendedDuration:()=>$A0,emoji:()=>mF,email:()=>dF,e164:()=>$N,duration:()=>pF,domain:()=>GA0,datetime:()=>qN,date:()=>IN,cuid2:()=>kF,cuid:()=>xF,cidrv6:()=>aF,cidrv4:()=>tF,browserEmail:()=>QA0,boolean:()=>QN,bigint:()=>YN,base64url:()=>aw,base64:()=>sF});function mF(){return new RegExp(KA0,"u")}function Ob($){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 zN($){return new RegExp(`^${Ob($)}$`)}function qN($){let I=Ob({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let q=`${I}(?:${z.join("|")})`;return new RegExp(`^${Db}T(?:${q})$`)}function xY($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function kY($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var xF,kF,fF,bF,nF,iF,pF,$A0,cF,J3=($)=>{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})$`)},IA0,zA0,qA0,dF,UA0,YA0,Lb,JA0,QA0,KA0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lF,oF,rF=($)=>{let I=c$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},tF,aF,sF,aw,wA0,GA0,eF,$N,Db="(?:(?:\\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])))",IN,UN=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},YN,JN,uY,QN,KN,wN,GN,HN,HA0,WA0,VA0,ZA0,XA0,LA0,DA0,OA0,FA0,NA0,MA0,AA0,PA0,TA0,EA0,BA0;var sw=K0(()=>{h0();xF=/^[cC][0-9a-z]{6,}$/,kF=/^[0-9a-z]+$/,fF=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bF=/^[0-9a-vA-V]{20}$/,nF=/^[A-Za-z0-9]{27}$/,iF=/^[a-zA-Z0-9_-]{21}$/,pF=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\dLine truncated
`).filter((Y)=>Y),q=Math.min(...z.map((Y)=>Y.length-Y.trimStart().length)),U=z.map((Y)=>Y.slice(q)).map((Y)=>" ".repeat(this.indent*2)+Y);for(let Y of U)this.content.push(Y)}compile(){let $=Function,I=this?.args,q=[...(this?.content??[""]).map((U)=>` ${U}`)];return new $(...I,q.join(`
`))}}var vN;var RN=K0(()=>{vN={major:4,minor:4,patch:3}});function aN($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function gb($){if(!tw.test($))return!1;let I=$.replace(/[-_]/g,(q)=>q==="-"?"+":"/"),z=I.padEnd(Math.ceil(I.length/4)*4,"=");return aN(z)}function _b($,I=null){try{let z=$.split(".");if(z.length!==3)return!1;let[q]=z;if(!q)return!1;let U=JSON.parse(atob(q));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(I&&(!("alg"in U)||U.alg!==I))return!1;return!0}catch{return!1}}function Lb($,I,z){if($.issues.length)I.issues.push(...I$(z,$.issues));I.value[z]=$.value}function YG($,I,z,q,U,Y){let J=z in q;if($.issues.length){if(U&&Y&&!J)return;I.issues.push(...I$(z,$.issues))}if(!J&&!U){if(!$.issues.length)I.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(J)I.value[z]=void 0}else I.value[z]=$.value}function Cb($){let I=Object.keys($.shape);for(let q of I)if(!$.shape?.[q]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${q}": expected a Zod schema`);let z=jF($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(z)}}function hb($,I,z,q,U,Y){let J=[],Q=U.keySet,K=U.catchall._zod,w=K.def.type,G=K.optin==="optional",H=K.optout==="optional";for(let W in I){if(W==="__proto__")continue;if(Q.has(W))continue;if(w==="never"){J.push(W);continue}let V=K.run({value:I[W],issues:[]},q);if(V instanceof Promise)$.push(V.then((X)=>YG(X,z,W,I,G,H)));else YG(V,z,W,I,G,H)}if(J.length)z.issues.push({code:"unrecognized_keys",keys:J,input:I,inst:Y});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function Db($,I,z,q){for(let Y of $)if(Y.issues.length===0)return I.value=Y.value,I;let U=$.filter((Y)=>!E9(Y));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>b6(J,q,E4())))}),I}function Ob($,I,z,q){let U=$.filter((Y)=>Y.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>b6(J,q,E4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:[],inclusive:!1});return I}function gN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(T9($)&&T9(I)){let z=Object.keys(I),q=Object.keys($).filter((Y)=>z.indexOf(Y)!==-1),U={...$,...I};for(let Y of q){let J=gN($[Y],I[Y]);if(!J.valid)return{valid:!1,mergeErrorPath:[Y,...J.mergeErrorPath]};U[Y]=J.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let q=0;q<$.length;q++){let U=$[q],Y=I[q],J=gN(U,Y);if(!J.valid)return{valid:!1,mergeErrorPath:[q,...J.mergeErrorPath]};z.push(J.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function Fb($,I,z){let q=new Map,U;for(let Q of I.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let K of Q.keys){if(!q.has(K))q.set(K,{});q.get(K).l=!0}}else $.issues.push(Q);for(let Q of z.issues)if(Q.code==="unrecognized_keys")for(let K of Q.keys){if(!q.has(K))q.set(K,{});q.get(K).r=!0}else $.issues.push(Q);let Y=[...q].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(Y.length&&U)$.issues.push({...U,keys:Y});if(E9($))return $;let J=gN(I.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}function Nb($,I){for(let z=$.length-1;z>=0;z--)if($[z]._zod[I]!=="optional")return z+1;return 0}function Mb($,I,z){if($.issues.length)I.issues.push(...I$(z,$.issues));I.value[z]=$.value}function Ab($,I,z,q,U){for(let Y=0;Y<z.length;Y++){let J=$[Y],Q=Y<q.length;if(J.issues.length){if(!Q&&Y>=U){I.value.length=Y;break}I.issues.push(...I$(Y,J.issues))}I.value[Y]=J.value}for(let Y=I.value.length-1;Y>=q.length;Y--)if(z[Y]._zod.optout==="optional"&&I.value[Y]===void 0)I.value.length=Y;else break;return I}function Pb($,I,z,q,U,Y,J){if($.issues.length)if(BY.has(typeof q))z.issues.push(...I$(q,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:U,inst:Y,issues:$.issues.map((Q)=>b6(Q,J,E4()))});if(I.issues.length)if(BY.has(typeof q))z.issues.push(...I$(q,I.issues));else z.issues.push({origin:"map",code:"invalid_element",input:U,inst:Y,key:q,issues:I.issues.map((Q)=>b6(Q,J,E4()))});z.value.set($.value,I.value)}function Tb($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}function Eb($,I){if(I===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Bb($,I){if($.value===void 0)$.value=I.defaultValue;return $}function jb($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}function zG($,I,z){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues,f Line truncated
`))}}var gN;var _N=K0(()=>{gN={major:4,minor:4,patch:3}});function eN($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function ub($){if(!aw.test($))return!1;let I=$.replace(/[-_]/g,(q)=>q==="-"?"+":"/"),z=I.padEnd(Math.ceil(I.length/4)*4,"=");return eN(z)}function xb($,I=null){try{let z=$.split(".");if(z.length!==3)return!1;let[q]=z;if(!q)return!1;let U=JSON.parse(atob(q));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(I&&(!("alg"in U)||U.alg!==I))return!1;return!0}catch{return!1}}function Ab($,I,z){if($.issues.length)I.issues.push(...I$(z,$.issues));I.value[z]=$.value}function JG($,I,z,q,U,Y){let J=z in q;if($.issues.length){if(U&&Y&&!J)return;I.issues.push(...I$(z,$.issues))}if(!J&&!U){if(!$.issues.length)I.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(J)I.value[z]=void 0}else I.value[z]=$.value}function kb($){let I=Object.keys($.shape);for(let q of I)if(!$.shape?.[q]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${q}": expected a Zod schema`);let z=RF($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(z)}}function fb($,I,z,q,U,Y){let J=[],Q=U.keySet,K=U.catchall._zod,w=K.def.type,G=K.optin==="optional",H=K.optout==="optional";for(let W in I){if(W==="__proto__")continue;if(Q.has(W))continue;if(w==="never"){J.push(W);continue}let V=K.run({value:I[W],issues:[]},q);if(V instanceof Promise)$.push(V.then((X)=>JG(X,z,W,I,G,H)));else JG(V,z,W,I,G,H)}if(J.length)z.issues.push({code:"unrecognized_keys",keys:J,input:I,inst:Y});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function Pb($,I,z,q){for(let Y of $)if(Y.issues.length===0)return I.value=Y.value,I;let U=$.filter((Y)=>!E9(Y));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>b6(J,q,E4())))}),I}function Tb($,I,z,q){let U=$.filter((Y)=>Y.issues.length===0);if(U.length===1)return I.value=U[0].value,I;if(U.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:$.map((Y)=>Y.issues.map((J)=>b6(J,q,E4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:[],inclusive:!1});return I}function CN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(T9($)&&T9(I)){let z=Object.keys(I),q=Object.keys($).filter((Y)=>z.indexOf(Y)!==-1),U={...$,...I};for(let Y of q){let J=CN($[Y],I[Y]);if(!J.valid)return{valid:!1,mergeErrorPath:[Y,...J.mergeErrorPath]};U[Y]=J.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let q=0;q<$.length;q++){let U=$[q],Y=I[q],J=CN(U,Y);if(!J.valid)return{valid:!1,mergeErrorPath:[q,...J.mergeErrorPath]};z.push(J.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function Eb($,I,z){let q=new Map,U;for(let Q of I.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let K of Q.keys){if(!q.has(K))q.set(K,{});q.get(K).l=!0}}else $.issues.push(Q);for(let Q of z.issues)if(Q.code==="unrecognized_keys")for(let K of Q.keys){if(!q.has(K))q.set(K,{});q.get(K).r=!0}else $.issues.push(Q);let Y=[...q].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(Y.length&&U)$.issues.push({...U,keys:Y});if(E9($))return $;let J=CN(I.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}function Bb($,I){for(let z=$.length-1;z>=0;z--)if($[z]._zod[I]!=="optional")return z+1;return 0}function jb($,I,z){if($.issues.length)I.issues.push(...I$(z,$.issues));I.value[z]=$.value}function vb($,I,z,q,U){for(let Y=0;Y<z.length;Y++){let J=$[Y],Q=Y<q.length;if(J.issues.length){if(!Q&&Y>=U){I.value.length=Y;break}I.issues.push(...I$(Y,J.issues))}I.value[Y]=J.value}for(let Y=I.value.length-1;Y>=q.length;Y--)if(z[Y]._zod.optout==="optional"&&I.value[Y]===void 0)I.value.length=Y;else break;return I}function Rb($,I,z,q,U,Y,J){if($.issues.length)if(jY.has(typeof q))z.issues.push(...I$(q,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:U,inst:Y,issues:$.issues.map((Q)=>b6(Q,J,E4()))});if(I.issues.length)if(jY.has(typeof q))z.issues.push(...I$(q,I.issues));else z.issues.push({origin:"map",code:"invalid_element",input:U,inst:Y,key:q,issues:I.issues.map((Q)=>b6(Q,J,E4()))});z.value.set($.value,I.value)}function gb($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}function _b($,I){if(I===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Cb($,I){if($.value===void 0)$.value=I.defaultValue;return $}function hb($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}function qG($,I,z){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues,f Line truncated
if (${M}.issues.length) {
if (${v} in input) {
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
@@ -60,88 +60,88 @@ import{createRequire as LM0}from"node:module";var QM0=Object.create;var{getProto
newResult[${v}] = ${M}.value;
}
`)}V.write("payload.value = newResult;"),V.write("return payload;");let A=V.compile();return(T,M)=>A(W,T,M)},Y,J=U3,Q=!I3.jitless,w=Q&&TF.value,G=I.catchall,H;$._zod.parse=(W,V)=>{H??(H=q.value);let X=W.value;if(!J(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(Q&&w&&V?.async===!1&&V.jitless!==!0){if(!Y)Y=U(I.shape);if(W=Y(W,V),!G)return W;return hb([],X,W,V,H,$)}return z(W,V)}});fY=r("$ZodUnion",($,I)=>{d0.init($,I),U1($._zod,"optin",()=>I.options.some((q)=>q._zod.optin==="optional")?"optional":void 0),U1($._zod,"optout",()=>I.options.some((q)=>q._zod.optout==="optional")?"optional":void 0),U1($._zod,"values",()=>{if(I.options.every((q)=>q._zod.values))return new Set(I.options.flatMap((q)=>Array.from(q._zod.values)));return}),U1($._zod,"pattern",()=>{if(I.options.every((q)=>q._zod.pattern)){let q=I.options.map((U)=>U._zod.pattern);return new RegExp(`^(${q.map((U)=>EY(U.source)).join("|")})$`)}return});let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let K=Q._zod.run({value:q.value,issues:[]},U);if(K instanceof Promise)J.push(K),Y=!0;else{if(K.issues.length===0)return K;J.push(K)}}if(!Y)return Db(J,q,$,U);return Promise.all(J).then((Q)=>{return Db(Q,q,$,U)})}});XM=r("$ZodXor",($,I)=>{fY.init($,I),I.inclusive=!1;let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let K=Q._zod.run({value:q.value,issues:[]},U);if(K instanceof Promise)J.push(K),Y=!0;else J.push(K)}if(!Y)return Ob(J,q,$,U);return Promise.all(J).then((Q)=>{return Ob(Q,q,$,U)})}}),LM=r("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,fY.init($,I);let z=$._zod.parse;U1($._zod,"propValues",()=>{let U={};for(let Y of I.options){let J=Y._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Y)}"`);for(let[Q,K]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let w of K)U[Q].add(w)}}return U});let q=rI(()=>{let U=I.options,Y=new Map;for(let J of U){let Q=J._zod.propValues?.[I.discriminator];if(!Q||Q.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(J)}"`);for(let K of Q){if(Y.has(K))throw Error(`Duplicate discriminator value "${String(K)}"`);Y.set(K,J)}}return Y});$._zod.parse=(U,Y)=>{let J=U.value;if(!U3(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let Q=q.value.get(J?.[I.discriminator]);if(Q)return Q._zod.run(U,Y);if(I.unionFallback||Y.direction==="backward")return z(U,Y);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(q.value.keys()),input:J,path:[I.discriminator],inst:$}),U}}),DM=r("$ZodIntersection",($,I)=>{d0.init($,I),$._zod.parse=(z,q)=>{let U=z.value,Y=I.left._zod.run({value:U,issues:[]},q),J=I.right._zod.run({value:U,issues:[]},q);if(Y instanceof Promise||J instanceof Promise)return Promise.all([Y,J]).then(([K,w])=>{return Fb(z,K,w)});return Fb(z,Y,J)}});KG=r("$ZodTuple",($,I)=>{d0.init($,I);let z=I.items;$._zod.parse=(q,U)=>{let Y=q.value;if(!Array.isArray(Y))return q.issues.push({input:Y,inst:$,expected:"tuple",code:"invalid_type"}),q;q.value=[];let J=[],Q=Nb(z,"optin"),K=Nb(z,"optout");if(!I.rest){if(Y.length<Q)return q.issues.push({code:"too_small",minimum:Q,inclusive:!0,input:Y,inst:$,origin:"array"}),q;if(Y.length>z.length)q.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:Y,inst:$,origin:"array"})}let w=Array(z.length);for(let G=0;G<z.length;G++){let H=z[G]._zod.run({value:Y[G],issues:[]},U);if(H instanceof Promise)J.push(H.then((W)=>{w[G]=W}));else w[G]=H}if(I.rest){let G=z.length-1,H=Y.slice(z.length);for(let W of H){G++;let V=I.rest._zod.run({value:W,issues:[]},U);if(V instanceof Promise)J.push(V.then((X)=>Mb(X,q,G)));else Mb(V,q,G)}}if(J.length)return Promise.all(J).then(()=>Ab(w,q,z,Y,K));return Ab(w,q,z,Y,K)}});OM=r("$ZodRecord",($,I)=>{d0.init($,I),$._zod.parse=(z,q)=>{let U=z.value;if(!T9(U))return z.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),z;let Y=[],J=I.keyType._zod.values;if(J){z.value={};let Q=new Set;for(let w of J)if(typeof w==="string"||typeof w==="number"||typeof w==="symbol"){Q.add(typeof w==="number"?w.toString():w);let G=I.keyType._zod.run({value:w,issues:[]},q);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(G.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((V)=>b6(V,q,E4())),input:w,path:[w],inst:$});continue}let H=G.value,W=I.valueType._zod.run({value:U[w],issues:[]},q);if(W instanceof Promise)Y.push(W.then((V)=>{if(V.issues.length)z.issues.push(...I$(w,V.issues));z.value[H]=V.value}));else{if(W.issues.length)z.issues.push(...I$(w,W.issues));z.value[H]=W.value}}let K;for(let w in U)if(!Q.has(w))K=K??[],K.push(w);if(K&&K.length>0)z.issues.push({code:"unrecognize Line truncated
`)}V.write("payload.value = newResult;"),V.write("return payload;");let A=V.compile();return(T,M)=>A(W,T,M)},Y,J=Y3,Q=!z3.jitless,w=Q&&BF.value,G=I.catchall,H;$._zod.parse=(W,V)=>{H??(H=q.value);let X=W.value;if(!J(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(Q&&w&&V?.async===!1&&V.jitless!==!0){if(!Y)Y=U(I.shape);if(W=Y(W,V),!G)return W;return fb([],X,W,V,H,$)}return z(W,V)}});bY=r("$ZodUnion",($,I)=>{d0.init($,I),U1($._zod,"optin",()=>I.options.some((q)=>q._zod.optin==="optional")?"optional":void 0),U1($._zod,"optout",()=>I.options.some((q)=>q._zod.optout==="optional")?"optional":void 0),U1($._zod,"values",()=>{if(I.options.every((q)=>q._zod.values))return new Set(I.options.flatMap((q)=>Array.from(q._zod.values)));return}),U1($._zod,"pattern",()=>{if(I.options.every((q)=>q._zod.pattern)){let q=I.options.map((U)=>U._zod.pattern);return new RegExp(`^(${q.map((U)=>BY(U.source)).join("|")})$`)}return});let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let K=Q._zod.run({value:q.value,issues:[]},U);if(K instanceof Promise)J.push(K),Y=!0;else{if(K.issues.length===0)return K;J.push(K)}}if(!Y)return Pb(J,q,$,U);return Promise.all(J).then((Q)=>{return Pb(Q,q,$,U)})}});DM=r("$ZodXor",($,I)=>{bY.init($,I),I.inclusive=!1;let z=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(q,U)=>{if(z)return z(q,U);let Y=!1,J=[];for(let Q of I.options){let K=Q._zod.run({value:q.value,issues:[]},U);if(K instanceof Promise)J.push(K),Y=!0;else J.push(K)}if(!Y)return Tb(J,q,$,U);return Promise.all(J).then((Q)=>{return Tb(Q,q,$,U)})}}),OM=r("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,bY.init($,I);let z=$._zod.parse;U1($._zod,"propValues",()=>{let U={};for(let Y of I.options){let J=Y._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Y)}"`);for(let[Q,K]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let w of K)U[Q].add(w)}}return U});let q=tI(()=>{let U=I.options,Y=new Map;for(let J of U){let Q=J._zod.propValues?.[I.discriminator];if(!Q||Q.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(J)}"`);for(let K of Q){if(Y.has(K))throw Error(`Duplicate discriminator value "${String(K)}"`);Y.set(K,J)}}return Y});$._zod.parse=(U,Y)=>{let J=U.value;if(!Y3(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let Q=q.value.get(J?.[I.discriminator]);if(Q)return Q._zod.run(U,Y);if(I.unionFallback||Y.direction==="backward")return z(U,Y);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(q.value.keys()),input:J,path:[I.discriminator],inst:$}),U}}),FM=r("$ZodIntersection",($,I)=>{d0.init($,I),$._zod.parse=(z,q)=>{let U=z.value,Y=I.left._zod.run({value:U,issues:[]},q),J=I.right._zod.run({value:U,issues:[]},q);if(Y instanceof Promise||J instanceof Promise)return Promise.all([Y,J]).then(([K,w])=>{return Eb(z,K,w)});return Eb(z,Y,J)}});wG=r("$ZodTuple",($,I)=>{d0.init($,I);let z=I.items;$._zod.parse=(q,U)=>{let Y=q.value;if(!Array.isArray(Y))return q.issues.push({input:Y,inst:$,expected:"tuple",code:"invalid_type"}),q;q.value=[];let J=[],Q=Bb(z,"optin"),K=Bb(z,"optout");if(!I.rest){if(Y.length<Q)return q.issues.push({code:"too_small",minimum:Q,inclusive:!0,input:Y,inst:$,origin:"array"}),q;if(Y.length>z.length)q.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:Y,inst:$,origin:"array"})}let w=Array(z.length);for(let G=0;G<z.length;G++){let H=z[G]._zod.run({value:Y[G],issues:[]},U);if(H instanceof Promise)J.push(H.then((W)=>{w[G]=W}));else w[G]=H}if(I.rest){let G=z.length-1,H=Y.slice(z.length);for(let W of H){G++;let V=I.rest._zod.run({value:W,issues:[]},U);if(V instanceof Promise)J.push(V.then((X)=>jb(X,q,G)));else jb(V,q,G)}}if(J.length)return Promise.all(J).then(()=>vb(w,q,z,Y,K));return vb(w,q,z,Y,K)}});NM=r("$ZodRecord",($,I)=>{d0.init($,I),$._zod.parse=(z,q)=>{let U=z.value;if(!T9(U))return z.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),z;let Y=[],J=I.keyType._zod.values;if(J){z.value={};let Q=new Set;for(let w of J)if(typeof w==="string"||typeof w==="number"||typeof w==="symbol"){Q.add(typeof w==="number"?w.toString():w);let G=I.keyType._zod.run({value:w,issues:[]},q);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(G.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((V)=>b6(V,q,E4())),input:w,path:[w],inst:$});continue}let H=G.value,W=I.valueType._zod.run({value:U[w],issues:[]},q);if(W instanceof Promise)Y.push(W.then((V)=>{if(V.issues.length)z.issues.push(...I$(w,V.issues));z.value[H]=V.value}));else{if(W.issues.length)z.issues.push(...I$(w,W.issues));z.value[H]=W.value}}let K;for(let w in U)if(!Q.has(w))K=K??[],K.push(w);if(K&&K.length>0)z.issues.push({code:"unrecognize Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let Q=J[1];if(I===J[0]){Y(J);continue}if($.external){let w=$.external.registry.get(J[0])?.id;if(I!==J[0]&&w){Y(J);continue}}if($.metadataRegistry.get(J[0])?.id){Y(J);continue}if(Q.cycle){Y(J);continue}if(Q.count>1){if($.reused==="ref"){Y(J);continue}}}}function g9($,I){let z=$.seen.get(I);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let q=(Q)=>{let K=$.seen.get(Q);if(K.ref===null)return;let w=K.def??K.schema,G={...w},H=K.ref;if(K.ref=null,H){q(H);let V=$.seen.get(H),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))w.allOf=w.allOf??[],w.allOf.push(X);else Object.assign(w,X);if(Object.assign(w,G),Q._zod.parent===H)for(let D in w){if(D==="$ref"||D==="allOf")continue;if(!(D in G))delete w[D]}if(X.$ref&&V.def)for(let D in w){if(D==="$ref"||D==="allOf")continue;if(D in V.def&&JSON.stringify(w[D])===JSON.stringify(V.def[D]))delete w[D]}}let W=Q._zod.parent;if(W&&W!==H){q(W);let V=$.seen.get(W);if(V?.schema.$ref){if(w.$ref=V.schema.$ref,V.def)for(let X in w){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(w[X])===JSON.stringify(V.def[X]))delete w[X]}}}$.override({zodSchema:Q,jsonSchema:w,path:K.path??[]})};for(let Q of[...$.seen.entries()].reverse())q(Q[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Q=$.external.registry.get(I)?.id;if(!Q)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(Q)}Object.assign(U,z.def??z.schema);let Y=$.metadataRegistry.get(I)?.id;if(Y!==void 0&&U.id===Y)delete U.id;let J=$.external?.defs??{};for(let Q of $.seen.entries()){let K=Q[1];if(K.def&&K.defId){if(K.def.id===K.defId)delete K.def.id;J[K.defId]=K.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")U.$defs=J;else U.definitions=J;try{let Q=JSON.parse(JSON.stringify(U));return Object.defineProperty(Q,"~standard",{value:{...I["~standard"],jsonSchema:{input:Dz(I,"input",$.processors),output:Dz(I,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function i6($,I){let z=I??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let q=$._zod.def;if(q.type==="transform")return!0;if(q.type==="array")return i6(q.element,z);if(q.type==="set")return i6(q.valueType,z);if(q.type==="lazy")return i6(q.getter(),z);if(q.type==="promise"||q.type==="optional"||q.type==="nonoptional"||q.type==="nullable"||q.type==="readonly"||q.type==="default"||q.type==="prefault")return i6(q.innerType,z);if(q.type==="intersection")return i6(q.left,z)||i6(q.right,z);if(q.type==="record"||q.type==="map")return i6(q.keyType,z)||i6(q.valueType,z);if(q.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return i6(q.in,z)||i6(q.out,z)}if(q.type==="object"){for(let U in q.shape)if(i6(q.shape[U],z))return!0;return!1}if(q.type==="union"){for(let U of q.options)if(i6(U,z))return!0;return!1}if(q.type==="tuple"){for(let U of q.items)if(i6(U,z))return!0;if(q.rest&&i6(q.rest,z))return!0;return!1}return!1}var vP=($,I={})=>(z)=>{let q=v9({...z,processors:I});return x1($,q),R9(q,$),g9(q,$)},Dz=($,I,z={})=>(q)=>{let{libraryOptions:U,target:Y}=q??{},J=v9({...U??{},target:Y,io:I,processors:z});return x1($,J),R9(J,$),g9(J,$)};var rY=K0(()=>{mY()});function bG($,I){if("_idmap"in $){let q=$,U=v9({...I,processors:xG}),Y={};for(let K of q._idmap.entries()){let[w,G]=K;x1(G,U)}let J={},Q={registry:q,uri:I?.uri,defs:Y};U.external=Q;for(let K of q._idmap.entries()){let[w,G]=K;R9(U,G),J[w]=g9(U,G)}if(Object.keys(Y).length>0){let K=U.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[K]:Y}}return{schemas:J}}let z=v9({...I,processors:xG});return x1($,z),R9(z,$),g9(z,$)}var xP0,RP=($,I,z,q)=>{let U=z;U.type="string";let{minimum:Y,maximum:J,format:Q,patterns:K,contentEncoding:w}=$._zod.bag;if(typeof Y==="number")U.minLength=Y;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=xP0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(w)U.contentEncoding=w;if(K&&K.size>0){let G=[...K];if(G.length===1)U.pattern=G[0].source;else if(G.length>1)U.allOf=[...G.map((H)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:H.source}))]}},gP=($,I,z,q)=>{let U=z,{minimum:Y,maximum:J,format:Q,multipleOf:K,exclusiveMaximum:w,exclusiveMinimum:G}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let H=typeof G==="number"&&G>=(Y??Number.NEGATIVE_INFINITY),W=typeof w==="number"&&w<=(J??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(H)if(V)U.minimum=G,U.exclusiveMinimum=!0;else U.exclusiveMinimLine truncated
`:""},this._extScope=$,this._scope=new Z8.Scope({parent:$}),this._nodes=[new xp]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let z=this._extScope.value($,I);return(this._values[z.prefix]||(this._values[z.prefix]=new Set)).add(z),z}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,z,q){let U=this._scope.toName(I);if(z!==void 0&&q)this._constants[U.str]=z;return this._leafNode(new _p($,U,z)),U}const($,I,z){return this._def(Z8.varKinds.const,$,I,z)}let($,I,z){return this._def(Z8.varKinds.let,$,I,z)}var($,I,z){return this._def(Z8.varKinds.var,$,I,z)}assign($,I,z){return this._leafNode(new rE($,I,z))}add($,I){return this._leafNode(new Cp($,J$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X1.nil)this._leafNode(new up($));return this}object(...$){let I=["{"];for(let[z,q]of $){if(I.length>1)I.push(",");if(I.push(z),z!==q||this.opts.es5)I.push(":"),(0,X1.addCodeArg)(I,q)}return I.push("}"),new X1._Code(I)}if($,I,z){if(this._blockNode(new E5($)),I&&z)this.code(I).else().code(z).endIf();else if(I)this.code(I).endIf();else if(z)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new E5($))}else(){return this._elseNode(new jJ)}endIf(){return this._endBlockNode(E5,jJ)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new kp($),I)}forRange($,I,z,q,U=this.opts.es5?Z8.varKinds.var:Z8.varKinds.let){let Y=this._scope.toName($);return this._for(new fp(U,Y,I,z),()=>q(Y))}forOf($,I,z,q=Z8.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let Y=I instanceof X1.Name?I:this.var("_arr",I);return this.forRange("_i",0,X1._`${Y}.length`,(J)=>{this.var(U,X1._`${Y}[${J}]`),z(U)})}return this._for(new lE("of",q,U,I),()=>z(U))}forIn($,I,z,q=this.opts.es5?Z8.varKinds.var:Z8.varKinds.const){if(this.opts.ownProperties)return this.forOf($,X1._`Object.keys(${I})`,z);let U=this._scope.toName($);return this._for(new lE("in",q,U,I),()=>z(U))}endFor(){return this._endBlockNode(Cz)}label($){return this._leafNode(new hp($))}break($){return this._leafNode(new Sp($))}return($){let I=new xH;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(xH)}try($,I,z){if(!I&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let q=new bp;if(this._blockNode(q),this.code($),I){let U=this.name("e");this._currNode=q.catch=new kH(U),I(U)}if(z)this._currNode=q.finally=new fH,this.code(z);return this._endBlockNode(kH,fH)}throw($){return this._leafNode(new yp($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw Error("CodeGen: not in self-balancing block");let z=this._nodes.length-I;if(z<0||$!==void 0&&z!==$)throw Error(`CodeGen: wrong number of nodes: ${z} vs ${$} expected`);return this._nodes.length=I,this}func($,I=X1.nil,z,q){if(this._blockNode(new uH($,I,z)),q)this.code(q).endFunc();return this}endFunc(){return this._endBlockNode(uH)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let z=this._currNode;if(z instanceof $||I&&z instanceof I)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof E5))throw Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}J$.CodeGen=np;function H3($,I){for(let z in I)$[z]=($[z]||0)+(I[z]||0);return $}function bH($,I){return I instanceof X1._CodeOrName?H3($,I.names):$}function hz($,I,z){if($ instanceof X1.Name)return q($);if(!U($))return $;return new X1._Code($._items.reduce((Y,J)=>{if(J instanceof X1.Name)J=q(J);if(J instanceof X1._Code)Y.push(...J._items);else Y.push(J);return Y},[]));function q(Y){let J=z[Y.str];if(J===void 0||I[Y.str]!==1)return Y;return delete I[Y.str],J}function U(Y){return Y instanceof X1._Code&&Y._items.some((J)=>J instanceof X1.Name&&I[J.str]===1&&z[J.str]!==void 0)}}function QB0($,I){for(let z in I)$[z]=($[z]||0)-(I[z]||0)}function ip($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X1._`!${oE($)}`}J$.not=ip;var KB0=pp(J$.operators.AND);function wB0(...$){return $.reduce(KB0)}J$.and=wB0;var GB0=pp(J$.operators.OR);function HB0(...$){return $.reduce(GB0)}J$.or=HB0;function pp($){return(I,z)=>I===X1.nil?z:z===X1.nil?I:X1._`${oE(I)} ${$} ${oE(z)}`}function oE($){return $ instanceof X1.Name?$:X1._`(${Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let Q=J[1];if(I===J[0]){Y(J);continue}if($.external){let w=$.external.registry.get(J[0])?.id;if(I!==J[0]&&w){Y(J);continue}}if($.metadataRegistry.get(J[0])?.id){Y(J);continue}if(Q.cycle){Y(J);continue}if(Q.count>1){if($.reused==="ref"){Y(J);continue}}}}function g9($,I){let z=$.seen.get(I);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let q=(Q)=>{let K=$.seen.get(Q);if(K.ref===null)return;let w=K.def??K.schema,G={...w},H=K.ref;if(K.ref=null,H){q(H);let V=$.seen.get(H),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))w.allOf=w.allOf??[],w.allOf.push(X);else Object.assign(w,X);if(Object.assign(w,G),Q._zod.parent===H)for(let D in w){if(D==="$ref"||D==="allOf")continue;if(!(D in G))delete w[D]}if(X.$ref&&V.def)for(let D in w){if(D==="$ref"||D==="allOf")continue;if(D in V.def&&JSON.stringify(w[D])===JSON.stringify(V.def[D]))delete w[D]}}let W=Q._zod.parent;if(W&&W!==H){q(W);let V=$.seen.get(W);if(V?.schema.$ref){if(w.$ref=V.schema.$ref,V.def)for(let X in w){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(w[X])===JSON.stringify(V.def[X]))delete w[X]}}}$.override({zodSchema:Q,jsonSchema:w,path:K.path??[]})};for(let Q of[...$.seen.entries()].reverse())q(Q[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let Q=$.external.registry.get(I)?.id;if(!Q)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(Q)}Object.assign(U,z.def??z.schema);let Y=$.metadataRegistry.get(I)?.id;if(Y!==void 0&&U.id===Y)delete U.id;let J=$.external?.defs??{};for(let Q of $.seen.entries()){let K=Q[1];if(K.def&&K.defId){if(K.def.id===K.defId)delete K.def.id;J[K.defId]=K.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")U.$defs=J;else U.definitions=J;try{let Q=JSON.parse(JSON.stringify(U));return Object.defineProperty(Q,"~standard",{value:{...I["~standard"],jsonSchema:{input:Oz(I,"input",$.processors),output:Oz(I,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function i6($,I){let z=I??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let q=$._zod.def;if(q.type==="transform")return!0;if(q.type==="array")return i6(q.element,z);if(q.type==="set")return i6(q.valueType,z);if(q.type==="lazy")return i6(q.getter(),z);if(q.type==="promise"||q.type==="optional"||q.type==="nonoptional"||q.type==="nullable"||q.type==="readonly"||q.type==="default"||q.type==="prefault")return i6(q.innerType,z);if(q.type==="intersection")return i6(q.left,z)||i6(q.right,z);if(q.type==="record"||q.type==="map")return i6(q.keyType,z)||i6(q.valueType,z);if(q.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return i6(q.in,z)||i6(q.out,z)}if(q.type==="object"){for(let U in q.shape)if(i6(q.shape[U],z))return!0;return!1}if(q.type==="union"){for(let U of q.options)if(i6(U,z))return!0;return!1}if(q.type==="tuple"){for(let U of q.items)if(i6(U,z))return!0;if(q.rest&&i6(q.rest,z))return!0;return!1}return!1}var gP=($,I={})=>(z)=>{let q=v9({...z,processors:I});return x1($,q),R9(q,$),g9(q,$)},Oz=($,I,z={})=>(q)=>{let{libraryOptions:U,target:Y}=q??{},J=v9({...U??{},target:Y,io:I,processors:z});return x1($,J),R9(J,$),g9(J,$)};var tY=K0(()=>{lY()});function nG($,I){if("_idmap"in $){let q=$,U=v9({...I,processors:kG}),Y={};for(let K of q._idmap.entries()){let[w,G]=K;x1(G,U)}let J={},Q={registry:q,uri:I?.uri,defs:Y};U.external=Q;for(let K of q._idmap.entries()){let[w,G]=K;R9(U,G),J[w]=g9(U,G)}if(Object.keys(Y).length>0){let K=U.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[K]:Y}}return{schemas:J}}let z=v9({...I,processors:kG});return x1($,z),R9(z,$),g9(z,$)}var oP0,_P=($,I,z,q)=>{let U=z;U.type="string";let{minimum:Y,maximum:J,format:Q,patterns:K,contentEncoding:w}=$._zod.bag;if(typeof Y==="number")U.minLength=Y;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=oP0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(w)U.contentEncoding=w;if(K&&K.size>0){let G=[...K];if(G.length===1)U.pattern=G[0].source;else if(G.length>1)U.allOf=[...G.map((H)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:H.source}))]}},CP=($,I,z,q)=>{let U=z,{minimum:Y,maximum:J,format:Q,multipleOf:K,exclusiveMaximum:w,exclusiveMinimum:G}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let H=typeof G==="number"&&G>=(Y??Number.NEGATIVE_INFINITY),W=typeof w==="number"&&w<=(J??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(H)if(V)U.minimum=G,U.exclusiveMinimum=!0;else U.exclusiveMinimLine truncated
`:""},this._extScope=$,this._scope=new Z8.Scope({parent:$}),this._nodes=[new pp]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let z=this._extScope.value($,I);return(this._values[z.prefix]||(this._values[z.prefix]=new Set)).add(z),z}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,z,q){let U=this._scope.toName(I);if(z!==void 0&&q)this._constants[U.str]=z;return this._leafNode(new xp($,U,z)),U}const($,I,z){return this._def(Z8.varKinds.const,$,I,z)}let($,I,z){return this._def(Z8.varKinds.let,$,I,z)}var($,I,z){return this._def(Z8.varKinds.var,$,I,z)}assign($,I,z){return this._leafNode(new aE($,I,z))}add($,I){return this._leafNode(new kp($,J$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X1.nil)this._leafNode(new ip($));return this}object(...$){let I=["{"];for(let[z,q]of $){if(I.length>1)I.push(",");if(I.push(z),z!==q||this.opts.es5)I.push(":"),(0,X1.addCodeArg)(I,q)}return I.push("}"),new X1._Code(I)}if($,I,z){if(this._blockNode(new E5($)),I&&z)this.code(I).else().code(z).endIf();else if(I)this.code(I).endIf();else if(z)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new E5($))}else(){return this._elseNode(new vJ)}endIf(){return this._endBlockNode(E5,vJ)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new cp($),I)}forRange($,I,z,q,U=this.opts.es5?Z8.varKinds.var:Z8.varKinds.let){let Y=this._scope.toName($);return this._for(new dp(U,Y,I,z),()=>q(Y))}forOf($,I,z,q=Z8.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let Y=I instanceof X1.Name?I:this.var("_arr",I);return this.forRange("_i",0,X1._`${Y}.length`,(J)=>{this.var(U,X1._`${Y}[${J}]`),z(U)})}return this._for(new rE("of",q,U,I),()=>z(U))}forIn($,I,z,q=this.opts.es5?Z8.varKinds.var:Z8.varKinds.const){if(this.opts.ownProperties)return this.forOf($,X1._`Object.keys(${I})`,z);let U=this._scope.toName($);return this._for(new rE("in",q,U,I),()=>z(U))}endFor(){return this._endBlockNode(hz)}label($){return this._leafNode(new fp($))}break($){return this._leafNode(new bp($))}return($){let I=new kH;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(kH)}try($,I,z){if(!I&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let q=new mp;if(this._blockNode(q),this.code($),I){let U=this.name("e");this._currNode=q.catch=new fH(U),I(U)}if(z)this._currNode=q.finally=new bH,this.code(z);return this._endBlockNode(fH,bH)}throw($){return this._leafNode(new np($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw Error("CodeGen: not in self-balancing block");let z=this._nodes.length-I;if(z<0||$!==void 0&&z!==$)throw Error(`CodeGen: wrong number of nodes: ${z} vs ${$} expected`);return this._nodes.length=I,this}func($,I=X1.nil,z,q){if(this._blockNode(new xH($,I,z)),q)this.code(q).endFunc();return this}endFunc(){return this._endBlockNode(xH)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let z=this._currNode;if(z instanceof $||I&&z instanceof I)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof E5))throw Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}J$.CodeGen=lp;function W3($,I){for(let z in I)$[z]=($[z]||0)+(I[z]||0);return $}function nH($,I){return I instanceof X1._CodeOrName?W3($,I.names):$}function Sz($,I,z){if($ instanceof X1.Name)return q($);if(!U($))return $;return new X1._Code($._items.reduce((Y,J)=>{if(J instanceof X1.Name)J=q(J);if(J instanceof X1._Code)Y.push(...J._items);else Y.push(J);return Y},[]));function q(Y){let J=z[Y.str];if(J===void 0||I[Y.str]!==1)return Y;return delete I[Y.str],J}function U(Y){return Y instanceof X1._Code&&Y._items.some((J)=>J instanceof X1.Name&&I[J.str]===1&&z[J.str]!==void 0)}}function OB0($,I){for(let z in I)$[z]=($[z]||0)-(I[z]||0)}function op($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X1._`!${tE($)}`}J$.not=op;var FB0=rp(J$.operators.AND);function NB0(...$){return $.reduce(FB0)}J$.and=NB0;var MB0=rp(J$.operators.OR);function AB0(...$){return $.reduce(MB0)}J$.or=AB0;function rp($){return(I,z)=>I===X1.nil?z:z===X1.nil?I:X1._`${tE(I)} ${$} ${tE(z)}`}function tE($){return $ instanceof X1.Name?$:X1._`(${Line truncated
|| (${J} == "string" && ${U} && ${U} == +${U})`).assign(Q,e0._`+${U}`);return;case"integer":q.elseIf(e0._`${J} === "boolean" || ${U} === null
|| (${J} === "string" && ${U} && ${U} == +${U} && !(${U} % 1))`).assign(Q,e0._`+${U}`);return;case"boolean":q.elseIf(e0._`${U} === "false" || ${U} === 0 || ${U} === null`).assign(Q,!1).elseIf(e0._`${U} === "true" || ${U} === 1`).assign(Q,!0);return;case"null":q.elseIf(e0._`${U} === "" || ${U} === 0 || ${U} === false`),q.assign(Q,null);return;case"array":q.elseIf(e0._`${J} === "string" || ${J} === "number"
|| ${J} === "boolean" || ${U} === null`).assign(Q,e0._`[${U}]`)}}}function Tj0({gen:$,parentData:I,parentDataProperty:z},q){$.if(e0._`${I} !== undefined`,()=>$.assign(e0._`${I}[${z}]`,q))}function zB($,I,z,q=Sz.Correct){let U=q===Sz.Correct?e0.operators.EQ:e0.operators.NEQ,Y;switch($){case"null":return e0._`${I} ${U} null`;case"array":Y=e0._`Array.isArray(${I})`;break;case"object":Y=e0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J(e0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return e0._`typeof ${I} ${U} ${$}`}return q===Sz.Correct?Y:(0,e0.not)(Y);function J(Q=e0.nil){return(0,e0.and)(e0._`typeof ${I} == "number"`,Q,z?e0._`isFinite(${I})`:e0.nil)}}Fc.checkDataType=zB;function qB($,I,z,q){if($.length===1)return zB($[0],I,z,q);let U,Y=(0,Lc.toHash)($);if(Y.array&&Y.object){let J=e0._`typeof ${I} != "object"`;U=Y.null?J:e0._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=e0.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,e0.and)(U,zB(J,I,z,q));return U}Fc.checkDataTypes=qB;var Ej0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?e0._`{type: ${$}}`:e0._`{type: ${I}}`};function UB($){let I=Bj0($);(0,Fj0.reportError)(I,Ej0)}Fc.reportTypeError=UB;function Bj0($){let{gen:I,data:z,schema:q}=$,U=(0,Lc.schemaRefOrVal)($,q,"type");return{gen:I,keyword:"type",data:z,schema:q.type,schemaCode:U,schemaValue:U,parentSchema:q,params:{},it:$}}});var Tc=F((Ac)=>{Object.defineProperty(Ac,"__esModule",{value:!0});Ac.assignDefaults=void 0;var yz=z1(),hj0=F1();function Sj0($,I){let{properties:z,items:q}=$.schema;if(I==="object"&&z)for(let U in z)Mc($,U,z[U].default);else if(I==="array"&&Array.isArray(q))q.forEach((U,Y)=>Mc($,Y,U.default))}Ac.assignDefaults=Sj0;function Mc($,I,z){let{gen:q,compositeRule:U,data:Y,opts:J}=$;if(z===void 0)return;let Q=yz._`${Y}${(0,yz.getProperty)(I)}`;if(U){(0,hj0.checkStrictMode)($,`default is ignored for: ${Q}`);return}let K=yz._`${Q} === undefined`;if(J.useDefaults==="empty")K=yz._`${K} || ${Q} === null || ${Q} === ""`;q.if(K,yz._`${Q} = ${(0,yz.stringify)(z)}`)}});var l$=F((jc)=>{Object.defineProperty(jc,"__esModule",{value:!0});jc.validateUnion=jc.validateArray=jc.usePattern=jc.callValidateCode=jc.schemaProperties=jc.allSchemaProperties=jc.noPropertyInData=jc.propertyInData=jc.isOwnProperty=jc.hasPropFunc=jc.reportMissingProp=jc.checkMissingProp=jc.checkReportMissingProp=void 0;var $4=z1(),YB=F1(),k9=B5(),yj0=F1();function uj0($,I){let{gen:z,data:q,it:U}=$;z.if(QB(z,q,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:$4._`${I}`},!0),$.error()})}jc.checkReportMissingProp=uj0;function xj0({gen:$,data:I,it:{opts:z}},q,U){return(0,$4.or)(...q.map((Y)=>(0,$4.and)(QB($,I,Y,z.ownProperties),$4._`${U} = ${Y}`)))}jc.checkMissingProp=xj0;function kj0($,I){$.setParams({missingProperty:I},!0),$.error()}jc.reportMissingProp=kj0;function Ec($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:$4._`Object.prototype.hasOwnProperty`})}jc.hasPropFunc=Ec;function JB($,I,z){return $4._`${Ec($)}.call(${I}, ${z})`}jc.isOwnProperty=JB;function fj0($,I,z,q){let U=$4._`${I}${(0,$4.getProperty)(z)} !== undefined`;return q?$4._`${U} && ${JB($,I,z)}`:U}jc.propertyInData=fj0;function QB($,I,z,q){let U=$4._`${I}${(0,$4.getProperty)(z)} === undefined`;return q?(0,$4.or)(U,(0,$4.not)(JB($,I,z))):U}jc.noPropertyInData=QB;function Bc($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}jc.allSchemaProperties=Bc;function bj0($,I){return Bc(I).filter((z)=>!(0,YB.alwaysValidSchema)($,I[z]))}jc.schemaProperties=bj0;function nj0({schemaCode:$,data:I,it:{gen:z,topSchemaRef:q,schemaPath:U,errorPath:Y},it:J},Q,K,w){let G=w?$4._`${$}, ${I}, ${q}${U}`:I,H=[[k9.default.instancePath,(0,$4.strConcat)(k9.default.instancePath,Y)],[k9.default.parentData,J.parentData],[k9.default.parentDataProperty,J.parentDataProperty],[k9.default.rootData,k9.default.rootData]];if(J.opts.dynamicRef)H.push([k9.default.dynamicAnchors,k9.default.dynamicAnchors]);let W=$4._`${G}, ${z.object(...H)}`;return K!==$4.nil?$4._`${Q}.call(${K}, ${W})`:$4._`${Q}(${W})`}jc.callValidateCode=nj0;var ij0=$4._`new RegExp`;function pj0({gen:$,it:{opts:I}},z){let q=I.unicodeRegExp?"u":"",{regExp:U}=I.code,Y=U(z,q);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:$4._`${U.code==="new RegExp"?ij0:(0,yj0.useFunc)($,U)}(${z}, ${q})`})}jc.usePattern=pj0;function cj0($){let{gen:I,data:z,keyword:q,it:U}=$,Y=I.name("valid");if(U.allErrors){let Q=I.let("valid",!0);return J(()=>I.assign(Q,!1)),Q}return I.var(Y,!0),J(()=>I.break()),Y;function J(Q){let K=I.const("len",$4._`${z}.length`);I.forRange("i",0,K,(w)=>{$.subschema({keyword:q,dataProp:w,dataPropType:YB.Type.Num},Y),I.if((0,$4.not)(Y),Q)})}}jc.validateArray=cj0;function dj0($){let{gen:I,schema:z,keyword:q,it:U}=$;if(!Array.isArray(z))throw Error("ajv implementation error");if(z.some((K)=>(0,YB.alwaysValidSchema)(U,K))&&!U.opts.unevaluated)return;le Line truncated
|| ${J} === "boolean" || ${U} === null`).assign(Q,e0._`[${U}]`)}}}function yj0({gen:$,parentData:I,parentDataProperty:z},q){$.if(e0._`${I} !== undefined`,()=>$.assign(e0._`${I}[${z}]`,q))}function UB($,I,z,q=yz.Correct){let U=q===yz.Correct?e0.operators.EQ:e0.operators.NEQ,Y;switch($){case"null":return e0._`${I} ${U} null`;case"array":Y=e0._`Array.isArray(${I})`;break;case"object":Y=e0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J(e0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return e0._`typeof ${I} ${U} ${$}`}return q===yz.Correct?Y:(0,e0.not)(Y);function J(Q=e0.nil){return(0,e0.and)(e0._`typeof ${I} == "number"`,Q,z?e0._`isFinite(${I})`:e0.nil)}}Ec.checkDataType=UB;function YB($,I,z,q){if($.length===1)return UB($[0],I,z,q);let U,Y=(0,Ac.toHash)($);if(Y.array&&Y.object){let J=e0._`typeof ${I} != "object"`;U=Y.null?J:e0._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=e0.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,e0.and)(U,UB(J,I,z,q));return U}Ec.checkDataTypes=YB;var uj0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?e0._`{type: ${$}}`:e0._`{type: ${I}}`};function JB($){let I=xj0($);(0,gj0.reportError)(I,uj0)}Ec.reportTypeError=JB;function xj0($){let{gen:I,data:z,schema:q}=$,U=(0,Ac.schemaRefOrVal)($,q,"type");return{gen:I,keyword:"type",data:z,schema:q.type,schemaCode:U,schemaValue:U,parentSchema:q,params:{},it:$}}});var gc=F((vc)=>{Object.defineProperty(vc,"__esModule",{value:!0});vc.assignDefaults=void 0;var uz=z1(),cj0=F1();function dj0($,I){let{properties:z,items:q}=$.schema;if(I==="object"&&z)for(let U in z)jc($,U,z[U].default);else if(I==="array"&&Array.isArray(q))q.forEach((U,Y)=>jc($,Y,U.default))}vc.assignDefaults=dj0;function jc($,I,z){let{gen:q,compositeRule:U,data:Y,opts:J}=$;if(z===void 0)return;let Q=uz._`${Y}${(0,uz.getProperty)(I)}`;if(U){(0,cj0.checkStrictMode)($,`default is ignored for: ${Q}`);return}let K=uz._`${Q} === undefined`;if(J.useDefaults==="empty")K=uz._`${K} || ${Q} === null || ${Q} === ""`;q.if(K,uz._`${Q} = ${(0,uz.stringify)(z)}`)}});var l$=F((hc)=>{Object.defineProperty(hc,"__esModule",{value:!0});hc.validateUnion=hc.validateArray=hc.usePattern=hc.callValidateCode=hc.schemaProperties=hc.allSchemaProperties=hc.noPropertyInData=hc.propertyInData=hc.isOwnProperty=hc.hasPropFunc=hc.reportMissingProp=hc.checkMissingProp=hc.checkReportMissingProp=void 0;var $4=z1(),QB=F1(),k9=B5(),mj0=F1();function lj0($,I){let{gen:z,data:q,it:U}=$;z.if(wB(z,q,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:$4._`${I}`},!0),$.error()})}hc.checkReportMissingProp=lj0;function oj0({gen:$,data:I,it:{opts:z}},q,U){return(0,$4.or)(...q.map((Y)=>(0,$4.and)(wB($,I,Y,z.ownProperties),$4._`${U} = ${Y}`)))}hc.checkMissingProp=oj0;function rj0($,I){$.setParams({missingProperty:I},!0),$.error()}hc.reportMissingProp=rj0;function _c($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:$4._`Object.prototype.hasOwnProperty`})}hc.hasPropFunc=_c;function KB($,I,z){return $4._`${_c($)}.call(${I}, ${z})`}hc.isOwnProperty=KB;function tj0($,I,z,q){let U=$4._`${I}${(0,$4.getProperty)(z)} !== undefined`;return q?$4._`${U} && ${KB($,I,z)}`:U}hc.propertyInData=tj0;function wB($,I,z,q){let U=$4._`${I}${(0,$4.getProperty)(z)} === undefined`;return q?(0,$4.or)(U,(0,$4.not)(KB($,I,z))):U}hc.noPropertyInData=wB;function Cc($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}hc.allSchemaProperties=Cc;function aj0($,I){return Cc(I).filter((z)=>!(0,QB.alwaysValidSchema)($,I[z]))}hc.schemaProperties=aj0;function sj0({schemaCode:$,data:I,it:{gen:z,topSchemaRef:q,schemaPath:U,errorPath:Y},it:J},Q,K,w){let G=w?$4._`${$}, ${I}, ${q}${U}`:I,H=[[k9.default.instancePath,(0,$4.strConcat)(k9.default.instancePath,Y)],[k9.default.parentData,J.parentData],[k9.default.parentDataProperty,J.parentDataProperty],[k9.default.rootData,k9.default.rootData]];if(J.opts.dynamicRef)H.push([k9.default.dynamicAnchors,k9.default.dynamicAnchors]);let W=$4._`${G}, ${z.object(...H)}`;return K!==$4.nil?$4._`${Q}.call(${K}, ${W})`:$4._`${Q}(${W})`}hc.callValidateCode=sj0;var ej0=$4._`new RegExp`;function $v0({gen:$,it:{opts:I}},z){let q=I.unicodeRegExp?"u":"",{regExp:U}=I.code,Y=U(z,q);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:$4._`${U.code==="new RegExp"?ej0:(0,mj0.useFunc)($,U)}(${z}, ${q})`})}hc.usePattern=$v0;function Iv0($){let{gen:I,data:z,keyword:q,it:U}=$,Y=I.name("valid");if(U.allErrors){let Q=I.let("valid",!0);return J(()=>I.assign(Q,!1)),Q}return I.var(Y,!0),J(()=>I.break()),Y;function J(Q){let K=I.const("len",$4._`${z}.length`);I.forRange("i",0,K,(w)=>{$.subschema({keyword:q,dataProp:w,dataPropType:QB.Type.Num},Y),I.if((0,$4.not)(Y),Q)})}}hc.validateArray=Iv0;function zv0($){let{gen:I,schema:z,keyword:q,it:U}=$;if(!Array.isArray(z))throw Error("ajv implementation error");if(z.some((K)=>(0,QB.alwaysValidSchema)(U,K))&&!U.opts.unevaluated)return;le Line truncated
missingProperty: ${q},
depsCount: ${I},
deps: ${z}}`};var GC0={keyword:"dependencies",type:"object",schemaType:"object",error:cm.error,code($){let[I,z]=HC0($);im($,I),pm($,z)}};function HC0({schema:$}){let I={},z={};for(let q in $){if(q==="__proto__")continue;let U=Array.isArray($[q])?I:z;U[q]=$[q]}return[I,z]}function im($,I=$.schema){let{gen:z,data:q,it:U}=$;if(Object.keys(I).length===0)return;let Y=z.let("missing");for(let J in I){let Q=I[J];if(Q.length===0)continue;let K=(0,dJ.propertyInData)(z,q,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)z.if(K,()=>{for(let w of Q)(0,dJ.checkReportMissingProp)($,w)});else z.if(gB._`${K} && (${(0,dJ.checkMissingProp)($,Q,Y)})`),(0,dJ.reportMissingProp)($,Y),z.else()}}cm.validatePropertyDeps=im;function pm($,I=$.schema){let{gen:z,data:q,keyword:U,it:Y}=$,J=z.name("valid");for(let Q in I){if((0,wC0.alwaysValidSchema)(Y,I[Q]))continue;z.if((0,dJ.propertyInData)(z,q,Q,Y.opts.ownProperties),()=>{let K=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(K,J)},()=>z.var(J,!0)),$.ok(J)}}cm.validateSchemaDeps=pm;cm.default=GC0});var tm=F((rm)=>{Object.defineProperty(rm,"__esModule",{value:!0});var om=z1(),ZC0=F1(),XC0={message:"property name must be valid",params:({params:$})=>om._`{propertyName: ${$.propertyName}}`},LC0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:XC0,code($){let{gen:I,schema:z,data:q,it:U}=$;if((0,ZC0.alwaysValidSchema)(U,z))return;let Y=I.name("valid");I.forIn("key",q,(J)=>{$.setParams({propertyName:J}),$.subschema({keyword:"propertyNames",data:J,dataTypes:["string"],propertyName:J,compositeRule:!0},Y),I.if((0,om.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};rm.default=LC0});var _B=F((am)=>{Object.defineProperty(am,"__esModule",{value:!0});var KW=l$(),D8=z1(),OC0=B5(),wW=F1(),FC0={message:"must NOT have additional properties",params:({params:$})=>D8._`{additionalProperty: ${$.additionalProperty}}`},NC0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:FC0,code($){let{gen:I,schema:z,parentSchema:q,data:U,errsCount:Y,it:J}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:Q,opts:K}=J;if(J.props=!0,K.removeAdditional!=="all"&&(0,wW.alwaysValidSchema)(J,z))return;let w=(0,KW.allSchemaProperties)(q.properties),G=(0,KW.allSchemaProperties)(q.patternProperties);H(),$.ok(D8._`${Y} === ${OC0.default.errors}`);function H(){I.forIn("key",U,(D)=>{if(!w.length&&!G.length)X(D);else I.if(W(D),()=>X(D))})}function W(D){let O;if(w.length>8){let A=(0,wW.schemaRefOrVal)(J,q.properties,"properties");O=(0,KW.isOwnProperty)(I,A,D)}else if(w.length)O=(0,D8.or)(...w.map((A)=>D8._`${D} === ${A}`));else O=D8.nil;if(G.length)O=(0,D8.or)(O,...G.map((A)=>D8._`${(0,KW.usePattern)($,A)}.test(${D})`));return(0,D8.not)(O)}function V(D){I.code(D8._`delete ${U}[${D}]`)}function X(D){if(K.removeAdditional==="all"||K.removeAdditional&&z===!1){V(D);return}if(z===!1){if($.setParams({additionalProperty:D}),$.error(),!Q)I.break();return}if(typeof z=="object"&&!(0,wW.alwaysValidSchema)(J,z)){let O=I.name("valid");if(K.removeAdditional==="failing")L(D,O,!1),I.if((0,D8.not)(O),()=>{$.reset(),V(D)});else if(L(D,O),!Q)I.if((0,D8.not)(O),()=>I.break())}}function L(D,O,A){let T={keyword:"additionalProperties",dataProp:D,dataPropType:wW.Type.Str};if(A===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,O)}}};am.default=NC0});var Il=F(($l)=>{Object.defineProperty($l,"__esModule",{value:!0});var AC0=hJ(),sm=l$(),CB=F1(),em=_B(),PC0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,parentSchema:q,data:U,it:Y}=$;if(Y.opts.removeAdditional==="all"&&q.additionalProperties===void 0)em.default.code(new AC0.KeywordCxt(Y,em.default,"additionalProperties"));let J=(0,sm.allSchemaProperties)(z);for(let H of J)Y.definedProperties.add(H);if(Y.opts.unevaluated&&J.length&&Y.props!==!0)Y.props=CB.mergeEvaluated.props(I,(0,CB.toHash)(J),Y.props);let Q=J.filter((H)=>!(0,CB.alwaysValidSchema)(Y,z[H]));if(Q.length===0)return;let K=I.name("valid");for(let H of Q){if(w(H))G(H);else{if(I.if((0,sm.propertyInData)(I,U,H,Y.opts.ownProperties)),G(H),!Y.allErrors)I.else().var(K,!0);I.endIf()}$.it.definedProperties.add(H),$.ok(K)}function w(H){return Y.opts.useDefaults&&!Y.compositeRule&&z[H].default!==void 0}function G(H){$.subschema({keyword:"properties",schemaProp:H,dataProp:H},K)}}};$l.default=PC0});var Jl=F((Yl)=>{Object.defineProperty(Yl,"__esModule",{value:!0});var zl=l$(),GW=z1(),ql=F1(),Ul=F1(),EC0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,data:q,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,zl.allSchemaProperties)(z),K=Q.filter((L)=>(0,ql.alwaysValidSchema)(Y,z[L]));if(Q.length===0||K.length===Q.length&&(!Y.opts.unevaluated||Y.props===!0))return;let w=J.strictSchema&&!J.allowMatchingProperties&&U.properties,G=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,n+=a1(k,2),n+=Q.magic,n+=a1(D,2),n+=a1(O,2),n+=a1(h.crc32,4),n+=a1(h.compressedSize,4),n+=a1(h.uncompressedSize,4),n+=a1(w.length,2),n+=a1(A.length,2);var g=aV.LOCAL_FILE_HEADER+n+w+A,b=aV.CENTRAL_FILE_HEADER+a1(f,2)+n+a1(W.length,2)+"\x00\x00\x00\x00"+a1(E,4)+a1(q,4)+w+A+W;return{fileRecord:g,dirRecord:b}},Ii0=function($,I,z,q,U){var Y="",J=Aq.transformTo("string",U(q));return Y=aV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+a1($,2)+a1($,2)+a1(I,4)+a1(z,4)+a1(J.length,2)+J,Y},zi0=function($){var I="";return I=aV.DATA_DESCRIPTOR+a1($.crc32,4)+a1($.compressedSize,4)+a1($.uncompressedSize,4),I};function T8($,I,z,q){Pq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=z,this.encodeFileName=q,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Aq.inherits(T8,Pq);T8.prototype.push=function($){var I=$.meta.percent||0,z=this.entriesCount,q=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,Pq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(I+100*(z-q-1))/z:100}})};T8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var z=w10($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};T8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,z=w10($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),I)this.push({data:zi0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};T8.prototype.flush=function(){var $=this.bytesWritten;for(var I=0;I<this.dirRecords.length;I++)this.push({data:this.dirRecords[I],meta:{percent:100}});var z=this.bytesWritten-$,q=Ii0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:q,meta:{percent:100}})};T8.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};T8.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(z){I.processChunk(z)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(z){I.error(z)}),this};T8.prototype.resume=function(){if(!Pq.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};T8.prototype.error=function($){var I=this._sources;if(!Pq.prototype.error.call(this,$))return!1;for(var z=0;z<I.length;z++)try{I[z].error($)}catch(q){}return!0};T8.prototype.lock=function(){Pq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};G10.exports=T8});var W10=F((Ji0)=>{var qi0=OR(),Ui0=H10(),Yi0=function($,I){var z=$||I,q=qi0[z];if(!q)throw Error(z+" is not a valid compression method !");return q};Ji0.generateWorker=function($,I,z){var q=new Ui0(I.streamFiles,z,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=Yi0(J.options.compression,I.compression),K=J.options.compressionOptions||I.compressionOptions||{},w=J.dir,G=J.date;J._compressWorker(Q,K).withStreamInfo("file",{name:Y,dir:w,date:G,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(q)}),q.entriesCount=U}catch(Y){q.error(Y)}return q}});var Z10=F((WR1,V10)=>{var Ki0=D4(),sV=R$();function oQ($,I){sV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Ki0.inherits(oQ,sV);oQ.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(z){I.push({data:z,meta:{percent:0}})}).on("error",function(z){if(I.isPaused)this.generatedError=z;else I.error(z)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};oQ.prototype.pause=function(){if(!sV.prototype.pause.call(this))return!1;return this._stream.pause(),!0};oQ.prototype.resume=function(){if(!sV.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};V10.exports=oQ});var T10=F((VR1,P10)=>{var wi0=Wq(),rQ=D4(),O10=R$(),Gi0=Tv(),F10=Ev(),X10=hV(),Hi0=Le(),Wi0=W10(),L10=jQ(),Vi0=Z10(),N10=function($,I,z){var q=rQ.getTypeOf(I),U,Y=rQ.extend(z||{},F10);if(Y.date=Y.date||new Date,Y.compression!==null)Y.compression=Y.compression.toUpperCase();if(typeof Y.unixPermissions==="string")Y.unixPermissions=parseInt(Y.unixPermissions,8);if(Y.unixPermissions&&Y.unixPermissions&16384)Y.dir=!0;if(Y.dosPermissions&&Y.dosPermissions Line truncated
`)}openNode($,I){let z=this.tos,q=this._xml;if(z&&this.open)q.push(">");this._stack.push($),q.push("<"),q.push($),zg(q,I),this.leaf=!0,this.open=!0}addAttribute($,I){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(I!==void 0)Z60(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");zg(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(V60.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),I=this._xml;if(this.leaf)I.push("/>");else I.push("</"),I.push($),I.push(">");this.open=!1,this.leaf=!1}leafNode($,I,z){if(this.openNode($,I),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("")}}qg.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};X60.exports=qg});var Ug=F((Ud0)=>{var L60=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function qd0($){if(typeof $==="string")return $;if(L60)return L60.decode($);return $.toString()}Ud0.bufferToString=qd0});var M60=F((O60)=>{Object.defineProperty(O60,"__esModule",{value:!0});O60.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;O60.S=` \r
`;O60.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";O60.NAME_CHAR="-"+O60.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";O60.CHAR_RE=new RegExp("^["+O60.CHAR+"]$","u");O60.S_RE=new RegExp("^["+O60.S+"]+$","u");O60.NAME_START_CHAR_RE=new RegExp("^["+O60.NAME_START_CHAR+"]$","u");O60.NAME_CHAR_RE=new RegExp("^["+O60.NAME_CHAR+"]$","u");O60.NAME_RE=new RegExp("^["+O60.NAME_START_CHAR+"]["+O60.NAME_CHAR+"]*$","u");O60.NMTOKEN_RE=new RegExp("^["+O60.NAME_CHAR+"]+$","u");var Yg=9,Jg=10,Qg=13,Kg=32;O60.S_LIST=[Kg,Jg,Qg,Yg];function Jd0($){return $>=Kg&&$<=55295||$===Jg||$===Qg||$===Yg||$>=57344&&$<=65533||$>=65536&&$<=1114111}O60.isChar=Jd0;function Qd0($){return $===Kg||$===Jg||$===Qg||$===Yg}O60.isS=Qd0;function D60($){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}O60.isNameStartChar=D60;function Kd0($){return D60($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}O60.isNameChar=Kd0});var _60=F((j60)=>{Object.defineProperty(j60,"__esModule",{value:!0});j60.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";j60.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";j60.S=` \r
`;j60.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";j60.NAME_CHAR="-"+j60.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";j60.CHAR_RE=new RegExp("^["+j60.CHAR+"]$","u");j60.RESTRICTED_CHAR_RE=new RegExp("^["+j60.RESTRICTED_CHAR+"]$","u");j60.S_RE=new RegExp("^["+j60.S+"]+$","u");j60.NAME_START_CHAR_RE=new RegExp("^["+j60.NAME_START_CHAR+"]$","u");j60.NAME_CHAR_RE=new RegExp("^["+j60.NAME_CHAR+"]$","u");j60.NAME_RE=new RegExp("^["+j60.NAME_START_CHAR+"]["+j60.NAME_CHAR+"]*$","u");j60.NMTOKEN_RE=new RegExp("^["+j60.NAME_CHAR+"]+$","u");var A60=9,P60=10,T60=13,E60=32;j60.S_LIST=[E60,P60,T60,A60];function Nd0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}j60.isChar=Nd0;function Md0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}j60.isRestrictedChar=Md0;function Ad0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}j60.isCharAndNotRestricted=Ad0;function Pd0($){return $===E60||$===P60||$===T60||$===A60}j60.isS=Pd0;function B60($){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}j60.isNameStartChar=B60;function Td0($){return B60($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}j60.isNameChar=Td0});var S60=F((h60)=>{Object.defineProperty(h60,"__esModule",{value:!0});h60.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";h60.NC_NAME_CHAR="-"+h60.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";h60.NC_NAME_START_CHAR_RE=new RegExp("^["+h60.NC_NAME_START_CHAR+"]$","u");h60.NC_NAME_CHAR_RE=new RegExp("^["+h60.NC_NAME_CHAR+"]$","u");h60.NC_NAME_RE=new RegExp("^["+h60.NC_NAME_START_CHAR+"]["+h60.NC_NAME_CHAR+"]*$","u");function C60($){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}h60.isNCNameStartChar=C60;function fd0($){return C60($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}h60.isNCNameChar=fd0});var z$0=F((I$0)=>{Object.defineProperty(I$0,"__esModule",{value:!0});var Sq=M60(),dd0=_60(),Ag=S60(),W$=Sq.isS,md0=Sq.isChar,K2=Sq.isNameStartChar,y60=Sq.isNameChar,r60=Sq.S_LIST,ld0=Sq.NAME_RE,od0=dd0.isChar,rd0=Ag.isNCNameStartChar,td0=Ag.isNCNameChar,ad0=Ag.NC_NAME_RE,jZ="http://www.w3.org/XML/1998/namespace",hq="http://www.w3.org/2000/xmlns/",sd0={__proto__:null,xml:jZ,xmlns:hq},ed0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V4=-1,I5=-2,u60=0,$m0=1,Gg=2,Im0=3,gq=4,zm0=5,qm0=6,Um0=7,Hg=8,Ym0=9,Jm0=10,Qm0=11,Km0=12,l6=13,AZ=14,Wg=15,wm0=16,Vg=17,Gm0=18,Hm0=19,Zg=20,Wm0=21,Vm0=22,Zm0=23,x60=24,Xg=25,PZ=26,k60=27,Xm0=28,Lm0=29,f60=30,Dm0=31,Om0=32,n3=33,Fm0=34,Lg=35,w2=36,Dg=37,Nm0=38,b60=39,n60=40,Mm0=41,i60=42,Am0=43,Pm0=44,Og=9,B8=10,Fg=13,p60=32,c60=33,t60=34,G2=38,a60=39,TZ=45,EZ=47,Tm0=59,w7=60,_q=61,m4=62,L6=63,s60=91,Cq=93,d60=133,m60=8232,BZ=($)=>$===t60||$===a60,e60=[t60,a60],Em0=[...e60,s60,m4],Bm0=[...e60,w7,Cq],jm0=[_q,L6,...r60],vm0=[...r60,m4,G2,w7];function Mg($,I,z){switch(I){case"xml":if(z!==jZ)$.fail(`xml prefix must be bound to ${jZ}.`);break;case"xmlns":if(z!==hq)$.fail(`xmlns prefix must be bound to ${hq}.`);break;default:}switch(z){case hq:$.fail(I===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${hq}.`);break;case jZ:switch(I){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 Rm0($,I){for(let z of Object.keys(I))Mg($,z,I[z])}var gm0=($)=>ad0.test($),_m0=($)=>ld0.test($),i3=0,l60=1,Ng=2;I$0.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var o60={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 $$0{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let I=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,I){this.nameStartCheck=rd0,this.nameCheck=td0,this.isName=gm0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},sd0);let z=this.opt.additionalNamesp Line truncated
deps: ${z}}`};var MC0={keyword:"dependencies",type:"object",schemaType:"object",error:tm.error,code($){let[I,z]=AC0($);om($,I),rm($,z)}};function AC0({schema:$}){let I={},z={};for(let q in $){if(q==="__proto__")continue;let U=Array.isArray($[q])?I:z;U[q]=$[q]}return[I,z]}function om($,I=$.schema){let{gen:z,data:q,it:U}=$;if(Object.keys(I).length===0)return;let Y=z.let("missing");for(let J in I){let Q=I[J];if(Q.length===0)continue;let K=(0,mJ.propertyInData)(z,q,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)z.if(K,()=>{for(let w of Q)(0,mJ.checkReportMissingProp)($,w)});else z.if(CB._`${K} && (${(0,mJ.checkMissingProp)($,Q,Y)})`),(0,mJ.reportMissingProp)($,Y),z.else()}}tm.validatePropertyDeps=om;function rm($,I=$.schema){let{gen:z,data:q,keyword:U,it:Y}=$,J=z.name("valid");for(let Q in I){if((0,NC0.alwaysValidSchema)(Y,I[Q]))continue;z.if((0,mJ.propertyInData)(z,q,Q,Y.opts.ownProperties),()=>{let K=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(K,J)},()=>z.var(J,!0)),$.ok(J)}}tm.validateSchemaDeps=rm;tm.default=MC0});var zl=F((Il)=>{Object.defineProperty(Il,"__esModule",{value:!0});var $l=z1(),EC0=F1(),BC0={message:"property name must be valid",params:({params:$})=>$l._`{propertyName: ${$.propertyName}}`},jC0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:BC0,code($){let{gen:I,schema:z,data:q,it:U}=$;if((0,EC0.alwaysValidSchema)(U,z))return;let Y=I.name("valid");I.forIn("key",q,(J)=>{$.setParams({propertyName:J}),$.subschema({keyword:"propertyNames",data:J,dataTypes:["string"],propertyName:J,compositeRule:!0},Y),I.if((0,$l.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};Il.default=jC0});var hB=F((ql)=>{Object.defineProperty(ql,"__esModule",{value:!0});var wW=l$(),D8=z1(),RC0=B5(),GW=F1(),gC0={message:"must NOT have additional properties",params:({params:$})=>D8._`{additionalProperty: ${$.additionalProperty}}`},_C0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:gC0,code($){let{gen:I,schema:z,parentSchema:q,data:U,errsCount:Y,it:J}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:Q,opts:K}=J;if(J.props=!0,K.removeAdditional!=="all"&&(0,GW.alwaysValidSchema)(J,z))return;let w=(0,wW.allSchemaProperties)(q.properties),G=(0,wW.allSchemaProperties)(q.patternProperties);H(),$.ok(D8._`${Y} === ${RC0.default.errors}`);function H(){I.forIn("key",U,(D)=>{if(!w.length&&!G.length)X(D);else I.if(W(D),()=>X(D))})}function W(D){let O;if(w.length>8){let A=(0,GW.schemaRefOrVal)(J,q.properties,"properties");O=(0,wW.isOwnProperty)(I,A,D)}else if(w.length)O=(0,D8.or)(...w.map((A)=>D8._`${D} === ${A}`));else O=D8.nil;if(G.length)O=(0,D8.or)(O,...G.map((A)=>D8._`${(0,wW.usePattern)($,A)}.test(${D})`));return(0,D8.not)(O)}function V(D){I.code(D8._`delete ${U}[${D}]`)}function X(D){if(K.removeAdditional==="all"||K.removeAdditional&&z===!1){V(D);return}if(z===!1){if($.setParams({additionalProperty:D}),$.error(),!Q)I.break();return}if(typeof z=="object"&&!(0,GW.alwaysValidSchema)(J,z)){let O=I.name("valid");if(K.removeAdditional==="failing")L(D,O,!1),I.if((0,D8.not)(O),()=>{$.reset(),V(D)});else if(L(D,O),!Q)I.if((0,D8.not)(O),()=>I.break())}}function L(D,O,A){let T={keyword:"additionalProperties",dataProp:D,dataPropType:GW.Type.Str};if(A===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,O)}}};ql.default=_C0});var Ql=F((Jl)=>{Object.defineProperty(Jl,"__esModule",{value:!0});var hC0=SJ(),Ul=l$(),SB=F1(),Yl=hB(),SC0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,parentSchema:q,data:U,it:Y}=$;if(Y.opts.removeAdditional==="all"&&q.additionalProperties===void 0)Yl.default.code(new hC0.KeywordCxt(Y,Yl.default,"additionalProperties"));let J=(0,Ul.allSchemaProperties)(z);for(let H of J)Y.definedProperties.add(H);if(Y.opts.unevaluated&&J.length&&Y.props!==!0)Y.props=SB.mergeEvaluated.props(I,(0,SB.toHash)(J),Y.props);let Q=J.filter((H)=>!(0,SB.alwaysValidSchema)(Y,z[H]));if(Q.length===0)return;let K=I.name("valid");for(let H of Q){if(w(H))G(H);else{if(I.if((0,Ul.propertyInData)(I,U,H,Y.opts.ownProperties)),G(H),!Y.allErrors)I.else().var(K,!0);I.endIf()}$.it.definedProperties.add(H),$.ok(K)}function w(H){return Y.opts.useDefaults&&!Y.compositeRule&&z[H].default!==void 0}function G(H){$.subschema({keyword:"properties",schemaProp:H,dataProp:H},K)}}};Jl.default=SC0});var Wl=F((Hl)=>{Object.defineProperty(Hl,"__esModule",{value:!0});var Kl=l$(),HW=z1(),wl=F1(),Gl=F1(),uC0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,data:q,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,Kl.allSchemaProperties)(z),K=Q.filter((L)=>(0,wl.alwaysValidSchema)(Y,z[L]));if(Q.length===0||K.length===Q.length&&(!Y.opts.unevaluated||Y.props===!0))return;let w=J.strictSchema&&!J.allowMatchingProperties&&U.properties,G=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,b+=a1(k,2),b+=Q.magic,b+=a1(D,2),b+=a1(O,2),b+=a1(h.crc32,4),b+=a1(h.compressedSize,4),b+=a1(h.uncompressedSize,4),b+=a1(w.length,2),b+=a1(A.length,2);var g=sV.LOCAL_FILE_HEADER+b+w+A,f=sV.CENTRAL_FILE_HEADER+a1(n,2)+b+a1(W.length,2)+"\x00\x00\x00\x00"+a1(j,4)+a1(q,4)+w+A+W;return{fileRecord:g,dirRecord:f}},Wi0=function($,I,z,q,U){var Y="",J=Pq.transformTo("string",U(q));return Y=sV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+a1($,2)+a1($,2)+a1(I,4)+a1(z,4)+a1(J.length,2)+J,Y},Vi0=function($){var I="";return I=sV.DATA_DESCRIPTOR+a1($.crc32,4)+a1($.compressedSize,4)+a1($.uncompressedSize,4),I};function T8($,I,z,q){Tq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=z,this.encodeFileName=q,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Pq.inherits(T8,Tq);T8.prototype.push=function($){var I=$.meta.percent||0,z=this.entriesCount,q=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,Tq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(I+100*(z-q-1))/z:100}})};T8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var z=X10($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};T8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,z=X10($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),I)this.push({data:Vi0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};T8.prototype.flush=function(){var $=this.bytesWritten;for(var I=0;I<this.dirRecords.length;I++)this.push({data:this.dirRecords[I],meta:{percent:100}});var z=this.bytesWritten-$,q=Wi0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:q,meta:{percent:100}})};T8.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};T8.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(z){I.processChunk(z)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(z){I.error(z)}),this};T8.prototype.resume=function(){if(!Tq.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};T8.prototype.error=function($){var I=this._sources;if(!Tq.prototype.error.call(this,$))return!1;for(var z=0;z<I.length;z++)try{I[z].error($)}catch(q){}return!0};T8.prototype.lock=function(){Tq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};L10.exports=T8});var O10=F((Di0)=>{var Zi0=NR(),Xi0=D10(),Li0=function($,I){var z=$||I,q=Zi0[z];if(!q)throw Error(z+" is not a valid compression method !");return q};Di0.generateWorker=function($,I,z){var q=new Xi0(I.streamFiles,z,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=Li0(J.options.compression,I.compression),K=J.options.compressionOptions||I.compressionOptions||{},w=J.dir,G=J.date;J._compressWorker(Q,K).withStreamInfo("file",{name:Y,dir:w,date:G,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(q)}),q.entriesCount=U}catch(Y){q.error(Y)}return q}});var N10=F((uR1,F10)=>{var Fi0=D4(),eV=R$();function rQ($,I){eV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Fi0.inherits(rQ,eV);rQ.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(z){I.push({data:z,meta:{percent:0}})}).on("error",function(z){if(I.isPaused)this.generatedError=z;else I.error(z)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};rQ.prototype.pause=function(){if(!eV.prototype.pause.call(this))return!1;return this._stream.pause(),!0};rQ.prototype.resume=function(){if(!eV.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};F10.exports=rQ});var g10=F((xR1,R10)=>{var Ni0=Vq(),tQ=D4(),T10=R$(),Mi0=Bv(),E10=jv(),M10=SV(),Ai0=Ae(),Pi0=O10(),A10=vQ(),Ti0=N10(),B10=function($,I,z){var q=tQ.getTypeOf(I),U,Y=tQ.extend(z||{},E10);if(Y.date=Y.date||new Date,Y.compression!==null)Y.compression=Y.compression.toUpperCase();if(typeof Y.unixPermissions==="string")Y.unixPermissions=parseInt(Y.unixPermissions,8);if(Y.unixPermissions&&Y.unixPermissions&16384)Y.dir=!0;if(Y.dosPermissions&&Y.dosPermissions Line truncated
`)}openNode($,I){let z=this.tos,q=this._xml;if(z&&this.open)q.push(">");this._stack.push($),q.push("<"),q.push($),Ug(q,I),this.leaf=!0,this.open=!0}addAttribute($,I){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(I!==void 0)N60(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Ug(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(F60.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),I=this._xml;if(this.leaf)I.push("/>");else I.push("</"),I.push($),I.push(">");this.open=!1,this.leaf=!1}leafNode($,I,z){if(this.openNode($,I),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("")}}Yg.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};M60.exports=Yg});var Jg=F((Xd0)=>{var A60=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Zd0($){if(typeof $==="string")return $;if(A60)return A60.decode($);return $.toString()}Xd0.bufferToString=Zd0});var j60=F((T60)=>{Object.defineProperty(T60,"__esModule",{value:!0});T60.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;T60.S=` \r
`;T60.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";T60.NAME_CHAR="-"+T60.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";T60.CHAR_RE=new RegExp("^["+T60.CHAR+"]$","u");T60.S_RE=new RegExp("^["+T60.S+"]+$","u");T60.NAME_START_CHAR_RE=new RegExp("^["+T60.NAME_START_CHAR+"]$","u");T60.NAME_CHAR_RE=new RegExp("^["+T60.NAME_CHAR+"]$","u");T60.NAME_RE=new RegExp("^["+T60.NAME_START_CHAR+"]["+T60.NAME_CHAR+"]*$","u");T60.NMTOKEN_RE=new RegExp("^["+T60.NAME_CHAR+"]+$","u");var Qg=9,Kg=10,wg=13,Gg=32;T60.S_LIST=[Gg,Kg,wg,Qg];function Dd0($){return $>=Gg&&$<=55295||$===Kg||$===wg||$===Qg||$>=57344&&$<=65533||$>=65536&&$<=1114111}T60.isChar=Dd0;function Od0($){return $===Gg||$===Kg||$===wg||$===Qg}T60.isS=Od0;function P60($){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}T60.isNameStartChar=P60;function Fd0($){return P60($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}T60.isNameChar=Fd0});var x60=F((h60)=>{Object.defineProperty(h60,"__esModule",{value:!0});h60.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";h60.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";h60.S=` \r
`;h60.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";h60.NAME_CHAR="-"+h60.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";h60.CHAR_RE=new RegExp("^["+h60.CHAR+"]$","u");h60.RESTRICTED_CHAR_RE=new RegExp("^["+h60.RESTRICTED_CHAR+"]$","u");h60.S_RE=new RegExp("^["+h60.S+"]+$","u");h60.NAME_START_CHAR_RE=new RegExp("^["+h60.NAME_START_CHAR+"]$","u");h60.NAME_CHAR_RE=new RegExp("^["+h60.NAME_CHAR+"]$","u");h60.NAME_RE=new RegExp("^["+h60.NAME_START_CHAR+"]["+h60.NAME_CHAR+"]*$","u");h60.NMTOKEN_RE=new RegExp("^["+h60.NAME_CHAR+"]+$","u");var v60=9,R60=10,g60=13,_60=32;h60.S_LIST=[_60,R60,g60,v60];function _d0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}h60.isChar=_d0;function Cd0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}h60.isRestrictedChar=Cd0;function hd0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}h60.isCharAndNotRestricted=hd0;function Sd0($){return $===_60||$===R60||$===g60||$===v60}h60.isS=Sd0;function C60($){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}h60.isNameStartChar=C60;function yd0($){return C60($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}h60.isNameChar=yd0});var b60=F((f60)=>{Object.defineProperty(f60,"__esModule",{value:!0});f60.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";f60.NC_NAME_CHAR="-"+f60.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";f60.NC_NAME_START_CHAR_RE=new RegExp("^["+f60.NC_NAME_START_CHAR+"]$","u");f60.NC_NAME_CHAR_RE=new RegExp("^["+f60.NC_NAME_CHAR+"]$","u");f60.NC_NAME_RE=new RegExp("^["+f60.NC_NAME_START_CHAR+"]["+f60.NC_NAME_CHAR+"]*$","u");function k60($){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}f60.isNCNameStartChar=k60;function td0($){return k60($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}f60.isNCNameChar=td0});var K$0=F((Q$0)=>{Object.defineProperty(Q$0,"__esModule",{value:!0});var yq=j60(),zm0=x60(),Tg=b60(),W$=yq.isS,qm0=yq.isChar,w2=yq.isNameStartChar,n60=yq.isNameChar,I$0=yq.S_LIST,Um0=yq.NAME_RE,Ym0=zm0.isChar,Jm0=Tg.isNCNameStartChar,Qm0=Tg.isNCNameChar,Km0=Tg.NC_NAME_RE,vZ="http://www.w3.org/XML/1998/namespace",Sq="http://www.w3.org/2000/xmlns/",wm0={__proto__:null,xml:vZ,xmlns:Sq},Gm0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V4=-1,I5=-2,i60=0,Hm0=1,Wg=2,Wm0=3,_q=4,Vm0=5,Zm0=6,Xm0=7,Vg=8,Lm0=9,Dm0=10,Om0=11,Fm0=12,l6=13,PZ=14,Zg=15,Nm0=16,Xg=17,Mm0=18,Am0=19,Lg=20,Pm0=21,Tm0=22,Em0=23,p60=24,Dg=25,TZ=26,c60=27,Bm0=28,jm0=29,d60=30,vm0=31,Rm0=32,i3=33,gm0=34,Og=35,G2=36,Fg=37,_m0=38,m60=39,l60=40,Cm0=41,o60=42,hm0=43,Sm0=44,Ng=9,B8=10,Mg=13,r60=32,t60=33,z$0=34,H2=38,q$0=39,EZ=45,BZ=47,ym0=59,w7=60,Cq=61,m4=62,L6=63,U$0=91,hq=93,a60=133,s60=8232,jZ=($)=>$===z$0||$===q$0,Y$0=[z$0,q$0],um0=[...Y$0,U$0,m4],xm0=[...Y$0,w7,hq],km0=[Cq,L6,...I$0],fm0=[...I$0,m4,H2,w7];function Pg($,I,z){switch(I){case"xml":if(z!==vZ)$.fail(`xml prefix must be bound to ${vZ}.`);break;case"xmlns":if(z!==Sq)$.fail(`xmlns prefix must be bound to ${Sq}.`);break;default:}switch(z){case Sq:$.fail(I===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${Sq}.`);break;case vZ:switch(I){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 bm0($,I){for(let z of Object.keys(I))Pg($,z,I[z])}var nm0=($)=>Km0.test($),im0=($)=>Um0.test($),p3=0,e60=1,Ag=2;Q$0.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var $$0={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 J$0{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let I=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,I){this.nameStartCheck=Jm0,this.nameCheck=Qm0,this.isName=nm0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},wm0);let z=this.opt.additionalNamesp Line truncated
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:z}=this;while(!0){let q=this.getCode();switch(q){case I5:this.text+=`${z.slice(I,this.prevI)}
`,I=this.i,q=B8;break;case V4:return this.text+=z.slice(I),!1;default:}if(q===$)return this.text+=z.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let z=this.getCode();if(z===V4)return this.name+=$.slice(I),V4;if(!y60(z))return this.name+=$.slice(I,this.prevI),z===I5?B8:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===V4||!W$($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=md0,this.getCode=this.getCode10;else this.isChar=od0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=$m0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case w7:if(this.state=Wg,this.text.length!==0)throw Error("no-empty text at start");break;case V4:break;default:this.unget(),this.state=l6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(Em0);switch(I){case m4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=l6,this.doctype=!0;break}case V4:break;default:if(this.text+=String.fromCodePoint(I),I===s60)this.state=gq;else if(BZ(I))this.state=Im0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Gg}sDTD(){let $=this.captureTo(Bm0);if($===V4)return;if(this.text+=String.fromCodePoint($),$===Cq)this.state=Gg;else if($===w7)this.state=qm0;else if(BZ($))this.state=zm0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=gq,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case c60:this.state=Um0,this.openWakaBang="";break;case L6:this.state=Qm0;break;default:this.state=gq}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?Hg:gq,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(TZ))this.text+="-",this.state=Ym0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===TZ?Jm0:Hg}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===m4)this.state=gq;else this.fail("malformed comment."),this.state=Hg}sDTDPI(){if(this.captureToChar(L6))this.text+="?",this.state=Km0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===m4)this.state=gq}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case I5:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case Tm0:{let{entityReturnState:z}=this,q=this.entity+I.slice($,this.prevI);this.state=z;let U;if(q==="")this.fail("empty entity name."),U="&;";else U=this.parseEntity(q),this.entity="";if(z!==l6||this.textHandler!==void 0)this.text+=U;break $}case V4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(K2($))this.state=Fm0,this.unget(),this.xmlDeclPossible=!1;else switch($){case EZ:this.state=Am0,this.xmlDeclPossible=!1;break;case c60:this.state=wm0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case L6:this.state=Zm0;break;default:this.fail("disallowed character in tag name"),this.state=l6,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=Zg,this.openWakaBang="";break;case"--":this.state=Vg,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Gg,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(TZ))this.state=Gm0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===TZ)this.state=Hm0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=Vg}sCommentEnded(){let $=this.getCodeNorm();if($!==m4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=Vg;else this.state=l6}sCData(){if(this.captureToChar(Cq))this.state=Wm0}sCDataEnding(){let $=this.getCodeNorm();if($===Cq)this.state=Vm0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Zg}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case m4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=l6;break}case Cq:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=Zg}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=x60;else if($===L6||W$($))this.fail("processing instruction without a target."),this.state=$===L6?PZ:Xg;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=x60}sPIRest(){let{chunk:$,i:I}=this;while(!0){let z=this.getCodeNorm();if(z===V4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(I,this.prevI);let q=z===L6;if(q||W$(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=q?n3:k60}else this.state=q?PZ:Xg;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($===L6)this.state=PZ;else if(!W$($))this.text=String.fromCodePoint($)}else if(this.captureToChar(L6))this.state=PZ}sPIEnding(){var $;let I=this.getCodeNorm();if(I===m4){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=l6}else if(I===L6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Xg;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===L6){this.state=n3;return}if($!==V4)this.state=Xm0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(jm0);if($===L6){this.state=n3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(W$($)||$===_q))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=$===_q?f60:Lm0}sXMLDeclEq(){let $=this.getCodeNorm();if($===L6){this.state=n3,this.fail("XML declaration is incomplete.");return}if(W$($))return;if($!==_q)this.fail("value required.");this.state=f60}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===L6){this.state=n3,this.fail("XML declaration is incomplete.");return}if(W$($))return;if(!BZ($))this.fail("value must be quoted."),this.q=p60;else this.q=$;this.state=Dm0}sXMLDeclValue(){let $=this.captureTo([this.q,L6]);if($===L6){this.state=n3,this.text="",this.fail("XML declaration is incomplete.");return}if($===V4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=I;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver Line truncated
`;$=this.i,I=i3;break;case V4:if(q!==void 0)this.text+=z.slice($);break $;default:I=i3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:z}=this,q=!1;$:while(!0){let U=this.getCode();switch(U){case w7:{if(this.state=Wg,z!==void 0){let{text:Y}=this,J=I.slice($,this.prevI);if(Y.length!==0)z(Y+J),this.text="";else if(J.length!==0)z(J)}break $}case G2:if(this.state=AZ,this.entityReturnState=l6,z!==void 0)this.text+=I.slice($,this.prevI);q=!0;break $;case I5:if(z!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case V4:if(z!==void 0)this.text+=I.slice($);break $;default:if(!W$(U))q=!0}}if(!q)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($,I){var z;let{prefix:q,local:U}=this.qname($),Y={name:$,prefix:q,local:U,value:I};if(this.attribList.push(Y),(z=this.attributeHandler)===null||z===void 0||z.call(this,Y),q==="xmlns"){let J=I.trim();if(this.currentXMLVersion==="1.0"&&J==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[U]=J,Mg(this,U,J)}else if($==="xmlns"){let J=I.trim();this.topNS[""]=J,Mg(this,"",J)}}pushAttribPlain($,I){var z;let q={name:$,value:I};this.attribList.push(q),(z=this.attributeHandler)===null||z===void 0||z.call(this,q)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let U=z.pop();this.fail(`unclosed tag: ${U.name}`)}if(this.state!==u60&&this.state!==l6)this.fail("unexpected end.");let{text:q}=this;if(q.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,q),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,z;let q=this.topNS[$];if(q!==void 0)return q;let{tags:U}=this;for(let Y=U.length-1;Y>=0;Y--)if(q=U[Y].ns[$],q!==void 0)return q;if(q=this.ns[$],q!==void 0)return q;return(z=(I=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let z=$.slice(I+1),q=$.slice(0,I);if(q===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:q,local:z}}processAttribsNS(){var $;let{attribList:I}=this,z=this.tag;{let{prefix:Y,local:J}=this.qname(z.name);z.prefix=Y,z.local=J;let Q=z.uri=($=this.resolve(Y))!==null&&$!==void 0?$:"";if(Y!==""){if(Y==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(Q==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Y)}.`),z.uri=Y}}if(I.length===0)return;let{attributes:q}=z,U=new Set;for(let Y of I){let{name:J,prefix:Q,local:K}=Y,w,G;if(Q==="")w=J==="xmlns"?hq:"",G=J;else{if(w=this.resolve(Q),w===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),w=Q;G=`{${w}}${K}`}if(U.has(G))this.fail(`duplicate attribute: ${G}.`);U.add(G),Y.uri=w,q[J]=Y}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:z,value:q}of $){if(I[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);I[z]=q}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),I.push(z),this.state=l6,this.name=""}openSelfClosingTag(){var $,I,z;this.processAttribs();let{tags:q}=this,U=this.tag;if(U.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,U),(I=this.closeTagHandler)===null||I===void 0||I.call(this,U),(this.tag=(z=q[q.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=l6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=l6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,q=$.length;while(q-- >0){let U=this.tag=$.pop();if(this.topNS=U.ns,z===null||z===void 0||z(U),U.name===I)break;this.fail("unexpected close tag.")}if(q===0)this.closedRoot=!0;else if(q<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}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 I=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))I=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))I=parseInt($.slice(1),10);if(!this.isChar(I))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(I)}}I$0.SaxesParser=$$0});var H2=F((tR1,q$0)=>{var{SaxesParser:Sm0}=z$0(),{PassThrough:ym0}=g6(),{bufferToString:um0}=Ug();q$0.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new ym0);let I=new Sm0,z;I.on("error",(U)=>{z=U});let q=[];I.on("opentag",(U)=>q.push({eventType:"opentag",value:U})),I.on("text",(U)=>q.push({eventType:"text",value:U})),I.on("closetag",(U)=>q.push({eventType:"closetag",value:U}));for await(let U of $){if(I.write(um0(U)),z)throw z;yield q,q=[]}}});var O0=F((aR1,U$0)=>{var xm0=H2(),km0=X6();class yq{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof yq)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:z,value:q}of I)if(z==="opentag")this.parseOpen(q);else if(z==="text")this.parseText(q);else if(z==="closetag"){if(!this.parseClose(q.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&&((I=$.writeHeaders)!==null&&I!==void 0?I:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}SI0.FormatterOptions=hI0});var JX=F((AC1,fI0)=>{var os0="[object AsyncFunction]",rs0="[object Function]",ts0="[object GeneratorFunction]",as0="[object Null]",ss0="[object Proxy]",es0="[object Undefined]",$e0=typeof global=="object"&&global&&global.Object===Object&&global,Ie0=typeof self=="object"&&self&&self.Object===Object&&self,ze0=$e0||Ie0||Function("return this")(),xI0=Object.prototype,qe0=xI0.hasOwnProperty,kI0=xI0.toString,uI0=ze0.Symbol,r3=uI0?uI0.toStringTag:void 0;function Ue0($){if($==null)return $===void 0?es0:as0;return r3&&r3 in Object($)?Ye0($):Je0($)}function Ye0($){var I=qe0.call($,r3),z=$[r3];try{$[r3]=void 0;var q=!0}catch(Y){}var U=kI0.call($);if(q)if(I)$[r3]=z;else delete $[r3];return U}function Je0($){return kI0.call($)}function Qe0($){if(!Ke0($))return!1;var I=Ue0($);return I==rs0||I==ts0||I==os0||I==ss0}function Ke0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}fI0.exports=Qe0});var Nz0=F((QX,dq)=>{var we0=200,d_="__lodash_hash_undefined__",XX=1,aI0=2,sI0=9007199254740991,KX="[object Arguments]",k_="[object Array]",Ge0="[object AsyncFunction]",eI0="[object Boolean]",$z0="[object Date]",Iz0="[object Error]",zz0="[object Function]",He0="[object GeneratorFunction]",wX="[object Map]",qz0="[object Number]",We0="[object Null]",cq="[object Object]",bI0="[object Promise]",Ve0="[object Proxy]",Uz0="[object RegExp]",GX="[object Set]",Yz0="[object String]",Ze0="[object Symbol]",Xe0="[object Undefined]",f_="[object WeakMap]",Jz0="[object ArrayBuffer]",HX="[object DataView]",Le0="[object Float32Array]",De0="[object Float64Array]",Oe0="[object Int8Array]",Fe0="[object Int16Array]",Ne0="[object Int32Array]",Me0="[object Uint8Array]",Ae0="[object Uint8ClampedArray]",Pe0="[object Uint16Array]",Te0="[object Uint32Array]",Ee0=/[\\^$.*+?()[\]{}|]/g,Be0=/^\[object .+?Constructor\]$/,je0=/^(?:0|[1-9]\d*)$/,z4={};z4[Le0]=z4[De0]=z4[Oe0]=z4[Fe0]=z4[Ne0]=z4[Me0]=z4[Ae0]=z4[Pe0]=z4[Te0]=!0;z4[KX]=z4[k_]=z4[Jz0]=z4[eI0]=z4[HX]=z4[$z0]=z4[Iz0]=z4[zz0]=z4[wX]=z4[qz0]=z4[cq]=z4[Uz0]=z4[GX]=z4[Yz0]=z4[f_]=!1;var Qz0=typeof global=="object"&&global&&global.Object===Object&&global,ve0=typeof self=="object"&&self&&self.Object===Object&&self,c5=Qz0||ve0||Function("return this")(),Kz0=typeof QX=="object"&&QX&&!QX.nodeType&&QX,nI0=Kz0&&typeof dq=="object"&&dq&&!dq.nodeType&&dq,wz0=nI0&&nI0.exports===Kz0,y_=wz0&&Qz0.process,iI0=function(){try{return y_&&y_.binding&&y_.binding("util")}catch($){}}(),pI0=iI0&&iI0.isTypedArray;function Re0($,I){var z=-1,q=$==null?0:$.length,U=0,Y=[];while(++z<q){var J=$[z];if(I(J,z,$))Y[U++]=J}return Y}function ge0($,I){var z=-1,q=I.length,U=$.length;while(++z<q)$[U+z]=I[z];return $}function _e0($,I){var z=-1,q=$==null?0:$.length;while(++z<q)if(I($[z],z,$))return!0;return!1}function Ce0($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}function he0($){return function(I){return $(I)}}function Se0($,I){return $.has(I)}function ye0($,I){return $==null?void 0:$[I]}function ue0($){var I=-1,z=Array($.size);return $.forEach(function(q,U){z[++I]=[U,q]}),z}function xe0($,I){return function(z){return $(I(z))}}function ke0($){var I=-1,z=Array($.size);return $.forEach(function(q){z[++I]=q}),z}var fe0=Array.prototype,be0=Function.prototype,LX=Object.prototype,u_=c5["__core-js_shared__"],Gz0=be0.toString,q5=LX.hasOwnProperty,cI0=function(){var $=/[^.]+$/.exec(u_&&u_.keys&&u_.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Hz0=LX.toString,ne0=RegExp("^"+Gz0.call(q5).replace(Ee0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dI0=wz0?c5.Buffer:void 0,WX=c5.Symbol,mI0=c5.Uint8Array,Wz0=LX.propertyIsEnumerable,ie0=fe0.splice,t3=WX?WX.toStringTag:void 0,lI0=Object.getOwnPropertySymbols,pe0=dI0?dI0.isBuffer:void 0,ce0=xe0(Object.keys,Object),b_=mq(c5,"DataView"),O2=mq(c5,"Map"),n_=mq(c5,"Promise"),i_=mq(c5,"Set"),p_=mq(c5,"WeakMap"),F2=mq(Object,"create"),de0=e3(b_),me0=e3(O2),le0=e3(n_),oe0=e3(i_),re0=e3(p_),oI0=WX?WX.prototype:void 0,x_=oI0?oI0.valueOf:void 0;function a3($){var I=-1,z=$==null?0:$.length;this.clear();while(++I<z){var q=$[I];this.set(q[0],q[1])}}function te0(){this.__data__=F2?F2(null):{},this.size=0}function ae0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function se0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let z=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(U11.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,I,z){let q=`${Y11.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:U}=this;if(U.quote!==""){if(q.indexOf(U.quote)!==-1)return this.quoteField(q.replace(this.REPLACE_REGEXP,U.escapedQuote))}if(q.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,z))return this.quoteField(q);return q}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}lq.FieldFormatter=Rz0});var t_=F((gz0)=>{Object.defineProperty(gz0,"__esModule",{value:!0});gz0.isSyncTransform=void 0;gz0.isSyncTransform=($)=>$.length===1});var hz0=F((oq)=>{var Cz0=oq&&oq.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(oq,"__esModule",{value:!0});oq.RowFormatter=void 0;var Q11=Cz0(JX()),K11=Cz0(Nz0()),w11=r_(),G11=t_();class $I{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new w11.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($I.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(G11.isSyncTransform($))return(I,z)=>{let q=null;try{q=$(I)}catch(U){return z(U)}return z(null,q)};return(I,z)=>{$(I,z)}}set rowTransform($){if(!Q11.default($))throw TypeError("The transform should be a function");this._rowTransform=$I.createTransform($)}format($,I){this.callTransformer($,(z,q)=>{if(z)return I(z);if(!$)return I(null);let U=[];if(q){let{shouldFormatColumns:Y,headers:J}=this.checkHeaders(q);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)U.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Y){let Q=this.gatherColumns(q);U.push(this.formatColumns(Q,!1))}}return I(null,U)})}finish($){let I=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));I.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)I.push(this.formatterOptions.rowDelimiter);return $(null,I)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let I=$I.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!K11.default(I,$),headers:I}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((I)=>$[I]);if($I.isRowHashArray($))return this.headers.map((I,z)=>{let q=$[z];if(q)return q[1];return""});if($I.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,z)=>$[z])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let z=$.map((U,Y)=>this.fieldFormatter.format(U,Y,I)).join(this.formatterOptions.delimiter),{rowCount:q}=this;if(this.rowCount+=1,q)return[this.formatterOptions.rowDelimiter,z].join("");return z}}oq.RowFormatter=$I});var Sz0=F((FX)=>{Object.defineProperty(FX,"__esModule",{value:!0});FX.FieldFormatter=FX.RowFormatter=void 0;var H11=hz0();Object.defineProperty(FX,"RowFormatter",{enumerable:!0,get:function(){return H11.RowFormatter}});var W11=r_();Object.defineProperty(FX,"FieldFormatter",{enumerable:!0,get:function(){return W11.FieldFormatter}})});var a_=F((uz0)=>{Object.defineProperty(uz0,"__esModule",{value:!0});uz0.CsvFormatterStream=void 0;var Z11=t("stream"),X11=Sz0();class yz0 extends Z11.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new X11.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,z){let q=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(U,Y)=>{if(U)return q=!0,z(U);if(Y)Y.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return q=!0,z()})}catch(U){if(q)throw U;z(U)}}_flush($){this.rowFormatter.finish((I,z)=>{if(I)return $(I);if(z)z.forEach((q)=>{this.push(Buffer.from(q,"utf8"))});return $()})}}uz0.CsvFormatterStream=yz0});var fz0=F((j1)=>{var kz0=j1&&j1.__createBinding||(Object.create?function($,I,z,q){if(q===void 0)q=z;Object.defineProperty($,q,{enumerable:!0,get:function(){return I[z]}})}:function($,I,z,q){if(q===void 0)q=z;$[q]=I[z]}),L11=j1&&j1.__setModuleDefault||(Object.create?function($,I){Ob Line truncated
`,I=this.i,q=B8;break;case V4:return this.text+=z.slice(I),!1;default:}if(q===$)return this.text+=z.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let z=this.getCode();if(z===V4)return this.name+=$.slice(I),V4;if(!n60(z))return this.name+=$.slice(I,this.prevI),z===I5?B8:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===V4||!W$($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=qm0,this.getCode=this.getCode10;else this.isChar=Ym0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Hm0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case w7:if(this.state=Zg,this.text.length!==0)throw Error("no-empty text at start");break;case V4:break;default:this.unget(),this.state=l6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(um0);switch(I){case m4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=l6,this.doctype=!0;break}case V4:break;default:if(this.text+=String.fromCodePoint(I),I===U$0)this.state=_q;else if(jZ(I))this.state=Wm0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Wg}sDTD(){let $=this.captureTo(xm0);if($===V4)return;if(this.text+=String.fromCodePoint($),$===hq)this.state=Wg;else if($===w7)this.state=Zm0;else if(jZ($))this.state=Vm0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=_q,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case t60:this.state=Xm0,this.openWakaBang="";break;case L6:this.state=Om0;break;default:this.state=_q}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?Vg:_q,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(EZ))this.text+="-",this.state=Lm0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===EZ?Dm0:Vg}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===m4)this.state=_q;else this.fail("malformed comment."),this.state=Vg}sDTDPI(){if(this.captureToChar(L6))this.text+="?",this.state=Fm0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===m4)this.state=_q}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case I5:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case ym0:{let{entityReturnState:z}=this,q=this.entity+I.slice($,this.prevI);this.state=z;let U;if(q==="")this.fail("empty entity name."),U="&;";else U=this.parseEntity(q),this.entity="";if(z!==l6||this.textHandler!==void 0)this.text+=U;break $}case V4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(w2($))this.state=gm0,this.unget(),this.xmlDeclPossible=!1;else switch($){case BZ:this.state=hm0,this.xmlDeclPossible=!1;break;case t60:this.state=Nm0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case L6:this.state=Em0;break;default:this.fail("disallowed character in tag name"),this.state=l6,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=Lg,this.openWakaBang="";break;case"--":this.state=Xg,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Wg,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(EZ))this.state=Mm0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===EZ)this.state=Am0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=Xg}sCommentEnded(){let $=this.getCodeNorm();if($!==m4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=Xg;else this.state=l6}sCData(){if(this.captureToChar(hq))this.state=Pm0}sCDataEnding(){let $=this.getCodeNorm();if($===hq)this.state=Tm0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Lg}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case m4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=l6;break}case hq:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=Lg}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=p60;else if($===L6||W$($))this.fail("processing instruction without a target."),this.state=$===L6?TZ:Dg;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=p60}sPIRest(){let{chunk:$,i:I}=this;while(!0){let z=this.getCodeNorm();if(z===V4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(I,this.prevI);let q=z===L6;if(q||W$(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=q?i3:c60}else this.state=q?TZ:Dg;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($===L6)this.state=TZ;else if(!W$($))this.text=String.fromCodePoint($)}else if(this.captureToChar(L6))this.state=TZ}sPIEnding(){var $;let I=this.getCodeNorm();if(I===m4){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=l6}else if(I===L6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Dg;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===L6){this.state=i3;return}if($!==V4)this.state=Bm0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(km0);if($===L6){this.state=i3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(W$($)||$===Cq))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=$===Cq?d60:jm0}sXMLDeclEq(){let $=this.getCodeNorm();if($===L6){this.state=i3,this.fail("XML declaration is incomplete.");return}if(W$($))return;if($!==Cq)this.fail("value required.");this.state=d60}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===L6){this.state=i3,this.fail("XML declaration is incomplete.");return}if(W$($))return;if(!jZ($))this.fail("value must be quoted."),this.q=r60;else this.q=$;this.state=vm0}sXMLDeclValue(){let $=this.captureTo([this.q,L6]);if($===L6){this.state=i3,this.text="",this.fail("XML declaration is incomplete.");return}if($===V4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=I;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver Line truncated
`;$=this.i,I=p3;break;case V4:if(q!==void 0)this.text+=z.slice($);break $;default:I=p3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:z}=this,q=!1;$:while(!0){let U=this.getCode();switch(U){case w7:{if(this.state=Zg,z!==void 0){let{text:Y}=this,J=I.slice($,this.prevI);if(Y.length!==0)z(Y+J),this.text="";else if(J.length!==0)z(J)}break $}case H2:if(this.state=PZ,this.entityReturnState=l6,z!==void 0)this.text+=I.slice($,this.prevI);q=!0;break $;case I5:if(z!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case V4:if(z!==void 0)this.text+=I.slice($);break $;default:if(!W$(U))q=!0}}if(!q)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($,I){var z;let{prefix:q,local:U}=this.qname($),Y={name:$,prefix:q,local:U,value:I};if(this.attribList.push(Y),(z=this.attributeHandler)===null||z===void 0||z.call(this,Y),q==="xmlns"){let J=I.trim();if(this.currentXMLVersion==="1.0"&&J==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[U]=J,Pg(this,U,J)}else if($==="xmlns"){let J=I.trim();this.topNS[""]=J,Pg(this,"",J)}}pushAttribPlain($,I){var z;let q={name:$,value:I};this.attribList.push(q),(z=this.attributeHandler)===null||z===void 0||z.call(this,q)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let U=z.pop();this.fail(`unclosed tag: ${U.name}`)}if(this.state!==i60&&this.state!==l6)this.fail("unexpected end.");let{text:q}=this;if(q.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,q),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,z;let q=this.topNS[$];if(q!==void 0)return q;let{tags:U}=this;for(let Y=U.length-1;Y>=0;Y--)if(q=U[Y].ns[$],q!==void 0)return q;if(q=this.ns[$],q!==void 0)return q;return(z=(I=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let z=$.slice(I+1),q=$.slice(0,I);if(q===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:q,local:z}}processAttribsNS(){var $;let{attribList:I}=this,z=this.tag;{let{prefix:Y,local:J}=this.qname(z.name);z.prefix=Y,z.local=J;let Q=z.uri=($=this.resolve(Y))!==null&&$!==void 0?$:"";if(Y!==""){if(Y==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(Q==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Y)}.`),z.uri=Y}}if(I.length===0)return;let{attributes:q}=z,U=new Set;for(let Y of I){let{name:J,prefix:Q,local:K}=Y,w,G;if(Q==="")w=J==="xmlns"?Sq:"",G=J;else{if(w=this.resolve(Q),w===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),w=Q;G=`{${w}}${K}`}if(U.has(G))this.fail(`duplicate attribute: ${G}.`);U.add(G),Y.uri=w,q[J]=Y}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:z,value:q}of $){if(I[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);I[z]=q}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),I.push(z),this.state=l6,this.name=""}openSelfClosingTag(){var $,I,z;this.processAttribs();let{tags:q}=this,U=this.tag;if(U.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,U),(I=this.closeTagHandler)===null||I===void 0||I.call(this,U),(this.tag=(z=q[q.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=l6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=l6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,q=$.length;while(q-- >0){let U=this.tag=$.pop();if(this.topNS=U.ns,z===null||z===void 0||z(U),U.name===I)break;this.fail("unexpected close tag.")}if(q===0)this.closedRoot=!0;else if(q<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}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 I=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))I=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))I=parseInt($.slice(1),10);if(!this.isChar(I))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(I)}}Q$0.SaxesParser=J$0});var W2=F((Ng1,w$0)=>{var{SaxesParser:dm0}=K$0(),{PassThrough:mm0}=g6(),{bufferToString:lm0}=Jg();w$0.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new mm0);let I=new dm0,z;I.on("error",(U)=>{z=U});let q=[];I.on("opentag",(U)=>q.push({eventType:"opentag",value:U})),I.on("text",(U)=>q.push({eventType:"text",value:U})),I.on("closetag",(U)=>q.push({eventType:"closetag",value:U}));for await(let U of $){if(I.write(lm0(U)),z)throw z;yield q,q=[]}}});var O0=F((Mg1,G$0)=>{var om0=W2(),rm0=X6();class uq{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof uq)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:z,value:q}of I)if(z==="opentag")this.parseOpen(q);else if(z==="text")this.parseText(q);else if(z==="closetag"){if(!this.parseClose(q.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&&((I=$.writeHeaders)!==null&&I!==void 0?I:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}bI0.FormatterOptions=fI0});var QX=F((mC1,dI0)=>{var Ye0="[object AsyncFunction]",Je0="[object Function]",Qe0="[object GeneratorFunction]",Ke0="[object Null]",we0="[object Proxy]",Ge0="[object Undefined]",He0=typeof global=="object"&&global&&global.Object===Object&&global,We0=typeof self=="object"&&self&&self.Object===Object&&self,Ve0=He0||We0||Function("return this")(),pI0=Object.prototype,Ze0=pI0.hasOwnProperty,cI0=pI0.toString,iI0=Ve0.Symbol,t3=iI0?iI0.toStringTag:void 0;function Xe0($){if($==null)return $===void 0?Ge0:Ke0;return t3&&t3 in Object($)?Le0($):De0($)}function Le0($){var I=Ze0.call($,t3),z=$[t3];try{$[t3]=void 0;var q=!0}catch(Y){}var U=cI0.call($);if(q)if(I)$[t3]=z;else delete $[t3];return U}function De0($){return cI0.call($)}function Oe0($){if(!Fe0($))return!1;var I=Xe0($);return I==Je0||I==Qe0||I==Ye0||I==we0}function Fe0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}dI0.exports=Oe0});var Bz0=F((KX,mq)=>{var Ne0=200,l_="__lodash_hash_undefined__",LX=1,qz0=2,Uz0=9007199254740991,wX="[object Arguments]",b_="[object Array]",Me0="[object AsyncFunction]",Yz0="[object Boolean]",Jz0="[object Date]",Qz0="[object Error]",Kz0="[object Function]",Ae0="[object GeneratorFunction]",GX="[object Map]",wz0="[object Number]",Pe0="[object Null]",dq="[object Object]",mI0="[object Promise]",Te0="[object Proxy]",Gz0="[object RegExp]",HX="[object Set]",Hz0="[object String]",Ee0="[object Symbol]",Be0="[object Undefined]",n_="[object WeakMap]",Wz0="[object ArrayBuffer]",WX="[object DataView]",je0="[object Float32Array]",ve0="[object Float64Array]",Re0="[object Int8Array]",ge0="[object Int16Array]",_e0="[object Int32Array]",Ce0="[object Uint8Array]",he0="[object Uint8ClampedArray]",Se0="[object Uint16Array]",ye0="[object Uint32Array]",ue0=/[\\^$.*+?()[\]{}|]/g,xe0=/^\[object .+?Constructor\]$/,ke0=/^(?:0|[1-9]\d*)$/,z4={};z4[je0]=z4[ve0]=z4[Re0]=z4[ge0]=z4[_e0]=z4[Ce0]=z4[he0]=z4[Se0]=z4[ye0]=!0;z4[wX]=z4[b_]=z4[Wz0]=z4[Yz0]=z4[WX]=z4[Jz0]=z4[Qz0]=z4[Kz0]=z4[GX]=z4[wz0]=z4[dq]=z4[Gz0]=z4[HX]=z4[Hz0]=z4[n_]=!1;var Vz0=typeof global=="object"&&global&&global.Object===Object&&global,fe0=typeof self=="object"&&self&&self.Object===Object&&self,c5=Vz0||fe0||Function("return this")(),Zz0=typeof KX=="object"&&KX&&!KX.nodeType&&KX,lI0=Zz0&&typeof mq=="object"&&mq&&!mq.nodeType&&mq,Xz0=lI0&&lI0.exports===Zz0,x_=Xz0&&Vz0.process,oI0=function(){try{return x_&&x_.binding&&x_.binding("util")}catch($){}}(),rI0=oI0&&oI0.isTypedArray;function be0($,I){var z=-1,q=$==null?0:$.length,U=0,Y=[];while(++z<q){var J=$[z];if(I(J,z,$))Y[U++]=J}return Y}function ne0($,I){var z=-1,q=I.length,U=$.length;while(++z<q)$[U+z]=I[z];return $}function ie0($,I){var z=-1,q=$==null?0:$.length;while(++z<q)if(I($[z],z,$))return!0;return!1}function pe0($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}function ce0($){return function(I){return $(I)}}function de0($,I){return $.has(I)}function me0($,I){return $==null?void 0:$[I]}function le0($){var I=-1,z=Array($.size);return $.forEach(function(q,U){z[++I]=[U,q]}),z}function oe0($,I){return function(z){return $(I(z))}}function re0($){var I=-1,z=Array($.size);return $.forEach(function(q){z[++I]=q}),z}var te0=Array.prototype,ae0=Function.prototype,DX=Object.prototype,k_=c5["__core-js_shared__"],Lz0=ae0.toString,q5=DX.hasOwnProperty,tI0=function(){var $=/[^.]+$/.exec(k_&&k_.keys&&k_.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Dz0=DX.toString,se0=RegExp("^"+Lz0.call(q5).replace(ue0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),aI0=Xz0?c5.Buffer:void 0,VX=c5.Symbol,sI0=c5.Uint8Array,Oz0=DX.propertyIsEnumerable,ee0=te0.splice,a3=VX?VX.toStringTag:void 0,eI0=Object.getOwnPropertySymbols,$01=aI0?aI0.isBuffer:void 0,I01=oe0(Object.keys,Object),i_=lq(c5,"DataView"),F2=lq(c5,"Map"),p_=lq(c5,"Promise"),c_=lq(c5,"Set"),d_=lq(c5,"WeakMap"),N2=lq(Object,"create"),z01=$I(i_),q01=$I(F2),U01=$I(p_),Y01=$I(c_),J01=$I(d_),$z0=VX?VX.prototype:void 0,f_=$z0?$z0.valueOf:void 0;function s3($){var I=-1,z=$==null?0:$.length;this.clear();while(++I<z){var q=$[I];this.set(q[0],q[1])}}function Q01(){this.__data__=N2?N2(null):{},this.size=0}function K01($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function w01($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let z=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(X11.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,I,z){let q=`${L11.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:U}=this;if(U.quote!==""){if(q.indexOf(U.quote)!==-1)return this.quoteField(q.replace(this.REPLACE_REGEXP,U.escapedQuote))}if(q.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,z))return this.quoteField(q);return q}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}oq.FieldFormatter=yz0});var s_=F((uz0)=>{Object.defineProperty(uz0,"__esModule",{value:!0});uz0.isSyncTransform=void 0;uz0.isSyncTransform=($)=>$.length===1});var fz0=F((rq)=>{var kz0=rq&&rq.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(rq,"__esModule",{value:!0});rq.RowFormatter=void 0;var O11=kz0(QX()),F11=kz0(Bz0()),N11=a_(),M11=s_();class II{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new N11.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(II.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(M11.isSyncTransform($))return(I,z)=>{let q=null;try{q=$(I)}catch(U){return z(U)}return z(null,q)};return(I,z)=>{$(I,z)}}set rowTransform($){if(!O11.default($))throw TypeError("The transform should be a function");this._rowTransform=II.createTransform($)}format($,I){this.callTransformer($,(z,q)=>{if(z)return I(z);if(!$)return I(null);let U=[];if(q){let{shouldFormatColumns:Y,headers:J}=this.checkHeaders(q);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)U.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Y){let Q=this.gatherColumns(q);U.push(this.formatColumns(Q,!1))}}return I(null,U)})}finish($){let I=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));I.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)I.push(this.formatterOptions.rowDelimiter);return $(null,I)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let I=II.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!F11.default(I,$),headers:I}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((I)=>$[I]);if(II.isRowHashArray($))return this.headers.map((I,z)=>{let q=$[z];if(q)return q[1];return""});if(II.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,z)=>$[z])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let z=$.map((U,Y)=>this.fieldFormatter.format(U,Y,I)).join(this.formatterOptions.delimiter),{rowCount:q}=this;if(this.rowCount+=1,q)return[this.formatterOptions.rowDelimiter,z].join("");return z}}rq.RowFormatter=II});var bz0=F((NX)=>{Object.defineProperty(NX,"__esModule",{value:!0});NX.FieldFormatter=NX.RowFormatter=void 0;var A11=fz0();Object.defineProperty(NX,"RowFormatter",{enumerable:!0,get:function(){return A11.RowFormatter}});var P11=a_();Object.defineProperty(NX,"FieldFormatter",{enumerable:!0,get:function(){return P11.FieldFormatter}})});var e_=F((iz0)=>{Object.defineProperty(iz0,"__esModule",{value:!0});iz0.CsvFormatterStream=void 0;var E11=t("stream"),B11=bz0();class nz0 extends E11.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new B11.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,z){let q=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(U,Y)=>{if(U)return q=!0,z(U);if(Y)Y.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return q=!0,z()})}catch(U){if(q)throw U;z(U)}}_flush($){this.rowFormatter.finish((I,z)=>{if(I)return $(I);if(z)z.forEach((q)=>{this.push(Buffer.from(q,"utf8"))});return $()})}}iz0.CsvFormatterStream=nz0});var dz0=F((j1)=>{var cz0=j1&&j1.__createBinding||(Object.create?function($,I,z,q){if(q===void 0)q=z;Object.defineProperty($,q,{enumerable:!0,get:function(){return I[z]}})}:function($,I,z,q){if(q===void 0)q=z;$[q]=I[z]}),j11=j1&&j1.__setModuleDefault||(Object.create?function($,I){Ob Line truncated
`||I===`\r
`}static isTokenCarriageReturn($,I){return $.token===I.carriageReturn}static isTokenComment($,I){return I.supportsComments&&!!$&&$.token===I.comment}static isTokenEscapeCharacter($,I){return $.token===I.escapeChar}static isTokenQuote($,I){return $.token===I.quote}static isTokenDelimiter($,I){return $.token===I.delimiter}}bq0.Token=fq0});var MC=F((cq0)=>{Object.defineProperty(cq0,"__esModule",{value:!0});cq0.Scanner=void 0;var iq0=N7(),T$1=/((?:\r\n)|\n|\r)/;class pq0{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,I=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(I)===-1)return null;let z=I.exec($);if(z==null)return null;let q=z[1],U=this.cursor+(z.index||0);return new iq0.Token({token:q,startCursor:U,endCursor:U+q.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new iq0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=T$1.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}}cq0.Scanner=pq0});var iX=F((lq0)=>{Object.defineProperty(lq0,"__esModule",{value:!0});lq0.ColumnFormatter=void 0;class mq0{constructor($){if($.trim)this.format=(I)=>I.trim();else if($.ltrim)this.format=(I)=>I.trimLeft();else if($.rtrim)this.format=(I)=>I.trimRight();else this.format=(I)=>I}}lq0.ColumnFormatter=mq0});var AC=F((aq0)=>{Object.defineProperty(aq0,"__esModule",{value:!0});aq0.NonQuotedColumnParser=void 0;var E$1=iX(),rq0=N7();class tq0{constructor($){this.parserOptions=$,this.columnFormatter=new E$1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,z=[],q=$.nextCharacterToken;for(;q;q=$.nextCharacterToken){if(rq0.Token.isTokenDelimiter(q,I)||rq0.Token.isTokenRowDelimiter(q))break;z.push(q.token),$.advancePastToken(q)}return this.columnFormatter.format(z.join(""))}}aq0.NonQuotedColumnParser=tq0});var PC=F(($U0)=>{Object.defineProperty($U0,"__esModule",{value:!0});$U0.QuotedColumnParser=void 0;var B$1=iX(),YU=N7();class eq0{constructor($){this.parserOptions=$,this.columnFormatter=new B$1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:z,col:q}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(I),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),q}gatherDataBetweenQuotes($){let{parserOptions:I}=this,z=!1,q=!1,U=[],Y=$.nextCharacterToken;for(;!q&&Y!==null;Y=$.nextCharacterToken){let J=YU.Token.isTokenQuote(Y,I);if(!z&&J)z=!0;else if(z)if(YU.Token.isTokenEscapeCharacter(Y,I)){$.advancePastToken(Y);let Q=$.nextCharacterToken;if(Q!==null&&(YU.Token.isTokenQuote(Q,I)||YU.Token.isTokenEscapeCharacter(Q,I)))U.push(Q.token),Y=Q;else if(J)q=!0;else U.push(Y.token)}else if(J)q=!0;else U.push(Y.token);$.advancePastToken(Y)}return{col:this.columnFormatter.format(U.join("")),foundClosingQuote:q}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:z}=$;if(z){let q=YU.Token.isTokenDelimiter(z,I),U=YU.Token.isTokenRowDelimiter(z);if(!(q||U)){let Y=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${z.token}'. at '${Y}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}$U0.QuotedColumnParser=eq0});var YU0=F((qU0)=>{Object.defineProperty(qU0,"__esModule",{value:!0});qU0.ColumnParser=void 0;var j$1=AC(),v$1=PC(),R$1=N7();class zU0{constructor($){this.parserOptions=$,this.quotedColumnParser=new v$1.QuotedColumnParser($),this.nonQuotedColumnParser=new j$1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&R$1.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}qU0.ColumnParser=zU0});var TC=F((JU)=>{Object.defineProperty(JU,"__esModule",{value:!0});JU.ColumnFormatter=JU.QuotedColumnParser=JU.NonQuotedColumnParser=JU.ColumnParser=void 0;var g$1=YU0();Object.defineProperty(JU,"ColumnParser",{enumerable:!0,get:function(){return g$1.ColumnParser}});var _$1=AC();Object.defineProperty(JU,"NonQuotedColumnParser",{enumerable:!0,get:function(){return _$1.NonQuotedColumnParser}});var C$1=PC();Object.defineProperty(JU,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,x,x,V,q);let h=V.type==="*"?bC:V.type==="?"?pC:"\\"+V.type;U=!0,q=q.slice(0,V.reStart)+h+"\\("+x}if(T(),Y)q+="\\\\";let M=P81[q.charAt(0)];for(let x=Q.length-1;x>-1;x--){let h=Q[x],k=q.slice(0,h.reStart),E=q.slice(h.reStart,h.reEnd-8),f=q.slice(h.reEnd),n=q.slice(h.reEnd-8,h.reEnd)+f,g=k.split(")").length,b=k.split("(").length-g,p=f;for(let R=0;R<b;R++)p=p.replace(/\)[+*?]?/,"");f=p;let q0=f===""&&I!==nC?"(?:$|\\/)":"";q=k+E+f+q0+n}if(q!==""&&U)q="(?=.)"+q;if(M)q=O()+q;if(I===nC)return[q,U];if(z.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return E81($);let v=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+q+"$",v),{_glob:$,_src:q})}catch(x){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 I=this.options,z=I.noglobstar?bC:I.dot?M81:A81,q=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?j81(J):J===o6?o6:J._src).reduce((J,Q)=>{if(!(J[J.length-1]===o6&&Q===o6))J.push(Q);return J},[]),Y.forEach((J,Q)=>{if(J!==o6||Y[Q-1]===o6)return;if(Q===0)if(Y.length>1)Y[Q+1]="(?:\\/|"+z+"\\/)?"+Y[Q+1];else Y[Q]=z;else if(Q===Y.length-1)Y[Q-1]+="(?:\\/|"+z+")?";else Y[Q-1]+="(?:\\/|\\/"+z+"\\/)"+Y[Q+1],Y[Q+1]=o6}),Y.filter((J)=>J!==o6).join("/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}match($,I=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&I)return!0;let z=this.options;if(iC.sep!=="/")$=$.split(iC.sep).join("/");$=$.split(aU0),this.debug(this.pattern,"split",$);let q=this.set;this.debug(this.pattern,"set",q);let U;for(let Y=$.length-1;Y>=0;Y--)if(U=$[Y],U)break;for(let Y=0;Y<q.length;Y++){let J=q[Y],Q=$;if(z.matchBase&&J.length===1)Q=[U];if(this.matchOne(Q,J,I)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return C$.defaults($).Minimatch}}C$.Minimatch=j2});var YY0=F((_h1,UY0)=>{UY0.exports=qY0;var mC=t("fs"),{EventEmitter:R81}=t("events"),{Minimatch:dC}=$Y0(),{resolve:g81}=t("path");function _81($,I){return new Promise((z,q)=>{mC.readdir($,{withFileTypes:!0},(U,Y)=>{if(U)switch(U.code){case"ENOTDIR":if(I)q(U);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:q(U);break}else z(Y)})})}function IY0($,I){return new Promise((z,q)=>{(I?mC.stat:mC.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)z(IY0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*zY0($,I,z,q,U,Y){let J=await _81(I+$,Y);for(let Q of J){let K=Q.name;if(K===void 0)K=Q,q=!0;let w=$+"/"+K,G=w.slice(1),H=I+"/"+G,W=null;if(q||z)W=await IY0(H,z);if(!W&&Q.name!==void 0)W=Q;if(W===null)W={isDirectory:()=>!1};if(W.isDirectory()){if(!U(G))yield{relative:G,absolute:H,stats:W},yield*zY0(w,I,z,q,U,!1)}else yield{relative:G,absolute:H,stats:W}}}async function*C81($,I,z,q){yield*zY0("",$,I,z,q,!0)}function h81($){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 lC extends R81{constructor($,I,z){super();if(typeof I==="function")z=I,I=null;if(this.options=h81(I||{}),this.matchers=[],this.options.pattern){let q=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=q.map((U)=>new dC(U,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let q=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=q.map((U)=>new dC(U,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let q=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=q.map((U)=>new dC(U,{dot:!0}))}if(this.iterator=C81(g81($||"."),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",(q)=>this._matches.push(this.options.absolute?q.absolute:q.relative)),this.on("error",(q)=>z(q)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let z=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((q)=>q.match(z)))&&!this.ignoreMatchers.some((q)=>q.match(z))&&(!this.options.nodir||!I)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let I=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,I)){let z=$.value.relative,q=$.value.absolute;if(this.options.mark&&I)z+="/",q+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:q,stat:$.value.stats});else this.emit("match",{relative:z,ab Line truncated
`}static isTokenCarriageReturn($,I){return $.token===I.carriageReturn}static isTokenComment($,I){return I.supportsComments&&!!$&&$.token===I.comment}static isTokenEscapeCharacter($,I){return $.token===I.escapeChar}static isTokenQuote($,I){return $.token===I.quote}static isTokenDelimiter($,I){return $.token===I.delimiter}}mq0.Token=dq0});var PC=F((tq0)=>{Object.defineProperty(tq0,"__esModule",{value:!0});tq0.Scanner=void 0;var oq0=N7(),y$1=/((?:\r\n)|\n|\r)/;class rq0{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,I=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(I)===-1)return null;let z=I.exec($);if(z==null)return null;let q=z[1],U=this.cursor+(z.index||0);return new oq0.Token({token:q,startCursor:U,endCursor:U+q.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new oq0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=y$1.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}}tq0.Scanner=rq0});var pX=F((eq0)=>{Object.defineProperty(eq0,"__esModule",{value:!0});eq0.ColumnFormatter=void 0;class sq0{constructor($){if($.trim)this.format=(I)=>I.trim();else if($.ltrim)this.format=(I)=>I.trimLeft();else if($.rtrim)this.format=(I)=>I.trimRight();else this.format=(I)=>I}}eq0.ColumnFormatter=sq0});var TC=F((qU0)=>{Object.defineProperty(qU0,"__esModule",{value:!0});qU0.NonQuotedColumnParser=void 0;var u$1=pX(),IU0=N7();class zU0{constructor($){this.parserOptions=$,this.columnFormatter=new u$1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,z=[],q=$.nextCharacterToken;for(;q;q=$.nextCharacterToken){if(IU0.Token.isTokenDelimiter(q,I)||IU0.Token.isTokenRowDelimiter(q))break;z.push(q.token),$.advancePastToken(q)}return this.columnFormatter.format(z.join(""))}}qU0.NonQuotedColumnParser=zU0});var EC=F((JU0)=>{Object.defineProperty(JU0,"__esModule",{value:!0});JU0.QuotedColumnParser=void 0;var x$1=pX(),JU=N7();class YU0{constructor($){this.parserOptions=$,this.columnFormatter=new x$1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:z,col:q}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(I),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),q}gatherDataBetweenQuotes($){let{parserOptions:I}=this,z=!1,q=!1,U=[],Y=$.nextCharacterToken;for(;!q&&Y!==null;Y=$.nextCharacterToken){let J=JU.Token.isTokenQuote(Y,I);if(!z&&J)z=!0;else if(z)if(JU.Token.isTokenEscapeCharacter(Y,I)){$.advancePastToken(Y);let Q=$.nextCharacterToken;if(Q!==null&&(JU.Token.isTokenQuote(Q,I)||JU.Token.isTokenEscapeCharacter(Q,I)))U.push(Q.token),Y=Q;else if(J)q=!0;else U.push(Y.token)}else if(J)q=!0;else U.push(Y.token);$.advancePastToken(Y)}return{col:this.columnFormatter.format(U.join("")),foundClosingQuote:q}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:z}=$;if(z){let q=JU.Token.isTokenDelimiter(z,I),U=JU.Token.isTokenRowDelimiter(z);if(!(q||U)){let Y=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${z.token}'. at '${Y}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}JU0.QuotedColumnParser=YU0});var HU0=F((wU0)=>{Object.defineProperty(wU0,"__esModule",{value:!0});wU0.ColumnParser=void 0;var k$1=TC(),f$1=EC(),b$1=N7();class KU0{constructor($){this.parserOptions=$,this.quotedColumnParser=new f$1.QuotedColumnParser($),this.nonQuotedColumnParser=new k$1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&b$1.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}wU0.ColumnParser=KU0});var BC=F((QU)=>{Object.defineProperty(QU,"__esModule",{value:!0});QU.ColumnFormatter=QU.QuotedColumnParser=QU.NonQuotedColumnParser=QU.ColumnParser=void 0;var n$1=HU0();Object.defineProperty(QU,"ColumnParser",{enumerable:!0,get:function(){return n$1.ColumnParser}});var i$1=TC();Object.defineProperty(QU,"NonQuotedColumnParser",{enumerable:!0,get:function(){return i$1.NonQuotedColumnParser}});var p$1=EC();Object.defineProperty(QU,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,x,x,V,q);let h=V.type==="*"?iC:V.type==="?"?dC:"\\"+V.type;U=!0,q=q.slice(0,V.reStart)+h+"\\("+x}if(T(),Y)q+="\\\\";let M=S81[q.charAt(0)];for(let x=Q.length-1;x>-1;x--){let h=Q[x],k=q.slice(0,h.reStart),j=q.slice(h.reStart,h.reEnd-8),n=q.slice(h.reEnd),b=q.slice(h.reEnd-8,h.reEnd)+n,g=k.split(")").length,f=k.split("(").length-g,p=n;for(let R=0;R<f;R++)p=p.replace(/\)[+*?]?/,"");n=p;let q0=n===""&&I!==pC?"(?:$|\\/)":"";q=k+j+n+q0+b}if(q!==""&&U)q="(?=.)"+q;if(M)q=O()+q;if(I===pC)return[q,U];if(z.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return u81($);let v=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+q+"$",v),{_glob:$,_src:q})}catch(x){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 I=this.options,z=I.noglobstar?iC:I.dot?C81:h81,q=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?k81(J):J===o6?o6:J._src).reduce((J,Q)=>{if(!(J[J.length-1]===o6&&Q===o6))J.push(Q);return J},[]),Y.forEach((J,Q)=>{if(J!==o6||Y[Q-1]===o6)return;if(Q===0)if(Y.length>1)Y[Q+1]="(?:\\/|"+z+"\\/)?"+Y[Q+1];else Y[Q]=z;else if(Q===Y.length-1)Y[Q-1]+="(?:\\/|"+z+")?";else Y[Q-1]+="(?:\\/|\\/"+z+"\\/)"+Y[Q+1],Y[Q+1]=o6}),Y.filter((J)=>J!==o6).join("/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}match($,I=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&I)return!0;let z=this.options;if(cC.sep!=="/")$=$.split(cC.sep).join("/");$=$.split(qY0),this.debug(this.pattern,"split",$);let q=this.set;this.debug(this.pattern,"set",q);let U;for(let Y=$.length-1;Y>=0;Y--)if(U=$[Y],U)break;for(let Y=0;Y<q.length;Y++){let J=q[Y],Q=$;if(z.matchBase&&J.length===1)Q=[U];if(this.matchOne(Q,J,I)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return C$.defaults($).Minimatch}}C$.Minimatch=v2});var HY0=F((IS1,GY0)=>{GY0.exports=wY0;var oC=t("fs"),{EventEmitter:b81}=t("events"),{Minimatch:lC}=JY0(),{resolve:n81}=t("path");function i81($,I){return new Promise((z,q)=>{oC.readdir($,{withFileTypes:!0},(U,Y)=>{if(U)switch(U.code){case"ENOTDIR":if(I)q(U);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:q(U);break}else z(Y)})})}function QY0($,I){return new Promise((z,q)=>{(I?oC.stat:oC.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)z(QY0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*KY0($,I,z,q,U,Y){let J=await i81(I+$,Y);for(let Q of J){let K=Q.name;if(K===void 0)K=Q,q=!0;let w=$+"/"+K,G=w.slice(1),H=I+"/"+G,W=null;if(q||z)W=await QY0(H,z);if(!W&&Q.name!==void 0)W=Q;if(W===null)W={isDirectory:()=>!1};if(W.isDirectory()){if(!U(G))yield{relative:G,absolute:H,stats:W},yield*KY0(w,I,z,q,U,!1)}else yield{relative:G,absolute:H,stats:W}}}async function*p81($,I,z,q){yield*KY0("",$,I,z,q,!0)}function c81($){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 rC extends b81{constructor($,I,z){super();if(typeof I==="function")z=I,I=null;if(this.options=c81(I||{}),this.matchers=[],this.options.pattern){let q=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=q.map((U)=>new lC(U,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let q=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=q.map((U)=>new lC(U,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let q=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=q.map((U)=>new lC(U,{dot:!0}))}if(this.iterator=p81(n81($||"."),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",(q)=>this._matches.push(this.options.absolute?q.absolute:q.relative)),this.on("error",(q)=>z(q)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let z=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((q)=>q.match(z)))&&!this.ignoreMatchers.some((q)=>q.match(z))&&(!this.options.nodir||!I)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let I=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,I)){let z=$.value.relative,q=$.value.absolute;if(this.options.mark&&I)z+="/",q+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:q,stat:$.value.stats});else this.emit("match",{relative:z,ab Line truncated
`,y);y=I0===-1?B.length:I0}else if(d!==-1&&B[y]==="/"&&B[y+1]==="*"){let I0=B.indexOf("*/",y);if(I0!==-1)y=I0+2,d=B.indexOf("*/",y);else C+=B[y],y++}else C+=B[y],y++;return C}function n$(B){let C=k6(B.toString()),y=C.match(T4);if(!y)y=C.match(S4);if(!y)throw Error(`could not parse args in autoInject
Source:
`+C);let[,d]=y;return d.replace(/\s/g,"").split(b$).map((I0)=>I0.replace($$,"").trim())}function N$(B,C){var y={};return Object.keys(B).forEach((d)=>{var I0=B[d],Y0,w0=V(I0),H0=!w0&&I0.length===1||w0&&I0.length===0;if(Array.isArray(I0))Y0=[...I0],I0=Y0.pop(),y[d]=Y0.concat(Y0.length>0?L0:I0);else if(H0)y[d]=I0;else{if(Y0=n$(I0),I0.length===0&&!w0&&Y0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!w0)Y0.pop();y[d]=Y0.concat(L0)}function L0(u0,Z1){var P1=Y0.map((D1)=>u0[D1]);P1.push(Z1),D(I0)(...P1)}}),W1(y,C)}class a7{constructor(){this.head=this.tail=null,this.length=0}removeLink(B){if(B.prev)B.prev.next=B.next;else this.head=B.next;if(B.next)B.next.prev=B.prev;else this.tail=B.prev;return B.prev=B.next=null,this.length-=1,B}empty(){while(this.head)this.shift();return this}insertAfter(B,C){if(C.prev=B,C.next=B.next,B.next)B.next.prev=C;else this.tail=C;B.next=C,this.length+=1}insertBefore(B,C){if(C.prev=B.prev,C.next=B,B.prev)B.prev.next=C;else this.head=C;B.prev=C,this.length+=1}unshift(B){if(this.head)this.insertBefore(this.head,B);else M$(this,B)}push(B){if(this.tail)this.insertAfter(this.tail,B);else M$(this,B)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var B=this.head;while(B)yield B.data,B=B.next}remove(B){var C=this.head;while(C){var{next:y}=C;if(B(C))this.removeLink(C);C=y}return this}}function M$(B,C){B.length=1,B.head=B.tail=C}function N9(B,C,y){if(C==null)C=1;else if(C===0)throw RangeError("Concurrency must not be zero");var d=D(B),I0=0,Y0=[];let w0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function H0(b0,C0){w0[b0].push(C0)}function L0(b0,C0){let n0=(...O1)=>{u0(b0,n0),C0(...O1)};w0[b0].push(n0)}function u0(b0,C0){if(!b0)return Object.keys(w0).forEach((n0)=>w0[n0]=[]);if(!C0)return w0[b0]=[];w0[b0]=w0[b0].filter((n0)=>n0!==C0)}function Z1(b0,...C0){w0[b0].forEach((n0)=>n0(...C0))}var P1=!1;function D1(b0,C0,n0,O1){if(O1!=null&&typeof O1!=="function")throw Error("task callback must be a function");T1.started=!0;var H4,a4;function p$(e7,...AY){if(e7)return n0?a4(e7):H4();if(AY.length<=1)return H4(AY[0]);H4(AY)}var lI=T1._createTaskItem(b0,n0?p$:O1||p$);if(C0)T1._tasks.unshift(lI);else T1._tasks.push(lI);if(!P1)P1=!0,w(()=>{P1=!1,T1.process()});if(n0||!O1)return new Promise((e7,AY)=>{H4=e7,a4=AY})}function i$(b0){return function(C0,...n0){I0-=1;for(var O1=0,H4=b0.length;O1<H4;O1++){var a4=b0[O1],p$=Y0.indexOf(a4);if(p$===0)Y0.shift();else if(p$>0)Y0.splice(p$,1);if(a4.callback(C0,...n0),C0!=null)Z1("error",C0,a4.data)}if(I0<=T1.concurrency-T1.buffer)Z1("unsaturated");if(T1.idle())Z1("drain");T1.process()}}function mI(b0){if(b0.length===0&&T1.idle())return w(()=>Z1("drain")),!0;return!1}let s7=(b0)=>(C0)=>{if(!C0)return new Promise((n0,O1)=>{L0(b0,(H4,a4)=>{if(H4)return O1(H4);n0(a4)})});u0(b0),H0(b0,C0)};var MY=!1,T1={_tasks:new a7,_createTaskItem(b0,C0){return{data:b0,callback:C0}},*[Symbol.iterator](){yield*T1._tasks[Symbol.iterator]()},concurrency:C,payload:y,buffer:C/4,started:!1,paused:!1,push(b0,C0){if(Array.isArray(b0)){if(mI(b0))return;return b0.map((n0)=>D1(n0,!1,!1,C0))}return D1(b0,!1,!1,C0)},pushAsync(b0,C0){if(Array.isArray(b0)){if(mI(b0))return;return b0.map((n0)=>D1(n0,!1,!0,C0))}return D1(b0,!1,!0,C0)},kill(){u0(),T1._tasks.empty()},unshift(b0,C0){if(Array.isArray(b0)){if(mI(b0))return;return b0.map((n0)=>D1(n0,!0,!1,C0))}return D1(b0,!0,!1,C0)},unshiftAsync(b0,C0){if(Array.isArray(b0)){if(mI(b0))return;return b0.map((n0)=>D1(n0,!0,!0,C0))}return D1(b0,!0,!0,C0)},remove(b0){T1._tasks.remove(b0)},process(){if(MY)return;MY=!0;while(!T1.paused&&I0<T1.concurrency&&T1._tasks.length){var b0=[],C0=[],n0=T1._tasks.length;if(T1.payload)n0=Math.min(n0,T1.payload);for(var O1=0;O1<n0;O1++){var H4=T1._tasks.shift();b0.push(H4),Y0.push(H4),C0.push(H4.data)}if(I0+=1,T1._tasks.length===0)Z1("empty");if(I0===T1.concurrency)Z1("saturated");var a4=g(i$(b0));d(C0,a4)}MY=!1},length(){return T1._tasks.length},running(){return I0},workersList(){return Y0},idle(){return T1._tasks.length+I0===0},pause(){T1.paused=!0},resume(){if(T1.paused===!1)return;T1.paused=!1,w(T1.process)}};return Object.defineProperties(T1,{saturated:{writable:!1,value:s7("saturated")},unsaturated:{writable:!1,value:s7("unsaturated")},empty:{writable:!1,value:s7("empty")},drain:{writable:!1,value:s7("drain")},error:{writable:!1,value:s7("error")}}),T1}function R0(B,C){return N9(B,1,C)}function a(B,C,y){return N9(B,C,y)}function N(B,C,y,d){d=x(d);var I0=D(y);return S0(B,(Y0,w0,H0)=>{I0(C,Y0,(L0,u0)=>{C=u0,H0(L0)})},(Y0)=>d(Y0,C))}var P=O(N,4);function S(...B){var C=B.map(D);return function(...y){var d=this,I0=y[y.length-1];if(typeof I0=="function")y.pop();else I0=I1();return P(C,y,(Y0,w0,H0)=>{w0.apply(d,Y0.concat((L0,...u0)=>{H0(L0,u0)}))},(Y0,w0)=>I0(Y0,...w0)),I0[v0]}}function i(...B){return S(...B.reverse())}function s(B,C,y,d){return T(p(C),B,y,d)}var o=O(s,4);function $0 Line truncated
GFS4: `),console.error($)};if(!F4[O6]){if(oC=global[O6]||[],LY0(F4,oC),F4.close=function($){function I(z,q){return $.call(F4,z,function(U){if(!U)XY0();if(typeof q==="function")q.apply(this,arguments)})}return Object.defineProperty(I,sX,{value:$}),I}(F4.close),F4.closeSync=function($){function I(z){$.apply(F4,arguments),XY0()}return Object.defineProperty(I,sX,{value:$}),I}(F4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){UI(F4[O6]),t("assert").equal(F4[O6].length,0)})}var oC;if(!global[O6])LY0(global,F4[O6]);aC.exports=rC(i81(F4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F4.__patched)aC.exports=rC(F4),F4.__patched=!0;function rC($){b81($),$.gracefulify=rC,$.createReadStream=v,$.createWriteStream=x;var I=$.readFile;$.readFile=z;function z(E,f,n){if(typeof f==="function")n=f,f=null;return g(E,f,n);function g(b,p,q0,R){return I(b,p,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))wU([g,[b,p,q0],u,R||Date.now(),Date.now()]);else if(typeof q0==="function")q0.apply(this,arguments)})}}var q=$.writeFile;$.writeFile=U;function U(E,f,n,g){if(typeof n==="function")g=n,n=null;return b(E,f,n,g);function b(p,q0,R,u,c){return q(p,q0,R,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))wU([b,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(E,f,n,g){if(typeof n==="function")g=n,n=null;return b(E,f,n,g);function b(p,q0,R,u,c){return Y(p,q0,R,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))wU([b,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=K;function K(E,f,n,g){if(typeof n==="function")g=n,n=0;return b(E,f,n,g);function b(p,q0,R,u,c){return Q(p,q0,R,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))wU([b,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var w=$.readdir;$.readdir=H;var G=/^v[0-5]\./;function H(E,f,n){if(typeof f==="function")n=f,f=null;var g=G.test(process.version)?function(q0,R,u,c){return w(q0,b(q0,R,u,c))}:function(q0,R,u,c){return w(q0,R,b(q0,R,u,c))};return g(E,f,n);function b(p,q0,R,u){return function(c,m){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))wU([g,[p,q0,R],c,u||Date.now(),Date.now()]);else{if(m&&m.sort)m.sort();if(typeof R==="function")R.call(this,c,m)}}}}if(process.version.substr(0,4)==="v0.8"){var W=n81($);O=W.ReadStream,T=W.WriteStream}var V=$.ReadStream;if(V)O.prototype=Object.create(V.prototype),O.prototype.open=A;var X=$.WriteStream;if(X)T.prototype=Object.create(X.prototype),T.prototype.open=M;Object.defineProperty($,"ReadStream",{get:function(){return O},set:function(E){O=E},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return T},set:function(E){T=E},enumerable:!0,configurable:!0});var L=O;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(E){L=E},enumerable:!0,configurable:!0});var D=T;Object.defineProperty($,"FileWriteStream",{get:function(){return D},set:function(E){D=E},enumerable:!0,configurable:!0});function O(E,f){if(this instanceof O)return V.apply(this,arguments),this;else return O.apply(Object.create(O.prototype),arguments)}function A(){var E=this;k(E.path,E.flags,E.mode,function(f,n){if(f){if(E.autoClose)E.destroy();E.emit("error",f)}else E.fd=n,E.emit("open",n),E.read()})}function T(E,f){if(this instanceof T)return X.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function M(){var E=this;k(E.path,E.flags,E.mode,function(f,n){if(f)E.destroy(),E.emit("error",f);else E.fd=n,E.emit("open",n)})}function v(E,f){return new $.ReadStream(E,f)}function x(E,f){return new $.WriteStream(E,f)}var h=$.open;$.open=k;function k(E,f,n,g){if(typeof n==="function")g=n,n=null;return b(E,f,n,g);function b(p,q0,R,u,c){return h(p,q0,R,function(m,e){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))wU([b,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return $}function wU($){UI("ENQUEUE",$[0].name,$[1]),F4[O6].push($),tC()}var aX;function XY0(){var $=Date.now();for(var I=0;I<F4[O6].length;++I)if(F4[O6][I].length>2)F4[O6][I][3]=$,F4[O6][I][4]=$;tC()}function tC(){if(clearTimeout(aX),aX=void 0,F4[O6].length===0)return;var $=F4[O6].shift(),I=$[0],z=$[1],q=$[2],U=$[3],Y=$[4];if(U===void 0)UI("RETRY",I.name,z),I.apply(null,z);else if(Date.now()-U>=60000){UI("TIMEOUT",I.name,z);var J=z.pop();if(typeof J==="function")J.call(null,q)}else{var Q=Date.now()-Y,K=Math.max(Y-U,1),w=Math.min(K*1.2,100);if(Q>=w)UI("RETRY",I.name,z),I.apply(null,z.concat([U]));else F4[O6].push($)}if(aX===void 0)aX=setTimeout(tC,0)}});var OY0=F((uh1,sC)=>{function c81($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var DY0=C4().Buffer,v2=t("util");function d81($,I,z){$.copy(I,z)}sC.exports=function(){function $(){c81(this,$),this.head=null,this.tail=null,thi Line truncated
`+C);let[,d]=y;return d.replace(/\s/g,"").split(b$).map((I0)=>I0.replace($$,"").trim())}function N$(B,C){var y={};return Object.keys(B).forEach((d)=>{var I0=B[d],Y0,w0=V(I0),H0=!w0&&I0.length===1||w0&&I0.length===0;if(Array.isArray(I0))Y0=[...I0],I0=Y0.pop(),y[d]=Y0.concat(Y0.length>0?L0:I0);else if(H0)y[d]=I0;else{if(Y0=n$(I0),I0.length===0&&!w0&&Y0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!w0)Y0.pop();y[d]=Y0.concat(L0)}function L0(u0,Z1){var P1=Y0.map((D1)=>u0[D1]);P1.push(Z1),D(I0)(...P1)}}),W1(y,C)}class s7{constructor(){this.head=this.tail=null,this.length=0}removeLink(B){if(B.prev)B.prev.next=B.next;else this.head=B.next;if(B.next)B.next.prev=B.prev;else this.tail=B.prev;return B.prev=B.next=null,this.length-=1,B}empty(){while(this.head)this.shift();return this}insertAfter(B,C){if(C.prev=B,C.next=B.next,B.next)B.next.prev=C;else this.tail=C;B.next=C,this.length+=1}insertBefore(B,C){if(C.prev=B.prev,C.next=B,B.prev)B.prev.next=C;else this.head=C;B.prev=C,this.length+=1}unshift(B){if(this.head)this.insertBefore(this.head,B);else M$(this,B)}push(B){if(this.tail)this.insertAfter(this.tail,B);else M$(this,B)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var B=this.head;while(B)yield B.data,B=B.next}remove(B){var C=this.head;while(C){var{next:y}=C;if(B(C))this.removeLink(C);C=y}return this}}function M$(B,C){B.length=1,B.head=B.tail=C}function N9(B,C,y){if(C==null)C=1;else if(C===0)throw RangeError("Concurrency must not be zero");var d=D(B),I0=0,Y0=[];let w0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function H0(b0,C0){w0[b0].push(C0)}function L0(b0,C0){let n0=(...O1)=>{u0(b0,n0),C0(...O1)};w0[b0].push(n0)}function u0(b0,C0){if(!b0)return Object.keys(w0).forEach((n0)=>w0[n0]=[]);if(!C0)return w0[b0]=[];w0[b0]=w0[b0].filter((n0)=>n0!==C0)}function Z1(b0,...C0){w0[b0].forEach((n0)=>n0(...C0))}var P1=!1;function D1(b0,C0,n0,O1){if(O1!=null&&typeof O1!=="function")throw Error("task callback must be a function");T1.started=!0;var H4,a4;function p$($3,...PY){if($3)return n0?a4($3):H4();if(PY.length<=1)return H4(PY[0]);H4(PY)}var oI=T1._createTaskItem(b0,n0?p$:O1||p$);if(C0)T1._tasks.unshift(oI);else T1._tasks.push(oI);if(!P1)P1=!0,w(()=>{P1=!1,T1.process()});if(n0||!O1)return new Promise(($3,PY)=>{H4=$3,a4=PY})}function i$(b0){return function(C0,...n0){I0-=1;for(var O1=0,H4=b0.length;O1<H4;O1++){var a4=b0[O1],p$=Y0.indexOf(a4);if(p$===0)Y0.shift();else if(p$>0)Y0.splice(p$,1);if(a4.callback(C0,...n0),C0!=null)Z1("error",C0,a4.data)}if(I0<=T1.concurrency-T1.buffer)Z1("unsaturated");if(T1.idle())Z1("drain");T1.process()}}function lI(b0){if(b0.length===0&&T1.idle())return w(()=>Z1("drain")),!0;return!1}let e7=(b0)=>(C0)=>{if(!C0)return new Promise((n0,O1)=>{L0(b0,(H4,a4)=>{if(H4)return O1(H4);n0(a4)})});u0(b0),H0(b0,C0)};var AY=!1,T1={_tasks:new s7,_createTaskItem(b0,C0){return{data:b0,callback:C0}},*[Symbol.iterator](){yield*T1._tasks[Symbol.iterator]()},concurrency:C,payload:y,buffer:C/4,started:!1,paused:!1,push(b0,C0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>D1(n0,!1,!1,C0))}return D1(b0,!1,!1,C0)},pushAsync(b0,C0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>D1(n0,!1,!0,C0))}return D1(b0,!1,!0,C0)},kill(){u0(),T1._tasks.empty()},unshift(b0,C0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>D1(n0,!0,!1,C0))}return D1(b0,!0,!1,C0)},unshiftAsync(b0,C0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>D1(n0,!0,!0,C0))}return D1(b0,!0,!0,C0)},remove(b0){T1._tasks.remove(b0)},process(){if(AY)return;AY=!0;while(!T1.paused&&I0<T1.concurrency&&T1._tasks.length){var b0=[],C0=[],n0=T1._tasks.length;if(T1.payload)n0=Math.min(n0,T1.payload);for(var O1=0;O1<n0;O1++){var H4=T1._tasks.shift();b0.push(H4),Y0.push(H4),C0.push(H4.data)}if(I0+=1,T1._tasks.length===0)Z1("empty");if(I0===T1.concurrency)Z1("saturated");var a4=g(i$(b0));d(C0,a4)}AY=!1},length(){return T1._tasks.length},running(){return I0},workersList(){return Y0},idle(){return T1._tasks.length+I0===0},pause(){T1.paused=!0},resume(){if(T1.paused===!1)return;T1.paused=!1,w(T1.process)}};return Object.defineProperties(T1,{saturated:{writable:!1,value:e7("saturated")},unsaturated:{writable:!1,value:e7("unsaturated")},empty:{writable:!1,value:e7("empty")},drain:{writable:!1,value:e7("drain")},error:{writable:!1,value:e7("error")}}),T1}function R0(B,C){return N9(B,1,C)}function a(B,C,y){return N9(B,C,y)}function N(B,C,y,d){d=x(d);var I0=D(y);return S0(B,(Y0,w0,H0)=>{I0(C,Y0,(L0,u0)=>{C=u0,H0(L0)})},(Y0)=>d(Y0,C))}var P=O(N,4);function S(...B){var C=B.map(D);return function(...y){var d=this,I0=y[y.length-1];if(typeof I0=="function")y.pop();else I0=I1();return P(C,y,(Y0,w0,H0)=>{w0.apply(d,Y0.concat((L0,...u0)=>{H0(L0,u0)}))},(Y0,w0)=>I0(Y0,...w0)),I0[v0]}}function i(...B){return S(...B.reverse())}function s(B,C,y,d){return T(p(C),B,y,d)}var o=O(s,4);function $0 Line truncated
GFS4: `),console.error($)};if(!F4[O6]){if(tC=global[O6]||[],AY0(F4,tC),F4.close=function($){function I(z,q){return $.call(F4,z,function(U){if(!U)MY0();if(typeof q==="function")q.apply(this,arguments)})}return Object.defineProperty(I,eX,{value:$}),I}(F4.close),F4.closeSync=function($){function I(z){$.apply(F4,arguments),MY0()}return Object.defineProperty(I,eX,{value:$}),I}(F4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){YI(F4[O6]),t("assert").equal(F4[O6].length,0)})}var tC;if(!global[O6])AY0(global,F4[O6]);eC.exports=aC(e81(F4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F4.__patched)eC.exports=aC(F4),F4.__patched=!0;function aC($){a81($),$.gracefulify=aC,$.createReadStream=v,$.createWriteStream=x;var I=$.readFile;$.readFile=z;function z(j,n,b){if(typeof n==="function")b=n,n=null;return g(j,n,b);function g(f,p,q0,R){return I(f,p,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))GU([g,[f,p,q0],u,R||Date.now(),Date.now()]);else if(typeof q0==="function")q0.apply(this,arguments)})}}var q=$.writeFile;$.writeFile=U;function U(j,n,b,g){if(typeof b==="function")g=b,b=null;return f(j,n,b,g);function f(p,q0,R,u,c){return q(p,q0,R,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))GU([f,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(j,n,b,g){if(typeof b==="function")g=b,b=null;return f(j,n,b,g);function f(p,q0,R,u,c){return Y(p,q0,R,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))GU([f,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=K;function K(j,n,b,g){if(typeof b==="function")g=b,b=0;return f(j,n,b,g);function f(p,q0,R,u,c){return Q(p,q0,R,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))GU([f,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var w=$.readdir;$.readdir=H;var G=/^v[0-5]\./;function H(j,n,b){if(typeof n==="function")b=n,n=null;var g=G.test(process.version)?function(q0,R,u,c){return w(q0,f(q0,R,u,c))}:function(q0,R,u,c){return w(q0,R,f(q0,R,u,c))};return g(j,n,b);function f(p,q0,R,u){return function(c,m){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))GU([g,[p,q0,R],c,u||Date.now(),Date.now()]);else{if(m&&m.sort)m.sort();if(typeof R==="function")R.call(this,c,m)}}}}if(process.version.substr(0,4)==="v0.8"){var W=s81($);O=W.ReadStream,T=W.WriteStream}var V=$.ReadStream;if(V)O.prototype=Object.create(V.prototype),O.prototype.open=A;var X=$.WriteStream;if(X)T.prototype=Object.create(X.prototype),T.prototype.open=M;Object.defineProperty($,"ReadStream",{get:function(){return O},set:function(j){O=j},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return T},set:function(j){T=j},enumerable:!0,configurable:!0});var L=O;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(j){L=j},enumerable:!0,configurable:!0});var D=T;Object.defineProperty($,"FileWriteStream",{get:function(){return D},set:function(j){D=j},enumerable:!0,configurable:!0});function O(j,n){if(this instanceof O)return V.apply(this,arguments),this;else return O.apply(Object.create(O.prototype),arguments)}function A(){var j=this;k(j.path,j.flags,j.mode,function(n,b){if(n){if(j.autoClose)j.destroy();j.emit("error",n)}else j.fd=b,j.emit("open",b),j.read()})}function T(j,n){if(this instanceof T)return X.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function M(){var j=this;k(j.path,j.flags,j.mode,function(n,b){if(n)j.destroy(),j.emit("error",n);else j.fd=b,j.emit("open",b)})}function v(j,n){return new $.ReadStream(j,n)}function x(j,n){return new $.WriteStream(j,n)}var h=$.open;$.open=k;function k(j,n,b,g){if(typeof b==="function")g=b,b=null;return f(j,n,b,g);function f(p,q0,R,u,c){return h(p,q0,R,function(m,e){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))GU([f,[p,q0,R,u],m,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return $}function GU($){YI("ENQUEUE",$[0].name,$[1]),F4[O6].push($),sC()}var sX;function MY0(){var $=Date.now();for(var I=0;I<F4[O6].length;++I)if(F4[O6][I].length>2)F4[O6][I][3]=$,F4[O6][I][4]=$;sC()}function sC(){if(clearTimeout(sX),sX=void 0,F4[O6].length===0)return;var $=F4[O6].shift(),I=$[0],z=$[1],q=$[2],U=$[3],Y=$[4];if(U===void 0)YI("RETRY",I.name,z),I.apply(null,z);else if(Date.now()-U>=60000){YI("TIMEOUT",I.name,z);var J=z.pop();if(typeof J==="function")J.call(null,q)}else{var Q=Date.now()-Y,K=Math.max(Y-U,1),w=Math.min(K*1.2,100);if(Q>=w)YI("RETRY",I.name,z),I.apply(null,z.concat([U]));else F4[O6].push($)}if(sX===void 0)sX=setTimeout(sC,0)}});var TY0=F((JS1,$h)=>{function I51($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var PY0=C4().Buffer,R2=t("util");function z51($,I,z){$.copy(I,z)}$h.exports=function(){function $(){I51(this,$),this.head=null,this.tail=null,thi Line truncated
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/UJ0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var q="";if(z>4&&$[3]==="\\"){var U=$[2];if((U==="?"||U===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),q="//"}var Y=$.split(/[/\\]+/);if(I!==!1&&Y[Y.length-1]==="")Y.pop();return q+Y.join("/")}});var Oh=F((oh1,HJ0)=>{var JJ0=9007199254740991,a51="[object Arguments]",s51="[object Function]",e51="[object GeneratorFunction]",$91=/^(?:0|[1-9]\d*)$/;function QJ0($,I,z){switch(z.length){case 0:return $.call(I);case 1:return $.call(I,z[0]);case 2:return $.call(I,z[0],z[1]);case 3:return $.call(I,z[0],z[1],z[2])}return $.apply(I,z)}function I91($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}var x2=Object.prototype,k2=x2.hasOwnProperty,KJ0=x2.toString,z91=x2.propertyIsEnumerable,YJ0=Math.max;function q91($,I){var z=V91($)||W91($)?I91($.length,String):[],q=z.length,U=!!q;for(var Y in $)if((I||k2.call($,Y))&&!(U&&(Y=="length"||GJ0(Y,q))))z.push(Y);return z}function U91($,I,z,q){if($===void 0||Xh($,x2[z])&&!k2.call(q,z))return I;return $}function Y91($,I,z){var q=$[I];if(!(k2.call($,I)&&Xh(q,z))||z===void 0&&!(I in $))$[I]=z}function J91($){if(!Dh($))return H91($);var I=G91($),z=[];for(var q in $)if(!(q=="constructor"&&(I||!k2.call($,q))))z.push(q);return z}function wJ0($,I){return I=YJ0(I===void 0?$.length-1:I,0),function(){var z=arguments,q=-1,U=YJ0(z.length-I,0),Y=Array(U);while(++q<U)Y[q]=z[I+q];q=-1;var J=Array(I+1);while(++q<I)J[q]=z[q];return J[I]=Y,QJ0($,this,J)}}function Q91($,I,z,q){z||(z={});var U=-1,Y=I.length;while(++U<Y){var J=I[U],Q=q?q(z[J],$[J],J,z,$):void 0;Y91(z,J,Q===void 0?$[J]:Q)}return z}function K91($){return wJ0(function(I,z){var q=-1,U=z.length,Y=U>1?z[U-1]:void 0,J=U>2?z[2]:void 0;if(Y=$.length>3&&typeof Y=="function"?(U--,Y):void 0,J&&w91(z[0],z[1],J))Y=U<3?void 0:Y,U=1;I=Object(I);while(++q<U){var Q=z[q];if(Q)$(I,Q,q,Y)}return I})}function GJ0($,I){return I=I==null?JJ0:I,!!I&&(typeof $=="number"||$91.test($))&&($>-1&&$%1==0&&$<I)}function w91($,I,z){if(!Dh(z))return!1;var q=typeof I;if(q=="number"?Lh(z)&&GJ0(I,z.length):q=="string"&&(I in z))return Xh(z[I],$);return!1}function G91($){var I=$&&$.constructor,z=typeof I=="function"&&I.prototype||x2;return $===z}function H91($){var I=[];if($!=null)for(var z in Object($))I.push(z);return I}function Xh($,I){return $===I||$!==$&&I!==I}function W91($){return Z91($)&&k2.call($,"callee")&&(!z91.call($,"callee")||KJ0.call($)==a51)}var V91=Array.isArray;function Lh($){return $!=null&&L91($.length)&&!X91($)}function Z91($){return D91($)&&Lh($)}function X91($){var I=Dh($)?KJ0.call($):"";return I==s51||I==e51}function L91($){return typeof $=="number"&&$>-1&&$%1==0&&$<=JJ0}function Dh($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function D91($){return!!$&&typeof $=="object"}var O91=K91(function($,I,z,q){Q91(I,N91(I),$,q)}),F91=wJ0(function($){return $.push(void 0,U91),QJ0(O91,void 0,$)});function N91($){return Lh($)?q91($,!0):J91($)}HJ0.exports=F91});var VJ0=F((rh1,Fh)=>{function M91($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var WJ0=C4().Buffer,f2=t("util");function A91($,I,z){$.copy(I,z)}Fh.exports=function(){function $(){M91(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var q={data:z,next:null};if(this.length>0)this.tail.next=q;else this.head=q;this.tail=q,++this.length},$.prototype.unshift=function(z){var q={data:z,next:this.head};if(this.length===0)this.tail=q;this.head=q,++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 q=this.head,U=""+q.data;while(q=q.next)U+=z+q.data;return U},$.prototype.concat=function(z){if(this.length===0)return WJ0.alloc(0);var q=WJ0.allocUnsafe(z>>>0),U=this.head,Y=0;while(U)A91(U.data,q,Y),Y+=U.data.length,U=U.next;return q},$}();if(f2&&f2.inspect&&f2.inspect.custom)Fh.exports.prototype[f2.inspect.custom]=function(){var $=f2.inspect({length:this.length});return this.constructor.name+" "+$}});var Nh=F((th1,ZJ0)=>{var HL=_4();function P91($,I){var z=this,q=this._readableState&&this._readableState.destroyed,U=this._writableState&&this._writableState.destroyed;if(q||U){if(I)I($);else if($){if(!this._writableState)HL.nextTick(WL,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,HL.nextTick(WL,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Y){if(!I&&Y){if(!z._writableState)HL.nextTick(WL,z,Y);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,HL.nextTick(WL,z,Y)}else if(I)I(Y)}),this}function T91(){if(this._readableState)this._readable Line truncated
%s`,v,v,A,q);var x=A.type==="*"?US:A.type==="?"?qS:"\\"+A.type;U=!0,q=q.slice(0,A.reStart)+x+"\\("+v}if(X(),Y)q+="\\\\";var h=!1;switch(q.charAt(0)){case"[":case".":case"(":h=!0}for(var k=Q.length-1;k>-1;k--){var E=Q[k],f=q.slice(0,E.reStart),n=q.slice(E.reStart,E.reEnd-8),g=q.slice(E.reEnd-8,E.reEnd),b=q.slice(E.reEnd);g+=b;var p=f.split("(").length-1,q0=b;for(L=0;L<p;L++)q0=q0.replace(/\)[+*?]?/,"");b=q0;var R="";if(b===""&&I!==vL)R="$";var u=f+n+b+R+g;q=u}if(q!==""&&U)q="(?=.)"+q;if(h)q=W+q;if(I===vL)return[q,U];if(!U)return pz1($);var c=z.nocase?"i":"";try{var m=new RegExp("^"+q+"$",c)}catch(e){return new RegExp("$.")}return m._glob=$,m._src=q,m}h$.makeRe=function($,I){return new k4($,I||{}).makeRe()};k4.prototype.makeRe=iz1;function iz1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,z=I.noglobstar?US:I.dot?Sz1:yz1,q=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===WI?z:typeof J==="string"?cz1(J):J._src}).join("\\/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}h$.match=function($,I,z){z=z||{};var q=new k4(I,z);if($=$.filter(function(U){return q.match(U)}),q.options.nonull&&!$.length)$.push(I);return $};k4.prototype.match=function(I,z){if(typeof z>"u")z=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&z)return!0;var q=this.options;if(a2.sep!=="/")I=I.split(a2.sep).join("/");I=I.split(iQ0),this.debug(this.pattern,"split",I);var U=this.set;this.debug(this.pattern,"set",U);var Y,J;for(J=I.length-1;J>=0;J--)if(Y=I[J],Y)break;for(J=0;J<U.length;J++){var Q=U[J],K=I;if(q.matchBase&&Q.length===1)K=[Y];var w=this.matchOne(K,Q,z);if(w){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate};k4.prototype.matchOne=function($,I,z){if(I.indexOf(WI)!==-1)return this._matchGlobstar($,I,z,0,0);return this._matchOne($,I,z,0,0)};k4.prototype._matchGlobstar=function($,I,z,q,U){var Y,J=-1;for(Y=U;Y<I.length;Y++)if(I[Y]===WI){J=Y;break}var Q=-1;for(Y=I.length-1;Y>=0;Y--)if(I[Y]===WI){Q=Y;break}var K=I.slice(U,J),w=z?I.slice(J+1):I.slice(J+1,Q),G=z?[]:I.slice(Q+1);if(K.length){var H=$.slice(q,q+K.length);if(!this._matchOne(H,K,z,0,0))return!1;q+=K.length}var W=0;if(G.length){if(G.length+q>$.length)return!1;var V=$.length-G.length;if(this._matchOne($,G,z,V,0))W=G.length;else{if($[$.length-1]!==""||q+G.length===$.length)return!1;if(V--,!this._matchOne($,G,z,V,0))return!1;W=G.length+1}}if(!w.length){var X=!!W;for(Y=q;Y<$.length-W;Y++){var L=String($[Y]);if(X=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return z||X}var D=[[[],0]],O=D[0],A=0,T=[0];for(var M=0;M<w.length;M++){var v=w[M];if(v===WI)T.push(A),O=[[],0],D.push(O);else O[0].push(v),A++}var x=D.length-1,h=$.length-W;for(var k=0;k<D.length;k++)D[k][1]=h-(T[x--]+D[k][0].length);return!!this._matchGlobStarBodySections($,D,q,0,z,0,!!W)};k4.prototype._matchGlobStarBodySections=function($,I,z,q,U,Y,J){var Q=I[q];if(!Q){for(var K=z;K<$.length;K++){J=!0;var w=$[K];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1}return J}var G=Q[0],H=Q[1];while(z<=H){var W=this._matchOne($.slice(0,z+G.length),G,U,z,0);if(W&&Y<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,z+G.length,q+1,U,Y+1,J);if(V!==!1)return V}var w=$[z];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1;z++}return U||null};k4.prototype._matchOne=function($,I,z,q,U){var Y,J,Q,K;for(Y=q,J=U,Q=$.length,K=I.length;Y<Q&&J<K;Y++,J++){this.debug("matchOne loop");var w=I[J],G=$[Y];if(this.debug(I,w,G),w===!1||w===WI)return!1;var H;if(typeof w==="string")H=G===w,this.debug("string match",w,G,H);else H=G.match(w),this.debug("pattern match",w,G,H);if(!H)return!1}if(Y===Q&&J===K)return!0;else if(Y===Q)return z;else if(J===K)return Y===Q-1&&$[Y]==="";throw Error("wtf?")};function pz1($){return $.replace(/\\(.)/g,"$1")}function cz1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var CL=F((XS1,_L)=>{function dQ0($){return $.charAt(0)==="/"}function mQ0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=I.exec($),q=z[1]||"",U=Boolean(q&&q.charAt(1)!==":");return Boolean(z[2]||U)}_L.exports=process.platform==="win32"?mQ0:dQ0;_L.exports.posix=dQ0;_L.exports.win32=mQ0});var JS=F(($q1)=>{$q1.setopts=tz1;$q1.ownProp=lQ0;$q1.makeAbs=s2;$q1.finish=az1;$q1.mark=sz1;$q1.isIgnored=rQ0;$q1.childrenIgnored=ez1;function lQ0($,I){return Object.prototype.hasOwnProperty.call($,I)}var dz1=t("fs"),AU=t("path"),mz1=gL(),oQ0=CL(),YS=mz1.Minimatch;function lz1($,I){return $.localeCompare(I,"en")}function oz1($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(rz1)}function rz1($){var I=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");I=new YS(z,{dot:!0})}return{matcher: Line truncated
*/GJ0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var q="";if(z>4&&$[3]==="\\"){var U=$[2];if((U==="?"||U===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),q="//"}var Y=$.split(/[/\\]+/);if(I!==!1&&Y[Y.length-1]==="")Y.pop();return q+Y.join("/")}});var Nh=F((OS1,DJ0)=>{var WJ0=9007199254740991,K91="[object Arguments]",w91="[object Function]",G91="[object GeneratorFunction]",H91=/^(?:0|[1-9]\d*)$/;function VJ0($,I,z){switch(z.length){case 0:return $.call(I);case 1:return $.call(I,z[0]);case 2:return $.call(I,z[0],z[1]);case 3:return $.call(I,z[0],z[1],z[2])}return $.apply(I,z)}function W91($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}var k2=Object.prototype,f2=k2.hasOwnProperty,ZJ0=k2.toString,V91=k2.propertyIsEnumerable,HJ0=Math.max;function Z91($,I){var z=T91($)||P91($)?W91($.length,String):[],q=z.length,U=!!q;for(var Y in $)if((I||f2.call($,Y))&&!(U&&(Y=="length"||LJ0(Y,q))))z.push(Y);return z}function X91($,I,z,q){if($===void 0||Dh($,k2[z])&&!f2.call(q,z))return I;return $}function L91($,I,z){var q=$[I];if(!(f2.call($,I)&&Dh(q,z))||z===void 0&&!(I in $))$[I]=z}function D91($){if(!Fh($))return A91($);var I=M91($),z=[];for(var q in $)if(!(q=="constructor"&&(I||!f2.call($,q))))z.push(q);return z}function XJ0($,I){return I=HJ0(I===void 0?$.length-1:I,0),function(){var z=arguments,q=-1,U=HJ0(z.length-I,0),Y=Array(U);while(++q<U)Y[q]=z[I+q];q=-1;var J=Array(I+1);while(++q<I)J[q]=z[q];return J[I]=Y,VJ0($,this,J)}}function O91($,I,z,q){z||(z={});var U=-1,Y=I.length;while(++U<Y){var J=I[U],Q=q?q(z[J],$[J],J,z,$):void 0;L91(z,J,Q===void 0?$[J]:Q)}return z}function F91($){return XJ0(function(I,z){var q=-1,U=z.length,Y=U>1?z[U-1]:void 0,J=U>2?z[2]:void 0;if(Y=$.length>3&&typeof Y=="function"?(U--,Y):void 0,J&&N91(z[0],z[1],J))Y=U<3?void 0:Y,U=1;I=Object(I);while(++q<U){var Q=z[q];if(Q)$(I,Q,q,Y)}return I})}function LJ0($,I){return I=I==null?WJ0:I,!!I&&(typeof $=="number"||H91.test($))&&($>-1&&$%1==0&&$<I)}function N91($,I,z){if(!Fh(z))return!1;var q=typeof I;if(q=="number"?Oh(z)&&LJ0(I,z.length):q=="string"&&(I in z))return Dh(z[I],$);return!1}function M91($){var I=$&&$.constructor,z=typeof I=="function"&&I.prototype||k2;return $===z}function A91($){var I=[];if($!=null)for(var z in Object($))I.push(z);return I}function Dh($,I){return $===I||$!==$&&I!==I}function P91($){return E91($)&&f2.call($,"callee")&&(!V91.call($,"callee")||ZJ0.call($)==K91)}var T91=Array.isArray;function Oh($){return $!=null&&j91($.length)&&!B91($)}function E91($){return v91($)&&Oh($)}function B91($){var I=Fh($)?ZJ0.call($):"";return I==w91||I==G91}function j91($){return typeof $=="number"&&$>-1&&$%1==0&&$<=WJ0}function Fh($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function v91($){return!!$&&typeof $=="object"}var R91=F91(function($,I,z,q){O91(I,_91(I),$,q)}),g91=XJ0(function($){return $.push(void 0,X91),VJ0(R91,void 0,$)});function _91($){return Oh($)?Z91($,!0):D91($)}DJ0.exports=g91});var FJ0=F((FS1,Mh)=>{function C91($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var OJ0=C4().Buffer,b2=t("util");function h91($,I,z){$.copy(I,z)}Mh.exports=function(){function $(){C91(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var q={data:z,next:null};if(this.length>0)this.tail.next=q;else this.head=q;this.tail=q,++this.length},$.prototype.unshift=function(z){var q={data:z,next:this.head};if(this.length===0)this.tail=q;this.head=q,++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 q=this.head,U=""+q.data;while(q=q.next)U+=z+q.data;return U},$.prototype.concat=function(z){if(this.length===0)return OJ0.alloc(0);var q=OJ0.allocUnsafe(z>>>0),U=this.head,Y=0;while(U)h91(U.data,q,Y),Y+=U.data.length,U=U.next;return q},$}();if(b2&&b2.inspect&&b2.inspect.custom)Mh.exports.prototype[b2.inspect.custom]=function(){var $=b2.inspect({length:this.length});return this.constructor.name+" "+$}});var Ah=F((NS1,NJ0)=>{var WL=_4();function S91($,I){var z=this,q=this._readableState&&this._readableState.destroyed,U=this._writableState&&this._writableState.destroyed;if(q||U){if(I)I($);else if($){if(!this._writableState)WL.nextTick(VL,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,WL.nextTick(VL,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Y){if(!I&&Y){if(!z._writableState)WL.nextTick(VL,z,Y);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,WL.nextTick(VL,z,Y)}else if(I)I(Y)}),this}function y91(){if(this._readableState)this._readable Line truncated
%s`,v,v,A,q);var x=A.type==="*"?JS:A.type==="?"?YS:"\\"+A.type;U=!0,q=q.slice(0,A.reStart)+x+"\\("+v}if(X(),Y)q+="\\\\";var h=!1;switch(q.charAt(0)){case"[":case".":case"(":h=!0}for(var k=Q.length-1;k>-1;k--){var j=Q[k],n=q.slice(0,j.reStart),b=q.slice(j.reStart,j.reEnd-8),g=q.slice(j.reEnd-8,j.reEnd),f=q.slice(j.reEnd);g+=f;var p=n.split("(").length-1,q0=f;for(L=0;L<p;L++)q0=q0.replace(/\)[+*?]?/,"");f=q0;var R="";if(f===""&&I!==RL)R="$";var u=n+b+f+R+g;q=u}if(q!==""&&U)q="(?=.)"+q;if(h)q=W+q;if(I===RL)return[q,U];if(!U)return $q1($);var c=z.nocase?"i":"";try{var m=new RegExp("^"+q+"$",c)}catch(e){return new RegExp("$.")}return m._glob=$,m._src=q,m}h$.makeRe=function($,I){return new k4($,I||{}).makeRe()};k4.prototype.makeRe=ez1;function ez1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,z=I.noglobstar?JS:I.dot?dz1:mz1,q=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===VI?z:typeof J==="string"?Iq1(J):J._src}).join("\\/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,q)}catch(Y){this.regexp=!1}return this.regexp}h$.match=function($,I,z){z=z||{};var q=new k4(I,z);if($=$.filter(function(U){return q.match(U)}),q.options.nonull&&!$.length)$.push(I);return $};k4.prototype.match=function(I,z){if(typeof z>"u")z=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&z)return!0;var q=this.options;if(s2.sep!=="/")I=I.split(s2.sep).join("/");I=I.split(oQ0),this.debug(this.pattern,"split",I);var U=this.set;this.debug(this.pattern,"set",U);var Y,J;for(J=I.length-1;J>=0;J--)if(Y=I[J],Y)break;for(J=0;J<U.length;J++){var Q=U[J],K=I;if(q.matchBase&&Q.length===1)K=[Y];var w=this.matchOne(K,Q,z);if(w){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate};k4.prototype.matchOne=function($,I,z){if(I.indexOf(VI)!==-1)return this._matchGlobstar($,I,z,0,0);return this._matchOne($,I,z,0,0)};k4.prototype._matchGlobstar=function($,I,z,q,U){var Y,J=-1;for(Y=U;Y<I.length;Y++)if(I[Y]===VI){J=Y;break}var Q=-1;for(Y=I.length-1;Y>=0;Y--)if(I[Y]===VI){Q=Y;break}var K=I.slice(U,J),w=z?I.slice(J+1):I.slice(J+1,Q),G=z?[]:I.slice(Q+1);if(K.length){var H=$.slice(q,q+K.length);if(!this._matchOne(H,K,z,0,0))return!1;q+=K.length}var W=0;if(G.length){if(G.length+q>$.length)return!1;var V=$.length-G.length;if(this._matchOne($,G,z,V,0))W=G.length;else{if($[$.length-1]!==""||q+G.length===$.length)return!1;if(V--,!this._matchOne($,G,z,V,0))return!1;W=G.length+1}}if(!w.length){var X=!!W;for(Y=q;Y<$.length-W;Y++){var L=String($[Y]);if(X=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return z||X}var D=[[[],0]],O=D[0],A=0,T=[0];for(var M=0;M<w.length;M++){var v=w[M];if(v===VI)T.push(A),O=[[],0],D.push(O);else O[0].push(v),A++}var x=D.length-1,h=$.length-W;for(var k=0;k<D.length;k++)D[k][1]=h-(T[x--]+D[k][0].length);return!!this._matchGlobStarBodySections($,D,q,0,z,0,!!W)};k4.prototype._matchGlobStarBodySections=function($,I,z,q,U,Y,J){var Q=I[q];if(!Q){for(var K=z;K<$.length;K++){J=!0;var w=$[K];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1}return J}var G=Q[0],H=Q[1];while(z<=H){var W=this._matchOne($.slice(0,z+G.length),G,U,z,0);if(W&&Y<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,z+G.length,q+1,U,Y+1,J);if(V!==!1)return V}var w=$[z];if(w==="."||w===".."||!this.options.dot&&w.charAt(0)===".")return!1;z++}return U||null};k4.prototype._matchOne=function($,I,z,q,U){var Y,J,Q,K;for(Y=q,J=U,Q=$.length,K=I.length;Y<Q&&J<K;Y++,J++){this.debug("matchOne loop");var w=I[J],G=$[Y];if(this.debug(I,w,G),w===!1||w===VI)return!1;var H;if(typeof w==="string")H=G===w,this.debug("string match",w,G,H);else H=G.match(w),this.debug("pattern match",w,G,H);if(!H)return!1}if(Y===Q&&J===K)return!0;else if(Y===Q)return z;else if(J===K)return Y===Q-1&&$[Y]==="";throw Error("wtf?")};function $q1($){return $.replace(/\\(.)/g,"$1")}function Iq1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var hL=F((fS1,CL)=>{function aQ0($){return $.charAt(0)==="/"}function sQ0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=I.exec($),q=z[1]||"",U=Boolean(q&&q.charAt(1)!==":");return Boolean(z[2]||U)}CL.exports=process.platform==="win32"?sQ0:aQ0;CL.exports.posix=aQ0;CL.exports.win32=sQ0});var KS=F((Hq1)=>{Hq1.setopts=Qq1;Hq1.ownProp=eQ0;Hq1.makeAbs=e2;Hq1.finish=Kq1;Hq1.mark=wq1;Hq1.isIgnored=I20;Hq1.childrenIgnored=Gq1;function eQ0($,I){return Object.prototype.hasOwnProperty.call($,I)}var zq1=t("fs"),PU=t("path"),qq1=_L(),$20=hL(),QS=qq1.Minimatch;function Uq1($,I){return $.localeCompare(I,"en")}function Yq1($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(Jq1)}function Jq1($){var I=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");I=new QS(z,{dot:!0})}return{matcher: Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new l4($,I).found}function l4($,I){if(!$)throw Error("must provide pattern");if(typeof I==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))return new l4($,I);if(wq1(this,$,I),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var q=0;q<z;q++)this._process(this.minimatch.set[q],q,!1);this._finish()}l4.prototype._finish=function(){if(aQ0.ok(this instanceof l4),this.realpath){var $=this;this.matches.forEach(function(I,z){var q=$.matches[z]=Object.create(null);for(var U in I)try{U=$._makeAbs(U);var Y=Kq1.realpathSync(U,$.realpathCache);q[Y]=!0}catch(J){if(J.syscall==="stat")q[$._makeAbs(U)]=!0;else throw J}})}VI.finish(this)};l4.prototype._process=function($,I,z){aQ0.ok(this instanceof l4);var q=0;while(typeof $[q]==="string")q++;var U;switch(q){case $.length:this._processSimple($.join("/"),I);return;case 0:U=null;break;default:U=$.slice(0,q).join("/");break}var Y=$.slice(q),J;if(U===null)J=".";else if(hL(U)||hL($.map(function(w){return typeof w==="string"?w:"[*]"}).join("/"))){if(!U||!hL(U))U="/"+U;J=U}else J=U;var Q=this._makeAbs(J);if(Gq1(this,J))return;var K=Y[0]===tQ0.GLOBSTAR;if(K)this._processGlobStar(U,J,Q,Y,I,z);else this._processReaddir(U,J,Q,Y,I,z)};l4.prototype._processReaddir=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q[0],K=!!this.minimatch.negate,w=Q._glob,G=this.dot||w.charAt(0)===".",H=[];for(var W=0;W<J.length;W++){var V=J[W];if(V.charAt(0)!=="."||G){var X;if(K&&!$)X=!V.match(Q);else X=V.match(Q);if(X)H.push(V)}}var L=H.length;if(L===0)return;if(q.length===1&&!this.mark&&!this.stat){if(!this.matches[U])this.matches[U]=Object.create(null);for(var W=0;W<L;W++){var V=H[W];if($)if($.slice(-1)!=="/")V=$+"/"+V;else V=$+V;if(V.charAt(0)==="/"&&!this.nomount)V=QS.join(this.root,V);this._emitMatch(U,V)}return}q.shift();for(var W=0;W<L;W++){var V=H[W],D;if($)D=[$,V];else D=[V];this._process(D.concat(q),U,Y)}};l4.prototype._emitMatch=function($,I){if(Hq1(this,I))return;var z=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=z;if(this.matches[$][I])return;if(this.nodir){var q=this.cache[z];if(q==="DIR"||Array.isArray(q))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};l4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,z,q;try{z=this.fs.lstatSync($)}catch(Y){if(Y.code==="ENOENT")return null}var U=z&&z.isSymbolicLink();if(this.symlinks[$]=U,!U&&z&&!z.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};l4.prototype._readdir=function($,I){var z;if(I&&!KS(this.symlinks,$))return this._readdirInGlobStar($);if(KS(this.cache,$)){var q=this.cache[$];if(!q||q==="FILE")return null;if(Array.isArray(q))return q}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(U){return this._readdirError($,U),null}};l4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var z=0;z<I.length;z++){var q=I[z];if($==="/")q=$+q;else q=$+"/"+q;this.cache[q]=!0}return this.cache[$]=I,I};l4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var q=Error(I.code+" invalid cwd "+this.cwd);throw q.path=this.cwd,q.code=I.code,q}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 I;if(!this.silent)console.error("glob error",I);break}};l4.prototype._processGlobStar=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q.slice(1),K=$?[$]:[],w=K.concat(Q);this._process(w,U,!1);var G=J.length,H=this.symlinks[z];if(H&&Y)return;for(var W=0;W<G;W++){var V=J[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=K.concat(J[W],Q);this._process(X,U,!0);var L=K.concat(J[W],q);this._process(L,U,!0)}};l4.prototype._processSimple=function($,I){var z=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!z)return;if($&&hL($)&&!this.nomount){var q=/[\/\\]$/.test($);if($.charAt(0)==="/")$=QS.join(this.root,$);else if($=QS.resolve(this.root,$),q)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};l4.prototype._stat=function($){var I=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&KS(this.cache,I)){var J=this.cache[I];if(Array.isArray(J))J="DIR";if(!z||J==="DIR")return J;if(z&&J==="FILE")return!1}var q,U=this.statCache[I];if(!U){var Y;try{Y=this.fs.lstatSync(I)}catch(Q){if(Q&&(Q.code==="ENOENT"||Q.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(Y&&Y.isSymbolicLink())try{U=this.fs.statSync(I)}catch(Q){U=Y}else U=Y}this.statCache[I]=U;var J=!0;if(U)J=U.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||J,z&&J==="FILE")return!1;return J};l4.prototype._mark=function($){return VI.mark(this,$)};l4.prototype._makeAbs=function($){return VI.makeAbs(this,$)}});var wS=F((MS1,z20)=>{z20.exports=I20;function I20($,I){if($&&I)return I20($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(q){z[q]=$[q]}),z;f Line truncated
`);if($.linkname)I+=nS(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var q in z)I+=nS(" "+q+"="+z[q]+`
`);return Buffer.from(I)};jU1.decodePax=function($){var I={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var q=parseInt($.slice(0,z).toString(),10);if(!q)return I;var U=$.slice(z+1,q-1).toString(),Y=U.indexOf("=");if(Y===-1)return I;I[U.slice(0,Y)]=U.slice(Y+1),$=$.slice(q)}return I};jU1.encode=function($){var I=LU1(512),z=$.name,q="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var U=z.indexOf("/");if(U===-1)return null;q+=q?"/"+z.slice(0,U):z.slice(0,U),z=z.slice(U+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(q)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(z),I.write(g7($.mode&AU1,6),100),I.write(g7($.uid,6),108),I.write(g7($.gid,6),116),I.write(g7($.size,11),124),I.write(g7($.mtime.getTime()/1000|0,11),136),I[156]=NK0+EU1($.type),$.linkname)I.write($.linkname,157);if(MK0.copy(I,UK),FU1.copy(I,iS),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(g7($.devmajor||0,6),329),I.write(g7($.devminor||0,6),337),q)I.write(q,345);return I.write(g7(PK0(I),6),148),I};jU1.decode=function($,I,z){var q=$[156]===0?0:$[156]-NK0,U=BU($,0,100,I),Y=_7($,100,8),J=_7($,108,8),Q=_7($,116,8),K=_7($,124,12),w=_7($,136,12),G=TU1(q),H=$[157]===0?null:BU($,157,100,I),W=BU($,265,32),V=BU($,297,32),X=_7($,329,8),L=_7($,337,8),D=PK0($);if(D===256)return null;if(D!==_7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(MK0.compare($,UK,UK+6)===0){if($[345])U=BU($,345,155,I)+"/"+U}else if(NU1.compare($,UK,UK+6)===0&&MU1.compare($,iS,iS+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(q===0&&U&&U[U.length-1]==="/")q=5;return{name:U,mode:Y,uid:J,gid:Q,size:K,mtime:new Date(1000*w),type:G,linkname:H,uname:W,gname:V,devmajor:X,devminor:L}}});var gK0=F((zy1,RK0)=>{var EK0=t("util"),hU1=FK0(),YK=pS(),BK0=g6().Writable,jK0=g6().PassThrough,vK0=function(){},TK0=function($){return $&=511,$&&512-$},SU1=function($,I){var z=new bL($,I);return z.end(),z},yU1=function($,I){if(I.path)$.name=I.path;if(I.linkpath)$.linkname=I.linkpath;if(I.size)$.size=parseInt(I.size,10);return $.pax=I,$},bL=function($,I){this._parent=$,this.offset=I,jK0.call(this,{autoDestroy:!1})};EK0.inherits(bL,jK0);bL.prototype.destroy=function($){this._parent.destroy($)};var $9=function($){if(!(this instanceof $9))return new $9($);BK0.call(this,$),$=$||{},this._offset=0,this._buffer=hU1(),this._missing=0,this._partial=!1,this._onparse=vK0,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 I=this,z=I._buffer,q=function(){I._continue()},U=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)q()},Y=function(){I._stream=null;var W=TK0(I._header.size);if(W)I._parse(W,J);else I._parse(512,H);if(!I._locked)q()},J=function(){I._buffer.consume(TK0(I._header.size)),I._parse(512,H),q()},Q=function(){var W=I._header.size;I._paxGlobal=YK.decodePax(z.slice(0,W)),z.consume(W),Y()},K=function(){var W=I._header.size;if(I._pax=YK.decodePax(z.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);z.consume(W),Y()},w=function(){var W=I._header.size;this._gnuLongPath=YK.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},G=function(){var W=I._header.size;this._gnuLongLinkPath=YK.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},H=function(){var W=I._offset,V;try{V=I._header=YK.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(z.consume(512),!V){I._parse(512,H),q();return}if(V.type==="gnu-long-path"){I._parse(V.size,w),q();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,G),q();return}if(V.type==="pax-global-header"){I._parse(V.size,Q),q();return}if(V.type==="pax-header"){I._parse(V.size,K),q();return}if(I._gnuLongPath)V.name=I._gnuLongPath,I._gnuLongPath=null;if(I._gnuLongLinkPath)V.linkname=I._gnuLongLinkPath,I._gnuLongLinkPath=null;if(I._pax)I._header=V=yU1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,H),I.emit("entry",V,SU1(I,W),U);return}I._stream=new bL(I,W),I.emit("entry",V,I._stream,U),I._parse(V.size,Y),q()};this._onheader=H,this._parse(512,H)};EK0.inherits($9,BK0);$9.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};$9.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};$9.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=vK0,this._overflow)this._write(this._overflow,void 0,$);else $()};$9.prototype._write=function($,I,z){if(this._destroyed)return;var q=this._stream,U=this._buffer,Y=this._missing;if($.length)this._partial=!0;if($.length<Y){ Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let I=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$Y1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}zw0.exports=Iw0});var Kw0=F((Wy1,Qw0)=>{var Uw0=X6(),Yw0=V7(),zY1=L4(),qY1=A_(),UY1=T_();class Jw0{constructor($,I,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=I}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:Yw0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:Yw0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(I)}_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($,I){let z=new qY1,q=new Uw0;z.render(q,$),this.commentsStream.write(q.xml);let U=new UY1,Y=new Uw0;U.render(Y,$,I),this.vmlStream.write(Y.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((I)=>{I.refAddress=zY1.decodeAddress(I.ref)}),$.forEach((I)=>{this._writeComment(I,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}Qw0.exports=Jw0});var Zw0=F((Vy1,Vw0)=>{var YY1=B4(),JY1=V7(),mS=L4(),ww0=bj(),Gw0=C5(),QY1=Ig(),Hw0=UV(),lS=JV(),KY1=qw0(),wY1=Kw0(),GY1=kj(),$6=new QY1,oS=G7(),HY1=tg(),WY1=ag(),VY1=sg(),ZY1=mg(),XY1=cg(),LY1=lg(),DY1=eg(),OY1=$_(),FY1=I_(),NY1=z_(),MY1=q_(),AY1=U_(),PY1=w_(),TY1=J_(),EY1=Y_(),I6={dataValidations:new HY1,sheetProperties:new WY1,sheetFormatProperties:new VY1,columns:new oS({tag:"cols",length:!1,childXform:new ZY1}),row:new XY1,hyperlinks:new oS({tag:"hyperlinks",length:!1,childXform:new LY1}),sheetViews:new oS({tag:"sheetViews",length:!1,childXform:new DY1}),sheetProtection:new OY1,pageMargins:new FY1,pageSeteup:new NY1,autoFilter:new MY1,picture:new AY1,conditionalFormattings:new PY1,headerFooter:new TY1,rowBreaks:new EY1};class Ww0{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 KY1($),this._sheetCommentsWriter=new wY1(this,this._sheetRelsWriter,$),this._dimensions=new Gw0,this._rowZero=1,this.committed=!1,this.dataValidations=new GY1,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 l4))return new l4($,I);if(Nq1(this,$,I),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var q=0;q<z;q++)this._process(this.minimatch.set[q],q,!1);this._finish()}l4.prototype._finish=function(){if(q20.ok(this instanceof l4),this.realpath){var $=this;this.matches.forEach(function(I,z){var q=$.matches[z]=Object.create(null);for(var U in I)try{U=$._makeAbs(U);var Y=Fq1.realpathSync(U,$.realpathCache);q[Y]=!0}catch(J){if(J.syscall==="stat")q[$._makeAbs(U)]=!0;else throw J}})}ZI.finish(this)};l4.prototype._process=function($,I,z){q20.ok(this instanceof l4);var q=0;while(typeof $[q]==="string")q++;var U;switch(q){case $.length:this._processSimple($.join("/"),I);return;case 0:U=null;break;default:U=$.slice(0,q).join("/");break}var Y=$.slice(q),J;if(U===null)J=".";else if(SL(U)||SL($.map(function(w){return typeof w==="string"?w:"[*]"}).join("/"))){if(!U||!SL(U))U="/"+U;J=U}else J=U;var Q=this._makeAbs(J);if(Mq1(this,J))return;var K=Y[0]===z20.GLOBSTAR;if(K)this._processGlobStar(U,J,Q,Y,I,z);else this._processReaddir(U,J,Q,Y,I,z)};l4.prototype._processReaddir=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q[0],K=!!this.minimatch.negate,w=Q._glob,G=this.dot||w.charAt(0)===".",H=[];for(var W=0;W<J.length;W++){var V=J[W];if(V.charAt(0)!=="."||G){var X;if(K&&!$)X=!V.match(Q);else X=V.match(Q);if(X)H.push(V)}}var L=H.length;if(L===0)return;if(q.length===1&&!this.mark&&!this.stat){if(!this.matches[U])this.matches[U]=Object.create(null);for(var W=0;W<L;W++){var V=H[W];if($)if($.slice(-1)!=="/")V=$+"/"+V;else V=$+V;if(V.charAt(0)==="/"&&!this.nomount)V=wS.join(this.root,V);this._emitMatch(U,V)}return}q.shift();for(var W=0;W<L;W++){var V=H[W],D;if($)D=[$,V];else D=[V];this._process(D.concat(q),U,Y)}};l4.prototype._emitMatch=function($,I){if(Aq1(this,I))return;var z=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=z;if(this.matches[$][I])return;if(this.nodir){var q=this.cache[z];if(q==="DIR"||Array.isArray(q))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};l4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,z,q;try{z=this.fs.lstatSync($)}catch(Y){if(Y.code==="ENOENT")return null}var U=z&&z.isSymbolicLink();if(this.symlinks[$]=U,!U&&z&&!z.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};l4.prototype._readdir=function($,I){var z;if(I&&!GS(this.symlinks,$))return this._readdirInGlobStar($);if(GS(this.cache,$)){var q=this.cache[$];if(!q||q==="FILE")return null;if(Array.isArray(q))return q}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(U){return this._readdirError($,U),null}};l4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var z=0;z<I.length;z++){var q=I[z];if($==="/")q=$+q;else q=$+"/"+q;this.cache[q]=!0}return this.cache[$]=I,I};l4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var q=Error(I.code+" invalid cwd "+this.cwd);throw q.path=this.cwd,q.code=I.code,q}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 I;if(!this.silent)console.error("glob error",I);break}};l4.prototype._processGlobStar=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q.slice(1),K=$?[$]:[],w=K.concat(Q);this._process(w,U,!1);var G=J.length,H=this.symlinks[z];if(H&&Y)return;for(var W=0;W<G;W++){var V=J[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=K.concat(J[W],Q);this._process(X,U,!0);var L=K.concat(J[W],q);this._process(L,U,!0)}};l4.prototype._processSimple=function($,I){var z=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!z)return;if($&&SL($)&&!this.nomount){var q=/[\/\\]$/.test($);if($.charAt(0)==="/")$=wS.join(this.root,$);else if($=wS.resolve(this.root,$),q)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};l4.prototype._stat=function($){var I=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&GS(this.cache,I)){var J=this.cache[I];if(Array.isArray(J))J="DIR";if(!z||J==="DIR")return J;if(z&&J==="FILE")return!1}var q,U=this.statCache[I];if(!U){var Y;try{Y=this.fs.lstatSync(I)}catch(Q){if(Q&&(Q.code==="ENOENT"||Q.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(Y&&Y.isSymbolicLink())try{U=this.fs.statSync(I)}catch(Q){U=Y}else U=Y}this.statCache[I]=U;var J=!0;if(U)J=U.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||J,z&&J==="FILE")return!1;return J};l4.prototype._mark=function($){return ZI.mark(this,$)};l4.prototype._makeAbs=function($){return ZI.makeAbs(this,$)}});var HS=F((dS1,K20)=>{K20.exports=Q20;function Q20($,I){if($&&I)return Q20($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(q){z[q]=$[q]}),z;f Line truncated
`);if($.linkname)I+=pS(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var q in z)I+=pS(" "+q+"="+z[q]+`
`);return Buffer.from(I)};kU1.decodePax=function($){var I={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var q=parseInt($.slice(0,z).toString(),10);if(!q)return I;var U=$.slice(z+1,q-1).toString(),Y=U.indexOf("=");if(Y===-1)return I;I[U.slice(0,Y)]=U.slice(Y+1),$=$.slice(q)}return I};kU1.encode=function($){var I=jU1(512),z=$.name,q="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var U=z.indexOf("/");if(U===-1)return null;q+=q?"/"+z.slice(0,U):z.slice(0,U),z=z.slice(U+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(q)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(z),I.write(g7($.mode&hU1,6),100),I.write(g7($.uid,6),108),I.write(g7($.gid,6),116),I.write(g7($.size,11),124),I.write(g7($.mtime.getTime()/1000|0,11),136),I[156]=BK0+uU1($.type),$.linkname)I.write($.linkname,157);if(jK0.copy(I,YK),gU1.copy(I,cS),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(g7($.devmajor||0,6),329),I.write(g7($.devminor||0,6),337),q)I.write(q,345);return I.write(g7(RK0(I),6),148),I};kU1.decode=function($,I,z){var q=$[156]===0?0:$[156]-BK0,U=jU($,0,100,I),Y=_7($,100,8),J=_7($,108,8),Q=_7($,116,8),K=_7($,124,12),w=_7($,136,12),G=yU1(q),H=$[157]===0?null:jU($,157,100,I),W=jU($,265,32),V=jU($,297,32),X=_7($,329,8),L=_7($,337,8),D=RK0($);if(D===256)return null;if(D!==_7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(jK0.compare($,YK,YK+6)===0){if($[345])U=jU($,345,155,I)+"/"+U}else if(_U1.compare($,YK,YK+6)===0&&CU1.compare($,cS,cS+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(q===0&&U&&U[U.length-1]==="/")q=5;return{name:U,mode:Y,uid:J,gid:Q,size:K,mtime:new Date(1000*w),type:G,linkname:H,uname:W,gname:V,devmajor:X,devminor:L}}});var uK0=F((By1,yK0)=>{var _K0=t("util"),cU1=EK0(),JK=dS(),CK0=g6().Writable,hK0=g6().PassThrough,SK0=function(){},gK0=function($){return $&=511,$&&512-$},dU1=function($,I){var z=new nL($,I);return z.end(),z},mU1=function($,I){if(I.path)$.name=I.path;if(I.linkpath)$.linkname=I.linkpath;if(I.size)$.size=parseInt(I.size,10);return $.pax=I,$},nL=function($,I){this._parent=$,this.offset=I,hK0.call(this,{autoDestroy:!1})};_K0.inherits(nL,hK0);nL.prototype.destroy=function($){this._parent.destroy($)};var $9=function($){if(!(this instanceof $9))return new $9($);CK0.call(this,$),$=$||{},this._offset=0,this._buffer=cU1(),this._missing=0,this._partial=!1,this._onparse=SK0,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 I=this,z=I._buffer,q=function(){I._continue()},U=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)q()},Y=function(){I._stream=null;var W=gK0(I._header.size);if(W)I._parse(W,J);else I._parse(512,H);if(!I._locked)q()},J=function(){I._buffer.consume(gK0(I._header.size)),I._parse(512,H),q()},Q=function(){var W=I._header.size;I._paxGlobal=JK.decodePax(z.slice(0,W)),z.consume(W),Y()},K=function(){var W=I._header.size;if(I._pax=JK.decodePax(z.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);z.consume(W),Y()},w=function(){var W=I._header.size;this._gnuLongPath=JK.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},G=function(){var W=I._header.size;this._gnuLongLinkPath=JK.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},H=function(){var W=I._offset,V;try{V=I._header=JK.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(z.consume(512),!V){I._parse(512,H),q();return}if(V.type==="gnu-long-path"){I._parse(V.size,w),q();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,G),q();return}if(V.type==="pax-global-header"){I._parse(V.size,Q),q();return}if(V.type==="pax-header"){I._parse(V.size,K),q();return}if(I._gnuLongPath)V.name=I._gnuLongPath,I._gnuLongPath=null;if(I._gnuLongLinkPath)V.linkname=I._gnuLongLinkPath,I._gnuLongLinkPath=null;if(I._pax)I._header=V=mU1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,H),I.emit("entry",V,dU1(I,W),U);return}I._stream=new nL(I,W),I.emit("entry",V,I._stream,U),I._parse(V.size,Y),q()};this._onheader=H,this._parse(512,H)};_K0.inherits($9,CK0);$9.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};$9.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};$9.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=SK0,this._overflow)this._write(this._overflow,void 0,$);else $()};$9.prototype._write=function($,I,z){if(this._destroyed)return;var q=this._stream,U=this._buffer,Y=this._missing;if($.length)this._partial=!0;if($.length<Y){ Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let I=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${HY1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}Kw0.exports=Qw0});var Zw0=F((uy1,Vw0)=>{var Gw0=X6(),Hw0=V7(),VY1=L4(),ZY1=T_(),XY1=B_();class Ww0{constructor($,I,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=I}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:Hw0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:Hw0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(I)}_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($,I){let z=new ZY1,q=new Gw0;z.render(q,$),this.commentsStream.write(q.xml);let U=new XY1,Y=new Gw0;U.render(Y,$,I),this.vmlStream.write(Y.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((I)=>{I.refAddress=VY1.decodeAddress(I.ref)}),$.forEach((I)=>{this._writeComment(I,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}Vw0.exports=Ww0});var Nw0=F((xy1,Fw0)=>{var LY1=B4(),DY1=V7(),oS=L4(),Xw0=ij(),Lw0=C5(),OY1=qg(),Dw0=YV(),rS=QV(),FY1=ww0(),NY1=Zw0(),MY1=bj(),$6=new OY1,tS=G7(),AY1=sg(),PY1=eg(),TY1=$_(),EY1=og(),BY1=mg(),jY1=rg(),vY1=I_(),RY1=z_(),gY1=q_(),_Y1=U_(),CY1=Y_(),hY1=J_(),SY1=H_(),yY1=K_(),uY1=Q_(),I6={dataValidations:new AY1,sheetProperties:new PY1,sheetFormatProperties:new TY1,columns:new tS({tag:"cols",length:!1,childXform:new EY1}),row:new BY1,hyperlinks:new tS({tag:"hyperlinks",length:!1,childXform:new jY1}),sheetViews:new tS({tag:"sheetViews",length:!1,childXform:new vY1}),sheetProtection:new RY1,pageMargins:new gY1,pageSeteup:new _Y1,autoFilter:new CY1,picture:new hY1,conditionalFormattings:new SY1,headerFooter:new yY1,rowBreaks:new uY1};class Ow0{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 FY1($),this._sheetCommentsWriter=new NY1(this,this._sheetRelsWriter,$),this._dimensions=new Lw0,this._rowZero=1,this.committed=!1,this.dataValidations=new MY1,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
`)},Wy=Vy.getNativePromise();if(Vy.isNode&&typeof MutationObserver>"u")Zy=global.setImmediate,Xy=process.nextTick,MI=Vy.isRecentNode?function($){Zy.call(global,$)}:function($){Xy.call(process,$)};else if(typeof Wy==="function"&&typeof Wy.resolve==="function")Ly=Wy.resolve(),MI=function($){Ly.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))MI=function(){var $=document.createElement("div"),I={attributes:!0},z=!1,q=document.createElement("div"),U=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});U.observe(q,I);var Y=function(){if(z)return;z=!0,q.classList.toggle("foo")};return function(Q){var K=new MutationObserver(function(){K.disconnect(),Q()});K.observe($,I),Y()}}();else if(typeof setImmediate<"u")MI=function($){setImmediate($)};else if(typeof setTimeout<"u")MI=function($){setTimeout($,0)};else MI=LJ1;var Zy,Xy,Ly;lw0.exports=MI});var tw0=F((Ey1,rw0)=>{function DJ1($,I,z,q,U){for(var Y=0;Y<U;++Y)z[Y+q]=$[Y+I],$[Y+I]=void 0}function S7($){this._capacity=$,this._length=0,this._front=0}S7.prototype._willBeOverCapacity=function($){return this._capacity<$};S7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var z=this._front+I&this._capacity-1;this[z]=$,this._length=I+1};S7.prototype.push=function($,I,z){var q=this.length()+3;if(this._willBeOverCapacity(q)){this._pushOne($),this._pushOne(I),this._pushOne(z);return}var U=this._front+q-3;this._checkCapacity(q);var Y=this._capacity-1;this[U+0&Y]=$,this[U+1&Y]=I,this[U+2&Y]=z,this._length=q};S7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};S7.prototype.length=function(){return this._length};S7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};S7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var z=this._front,q=this._length,U=z+q&I-1;DJ1(this,0,this,I,U)};rw0.exports=S7});var qG0=F((By1,Dy)=>{var IG0;try{throw Error()}catch($){IG0=$}var OJ1=ow0(),aw0=tw0(),zG0=r1();function z6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new aw0(16),this._normalQueue=new aw0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=OJ1}z6.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};z6.prototype.hasCustomScheduler=function(){return this._customScheduler};z6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};z6.prototype.disableTrampolineIfNecessary=function(){if(zG0.hasDevTools)this._trampolineEnabled=!1};z6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};z6.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`)},Zy=Xy.getNativePromise();if(Xy.isNode&&typeof MutationObserver>"u")Ly=global.setImmediate,Dy=process.nextTick,AI=Xy.isRecentNode?function($){Ly.call(global,$)}:function($){Dy.call(process,$)};else if(typeof Zy==="function"&&typeof Zy.resolve==="function")Oy=Zy.resolve(),AI=function($){Oy.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))AI=function(){var $=document.createElement("div"),I={attributes:!0},z=!1,q=document.createElement("div"),U=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});U.observe(q,I);var Y=function(){if(z)return;z=!0,q.classList.toggle("foo")};return function(Q){var K=new MutationObserver(function(){K.disconnect(),Q()});K.observe($,I),Y()}}();else if(typeof setImmediate<"u")AI=function($){setImmediate($)};else if(typeof setTimeout<"u")AI=function($){setTimeout($,0)};else AI=jJ1;var Ly,Dy,Oy;ew0.exports=AI});var zG0=F((ry1,IG0)=>{function vJ1($,I,z,q,U){for(var Y=0;Y<U;++Y)z[Y+q]=$[Y+I],$[Y+I]=void 0}function S7($){this._capacity=$,this._length=0,this._front=0}S7.prototype._willBeOverCapacity=function($){return this._capacity<$};S7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var z=this._front+I&this._capacity-1;this[z]=$,this._length=I+1};S7.prototype.push=function($,I,z){var q=this.length()+3;if(this._willBeOverCapacity(q)){this._pushOne($),this._pushOne(I),this._pushOne(z);return}var U=this._front+q-3;this._checkCapacity(q);var Y=this._capacity-1;this[U+0&Y]=$,this[U+1&Y]=I,this[U+2&Y]=z,this._length=q};S7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};S7.prototype.length=function(){return this._length};S7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};S7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var z=this._front,q=this._length,U=z+q&I-1;vJ1(this,0,this,I,U)};IG0.exports=S7});var wG0=F((ty1,Fy)=>{var QG0;try{throw Error()}catch($){QG0=$}var RJ1=$G0(),qG0=zG0(),KG0=r1();function z6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new qG0(16),this._normalQueue=new qG0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=RJ1}z6.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};z6.prototype.hasCustomScheduler=function(){return this._customScheduler};z6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};z6.prototype.disableTrampolineIfNecessary=function(){if(KG0.hasDevTools)this._trampolineEnabled=!1};z6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};z6.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};z6.prototype.throwLater=function($,I){if(arguments.length===1)I=$,$=function(){throw I};if(typeof setTimeout<"u")setTimeout(function(){$(I)},0);else try{this._schedule(function(){$(I)})}catch(z){throw Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function sw0($,I,z){this._lateQueue.push($,I,z),this._queueTick()}function ew0($,I,z){this._normalQueue.push($,I,z),this._queueTick()}function $G0($){this._normalQueue._pushOne($),this._queueTick()}if(!zG0.hasDevTools)z6.prototype.invokeLater=sw0,z6.prototype.invoke=ew0,z6.prototype.settlePromises=$G0;else z6.prototype.invokeLater=function($,I,z){if(this._trampolineEnabled)sw0.call(this,$,I,z);else this._schedule(function(){setTimeout(function(){$.call(I,z)},100)})},z6.prototype.invoke=function($,I,z){if(this._trampolineEnabled)ew0.call(this,$,I,z);else this._schedule(function(){$.call(I,z)})},z6.prototype.settlePromises=function($){if(this._trampolineEnabled)$G0.call(this,$);else this._schedule(function(){$._settlePromises()})};z6.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var z=$.shift(),q=$.shift();I.call(z,q)}};z6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};z6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};z6.prototype._reset=function(){this._isTickUsed=!1};Dy.exports=z6;Dy.exports.firstLineError=IG0});var z9=F((jy1,JG0)=>{var Ny=NI(),FJ1=Ny.freeze,UG0=r1(),YG0=UG0.inherits,_U=UG0.notEnumerableProp;function CU($,I){function z(q){if(!(this instanceof z))return new z(q);if(_U(this,"message",typeof q==="string"?q:I),_U(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return YG0(z,Error),z}var Oy,Fy,NJ1=CU("Warning","warning"),MJ1=CU("CancellationError","cancellation error"),AJ1=CU("TimeoutError","timeout error"),HK=CU("AggregateError","aggregate error");try{Oy=TypeError,Fy=RangeError}catch($){Oy=CU("TypeError","type error"),Fy=CU("RangeError","range error")}var rL="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(AI=0;AI<rL.length;++AI)if(typeof Array.prototype[rL[AI]]==="function")HK.prototype[rL[AI]]=Array.prototype[rL[AI]];var AI;Ny.defineProperty(HK.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});HK.prototype.isOperational=!0;var tL=0;HK.prototype.toString=function(){var $=Array(tL*4+1).join(" "),I=`
`)}};function UG0($,I,z){this._lateQueue.push($,I,z),this._queueTick()}function YG0($,I,z){this._normalQueue.push($,I,z),this._queueTick()}function JG0($){this._normalQueue._pushOne($),this._queueTick()}if(!KG0.hasDevTools)z6.prototype.invokeLater=UG0,z6.prototype.invoke=YG0,z6.prototype.settlePromises=JG0;else z6.prototype.invokeLater=function($,I,z){if(this._trampolineEnabled)UG0.call(this,$,I,z);else this._schedule(function(){setTimeout(function(){$.call(I,z)},100)})},z6.prototype.invoke=function($,I,z){if(this._trampolineEnabled)YG0.call(this,$,I,z);else this._schedule(function(){$.call(I,z)})},z6.prototype.settlePromises=function($){if(this._trampolineEnabled)JG0.call(this,$);else this._schedule(function(){$._settlePromises()})};z6.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var z=$.shift(),q=$.shift();I.call(z,q)}};z6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};z6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};z6.prototype._reset=function(){this._isTickUsed=!1};Fy.exports=z6;Fy.exports.firstLineError=QG0});var z9=F((ay1,WG0)=>{var Ay=MI(),gJ1=Ay.freeze,GG0=r1(),HG0=GG0.inherits,CU=GG0.notEnumerableProp;function hU($,I){function z(q){if(!(this instanceof z))return new z(q);if(CU(this,"message",typeof q==="string"?q:I),CU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return HG0(z,Error),z}var Ny,My,_J1=hU("Warning","warning"),CJ1=hU("CancellationError","cancellation error"),hJ1=hU("TimeoutError","timeout error"),WK=hU("AggregateError","aggregate error");try{Ny=TypeError,My=RangeError}catch($){Ny=hU("TypeError","type error"),My=hU("RangeError","range error")}var tL="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(PI=0;PI<tL.length;++PI)if(typeof Array.prototype[tL[PI]]==="function")WK.prototype[tL[PI]]=Array.prototype[tL[PI]];var PI;Ay.defineProperty(WK.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});WK.prototype.isOperational=!0;var aL=0;WK.prototype.toString=function(){var $=Array(aL*4+1).join(" "),I=`
`+$+`AggregateError of:
`;tL++,$=Array(tL*4+1).join(" ");for(var z=0;z<this.length;++z){var q=this[z]===this?"[Circular AggregateError]":this[z]+"",U=q.split(`
`;aL++,$=Array(aL*4+1).join(" ");for(var z=0;z<this.length;++z){var q=this[z]===this?"[Circular AggregateError]":this[z]+"",U=q.split(`
`);for(var Y=0;Y<U.length;++Y)U[Y]=$+U[Y];q=U.join(`
`),I+=q+`
`}return tL--,I};function GK($){if(!(this instanceof GK))return new GK($);if(_U(this,"name","OperationalError"),_U(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)_U(this,"message",$.message),_U(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}YG0(GK,Error);var PI=Error.__BluebirdErrorTypes__;if(!PI)PI=FJ1({CancellationError:MJ1,TimeoutError:AJ1,OperationalError:GK,RejectionError:GK,AggregateError:HK}),Ny.defineProperty(Error,"__BluebirdErrorTypes__",{value:PI,writable:!1,enumerable:!1,configurable:!1});JG0.exports={Error,TypeError:Oy,RangeError:Fy,CancellationError:PI.CancellationError,OperationalError:PI.OperationalError,TimeoutError:PI.TimeoutError,AggregateError:PI.AggregateError,Warning:NJ1}});var KG0=F((vy1,QG0)=>{QG0.exports=function($,I){var z=r1(),q=z.errorObj,U=z.isObject;function Y(H,W){if(U(H)){if(H instanceof $)return H;var V=Q(H);if(V===q){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(w(H)){var X=new $(I);return H._then(X._fulfill,X._reject,void 0,X,null),X}return G(H,V,W)}}return H}function J(H){return H.then}function Q(H){try{return J(H)}catch(W){return q.e=W,q}}var K={}.hasOwnProperty;function w(H){try{return K.call(H,"_promise0")}catch(W){return!1}}function G(H,W,V){var X=new $(I),L=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var D=!0,O=z.tryCatch(W).call(H,A,T);if(D=!1,X&&O===q)X._rejectCallback(O.e,!0,!0),X=null;function A(M){if(!X)return;X._resolveCallback(M),X=null}function T(M){if(!X)return;X._rejectCallback(M,D,!0),X=null}return L}return Y}});var GG0=F((Ry1,wG0)=>{wG0.exports=function($,I,z,q,U){var Y=r1(),J=Y.isArray;function Q(w){switch(w){case-2:return[];case-3:return{}}}function K(w){var G=this._promise=new $(I);if(w instanceof $)G._propagateFrom(w,3);G._setOnCancel(this),this._values=w,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Y.inherits(K,U),K.prototype.length=function(){return this._length},K.prototype.promise=function(){return this._promise},K.prototype._init=function w(G,H){var W=z(this._values,this._promise);if(W instanceof $){W=W._target();var V=W._bitField;if(this._values=W,(V&50397184)===0)return this._promise._setAsyncGuaranteed(),W._then(w,this._reject,void 0,this,H);else if((V&33554432)!==0)W=W._value();else if((V&16777216)!==0)return this._reject(W._reason());else return this._cancel()}if(W=Y.asArray(W),W===null){var X=q("expecting an array or an iterable object but got "+Y.classString(W)).reason();this._promise._rejectCallback(X,!1);return}if(W.length===0){if(H===-5)this._resolveEmptyArray();else this._resolve(Q(H));return}this._iterate(W)},K.prototype._iterate=function(w){var G=this.getActualLength(w.length);this._length=G,this._values=this.shouldCopyValues()?Array(G):this._values;var H=this._promise,W=!1,V=null;for(var X=0;X<G;++X){var L=z(w[X],H);if(L instanceof $)L=L._target(),V=L._bitField;else V=null;if(W){if(V!==null)L.suppressUnhandledRejections()}else if(V!==null)if((V&50397184)===0)L._proxy(this,X),this._values[X]=L;else if((V&33554432)!==0)W=this._promiseFulfilled(L._value(),X);else if((V&16777216)!==0)W=this._promiseRejected(L._reason(),X);else W=this._promiseCancelled(X);else W=this._promiseFulfilled(L,X)}if(!W)H._setAsyncGuaranteed()},K.prototype._isResolved=function(){return this._values===null},K.prototype._resolve=function(w){this._values=null,this._promise._fulfill(w)},K.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},K.prototype._reject=function(w){this._values=null,this._promise._rejectCallback(w,!1)},K.prototype._promiseFulfilled=function(w,G){this._values[G]=w;var H=++this._totalResolved;if(H>=this._length)return this._resolve(this._values),!0;return!1},K.prototype._promiseCancelled=function(){return this._cancel(),!0},K.prototype._promiseRejected=function(w){return this._totalResolved++,this._reject(w),!0},K.prototype._resultCancelled=function(){if(this._isResolved())return;var w=this._values;if(this._cancel(),w instanceof $)w.cancel();else for(var G=0;G<w.length;++G)if(w[G]instanceof $)w[G].cancel()},K.prototype.shouldCopyValues=function(){return!0},K.prototype.getActualLength=function(w){return w},K}});var WG0=F((gy1,HG0)=>{HG0.exports=function($){var I=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function q(){this._trace=new q.CapturedTrace(Y())}q.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},q.prototype._popContext=function(){if(this._trace!==void 0){var J=z.pop(),Q=J._promiseCreated;return J._promiseCreated=null,Q}return null};function U(){if(I)return new q}function Y(){var J=z.length-1;if(J>=0)return z[J];return}return q.CapturedTrace=null,q.create=U,q.deactivateLong Line truncated
`}return aL--,I};function HK($){if(!(this instanceof HK))return new HK($);if(CU(this,"name","OperationalError"),CU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)CU(this,"message",$.message),CU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}HG0(HK,Error);var TI=Error.__BluebirdErrorTypes__;if(!TI)TI=gJ1({CancellationError:CJ1,TimeoutError:hJ1,OperationalError:HK,RejectionError:HK,AggregateError:WK}),Ay.defineProperty(Error,"__BluebirdErrorTypes__",{value:TI,writable:!1,enumerable:!1,configurable:!1});WG0.exports={Error,TypeError:Ny,RangeError:My,CancellationError:TI.CancellationError,OperationalError:TI.OperationalError,TimeoutError:TI.TimeoutError,AggregateError:TI.AggregateError,Warning:_J1}});var ZG0=F((sy1,VG0)=>{VG0.exports=function($,I){var z=r1(),q=z.errorObj,U=z.isObject;function Y(H,W){if(U(H)){if(H instanceof $)return H;var V=Q(H);if(V===q){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(w(H)){var X=new $(I);return H._then(X._fulfill,X._reject,void 0,X,null),X}return G(H,V,W)}}return H}function J(H){return H.then}function Q(H){try{return J(H)}catch(W){return q.e=W,q}}var K={}.hasOwnProperty;function w(H){try{return K.call(H,"_promise0")}catch(W){return!1}}function G(H,W,V){var X=new $(I),L=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var D=!0,O=z.tryCatch(W).call(H,A,T);if(D=!1,X&&O===q)X._rejectCallback(O.e,!0,!0),X=null;function A(M){if(!X)return;X._resolveCallback(M),X=null}function T(M){if(!X)return;X._rejectCallback(M,D,!0),X=null}return L}return Y}});var LG0=F((ey1,XG0)=>{XG0.exports=function($,I,z,q,U){var Y=r1(),J=Y.isArray;function Q(w){switch(w){case-2:return[];case-3:return{}}}function K(w){var G=this._promise=new $(I);if(w instanceof $)G._propagateFrom(w,3);G._setOnCancel(this),this._values=w,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Y.inherits(K,U),K.prototype.length=function(){return this._length},K.prototype.promise=function(){return this._promise},K.prototype._init=function w(G,H){var W=z(this._values,this._promise);if(W instanceof $){W=W._target();var V=W._bitField;if(this._values=W,(V&50397184)===0)return this._promise._setAsyncGuaranteed(),W._then(w,this._reject,void 0,this,H);else if((V&33554432)!==0)W=W._value();else if((V&16777216)!==0)return this._reject(W._reason());else return this._cancel()}if(W=Y.asArray(W),W===null){var X=q("expecting an array or an iterable object but got "+Y.classString(W)).reason();this._promise._rejectCallback(X,!1);return}if(W.length===0){if(H===-5)this._resolveEmptyArray();else this._resolve(Q(H));return}this._iterate(W)},K.prototype._iterate=function(w){var G=this.getActualLength(w.length);this._length=G,this._values=this.shouldCopyValues()?Array(G):this._values;var H=this._promise,W=!1,V=null;for(var X=0;X<G;++X){var L=z(w[X],H);if(L instanceof $)L=L._target(),V=L._bitField;else V=null;if(W){if(V!==null)L.suppressUnhandledRejections()}else if(V!==null)if((V&50397184)===0)L._proxy(this,X),this._values[X]=L;else if((V&33554432)!==0)W=this._promiseFulfilled(L._value(),X);else if((V&16777216)!==0)W=this._promiseRejected(L._reason(),X);else W=this._promiseCancelled(X);else W=this._promiseFulfilled(L,X)}if(!W)H._setAsyncGuaranteed()},K.prototype._isResolved=function(){return this._values===null},K.prototype._resolve=function(w){this._values=null,this._promise._fulfill(w)},K.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},K.prototype._reject=function(w){this._values=null,this._promise._rejectCallback(w,!1)},K.prototype._promiseFulfilled=function(w,G){this._values[G]=w;var H=++this._totalResolved;if(H>=this._length)return this._resolve(this._values),!0;return!1},K.prototype._promiseCancelled=function(){return this._cancel(),!0},K.prototype._promiseRejected=function(w){return this._totalResolved++,this._reject(w),!0},K.prototype._resultCancelled=function(){if(this._isResolved())return;var w=this._values;if(this._cancel(),w instanceof $)w.cancel();else for(var G=0;G<w.length;++G)if(w[G]instanceof $)w[G].cancel()},K.prototype.shouldCopyValues=function(){return!0},K.prototype.getActualLength=function(w){return w},K}});var OG0=F(($u1,DG0)=>{DG0.exports=function($){var I=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function q(){this._trace=new q.CapturedTrace(Y())}q.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},q.prototype._popContext=function(){if(this._trace!==void 0){var J=z.pop(),Q=J._promiseCreated;return J._promiseCreated=null,Q}return null};function U(){if(I)return new q}function Y(){var J=z.length-1;if(J>=0)return z[J];return}return q.CapturedTrace=null,q.create=U,q.deactivateLong Line truncated
See http://goo.gl/MqrFmX
`);if(!R0.longStackTraces&&$$()){var a=$.prototype._captureStackTrace,N=$.prototype._attachExtraTrace;R0.longStackTraces=!0,M=function(){if(q.haveItemsQueued()&&!R0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),q.enableTrampoline(),R0.longStackTraces=!1},$.prototype._captureStackTrace=e,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),q.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return R0.longStackTraces&&$$()};var v=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(a),function(N,P){var S=new CustomEvent(N.toLowerCase(),{detail:P,cancelable:!0});return!Y.global.dispatchEvent(S)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Y.global.dispatchEvent(a),function(P,S){var i=new Event(P.toLowerCase(),{cancelable:!0});return i.detail=S,!Y.global.dispatchEvent(i)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(a),function(P,S){var i=document.createEvent("CustomEvent");return i.initCustomEvent(P.toLowerCase(),!1,!0,S),!Y.global.dispatchEvent(i)}}}catch(N){}return function(){return!1}}(),x=function(){if(Y.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Y.global)return function(){return!1};return function(a){var N="on"+a.toLowerCase(),P=Y.global[N];if(!P)return!1;return P.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function h(a,N){return{promise:N}}var k={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(a,N,P){return{promise:N,child:P}},warning:function(a,N){return{warning:N}},unhandledRejection:function(a,N,P){return{reason:N,promise:P}},rejectionHandled:h},E=function(a){var N=!1;try{N=x.apply(null,arguments)}catch(S){q.throwLater(S),N=!0}var P=!1;try{P=v(a,k[a].apply(null,arguments))}catch(S){q.throwLater(S),P=!0}return P||N};$.config=function(a){if(a=Object(a),"longStackTraces"in a){if(a.longStackTraces)$.longStackTraces();else if(!a.longStackTraces&&$.hasLongStackTraces())M()}if("warnings"in a){var N=a.warnings;if(R0.warnings=!!N,T=R0.warnings,Y.isObject(N)){if("wForgottenReturn"in N)T=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!R0.cancellation){if(q.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=q0,$.prototype._propagateFrom=R,$.prototype._onCancel=b,$.prototype._setOnCancel=p,$.prototype._attachCancellationCallback=g,$.prototype._execute=n,c=R,R0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!R0.monitoring)R0.monitoring=!0,$.prototype._fireEvent=E;else if(!a.monitoring&&R0.monitoring)R0.monitoring=!1,$.prototype._fireEvent=f}return $};function f(){return!1}$.prototype._fireEvent=f,$.prototype._execute=function(a,N,P){try{a(N,P)}catch(S){return S}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(a){},$.prototype._attachCancellationCallback=function(a){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(a,N){};function n(a,N,P){var S=this;try{a(N,P,function(i){if(typeof i!=="function")throw TypeError("onCancel must be a function, got: "+Y.toString(i));S._attachCancellationCallback(i)})}catch(i){return i}}function g(a){if(!this._isCancellable())return this;var N=this._onCancel();if(N!==void 0)if(Y.isArray(N))N.push(a);else this._setOnCancel([N,a]);else this._setOnCancel(a)}function b(){return this._onCancelField}function p(a){this._onCancelField=a}function q0(){this._cancellationParent=void 0,this._onCancelField=void 0}function R(a,N){if((N&1)!==0){this._cancellationParent=a;var P=a._branchesRemainingToCancel;if(P===void 0)P=0;a._branchesRemainingToCancel=P+1}if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}function u(a,N){if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}var c=u;function m(){var a=this._boundTo;if(a!==void 0){if(a instanceof $)if(a.isFulfilled())return a.value();else return}return a}function e(){this._trace=new M$(this._peekContext())}function G0(a,N){if(J(a)){var P=this._trace;if(P!==void 0){if(N)P=P._parent}if(P!==void 0)P.attachExtraTrace(a);else if(!a.__stackCleaned__){var S=I1(a);Y.notEnumerableProp(a,"stack",S.message+`
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),q.enableTrampoline(),R0.longStackTraces=!1},$.prototype._captureStackTrace=e,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),q.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return R0.longStackTraces&&$$()};var v=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(a),function(N,P){var S=new CustomEvent(N.toLowerCase(),{detail:P,cancelable:!0});return!Y.global.dispatchEvent(S)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Y.global.dispatchEvent(a),function(P,S){var i=new Event(P.toLowerCase(),{cancelable:!0});return i.detail=S,!Y.global.dispatchEvent(i)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(a),function(P,S){var i=document.createEvent("CustomEvent");return i.initCustomEvent(P.toLowerCase(),!1,!0,S),!Y.global.dispatchEvent(i)}}}catch(N){}return function(){return!1}}(),x=function(){if(Y.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Y.global)return function(){return!1};return function(a){var N="on"+a.toLowerCase(),P=Y.global[N];if(!P)return!1;return P.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function h(a,N){return{promise:N}}var k={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(a,N,P){return{promise:N,child:P}},warning:function(a,N){return{warning:N}},unhandledRejection:function(a,N,P){return{reason:N,promise:P}},rejectionHandled:h},j=function(a){var N=!1;try{N=x.apply(null,arguments)}catch(S){q.throwLater(S),N=!0}var P=!1;try{P=v(a,k[a].apply(null,arguments))}catch(S){q.throwLater(S),P=!0}return P||N};$.config=function(a){if(a=Object(a),"longStackTraces"in a){if(a.longStackTraces)$.longStackTraces();else if(!a.longStackTraces&&$.hasLongStackTraces())M()}if("warnings"in a){var N=a.warnings;if(R0.warnings=!!N,T=R0.warnings,Y.isObject(N)){if("wForgottenReturn"in N)T=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!R0.cancellation){if(q.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=q0,$.prototype._propagateFrom=R,$.prototype._onCancel=f,$.prototype._setOnCancel=p,$.prototype._attachCancellationCallback=g,$.prototype._execute=b,c=R,R0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!R0.monitoring)R0.monitoring=!0,$.prototype._fireEvent=j;else if(!a.monitoring&&R0.monitoring)R0.monitoring=!1,$.prototype._fireEvent=n}return $};function n(){return!1}$.prototype._fireEvent=n,$.prototype._execute=function(a,N,P){try{a(N,P)}catch(S){return S}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(a){},$.prototype._attachCancellationCallback=function(a){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(a,N){};function b(a,N,P){var S=this;try{a(N,P,function(i){if(typeof i!=="function")throw TypeError("onCancel must be a function, got: "+Y.toString(i));S._attachCancellationCallback(i)})}catch(i){return i}}function g(a){if(!this._isCancellable())return this;var N=this._onCancel();if(N!==void 0)if(Y.isArray(N))N.push(a);else this._setOnCancel([N,a]);else this._setOnCancel(a)}function f(){return this._onCancelField}function p(a){this._onCancelField=a}function q0(){this._cancellationParent=void 0,this._onCancelField=void 0}function R(a,N){if((N&1)!==0){this._cancellationParent=a;var P=a._branchesRemainingToCancel;if(P===void 0)P=0;a._branchesRemainingToCancel=P+1}if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}function u(a,N){if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}var c=u;function m(){var a=this._boundTo;if(a!==void 0){if(a instanceof $)if(a.isFulfilled())return a.value();else return}return a}function e(){this._trace=new M$(this._peekContext())}function G0(a,N){if(J(a)){var P=this._trace;if(P!==void 0){if(N)P=P._parent}if(P!==void 0)P.attachExtraTrace(a);else if(!a.__stackCleaned__){var S=I1(a);Y.notEnumerableProp(a,"stack",S.message+`
`+S.stack.join(`
`)),Y.notEnumerableProp(a,"__stackCleaned__",!0)}}}function M0(a,N,P,S,i){if(a===void 0&&N!==null&&T){if(i!==void 0&&i._returnedNonUndefined())return;if((S._bitField&65535)===0)return;if(P)P=P+" ";var s="",o="";if(N._trace){var $0=N._trace.stack.split(`
`),J0=U0($0);for(var W0=J0.length-1;W0>=0;--W0){var y0=J0[W0];if(!G.test(y0)){var c0=y0.match(H);if(c0)s="at "+c0[1]+":"+c0[2]+":"+c0[3]+" ";break}}if(J0.length>0){var i0=J0[0];for(var W0=0;W0<$0.length;++W0)if($0[W0]===i0){if(W0>0)o=`
`+$0[W0-1];break}}}var V1="a promise was created in a "+P+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+o;S._warn(V1,!0,N)}}function g0(a,N){var P=a+" is deprecated and will be removed in a future version.";if(N)P+=" Use "+N+" instead.";return G1(P)}function G1(a,N,P){if(!R0.warnings)return;var S=new U(a),i;if(N)P._attachExtraTrace(S);else if(R0.longStackTraces&&(i=$._peekContext()))i.attachExtraTrace(S);else{var s=I1(S);S.stack=s.message+`
`+s.stack.join(`
`)}if(!E("warning",S))W1(S,"",!0)}function S0(a,N){for(var P=0;P<N.length-1;++P)N[P].push("From previous event:"),N[P]=N[P].join(`
`)}if(!j("warning",S))W1(S,"",!0)}function S0(a,N){for(var P=0;P<N.length-1;++P)N[P].push("From previous event:"),N[P]=N[P].join(`
`);if(P<N.length)N[P]=N[P].join(`
`);return a+`
`+N.join(`
`)}function $1(a){for(var N=0;N<a.length;++N)if(a[N].length===0||N+1<a.length&&a[N][0]===a[N+1][0])a.splice(N,1),N--}function A0(a){var N=a[0];for(var P=1;P<a.length;++P){var S=a[P],i=N.length-1,s=N[i],o=-1;for(var $0=S.length-1;$0>=0;--$0)if(S[$0]===s){o=$0;break}for(var $0=o;$0>=0;--$0){var J0=S[$0];if(N[i]===J0)N.pop(),i--;else break}N=S}}function U0(a){var N=[];for(var P=0;P<a.length;++P){var S=a[P],i=S===" (No stack trace)"||W.test(S),s=i&&k6(S);if(i&&!s){if(X&&S.charAt(0)!==" ")S=" "+S;N.push(S)}}return N}function v0(a){var N=a.stack.replace(/\s+$/g,"").split(`
`);for(var P=0;P<N.length;++P){var S=N[P];if(S===" (No stack trace)"||W.test(S))break}if(P>0&&a.name!="SyntaxError")N=N.slice(P);return N}function I1(a){var N=a.stack,P=a.toString();return N=typeof N==="string"&&N.length>0?v0(a):[" (No stack trace)"],{message:P,stack:a.name=="SyntaxError"?N:U0(N)}}function W1(a,N,P){if(typeof console<"u"){var S;if(Y.isObject(a)){var i=a.stack;S=N+V(i,a)}else S=N+String(a);if(typeof L==="function")L(S,P);else if(typeof console.log==="function"||typeof console.log==="object")console.log(S)}}function T4(a,N,P,S){var i=!1;try{if(typeof N==="function")if(i=!0,a==="rejectionHandled")N(S);else N(P,S)}catch(s){q.throwLater(s)}if(a==="unhandledRejection"){if(!E(a,P,S)&&!i)W1(P,"Unhandled rejection ")}else E(a,S)}function S4(a){var N;if(typeof a==="function")N="[function "+(a.name||"anonymous")+"]";else{N=a&&typeof a.toString==="function"?a.toString():Y.toString(a);var P=/\[object [a-zA-Z0-9$_]+\]/;if(P.test(N))try{var S=JSON.stringify(a);N=S}catch(i){}if(N.length===0)N="(empty array)"}return"(<"+b$(N)+">, no stack trace)"}function b$(a){var N=41;if(a.length<N)return a;return a.substr(0,N-3)+"..."}function $$(){return typeof N9==="function"}var k6=function(){return!1},n$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function N$(a){var N=a.match(n$);if(N)return{fileName:N[1],line:parseInt(N[2],10)}}function a7(a,N){if(!$$())return;var P=a.stack.split(`
`);for(var P=0;P<N.length;++P){var S=N[P];if(S===" (No stack trace)"||W.test(S))break}if(P>0&&a.name!="SyntaxError")N=N.slice(P);return N}function I1(a){var N=a.stack,P=a.toString();return N=typeof N==="string"&&N.length>0?v0(a):[" (No stack trace)"],{message:P,stack:a.name=="SyntaxError"?N:U0(N)}}function W1(a,N,P){if(typeof console<"u"){var S;if(Y.isObject(a)){var i=a.stack;S=N+V(i,a)}else S=N+String(a);if(typeof L==="function")L(S,P);else if(typeof console.log==="function"||typeof console.log==="object")console.log(S)}}function T4(a,N,P,S){var i=!1;try{if(typeof N==="function")if(i=!0,a==="rejectionHandled")N(S);else N(P,S)}catch(s){q.throwLater(s)}if(a==="unhandledRejection"){if(!j(a,P,S)&&!i)W1(P,"Unhandled rejection ")}else j(a,S)}function S4(a){var N;if(typeof a==="function")N="[function "+(a.name||"anonymous")+"]";else{N=a&&typeof a.toString==="function"?a.toString():Y.toString(a);var P=/\[object [a-zA-Z0-9$_]+\]/;if(P.test(N))try{var S=JSON.stringify(a);N=S}catch(i){}if(N.length===0)N="(empty array)"}return"(<"+b$(N)+">, no stack trace)"}function b$(a){var N=41;if(a.length<N)return a;return a.substr(0,N-3)+"..."}function $$(){return typeof N9==="function"}var k6=function(){return!1},n$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function N$(a){var N=a.match(n$);if(N)return{fileName:N[1],line:parseInt(N[2],10)}}function s7(a,N){if(!$$())return;var P=a.stack.split(`
`),S=N.stack.split(`
`),i=-1,s=-1,o,$0;for(var J0=0;J0<P.length;++J0){var W0=N$(P[J0]);if(W0){o=W0.fileName,i=W0.line;break}}for(var J0=0;J0<S.length;++J0){var W0=N$(S[J0]);if(W0){$0=W0.fileName,s=W0.line;break}}if(i<0||s<0||!o||!$0||o!==$0||i>=s)return;k6=function(y0){if(w.test(y0))return!0;var c0=N$(y0);if(c0){if(c0.fileName===o&&(i<=c0.line&&c0.line<=s))return!0}return!1}}function M$(a){this._parent=a,this._promisesCreated=0;var N=this._length=1+(a===void 0?0:a._length);if(N9(this,M$),N>32)this.uncycle()}Y.inherits(M$,Error),I.CapturedTrace=M$,M$.prototype.uncycle=function(){var a=this._length;if(a<2)return;var N=[],P={};for(var S=0,i=this;i!==void 0;++S)N.push(i),i=i._parent;a=this._length=S;for(var S=a-1;S>=0;--S){var s=N[S].stack;if(P[s]===void 0)P[s]=S}for(var S=0;S<a;++S){var o=N[S].stack,$0=P[o];if($0!==void 0&&$0!==S){if($0>0)N[$0-1]._parent=void 0,N[$0-1]._length=1;N[S]._parent=void 0,N[S]._length=1;var J0=S>0?N[S-1]:this;if($0<a-1)J0._parent=N[$0+1],J0._parent.uncycle(),J0._length=J0._parent._length+1;else J0._parent=void 0,J0._length=1;var W0=J0._length+1;for(var y0=S-2;y0>=0;--y0)N[y0]._length=W0,W0++;return}}},M$.prototype.attachExtraTrace=function(a){if(a.__stackCleaned__)return;this.uncycle();var N=I1(a),P=N.message,S=[N.stack],i=this;while(i!==void 0)S.push(U0(i.stack.split(`
`))),i=i._parent;A0(S),$1(S),Y.notEnumerableProp(a,"stack",S0(P,S)),Y.notEnumerableProp(a,"__stackCleaned__",!0)};var N9=function(){var N=/^\s*at\s*/,P=function(o,$0){if(typeof o==="string")return o;if($0.name!==void 0&&$0.message!==void 0)return $0.toString();return S4($0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,W=N,V=P;var S=Error.captureStackTrace;return k6=function(o){return w.test(o)},function(o,$0){Error.stackTraceLimit+=6,S(o,$0),Error.stackTraceLimit-=6}}var i=Error();if(typeof i.stack==="string"&&i.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return W=/@/,V=P,X=!0,function($0){$0.stack=Error().stack};var s;try{throw Error()}catch(o){s="stack"in o}if(!("stack"in i)&&s&&typeof Error.stackTraceLimit==="number")return W=N,V=P,function($0){Error.stackTraceLimit+=6;try{throw Error()}catch(J0){$0.stack=J0.stack}Error.stackTraceLimit-=6};return V=function(o,$0){if(typeof o==="string")return o;if((typeof $0==="object"||typeof $0==="function")&&$0.name!==void 0&&$0.message!==void 0)return $0.toString();return S4($0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(L=function(a){console.warn(a)},Y.isNode&&process.stderr.isTTY)L=function(a,N){var P=N?"\x1B[33m":"\x1B[31m";console.warn(P+a+`\x1B[0m
`)};else if(!Y.isNode&&typeof Error().stack==="string")L=function(a,N){console.warn("%c"+a,N?"color: darkorange":"color: red")}}var R0={warnings:O,longStackTraces:!1,cancellation:!1,monitoring:!1};if(A)$.longStackTraces();return{longStackTraces:function(){return R0.longStackTraces},warnings:function(){return R0.warnings},cancellation:function(){return R0.cancellation},monitoring:function(){return R0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return m},checkForgottenReturns:M0,setBounds:a7,warn:G1,deprecated:g0,CapturedTrace:M$,fireDomEvent:v,fireGlobalEvent:x}}});var LG0=F((Cy1,XG0)=>{XG0.exports=function($,I){var z=r1(),q=$.CancellationError,U=z.errorObj;function Y(H,W,V){this.promise=H,this.type=W,this.handler=V,this.called=!1,this.cancelPromise=null}Y.prototype.isFinallyHandler=function(){return this.type===0};function J(H){this.finallyHandler=H}J.prototype._resultCancelled=function(){Q(this.finallyHandler)};function Q(H,W){if(H.cancelPromise!=null){if(arguments.length>1)H.cancelPromise._reject(W);else H.cancelPromise._cancel();return H.cancelPromise=null,!0}return!1}function K(){return G.call(this,this.promise._target()._settledValue())}function w(H){if(Q(this,H))return;return U.e=H,U}function G(H){var W=this.promise,V=this.handler;if(!this.called){this.called=!0;var X=this.isFinallyHandler()?V.call(W._boundValue()):V.call(W._boundValue(),H);if(X!==void 0){W._setReturnedNonUndefined();var L=I(X,W);if(L instanceof $){if(this.cancelPromise!=null){if(L._isCancelled()){var D=new q("late cancellation observer");return W._attachExtraTrace(D),U.e=D,U}else if(L.isPending())L._attachCancellationCallback(new J(this))}return L._then(K,w,void 0,this,void 0)}}}if(W.isRejected())return Q(this),U.e=H,U;else return Q(this),H}return $.prototype._passThrough=function(H,W,V,X){if(typeof H!=="function")return this.then();return this._then(V,X,void 0,new Y(this,W,H),void 0)},$.prototype.lastly=$.prototype.finally=function(H){return this._passThrough(H,0,G,G)},$.prototype.tap=function(H){return this._passThrough(H,1,G)},Y}});var OG0=F((hy1,DG0)=>{DG0.exports=function($){var I=r1(),z=NI().keys,q=I.tryCatch,U=I.errorObj;function Y(J,Q,K){return function(w){var G=K._boundValue();$:for(var H=0;H<J.length;++H){var W=J[H];if(W===Error||W!=null&&W.prototype instanceof Error){if(w instanceof W)return q(Q).call(G,w)}else if(typeof W==="function"){var V=q(W).call(G,w);if(V===U)return V;else if(V)return q(Q).call(G,w)}else if(I.isObject(w)){var X=z(W);for(var L=0;L<X.length;++L){var D=X[L];if(W[D]!=w[D])continue $}return q(Q).call(G,w)}}return $}}return Y}});var My=F((Sy1,MG0)=>{var FG0=r1(),PJ1=FG0.maybeWrapAsError,TJ1=z9(),EJ1=TJ1.OperationalError,NG0=NI();function BJ1($){return $ instanceof Error&&NG0.getPrototypeOf($)===Error.prototype}var jJ1=/^(?:name|message|stack|cause)$/;function vJ1($){var I;if(BJ1($)){I=new EJ1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var z=NG0.keys($);for(var q=0;q<z.length;++q){var U=z[q];if(!jJ1.test(U))I[U]=$[U]}return I}return FG0.markAsOriginatingFromRejection($),$}function RJ1($,I){return function(z,q){if($===null)return;if(z){var U=vJ1(PJ1(z));$._attachExtraTrace(U),$._reject(U)}else if(!I)$._fulfill(q);else{var Y=arguments.length,J=Array(Math.max(Y-1,0));for(var Q=1;Q<Y;++Q)J[Q-1]=arguments[Q];$._fulfill(J)}$=null}}MG0.exports=RJ1});var PG0=F((yy1,AG0)=>{AG0.exports=function($,I,z,q,U){var Y=r1(),J=Y.tryCatch;$.method=function(Q){if(typeof Q!=="function")throw new $.TypeError("expecting a function but got "+Y.classString(Q));return function(){var K=new $(I);K._captureStackTrace(),K._pushContext();var w=J(Q).apply(this,arguments),G=K._popContext();return U.checkForgottenReturns(w,G,"Promise.method",K),K._resolveFromSyncValue(w),K}},$.attempt=$.try=function(Q){if(typeof Q!=="function")return q("expecting a function but got "+Y.classString(Q));var K=new $(I);K._captureStackTrace(),K._pushContext();var w;if(arguments.length>1){U.deprecated("calling Promise.try with more than 1 argument");var G=arguments[1],H=arguments[2];w=Y.isArray(G)?J(Q).apply(H,G):J(Q).call(H,G)}else w=J(Q)();var W=K._popContext();return U.checkForgottenReturns(w,W,"Promise.try",K),K._resolveFromSyncValue(w),K},$.prototype._resolveFromSyncValue=function(Q){if(Q===Y.errorObj)this._rejectCallback(Q.e,!1);else this._resolveCallback(Q,!0)}}});var EG0=F((uy1,TG0)=>{TG0.exports=function($,I,z,q){var U=!1,Y=function(w,G){this._reject(G)},J=function(w,G){G.promiseRejectionQueued=!0,G.bindingPromise._then(Y,Y,null,this,w)},Q=function(w,G){if((this._bitField&50397184)===0)this._resolveCallback(G.target)},K=function(w,G){if(!G.promiseRejectionQueued)this._reject(w)};$.prototype.bind=function(w){if(!U)U=!0,$.prototype._propagateFrom=q.propagateFromFunction(),$.prototype._boundValue=q.boundValueFunction();var G=z(w),H=new $(I);H._propagateFrom(this,1);var W=this._target();if(H._setBoundTo(G),G instanceof $){var V={promiseRejectionQueued:!1,promise:H,target:W,bindingPromise:G};W._then(I,J,voi Line truncated
`)};else if(!Y.isNode&&typeof Error().stack==="string")L=function(a,N){console.warn("%c"+a,N?"color: darkorange":"color: red")}}var R0={warnings:O,longStackTraces:!1,cancellation:!1,monitoring:!1};if(A)$.longStackTraces();return{longStackTraces:function(){return R0.longStackTraces},warnings:function(){return R0.warnings},cancellation:function(){return R0.cancellation},monitoring:function(){return R0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return m},checkForgottenReturns:M0,setBounds:s7,warn:G1,deprecated:g0,CapturedTrace:M$,fireDomEvent:v,fireGlobalEvent:x}}});var AG0=F((zu1,MG0)=>{MG0.exports=function($,I){var z=r1(),q=$.CancellationError,U=z.errorObj;function Y(H,W,V){this.promise=H,this.type=W,this.handler=V,this.called=!1,this.cancelPromise=null}Y.prototype.isFinallyHandler=function(){return this.type===0};function J(H){this.finallyHandler=H}J.prototype._resultCancelled=function(){Q(this.finallyHandler)};function Q(H,W){if(H.cancelPromise!=null){if(arguments.length>1)H.cancelPromise._reject(W);else H.cancelPromise._cancel();return H.cancelPromise=null,!0}return!1}function K(){return G.call(this,this.promise._target()._settledValue())}function w(H){if(Q(this,H))return;return U.e=H,U}function G(H){var W=this.promise,V=this.handler;if(!this.called){this.called=!0;var X=this.isFinallyHandler()?V.call(W._boundValue()):V.call(W._boundValue(),H);if(X!==void 0){W._setReturnedNonUndefined();var L=I(X,W);if(L instanceof $){if(this.cancelPromise!=null){if(L._isCancelled()){var D=new q("late cancellation observer");return W._attachExtraTrace(D),U.e=D,U}else if(L.isPending())L._attachCancellationCallback(new J(this))}return L._then(K,w,void 0,this,void 0)}}}if(W.isRejected())return Q(this),U.e=H,U;else return Q(this),H}return $.prototype._passThrough=function(H,W,V,X){if(typeof H!=="function")return this.then();return this._then(V,X,void 0,new Y(this,W,H),void 0)},$.prototype.lastly=$.prototype.finally=function(H){return this._passThrough(H,0,G,G)},$.prototype.tap=function(H){return this._passThrough(H,1,G)},Y}});var TG0=F((qu1,PG0)=>{PG0.exports=function($){var I=r1(),z=MI().keys,q=I.tryCatch,U=I.errorObj;function Y(J,Q,K){return function(w){var G=K._boundValue();$:for(var H=0;H<J.length;++H){var W=J[H];if(W===Error||W!=null&&W.prototype instanceof Error){if(w instanceof W)return q(Q).call(G,w)}else if(typeof W==="function"){var V=q(W).call(G,w);if(V===U)return V;else if(V)return q(Q).call(G,w)}else if(I.isObject(w)){var X=z(W);for(var L=0;L<X.length;++L){var D=X[L];if(W[D]!=w[D])continue $}return q(Q).call(G,w)}}return $}}return Y}});var Py=F((Uu1,jG0)=>{var EG0=r1(),SJ1=EG0.maybeWrapAsError,yJ1=z9(),uJ1=yJ1.OperationalError,BG0=MI();function xJ1($){return $ instanceof Error&&BG0.getPrototypeOf($)===Error.prototype}var kJ1=/^(?:name|message|stack|cause)$/;function fJ1($){var I;if(xJ1($)){I=new uJ1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var z=BG0.keys($);for(var q=0;q<z.length;++q){var U=z[q];if(!kJ1.test(U))I[U]=$[U]}return I}return EG0.markAsOriginatingFromRejection($),$}function bJ1($,I){return function(z,q){if($===null)return;if(z){var U=fJ1(SJ1(z));$._attachExtraTrace(U),$._reject(U)}else if(!I)$._fulfill(q);else{var Y=arguments.length,J=Array(Math.max(Y-1,0));for(var Q=1;Q<Y;++Q)J[Q-1]=arguments[Q];$._fulfill(J)}$=null}}jG0.exports=bJ1});var RG0=F((Yu1,vG0)=>{vG0.exports=function($,I,z,q,U){var Y=r1(),J=Y.tryCatch;$.method=function(Q){if(typeof Q!=="function")throw new $.TypeError("expecting a function but got "+Y.classString(Q));return function(){var K=new $(I);K._captureStackTrace(),K._pushContext();var w=J(Q).apply(this,arguments),G=K._popContext();return U.checkForgottenReturns(w,G,"Promise.method",K),K._resolveFromSyncValue(w),K}},$.attempt=$.try=function(Q){if(typeof Q!=="function")return q("expecting a function but got "+Y.classString(Q));var K=new $(I);K._captureStackTrace(),K._pushContext();var w;if(arguments.length>1){U.deprecated("calling Promise.try with more than 1 argument");var G=arguments[1],H=arguments[2];w=Y.isArray(G)?J(Q).apply(H,G):J(Q).call(H,G)}else w=J(Q)();var W=K._popContext();return U.checkForgottenReturns(w,W,"Promise.try",K),K._resolveFromSyncValue(w),K},$.prototype._resolveFromSyncValue=function(Q){if(Q===Y.errorObj)this._rejectCallback(Q.e,!1);else this._resolveCallback(Q,!0)}}});var _G0=F((Ju1,gG0)=>{gG0.exports=function($,I,z,q){var U=!1,Y=function(w,G){this._reject(G)},J=function(w,G){G.promiseRejectionQueued=!0,G.bindingPromise._then(Y,Y,null,this,w)},Q=function(w,G){if((this._bitField&50397184)===0)this._resolveCallback(G.target)},K=function(w,G){if(!G.promiseRejectionQueued)this._reject(w)};$.prototype.bind=function(w){if(!U)U=!0,$.prototype._propagateFrom=q.propagateFromFunction(),$.prototype._boundValue=q.boundValueFunction();var G=z(w),H=new $(I);H._propagateFrom(this,1);var W=this._target();if(H._setBoundTo(G),G instanceof $){var V={promiseRejectionQueued:!1,promise:H,target:W,bindingPromise:G};W._then(I,J,voi Line truncated
See http://goo.gl/MqrFmX
`);return this._settledValue()},q=I.prototype.error=I.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()},U=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Y=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},J=I.prototype.isPending=function(){return(this._bitField&50397184)===0},Q=I.prototype.isResolved=function(){return(this._bitField&50331648)!==0};I.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 Y.call(this._target())},$.prototype.isFulfilled=function(){return U.call(this._target())},$.prototype.isResolved=function(){return Q.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var K=this._target();return K._unsetRejectionIsUnhandled(),q.call(K)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var hG0=F((by1,CG0)=>{CG0.exports=function($,I,z,q,U,Y){var J=r1(),Q=J.canEvaluate,K=J.tryCatch,w=J.errorObj,G;if(Q){var H=function(A){return Function("value","holder",`
`);return this._settledValue()},U=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Y=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},J=I.prototype.isPending=function(){return(this._bitField&50397184)===0},Q=I.prototype.isResolved=function(){return(this._bitField&50331648)!==0};I.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 Y.call(this._target())},$.prototype.isFulfilled=function(){return U.call(this._target())},$.prototype.isResolved=function(){return Q.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var K=this._target();return K._unsetRejectionIsUnhandled(),q.call(K)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var fG0=F((Gu1,kG0)=>{kG0.exports=function($,I,z,q,U,Y){var J=r1(),Q=J.canEvaluate,K=J.tryCatch,w=J.errorObj,G;if(Q){var H=function(A){return Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
@@ -149,13 +149,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
'use strict';
holder.pIndex = promise;
`.replace(/Index/g,A))},V=function(A){var T=Array(A);for(var M=0;M<T.length;++M)T[M]="this.p"+(M+1);var v=T.join(" = ")+" = null;",x=`var promise;
`+T.map(function(f){return`
promise = `+f+`;
`+T.map(function(n){return`
promise = `+n+`;
if (promise instanceof Promise) {
promise.cancel();
}
`}).join(`
`),h=T.join(", "),k="Holder$"+A,E=`return function(tryCatch, errorObj, Promise, async) {
`),h=T.join(", "),k="Holder$"+A,j=`return function(tryCatch, errorObj, Promise, async) {
'use strict';
function [TheName](fn) {
[TheProperties]
@@ -193,7 +193,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return E=E.replace(/\[TheName\]/g,k).replace(/\[TheTotal\]/g,A).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,v).replace(/\[CancellationCode\]/g,x),Function("tryCatch","errorObj","Promise","async",E)(K,w,$,U)},X=[],L=[],D=[];for(var O=0;O<8;++O)X.push(V(O+1)),L.push(H(O+1)),D.push(W(O+1));G=function(A){this._reject(A)}}$.join=function(){var A=arguments.length-1,T;if(A>0&&typeof arguments[A]==="function"){if(T=arguments[A],A<=8&&Q){var p=new $(q);p._captureStackTrace();var M=X[A-1],v=new M(T),x=L;for(var h=0;h<A;++h){var k=z(arguments[h],p);if(k instanceof $){k=k._target();var E=k._bitField;if((E&50397184)===0)k._then(x[h],G,void 0,p,v),D[h](k,v),v.asyncNeeded=!1;else if((E&33554432)!==0)x[h].call(p,k._value(),v);else if((E&16777216)!==0)p._reject(k._reason());else p._cancel()}else x[h].call(p,k,v)}if(!p._isFateSealed()){if(v.asyncNeeded){var f=Y();if(f!==null)v.fn=J.domainBind(f,v.fn)}p._setAsyncGuaranteed(),p._setOnCancel(v)}return p}}var n=arguments.length,g=Array(n);for(var b=0;b<n;++b)g[b]=arguments[b];if(T)g.pop();var p=new I(g).promise();return T!==void 0?p.spread(T):p}}});var yG0=F((ny1,SG0)=>{SG0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=r1(),K=Q.tryCatch,w=Q.errorObj,G=$._async;function H(V,X,L,D){this.constructor$(V),this._promise._captureStackTrace();var O=J();this._callback=O===null?X:Q.domainBind(O,X),this._preservedValues=D===U?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],G.invoke(this._asyncInit,this,void 0)}Q.inherits(H,I),H.prototype._asyncInit=function(){this._init$(void 0,-2)},H.prototype._init=function(){},H.prototype._promiseFulfilled=function(V,X){var L=this._values,D=this.length(),O=this._preservedValues,A=this._limit;if(X<0){if(X=X*-1-1,L[X]=V,A>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(A>=1&&this._inFlight>=A)return L[X]=V,this._queue.push(X),!1;if(O!==null)O[X]=V;var T=this._promise,M=this._callback,v=T._boundValue();T._pushContext();var x=K(M).call(v,V,X,D),h=T._popContext();if(Y.checkForgottenReturns(x,h,O!==null?"Promise.filter":"Promise.map",T),x===w)return this._reject(x.e),!0;var k=q(x,this._promise);if(k instanceof $){k=k._target();var E=k._bitField;if((E&50397184)===0){if(A>=1)this._inFlight++;return L[X]=k,k._proxy(this,(X+1)*-1),!1}else if((E&33554432)!==0)x=k._value();else if((E&16777216)!==0)return this._reject(k._reason()),!0;else return this._cancel(),!0}L[X]=x}var f=++this._totalResolved;if(f>=D){if(O!==null)this._filter(L,O);else this._resolve(L);return!0}return!1},H.prototype._drainQueue=function(){var V=this._queue,X=this._limit,L=this._values;while(V.length>0&&this._inFlight<X){if(this._isResolved())return;var D=V.pop();this._promiseFulfilled(L[D],D)}},H.prototype._filter=function(V,X){var L=X.length,D=Array(L),O=0;for(var A=0;A<L;++A)if(V[A])D[O++]=X[A];D.length=O,this._resolve(D)},H.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,L,D){if(typeof X!=="function")return z("expecting a function but got "+Q.classString(X));var O=0;if(L!==void 0)if(typeof L==="object"&&L!==null){if(typeof L.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+Q.classString(L.concurrency)));O=L.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+Q.classString(L)));return O=typeof O==="number"&&isFinite(O)&&O>=1?O:0,new H(V,X,O,D).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,L,D){return W(V,X,L,D)}}});var xG0=F((iy1,uG0)=>{var Ay=Object.create;if(Ay)aL=Ay(null),sL=Ay(null),aL[" size"]=sL[" size"]=0;var aL,sL;uG0.exports=function($){var I=r1(),z=I.canEvaluate,q=I.isIdentifier,U,Y,J=function(V){return Function("ensureMethod",`
`;return j=j.replace(/\[TheName\]/g,k).replace(/\[TheTotal\]/g,A).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,v).replace(/\[CancellationCode\]/g,x),Function("tryCatch","errorObj","Promise","async",j)(K,w,$,U)},X=[],L=[],D=[];for(var O=0;O<8;++O)X.push(V(O+1)),L.push(H(O+1)),D.push(W(O+1));G=function(A){this._reject(A)}}$.join=function(){var A=arguments.length-1,T;if(A>0&&typeof arguments[A]==="function"){if(T=arguments[A],A<=8&&Q){var p=new $(q);p._captureStackTrace();var M=X[A-1],v=new M(T),x=L;for(var h=0;h<A;++h){var k=z(arguments[h],p);if(k instanceof $){k=k._target();var j=k._bitField;if((j&50397184)===0)k._then(x[h],G,void 0,p,v),D[h](k,v),v.asyncNeeded=!1;else if((j&33554432)!==0)x[h].call(p,k._value(),v);else if((j&16777216)!==0)p._reject(k._reason());else p._cancel()}else x[h].call(p,k,v)}if(!p._isFateSealed()){if(v.asyncNeeded){var n=Y();if(n!==null)v.fn=J.domainBind(n,v.fn)}p._setAsyncGuaranteed(),p._setOnCancel(v)}return p}}var b=arguments.length,g=Array(b);for(var f=0;f<b;++f)g[f]=arguments[f];if(T)g.pop();var p=new I(g).promise();return T!==void 0?p.spread(T):p}}});var nG0=F((Hu1,bG0)=>{bG0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=r1(),K=Q.tryCatch,w=Q.errorObj,G=$._async;function H(V,X,L,D){this.constructor$(V),this._promise._captureStackTrace();var O=J();this._callback=O===null?X:Q.domainBind(O,X),this._preservedValues=D===U?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],G.invoke(this._asyncInit,this,void 0)}Q.inherits(H,I),H.prototype._asyncInit=function(){this._init$(void 0,-2)},H.prototype._init=function(){},H.prototype._promiseFulfilled=function(V,X){var L=this._values,D=this.length(),O=this._preservedValues,A=this._limit;if(X<0){if(X=X*-1-1,L[X]=V,A>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(A>=1&&this._inFlight>=A)return L[X]=V,this._queue.push(X),!1;if(O!==null)O[X]=V;var T=this._promise,M=this._callback,v=T._boundValue();T._pushContext();var x=K(M).call(v,V,X,D),h=T._popContext();if(Y.checkForgottenReturns(x,h,O!==null?"Promise.filter":"Promise.map",T),x===w)return this._reject(x.e),!0;var k=q(x,this._promise);if(k instanceof $){k=k._target();var j=k._bitField;if((j&50397184)===0){if(A>=1)this._inFlight++;return L[X]=k,k._proxy(this,(X+1)*-1),!1}else if((j&33554432)!==0)x=k._value();else if((j&16777216)!==0)return this._reject(k._reason()),!0;else return this._cancel(),!0}L[X]=x}var n=++this._totalResolved;if(n>=D){if(O!==null)this._filter(L,O);else this._resolve(L);return!0}return!1},H.prototype._drainQueue=function(){var V=this._queue,X=this._limit,L=this._values;while(V.length>0&&this._inFlight<X){if(this._isResolved())return;var D=V.pop();this._promiseFulfilled(L[D],D)}},H.prototype._filter=function(V,X){var L=X.length,D=Array(L),O=0;for(var A=0;A<L;++A)if(V[A])D[O++]=X[A];D.length=O,this._resolve(D)},H.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,L,D){if(typeof X!=="function")return z("expecting a function but got "+Q.classString(X));var O=0;if(L!==void 0)if(typeof L==="object"&&L!==null){if(typeof L.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+Q.classString(L.concurrency)));O=L.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+Q.classString(L)));return O=typeof O==="number"&&isFinite(O)&&O>=1?O:0,new H(V,X,O,D).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,L,D){return W(V,X,L,D)}}});var pG0=F((Wu1,iG0)=>{var Ty=Object.create;if(Ty)sL=Ty(null),eL=Ty(null),sL[" size"]=eL[" size"]=0;var sL,eL;iG0.exports=function($){var I=r1(),z=I.canEvaluate,q=I.isIdentifier,U,Y,J=function(V){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
@@ -210,7 +210,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
`.replace(/methodName/g,V))(w)},Q=function(V){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",V))},K=function(V,X,L){var D=L[V];if(typeof D!=="function"){if(!q(V))return null;if(D=X(V),L[V]=D,L[" size"]++,L[" size"]>512){var O=Object.keys(L);for(var A=0;A<256;++A)delete L[O[A]];L[" size"]=O.length-256}}return D};U=function(V){return K(V,J,aL)},Y=function(V){return K(V,Q,sL)};function w(V,X){var L;if(V!=null)L=V[X];if(typeof L!=="function"){var D="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(D)}return L}function G(V){var X=this.pop(),L=w(V,X);return L.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,L=Array(Math.max(X-1,0));for(var D=1;D<X;++D)L[D-1]=arguments[D];if(z){var O=U(V);if(O!==null)return this._then(O,void 0,void 0,L,void 0)}return L.push(V),this._then(G,void 0,void 0,L,void 0)};function H(V){return V[this]}function W(V){var X=+this;if(X<0)X=Math.max(0,X+V.length);return V[X]}$.prototype.get=function(V){var X=typeof V==="number",L;if(!X)if(z){var D=Y(V);L=D!==null?D:H}else L=H;else L=W;return this._then(L,void 0,void 0,V,void 0)}}});var fG0=F((py1,kG0)=>{kG0.exports=function($,I,z,q,U,Y){var J=r1(),Q=z9().TypeError,K=r1().inherits,w=J.errorObj,G=J.tryCatch,H={};function W(T){setTimeout(function(){throw T},0)}function V(T){var M=z(T);if(M!==T&&typeof T._isDisposable==="function"&&typeof T._getDisposer==="function"&&T._isDisposable())M._setDisposable(T._getDisposer());return M}function X(T,M){var v=0,x=T.length,h=new $(U);function k(){if(v>=x)return h._fulfill();var E=V(T[v++]);if(E instanceof $&&E._isDisposable()){try{E=z(E._getDisposer().tryDispose(M),T.promise)}catch(f){return W(f)}if(E instanceof $)return E._then(k,W,null,null,null)}k()}return k(),h}function L(T,M,v){this._data=T,this._promise=M,this._context=v}L.prototype.data=function(){return this._data},L.prototype.promise=function(){return this._promise},L.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return H},L.prototype.tryDispose=function(T){var M=this.resource(),v=this._context;if(v!==void 0)v._pushContext();var x=M!==H?this.doDispose(M,T):null;if(v!==void 0)v._popContext();return this._promise._unsetDisposable(),this._data=null,x},L.isDisposer=function(T){return T!=null&&typeof T.resource==="function"&&typeof T.tryDispose==="function"};function D(T,M,v){this.constructor$(T,M,v)}K(D,L),D.prototype.doDispose=function(T,M){var v=this.data();return v.call(T,T,M)};function O(T){if(L.isDisposer(T))return this.resources[this.index]._setDisposable(T),T.promise();return T}function A(T){this.length=T,this.promise=null,this[T-1]=null}A.prototype._resultCancelled=function(){var T=this.length;for(var M=0;M<T;++M){var v=this[M];if(v instanceof $)v.cancel()}},$.using=function(){var T=arguments.length;if(T<2)return I("you must pass at least 2 arguments to Promise.using");var M=arguments[T-1];if(typeof M!=="function")return I("expecting a function but got "+J.classString(M));var v,x=!0;if(T===2&&Array.isArray(arguments[0]))v=arguments[0],T=v.length,x=!1;else v=arguments,T--;var h=new A(T);for(var k=0;k<T;++k){var E=v[k];if(L.isDisposer(E)){var f=E;E=E.promise(),E._setDisposable(f)}else{var n=z(E);if(n instanceof $)E=n._then(O,null,null,{resources:h,index:k},void 0)}h[k]=E}var g=Array(h.length);for(var k=0;k<g.length;++k)g[k]=$.resolve(h[k]).reflect();var b=$.all(g).then(function(q0){for(var R=0;R<q0.length;++R){var u=q0[R];if(u.isRejected())return w.e=u.error(),w;else if(!u.isFulfilled()){b.cancel();return}q0[R]=u.value()}p._pushContext(),M=G(M);var c=x?M.apply(void 0,q0):M(q0),m=p._popContext();return Y.checkForgottenReturns(c,m,"Promise.using",p),c}),p=b.lastly(function(){var q0=new $.PromiseInspection(b);return X(h,q0)});return h.promise=p,p._setOnCancel(h),p},$.prototype._setDisposable=function(T){this._bitField=this._bitField|131072,this._disposer=T},$.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(T){if(typeof T==="function")return new D(T,this,q());throw new Q}}});var nG0=F((cy1,bG0)=>{bG0.exports=function($,I,z){var q=r1(),U=$.TimeoutError;function Y(H){this.handle=H}Y.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(H){return Q(+this).thenReturn(H)},Q=$.delay=function(H,W){var V,X;if(W!==void 0){if(V=$.resolve(W)._then(J,null,null,H,void 0),z.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+H),z.cancellation())V._setOnCancel(new Y(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(H){return Q(H,this)};var K=function(H,W,V){var X;if(typeof W!=="string")if(W instanceof Error)X=W;else X=new U("operation timed out");else X=new U(W);if(q.markAsOriginatingFromRejection(X),H._attachExtraTrace(X),H._reject(X),V!=null)V.cancel()};function w(H){return clearTimeout(this.handle),H}f Line truncated
`.replace("propertyName",V))},K=function(V,X,L){var D=L[V];if(typeof D!=="function"){if(!q(V))return null;if(D=X(V),L[V]=D,L[" size"]++,L[" size"]>512){var O=Object.keys(L);for(var A=0;A<256;++A)delete L[O[A]];L[" size"]=O.length-256}}return D};U=function(V){return K(V,J,sL)},Y=function(V){return K(V,Q,eL)};function w(V,X){var L;if(V!=null)L=V[X];if(typeof L!=="function"){var D="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(D)}return L}function G(V){var X=this.pop(),L=w(V,X);return L.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,L=Array(Math.max(X-1,0));for(var D=1;D<X;++D)L[D-1]=arguments[D];if(z){var O=U(V);if(O!==null)return this._then(O,void 0,void 0,L,void 0)}return L.push(V),this._then(G,void 0,void 0,L,void 0)};function H(V){return V[this]}function W(V){var X=+this;if(X<0)X=Math.max(0,X+V.length);return V[X]}$.prototype.get=function(V){var X=typeof V==="number",L;if(!X)if(z){var D=Y(V);L=D!==null?D:H}else L=H;else L=W;return this._then(L,void 0,void 0,V,void 0)}}});var dG0=F((Vu1,cG0)=>{cG0.exports=function($,I,z,q,U,Y){var J=r1(),Q=z9().TypeError,K=r1().inherits,w=J.errorObj,G=J.tryCatch,H={};function W(T){setTimeout(function(){throw T},0)}function V(T){var M=z(T);if(M!==T&&typeof T._isDisposable==="function"&&typeof T._getDisposer==="function"&&T._isDisposable())M._setDisposable(T._getDisposer());return M}function X(T,M){var v=0,x=T.length,h=new $(U);function k(){if(v>=x)return h._fulfill();var j=V(T[v++]);if(j instanceof $&&j._isDisposable()){try{j=z(j._getDisposer().tryDispose(M),T.promise)}catch(n){return W(n)}if(j instanceof $)return j._then(k,W,null,null,null)}k()}return k(),h}function L(T,M,v){this._data=T,this._promise=M,this._context=v}L.prototype.data=function(){return this._data},L.prototype.promise=function(){return this._promise},L.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return H},L.prototype.tryDispose=function(T){var M=this.resource(),v=this._context;if(v!==void 0)v._pushContext();var x=M!==H?this.doDispose(M,T):null;if(v!==void 0)v._popContext();return this._promise._unsetDisposable(),this._data=null,x},L.isDisposer=function(T){return T!=null&&typeof T.resource==="function"&&typeof T.tryDispose==="function"};function D(T,M,v){this.constructor$(T,M,v)}K(D,L),D.prototype.doDispose=function(T,M){var v=this.data();return v.call(T,T,M)};function O(T){if(L.isDisposer(T))return this.resources[this.index]._setDisposable(T),T.promise();return T}function A(T){this.length=T,this.promise=null,this[T-1]=null}A.prototype._resultCancelled=function(){var T=this.length;for(var M=0;M<T;++M){var v=this[M];if(v instanceof $)v.cancel()}},$.using=function(){var T=arguments.length;if(T<2)return I("you must pass at least 2 arguments to Promise.using");var M=arguments[T-1];if(typeof M!=="function")return I("expecting a function but got "+J.classString(M));var v,x=!0;if(T===2&&Array.isArray(arguments[0]))v=arguments[0],T=v.length,x=!1;else v=arguments,T--;var h=new A(T);for(var k=0;k<T;++k){var j=v[k];if(L.isDisposer(j)){var n=j;j=j.promise(),j._setDisposable(n)}else{var b=z(j);if(b instanceof $)j=b._then(O,null,null,{resources:h,index:k},void 0)}h[k]=j}var g=Array(h.length);for(var k=0;k<g.length;++k)g[k]=$.resolve(h[k]).reflect();var f=$.all(g).then(function(q0){for(var R=0;R<q0.length;++R){var u=q0[R];if(u.isRejected())return w.e=u.error(),w;else if(!u.isFulfilled()){f.cancel();return}q0[R]=u.value()}p._pushContext(),M=G(M);var c=x?M.apply(void 0,q0):M(q0),m=p._popContext();return Y.checkForgottenReturns(c,m,"Promise.using",p),c}),p=f.lastly(function(){var q0=new $.PromiseInspection(f);return X(h,q0)});return h.promise=p,p._setOnCancel(h),p},$.prototype._setDisposable=function(T){this._bitField=this._bitField|131072,this._disposer=T},$.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(T){if(typeof T==="function")return new D(T,this,q());throw new Q}}});var lG0=F((Zu1,mG0)=>{mG0.exports=function($,I,z){var q=r1(),U=$.TimeoutError;function Y(H){this.handle=H}Y.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(H){return Q(+this).thenReturn(H)},Q=$.delay=function(H,W){var V,X;if(W!==void 0){if(V=$.resolve(W)._then(J,null,null,H,void 0),z.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+H),z.cancellation())V._setOnCancel(new Y(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(H){return Q(H,this)};var K=function(H,W,V){var X;if(typeof W!=="string")if(W instanceof Error)X=W;else X=new U("operation timed out");else X=new U(W);if(q.markAsOriginatingFromRejection(X),H._attachExtraTrace(X),H._reject(X),V!=null)V.cancel()};function w(H){return clearTimeout(this.handle),H}f Line truncated
See http://goo.gl/MqrFmX
@@ -223,10 +223,10 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
`);var D=Object(L).yieldHandler,O=V,A=Error().stack;return function(){var T=X.apply(this,arguments),M=new O(void 0,void 0,D,A),v=M.promise();return M._generator=T,M._promiseFulfilled(void 0),v}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new Q("expecting a function but got "+K.classString(X));H.push(X)},$.spawn=function(X){if(Y.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var L=new V(X,this),D=L.promise();return L._run($.spawn),D}}});var dG0=F((my1,cG0)=>{cG0.exports=function($){var I=r1(),z=$._async,q=I.tryCatch,U=I.errorObj;function Y(K,w){var G=this;if(!I.isArray(K))return J.call(G,K,w);var H=q(w).apply(G._boundValue(),[null].concat(K));if(H===U)z.throwLater(H.e)}function J(K,w){var G=this,H=G._boundValue(),W=K===void 0?q(w).call(H,null):q(w).call(H,null,K);if(W===U)z.throwLater(W.e)}function Q(K,w){var G=this;if(!K){var H=Error(K+"");H.cause=K,K=H}var W=q(w).call(G._boundValue(),K);if(W===U)z.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(K,w){if(typeof K=="function"){var G=J;if(w!==void 0&&Object(w).spread)G=Y;this._then(G,Q,void 0,this,K)}return this}}});var lG0=F((ly1,mG0)=>{mG0.exports=function($,I){var z={},q=r1(),U=My(),Y=q.withAppended,J=q.maybeWrapAsError,Q=q.canEvaluate,K=z9().TypeError,w="Async",G={__isPromisified__:!0},H=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+H.join("|")+")$"),V=function(b){return q.isIdentifier(b)&&b.charAt(0)!=="_"&&b!=="constructor"};function X(b){return!W.test(b)}function L(b){try{return b.__isPromisified__===!0}catch(p){return!1}}function D(b,p,q0){var R=q.getDataPropertyOrDefault(b,p+q0,G);return R?L(R):!1}function O(b,p,q0){for(var R=0;R<b.length;R+=2){var u=b[R];if(q0.test(u)){var c=u.replace(q0,"");for(var m=0;m<b.length;m+=2)if(b[m]===c)throw new K(`Cannot promisify an API that has normal methods with '%s'-suffix
`);var L=new V(X,this),D=L.promise();return L._run($.spawn),D}}});var aG0=F((Lu1,tG0)=>{tG0.exports=function($){var I=r1(),z=$._async,q=I.tryCatch,U=I.errorObj;function Y(K,w){var G=this;if(!I.isArray(K))return J.call(G,K,w);var H=q(w).apply(G._boundValue(),[null].concat(K));if(H===U)z.throwLater(H.e)}function J(K,w){var G=this,H=G._boundValue(),W=K===void 0?q(w).call(H,null):q(w).call(H,null,K);if(W===U)z.throwLater(W.e)}function Q(K,w){var G=this;if(!K){var H=Error(K+"");H.cause=K,K=H}var W=q(w).call(G._boundValue(),K);if(W===U)z.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(K,w){if(typeof K=="function"){var G=J;if(w!==void 0&&Object(w).spread)G=Y;this._then(G,Q,void 0,this,K)}return this}}});var eG0=F((Du1,sG0)=>{sG0.exports=function($,I){var z={},q=r1(),U=Py(),Y=q.withAppended,J=q.maybeWrapAsError,Q=q.canEvaluate,K=z9().TypeError,w="Async",G={__isPromisified__:!0},H=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+H.join("|")+")$"),V=function(f){return q.isIdentifier(f)&&f.charAt(0)!=="_"&&f!=="constructor"};function X(f){return!W.test(f)}function L(f){try{return f.__isPromisified__===!0}catch(p){return!1}}function D(f,p,q0){var R=q.getDataPropertyOrDefault(f,p+q0,G);return R?L(R):!1}function O(f,p,q0){for(var R=0;R<f.length;R+=2){var u=f[R];if(q0.test(u)){var c=u.replace(q0,"");for(var m=0;m<f.length;m+=2)if(f[m]===c)throw new K(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",p))}}}function A(b,p,q0,R){var u=q.inheritedDataKeys(b),c=[];for(var m=0;m<u.length;++m){var e=u[m],G0=b[e],M0=R===V?!0:V(e,G0,b);if(typeof G0==="function"&&!L(G0)&&!D(b,e,p)&&R(e,G0,b,M0))c.push(e,G0)}return O(c,p,q0),c}var T=function(b){return b.replace(/([$])/,"\\$")},M,v=function(b){var p=[b],q0=Math.max(0,b-1-3);for(var R=b-1;R>=q0;--R)p.push(R);for(var R=b+1;R<=3;++R)p.push(R);return p},x=function(b){return q.filledRange(b,"_arg","")},h=function(b){return q.filledRange(Math.max(b,3),"_arg","")},k=function(b){if(typeof b.length==="number")return Math.max(Math.min(b.length,1024),0);return 0};M=function(b,p,q0,R,u,c){var m=Math.max(0,k(R)-1),e=v(m),G0=typeof b==="string"||p===z;function M0($1){var A0=x($1).join(", "),U0=$1>0?", ":"",v0;if(G0)v0=`ret = callback.call(this, {{args}}, nodeback); break;
`.replace("%s",p))}}}function A(f,p,q0,R){var u=q.inheritedDataKeys(f),c=[];for(var m=0;m<u.length;++m){var e=u[m],G0=f[e],M0=R===V?!0:V(e,G0,f);if(typeof G0==="function"&&!L(G0)&&!D(f,e,p)&&R(e,G0,f,M0))c.push(e,G0)}return O(c,p,q0),c}var T=function(f){return f.replace(/([$])/,"\\$")},M,v=function(f){var p=[f],q0=Math.max(0,f-1-3);for(var R=f-1;R>=q0;--R)p.push(R);for(var R=f+1;R<=3;++R)p.push(R);return p},x=function(f){return q.filledRange(f,"_arg","")},h=function(f){return q.filledRange(Math.max(f,3),"_arg","")},k=function(f){if(typeof f.length==="number")return Math.max(Math.min(f.length,1024),0);return 0};M=function(f,p,q0,R,u,c){var m=Math.max(0,k(R)-1),e=v(m),G0=typeof f==="string"||p===z;function M0($1){var A0=x($1).join(", "),U0=$1>0?", ":"",v0;if(G0)v0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else v0=p===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return v0.replace("{{args}}",A0).replace(", ",U0)}function g0(){var $1="";for(var A0=0;A0<e.length;++A0)$1+="case "+e[A0]+":"+M0(e[A0]);return $1+=`
@@ -241,7 +241,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
break;
`.replace("[CodeForCall]",G0?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),$1}var G1=typeof b==="string"?"this != null ? this['"+b+"'] : fn":"fn",S0=`'use strict';
`),$1}var G1=typeof f==="string"?"this != null ? this['"+f+"'] : fn":"fn",S0=`'use strict';
var ret = function (Parameters) {
'use strict';
var len = arguments.length;
@@ -261,25 +261,25 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
};
notEnumerableProp(ret, '__isPromisified__', true);
return ret;
`.replace("[CodeForSwitchCase]",g0()).replace("[GetFunctionCode]",G1);return S0=S0.replace("Parameters",h(m)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",S0)($,R,p,Y,J,U,q.tryCatch,q.errorObj,q.notEnumerableProp,I)};function E(b,p,q0,R,u,c){var m=function(){return this}(),e=b;if(typeof e==="string")b=R;function G0(){var M0=p;if(p===z)M0=this;var g0=new $(I);g0._captureStackTrace();var G1=typeof e==="string"&&this!==m?this[e]:b,S0=U(g0,c);try{G1.apply(M0,Y(arguments,S0))}catch($1){g0._rejectCallback(J($1),!0,!0)}if(!g0._isFateSealed())g0._setAsyncGuaranteed();return g0}return q.notEnumerableProp(G0,"__isPromisified__",!0),G0}var f=Q?M:E;function n(b,p,q0,R,u){var c=new RegExp(T(p)+"$"),m=A(b,p,c,q0);for(var e=0,G0=m.length;e<G0;e+=2){var M0=m[e],g0=m[e+1],G1=M0+p;if(R===f)b[G1]=f(M0,z,M0,g0,p,u);else{var S0=R(g0,function(){return f(M0,z,M0,g0,p,u)});q.notEnumerableProp(S0,"__isPromisified__",!0),b[G1]=S0}}return q.toFastProperties(b),b}function g(b,p,q0){return f(b,p,void 0,b,null,q0)}$.promisify=function(b,p){if(typeof b!=="function")throw new K("expecting a function but got "+q.classString(b));if(L(b))return b;p=Object(p);var q0=p.context===void 0?z:p.context,R=!!p.multiArgs,u=g(b,q0,R);return q.copyDescriptors(b,u,X),u},$.promisifyAll=function(b,p){if(typeof b!=="function"&&typeof b!=="object")throw new K(`the target of promisifyAll must be an object or a function
`.replace("[CodeForSwitchCase]",g0()).replace("[GetFunctionCode]",G1);return S0=S0.replace("Parameters",h(m)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",S0)($,R,p,Y,J,U,q.tryCatch,q.errorObj,q.notEnumerableProp,I)};function j(f,p,q0,R,u,c){var m=function(){return this}(),e=f;if(typeof e==="string")f=R;function G0(){var M0=p;if(p===z)M0=this;var g0=new $(I);g0._captureStackTrace();var G1=typeof e==="string"&&this!==m?this[e]:f,S0=U(g0,c);try{G1.apply(M0,Y(arguments,S0))}catch($1){g0._rejectCallback(J($1),!0,!0)}if(!g0._isFateSealed())g0._setAsyncGuaranteed();return g0}return q.notEnumerableProp(G0,"__isPromisified__",!0),G0}var n=Q?M:j;function b(f,p,q0,R,u){var c=new RegExp(T(p)+"$"),m=A(f,p,c,q0);for(var e=0,G0=m.length;e<G0;e+=2){var M0=m[e],g0=m[e+1],G1=M0+p;if(R===n)f[G1]=n(M0,z,M0,g0,p,u);else{var S0=R(g0,function(){return n(M0,z,M0,g0,p,u)});q.notEnumerableProp(S0,"__isPromisified__",!0),f[G1]=S0}}return q.toFastProperties(f),f}function g(f,p,q0){return n(f,p,void 0,f,null,q0)}$.promisify=function(f,p){if(typeof f!=="function")throw new K("expecting a function but got "+q.classString(f));if(L(f))return f;p=Object(p);var q0=p.context===void 0?z:p.context,R=!!p.multiArgs,u=g(f,q0,R);return q.copyDescriptors(f,u,X),u},$.promisifyAll=function(f,p){if(typeof f!=="function"&&typeof f!=="object")throw new K(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);p=Object(p);var q0=!!p.multiArgs,R=p.suffix;if(typeof R!=="string")R=w;var u=p.filter;if(typeof u!=="function")u=V;var c=p.promisifier;if(typeof c!=="function")c=f;if(!q.isIdentifier(R))throw RangeError(`suffix must be a valid identifier
`);p=Object(p);var q0=!!p.multiArgs,R=p.suffix;if(typeof R!=="string")R=w;var u=p.filter;if(typeof u!=="function")u=V;var c=p.promisifier;if(typeof c!=="function")c=n;if(!q.isIdentifier(R))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var m=q.inheritedDataKeys(b);for(var e=0;e<m.length;++e){var G0=b[m[e]];if(m[e]!=="constructor"&&q.isClass(G0))n(G0.prototype,R,u,c,q0),n(G0,R,u,c,q0)}return n(b,R,u,c,q0)}}});var rG0=F((oy1,oG0)=>{oG0.exports=function($,I,z,q){var U=r1(),Y=U.isObject,J=NI(),Q;if(typeof Map==="function")Q=Map;var K=function(){var W=0,V=0;function X(L,D){this[W]=L,this[W+V]=D,W++}return function(D){V=D.size,W=0;var O=Array(D.size*2);return D.forEach(X,O),O}}(),w=function(W){var V=new Q,X=W.length/2|0;for(var L=0;L<X;++L){var D=W[X+L],O=W[L];V.set(D,O)}return V};function G(W){var V=!1,X;if(Q!==void 0&&W instanceof Q)X=K(W),V=!0;else{var L=J.keys(W),D=L.length;X=Array(D*2);for(var O=0;O<D;++O){var A=L[O];X[O]=W[A],X[O+D]=A}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}U.inherits(G,I),G.prototype._init=function(){},G.prototype._promiseFulfilled=function(W,V){this._values[V]=W;var X=++this._totalResolved;if(X>=this._length){var L;if(this._isMap)L=w(this._values);else{L={};var D=this.length();for(var O=0,A=this.length();O<A;++O)L[this._values[O+D]]=this._values[O]}return this._resolve(L),!0}return!1},G.prototype.shouldCopyValues=function(){return!1},G.prototype.getActualLength=function(W){return W>>1};function H(W){var V,X=z(W);if(!Y(X))return q(`cannot await properties of a non-object
`);var m=q.inheritedDataKeys(f);for(var e=0;e<m.length;++e){var G0=f[m[e]];if(m[e]!=="constructor"&&q.isClass(G0))b(G0.prototype,R,u,c,q0),b(G0,R,u,c,q0)}return b(f,R,u,c,q0)}}});var IH0=F((Ou1,$H0)=>{$H0.exports=function($,I,z,q){var U=r1(),Y=U.isObject,J=MI(),Q;if(typeof Map==="function")Q=Map;var K=function(){var W=0,V=0;function X(L,D){this[W]=L,this[W+V]=D,W++}return function(D){V=D.size,W=0;var O=Array(D.size*2);return D.forEach(X,O),O}}(),w=function(W){var V=new Q,X=W.length/2|0;for(var L=0;L<X;++L){var D=W[X+L],O=W[L];V.set(D,O)}return V};function G(W){var V=!1,X;if(Q!==void 0&&W instanceof Q)X=K(W),V=!0;else{var L=J.keys(W),D=L.length;X=Array(D*2);for(var O=0;O<D;++O){var A=L[O];X[O]=W[A],X[O+D]=A}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}U.inherits(G,I),G.prototype._init=function(){},G.prototype._promiseFulfilled=function(W,V){this._values[V]=W;var X=++this._totalResolved;if(X>=this._length){var L;if(this._isMap)L=w(this._values);else{L={};var D=this.length();for(var O=0,A=this.length();O<A;++O)L[this._values[O+D]]=this._values[O]}return this._resolve(L),!0}return!1},G.prototype.shouldCopyValues=function(){return!1},G.prototype.getActualLength=function(W){return W>>1};function H(W){var V,X=z(W);if(!Y(X))return q(`cannot await properties of a non-object
See http://goo.gl/MqrFmX
`);else if(X instanceof $)V=X._then($.props,void 0,void 0,void 0,void 0);else V=new G(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return H(this)},$.props=function(W){return H(W)}}});var aG0=F((ry1,tG0)=>{tG0.exports=function($,I,z,q){var U=r1(),Y=function(Q){return Q.then(function(K){return J(K,Q)})};function J(Q,K){var w=z(Q);if(w instanceof $)return Y(w);else if(Q=U.asArray(Q),Q===null)return q("expecting an array or an iterable object but got "+U.classString(Q));var G=new $(I);if(K!==void 0)G._propagateFrom(K,3);var{_fulfill:H,_reject:W}=G;for(var V=0,X=Q.length;V<X;++V){var L=Q[V];if(L===void 0&&!(V in Q))continue;$.cast(L)._then(H,W,void 0,G,null)}return G}$.race=function(Q){return J(Q,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var eG0=F((ty1,sG0)=>{sG0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=r1(),K=Q.tryCatch;function w(X,L,D,O){this.constructor$(X);var A=J();if(this._fn=A===null?L:Q.domainBind(A,L),D!==void 0)D=$.resolve(D),D._attachCancellationCallback(this);if(this._initialValue=D,this._currentCancellable=null,O===U)this._eachValues=Array(this._length);else if(O===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}Q.inherits(w,I),w.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==U)this._eachValues.push(X)},w.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);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(X){this._promise._resolveCallback(X),this._values=null},w.prototype._resultCancelled=function(X){if(X===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(X){this._values=X;var L,D,O=X.length;if(this._initialValue!==void 0)L=this._initialValue,D=0;else L=$.resolve(X[0]),D=1;if(this._currentCancellable=L,!L.isRejected())for(;D<O;++D){var A={accum:null,value:X[D],index:D,length:O,array:this};L=L._then(W,void 0,void 0,A,void 0)}if(this._eachValues!==void 0)L=L._then(this._eachComplete,void 0,void 0,this,void 0);L._then(G,G,void 0,L,this)},$.prototype.reduce=function(X,L){return H(this,X,L,null)},$.reduce=function(X,L,D,O){return H(X,L,D,O)};function G(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function H(X,L,D,O){if(typeof L!=="function")return z("expecting a function but got "+Q.classString(L));var A=new w(X,L,D,O);return A.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var L=q(this.value,this.array._promise);if(L instanceof $)return this.array._currentCancellable=L,L._then(V,void 0,void 0,this,void 0);else return V.call(this,L)}function V(X){var L=this.array,D=L._promise,O=K(L._fn);D._pushContext();var A;if(L._eachValues!==void 0)A=O.call(D._boundValue(),X,this.index,this.length);else A=O.call(D._boundValue(),this.accum,X,this.index,this.length);if(A instanceof $)L._currentCancellable=A;var T=D._popContext();return Y.checkForgottenReturns(A,T,L._eachValues!==void 0?"Promise.each":"Promise.reduce",D),A}}});var IH0=F((ay1,$H0)=>{$H0.exports=function($,I,z){var q=$.PromiseInspection,U=r1();function Y(J){this.constructor$(J)}U.inherits(Y,I),Y.prototype._promiseResolved=function(J,Q){this._values[J]=Q;var K=++this._totalResolved;if(K>=this._length)return this._resolve(this._values),!0;return!1},Y.prototype._promiseFulfilled=function(J,Q){var K=new q;return K._bitField=33554432,K._settledValueField=J,this._promiseResolved(Q,K)},Y.prototype._promiseRejected=function(J,Q){var K=new q;return K._bitField=16777216,K._settledValueField=J,this._promiseResolved(Q,K)},$.settle=function(J){return z.deprecated(".settle()",".reflect()"),new Y(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var qH0=F((sy1,zH0)=>{zH0.exports=function($,I,z){var q=r1(),U=z9().RangeError,Y=z9().AggregateError,J=q.isArray,Q={};function K(G){this.constructor$(G),this._howMany=0,this._unwrap=!1,this._initialized=!1}q.inherits(K,I),K.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var G=J(this._values);if(!this._isResolved()&&G&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},K.prototype.init=function(){this._initialized=!0,this._init()},K.prototype.setUnwrap=function(){this._unwrap=!0},K.prototype.howMany=function(){return this._howMany},K.prototype.setHowMany=function(G){this._howMany=G},K.prototype._promiseFulfilled=function(G){if(this._addFulfilled(G),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
`);else if(X instanceof $)V=X._then($.props,void 0,void 0,void 0,void 0);else V=new G(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return H(this)},$.props=function(W){return H(W)}}});var qH0=F((Fu1,zH0)=>{zH0.exports=function($,I,z,q){var U=r1(),Y=function(Q){return Q.then(function(K){return J(K,Q)})};function J(Q,K){var w=z(Q);if(w instanceof $)return Y(w);else if(Q=U.asArray(Q),Q===null)return q("expecting an array or an iterable object but got "+U.classString(Q));var G=new $(I);if(K!==void 0)G._propagateFrom(K,3);var{_fulfill:H,_reject:W}=G;for(var V=0,X=Q.length;V<X;++V){var L=Q[V];if(L===void 0&&!(V in Q))continue;$.cast(L)._then(H,W,void 0,G,null)}return G}$.race=function(Q){return J(Q,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var YH0=F((Nu1,UH0)=>{UH0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=r1(),K=Q.tryCatch;function w(X,L,D,O){this.constructor$(X);var A=J();if(this._fn=A===null?L:Q.domainBind(A,L),D!==void 0)D=$.resolve(D),D._attachCancellationCallback(this);if(this._initialValue=D,this._currentCancellable=null,O===U)this._eachValues=Array(this._length);else if(O===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}Q.inherits(w,I),w.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==U)this._eachValues.push(X)},w.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);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(X){this._promise._resolveCallback(X),this._values=null},w.prototype._resultCancelled=function(X){if(X===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(X){this._values=X;var L,D,O=X.length;if(this._initialValue!==void 0)L=this._initialValue,D=0;else L=$.resolve(X[0]),D=1;if(this._currentCancellable=L,!L.isRejected())for(;D<O;++D){var A={accum:null,value:X[D],index:D,length:O,array:this};L=L._then(W,void 0,void 0,A,void 0)}if(this._eachValues!==void 0)L=L._then(this._eachComplete,void 0,void 0,this,void 0);L._then(G,G,void 0,L,this)},$.prototype.reduce=function(X,L){return H(this,X,L,null)},$.reduce=function(X,L,D,O){return H(X,L,D,O)};function G(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function H(X,L,D,O){if(typeof L!=="function")return z("expecting a function but got "+Q.classString(L));var A=new w(X,L,D,O);return A.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var L=q(this.value,this.array._promise);if(L instanceof $)return this.array._currentCancellable=L,L._then(V,void 0,void 0,this,void 0);else return V.call(this,L)}function V(X){var L=this.array,D=L._promise,O=K(L._fn);D._pushContext();var A;if(L._eachValues!==void 0)A=O.call(D._boundValue(),X,this.index,this.length);else A=O.call(D._boundValue(),this.accum,X,this.index,this.length);if(A instanceof $)L._currentCancellable=A;var T=D._popContext();return Y.checkForgottenReturns(A,T,L._eachValues!==void 0?"Promise.each":"Promise.reduce",D),A}}});var QH0=F((Mu1,JH0)=>{JH0.exports=function($,I,z){var q=$.PromiseInspection,U=r1();function Y(J){this.constructor$(J)}U.inherits(Y,I),Y.prototype._promiseResolved=function(J,Q){this._values[J]=Q;var K=++this._totalResolved;if(K>=this._length)return this._resolve(this._values),!0;return!1},Y.prototype._promiseFulfilled=function(J,Q){var K=new q;return K._bitField=33554432,K._settledValueField=J,this._promiseResolved(Q,K)},Y.prototype._promiseRejected=function(J,Q){var K=new q;return K._bitField=16777216,K._settledValueField=J,this._promiseResolved(Q,K)},$.settle=function(J){return z.deprecated(".settle()",".reflect()"),new Y(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var wH0=F((Au1,KH0)=>{KH0.exports=function($,I,z){var q=r1(),U=z9().RangeError,Y=z9().AggregateError,J=q.isArray,Q={};function K(G){this.constructor$(G),this._howMany=0,this._unwrap=!1,this._initialized=!1}q.inherits(K,I),K.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var G=J(this._values);if(!this._isResolved()&&G&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},K.prototype.init=function(){this._initialized=!0,this._init()},K.prototype.setUnwrap=function(){this._unwrap=!0},K.prototype.howMany=function(){return this._howMany},K.prototype.setHowMany=function(G){this._howMany=G},K.prototype._promiseFulfilled=function(G){if(this._addFulfilled(G),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
See http://goo.gl/MqrFmX
`);var W=new K(G),V=W.promise();return W.setHowMany(H),W.init(),V}$.some=function(G,H){return w(G,H)},$.prototype.some=function(G){return w(this,G)},$._SomePromiseArray=K}});var YH0=F((ey1,UH0)=>{UH0.exports=function($,I){var z=$.map;$.prototype.filter=function(q,U){return z(this,q,U,I)},$.filter=function(q,U,Y){return z(q,U,Y,I)}}});var QH0=F(($u1,JH0)=>{JH0.exports=function($,I){var{reduce:z,all:q}=$;function U(){return q(this)}function Y(J,Q){return z(J,Q,I,I)}$.prototype.each=function(J){return z(this,J,I,0)._then(U,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return z(this,J,I,I)},$.each=function(J,Q){return z(J,Q,I,0)._then(U,void 0,void 0,J,void 0)},$.mapSeries=Y}});var wH0=F((Iu1,KH0)=>{KH0.exports=function($){var I=$._SomePromiseArray;function z(q){var U=new I(q),Y=U.promise();return U.setHowMany(1),U.setUnwrap(),U.init(),Y}$.any=function(q){return z(q)},$.prototype.any=function(){return z(this)}}});var GH0=F((zu1,Py)=>{Py.exports=function(){var $=function(){return new H(`circular promise resolution chain
`);var W=new K(G),V=W.promise();return W.setHowMany(H),W.init(),V}$.some=function(G,H){return w(G,H)},$.prototype.some=function(G){return w(this,G)},$._SomePromiseArray=K}});var HH0=F((Pu1,GH0)=>{GH0.exports=function($,I){var z=$.map;$.prototype.filter=function(q,U){return z(this,q,U,I)},$.filter=function(q,U,Y){return z(q,U,Y,I)}}});var VH0=F((Tu1,WH0)=>{WH0.exports=function($,I){var{reduce:z,all:q}=$;function U(){return q(this)}function Y(J,Q){return z(J,Q,I,I)}$.prototype.each=function(J){return z(this,J,I,0)._then(U,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return z(this,J,I,I)},$.each=function(J,Q){return z(J,Q,I,0)._then(U,void 0,void 0,J,void 0)},$.mapSeries=Y}});var XH0=F((Eu1,ZH0)=>{ZH0.exports=function($){var I=$._SomePromiseArray;function z(q){var U=new I(q),Y=U.promise();return U.setHowMany(1),U.setUnwrap(),U.init(),Y}$.any=function(q){return z(q)},$.prototype.any=function(){return z(this)}}});var LH0=F((Bu1,Ey)=>{Ey.exports=function(){var $=function(){return new H(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},I=function(){return new g.PromiseInspection(this._target())},z=function(R){return g.reject(new H(R))};function q(){}var U={},Y=r1(),J;if(Y.isNode)J=function(){var R=process.domain;if(R===void 0)R=null;return R};else J=function(){return null};Y.notEnumerableProp(g,"_getDomain",J);var Q=NI(),K=qG0(),w=new K;Q.defineProperty(g,"_async",{value:w});var G=z9(),H=g.TypeError=G.TypeError;g.RangeError=G.RangeError;var W=g.CancellationError=G.CancellationError;g.TimeoutError=G.TimeoutError,g.OperationalError=G.OperationalError,g.RejectionError=G.OperationalError,g.AggregateError=G.AggregateError;var V=function(){},X={},L={},D=KG0()(g,V),O=GG0()(g,V,D,z,q),A=WG0()(g),T=A.create,M=ZG0()(g,A),v=M.CapturedTrace,x=LG0()(g,D),h=OG0()(L),k=My(),E=Y.errorObj,f=Y.tryCatch;function n(R,u){if(typeof u!=="function")throw new H("expecting a function but got "+Y.classString(u));if(R.constructor!==g)throw new H(`the promise constructor cannot be invoked directly
`)},I=function(){return new g.PromiseInspection(this._target())},z=function(R){return g.reject(new H(R))};function q(){}var U={},Y=r1(),J;if(Y.isNode)J=function(){var R=process.domain;if(R===void 0)R=null;return R};else J=function(){return null};Y.notEnumerableProp(g,"_getDomain",J);var Q=MI(),K=wG0(),w=new K;Q.defineProperty(g,"_async",{value:w});var G=z9(),H=g.TypeError=G.TypeError;g.RangeError=G.RangeError;var W=g.CancellationError=G.CancellationError;g.TimeoutError=G.TimeoutError,g.OperationalError=G.OperationalError,g.RejectionError=G.OperationalError,g.AggregateError=G.AggregateError;var V=function(){},X={},L={},D=ZG0()(g,V),O=LG0()(g,V,D,z,q),A=OG0()(g),T=A.create,M=NG0()(g,A),v=M.CapturedTrace,x=AG0()(g,D),h=TG0()(L),k=Py(),j=Y.errorObj,n=Y.tryCatch;function b(R,u){if(typeof u!=="function")throw new H("expecting a function but got "+Y.classString(u));if(R.constructor!==g)throw new H(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function g(R){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,R!==V)n(this,R),this._resolveFromExecutor(R);this._promiseCreated(),this._fireEvent("promiseCreated",this)}g.prototype.toString=function(){return"[object Promise]"},g.prototype.caught=g.prototype.catch=function(R){var u=arguments.length;if(u>1){var c=Array(u-1),m=0,e;for(e=0;e<u-1;++e){var G0=arguments[e];if(Y.isObject(G0))c[m++]=G0;else return z("expecting an object but got A catch statement predicate "+Y.classString(G0))}return c.length=m,R=arguments[e],this.then(void 0,h(c,R,this))}return this.then(void 0,R)},g.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},g.prototype.then=function(R,u){if(M.warnings()&&arguments.length>0&&typeof R!=="function"&&typeof u!=="function"){var c=".then() only accepts functions but was passed: "+Y.classString(R);if(arguments.length>1)c+=", "+Y.classString(u);this._warn(c)}return this._then(R,u,void 0,void 0,void 0)},g.prototype.done=function(R,u){var c=this._then(R,u,void 0,void 0,void 0);c._setIsFinal()},g.prototype.spread=function(R){if(typeof R!=="function")return z("expecting a function but got "+Y.classString(R));return this.all()._then(R,void 0,void 0,X,void 0)},g.prototype.toJSON=function(){var R={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())R.fulfillmentValue=this.value(),R.isFulfilled=!0;else if(this.isRejected())R.rejectionReason=this.reason(),R.isRejected=!0;return R},g.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new O(this).promise()},g.prototype.error=function(R){return this.caught(Y.originatesFromRejection,R)},g.getNewLibraryCopy=Py.exports,g.is=function(R){return R instanceof g},g.fromNode=g.fromCallback=function(R){var u=new g(V);u._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,m=f(R)(k(u,c));if(m===E)u._rejectCallback(m.e,!0);if(!u._isFateSealed())u._setAsyncGuaranteed();return u},g.all=function(R){return new O(R).promise()},g.cast=function(R){var u=D(R);if(!(u instanceof g))u=new g(V),u._captureStackTrace(),u._setFulfilled(),u._rejectionHandler0=R;return u},g.resolve=g.fulfilled=g.cast,g.reject=g.rejected=function(R){var u=new g(V);return u._captureStackTrace(),u._rejectCallback(R,!0),u},g.setScheduler=function(R){if(typeof R!=="function")throw new H("expecting a function but got "+Y.classString(R));return w.setScheduler(R)},g.prototype._then=function(R,u,c,m,e){var G0=e!==void 0,M0=G0?e:new g(V),g0=this._target(),G1=g0._bitField;if(!G0){if(M0._propagateFrom(this,3),M0._captureStackTrace(),m===void 0&&(this._bitField&2097152)!==0)if((G1&50397184)!==0)m=this._boundValue();else m=g0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,M0)}var S0=J();if((G1&50397184)!==0){var $1,A0,U0=g0._settlePromiseCtx;if((G1&33554432)!==0)A0=g0._rejectionHandler0,$1=R;else if((G1&16777216)!==0)A0=g0._fulfillmentHandler0,$1=u,g0._unsetRejectionIsUnhandled();else U0=g0._settlePromiseLateCancellationObserver,A0=new W("late cancellation observer"),g0._attachExtraTrace(A0),$1=u;w.invoke(U0,g0,{handler:S0===null?$1:typeof $1==="function"&&Y.domainBind(S0,$1),promise:M0,receiver:m,value:A0})}else g0._addCallbacks(R,u,M0,m,S0);return M0},g.prototype._length=function(){return this._bitField&65535},g.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},g.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},g.prototype._setLength=function(R){this._bitField=this._bitField&-65536|R&65535},g.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},g.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},g.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},g.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},g.prototype._isFinal=function(){return(this._bitField&4194304)>0},g.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},g.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},g.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},g.prototype._setAsyncGuaranteed=function(){if(w.hasCustomScheduler())return;this._bitField=this._bitField|134217728},g.prototype._receiverAt=function(R){var u=R===0?this._receiver0:this[R*4-4+3];if(u===U)return;else if(u===void 0&&this._isBound())return this._boundValue();return u},g.prototype._promiseAt=function(R){return this[R*4-4+2]},g.prototype._fulfillmentHandlerAt=function(R){return this[R*4-4+0]},g.prototype._rejectionHandlerAt=function(R){return this[R*4-4+1]},g.prototype._boundValue=function(){},g.prototype._migrateCallback0=function(R){var{_bitField:u,_ Line truncated
`)}function g(R){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,R!==V)b(this,R),this._resolveFromExecutor(R);this._promiseCreated(),this._fireEvent("promiseCreated",this)}g.prototype.toString=function(){return"[object Promise]"},g.prototype.caught=g.prototype.catch=function(R){var u=arguments.length;if(u>1){var c=Array(u-1),m=0,e;for(e=0;e<u-1;++e){var G0=arguments[e];if(Y.isObject(G0))c[m++]=G0;else return z("expecting an object but got A catch statement predicate "+Y.classString(G0))}return c.length=m,R=arguments[e],this.then(void 0,h(c,R,this))}return this.then(void 0,R)},g.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},g.prototype.then=function(R,u){if(M.warnings()&&arguments.length>0&&typeof R!=="function"&&typeof u!=="function"){var c=".then() only accepts functions but was passed: "+Y.classString(R);if(arguments.length>1)c+=", "+Y.classString(u);this._warn(c)}return this._then(R,u,void 0,void 0,void 0)},g.prototype.done=function(R,u){var c=this._then(R,u,void 0,void 0,void 0);c._setIsFinal()},g.prototype.spread=function(R){if(typeof R!=="function")return z("expecting a function but got "+Y.classString(R));return this.all()._then(R,void 0,void 0,X,void 0)},g.prototype.toJSON=function(){var R={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())R.fulfillmentValue=this.value(),R.isFulfilled=!0;else if(this.isRejected())R.rejectionReason=this.reason(),R.isRejected=!0;return R},g.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new O(this).promise()},g.prototype.error=function(R){return this.caught(Y.originatesFromRejection,R)},g.getNewLibraryCopy=Ey.exports,g.is=function(R){return R instanceof g},g.fromNode=g.fromCallback=function(R){var u=new g(V);u._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,m=n(R)(k(u,c));if(m===j)u._rejectCallback(m.e,!0);if(!u._isFateSealed())u._setAsyncGuaranteed();return u},g.all=function(R){return new O(R).promise()},g.cast=function(R){var u=D(R);if(!(u instanceof g))u=new g(V),u._captureStackTrace(),u._setFulfilled(),u._rejectionHandler0=R;return u},g.resolve=g.fulfilled=g.cast,g.reject=g.rejected=function(R){var u=new g(V);return u._captureStackTrace(),u._rejectCallback(R,!0),u},g.setScheduler=function(R){if(typeof R!=="function")throw new H("expecting a function but got "+Y.classString(R));return w.setScheduler(R)},g.prototype._then=function(R,u,c,m,e){var G0=e!==void 0,M0=G0?e:new g(V),g0=this._target(),G1=g0._bitField;if(!G0){if(M0._propagateFrom(this,3),M0._captureStackTrace(),m===void 0&&(this._bitField&2097152)!==0)if((G1&50397184)!==0)m=this._boundValue();else m=g0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,M0)}var S0=J();if((G1&50397184)!==0){var $1,A0,U0=g0._settlePromiseCtx;if((G1&33554432)!==0)A0=g0._rejectionHandler0,$1=R;else if((G1&16777216)!==0)A0=g0._fulfillmentHandler0,$1=u,g0._unsetRejectionIsUnhandled();else U0=g0._settlePromiseLateCancellationObserver,A0=new W("late cancellation observer"),g0._attachExtraTrace(A0),$1=u;w.invoke(U0,g0,{handler:S0===null?$1:typeof $1==="function"&&Y.domainBind(S0,$1),promise:M0,receiver:m,value:A0})}else g0._addCallbacks(R,u,M0,m,S0);return M0},g.prototype._length=function(){return this._bitField&65535},g.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},g.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},g.prototype._setLength=function(R){this._bitField=this._bitField&-65536|R&65535},g.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},g.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},g.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},g.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},g.prototype._isFinal=function(){return(this._bitField&4194304)>0},g.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},g.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},g.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},g.prototype._setAsyncGuaranteed=function(){if(w.hasCustomScheduler())return;this._bitField=this._bitField|134217728},g.prototype._receiverAt=function(R){var u=R===0?this._receiver0:this[R*4-4+3];if(u===U)return;else if(u===void 0&&this._isBound())return this._boundValue();return u},g.prototype._promiseAt=function(R){return this[R*4-4+2]},g.prototype._fulfillmentHandlerAt=function(R){return this[R*4-4+0]},g.prototype._rejectionHandlerAt=function(R){return this[R*4-4+1]},g.prototype._boundValue=function(){},g.prototype._migrateCallback0=function(R){var{_bitField:u,_ Line truncated
path = %s
syscall = %s
fstream_type = %s
@@ -289,21 +289,21 @@ fstream_class = %s
fstream_stack =
%s
`,I||"UNKNOWN",q.stack,q.path,q.syscall,q.fstream_type,q.fstream_path,q.fstream_unc_path,q.fstream_class,q.fstream_stack.join(`
`));else z.emit("warn",q)};x7.prototype.info=function($,I){this.emit("info",$,I)};x7.prototype.error=function($,I,z){var q=pW0($,I,this);if(z)throw q;else this.emit("error",q)};function pW0($,I,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.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(q){return q.replace(/^ {4}at /,"")}),$}});var SK=F((Cu1,dW0)=>{dW0.exports=KK1;function KK1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var q=0,U=I.length;q<U;q++){z=I[q];var Y=$[z]||$["is"+z];if(typeof Y==="function")Y=Y.call($);if(Y)return $[z]=!0,$.type=z,z}return null}});var wu=F((hu1,mW0)=>{mW0.exports=yK;var wK1=X$(),GK1=l0(),Ku=RI();GK1(yK,Ku);function yK($){var I=this;if(!(I instanceof yK))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);Ku.call(I,$)}yK.prototype._stat=function($){var I=this;wK1.readlink(I._path,function(z,q){if(z)return I.error(z);I.linkpath=I.props.linkpath=q,I.emit("linkpath",q),Ku.prototype._stat.call(I,$)})};yK.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Hu=F((Su1,rW0)=>{rW0.exports=W5;var oW0=X$(),HK1=l0(),uK=t("path"),Gu=RI(),lW0=t("assert").ok;HK1(W5,Gu);function W5($){var I=this;if(!(I instanceof W5))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(I.entries=null,I._index=-1,I._paused=!1,I._length=-1,$.sort)this.sort=$.sort;Gu.call(this,$)}W5.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,oW0.readdir($._path,function(I,z){if(I)return $.error(I);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",q);else q();function q(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};W5.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 I=uK.resolve($._path,$.entries[$._index]);lW0(I!==$._path),lW0($.entries[$._index]),$._currentEntry=I,oW0[$.props.follow?"stat":"lstat"](I,function(z,q){if(z)return $.error(z);var U=$._proxy||$;q.path=I,q.basename=uK.basename(I),q.dirname=uK.dirname(I);var Y=$.getChildProps.call(U,q);Y.path=I,Y.basename=uK.basename(I),Y.dirname=uK.dirname(I);var J=Gu(Y,q);$._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 Q=!1;J.on("close",K),J.on("disown",K);function K(){if(Q)return;if(Q=!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))})})};W5.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};W5.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}};W5.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._currentEntry&&I._currentEntry.pause)I._currentEntry.pause($);I.emit("pause",$)};W5.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I._paused=!1,I.emit("resume",$),I._paused)return;if(I._currentEntry){if(I._currentEntry.resume)I._currentEntry.resume($)}else I._read()};W5.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var Wu=F((yu1,eW0)=>{eW0.exports=gI;var WK1=X$(),VK1=l0(),tW0=RI(),aW0={EOF:!0},sW0={CLOSE:!0};VK1(gI,tW0);function gI($){var I=this;if(!(I instanceof gI))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);I._buffer=[],I._bytesEmitted=0,tW0.call(I,$)}gI.prototype._getStream=function(){var $=this,I=$._stream=WK1.createReadStream($._path,$.pro Line truncated
`));else z.emit("warn",q)};x7.prototype.info=function($,I){this.emit("info",$,I)};x7.prototype.error=function($,I,z){var q=rW0($,I,this);if(z)throw q;else this.emit("error",q)};function rW0($,I,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.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(q){return q.replace(/^ {4}at /,"")}),$}});var yK=F((zx1,aW0)=>{aW0.exports=FK1;function FK1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var q=0,U=I.length;q<U;q++){z=I[q];var Y=$[z]||$["is"+z];if(typeof Y==="function")Y=Y.call($);if(Y)return $[z]=!0,$.type=z,z}return null}});var Hu=F((qx1,sW0)=>{sW0.exports=uK;var NK1=X$(),MK1=l0(),Gu=gI();MK1(uK,Gu);function uK($){var I=this;if(!(I instanceof uK))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);Gu.call(I,$)}uK.prototype._stat=function($){var I=this;NK1.readlink(I._path,function(z,q){if(z)return I.error(z);I.linkpath=I.props.linkpath=q,I.emit("linkpath",q),Gu.prototype._stat.call(I,$)})};uK.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Vu=F((Ux1,IV0)=>{IV0.exports=W5;var $V0=X$(),AK1=l0(),xK=t("path"),Wu=gI(),eW0=t("assert").ok;AK1(W5,Wu);function W5($){var I=this;if(!(I instanceof W5))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(I.entries=null,I._index=-1,I._paused=!1,I._length=-1,$.sort)this.sort=$.sort;Wu.call(this,$)}W5.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,$V0.readdir($._path,function(I,z){if(I)return $.error(I);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",q);else q();function q(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};W5.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 I=xK.resolve($._path,$.entries[$._index]);eW0(I!==$._path),eW0($.entries[$._index]),$._currentEntry=I,$V0[$.props.follow?"stat":"lstat"](I,function(z,q){if(z)return $.error(z);var U=$._proxy||$;q.path=I,q.basename=xK.basename(I),q.dirname=xK.dirname(I);var Y=$.getChildProps.call(U,q);Y.path=I,Y.basename=xK.basename(I),Y.dirname=xK.dirname(I);var J=Wu(Y,q);$._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 Q=!1;J.on("close",K),J.on("disown",K);function K(){if(Q)return;if(Q=!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))})})};W5.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};W5.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}};W5.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._currentEntry&&I._currentEntry.pause)I._currentEntry.pause($);I.emit("pause",$)};W5.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I._paused=!1,I.emit("resume",$),I._paused)return;if(I._currentEntry){if(I._currentEntry.resume)I._currentEntry.resume($)}else I._read()};W5.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var Zu=F((Yx1,YV0)=>{YV0.exports=_I;var PK1=X$(),TK1=l0(),zV0=gI(),qV0={EOF:!0},UV0={CLOSE:!0};TK1(_I,zV0);function _I($){var I=this;if(!(I instanceof _I))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);I._buffer=[],I._bytesEmitted=0,zV0.call(I,$)}_I.prototype._getStream=function(){var $=this,I=$._stream=PK1.createReadStream($._path,$.pro Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(sW0),$._read();else $.emit("close")}),I.on("error",function(z){$.emit("error",z)}),$._read()};gI.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var z=0,q=I.length;z<q;z++){var U=I[z];if(U===aW0)$.emit("end");else if(U===sW0)$.emit("close");else $.emit("data",U);if($._paused){$._buffer=I.slice(z);return}}$._buffer.length=0}};gI.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};gI.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I.emit("resume",$),I._paused=!1,I._stream)I._stream.resume();I._read()}});var zV0=F((uu1,IV0)=>{IV0.exports=TD;var ZK1=l0(),$V0=RI();ZK1(TD,$V0);function TD($){var I=this;if(!(I instanceof TD))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);$V0.call(I,$)}TD.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Zu=F((xu1,qV0)=>{qV0.exports=_I;var Vu=RI(),XK1=SK(),LK1=l0(),DK1=X$();LK1(_I,Vu);function _I($){var I=this;if(!(I instanceof _I))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,Vu.call(I,$)}_I.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";DK1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=XK1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Vu(I,U))})};_I.prototype._addProxy=function($){var I=this;if(I._proxyTarget)return I.error("proxy already set");I._proxyTarget=$,$._proxy=I,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var z=I._buffer;I._buffer.length=0,z.forEach(function(q){$[q[0]].apply($,q[1])})};_I.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};_I.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var RI=F((ku1,JV0)=>{JV0.exports=C8;var OK1=X$(),FK1=t("stream").Stream,NK1=l0(),Xu=t("path"),Lu=SK(),ED=C8.hardLinks={},UV0=PD();NK1(C8,UV0);var YV0=wu();function C8($,I){var z=this;if(!(z instanceof C8))return new C8($,I);if(typeof $==="string")$={path:$};var q,U;if($.type&&typeof $.type==="function")q=$.type,U=q;else q=Lu($),U=C8;if(I&&!q)q=Lu(I),$[q]=!0,$.type=q;switch(q){case"Directory":U=Hu();break;case"Link":case"File":U=Wu();break;case"SymbolicLink":U=YV0;break;case"Socket":U=zV0();break;case null:U=Zu();break}if(!(z instanceof U))return new U($);if(UV0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=q,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=Xu.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=Xu.basename(z.path),z.dirname=$.dirname=Xu.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=MK1;z._stat(I)}function MK1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}C8.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else OK1[q](I._path,U);function U(Y,J){if(Y)return I.error(Y);if(Object.keys(J).forEach(function(V){z[V]=J[V]}),I.size!==void 0&&z.size!==I.size)return I.error("incorrect size");I.size=z.size;var Q=Lu(z),K=z.hardlinks!==!1;if(K&&Q!=="Directory"&&z.nlink&&z.nlink>1){var w=z.dev+":"+z.ino;if(ED[w]===I._path||!ED[w])ED[w]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=ED[w],I._stat=I._read=YV0.prototype._read}if(I.type&&I.type!==Q)I.error("Unexpected type: "+Q);if(I.filter){var G=I._proxy||I;if(!I.filter.call(G,G,z)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var H=["_stat","stat","ready"],W=0;(function V(){if(I._aborted){I.emit("end"),I.emit("close");return}if(I._paused&&I.type!=="Directory"){I.once("resume",V);return}var X=H[W++];if(!X)return I._read();I.emit(X,z),V()})()}};C8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(z){var q=$.add(z);if(q===!1)I.pause()});return FK1.prototype.pipe.apply(this,arguments)};C8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};C8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};C8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Nu=F((fu1,ZV0)=>{Z Line truncated
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(UV0),$._read();else $.emit("close")}),I.on("error",function(z){$.emit("error",z)}),$._read()};_I.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var z=0,q=I.length;z<q;z++){var U=I[z];if(U===qV0)$.emit("end");else if(U===UV0)$.emit("close");else $.emit("data",U);if($._paused){$._buffer=I.slice(z);return}}$._buffer.length=0}};_I.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};_I.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I.emit("resume",$),I._paused=!1,I._stream)I._stream.resume();I._read()}});var KV0=F((Jx1,QV0)=>{QV0.exports=ED;var EK1=l0(),JV0=gI();EK1(ED,JV0);function ED($){var I=this;if(!(I instanceof ED))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);JV0.call(I,$)}ED.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Lu=F((Qx1,wV0)=>{wV0.exports=CI;var Xu=gI(),BK1=yK(),jK1=l0(),vK1=X$();jK1(CI,Xu);function CI($){var I=this;if(!(I instanceof CI))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,Xu.call(I,$)}CI.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";vK1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=BK1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Xu(I,U))})};CI.prototype._addProxy=function($){var I=this;if(I._proxyTarget)return I.error("proxy already set");I._proxyTarget=$,$._proxy=I,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var z=I._buffer;I._buffer.length=0,z.forEach(function(q){$[q[0]].apply($,q[1])})};CI.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};CI.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var gI=F((Kx1,WV0)=>{WV0.exports=C8;var RK1=X$(),gK1=t("stream").Stream,_K1=l0(),Du=t("path"),Ou=yK(),BD=C8.hardLinks={},GV0=TD();_K1(C8,GV0);var HV0=Hu();function C8($,I){var z=this;if(!(z instanceof C8))return new C8($,I);if(typeof $==="string")$={path:$};var q,U;if($.type&&typeof $.type==="function")q=$.type,U=q;else q=Ou($),U=C8;if(I&&!q)q=Ou(I),$[q]=!0,$.type=q;switch(q){case"Directory":U=Vu();break;case"Link":case"File":U=Zu();break;case"SymbolicLink":U=HV0;break;case"Socket":U=KV0();break;case null:U=Lu();break}if(!(z instanceof U))return new U($);if(GV0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=q,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=Du.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=Du.basename(z.path),z.dirname=$.dirname=Du.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=CK1;z._stat(I)}function CK1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}C8.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else RK1[q](I._path,U);function U(Y,J){if(Y)return I.error(Y);if(Object.keys(J).forEach(function(V){z[V]=J[V]}),I.size!==void 0&&z.size!==I.size)return I.error("incorrect size");I.size=z.size;var Q=Ou(z),K=z.hardlinks!==!1;if(K&&Q!=="Directory"&&z.nlink&&z.nlink>1){var w=z.dev+":"+z.ino;if(BD[w]===I._path||!BD[w])BD[w]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=BD[w],I._stat=I._read=HV0.prototype._read}if(I.type&&I.type!==Q)I.error("Unexpected type: "+Q);if(I.filter){var G=I._proxy||I;if(!I.filter.call(G,G,z)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var H=["_stat","stat","ready"],W=0;(function V(){if(I._aborted){I.emit("end"),I.emit("close");return}if(I._paused&&I.type!=="Directory"){I.once("resume",V);return}var X=H[W++];if(!X)return I._read();I.emit(X,z),V()})()}};C8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(z){var q=$.add(z);if(q===!1)I.pause()});return gK1.prototype.pipe.apply(this,arguments)};C8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};C8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};C8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Au=F((wx1,NV0)=>{N Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);uD.prototype._finish.call($)}});var _u=F((qx1,qZ0)=>{qZ0.exports=i7;var gu=cU(),oK1=SK(),rK1=l0(),tK1=SD(),aK1=t("fs");rK1(i7,gu);function i7($){var I=this;if(!(I instanceof i7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,gu.call(I,$)}i7.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";aK1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=oK1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(gu(I,U))})};i7.prototype._addProxy=function($){var I=this;if(I._proxy)return I.error("proxy already set");I._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$);var z=I._buffer;if(z.forEach(function(q){$[q[0]].apply($,q[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};i7.prototype.add=function($){if(tK1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};i7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};i7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var cU=F((Ux1,WZ0)=>{WZ0.exports=J8;var Y8=X$(),sK1=l0(),eK1=Nu(),$w1=Eu(),bK=t("path"),YZ0=process.platform==="win32"?0:process.umask(),JZ0=SK(),QZ0=PD();sK1(J8,QZ0);J8.dirmode=parseInt("0777",8)&~YZ0;J8.filemode=parseInt("0666",8)&~YZ0;var Iw1=ju(),zw1=vu(),qw1=Ru(),Uw1=_u();function J8($,I){var z=this;if(typeof $==="string")$={path:$};var q=JZ0($),U=J8;switch(q){case"Directory":U=Iw1;break;case"File":U=qw1;break;case"Link":case"SymbolicLink":U=zw1;break;case null:default:U=Uw1;break}if(!(z instanceof U))return new U($);if(QZ0.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=bK.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=bK.basename($.path),z.dirname=bK.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(I)}J8.prototype._create=function(){var $=this;Y8[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};J8.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat",U=I._proxy||I;if($)Y(null,$);else Y8[q](I._path,Y);function Y(J,Q){if(I.filter&&!I.filter.call(U,U,Q)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(J||!Q)return Cu(I);I._old=Q;var K=JZ0(Q);if(K!==I.type||I.type==="File"&&Q.nlink>1)return eK1(I._path,function(w){if(w)return I.error(w);I._old=null,Cu(I)});Cu(I)}};function Cu($){$w1(bK.dirname($._path),J8.dirmode,function(I,z){if(I)return $.error(I);return $._madeDir=z,$._create()})}function KZ0($,I,z,q,U){var Y=I.mode,J=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!Y8[J])return U();if(typeof Y!=="number")return U();var Q=z.mode&parseInt("0777",8);if(Y=Y&parseInt("0777",8),Y===Q)return U();Y8[J](q,Y,U)}function wZ0($,I,z,q,U){if(process.platform==="win32")return U();if(!process.getuid||process.getuid()!==0)return U();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return U();if(z.uid===I.uid&&z.gid===I.gid)return U();var Y=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!Y8[Y])return U();if(typeof I.uid!=="number")I.uid=z.uid;if(typeof I.gid!=="number")I.gid=z.gid;Y8[Y](q,I.uid,I.gid,U)}function GZ0($,I,z,q,U){if(!Y8.utimes||process.platform==="win32")return U();var Y=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Y==="lutimes"&&!Y8[Y])Y="utimes";if(!Y8[Y])return U();var{atime:J,mtime:Q}=z,K=I.atime,w=I.mtime;if(K===void 0)K=J;if(w===void 0)w=Q;if(!UZ0(K))K=new Date(K);if(!UZ0(w))K=new Date(w);if(K.getTime()===J.getTime()&&w.getTime()===Q.getTime())return U();Y8[Y](q,K,w,U)}J8.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,z=null,q=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Y($._old);else{var U=$.props.follow?"stat":"lstat";Y8[U]($._path,function(Q,K){if(Q)if(Q.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(Q);Y($._old=K)})}return;function Y(Q){I+=3,KZ0($,$.props,Q,$._path,J("chmod")),wZ0($,$.props,Q,$._path,J("chown")),GZ0($,$.props,Q,$._path,J("utimes"))}function J(Q){return function(K){if(z)return;if(K)return K.fstream_finish_call=Q,$.error(z=K);if(--I>0)return;if(q)return;if(q=!0,!$._madeDir)return w();else HZ0($,$._path,w);function w(G){if(G)return G.fstream_finish_call="setupMadeDir",$.error(G);$.emit("end"),$.emit("close")}}}};function HZ0($,I,z){var q=$._madeDir,U=bK.dirname(I);Yw1($,U,function(Y){if(Y)return z(Y);if(U===q)return z();HZ0($,U,z)})}function Yw1($,I,z){var q={};Object.keys($.props).forEach(function(Q){if(q[Q]=$.props[Q],Q==="mode"&&$.type!=="Directory")q[Q]=q[Q]|parseInt("0111",8)});var U=3,Y=null;Y8.stat(I,function(Q,K){if(Q)return z(Y=Q);KZ0($,q,K,I,J),wZ0($,q,K,I,J),GZ0($,q,K,I,J)});function J(Q){if(Y)return;if(Q)return z(Y=Q);if(--U===0)return z()}}J8.prototype.pipe=function(){this.error("Can't pipe from writable stream")};J8.prototype.add=function(){this.error("Can't add to non-Directory type")};J8.prototype.write=function(){return!0};function Jw1($){return Object.prototype.toString.call($)}function UZ0($){return typeof $==="object"&&Jw1($)==="[object Date]"}});var xu=F((Qw1)=>{Qw1.Abstract=PD();Qw1.Reader=RI();Qw1.Writer=cU();Qw1.File={Reader:Wu(),Writer:Ru()};Qw1.Dir={Reader:Hu(),Writer:ju()};Qw1.Link={Reader:wu(),Writer:vu()};Qw1.Proxy={Reader:Zu(),Writer:_u()};Qw1.Reader.Dir=Qw1.DirReader=Qw1.Dir.Reader;Qw1.Reader.File=Qw1.FileReader=Qw1.File.Reader;Qw1.Reader.Link=Qw1.LinkReader=Qw1.Link.Reader;Qw1.Reader.Proxy=Qw1.ProxyReader=Qw1.Proxy.Reader;Qw1.Writer.Dir=Qw1.DirWriter=Qw1.Dir.Writer;Qw1.Writer.File=Qw1.FileWriter=Qw1.File.Writer;Qw1.Writer.Link=Qw1.LinkWriter=Qw1.Link.Writer;Qw1.Writer.Proxy=Qw1.ProxyWriter=Qw1.Proxy.Writer;Qw1.collect=SD()});var ZZ0=F((Zx1,VZ0)=>{VZ0.exports=Xw1;var Gw1=ZD(),Hw1=xu().Writer,ku=t("path"),Ww1=t("stream"),Vw1=Ju(),Zw1=y7();function Xw1($){$.path=ku.resolve(ku.normalize($.path));var I=new Gw1($),z=new Ww1.Writable({objectMode:!0});z._write=function(U,Y,J){if(U.type=="Directory")return J();var Q=ku.join($.path,U.path);if(Q.indexOf($.path)!=0)return J();let K=$.getWriter?$.getWriter({path:Q}):Hw1({path:Q});U.pipe(K).on("error",J).on("close",J)};var q=Vw1(I,z);return I.once("crx-header",function(U){q.crxHeader=U}),I.pipe(z).on("finish",function(){q.emit("close")}),q.promise=function(){return new Zw1(function(U,Y){q.on("close",U),q.on("error",Y)})},q}});var XZ0=F((Xx1,xD)=>{var o4=function($){var I=1e7,z=7,q=9007199254740992,U=W(q),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(N,P,S,i){if(typeof N>"u")return Q[0];if(typeof P<"u")return+P===10&&!S?R0(N):$$(N,P,S,i);return R0(N)}function K(N,P){this.value=N,this.sign=P,this.isSmall=!1}K.prototype=Object.create(Q.prototype);function w(N){this.value=N,this.sign=N<0,this.isSmall=!0}w.prototype=Object.create(Q.prototype);function G(N){th Line truncated
actual: `+$._bytesWritten);xD.prototype._finish.call($)}});var hu=F((jx1,wZ0)=>{wZ0.exports=i7;var Cu=dU(),Yw1=yK(),Jw1=l0(),Qw1=yD(),Kw1=t("fs");Jw1(i7,Cu);function i7($){var I=this;if(!(I instanceof i7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,Cu.call(I,$)}i7.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";Kw1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=Yw1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Cu(I,U))})};i7.prototype._addProxy=function($){var I=this;if(I._proxy)return I.error("proxy already set");I._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(q){$.on(q,I.emit.bind(I,q))}),I.emit("proxy",$);var z=I._buffer;if(z.forEach(function(q){$[q[0]].apply($,q[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};i7.prototype.add=function($){if(Qw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};i7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};i7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var dU=F((vx1,OZ0)=>{OZ0.exports=J8;var Y8=X$(),ww1=l0(),Gw1=Au(),Hw1=ju(),nK=t("path"),HZ0=process.platform==="win32"?0:process.umask(),WZ0=yK(),VZ0=TD();ww1(J8,VZ0);J8.dirmode=parseInt("0777",8)&~HZ0;J8.filemode=parseInt("0666",8)&~HZ0;var Ww1=Ru(),Vw1=gu(),Zw1=_u(),Xw1=hu();function J8($,I){var z=this;if(typeof $==="string")$={path:$};var q=WZ0($),U=J8;switch(q){case"Directory":U=Ww1;break;case"File":U=Zw1;break;case"Link":case"SymbolicLink":U=Vw1;break;case null:default:U=Xw1;break}if(!(z instanceof U))return new U($);if(VZ0.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=nK.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=nK.basename($.path),z.dirname=nK.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(I)}J8.prototype._create=function(){var $=this;Y8[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};J8.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat",U=I._proxy||I;if($)Y(null,$);else Y8[q](I._path,Y);function Y(J,Q){if(I.filter&&!I.filter.call(U,U,Q)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(J||!Q)return Su(I);I._old=Q;var K=WZ0(Q);if(K!==I.type||I.type==="File"&&Q.nlink>1)return Gw1(I._path,function(w){if(w)return I.error(w);I._old=null,Su(I)});Su(I)}};function Su($){Hw1(nK.dirname($._path),J8.dirmode,function(I,z){if(I)return $.error(I);return $._madeDir=z,$._create()})}function ZZ0($,I,z,q,U){var Y=I.mode,J=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!Y8[J])return U();if(typeof Y!=="number")return U();var Q=z.mode&parseInt("0777",8);if(Y=Y&parseInt("0777",8),Y===Q)return U();Y8[J](q,Y,U)}function XZ0($,I,z,q,U){if(process.platform==="win32")return U();if(!process.getuid||process.getuid()!==0)return U();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return U();if(z.uid===I.uid&&z.gid===I.gid)return U();var Y=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!Y8[Y])return U();if(typeof I.uid!=="number")I.uid=z.uid;if(typeof I.gid!=="number")I.gid=z.gid;Y8[Y](q,I.uid,I.gid,U)}function LZ0($,I,z,q,U){if(!Y8.utimes||process.platform==="win32")return U();var Y=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Y==="lutimes"&&!Y8[Y])Y="utimes";if(!Y8[Y])return U();var{atime:J,mtime:Q}=z,K=I.atime,w=I.mtime;if(K===void 0)K=J;if(w===void 0)w=Q;if(!GZ0(K))K=new Date(K);if(!GZ0(w))K=new Date(w);if(K.getTime()===J.getTime()&&w.getTime()===Q.getTime())return U();Y8[Y](q,K,w,U)}J8.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,z=null,q=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Y($._old);else{var U=$.props.follow?"stat":"lstat";Y8[U]($._path,function(Q,K){if(Q)if(Q.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(Q);Y($._old=K)})}return;function Y(Q){I+=3,ZZ0($,$.props,Q,$._path,J("chmod")),XZ0($,$.props,Q,$._path,J("chown")),LZ0($,$.props,Q,$._path,J("utimes"))}function J(Q){return function(K){if(z)return;if(K)return K.fstream_finish_call=Q,$.error(z=K);if(--I>0)return;if(q)return;if(q=!0,!$._madeDir)return w();else DZ0($,$._path,w);function w(G){if(G)return G.fstream_finish_call="setupMadeDir",$.error(G);$.emit("end"),$.emit("close")}}}};function DZ0($,I,z){var q=$._madeDir,U=nK.dirname(I);Lw1($,U,function(Y){if(Y)return z(Y);if(U===q)return z();DZ0($,U,z)})}function Lw1($,I,z){var q={};Object.keys($.props).forEach(function(Q){if(q[Q]=$.props[Q],Q==="mode"&&$.type!=="Directory")q[Q]=q[Q]|parseInt("0111",8)});var U=3,Y=null;Y8.stat(I,function(Q,K){if(Q)return z(Y=Q);ZZ0($,q,K,I,J),XZ0($,q,K,I,J),LZ0($,q,K,I,J)});function J(Q){if(Y)return;if(Q)return z(Y=Q);if(--U===0)return z()}}J8.prototype.pipe=function(){this.error("Can't pipe from writable stream")};J8.prototype.add=function(){this.error("Can't add to non-Directory type")};J8.prototype.write=function(){return!0};function Dw1($){return Object.prototype.toString.call($)}function GZ0($){return typeof $==="object"&&Dw1($)==="[object Date]"}});var fu=F((Ow1)=>{Ow1.Abstract=TD();Ow1.Reader=gI();Ow1.Writer=dU();Ow1.File={Reader:Zu(),Writer:_u()};Ow1.Dir={Reader:Vu(),Writer:Ru()};Ow1.Link={Reader:Hu(),Writer:gu()};Ow1.Proxy={Reader:Lu(),Writer:hu()};Ow1.Reader.Dir=Ow1.DirReader=Ow1.Dir.Reader;Ow1.Reader.File=Ow1.FileReader=Ow1.File.Reader;Ow1.Reader.Link=Ow1.LinkReader=Ow1.Link.Reader;Ow1.Reader.Proxy=Ow1.ProxyReader=Ow1.Proxy.Reader;Ow1.Writer.Dir=Ow1.DirWriter=Ow1.Dir.Writer;Ow1.Writer.File=Ow1.FileWriter=Ow1.File.Writer;Ow1.Writer.Link=Ow1.LinkWriter=Ow1.Link.Writer;Ow1.Writer.Proxy=Ow1.ProxyWriter=Ow1.Proxy.Writer;Ow1.collect=yD()});var NZ0=F((kx1,FZ0)=>{FZ0.exports=Bw1;var Mw1=XD(),Aw1=fu().Writer,bu=t("path"),Pw1=t("stream"),Tw1=Ku(),Ew1=y7();function Bw1($){$.path=bu.resolve(bu.normalize($.path));var I=new Mw1($),z=new Pw1.Writable({objectMode:!0});z._write=function(U,Y,J){if(U.type=="Directory")return J();var Q=bu.join($.path,U.path);if(Q.indexOf($.path)!=0)return J();let K=$.getWriter?$.getWriter({path:Q}):Aw1({path:Q});U.pipe(K).on("error",J).on("close",J)};var q=Tw1(I,z);return I.once("crx-header",function(U){q.crxHeader=U}),I.pipe(z).on("finish",function(){q.emit("close")}),q.promise=function(){return new Ew1(function(U,Y){q.on("close",U),q.on("error",Y)})},q}});var MZ0=F((fx1,kD)=>{var o4=function($){var I=1e7,z=7,q=9007199254740992,U=W(q),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(N,P,S,i){if(typeof N>"u")return Q[0];if(typeof P<"u")return+P===10&&!S?R0(N):$$(N,P,S,i);return R0(N)}function K(N,P){this.value=N,this.sign=P,this.isSmall=!1}K.prototype=Object.create(Q.prototype);function w(N){this.value=N,this.sign=N<0,this.isSmall=!0}w.prototype=Object.create(Q.prototype);function G(N){th Line truncated
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var d1=t("fs"),pD=t("os"),r4=t("path"),vZ0=t("crypto"),V5={fs:d1.constants,os:pD.constants},CZ0=/XXXXXX/,hZ0=(V5.O_CREAT||V5.fs.O_CREAT)|(V5.O_EXCL||V5.fs.O_EXCL)|(V5.O_RDWR||V5.fs.O_RDWR),fw1=pD.platform()==="win32",bw1=V5.EBADF||V5.os.errno.EBADF,nw1=V5.ENOENT||V5.os.errno.ENOENT,mU=[],SZ0=d1.rmdirSync.bind(d1),yZ0=!1;function iw1($,I){return d1.rm($,{recursive:!0},I)}function uZ0($){return d1.rmSync($,{recursive:!0})}function pu($,I){let z=lU($,I),q=z[0],U=z[1];sw1(q,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function K(){try{let w=kZ0(J);d1.stat(w,function(G){if(!G){if(Q-- >0)return K();return U(Error("Could not get a unique tmp filename, max tries reached "+w))}U(null,w)})}catch(w){U(w)}})()})}function cu($){let I=lU($),z=I[0],q=ew1(z),U=q.tries;do{let Y=kZ0(q);try{d1.statSync(Y)}catch(J){return Y}}while(U-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function pw1($,I){let z=lU($,I),q=z[0],U=z[1];pu(q,function(J,Q){if(J)return U(J);d1.open(Q,hZ0,q.mode||384,function(w,G){if(w)return U(w);if(q.discardDescriptor)return d1.close(G,function(W){return U(W,Q,void 0,nu(Q,-1,q,!1))});else{let H=q.discardDescriptor||q.detachDescriptor;U(null,Q,G,nu(Q,H?-1:G,q,!1))}})})}function cw1($){let I=lU($),z=I[0],q=z.discardDescriptor||z.detachDescriptor,U=cu(z),Y=d1.openSync(U,hZ0,z.mode||384);if(z.discardDescriptor)d1.closeSync(Y),Y=void 0;return{name:U,fd:Y,removeCallback:nu(U,q?-1:Y,z,!0)}}function dw1($,I){let z=lU($,I),q=z[0],U=z[1];pu(q,function(J,Q){if(J)return U(J);d1.mkdir(Q,q.mode||448,function(w){if(w)return U(w);U(null,Q,xZ0(Q,q,!1))})})}function mw1($){let I=lU($),z=I[0],q=cu(z);return d1.mkdirSync(q,z.mode||448),{name:q,removeCallback:xZ0(q,z,!0)}}function lw1($,I){let z=function(q){if(q&&!iu(q))return I(q);I()};if(0<=$[0])d1.close($[0],function(){d1.unlink($[1],z)});else d1.unlink($[1],z)}function ow1($){let I=null;try{if(0<=$[0])d1.closeSync($[0])}catch(z){if(!$G1(z)&&!iu(z))throw z}finally{try{d1.unlinkSync($[1])}catch(z){if(!iu(z))I=z}}if(I!==null)throw I}function nu($,I,z,q){let U=iD(ow1,[I,$],q),Y=iD(lw1,[I,$],q,U);if(!z.keep)mU.unshift(U);return q?U:Y}function xZ0($,I,z){let q=I.unsafeCleanup?iw1:d1.rmdir.bind(d1),U=I.unsafeCleanup?uZ0:SZ0,Y=iD(U,$,z),J=iD(q,$,z,Y);if(!I.keep)mU.unshift(Y);return z?Y:J}function iD($,I,z,q){let U=!1;return function Y(J){if(!U){let Q=q||Y,K=mU.indexOf(Q);if(K>=0)mU.splice(K,1);if(U=!0,z||$===SZ0||$===uZ0)return $(I);else return $(I,J||function(){})}}}function rw1(){if(!yZ0)return;while(mU.length)try{mU[0]()}catch($){}}function RZ0($){let I=[],z=null;try{z=vZ0.randomBytes($)}catch(q){z=vZ0.pseudoRandomBytes($)}for(let q=0;q<$;q++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[q]%62]);return I.join("")}function D$($){return typeof $>"u"}function lU($,I){if(typeof $==="function")return[{},$];if(D$($))return[{},I];let z={};for(let q of Object.getOwnPropertyNames($))z[q]=$[q];return[z,I]}function tw1($,I,z){let q=r4.isAbsolute($)?$:r4.join(I,$);d1.stat(q,function(U){if(U)d1.realpath(r4.dirname(q),function(Y,J){if(Y)return z(Y);z(null,r4.join(J,r4.basename(q)))});else d1.realpath(q,z)})}function aw1($,I){let z=r4.isAbsolute($)?$:r4.join(I,$);try{return d1.statSync(z),d1.realpathSync(z)}catch(q){let U=d1.realpathSync(r4.dirname(z));return r4.join(U,r4.basename(z))}}function kZ0($){let I=$.tmpdir;if(!D$($.name))return r4.join(I,$.dir,$.name);if(!D$($.template))return r4.join(I,$.dir,$.template).replace(CZ0,RZ0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",RZ0(12),$.postfix?"-"+$.postfix:""].join("");return r4.join(I,$.dir,z)}function bu($,I){if(typeof I!=="string")throw Error(`${$} option must be a string, got "${typeof I}".`);if(I.includes(".."))throw Error("Relative value not allowed");return I}function fZ0($){if(!D$($.name)){let I=$.name;if(r4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let z=r4.basename(I);if(z===".."||z==="."||z!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!D$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(CZ0))throw Error(`Invalid template, found "${$.template}".`)}if(!D$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=D$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=D$($.prefix)?"":bu("prefix",$.prefix),$.postfix=D$($.postfix)?"":bu("postfix",$.postfix),$.template=D$($.template)?void 0:bu("template",$.template)}function gZ0($,I,z,q){if(D$(I))return q(null);tw1(I,z,function(U,Y){if(U)return q(U);let J=r4.relative(z,Y);if(J.startsWith("..")||r4.isAbsolute(J))return q(Error(`${$} option must be relative to "${z}", found "${J}".`));q(null,J)})}function _Z0($,I,z){if(D$(I))return;let q=aw1(I,z),U=r4.relative(z,q);if(U.startsWith("..")||r4.isAbsolute(U))throw ELine truncated
`,{mode:384}),I}function qx($){let I=TX0();for(let z of I){if(!x$(z))continue;for(let q of aD(z).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=Z5(z,q);try{let Y=eD(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function c7($,I){let z=qx($);if(!z)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(eD(z,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=eu.parse(U);return OX0(z,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}var Ix="SEAL_USE_ENTERPRISES_DIR",FX0="SEAL_HOME_ENTERPRISES_DIR",NX0="SEAL_USE_USER_ENTERPRISES_DIR",MX0="SEAL_HOME_USER_ENTERPRISES_DIR",AX0="SEAL_USE_CONFIG_FILE",PX0="SEAL_HOME_CONFIG_FILE",rU,sD,tD,LX0;var G9=K0(()=>{$x();rU=Z5($O(),".config","seal-use","enterprises"),sD=Z5($O(),".config","seal-home","enterprises"),tD=Z5($O(),".config","seal-use","config.json"),LX0=Z5($O(),".config","seal-home","config.json")});function d7($,I,z=[]){let q=I.corpId?.trim()||void 0,U=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,Y=q??U;if(Y){let Q=$.find((G)=>G.id===Y);if(Q)return Q;let K=$.find((G)=>G.id.toLowerCase()===Y.toLowerCase());if(K)return K;let w=$.find((G)=>G.name.toLowerCase()===Y.toLowerCase());if(w)return w;throw Error(`No enterprise config found for ${Y}`)}if(!I.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"))}function $H1($,I){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>I?z:z.toLowerCase())}function IH1($,I){return I?$:$.toLowerCase()}function zH1($,I,z,q){let U=IH1($,q),Y=I.filter((J)=>U.includes(J));if(z==="all"&&Y.length!==I.length)return[];return Y}function qH1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function UH1($,I){if(I.fields&&!I.fields.has($.field))return[];let z=qH1($.value),q=[];return z.forEach((U,Y)=>{let J=zH1(U,I.keywords,I.matchMode,I.caseSensitive);if(J.length===0)return;let Q=Math.max(0,Y-I.contextLines),K=Math.min(z.length,Y+I.contextLines+1),w={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Y+1,matchedKeywords:J,matchedText:IO(U,I.maxChars),context:{before:I.snippetOnly?[]:z.slice(Q,Y).map((G)=>IO(G,I.maxChars)),line:IO(U,I.maxChars),after:I.snippetOnly?[]:z.slice(Y+1,K).map((G)=>IO(G,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)w.context={before:[],line:w.context.line,after:[]};q.push(w)}),q}function IO($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function YH1($){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 BX0($){return $.rules.flatMap((I,z)=>{let q=`${$.id}:${I.description.slice(0,32)}`,U={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:I.scope,strictness:I.strictness,code:"code"in I?I.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:q,title:`${$.versionName} / ${I.scope}`,field:"history.description",value:I.description,metadata:U},{area:"rules",entityType:"rule",entityId:q,title:`${$.versionName} / ${I.scope}`,field:"history.scope",value:I.scope,metadata:U}]})}function JH1($){return[{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"title",value:$.title,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"purpose",value:$.purpose,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"content",value:$.content,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}}]}function QH1($){let I=[];if($.decisionPreferences)for(let[z,q]of Object.entries($.decisionPreferences))I.push({area:"preferences",entityType:"preference",field:`decisionPreferences.${z}`,value:q,metadata:{integrationSystem:$.integrationSystem}});return $.integrations.forEach((z,q)=>{I.push({area:"preferences",entityType:"integration",title:z.outboundName,field:`integrations[${q}]`,value:z,metadata:{type:z.type,outboundName:z.outboundName,mode:z.mode,corporationId:z.corporationId}})}),I}async function KH1($,I,z){let q=z.ruleVersionScope??"current",U=[I.id,`ruleVersionScope=${q}`,`ruleVersionId=${z.ruleVersionId??""}`,`ruleVersionNumber=${z.ruleVersionNumber??""}`,`latestRuleVersion=${z.latestRuleVersion??!1}`,`documentLimit=${z.documentLimit??100}`].join("|"),Y=EX0.get(U);if(!z.refresh&&Y&&Date.now()<Y.expiresAt)return Y;let[J,Q,K]=await Promise.all([wH1($,{scope:q,versionId:z.ruleVersionId,versionNumber:z.ruleVersionNumber,latest:z.latestRuleVersion}),d9($,{limit:z.documentLimit??100}),E1($,I.seal.endpoints.approvalStylePreferences)]),w=Date.now(),G={entries:[...J,...Q.articles.flatMap(JH1),...QH1(K)],fetchedAt:w,expiresAt:w+jX0};return EX0.set(U,G),G}async function wH1($,I){if(I.scope==="current")return(await W6($)).rules.flatMap(YH1);if(I.scope==="version"){let q=await GH1($,I);return BX0(q)}r Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==q.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:q}}async function Jx($,I,z){let q=I.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",U=await v$($,q);if(z||U.length>0)return _X0(U,z,I.id);if(I.environment==="test"||I.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${I.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let Y=(I.seal.url??I.source?.sealUrl??`https://${I.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await oW($,Y,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${Y}/api/v1/integrations/webhook/replay-mock-callback`},I.seal.endpoints.approvalStylePreferences)}throw new N4(`当前租户「${I.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${I.id}`)}async function tU($){let{query:I,sourceClient:z,targetClient:q,sourceCorp:U,targetCorp:Y,webhookSelector:J,snPrefix:Q,snSuffix:K,docIdPrefix:w,docIdSuffix:G,dryRun:H,fetchFn:W=fetch}=$,V=[];if(I.recordId){let v=await X4(z,I.recordId);V.push(v)}else if(I.recordIds&&I.recordIds.length>0)for(let v of I.recordIds)V.push(await X4(z,v));else if(I.sn){let v=await s4(z,{sourceDocumentSN:I.sn,limit:1});if(!v.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${I.sn}」的审批记录。`);V.push(v.records[0])}else if(I.sns&&I.sns.length>0)for(let v of I.sns){let x=await s4(z,{sourceDocumentSN:v,limit:1});if(!x.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${v}」的审批记录。`);V.push(x.records[0])}else if(I.limit!==void 0){let v=await s4(z,{limit:I.limit,status:I.status,startDate:I.startDate,endDate:I.endDate});if(!v.records.length)throw Error(`在企业「${U.name}」中未检索到符合条件的审批记录。`);V=v.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 X=V.map((v)=>({run:v,doc:Ux(v,{snPrefix:Q,snSuffix:K,docIdPrefix:w,docIdSuffix:G})}));if(H){let v={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Y.seal.url}/api/v1/integrations/webhook/preview`};try{let k=await v$(q,Y.seal.endpoints.approvalStylePreferences);if(k.length>0){let E=_X0(k,J,Y.id);v={id:E.id,name:E.name,mode:E.mode,incomingDocumentWebhookUrl:E.incomingDocumentWebhook.url}}}catch{}let x=X.map(({run:k,doc:E})=>({originalRecord:{id:k.id,sourceSystem:k.sourceSystem,sourceDocumentSN:k.sourceDocumentSN,sourceDocumentId:k.sourceDocumentId},document:E,success:!0})),h=x.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:v,totalCount:x.length,successCount:x.length,failureCount:0,originalRecord:h?x[0].originalRecord:void 0,document:h?x[0].document:void 0,records:x}}let L=await Jx(q,Y,J),D={id:L.id,name:L.name,mode:L.mode,incomingDocumentWebhookUrl:L.incomingDocumentWebhook.url},O=[],A=0,T=0;for(let{run:v,doc:x}of X){console.error(`[webhook-replay] 正在向 Webhook 通道「${L.name}」推送单据: ${x.documentSN}...`);try{let h=await Yx(L.incomingDocumentWebhook.url,L.secret,x,W,p4(Y.seal));O.push({originalRecord:{id:v.id,sourceSystem:v.sourceSystem,sourceDocumentSN:v.sourceDocumentSN,sourceDocumentId:v.sourceDocumentId},replayedDocument:{documentSN:x.documentSN,documentId:x.documentId,fieldCount:x.fields.length},pushResult:h,success:!0}),A+=1}catch(h){let k=h instanceof Error?h.message:String(h);O.push({originalRecord:{id:v.id,sourceSystem:v.sourceSystem,sourceDocumentSN:v.sourceDocumentSN,sourceDocumentId:v.sourceDocumentId},replayedDocument:{documentSN:x.documentSN,documentId:x.documentId,fieldCount:x.fields.length},error:k,success:!1}),T+=1}}let M=O.length===1;return{success:T===0,dryRun:!1,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:D,totalCount:O.length,successCount:A,failureCount:T,originalRecord:M?O[0].originalRecord:void 0,replayedDocument:M?O[0].replayedDocument:void 0,pushResult:M?O[0].pushResult:void 0,records:O}}var XH1;var tK=K0(()=>{zO();k$();c4();XH1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var CX0,Ik1,DH1,zk1;var hX0=K0(()=>{p9();CX0=Z.object({level:Z.enum(["error","warning","info"]),code:Z.string(),message:Z.string(),snippet:Z.string().optional(),suggestion:Z.string().optional()}),Ik1=Z.object({score:Z.number().min(0).max(100),passed:Z.boolean(),issues:Z.array(CX0)}),DH1=Z.object({ruleId:Z.stri Line truncated
*/var d1=t("fs"),cD=t("os"),r4=t("path"),SZ0=t("crypto"),V5={fs:d1.constants,os:cD.constants},kZ0=/XXXXXX/,fZ0=(V5.O_CREAT||V5.fs.O_CREAT)|(V5.O_EXCL||V5.fs.O_EXCL)|(V5.O_RDWR||V5.fs.O_RDWR),tw1=cD.platform()==="win32",aw1=V5.EBADF||V5.os.errno.EBADF,sw1=V5.ENOENT||V5.os.errno.ENOENT,lU=[],bZ0=d1.rmdirSync.bind(d1),nZ0=!1;function ew1($,I){return d1.rm($,{recursive:!0},I)}function iZ0($){return d1.rmSync($,{recursive:!0})}function du($,I){let z=oU($,I),q=z[0],U=z[1];wG1(q,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function K(){try{let w=cZ0(J);d1.stat(w,function(G){if(!G){if(Q-- >0)return K();return U(Error("Could not get a unique tmp filename, max tries reached "+w))}U(null,w)})}catch(w){U(w)}})()})}function mu($){let I=oU($),z=I[0],q=GG1(z),U=q.tries;do{let Y=cZ0(q);try{d1.statSync(Y)}catch(J){return Y}}while(U-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function $G1($,I){let z=oU($,I),q=z[0],U=z[1];du(q,function(J,Q){if(J)return U(J);d1.open(Q,fZ0,q.mode||384,function(w,G){if(w)return U(w);if(q.discardDescriptor)return d1.close(G,function(W){return U(W,Q,void 0,pu(Q,-1,q,!1))});else{let H=q.discardDescriptor||q.detachDescriptor;U(null,Q,G,pu(Q,H?-1:G,q,!1))}})})}function IG1($){let I=oU($),z=I[0],q=z.discardDescriptor||z.detachDescriptor,U=mu(z),Y=d1.openSync(U,fZ0,z.mode||384);if(z.discardDescriptor)d1.closeSync(Y),Y=void 0;return{name:U,fd:Y,removeCallback:pu(U,q?-1:Y,z,!0)}}function zG1($,I){let z=oU($,I),q=z[0],U=z[1];du(q,function(J,Q){if(J)return U(J);d1.mkdir(Q,q.mode||448,function(w){if(w)return U(w);U(null,Q,pZ0(Q,q,!1))})})}function qG1($){let I=oU($),z=I[0],q=mu(z);return d1.mkdirSync(q,z.mode||448),{name:q,removeCallback:pZ0(q,z,!0)}}function UG1($,I){let z=function(q){if(q&&!cu(q))return I(q);I()};if(0<=$[0])d1.close($[0],function(){d1.unlink($[1],z)});else d1.unlink($[1],z)}function YG1($){let I=null;try{if(0<=$[0])d1.closeSync($[0])}catch(z){if(!HG1(z)&&!cu(z))throw z}finally{try{d1.unlinkSync($[1])}catch(z){if(!cu(z))I=z}}if(I!==null)throw I}function pu($,I,z,q){let U=pD(YG1,[I,$],q),Y=pD(UG1,[I,$],q,U);if(!z.keep)lU.unshift(U);return q?U:Y}function pZ0($,I,z){let q=I.unsafeCleanup?ew1:d1.rmdir.bind(d1),U=I.unsafeCleanup?iZ0:bZ0,Y=pD(U,$,z),J=pD(q,$,z,Y);if(!I.keep)lU.unshift(Y);return z?Y:J}function pD($,I,z,q){let U=!1;return function Y(J){if(!U){let Q=q||Y,K=lU.indexOf(Q);if(K>=0)lU.splice(K,1);if(U=!0,z||$===bZ0||$===iZ0)return $(I);else return $(I,J||function(){})}}}function JG1(){if(!nZ0)return;while(lU.length)try{lU[0]()}catch($){}}function yZ0($){let I=[],z=null;try{z=SZ0.randomBytes($)}catch(q){z=SZ0.pseudoRandomBytes($)}for(let q=0;q<$;q++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[q]%62]);return I.join("")}function D$($){return typeof $>"u"}function oU($,I){if(typeof $==="function")return[{},$];if(D$($))return[{},I];let z={};for(let q of Object.getOwnPropertyNames($))z[q]=$[q];return[z,I]}function QG1($,I,z){let q=r4.isAbsolute($)?$:r4.join(I,$);d1.stat(q,function(U){if(U)d1.realpath(r4.dirname(q),function(Y,J){if(Y)return z(Y);z(null,r4.join(J,r4.basename(q)))});else d1.realpath(q,z)})}function KG1($,I){let z=r4.isAbsolute($)?$:r4.join(I,$);try{return d1.statSync(z),d1.realpathSync(z)}catch(q){let U=d1.realpathSync(r4.dirname(z));return r4.join(U,r4.basename(z))}}function cZ0($){let I=$.tmpdir;if(!D$($.name))return r4.join(I,$.dir,$.name);if(!D$($.template))return r4.join(I,$.dir,$.template).replace(kZ0,yZ0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",yZ0(12),$.postfix?"-"+$.postfix:""].join("");return r4.join(I,$.dir,z)}function iu($,I){if(typeof I!=="string")throw Error(`${$} option must be a string, got "${typeof I}".`);if(I.includes(".."))throw Error("Relative value not allowed");return I}function dZ0($){if(!D$($.name)){let I=$.name;if(r4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let z=r4.basename(I);if(z===".."||z==="."||z!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!D$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(kZ0))throw Error(`Invalid template, found "${$.template}".`)}if(!D$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=D$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=D$($.prefix)?"":iu("prefix",$.prefix),$.postfix=D$($.postfix)?"":iu("postfix",$.postfix),$.template=D$($.template)?void 0:iu("template",$.template)}function uZ0($,I,z,q){if(D$(I))return q(null);QG1(I,z,function(U,Y){if(U)return q(U);let J=r4.relative(z,Y);if(J.startsWith("..")||r4.isAbsolute(J))return q(Error(`${$} option must be relative to "${z}", found "${J}".`));q(null,J)})}function xZ0($,I,z){if(D$(I))return;let q=KG1(I,z),U=r4.relative(z,q);if(U.startsWith("..")||r4.isAbsolute(U))throw ELine truncated
`,{mode:384}),I}function Yx($){let I=gX0();for(let z of I){if(!x$(z))continue;for(let q of eD(z).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=Z5(z,q);try{let Y=IO(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function d7($,I){let z=Yx($);if(!z)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(IO(z,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=Ix.parse(U);return TX0(z,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}var qx="SEAL_USE_ENTERPRISES_DIR",EX0="SEAL_HOME_ENTERPRISES_DIR",BX0="SEAL_USE_USER_ENTERPRISES_DIR",jX0="SEAL_HOME_USER_ENTERPRISES_DIR",vX0="SEAL_USE_CONFIG_FILE",RX0="SEAL_HOME_CONFIG_FILE",tU,$O,sD,AX0;var G9=K0(()=>{zx();tU=Z5(zO(),".config","seal-use","enterprises"),$O=Z5(zO(),".config","seal-home","enterprises"),sD=Z5(zO(),".config","seal-use","config.json"),AX0=Z5(zO(),".config","seal-home","config.json")});function m7($,I,z=[]){let q=I.corpId?.trim()||void 0,U=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,Y=q??U;if(Y){let Q=$.find((G)=>G.id===Y);if(Q)return Q;let K=$.find((G)=>G.id.toLowerCase()===Y.toLowerCase());if(K)return K;let w=$.find((G)=>G.name.toLowerCase()===Y.toLowerCase());if(w)return w;throw Error(`No enterprise config found for ${Y}`)}if(!I.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 Jx,mkdirSync as HH1,readFileSync as WH1,renameSync as VH1,unlinkSync as ZH1,writeFileSync as XH1}from"node:fs";import{homedir as LH1}from"node:os";import{dirname as DH1,join as OH1}from"node:path";function Kx(){let $=process.env[FH1]?.trim();if($)return $;return NH1}function _X0($=new Date){return $.toISOString().slice(0,10)}function CX0($=Qx,I=new Date){let z=I.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function hX0($=Kx()){if(!Jx($))return{};try{let I=WH1($,"utf-8"),z=JSON.parse(I);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function MH1($,I){let z={};for(let[q,U]of Object.entries($)){if(!U||typeof U!=="object")continue;let Y={},J=!1;for(let[Q,K]of Object.entries(U))if(typeof K==="number"&&K>0&&Q>=I)Y[Q]=K,J=!0;if(J)z[q]=Y}return z}function AH1($,I=Kx()){let z=DH1(I);if(!Jx(z))HH1(z,{recursive:!0,mode:448});let q=`${I}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{XH1(q,JSON.stringify($,null,2),"utf-8"),VH1(q,I)}catch(U){try{if(Jx(q))ZH1(q)}catch{}throw U}}function SX0($,I=new Date){if(!$||typeof $!=="string")return;try{let z=Kx(),q=hX0(z),U=_X0(I),Y=CX0(Qx,I),J=MH1(q,Y);J[$]=J[$]||{},J[$][U]=(J[$][U]??0)+1,AH1(J,z)}catch{}}function PH1($,I=Qx,z=new Date){let q=new Map;try{let U=hX0(),Y=CX0(I,z),J=_X0(z),Q=$??Object.keys(U);for(let K of Q){let w=U[K];if(!w){q.set(K,0);continue}let G=0;for(let[H,W]of Object.entries(w))if(H>=Y&&H<=J&&typeof W==="number")G+=W;q.set(K,G)}}catch{if($)for(let U of $)q.set(U,0)}return q}function yX0($,I,z){let q=z??PH1($.map((U)=>U.id));return[...$].sort((U,Y)=>{if(I){if(U.id===I&&Y.id!==I)return-1;if(Y.id===I&&U.id!==I)return 1}let J=q.get(U.id)??0,Q=q.get(Y.id)??0;if(J!==Q)return Q-J;let K=U.name??U.id,w=Y.name??Y.id,G=K.localeCompare(w,"zh-CN");if(G!==0)return G;return U.id.localeCompare(Y.id)})}var FH1="SEAL_USE_USAGE_FILE",NH1,Qx=7;var wx=K0(()=>{NH1=OH1(LH1(),".config","seal-use","usage.json")});function TH1($,I){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>I?z:z.toLowerCase())}function EH1($,I){return I?$:$.toLowerCase()}function BH1($,I,z,q){let U=EH1($,q),Y=I.filter((J)=>U.includes(J));if(z==="all"&&Y.length!==I.length)return[];return Y}function jH1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function vH1($,I){if(I.fields&&!I.fields.has($.field))return[];let z=jH1($.value),q=[];return z.forEach((U,Y)=>{let J=BH1(U,I.keywords,I.matchMode,I.caseSensitive);if(J.length===0)return;let Q=Math.max(0,Y-I.contextLines),K=Math.min(z.length,Y+I.contextLines+1),w={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Y+1,matchedKeywords:J,matchedText:qO(U,I.maxChars),context:{before:I.snippetOnly?[]:z.slice(Q,Y).map((G)=>qO(G,I.maxChars)),line:qO(U,I.maxChars),after:I.snippetOnly?[]:z.slice(Y+1,K).map((G)=>qO(G,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)w.context={before:[],line:w.context.line,after:[]};q.push(w)}),q}function qO($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function RH1($){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 xX0($){return $.rules.flatMap((I,z)=>{let q=`${$.id}:${I.description.slice(0,32)}`,U={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:I.scope,strictness:I.strictness,code:"code"in I?I.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:q,title:`${$.versionName} / ${I.scope}`,field:"history.description Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==q.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:q}}async function Wx($,I,z){let q=I.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",U=await v$($,q);if(z||U.length>0)return iX0(U,z,I.id);if(I.environment==="test"||I.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${I.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let Y=(I.seal.url??I.source?.sealUrl??`https://${I.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await rW($,Y,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${Y}/api/v1/integrations/webhook/replay-mock-callback`},I.seal.endpoints.approvalStylePreferences)}throw new N4(`当前租户「${I.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${I.id}`)}async function aU($){let{query:I,sourceClient:z,targetClient:q,sourceCorp:U,targetCorp:Y,webhookSelector:J,snPrefix:Q,snSuffix:K,docIdPrefix:w,docIdSuffix:G,dryRun:H,fetchFn:W=fetch}=$,V=[];if(I.recordId){let v=await X4(z,I.recordId);V.push(v)}else if(I.recordIds&&I.recordIds.length>0)for(let v of I.recordIds)V.push(await X4(z,v));else if(I.sn){let v=await s4(z,{sourceDocumentSN:I.sn,limit:1});if(!v.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${I.sn}」的审批记录。`);V.push(v.records[0])}else if(I.sns&&I.sns.length>0)for(let v of I.sns){let x=await s4(z,{sourceDocumentSN:v,limit:1});if(!x.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${v}」的审批记录。`);V.push(x.records[0])}else if(I.limit!==void 0){let v=await s4(z,{limit:I.limit,status:I.status,startDate:I.startDate,endDate:I.endDate});if(!v.records.length)throw Error(`在企业「${U.name}」中未检索到符合条件的审批记录。`);V=v.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 X=V.map((v)=>({run:v,doc:Gx(v,{snPrefix:Q,snSuffix:K,docIdPrefix:w,docIdSuffix:G})}));if(H){let v={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Y.seal.url}/api/v1/integrations/webhook/preview`};try{let k=await v$(q,Y.seal.endpoints.approvalStylePreferences);if(k.length>0){let j=iX0(k,J,Y.id);v={id:j.id,name:j.name,mode:j.mode,incomingDocumentWebhookUrl:j.incomingDocumentWebhook.url}}}catch{}let x=X.map(({run:k,doc:j})=>({originalRecord:{id:k.id,sourceSystem:k.sourceSystem,sourceDocumentSN:k.sourceDocumentSN,sourceDocumentId:k.sourceDocumentId},document:j,success:!0})),h=x.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:v,totalCount:x.length,successCount:x.length,failureCount:0,originalRecord:h?x[0].originalRecord:void 0,document:h?x[0].document:void 0,records:x}}let L=await Wx(q,Y,J),D={id:L.id,name:L.name,mode:L.mode,incomingDocumentWebhookUrl:L.incomingDocumentWebhook.url},O=[],A=0,T=0;for(let{run:v,doc:x}of X){console.error(`[webhook-replay] 正在向 Webhook 通道「${L.name}」推送单据: ${x.documentSN}...`);try{let h=await Hx(L.incomingDocumentWebhook.url,L.secret,x,W,p4(Y.seal));O.push({originalRecord:{id:v.id,sourceSystem:v.sourceSystem,sourceDocumentSN:v.sourceDocumentSN,sourceDocumentId:v.sourceDocumentId},replayedDocument:{documentSN:x.documentSN,documentId:x.documentId,fieldCount:x.fields.length},pushResult:h,success:!0}),A+=1}catch(h){let k=h instanceof Error?h.message:String(h);O.push({originalRecord:{id:v.id,sourceSystem:v.sourceSystem,sourceDocumentSN:v.sourceDocumentSN,sourceDocumentId:v.sourceDocumentId},replayedDocument:{documentSN:x.documentSN,documentId:x.documentId,fieldCount:x.fields.length},error:k,success:!1}),T+=1}}let M=O.length===1;return{success:T===0,dryRun:!1,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:D,totalCount:O.length,successCount:A,failureCount:T,originalRecord:M?O[0].originalRecord:void 0,replayedDocument:M?O[0].replayedDocument:void 0,pushResult:M?O[0].pushResult:void 0,records:O}}var fH1;var aK=K0(()=>{UO();k$();c4();fH1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var pX0,Rk1,nH1,gk1;var cX0=K0(()=>{p9();pX0=Z.object({level:Z.enum(["error","warning","info"]),code:Z.string(),message:Z.string(),snippet:Z.string().optional(),suggestion:Z.string().optional()}),Rk1=Z.object({score:Z.number().min(0).max(100),passed:Z.boolean(),issues:Z.array(pX0)}),nH1=Z.object({ruleId:Z.stri Line truncated
* ==============================================================================
* Seal 官方标准规则校验器 (Official Standard Rule Linter)
* ==============================================================================
@@ -626,41 +626,43 @@ export function lintRule(rule: RuleLintTarget): RuleLintResult {
}
export default lintRule;
`}});import{existsSync as uI,mkdirSync as BH1,readFileSync as jH1,readdirSync as xX0,rmSync as vH1,unlinkSync as RH1,writeFileSync as gH1}from"node:fs";import{homedir as _H1}from"node:os";import{isAbsolute as CH1,join as u6,resolve as hH1}from"node:path";import{pathToFileURL as yX0}from"node:url";function kX0($=L5){let I=[],z=[];try{if(!uI($))BH1($,{recursive:!0});let q=Object.keys(wx);for(let[Y,J]of Object.entries(wx)){let Q=u6($,Y),K=!0;if(uI(Q))try{if(jH1(Q,"utf8")===J)K=!1}catch{K=!0}if(K)gH1(Q,J,"utf8");I.push(Y)}let U=xX0($,{withFileTypes:!0});for(let Y of U)if(!q.includes(Y.name)){let J=u6($,Y.name);try{if(Y.isDirectory())vH1(J,{recursive:!0,force:!0});else RH1(J);z.push(Y.name)}catch{}}}catch{}return{synced:I,pruned:z}}function fX0($={syncOfficial:!0}){if($.syncOfficial!==!1)kX0();let I=[{name:"builtin",type:"builtin",path:u6(L5,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:u6(L5,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"}],z=[Q8,JO];for(let q of z)if(uI(q))try{let U=xX0(q,{withFileTypes:!0});for(let Y of U){if(Y.isDirectory())continue;let J=Y.name;if(J.endsWith(".ts")||J.endsWith(".js")||J.endsWith(".mjs")){let Q=J.replace(/\.(ts|js|mjs)$/,"");if(!I.some((K)=>K.name===Q))I.push({name:Q,type:"custom",path:u6(q,J),description:`用户自定义规则校验器 (${J})`})}}}catch{}return I}function yH1($){let I=($||"").trim();if(!I||I==="builtin"||I==="default"||I==="official/builtin"||I==="official/builtin.ts")return{path:u6(L5,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(I==="strict"||I==="official/strict"||I==="official/strict.ts")return{path:u6(L5,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(CH1(I)||I.startsWith("./")||I.startsWith("../")){let q=hH1(I);if(uI(q))return{path:q};for(let U of[".ts",".js",".mjs"])if(uI(`${q}${U}`))return{path:`${q}${U}`}}let z=[u6(Q8,`${I}.ts`),u6(Q8,`${I}.js`),u6(Q8,`${I}.mjs`),u6(JO,`${I}.ts`),u6(JO,`${I}.js`),u6(JO,`${I}.mjs`)];for(let q of z)if(uI(q))return{path:q};return{}}async function Hx($){kX0();let I=yH1($??"builtin");if(I.isOfficial){let q=I.officialKind==="strict"?SX0:aU,U=I.officialKind==="strict"?"official":"builtin",Y=I.path;if(Y&&uI(Y))try{let Q=await import(yX0(Y).href),K=Q.default??Q.lintRule??Q.linter??Q.lint;if(typeof K==="function")return{name:I.officialKind??"builtin",type:U,filePath:Y,linter:uX0(K,q)}}catch{}return{name:I.officialKind??"builtin",type:U,filePath:Y,linter:q}}let z=I.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aU};try{let U=await import(yX0(z).href),Y=U.default??U.lintRule??U.linter??U.lint;if(typeof Y!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aU};return{name:$??"custom",type:"custom",filePath:z,linter:uX0(Y,aU)}}catch(q){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${q?.message??q}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aU}}}function uX0($,I){return async(z,q)=>{try{let U=await $(z,q);if(U&&typeof U==="object"&&typeof U.score==="number"&&Array.isArray(U.issues))return U;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),I(z,q)}catch(U){return console.error("⚠️ [linter] 自定义校验器执行异常:",U),I(z,q)}}}var Q8,SH1="official",L5,JO;var Wx=K0(()=>{Qx();Gx();Kx();Q8=u6(_H1(),".config","seal-use","linters"),L5=u6(Q8,SH1),JO=u6(process.cwd(),"linters")});async function Vx($,I,z){let q=await I.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:q.score,passed:q.passed,issues:q.issues,description:$.description}}async function bX0($,I,z,q){let U=q?.minScore??0,Y=q?.level??"all",J=[],Q=0;for(let V of $){let X=await Vx(V,I,z);Q+=X.score;let L=X.issues;if(Y==="error")L=X.issues.filter((O)=>O.level==="error");else if(Y==="warning")L=X.issues.filter((O)=>O.level==="warning"||O.level==="error");let D=L.every((O)=>O.level!=="error");if(q?.summary){if(L.length>0)J.push({...X,passed:D,issues:L})}else J.push({...X,passed:D,issues:L})}let K=$.length,w=K===0?100:Math.round(Q/K),G=J.filter((V)=>V.issues.length>0).length,H=K-G,W=w>=U&&J.every((V)=>V.passed);return{linter:I.name,linterType:I.type,totalRules:K,healthyCount:H,issueCount:G,overallScore:w,passed:W,issues:J}}var Zx=K0(()=>{hX0();Qx();Kx();Gx();Wx()});import{existsSync as uH1,readFileSync as xH1,writeFileSync as kH1,mkdirSync as fH1}from"node:fs";import{dirname as bH1,resolve as iX0}from"node:path";function nH1($){let I;try{I=JSON.parse($)}catch(z){throw ErroLine truncated
`,"utf8"),z}function cX0($){return $.map((I,z)=>{let q;if(typeof I.code==="number")q=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")q=I.code.startsWith("#")?I.code:`#${I.code}`;else q=`#${String(z+1).padStart(4,"0")}`;return{id:I.id,code:q,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}var dX0=()=>{};var K8;var sU=K0(()=>{K8=class K8 extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}});var rX0=F((jk1,oX0)=>{oX0.exports=QO;function QO(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}QO.prototype.go=function($){if(this.pending<this.max)lX0(this,$);else this.waiting.push($)};QO.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};QO.prototype.hold=function(){return mX0(this)};function mX0($){$.pending+=1;var I=!1;return z;function z(U){if(I)throw Error("callback called twice");if(I=!0,$.error=$.error||U,$.pending-=1,$.waiting.length>0&&$.pending<$.max)lX0($,$.waiting.shift());else if($.pending===0){var Y=$.listeners;$.listeners=[],Y.forEach(q)}}function q(U){U($.error)}}function lX0($,I){I(mX0($))}});var sX0=F((cH1)=>{var Lx=t("fs"),Dx=t("util"),tX0=t("stream"),aX0=tX0.Readable,iH1=tX0.PassThrough,pH1=rX0(),KO=t("events").EventEmitter;cH1.BufferSlicer=$Y;cH1.FdSlicer=eU;Dx.inherits(eU,KO);function eU($){KO.call(this),this.fd=$,this.pend=new pH1,this.pend.max=1,this.refCount=0}eU.prototype.read=function($,I,z,q,U){var Y=this;Y.pend.go(function(J){Lx.read(Y.fd,$,I,z,q,function(Q,K,w){J(),U(Q,K,w)})})};eU.prototype.createReadStream=function($){return new aK(this,$)};eU.prototype.ref=function(){this.refCount+=1};eU.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Lx.close($.fd,I);function I(z){if(z)$.emit("error",z);else $.emit("close")}};Dx.inherits(aK,aX0);function aK($,I){I=I||{},aX0.call(this,I),this.context=$,this.context.ref(),this.start=I.start||0,this.endOffset=I.end,this.pos=this.start}aK.prototype._read=function($){var I=this,z=Math.min(I._readableState.highWaterMark,$);if(I.endOffset!=null)z=Math.min(z,I.endOffset-I.pos);if(z<=0){I.push(null),this._cleanup();return}I.context.pend.go(function(q){var U=Buffer.allocUnsafe(z);Lx.read(I.context.fd,U,0,z,I.pos,function(Y,J){if(Y)I.destroy(Y);else if(J===0)I.push(null),I._cleanup();else I.pos+=J,I.push(U.slice(0,J));q()})})};aK.prototype._destroy=function($,I){this._cleanup(),I($)};aK.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};Dx.inherits($Y,KO);function $Y($){KO.call(this),this.refCount=0,this.buffer=$}$Y.prototype.read=function($,I,z,q,U){if(!(0<=I&&I<=$.length))throw RangeError("offset outside buffer: 0 <= "+I+" <= "+$.length);if(q<0)throw RangeError("position is negative: "+q);if(I+z>$.length)z=$.length-I;if(q+z>this.buffer.length)z=this.buffer.length-q;if(z<=0){setImmediate(function(){U(null,0)});return}this.buffer.copy($,I,q,q+z),setImmediate(function(){U(null,z)})};$Y.prototype.createReadStream=function($){$=$||{};var I=new iH1($);I.start=$.start||0,I.endOffset=$.end,I.pos=I.endOffset||this.buffer.length;var z=this.buffer.slice(I.start,I.pos),q=65536,U=0;while(!0){var Y=U+q;if(Y>=z.length){if(U<z.length)I.write(z.slice(U,z.length));break}I.write(z.slice(U,Y)),U=Y}return I.end(),I};$Y.prototype.ref=function(){this.refCount+=1};$Y.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var $L0=F((Rk1,eX0)=>{var lH1=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,1090812512, Line truncated
`}});import{existsSync as xI,mkdirSync as tH1,readFileSync as aH1,readdirSync as oX0,rmSync as sH1,unlinkSync as eH1,writeFileSync as $W1}from"node:fs";import{homedir as IW1}from"node:os";import{isAbsolute as zW1,join as u6,resolve as qW1}from"node:path";import{pathToFileURL as mX0}from"node:url";function rX0($=L5){let I=[],z=[];try{if(!xI($))tH1($,{recursive:!0});let q=Object.keys(Xx);for(let[Y,J]of Object.entries(Xx)){let Q=u6($,Y),K=!0;if(xI(Q))try{if(aH1(Q,"utf8")===J)K=!1}catch{K=!0}if(K)$W1(Q,J,"utf8");I.push(Y)}let U=oX0($,{withFileTypes:!0});for(let Y of U)if(!q.includes(Y.name)){let J=u6($,Y.name);try{if(Y.isDirectory())sH1(J,{recursive:!0,force:!0});else eH1(J);z.push(Y.name)}catch{}}}catch{}return{synced:I,pruned:z}}function tX0($={syncOfficial:!0}){if($.syncOfficial!==!1)rX0();let I=[{name:"builtin",type:"builtin",path:u6(L5,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:u6(L5,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"}],z=[Q8,KO];for(let q of z)if(xI(q))try{let U=oX0(q,{withFileTypes:!0});for(let Y of U){if(Y.isDirectory())continue;let J=Y.name;if(J.endsWith(".ts")||J.endsWith(".js")||J.endsWith(".mjs")){let Q=J.replace(/\.(ts|js|mjs)$/,"");if(!I.some((K)=>K.name===Q))I.push({name:Q,type:"custom",path:u6(q,J),description:`用户自定义规则校验器 (${J})`})}}}catch{}return I}function YW1($){let I=($||"").trim();if(!I||I==="builtin"||I==="default"||I==="official/builtin"||I==="official/builtin.ts")return{path:u6(L5,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(I==="strict"||I==="official/strict"||I==="official/strict.ts")return{path:u6(L5,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(zW1(I)||I.startsWith("./")||I.startsWith("../")){let q=qW1(I);if(xI(q))return{path:q};for(let U of[".ts",".js",".mjs"])if(xI(`${q}${U}`))return{path:`${q}${U}`}}let z=[u6(Q8,`${I}.ts`),u6(Q8,`${I}.js`),u6(Q8,`${I}.mjs`),u6(KO,`${I}.ts`),u6(KO,`${I}.js`),u6(KO,`${I}.mjs`)];for(let q of z)if(xI(q))return{path:q};return{}}async function Dx($){rX0();let I=YW1($??"builtin");if(I.isOfficial){let q=I.officialKind==="strict"?dX0:sU,U=I.officialKind==="strict"?"official":"builtin",Y=I.path;if(Y&&xI(Y))try{let Q=await import(mX0(Y).href),K=Q.default??Q.lintRule??Q.linter??Q.lint;if(typeof K==="function")return{name:I.officialKind??"builtin",type:U,filePath:Y,linter:lX0(K,q)}}catch{}return{name:I.officialKind??"builtin",type:U,filePath:Y,linter:q}}let z=I.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:sU};try{let U=await import(mX0(z).href),Y=U.default??U.lintRule??U.linter??U.lint;if(typeof Y!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:sU};return{name:$??"custom",type:"custom",filePath:z,linter:lX0(Y,sU)}}catch(q){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${q?.message??q}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:sU}}}function lX0($,I){return async(z,q)=>{try{let U=await $(z,q);if(U&&typeof U==="object"&&typeof U.score==="number"&&Array.isArray(U.issues))return U;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),I(z,q)}catch(U){return console.error("⚠️ [linter] 自定义校验器执行异常:",U),I(z,q)}}}var Q8,UW1="official",L5,KO;var Ox=K0(()=>{Vx();Lx();Zx();Q8=u6(IW1(),".config","seal-use","linters"),L5=u6(Q8,UW1),KO=u6(process.cwd(),"linters")});async function Fx($,I,z){let q=await I.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:q.score,passed:q.passed,issues:q.issues,description:$.description}}async function aX0($,I,z,q){let U=q?.minScore??0,Y=q?.level??"all",J=[],Q=0;for(let V of $){let X=await Fx(V,I,z);Q+=X.score;let L=X.issues;if(Y==="error")L=X.issues.filter((O)=>O.level==="error");else if(Y==="warning")L=X.issues.filter((O)=>O.level==="warning"||O.level==="error");let D=L.every((O)=>O.level!=="error");if(q?.summary){if(L.length>0)J.push({...X,passed:D,issues:L})}else J.push({...X,passed:D,issues:L})}let K=$.length,w=K===0?100:Math.round(Q/K),G=J.filter((V)=>V.issues.length>0).length,H=K-G,W=w>=U&&J.every((V)=>V.passed);return{linter:I.name,linterType:I.type,totalRules:K,healthyCount:H,issueCount:G,overallScore:w,passed:W,issues:J}}var Nx=K0(()=>{cX0();Vx();Zx();Lx();Ox()});import{existsSync as JW1,readFileSync as QW1,writeFileSync as KW1,mkdirSync as wW1}from"node:fs";import{dirname as GW1,resolve as eX0}from"node:path";function HW1($){let I;try{I=JSON.parse($)}catch(z){throw ErroLine truncated
`,"utf8"),z}function IL0($){return $.map((I,z)=>{let q;if(typeof I.code==="number")q=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")q=I.code.startsWith("#")?I.code:`#${I.code}`;else q=`#${String(z+1).padStart(4,"0")}`;return{id:I.id,code:q,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}var zL0=()=>{};var K8;var eU=K0(()=>{K8=class K8 extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}});var JL0=F((If1,YL0)=>{YL0.exports=wO;function wO(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}wO.prototype.go=function($){if(this.pending<this.max)UL0(this,$);else this.waiting.push($)};wO.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};wO.prototype.hold=function(){return qL0(this)};function qL0($){$.pending+=1;var I=!1;return z;function z(U){if(I)throw Error("callback called twice");if(I=!0,$.error=$.error||U,$.pending-=1,$.waiting.length>0&&$.pending<$.max)UL0($,$.waiting.shift());else if($.pending===0){var Y=$.listeners;$.listeners=[],Y.forEach(q)}}function q(U){U($.error)}}function UL0($,I){I(qL0($))}});var wL0=F((ZW1)=>{var Ax=t("fs"),Px=t("util"),QL0=t("stream"),KL0=QL0.Readable,WW1=QL0.PassThrough,VW1=JL0(),GO=t("events").EventEmitter;ZW1.BufferSlicer=IY;ZW1.FdSlicer=$Y;Px.inherits($Y,GO);function $Y($){GO.call(this),this.fd=$,this.pend=new VW1,this.pend.max=1,this.refCount=0}$Y.prototype.read=function($,I,z,q,U){var Y=this;Y.pend.go(function(J){Ax.read(Y.fd,$,I,z,q,function(Q,K,w){J(),U(Q,K,w)})})};$Y.prototype.createReadStream=function($){return new sK(this,$)};$Y.prototype.ref=function(){this.refCount+=1};$Y.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Ax.close($.fd,I);function I(z){if(z)$.emit("error",z);else $.emit("close")}};Px.inherits(sK,KL0);function sK($,I){I=I||{},KL0.call(this,I),this.context=$,this.context.ref(),this.start=I.start||0,this.endOffset=I.end,this.pos=this.start}sK.prototype._read=function($){var I=this,z=Math.min(I._readableState.highWaterMark,$);if(I.endOffset!=null)z=Math.min(z,I.endOffset-I.pos);if(z<=0){I.push(null),this._cleanup();return}I.context.pend.go(function(q){var U=Buffer.allocUnsafe(z);Ax.read(I.context.fd,U,0,z,I.pos,function(Y,J){if(Y)I.destroy(Y);else if(J===0)I.push(null),I._cleanup();else I.pos+=J,I.push(U.slice(0,J));q()})})};sK.prototype._destroy=function($,I){this._cleanup(),I($)};sK.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};Px.inherits(IY,GO);function IY($){GO.call(this),this.refCount=0,this.buffer=$}IY.prototype.read=function($,I,z,q,U){if(!(0<=I&&I<=$.length))throw RangeError("offset outside buffer: 0 <= "+I+" <= "+$.length);if(q<0)throw RangeError("position is negative: "+q);if(I+z>$.length)z=$.length-I;if(q+z>this.buffer.length)z=this.buffer.length-q;if(z<=0){setImmediate(function(){U(null,0)});return}this.buffer.copy($,I,q,q+z),setImmediate(function(){U(null,z)})};IY.prototype.createReadStream=function($){$=$||{};var I=new WW1($);I.start=$.start||0,I.endOffset=$.end,I.pos=I.endOffset||this.buffer.length;var z=this.buffer.slice(I.start,I.pos),q=65536,U=0;while(!0){var Y=U+q;if(Y>=z.length){if(U<z.length)I.write(z.slice(U,z.length));break}I.write(z.slice(U,Y)),U=Y}return I.end(),I};IY.prototype.ref=function(){this.refCount+=1};IY.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var HL0=F((qf1,GL0)=>{var DW1=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,1090812512, 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 CL0=F((dW1)=>{var ex=W9().Buffer;dW1._dbcs=Z9;var T6=-1,_L0=-2,H8=-10,a6=-1000,QY=Array(256),$w=-1;for(eK=0;eK<256;eK++)QY[eK]=T6;var eK;function Z9($,I){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]=QY.slice(0),this.decodeTableSeq=[];for(var q=0;q<z.length;q++)this._addDecodeChunk(z[q]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var U=this.decodeTables.length;this.decodeTables.push(QY.slice(0));var Y=this.decodeTables.length;this.decodeTables.push(QY.slice(0));var J=this.decodeTables[0];for(var q=129;q<=254;q++){var Q=this.decodeTables[a6-J[q]];for(var K=48;K<=57;K++){if(Q[K]===T6)Q[K]=a6-U;else if(Q[K]>a6)throw Error("gb18030 decode tables conflict at byte 2");var w=this.decodeTables[a6-Q[K]];for(var G=129;G<=254;G++){if(w[G]===T6)w[G]=a6-Y;else if(w[G]===a6-Y)continue;else if(w[G]>a6)throw Error("gb18030 decode tables conflict at byte 3");var H=this.decodeTables[a6-w[G]];for(var W=48;W<=57;W++)if(H[W]===T6)H[W]=_L0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var q=0;q<$.encodeSkipVals.length;q++){var X=$.encodeSkipVals[q];if(typeof X==="number")V[X]=!0;else for(var K=X.from;K<=X.to;K++)V[K]=!0}if(this._fillEncodeTable(0,0,V),$.encodeAdd){for(var L in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,L))this._setEncodeChar(L.charCodeAt(0),$.encodeAdd[L])}if(this.defCharSB=this.encodeTable[0][I.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===T6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===T6)this.defCharSB=63}Z9.prototype.encoder=MO;Z9.prototype.decoder=$k;Z9.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var z=this.decodeTables[0];for(var q=I.length-1;q>0;q--){var U=z[I[q]];if(U==T6)z[I[q]]=a6-this.decodeTables.length,this.decodeTables.push(z=QY.slice(0));else if(U<=a6)z=this.decodeTables[a6-U];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};Z9.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),z=this._getDecodeTrieNode(I);I=I&255;for(var q=1;q<$.length;q++){var U=$[q];if(typeof U==="string")for(var Y=0;Y<U.length;){var J=U.charCodeAt(Y++);if(J>=55296&&J<56320){var Q=U.charCodeAt(Y++);if(Q>=56320&&Q<57344)z[I++]=65536+(J-55296)*1024+(Q-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(J>4080&&J<=4095){var K=4095-J+2,w=[];for(var G=0;G<K;G++)w.push(U.charCodeAt(Y++));z[I++]=H8-this.decodeTableSeq.length,this.decodeTableSeq.push(w)}else z[I++]=J}else if(typeof U==="number"){var H=z[I-1]+1;for(var Y=0;Y<U;Y++)z[I++]=H++}else throw Error("Incorrect type '"+typeof U+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`);let O=new FormData,A=await Jk(q.fileBuffer,D),T=L.split("/").pop()??L;O.append("files",new File([new Uint8Array(A)],T));let M=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...rK({},z.secret)},body:O});if(!M.ok)throw Error(`附件上传失败 ${M.status}: ${await M.text()}`);let v=await M.json();G.set(L,v.attachments?.map((x)=>x.data)??(v.data===void 0?[]:[v.data])),process.stderr.write(`✓ 附件上传成功: ${L}
\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 pL0=F((XV1)=>{var Yk=W9().Buffer;XV1._dbcs=Z9;var T6=-1,iL0=-2,H8=-10,a6=-1000,KY=Array(256),Iw=-1;for($w=0;$w<256;$w++)KY[$w]=T6;var $w;function Z9($,I){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]=KY.slice(0),this.decodeTableSeq=[];for(var q=0;q<z.length;q++)this._addDecodeChunk(z[q]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var U=this.decodeTables.length;this.decodeTables.push(KY.slice(0));var Y=this.decodeTables.length;this.decodeTables.push(KY.slice(0));var J=this.decodeTables[0];for(var q=129;q<=254;q++){var Q=this.decodeTables[a6-J[q]];for(var K=48;K<=57;K++){if(Q[K]===T6)Q[K]=a6-U;else if(Q[K]>a6)throw Error("gb18030 decode tables conflict at byte 2");var w=this.decodeTables[a6-Q[K]];for(var G=129;G<=254;G++){if(w[G]===T6)w[G]=a6-Y;else if(w[G]===a6-Y)continue;else if(w[G]>a6)throw Error("gb18030 decode tables conflict at byte 3");var H=this.decodeTables[a6-w[G]];for(var W=48;W<=57;W++)if(H[W]===T6)H[W]=iL0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var q=0;q<$.encodeSkipVals.length;q++){var X=$.encodeSkipVals[q];if(typeof X==="number")V[X]=!0;else for(var K=X.from;K<=X.to;K++)V[K]=!0}if(this._fillEncodeTable(0,0,V),$.encodeAdd){for(var L in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,L))this._setEncodeChar(L.charCodeAt(0),$.encodeAdd[L])}if(this.defCharSB=this.encodeTable[0][I.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===T6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===T6)this.defCharSB=63}Z9.prototype.encoder=PO;Z9.prototype.decoder=Jk;Z9.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var z=this.decodeTables[0];for(var q=I.length-1;q>0;q--){var U=z[I[q]];if(U==T6)z[I[q]]=a6-this.decodeTables.length,this.decodeTables.push(z=KY.slice(0));else if(U<=a6)z=this.decodeTables[a6-U];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};Z9.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),z=this._getDecodeTrieNode(I);I=I&255;for(var q=1;q<$.length;q++){var U=$[q];if(typeof U==="string")for(var Y=0;Y<U.length;){var J=U.charCodeAt(Y++);if(J>=55296&&J<56320){var Q=U.charCodeAt(Y++);if(Q>=56320&&Q<57344)z[I++]=65536+(J-55296)*1024+(Q-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(J>4080&&J<=4095){var K=4095-J+2,w=[];for(var G=0;G<K;G++)w.push(U.charCodeAt(Y++));z[I++]=H8-this.decodeTableSeq.length,this.decodeTableSeq.push(w)}else z[I++]=J}else if(typeof U==="number"){var H=z[I-1]+1;for(var Y=0;Y<U;Y++)z[I++]=H++}else throw Error("Incorrect type '"+typeof U+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`);let O=new FormData,A=await Wk(q.fileBuffer,D),T=L.split("/").pop()??L;O.append("files",new File([new Uint8Array(A)],T));let M=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...tK({},z.secret)},body:O});if(!M.ok)throw Error(`附件上传失败 ${M.status}: ${await M.text()}`);let v=await M.json();G.set(L,v.attachments?.map((x)=>x.data)??(v.data===void 0?[]:[v.data])),process.stderr.write(`✓ 附件上传成功: ${L}
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${K.document.documentId}
`);let W=Hk(K.document,w,G),V=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...rK({webhookId:Y,...W},z.secret)},body:JSON.stringify(W)});if(!V.ok)throw Error(`Webhook 单据推送失败 ${V.status}: ${await V.text()}`);J.push({documentId:W.documentId,document:W,pushResult:await V.json()}),process.stderr.write(`✓ 单据推送成功: ${W.documentId}
`)}return{warnings:[],results:J}}function bI($){return{fileBuffer:BV1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Vk=K0(()=>{zO();Wk();Gk();Qk();sU()});import{existsSync as gV1}from"node:fs";async function vO($,I,z={}){let U=K4().stateful?"stateful":"stateless",Y="ok",J,Q,K;try{let M=await v6($);K={id:M.user.id,name:M.user.name,isAdmin:M.user.isAdmin},Q={id:M.tenant.id,name:M.tenant.name,tenantSlug:M.tenant.tenantSlug,corporationName:M.tenant.hoseCorpConfig?.corporationName}}catch(M){Y="error",J=M instanceof Error?M.message:String(M)}let w=[];if(Y==="ok")try{w=await v$($,I.seal.endpoints.approvalStylePreferences)}catch(M){Y="error",J=`读取 Webhook 配置失败: ${M instanceof Error?M.message:String(M)}`}let G=w.length===1,H=w.map((M)=>({id:M.id,name:M.name,mode:M.mode,incomingDocumentWebhookUrl:M.incomingDocumentWebhook.url,outgoingResultWebhookUrl:M.outgoingResultWebhook,autoApprovalRate:M.autoApprovalRate,...G?{isDefault:!0}:{}})),W=G?{id:w[0].id,name:w[0].name,mode:w[0].mode}:null,V=z.webhook?m9(w,z.webhook):G?w[0]:void 0,X;if(z.filePath)if(!gV1(z.filePath))X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let M=bI(z.filePath),v=await fI(M.fileBuffer,M.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:z.filePath,fileName:M.fileName,documentCount:v.documents.length,warnings:v.warnings}}catch(M){X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[M instanceof Error?M.message:String(M)]}}let L=X?X.valid:!0,D=Y==="ok"&&H.length>0&&L,O=U==="stateful"?"":` --corp ${I.id}`,A="",T="";if(Y!=="ok")T=`凭证鉴权异常: ${J}`,A=`seal-use auth diagnose${O}`;else if(H.length===0)T="当前企业尚未配置任何 Webhook 集成通道",A=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${O}`;else if(X&&!X.valid)T=`材料包预检失败: ${X.errors?.join("; ")}`,A=`seal-use webhook material-pack preview ${X.filePath}${O}`;else{T=G?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${H.length} 个 Webhook 通道,等待载入`;let M=X?.filePath??"<材料包.zip>",v=G?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;A=`seal-use webhook material-pack push ${M}${v}${O}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:K},stateMode:U,authStatus:Y,authError:J,activeWebhooks:H,defaultWebhook:W,materialPack:X,statusMessage:T,nextAction:A}}var VD0=K0(()=>{G9();c4();Vk()});var Zk=K0(()=>{sU();sz();zO();Qk();Gk();Wk();Vk();VD0()});import{existsSync as ZD0,mkdirSync as XD0,statSync as _V1}from"node:fs";import{homedir as CV1}from"node:os";import{dirname as hV1,resolve as RO}from"node:path";function LD0($){if($.outputFile){let J=RO($.outputFile),Q=hV1(J);if(!ZD0(Q))XD0(Q,{recursive:!0});return J}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",q=$.dateTag||new Date().toISOString().slice(0,10),U=`${z}_智能洞察报告_${q}.xlsx`,Y;if($.toDownloads)Y=RO(CV1(),"Downloads");else Y=RO(process.cwd(),"exports");if(!ZD0(Y))XD0(Y,{recursive:!0});return RO(Y,U)}async function gO($,I,z={}){let q=I.name||I.id,U=LD0({outputFile:z.outputFile,toDownloads:z.toDownloads,corpName:q,corpId:I.id}),Y=new Date().toISOString(),[J,Q]=await Promise.all([eW($,{startDate:z.startDate?String(z.startDate):void 0,endDate:z.endDate?String(z.endDate):void 0,limit:z.limit??100}),IV($,{startDate:z.startDate,endDate:z.endDate}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),K=J.tagStats||[],w=[],G=Math.min(K.length,z.limit??50);for(let E=0;E<G;E++){let f=K[E];if(!f?.tagId)continue;try{let n=await $V($,{tagId:f.tagId,startDate:z.startDate?String(z.startDate):void 0,endDate:z.endDate?String(z.endDate):void 0});for(let g of n.risks||[])w.push({tagId:f.tagId,tagName:f.tagName||f.tagId,documentSN:g.documentSN||"-",documentType:g.documentType||"-",riskLevel:g.riskLevel||"warning",confidence:g.confidence??0,riskDetails:g.riskDetails||"-",reasoning:g.reasoning||"-",sourceDocumentURL:g.sourceDocumentURL,createdAt:g.createdAt})}catch{}}let H=new DD0.default.Workbook;H.creator="seal-use",H.lastModifiedBy="seal-use",H.created=new Date,H.modified=new Date;let W={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},V={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},X={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},L=H.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});L.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}],L.getRow(1).height=28,L.getRow(1).font=V,L.getRow(1).fill=W,L.g Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:KY({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:uO(I,["template.name","templateName","form.name","formName","formTitle"]),amount:CO(z,["金额","报销金额","付款金额","合计","价税合计"])??uO(I,["amount","totalAmount","expenseAmount"]),expenseType:CO(z,["费用类型","费用类别","报销类型"]),costCompany:CO(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:CO(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:tV1($),attachments:oU($,{summary:!0}).attachments,aiResult:kO($),manualResult:iI($)?.value,hints:KY({amountMentions:MD0(q,["金额","合计","税率"],8),partyMentions:MD0(q,["买方","卖方","甲方","乙方","收款"],8)})}}function mV1($){let I=[["result.citedRules",X9($,"result.citedRules")],["result.matchedRules",X9($,"result.matchedRules")],["result.ruleResults",X9($,"result.ruleResults")],["result.rules",X9($,"result.rules")],["pipelineData.citedRules",X9($,"pipelineData.citedRules")],["pipelineData.matchedRules",X9($,"pipelineData.matchedRules")]],z=[],q=new Set;for(let[U,Y]of I)(Array.isArray(Y)?Y:Y&&typeof Y==="object"?Object.values(Y):[]).forEach((Q,K)=>{let w=Qw(Q);if(!w)return;let G=w4(w.runtimeRuleId)??w4(w.runtimeId)??w4(w.id)??w4(w.ruleId),H=w4(w.ruleCode)??w4(w.code)??(G?eV1(G):void 0),W=KY({runtimeRuleId:G,ruleCode:H,versionNumber:oV1(w.versionNumber)??$.ruleSetVersionNumber,scope:w4(w.scope),strictness:w4(w.strictness),appliedAnalysis:w.appliedAnalysis??w.analysis??w.reasoning,checkResult:w.checkResult??w.result??w.decision,findings:w.findings??w.riskPoints??w.evidence,sourcePath:`${U}.${K}`}),V=JSON.stringify(W);if(!q.has(V))q.add(V),z.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function uO($,I){if(!$)return;for(let z of I){let q=X9($,z);if(q!==void 0)return q}return}function ND0($,I){if(!$)return 0;for(let z of I){let q=X9($,z);if(Array.isArray(q))return q.length;if(q&&typeof q==="object")return Object.keys(q).length;if(typeof q==="number")return q}return 0}function X9($,I){return I.split(".").reduce((z,q)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let U=Number(q);return Number.isInteger(U)?z[U]:void 0}if(typeof z==="object")return z[q];return},$)}function lV1($,I,z){let q=I.split("."),U=$;for(let Y of q.slice(0,-1)){let J=U[Y];if(!J||typeof J!=="object"||Array.isArray(J))U[Y]={};U=U[Y]}U[q[q.length-1]??I]=z}function KY($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function Qw($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function oV1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function rV1($){let I=[];return Ok($,"document",I),I}function Ok($,I,z){if(Array.isArray($)){$.forEach((J,Q)=>Ok(J,`${I}.${Q}`,z));return}let q=Qw($);if(!q)return;let U=w4(q.label)??w4(q.name)??w4(q.title)??w4(q.fieldName),Y=q.value??q.displayValue??q.text??q.content;if(U&&Y!==void 0&&typeof Y!=="object")z.push(KY({path:I,label:U,value:Y,type:w4(q.type)??w4(q.fieldType)}));for(let[J,Q]of Object.entries(q)){if(J==="attachments")continue;Ok(Q,`${I}.${J}`,z)}}function CO($,I){return $.find((q)=>{let U=w4(q.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function tV1($){let I=[];return xO($.result,"result",I),xO($.document,"document",I),I.slice(0,20)}function xO($,I,z){if(Array.isArray($)){$.forEach((U,Y)=>xO(U,`${I}.${Y}`,z));return}let q=Qw($);if(!q)return;if(/invoice|发票/i.test(I))z.push(KY({path:I,fileName:w4(q.fileName)??w4(q.filename)??w4(q.name),buyer:q.buyer??q.buyerName??q.purchaserName,seller:q.seller??q.sellerName,amount:q.amount??q.totalAmount??q.total,taxRate:q.taxRate,category:q.category??q.type}));for(let[U,Y]of Object.entries(q))xO(Y,`${I}.${U}`,z)}function MD0($,I,z){return $.split(/\r?\n/).filter((q)=>I.some((U)=>q.includes(U))).slice(0,z)}function hO($){return $.map((I)=>{let z=nI(I);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 Lk($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function aV1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let z=await X4($,I.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`);let W=Dk(K.document,w,G),V=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...tK({webhookId:Y,...W},z.secret)},body:JSON.stringify(W)});if(!V.ok)throw Error(`Webhook 单据推送失败 ${V.status}: ${await V.text()}`);J.push({documentId:W.documentId,document:W,pushResult:await V.json()}),process.stderr.write(`✓ 单据推送成功: ${W.documentId}
`)}return{warnings:[],results:J}}function nI($){return{fileBuffer:tV1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Fk=K0(()=>{UO();Ok();Lk();Vk();eU()});import{existsSync as $Z1}from"node:fs";async function gO($,I,z={}){let U=K4().stateful?"stateful":"stateless",Y="ok",J,Q,K;try{let M=await v6($);K={id:M.user.id,name:M.user.name,isAdmin:M.user.isAdmin},Q={id:M.tenant.id,name:M.tenant.name,tenantSlug:M.tenant.tenantSlug,corporationName:M.tenant.hoseCorpConfig?.corporationName}}catch(M){Y="error",J=M instanceof Error?M.message:String(M)}let w=[];if(Y==="ok")try{w=await v$($,I.seal.endpoints.approvalStylePreferences)}catch(M){Y="error",J=`读取 Webhook 配置失败: ${M instanceof Error?M.message:String(M)}`}let G=w.length===1,H=w.map((M)=>({id:M.id,name:M.name,mode:M.mode,incomingDocumentWebhookUrl:M.incomingDocumentWebhook.url,outgoingResultWebhookUrl:M.outgoingResultWebhook,autoApprovalRate:M.autoApprovalRate,...G?{isDefault:!0}:{}})),W=G?{id:w[0].id,name:w[0].name,mode:w[0].mode}:null,V=z.webhook?m9(w,z.webhook):G?w[0]:void 0,X;if(z.filePath)if(!$Z1(z.filePath))X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let M=nI(z.filePath),v=await bI(M.fileBuffer,M.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:z.filePath,fileName:M.fileName,documentCount:v.documents.length,warnings:v.warnings}}catch(M){X={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[M instanceof Error?M.message:String(M)]}}let L=X?X.valid:!0,D=Y==="ok"&&H.length>0&&L,O=U==="stateful"?"":` --corp ${I.id}`,A="",T="";if(Y!=="ok")T=`凭证鉴权异常: ${J}`,A=`seal-use auth diagnose${O}`;else if(H.length===0)T="当前企业尚未配置任何 Webhook 集成通道",A=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${O}`;else if(X&&!X.valid)T=`材料包预检失败: ${X.errors?.join("; ")}`,A=`seal-use webhook material-pack preview ${X.filePath}${O}`;else{T=G?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${H.length} 个 Webhook 通道,等待载入`;let M=X?.filePath??"<材料包.zip>",v=G?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;A=`seal-use webhook material-pack push ${M}${v}${O}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:K},stateMode:U,authStatus:Y,authError:J,activeWebhooks:H,defaultWebhook:W,materialPack:X,statusMessage:T,nextAction:A}}var TD0=K0(()=>{G9();c4();Fk()});var Nk=K0(()=>{eU();ez();UO();Vk();Lk();Ok();Fk();TD0()});import{existsSync as ED0,mkdirSync as BD0,statSync as IZ1}from"node:fs";import{homedir as zZ1}from"node:os";import{dirname as qZ1,resolve as _O}from"node:path";function jD0($){if($.outputFile){let J=_O($.outputFile),Q=qZ1(J);if(!ED0(Q))BD0(Q,{recursive:!0});return J}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",q=$.dateTag||new Date().toISOString().slice(0,10),U=`${z}_智能洞察报告_${q}.xlsx`,Y;if($.toDownloads)Y=_O(zZ1(),"Downloads");else Y=_O(process.cwd(),"exports");if(!ED0(Y))BD0(Y,{recursive:!0});return _O(Y,U)}async function CO($,I,z={}){let q=I.name||I.id,U=jD0({outputFile:z.outputFile,toDownloads:z.toDownloads,corpName:q,corpId:I.id}),Y=new Date().toISOString(),[J,Q]=await Promise.all([$V($,{startDate:z.startDate?String(z.startDate):void 0,endDate:z.endDate?String(z.endDate):void 0,limit:z.limit??100}),zV($,{startDate:z.startDate,endDate:z.endDate}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),K=J.tagStats||[],w=[],G=Math.min(K.length,z.limit??50);for(let j=0;j<G;j++){let n=K[j];if(!n?.tagId)continue;try{let b=await IV($,{tagId:n.tagId,startDate:z.startDate?String(z.startDate):void 0,endDate:z.endDate?String(z.endDate):void 0});for(let g of b.risks||[])w.push({tagId:n.tagId,tagName:n.tagName||n.tagId,documentSN:g.documentSN||"-",documentType:g.documentType||"-",riskLevel:g.riskLevel||"warning",confidence:g.confidence??0,riskDetails:g.riskDetails||"-",reasoning:g.reasoning||"-",sourceDocumentURL:g.sourceDocumentURL,createdAt:g.createdAt})}catch{}}let H=new vD0.default.Workbook;H.creator="seal-use",H.lastModifiedBy="seal-use",H.created=new Date,H.modified=new Date;let W={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},V={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},X={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},L=H.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});L.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}],L.getRow(1).height=28,L.getRow(1).font=V,L.getRow(1).fill=W,L.g Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:wY({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:kO(I,["template.name","templateName","form.name","formName","formTitle"]),amount:SO(z,["金额","报销金额","付款金额","合计","价税合计"])??kO(I,["amount","totalAmount","expenseAmount"]),expenseType:SO(z,["费用类型","费用类别","报销类型"]),costCompany:SO(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:SO(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:NZ1($),attachments:rU($,{summary:!0}).attachments,aiResult:bO($),manualResult:pI($)?.value,hints:wY({amountMentions:CD0(q,["金额","合计","税率"],8),partyMentions:CD0(q,["买方","卖方","甲方","乙方","收款"],8)})}}function LZ1($){let I=[["result.citedRules",X9($,"result.citedRules")],["result.matchedRules",X9($,"result.matchedRules")],["result.ruleResults",X9($,"result.ruleResults")],["result.rules",X9($,"result.rules")],["pipelineData.citedRules",X9($,"pipelineData.citedRules")],["pipelineData.matchedRules",X9($,"pipelineData.matchedRules")]],z=[],q=new Set;for(let[U,Y]of I)(Array.isArray(Y)?Y:Y&&typeof Y==="object"?Object.values(Y):[]).forEach((Q,K)=>{let w=Kw(Q);if(!w)return;let G=w4(w.runtimeRuleId)??w4(w.runtimeId)??w4(w.id)??w4(w.ruleId),H=w4(w.ruleCode)??w4(w.code)??(G?PZ1(G):void 0),W=wY({runtimeRuleId:G,ruleCode:H,versionNumber:OZ1(w.versionNumber)??$.ruleSetVersionNumber,scope:w4(w.scope),strictness:w4(w.strictness),appliedAnalysis:w.appliedAnalysis??w.analysis??w.reasoning,checkResult:w.checkResult??w.result??w.decision,findings:w.findings??w.riskPoints??w.evidence,sourcePath:`${U}.${K}`}),V=JSON.stringify(W);if(!q.has(V))q.add(V),z.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function kO($,I){if(!$)return;for(let z of I){let q=X9($,z);if(q!==void 0)return q}return}function _D0($,I){if(!$)return 0;for(let z of I){let q=X9($,z);if(Array.isArray(q))return q.length;if(q&&typeof q==="object")return Object.keys(q).length;if(typeof q==="number")return q}return 0}function X9($,I){return I.split(".").reduce((z,q)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let U=Number(q);return Number.isInteger(U)?z[U]:void 0}if(typeof z==="object")return z[q];return},$)}function DZ1($,I,z){let q=I.split("."),U=$;for(let Y of q.slice(0,-1)){let J=U[Y];if(!J||typeof J!=="object"||Array.isArray(J))U[Y]={};U=U[Y]}U[q[q.length-1]??I]=z}function wY($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function Kw($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function OZ1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function FZ1($){let I=[];return Tk($,"document",I),I}function Tk($,I,z){if(Array.isArray($)){$.forEach((J,Q)=>Tk(J,`${I}.${Q}`,z));return}let q=Kw($);if(!q)return;let U=w4(q.label)??w4(q.name)??w4(q.title)??w4(q.fieldName),Y=q.value??q.displayValue??q.text??q.content;if(U&&Y!==void 0&&typeof Y!=="object")z.push(wY({path:I,label:U,value:Y,type:w4(q.type)??w4(q.fieldType)}));for(let[J,Q]of Object.entries(q)){if(J==="attachments")continue;Tk(Q,`${I}.${J}`,z)}}function SO($,I){return $.find((q)=>{let U=w4(q.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function NZ1($){let I=[];return fO($.result,"result",I),fO($.document,"document",I),I.slice(0,20)}function fO($,I,z){if(Array.isArray($)){$.forEach((U,Y)=>fO(U,`${I}.${Y}`,z));return}let q=Kw($);if(!q)return;if(/invoice|发票/i.test(I))z.push(wY({path:I,fileName:w4(q.fileName)??w4(q.filename)??w4(q.name),buyer:q.buyer??q.buyerName??q.purchaserName,seller:q.seller??q.sellerName,amount:q.amount??q.totalAmount??q.total,taxRate:q.taxRate,category:q.category??q.type}));for(let[U,Y]of Object.entries(q))fO(Y,`${I}.${U}`,z)}function CD0($,I,z){return $.split(/\r?\n/).filter((q)=>I.some((U)=>q.includes(U))).slice(0,z)}function yO($){return $.map((I)=>{let z=iI(I);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 Ak($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function MZ1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let z=await X4($,I.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`+`• 身份主体:${O}${A}
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
`+`• 时效性:换票凭证有效时间 ${V} 秒(${Math.round(V/60)} 分钟),在浏览器打开后将保留 30 天会话
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?G:w,sealResultUrl:w,ssoUrl:G,type:I.sso?"sso_link":"deep_link",expiresIn:I.sso?V:void 0,identity:H,warning:W,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Y.type==="hose"?qZ1(Y.domain):void 0,documentUrl:Q,recordId:U?.id,sourceDocumentSN:U?.sourceDocumentSN,sourceDocumentId:U?.sourceDocumentId,sourceSystem:U?.sourceSystem,missing:{enterpriseAssistUrl:J?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:q&&!Q?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:Z.object({query:Z.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:Z.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:Z.string().optional().describe("模拟批次 ID"),latest:Z.boolean().optional().describe("只返回最新一条匹配记录"),fields:Z.union([Z.string(),Z.array(Z.string())]).optional().describe("限制返回字段"),limit:Z.number().int().positive().max(100).optional(),maxScan:Z.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:Z.boolean().optional()}),handler:async($,I)=>{let z=I.sn??I.query;if(!z)throw Error("query or sn is required");let q=await UZ1($,{query:z,sn:I.sn,batchId:I.batchId,latest:I.latest,limit:I.latest?1:I.limit??20,maxScan:I.maxScan??1000}),U=await Promise.all(q.records.map((Q)=>X4($,Q.id))),Y=FD0(I.fields),J=U.map((Q)=>$Z1(Q,Y));return{query:z,sourceDocumentSN:I.sn,simulationBatchId:I.batchId,latest:I.latest??!1,total:q.total,scanned:q.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}'`},...I.includeBridge?{bridge:hO(U)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:Z.object({batchId:Z.string().describe("simulation batch ID"),query:Z.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,I)=>{let z=Tk(await _j($,I.batchId),I.query);return{batchId:I.batchId,count:z.length,records:z.map(nI),bridge:hO(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:Z.object({mode:Z.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:Z.array(Z.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:Z.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:Z.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:Z.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:Z.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:Z.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:Z.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:Z.array(Z.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:Z.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:Z.record(Z.string(),Z.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:Z.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:Z.record(Z.string(),Z.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,I)=>{let z=I.mode??"hosecloud",q=I.signKey;if(z==="hosecloud"&&!q){if(q=(await hj($)).find((Q)=>Q.signKey)?.signKey,!q)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`)}function ZZ1($){let I=[];if(I.push(`seal-use ${$.area} - ${$.title}`),$.description)I.push($.description);I.push(""),I.push("Usage:");for(let z of $.commands)for(let q of z.usage)I.push(` ${q}`);if($.commands.some((z)=>z.name))I.push(""),I.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return I.join(`
`)}function kD0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of fD0)for(let z of I.commands)for(let q of z.usage)$.push(` ${q}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var fD0;var _k=K0(()=>{k$();fD0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List all configured enterprises",usage:["seal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]"],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"}]},{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>",description:"Filter records by status (e.g. completed, failed, rejected)"},{flag:"--webhook <idOrName>",description:"Target Webhook integration on test enterprise"},{flag:"--sn-suffix <str>",description:"Optional suffix appended to documentSN"},{fla Line truncated
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?G:w,sealResultUrl:w,ssoUrl:G,type:I.sso?"sso_link":"deep_link",expiresIn:I.sso?V:void 0,identity:H,warning:W,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Y.type==="hose"?jZ1(Y.domain):void 0,documentUrl:Q,recordId:U?.id,sourceDocumentSN:U?.sourceDocumentSN,sourceDocumentId:U?.sourceDocumentId,sourceSystem:U?.sourceSystem,missing:{enterpriseAssistUrl:J?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:q&&!Q?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:Z.object({query:Z.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:Z.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:Z.string().optional().describe("模拟批次 ID"),latest:Z.boolean().optional().describe("只返回最新一条匹配记录"),fields:Z.union([Z.string(),Z.array(Z.string())]).optional().describe("限制返回字段"),limit:Z.number().int().positive().max(100).optional(),maxScan:Z.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:Z.boolean().optional()}),handler:async($,I)=>{let z=I.sn??I.query;if(!z)throw Error("query or sn is required");let q=await vZ1($,{query:z,sn:I.sn,batchId:I.batchId,latest:I.latest,limit:I.latest?1:I.limit??20,maxScan:I.maxScan??1000}),U=await Promise.all(q.records.map((Q)=>X4($,Q.id))),Y=gD0(I.fields),J=U.map((Q)=>TZ1(Q,Y));return{query:z,sourceDocumentSN:I.sn,simulationBatchId:I.batchId,latest:I.latest??!1,total:q.total,scanned:q.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}'`},...I.includeBridge?{bridge:yO(U)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:Z.object({batchId:Z.string().describe("simulation batch ID"),query:Z.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,I)=>{let z=gk(await hj($,I.batchId),I.query);return{batchId:I.batchId,count:z.length,records:z.map(iI),bridge:yO(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:Z.object({mode:Z.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:Z.array(Z.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:Z.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:Z.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:Z.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:Z.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:Z.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:Z.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:Z.array(Z.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:Z.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:Z.record(Z.string(),Z.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:Z.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:Z.record(Z.string(),Z.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,I)=>{let z=I.mode??"hosecloud",q=I.signKey;if(z==="hosecloud"&&!q){if(q=(await yj($)).find((Q)=>Q.signKey)?.signKey,!q)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`)}function kZ1($){let I=[];if(I.push(`seal-use ${$.area} - ${$.title}`),$.description)I.push($.description);I.push(""),I.push("Usage:");for(let z of $.commands)for(let q of z.usage)I.push(` ${q}`);if($.commands.some((z)=>z.name))I.push(""),I.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return I.join(`
`)}function rD0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of tD0)for(let z of I.commands)for(let q of z.usage)$.push(` ${q}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var tD0;var xk=K0(()=>{k$();tD0=[{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>",descript Line truncated
`)}
`}function ww($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function T0($,I={}){FZ1($,I);let z=`${JSON.stringify($,null,2)}
`;if(I.outputFile){XZ1(I.outputFile,z),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function FZ1($,I={}){if(I.allowFull||I.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>OZ1)throw new qO(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function pD0($,I){if(I)return;let z=$&&typeof $==="object"?$:{},q=typeof z.count==="number"?z.count:void 0,U=Array.isArray(z.rules)?z.rules.length:void 0,Y=Buffer.byteLength(JSON.stringify($),"utf-8"),J=q??U??0;if(J>LZ1||Y>DZ1)throw new qO(`Rule list is large (${J} rules, ${Y} 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 Z0($){return{allowFull:V0($.full)===!0,outputFile:j($.outputFile)??j($["output-file"])}}function cD0($=[]){console.log(nD0($))}var LZ1=100,DZ1=120000,iD0,OZ1=200000;var u1=K0(()=>{G4();k$();_k();iD0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var dD0={};A$(dD0,{selectCorp:()=>w1,runToolResult:()=>o7,runTool:()=>N0,globalConfigSummary:()=>l7});function w1($){let I=O$(),z=K4();return d7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},w9())}function l7($=K4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:SI()}}async function N0($,I,z,q,U={}){T0(await o7($,I,z,q),U)}async function o7($,I,z,q){let U=Jw.find((Q)=>Q.name===$);if(!U)throw Error(`Unknown Seal tool: ${$}`);let Y=Object.fromEntries(Object.entries(q).filter(([,Q])=>Q!==void 0)),J=U.handler;return J(I,Y,{corp:z})}var A4=K0(()=>{G9();fO();u1()});var iF0={};A$(iF0,{formatTenantDoctorDashboard:()=>BX1,diagnoseTenantContract:()=>EX1});async function EX1($,I){let z=[],q=I.environment==="test"?"test":"production",U=q==="test"?I.prodCorpId:I.testCorpId,Y=q==="test"?"prodParent":"testTarget",J=null,Q=null;try{let D=await v6($);if(J=D.user,Q=D.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:Q?.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(D){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${D instanceof Error?D.message:String(D)}`,details:{error:String(D)},recommendation:`请执行 seal-use auth login --corp ${I.id} 重新登录或更新 Token`})}let K={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},w={used:0,remaining:0};try{let D=await N3($),O=Array.isArray(D.features)?D.features:[],A=O.find((M)=>M?.code==="ai-approval");if(A){let M=typeof A.balance==="number"?A.balance:0,v=typeof A.deductionAmount==="number"&&A.deductionAmount>0?A.deductionAmount:120,x=Math.floor(M/v);if(K.balance=M,K.deductionAmount=v,K.estimatedRuns=x,M<=0)K.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:M,deductionAmount:v,estimatedRuns:x},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(x<10)K.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${M} 点 (单笔扣除 ${v} 点),仅可支持约 ${x} 笔审核`,details:{balance:M,deductionAmount:v,estimatedRuns:x},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else K.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${M} 点,预估可支持 ${x} 笔审核单据`,details:{balance:M,deductionAmount:v,estimatedRuns:x}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:O.map((M)=>M?.code)}});let T=O.find((M)=>M?.code==="approval-rules");if(T)w.used=typeof T.used==="number"?T.used:0,w.remaining=typeof T.remaining==="number"?T.remaining:0}catch(D){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${D instanceof Error?D.message:String(D)}`,details:{error: Line truncated
`)}var pF0=K0(()=>{c4()});import{dirname as Fw,resolve as vN0}from"node:path";import{fileURLToPath as YL1}from"node:url";q$();function Oz($){return!!$._zod}function _9($,I){if(Oz($))return $z($,I);return $.safeParse(I)}function nG($){if(!$)return;let I;if(Oz($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function bn($){if(Oz($)){let Y=$._zod?.def;if(Y){if(Y.value!==void 0)return Y.value;if(Array.isArray(Y.values)&&Y.values.length>0)return Y.values[0]}}let z=$._def;if(z){if(z.value!==void 0)return z.value;if(Array.isArray(z.values)&&z.values.length>0)return z.values[0]}let q=$.value;if(q!==void 0)return q;return}var ME="2025-11-25";var Up=[ME,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],h9="io.modelcontextprotocol/related-task",NH="2.0",i4=OH(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),Yp=c1([Q0(),M1().int()]),Jp=Q0(),XF1=J6({ttl:M1().optional(),pollInterval:M1().optional()}),sP0=j0({ttl:M1().optional()}),eP0=j0({taskId:Q0()}),AE=J6({progressToken:Yp.optional(),[h9]:eP0.optional()}),B$=j0({_meta:AE.optional()}),VJ=B$.extend({task:sP0.optional()}),Qp=($)=>VJ.safeParse($).success,K6=j0({method:Q0(),params:B$.loose().optional()}),d$=j0({_meta:AE.optional()}),m$=j0({method:Q0(),params:d$.loose().optional()}),w6=J6({_meta:AE.optional()}),MH=c1([Q0(),M1().int()]),Kp=j0({jsonrpc:x0(NH),id:MH,...K6.shape}).strict(),PE=($)=>Kp.safeParse($).success,wp=j0({jsonrpc:x0(NH),...m$.shape}).strict(),Gp=($)=>wp.safeParse($).success,TE=j0({jsonrpc:x0(NH),id:MH,result:w6}).strict(),ZJ=($)=>TE.safeParse($).success;var H1;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(H1||(H1={}));var EE=j0({jsonrpc:x0(NH),id:MH.optional(),error:j0({code:M1().int(),message:Q0(),data:p1().optional()})}).strict();var Hp=($)=>EE.safeParse($).success;var Wp=c1([Kp,wp,TE,EE]),LF1=c1([TE,EE]),AH=w6.strict(),$T0=d$.extend({requestId:MH.optional(),reason:Q0().optional()}),PH=m$.extend({method:x0("notifications/cancelled"),params:$T0}),IT0=j0({src:Q0(),mimeType:Q0().optional(),sizes:Y1(Q0()).optional(),theme:Q6(["light","dark"]).optional()}),XJ=j0({icons:Y1(IT0).optional()}),jz=j0({name:Q0(),title:Q0().optional()}),Vp=jz.extend({...jz.shape,...XJ.shape,version:Q0(),websiteUrl:Q0().optional(),description:Q0().optional()}),zT0=Bz(j0({applyDefaults:R4().optional()}),f1(Q0(),p1())),qT0=WJ(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},Bz(j0({form:zT0.optional(),url:i4.optional()}),f1(Q0(),p1()).optional())),UT0=J6({list:i4.optional(),cancel:i4.optional(),requests:J6({sampling:J6({createMessage:i4.optional()}).optional(),elicitation:J6({create:i4.optional()}).optional()}).optional()}),YT0=J6({list:i4.optional(),cancel:i4.optional(),requests:J6({tools:J6({call:i4.optional()}).optional()}).optional()}),JT0=j0({experimental:f1(Q0(),i4).optional(),sampling:j0({context:i4.optional(),tools:i4.optional()}).optional(),elicitation:qT0.optional(),roots:j0({listChanged:R4().optional()}).optional(),tasks:UT0.optional(),extensions:f1(Q0(),i4).optional()}),QT0=B$.extend({protocolVersion:Q0(),capabilities:JT0,clientInfo:Vp}),BE=K6.extend({method:x0("initialize"),params:QT0});var KT0=j0({experimental:f1(Q0(),i4).optional(),logging:i4.optional(),completions:i4.optional(),prompts:j0({listChanged:R4().optional()}).optional(),resources:j0({subscribe:R4().optional(),listChanged:R4().optional()}).optional(),tools:j0({listChanged:R4().optional()}).optional(),tasks:YT0.optional(),extensions:f1(Q0(),i4).optional()}),wT0=w6.extend({protocolVersion:Q0(),capabilities:KT0,serverInfo:Vp,instructions:Q0().optional()}),jE=m$.extend({method:x0("notifications/initialized"),params:d$.optional()});var TH=K6.extend({method:x0("ping"),params:B$.optional()}),GT0=j0({progress:M1(),total:l1(M1()),message:l1(Q0())}),HT0=j0({...d$.shape,...GT0.shape,progressToken:Yp}),EH=m$.extend({method:x0("notifications/progress"),params:HT0}),WT0=B$.extend({cursor:Jp.optional()}),LJ=K6.extend({params:WT0.optional()}),DJ=w6.extend({nextCursor:Jp.optional()}),VT0=Q6(["working","input_required","completed","failed","cancelled"]),OJ=j0({taskId:Q0(),status:VT0,ttl:c1([M1(),UJ()]),createdAt:Q0(),lastUpdatedAt:Q0(),pollInterval:l1(M1()),statusMessage:l1(Q0())}),vz=w6.extend({task:OJ}),ZT0=d$.merge(OJ),FJ=m$.extend({method:x0("notifications/tasks/status"),params:ZT0}),BH=K6.extend({method:x0("tasks/get"),params:B$.extend({taskId:Q0()})}),jH=w6.merge(OJ),vH=K6.extend({method:x0("tasks/result"),params:B$.extend({taskId:Q0()})}),DF1=w6.loose(),RH=LJ.extend({method:x0("tasks/list")}),gH=DJ.extend({tasks:Y1(OJ)}),_H=K6.extend({method:x0("tasks/cancel"),par Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),YS0(I)}clear(){this._buffer=void 0}}function YS0($){return Wp.parse(JSON.parse($))}function Ko($){return JSON.stringify($)+`
`}class rB{constructor($=wo.stdin,I=wo.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new oB,this._started=!1,this._ondata=(z)=>{this._readBuffer.append(z),this.processReadBuffer()},this._onerror=(z)=>{this.onerror?.(z)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let z=Ko($);if(this._stdout.write(z))I();else this._stdout.once("drain",I)})}}w$();import{dirname as Hf,join as eX1}from"node:path";import{fileURLToPath as $L1}from"node:url";import{spawnSync as Gr}from"node:child_process";var qQ={name:"seal-use",version:"0.10.20",type:"module",module:"src/server.ts",bin:{"seal-use":"src/cli.ts","seal-home":"src/cli.ts"},scripts:{dev:"bun run --watch src/server.ts",start:"bun run src/server.ts",probe:"bun run src/probe.ts",cli:"bun run src/cli.ts",check:"tsc --noEmit","build:binary":"node scripts/build-binary.mjs","build:plugin":"node scripts/build-plugin.mjs",bump:"bun run scripts/bump-version.ts","dev:override":"bun run scripts/dev-override.ts","dev:link":"bun run scripts/dev-override.ts","openapi:bundle":"bun run scripts/bundle-openapi.ts","openapi:raw":"bun run scripts/generate-raw-openapi.ts",test:"bun test"},dependencies:{"@modelcontextprotocol/sdk":"^1.29.0",exceljs:"^4.4.0","iconv-lite":"^0.7.3",ky:"^2.0.2","pinyin-pro":"^3.29.3",yauzl:"^3.4.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@types/yauzl":"^3.4.0","bun-types":"^1.3.14",typescript:"^5.9.3",yaml:"^2.9.0"}};function oS0($,I=qQ.version){let z=$.trim();if(!z)return null;let q=z.endsWith("-dirty"),U=q?z.slice(0,-6):z,Y=U.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(Y&&Y[1]&&Y[2]&&Y[3])return{baseVersion:Y[1],commitsAhead:Number.parseInt(Y[2],10),commit:Y[3],dirty:q,describe:z};let J=U.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(J&&J[1])return{baseVersion:J[1],commitsAhead:0,commit:"",dirty:q,describe:z};let Q=U.match(/^([0-9a-f]{7,40})$/);if(Q&&Q[1])return{baseVersion:I,commitsAhead:0,commit:Q[1],dirty:q,describe:z};return null}function rS0($,I,z,q){let Y=z?`+g${z}${q?".dirty":""}`:q?"+dirty":"";return`${$}-dev.${I}${Y}`}function tS0($){let I=$?.env,z=I?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,q=I?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,U=I?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,Y=I?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,J=I?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,Q=I?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,K=I?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,w=I?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,G=I?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,H=$?.cwd;if(z){let W=q==="true",X={name:"seal-use",version:z,channel:U||(W?"release":"dev"),isRelease:W};if(Y)X.git={baseVersion:Y,commitsAhead:Number.parseInt(J||"0",10),commit:Q||"",dirty:K==="true",describe:w||z};return X}if(q==="true"||G==="1")return{name:"seal-use",version:qQ.version,channel:"release",isRelease:!0};try{let W=Gr("git",["describe","--tags","--long","--dirty","--always"],{cwd:H,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(W.status===0&&W.stdout){let V=oS0(W.stdout.trim(),qQ.version);if(V){if(!V.commit){let L=Gr("git",["rev-parse","--short","HEAD"],{cwd:H,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(L.status===0&&L.stdout)V.commit=L.stdout.trim()}return{name:"seal-use",version:rS0(V.baseVersion,V.commitsAhead,V.commit,V.dirty),channel:"dev",isRelease:!1,git:V}}}}catch{}return{name:"seal-use",version:`${qQ.version}-dev.0+local`,channel:"dev",isRelease:!1}}var UQ=tS0(),q1=UQ.version,Dj=UQ.isRelease,uB1=UQ.channel;c4();lu();tu();A4();G4();u1();w$();A4();c4();c4();tK();Zk();G4();u1();k$();import{existsSync as mD0}from"node:fs";async function lD0($,I){if(!mD0($))throw Error(`File not found: ${$}`);let z=bI($);console.log(JSON.stringify(await fI(z.fileBuffer,z.fileName,I),null,2))}async function cO($,I,z,q,U){if($==="ready"||$==="status"){let Y=I??j(U.options.file)??j(U.options.input),J=await vO(z,q,{filePath:Y,webhook:j(U.options.webhook)??j(U.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.activeWebhooLine truncated
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Y=w1(q),J=w1(U);if(Y.id===J.id)throw M4(`Cannot bind enterprise '${Y.id}' to itself.`);if(Y.prodCorpId&&Y.prodCorpId!==J.id)throw M4(`Cannot use '${Y.id}' as a production enterprise because it is already registered as a test enterprise for '${Y.prodCorpId}'. Multi-tier chaining is not permitted.`);if(J.testCorpId&&J.testCorpId!==Y.id)throw M4(`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 Q=V0(z.options.force)===!0;if(Y.testCorpId&&Y.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Y.id){if(!Q)throw X5(`Enterprise binding conflict: production enterprise '${Y.id}' is bound to '${Y.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 ${Y.id} ${J.id} --confirm --force`)}if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0)){let H=Q?" --force":"";throw X5(`Refusing to bind test enterprise '${J.name}' (${J.id}) to production enterprise '${Y.name}' (${Y.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${J.id}' as a test environment.`,`seal-use corps bind-test ${Y.id} ${J.id} --confirm${H}`)}if(Y.testCorpId&&Y.testCorpId!==J.id)try{c7(Y.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Y.id)try{c7(J.prodCorpId,{testCorpId:void 0})}catch{}let w=c7(Y.id,{environment:"production",testCorpId:J.id}),G=c7(J.id,{environment:"test",prodCorpId:Y.id});T0({success:!0,productionEnterprise:{id:w.id,name:w.name,environment:w.environment,testCorpId:w.testCorpId},testEnterprise:{id:G.id,name:G.name,environment:G.environment,prodCorpId:G.prodCorpId}});return}if($==="unbind-test"){let q=I??j(z.options.corp),U=w1(q);if(!U.testCorpId&&!U.prodCorpId){T0({unbound:!1,message:`Enterprise '${U.name}' (${U.id}) does not have an active test enterprise binding.`});return}let Y=U.testCorpId?U.id:U.prodCorpId,J=U.testCorpId?U.testCorpId:U.id;if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw X5(`Refusing to unbind production enterprise '${Y}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${U.id} --confirm`);c7(Y,{testCorpId:void 0});try{c7(J,{prodCorpId:void 0})}catch{}T0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let q=I??j(z.options.corp),U=w1(q);if(!U.testCorpId)throw M4(`Production enterprise '${U.name}' (${U.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${U.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Y=w1(U.testCorpId);if(Y.environment!=="test")throw Error(`Target enterprise '${Y.name}' (${Y.id}) is marked as '${Y.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let J=await J1(U),Q=await J1(Y),[K,w,G,H,W,V,X,L]=await Promise.all([E1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),E1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),W6(J),W6(Q),r$(J).catch(()=>[]),r$(Q).catch(()=>[]),d9(J,{limit:100}).catch(()=>({articles:[]})),d9(Q,{limit:100}).catch(()=>({articles:[]}))]),D=(X.articles||[]).filter((U0)=>!U0.isDeleted),O=(L.articles||[]).filter((U0)=>!U0.isDeleted),A=new Map(O.map((U0)=>[U0.title.trim(),U0])),T=[],M=[],v=new Set(D.map((U0)=>U0.title.trim()));for(let U0 of D){let v0=U0.title.trim(),I1=A.get(v0);if(!I1)T.push(U0);else{let W1=I1.content!==U0.content,T4=(I1.purpose??"")!==(U0.purpose??""),S4=I1.enabled!==U0.enabled,b$=I1.contentType!==U0.contentType,$$=(I1.status??"")!==(U0.status??""),k6=JSON.stringify([...I1.scenarios??[]].sort())!==JSON.stringify([...U0.scenarios??[]].sort()),n$=JSON.stringify([...I1.tags??[]].sort())!==JSON.stringify([...U0.tags??[]].sort());if(W1||T4||S4||b$||$$||k6||n$)M.push({testId:I1.id,prodDoc:U0,reasons:[...W1?["content"]:[],...T4?["purpose"]:[],...S4?["enabled"]:[],...b$?["contentType"]:[],...$$?["status"]:[],...k6?["scenarios"]:[],...n$?["tags"]:[]]})}}let x=O.filter((U0)=>!v.has(U0.title.trim())),k=[...W].sort((U0,v0)=>v0.versionNumber-U0.versionNumber)[0],E=k?.versionNumber,n=([...V].sort((U0,v0)=>v0.versionNumber-U0.versionNumber)[0]?.versionNumber??0)+1,g=wF0(U.name,E,V),p=j(z.options["version-name"])??j(z.options.versionName)??GF0(U.name,E,g,n),q0={...w,tone:K.tone,language:K.language,detailLevel:K.detailLevel,outputFormat:K.outputFormat,examples:K.examples??[],prohibitedPhrases:K.prohibitedPhrases??[],customInstructions:K.customInstructions,decisionPreferences:K.decisionPreferences,thinkingDepthPreference:K.thinkingDepthPreference};if(V0(z.options["dry-run"])===!0||V0(z.options.dryRun)===!0){T0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:k?{versionNumber:k.versionNumber,versionName:k.versionName}:null,documentsCount:D.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:E??null,sourceProdVersionName:k?.versionName??null,targetTestExpectedVersionNumber:n,targetTestPublishVersionName:p,iteration:g},preferencesDiff:{decisionPreferences:{before:w.decisionPreferences,after:K.decisionPreferences},thinkingDepthPreference:{before:w.thinkingDepthPreference,after:K.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:G.rules.length,targetExistingDraftRuleCount:H.rules.length,toDeleteCount:H.rules.length,toCreateCount:G.rules.length,rulesToSync:G.rules.map((U0,v0)=>({index:v0+1,sourceRuleId:U0.id,sourceRuleCode:U0.code??v0+1,expectedTargetCode:`rule-${v0+1}`,description:U0.description,scope:U0.scope,strictness:U0.strictness}))},documentsPlan:{sourceDocumentCount:D.length,targetExistingDocumentCount:O.length,toCreateCount:T.length,toCreate:T.map((U0)=>({title:U0.title,purpose:U0.purpose,contentType:U0.contentType,scenarios:U0.scenarios})),toUpdateCount:M.length,toUpdate:M.map((U0)=>({targetDocumentId:U0.testId,title:U0.prodDoc.title,reasons:U0.reasons})),toDeleteCount:x.length,toDelete:x.map((U0)=>({targetDocumentId:U0.id,title:U0.title}))},publishingPlan:{targetCorpId:Y.id,publishVersionName:p,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(U.source.type!=="hose")return{sourceType:U.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let U0=(K.integrations??[]).filter((W1)=>W1.type==="hosecloud"),v0=new Set,I1=U0.filter((W1)=>{let T4=W1.corporationId??U.id;if(v0.has(T4))return!1;return v0.add(T4),!0});return{sourceType:"hose",outboundName:LF0(U.name),targetMode:"assisted",integrationsCount:I1.length,integrations:I1.map((W1)=>({corporationId:W1.corporationId,apiOrigin:W1.apiOrigin,customApiUrl:W1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(V0(z.options.yes)===!0||V0(z.options.confirm)===!0))throw X5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${G.rules.length} draft rules, and ${D.length} knowledge documents from production enterprise '${U.name}' (${U.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 ${U.id} --yes`);await i8(Q,q0,Y.seal.endpoints.approvalStylePreferences);let c=[];for(let U0 of x)await lW(Q,U0.id),c.push({id:U0.id,title:U0.title});let m=[];for(let U0 of M)await mW(Q,U0.testId,{title:U0.prodDoc.title,purpose:U0.prodDoc.purpose,content:U0.prodDoc.content,contentType:U0.prodDoc.contentType,status:U0.prodDoc.status,enabled:U0.prodDoc.ena Line truncated
`}function Gw($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function T0($,I={}){pZ1($,I);let z=`${JSON.stringify($,null,2)}
`;if(I.outputFile){fZ1(I.outputFile,z),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function pZ1($,I={}){if(I.allowFull||I.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>iZ1)throw new YO(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function $O0($,I){if(I)return;let z=$&&typeof $==="object"?$:{},q=typeof z.count==="number"?z.count:void 0,U=Array.isArray(z.rules)?z.rules.length:void 0,Y=Buffer.byteLength(JSON.stringify($),"utf-8"),J=q??U??0;if(J>bZ1||Y>nZ1)throw new YO(`Rule list is large (${J} rules, ${Y} 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 Z0($){return{allowFull:V0($.full)===!0,outputFile:E($.outputFile)??E($["output-file"])}}function IO0($=[]){console.log(sD0($))}var bZ1=100,nZ1=120000,eD0,iZ1=200000;var u1=K0(()=>{G4();k$();xk();eD0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var zO0={};A$(zO0,{selectCorp:()=>w1,runToolResult:()=>r7,runTool:()=>N0,globalConfigSummary:()=>o7});function w1($){let I=O$(),z=K4(),q=m7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},w9());return SX0(q.id),q}function o7($=K4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:yI()}}async function N0($,I,z,q,U={}){T0(await r7($,I,z,q),U)}async function r7($,I,z,q){let U=Qw.find((Q)=>Q.name===$);if(!U)throw Error(`Unknown Seal tool: ${$}`);let Y=Object.fromEntries(Object.entries(q).filter(([,Q])=>Q!==void 0)),J=U.handler;return J(I,Y,{corp:z})}var A4=K0(()=>{G9();wx();nO();u1()});var eF0={};A$(eF0,{formatTenantDoctorDashboard:()=>tX1,diagnoseTenantContract:()=>rX1});async function rX1($,I){let z=[],q=I.environment==="test"?"test":"production",U=q==="test"?I.prodCorpId:I.testCorpId,Y=q==="test"?"prodParent":"testTarget",J=null,Q=null;try{let D=await v6($);if(J=D.user,Q=D.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:Q?.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(D){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${D instanceof Error?D.message:String(D)}`,details:{error:String(D)},recommendation:`请执行 seal-use auth login --corp ${I.id} 重新登录或更新 Token`})}let K={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},w={used:0,remaining:0};try{let D=await M3($),O=Array.isArray(D.features)?D.features:[],A=O.find((M)=>M?.code==="ai-approval");if(A){let M=typeof A.balance==="number"?A.balance:0,v=typeof A.deductionAmount==="number"&&A.deductionAmount>0?A.deductionAmount:120,x=Math.floor(M/v);if(K.balance=M,K.deductionAmount=v,K.estimatedRuns=x,M<=0)K.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:M,deductionAmount:v,estimatedRuns:x},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(x<10)K.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${M} 点 (单笔扣除 ${v} 点),仅可支持约 ${x} 笔审核`,details:{balance:M,deductionAmount:v,estimatedRuns:x},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else K.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${M} 点,预估可支持 ${x} 笔审核单据`,details:{balance:M,deductionAmount:v,estimatedRuns:x}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:O.map((M)=>M?.code)}});let T=O.find((M)=>M?.code==="approval-rules");if(T)w.used=typeof T.used==="number"?T.used:0,w.remaining=typeof T.remaining==="number"?T.remaining:0}catch(D){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${D instanceof Error?D.message:String(DLine truncated
`)}var $N0=K0(()=>{c4()});import{dirname as Nw,resolve as fN0}from"node:path";import{fileURLToPath as RL1}from"node:url";q$();function Fz($){return!!$._zod}function _9($,I){if(Fz($))return Iz($,I);return $.safeParse(I)}function iG($){if(!$)return;let I;if(Fz($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function ln($){if(Fz($)){let Y=$._zod?.def;if(Y){if(Y.value!==void 0)return Y.value;if(Array.isArray(Y.values)&&Y.values.length>0)return Y.values[0]}}let z=$._def;if(z){if(z.value!==void 0)return z.value;if(Array.isArray(z.values)&&z.values.length>0)return z.values[0]}let q=$.value;if(q!==void 0)return q;return}var PE="2025-11-25";var Gp=[PE,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],h9="io.modelcontextprotocol/related-task",MH="2.0",i4=FH(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),Hp=c1([Q0(),M1().int()]),Wp=Q0(),fF1=J6({ttl:M1().optional(),pollInterval:M1().optional()}),wT0=j0({ttl:M1().optional()}),GT0=j0({taskId:Q0()}),TE=J6({progressToken:Hp.optional(),[h9]:GT0.optional()}),B$=j0({_meta:TE.optional()}),ZJ=B$.extend({task:wT0.optional()}),Vp=($)=>ZJ.safeParse($).success,K6=j0({method:Q0(),params:B$.loose().optional()}),d$=j0({_meta:TE.optional()}),m$=j0({method:Q0(),params:d$.loose().optional()}),w6=J6({_meta:TE.optional()}),AH=c1([Q0(),M1().int()]),Zp=j0({jsonrpc:x0(MH),id:AH,...K6.shape}).strict(),EE=($)=>Zp.safeParse($).success,Xp=j0({jsonrpc:x0(MH),...m$.shape}).strict(),Lp=($)=>Xp.safeParse($).success,BE=j0({jsonrpc:x0(MH),id:AH,result:w6}).strict(),XJ=($)=>BE.safeParse($).success;var H1;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(H1||(H1={}));var jE=j0({jsonrpc:x0(MH),id:AH.optional(),error:j0({code:M1().int(),message:Q0(),data:p1().optional()})}).strict();var Dp=($)=>jE.safeParse($).success;var Op=c1([Zp,Xp,BE,jE]),bF1=c1([BE,jE]),PH=w6.strict(),HT0=d$.extend({requestId:AH.optional(),reason:Q0().optional()}),TH=m$.extend({method:x0("notifications/cancelled"),params:HT0}),WT0=j0({src:Q0(),mimeType:Q0().optional(),sizes:Y1(Q0()).optional(),theme:Q6(["light","dark"]).optional()}),LJ=j0({icons:Y1(WT0).optional()}),vz=j0({name:Q0(),title:Q0().optional()}),Fp=vz.extend({...vz.shape,...LJ.shape,version:Q0(),websiteUrl:Q0().optional(),description:Q0().optional()}),VT0=jz(j0({applyDefaults:R4().optional()}),f1(Q0(),p1())),ZT0=VJ(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},jz(j0({form:VT0.optional(),url:i4.optional()}),f1(Q0(),p1()).optional())),XT0=J6({list:i4.optional(),cancel:i4.optional(),requests:J6({sampling:J6({createMessage:i4.optional()}).optional(),elicitation:J6({create:i4.optional()}).optional()}).optional()}),LT0=J6({list:i4.optional(),cancel:i4.optional(),requests:J6({tools:J6({call:i4.optional()}).optional()}).optional()}),DT0=j0({experimental:f1(Q0(),i4).optional(),sampling:j0({context:i4.optional(),tools:i4.optional()}).optional(),elicitation:ZT0.optional(),roots:j0({listChanged:R4().optional()}).optional(),tasks:XT0.optional(),extensions:f1(Q0(),i4).optional()}),OT0=B$.extend({protocolVersion:Q0(),capabilities:DT0,clientInfo:Fp}),vE=K6.extend({method:x0("initialize"),params:OT0});var FT0=j0({experimental:f1(Q0(),i4).optional(),logging:i4.optional(),completions:i4.optional(),prompts:j0({listChanged:R4().optional()}).optional(),resources:j0({subscribe:R4().optional(),listChanged:R4().optional()}).optional(),tools:j0({listChanged:R4().optional()}).optional(),tasks:LT0.optional(),extensions:f1(Q0(),i4).optional()}),NT0=w6.extend({protocolVersion:Q0(),capabilities:FT0,serverInfo:Fp,instructions:Q0().optional()}),RE=m$.extend({method:x0("notifications/initialized"),params:d$.optional()});var EH=K6.extend({method:x0("ping"),params:B$.optional()}),MT0=j0({progress:M1(),total:l1(M1()),message:l1(Q0())}),AT0=j0({...d$.shape,...MT0.shape,progressToken:Hp}),BH=m$.extend({method:x0("notifications/progress"),params:AT0}),PT0=B$.extend({cursor:Wp.optional()}),DJ=K6.extend({params:PT0.optional()}),OJ=w6.extend({nextCursor:Wp.optional()}),TT0=Q6(["working","input_required","completed","failed","cancelled"]),FJ=j0({taskId:Q0(),status:TT0,ttl:c1([M1(),YJ()]),createdAt:Q0(),lastUpdatedAt:Q0(),pollInterval:l1(M1()),statusMessage:l1(Q0())}),Rz=w6.extend({task:FJ}),ET0=d$.merge(FJ),NJ=m$.extend({method:x0("notifications/tasks/status"),params:ET0}),jH=K6.extend({method:x0("tasks/get"),params:B$.extend({taskId:Q0()})}),vH=w6.merge(FJ),RH=K6.extend({method:x0("tasks/result"),params:B$.extend({taskId:Q0()})}),nF1=w6.loose(),gH=DJ.extend({method:x0("tasks/list")}),_H=OJ.extend({tasks:Y1(FJ)}),CH=K6.extend({method:x0("tasks/cancel"),par Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),LS0(I)}clear(){this._buffer=void 0}}function LS0($){return Op.parse(JSON.parse($))}function Zo($){return JSON.stringify($)+`
`}class aB{constructor($=Xo.stdin,I=Xo.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new tB,this._started=!1,this._ondata=(z)=>{this._readBuffer.append(z),this.processReadBuffer()},this._onerror=(z)=>{this.onerror?.(z)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let z=Zo($);if(this._stdout.write(z))I();else this._stdout.once("drain",I)})}}w$();import{dirname as Df,join as PL1}from"node:path";import{fileURLToPath as TL1}from"node:url";import{spawnSync as Lr}from"node:child_process";var UQ={name:"seal-use",version:"0.10.20",type:"module",module:"src/server.ts",bin:{"seal-use":"src/cli.ts","seal-home":"src/cli.ts"},scripts:{dev:"bun run --watch src/server.ts",start:"bun run src/server.ts",probe:"bun run src/probe.ts",cli:"bun run src/cli.ts",check:"tsc --noEmit","build:binary":"node scripts/build-binary.mjs","build:plugin":"node scripts/build-plugin.mjs",bump:"bun run scripts/bump-version.ts","dev:override":"bun run scripts/dev-override.ts","dev:link":"bun run scripts/dev-override.ts","openapi:bundle":"bun run scripts/bundle-openapi.ts","openapi:raw":"bun run scripts/generate-raw-openapi.ts",test:"bun test"},dependencies:{"@modelcontextprotocol/sdk":"^1.29.0",exceljs:"^4.4.0","iconv-lite":"^0.7.3",ky:"^2.0.2","pinyin-pro":"^3.29.3",yauzl:"^3.4.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@types/yauzl":"^3.4.0","bun-types":"^1.3.14",typescript:"^5.9.3",yaml:"^2.9.0"}};function Yy0($,I=UQ.version){let z=$.trim();if(!z)return null;let q=z.endsWith("-dirty"),U=q?z.slice(0,-6):z,Y=U.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(Y&&Y[1]&&Y[2]&&Y[3])return{baseVersion:Y[1],commitsAhead:Number.parseInt(Y[2],10),commit:Y[3],dirty:q,describe:z};let J=U.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(J&&J[1])return{baseVersion:J[1],commitsAhead:0,commit:"",dirty:q,describe:z};let Q=U.match(/^([0-9a-f]{7,40})$/);if(Q&&Q[1])return{baseVersion:I,commitsAhead:0,commit:Q[1],dirty:q,describe:z};return null}function Jy0($,I,z,q){let Y=z?`+g${z}${q?".dirty":""}`:q?"+dirty":"";return`${$}-dev.${I}${Y}`}function Qy0($){let I=$?.env,z=I?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,q=I?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,U=I?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,Y=I?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,J=I?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,Q=I?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,K=I?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,w=I?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,G=I?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,H=$?.cwd;if(z){let W=q==="true",X={name:"seal-use",version:z,channel:U||(W?"release":"dev"),isRelease:W};if(Y)X.git={baseVersion:Y,commitsAhead:Number.parseInt(J||"0",10),commit:Q||"",dirty:K==="true",describe:w||z};return X}if(q==="true"||G==="1")return{name:"seal-use",version:UQ.version,channel:"release",isRelease:!0};try{let W=Lr("git",["describe","--tags","--long","--dirty","--always"],{cwd:H,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(W.status===0&&W.stdout){let V=Yy0(W.stdout.trim(),UQ.version);if(V){if(!V.commit){let L=Lr("git",["rev-parse","--short","HEAD"],{cwd:H,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(L.status===0&&L.stdout)V.commit=L.stdout.trim()}return{name:"seal-use",version:Jy0(V.baseVersion,V.commitsAhead,V.commit,V.dirty),channel:"dev",isRelease:!1,git:V}}}}catch{}return{name:"seal-use",version:`${UQ.version}-dev.0+local`,channel:"dev",isRelease:!1}}var YQ=Qy0(),q1=YQ.version,Fj=YQ.isRelease,Jj1=YQ.channel;c4();rD();su();A4();G4();u1();w$();A4();c4();c4();aK();Nk();G4();u1();k$();import{existsSync as qO0}from"node:fs";async function UO0($,I){if(!qO0($))throw Error(`File not found: ${$}`);let z=nI($);console.log(JSON.stringify(await bI(z.fileBuffer,z.fileName,I),null,2))}async function mO($,I,z,q,U){if($==="ready"||$==="status"){let Y=I??E(U.options.file)??E(U.options.input),J=await gO(z,q,{filePath:Y,webhook:E(U.options.webhook)??E(U.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.activeWebhooLine truncated
`+`\uD83D\uDC49 查看全部请添加: seal-use corps list --all
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}T0(O.map((A)=>({id:A.id,name:A.name,environment:A.environment??"production",sourceType:A.source.type,provider:A.source.provider??A.source.type,staffId:A.source.staffId,testCorpId:A.testCorpId,prodCorpId:A.prodCorpId,current:A.id===w})));return}if($==="get"||$==="show"){let q=I??E(z.options.corp);if(!q)throw M4("Usage: seal-use corps get <corpId>");let U=w1(q),Y=Yx(U.id),J=MX1(U);T0({id:U.id,name:U.name,environment:U.environment??"production",configFile:Y,seal:{url:J,tenantSlug:U.seal.tenantSlug??U.source.tenantSlug,customHeaderNames:U.seal.headers?Object.keys(U.seal.headers):[],customCookieNames:U.seal.cookies?Object.keys(U.seal.cookies):[],endpoints:U.seal.endpoints},source:AX1(U.source),relations:{testCorpId:U.testCorpId,prodCorpId:U.prodCorpId},auth:{refreshTtl:U.auth.refreshTtl}});return}if($==="current"){let q=w1(E(z.options.corp));T0({id:q.id,name:q.name,environment:q.environment??"production",sourceType:q.source.type,provider:q.source.provider??q.source.type,staffId:q.source.staffId,testCorpId:q.testCorpId,prodCorpId:q.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let q=I??E(z.options.corp);if(!q)throw M4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let U=w1(q),Y=$==="mark-test"?"test":$==="mark-prod"?"production":E(z.options.env)??E(z.options.environment);if(Y!=="production"&&Y!=="test")throw M4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw X5(`Refusing to change environment tag of enterprise '${U.name}' (${U.id}) to '${Y}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${U.id} --env ${Y} --confirm`);let Q=d7(U.id,{environment:Y});T0({id:Q.id,name:Q.name,environment:Q.environment,testCorpId:Q.testCorpId,prodCorpId:Q.prodCorpId});return}if($==="bind-test"){let q,U;if(I&&z.command[3])q=I,U=z.command[3];else if(I){let H=E(z.options.corp),W=E(z.options["test-corp"])??E(z.options.testCorp);if(H)q=H,U=I;else if(W)q=I,U=W}if(!q||!U)throw M4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Y=w1(q),J=w1(U);if(Y.id===J.id)throw M4(`Cannot bind enterprise '${Y.id}' to itself.`);if(Y.prodCorpId&&Y.prodCorpId!==J.id)throw M4(`Cannot use '${Y.id}' as a production enterprise because it is already registered as a test enterprise for '${Y.prodCorpId}'. Multi-tier chaining is not permitted.`);if(J.testCorpId&&J.testCorpId!==Y.id)throw M4(`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 Q=V0(z.options.force)===!0;if(Y.testCorpId&&Y.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Y.id){if(!Q)throw X5(`Enterprise binding conflict: production enterprise '${Y.id}' is bound to '${Y.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 ${Y.id} ${J.id} --confirm --force`)}if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0)){let H=Q?" --force":"";throw X5(`Refusing to bind test enterprise '${J.name}' (${J.id}) to production enterprise '${Y.name}' (${Y.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${J.id}' as a test environment.`,`seal-use corps bind-test ${Y.id} ${J.id} --confirm${H}`)}if(Y.testCorpId&&Y.testCorpId!==J.id)try{d7(Y.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Y.id)try{d7(J.prodCorpId,{testCorpId:void 0})}catch{}let w=d7(Y.id,{environment:"production",testCorpId:J.id}),G=d7(J.id,{environment:"test",prodCorpId:Y.id});T0({success:!0,productionEnterprise:{id:w.id,name:w.name,environment:w.environment,testCorpId:w.testCorpId},testEnterprise:{id:G.id,name:G.name,environment:G.environment,prodCorpId:G.prodCorpId}});return}if($==="unbind-test"){let q=I??E(z.options.corp),U=w1(q);if(!U.testCorpId&&!U.prodCorpId){T0({unbound:!1,message:`Enterprise '${U.name}' (${U.id}) does not have an active test enterprise binding.`});return}let Y=U.testCorpId?U.id:U.prodCorpId,J=U.testCorpId?U.testCorpId:U.id;if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw X5(`Refusing to unbind production enterprise '${Y}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${U.id} --confirm`);d7(Y,{testCorpId:void 0});try{d7(J,{prodCorpId:void 0})}catch{}T0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let q=I??E(z.options.corp),U=w1(q);if(!U.testCorpId)throw M4(`Production enterprise '${U.name}' (${U.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${U.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Y=w1(U.testCorpId);if(Y.environment!=="test")throw Error(`Target enterprise '${Y.name}' (${Y.id}) is marked as '${Y.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let J=await J1(U),Q=await J1(Y),[K,w,G,H,W,V,X,L]=await Promise.all([E1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),E1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),W6(J),W6(Q),r$(J).catch(()=>[]),r$(Q).catch(()=>[]),d9(J,{limit:100}).catch(()=>({articles:[]})),d9(Q,{limit:100}).catch(()=>({articles:[]}))]),D=(X.articles||[]).filter((U0)=>!U0.isDeleted),O=(L.articles||[]).filter((U0)=>!U0.isDeleted),A=new Map(O.map((U0)=>[U0.title.trim(),U0])),T=[],M=[],v=new Set(D.map((U0)=>U0.title.trim()));for(let U0 of D){let v0=U0.title.trim(),I1=A.get(v0);if(!I1)T.push(U0);else{let W1=I1.content!==U0.content,T4=(I1.purpose??"")!==(U0.purpose??""),S4=I1.enabled!==U0.enabled,b$=I1.contentType!==U0.contentType,$$=(I1.status??"")!==(U0.status??""),k6=JSON.stringify([...I1.scenarios??[]].sort())!==JSON.stringify([...U0.scenarios??[]].sort()),n$=JSON.stringify([...I1.tags??[]].sort())!==JSON.stringify([...U0.tags??[]].sort());if(W1||T4||S4||b$||$$||k6||n$)M.push({testId:I1.id,prodDoc:U0,reasons:[...W1?["content"]:[],...T4?["purpose"]:[],...S4?["enabled"]:[],...b$?["contentType"]:[],...$$?["status"]:[],...k6?["scenarios"]:[],...n$?["tags"]:[]]})}}let x=O.filter((U0)=>!v.has(U0.title.trim())),k=[...W].sort((U0,v0)=>v0.versionNumber-U0.versionNumber)[0],j=k?.versionNumber,b=([...V].sort((U0,v0)=>v0.versionNumber-U0.versionNumber)[0]?.versionNumber??0)+1,g=NF0(U.name,j,V),p=E(z.options["version-name"])??E(z.options.versionName)??MF0(U.name,j,g,b),q0={...w,tone:K.tone,language:K.language,detailLevel:K.detailLevel,outputFormat:K.outputFormat,examples:K.examples??[],prohibitedPhrases:K.prohibitedPhrases??[],customInstructions:K.customInstructions,decisionPreferences:K.decisionPreferences,thinkingDepthPreference:K.thinkingDepthPreference};if(V0(z.options["dry-run"])===!0||V0(z.options.dryRun)===!0){T0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:k?{versionNumber:k.versionNumber,versionName:k.versionName}:null,documentsCount:D.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:j??null,sourceProdVersionName:k?.versionName??null,targetTestExpectedVersionNumber:b,targetTestPublishVersionName:p,iteration:g},preferencesDiff:{decisionPreferences:{before:w.decisionPreferences,after:K.decisionPreferences},thinkingDepthPreference:{before:w.thinkingDepthPreference,after:K.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:G.rules.length,targetExistingDraftRuleCount:H.rules.length,toDeleteCount:H.rules.length,toCreateCount:G.rules.length,rulesToSync:G.rules.map((U0,v0)=>({index:v0+1,sourceRuleId:U0.id,sourceRuleCode:U0.code??v0+1,expectedTargetCode:`rule-${v0+1}`,description:U0.description,scope:U0.scope,strictness:U0.strictness}))},documentsPlan:{sourceDocumentCount:D.length,targetExistingDocumentCount:O.length,toCreateCount:T.length,toCreate:T.map((U0)=>({title:U0.title,purpose:U0.purpose,contentType:U0.contentType,scenarios:U0.scenarios})),toUpdateCount:M.length,toUpdate:M.map((U0)=>({targetDocumentId:U0.testId,title:U0.prodDoc.title,reasons:U0.reasons})),toDeleteCount:x.length,toDelete:x.map((U0)=>({targetDocumentId:U0.id,title:U0.title}))},publishingPlan:{targetCorpId:Y.id,publishVersionName:p,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(U.source.type!=="hose")return{sourceType:U.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let U0=(K.integrations??[]).filter((W1)=>W1.type==="hosecloud"),v0=new Set,I1=U0.filter((W1)=>{let T4=W1.corporationId??U.id;if(v0.has(T4))return!1;return v0.add(T4),!0});return{sourceType:"hose",outboundName:jF0(U.name),targetMode:"assisted",integrationsCount:I1.length,integrations:I1.map((W1)=>({corporationId:W1.corporationId,apiOrigin:W1.apiOrigin,customApiUrl:W1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(V0(z.options.yes)===!0||V0(z.options.confirm)===!0))throw X5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${G.rules.length} draft rules, and ${D.length} knowledge documents from production enterprise '${U.name}' (${U.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 ${U.id} --yes`);await i8(Q,q0,Y.seal.endpoints.approvalStylePreferences);let c=[];for(let U0 of x)await oW(Q,U0.id),c.push({id:U0.id,title:U0.title});let m=[];for(let U0 of M)await lW(Q,U0.testId,{title:U0.prodDoc.title,purpose:U0.prodDoc.purpose,content:U0.prodDoc.content,contentType:U0.prodDoc.contentType,status:U0.prodDoc.status,enabled:U0.prodDoc.ena Line truncated
Run 'seal-use corps bind-test ${U.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=U}else if(J=w1(U.testCorpId),J.environment!=="test"&&!Y)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 Q=j(z.options.recordId)??j(z.options["record-id"])??j(z.options.id),K=j(z.options.recordIds)??j(z.options["record-ids"]),w=K?K.split(",").map((n)=>n.trim()).filter(Boolean):void 0,G=j(z.options.sn)??j(z.options.documentSn)??j(z.options["document-sn"]),H=j(z.options.sns)??j(z.options["document-sns"]),W=H?H.split(",").map((n)=>n.trim()).filter(Boolean):void 0,V=_0(z.options.limit)??(!Q&&!w&&!G&&!W?1:void 0),X=j(z.options.status),L=j(z.options.startDate)??j(z.options["start-date"]),D=j(z.options.endDate)??j(z.options["end-date"]),O=await J1(U),A=U.id===J.id?O:await J1(J),T=j(z.options.webhook)??j(z.options.selector),M=j(z.options.snSuffix)??j(z.options["sn-suffix"]),v=j(z.options.snPrefix)??j(z.options["sn-prefix"]),x=j(z.options.docIdSuffix)??j(z.options["doc-id-suffix"]),h=j(z.options.docIdPrefix)??j(z.options["doc-id-prefix"]),k=V0(z.options.dryRun)??V0(z.options["dry-run"]),E={recordId:Q,recordIds:w,sn:G,sns:W,limit:V,status:X,startDate:L,endDate:D};console.error(`[corps-replay-test] 正式企业「${U.name}」(${U.id}) -> 测试企业「${J.name}」(${J.id})`);let f=await tU({query:E,sourceClient:O,targetClient:A,sourceCorp:U,targetCorp:J,webhookSelector:T,snPrefix:v,snSuffix:M,docIdPrefix:h,docIdSuffix:x,dryRun:k});if(k){console.error(`[corps-replay-test] 预览模式:已成功从 ${U.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(f,null,2));return}if(f.success)if(f.totalCount===1&&f.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${f.replayedDocument.documentSN}」至 ${J.name} (${f.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${f.successCount} 条单据(来自「${U.name}」)至「${J.name}」(${f.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${f.successCount} 条,失败 ${f.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${f.totalCount}`),console.log(JSON.stringify(f,null,2)),!f.success)process.exitCode=1;return}if($==="switch"){let q=I;if(!q)throw Error("Usage: seal-use corps switch <corpId>");let U=K4();if(!U.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let Y=w1(q);yI({...U,stateful:!0,defaultCorpId:Y.id}),T0({current:!0,id:Y.id,name:Y.name});return}if($==="probe-hose"){await $X1(s6(z.json));return}if($==="hose-staffs"){await IX1(s6(z.json));return}if($==="add-hose"){await zX1(s6(z.json));return}if($==="add-seal"){await qX1(s6(z.json));return}if($==="add-link"){let q=I??j(z.options.link)??j(z.options.url);if(!q)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]");await UX1(q,j(z.options.name),V0(z.options.overwrite)===!0);return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function LF0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function eZ1($,I,z,q){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let U=($.source.appKey??$.source.key)?.trim(),Y=($.source.appSecurity??$.source.password)?.trim();if(!U||!Y)return{skipped:!0,reason:"prod hose source missing appKey/appSecurity (or key/password)"};let[J,Q]=await Promise.all([E1(z,$.seal.endpoints.approvalStylePreferences).catch(()=>({})),E1(q,I.seal.endpoints.approvalStylePreferences).catch(()=>({}))]),K=(J.integrations??[]).filter((A)=>A.type==="hosecloud");if(K.length===0)return{skipped:!0,reason:"prod Seal enterprise has no hosecloud integrations configured"};let w=new Set,G=[];for(let A of K){let T=A.corporationId??$.id;if(!w.has(T))w.add(T),G.push(A)}let H=Q.integrations??[],W=new Map(H.filter((A)=>A.type==="hosecloud").map((A)=>[A.corporationId,A])),V=LF0($.name),X=[],L=G.map((A)=>{let T=W.get(A.corporationId),M=T?.signKey??tZ1(6).toString("hex");return X.push({signKey:M,outboundName:V,corporationId:A.corporationId,action:T?"updated":"created"}),{type:"hosecloud",signKey:M,outboundName:V,mode:"assisted",apiKey:U,apiSecret:Y,apiOrigin:A.apiOrigin,...A.customApiUrl?{customApiUrl:A.customApiUrl}:{},corporationId:A.corporationId}}),D=H.filter((A)=>A.type!=="hosecloud"),O={...Q,integrations:[...D,...L]};return await i8(q,O,I.seal.endpoints.approvalStylePreferences),{skipped:!1,synced:X}}async function $X1($){let I=L9($,"appKey"),z=L9($,"appSecurity"),q=b1($,"domain"),U=await tz(I,z,q),Y=await SW(U.domain,U.openapiToken).catch(()=>[]) Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${E.length} candidate administrators:
- ${f}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!L)if(!G&&Y)L=Y;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let D=b1($,"id")??W,O=V??W,A=b1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,T={id:D,name:O,environment:"production",seal:{url:A,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:H,appKey:z,appSecurity:q,corpId:W,staffId:L},auth:{refreshTtl:300}};if(G)vW(D),await VY(T);let M=zx();WF0(M,{recursive:!0,mode:448});let v=ZF0(M,`${bO(D)}.json`);if(HF0(v)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${v}. Pass "overwrite": true to replace it.`);VF0(v,`${JSON.stringify(T,null,2)}
`,{mode:384}),T0({id:D,name:O,corpId:W,domain:H,staffId:L,verified:G,path:v})}async function qX1($){let I=L9($,"token"),z=(b1($,"sealUrl")??b1($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let q=Bk($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=DF0($),J=U?await YX1(z,I,p4(Y)):void 0;OF0($,{token:I,sealUrl:z,expiresIn:q,verify:U,remote:J,custom:Y})}function DF0($){return{headers:au.parse($.headers),cookies:su.parse($.cookies)}}async function UX1($,I,z){let q=await RW($),U=d6(q.sealUrl,q.token),Y=await v6(U),J={user:Y.user,tenant:Y.tenant};gW(q.corpId,J.tenant),OF0({id:q.corpId,corpId:q.corpId,name:I,provider:"hosecloud",overwrite:z},{token:q.token,sealUrl:q.sealUrl,expiresIn:q.expiresIn,verify:!0,remote:J})}function OF0($,I){let{token:z,sealUrl:q,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??DF0($),K=J?.user,w=J?.tenant,G=b1($,"tenantSlug")??t7(w?.tenantSlug),H=b1($,"tenantId")??t7(w?.id),W=b1($,"tenantName")??t7(w?.name),V=b1($,"id")??G??H;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let X=b1($,"staffId")??t7(K?.providerUserId)??t7(K?.id)??"seal",L=b1($,"provider")??t7(K?.provider)??t7(w?.providerConfig?.provider),D=b1($,"corpId")??G??H??V,O={id:V,name:b1($,"name")??W??V,environment:"production",seal:{url:q,tenantSlug:G,headers:Q.headers,cookies:Q.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:q,expiresIn:U,staffId:X,corpId:D,tenantId:H,tenantSlug:G,tenantName:W,providerUserId:t7(K?.providerUserId),provider:L},auth:{refreshTtl:300}},A=zx();WF0(A,{recursive:!0,mode:448});let T=ZF0(A,`${bO(V)}.json`);if(HF0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);VF0(T,`${JSON.stringify(O,null,2)}
`,{mode:384}),T0({id:V,name:O.name,tenantId:H,tenantSlug:G,verified:Y,path:T})}async function YX1($,I,z={}){let q=d6($,I,z),U=await v6(q);return{user:U.user??{},tenant:U.tenant??{}}}function t7($){return typeof $==="string"&&$?$:void 0}F3();w$();c4();A4();G4();u1();async function FF0($,I){let z=await RW($),q=d6(z.sealUrl,z.token),U=await v6(q);gW(z.corpId,U.tenant);let Y=await ez(q,{note:I});T0({tenant:{id:U.tenant.id,name:U.tenant.name,tenantSlug:U.tenant.tenantSlug,corpId:z.corpId},user:{id:U.user.id,name:U.user.name,providerUserId:U.user.providerUserId,isAdmin:U.user.isAdmin},delegation:Y,expiresIn:z.expiresIn})}async function NF0($,I,z,q,U){if($==="list"){await N0("seal_delegation_list",z,q,{},Z0(U.options));return}if($==="create"){let Y=j(U.options.note)??(I?[I,...U.command.slice(2)].join(" "):void 0);await N0("seal_delegation_create",z,q,{note:Y},Z0(U.options));return}if($==="revoke"){let Y=I??j(U.options.tokenId);if(!Y)throw Error("Usage: seal-use delegation revoke <tokenId>");await N0("seal_delegation_revoke",z,q,{tokenId:Y},Z0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}A4();G4();u1();c4();k$();import{readFileSync as JX1}from"node:fs";async function MF0($,I,z,q,U,Y){if(!$||$==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);J=U}else if(J=w1(U.testCorpId),J.environment!=="test"&&!Y)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 Q=E(z.options.recordId)??E(z.options["record-id"])??E(z.options.id),K=E(z.options.recordIds)??E(z.options["record-ids"]),w=K?K.split(",").map((b)=>b.trim()).filter(Boolean):void 0,G=E(z.options.sn)??E(z.options.documentSn)??E(z.options["document-sn"]),H=E(z.options.sns)??E(z.options["document-sns"]),W=H?H.split(",").map((b)=>b.trim()).filter(Boolean):void 0,V=_0(z.options.limit)??(!Q&&!w&&!G&&!W?1:void 0),X=E(z.options.status),L=E(z.options.startDate)??E(z.options["start-date"]),D=E(z.options.endDate)??E(z.options["end-date"]),O=await J1(U),A=U.id===J.id?O:await J1(J),T=E(z.options.webhook)??E(z.options.selector),M=E(z.options.snSuffix)??E(z.options["sn-suffix"]),v=E(z.options.snPrefix)??E(z.options["sn-prefix"]),x=E(z.options.docIdSuffix)??E(z.options["doc-id-suffix"]),h=E(z.options.docIdPrefix)??E(z.options["doc-id-prefix"]),k=V0(z.options.dryRun)??V0(z.options["dry-run"]),j={recordId:Q,recordIds:w,sn:G,sns:W,limit:V,status:X,startDate:L,endDate:D};console.error(`[corps-replay-test] 正式企业「${U.name}」(${U.id}) -> 测试企业「${J.name}」(${J.id})`);let n=await aU({query:j,sourceClient:O,targetClient:A,sourceCorp:U,targetCorp:J,webhookSelector:T,snPrefix:v,snSuffix:M,docIdPrefix:h,docIdSuffix:x,dryRun:k});if(k){console.error(`[corps-replay-test] 预览模式:已成功从 ${U.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(n,null,2));return}if(n.success)if(n.totalCount===1&&n.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${n.replayedDocument.documentSN}」至 ${J.name} (${n.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${n.successCount} 条单据(来自「${U.name}」)至「${J.name}」(${n.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${n.successCount} 条,失败 ${n.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${n.totalCount}`),console.log(JSON.stringify(n,null,2)),!n.success)process.exitCode=1;return}if($==="switch"){let q=I;if(!q)throw Error("Usage: seal-use corps switch <corpId>");let U=K4();if(!U.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let Y=w1(q);uI({...U,stateful:!0,defaultCorpId:Y.id}),T0({current:!0,id:Y.id,name:Y.name});return}if($==="probe-hose"){await TX1(s6(z.json));return}if($==="hose-staffs"){await EX1(s6(z.json));return}if($==="add-hose"){await BX1(s6(z.json));return}if($==="add-seal"){await jX1(s6(z.json));return}if($==="add-link"){let q=I??E(z.options.link)??E(z.options.url);if(!q)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]");await vX1(q,E(z.options.name),V0(z.options.overwrite)===!0);return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function jF0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function PX1($,I,z,q){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let U=($.source.appKey??$.source.key)?.trim(),Y=($.source.appSecurity??$.source.password)?.trim();if(!U||!Y)return{skipped:!0,reason:"prod hose source missing appKey/appSecurity (or key/password)"};let[J,Q]=await Promise.all([E1(z,$.seal.endpoints.approvalStylePreferences).catch(()=>({})),E1(q,I.seal.endpoints.approvalStylePreferences).catch(()=>({}))]),K=(J.integrations??[]).filter((A)=>A.type==="hosecloud");if(K.length===0)return{skipped:!0,reason:"prod Seal enterprise has no hosecloud integrations configured"};let w=new Set,G=[];for(let A of K){let T=A.corporationId??$.id;if(!w.has(T))w.add(T),G.push(A)}let H=Q.integrations??[],W=new Map(H.filter((A)=>A.type==="hosecloud").map((A)=>[A.corporationId,A])),V=jF0($.name),X=[],L=G.map((A)=>{let T=W.get(A.corporationId),M=T?.signKey??NX1(6).toString("hex");return X.push({signKey:M,outboundName:V,corporationId:A.corporationId,action:T?"updated":"created"}),{type:"hosecloud",signKey:M,outboundName:V,mode:"assisted",apiKey:U,apiSecret:Y,apiOrigin:A.apiOrigin,...A.customApiUrl?{customApiUrl:A.customApiUrl}:{},corporationId:A.corporationId}}),D=H.filter((A)=>A.type!=="hosecloud"),O={...Q,integrations:[...D,...L]};return await i8(q,O,I.seal.endpoints.approvalStylePreferences),{skipped:!1,synced:X}}async function TX1($){let I=L9($,"appKey"),z=L9($,"appSecurity"),q=b1($,"domain"),U=await az(I,z,q),Y=await yW(U.domain,U.openapiToken).catch(()=>[]) Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${j.length} candidate administrators:
- ${n}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!L)if(!G&&Y)L=Y;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let D=b1($,"id")??W,O=V??W,A=b1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,T={id:D,name:O,environment:"production",seal:{url:A,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:H,appKey:z,appSecurity:q,corpId:W,staffId:L},auth:{refreshTtl:300}};if(G)RW(D),await ZY(T);let M=Ux();PF0(M,{recursive:!0,mode:448});let v=EF0(M,`${iO(D)}.json`);if(AF0(v)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${v}. Pass "overwrite": true to replace it.`);TF0(v,`${JSON.stringify(T,null,2)}
`,{mode:384}),T0({id:D,name:O,corpId:W,domain:H,staffId:L,verified:G,path:v})}async function jX1($){let I=L9($,"token"),z=(b1($,"sealUrl")??b1($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let q=Ck($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=vF0($),J=U?await RX1(z,I,p4(Y)):void 0;RF0($,{token:I,sealUrl:z,expiresIn:q,verify:U,remote:J,custom:Y})}function vF0($){return{headers:eu.parse($.headers),cookies:$x.parse($.cookies)}}async function vX1($,I,z){let q=await gW($),U=d6(q.sealUrl,q.token),Y=await v6(U),J={user:Y.user,tenant:Y.tenant};_W(q.corpId,J.tenant),RF0({id:q.corpId,corpId:q.corpId,name:I,provider:"hosecloud",overwrite:z},{token:q.token,sealUrl:q.sealUrl,expiresIn:q.expiresIn,verify:!0,remote:J})}function RF0($,I){let{token:z,sealUrl:q,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??vF0($),K=J?.user,w=J?.tenant,G=b1($,"tenantSlug")??a7(w?.tenantSlug),H=b1($,"tenantId")??a7(w?.id),W=b1($,"tenantName")??a7(w?.name),V=b1($,"id")??G??H;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let X=b1($,"staffId")??a7(K?.providerUserId)??a7(K?.id)??"seal",L=b1($,"provider")??a7(K?.provider)??a7(w?.providerConfig?.provider),D=b1($,"corpId")??G??H??V,O={id:V,name:b1($,"name")??W??V,environment:"production",seal:{url:q,tenantSlug:G,headers:Q.headers,cookies:Q.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:q,expiresIn:U,staffId:X,corpId:D,tenantId:H,tenantSlug:G,tenantName:W,providerUserId:a7(K?.providerUserId),provider:L},auth:{refreshTtl:300}},A=Ux();PF0(A,{recursive:!0,mode:448});let T=EF0(A,`${iO(V)}.json`);if(AF0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);TF0(T,`${JSON.stringify(O,null,2)}
`,{mode:384}),T0({id:V,name:O.name,tenantId:H,tenantSlug:G,verified:Y,path:T})}async function RX1($,I,z={}){let q=d6($,I,z),U=await v6(q);return{user:U.user??{},tenant:U.tenant??{}}}function a7($){return typeof $==="string"&&$?$:void 0}N3();w$();c4();A4();G4();u1();async function gF0($,I){let z=await gW($),q=d6(z.sealUrl,z.token),U=await v6(q);_W(z.corpId,U.tenant);let Y=await $q(q,{note:I});T0({tenant:{id:U.tenant.id,name:U.tenant.name,tenantSlug:U.tenant.tenantSlug,corpId:z.corpId},user:{id:U.user.id,name:U.user.name,providerUserId:U.user.providerUserId,isAdmin:U.user.isAdmin},delegation:Y,expiresIn:z.expiresIn})}async function _F0($,I,z,q,U){if($==="list"){await N0("seal_delegation_list",z,q,{},Z0(U.options));return}if($==="create"){let Y=E(U.options.note)??(I?[I,...U.command.slice(2)].join(" "):void 0);await N0("seal_delegation_create",z,q,{note:Y},Z0(U.options));return}if($==="revoke"){let Y=I??E(U.options.tokenId);if(!Y)throw Error("Usage: seal-use delegation revoke <tokenId>");await N0("seal_delegation_revoke",z,q,{tokenId:Y},Z0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}A4();G4();u1();c4();k$();import{readFileSync as gX1}from"node:fs";async function CF0($,I,z,q,U,Y){if(!$||$==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
`+`支持的审批系统与发布目标:
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
@@ -668,14 +670,14 @@ 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",Q=$==="hosecloud"?I:$,K=$==="hosecloud"?z:I;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(Q==="requirements"){await N0("seal_deploy_hosecloud_requirements",q,U,{},Z0(Y.options));return}if(Q==="list"){await N0("seal_deploy_hosecloud_list",q,U,{},Z0(Y.options));return}if(Q==="get"){let w=K??j(Y.options.signKey)??j(Y.options["sign-key"]);if(!w){let H=((await E1(q)).integrations??[]).filter((W)=>W.type==="hosecloud");if(H.length===0)throw Error(`当前企业 (${U.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 w=$==="maycur"?"每刻报销":"汇联易";throw Error(`${w}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${w}' --result-url <url> --corp <corpId>`)}let J=$==="hosecloud",Q=$==="hosecloud"?I:$,K=$==="hosecloud"?z:I;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(Q==="requirements"){await N0("seal_deploy_hosecloud_requirements",q,U,{},Z0(Y.options));return}if(Q==="list"){await N0("seal_deploy_hosecloud_list",q,U,{},Z0(Y.options));return}if(Q==="get"){let w=K??E(Y.options.signKey)??E(Y.options["sign-key"]);if(!w){let H=((await E1(q)).integrations??[]).filter((W)=>W.type==="hosecloud");if(H.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${U.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${U.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let W of H){let V=W.outboundName??"SealAI 审批",X=W.signKey,L=W.apiOrigin??"production";console.error(` • "${V}" (signKey: ${X}, 环境: ${L})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${X} --corp ${U.id}
`)}throw new N4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,H.length===1?`seal-use deploy hosecloud get ${H[0].signKey} --corp ${U.id}`:void 0)}await N0("seal_deploy_hosecloud_get",q,U,{signKey:w},Z0(Y.options));return}if(Q==="status"){await N0("seal_deploy_hosecloud_status",q,U,{},Z0(Y.options));return}if(Q==="configure"){let w=j(Y.options.input),G=w?JSON.parse(JX1(w,"utf8")):s6(Y.json);if(!G||Object.keys(G).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await N0("seal_deploy_hosecloud_configure",q,U,{...G,dryRun:V0(Y.options.dryRun)??V0(Y.options["dry-run"])},Z0(Y.options));return}if(Q==="sync"){let w=K??j(Y.options.signKey)??j(Y.options["sign-key"]),G=V0(Y.options.auto)??V0(Y.options.yes);if(!w){let W=((await E1(q)).integrations??[]).filter((X)=>X.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`)}throw new N4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,H.length===1?`seal-use deploy hosecloud get ${H[0].signKey} --corp ${U.id}`:void 0)}await N0("seal_deploy_hosecloud_get",q,U,{signKey:w},Z0(Y.options));return}if(Q==="status"){await N0("seal_deploy_hosecloud_status",q,U,{},Z0(Y.options));return}if(Q==="configure"){let w=E(Y.options.input),G=w?JSON.parse(gX1(w,"utf8")):s6(Y.json);if(!G||Object.keys(G).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await N0("seal_deploy_hosecloud_configure",q,U,{...G,dryRun:V0(Y.options.dryRun)??V0(Y.options["dry-run"])},Z0(Y.options));return}if(Q==="sync"){let w=K??E(Y.options.signKey)??E(Y.options["sign-key"]),G=V0(Y.options.auto)??V0(Y.options.yes);if(!w){let W=((await E1(q)).integrations??[]).filter((X)=>X.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${U.id}`);let V=W[0];if(V&&W.length===1&&G){let X=V.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${X})`),await N0("seal_deploy_hosecloud_sync",q,U,{signKey:X},Z0(Y.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${U.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of W){let L=X.outboundName??"SealAI 审批",D=X.signKey,O=X.apiOrigin??"production";console.error(` • "${L}" (signKey: ${D}, 环境: ${O})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${D} --corp ${U.id}
`)}if(W.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${U.id}
`);throw new N4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,W.length===1?`seal-use deploy hosecloud sync ${W[0].signKey} --corp ${U.id}`:void 0)}await N0("seal_deploy_hosecloud_sync",q,U,{signKey:w},Z0(Y.options));return}throw Error(`Unknown deploy hosecloud action: ${Q??""}. Available: requirements, list, get, status, configure, sync.`)}Wx();import{accessSync as MX1,constants as AX1,existsSync as x6,readdirSync as PX1}from"node:fs";import{homedir as TX1}from"node:os";import{join as O9}from"node:path";G9();import{existsSync as pk,mkdirSync as hF0,rmSync as OX1,writeFileSync as FX1}from"node:fs";import{homedir as SF0}from"node:os";import{dirname as NX1,join as ck}from"node:path";var AF0=`---
`);throw new N4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,W.length===1?`seal-use deploy hosecloud sync ${W[0].signKey} --corp ${U.id}`:void 0)}await N0("seal_deploy_hosecloud_sync",q,U,{signKey:w},Z0(Y.options));return}throw Error(`Unknown deploy hosecloud action: ${Q??""}. Available: requirements, list, get, status, configure, sync.`)}Ox();import{accessSync as dX1,constants as mX1,existsSync as x6,readdirSync as lX1}from"node:fs";import{homedir as oX1}from"node:os";import{join as O9}from"node:path";G9();import{existsSync as rk,mkdirSync as cF0,rmSync as iX1,writeFileSync as pX1}from"node:fs";import{homedir as dF0}from"node:os";import{dirname as cX1,join as tk}from"node:path";var hF0=`---
name: seal-use
description: "v0.10.20: 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:
@@ -871,11 +873,11 @@ 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 PF0=`interface:
`;var SF0=`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 TF0=`# Rule Lightweight Queries
`;var yF0=`# 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.
@@ -986,7 +988,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 EF0=`# Approval Bad Case Catalog
`;var uF0=`# 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.
@@ -1036,7 +1038,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 BF0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise the user-level `~/.config/seal-use/enterprises` directory is loaded. A configured\n `testEnterprisesDir` is loaded first for test-tenant workflows. The current working directory's\n `./enterprises` directory is not loaded implicitly.\n- Set `SEAL_USE_ENTERPRISES_DIR` to use one explicit directory instead. Legacy\n `~/.config/seal-home/enterprises` files are migrated to the primary directory when possible.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** with the stable prefix `👉 Next action: seal-use ...`.\n- **`Exit Code`**: `0` on success; `1` runtime/upstream failure, `2` usage/argument error, `10` explicit destructive-operation confirmation required, `11` missing/invalid authentication, and `12` output protection requiring a compact/file/query alternative.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config test-dir [<path>|--clear]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules count [--corp <corpId>]\nseal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]\nseal-use rules clear [--corp <corpId>] [--dry-run|--yes]\nseal-use rules versions [--corp <corpId>]\nseal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]\nseal-use rules get --corp <corpId> --version <number|latest> --code '#0038'\nseal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205\nseal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]\nseal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]\nseal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use rules linters [--corp <corpId>]\nseal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]\nseal-use rules map [--corp <corpId>] [--version <id|num|latest>] [--code <code>]\nseal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update [--check] [--force] [--version <v>]\nseal-use update check\nseal-use update changelog [--limit <n>]\nseal-use changelog [--limit <n>]\nseal-use mcp\nseal-use mcp config\nseal-use mcp-config\nseal-use skill dump\nseal-use skill install [--dir <path>|--local]\nseal-use skill status\nseal-use doctor [--quiet]\nseal-use doctor tenant [--corp <corpId>] [--quiet]\nseal-use doctor guide\nseal-use doctor paths\nseal-use test regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--limit <n>] [--all] [--sort <usage|name|id>] [--strict] [--corp <corpId>]\nseal-use corps search <query> [--env <production|test>] [--strict]\nseal-use corps get <corpId>\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps mark <corpId> --env <production|test> [--confirm]\nseal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]\nseal-use corps unbind-test [<corpId>] [--confirm]\nseal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]\nseal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]\nseal-use corps regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]\nseal-use auth diagnose [--corp <corpId>]\nseal-use auth hose-link [--corp <corpId>] [--expire 7200]Line truncated
`;var xF0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise the user-level `~/.config/seal-use/enterprises` directory is loaded. A configured\n `testEnterprisesDir` is loaded first for test-tenant workflows. The current working directory's\n `./enterprises` directory is not loaded implicitly.\n- Set `SEAL_USE_ENTERPRISES_DIR` to use one explicit directory instead. Legacy\n `~/.config/seal-home/enterprises` files are migrated to the primary directory when possible.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** with the stable prefix `👉 Next action: seal-use ...`.\n- **`Exit Code`**: `0` on success; `1` runtime/upstream failure, `2` usage/argument error, `10` explicit destructive-operation confirmation required, `11` missing/invalid authentication, and `12` output protection requiring a compact/file/query alternative.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config test-dir [<path>|--clear]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules count [--corp <corpId>]\nseal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]\nseal-use rules clear [--corp <corpId>] [--dry-run|--yes]\nseal-use rules versions [--corp <corpId>]\nseal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]\nseal-use rules get --corp <corpId> --version <number|latest> --code '#0038'\nseal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205\nseal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]\nseal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]\nseal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use rules linters [--corp <corpId>]\nseal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]\nseal-use rules map [--corp <corpId>] [--version <id|num|latest>] [--code <code>]\nseal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update [--check] [--force] [--version <v>]\nseal-use update check\nseal-use update changelog [--limit <n>]\nseal-use changelog [--limit <n>]\nseal-use mcp\nseal-use mcp config\nseal-use mcp-config\nseal-use skill dump\nseal-use skill install [--dir <path>|--local]\nseal-use skill status\nseal-use doctor [--quiet]\nseal-use doctor tenant [--corp <corpId>] [--quiet]\nseal-use doctor guide\nseal-use doctor paths\nseal-use test regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--limit <n>] [--all] [--sort <usage|name|id>] [--strict] [--corp <corpId>]\nseal-use corps search <query> [--env <production|test>] [--strict]\nseal-use corps get <corpId>\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps mark <corpId> --env <production|test> [--confirm]\nseal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]\nseal-use corps unbind-test [<corpId>] [--confirm]\nseal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]\nseal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]\nseal-use corps regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--overwrite]\nseal-use auth diagnose [--corp <corpId>]\nseal-use auth hose-link [--corp <corpId>] [--expire 7200]Line truncated
Use this workflow when a customer disputes an AI approval finding about an attachment, invoice, receipt, OCR result, or a UI-highlighted audit result.
@@ -1257,7 +1259,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 RF0=`# Customer Feedback Rule Remediation
`;var bF0=`# Customer Feedback Rule Remediation
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.
@@ -1427,7 +1429,7 @@ Return a compact report containing:
- New version number and version name, if published
- Verification result
- Whether a regression rerun was performed
`;var gF0=`# Enterprise Onboarding
`;var nF0=`# 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.
@@ -1561,7 +1563,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 _F0=`# Hose Enterprise Auth
`;var iF0=`# Hose Enterprise Auth
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
@@ -1626,7 +1628,7 @@ Important:
- \`seal-use auth diagnose\` proves this stage works but redacts the token, so it is not enough when the user needs the actual clickable Hose link.
- **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.
- If the CLI later provides a dedicated command for this, prefer that command.
`;var CF0=`# Hose Enterprise Initialization & Automated Discovery
`;var pF0=`# 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.
@@ -1732,7 +1734,7 @@ seal-use corps hose-staffs --json '{
}'
\`\`\`
* 直接使用指定 ID 完成接入并进行连通性验证。
`;var yF0={"SKILL.md":AF0,"agents/openai.yaml":PF0,"references/rule-lightweight.md":TF0,"references/approval-bad-cases.md":EF0,"references/cli.md":BF0,"references/approval-run-lightweight.md":jF0,"references/approval-attachment-trace.md":vF0,"references/customer-feedback-rule-remediation.md":RF0,"references/enterprise-onboarding.md":gF0,"references/hose-enterprise-auth.md":_F0,"references/hose-enterprise-init.md":CF0};function uF0(){return yF0["SKILL.md"]||""}function pI(){return ck(SF0(),".agents","skills","seal-use")}function xF0(){return ck(SF0(),".agents","skills","seal-home")}function kF0(){let $=xF0();if(pk($))try{return OX1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function dk($=pI()){kF0(),hF0($,{recursive:!0});let I=[];for(let[z,q]of Object.entries(yF0)){let U=ck($,z);hF0(NX1(U),{recursive:!0}),FX1(U,q,"utf8"),I.push(z)}return{targetDir:$,files:I}}function mk(){let $=xF0(),I=pI(),z=pk($),q=pk(I);if(z||q)return kF0(),dk(I),{synced:!0,targetDir:I};return{synced:!1}}var lk=[{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"}],ok=[{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 路径杜绝写文件与环境篡改。"}],rk=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同 Line truncated
`;var mF0={"SKILL.md":hF0,"agents/openai.yaml":SF0,"references/rule-lightweight.md":yF0,"references/approval-bad-cases.md":uF0,"references/cli.md":xF0,"references/approval-run-lightweight.md":kF0,"references/approval-attachment-trace.md":fF0,"references/customer-feedback-rule-remediation.md":bF0,"references/enterprise-onboarding.md":nF0,"references/hose-enterprise-auth.md":iF0,"references/hose-enterprise-init.md":pF0};function lF0(){return mF0["SKILL.md"]||""}function cI(){return tk(dF0(),".agents","skills","seal-use")}function oF0(){return tk(dF0(),".agents","skills","seal-home")}function rF0(){let $=oF0();if(rk($))try{return iX1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function ak($=cI()){rF0(),cF0($,{recursive:!0});let I=[];for(let[z,q]of Object.entries(mF0)){let U=tk($,z);cF0(cX1(U),{recursive:!0}),pX1(U,q,"utf8"),I.push(z)}return{targetDir:$,files:I}}function sk(){let $=oF0(),I=cI(),z=rk($),q=rk(I);if(z||q)return rF0(),ak(I),{synced:!0,targetDir:I};return{synced:!1}}var ek=[{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"}],$f=[{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 路径杜绝写文件与环境篡改。"}],If=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同 Line truncated
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
@@ -1755,14 +1757,14 @@ seal-use corps hose-staffs --json '{
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
| :--- | :--- | :--- | :--- |
${lk.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
${ek.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
`)}
---
## 3. 安全与数据隐私保证
${ok.map(($,I)=>`### 3.${I+1} ${$.topic}
${$f.map(($,I)=>`### 3.${I+1} ${$.topic}
- **安全承诺**:${$.guarantee}
- **实现约束**:${$.enforcement}
`).join(`
@@ -1772,7 +1774,7 @@ ${ok.map(($,I)=>`### 3.${I+1} ${$.topic}
## 4. 业务域能力图谱
${rk.map(($)=>`### \`seal-use ${$.domain}\`
${If.map(($)=>`### \`seal-use ${$.domain}\`
* **能力定位**:${$.summary}
* **核心命令**:${$.primaryCommands.map((I)=>`\`seal-use ${I}\``).join("、")}
`).join(`
@@ -1785,15 +1787,15 @@ ${rk.map(($)=>`### \`seal-use ${$.domain}\`
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
`}function bF0($){if(!x6($))return 0;try{return PX1($).filter((I)=>I.endsWith(".json")).length}catch{return 0}}function sO($){try{return MX1($,AX1.W_OK),!0}catch{return!1}}function tk(){let $=TX1(),I=O9($,".config","seal-use"),z=O9(I,"enterprises"),q=O9(I,"config.json"),U=O9(I,"seal_tokens.json"),Y=O9(I,"mappings"),J=pI(),Q=O9($,"Downloads"),w=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",O9($,".local","bin","seal-use"),O9($,"bin","seal-use")].find((M)=>x6(M))??process.execPath,G={configDir:{name:"配置根目录",path:I,exists:x6(I),writable:x6(I)?sO(I):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:x6(z),writable:x6(z)?sO(z):!1,fileCount:bF0(z),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:q,exists:x6(q),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:U,exists:x6(U),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Y,exists:x6(Y),fileCount:bF0(Y),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:x6(O9(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:Q,exists:x6(Q),writable:x6(Q)?sO(Q):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:Q8,exists:x6(Q8),writable:x6(Q8)?sO(Q8):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:L5,exists:x6(L5),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:w,exists:x6(w),description:"系统全局命令执行入口"}},H=[];try{H=O$()}catch{H=[]}let V=K4().defaultCorpId??H[0]?.id,X=H.find((M)=>M.id===V),L=H.filter((M)=>(M.environment??"production").toLowerCase()==="test").length,D=H.length-L,O=[];if(O.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),G.configDir?.exists&&G.configDir.writable)O.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${I} (正常读写)`});else if(G.configDir?.exists)O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${I} (存在但可能不可写)`});else O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${I},首次运行配置命令时将自动创建`});if(H.length>0)O.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${H.length} 家企业 (正式: ${D}, 测试: ${L})`});else O.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(G.agentSkillDir?.exists)O.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else O.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let A=O.some((M)=>M.status==="warn"||M.status==="error"),T=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:A?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:q1,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:T},directories:G,enterprises:{total:H.length,productionCount:D,testCount:L,activeCorpId:X?.id,activeCorpName:X?.name},checks:O,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:lk.length,securityPoliciesCount:ok.length,domainCapabilitiesCount:rk.length,guideCommand:"seal-use doctor guide"}}}function nF0($){let I=[],z=$.doctor==="ok"?"✨":"⚠️";I.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${z}`),I.push("─────────────────────────────────────────────────────────────"),I.push("【运行环境】"),I.push(` 版本号: ${$.runtime.version}`),I.push(` 程序路径: ${$.runtime.executablePath}`),I.push(` 操作系统: ${$.runtime.platform}`),I.push(` 执行引擎: ${$.runtime.engine}`),I.push(""),I.push("【核心路径状态】");for(let[,q]of Object.entries($.directories)){let U=q.exists?"✓":"○",Y=q.exists?q.fileCount!==void 0?`(${q.fileCount} 个文件)`:q.writable?"(就绪/可写)":"(存在)":"(未创建)";I.push(` ${U} ${q.name.padEnd(16," ")}: ${q.path} ${Y}`)}if(I.push(""),I.push("【企业资产概览】"),I.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)I.push(` 当前激活企业: ${$.enterprises.activeCLine truncated
`)}G4();u1();async function cF0($,I,z){let q=($??I??"").toLowerCase();if(q==="guide"||q==="doc"||q==="knowledge"||q==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(fF0());return}if(q==="paths"||q==="dirs"||q==="directories"){let J=tk();T0(J.directories);return}if(q==="tenant"||q==="corp"||q==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (A4(),dD0)),{createSealClient:Q}=await Promise.resolve().then(() => (w$(),wr)),{stringOption:K}=await Promise.resolve().then(() => (G4(),xD0)),{diagnoseTenantContract:w,formatTenantDoctorDashboard:G}=await Promise.resolve().then(() => (pF0(),iF0)),H=K(z.options.corp)??(I&&I!==q?I:void 0)??(z.command[2]&&z.command[2]!==q?z.command[2]:void 0),W=J(H),V=await Q(W),X=await w(V,W);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(G(X));T0(X);return}let U=tk();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(nF0(U));T0(U)}G4();import{createServer as _X1}from"node:http";A4();import{URL as vX1}from"node:url";var dF0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.20",description:`Planned HTTP contract for the seal-use wrapped backend API.
`}function aF0($){if(!x6($))return 0;try{return lX1($).filter((I)=>I.endsWith(".json")).length}catch{return 0}}function $F($){try{return dX1($,mX1.W_OK),!0}catch{return!1}}function zf(){let $=oX1(),I=O9($,".config","seal-use"),z=O9(I,"enterprises"),q=O9(I,"config.json"),U=O9(I,"seal_tokens.json"),Y=O9(I,"mappings"),J=cI(),Q=O9($,"Downloads"),w=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",O9($,".local","bin","seal-use"),O9($,"bin","seal-use")].find((M)=>x6(M))??process.execPath,G={configDir:{name:"配置根目录",path:I,exists:x6(I),writable:x6(I)?$F(I):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:x6(z),writable:x6(z)?$F(z):!1,fileCount:aF0(z),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:q,exists:x6(q),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:U,exists:x6(U),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Y,exists:x6(Y),fileCount:aF0(Y),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:x6(O9(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:Q,exists:x6(Q),writable:x6(Q)?$F(Q):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:Q8,exists:x6(Q8),writable:x6(Q8)?$F(Q8):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:L5,exists:x6(L5),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:w,exists:x6(w),description:"系统全局命令执行入口"}},H=[];try{H=O$()}catch{H=[]}let V=K4().defaultCorpId??H[0]?.id,X=H.find((M)=>M.id===V),L=H.filter((M)=>(M.environment??"production").toLowerCase()==="test").length,D=H.length-L,O=[];if(O.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),G.configDir?.exists&&G.configDir.writable)O.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${I} (正常读写)`});else if(G.configDir?.exists)O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${I} (存在但可能不可写)`});else O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${I},首次运行配置命令时将自动创建`});if(H.length>0)O.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${H.length} 家企业 (正式: ${D}, 测试: ${L})`});else O.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(G.agentSkillDir?.exists)O.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else O.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let A=O.some((M)=>M.status==="warn"||M.status==="error"),T=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:A?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:q1,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:T},directories:G,enterprises:{total:H.length,productionCount:D,testCount:L,activeCorpId:X?.id,activeCorpName:X?.name},checks:O,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:ek.length,securityPoliciesCount:$f.length,domainCapabilitiesCount:If.length,guideCommand:"seal-use doctor guide"}}}function sF0($){let I=[],z=$.doctor==="ok"?"✨":"⚠️";I.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${z}`),I.push("─────────────────────────────────────────────────────────────"),I.push("【运行环境】"),I.push(` 版本号: ${$.runtime.version}`),I.push(` 程序路径: ${$.runtime.executablePath}`),I.push(` 操作系统: ${$.runtime.platform}`),I.push(` 执行引擎: ${$.runtime.engine}`),I.push(""),I.push("【核心路径状态】");for(let[,q]of Object.entries($.directories)){let U=q.exists?"✓":"○",Y=q.exists?q.fileCount!==void 0?`(${q.fileCount} 个文件)`:q.writable?"(就绪/可写)":"(存在)":"(未创建)";I.push(` ${U} ${q.name.padEnd(16," ")}: ${q.path} ${Y}`)}if(I.push(""),I.push("【企业资产概览】"),I.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)I.push(` 当前激活企业: ${$.enterprises.activeCLine truncated
`)}G4();u1();async function IN0($,I,z){let q=($??I??"").toLowerCase();if(q==="guide"||q==="doc"||q==="knowledge"||q==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(tF0());return}if(q==="paths"||q==="dirs"||q==="directories"){let J=zf();T0(J.directories);return}if(q==="tenant"||q==="corp"||q==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (A4(),zO0)),{createSealClient:Q}=await Promise.resolve().then(() => (w$(),Xr)),{stringOption:K}=await Promise.resolve().then(() => (G4(),oD0)),{diagnoseTenantContract:w,formatTenantDoctorDashboard:G}=await Promise.resolve().then(() => ($N0(),eF0)),H=K(z.options.corp)??(I&&I!==q?I:void 0)??(z.command[2]&&z.command[2]!==q?z.command[2]:void 0),W=J(H),V=await Q(W),X=await w(V,W);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(G(X));T0(X);return}let U=zf();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(sF0(U));T0(U)}G4();import{createServer as IL1}from"node:http";A4();import{URL as sX1}from"node:url";var zN0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.20",description:`Planned HTTP contract for the seal-use wrapped backend API.
These endpoints describe the intended stable API for frontend developers and agents once
the HTTP adapter is implemented.
They are not the raw downstream Seal endpoints. seal-use is responsible for enterprise
selection, source authentication, response compaction, and diagnostics-friendly fields.
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],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",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",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",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",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 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:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",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:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",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:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{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:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",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:{"2 Line truncated
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],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",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",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",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",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 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:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",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:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",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:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{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:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",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:{"2 Line truncated
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
@@ -1817,24 +1819,24 @@ selection, source authentication, response compaction, and diagnostics-friendly
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
></script>
</body>
</html>`}async function t4($,I,z,q){let U=$.handler;return U(I,z,{corp:q})}async function lF0($,I){if(I.setHeader("Access-Control-Allow-Origin","*"),I.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),I.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){I.writeHead(204),I.end();return}let z=$.headers.host||"localhost",q=$.headers["x-forwarded-proto"]||"http",U=new vX1($.url||"/",`${q}://${z}`),Y=U.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Y==="/"){e1(I,200,{name:"seal-use",version:q1,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"&&Y==="/docs"){gX1(I,200,mF0());return}if(J==="GET"&&Y==="/openapi.json"){e1(I,200,eO());return}if(J==="GET"&&Y==="/health"){e1(I,200,{status:"ok",version:q1,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Y==="/shutdown"||Y==="/api/shutdown")){e1(I,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(J==="POST"&&Y==="/api/cli"){let Q=await IF($),K=(typeof Q?.command==="string"?Q.command:"").trim();if(!K){$F(I,400,"Missing 'command' property in request body");return}let w=ak(K),G=w[0]==="seal-use"||w[0]==="seal-home"||w[0]?.endsWith("/seal-use")||w[0]?.endsWith("/seal-home")?w.slice(1):w,H=await Xw(G),W=void 0;try{if(H.stdout.trim().startsWith("{")||H.stdout.trim().startsWith("["))W=JSON.parse(H.stdout)}catch{}e1(I,H.isError?400:200,{success:!H.isError,stdout:H.stdout,stderr:H.stderr,exitCode:H.exitCode,data:W});return}if(J==="POST"&&Y.startsWith("/api/tool/")){let Q=Y.slice(10).trim(),K=n4(Q);if(!K){$F(I,404,`Tool not found: '${Q}'`);return}let w=await IF($)||{},G=e6($,U,w),H=w1(G),W=await J1(H),V={...w};delete V.corp;let X=await t4(K,W,V,H);e1(I,200,X);return}if(Y.startsWith("/v1/")){if(await RX1($,I,J,Y,U))return}$F(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let K=Q instanceof Error?Q.message:String(Q);$F(I,500,K)}}async function RX1($,I,z,q,U){let Y=Object.fromEntries(U.searchParams.entries());if(z==="GET"&&q==="/v1/corps"){let J=O$(),Q=K4();return e1(I,200,{count:J.length,mode:Q.stateful?"stateful":"stateless",defaultCorpId:Q.defaultCorpId,corps:J.map((K)=>({id:K.id,name:K.name,sourceType:K.source.type,sealUrl:K.seal?.url}))}),!0}if(z==="GET"&&q==="/v1/whoami"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_whoami"),G=await t4(w,K,{},Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/session"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_session_get"),G=await t4(w,K,{},Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/summary"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_runs_summary"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/stats"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_runs_stats"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/pick"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_run_pick"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/url"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_run_url_get"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(q.startsWith("/v1/approval-runs/")){let J=q.slice(18).split("/"),Q=J[0],K=J[1];if(Q&&!["summary","pick","stats","url","bridge"].includes(Q)){let w=e6($,U,Y),G=w1(w),H=await J1(G);if(!K){let W=n4("seal_approval_run_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="attachments"){let W=n4("seal_approval_run_attachments_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="cited-rules"){let W=n4("seal_approval_run_cited_rules_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="document-summary"){let W=n4("seal_approval_run_document_summary_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="result"){let W=n4("seal_approval_run_result_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}}}if(z==="GET"&&q==="/v1/approval-runs"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_runs_search"),G=await t4(w,K,{...Y,limit:Y.limit?Number(Y.limit):void 0,offset:Y.offset?Number(Y.offset):void 0,includeBridge:Y.includeBridge==="true"},Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval/rules"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_rules_list"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/simulation/batches"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_simulation_batches_list"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="POST"&&q==="/v1/simulation/create-batch"){let J=await IF($)||{},Q=e6($,U,J),K=w1(Q),w=await J1Line truncated
</html>`}async function t4($,I,z,q){let U=$.handler;return U(I,z,{corp:q})}async function UN0($,I){if(I.setHeader("Access-Control-Allow-Origin","*"),I.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),I.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){I.writeHead(204),I.end();return}let z=$.headers.host||"localhost",q=$.headers["x-forwarded-proto"]||"http",U=new sX1($.url||"/",`${q}://${z}`),Y=U.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Y==="/"){e1(I,200,{name:"seal-use",version:q1,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"&&Y==="/docs"){$L1(I,200,qN0());return}if(J==="GET"&&Y==="/openapi.json"){e1(I,200,IF());return}if(J==="GET"&&Y==="/health"){e1(I,200,{status:"ok",version:q1,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Y==="/shutdown"||Y==="/api/shutdown")){e1(I,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(J==="POST"&&Y==="/api/cli"){let Q=await qF($),K=(typeof Q?.command==="string"?Q.command:"").trim();if(!K){zF(I,400,"Missing 'command' property in request body");return}let w=qf(K),G=w[0]==="seal-use"||w[0]==="seal-home"||w[0]?.endsWith("/seal-use")||w[0]?.endsWith("/seal-home")?w.slice(1):w,H=await Lw(G),W=void 0;try{if(H.stdout.trim().startsWith("{")||H.stdout.trim().startsWith("["))W=JSON.parse(H.stdout)}catch{}e1(I,H.isError?400:200,{success:!H.isError,stdout:H.stdout,stderr:H.stderr,exitCode:H.exitCode,data:W});return}if(J==="POST"&&Y.startsWith("/api/tool/")){let Q=Y.slice(10).trim(),K=n4(Q);if(!K){zF(I,404,`Tool not found: '${Q}'`);return}let w=await qF($)||{},G=e6($,U,w),H=w1(G),W=await J1(H),V={...w};delete V.corp;let X=await t4(K,W,V,H);e1(I,200,X);return}if(Y.startsWith("/v1/")){if(await eX1($,I,J,Y,U))return}zF(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let K=Q instanceof Error?Q.message:String(Q);zF(I,500,K)}}async function eX1($,I,z,q,U){let Y=Object.fromEntries(U.searchParams.entries());if(z==="GET"&&q==="/v1/corps"){let J=O$(),Q=K4();return e1(I,200,{count:J.length,mode:Q.stateful?"stateful":"stateless",defaultCorpId:Q.defaultCorpId,corps:J.map((K)=>({id:K.id,name:K.name,sourceType:K.source.type,sealUrl:K.seal?.url}))}),!0}if(z==="GET"&&q==="/v1/whoami"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_whoami"),G=await t4(w,K,{},Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/session"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_session_get"),G=await t4(w,K,{},Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/summary"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_runs_summary"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/stats"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_runs_stats"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/pick"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_run_pick"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/url"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_run_url_get"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(q.startsWith("/v1/approval-runs/")){let J=q.slice(18).split("/"),Q=J[0],K=J[1];if(Q&&!["summary","pick","stats","url","bridge"].includes(Q)){let w=e6($,U,Y),G=w1(w),H=await J1(G);if(!K){let W=n4("seal_approval_run_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="attachments"){let W=n4("seal_approval_run_attachments_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="cited-rules"){let W=n4("seal_approval_run_cited_rules_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="document-summary"){let W=n4("seal_approval_run_document_summary_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}if(K==="result"){let W=n4("seal_approval_run_result_get"),V=await t4(W,H,{recordId:Q,...Y},G);return e1(I,200,V),!0}}}if(z==="GET"&&q==="/v1/approval-runs"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_runs_search"),G=await t4(w,K,{...Y,limit:Y.limit?Number(Y.limit):void 0,offset:Y.offset?Number(Y.offset):void 0,includeBridge:Y.includeBridge==="true"},Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/approval/rules"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_approval_rules_list"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="GET"&&q==="/v1/simulation/batches"){let J=e6($,U,Y),Q=w1(J),K=await J1(Q),w=n4("seal_simulation_batches_list"),G=await t4(w,K,Y,Q);return e1(I,200,G),!0}if(z==="POST"&&q==="/v1/simulation/create-batch"){let J=await qF($)||{},Q=e6($,U,J),K=w1(Q),w=await J1Line truncated
\uD83D\uDE80 seal-use HTTP Server (v${q1}) started`),console.error(` URL: http://${z}:${I}`),console.error(` Docs: http://${z}:${I}/docs`),console.error(` OpenAPI: http://${z}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${I}/api/cli`),console.error(` REST API: http://${z}:${I}/v1/...
`);U(q)})})}async function oF0($){let I=_0($.options.port)??_0($.options.p),z=j($.options.host)??j($.options.h),q=await UF({port:I,host:z}),U=()=>{q.close(()=>{process.exit(0)})};process.on("SIGINT",U),process.on("SIGTERM",U),await new Promise(()=>{})}A4();u1();async function rF0($,I,z,q){if($==="config"||$==="get"){await N0("seal_llm_config_get",I,z,{},Z0(q.options));return}if($==="providers"||$==="list"){await N0("seal_llm_providers_list",I,z,{},Z0(q.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}u1();async function tF0($,I){if($==="config"||$==="json"){sk();return}await ek()}function sk(){T0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}u1();function aF0($){let I=eO();T0(I,{...Z0($.options),allowFull:!0})}A4();u1();async function sF0($,I,z,q){if($==="available"){await N0("seal_permissions_available_list",I,z,{},Z0(q.options));return}if($==="configs"||$==="list"){await N0("seal_permissions_configs_list",I,z,{},Z0(q.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}A4();G4();u1();import{readFileSync as eF0}from"node:fs";async function $N0($,I,z,q,U,Y,J){if(!$||$==="get"){await N0("seal_preference_get",U,Y,{},Z0(J.options));return}if($==="decision"){if(I==="update"||!I){let Q=j(J.options.input),K=Q?JSON.parse(eF0(Q,"utf8")):s6(J.json);if(!K||Object.keys(K).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await N0("seal_preference_decision_update",U,Y,{...K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let Q=j(J.options.default)??j(J.options.level)??q;if(Q!=="medium"&&Q!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await N0("seal_preference_thinking_depth_set",U,Y,{defaultLevel:Q,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}if(I==="policies"){if(z==="list"||!z){await N0("seal_preference_thinking_depth_policies_list",U,Y,{},Z0(J.options));return}if(z==="upsert"){let Q=j(J.options.input),K=Q?JSON.parse(eF0(Q,"utf8")):s6(J.json);if(!K||!K.id||!K.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await N0("seal_preference_thinking_depth_policies_upsert",U,Y,{...K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}if(z==="remove"||z==="delete"){let Q=q??j(J.options.id)??j(J.options.policyId);if(!Q)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await N0("seal_preference_thinking_depth_policies_remove",U,Y,{policyId:Q,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}G9();w$();c4();async function IN0($={}){let I=O$(),z=K4(),q=d7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},w9());console.log(`[probe] corp=${q.id} source=${q.source.type}`);let U=await VY(q);console.log("[probe] seal enterprise"),console.log(JSON.stringify(U,null,2));let Y=await J1(q),J=await aW(Y,{documentLimit:20,stylePreferencesEndpoint:q.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))}G4();async function zN0($,I,z){let q=I??j(z.options.corp)??($&&$!=="--corp"?$:void 0);await IN0({corpId:q})}Zx();A4();k$();G4();u1();async function $f($,I,z,q,U){if($==="count"){await N0("seal_approval_rules_list",z,q,{countOnly:!0},Z0(U.options));return}if($==="list"){if(V0(U.options.count)){await N0("seal_approval_rules_list",z,q,{countOnly:!0},Z0(U.options));return}let Y=_0(U.options.limit),J=_0(U.options.offset);if(V0(U.options.summary)){await N0("seal_approval_rules_list",z,q,{fields:iD0,limit:Y,offset:J},Z0(U.options));return}let Q=await o7("seal_approval_rules_list",z,q,{limit:Y,offset:J});pD0(Q,V0(U.options.full)===!0),T0(Q);return}if($==="clear"){let Y=V0(U.options.yes)===!0,J=V0(U.options.dryRun)??V0(U.options["dry-run"])??!Y;if(!Y&&!J)throw X5("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${q.id} --dry-run`);let Q=await o7("seal_approval_rules_clear",z,q,{dryRun:J,recode:V0(U.options.recode)});if(!Y&&J&&Q&&typeof Q==="object"){T0({...Q,nextCommand:`seal-use rules clear --corp ${q.id} --yes`},Z0(U.options));return}T0(Q,Z0(U.options));return}if($==="versions"){await N0("seal_approval_rule_versions_list",z,q,{},Z0(U.options));return}if($==="version"){let Y=I??j(U.op Line truncated
`).filter(Boolean),Y=U.slice(-I);return{logFile:z,lines:Y,totalLines:U.length}}async function uX1($){let I=KF($),z=qf($),q=Lw($);JN0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):zF),Y=$.host??(process.env.HOST?process.env.HOST:qF);JF(I,`${process.pid}
`,{mode:384}),JF(z,JSON.stringify({pid:process.pid,port:U,host:Y,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),ZY(q,`service starting on http://${Y}:${U} pid=${process.pid}`);let J=null;try{J=await UF({port:U,host:Y,silent:!0}),ZY(q,`service listening pid=${process.pid}`)}catch(K){if(ZY(q,`service failed to bind port ${U}: ${K instanceof Error?K.message:String(K)}`),QF(I)===process.pid)N5(I,{force:!0}),N5(z,{force:!0});throw K}let Q=()=>{if(J)J.close(),J=null;if(QF(I)===process.pid)N5(I,{force:!0}),N5(z,{force:!0});ZY(q,`stopped pid=${process.pid}`)};await new Promise((K)=>{let w=!1,G=()=>{if(w)return;w=!0,Q(),process.off("SIGTERM",G),process.off("SIGINT",G),K()};process.once("SIGTERM",G),process.once("SIGINT",G)})}function qN0($){JN0($.stateDir);let I=XY($);if(I.running)return I;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},q=[...z.args??[],"service","run"];if($.port)q.push("--port",String($.port));if($.host)q.push("--host",String($.host));let U=CX1(z.command,q,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=KF($);return JF(Y,`${U.pid}
`,{mode:384}),ZY(Lw($),`started pid=${U.pid}`),{started:!0,...XY($)}}function UN0($,I={}){let z=KF($),q=qf($),U=QF(z);if(!U||!YN0(U,$.appRoot))return N5(z,{force:!0}),N5(q,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),N5(z,{force:!0}),N5(q,{force:!0}),ZY(Lw($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function YN0($,I){if(!xX1($))return!1;try{let z=hX1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(z.includes(I)||z.includes("seal-use")||z.includes("src/cli.ts"))&&z.includes("service")&&z.includes("run")}catch{return!1}}function xX1($){try{return process.kill($,0),!0}catch{return!1}}function KF($){return zf($.stateDir,"service.pid")}function qf($){return zf($.stateDir,"service.json")}function Lw($){return zf($.stateDir,"service.log")}function QF($){if(!YF($))return;let I=Number(If($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function JN0($){SX1($,{recursive:!0,mode:448})}function ZY($,I){JF($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}u1();G4();var Uf=fX1(kX1(),".config","seal-use");async function Yf($,I,z){let q=z?_0(z.options.port)??_0(z.options.p):void 0,U=z?j(z.options.host)??j(z.options.h):void 0,Y=z?_0(z.options.lines)??_0(z.options.n):void 0,J=await cI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Uf,version:q1,launcher:I.launcher,port:q,host:U},{maxLines:Y});if(J!==void 0)T0(J)}A4();G4();u1();import{existsSync as bX1,readFileSync as QN0}from"node:fs";async function KN0($,I,z,q,U){if($==="batch-records"||$==="records"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation batch-records <batchId>");await N0("seal_simulation_batch_records_get",z,q,{batchId:Y,query:j(U.options.query)},Z0(U.options));return}if($==="create"||$==="run"){let Y=j(U.options.mode)??j(U.options.sourceSystem)??j(U.options["source-system"])??"hosecloud",J=Y==="material-pack"?"material_pack":Y,Q=j(U.options.schemaConfig)??j(U.options["schema-config"]),K=Q?JSON.parse(QN0(Q,"utf8")):void 0,w=j(U.options.input),G=w?JSON.parse(QN0(w,"utf8")):s6(U.json),H=j(U.options.packageId)??j(U.options["package-id"]),W=q6(U.options.packageIds)??q6(U.options["package-ids"])??(H?[H]:void 0),V=q6(U.options.flowIds)??q6(U.options["flow-ids"])??q6(U.options.documentSn)??q6(U.options["document-sn"]),X=j(U.options.signKey)??j(U.options["sign-key"])??j(U.options.integration),L=V0(U.options.noWait)??V0(U.options["no-wait"]);await N0("seal_simulation_batch_create",z,q,{mode:J,sourceSystem:J,flowIds:V,documentSn:V,rejectNodeName:j(U.options.rejectNode)??j(U.options["reject-node"])??null,thinkingDepthOverride:j(U.options.thinkingDepth)??j(U.options["thinking-depth"]),skipInvoiceGeneration:V0(U.options.skipInvoiceGeneration)??V0(U.options["skip-invoice-generation"]),skipExpenseExtraction:V0(U.options.skipExpenseExtraction)??V0(U.options["skip-expense-extraction"]),disableAttachmentCache:V0(U.options.disableAttachmentCache)??V0(U.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:H,templateId:j(U.options.templateId)??j(U.options["template-id"]),schemaConfig:K,requestIds:q6(U.options.requestIds)??q6(U.options["request-ids"]),workflowTypeId:j(U.options.workflowTypeId)??j(U.options["workflow-type-id"]),flowStatusList:q6(U.options.flowStatusList)?.map(Number)??q6(U.options["flow-status-list"])?.map(Number),businessCodes:q6(U.options.businessCodes)??q6(U.options["business-codes"]),documentType:j(U.options.documentType)??j(U.options["document-type"]),startTime:_0(U.options.startTime)??_0(U.options["start-time"]),endTime:_0(U.options.endTime)??_0(U.options["end-time"]),status:q6(U.options.status),limit:_0(U.options.limit),noWait:L,rawParams:G},Z0(U.options));return}if($==="wait"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await N0("seal_simulation_batch_wait",z,q,{batchId:Y,timeout:j(U.options.timeout),pollInterval:j(U.options.pollInterval)??j(U.options["poll-interval"])},Z0(U.options));return}if($==="status"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation status <batchId>");await N0("seal_simulation_batch_status",z,q,{batchId:Y},Z0(U.options));return}if($==="clean"||$==="delete"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation clean <batchId>");await N0("seal_simulation_batch_clean",z,q,{batchId:Y},Z0(U.options));return}if($==="specifications"){let Y=I??j(U.options.integration)??j(U.options.signKey)??j(U.options["sign-key"]);await N0("seal_simulation_specifications_list",z,q,{signKey:Y},Z0(U.options));return}if($==="approval-definitions"||$==="definitions"){await N0("seal_simulation_feishu_approval_definitions_list",z,q,{},Z0(U.options));return}if($==="list"){await N0("seal_simulation_batches_list",z,q,{limit:_0(U.options.limit)},Z0(U.options));return}if($==="get"){let Y=I??j(U.options.batchId)??j(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation get <batchId>");await N0("seal_simulation_batch_get",z,q,{batchId:Y},Z0(U.options));return}if($==="templates"){await N0("seal_simulation_templates_get",z,q,{},Z0(U.options));return}if($==="integrations"){await N0("seal_simulation_integrations_get",z,q,{},Z0(U.options));return}if($==="package-upload"){let Y=I??j(U.options.file);if(!Y)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!bX1(Y))throw Error(`File not found: ${Y}`);await N0("seal_simulation_material_package_upload",z,q,{filePath:Y},Z0(U.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as wN0}from"node:fs";import{join as wF}from"node:path";G4();u1();function GN0($,I,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${uF0()}
`);return}if($==="install"||$==="init"||$==="sync"){let q=V0(z.options.local)||V0(z.options.workspace),U=j(z.options.dir)??j(z.options.target)??I,Y=U?U:q?wF(process.cwd(),".agents","skills","seal-use"):pI(),J=dk(Y);T0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let q=pI(),U=wF(process.cwd(),".agents","skills","seal-use");T0({global:{dir:q,installed:wN0(wF(q,"SKILL.md"))},local:{dir:U,installed:wN0(wF(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}u1();async function HN0($,I){if($==="config"){T0(await VY(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}k$();A4();G4();u1();w$();k$();c4();tK();function Jf($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let I=$.toUpperCase().trim();if(I==="APPROVE"||I==="PASS")return"APPROVE";if(I==="REJECT"||I==="DENIED")return"REJECT";if(I==="MANUAL"||I==="ASSISTED")return"MANUAL";if(I==="ERROR"||I==="FAILED")return"ERROR";return I}async function WN0($){let{sourceCorp:I,targetCorp:z,sourceClient:q,targetClient:U,samples:Y=10,dryRun:J=!1,pollIntervalMs:Q=2000,timeoutMs:K=45000,snPrefix:w="REG_",fetchFn:G=fetch}=$;if(z.environment!=="test")throw new N4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${I.id} <testCorpId>`);let H=await N3(U),V=(Array.isArray(H.features)?H.features:[]).find((u)=>u?.code==="ai-approval"),X=typeof V?.balance==="number"?V.balance:0,L=typeof V?.deductionAmount==="number"&&V.deductionAmount>0?V.deductionAmount:120,D=Y*L;if(X<D)throw new N4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${X} 点,本次回归抽样 ${Y} 笔需要约 ${D} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(X/L))})`);let O=await s4(q,{limit:Y,status:"completed"}),A=Array.isArray(O.records)?O.records:[];if(A.length===0){let u=await s4(q,{limit:Y});A=Array.isArray(u.records)?u.records:[]}if(A.length===0)throw new N4(`在母企业「${I.name}」(${I.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(A=A.slice(0,Y),J){let u=A.map((c)=>{let m=c.sourceDocumentSN??c.id,e=c?.result?.decision??c.aiDecision??c?.decision,G0=Jf(e),M0=c?.result?.summary??c.aiSummary;return{sn:m,sourceRecordId:c.id,prodDecision:G0,prodSummary:M0,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:I.id,name:I.name,environment:I.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:X,deductionAmount:L,estimatedRequired:D},metrics:{sampleCount:u.length,successCount:u.length,failureCount:0,matchCount:u.length,flipCount:0,concordanceRate:1},flips:[],records:u}}let T=await Jx(U,z),M=[];for(let u of A){let c=Date.now(),m=u.sourceDocumentSN??u.id,e=Jf(u?.result?.decision??u.aiDecision??u?.decision),G0=u?.result?.summary??u.aiSummary;try{let M0=await X4(q,u.id),g0=`${w}${m}`,G1=Ux(M0,{snPrefix:w,docIdPrefix:w});await Yx(T.incomingDocumentWebhook.url,T.secret,G1,G,p4(z.seal));let S0=null,$1=Date.now();while(Date.now()-$1<K){await new Promise((S4)=>setTimeout(S4,Q));let T4=await s4(U,{sourceDocumentSN:g0,limit:1});if(T4.records&&T4.records.length>0){let S4=T4.records[0];if(S4.status==="completed"||S4.status==="failed"){S0=S4;break}}}if(!S0){M.push({sn:m,sourceRecordId:u.id,prodDecision:e,prodSummary:G0,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(K/1000)}s 未完成)`,durationMs:Date.now()-c});continue}let A0=Jf(S0?.result?.decision??S0.aiDecision??S0?.decision??(S0.status==="completed"?"APPROVE":"ERROR")),U0=S0?.result?.summary??S0.aiSummary,v0=e===A0,I1=v0?"MATCHED":"FLIPPED",W1={sn:m,sourceRecordId:u.id,prodDecision:e,prodSummary:G0,testRecordId:S0.id,testDecision:A0,testSummary:U0,status:I1,durationMs:Date.now()-c};if(!v0)W1.diff={from:e,to:A0,reasonDiff:U0&&G0&&U0!==G0?`生产: ${G0.slice(0,60)}... -> 测试: ${U0.slice(0,60)}...`:void 0};M.push(W1)}catch(M0){M.push({sn:m,sourceRecordId:u.id,prodDecision:e,prodSummary:G0,status:"FAILED",error:M0 instanceof Error?M0.message:String(M0),durationMs:Date.now()-c})}}let v=M.filter((u)=>u.status==="MATCHED"||u.status==="FLIPPED"),x=M.filter((u)=>u.status==="MATCHED"),h=M.filter((u)=>u.status==="FLIPPED"),k=M.filter((u)=>u.status==="FAILED").length,E=x.length,f=h.length,n=E+f,g=n>0?E/n:0,b=f>0,p=b?"REGRESSIONS_DETECTED":"CLEAN",q0=!b&&k===0,R;try{let u=await N3(U),m=(Array.isArray(u.features)?u.features:[]).find((e)=>e?.code==="ai-approval");if(typeof m?.balance==="number")R=m.balance}catch{}return{ok:!b&&k===0,verdict:p,safeToPublish:q0,timestamp:new Date().toISOString(),sourceCorp:{id:I.id,name:I.name,environment:I.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:X,deductionAmount:L,estimatedRequired:D,balanceAfter:R},metrics:{sampleCount:M.length,successCount:v.length,failureCount:k,matchCount:E,flipCount:f,concordanceRate:Number(g.toFixed(4))},flips:h,records:M}}function VN0($){let{sourceCorp:I,targetCorp:z,verdict:q,safeToPublish:U,metrics:Y,quota:J,flips:Q,records:K}=$,w=q==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":q==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",G=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${I.name}」-> 测试靶场「${z.name}」`,` 判定: ${w} · 准许发布: ${U?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${Y.sampleCount} | 一致通过: ${Y.matchCount} | 决策翻转: ${Y.flipCount} | 异常失败: ${Y.failureCount}`,` 一致率: ${(Y.concordanceRate*100).toFixed(1)}% | 消耗预估: ${J.estimatedRequired} 点 (余量: ${J.balanceBefore}${J.balanceAfter!==void 0?` -> ${J.balanceAfter}`:""})`," "+"─".repeat(65)];if(Q.length>0){G.push(` ⚠️ 决策翻转清单 (${Q.length} 笔单据在新规则下结果改变):`);for(let H of Q)if(G.push(` • 单据 [${H.sn}]: 原生产判定「${H.prodDecision}」 ➔ 测试新判定「${H.testDecision}」`),H.diff?.reasonDiff)G.push(` 理由差异: ${H.diff.reasonDiff}`);G.push(" "+"─".repeat(65)),G.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(q==="CLEAN")G.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% Line truncated
`)}async function Qf($,I,z){let q=($??I??"regression").toLowerCase();if(q==="regression"||q==="regress"||q==="matrix"){let U=j(z.options.corp)??(I&&I!==q?I:void 0),Y=w1(U),J=Y,Q=Y;if(Y.environment==="test"){Q=Y;let A=j(z.options["prod-corp"])??j(z.options.prod)??Y.prodCorpId;if(!A)throw new N4(`测试企业「${Y.name}」(${Y.id}) 未绑定生产母企业,无法拉取历史样本。
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${Y.id}`);J=w1(A)}else{J=Y;let A=j(z.options["test-corp"])??j(z.options.test)??Y.testCorpId;if(!A)throw new N4(`生产企业「${Y.name}」(${Y.id}) 未绑定测试靶场企业。
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);Q=w1(A)}let K=await J1(J),w=await J1(Q),G=_0(z.options.samples)??_0(z.options.limit)??_0(z.options.n)??10,H=V0(z.options["dry-run"]),W=V0(z.options["fail-on-flips"]),V=_0(z.options["poll-interval"])??2000,X=_0(z.options.timeout)??45000,L=j(z.options["sn-prefix"])??"REG_",D=await WN0({sourceCorp:J,targetCorp:Q,sourceClient:K,targetClient:w,samples:G,dryRun:H,pollIntervalMs:V,timeoutMs:X,snPrefix:L,failOnFlips:W});if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(VN0(D));if(T0(D),W&&!D.ok)throw new N4(`回归测试发现 ${D.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new N4(`未知的 test 子命令: "${q}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}A4();G4();u1();async function ZN0($,I,z,q){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await N0($,I,z,s6(q.json),Z0(q.options))}fO();u1();function XN0(){T0(Jw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as nX1,mkdirSync as iX1,renameSync as Kf,rmSync as pX1,unlinkSync as NN0,writeFileSync as LN0}from"node:fs";import{dirname as cX1,join as DN0}from"node:path";import{spawnSync as dI}from"node:child_process";function GF($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}u1();var MN0="yunyingk/seal-use",Ow="yunyingk/seal-home";var dX1="SEAL_USE_GITHUB_REPO",mX1="SEAL_HOME_GITHUB_REPO";async function AN0($,I={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Uf,version:q1,launcher:$.launcher},q=I.repo||process.env[dX1]?.trim()||process.env[mX1]?.trim()||MN0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let M=Y.replace(/^v/,""),v=PN0(M,q1);if(v<0)if(!Dj&&I.force);else{T0({updated:!1,currentVersion:q1,targetVersion:M,mode:GF()?"binary":"source",message:!Dj?`Cannot downgrade seal-use from dev build v${q1} to release v${M}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${q1} to older version v${M}. Updates must be forward-only.`});return}if(v===0&&!I.force){T0({updated:!1,currentVersion:q1,targetVersion:M,mode:GF()?"binary":"source",message:`seal-use is already at version v${q1}. Use --force to reinstall.`});return}}if(I.changelogOnly){let M=await wf(q,I.limit??10);T0({currentVersion:q1,totalQueried:M.length,releases:M.map((v)=>({version:v.version,tagName:v.tagName,publishedAt:v.publishedAt,author:v.author,releaseNotes:v.notes,releaseUrl:v.htmlUrl,isCurrent:v.version===q1,isNewer:Dw(v.version,q1)}))});return}if(!GF()){if(I.checkOnly){let v=await wf(q,30),x=v[0],h=x?.version??q1,k=v.find((n)=>n.version===q1),E=Dw(h,q1),f=v.filter((n)=>Dw(n.version,q1));T0({updated:!1,updateAvailable:E,currentVersion:q1,currentVersionPublishedAt:k?.publishedAt,latestVersion:h,latestVersionPublishedAt:x?.publishedAt,behindCount:f.length,pendingReleases:f.map((n)=>({version:n.version,tagName:n.tagName,publishedAt:n.publishedAt,author:n.author,releaseNotes:n.notes,releaseUrl:n.htmlUrl})),releaseNotes:x?.notes??"",releaseUrl:x?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let M=XY(z).running;if(M)await cI("stop",z);try{FN0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(v){console.error(`git pull skipped: ${v instanceof Error?v.message:String(v)}`)}if(FN0("bun",["install"],{cwd:$.appRoot}),M)await cI("start",z);T0({updated:!0,serviceRestarted:M,version:q1,mode:"source"});return}let J=lX1(),Q=oX1(),K=await wf(q,30),w=Y?K.find((M)=>M.version===Y||M.tagName===Y||M.tagName===`v${Y}`)??await ON0(q,Y):K[0]??await ON0(q);if(!w){T0({updated:!1,currentVersion:q1,mode:"binary",message:`Failed to query releases from repository '${q}'`});return}let G=w.version,H=K.find((M)=>M.version===q1),W=Dw(G,q1),V=W||Boolean(I.force),X=K.filter((M)=>Dw(M.version,q1));if(I.checkOnly){T0({updated:!1,updateAvailable:W,currentVersion:q1,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,behindCount:X.length,pendingReleases:X.map((M)=>({version:M.version,tagName:M.tagName,publishedAt:M.publishedAt,author:M.author,releaseNotes:M.notes,releaseUrl:M.htmlUrl})),releaseNotes:w.notes,releaseUrl:w.htmlUrl,mode:"binary"});return}if(!V){T0({updated:!1,currentVersion:q1,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,mode:"binary",message:`seal-use is already up to date (v${q1})`});return}let L=rX1(w.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${G}. Available assets: ${w.assets.map((M)=>M.name).join(", ")}`);let D=XY(z).running;if(D)await cI("stop",z);let O=process.execPath,A=cX1(O),T=DN0(A,`.tmp-update-${Date.now()}`);iX1(T,{recursive:!0});try{let M=DN0(T,L.name);await tX1(L.downloadUrl,M,w.tagName,L.name);let v=M;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))v=aX1(M,T,J);else if(L.name.endsWith(".zip"))v=sX1(M,T,J);if(nX1(v,493),process.platform==="darwin")try{dI("/usr/bin/codesign",["--remove-signature",v],{stdio:"ignore"}),dI("/usr/bin/codesign",["--force","--sign","-",v],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let h=`${O}.old.${Date.now()}`;try{Kf(O,h)}catch{}Kf(v,O)}else Kf(v,O);if(D)await cI("start",z);let x=mk();T0({updated:!0,fromVersion:q1,toVersion:G,serviceRestarted:D,skillSynced:x.synced?x.targetDir:!1,mode:"binary"})}finally{try{pX1(T,{recursive:!0,force:!0})}catch{}}}function lX1(){if(process.platform==="darwin")retur Line truncated
`)}catch{}}async function tX1($,I,z,q){let U=Gf(),Y=[],J=z?z.startsWith("v")?z:`v${z}`:void 0,Q=q||$.split("/").pop()||"";if(U!=="github"){if(J&&Q)Y.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${J}/${Q}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${J}/${Q}`);if($.startsWith("https://git.ying-qing.cn"))Y.push($)}if(U!=="gitea")if(J&&Q){let L=`https://github.com/${MN0}/releases/download/${J}/${Q}`;if(!process.env.CI)Y.push(`https://ghfast.top/${L}`,`https://gh.ddlc.top/${L}`);Y.push(L)}else if($.includes("github.com")){if(!process.env.CI)Y.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Y.push($)}else Y.push($);let K=Array.from(new Set(Y)),w,G=6000,H=6000,W=307200,V=1e4,X=180000;for(let L=0;L<K.length;L++){let D=K[L],O=new AbortController,A="",T=(h)=>{A=h;try{O.abort()}catch{}},M=setTimeout(()=>{T("Connection timed out (no response headers within 6s)")},G),v,x;try{HF(`==> [${L+1}/${K.length}] Downloading via: ${D}`);let h=await fetch(D,{signal:O.signal});if(M)clearTimeout(M),M=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);v=setTimeout(()=>{T("Overall download time exceeded 3 minutes")},X);let k=Number(h.headers.get("content-length"))||0,E=h.body?.getReader();if(!E){let p=Buffer.from(await h.arrayBuffer());if(p.length<1000)throw Error(`Downloaded content is suspiciously small (${p.length} bytes)`);LN0(I,p),HF(`✓ Download succeeded (${(p.length/1024/1024).toFixed(1)} MB)`);return}let f=[],n=0,g=0;x=setTimeout(()=>{if(n<W){let p=(n/1024).toFixed(1);T(`Initial transfer too slow (${p} KB < 300 KB in 6s), switching mirror...`)}},H);while(!0){let p=E.read(),q0,R=new Promise((e,G0)=>{q0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),u;try{u=await Promise.race([p,R])}finally{if(q0)clearTimeout(q0)}let{done:c,value:m}=u;if(c)break;if(m){if(f.push(m),n+=m.length,x&&n>=W)clearTimeout(x),x=void 0;let e=Date.now();if(e-g>200){g=e;let G0=k?Math.round(n/k*100):0,M0=(n/1048576).toFixed(1),g0=k?(k/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${M0} / ${g0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let b=Buffer.concat(f);if(b.length<1000)throw Error(`Downloaded content is suspiciously small (${b.length} bytes)`);LN0(I,b),HF(`✓ Download completed successfully (${(b.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(M)clearTimeout(M);if(x)clearTimeout(x);if(v)clearTimeout(v);let k=A||(h instanceof Error?h.message:String(h));w=Error(k),HF(`
↳ Mirror failed: ${w.message}`)}finally{if(M)clearTimeout(M);if(x)clearTimeout(x);if(v)clearTimeout(v)}}throw Error(`Failed to download asset from all mirrors: ${w?.message}`)}function aX1($,I,z){let q=dI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract tar archive: ${q.stderr.toString()}`);NN0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=dI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function sX1($,I,z){let q=dI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract zip archive: ${q.stderr.toString()}`);NN0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=dI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function PN0($,I){let z=$.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0),q=I.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0);for(let U=0;U<Math.max(z.length,q.length);U++){let Y=z[U]??0,J=q[U]??0;if(Y>J)return 1;if(Y<J)return-1}return 0}function Dw($,I){return PN0($,I)>0}function FN0($,I,z={}){let q=dI($,I,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(q.stdout)console.error(q.stdout.trimEnd());if(q.stderr)console.error(q.stderr.trimEnd());if(q.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${q.status}`)}A4();G4();u1();async function TN0($,I,z,q,U){if($==="create"){let Y=j(U.options.name)??I,J=j(U.options.phone);if(!Y||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let Q=j(U.options.dept)??j(U.options.departmentId);await N0("seal_user_create",z,q,{name:Y,phone:J,departmentIds:Q?[Q]:void 0},Z0(U.options));return}if($==="reset-password"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users reset-password <userId>");await N0("seal_user_reset_password",z,q,{userId:Y},Z0(U.options));return}if($==="search"||$==="list"){let Y=I??j(U.options.keyword)??j(U.options.query)??"";await N0("seal_user_search",z,q,{keyword:Y},Z0(U.options));return}if($==="get"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users get <userId>");await N0("seal_user_get",z,q,{userId:Y},Z0(U.options));return}if($==="delete"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users delete <userId>");await N0("seal_user_delete",z,q,{userId:Y},Z0(U.options));return}if($==="activate"){let Y=I??j(U.options.userId);if(!Y)throw Error("Usage: seal-use users activate <userId>");await N0("seal_user_activate",z,q,{userId:Y},Z0(U.options));return}if($==="delegation"||$==="impersonate"){let Y=I??j(U.options.userId)??j(U.options.phone);if(!Y)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=j(U.options.note);await N0("seal_user_delegation_create",z,q,{userIdOrPhone:Y,note:J},Z0(U.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}k$();A4();G4();_k();u1();var EN0=Hf(Hf(Hf($L1(import.meta.url)))),IL1=new Set(["config","service","stop","http","serve","update","tools","corps","corp","tool","source","auth","delegation","users","contacts","data","llm","permissions","billing","webhook","webhooks","context","rules","approval-runs","analytics","simulation","deploy","preference","preferences","mcp","server","mcp-config","skill","openapi","probe","doctor","changelog","test"]),zL1=new Set(["http","server","web","mcp"]);function qL1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(I&&zL1.has(I))return!0;if((I==="service"||I==="daemon")&&z==="run")return!0;return!1}var BN0=Promise.resolve();function Xw($,I={}){if(qL1($))return jN0($,I);let z=BN0.then(()=>jN0($,I));return BN0=z.then(()=>{return},()=>{return}),z}async function jN0($,I){let z=[],q=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??EN0,entryFile:I.entryFile??eX1(I.appRoot??EN0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{z.push(Ck(Q))},console.error=(...Q)=>{q.push(Ck(Q))};try{return await UL1($,J),{stdout:Kw(z),stderr:Kw(q),isError:!1,exitCode:0}}catch(Q){let K=ww(Q instanceof Error?Q.message:String(Q)),w=UO(Q);if(q.push(K),w.nextAction&&!K.includes("Next action:"))q.push(`\uD83D\uDC49 Next action: ${w.nextAction}`);return{stdout:Kw(z),stderr:Kw(q),isError:!0,exitCode:w.exitCode}}finally{console.log=U,console.error=Y}}async function UL1($,I){let z=Ek($),[q,U,Y]=z.command;if(q==="version"||q==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){T0(UQ);return}let J=bD0(z);if(J.isHelp){cD0(J.target);return}if(!q||!IL1.has(q))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(q==="webhook"&&U==="material-pack"&&Y==="preview"){let w=z.command[3]??j(z.options.file)??j(z.options.input);if(!w)throw Error("Usage: seal-use webhook material-pack preview <材料包.zip>");await lD0(w,GY(z.options));return}if(q==="openapi"){aF0(z);return}if(q==="mcp-config"){sk();return}if(q==="skill"){GN0(U,Y,z);return}if(q==="mcp"||q==="server"){await tF0(U,z);return}if(q==="probe"){await zN0(U,Y,z);return}if(q==="doctor"){await cF0(U,Y,z);return}if(q==="test"){await Qf(U,Y,z);return}if(q==="config"){$O0(U,Y,z);return}if(q==="service"){await Yf(U,I,z);return}if(q==="stop"){await Yf("stop",I,z);return}if(q==="http"||q==="serve"){await oF0(z);return}if(q==="update"||q==="changelog"){let w=q==="changelog"||U==="changelog"||U==="log"||U==="history"||V0(z.options.changelog)===!0,G=U==="check"||V0(z.options.check)===!0||V0(z.options["check-only"])===!0,H=j(z.options.version)??j(z.options.tag)??(!w&&!G&&U&&!U.startsWith("-")?U:void 0);await AN0(I,{checkOnly:G,changelogOnly:w,lim Line truncated
`);U(q)})})}async function YN0($){let I=_0($.options.port)??_0($.options.p),z=E($.options.host)??E($.options.h),q=await JF({port:I,host:z}),U=()=>{q.close(()=>{process.exit(0)})};process.on("SIGINT",U),process.on("SIGTERM",U),await new Promise(()=>{})}A4();u1();async function JN0($,I,z,q){if($==="config"||$==="get"){await N0("seal_llm_config_get",I,z,{},Z0(q.options));return}if($==="providers"||$==="list"){await N0("seal_llm_providers_list",I,z,{},Z0(q.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}u1();async function QN0($,I){if($==="config"||$==="json"){Uf();return}await Yf()}function Uf(){T0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}u1();function KN0($){let I=IF();T0(I,{...Z0($.options),allowFull:!0})}A4();u1();async function wN0($,I,z,q){if($==="available"){await N0("seal_permissions_available_list",I,z,{},Z0(q.options));return}if($==="configs"||$==="list"){await N0("seal_permissions_configs_list",I,z,{},Z0(q.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}A4();G4();u1();import{readFileSync as GN0}from"node:fs";async function HN0($,I,z,q,U,Y,J){if(!$||$==="get"){await N0("seal_preference_get",U,Y,{},Z0(J.options));return}if($==="decision"){if(I==="update"||!I){let Q=E(J.options.input),K=Q?JSON.parse(GN0(Q,"utf8")):s6(J.json);if(!K||Object.keys(K).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await N0("seal_preference_decision_update",U,Y,{...K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let Q=E(J.options.default)??E(J.options.level)??q;if(Q!=="medium"&&Q!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await N0("seal_preference_thinking_depth_set",U,Y,{defaultLevel:Q,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}if(I==="policies"){if(z==="list"||!z){await N0("seal_preference_thinking_depth_policies_list",U,Y,{},Z0(J.options));return}if(z==="upsert"){let Q=E(J.options.input),K=Q?JSON.parse(GN0(Q,"utf8")):s6(J.json);if(!K||!K.id||!K.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await N0("seal_preference_thinking_depth_policies_upsert",U,Y,{...K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}if(z==="remove"||z==="delete"){let Q=q??E(J.options.id)??E(J.options.policyId);if(!Q)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await N0("seal_preference_thinking_depth_policies_remove",U,Y,{policyId:Q,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},Z0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}G9();w$();c4();async function WN0($={}){let I=O$(),z=K4(),q=m7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},w9());console.log(`[probe] corp=${q.id} source=${q.source.type}`);let U=await ZY(q);console.log("[probe] seal enterprise"),console.log(JSON.stringify(U,null,2));let Y=await J1(q),J=await sW(Y,{documentLimit:20,stylePreferencesEndpoint:q.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))}G4();async function VN0($,I,z){let q=I??E(z.options.corp)??($&&$!=="--corp"?$:void 0);await WN0({corpId:q})}Nx();A4();k$();G4();u1();async function Jf($,I,z,q,U){if($==="count"){await N0("seal_approval_rules_list",z,q,{countOnly:!0},Z0(U.options));return}if($==="list"){if(V0(U.options.count)){await N0("seal_approval_rules_list",z,q,{countOnly:!0},Z0(U.options));return}let Y=_0(U.options.limit),J=_0(U.options.offset);if(V0(U.options.summary)){await N0("seal_approval_rules_list",z,q,{fields:eD0,limit:Y,offset:J},Z0(U.options));return}let Q=await r7("seal_approval_rules_list",z,q,{limit:Y,offset:J});$O0(Q,V0(U.options.full)===!0),T0(Q);return}if($==="clear"){let Y=V0(U.options.yes)===!0,J=V0(U.options.dryRun)??V0(U.options["dry-run"])??!Y;if(!Y&&!J)throw X5("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${q.id} --dry-run`);let Q=await r7("seal_approval_rules_clear",z,q,{dryRun:J,recode:V0(U.options.recode)});if(!Y&&J&&Q&&typeof Q==="object"){T0({...Q,nextCommand:`seal-use rules clear --corp ${q.id} --yes`},Z0(U.options));return}T0(Q,Z0(U.options));return}if($==="versions"){await N0("seal_approval_rule_versions_list",z,q,{},Z0(U.options));return}if($==="version"){let Y=I??E(U.op Line truncated
`).filter(Boolean),Y=U.slice(-I);return{logFile:z,lines:Y,totalLines:U.length}}async function JL1($){let I=GF($),z=wf($),q=Dw($);DN0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):UF),Y=$.host??(process.env.HOST?process.env.HOST:YF);KF(I,`${process.pid}
`,{mode:384}),KF(z,JSON.stringify({pid:process.pid,port:U,host:Y,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),XY(q,`service starting on http://${Y}:${U} pid=${process.pid}`);let J=null;try{J=await JF({port:U,host:Y,silent:!0}),XY(q,`service listening pid=${process.pid}`)}catch(K){if(XY(q,`service failed to bind port ${U}: ${K instanceof Error?K.message:String(K)}`),wF(I)===process.pid)N5(I,{force:!0}),N5(z,{force:!0});throw K}let Q=()=>{if(J)J.close(),J=null;if(wF(I)===process.pid)N5(I,{force:!0}),N5(z,{force:!0});XY(q,`stopped pid=${process.pid}`)};await new Promise((K)=>{let w=!1,G=()=>{if(w)return;w=!0,Q(),process.off("SIGTERM",G),process.off("SIGINT",G),K()};process.once("SIGTERM",G),process.once("SIGINT",G)})}function ZN0($){DN0($.stateDir);let I=LY($);if(I.running)return I;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},q=[...z.args??[],"service","run"];if($.port)q.push("--port",String($.port));if($.host)q.push("--host",String($.host));let U=zL1(z.command,q,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=GF($);return KF(Y,`${U.pid}
`,{mode:384}),XY(Dw($),`started pid=${U.pid}`),{started:!0,...LY($)}}function XN0($,I={}){let z=GF($),q=wf($),U=wF(z);if(!U||!LN0(U,$.appRoot))return N5(z,{force:!0}),N5(q,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),N5(z,{force:!0}),N5(q,{force:!0}),XY(Dw($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function LN0($,I){if(!QL1($))return!1;try{let z=qL1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(z.includes(I)||z.includes("seal-use")||z.includes("src/cli.ts"))&&z.includes("service")&&z.includes("run")}catch{return!1}}function QL1($){try{return process.kill($,0),!0}catch{return!1}}function GF($){return Kf($.stateDir,"service.pid")}function wf($){return Kf($.stateDir,"service.json")}function Dw($){return Kf($.stateDir,"service.log")}function wF($){if(!QF($))return;let I=Number(Qf($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function DN0($){UL1($,{recursive:!0,mode:448})}function XY($,I){KF($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}u1();G4();var Gf=wL1(KL1(),".config","seal-use");async function Hf($,I,z){let q=z?_0(z.options.port)??_0(z.options.p):void 0,U=z?E(z.options.host)??E(z.options.h):void 0,Y=z?_0(z.options.lines)??_0(z.options.n):void 0,J=await dI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Gf,version:q1,launcher:I.launcher,port:q,host:U},{maxLines:Y});if(J!==void 0)T0(J)}A4();G4();u1();import{existsSync as GL1,readFileSync as ON0}from"node:fs";async function FN0($,I,z,q,U){if($==="batch-records"||$==="records"){let Y=I??E(U.options.batchId)??E(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation batch-records <batchId>");await N0("seal_simulation_batch_records_get",z,q,{batchId:Y,query:E(U.options.query)},Z0(U.options));return}if($==="create"||$==="run"){let Y=E(U.options.mode)??E(U.options.sourceSystem)??E(U.options["source-system"])??"hosecloud",J=Y==="material-pack"?"material_pack":Y,Q=E(U.options.schemaConfig)??E(U.options["schema-config"]),K=Q?JSON.parse(ON0(Q,"utf8")):void 0,w=E(U.options.input),G=w?JSON.parse(ON0(w,"utf8")):s6(U.json),H=E(U.options.packageId)??E(U.options["package-id"]),W=q6(U.options.packageIds)??q6(U.options["package-ids"])??(H?[H]:void 0),V=q6(U.options.flowIds)??q6(U.options["flow-ids"])??q6(U.options.documentSn)??q6(U.options["document-sn"]),X=E(U.options.signKey)??E(U.options["sign-key"])??E(U.options.integration),L=V0(U.options.noWait)??V0(U.options["no-wait"]);await N0("seal_simulation_batch_create",z,q,{mode:J,sourceSystem:J,flowIds:V,documentSn:V,rejectNodeName:E(U.options.rejectNode)??E(U.options["reject-node"])??null,thinkingDepthOverride:E(U.options.thinkingDepth)??E(U.options["thinking-depth"]),skipInvoiceGeneration:V0(U.options.skipInvoiceGeneration)??V0(U.options["skip-invoice-generation"]),skipExpenseExtraction:V0(U.options.skipExpenseExtraction)??V0(U.options["skip-expense-extraction"]),disableAttachmentCache:V0(U.options.disableAttachmentCache)??V0(U.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:H,templateId:E(U.options.templateId)??E(U.options["template-id"]),schemaConfig:K,requestIds:q6(U.options.requestIds)??q6(U.options["request-ids"]),workflowTypeId:E(U.options.workflowTypeId)??E(U.options["workflow-type-id"]),flowStatusList:q6(U.options.flowStatusList)?.map(Number)??q6(U.options["flow-status-list"])?.map(Number),businessCodes:q6(U.options.businessCodes)??q6(U.options["business-codes"]),documentType:E(U.options.documentType)??E(U.options["document-type"]),startTime:_0(U.options.startTime)??_0(U.options["start-time"]),endTime:_0(U.options.endTime)??_0(U.options["end-time"]),status:q6(U.options.status),limit:_0(U.options.limit),noWait:L,rawParams:G},Z0(U.options));return}if($==="wait"){let Y=I??E(U.options.batchId)??E(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await N0("seal_simulation_batch_wait",z,q,{batchId:Y,timeout:E(U.options.timeout),pollInterval:E(U.options.pollInterval)??E(U.options["poll-interval"])},Z0(U.options));return}if($==="status"){let Y=I??E(U.options.batchId)??E(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation status <batchId>");await N0("seal_simulation_batch_status",z,q,{batchId:Y},Z0(U.options));return}if($==="clean"||$==="delete"){let Y=I??E(U.options.batchId)??E(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation clean <batchId>");await N0("seal_simulation_batch_clean",z,q,{batchId:Y},Z0(U.options));return}if($==="specifications"){let Y=I??E(U.options.integration)??E(U.options.signKey)??E(U.options["sign-key"]);await N0("seal_simulation_specifications_list",z,q,{signKey:Y},Z0(U.options));return}if($==="approval-definitions"||$==="definitions"){await N0("seal_simulation_feishu_approval_definitions_list",z,q,{},Z0(U.options));return}if($==="list"){await N0("seal_simulation_batches_list",z,q,{limit:_0(U.options.limit)},Z0(U.options));return}if($==="get"){let Y=I??E(U.options.batchId)??E(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation get <batchId>");await N0("seal_simulation_batch_get",z,q,{batchId:Y},Z0(U.options));return}if($==="templates"){await N0("seal_simulation_templates_get",z,q,{},Z0(U.options));return}if($==="integrations"){await N0("seal_simulation_integrations_get",z,q,{},Z0(U.options));return}if($==="package-upload"){let Y=I??E(U.options.file);if(!Y)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!GL1(Y))throw Error(`File not found: ${Y}`);await N0("seal_simulation_material_package_upload",z,q,{filePath:Y},Z0(U.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as NN0}from"node:fs";import{join as HF}from"node:path";G4();u1();function MN0($,I,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${lF0()}
`);return}if($==="install"||$==="init"||$==="sync"){let q=V0(z.options.local)||V0(z.options.workspace),U=E(z.options.dir)??E(z.options.target)??I,Y=U?U:q?HF(process.cwd(),".agents","skills","seal-use"):cI(),J=ak(Y);T0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let q=cI(),U=HF(process.cwd(),".agents","skills","seal-use");T0({global:{dir:q,installed:NN0(HF(q,"SKILL.md"))},local:{dir:U,installed:NN0(HF(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}u1();async function AN0($,I){if($==="config"){T0(await ZY(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}k$();A4();G4();u1();w$();k$();c4();aK();function Wf($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let I=$.toUpperCase().trim();if(I==="APPROVE"||I==="PASS")return"APPROVE";if(I==="REJECT"||I==="DENIED")return"REJECT";if(I==="MANUAL"||I==="ASSISTED")return"MANUAL";if(I==="ERROR"||I==="FAILED")return"ERROR";return I}async function PN0($){let{sourceCorp:I,targetCorp:z,sourceClient:q,targetClient:U,samples:Y=10,dryRun:J=!1,pollIntervalMs:Q=2000,timeoutMs:K=45000,snPrefix:w="REG_",fetchFn:G=fetch}=$;if(z.environment!=="test")throw new N4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${I.id} <testCorpId>`);let H=await M3(U),V=(Array.isArray(H.features)?H.features:[]).find((u)=>u?.code==="ai-approval"),X=typeof V?.balance==="number"?V.balance:0,L=typeof V?.deductionAmount==="number"&&V.deductionAmount>0?V.deductionAmount:120,D=Y*L;if(X<D)throw new N4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${X} 点,本次回归抽样 ${Y} 笔需要约 ${D} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(X/L))})`);let O=await s4(q,{limit:Y,status:"completed"}),A=Array.isArray(O.records)?O.records:[];if(A.length===0){let u=await s4(q,{limit:Y});A=Array.isArray(u.records)?u.records:[]}if(A.length===0)throw new N4(`在母企业「${I.name}」(${I.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(A=A.slice(0,Y),J){let u=A.map((c)=>{let m=c.sourceDocumentSN??c.id,e=c?.result?.decision??c.aiDecision??c?.decision,G0=Wf(e),M0=c?.result?.summary??c.aiSummary;return{sn:m,sourceRecordId:c.id,prodDecision:G0,prodSummary:M0,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:I.id,name:I.name,environment:I.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:X,deductionAmount:L,estimatedRequired:D},metrics:{sampleCount:u.length,successCount:u.length,failureCount:0,matchCount:u.length,flipCount:0,concordanceRate:1},flips:[],records:u}}let T=await Wx(U,z),M=[];for(let u of A){let c=Date.now(),m=u.sourceDocumentSN??u.id,e=Wf(u?.result?.decision??u.aiDecision??u?.decision),G0=u?.result?.summary??u.aiSummary;try{let M0=await X4(q,u.id),g0=`${w}${m}`,G1=Gx(M0,{snPrefix:w,docIdPrefix:w});await Hx(T.incomingDocumentWebhook.url,T.secret,G1,G,p4(z.seal));let S0=null,$1=Date.now();while(Date.now()-$1<K){await new Promise((S4)=>setTimeout(S4,Q));let T4=await s4(U,{sourceDocumentSN:g0,limit:1});if(T4.records&&T4.records.length>0){let S4=T4.records[0];if(S4.status==="completed"||S4.status==="failed"){S0=S4;break}}}if(!S0){M.push({sn:m,sourceRecordId:u.id,prodDecision:e,prodSummary:G0,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(K/1000)}s 未完成)`,durationMs:Date.now()-c});continue}let A0=Wf(S0?.result?.decision??S0.aiDecision??S0?.decision??(S0.status==="completed"?"APPROVE":"ERROR")),U0=S0?.result?.summary??S0.aiSummary,v0=e===A0,I1=v0?"MATCHED":"FLIPPED",W1={sn:m,sourceRecordId:u.id,prodDecision:e,prodSummary:G0,testRecordId:S0.id,testDecision:A0,testSummary:U0,status:I1,durationMs:Date.now()-c};if(!v0)W1.diff={from:e,to:A0,reasonDiff:U0&&G0&&U0!==G0?`生产: ${G0.slice(0,60)}... -> 测试: ${U0.slice(0,60)}...`:void 0};M.push(W1)}catch(M0){M.push({sn:m,sourceRecordId:u.id,prodDecision:e,prodSummary:G0,status:"FAILED",error:M0 instanceof Error?M0.message:String(M0),durationMs:Date.now()-c})}}let v=M.filter((u)=>u.status==="MATCHED"||u.status==="FLIPPED"),x=M.filter((u)=>u.status==="MATCHED"),h=M.filter((u)=>u.status==="FLIPPED"),k=M.filter((u)=>u.status==="FAILED").length,j=x.length,n=h.length,b=j+n,g=b>0?j/b:0,f=n>0,p=f?"REGRESSIONS_DETECTED":"CLEAN",q0=!f&&k===0,R;try{let u=await M3(U),m=(Array.isArray(u.features)?u.features:[]).find((e)=>e?.code==="ai-approval");if(typeof m?.balance==="number")R=m.balance}catch{}return{ok:!f&&k===0,verdict:p,safeToPublish:q0,timestamp:new Date().toISOString(),sourceCorp:{id:I.id,name:I.name,environment:I.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:X,deductionAmount:L,estimatedRequired:D,balanceAfter:R},metrics:{sampleCount:M.length,successCount:v.length,failureCount:k,matchCount:j,flipCount:n,concordanceRate:Number(g.toFixed(4))},flips:h,records:M}}function TN0($){let{sourceCorp:I,targetCorp:z,verdict:q,safeToPublish:U,metrics:Y,quota:J,flips:Q,records:K}=$,w=q==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":q==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",G=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${I.name}」-> 测试靶场「${z.name}」`,` 判定: ${w} · 准许发布: ${U?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${Y.sampleCount} | 一致通过: ${Y.matchCount} | 决策翻转: ${Y.flipCount} | 异常失败: ${Y.failureCount}`,` 一致率: ${(Y.concordanceRate*100).toFixed(1)}% | 消耗预估: ${J.estimatedRequired} 点 (余量: ${J.balanceBefore}${J.balanceAfter!==void 0?` -> ${J.balanceAfter}`:""})`," "+"─".repeat(65)];if(Q.length>0){G.push(` ⚠️ 决策翻转清单 (${Q.length} 笔单据在新规则下结果改变):`);for(let H of Q)if(G.push(` • 单据 [${H.sn}]: 原生产判定「${H.prodDecision}」 ➔ 测试新判定「${H.testDecision}」`),H.diff?.reasonDiff)G.push(` 理由差异: ${H.diff.reasonDiff}`);G.push(" "+"─".repeat(65)),G.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(q==="CLEAN")G.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% Line truncated
`)}async function Vf($,I,z){let q=($??I??"regression").toLowerCase();if(q==="regression"||q==="regress"||q==="matrix"){let U=E(z.options.corp)??(I&&I!==q?I:void 0),Y=w1(U),J=Y,Q=Y;if(Y.environment==="test"){Q=Y;let A=E(z.options["prod-corp"])??E(z.options.prod)??Y.prodCorpId;if(!A)throw new N4(`测试企业「${Y.name}」(${Y.id}) 未绑定生产母企业,无法拉取历史样本。
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${Y.id}`);J=w1(A)}else{J=Y;let A=E(z.options["test-corp"])??E(z.options.test)??Y.testCorpId;if(!A)throw new N4(`生产企业「${Y.name}」(${Y.id}) 未绑定测试靶场企业。
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);Q=w1(A)}let K=await J1(J),w=await J1(Q),G=_0(z.options.samples)??_0(z.options.limit)??_0(z.options.n)??10,H=V0(z.options["dry-run"]),W=V0(z.options["fail-on-flips"]),V=_0(z.options["poll-interval"])??2000,X=_0(z.options.timeout)??45000,L=E(z.options["sn-prefix"])??"REG_",D=await PN0({sourceCorp:J,targetCorp:Q,sourceClient:K,targetClient:w,samples:G,dryRun:H,pollIntervalMs:V,timeoutMs:X,snPrefix:L,failOnFlips:W});if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(TN0(D));if(T0(D),W&&!D.ok)throw new N4(`回归测试发现 ${D.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new N4(`未知的 test 子命令: "${q}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}A4();G4();u1();async function EN0($,I,z,q){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await N0($,I,z,s6(q.json),Z0(q.options))}nO();u1();function BN0(){T0(Qw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as HL1,mkdirSync as WL1,renameSync as Zf,rmSync as VL1,unlinkSync as _N0,writeFileSync as jN0}from"node:fs";import{dirname as ZL1,join as vN0}from"node:path";import{spawnSync as mI}from"node:child_process";function WF($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}u1();var CN0="yunyingk/seal-use",Fw="yunyingk/seal-home";var XL1="SEAL_USE_GITHUB_REPO",LL1="SEAL_HOME_GITHUB_REPO";async function hN0($,I={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Gf,version:q1,launcher:$.launcher},q=I.repo||process.env[XL1]?.trim()||process.env[LL1]?.trim()||CN0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let M=Y.replace(/^v/,""),v=SN0(M,q1);if(v<0)if(!Fj&&I.force);else{T0({updated:!1,currentVersion:q1,targetVersion:M,mode:WF()?"binary":"source",message:!Fj?`Cannot downgrade seal-use from dev build v${q1} to release v${M}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${q1} to older version v${M}. Updates must be forward-only.`});return}if(v===0&&!I.force){T0({updated:!1,currentVersion:q1,targetVersion:M,mode:WF()?"binary":"source",message:`seal-use is already at version v${q1}. Use --force to reinstall.`});return}}if(I.changelogOnly){let M=await Xf(q,I.limit??10);T0({currentVersion:q1,totalQueried:M.length,releases:M.map((v)=>({version:v.version,tagName:v.tagName,publishedAt:v.publishedAt,author:v.author,releaseNotes:v.notes,releaseUrl:v.htmlUrl,isCurrent:v.version===q1,isNewer:Ow(v.version,q1)}))});return}if(!WF()){if(I.checkOnly){let v=await Xf(q,30),x=v[0],h=x?.version??q1,k=v.find((b)=>b.version===q1),j=Ow(h,q1),n=v.filter((b)=>Ow(b.version,q1));T0({updated:!1,updateAvailable:j,currentVersion:q1,currentVersionPublishedAt:k?.publishedAt,latestVersion:h,latestVersionPublishedAt:x?.publishedAt,behindCount:n.length,pendingReleases:n.map((b)=>({version:b.version,tagName:b.tagName,publishedAt:b.publishedAt,author:b.author,releaseNotes:b.notes,releaseUrl:b.htmlUrl})),releaseNotes:x?.notes??"",releaseUrl:x?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let M=LY(z).running;if(M)await dI("stop",z);try{gN0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(v){console.error(`git pull skipped: ${v instanceof Error?v.message:String(v)}`)}if(gN0("bun",["install"],{cwd:$.appRoot}),M)await dI("start",z);T0({updated:!0,serviceRestarted:M,version:q1,mode:"source"});return}let J=DL1(),Q=OL1(),K=await Xf(q,30),w=Y?K.find((M)=>M.version===Y||M.tagName===Y||M.tagName===`v${Y}`)??await RN0(q,Y):K[0]??await RN0(q);if(!w){T0({updated:!1,currentVersion:q1,mode:"binary",message:`Failed to query releases from repository '${q}'`});return}let G=w.version,H=K.find((M)=>M.version===q1),W=Ow(G,q1),V=W||Boolean(I.force),X=K.filter((M)=>Ow(M.version,q1));if(I.checkOnly){T0({updated:!1,updateAvailable:W,currentVersion:q1,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,behindCount:X.length,pendingReleases:X.map((M)=>({version:M.version,tagName:M.tagName,publishedAt:M.publishedAt,author:M.author,releaseNotes:M.notes,releaseUrl:M.htmlUrl})),releaseNotes:w.notes,releaseUrl:w.htmlUrl,mode:"binary"});return}if(!V){T0({updated:!1,currentVersion:q1,currentVersionPublishedAt:H?.publishedAt,latestVersion:G,latestVersionPublishedAt:w.publishedAt,mode:"binary",message:`seal-use is already up to date (v${q1})`});return}let L=FL1(w.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${G}. Available assets: ${w.assets.map((M)=>M.name).join(", ")}`);let D=LY(z).running;if(D)await dI("stop",z);let O=process.execPath,A=ZL1(O),T=vN0(A,`.tmp-update-${Date.now()}`);WL1(T,{recursive:!0});try{let M=vN0(T,L.name);await NL1(L.downloadUrl,M,w.tagName,L.name);let v=M;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))v=ML1(M,T,J);else if(L.name.endsWith(".zip"))v=AL1(M,T,J);if(HL1(v,493),process.platform==="darwin")try{mI("/usr/bin/codesign",["--remove-signature",v],{stdio:"ignore"}),mI("/usr/bin/codesign",["--force","--sign","-",v],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let h=`${O}.old.${Date.now()}`;try{Zf(O,h)}catch{}Zf(v,O)}else Zf(v,O);if(D)await dI("start",z);let x=sk();T0({updated:!0,fromVersion:q1,toVersion:G,serviceRestarted:D,skillSynced:x.synced?x.targetDir:!1,mode:"binary"})}finally{try{VL1(T,{recursive:!0,force:!0})}catch{}}}function DL1(){if(process.platform==="darwin")retur Line truncated
`)}catch{}}async function NL1($,I,z,q){let U=Lf(),Y=[],J=z?z.startsWith("v")?z:`v${z}`:void 0,Q=q||$.split("/").pop()||"";if(U!=="github"){if(J&&Q)Y.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${J}/${Q}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${J}/${Q}`);if($.startsWith("https://git.ying-qing.cn"))Y.push($)}if(U!=="gitea")if(J&&Q){let L=`https://github.com/${CN0}/releases/download/${J}/${Q}`;if(!process.env.CI)Y.push(`https://ghfast.top/${L}`,`https://gh.ddlc.top/${L}`);Y.push(L)}else if($.includes("github.com")){if(!process.env.CI)Y.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Y.push($)}else Y.push($);let K=Array.from(new Set(Y)),w,G=6000,H=6000,W=307200,V=1e4,X=180000;for(let L=0;L<K.length;L++){let D=K[L],O=new AbortController,A="",T=(h)=>{A=h;try{O.abort()}catch{}},M=setTimeout(()=>{T("Connection timed out (no response headers within 6s)")},G),v,x;try{VF(`==> [${L+1}/${K.length}] Downloading via: ${D}`);let h=await fetch(D,{signal:O.signal});if(M)clearTimeout(M),M=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);v=setTimeout(()=>{T("Overall download time exceeded 3 minutes")},X);let k=Number(h.headers.get("content-length"))||0,j=h.body?.getReader();if(!j){let p=Buffer.from(await h.arrayBuffer());if(p.length<1000)throw Error(`Downloaded content is suspiciously small (${p.length} bytes)`);jN0(I,p),VF(`✓ Download succeeded (${(p.length/1024/1024).toFixed(1)} MB)`);return}let n=[],b=0,g=0;x=setTimeout(()=>{if(b<W){let p=(b/1024).toFixed(1);T(`Initial transfer too slow (${p} KB < 300 KB in 6s), switching mirror...`)}},H);while(!0){let p=j.read(),q0,R=new Promise((e,G0)=>{q0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),u;try{u=await Promise.race([p,R])}finally{if(q0)clearTimeout(q0)}let{done:c,value:m}=u;if(c)break;if(m){if(n.push(m),b+=m.length,x&&b>=W)clearTimeout(x),x=void 0;let e=Date.now();if(e-g>200){g=e;let G0=k?Math.round(b/k*100):0,M0=(b/1048576).toFixed(1),g0=k?(k/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${M0} / ${g0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let f=Buffer.concat(n);if(f.length<1000)throw Error(`Downloaded content is suspiciously small (${f.length} bytes)`);jN0(I,f),VF(`✓ Download completed successfully (${(f.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(M)clearTimeout(M);if(x)clearTimeout(x);if(v)clearTimeout(v);let k=A||(h instanceof Error?h.message:String(h));w=Error(k),VF(`
↳ Mirror failed: ${w.message}`)}finally{if(M)clearTimeout(M);if(x)clearTimeout(x);if(v)clearTimeout(v)}}throw Error(`Failed to download asset from all mirrors: ${w?.message}`)}function ML1($,I,z){let q=mI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract tar archive: ${q.stderr.toString()}`);_N0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=mI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function AL1($,I,z){let q=mI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract zip archive: ${q.stderr.toString()}`);_N0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=mI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
`).filter(Boolean),J=Y.find((Q)=>Q.endsWith(`/${U}`)||Q.endsWith(U));if(J)return J;return Y[0]||$}function SN0($,I){let z=$.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0),q=I.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0);for(let U=0;U<Math.max(z.length,q.length);U++){let Y=z[U]??0,J=q[U]??0;if(Y>J)return 1;if(Y<J)return-1}return 0}function Ow($,I){return SN0($,I)>0}function gN0($,I,z={}){let q=mI($,I,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(q.stdout)console.error(q.stdout.trimEnd());if(q.stderr)console.error(q.stderr.trimEnd());if(q.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${q.status}`)}A4();G4();u1();async function yN0($,I,z,q,U){if($==="create"){let Y=E(U.options.name)??I,J=E(U.options.phone);if(!Y||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let Q=E(U.options.dept)??E(U.options.departmentId);await N0("seal_user_create",z,q,{name:Y,phone:J,departmentIds:Q?[Q]:void 0},Z0(U.options));return}if($==="reset-password"){let Y=I??E(U.options.userId);if(!Y)throw Error("Usage: seal-use users reset-password <userId>");await N0("seal_user_reset_password",z,q,{userId:Y},Z0(U.options));return}if($==="search"||$==="list"){let Y=I??E(U.options.keyword)??E(U.options.query)??"";await N0("seal_user_search",z,q,{keyword:Y},Z0(U.options));return}if($==="get"){let Y=I??E(U.options.userId);if(!Y)throw Error("Usage: seal-use users get <userId>");await N0("seal_user_get",z,q,{userId:Y},Z0(U.options));return}if($==="delete"){let Y=I??E(U.options.userId);if(!Y)throw Error("Usage: seal-use users delete <userId>");await N0("seal_user_delete",z,q,{userId:Y},Z0(U.options));return}if($==="activate"){let Y=I??E(U.options.userId);if(!Y)throw Error("Usage: seal-use users activate <userId>");await N0("seal_user_activate",z,q,{userId:Y},Z0(U.options));return}if($==="delegation"||$==="impersonate"){let Y=I??E(U.options.userId)??E(U.options.phone);if(!Y)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=E(U.options.note);await N0("seal_user_delegation_create",z,q,{userIdOrPhone:Y,note:J},Z0(U.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}k$();A4();G4();xk();u1();var uN0=Df(Df(Df(TL1(import.meta.url)))),EL1=new Set(["config","service","stop","http","serve","update","tools","corps","corp","tool","source","auth","delegation","users","contacts","data","llm","permissions","billing","webhook","webhooks","context","rules","approval-runs","analytics","simulation","deploy","preference","preferences","mcp","server","mcp-config","skill","openapi","probe","doctor","changelog","test"]),BL1=new Set(["http","server","web","mcp"]);function jL1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(I&&BL1.has(I))return!0;if((I==="service"||I==="daemon")&&z==="run")return!0;return!1}var xN0=Promise.resolve();function Lw($,I={}){if(jL1($))return kN0($,I);let z=xN0.then(()=>kN0($,I));return xN0=z.then(()=>{return},()=>{return}),z}async function kN0($,I){let z=[],q=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??uN0,entryFile:I.entryFile??PL1(I.appRoot??uN0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{z.push(kk(Q))},console.error=(...Q)=>{q.push(kk(Q))};try{return await vL1($,J),{stdout:ww(z),stderr:ww(q),isError:!1,exitCode:0}}catch(Q){let K=Gw(Q instanceof Error?Q.message:String(Q)),w=JO(Q);if(q.push(K),w.nextAction&&!K.includes("Next action:"))q.push(`\uD83D\uDC49 Next action: ${w.nextAction}`);return{stdout:ww(z),stderr:ww(q),isError:!0,exitCode:w.exitCode}}finally{console.log=U,console.error=Y}}async function vL1($,I){let z=_k($),[q,U,Y]=z.command;if(q==="version"||q==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){T0(YQ);return}let J=aD0(z);if(J.isHelp){IO0(J.target);return}if(!q||!EL1.has(q))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(q==="webhook"&&U==="material-pack"&&Y==="preview"){let w=z.command[3]??E(z.options.file)??E(z.options.input);if(!w)throw Error("Usage: seal-use webhook material-pack preview <材料包.zip>");await UO0(w,HY(z.options));return}if(q==="openapi"){KN0(z);return}if(q==="mcp-config"){Uf();return}if(q==="skill"){MN0(U,Y,z);return}if(q==="mcp"||q==="server"){await QN0(U,z);return}if(q==="probe"){await VN0(U,Y,z);return}if(q==="doctor"){await IN0(U,Y,z);return}if(q==="test"){await Vf(U,Y,z);return}if(q==="config"){HO0(U,Y,z);return}if(q==="service"){await Hf(U,I,z);return}if(q==="stop"){await Hf("stop",I,z);return}if(q==="http"||q==="serve"){await YN0(z);return}if(q==="update"||q==="changelog"){let w=q==="changelog"||U==="changelog"||U==="log"||U==="history"||V0(z.options.changelog)===!0,G=U==="check"||V0(z.options.check)===!0||V0(z.options["check-only"])===!0,H=E(z.options.version)??E(z.options.tag)??(!w&&!G&&U&&!U.startsWith("-")?U:void 0);await hN0(I,{checkOnly:G,changelogOnly:w,lim Line truncated
`)?"":`
`}`);process.exitCode=$.exitCode}var VL1=Boolean(t.main==t.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&vN0(process.argv[1])===vN0(F9));if(VL1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await WL1();else ek().catch(($)=>{console.error($),process.exitCode=1});export{ak as tokenizeCommand,ek as startServer,wL1 as resolveMcpEnabled,GL1 as createServer,QL1 as SEAL_MCP_ENABLED_ENV,JL1 as SEAL_CLI_TOOL_NAME,KL1 as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var xL1=Boolean(t.main==t.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&fN0(process.argv[1])===fN0(F9));if(xL1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await uL1();else Yf().catch(($)=>{console.error($),process.exitCode=1});export{qf as tokenizeCommand,Yf as startServer,hL1 as resolveMcpEnabled,SL1 as createServer,_L1 as SEAL_MCP_ENABLED_ENV,gL1 as SEAL_CLI_TOOL_NAME,CL1 as LEGACY_SEAL_MCP_ENABLED_ENV};
+2 -2
View File
@@ -145,8 +145,8 @@ seal-use analytics risks <tagId> --corp <corpId> [--start-date <ISO>] [--end-dat
seal-use analytics performance --corp <corpId> [--start-date <ISO|ms>] [--end-date <ISO|ms>]
seal-use analytics analyze <recordId> --corp <corpId>
seal-use analytics export --corp <corpId> [--downloads] [--out <file>] [--start-date <ISO>] [--end-date <ISO>]
seal-use approval-runs count --corp <corpId> [--status APPROVED]
seal-use approval-runs export --corp <corpId> [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--limit <n>] [--downloads] [--out <file>]
seal-use approval-runs count --corp <corpId> [--status APPROVED] [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>]
seal-use approval-runs export --corp <corpId> [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--status <status>] [--manual-status <status>] [--completed-only] [--limit <n>] [--downloads] [--out <file>]
seal-use approval-runs search --corp <corpId> [--query text] [--limit 20] [--includeBridge true]
seal-use approval-runs get <recordId> --corp <corpId> [--fields metadata|document.fields,result.summary] [--output-file file.json]
seal-use approval-runs attachments <recordId> --corp <corpId>
+19 -4
View File
@@ -1,7 +1,7 @@
import type { CorpConfig } from "../../core/config/types.js";
import type { createSealClient } from "../../core/http/factory.js";
import * as api from "../../domains/seal/api.js";
import { exportApprovalRunsToExcel } from "../../domains/seal/approval-runs-export.js";
import { exportApprovalRunsToExcel, normalizeTimestamp } from "../../domains/seal/approval-runs-export.js";
import {
downloadApprovalRunAttachments,
extractApprovalRunAttachments
@@ -71,6 +71,14 @@ export async function handleApprovalRunsCommand(
}
if (action === "count") {
const rawStart =
stringOption(args.options.start) ??
stringOption(args.options.startDate) ??
stringOption(args.options.since);
const rawEnd =
stringOption(args.options.end) ??
stringOption(args.options.endDate);
await runTool(
"seal_approval_runs_count",
client,
@@ -79,7 +87,9 @@ export async function handleApprovalRunsCommand(
status: stringOption(args.options.status),
sourceSystem: stringOption(args.options.sourceSystem) ?? stringOption(args.options["source-system"]),
taskMode: stringOption(args.options.taskMode) ?? stringOption(args.options["task-mode"]),
search: stringOption(args.options.search) ?? stringOption(args.options.query)
search: stringOption(args.options.search) ?? stringOption(args.options.query),
startDate: rawStart ? normalizeTimestamp(rawStart, false) : undefined,
endDate: rawEnd ? normalizeTimestamp(rawEnd, true) : undefined
},
outputOptions(args.options)
);
@@ -94,8 +104,13 @@ export async function handleApprovalRunsCommand(
{
limit: numberOption(args.options.limit),
offset: numberOption(args.options.offset),
startDate: stringOption(args.options.startDate),
endDate: stringOption(args.options.endDate),
startDate:
stringOption(args.options.startDate) ??
stringOption(args.options.start) ??
stringOption(args.options.since),
endDate:
stringOption(args.options.endDate) ??
stringOption(args.options.end),
status: stringOption(args.options.status),
taskMode: stringOption(args.options.taskMode),
manualApprovalStatus: stringOption(args.options.manualApprovalStatus),
+8
View File
@@ -220,4 +220,12 @@ describe("CLI help execution for lifecycle commands", () => {
expect(result.isError).toBe(false);
expect(result.stdout).toContain("seal-use stop");
});
test("approval-runs --help prints updated count and export parameter usage", async () => {
const result = await runCli(["approval-runs", "--help"]);
expect(result.exitCode).toBe(0);
expect(result.isError).toBe(false);
expect(result.stdout).toContain("approval-runs count [--status APPROVED] [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>]");
expect(result.stdout).toContain("approval-runs export [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--status <status>] [--manual-status <status>] [--completed-only]");
});
});
+3 -3
View File
@@ -322,13 +322,13 @@ export const HELP_REGISTRY: AreaHelp[] = [
},
{
name: "count",
summary: "Count approval runs filtered by status",
usage: ["seal-use approval-runs count [--status APPROVED] [--corp <corpId>]"]
summary: "Count approval runs filtered by status or time range",
usage: ["seal-use approval-runs count [--status APPROVED] [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--corp <corpId>]"]
},
{
name: "export",
summary: "Export approval run audit records to Excel workbook",
usage: ["seal-use approval-runs export [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--limit <n>] [--downloads] [--out <file>] [--corp <corpId>]"]
usage: ["seal-use approval-runs export [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--status <status>] [--manual-status <status>] [--completed-only] [--limit <n>] [--downloads] [--out <file>] [--corp <corpId>]"]
},
{
name: "list",
@@ -4,6 +4,8 @@ import { join } from "node:path";
import { tmpdir } from "node:os";
import ExcelJS from "exceljs";
import {
formatDate,
formatExportDateTag,
getRuleBriefTitle,
normalizeManualApprovalStatus,
normalizeTimestamp,
@@ -66,6 +68,43 @@ describe("approval-runs-export helpers", () => {
recordCount: 50
});
expect(dl).toContain("Downloads/大黄蜂_审核记录_2026-08-07至今_50条.xlsx");
const rangeDl = resolveOutputFilePath({
toDownloads: true,
corpName: "华铁大黄蜂",
dateTag: "2026-08-07至2026-09-13",
recordCount: 9780
});
expect(rangeDl).toContain("Downloads/华铁大黄蜂_审核记录_2026-08-07至2026-09-13_9780条.xlsx");
});
test("formatDate formats dates, epoch timestamps, and strings cleanly in Asia/Shanghai", () => {
expect(formatDate("2026-08-07")).toBe("2026-08-07");
expect(formatDate("2026-08-07T12:00:00Z")).toBe("2026-08-07");
expect(formatDate("1786032000000")).toBe("2026-08-07");
expect(formatDate("1786032000")).toBe("2026-08-07");
expect(formatDate(1786032000000)).toBe("2026-08-07");
expect(formatDate(new Date("2026-08-07T00:00:00+08:00"))).toBe("2026-08-07");
expect(formatDate(undefined)).toBeUndefined();
expect(formatDate("")).toBeUndefined();
});
test("formatExportDateTag handles startDate and endDate combinations", () => {
// Both start and end
expect(formatExportDateTag("2026-08-07", "2026-09-13")).toBe("2026-08-07至2026-09-13");
expect(formatExportDateTag("1786032000000", "1789315199999")).toBe("2026-08-07至2026-09-13");
// Only start
expect(formatExportDateTag("2026-08-07", undefined)).toBe("2026-08-07至今");
expect(formatExportDateTag("2026-08-07", "")).toBe("2026-08-07至今");
// Only end
expect(formatExportDateTag(undefined, "2026-09-13")).toBe("截至2026-09-13");
expect(formatExportDateTag("", "2026-09-13")).toBe("截至2026-09-13");
// Neither
const today = new Date().toLocaleDateString("en-CA", { timeZone: "Asia/Shanghai" });
expect(formatExportDateTag(undefined, undefined)).toBe(today);
});
});
+50 -10
View File
@@ -50,6 +50,55 @@ export function normalizeTimestamp(val?: string | number, endOfDay = false): str
return str;
}
export function formatDate(val?: string | number | Date): string | undefined {
if (val === undefined || val === null || val === "") return undefined;
if (val instanceof Date) {
return Number.isNaN(val.getTime())
? undefined
: val.toLocaleDateString("en-CA", { timeZone: "Asia/Shanghai" });
}
const raw = String(val).trim();
if (!raw) return undefined;
if (/^\d{4}-\d{2}-\d{2}/.test(raw)) {
return raw.slice(0, 10);
}
if (/^\d{10}$/.test(raw)) {
const d = new Date(Number(raw) * 1000);
return Number.isNaN(d.getTime())
? undefined
: d.toLocaleDateString("en-CA", { timeZone: "Asia/Shanghai" });
}
if (/^\d{13}$/.test(raw) || /^\d+$/.test(raw)) {
const d = new Date(Number(raw));
return Number.isNaN(d.getTime())
? undefined
: d.toLocaleDateString("en-CA", { timeZone: "Asia/Shanghai" });
}
const d = new Date(raw);
return Number.isNaN(d.getTime())
? undefined
: d.toLocaleDateString("en-CA", { timeZone: "Asia/Shanghai" });
}
export function formatExportDateTag(
startDate?: string | number | Date,
endDate?: string | number | Date
): string {
const start = formatDate(startDate);
const end = formatDate(endDate);
if (start && end) {
return `${start}至${end}`;
}
if (start) {
return `${start}至今`;
}
if (end) {
return `截至${end}`;
}
return new Date().toLocaleDateString("en-CA", { timeZone: "Asia/Shanghai" });
}
export function normalizeManualApprovalStatus(status?: string | string[]): string[] | undefined {
if (!status) return undefined;
const rawList = Array.isArray(status) ? status : [status];
@@ -493,16 +542,7 @@ export async function exportApprovalRunsToExcel(
}
// 4. 保存文件落地
let dateTag: string | undefined;
if (options.startDate) {
const rawStart = String(options.startDate);
if (/^\d{4}-\d{2}-\d{2}/.test(rawStart)) {
dateTag = `${rawStart.slice(0, 10)}至今`;
} else if (/^\d+$/.test(rawStart)) {
const d = new Date(Number(rawStart));
dateTag = `${d.getFullYear()}${String(d.getMonth() + 1).padStart(2, "0")}${String(d.getDate()).padStart(2, "0")}至今`;
}
}
const dateTag = formatExportDateTag(options.startDate, options.endDate);
const targetPath = resolveOutputFilePath({
outputFile: options.outputFile,
+2 -5
View File
@@ -5,6 +5,7 @@ import ExcelJS from "exceljs";
import type { KyInstance } from "ky";
import type { CorpConfig } from "../../core/config/types.js";
import * as api from "./api.js";
import { formatExportDateTag } from "./approval-runs-export.js";
import type { InsightPerformance } from "./types.js";
export interface InsightExportOptions {
@@ -355,11 +356,7 @@ export async function exportInsightReportToExcel(
}
// 4. 写入本地文件
let dateTag: string | undefined;
if (options.startDate) {
const raw = String(options.startDate).slice(0, 10).replace(/[-:]/g, "");
dateTag = `${raw}至今`;
}
const dateTag = formatExportDateTag(options.startDate, options.endDate);
const targetPath = resolveInsightOutputFilePath({
outputFile: options.outputFile,
+33
View File
@@ -847,6 +847,39 @@ describe("sealTools", () => {
outboundName: "DingTalk AI Audit"
});
});
test("seal_approval_runs_count supports startDate and endDate and normalizes them", async () => {
const tool = sealTools.find((item) => item.name === "seal_approval_runs_count");
expect(tool).toBeDefined();
const schema = z.toJSONSchema(tool!.parameters) as {
properties?: Record<string, unknown>;
};
expect(schema.properties).toHaveProperty("startDate");
expect(schema.properties).toHaveProperty("endDate");
expect(schema.properties).toHaveProperty("status");
const requests: string[] = [];
const client = fakeApprovalRunsClient(requests);
const handler = tool!.handler as ToolHandler;
const res = await handler(
client,
{
status: "APPROVED",
startDate: "2026-08-07",
endDate: "2026-09-13"
},
fakeContext()
);
expect(res).toEqual({ total: 3 });
expect(requests).toHaveLength(1);
expect(requests[0]).toContain("api/v1/approvals?");
expect(requests[0]).toContain("startDate=1786032000000");
expect(requests[0]).toContain("endDate=1789315199999");
expect(requests[0]).toContain("APPROVED");
});
});
function fakeApprovalRunsClient(requests: string[] = []): KyInstance {
+18 -4
View File
@@ -28,7 +28,7 @@ import { MaterialPackFilePolicyPatchSchema, MaterialPackFilePolicySchema } from
import {
extractApprovalRunAttachments
} from "./attachments.js";
import { exportApprovalRunsToExcel } from "./approval-runs-export.js";
import { exportApprovalRunsToExcel, normalizeTimestamp } from "./approval-runs-export.js";
import { exportInsightReportToExcel, type InsightExportOptions } from "./insight-export.js";
import {
ThinkingPolicySchema,
@@ -2496,15 +2496,29 @@ export const sealTools = [
status: z.string().optional(),
sourceSystem: z.string().optional(),
taskMode: z.string().optional(),
search: z.string().optional()
search: z.string().optional(),
startDate: z.string().optional().describe("起始时间戳(毫秒)或日期字符串"),
endDate: z.string().optional().describe("结束时间戳(毫秒)或日期字符串")
}),
handler: async (client: KyInstance, params: { status?: string; sourceSystem?: string; taskMode?: string; search?: string }) => {
handler: async (
client: KyInstance,
params: {
status?: string;
sourceSystem?: string;
taskMode?: string;
search?: string;
startDate?: string;
endDate?: string;
}
) => {
const runs = await api.listApprovalRuns(client, {
limit: 1,
status: params.status,
sourceSystem: params.sourceSystem,
taskMode: params.taskMode,
search: params.search
search: params.search,
startDate: normalizeTimestamp(params.startDate, false),
endDate: normalizeTimestamp(params.endDate, true)
});
return {
total: runs.total ?? runs.records.length