Release v0.10.22: Webhook resource pack export and HLab rule linter

This commit is contained in:
gitea committed 2026-09-14 11:47:10 +08:00
1 parent 4238018f3c
commit 3082919d76
7 files changed
+223 -199

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.21",
"version": "0.10.22",
"description": "Seal Use tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, and search.",
"author": {
"name": "yingqing"
+12
View File
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.10.22] - 2026-09-14
### Added & Enhanced
- **Webhook Resource Pack Export & Dataset Renaming**:
- Formally renamed the Webhook dataset format to **Webhook 资源包** (Webhook Resource Pack, CLI: `resource-pack`, alias: `pack`), cleanly distinguishing it from Seal backend's native simulation material pack while keeping `material-pack` 100% backward-compatible.
- Implemented `exportApprovalRunsToResourcePack` and CLI command `seal-use webhook resource-pack export` to export online approval runs and downloaded attachments into a local standard `.zip` resource pack for offline distribution via third-party channels.
- Refined bidirectional ZIP validation so documents without attachments do not trigger false directory-missing errors.
- **Official HLab Structured Rule Linter (`hlab`)**:
- Implemented the official HLab Rule Linter (`hlab`, aliases: `hlab-sop`, `hlab-rules`, `hlab-standard`) based on industrial Rule-as-SOP standards.
- Enforces check methods (`**检查方法**`), evaluation standards (`**判定标准**`), ternary decision closure (`- PASS`, `- FAIL`, `- 证据不足` with manual review), disposal action decoupling, and false-skip prevention.
- Automatically synchronizes plaintext template to `~/.config/seal-use/linters/official/hlab.ts`.
## [0.10.21] - 2026-09-14
### Added & Enhanced
+203 -191
View File
@@ -1,161 +1,161 @@
import{createRequire as RM0}from"node:module";var FM0=Object.create;var{getPrototypeOf:MM0,defineProperty:FN,getOwnPropertyNames:AM0}=Object;var PM0=Object.prototype.hasOwnProperty;function TM0($){return this[$]}var EM0,BM0,I3=($,I,z)=>{var q=$!=null&&typeof $==="object";if(q){var U=I?EM0??=new WeakMap:BM0??=new WeakMap,Y=U.get($);if(Y)return Y}z=$!=null?FM0(MM0($)):{};let J=I||!$||!$.__esModule?FN(z,"default",{value:$,enumerable:!0}):z;for(let Q of AM0($))if(!PM0.call(J,Q))FN(J,Q,{get:TM0.bind($,Q),enumerable:!0});if(q)U.set($,J);return J};var N=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var jM0=($)=>$;function vM0($,I){this[$]=jM0.bind(null,I)}var A$=($,I)=>{for(var z in I)FN($,z,{get:I[z],enumerable:!0,configurable:!0,set:vM0.bind(I,z)})};var K0=($,I)=>()=>($&&(I=$($=0)),I);var a=RM0(import.meta.url);function t($,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,H=Object.keys(w);for(let G=0;G<H.length;G++){let W=H[G];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 H of w._zod.deferred)H();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 qb,MN,AN,y8,q3,z3;var U3=K0(()=>{MN=Object.freeze({status:"aborted"});AN=Symbol("zod_brand");y8=class y8 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"}};(qb=globalThis).__zod_globalConfig??(qb.__zod_globalConfig={});z3=globalThis.__zod_globalConfig});var N0={};A$(N0,{unwrapMessage:()=>TY,uint8ArrayToHex:()=>$A0,uint8ArrayToBase64url:()=>sM0,uint8ArrayToBase64:()=>Jb,stringifyPrimitive:()=>X0,slugify:()=>EN,shallowClone:()=>jN,safeExtend:()=>mM0,required:()=>rM0,randomString:()=>fM0,propertyKeyTypes:()=>jY,promiseAllObject:()=>kM0,primitiveTypes:()=>vN,prefixIssues:()=>I$,pick:()=>pM0,partial:()=>oM0,parsedType:()=>O0,optionalKeys:()=>RN,omit:()=>cM0,objectClone:()=>yM0,numKeys:()=>bM0,nullish:()=>A9,normalizeParams:()=>A0,mergeDefs:()=>M5,merge:()=>lM0,jsonStringifyReplacer:()=>rI,joinValues:()=>U0,issue:()=>aI,isPlainObject:()=>T9,isObject:()=>Y3,hexToUint8Array:()=>eM0,getSizableOrigin:()=>vY,getParsedType:()=>nM0,getLengthableOrigin:()=>RY,getEnumValues:()=>EY,getElementAtPath:()=>xM0,floatSafeRemainder:()=>TN,finalizeIssue:()=>b6,extend:()=>dM0,explicitlyAborted:()=>CN,escapeRegex:()=>c$,esc:()=>nw,defineLazy:()=>Y1,createTransparentProxy:()=>iM0,cloneDef:()=>uM0,clone:()=>f6,cleanRegex:()=>BY,cleanEnum:()=>tM0,captureStackTrace:()=>iw,cached:()=>tI,base64urlToUint8Array:()=>aM0,base64ToUint8Array:()=>Yb,assignProp:()=>P9,assertNotEqual:()=>_M0,assertNever:()=>hM0,assertIs:()=>CM0,assertEqual:()=>gM0,assert:()=>SM0,allowsEval:()=>BN,aborted:()=>E9,NUMBER_FORMAT_RANGES:()=>gN,Class:()=>Qb,BIGINT_FORMAT_RANGES:()=>_N});function gM0($){return $}function _M0($){return $}function CM0($){}function hM0($){throw Error("Unexpected value in exhaustive check")}function SM0($){}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 U0($,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 TN($,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 Y1($,I,z){let q=void 0;Object.defineProperty($,I,{get(){if(q===Ub)return;if(q===void 0)q=Ub,q=z();return q},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function yM0($){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 uM0($){return M5($._zod.def)}function xM0($,I){if(!I)return $;return I.reduce((z,q)=>z?.[q],$)}function kM0($){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 fM0($=10){let z=Line truncated
`)}var Kb=($,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 yN=K0(()=>{U3();C0();gY=t("$ZodError",Kb),z$=t("$ZodError",Kb,{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 y8;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 y8;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)},Hb,cw=($)=>(I,z,q)=>{return sI($)(I,z,q)},Gb,dw=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return eI($)(I,z,U)},Wb,mw=($)=>async(I,z,q)=>{return eI($)(I,z,q)},Vb,lw=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return $z($)(I,z,U)},Zb,ow=($)=>(I,z,q)=>{return $z($)(I,z,q)},Xb,rw=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return zz($)(I,z,U)},Lb,tw=($)=>async(I,z,q)=>{return zz($)(I,z,q)},Ob;var uN=K0(()=>{U3();yN();C0();hY=sI(z$),SY=eI(z$),Iz=$z(z$),yY=zz(z$),Hb=pw(z$),Gb=cw(z$),Wb=dw(z$),Vb=mw(z$),Zb=lw(z$),Xb=ow(z$),Lb=rw(z$),Ob=tw(z$)});var P$={};A$(P$,{xid:()=>bN,uuid7:()=>YA0,uuid6:()=>UA0,uuid4:()=>qA0,uuid:()=>J3,uppercase:()=>GF,unicodeEmail:()=>Db,undefined:()=>wF,ulid:()=>fN,time:()=>zF,string:()=>UF,sha512_hex:()=>BA0,sha512_base64url:()=>vA0,sha512_base64:()=>jA0,sha384_hex:()=>PA0,sha384_base64url:()=>EA0,sha384_base64:()=>TA0,sha256_hex:()=>FA0,sha256_base64url:()=>AA0,sha256_base64:()=>MA0,sha1_hex:()=>OA0,sha1_base64url:()=>NA0,sha1_base64:()=>DA0,rfc5322Email:()=>QA0,number:()=>uY,null:()=>KF,nanoid:()=>iN,md5_hex:()=>ZA0,md5_base64url:()=>LA0,md5_base64:()=>XA0,mac:()=>rN,lowercase:()=>HF,ksuid:()=>nN,ipv6:()=>oN,ipv4:()=>lN,integer:()=>JF,idnEmail:()=>KA0,httpProtocol:()=>eN,html5Email:()=>JA0,hostname:()=>GA0,hex:()=>VA0,guid:()=>cN,extendedDuration:()=>zA0,emoji:()=>mN,email:()=>dN,e164:()=>$F,duration:()=>pN,domain:()=>WA0,datetime:()=>qF,date:()=>IF,cuid2:()=>kN,cuid:()=>xN,cidrv6:()=>aN,cidrv4:()=>tN,browserEmail:()=>wA0,boolean:()=>QF,bigint:()=>YF,base64url:()=>aw,base64:()=>sN});function mN(){return new RegExp(HA0,"u")}function Fb($){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 zF($){return new RegExp(`^${Fb($)}$`)}function qF($){let I=Fb({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(`^${Nb}T(?:${q})$`)}function xY($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function kY($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var xN,kN,fN,bN,nN,iN,pN,zA0,cN,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})$`)},qA0,UA0,YA0,dN,JA0,QA0,Db,KA0,wA0,HA0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lN,oN,rN=($)=>{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}$`)},tN,aN,sN,aw,GA0,WA0,eN,$F,Nb="(?:(?:\\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])))",IF,UF=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},YF,JF,uY,QF,KF,wF,HF,GF,VA0,ZA0,XA0,LA0,OA0,DA0,NA0,FA0,MA0,AA0,PA0,TA0,EA0,BA0,jA0,vA0;var sw=K0(()=>{C0();xN=/^[cC][0-9a-z]{6,}$/,kN=/^[0-9a-z]+$/,fN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bN=/^[0-9a-vA-V]{20}$/,nN=/^[A-Za-z0-9]{27}$/,iN=/^[a-zA-Z0-9_-]{21}$/,pN=/^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 HS0}from"node:module";var $S0=Object.create;var{getPrototypeOf:IS0,defineProperty:QP,getOwnPropertyNames:zS0}=Object;var qS0=Object.prototype.hasOwnProperty;function US0($){return this[$]}var YS0,JS0,j4=($,I,z)=>{var q=$!=null&&typeof $==="object";if(q){var U=I?YS0??=new WeakMap:JS0??=new WeakMap,Y=U.get($);if(Y)return Y}z=$!=null?$S0(IS0($)):{};let J=I||!$||!$.__esModule?QP(z,"default",{value:$,enumerable:!0}):z;for(let Q of zS0($))if(!qS0.call(J,Q))QP(J,Q,{get:US0.bind($,Q),enumerable:!0});if(q)U.set($,J);return J};var M=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var QS0=($)=>$;function KS0($,I){this[$]=QS0.bind(null,I)}var o8=($,I)=>{for(var z in I)QP($,z,{get:I[z],enumerable:!0,configurable:!0,set:KS0.bind(I,z)})};var e=($,I)=>()=>($&&(I=$($=0)),I);var d=HS0(import.meta.url);function t($,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 H=J.prototype,G=Object.keys(H);for(let Z=0;Z<G.length;Z++){let W=G[Z];if(!(W in Q))Q[W]=H[W].bind(Q)}}let U=z?.Parent??Object;class Y extends U{}Object.defineProperty(Y,"name",{value:$});function J(Q){var K;let H=z?.Parent?new Y:this;q(H,Q),(K=H._zod).deferred??(K.deferred=[]);for(let G of H._zod.deferred)G();return H}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 f4($){if($)Object.assign(H2,$);return H2}var qm,KP,HP,O5,G2,H2;var Z2=e(()=>{KP=Object.freeze({status:"aborted"});HP=Symbol("zod_brand");O5=class O5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};G2=class G2 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(qm=globalThis).__zod_globalConfig??(qm.__zod_globalConfig={});H2=globalThis.__zod_globalConfig});var M0={};o8(M0,{unwrapMessage:()=>EJ,uint8ArrayToHex:()=>SS0,uint8ArrayToBase64url:()=>hS0,uint8ArrayToBase64:()=>Jm,stringifyPrimitive:()=>w0,slugify:()=>WP,shallowClone:()=>VP,safeExtend:()=>ES0,required:()=>_S0,randomString:()=>MS0,propertyKeyTypes:()=>_J,promiseAllObject:()=>FS0,primitiveTypes:()=>wP,prefixIssues:()=>E8,pick:()=>PS0,partial:()=>CS0,parsedType:()=>O0,optionalKeys:()=>LP,omit:()=>BS0,objectClone:()=>wS0,numKeys:()=>NS0,nullish:()=>L3,normalizeParams:()=>A0,mergeDefs:()=>H9,merge:()=>jS0,jsonStringifyReplacer:()=>Bz,joinValues:()=>Y0,issue:()=>Ez,isPlainObject:()=>F3,isObject:()=>W2,hexToUint8Array:()=>gS0,getSizableOrigin:()=>RJ,getParsedType:()=>DS0,getLengthableOrigin:()=>vJ,getEnumValues:()=>jJ,getElementAtPath:()=>OS0,floatSafeRemainder:()=>ZP,finalizeIssue:()=>K8,extend:()=>TS0,explicitlyAborted:()=>MP,escapeRegex:()=>w$,esc:()=>TW,defineLazy:()=>J1,createTransparentProxy:()=>AS0,cloneDef:()=>LS0,clone:()=>Q8,cleanRegex:()=>CJ,cleanEnum:()=>RS0,captureStackTrace:()=>EW,cached:()=>Tz,base64urlToUint8Array:()=>vS0,base64ToUint8Array:()=>Ym,assignProp:()=>O3,assertNotEqual:()=>ZS0,assertNever:()=>XS0,assertIs:()=>WS0,assertEqual:()=>GS0,assert:()=>VS0,allowsEval:()=>XP,aborted:()=>M3,NUMBER_FORMAT_RANGES:()=>OP,Class:()=>Qm,BIGINT_FORMAT_RANGES:()=>FP});function GS0($){return $}function ZS0($){return $}function WS0($){}function XS0($){throw Error("Unexpected value in exhaustive check")}function VS0($){}function jJ($){let I=Object.values($).filter((q)=>typeof q==="number");return Object.entries($).filter(([q,U])=>I.indexOf(+q)===-1).map(([q,U])=>U)}function Y0($,I="|"){return $.map((z)=>w0(z)).join(I)}function Bz($,I){if(typeof I==="bigint")return I.toString();return I}function Tz($){return{get value(){{let z=$();return Object.defineProperty(this,"value",{value:z}),z}throw Error("cached value already set")}}}function L3($){return $===null||$===void 0}function CJ($){let I=$.startsWith("^")?1:0,z=$.endsWith("$")?$.length-1:$.length;return $.slice(I,z)}function ZP($,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 J1($,I,z){let q=void 0;Object.defineProperty($,I,{get(){if(q===Um)return;if(q===void 0)q=Um,q=z();return q},set(U){Object.defineProperty($,I,{value:U})},configurable:!0})}function wS0($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function O3($,I,z){Object.defineProperty($,I,{value:z,writable:!0,enumerable:!0,configurable:!0})}function H9(...$){let I={};for(let z of $){let q=Object.getOwnPropertyDescriptors(z);Object.assign(I,q)}return Object.defineProperties({},I)}function LS0($){return H9($._zod.def)}function OS0($,I){if(!I)return $;return I.reduce((z,q)=>z?.[q],$)}function FS0($){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 MS0($=10){let z=""Line truncated
`)}var Km=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,Bz,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},hJ,j8;var AP=e(()=>{Z2();h0();hJ=t("$ZodError",Km),j8=t("$ZodError",Km,{Parent:Error})});var jz=($)=>(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 O5;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((K)=>K8(K,Y,f4())));throw EW(Q,U?.callee),Q}return J.value},yJ,Cz=($)=>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)=>K8(K,Y,f4())));throw EW(Q,U?.callee),Q}return J.value},xJ,_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 O5;return Y.issues.length?{success:!1,error:new($??hJ)(Y.issues.map((J)=>K8(J,U,f4())))}:{success:!0,data:Y.value}},Rz,vz=($)=>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)=>K8(J,U,f4())))}:{success:!0,data:Y.value}},uJ,jW=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return jz($)(I,z,U)},Gm,CW=($)=>(I,z,q)=>{return jz($)(I,z,q)},Zm,_W=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return Cz($)(I,z,U)},Wm,RW=($)=>async(I,z,q)=>{return Cz($)(I,z,q)},Xm,vW=($)=>(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return _z($)(I,z,U)},Vm,hW=($)=>(I,z,q)=>{return _z($)(I,z,q)},wm,gW=($)=>async(I,z,q)=>{let U=q?{...q,direction:"backward"}:{direction:"backward"};return vz($)(I,z,U)},Lm,SW=($)=>async(I,z,q)=>{return vz($)(I,z,q)},Om;var PP=e(()=>{Z2();AP();h0();yJ=jz(j8),xJ=Cz(j8),Rz=_z(j8),uJ=vz(j8),Gm=jW(j8),Zm=CW(j8),Wm=_W(j8),Xm=RW(j8),Vm=vW(j8),wm=hW(j8),Lm=gW(j8),Om=SW(j8)});var r8={};o8(r8,{xid:()=>jP,uuid7:()=>fS0,uuid6:()=>kS0,uuid4:()=>uS0,uuid:()=>X2,uppercase:()=>aP,unicodeEmail:()=>Fm,undefined:()=>sP,ulid:()=>EP,time:()=>cP,string:()=>dP,sha512_hex:()=>Jy0,sha512_base64url:()=>Ky0,sha512_base64:()=>Qy0,sha384_hex:()=>qy0,sha384_base64url:()=>Yy0,sha384_base64:()=>Uy0,sha256_hex:()=>$y0,sha256_base64url:()=>zy0,sha256_base64:()=>Iy0,sha1_hex:()=>tS0,sha1_base64url:()=>eS0,sha1_base64:()=>aS0,rfc5322Email:()=>iS0,number:()=>kJ,null:()=>rP,nanoid:()=>_P,md5_hex:()=>oS0,md5_base64url:()=>sS0,md5_base64:()=>rS0,mac:()=>xP,lowercase:()=>tP,ksuid:()=>CP,ipv6:()=>yP,ipv4:()=>SP,integer:()=>lP,idnEmail:()=>nS0,httpProtocol:()=>bP,html5Email:()=>bS0,hostname:()=>dS0,hex:()=>lS0,guid:()=>vP,extendedDuration:()=>xS0,emoji:()=>gP,email:()=>hP,e164:()=>iP,duration:()=>RP,domain:()=>mS0,datetime:()=>pP,date:()=>nP,cuid2:()=>TP,cuid:()=>BP,cidrv6:()=>kP,cidrv4:()=>uP,browserEmail:()=>cS0,boolean:()=>oP,bigint:()=>mP,base64url:()=>yW,base64:()=>fP});function gP(){return new RegExp(pS0,"u")}function Nm($){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 cP($){return new RegExp(`^${Nm($)}$`)}function pP($){let I=Nm({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(`^${Mm}T(?:${q})$`)}function fJ($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function bJ($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var BP,TP,EP,jP,CP,_P,RP,xS0,vP,X2=($)=>{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})$`)},uS0,kS0,fS0,hP,bS0,iS0,Fm,nS0,cS0,pS0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",SP,yP,xP=($)=>{let I=w$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},uP,kP,fP,yW,dS0,mS0,bP,iP,Mm="(?:(?:\\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])))",nP,dP=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},mP,lP,kJ,oP,rP,sP,tP,aP,lS0,oS0,rS0,sS0,tS0,aS0,eS0,$y0,Iy0,zy0,qy0,Uy0,Yy0,Jy0,Qy0,Ky0;var xW=e(()=>{h0();BP=/^[cC][0-9a-z]{6,}$/,TP=/^[0-9a-z]+$/,EP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jP=/^[0-9a-vA-V]{20}$/,CP=/^[A-Za-z0-9]{27}$/,_P=/^[a-zA-Z0-9_-]{21}$/,RP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?Line 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 gF;var _F=K0(()=>{gF={major:4,minor:4,patch:3}});function eF($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function kb($){if(!aw.test($))return!1;let I=$.replace(/[-_]/g,(q)=>q==="-"?"+":"/"),z=I.padEnd(Math.ceil(I.length/4)*4,"=");return eF(z)}function fb($,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 Tb($,I,z){if($.issues.length)I.issues.push(...I$(z,$.issues));I.value[z]=$.value}function JH($,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 bb($){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=RN($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(z)}}function nb($,I,z,q,U,Y){let J=[],Q=U.keySet,K=U.catchall._zod,w=K.def.type,H=K.optin==="optional",G=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)=>JH(X,z,W,I,H,G)));else JH(V,z,W,I,H,G)}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 Eb($,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 Bb($,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 CF($,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=CF($[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=CF(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 jb($,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=CF(I.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}function vb($,I){for(let z=$.length-1;z>=0;z--)if($[z]._zod[I]!=="optional")return z+1;return 0}function Rb($,I,z){if($.issues.length)I.issues.push(...I$(z,$.issues));I.value[z]=$.value}function gb($,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 _b($,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 Cb($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}function hb($,I){if(I===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Sb($,I){if($.value===void 0)$.value=I.defaultValue;return $}function yb($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}function qH($,I,z){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues,f Line truncated
if (${M}.issues.length) {
if (${j} in input) {
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
`))}}var OB;var FB=e(()=>{OB={major:4,minor:4,patch:3}});function bB($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function km($){if(!yW.test($))return!1;let I=$.replace(/[-_]/g,(q)=>q==="-"?"+":"/"),z=I.padEnd(Math.ceil(I.length/4)*4,"=");return bB(z)}function fm($,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 Bm($,I,z){if($.issues.length)I.issues.push(...E8(z,$.issues));I.value[z]=$.value}function pW($,I,z,q,U,Y){let J=z in q;if($.issues.length){if(U&&Y&&!J)return;I.issues.push(...E8(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 bm($){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=LP($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(z)}}function im($,I,z,q,U,Y){let J=[],Q=U.keySet,K=U.catchall._zod,H=K.def.type,G=K.optin==="optional",Z=K.optout==="optional";for(let W in I){if(W==="__proto__")continue;if(Q.has(W))continue;if(H==="never"){J.push(W);continue}let X=K.run({value:I[W],issues:[]},q);if(X instanceof Promise)$.push(X.then((w)=>pW(w,z,W,I,G,Z)));else pW(X,z,W,I,G,Z)}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 Tm($,I,z,q){for(let Y of $)if(Y.issues.length===0)return I.value=Y.value,I;let U=$.filter((Y)=>!M3(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)=>K8(J,q,f4())))}),I}function Em($,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)=>K8(J,q,f4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:z,errors:[],inclusive:!1});return I}function MB($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(F3($)&&F3(I)){let z=Object.keys(I),q=Object.keys($).filter((Y)=>z.indexOf(Y)!==-1),U={...$,...I};for(let Y of q){let J=MB($[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=MB(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 jm($,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(M3($))return $;let J=MB(I.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}function Cm($,I){for(let z=$.length-1;z>=0;z--)if($[z]._zod[I]!=="optional")return z+1;return 0}function _m($,I,z){if($.issues.length)I.issues.push(...E8(z,$.issues));I.value[z]=$.value}function Rm($,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(...E8(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 vm($,I,z,q,U,Y,J){if($.issues.length)if(_J.has(typeof q))z.issues.push(...E8(q,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:U,inst:Y,issues:$.issues.map((Q)=>K8(Q,J,f4()))});if(I.issues.length)if(_J.has(typeof q))z.issues.push(...E8(q,I.issues));else z.issues.push({origin:"map",code:"invalid_element",input:U,inst:Y,key:q,issues:I.issues.map((Q)=>K8(Q,J,f4()))});z.value.set($.value,I.value)}function hm($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}function gm($,I){if(I===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Sm($,I){if($.value===void 0)$.value=I.defaultValue;return $}function ym($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}function iW($,I,z){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues,fa Line truncated
if (${A}.issues.length) {
if (${T} in input) {
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
...iss,
path: iss.path ? [${j}, ...iss.path] : [${j}]
path: iss.path ? [${T}, ...iss.path] : [${T}]
})));
}
}
if (${M}.value === undefined) {
if (${j} in input) {
newResult[${j}] = undefined;
if (${A}.value === undefined) {
if (${T} in input) {
newResult[${T}] = undefined;
}
} else {
newResult[${j}] = ${M}.value;
newResult[${T}] = ${A}.value;
}
`);else if(!h)V.write(`
const ${M}_present = ${j} in input;
if (${M}.issues.length) {
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
`);else if(!h)X.write(`
const ${A}_present = ${T} in input;
if (${A}.issues.length) {
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
...iss,
path: iss.path ? [${j}, ...iss.path] : [${j}]
path: iss.path ? [${T}, ...iss.path] : [${T}]
})));
}
if (!${M}_present && !${M}.issues.length) {
if (!${A}_present && !${A}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${j}]
path: [${T}]
});
}
if (${M}_present) {
if (${M}.value === undefined) {
newResult[${j}] = undefined;
if (${A}_present) {
if (${A}.value === undefined) {
newResult[${T}] = undefined;
} else {
newResult[${j}] = ${M}.value;
newResult[${T}] = ${A}.value;
}
}
`);else V.write(`
if (${M}.issues.length) {
payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
`);else X.write(`
if (${A}.issues.length) {
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
...iss,
path: iss.path ? [${j}, ...iss.path] : [${j}]
path: iss.path ? [${T}, ...iss.path] : [${T}]
})));
}
if (${M}.value === undefined) {
if (${j} in input) {
newResult[${j}] = undefined;
if (${A}.value === undefined) {
if (${T} in input) {
newResult[${T}] = undefined;
}
} else {
newResult[${j}] = ${M}.value;
newResult[${T}] = ${A}.value;
}
`)}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&&BN.value,H=I.catchall,G;$._zod.parse=(W,V)=>{G??(G=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),!H)return W;return nb([],X,W,V,G,$)}return z(W,V)}});bY=t("$ZodUnion",($,I)=>{d0.init($,I),Y1($._zod,"optin",()=>I.options.some((q)=>q._zod.optin==="optional")?"optional":void 0),Y1($._zod,"optout",()=>I.options.some((q)=>q._zod.optout==="optional")?"optional":void 0),Y1($._zod,"values",()=>{if(I.options.every((q)=>q._zod.values))return new Set(I.options.flatMap((q)=>Array.from(q._zod.values)));return}),Y1($._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 Eb(J,q,$,U);return Promise.all(J).then((Q)=>{return Eb(Q,q,$,U)})}});OM=t("$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 Bb(J,q,$,U);return Promise.all(J).then((Q)=>{return Bb(Q,q,$,U)})}}),DM=t("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,bY.init($,I);let z=$._zod.parse;Y1($._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}}),NM=t("$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 jb(z,K,w)});return jb(z,Y,J)}});wH=t("$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=vb(z,"optin"),K=vb(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 H=0;H<z.length;H++){let G=z[H]._zod.run({value:Y[H],issues:[]},U);if(G instanceof Promise)J.push(G.then((W)=>{w[H]=W}));else w[H]=G}if(I.rest){let H=z.length-1,G=Y.slice(z.length);for(let W of G){H++;let V=I.rest._zod.run({value:W,issues:[]},U);if(V instanceof Promise)J.push(V.then((X)=>Rb(X,q,H)));else Rb(V,q,H)}}if(J.length)return Promise.all(J).then(()=>gb(w,q,z,Y,K));return gb(w,q,z,Y,K)}});FM=t("$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 H=I.keyType._zod.run({value:w,issues:[]},q);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map((V)=>b6(V,q,E4())),input:w,path:[w],inst:$});continue}let G=H.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[G]=V.value}));else{if(W.issues.length)z.issues.push(...I$(w,W.issues));z.value[G]=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
`)}X.write("payload.value = newResult;"),X.write("return payload;");let D=X.compile();return(P,A)=>D(W,P,A)},Y,J=W2,Q=!H2.jitless,H=Q&&XP.value,G=I.catchall,Z;$._zod.parse=(W,X)=>{Z??(Z=q.value);let w=W.value;if(!J(w))return W.issues.push({expected:"object",code:"invalid_type",input:w,inst:$}),W;if(Q&&H&&X?.async===!1&&X.jitless!==!0){if(!Y)Y=U(I.shape);if(W=Y(W,X),!G)return W;return im([],w,W,X,Z,$)}return z(W,X)}});nJ=t("$ZodUnion",($,I)=>{m0.init($,I),J1($._zod,"optin",()=>I.options.some((q)=>q._zod.optin==="optional")?"optional":void 0),J1($._zod,"optout",()=>I.options.some((q)=>q._zod.optout==="optional")?"optional":void 0),J1($._zod,"values",()=>{if(I.options.every((q)=>q._zod.values))return new Set(I.options.flatMap((q)=>Array.from(q._zod.values)));return}),J1($._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)=>CJ(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 Tm(J,q,$,U);return Promise.all(J).then((Q)=>{return Tm(Q,q,$,U)})}});UT=t("$ZodXor",($,I)=>{nJ.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 Em(J,q,$,U);return Promise.all(J).then((Q)=>{return Em(Q,q,$,U)})}}),YT=t("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,nJ.init($,I);let z=$._zod.parse;J1($._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 H of K)U[Q].add(H)}}return U});let q=Tz(()=>{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(!W2(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}}),JT=t("$ZodIntersection",($,I)=>{m0.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,H])=>{return jm(z,K,H)});return jm(z,Y,J)}});lW=t("$ZodTuple",($,I)=>{m0.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=Cm(z,"optin"),K=Cm(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 H=Array(z.length);for(let G=0;G<z.length;G++){let Z=z[G]._zod.run({value:Y[G],issues:[]},U);if(Z instanceof Promise)J.push(Z.then((W)=>{H[G]=W}));else H[G]=Z}if(I.rest){let G=z.length-1,Z=Y.slice(z.length);for(let W of Z){G++;let X=I.rest._zod.run({value:W,issues:[]},U);if(X instanceof Promise)J.push(X.then((w)=>_m(w,q,G)));else _m(X,q,G)}}if(J.length)return Promise.all(J).then(()=>Rm(H,q,z,Y,K));return Rm(H,q,z,Y,K)}});QT=t("$ZodRecord",($,I)=>{m0.init($,I),$._zod.parse=(z,q)=>{let U=z.value;if(!F3(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 H of J)if(typeof H==="string"||typeof H==="number"||typeof H==="symbol"){Q.add(typeof H==="number"?H.toString():H);let G=I.keyType._zod.run({value:H,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((X)=>K8(X,q,f4())),input:H,path:[H],inst:$});continue}let Z=G.value,W=I.valueType._zod.run({value:U[H],issues:[]},q);if(W instanceof Promise)Y.push(W.then((X)=>{if(X.issues.length)z.issues.push(...E8(H,X.issues));z.value[Z]=X.value}));else{if(W.issues.length)z.issues.push(...E8(H,W.issues));z.value[Z]=W.value}}let K;for(let H in U)if(!Q.has(H))K=K??[],K.push(H);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,H={...w},G=K.ref;if(K.ref=null,G){q(G);let V=$.seen.get(G),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,H),Q._zod.parent===G)for(let O in w){if(O==="$ref"||O==="allOf")continue;if(!(O in H))delete w[O]}if(X.$ref&&V.def)for(let O in w){if(O==="$ref"||O==="allOf")continue;if(O in V.def&&JSON.stringify(w[O])===JSON.stringify(V.def[O]))delete w[O]}}let W=Q._zod.parent;if(W&&W!==G){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 gP=($,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 tY=K0(()=>{lY()});function nH($,I){if("_idmap"in $){let q=$,U=v9({...I,processors:kH}),Y={};for(let K of q._idmap.entries()){let[w,H]=K;x1(H,U)}let J={},Q={registry:q,uri:I?.uri,defs:Y};U.external=Q;for(let K of q._idmap.entries()){let[w,H]=K;R9(U,H),J[w]=g9(U,H)}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:kH});return x1($,z),R9(z,$),g9(z,$)}var tP0,_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=tP0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(w)U.contentEncoding=w;if(K&&K.size>0){let H=[...K];if(H.length===1)U.pattern=H[0].source;else if(H.length>1)U.allOf=[...H.map((G)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:G.source}))]}},CP=($,I,z,q)=>{let U=z,{minimum:Y,maximum:J,format:Q,multipleOf:K,exclusiveMaximum:w,exclusiveMinimum:H}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let G=typeof H==="number"&&H>=(Y??Number.NEGATIVE_INFINITY),W=typeof w==="number"&&w<=(J??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(G)if(V)U.minimum=H,U.exclusiveMinimum=!0;else U.exclusiveMinimLine truncated
`:""},this._extScope=$,this._scope=new X8.Scope({parent:$}),this._nodes=[new dp]}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 fp($,U,z)),U}const($,I,z){return this._def(X8.varKinds.const,$,I,z)}let($,I,z){return this._def(X8.varKinds.let,$,I,z)}var($,I,z){return this._def(X8.varKinds.var,$,I,z)}assign($,I,z){return this._leafNode(new aE($,I,z))}add($,I){return this._leafNode(new bp($,J$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X1.nil)this._leafNode(new cp($));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 mp($),I)}forRange($,I,z,q,U=this.opts.es5?X8.varKinds.var:X8.varKinds.let){let Y=this._scope.toName($);return this._for(new lp(U,Y,I,z),()=>q(Y))}forOf($,I,z,q=X8.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?X8.varKinds.var:X8.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 np($))}break($){return this._leafNode(new ip($))}return($){let I=new kG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(kG)}try($,I,z){if(!I&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let q=new op;if(this._blockNode(q),this.code($),I){let U=this.name("e");this._currNode=q.catch=new fG(U),I(U)}if(z)this._currNode=q.finally=new bG,this.code(z);return this._endBlockNode(fG,bG)}throw($){return this._leafNode(new pp($))}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 xG($,I,z)),q)this.code(q).endFunc();return this}endFunc(){return this._endBlockNode(xG)}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=rp;function W3($,I){for(let z in I)$[z]=($[z]||0)+(I[z]||0);return $}function nG($,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 FB0($,I){for(let z in I)$[z]=($[z]||0)-(I[z]||0)}function tp($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X1._`!${tE($)}`}J$.not=tp;var MB0=ap(J$.operators.AND);function AB0(...$){return $.reduce(MB0)}J$.and=AB0;var PB0=ap(J$.operators.OR);function TB0(...$){return $.reduce(PB0)}J$.or=TB0;function ap($){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
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 H=$.external.registry.get(J[0])?.id;if(I!==J[0]&&H){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 B3($,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 H=K.def??K.schema,G={...H},Z=K.ref;if(K.ref=null,Z){q(Z);let X=$.seen.get(Z),w=X.schema;if(w.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))H.allOf=H.allOf??[],H.allOf.push(w);else Object.assign(H,w);if(Object.assign(H,G),Q._zod.parent===Z)for(let O in H){if(O==="$ref"||O==="allOf")continue;if(!(O in G))delete H[O]}if(w.$ref&&X.def)for(let O in H){if(O==="$ref"||O==="allOf")continue;if(O in X.def&&JSON.stringify(H[O])===JSON.stringify(X.def[O]))delete H[O]}}let W=Q._zod.parent;if(W&&W!==Z){q(W);let X=$.seen.get(W);if(X?.schema.$ref){if(H.$ref=X.schema.$ref,X.def)for(let w in H){if(w==="$ref"||w==="allOf")continue;if(w in X.def&&JSON.stringify(H[w])===JSON.stringify(X.def[w]))delete H[w]}}}$.override({zodSchema:Q,jsonSchema:H,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:lz(I,"input",$.processors),output:lz(I,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function G8($,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 G8(q.element,z);if(q.type==="set")return G8(q.valueType,z);if(q.type==="lazy")return G8(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 G8(q.innerType,z);if(q.type==="intersection")return G8(q.left,z)||G8(q.right,z);if(q.type==="record"||q.type==="map")return G8(q.keyType,z)||G8(q.valueType,z);if(q.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return G8(q.in,z)||G8(q.out,z)}if(q.type==="object"){for(let U in q.shape)if(G8(q.shape[U],z))return!0;return!1}if(q.type==="union"){for(let U of q.options)if(G8(U,z))return!0;return!1}if(q.type==="tuple"){for(let U of q.items)if(G8(U,z))return!0;if(q.rest&&G8(q.rest,z))return!0;return!1}return!1}var Oj=($,I={})=>(z)=>{let q=A3({...z,processors:I});return c1($,q),P3(q,$),B3(q,$)},lz=($,I,z={})=>(q)=>{let{libraryOptions:U,target:Y}=q??{},J=A3({...U??{},target:Y,io:I,processors:z});return c1($,J),P3(J,$),B3(J,$)};var aJ=e(()=>{rJ()});function TX($,I){if("_idmap"in $){let q=$,U=A3({...I,processors:AX}),Y={};for(let K of q._idmap.entries()){let[H,G]=K;c1(G,U)}let J={},Q={registry:q,uri:I?.uri,defs:Y};U.external=Q;for(let K of q._idmap.entries()){let[H,G]=K;P3(U,G),J[H]=B3(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=A3({...I,processors:AX});return c1($,z),P3(z,$),B3(z,$)}var Rx0,Fj=($,I,z,q)=>{let U=z;U.type="string";let{minimum:Y,maximum:J,format:Q,patterns:K,contentEncoding:H}=$._zod.bag;if(typeof Y==="number")U.minLength=Y;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=Rx0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(H)U.contentEncoding=H;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((Z)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:Z.source}))]}},Mj=($,I,z,q)=>{let U=z,{minimum:Y,maximum:J,format:Q,multipleOf:K,exclusiveMaximum:H,exclusiveMinimum:G}=$._zod.bag;if(typeof Q==="string"&&Q.includes("int"))U.type="integer";else U.type="number";let Z=typeof G==="number"&&G>=(Y??Number.NEGATIVE_INFINITY),W=typeof H==="number"&&H<=(J??Number.POSITIVE_INFINITY),X=I.target==="draft-04"||I.target==="openapi-3.0";if(Z)if(X)U.minimum=G,U.exclusiveMinimum=!0;else U.exclusiveMinimuLine truncated
`:""},this._extScope=$,this._scope=new o$.Scope({parent:$}),this._nodes=[new dr]}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 fr($,U,z)),U}const($,I,z){return this._def(o$.varKinds.const,$,I,z)}let($,I,z){return this._def(o$.varKinds.let,$,I,z)}var($,I,z){return this._def(o$.varKinds.var,$,I,z)}assign($,I,z){return this._leafNode(new k_($,I,z))}add($,I){return this._leafNode(new br($,v8.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==M1.nil)this._leafNode(new pr($));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,M1.addCodeArg)(I,q)}return I.push("}"),new M1._Code(I)}if($,I,z){if(this._blockNode(new X9($)),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 X9($))}else(){return this._elseNode(new RQ)}endIf(){return this._endBlockNode(X9,RQ)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new mr($),I)}forRange($,I,z,q,U=this.opts.es5?o$.varKinds.var:o$.varKinds.let){let Y=this._scope.toName($);return this._for(new lr(U,Y,I,z),()=>q(Y))}forOf($,I,z,q=o$.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let Y=I instanceof M1.Name?I:this.var("_arr",I);return this.forRange("_i",0,M1._`${Y}.length`,(J)=>{this.var(U,M1._`${Y}[${J}]`),z(U)})}return this._for(new x_("of",q,U,I),()=>z(U))}forIn($,I,z,q=this.opts.es5?o$.varKinds.var:o$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,M1._`Object.keys(${I})`,z);let U=this._scope.toName($);return this._for(new x_("in",q,U,I),()=>z(U))}endFor(){return this._endBlockNode(Kq)}label($){return this._leafNode(new ir($))}break($){return this._leafNode(new nr($))}return($){let I=new AV;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(AV)}try($,I,z){if(!I&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let q=new or;if(this._blockNode(q),this.code($),I){let U=this.name("e");this._currNode=q.catch=new PV(U),I(U)}if(z)this._currNode=q.finally=new BV,this.code(z);return this._endBlockNode(PV,BV)}throw($){return this._leafNode(new cr($))}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=M1.nil,z,q){if(this._blockNode(new DV($,I,z)),q)this.code(q).endFunc();return this}endFunc(){return this._endBlockNode(DV)}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 X9))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]=$}}v8.CodeGen=rr;function M2($,I){for(let z in I)$[z]=($[z]||0)+(I[z]||0);return $}function TV($,I){return I instanceof M1._CodeOrName?M2($,I.names):$}function Hq($,I,z){if($ instanceof M1.Name)return q($);if(!U($))return $;return new M1._Code($._items.reduce((Y,J)=>{if(J instanceof M1.Name)J=q(J);if(J instanceof M1._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 M1._Code&&Y._items.some((J)=>J instanceof M1.Name&&I[J.str]===1&&z[J.str]!==void 0)}}function $f0($,I){for(let z in I)$[z]=($[z]||0)-(I[z]||0)}function sr($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:M1._`!${u_($)}`}v8.not=sr;var If0=tr(v8.operators.AND);function zf0(...$){return $.reduce(If0)}v8.and=zf0;var qf0=tr(v8.operators.OR);function Uf0(...$){return $.reduce(qf0)}v8.or=Uf0;function tr($){return(I,z)=>I===M1.nil?z:z===M1.nil?I:M1._`${u_(I)} ${$} ${u_(z)}`}function u_($){return $ instanceof M1.Name?$:M1._`(${Line truncated
|| (${J} == "string" && ${U} && ${U} == +${U})`).assign(Q,$1._`+${U}`);return;case"integer":q.elseIf($1._`${J} === "boolean" || ${U} === null
|| (${J} === "string" && ${U} && ${U} == +${U} && !(${U} % 1))`).assign(Q,$1._`+${U}`);return;case"boolean":q.elseIf($1._`${U} === "false" || ${U} === 0 || ${U} === null`).assign(Q,!1).elseIf($1._`${U} === "true" || ${U} === 1`).assign(Q,!0);return;case"null":q.elseIf($1._`${U} === "" || ${U} === 0 || ${U} === false`),q.assign(Q,null);return;case"array":q.elseIf($1._`${J} === "string" || ${J} === "number"
|| ${J} === "boolean" || ${U} === null`).assign(Q,$1._`[${U}]`)}}}function xj0({gen:$,parentData:I,parentDataProperty:z},q){$.if($1._`${I} !== undefined`,()=>$.assign($1._`${I}[${z}]`,q))}function UB($,I,z,q=yz.Correct){let U=q===yz.Correct?$1.operators.EQ:$1.operators.NEQ,Y;switch($){case"null":return $1._`${I} ${U} null`;case"array":Y=$1._`Array.isArray(${I})`;break;case"object":Y=$1._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J($1._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return $1._`typeof ${I} ${U} ${$}`}return q===yz.Correct?Y:(0,$1.not)(Y);function J(Q=$1.nil){return(0,$1.and)($1._`typeof ${I} == "number"`,Q,z?$1._`isFinite(${I})`:$1.nil)}}jc.checkDataType=UB;function YB($,I,z,q){if($.length===1)return UB($[0],I,z,q);let U,Y=(0,Tc.toHash)($);if(Y.array&&Y.object){let J=$1._`typeof ${I} != "object"`;U=Y.null?J:$1._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=$1.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,$1.and)(U,UB(J,I,z,q));return U}jc.checkDataTypes=YB;var kj0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?$1._`{type: ${$}}`:$1._`{type: ${I}}`};function JB($){let I=fj0($);(0,Cj0.reportError)(I,kj0)}jc.reportTypeError=JB;function fj0($){let{gen:I,data:z,schema:q}=$,U=(0,Tc.schemaRefOrVal)($,q,"type");return{gen:I,keyword:"type",data:z,schema:q.type,schemaCode:U,schemaValue:U,parentSchema:q,params:{},it:$}}});var Cc=N((gc)=>{Object.defineProperty(gc,"__esModule",{value:!0});gc.assignDefaults=void 0;var uz=z1(),mj0=N1();function lj0($,I){let{properties:z,items:q}=$.schema;if(I==="object"&&z)for(let U in z)Rc($,U,z[U].default);else if(I==="array"&&Array.isArray(q))q.forEach((U,Y)=>Rc($,Y,U.default))}gc.assignDefaults=lj0;function Rc($,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,mj0.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$=N((yc)=>{Object.defineProperty(yc,"__esModule",{value:!0});yc.validateUnion=yc.validateArray=yc.usePattern=yc.callValidateCode=yc.schemaProperties=yc.allSchemaProperties=yc.noPropertyInData=yc.propertyInData=yc.isOwnProperty=yc.hasPropFunc=yc.reportMissingProp=yc.checkMissingProp=yc.checkReportMissingProp=void 0;var $4=z1(),QB=N1(),k9=B5(),oj0=N1();function rj0($,I){let{gen:z,data:q,it:U}=$;z.if(wB(z,q,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:$4._`${I}`},!0),$.error()})}yc.checkReportMissingProp=rj0;function tj0({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}`)))}yc.checkMissingProp=tj0;function aj0($,I){$.setParams({missingProperty:I},!0),$.error()}yc.reportMissingProp=aj0;function hc($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:$4._`Object.prototype.hasOwnProperty`})}yc.hasPropFunc=hc;function KB($,I,z){return $4._`${hc($)}.call(${I}, ${z})`}yc.isOwnProperty=KB;function sj0($,I,z,q){let U=$4._`${I}${(0,$4.getProperty)(z)} !== undefined`;return q?$4._`${U} && ${KB($,I,z)}`:U}yc.propertyInData=sj0;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}yc.noPropertyInData=wB;function Sc($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}yc.allSchemaProperties=Sc;function ej0($,I){return Sc(I).filter((z)=>!(0,QB.alwaysValidSchema)($,I[z]))}yc.schemaProperties=ej0;function $v0({schemaCode:$,data:I,it:{gen:z,topSchemaRef:q,schemaPath:U,errorPath:Y},it:J},Q,K,w){let H=w?$4._`${$}, ${I}, ${q}${U}`:I,G=[[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)G.push([k9.default.dynamicAnchors,k9.default.dynamicAnchors]);let W=$4._`${H}, ${z.object(...G)}`;return K!==$4.nil?$4._`${Q}.call(${K}, ${W})`:$4._`${Q}(${W})`}yc.callValidateCode=$v0;var Iv0=$4._`new RegExp`;function zv0({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"?Iv0:(0,oj0.useFunc)($,U)}(${z}, ${q})`})}yc.usePattern=zv0;function qv0($){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)})}}yc.validateArray=qv0;function Uv0($){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
|| ${J} === "boolean" || ${U} === null`).assign(Q,$1._`[${U}]`)}}}function Ob0({gen:$,parentData:I,parentDataProperty:z},q){$.if($1._`${I} !== undefined`,()=>$.assign($1._`${I}[${z}]`,q))}function d_($,I,z,q=Gq.Correct){let U=q===Gq.Correct?$1.operators.EQ:$1.operators.NEQ,Y;switch($){case"null":return $1._`${I} ${U} null`;case"array":Y=$1._`Array.isArray(${I})`;break;case"object":Y=$1._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J($1._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return $1._`typeof ${I} ${U} ${$}`}return q===Gq.Correct?Y:(0,$1.not)(Y);function J(Q=$1.nil){return(0,$1.and)($1._`typeof ${I} == "number"`,Q,z?$1._`isFinite(${I})`:$1.nil)}}js.checkDataType=d_;function m_($,I,z,q){if($.length===1)return d_($[0],I,z,q);let U,Y=(0,Bs.toHash)($);if(Y.array&&Y.object){let J=$1._`typeof ${I} != "object"`;U=Y.null?J:$1._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=$1.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,$1.and)(U,d_(J,I,z,q));return U}js.checkDataTypes=m_;var Fb0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?$1._`{type: ${$}}`:$1._`{type: ${I}}`};function l_($){let I=Mb0($);(0,Wb0.reportError)(I,Fb0)}js.reportTypeError=l_;function Mb0($){let{gen:I,data:z,schema:q}=$,U=(0,Bs.schemaRefOrVal)($,q,"type");return{gen:I,keyword:"type",data:z,schema:q.type,schemaCode:U,schemaValue:U,parentSchema:q,params:{},it:$}}});var hs=M((Rs)=>{Object.defineProperty(Rs,"__esModule",{value:!0});Rs.assignDefaults=void 0;var Zq=z1(),Eb0=P1();function jb0($,I){let{properties:z,items:q}=$.schema;if(I==="object"&&z)for(let U in z)_s($,U,z[U].default);else if(I==="array"&&Array.isArray(q))q.forEach((U,Y)=>_s($,Y,U.default))}Rs.assignDefaults=jb0;function _s($,I,z){let{gen:q,compositeRule:U,data:Y,opts:J}=$;if(z===void 0)return;let Q=Zq._`${Y}${(0,Zq.getProperty)(I)}`;if(U){(0,Eb0.checkStrictMode)($,`default is ignored for: ${Q}`);return}let K=Zq._`${Q} === undefined`;if(J.useDefaults==="empty")K=Zq._`${K} || ${Q} === null || ${Q} === ""`;q.if(K,Zq._`${Q} = ${(0,Zq.stringify)(z)}`)}});var F$=M((ys)=>{Object.defineProperty(ys,"__esModule",{value:!0});ys.validateUnion=ys.validateArray=ys.usePattern=ys.callValidateCode=ys.schemaProperties=ys.allSchemaProperties=ys.noPropertyInData=ys.propertyInData=ys.isOwnProperty=ys.hasPropFunc=ys.reportMissingProp=ys.checkMissingProp=ys.checkReportMissingProp=void 0;var H4=z1(),o_=P1(),h3=V9(),Cb0=P1();function _b0($,I){let{gen:z,data:q,it:U}=$;z.if(s_(z,q,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:H4._`${I}`},!0),$.error()})}ys.checkReportMissingProp=_b0;function Rb0({gen:$,data:I,it:{opts:z}},q,U){return(0,H4.or)(...q.map((Y)=>(0,H4.and)(s_($,I,Y,z.ownProperties),H4._`${U} = ${Y}`)))}ys.checkMissingProp=Rb0;function vb0($,I){$.setParams({missingProperty:I},!0),$.error()}ys.reportMissingProp=vb0;function gs($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:H4._`Object.prototype.hasOwnProperty`})}ys.hasPropFunc=gs;function r_($,I,z){return H4._`${gs($)}.call(${I}, ${z})`}ys.isOwnProperty=r_;function hb0($,I,z,q){let U=H4._`${I}${(0,H4.getProperty)(z)} !== undefined`;return q?H4._`${U} && ${r_($,I,z)}`:U}ys.propertyInData=hb0;function s_($,I,z,q){let U=H4._`${I}${(0,H4.getProperty)(z)} === undefined`;return q?(0,H4.or)(U,(0,H4.not)(r_($,I,z))):U}ys.noPropertyInData=s_;function Ss($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}ys.allSchemaProperties=Ss;function gb0($,I){return Ss(I).filter((z)=>!(0,o_.alwaysValidSchema)($,I[z]))}ys.schemaProperties=gb0;function Sb0({schemaCode:$,data:I,it:{gen:z,topSchemaRef:q,schemaPath:U,errorPath:Y},it:J},Q,K,H){let G=H?H4._`${$}, ${I}, ${q}${U}`:I,Z=[[h3.default.instancePath,(0,H4.strConcat)(h3.default.instancePath,Y)],[h3.default.parentData,J.parentData],[h3.default.parentDataProperty,J.parentDataProperty],[h3.default.rootData,h3.default.rootData]];if(J.opts.dynamicRef)Z.push([h3.default.dynamicAnchors,h3.default.dynamicAnchors]);let W=H4._`${G}, ${z.object(...Z)}`;return K!==H4.nil?H4._`${Q}.call(${K}, ${W})`:H4._`${Q}(${W})`}ys.callValidateCode=Sb0;var yb0=H4._`new RegExp`;function xb0({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:H4._`${U.code==="new RegExp"?yb0:(0,Cb0.useFunc)($,U)}(${z}, ${q})`})}ys.usePattern=xb0;function ub0($){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",H4._`${z}.length`);I.forRange("i",0,K,(H)=>{$.subschema({keyword:q,dataProp:H,dataPropType:o_.Type.Num},Y),I.if((0,H4.not)(Y),Q)})}}ys.validateArray=ub0;function kb0($){let{gen:I,schema:z,keyword:q,it:U}=$;if(!Array.isArray(z))throw Error("ajv implementation error");if(z.some((K)=>(0,o_.alwaysValidSchema)(U,K))&&!U.opts.unevaluated)return;le Line truncated
missingProperty: ${q},
depsCount: ${I},
deps: ${z}}`};var PC0={keyword:"dependencies",type:"object",schemaType:"object",error:sm.error,code($){let[I,z]=TC0($);tm($,I),am($,z)}};function TC0({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 tm($,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()}}sm.validatePropertyDeps=tm;function am($,I=$.schema){let{gen:z,data:q,keyword:U,it:Y}=$,J=z.name("valid");for(let Q in I){if((0,AC0.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)}}sm.validateSchemaDeps=am;sm.default=PC0});var Ul=N((ql)=>{Object.defineProperty(ql,"__esModule",{value:!0});var zl=z1(),jC0=N1(),vC0={message:"property name must be valid",params:({params:$})=>zl._`{propertyName: ${$.propertyName}}`},RC0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:vC0,code($){let{gen:I,schema:z,data:q,it:U}=$;if((0,jC0.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,zl.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};ql.default=RC0});var hB=N((Yl)=>{Object.defineProperty(Yl,"__esModule",{value:!0});var wW=l$(),D8=z1(),_C0=B5(),HW=N1(),CC0={message:"must NOT have additional properties",params:({params:$})=>D8._`{additionalProperty: ${$.additionalProperty}}`},hC0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:CC0,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,HW.alwaysValidSchema)(J,z))return;let w=(0,wW.allSchemaProperties)(q.properties),H=(0,wW.allSchemaProperties)(q.patternProperties);G(),$.ok(D8._`${Y} === ${_C0.default.errors}`);function G(){I.forIn("key",U,(O)=>{if(!w.length&&!H.length)X(O);else I.if(W(O),()=>X(O))})}function W(O){let D;if(w.length>8){let A=(0,HW.schemaRefOrVal)(J,q.properties,"properties");D=(0,wW.isOwnProperty)(I,A,O)}else if(w.length)D=(0,D8.or)(...w.map((A)=>D8._`${O} === ${A}`));else D=D8.nil;if(H.length)D=(0,D8.or)(D,...H.map((A)=>D8._`${(0,wW.usePattern)($,A)}.test(${O})`));return(0,D8.not)(D)}function V(O){I.code(D8._`delete ${U}[${O}]`)}function X(O){if(K.removeAdditional==="all"||K.removeAdditional&&z===!1){V(O);return}if(z===!1){if($.setParams({additionalProperty:O}),$.error(),!Q)I.break();return}if(typeof z=="object"&&!(0,HW.alwaysValidSchema)(J,z)){let D=I.name("valid");if(K.removeAdditional==="failing")L(O,D,!1),I.if((0,D8.not)(D),()=>{$.reset(),V(O)});else if(L(O,D),!Q)I.if((0,D8.not)(D),()=>I.break())}}function L(O,D,A){let T={keyword:"additionalProperties",dataProp:O,dataPropType:HW.Type.Str};if(A===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,D)}}};Yl.default=hC0});var wl=N((Kl)=>{Object.defineProperty(Kl,"__esModule",{value:!0});var yC0=SJ(),Jl=l$(),SB=N1(),Ql=hB(),uC0={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)Ql.default.code(new yC0.KeywordCxt(Y,Ql.default,"additionalProperties"));let J=(0,Jl.allSchemaProperties)(z);for(let G of J)Y.definedProperties.add(G);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((G)=>!(0,SB.alwaysValidSchema)(Y,z[G]));if(Q.length===0)return;let K=I.name("valid");for(let G of Q){if(w(G))H(G);else{if(I.if((0,Jl.propertyInData)(I,U,G,Y.opts.ownProperties)),H(G),!Y.allErrors)I.else().var(K,!0);I.endIf()}$.it.definedProperties.add(G),$.ok(K)}function w(G){return Y.opts.useDefaults&&!Y.compositeRule&&z[G].default!==void 0}function H(G){$.subschema({keyword:"properties",schemaProp:G,dataProp:G},K)}}};Kl.default=uC0});var Zl=N((Vl)=>{Object.defineProperty(Vl,"__esModule",{value:!0});var Hl=l$(),GW=z1(),Gl=N1(),Wl=N1(),kC0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,data:q,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,Hl.allSchemaProperties)(z),K=Q.filter((L)=>(0,Gl.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,H=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,n+=a1(b,2),n+=Q.magic,n+=a1(O,2),n+=a1(D,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 C=sV.LOCAL_FILE_HEADER+n+w+A,k=sV.CENTRAL_FILE_HEADER+a1(f,2)+n+a1(W.length,2)+"\x00\x00\x00\x00"+a1(R,4)+a1(q,4)+w+A+W;return{fileRecord:C,dirRecord:k}},Zi0=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},Xi0=function($){var I="";return I=sV.DATA_DESCRIPTOR+a1($.crc32,4)+a1($.compressedSize,4)+a1($.uncompressedSize,4),I};function E8($,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(E8,Tq);E8.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}})};E8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var z=O10($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};E8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,z=O10($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),I)this.push({data:Xi0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};E8.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=Zi0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:q,meta:{percent:100}})};E8.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};E8.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};E8.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};E8.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};E8.prototype.lock=function(){Tq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};D10.exports=E8});var F10=N((Ni0)=>{var Li0=FR(),Oi0=N10(),Di0=function($,I){var z=$||I,q=Li0[z];if(!q)throw Error(z+" is not a valid compression method !");return q};Ni0.generateWorker=function($,I,z){var q=new Oi0(I.streamFiles,z,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=Di0(J.options.compression,I.compression),K=J.options.compressionOptions||I.compressionOptions||{},w=J.dir,H=J.date;J._compressWorker(Q,K).withStreamInfo("file",{name:Y,dir:w,date:H,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(q)}),q.entriesCount=U}catch(Y){q.error(Y)}return q}});var A10=N((dR1,M10)=>{var Mi0=O4(),eV=R$();function rQ($,I){eV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Mi0.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};M10.exports=rQ});var C10=N((mR1,_10)=>{var Ai0=Vq(),tQ=O4(),B10=R$(),Pi0=Bv(),j10=jv(),P10=SV(),Ti0=Te(),Ei0=F10(),T10=vQ(),Bi0=A10(),v10=function($,I,z){var q=tQ.getTypeOf(I),U,Y=tQ.extend(z||{},j10);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)A60(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(M60.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"};P60.exports=Yg});var Jg=N((Od0)=>{var T60=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ld0($){if(typeof $==="string")return $;if(T60)return T60.decode($);return $.toString()}Od0.bufferToString=Ld0});var R60=N((B60)=>{Object.defineProperty(B60,"__esModule",{value:!0});B60.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;B60.S=` \r
`;B60.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";B60.NAME_CHAR="-"+B60.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";B60.CHAR_RE=new RegExp("^["+B60.CHAR+"]$","u");B60.S_RE=new RegExp("^["+B60.S+"]+$","u");B60.NAME_START_CHAR_RE=new RegExp("^["+B60.NAME_START_CHAR+"]$","u");B60.NAME_CHAR_RE=new RegExp("^["+B60.NAME_CHAR+"]$","u");B60.NAME_RE=new RegExp("^["+B60.NAME_START_CHAR+"]["+B60.NAME_CHAR+"]*$","u");B60.NMTOKEN_RE=new RegExp("^["+B60.NAME_CHAR+"]+$","u");var Qg=9,Kg=10,wg=13,Hg=32;B60.S_LIST=[Hg,Kg,wg,Qg];function Nd0($){return $>=Hg&&$<=55295||$===Kg||$===wg||$===Qg||$>=57344&&$<=65533||$>=65536&&$<=1114111}B60.isChar=Nd0;function Fd0($){return $===Hg||$===Kg||$===wg||$===Qg}B60.isS=Fd0;function E60($){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}B60.isNameStartChar=E60;function Md0($){return E60($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}B60.isNameChar=Md0});var f60=N((y60)=>{Object.defineProperty(y60,"__esModule",{value:!0});y60.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";y60.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";y60.S=` \r
`;y60.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";y60.NAME_CHAR="-"+y60.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";y60.CHAR_RE=new RegExp("^["+y60.CHAR+"]$","u");y60.RESTRICTED_CHAR_RE=new RegExp("^["+y60.RESTRICTED_CHAR+"]$","u");y60.S_RE=new RegExp("^["+y60.S+"]+$","u");y60.NAME_START_CHAR_RE=new RegExp("^["+y60.NAME_START_CHAR+"]$","u");y60.NAME_CHAR_RE=new RegExp("^["+y60.NAME_CHAR+"]$","u");y60.NAME_RE=new RegExp("^["+y60.NAME_START_CHAR+"]["+y60.NAME_CHAR+"]*$","u");y60.NMTOKEN_RE=new RegExp("^["+y60.NAME_CHAR+"]+$","u");var g60=9,_60=10,C60=13,h60=32;y60.S_LIST=[h60,_60,C60,g60];function hd0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}y60.isChar=hd0;function Sd0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}y60.isRestrictedChar=Sd0;function yd0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}y60.isCharAndNotRestricted=yd0;function ud0($){return $===h60||$===_60||$===C60||$===g60}y60.isS=ud0;function S60($){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}y60.isNameStartChar=S60;function xd0($){return S60($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}y60.isNameChar=xd0});var i60=N((n60)=>{Object.defineProperty(n60,"__esModule",{value:!0});n60.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";n60.NC_NAME_CHAR="-"+n60.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";n60.NC_NAME_START_CHAR_RE=new RegExp("^["+n60.NC_NAME_START_CHAR+"]$","u");n60.NC_NAME_CHAR_RE=new RegExp("^["+n60.NC_NAME_CHAR+"]$","u");n60.NC_NAME_RE=new RegExp("^["+n60.NC_NAME_START_CHAR+"]["+n60.NC_NAME_CHAR+"]*$","u");function b60($){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}n60.isNCNameStartChar=b60;function sd0($){return b60($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}n60.isNCNameChar=sd0});var H$0=N((w$0)=>{Object.defineProperty(w$0,"__esModule",{value:!0});var yq=R60(),Um0=f60(),Tg=i60(),W$=yq.isS,Ym0=yq.isChar,w2=yq.isNameStartChar,p60=yq.isNameChar,q$0=yq.S_LIST,Jm0=yq.NAME_RE,Qm0=Um0.isChar,Km0=Tg.isNCNameStartChar,wm0=Tg.isNCNameChar,Hm0=Tg.NC_NAME_RE,vZ="http://www.w3.org/XML/1998/namespace",Sq="http://www.w3.org/2000/xmlns/",Gm0={__proto__:null,xml:vZ,xmlns:Sq},Wm0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},V4=-1,z5=-2,c60=0,Vm0=1,Wg=2,Zm0=3,_q=4,Xm0=5,Lm0=6,Om0=7,Vg=8,Dm0=9,Nm0=10,Fm0=11,Mm0=12,l6=13,PZ=14,Zg=15,Am0=16,Xg=17,Pm0=18,Tm0=19,Lg=20,Em0=21,Bm0=22,jm0=23,d60=24,Og=25,TZ=26,m60=27,vm0=28,Rm0=29,l60=30,gm0=31,_m0=32,i3=33,Cm0=34,Dg=35,H2=36,Ng=37,hm0=38,o60=39,r60=40,Sm0=41,t60=42,ym0=43,um0=44,Fg=9,j8=10,Mg=13,a60=32,s60=33,U$0=34,G2=38,Y$0=39,EZ=45,BZ=47,xm0=59,w7=60,Cq=61,m4=62,O6=63,J$0=91,hq=93,e60=133,$$0=8232,jZ=($)=>$===U$0||$===Y$0,Q$0=[U$0,Y$0],km0=[...Q$0,J$0,m4],fm0=[...Q$0,w7,hq],bm0=[Cq,O6,...q$0],nm0=[...q$0,m4,G2,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 im0($,I){for(let z of Object.keys(I))Pg($,z,I[z])}var pm0=($)=>Hm0.test($),cm0=($)=>Jm0.test($),p3=0,I$0=1,Ag=2;w$0.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var z$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 K$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=Km0,this.nameCheck=wm0,this.isName=pm0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Gm0);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 z5:this.text+=`${z.slice(I,this.prevI)}
`,I=this.i,q=j8;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(!p60(z))return this.name+=$.slice(I,this.prevI),z===z5?j8:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===V4||!W$($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=Ym0,this.getCode=this.getCode10;else this.isChar=Qm0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Vm0}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(km0);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===J$0)this.state=_q;else if(jZ(I))this.state=Zm0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Wg}sDTD(){let $=this.captureTo(fm0);if($===V4)return;if(this.text+=String.fromCodePoint($),$===hq)this.state=Wg;else if($===w7)this.state=Lm0;else if(jZ($))this.state=Xm0,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 s60:this.state=Om0,this.openWakaBang="";break;case O6:this.state=Fm0;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=Dm0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===EZ?Nm0: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(O6))this.text+="?",this.state=Mm0}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 z5:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case xm0:{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=Cm0,this.unget(),this.xmlDeclPossible=!1;else switch($){case BZ:this.state=ym0,this.xmlDeclPossible=!1;break;case s60:this.state=Am0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case O6:this.state=jm0;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=Pm0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===EZ)this.state=Tm0,($=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=Em0}sCDataEnding(){let $=this.getCodeNorm();if($===hq)this.state=Bm0;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=d60;else if($===O6||W$($))this.fail("processing instruction without a target."),this.state=$===O6?TZ:Og;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=d60}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===O6;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:m60}else this.state=q?TZ:Og;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===O6)this.state=TZ;else if(!W$($))this.text=String.fromCodePoint($)}else if(this.captureToChar(O6))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===O6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Og;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===O6){this.state=i3;return}if($!==V4)this.state=vm0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(bm0);if($===O6){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?l60:Rm0}sXMLDeclEq(){let $=this.getCodeNorm();if($===O6){this.state=i3,this.fail("XML declaration is incomplete.");return}if(W$($))return;if($!==Cq)this.fail("value required.");this.state=l60}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===O6){this.state=i3,this.fail("XML declaration is incomplete.");return}if(W$($))return;if(!jZ($))this.fail("value must be quoted."),this.q=a60;else this.q=$;this.state=gm0}sXMLDeclValue(){let $=this.captureTo([this.q,O6]);if($===O6){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 G2:if(this.state=PZ,this.entityReturnState=l6,z!==void 0)this.text+=I.slice($,this.prevI);q=!0;break $;case z5: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!==c60&&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,H;if(Q==="")w=J==="xmlns"?Sq:"",H=J;else{if(w=this.resolve(Q),w===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),w=Q;H=`{${w}}${K}`}if(U.has(H))this.fail(`duplicate attribute: ${H}.`);U.add(H),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)}}w$0.SaxesParser=K$0});var W2=N((Rg1,G$0)=>{var{SaxesParser:lm0}=H$0(),{PassThrough:om0}=_6(),{bufferToString:rm0}=Jg();G$0.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new om0);let I=new lm0,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(rm0(U)),z)throw z;yield q,q=[]}}});var D0=N((gg1,W$0)=>{var tm0=W2(),am0=L6();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}`}}iI0.FormatterOptions=nI0});var QX=N((Ih1,lI0)=>{var Qe0="[object AsyncFunction]",Ke0="[object Function]",we0="[object GeneratorFunction]",He0="[object Null]",Ge0="[object Proxy]",We0="[object Undefined]",Ve0=typeof global=="object"&&global&&global.Object===Object&&global,Ze0=typeof self=="object"&&self&&self.Object===Object&&self,Xe0=Ve0||Ze0||Function("return this")(),dI0=Object.prototype,Le0=dI0.hasOwnProperty,mI0=dI0.toString,cI0=Xe0.Symbol,t3=cI0?cI0.toStringTag:void 0;function Oe0($){if($==null)return $===void 0?We0:He0;return t3&&t3 in Object($)?De0($):Ne0($)}function De0($){var I=Le0.call($,t3),z=$[t3];try{$[t3]=void 0;var q=!0}catch(Y){}var U=mI0.call($);if(q)if(I)$[t3]=z;else delete $[t3];return U}function Ne0($){return mI0.call($)}function Fe0($){if(!Me0($))return!1;var I=Oe0($);return I==Ke0||I==we0||I==Qe0||I==Ge0}function Me0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}lI0.exports=Fe0});var vz0=N((KX,mq)=>{var Ae0=200,l_="__lodash_hash_undefined__",LX=1,Yz0=2,Jz0=9007199254740991,wX="[object Arguments]",b_="[object Array]",Pe0="[object AsyncFunction]",Qz0="[object Boolean]",Kz0="[object Date]",wz0="[object Error]",Hz0="[object Function]",Te0="[object GeneratorFunction]",HX="[object Map]",Gz0="[object Number]",Ee0="[object Null]",dq="[object Object]",oI0="[object Promise]",Be0="[object Proxy]",Wz0="[object RegExp]",GX="[object Set]",Vz0="[object String]",je0="[object Symbol]",ve0="[object Undefined]",n_="[object WeakMap]",Zz0="[object ArrayBuffer]",WX="[object DataView]",Re0="[object Float32Array]",ge0="[object Float64Array]",_e0="[object Int8Array]",Ce0="[object Int16Array]",he0="[object Int32Array]",Se0="[object Uint8Array]",ye0="[object Uint8ClampedArray]",ue0="[object Uint16Array]",xe0="[object Uint32Array]",ke0=/[\\^$.*+?()[\]{}|]/g,fe0=/^\[object .+?Constructor\]$/,be0=/^(?:0|[1-9]\d*)$/,z4={};z4[Re0]=z4[ge0]=z4[_e0]=z4[Ce0]=z4[he0]=z4[Se0]=z4[ye0]=z4[ue0]=z4[xe0]=!0;z4[wX]=z4[b_]=z4[Zz0]=z4[Qz0]=z4[WX]=z4[Kz0]=z4[wz0]=z4[Hz0]=z4[HX]=z4[Gz0]=z4[dq]=z4[Wz0]=z4[GX]=z4[Vz0]=z4[n_]=!1;var Xz0=typeof global=="object"&&global&&global.Object===Object&&global,ne0=typeof self=="object"&&self&&self.Object===Object&&self,c5=Xz0||ne0||Function("return this")(),Lz0=typeof KX=="object"&&KX&&!KX.nodeType&&KX,rI0=Lz0&&typeof mq=="object"&&mq&&!mq.nodeType&&mq,Oz0=rI0&&rI0.exports===Lz0,x_=Oz0&&Xz0.process,tI0=function(){try{return x_&&x_.binding&&x_.binding("util")}catch($){}}(),aI0=tI0&&tI0.isTypedArray;function ie0($,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 pe0($,I){var z=-1,q=I.length,U=$.length;while(++z<q)$[U+z]=I[z];return $}function ce0($,I){var z=-1,q=$==null?0:$.length;while(++z<q)if(I($[z],z,$))return!0;return!1}function de0($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}function me0($){return function(I){return $(I)}}function le0($,I){return $.has(I)}function oe0($,I){return $==null?void 0:$[I]}function re0($){var I=-1,z=Array($.size);return $.forEach(function(q,U){z[++I]=[U,q]}),z}function te0($,I){return function(z){return $(I(z))}}function ae0($){var I=-1,z=Array($.size);return $.forEach(function(q){z[++I]=q}),z}var se0=Array.prototype,ee0=Function.prototype,OX=Object.prototype,k_=c5["__core-js_shared__"],Dz0=ee0.toString,U5=OX.hasOwnProperty,sI0=function(){var $=/[^.]+$/.exec(k_&&k_.keys&&k_.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Nz0=OX.toString,$01=RegExp("^"+Dz0.call(U5).replace(ke0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eI0=Oz0?c5.Buffer:void 0,VX=c5.Symbol,$z0=c5.Uint8Array,Fz0=OX.propertyIsEnumerable,I01=se0.splice,a3=VX?VX.toStringTag:void 0,Iz0=Object.getOwnPropertySymbols,z01=eI0?eI0.isBuffer:void 0,q01=te0(Object.keys,Object),i_=lq(c5,"DataView"),N2=lq(c5,"Map"),p_=lq(c5,"Promise"),c_=lq(c5,"Set"),d_=lq(c5,"WeakMap"),F2=lq(Object,"create"),U01=$I(i_),Y01=$I(N2),J01=$I(p_),Q01=$I(c_),K01=$I(d_),zz0=VX?VX.prototype:void 0,f_=zz0?zz0.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 w01(){this.__data__=F2?F2(null):{},this.size=0}function H01($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function G01($){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(O11.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=`${D11.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=xz0});var s_=N((kz0)=>{Object.defineProperty(kz0,"__esModule",{value:!0});kz0.isSyncTransform=void 0;kz0.isSyncTransform=($)=>$.length===1});var nz0=N((rq)=>{var bz0=rq&&rq.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(rq,"__esModule",{value:!0});rq.RowFormatter=void 0;var F11=bz0(QX()),M11=bz0(vz0()),A11=a_(),P11=s_();class II{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new A11.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(P11.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(!F11.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:!M11.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 iz0=N((FX)=>{Object.defineProperty(FX,"__esModule",{value:!0});FX.FieldFormatter=FX.RowFormatter=void 0;var T11=nz0();Object.defineProperty(FX,"RowFormatter",{enumerable:!0,get:function(){return T11.RowFormatter}});var E11=a_();Object.defineProperty(FX,"FieldFormatter",{enumerable:!0,get:function(){return E11.FieldFormatter}})});var e_=N((cz0)=>{Object.defineProperty(cz0,"__esModule",{value:!0});cz0.CsvFormatterStream=void 0;var j11=a("stream"),v11=iz0();class pz0 extends j11.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new v11.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 $()})}}cz0.CsvFormatterStream=pz0});var lz0=N((j1)=>{var mz0=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]}),R11=j1&&j1.__setModuleDefault||(Object.create?function($,I){Ob Line truncated
deps: ${z}}`};var qd0={keyword:"dependencies",type:"object",schemaType:"object",error:aa.error,code($){let[I,z]=Ud0($);sa($,I),ta($,z)}};function Ud0({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 sa($,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,oQ.propertyInData)(z,q,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)z.if(K,()=>{for(let H of Q)(0,oQ.checkReportMissingProp)($,H)});else z.if(MR._`${K} && (${(0,oQ.checkMissingProp)($,Q,Y)})`),(0,oQ.reportMissingProp)($,Y),z.else()}}aa.validatePropertyDeps=sa;function ta($,I=$.schema){let{gen:z,data:q,keyword:U,it:Y}=$,J=z.name("valid");for(let Q in I){if((0,zd0.alwaysValidSchema)(Y,I[Q]))continue;z.if((0,oQ.propertyInData)(z,q,Q,Y.opts.ownProperties),()=>{let K=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(K,J)},()=>z.var(J,!0)),$.ok(J)}}aa.validateSchemaDeps=ta;aa.default=qd0});var Ue=M((qe)=>{Object.defineProperty(qe,"__esModule",{value:!0});var ze=z1(),Qd0=P1(),Kd0={message:"property name must be valid",params:({params:$})=>ze._`{propertyName: ${$.propertyName}}`},Hd0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Kd0,code($){let{gen:I,schema:z,data:q,it:U}=$;if((0,Qd0.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,ze.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};qe.default=Hd0});var NR=M((Ye)=>{Object.defineProperty(Ye,"__esModule",{value:!0});var lV=F$(),t$=z1(),Zd0=V9(),oV=P1(),Wd0={message:"must NOT have additional properties",params:({params:$})=>t$._`{additionalProperty: ${$.additionalProperty}}`},Xd0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Wd0,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,oV.alwaysValidSchema)(J,z))return;let H=(0,lV.allSchemaProperties)(q.properties),G=(0,lV.allSchemaProperties)(q.patternProperties);Z(),$.ok(t$._`${Y} === ${Zd0.default.errors}`);function Z(){I.forIn("key",U,(O)=>{if(!H.length&&!G.length)w(O);else I.if(W(O),()=>w(O))})}function W(O){let F;if(H.length>8){let D=(0,oV.schemaRefOrVal)(J,q.properties,"properties");F=(0,lV.isOwnProperty)(I,D,O)}else if(H.length)F=(0,t$.or)(...H.map((D)=>t$._`${O} === ${D}`));else F=t$.nil;if(G.length)F=(0,t$.or)(F,...G.map((D)=>t$._`${(0,lV.usePattern)($,D)}.test(${O})`));return(0,t$.not)(F)}function X(O){I.code(t$._`delete ${U}[${O}]`)}function w(O){if(K.removeAdditional==="all"||K.removeAdditional&&z===!1){X(O);return}if(z===!1){if($.setParams({additionalProperty:O}),$.error(),!Q)I.break();return}if(typeof z=="object"&&!(0,oV.alwaysValidSchema)(J,z)){let F=I.name("valid");if(K.removeAdditional==="failing")L(O,F,!1),I.if((0,t$.not)(F),()=>{$.reset(),X(O)});else if(L(O,F),!Q)I.if((0,t$.not)(F),()=>I.break())}}function L(O,F,D){let P={keyword:"additionalProperties",dataProp:O,dataPropType:oV.Type.Str};if(D===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,F)}}};Ye.default=Xd0});var He=M((Ke)=>{Object.defineProperty(Ke,"__esModule",{value:!0});var wd0=xQ(),Je=F$(),DR=P1(),Qe=NR(),Ld0={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)Qe.default.code(new wd0.KeywordCxt(Y,Qe.default,"additionalProperties"));let J=(0,Je.allSchemaProperties)(z);for(let Z of J)Y.definedProperties.add(Z);if(Y.opts.unevaluated&&J.length&&Y.props!==!0)Y.props=DR.mergeEvaluated.props(I,(0,DR.toHash)(J),Y.props);let Q=J.filter((Z)=>!(0,DR.alwaysValidSchema)(Y,z[Z]));if(Q.length===0)return;let K=I.name("valid");for(let Z of Q){if(H(Z))G(Z);else{if(I.if((0,Je.propertyInData)(I,U,Z,Y.opts.ownProperties)),G(Z),!Y.allErrors)I.else().var(K,!0);I.endIf()}$.it.definedProperties.add(Z),$.ok(K)}function H(Z){return Y.opts.useDefaults&&!Y.compositeRule&&z[Z].default!==void 0}function G(Z){$.subschema({keyword:"properties",schemaProp:Z,dataProp:Z},K)}}};Ke.default=Ld0});var Ve=M((Xe)=>{Object.defineProperty(Xe,"__esModule",{value:!0});var Ge=F$(),rV=z1(),Ze=P1(),We=P1(),Fd0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:z,data:q,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,Ge.allSchemaProperties)(z),K=Q.filter((L)=>(0,Ze.alwaysValidSchema)(Y,z[L]));if(Q.length===0||K.length===Q.length&&(!Y.opts.unevaluated||Y.props===!0))return;let H=J.strictSchema&&!J.allowMatchingProperties&&U.properties,G=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,i+=Y4(f,2),i+=Q.magic,i+=Y4(O,2),i+=Y4(F,2),i+=Y4(h.crc32,4),i+=Y4(h.compressedSize,4),i+=Y4(h.uncompressedSize,4),i+=Y4(H.length,2),i+=Y4(D.length,2);var v=xL.LOCAL_FILE_HEADER+i+H+D,y=xL.CENTRAL_FILE_HEADER+Y4(b,2)+i+Y4(W.length,2)+"\x00\x00\x00\x00"+Y4(C,4)+Y4(q,4)+H+D+W;return{fileRecord:v,dirRecord:y}},o01=function($,I,z,q,U){var Y="",J=aq.transformTo("string",U(q));return Y=xL.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+Y4($,2)+Y4($,2)+Y4(I,4)+Y4(z,4)+Y4(J.length,2)+J,Y},r01=function($){var I="";return I=xL.DATA_DESCRIPTOR+Y4($.crc32,4)+Y4($.compressedSize,4)+Y4($.uncompressedSize,4),I};function q5($,I,z,q){eq.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(q5,eq);q5.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,eq.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(I+100*(z-q-1))/z:100}})};q5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var z=L90($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};q5.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,z=L90($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),I)this.push({data:r01($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};q5.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=o01(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:q,meta:{percent:100}})};q5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};q5.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};q5.prototype.resume=function(){if(!eq.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};q5.prototype.error=function($){var I=this._sources;if(!eq.prototype.error.call(this,$))return!1;for(var z=0;z<I.length;z++)try{I[z].error($)}catch(q){}return!0};q5.prototype.lock=function(){eq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};O90.exports=q5});var M90=M((e01)=>{var s01=Qg(),t01=F90(),a01=function($,I){var z=$||I,q=s01[z];if(!q)throw Error(z+" is not a valid compression method !");return q};e01.generateWorker=function($,I,z){var q=new t01(I.streamFiles,z,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=a01(J.options.compression,I.compression),K=J.options.compressionOptions||I.compressionOptions||{},H=J.dir,G=J.date;J._compressWorker(Q,K).withStreamInfo("file",{name:Y,dir:H,date:G,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(q)}),q.entriesCount=U}catch(Y){q.error(Y)}return q}});var D90=M((He1,N90)=>{var I11=_4(),uL=$$();function tK($,I){uL.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}I11.inherits(tK,uL);tK.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()})};tK.prototype.pause=function(){if(!uL.prototype.pause.call(this))return!1;return this._stream.pause(),!0};tK.prototype.resume=function(){if(!uL.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};N90.exports=tK});var v90=M((Ge1,R90)=>{var z11=nq(),aK=_4(),T90=$$(),q11=Xh(),E90=Vh(),A90=FL(),U11=P$0(),Y11=M90(),P90=RK(),J11=D90(),j90=function($,I,z){var q=aK.getTypeOf(I),U,Y=aK.extend(z||{},E90);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.dosPermission Line truncated
`)}openNode($,I){let z=this.tos,q=this._xml;if(z&&this.open)q.push(">");this._stack.push($),q.push("<"),q.push($),pg(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)D70(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");pg(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(N70.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("")}}dg.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};A70.exports=dg});var mg=M((t61)=>{var P70=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function s61($){if(typeof $==="string")return $;if(P70)return P70.decode($);return $.toString()}t61.bufferToString=s61});var C70=M((T70)=>{Object.defineProperty(T70,"__esModule",{value:!0});T70.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;T70.S=` \r
`;T70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";T70.NAME_CHAR="-"+T70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";T70.CHAR_RE=new RegExp("^["+T70.CHAR+"]$","u");T70.S_RE=new RegExp("^["+T70.S+"]+$","u");T70.NAME_START_CHAR_RE=new RegExp("^["+T70.NAME_START_CHAR+"]$","u");T70.NAME_CHAR_RE=new RegExp("^["+T70.NAME_CHAR+"]$","u");T70.NAME_RE=new RegExp("^["+T70.NAME_START_CHAR+"]["+T70.NAME_CHAR+"]*$","u");T70.NMTOKEN_RE=new RegExp("^["+T70.NAME_CHAR+"]+$","u");var lg=9,og=10,rg=13,sg=32;T70.S_LIST=[sg,og,rg,lg];function e61($){return $>=sg&&$<=55295||$===og||$===rg||$===lg||$>=57344&&$<=65533||$>=65536&&$<=1114111}T70.isChar=e61;function $81($){return $===sg||$===og||$===rg||$===lg}T70.isS=$81;function B70($){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}T70.isNameStartChar=B70;function I81($){return B70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}T70.isNameChar=I81});var k70=M((S70)=>{Object.defineProperty(S70,"__esModule",{value:!0});S70.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";S70.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";S70.S=` \r
`;S70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";S70.NAME_CHAR="-"+S70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";S70.CHAR_RE=new RegExp("^["+S70.CHAR+"]$","u");S70.RESTRICTED_CHAR_RE=new RegExp("^["+S70.RESTRICTED_CHAR+"]$","u");S70.S_RE=new RegExp("^["+S70.S+"]+$","u");S70.NAME_START_CHAR_RE=new RegExp("^["+S70.NAME_START_CHAR+"]$","u");S70.NAME_CHAR_RE=new RegExp("^["+S70.NAME_CHAR+"]$","u");S70.NAME_RE=new RegExp("^["+S70.NAME_START_CHAR+"]["+S70.NAME_CHAR+"]*$","u");S70.NMTOKEN_RE=new RegExp("^["+S70.NAME_CHAR+"]+$","u");var _70=9,R70=10,v70=13,h70=32;S70.S_LIST=[h70,R70,v70,_70];function X81($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S70.isChar=X81;function V81($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}S70.isRestrictedChar=V81;function w81($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S70.isCharAndNotRestricted=w81;function L81($){return $===h70||$===R70||$===v70||$===_70}S70.isS=L81;function g70($){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}S70.isNameStartChar=g70;function O81($){return g70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}S70.isNameChar=O81});var i70=M((b70)=>{Object.defineProperty(b70,"__esModule",{value:!0});b70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";b70.NC_NAME_CHAR="-"+b70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";b70.NC_NAME_START_CHAR_RE=new RegExp("^["+b70.NC_NAME_START_CHAR+"]$","u");b70.NC_NAME_CHAR_RE=new RegExp("^["+b70.NC_NAME_CHAR+"]$","u");b70.NC_NAME_RE=new RegExp("^["+b70.NC_NAME_START_CHAR+"]["+b70.NC_NAME_CHAR+"]*$","u");function f70($){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}b70.isNCNameStartChar=f70;function h81($){return f70($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}b70.isNCNameChar=h81});var H20=M((K20)=>{Object.defineProperty(K20,"__esModule",{value:!0});var ZU=C70(),k81=k70(),GS=i70(),u8=ZU.isS,f81=ZU.isChar,ZH=ZU.isNameStartChar,n70=ZU.isNameChar,z20=ZU.S_LIST,b81=ZU.NAME_RE,i81=k81.isChar,n81=GS.isNCNameStartChar,c81=GS.isNCNameChar,p81=GS.NC_NAME_RE,WO="http://www.w3.org/XML/1998/namespace",GU="http://www.w3.org/2000/xmlns/",d81={__proto__:null,xml:WO,xmlns:GU},m81={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},B4=-1,k5=-2,c70=0,l81=1,ag=2,o81=3,QU=4,r81=5,s81=6,t81=7,eg=8,a81=9,e81=10,$$1=11,I$1=12,L8=13,QO=14,$S=15,z$1=16,IS=17,q$1=18,U$1=19,zS=20,Y$1=21,J$1=22,Q$1=23,p70=24,qS=25,KO=26,d70=27,K$1=28,H$1=29,m70=30,G$1=31,Z$1=32,o2=33,W$1=34,US=35,WH=36,YS=37,X$1=38,l70=39,o70=40,V$1=41,r70=42,w$1=43,L$1=44,JS=9,Y5=10,QS=13,s70=32,t70=33,q20=34,XH=38,U20=39,HO=45,GO=47,O$1=59,U7=60,KU=61,G6=62,x6=63,Y20=91,HU=93,a70=133,e70=8232,ZO=($)=>$===q20||$===U20,J20=[q20,U20],F$1=[...J20,Y20,G6],M$1=[...J20,U7,HU],N$1=[KU,x6,...z20],D$1=[...z20,G6,XH,U7];function HS($,I,z){switch(I){case"xml":if(z!==WO)$.fail(`xml prefix must be bound to ${WO}.`);break;case"xmlns":if(z!==GU)$.fail(`xmlns prefix must be bound to ${GU}.`);break;default:}switch(z){case GU:$.fail(I===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${GU}.`);break;case WO: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 A$1($,I){for(let z of Object.keys(I))HS($,z,I[z])}var P$1=($)=>p81.test($),B$1=($)=>b81.test($),r2=0,$20=1,KS=2;K20.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var I20={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 Q20{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=n81,this.nameCheck=c81,this.isName=P$1,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},d81);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 k5:this.text+=`${z.slice(I,this.prevI)}
`,I=this.i,q=Y5;break;case B4: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===B4)return this.name+=$.slice(I),B4;if(!n70(z))return this.name+=$.slice(I,this.prevI),z===k5?Y5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===B4||!u8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=f81,this.getCode=this.getCode10;else this.isChar=i81,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=l81}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case U7:if(this.state=$S,this.text.length!==0)throw Error("no-empty text at start");break;case B4:break;default:this.unget(),this.state=L8,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(F$1);switch(I){case G6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=L8,this.doctype=!0;break}case B4:break;default:if(this.text+=String.fromCodePoint(I),I===Y20)this.state=QU;else if(ZO(I))this.state=o81,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=ag}sDTD(){let $=this.captureTo(M$1);if($===B4)return;if(this.text+=String.fromCodePoint($),$===HU)this.state=ag;else if($===U7)this.state=s81;else if(ZO($))this.state=r81,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=QU,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case t70:this.state=t81,this.openWakaBang="";break;case x6:this.state=$$1;break;default:this.state=QU}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?eg:QU,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(HO))this.text+="-",this.state=a81}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===HO?e81:eg}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===G6)this.state=QU;else this.fail("malformed comment."),this.state=eg}sDTDPI(){if(this.captureToChar(x6))this.text+="?",this.state=I$1}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===G6)this.state=QU}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case k5:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case O$1:{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!==L8||this.textHandler!==void 0)this.text+=U;break $}case B4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(ZH($))this.state=W$1,this.unget(),this.xmlDeclPossible=!1;else switch($){case GO:this.state=w$1,this.xmlDeclPossible=!1;break;case t70:this.state=z$1,this.openWakaBang="",this.xmlDeclPossible=!1;break;case x6:this.state=Q$1;break;default:this.fail("disallowed character in tag name"),this.state=L8,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=zS,this.openWakaBang="";break;case"--":this.state=IS,this.openWakaBang="";break;case"DOCTYPE":if(this.state=ag,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(HO))this.state=q$1}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===HO)this.state=U$1,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=IS}sCommentEnded(){let $=this.getCodeNorm();if($!==G6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=IS;else this.state=L8}sCData(){if(this.captureToChar(HU))this.state=Y$1}sCDataEnding(){let $=this.getCodeNorm();if($===HU)this.state=J$1;else this.text+=`]${String.fromCodePoint($)}`,this.state=zS}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case G6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=L8;break}case HU:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=zS}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=p70;else if($===x6||u8($))this.fail("processing instruction without a target."),this.state=$===x6?KO:qS;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=p70}sPIRest(){let{chunk:$,i:I}=this;while(!0){let z=this.getCodeNorm();if(z===B4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(I,this.prevI);let q=z===x6;if(q||u8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=q?o2:d70}else this.state=q?KO:qS;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($===x6)this.state=KO;else if(!u8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(x6))this.state=KO}sPIEnding(){var $;let I=this.getCodeNorm();if(I===G6){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=L8}else if(I===x6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=qS;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===x6){this.state=o2;return}if($!==B4)this.state=K$1,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(N$1);if($===x6){this.state=o2,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(u8($)||$===KU))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=$===KU?m70:H$1}sXMLDeclEq(){let $=this.getCodeNorm();if($===x6){this.state=o2,this.fail("XML declaration is incomplete.");return}if(u8($))return;if($!==KU)this.fail("value required.");this.state=m70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===x6){this.state=o2,this.fail("XML declaration is incomplete.");return}if(u8($))return;if(!ZO($))this.fail("value must be quoted."),this.q=s70;else this.q=$;this.state=G$1}sXMLDeclValue(){let $=this.captureTo([this.q,x6]);if($===x6){this.state=o2,this.text="",this.fail("XML declaration is incomplete.");return}if($===B4)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=r2;break;case B4:if(q!==void 0)this.text+=z.slice($);break $;default:I=r2}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:z}=this,q=!1;$:while(!0){let U=this.getCode();switch(U){case U7:{if(this.state=$S,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 XH:if(this.state=QO,this.entityReturnState=L8,z!==void 0)this.text+=I.slice($,this.prevI);q=!0;break $;case k5:if(z!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case B4:if(z!==void 0)this.text+=I.slice($);break $;default:if(!u8(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,HS(this,U,J)}else if($==="xmlns"){let J=I.trim();this.topNS[""]=J,HS(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!==c70&&this.state!==L8)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,H,G;if(Q==="")H=J==="xmlns"?GU:"",G=J;else{if(H=this.resolve(Q),H===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),H=Q;G=`{${H}}${K}`}if(U.has(G))this.fail(`duplicate attribute: ${G}.`);U.add(G),Y.uri=H,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=L8,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=L8,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=L8,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)}}K20.SaxesParser=Q20});var VH=M((le1,G20)=>{var{SaxesParser:j$1}=H20(),{PassThrough:C$1}=w8(),{bufferToString:_$1}=mg();G20.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new C$1);let I=new j$1,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(_$1(U)),z)throw z;yield q,q=[]}}});var F0=M((oe1,Z20)=>{var R$1=VH(),v$1=y6();class WU{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof WU)$.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}`}}iJ0.FormatterOptions=bJ0});var dO=M((M44,mJ0)=>{var iI1="[object AsyncFunction]",nI1="[object Function]",cI1="[object GeneratorFunction]",pI1="[object Null]",dI1="[object Proxy]",mI1="[object Undefined]",lI1=typeof global=="object"&&global&&global.Object===Object&&global,oI1=typeof self=="object"&&self&&self.Object===Object&&self,rI1=lI1||oI1||Function("return this")(),pJ0=Object.prototype,sI1=pJ0.hasOwnProperty,dJ0=pJ0.toString,cJ0=rI1.Symbol,zI=cJ0?cJ0.toStringTag:void 0;function tI1($){if($==null)return $===void 0?mI1:pI1;return zI&&zI in Object($)?aI1($):eI1($)}function aI1($){var I=sI1.call($,zI),z=$[zI];try{$[zI]=void 0;var q=!0}catch(Y){}var U=dJ0.call($);if(q)if(I)$[zI]=z;else delete $[zI];return U}function eI1($){return dJ0.call($)}function $z1($){if(!Iz1($))return!1;var I=tI1($);return I==nI1||I==cI1||I==iI1||I==dI1}function Iz1($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}mJ0.exports=$z1});var jQ0=M((mO,AU)=>{var zz1=200,gy="__lodash_hash_undefined__",$F=1,UQ0=2,YQ0=9007199254740991,lO="[object Arguments]",Ey="[object Array]",qz1="[object AsyncFunction]",JQ0="[object Boolean]",QQ0="[object Date]",KQ0="[object Error]",HQ0="[object Function]",Uz1="[object GeneratorFunction]",oO="[object Map]",GQ0="[object Number]",Yz1="[object Null]",DU="[object Object]",lJ0="[object Promise]",Jz1="[object Proxy]",ZQ0="[object RegExp]",rO="[object Set]",WQ0="[object String]",Qz1="[object Symbol]",Kz1="[object Undefined]",jy="[object WeakMap]",XQ0="[object ArrayBuffer]",sO="[object DataView]",Hz1="[object Float32Array]",Gz1="[object Float64Array]",Zz1="[object Int8Array]",Wz1="[object Int16Array]",Xz1="[object Int32Array]",Vz1="[object Uint8Array]",wz1="[object Uint8ClampedArray]",Lz1="[object Uint16Array]",Oz1="[object Uint32Array]",Fz1=/[\\^$.*+?()[\]{}|]/g,Mz1=/^\[object .+?Constructor\]$/,Nz1=/^(?:0|[1-9]\d*)$/,Z4={};Z4[Hz1]=Z4[Gz1]=Z4[Zz1]=Z4[Wz1]=Z4[Xz1]=Z4[Vz1]=Z4[wz1]=Z4[Lz1]=Z4[Oz1]=!0;Z4[lO]=Z4[Ey]=Z4[XQ0]=Z4[JQ0]=Z4[sO]=Z4[QQ0]=Z4[KQ0]=Z4[HQ0]=Z4[oO]=Z4[GQ0]=Z4[DU]=Z4[ZQ0]=Z4[rO]=Z4[WQ0]=Z4[jy]=!1;var VQ0=typeof global=="object"&&global&&global.Object===Object&&global,Dz1=typeof self=="object"&&self&&self.Object===Object&&self,h9=VQ0||Dz1||Function("return this")(),wQ0=typeof mO=="object"&&mO&&!mO.nodeType&&mO,oJ0=wQ0&&typeof AU=="object"&&AU&&!AU.nodeType&&AU,LQ0=oJ0&&oJ0.exports===wQ0,Py=LQ0&&VQ0.process,rJ0=function(){try{return Py&&Py.binding&&Py.binding("util")}catch($){}}(),sJ0=rJ0&&rJ0.isTypedArray;function Az1($,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 Pz1($,I){var z=-1,q=I.length,U=$.length;while(++z<q)$[U+z]=I[z];return $}function Bz1($,I){var z=-1,q=$==null?0:$.length;while(++z<q)if(I($[z],z,$))return!0;return!1}function Tz1($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}function Ez1($){return function(I){return $(I)}}function jz1($,I){return $.has(I)}function Cz1($,I){return $==null?void 0:$[I]}function _z1($){var I=-1,z=Array($.size);return $.forEach(function(q,U){z[++I]=[U,q]}),z}function Rz1($,I){return function(z){return $(I(z))}}function vz1($){var I=-1,z=Array($.size);return $.forEach(function(q){z[++I]=q}),z}var hz1=Array.prototype,gz1=Function.prototype,IF=Object.prototype,By=h9["__core-js_shared__"],OQ0=gz1.toString,b5=IF.hasOwnProperty,tJ0=function(){var $=/[^.]+$/.exec(By&&By.keys&&By.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),FQ0=IF.toString,Sz1=RegExp("^"+OQ0.call(b5).replace(Fz1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),aJ0=LQ0?h9.Buffer:void 0,tO=h9.Symbol,eJ0=h9.Uint8Array,MQ0=IF.propertyIsEnumerable,yz1=hz1.splice,qI=tO?tO.toStringTag:void 0,$Q0=Object.getOwnPropertySymbols,xz1=aJ0?aJ0.isBuffer:void 0,uz1=Rz1(Object.keys,Object),Cy=PU(h9,"DataView"),DH=PU(h9,"Map"),_y=PU(h9,"Promise"),Ry=PU(h9,"Set"),vy=PU(h9,"WeakMap"),AH=PU(Object,"create"),kz1=JI(Cy),fz1=JI(DH),bz1=JI(_y),iz1=JI(Ry),nz1=JI(vy),IQ0=tO?tO.prototype:void 0,Ty=IQ0?IQ0.valueOf:void 0;function UI($){var I=-1,z=$==null?0:$.length;this.clear();while(++I<z){var q=$[I];this.set(q[0],q[1])}}function cz1(){this.__data__=AH?AH(null):{},this.size=0}function pz1($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function dz1($){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(tq1.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=`${aq1.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}`}}BU.FieldFormatter=xQ0});var ky=M((uQ0)=>{Object.defineProperty(uQ0,"__esModule",{value:!0});uQ0.isSyncTransform=void 0;uQ0.isSyncTransform=($)=>$.length===1});var bQ0=M((TU)=>{var fQ0=TU&&TU.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(TU,"__esModule",{value:!0});TU.RowFormatter=void 0;var $U1=fQ0(dO()),IU1=fQ0(jQ0()),zU1=uy(),qU1=ky();class QI{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new zU1.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(QI.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(qU1.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(!$U1.default($))throw TypeError("The transform should be a function");this._rowTransform=QI.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=QI.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!IU1.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(QI.isRowHashArray($))return this.headers.map((I,z)=>{let q=$[z];if(q)return q[1];return""});if(QI.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}}TU.RowFormatter=QI});var iQ0=M((UF)=>{Object.defineProperty(UF,"__esModule",{value:!0});UF.FieldFormatter=UF.RowFormatter=void 0;var UU1=bQ0();Object.defineProperty(UF,"RowFormatter",{enumerable:!0,get:function(){return UU1.RowFormatter}});var YU1=uy();Object.defineProperty(UF,"FieldFormatter",{enumerable:!0,get:function(){return YU1.FieldFormatter}})});var fy=M((cQ0)=>{Object.defineProperty(cQ0,"__esModule",{value:!0});cQ0.CsvFormatterStream=void 0;var QU1=d("stream"),KU1=iQ0();class nQ0 extends QU1.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new KU1.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 $()})}}cQ0.CsvFormatterStream=nQ0});var mQ0=M((g1)=>{var dQ0=g1&&g1.__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]}),HU1=g1&&g1.__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}}oq0.Token=lq0});var PC=N((sq0)=>{Object.defineProperty(sq0,"__esModule",{value:!0});sq0.Scanner=void 0;var tq0=F7(),x$1=/((?:\r\n)|\n|\r)/;class aq0{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 tq0.Token({token:q,startCursor:U,endCursor:U+q.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new tq0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=x$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}}sq0.Scanner=aq0});var pX=N((IU0)=>{Object.defineProperty(IU0,"__esModule",{value:!0});IU0.ColumnFormatter=void 0;class $U0{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}}IU0.ColumnFormatter=$U0});var TC=N((YU0)=>{Object.defineProperty(YU0,"__esModule",{value:!0});YU0.NonQuotedColumnParser=void 0;var k$1=pX(),qU0=F7();class UU0{constructor($){this.parserOptions=$,this.columnFormatter=new k$1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,z=[],q=$.nextCharacterToken;for(;q;q=$.nextCharacterToken){if(qU0.Token.isTokenDelimiter(q,I)||qU0.Token.isTokenRowDelimiter(q))break;z.push(q.token),$.advancePastToken(q)}return this.columnFormatter.format(z.join(""))}}YU0.NonQuotedColumnParser=UU0});var EC=N((KU0)=>{Object.defineProperty(KU0,"__esModule",{value:!0});KU0.QuotedColumnParser=void 0;var f$1=pX(),JU=F7();class QU0{constructor($){this.parserOptions=$,this.columnFormatter=new f$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()}}KU0.QuotedColumnParser=QU0});var VU0=N((GU0)=>{Object.defineProperty(GU0,"__esModule",{value:!0});GU0.ColumnParser=void 0;var b$1=TC(),n$1=EC(),i$1=F7();class HU0{constructor($){this.parserOptions=$,this.quotedColumnParser=new n$1.QuotedColumnParser($),this.nonQuotedColumnParser=new b$1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&i$1.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}GU0.ColumnParser=HU0});var BC=N((QU)=>{Object.defineProperty(QU,"__esModule",{value:!0});QU.ColumnFormatter=QU.QuotedColumnParser=QU.NonQuotedColumnParser=QU.ColumnParser=void 0;var p$1=VU0();Object.defineProperty(QU,"ColumnParser",{enumerable:!0,get:function(){return p$1.ColumnParser}});var c$1=TC();Object.defineProperty(QU,"NonQuotedColumnParser",{enumerable:!0,get:function(){return c$1.NonQuotedColumnParser}});var d$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=u81[q.charAt(0)];for(let x=Q.length-1;x>-1;x--){let h=Q[x],b=q.slice(0,h.reStart),R=q.slice(h.reStart,h.reEnd-8),f=q.slice(h.reEnd),n=q.slice(h.reEnd-8,h.reEnd)+f,C=b.split(")").length,k=b.split("(").length-C,p=f;for(let v=0;v<k;v++)p=p.replace(/\)[+*?]?/,"");f=p;let z0=f===""&&I!==pC?"(?:$|\\/)":"";q=b+R+f+z0+n}if(q!==""&&U)q="(?=.)"+q;if(M)q=D()+q;if(I===pC)return[q,U];if(z.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return k81($);let j=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+q+"$",j),{_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?S81:y81,q=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?b81(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(YY0),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 VY0=N((HS1,WY0)=>{WY0.exports=GY0;var oC=a("fs"),{EventEmitter:i81}=a("events"),{Minimatch:lC}=KY0(),{resolve:p81}=a("path");function c81($,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 wY0($,I){return new Promise((z,q)=>{(I?oC.stat:oC.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)z(wY0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*HY0($,I,z,q,U,Y){let J=await c81(I+$,Y);for(let Q of J){let K=Q.name;if(K===void 0)K=Q,q=!0;let w=$+"/"+K,H=w.slice(1),G=I+"/"+H,W=null;if(q||z)W=await wY0(G,z);if(!W&&Q.name!==void 0)W=Q;if(W===null)W={isDirectory:()=>!1};if(W.isDirectory()){if(!U(H))yield{relative:H,absolute:G,stats:W},yield*HY0(w,I,z,q,U,!1)}else yield{relative:H,absolute:G,stats:W}}}async function*d81($,I,z,q){yield*HY0("",$,I,z,q,!0)}function m81($){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 i81{constructor($,I,z){super();if(typeof I==="function")z=I,I=null;if(this.options=m81(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=d81(p81($||"."),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 g+=B[y],y++}else g+=B[y],y++;return g}function n$(B){let g=k6(B.toString()),y=g.match(T4);if(!y)y=g.match(S4);if(!y)throw Error(`could not parse args in autoInject
`}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}}lK0.Token=mK0});var Hx=M((tK0)=>{Object.defineProperty(tK0,"__esModule",{value:!0});tK0.Scanner=void 0;var rK0=w7(),OQ1=/((?:\r\n)|\n|\r)/;class sK0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,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 rK0.Token({token:q,startCursor:U,endCursor:U+q.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new rK0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=OQ1.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}}tK0.Scanner=sK0});var jF=M(($H0)=>{Object.defineProperty($H0,"__esModule",{value:!0});$H0.ColumnFormatter=void 0;class eK0{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}}$H0.ColumnFormatter=eK0});var Gx=M((UH0)=>{Object.defineProperty(UH0,"__esModule",{value:!0});UH0.NonQuotedColumnParser=void 0;var FQ1=jF(),zH0=w7();class qH0{constructor($){this.parserOptions=$,this.columnFormatter=new FQ1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,z=[],q=$.nextCharacterToken;for(;q;q=$.nextCharacterToken){if(zH0.Token.isTokenDelimiter(q,I)||zH0.Token.isTokenRowDelimiter(q))break;z.push(q.token),$.advancePastToken(q)}return this.columnFormatter.format(z.join(""))}}UH0.NonQuotedColumnParser=qH0});var Zx=M((QH0)=>{Object.defineProperty(QH0,"__esModule",{value:!0});QH0.QuotedColumnParser=void 0;var MQ1=jF(),xU=w7();class JH0{constructor($){this.parserOptions=$,this.columnFormatter=new MQ1.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=xU.Token.isTokenQuote(Y,I);if(!z&&J)z=!0;else if(z)if(xU.Token.isTokenEscapeCharacter(Y,I)){$.advancePastToken(Y);let Q=$.nextCharacterToken;if(Q!==null&&(xU.Token.isTokenQuote(Q,I)||xU.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=xU.Token.isTokenDelimiter(z,I),U=xU.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()}}QH0.QuotedColumnParser=JH0});var WH0=M((GH0)=>{Object.defineProperty(GH0,"__esModule",{value:!0});GH0.ColumnParser=void 0;var NQ1=Gx(),DQ1=Zx(),AQ1=w7();class HH0{constructor($){this.parserOptions=$,this.quotedColumnParser=new DQ1.QuotedColumnParser($),this.nonQuotedColumnParser=new NQ1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&AQ1.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}GH0.ColumnParser=HH0});var Wx=M((uU)=>{Object.defineProperty(uU,"__esModule",{value:!0});uU.ColumnFormatter=uU.QuotedColumnParser=uU.NonQuotedColumnParser=uU.ColumnParser=void 0;var PQ1=WH0();Object.defineProperty(uU,"ColumnParser",{enumerable:!0,get:function(){return PQ1.ColumnParser}});var BQ1=Gx();Object.defineProperty(uU,"NonQuotedColumnParser",{enumerable:!0,get:function(){return BQ1.NonQuotedColumnParser}});var TQ1=Zx();Object.defineProperty(uU,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,k,k,X,q);let h=X.type==="*"?jx:X.type==="?"?Rx:"\\"+X.type;U=!0,q=q.slice(0,X.reStart)+h+"\\("+k}if(P(),Y)q+="\\\\";let A=LK1[q.charAt(0)];for(let k=Q.length-1;k>-1;k--){let h=Q[k],f=q.slice(0,h.reStart),C=q.slice(h.reStart,h.reEnd-8),b=q.slice(h.reEnd),i=q.slice(h.reEnd-8,h.reEnd)+b,v=f.split(")").length,y=f.split("(").length-v,c=b;for(let R=0;R<y;R++)c=c.replace(/\)[+*?]?/,"");b=c;let $0=b===""&&I!==Cx?"(?:$|\\/)":"";q=f+C+b+$0+i}if(q!==""&&U)q="(?=.)"+q;if(A)q=F()+q;if(I===Cx)return[q,U];if(z.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return FK1($);let T=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+q+"$",T),{_glob:$,_src:q})}catch(k){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?jx:I.dot?VK1:wK1,q=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?NK1(J):J===O8?O8:J._src).reduce((J,Q)=>{if(!(J[J.length-1]===O8&&Q===O8))J.push(Q);return J},[]),Y.forEach((J,Q)=>{if(J!==O8||Y[Q-1]===O8)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]=O8}),Y.filter((J)=>J!==O8).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(_x.sep!=="/")$=$.split(_x.sep).join("/");$=$.split(YG0),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 q$.defaults($).Minimatch}}q$.Minimatch=RH});var XG0=M((C64,WG0)=>{WG0.exports=ZG0;var gx=d("fs"),{EventEmitter:AK1}=d("events"),{Minimatch:hx}=KG0(),{resolve:PK1}=d("path");function BK1($,I){return new Promise((z,q)=>{gx.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 HG0($,I){return new Promise((z,q)=>{(I?gx.stat:gx.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)z(HG0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*GG0($,I,z,q,U,Y){let J=await BK1(I+$,Y);for(let Q of J){let K=Q.name;if(K===void 0)K=Q,q=!0;let H=$+"/"+K,G=H.slice(1),Z=I+"/"+G,W=null;if(q||z)W=await HG0(Z,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:Z,stats:W},yield*GG0(H,I,z,q,U,!1)}else yield{relative:G,absolute:Z,stats:W}}}async function*TK1($,I,z,q){yield*GG0("",$,I,z,q,!0)}function EK1($){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 Sx extends AK1{constructor($,I,z){super();if(typeof I==="function")z=I,I=null;if(this.options=EK1(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 hx(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 hx(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 hx(U,{dot:!0}))}if(this.iterator=TK1(PK1($||"."),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
`,x);x=q0===-1?j.length:q0}else if(m!==-1&&j[x]==="/"&&j[x+1]==="*"){let q0=j.indexOf("*/",x);if(q0!==-1)x=q0+2,m=j.indexOf("*/",x);else g+=j[x],x++}else g+=j[x],x++;return g}function W$(j){let g=J8(j.toString()),x=g.match(k4);if(!x)x=g.match(t4);if(!x)throw Error(`could not parse args in autoInject
Source:
`+g);let[,d]=y;return d.replace(/\s/g,"").split(b$).map((I0)=>I0.replace($$,"").trim())}function F$(B,g){var y={};return Object.keys(B).forEach((d)=>{var I0=B[d],Y0,H0=V(I0),G0=!H0&&I0.length===1||H0&&I0.length===0;if(Array.isArray(I0))Y0=[...I0],I0=Y0.pop(),y[d]=Y0.concat(Y0.length>0?L0:I0);else if(G0)y[d]=I0;else{if(Y0=n$(I0),I0.length===0&&!H0&&Y0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!H0)Y0.pop();y[d]=Y0.concat(L0)}function L0(S0,Z1){var P1=Y0.map((O1)=>S0[O1]);P1.push(Z1),O(I0)(...P1)}}),W1(y,g)}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,g){if(g.prev=B,g.next=B.next,B.next)B.next.prev=g;else this.tail=g;B.next=g,this.length+=1}insertBefore(B,g){if(g.prev=B.prev,g.next=B,B.prev)B.prev.next=g;else this.head=g;B.prev=g,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 g=this.head;while(g){var{next:y}=g;if(B(g))this.removeLink(g);g=y}return this}}function M$(B,g){B.length=1,B.head=B.tail=g}function F9(B,g,y){if(g==null)g=1;else if(g===0)throw RangeError("Concurrency must not be zero");var d=O(B),I0=0,Y0=[];let H0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function G0(b0,_0){H0[b0].push(_0)}function L0(b0,_0){let n0=(...D1)=>{S0(b0,n0),_0(...D1)};H0[b0].push(n0)}function S0(b0,_0){if(!b0)return Object.keys(H0).forEach((n0)=>H0[n0]=[]);if(!_0)return H0[b0]=[];H0[b0]=H0[b0].filter((n0)=>n0!==_0)}function Z1(b0,..._0){H0[b0].forEach((n0)=>n0(..._0))}var P1=!1;function O1(b0,_0,n0,D1){if(D1!=null&&typeof D1!=="function")throw Error("task callback must be a function");T1.started=!0;var G4,a4;function p$($3,...PY){if($3)return n0?a4($3):G4();if(PY.length<=1)return G4(PY[0]);G4(PY)}var oI=T1._createTaskItem(b0,n0?p$:D1||p$);if(_0)T1._tasks.unshift(oI);else T1._tasks.push(oI);if(!P1)P1=!0,w(()=>{P1=!1,T1.process()});if(n0||!D1)return new Promise(($3,PY)=>{G4=$3,a4=PY})}function i$(b0){return function(_0,...n0){I0-=1;for(var D1=0,G4=b0.length;D1<G4;D1++){var a4=b0[D1],p$=Y0.indexOf(a4);if(p$===0)Y0.shift();else if(p$>0)Y0.splice(p$,1);if(a4.callback(_0,...n0),_0!=null)Z1("error",_0,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)=>(_0)=>{if(!_0)return new Promise((n0,D1)=>{L0(b0,(G4,a4)=>{if(G4)return D1(G4);n0(a4)})});S0(b0),G0(b0,_0)};var AY=!1,T1={_tasks:new s7,_createTaskItem(b0,_0){return{data:b0,callback:_0}},*[Symbol.iterator](){yield*T1._tasks[Symbol.iterator]()},concurrency:g,payload:y,buffer:g/4,started:!1,paused:!1,push(b0,_0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>O1(n0,!1,!1,_0))}return O1(b0,!1,!1,_0)},pushAsync(b0,_0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>O1(n0,!1,!0,_0))}return O1(b0,!1,!0,_0)},kill(){S0(),T1._tasks.empty()},unshift(b0,_0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>O1(n0,!0,!1,_0))}return O1(b0,!0,!1,_0)},unshiftAsync(b0,_0){if(Array.isArray(b0)){if(lI(b0))return;return b0.map((n0)=>O1(n0,!0,!0,_0))}return O1(b0,!0,!0,_0)},remove(b0){T1._tasks.remove(b0)},process(){if(AY)return;AY=!0;while(!T1.paused&&I0<T1.concurrency&&T1._tasks.length){var b0=[],_0=[],n0=T1._tasks.length;if(T1.payload)n0=Math.min(n0,T1.payload);for(var D1=0;D1<n0;D1++){var G4=T1._tasks.shift();b0.push(G4),Y0.push(G4),_0.push(G4.data)}if(I0+=1,T1._tasks.length===0)Z1("empty");if(I0===T1.concurrency)Z1("saturated");var a4=C(i$(b0));d(_0,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 v0(B,g){return F9(B,1,g)}function s(B,g,y){return F9(B,g,y)}function F(B,g,y,d){d=x(d);var I0=O(y);return x0(B,(Y0,H0,G0)=>{I0(g,Y0,(L0,S0)=>{g=S0,G0(L0)})},(Y0)=>d(Y0,g))}var P=D(F,4);function S(...B){var g=B.map(O);return function(...y){var d=this,I0=y[y.length-1];if(typeof I0=="function")y.pop();else I0=k0();return P(g,y,(Y0,H0,G0)=>{H0.apply(d,Y0.concat((L0,...S0)=>{G0(L0,S0)}))},(Y0,H0)=>I0(Y0,...H0)),I0[B0]}}function i(...B){return S(...B.reverse())}function e(B,g,y,d){return T(p(g),B,y,d)}var o=D(e,4);function $0 Line truncated
GFS4: `),console.error($)};if(!N4[N6]){if(tC=global[N6]||[],TY0(N4,tC),N4.close=function($){function I(z,q){return $.call(N4,z,function(U){if(!U)PY0();if(typeof q==="function")q.apply(this,arguments)})}return Object.defineProperty(I,eX,{value:$}),I}(N4.close),N4.closeSync=function($){function I(z){$.apply(N4,arguments),PY0()}return Object.defineProperty(I,eX,{value:$}),I}(N4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){YI(N4[N6]),a("assert").equal(N4[N6].length,0)})}var tC;if(!global[N6])TY0(global,N4[N6]);eC.exports=aC(I51(N4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!N4.__patched)eC.exports=aC(N4),N4.__patched=!0;function aC($){e81($),$.gracefulify=aC,$.createReadStream=j,$.createWriteStream=x;var I=$.readFile;$.readFile=z;function z(R,f,n){if(typeof f==="function")n=f,f=null;return C(R,f,n);function C(k,p,z0,v){return I(k,p,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))HU([C,[k,p,z0],u,v||Date.now(),Date.now()]);else if(typeof z0==="function")z0.apply(this,arguments)})}}var q=$.writeFile;$.writeFile=U;function U(R,f,n,C){if(typeof n==="function")C=n,n=null;return k(R,f,n,C);function k(p,z0,v,u,c){return q(p,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))HU([k,[p,z0,v,u],r,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(R,f,n,C){if(typeof n==="function")C=n,n=null;return k(R,f,n,C);function k(p,z0,v,u,c){return Y(p,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))HU([k,[p,z0,v,u],r,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=K;function K(R,f,n,C){if(typeof n==="function")C=n,n=0;return k(R,f,n,C);function k(p,z0,v,u,c){return Q(p,z0,v,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))HU([k,[p,z0,v,u],r,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var w=$.readdir;$.readdir=G;var H=/^v[0-5]\./;function G(R,f,n){if(typeof f==="function")n=f,f=null;var C=H.test(process.version)?function(z0,v,u,c){return w(z0,k(z0,v,u,c))}:function(z0,v,u,c){return w(z0,v,k(z0,v,u,c))};return C(R,f,n);function k(p,z0,v,u){return function(c,r){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))HU([C,[p,z0,v],c,u||Date.now(),Date.now()]);else{if(r&&r.sort)r.sort();if(typeof v==="function")v.call(this,c,r)}}}}if(process.version.substr(0,4)==="v0.8"){var W=$51($);D=W.ReadStream,T=W.WriteStream}var V=$.ReadStream;if(V)D.prototype=Object.create(V.prototype),D.prototype.open=A;var X=$.WriteStream;if(X)T.prototype=Object.create(X.prototype),T.prototype.open=M;Object.defineProperty($,"ReadStream",{get:function(){return D},set:function(R){D=R},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return T},set:function(R){T=R},enumerable:!0,configurable:!0});var L=D;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(R){L=R},enumerable:!0,configurable:!0});var O=T;Object.defineProperty($,"FileWriteStream",{get:function(){return O},set:function(R){O=R},enumerable:!0,configurable:!0});function D(R,f){if(this instanceof D)return V.apply(this,arguments),this;else return D.apply(Object.create(D.prototype),arguments)}function A(){var R=this;b(R.path,R.flags,R.mode,function(f,n){if(f){if(R.autoClose)R.destroy();R.emit("error",f)}else R.fd=n,R.emit("open",n),R.read()})}function T(R,f){if(this instanceof T)return X.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function M(){var R=this;b(R.path,R.flags,R.mode,function(f,n){if(f)R.destroy(),R.emit("error",f);else R.fd=n,R.emit("open",n)})}function j(R,f){return new $.ReadStream(R,f)}function x(R,f){return new $.WriteStream(R,f)}var h=$.open;$.open=b;function b(R,f,n,C){if(typeof n==="function")C=n,n=null;return k(R,f,n,C);function k(p,z0,v,u,c){return h(p,z0,v,function(r,q0){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))HU([k,[p,z0,v,u],r,c||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return $}function HU($){YI("ENQUEUE",$[0].name,$[1]),N4[N6].push($),sC()}var sX;function PY0(){var $=Date.now();for(var I=0;I<N4[N6].length;++I)if(N4[N6][I].length>2)N4[N6][I][3]=$,N4[N6][I][4]=$;sC()}function sC(){if(clearTimeout(sX),sX=void 0,N4[N6].length===0)return;var $=N4[N6].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 N4[N6].push($)}if(sX===void 0)sX=setTimeout(sC,0)}});var BY0=N((XS1,$h)=>{function q51($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var EY0=C4().Buffer,R2=a("util");function U51($,I,z){$.copy(I,z)}$h.exports=function(){function $(){q51(this,$),this.head=null,this.tail=null,th Line truncated
`+g);let[,m]=x;return m.replace(/\s/g,"").split(Z$).map((q0)=>q0.replace(T8,"").trim())}function m8(j,g){var x={};return Object.keys(j).forEach((m)=>{var q0=j[m],J0,G0=X(q0),Z0=!G0&&q0.length===1||G0&&q0.length===0;if(Array.isArray(q0))J0=[...q0],q0=J0.pop(),x[m]=J0.concat(J0.length>0?L0:q0);else if(Z0)x[m]=q0;else{if(J0=W$(q0),q0.length===0&&!G0&&J0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!G0)J0.pop();x[m]=J0.concat(L0)}function L0(S0,F1){var _1=J0.map((D1)=>S0[D1]);_1.push(F1),O(q0)(..._1)}}),L1(x,g)}class J2{constructor(){this.head=this.tail=null,this.length=0}removeLink(j){if(j.prev)j.prev.next=j.next;else this.head=j.next;if(j.next)j.next.prev=j.prev;else this.tail=j.prev;return j.prev=j.next=null,this.length-=1,j}empty(){while(this.head)this.shift();return this}insertAfter(j,g){if(g.prev=j,g.next=j.next,j.next)j.next.prev=g;else this.tail=g;j.next=g,this.length+=1}insertBefore(j,g){if(g.prev=j.prev,g.next=j,j.prev)j.prev.next=g;else this.head=g;j.prev=g,this.length+=1}unshift(j){if(this.head)this.insertBefore(this.head,j);else l8(this,j)}push(j){if(this.tail)this.insertAfter(this.tail,j);else l8(this,j)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var j=this.head;while(j)yield j.data,j=j.next}remove(j){var g=this.head;while(g){var{next:x}=g;if(j(g))this.removeLink(g);g=x}return this}}function l8(j,g){j.length=1,j.head=j.tail=g}function V3(j,g,x){if(g==null)g=1;else if(g===0)throw RangeError("Concurrency must not be zero");var m=O(j),q0=0,J0=[];let G0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function Z0(b0,v0){G0[b0].push(v0)}function L0(b0,v0){let i0=(...A1)=>{S0(b0,i0),v0(...A1)};G0[b0].push(i0)}function S0(b0,v0){if(!b0)return Object.keys(G0).forEach((i0)=>G0[i0]=[]);if(!v0)return G0[b0]=[];G0[b0]=G0[b0].filter((i0)=>i0!==v0)}function F1(b0,...v0){G0[b0].forEach((i0)=>i0(...v0))}var _1=!1;function D1(b0,v0,i0,A1){if(A1!=null&&typeof A1!=="function")throw Error("task callback must be a function");R1.started=!0;var A4,O6;function V$(K2,...TJ){if(K2)return i0?O6(K2):A4();if(TJ.length<=1)return A4(TJ[0]);A4(TJ)}var Pz=R1._createTaskItem(b0,i0?V$:A1||V$);if(v0)R1._tasks.unshift(Pz);else R1._tasks.push(Pz);if(!_1)_1=!0,H(()=>{_1=!1,R1.process()});if(i0||!A1)return new Promise((K2,TJ)=>{A4=K2,O6=TJ})}function X$(b0){return function(v0,...i0){q0-=1;for(var A1=0,A4=b0.length;A1<A4;A1++){var O6=b0[A1],V$=J0.indexOf(O6);if(V$===0)J0.shift();else if(V$>0)J0.splice(V$,1);if(O6.callback(v0,...i0),v0!=null)F1("error",v0,O6.data)}if(q0<=R1.concurrency-R1.buffer)F1("unsaturated");if(R1.idle())F1("drain");R1.process()}}function Az(b0){if(b0.length===0&&R1.idle())return H(()=>F1("drain")),!0;return!1}let Q2=(b0)=>(v0)=>{if(!v0)return new Promise((i0,A1)=>{L0(b0,(A4,O6)=>{if(A4)return A1(A4);i0(O6)})});S0(b0),Z0(b0,v0)};var BJ=!1,R1={_tasks:new J2,_createTaskItem(b0,v0){return{data:b0,callback:v0}},*[Symbol.iterator](){yield*R1._tasks[Symbol.iterator]()},concurrency:g,payload:x,buffer:g/4,started:!1,paused:!1,push(b0,v0){if(Array.isArray(b0)){if(Az(b0))return;return b0.map((i0)=>D1(i0,!1,!1,v0))}return D1(b0,!1,!1,v0)},pushAsync(b0,v0){if(Array.isArray(b0)){if(Az(b0))return;return b0.map((i0)=>D1(i0,!1,!0,v0))}return D1(b0,!1,!0,v0)},kill(){S0(),R1._tasks.empty()},unshift(b0,v0){if(Array.isArray(b0)){if(Az(b0))return;return b0.map((i0)=>D1(i0,!0,!1,v0))}return D1(b0,!0,!1,v0)},unshiftAsync(b0,v0){if(Array.isArray(b0)){if(Az(b0))return;return b0.map((i0)=>D1(i0,!0,!0,v0))}return D1(b0,!0,!0,v0)},remove(b0){R1._tasks.remove(b0)},process(){if(BJ)return;BJ=!0;while(!R1.paused&&q0<R1.concurrency&&R1._tasks.length){var b0=[],v0=[],i0=R1._tasks.length;if(R1.payload)i0=Math.min(i0,R1.payload);for(var A1=0;A1<i0;A1++){var A4=R1._tasks.shift();b0.push(A4),J0.push(A4),v0.push(A4.data)}if(q0+=1,R1._tasks.length===0)F1("empty");if(q0===R1.concurrency)F1("saturated");var O6=v(X$(b0));m(v0,O6)}BJ=!1},length(){return R1._tasks.length},running(){return q0},workersList(){return J0},idle(){return R1._tasks.length+q0===0},pause(){R1.paused=!0},resume(){if(R1.paused===!1)return;R1.paused=!1,H(R1.process)}};return Object.defineProperties(R1,{saturated:{writable:!1,value:Q2("saturated")},unsaturated:{writable:!1,value:Q2("unsaturated")},empty:{writable:!1,value:Q2("empty")},drain:{writable:!1,value:Q2("drain")},error:{writable:!1,value:Q2("error")}}),R1}function C0(j,g){return V3(j,1,g)}function a(j,g,x){return V3(j,g,x)}function N(j,g,x,m){m=k(m);var q0=O(x);return u0(j,(J0,G0,Z0)=>{q0(g,J0,(L0,S0)=>{g=S0,Z0(L0)})},(J0)=>m(J0,g))}var B=F(N,4);function S(...j){var g=j.map(O);return function(...x){var m=this,q0=x[x.length-1];if(typeof q0=="function")x.pop();else q0=k0();return B(g,x,(J0,G0,Z0)=>{G0.apply(m,J0.concat((L0,...S0)=>{Z0(L0,S0)}))},(J0,G0)=>q0(J0,...G0)),q0[E0]}}function n(...j){return S(...j.reverse())}function I0(j,g,x,m){return P(c(g),j,x,m)}var r=F(I0,4);function Line truncated
GFS4: `),console.error($)};if(!v4[k6]){if(xx=global[k6]||[],PG0(v4,xx),v4.close=function($){function I(z,q){return $.call(v4,z,function(U){if(!U)AG0();if(typeof q==="function")q.apply(this,arguments)})}return Object.defineProperty(I,uF,{value:$}),I}(v4.close),v4.closeSync=function($){function I(z){$.apply(v4,arguments),AG0()}return Object.defineProperty(I,uF,{value:$}),I}(v4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){ZI(v4[k6]),d("assert").equal(v4[k6].length,0)})}var xx;if(!global[k6])PG0(global,v4[k6]);fx.exports=ux(yK1(v4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!v4.__patched)fx.exports=ux(v4),v4.__patched=!0;function ux($){gK1($),$.gracefulify=ux,$.createReadStream=T,$.createWriteStream=k;var I=$.readFile;$.readFile=z;function z(C,b,i){if(typeof b==="function")i=b,b=null;return v(C,b,i);function v(y,c,$0,R){return I(y,c,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))bU([v,[y,c,$0],u,R||Date.now(),Date.now()]);else if(typeof $0==="function")$0.apply(this,arguments)})}}var q=$.writeFile;$.writeFile=U;function U(C,b,i,v){if(typeof i==="function")v=i,i=null;return y(C,b,i,v);function y(c,$0,R,u,p){return q(c,$0,R,function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))bU([y,[c,$0,R,u],s,p||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(C,b,i,v){if(typeof i==="function")v=i,i=null;return y(C,b,i,v);function y(c,$0,R,u,p){return Y(c,$0,R,function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))bU([y,[c,$0,R,u],s,p||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=K;function K(C,b,i,v){if(typeof i==="function")v=i,i=0;return y(C,b,i,v);function y(c,$0,R,u,p){return Q(c,$0,R,function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))bU([y,[c,$0,R,u],s,p||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var H=$.readdir;$.readdir=Z;var G=/^v[0-5]\./;function Z(C,b,i){if(typeof b==="function")i=b,b=null;var v=G.test(process.version)?function($0,R,u,p){return H($0,y($0,R,u,p))}:function($0,R,u,p){return H($0,R,y($0,R,u,p))};return v(C,b,i);function y(c,$0,R,u){return function(p,s){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))bU([v,[c,$0,R],p,u||Date.now(),Date.now()]);else{if(s&&s.sort)s.sort();if(typeof R==="function")R.call(this,p,s)}}}}if(process.version.substr(0,4)==="v0.8"){var W=SK1($);F=W.ReadStream,P=W.WriteStream}var X=$.ReadStream;if(X)F.prototype=Object.create(X.prototype),F.prototype.open=D;var w=$.WriteStream;if(w)P.prototype=Object.create(w.prototype),P.prototype.open=A;Object.defineProperty($,"ReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return P},set:function(C){P=C},enumerable:!0,configurable:!0});var L=F;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(C){L=C},enumerable:!0,configurable:!0});var O=P;Object.defineProperty($,"FileWriteStream",{get:function(){return O},set:function(C){O=C},enumerable:!0,configurable:!0});function F(C,b){if(this instanceof F)return X.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function D(){var C=this;f(C.path,C.flags,C.mode,function(b,i){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=i,C.emit("open",i),C.read()})}function P(C,b){if(this instanceof P)return w.apply(this,arguments),this;else return P.apply(Object.create(P.prototype),arguments)}function A(){var C=this;f(C.path,C.flags,C.mode,function(b,i){if(b)C.destroy(),C.emit("error",b);else C.fd=i,C.emit("open",i)})}function T(C,b){return new $.ReadStream(C,b)}function k(C,b){return new $.WriteStream(C,b)}var h=$.open;$.open=f;function f(C,b,i,v){if(typeof i==="function")v=i,i=null;return y(C,b,i,v);function y(c,$0,R,u,p){return h(c,$0,R,function(s,U0){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))bU([y,[c,$0,R,u],s,p||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return $}function bU($){ZI("ENQUEUE",$[0].name,$[1]),v4[k6].push($),kx()}var xF;function AG0(){var $=Date.now();for(var I=0;I<v4[k6].length;++I)if(v4[k6][I].length>2)v4[k6][I][3]=$,v4[k6][I][4]=$;kx()}function kx(){if(clearTimeout(xF),xF=void 0,v4[k6].length===0)return;var $=v4[k6].shift(),I=$[0],z=$[1],q=$[2],U=$[3],Y=$[4];if(U===void 0)ZI("RETRY",I.name,z),I.apply(null,z);else if(Date.now()-U>=60000){ZI("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),H=Math.min(K*1.2,100);if(Q>=H)ZI("RETRY",I.name,z),I.apply(null,z.concat([U]));else v4[k6].push($)}if(xF===void 0)xF=setTimeout(kx,0)}});var TG0=M((g64,bx)=>{function uK1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var BG0=l4().Buffer,vH=d("util");function kK1($,I,z){$.copy(I,z)}bx.exports=function(){function $(){uK1(this,$),this.head=null,this.tail=null,th Line truncated
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/WJ0.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 Fh=N((jS1,NJ0)=>{var ZJ0=9007199254740991,H91="[object Arguments]",G91="[object Function]",W91="[object GeneratorFunction]",V91=/^(?:0|[1-9]\d*)$/;function XJ0($,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 Z91($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}var k2=Object.prototype,f2=k2.hasOwnProperty,LJ0=k2.toString,X91=k2.propertyIsEnumerable,VJ0=Math.max;function L91($,I){var z=B91($)||E91($)?Z91($.length,String):[],q=z.length,U=!!q;for(var Y in $)if((I||f2.call($,Y))&&!(U&&(Y=="length"||DJ0(Y,q))))z.push(Y);return z}function O91($,I,z,q){if($===void 0||Oh($,k2[z])&&!f2.call(q,z))return I;return $}function D91($,I,z){var q=$[I];if(!(f2.call($,I)&&Oh(q,z))||z===void 0&&!(I in $))$[I]=z}function N91($){if(!Nh($))return T91($);var I=P91($),z=[];for(var q in $)if(!(q=="constructor"&&(I||!f2.call($,q))))z.push(q);return z}function OJ0($,I){return I=VJ0(I===void 0?$.length-1:I,0),function(){var z=arguments,q=-1,U=VJ0(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,XJ0($,this,J)}}function F91($,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;D91(z,J,Q===void 0?$[J]:Q)}return z}function M91($){return OJ0(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&&A91(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 DJ0($,I){return I=I==null?ZJ0:I,!!I&&(typeof $=="number"||V91.test($))&&($>-1&&$%1==0&&$<I)}function A91($,I,z){if(!Nh(z))return!1;var q=typeof I;if(q=="number"?Dh(z)&&DJ0(I,z.length):q=="string"&&(I in z))return Oh(z[I],$);return!1}function P91($){var I=$&&$.constructor,z=typeof I=="function"&&I.prototype||k2;return $===z}function T91($){var I=[];if($!=null)for(var z in Object($))I.push(z);return I}function Oh($,I){return $===I||$!==$&&I!==I}function E91($){return j91($)&&f2.call($,"callee")&&(!X91.call($,"callee")||LJ0.call($)==H91)}var B91=Array.isArray;function Dh($){return $!=null&&R91($.length)&&!v91($)}function j91($){return g91($)&&Dh($)}function v91($){var I=Nh($)?LJ0.call($):"";return I==G91||I==W91}function R91($){return typeof $=="number"&&$>-1&&$%1==0&&$<=ZJ0}function Nh($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function g91($){return!!$&&typeof $=="object"}var _91=M91(function($,I,z,q){F91(I,h91(I),$,q)}),C91=OJ0(function($){return $.push(void 0,O91),XJ0(_91,void 0,$)});function h91($){return Dh($)?L91($,!0):N91($)}NJ0.exports=C91});var MJ0=N((vS1,Mh)=>{function S91($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var FJ0=C4().Buffer,b2=a("util");function y91($,I,z){$.copy(I,z)}Mh.exports=function(){function $(){S91(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 FJ0.alloc(0);var q=FJ0.allocUnsafe(z>>>0),U=this.head,Y=0;while(U)y91(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=N((RS1,AJ0)=>{var WL=_4();function u91($,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 x91(){if(this._readableState)this._readable Line truncated
%s`,j,j,A,q);var x=A.type==="*"?JS:A.type==="?"?YS:"\\"+A.type;U=!0,q=q.slice(0,A.reStart)+x+"\\("+j}if(X(),Y)q+="\\\\";var h=!1;switch(q.charAt(0)){case"[":case".":case"(":h=!0}for(var b=Q.length-1;b>-1;b--){var R=Q[b],f=q.slice(0,R.reStart),n=q.slice(R.reStart,R.reEnd-8),C=q.slice(R.reEnd-8,R.reEnd),k=q.slice(R.reEnd);C+=k;var p=f.split("(").length-1,z0=k;for(L=0;L<p;L++)z0=z0.replace(/\)[+*?]?/,"");k=z0;var v="";if(k===""&&I!==RL)v="$";var u=f+n+k+v+C;q=u}if(q!==""&&U)q="(?=.)"+q;if(h)q=W+q;if(I===RL)return[q,U];if(!U)return zq1($);var c=z.nocase?"i":"";try{var r=new RegExp("^"+q+"$",c)}catch(q0){return new RegExp("$.")}return r._glob=$,r._src=q,r}h$.makeRe=function($,I){return new k4($,I||{}).makeRe()};k4.prototype.makeRe=Iq1;function Iq1(){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?lz1:oz1,q=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===VI?z:typeof J==="string"?qq1(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(tQ0),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),H=z?[]:I.slice(Q+1);if(K.length){var G=$.slice(q,q+K.length);if(!this._matchOne(G,K,z,0,0))return!1;q+=K.length}var W=0;if(H.length){if(H.length+q>$.length)return!1;var V=$.length-H.length;if(this._matchOne($,H,z,V,0))W=H.length;else{if($[$.length-1]!==""||q+H.length===$.length)return!1;if(V--,!this._matchOne($,H,z,V,0))return!1;W=H.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 O=[[[],0]],D=O[0],A=0,T=[0];for(var M=0;M<w.length;M++){var j=w[M];if(j===VI)T.push(A),D=[[],0],O.push(D);else D[0].push(j),A++}var x=O.length-1,h=$.length-W;for(var b=0;b<O.length;b++)O[b][1]=h-(T[x--]+O[b][0].length);return!!this._matchGlobStarBodySections($,O,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 H=Q[0],G=Q[1];while(z<=G){var W=this._matchOne($.slice(0,z+H.length),H,U,z,0);if(W&&Y<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,z+H.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],H=$[Y];if(this.debug(I,w,H),w===!1||w===VI)return!1;var G;if(typeof w==="string")G=H===w,this.debug("string match",w,H,G);else G=H.match(w),this.debug("pattern match",w,H,G);if(!G)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 zq1($){return $.replace(/\\(.)/g,"$1")}function qq1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var hL=N((oS1,CL)=>{function eQ0($){return $.charAt(0)==="/"}function $20($){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"?$20:eQ0;CL.exports.posix=eQ0;CL.exports.win32=$20});var KS=N((Vq1)=>{Vq1.setopts=wq1;Vq1.ownProp=I20;Vq1.makeAbs=e2;Vq1.finish=Hq1;Vq1.mark=Gq1;Vq1.isIgnored=q20;Vq1.childrenIgnored=Wq1;function I20($,I){return Object.prototype.hasOwnProperty.call($,I)}var Uq1=a("fs"),PU=a("path"),Yq1=_L(),z20=hL(),QS=Yq1.Minimatch;function Jq1($,I){return $.localeCompare(I,"en")}function Qq1($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(Kq1)}function Kq1($){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(Aq1(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(Y20.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=Mq1.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){Y20.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(Pq1(this,J))return;var K=Y[0]===U20.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,H=this.dot||w.charAt(0)===".",G=[];for(var W=0;W<J.length;W++){var V=J[W];if(V.charAt(0)!=="."||H){var X;if(K&&!$)X=!V.match(Q);else X=V.match(Q);if(X)G.push(V)}}var L=G.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=G[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=G[W],O;if($)O=[$,V];else O=[V];this._process(O.concat(q),U,Y)}};l4.prototype._emitMatch=function($,I){if(Tq1(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&&!HS(this.symlinks,$))return this._readdirInGlobStar($);if(HS(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 H=J.length,G=this.symlinks[z];if(G&&Y)return;for(var W=0;W<H;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&&HS(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 GS=N(($y1,H20)=>{H20.exports=w20;function w20($,I){if($&&I)return w20($)(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)};bU1.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};bU1.encode=function($){var I=RU1(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&yU1,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]=vK0+kU1($.type),$.linkname)I.write($.linkname,157);if(RK0.copy(I,YK),CU1.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(_K0(I),6),148),I};bU1.decode=function($,I,z){var q=$[156]===0?0:$[156]-vK0,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),H=xU1(q),G=$[157]===0?null:jU($,157,100,I),W=jU($,265,32),V=jU($,297,32),X=_7($,329,8),L=_7($,337,8),O=_K0($);if(O===256)return null;if(O!==_7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(RK0.compare($,YK,YK+6)===0){if($[345])U=jU($,345,155,I)+"/"+U}else if(hU1.compare($,YK,YK+6)===0&&SU1.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:H,linkname:G,uname:W,gname:V,devmajor:X,devminor:L}}});var kK0=N((yy1,xK0)=>{var hK0=a("util"),mU1=jK0(),JK=dS(),SK0=_6().Writable,yK0=_6().PassThrough,uK0=function(){},CK0=function($){return $&=511,$&&512-$},lU1=function($,I){var z=new nL($,I);return z.end(),z},oU1=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,yK0.call(this,{autoDestroy:!1})};hK0.inherits(nL,yK0);nL.prototype.destroy=function($){this._parent.destroy($)};var $9=function($){if(!(this instanceof $9))return new $9($);SK0.call(this,$),$=$||{},this._offset=0,this._buffer=mU1(),this._missing=0,this._partial=!1,this._onparse=uK0,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=CK0(I._header.size);if(W)I._parse(W,J);else I._parse(512,G);if(!I._locked)q()},J=function(){I._buffer.consume(CK0(I._header.size)),I._parse(512,G),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()},H=function(){var W=I._header.size;this._gnuLongLinkPath=JK.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},G=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,G),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,H),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=oU1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,G),I.emit("entry",V,lU1(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=G,this._parse(512,G)};hK0.inherits($9,SK0);$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=uK0,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="${VY1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}Hw0.exports=ww0});var Lw0=N((dy1,Xw0)=>{var Ww0=L6(),Vw0=V7(),XY1=L4(),LY1=T_(),OY1=B_();class Zw0{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:Vw0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:Vw0.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 LY1,q=new Ww0;z.render(q,$),this.commentsStream.write(q.xml);let U=new OY1,Y=new Ww0;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=XY1.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()}}Xw0.exports=Zw0});var Aw0=N((my1,Mw0)=>{var DY1=B4(),NY1=V7(),oS=L4(),Ow0=ij(),Dw0=C5(),FY1=qg(),Nw0=YV(),rS=QV(),MY1=Gw0(),AY1=Lw0(),PY1=bj(),$6=new FY1,tS=H7(),TY1=sg(),EY1=eg(),BY1=$_(),jY1=og(),vY1=mg(),RY1=rg(),gY1=I_(),_Y1=z_(),CY1=q_(),hY1=U_(),SY1=Y_(),yY1=J_(),uY1=G_(),xY1=K_(),kY1=Q_(),I6={dataValidations:new TY1,sheetProperties:new EY1,sheetFormatProperties:new BY1,columns:new tS({tag:"cols",length:!1,childXform:new jY1}),row:new vY1,hyperlinks:new tS({tag:"hyperlinks",length:!1,childXform:new RY1}),sheetViews:new tS({tag:"sheetViews",length:!1,childXform:new gY1}),sheetProtection:new _Y1,pageMargins:new CY1,pageSeteup:new hY1,autoFilter:new SY1,picture:new yY1,conditionalFormattings:new uY1,headerFooter:new xY1,rowBreaks:new kY1};class Fw0{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 MY1($),this._sheetCommentsWriter=new AY1(this,this._sheetRelsWriter,$),this._dimensions=new Dw0,this._rowZero=1,this.committed=!1,this.dataValidations=new PY1,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
*/ZZ0.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 Yu=M((d64,FZ0)=>{var XZ0=9007199254740991,pH1="[object Arguments]",dH1="[object Function]",mH1="[object GeneratorFunction]",lH1=/^(?:0|[1-9]\d*)$/;function VZ0($,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 oH1($,I){var z=-1,q=Array($);while(++z<$)q[z]=I(z);return q}var bH=Object.prototype,iH=bH.hasOwnProperty,wZ0=bH.toString,rH1=bH.propertyIsEnumerable,WZ0=Math.max;function sH1($,I){var z=JG1($)||YG1($)?oH1($.length,String):[],q=z.length,U=!!q;for(var Y in $)if((I||iH.call($,Y))&&!(U&&(Y=="length"||OZ0(Y,q))))z.push(Y);return z}function tH1($,I,z,q){if($===void 0||zu($,bH[z])&&!iH.call(q,z))return I;return $}function aH1($,I,z){var q=$[I];if(!(iH.call($,I)&&zu(q,z))||z===void 0&&!(I in $))$[I]=z}function eH1($){if(!Uu($))return UG1($);var I=qG1($),z=[];for(var q in $)if(!(q=="constructor"&&(I||!iH.call($,q))))z.push(q);return z}function LZ0($,I){return I=WZ0(I===void 0?$.length-1:I,0),function(){var z=arguments,q=-1,U=WZ0(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,VZ0($,this,J)}}function $G1($,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;aH1(z,J,Q===void 0?$[J]:Q)}return z}function IG1($){return LZ0(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&&zG1(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 OZ0($,I){return I=I==null?XZ0:I,!!I&&(typeof $=="number"||lH1.test($))&&($>-1&&$%1==0&&$<I)}function zG1($,I,z){if(!Uu(z))return!1;var q=typeof I;if(q=="number"?qu(z)&&OZ0(I,z.length):q=="string"&&(I in z))return zu(z[I],$);return!1}function qG1($){var I=$&&$.constructor,z=typeof I=="function"&&I.prototype||bH;return $===z}function UG1($){var I=[];if($!=null)for(var z in Object($))I.push(z);return I}function zu($,I){return $===I||$!==$&&I!==I}function YG1($){return QG1($)&&iH.call($,"callee")&&(!rH1.call($,"callee")||wZ0.call($)==pH1)}var JG1=Array.isArray;function qu($){return $!=null&&HG1($.length)&&!KG1($)}function QG1($){return GG1($)&&qu($)}function KG1($){var I=Uu($)?wZ0.call($):"";return I==dH1||I==mH1}function HG1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=XZ0}function Uu($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function GG1($){return!!$&&typeof $=="object"}var ZG1=IG1(function($,I,z,q){$G1(I,XG1(I),$,q)}),WG1=LZ0(function($){return $.push(void 0,tH1),VZ0(ZG1,void 0,$)});function XG1($){return qu($)?sH1($,!0):eH1($)}FZ0.exports=WG1});var NZ0=M((m64,Ju)=>{function VG1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var MZ0=l4().Buffer,nH=d("util");function wG1($,I,z){$.copy(I,z)}Ju.exports=function(){function $(){VG1(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 MZ0.alloc(0);var q=MZ0.allocUnsafe(z>>>0),U=this.head,Y=0;while(U)wG1(U.data,q,Y),Y+=U.data.length,U=U.next;return q},$}();if(nH&&nH.inspect&&nH.inspect.custom)Ju.exports.prototype[nH.inspect.custom]=function(){var $=nH.inspect({length:this.length});return this.constructor.name+" "+$}});var Qu=M((l64,DZ0)=>{var sF=m4();function LG1($,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)sF.nextTick(tF,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,sF.nextTick(tF,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)sF.nextTick(tF,z,Y);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,sF.nextTick(tF,z,Y)}else if(I)I(Y)}),this}function OG1(){if(this._readableState)this._readable Line truncated
%s`,T,T,D,q);var k=D.type==="*"?du:D.type==="?"?pu:"\\"+D.type;U=!0,q=q.slice(0,D.reStart)+k+"\\("+T}if(w(),Y)q+="\\\\";var h=!1;switch(q.charAt(0)){case"[":case".":case"(":h=!0}for(var f=Q.length-1;f>-1;f--){var C=Q[f],b=q.slice(0,C.reStart),i=q.slice(C.reStart,C.reEnd-8),v=q.slice(C.reEnd-8,C.reEnd),y=q.slice(C.reEnd);v+=y;var c=b.split("(").length-1,$0=y;for(L=0;L<c;L++)$0=$0.replace(/\)[+*?]?/,"");y=$0;var R="";if(y===""&&I!==XM)R="$";var u=b+i+y+R+v;q=u}if(q!==""&&U)q="(?=.)"+q;if(h)q=W+q;if(I===XM)return[q,U];if(!U)return xV1($);var p=z.nocase?"i":"";try{var s=new RegExp("^"+q+"$",p)}catch(U0){return new RegExp("$.")}return s._glob=$,s._src=q,s}U$.makeRe=function($,I){return new q6($,I||{}).makeRe()};q6.prototype.makeRe=yV1;function yV1(){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?du:I.dot?jV1:CV1,q=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===NI?z:typeof J==="string"?uV1(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}U$.match=function($,I,z){z=z||{};var q=new q6(I,z);if($=$.filter(function(U){return q.match(U)}),q.options.nonull&&!$.length)$.push(I);return $};q6.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($G.sep!=="/")I=I.split($G.sep).join("/");I=I.split($X0),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 H=this.matchOne(K,Q,z);if(H){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate};q6.prototype.matchOne=function($,I,z){if(I.indexOf(NI)!==-1)return this._matchGlobstar($,I,z,0,0);return this._matchOne($,I,z,0,0)};q6.prototype._matchGlobstar=function($,I,z,q,U){var Y,J=-1;for(Y=U;Y<I.length;Y++)if(I[Y]===NI){J=Y;break}var Q=-1;for(Y=I.length-1;Y>=0;Y--)if(I[Y]===NI){Q=Y;break}var K=I.slice(U,J),H=z?I.slice(J+1):I.slice(J+1,Q),G=z?[]:I.slice(Q+1);if(K.length){var Z=$.slice(q,q+K.length);if(!this._matchOne(Z,K,z,0,0))return!1;q+=K.length}var W=0;if(G.length){if(G.length+q>$.length)return!1;var X=$.length-G.length;if(this._matchOne($,G,z,X,0))W=G.length;else{if($[$.length-1]!==""||q+G.length===$.length)return!1;if(X--,!this._matchOne($,G,z,X,0))return!1;W=G.length+1}}if(!H.length){var w=!!W;for(Y=q;Y<$.length-W;Y++){var L=String($[Y]);if(w=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return z||w}var O=[[[],0]],F=O[0],D=0,P=[0];for(var A=0;A<H.length;A++){var T=H[A];if(T===NI)P.push(D),F=[[],0],O.push(F);else F[0].push(T),D++}var k=O.length-1,h=$.length-W;for(var f=0;f<O.length;f++)O[f][1]=h-(P[k--]+O[f][0].length);return!!this._matchGlobStarBodySections($,O,q,0,z,0,!!W)};q6.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 H=$[K];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1}return J}var G=Q[0],Z=Q[1];while(z<=Z){var W=this._matchOne($.slice(0,z+G.length),G,U,z,0);if(W&&Y<this.maxGlobstarRecursion){var X=this._matchGlobStarBodySections($,I,z+G.length,q+1,U,Y+1,J);if(X!==!1)return X}var H=$[z];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1;z++}return U||null};q6.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 H=I[J],G=$[Y];if(this.debug(I,H,G),H===!1||H===NI)return!1;var Z;if(typeof H==="string")Z=G===H,this.debug("string match",H,G,Z);else Z=G.match(H),this.debug("pattern match",H,G,Z);if(!Z)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 xV1($){return $.replace(/\\(.)/g,"$1")}function uV1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var OM=M((X84,LM)=>{function qX0($){return $.charAt(0)==="/"}function UX0($){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)}LM.exports=process.platform==="win32"?UX0:qX0;LM.exports.posix=qX0;LM.exports.win32=UX0});var lu=M((lV1)=>{lV1.setopts=cV1;lV1.ownProp=YX0;lV1.makeAbs=IG;lV1.finish=pV1;lV1.mark=dV1;lV1.isIgnored=QX0;lV1.childrenIgnored=mV1;function YX0($,I){return Object.prototype.hasOwnProperty.call($,I)}var kV1=d("fs"),eU=d("path"),fV1=wM(),JX0=OM(),mu=fV1.Minimatch;function bV1($,I){return $.localeCompare(I,"en")}function iV1($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(nV1)}function nV1($){var I=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");I=new mu(z,{dot:!0})}return{matcher Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new Z6($,I).found}function Z6($,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 Z6))return new Z6($,I);if(zw1(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()}Z6.prototype._finish=function(){if(HX0.ok(this instanceof Z6),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=Iw1.realpathSync(U,$.realpathCache);q[Y]=!0}catch(J){if(J.syscall==="stat")q[$._makeAbs(U)]=!0;else throw J}})}DI.finish(this)};Z6.prototype._process=function($,I,z){HX0.ok(this instanceof Z6);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(FM(U)||FM($.map(function(H){return typeof H==="string"?H:"[*]"}).join("/"))){if(!U||!FM(U))U="/"+U;J=U}else J=U;var Q=this._makeAbs(J);if(qw1(this,J))return;var K=Y[0]===KX0.GLOBSTAR;if(K)this._processGlobStar(U,J,Q,Y,I,z);else this._processReaddir(U,J,Q,Y,I,z)};Z6.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,H=Q._glob,G=this.dot||H.charAt(0)===".",Z=[];for(var W=0;W<J.length;W++){var X=J[W];if(X.charAt(0)!=="."||G){var w;if(K&&!$)w=!X.match(Q);else w=X.match(Q);if(w)Z.push(X)}}var L=Z.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 X=Z[W];if($)if($.slice(-1)!=="/")X=$+"/"+X;else X=$+X;if(X.charAt(0)==="/"&&!this.nomount)X=ou.join(this.root,X);this._emitMatch(U,X)}return}q.shift();for(var W=0;W<L;W++){var X=Z[W],O;if($)O=[$,X];else O=[X];this._process(O.concat(q),U,Y)}};Z6.prototype._emitMatch=function($,I){if(Uw1(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)};Z6.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};Z6.prototype._readdir=function($,I){var z;if(I&&!ru(this.symlinks,$))return this._readdirInGlobStar($);if(ru(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}};Z6.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};Z6.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}};Z6.prototype._processGlobStar=function($,I,z,q,U,Y){var J=this._readdir(z,Y);if(!J)return;var Q=q.slice(1),K=$?[$]:[],H=K.concat(Q);this._process(H,U,!1);var G=J.length,Z=this.symlinks[z];if(Z&&Y)return;for(var W=0;W<G;W++){var X=J[W];if(X.charAt(0)==="."&&!this.dot)continue;var w=K.concat(J[W],Q);this._process(w,U,!0);var L=K.concat(J[W],q);this._process(L,U,!0)}};Z6.prototype._processSimple=function($,I){var z=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!z)return;if($&&FM($)&&!this.nomount){var q=/[\/\\]$/.test($);if($.charAt(0)==="/")$=ou.join(this.root,$);else if($=ou.resolve(this.root,$),q)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};Z6.prototype._stat=function($){var I=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&ru(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};Z6.prototype._mark=function($){return DI.mark(this,$)};Z6.prototype._makeAbs=function($){return DI.makeAbs(this,$)}});var su=M((M84,VX0)=>{VX0.exports=XX0;function XX0($,I){if($&&I)return XX0($)(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+=ok(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var q in z)I+=ok(" "+q+"="+z[q]+`
`);return Buffer.from(I)};VF1.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};VF1.encode=function($){var I=qF1(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(R7($.mode&HF1,6),100),I.write(R7($.uid,6),108),I.write(R7($.gid,6),116),I.write(R7($.size,11),124),I.write(R7($.mtime.getTime()/1000|0,11),136),I[156]=Cw0+WF1($.type),$.linkname)I.write($.linkname,157);if(_w0.copy(I,OG),JF1.copy(I,rk),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(R7($.devmajor||0,6),329),I.write(R7($.devminor||0,6),337),q)I.write(q,345);return I.write(R7(vw0(I),6),148),I};VF1.decode=function($,I,z){var q=$[156]===0?0:$[156]-Cw0,U=KY($,0,100,I),Y=v7($,100,8),J=v7($,108,8),Q=v7($,116,8),K=v7($,124,12),H=v7($,136,12),G=ZF1(q),Z=$[157]===0?null:KY($,157,100,I),W=KY($,265,32),X=KY($,297,32),w=v7($,329,8),L=v7($,337,8),O=vw0($);if(O===256)return null;if(O!==v7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(_w0.compare($,OG,OG+6)===0){if($[345])U=KY($,345,155,I)+"/"+U}else if(QF1.compare($,OG,OG+6)===0&&KF1.compare($,rk,rk+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*H),type:G,linkname:Z,uname:W,gname:X,devmajor:w,devminor:L}}});var kw0=M((X$4,uw0)=>{var gw0=d("util"),NF1=jw0(),FG=sk(),Sw0=w8().Writable,yw0=w8().PassThrough,xw0=function(){},hw0=function($){return $&=511,$&&512-$},DF1=function($,I){var z=new kM($,I);return z.end(),z},AF1=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,$},kM=function($,I){this._parent=$,this.offset=I,yw0.call(this,{autoDestroy:!1})};gw0.inherits(kM,yw0);kM.prototype.destroy=function($){this._parent.destroy($)};var c9=function($){if(!(this instanceof c9))return new c9($);Sw0.call(this,$),$=$||{},this._offset=0,this._buffer=NF1(),this._missing=0,this._partial=!1,this._onparse=xw0,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=hw0(I._header.size);if(W)I._parse(W,J);else I._parse(512,Z);if(!I._locked)q()},J=function(){I._buffer.consume(hw0(I._header.size)),I._parse(512,Z),q()},Q=function(){var W=I._header.size;I._paxGlobal=FG.decodePax(z.slice(0,W)),z.consume(W),Y()},K=function(){var W=I._header.size;if(I._pax=FG.decodePax(z.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);z.consume(W),Y()},H=function(){var W=I._header.size;this._gnuLongPath=FG.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},G=function(){var W=I._header.size;this._gnuLongLinkPath=FG.decodeLongPath(z.slice(0,W),$.filenameEncoding),z.consume(W),Y()},Z=function(){var W=I._offset,X;try{X=I._header=FG.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(w){I.emit("error",w)}if(z.consume(512),!X){I._parse(512,Z),q();return}if(X.type==="gnu-long-path"){I._parse(X.size,H),q();return}if(X.type==="gnu-long-link-path"){I._parse(X.size,G),q();return}if(X.type==="pax-global-header"){I._parse(X.size,Q),q();return}if(X.type==="pax-header"){I._parse(X.size,K),q();return}if(I._gnuLongPath)X.name=I._gnuLongPath,I._gnuLongPath=null;if(I._gnuLongLinkPath)X.linkname=I._gnuLongLinkPath,I._gnuLongLinkPath=null;if(I._pax)I._header=X=AF1(X,I._pax),I._pax=null;if(I._locked=!0,!X.size||X.type==="directory"){I._parse(512,Z),I.emit("entry",X,DF1(I,W),U);return}I._stream=new kM(I,W),I.emit("entry",X,I._stream,U),I._parse(X.size,Y),q()};this._onheader=Z,this._parse(512,Z)};gw0.inherits(c9,Sw0);c9.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};c9.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};c9.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=xw0,this._overflow)this._write(this._overflow,void 0,$);else $()};c9.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="${iF1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}GL0.exports=HL0});var LL0=M((P$4,wL0)=>{var WL0=y6(),XL0=K7(),cF1=C4(),pF1=Gy(),dF1=Wy();class VL0{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:XL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:XL0.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 pF1,q=new WL0;z.render(q,$),this.commentsStream.write(q.xml);let U=new dF1,Y=new WL0;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=cF1.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()}}wL0.exports=VL0});var AL0=M((B$4,DL0)=>{var mF1=b4(),lF1=K7(),ek=C4(),OL0=_v(),FL0=N9(),oF1=cg(),ML0=cw(),$f=dw(),rF1=ZL0(),sF1=LL0(),tF1=jv(),M6=new oF1,If=Y7(),aF1=kS(),eF1=fS(),$M1=bS(),IM1=SS(),zM1=hS(),qM1=yS(),UM1=iS(),YM1=nS(),JM1=cS(),QM1=pS(),KM1=dS(),HM1=mS(),GM1=tS(),ZM1=oS(),WM1=lS(),N6={dataValidations:new aF1,sheetProperties:new eF1,sheetFormatProperties:new $M1,columns:new If({tag:"cols",length:!1,childXform:new IM1}),row:new zM1,hyperlinks:new If({tag:"hyperlinks",length:!1,childXform:new qM1}),sheetViews:new If({tag:"sheetViews",length:!1,childXform:new UM1}),sheetProtection:new YM1,pageMargins:new JM1,pageSeteup:new QM1,autoFilter:new KM1,picture:new HM1,conditionalFormattings:new GM1,headerFooter:new ZM1,rowBreaks:new WM1};class NL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new rF1($),this._sheetCommentsWriter=new sF1(this,this._sheetRelsWriter,$),this._dimensions=new FL0,this._rowZero=1,this.committed=!1,this.dataValidations=new tF1,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
`)},Zy=Xy.getNativePromise();if(Xy.isNode&&typeof MutationObserver>"u")Ly=global.setImmediate,Oy=process.nextTick,AI=Xy.isRecentNode?function($){Ly.call(global,$)}:function($){Oy.call(process,$)};else if(typeof Zy==="function"&&typeof Zy.resolve==="function")Dy=Zy.resolve(),AI=function($){Dy.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=RJ1;var Ly,Oy,Dy;IH0.exports=AI});var UH0=N((Uu1,qH0)=>{function gJ1($,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;gJ1(this,0,this,I,U)};qH0.exports=S7});var GH0=N((Yu1,Ny)=>{var wH0;try{throw Error()}catch($){wH0=$}var _J1=zH0(),YH0=UH0(),HH0=r1();function z6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new YH0(16),this._normalQueue=new YH0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=_J1}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(HH0.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
`)},Mf=Nf.getNativePromise();if(Nf.isNode&&typeof MutationObserver>"u")Df=global.setImmediate,Af=process.nextTick,gI=Nf.isRecentNode?function($){Df.call(global,$)}:function($){Af.call(process,$)};else if(typeof Mf==="function"&&typeof Mf.resolve==="function")Pf=Mf.resolve(),gI=function($){Pf.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))gI=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")gI=function($){setImmediate($)};else if(typeof setTimeout<"u")gI=function($){setTimeout($,0)};else gI=qN1;var Df,Af,Pf;IO0.exports=gI});var UO0=M((x$4,qO0)=>{function UN1($,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;UN1(this,0,this,I,U)};qO0.exports=S7});var ZO0=M((u$4,Bf)=>{var HO0;try{throw Error()}catch($){HO0=$}var YN1=zO0(),YO0=UO0(),GO0=q4();function D6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new YO0(16),this._normalQueue=new YO0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=YN1}D6.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};D6.prototype.hasCustomScheduler=function(){return this._customScheduler};D6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};D6.prototype.disableTrampolineIfNecessary=function(){if(GO0.hasDevTools)this._trampolineEnabled=!1};D6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};D6.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};D6.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 JH0($,I,z){this._lateQueue.push($,I,z),this._queueTick()}function QH0($,I,z){this._normalQueue.push($,I,z),this._queueTick()}function KH0($){this._normalQueue._pushOne($),this._queueTick()}if(!HH0.hasDevTools)z6.prototype.invokeLater=JH0,z6.prototype.invoke=QH0,z6.prototype.settlePromises=KH0;else z6.prototype.invokeLater=function($,I,z){if(this._trampolineEnabled)JH0.call(this,$,I,z);else this._schedule(function(){setTimeout(function(){$.call(I,z)},100)})},z6.prototype.invoke=function($,I,z){if(this._trampolineEnabled)QH0.call(this,$,I,z);else this._schedule(function(){$.call(I,z)})},z6.prototype.settlePromises=function($){if(this._trampolineEnabled)KH0.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};Ny.exports=z6;Ny.exports.firstLineError=wH0});var z9=N((Ju1,ZH0)=>{var Ay=MI(),CJ1=Ay.freeze,WH0=r1(),VH0=WH0.inherits,CU=WH0.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 VH0(z,Error),z}var Fy,My,hJ1=hU("Warning","warning"),SJ1=hU("CancellationError","cancellation error"),yJ1=hU("TimeoutError","timeout error"),WK=hU("AggregateError","aggregate error");try{Fy=TypeError,My=RangeError}catch($){Fy=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=`
`)}};function JO0($,I,z){this._lateQueue.push($,I,z),this._queueTick()}function QO0($,I,z){this._normalQueue.push($,I,z),this._queueTick()}function KO0($){this._normalQueue._pushOne($),this._queueTick()}if(!GO0.hasDevTools)D6.prototype.invokeLater=JO0,D6.prototype.invoke=QO0,D6.prototype.settlePromises=KO0;else D6.prototype.invokeLater=function($,I,z){if(this._trampolineEnabled)JO0.call(this,$,I,z);else this._schedule(function(){setTimeout(function(){$.call(I,z)},100)})},D6.prototype.invoke=function($,I,z){if(this._trampolineEnabled)QO0.call(this,$,I,z);else this._schedule(function(){$.call(I,z)})},D6.prototype.settlePromises=function($){if(this._trampolineEnabled)KO0.call(this,$);else this._schedule(function(){$._settlePromises()})};D6.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)}};D6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};D6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};D6.prototype._reset=function(){this._isTickUsed=!1};Bf.exports=D6;Bf.exports.firstLineError=HO0});var d9=M((k$4,VO0)=>{var jf=hI(),JN1=jf.freeze,WO0=q4(),XO0=WO0.inherits,XY=WO0.notEnumerableProp;function VY($,I){function z(q){if(!(this instanceof z))return new z(q);if(XY(this,"message",typeof q==="string"?q:I),XY(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return XO0(z,Error),z}var Tf,Ef,QN1=VY("Warning","warning"),KN1=VY("CancellationError","cancellation error"),HN1=VY("TimeoutError","timeout error"),BG=VY("AggregateError","aggregate error");try{Tf=TypeError,Ef=RangeError}catch($){Tf=VY("TypeError","type error"),Ef=VY("RangeError","range error")}var lM="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(SI=0;SI<lM.length;++SI)if(typeof Array.prototype[lM[SI]]==="function")BG.prototype[lM[SI]]=Array.prototype[lM[SI]];var SI;jf.defineProperty(BG.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});BG.prototype.isOperational=!0;var oM=0;BG.prototype.toString=function(){var $=Array(oM*4+1).join(" "),I=`
`+$+`AggregateError of:
`;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(`
`;oM++,$=Array(oM*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 aL--,I};function GK($){if(!(this instanceof GK))return new GK($);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)}VH0(GK,Error);var TI=Error.__BluebirdErrorTypes__;if(!TI)TI=CJ1({CancellationError:SJ1,TimeoutError:yJ1,OperationalError:GK,RejectionError:GK,AggregateError:WK}),Ay.defineProperty(Error,"__BluebirdErrorTypes__",{value:TI,writable:!1,enumerable:!1,configurable:!1});ZH0.exports={Error,TypeError:Fy,RangeError:My,CancellationError:TI.CancellationError,OperationalError:TI.OperationalError,TimeoutError:TI.TimeoutError,AggregateError:TI.AggregateError,Warning:hJ1}});var LH0=N((Qu1,XH0)=>{XH0.exports=function($,I){var z=r1(),q=z.errorObj,U=z.isObject;function Y(G,W){if(U(G)){if(G instanceof $)return G;var V=Q(G);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(G)){var X=new $(I);return G._then(X._fulfill,X._reject,void 0,X,null),X}return H(G,V,W)}}return G}function J(G){return G.then}function Q(G){try{return J(G)}catch(W){return q.e=W,q}}var K={}.hasOwnProperty;function w(G){try{return K.call(G,"_promise0")}catch(W){return!1}}function H(G,W,V){var X=new $(I),L=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var O=!0,D=z.tryCatch(W).call(G,A,T);if(O=!1,X&&D===q)X._rejectCallback(D.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,O,!0),X=null}return L}return Y}});var DH0=N((Ku1,OH0)=>{OH0.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 H=this._promise=new $(I);if(w instanceof $)H._propagateFrom(w,3);H._setOnCancel(this),this._values=w,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Y.inherits(K,U),K.prototype.length=function(){return this._length},K.prototype.promise=function(){return this._promise},K.prototype._init=function w(H,G){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,G);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(G===-5)this._resolveEmptyArray();else this._resolve(Q(G));return}this._iterate(W)},K.prototype._iterate=function(w){var H=this.getActualLength(w.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var G=this._promise,W=!1,V=null;for(var X=0;X<H;++X){var L=z(w[X],G);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)G._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,H){this._values[H]=w;var G=++this._totalResolved;if(G>=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 H=0;H<w.length;++H)if(w[H]instanceof $)w[H].cancel()},K.prototype.shouldCopyValues=function(){return!0},K.prototype.getActualLength=function(w){return w},K}});var FH0=N((wu1,NH0)=>{NH0.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 oM--,I};function PG($){if(!(this instanceof PG))return new PG($);if(XY(this,"name","OperationalError"),XY(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)XY(this,"message",$.message),XY(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}XO0(PG,Error);var yI=Error.__BluebirdErrorTypes__;if(!yI)yI=JN1({CancellationError:KN1,TimeoutError:HN1,OperationalError:PG,RejectionError:PG,AggregateError:BG}),jf.defineProperty(Error,"__BluebirdErrorTypes__",{value:yI,writable:!1,enumerable:!1,configurable:!1});VO0.exports={Error,TypeError:Tf,RangeError:Ef,CancellationError:yI.CancellationError,OperationalError:yI.OperationalError,TimeoutError:yI.TimeoutError,AggregateError:yI.AggregateError,Warning:QN1}});var LO0=M((f$4,wO0)=>{wO0.exports=function($,I){var z=q4(),q=z.errorObj,U=z.isObject;function Y(Z,W){if(U(Z)){if(Z instanceof $)return Z;var X=Q(Z);if(X===q){if(W)W._pushContext();var w=$.reject(X.e);if(W)W._popContext();return w}else if(typeof X==="function"){if(H(Z)){var w=new $(I);return Z._then(w._fulfill,w._reject,void 0,w,null),w}return G(Z,X,W)}}return Z}function J(Z){return Z.then}function Q(Z){try{return J(Z)}catch(W){return q.e=W,q}}var K={}.hasOwnProperty;function H(Z){try{return K.call(Z,"_promise0")}catch(W){return!1}}function G(Z,W,X){var w=new $(I),L=w;if(X)X._pushContext();if(w._captureStackTrace(),X)X._popContext();var O=!0,F=z.tryCatch(W).call(Z,D,P);if(O=!1,w&&F===q)w._rejectCallback(F.e,!0,!0),w=null;function D(A){if(!w)return;w._resolveCallback(A),w=null}function P(A){if(!w)return;w._rejectCallback(A,O,!0),w=null}return L}return Y}});var FO0=M((b$4,OO0)=>{OO0.exports=function($,I,z,q,U){var Y=q4(),J=Y.isArray;function Q(H){switch(H){case-2:return[];case-3:return{}}}function K(H){var G=this._promise=new $(I);if(H instanceof $)G._propagateFrom(H,3);G._setOnCancel(this),this._values=H,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 H(G,Z){var W=z(this._values,this._promise);if(W instanceof $){W=W._target();var X=W._bitField;if(this._values=W,(X&50397184)===0)return this._promise._setAsyncGuaranteed(),W._then(H,this._reject,void 0,this,Z);else if((X&33554432)!==0)W=W._value();else if((X&16777216)!==0)return this._reject(W._reason());else return this._cancel()}if(W=Y.asArray(W),W===null){var w=q("expecting an array or an iterable object but got "+Y.classString(W)).reason();this._promise._rejectCallback(w,!1);return}if(W.length===0){if(Z===-5)this._resolveEmptyArray();else this._resolve(Q(Z));return}this._iterate(W)},K.prototype._iterate=function(H){var G=this.getActualLength(H.length);this._length=G,this._values=this.shouldCopyValues()?Array(G):this._values;var Z=this._promise,W=!1,X=null;for(var w=0;w<G;++w){var L=z(H[w],Z);if(L instanceof $)L=L._target(),X=L._bitField;else X=null;if(W){if(X!==null)L.suppressUnhandledRejections()}else if(X!==null)if((X&50397184)===0)L._proxy(this,w),this._values[w]=L;else if((X&33554432)!==0)W=this._promiseFulfilled(L._value(),w);else if((X&16777216)!==0)W=this._promiseRejected(L._reason(),w);else W=this._promiseCancelled(w);else W=this._promiseFulfilled(L,w)}if(!W)Z._setAsyncGuaranteed()},K.prototype._isResolved=function(){return this._values===null},K.prototype._resolve=function(H){this._values=null,this._promise._fulfill(H)},K.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},K.prototype._reject=function(H){this._values=null,this._promise._rejectCallback(H,!1)},K.prototype._promiseFulfilled=function(H,G){this._values[G]=H;var Z=++this._totalResolved;if(Z>=this._length)return this._resolve(this._values),!0;return!1},K.prototype._promiseCancelled=function(){return this._cancel(),!0},K.prototype._promiseRejected=function(H){return this._totalResolved++,this._reject(H),!0},K.prototype._resultCancelled=function(){if(this._isResolved())return;var H=this._values;if(this._cancel(),H instanceof $)H.cancel();else for(var G=0;G<H.length;++G)if(H[G]instanceof $)H[G].cancel()},K.prototype.shouldCopyValues=function(){return!0},K.prototype.getActualLength=function(H){return H},K}});var NO0=M((i$4,MO0)=>{MO0.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(!v0.longStackTraces&&$$()){var s=$.prototype._captureStackTrace,F=$.prototype._attachExtraTrace;v0.longStackTraces=!0,M=function(){if(q.haveItemsQueued()&&!v0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
`);if(!C0.longStackTraces&&T8()){var a=$.prototype._captureStackTrace,N=$.prototype._attachExtraTrace;C0.longStackTraces=!0,A=function(){if(q.haveItemsQueued()&&!C0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=s,$.prototype._attachExtraTrace=F,I.deactivateLongStackTraces(),q.enableTrampoline(),v0.longStackTraces=!1},$.prototype._captureStackTrace=q0,$.prototype._attachExtraTrace=w0,I.activateLongStackTraces(),q.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return v0.longStackTraces&&$$()};var j=function(){try{if(typeof CustomEvent==="function"){var s=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(s),function(F,P){var S=new CustomEvent(F.toLowerCase(),{detail:P,cancelable:!0});return!Y.global.dispatchEvent(S)}}else if(typeof Event==="function"){var s=new Event("CustomEvent");return Y.global.dispatchEvent(s),function(P,S){var i=new Event(P.toLowerCase(),{cancelable:!0});return i.detail=S,!Y.global.dispatchEvent(i)}}else{var s=document.createEvent("CustomEvent");return s.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(s),function(P,S){var i=document.createEvent("CustomEvent");return i.initCustomEvent(P.toLowerCase(),!1,!0,S),!Y.global.dispatchEvent(i)}}}catch(F){}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(s){var F="on"+s.toLowerCase(),P=Y.global[F];if(!P)return!1;return P.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function h(s,F){return{promise:F}}var b={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(s,F,P){return{promise:F,child:P}},warning:function(s,F){return{warning:F}},unhandledRejection:function(s,F,P){return{reason:F,promise:P}},rejectionHandled:h},R=function(s){var F=!1;try{F=x.apply(null,arguments)}catch(S){q.throwLater(S),F=!0}var P=!1;try{P=j(s,b[s].apply(null,arguments))}catch(S){q.throwLater(S),P=!0}return P||F};$.config=function(s){if(s=Object(s),"longStackTraces"in s){if(s.longStackTraces)$.longStackTraces();else if(!s.longStackTraces&&$.hasLongStackTraces())M()}if("warnings"in s){var F=s.warnings;if(v0.warnings=!!F,T=v0.warnings,Y.isObject(F)){if("wForgottenReturn"in F)T=!!F.wForgottenReturn}}if("cancellation"in s&&s.cancellation&&!v0.cancellation){if(q.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=z0,$.prototype._propagateFrom=v,$.prototype._onCancel=k,$.prototype._setOnCancel=p,$.prototype._attachCancellationCallback=C,$.prototype._execute=n,c=v,v0.cancellation=!0}if("monitoring"in s){if(s.monitoring&&!v0.monitoring)v0.monitoring=!0,$.prototype._fireEvent=R;else if(!s.monitoring&&v0.monitoring)v0.monitoring=!1,$.prototype._fireEvent=f}return $};function f(){return!1}$.prototype._fireEvent=f,$.prototype._execute=function(s,F,P){try{s(F,P)}catch(S){return S}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(s){},$.prototype._attachCancellationCallback=function(s){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(s,F){};function n(s,F,P){var S=this;try{s(F,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 C(s){if(!this._isCancellable())return this;var F=this._onCancel();if(F!==void 0)if(Y.isArray(F))F.push(s);else this._setOnCancel([F,s]);else this._setOnCancel(s)}function k(){return this._onCancelField}function p(s){this._onCancelField=s}function z0(){this._cancellationParent=void 0,this._onCancelField=void 0}function v(s,F){if((F&1)!==0){this._cancellationParent=s;var P=s._branchesRemainingToCancel;if(P===void 0)P=0;s._branchesRemainingToCancel=P+1}if((F&2)!==0&&s._isBound())this._setBoundTo(s._boundTo)}function u(s,F){if((F&2)!==0&&s._isBound())this._setBoundTo(s._boundTo)}var c=u;function r(){var s=this._boundTo;if(s!==void 0){if(s instanceof $)if(s.isFulfilled())return s.value();else return}return s}function q0(){this._trace=new M$(this._peekContext())}function w0(s,F){if(J(s)){var P=this._trace;if(P!==void 0){if(F)P=P._parent}if(P!==void 0)P.attachExtraTrace(s);else if(!s.__stackCleaned__){var S=k0(s);Y.notEnumerableProp(s,"stack",S.message+`
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),q.enableTrampoline(),C0.longStackTraces=!1},$.prototype._captureStackTrace=U0,$.prototype._attachExtraTrace=H0,I.activateLongStackTraces(),q.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return C0.longStackTraces&&T8()};var T=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(a),function(N,B){var S=new CustomEvent(N.toLowerCase(),{detail:B,cancelable:!0});return!Y.global.dispatchEvent(S)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Y.global.dispatchEvent(a),function(B,S){var n=new Event(B.toLowerCase(),{cancelable:!0});return n.detail=S,!Y.global.dispatchEvent(n)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(a),function(B,S){var n=document.createEvent("CustomEvent");return n.initCustomEvent(B.toLowerCase(),!1,!0,S),!Y.global.dispatchEvent(n)}}}catch(N){}return function(){return!1}}(),k=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(),B=Y.global[N];if(!B)return!1;return B.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function h(a,N){return{promise:N}}var f={promiseCreated:h,promiseFulfilled:h,promiseRejected:h,promiseResolved:h,promiseCancelled:h,promiseChained:function(a,N,B){return{promise:N,child:B}},warning:function(a,N){return{warning:N}},unhandledRejection:function(a,N,B){return{reason:N,promise:B}},rejectionHandled:h},C=function(a){var N=!1;try{N=k.apply(null,arguments)}catch(S){q.throwLater(S),N=!0}var B=!1;try{B=T(a,f[a].apply(null,arguments))}catch(S){q.throwLater(S),B=!0}return B||N};$.config=function(a){if(a=Object(a),"longStackTraces"in a){if(a.longStackTraces)$.longStackTraces();else if(!a.longStackTraces&&$.hasLongStackTraces())A()}if("warnings"in a){var N=a.warnings;if(C0.warnings=!!N,P=C0.warnings,Y.isObject(N)){if("wForgottenReturn"in N)P=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!C0.cancellation){if(q.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=$0,$.prototype._propagateFrom=R,$.prototype._onCancel=y,$.prototype._setOnCancel=c,$.prototype._attachCancellationCallback=v,$.prototype._execute=i,p=R,C0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!C0.monitoring)C0.monitoring=!0,$.prototype._fireEvent=C;else if(!a.monitoring&&C0.monitoring)C0.monitoring=!1,$.prototype._fireEvent=b}return $};function b(){return!1}$.prototype._fireEvent=b,$.prototype._execute=function(a,N,B){try{a(N,B)}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 i(a,N,B){var S=this;try{a(N,B,function(n){if(typeof n!=="function")throw TypeError("onCancel must be a function, got: "+Y.toString(n));S._attachCancellationCallback(n)})}catch(n){return n}}function v(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 y(){return this._onCancelField}function c(a){this._onCancelField=a}function $0(){this._cancellationParent=void 0,this._onCancelField=void 0}function R(a,N){if((N&1)!==0){this._cancellationParent=a;var B=a._branchesRemainingToCancel;if(B===void 0)B=0;a._branchesRemainingToCancel=B+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 p=u;function s(){var a=this._boundTo;if(a!==void 0){if(a instanceof $)if(a.isFulfilled())return a.value();else return}return a}function U0(){this._trace=new l8(this._peekContext())}function H0(a,N){if(J(a)){var B=this._trace;if(B!==void 0){if(N)B=B._parent}if(B!==void 0)B.attachExtraTrace(a);else if(!a.__stackCleaned__){var S=k0(a);Y.notEnumerableProp(a,"stack",S.message+`
`+S.stack.join(`
`)),Y.notEnumerableProp(s,"__stackCleaned__",!0)}}}function M0(s,F,P,S,i){if(s===void 0&&F!==null&&T){if(i!==void 0&&i._returnedNonUndefined())return;if((S._bitField&65535)===0)return;if(P)P=P+" ";var e="",o="";if(F._trace){var $0=F._trace.stack.split(`
`),J0=m($0);for(var W0=J0.length-1;W0>=0;--W0){var h0=J0[W0];if(!H.test(h0)){var c0=h0.match(G);if(c0)e="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 "+e+"but was not returned from it, see http://goo.gl/rRqMUw"+o;S._warn(V1,!0,F)}}function R0(s,F){var P=s+" is deprecated and will be removed in a future version.";if(F)P+=" Use "+F+" instead.";return U1(P)}function U1(s,F,P){if(!v0.warnings)return;var S=new U(s),i;if(F)P._attachExtraTrace(S);else if(v0.longStackTraces&&(i=$._peekContext()))i.attachExtraTrace(S);else{var e=k0(S);S.stack=e.message+`
`+e.stack.join(`
`)}if(!R("warning",S))W1(S,"",!0)}function x0(s,F){for(var P=0;P<F.length-1;++P)F[P].push("From previous event:"),F[P]=F[P].join(`
`);if(P<F.length)F[P]=F[P].join(`
`);return s+`
`+F.join(`
`)}function r0(s){for(var F=0;F<s.length;++F)if(s[F].length===0||F+1<s.length&&s[F][0]===s[F+1][0])s.splice(F,1),F--}function I1(s){var F=s[0];for(var P=1;P<s.length;++P){var S=s[P],i=F.length-1,e=F[i],o=-1;for(var $0=S.length-1;$0>=0;--$0)if(S[$0]===e){o=$0;break}for(var $0=o;$0>=0;--$0){var J0=S[$0];if(F[i]===J0)F.pop(),i--;else break}F=S}}function m(s){var F=[];for(var P=0;P<s.length;++P){var S=s[P],i=S===" (No stack trace)"||W.test(S),e=i&&k6(S);if(i&&!e){if(X&&S.charAt(0)!==" ")S=" "+S;F.push(S)}}return F}function B0(s){var F=s.stack.replace(/\s+$/g,"").split(`
`);for(var P=0;P<F.length;++P){var S=F[P];if(S===" (No stack trace)"||W.test(S))break}if(P>0&&s.name!="SyntaxError")F=F.slice(P);return F}function k0(s){var F=s.stack,P=s.toString();return F=typeof F==="string"&&F.length>0?B0(s):[" (No stack trace)"],{message:P,stack:s.name=="SyntaxError"?F:m(F)}}function W1(s,F,P){if(typeof console<"u"){var S;if(Y.isObject(s)){var i=s.stack;S=F+V(i,s)}else S=F+String(s);if(typeof L==="function")L(S,P);else if(typeof console.log==="function"||typeof console.log==="object")console.log(S)}}function T4(s,F,P,S){var i=!1;try{if(typeof F==="function")if(i=!0,s==="rejectionHandled")F(S);else F(P,S)}catch(e){q.throwLater(e)}if(s==="unhandledRejection"){if(!R(s,P,S)&&!i)W1(P,"Unhandled rejection ")}else R(s,S)}function S4(s){var F;if(typeof s==="function")F="[function "+(s.name||"anonymous")+"]";else{F=s&&typeof s.toString==="function"?s.toString():Y.toString(s);var P=/\[object [a-zA-Z0-9$_]+\]/;if(P.test(F))try{var S=JSON.stringify(s);F=S}catch(i){}if(F.length===0)F="(empty array)"}return"(<"+b$(F)+">, no stack trace)"}function b$(s){var F=41;if(s.length<F)return s;return s.substr(0,F-3)+"..."}function $$(){return typeof F9==="function"}var k6=function(){return!1},n$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function F$(s){var F=s.match(n$);if(F)return{fileName:F[1],line:parseInt(F[2],10)}}function s7(s,F){if(!$$())return;var P=s.stack.split(`
`),S=F.stack.split(`
`),i=-1,e=-1,o,$0;for(var J0=0;J0<P.length;++J0){var W0=F$(P[J0]);if(W0){o=W0.fileName,i=W0.line;break}}for(var J0=0;J0<S.length;++J0){var W0=F$(S[J0]);if(W0){$0=W0.fileName,e=W0.line;break}}if(i<0||e<0||!o||!$0||o!==$0||i>=e)return;k6=function(h0){if(w.test(h0))return!0;var c0=F$(h0);if(c0){if(c0.fileName===o&&(i<=c0.line&&c0.line<=e))return!0}return!1}}function M$(s){this._parent=s,this._promisesCreated=0;var F=this._length=1+(s===void 0?0:s._length);if(F9(this,M$),F>32)this.uncycle()}Y.inherits(M$,Error),I.CapturedTrace=M$,M$.prototype.uncycle=function(){var s=this._length;if(s<2)return;var F=[],P={};for(var S=0,i=this;i!==void 0;++S)F.push(i),i=i._parent;s=this._length=S;for(var S=s-1;S>=0;--S){var e=F[S].stack;if(P[e]===void 0)P[e]=S}for(var S=0;S<s;++S){var o=F[S].stack,$0=P[o];if($0!==void 0&&$0!==S){if($0>0)F[$0-1]._parent=void 0,F[$0-1]._length=1;F[S]._parent=void 0,F[S]._length=1;var J0=S>0?F[S-1]:this;if($0<s-1)J0._parent=F[$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 h0=S-2;h0>=0;--h0)F[h0]._length=W0,W0++;return}}},M$.prototype.attachExtraTrace=function(s){if(s.__stackCleaned__)return;this.uncycle();var F=k0(s),P=F.message,S=[F.stack],i=this;while(i!==void 0)S.push(m(i.stack.split(`
`))),i=i._parent;I1(S),r0(S),Y.notEnumerableProp(s,"stack",x0(P,S)),Y.notEnumerableProp(s,"__stackCleaned__",!0)};var F9=function(){var F=/^\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=F,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 e;try{throw Error()}catch(o){e="stack"in o}if(!("stack"in i)&&e&&typeof Error.stackTraceLimit==="number")return W=F,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(s){console.warn(s)},Y.isNode&&process.stderr.isTTY)L=function(s,F){var P=F?"\x1B[33m":"\x1B[31m";console.warn(P+s+`\x1B[0m
`)};else if(!Y.isNode&&typeof Error().stack==="string")L=function(s,F){console.warn("%c"+s,F?"color: darkorange":"color: red")}}var v0={warnings:D,longStackTraces:!1,cancellation:!1,monitoring:!1};if(A)$.longStackTraces();return{longStackTraces:function(){return v0.longStackTraces},warnings:function(){return v0.warnings},cancellation:function(){return v0.cancellation},monitoring:function(){return v0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return r},checkForgottenReturns:M0,setBounds:s7,warn:U1,deprecated:R0,CapturedTrace:M$,fireDomEvent:j,fireGlobalEvent:x}}});var TH0=N((Gu1,PH0)=>{PH0.exports=function($,I){var z=r1(),q=$.CancellationError,U=z.errorObj;function Y(G,W,V){this.promise=G,this.type=W,this.handler=V,this.called=!1,this.cancelPromise=null}Y.prototype.isFinallyHandler=function(){return this.type===0};function J(G){this.finallyHandler=G}J.prototype._resultCancelled=function(){Q(this.finallyHandler)};function Q(G,W){if(G.cancelPromise!=null){if(arguments.length>1)G.cancelPromise._reject(W);else G.cancelPromise._cancel();return G.cancelPromise=null,!0}return!1}function K(){return H.call(this,this.promise._target()._settledValue())}function w(G){if(Q(this,G))return;return U.e=G,U}function H(G){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(),G);if(X!==void 0){W._setReturnedNonUndefined();var L=I(X,W);if(L instanceof $){if(this.cancelPromise!=null){if(L._isCancelled()){var O=new q("late cancellation observer");return W._attachExtraTrace(O),U.e=O,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=G,U;else return Q(this),G}return $.prototype._passThrough=function(G,W,V,X){if(typeof G!=="function")return this.then();return this._then(V,X,void 0,new Y(this,W,G),void 0)},$.prototype.lastly=$.prototype.finally=function(G){return this._passThrough(G,0,H,H)},$.prototype.tap=function(G){return this._passThrough(G,1,H)},Y}});var BH0=N((Wu1,EH0)=>{EH0.exports=function($){var I=r1(),z=MI().keys,q=I.tryCatch,U=I.errorObj;function Y(J,Q,K){return function(w){var H=K._boundValue();$:for(var G=0;G<J.length;++G){var W=J[G];if(W===Error||W!=null&&W.prototype instanceof Error){if(w instanceof W)return q(Q).call(H,w)}else if(typeof W==="function"){var V=q(W).call(H,w);if(V===U)return V;else if(V)return q(Q).call(H,w)}else if(I.isObject(w)){var X=z(W);for(var L=0;L<X.length;++L){var O=X[L];if(W[O]!=w[O])continue $}return q(Q).call(H,w)}}return $}}return Y}});var Py=N((Vu1,RH0)=>{var jH0=r1(),uJ1=jH0.maybeWrapAsError,xJ1=z9(),kJ1=xJ1.OperationalError,vH0=MI();function fJ1($){return $ instanceof Error&&vH0.getPrototypeOf($)===Error.prototype}var bJ1=/^(?:name|message|stack|cause)$/;function nJ1($){var I;if(fJ1($)){I=new kJ1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var z=vH0.keys($);for(var q=0;q<z.length;++q){var U=z[q];if(!bJ1.test(U))I[U]=$[U]}return I}return jH0.markAsOriginatingFromRejection($),$}function iJ1($,I){return function(z,q){if($===null)return;if(z){var U=nJ1(uJ1(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}}RH0.exports=iJ1});var _H0=N((Zu1,gH0)=>{gH0.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),H=K._popContext();return U.checkForgottenReturns(w,H,"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 H=arguments[1],G=arguments[2];w=Y.isArray(H)?J(Q).apply(G,H):J(Q).call(G,H)}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 hH0=N((Xu1,CH0)=>{CH0.exports=function($,I,z,q){var U=!1,Y=function(w,H){this._reject(H)},J=function(w,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(Y,Y,null,this,w)},Q=function(w,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},K=function(w,H){if(!H.promiseRejectionQueued)this._reject(w)};$.prototype.bind=function(w){if(!U)U=!0,$.prototype._propagateFrom=q.propagateFromFunction(),$.prototype._boundValue=q.boundValueFunction();var H=z(w),G=new $(I);G._propagateFrom(this,1);var W=this._target();if(G._setBoundTo(H),H instanceof $){var V={promiseRejectionQueued:!1,promise:G,target:W,bindingPromise:H};W._then(I,J,voi Line truncated
`)),Y.notEnumerableProp(a,"__stackCleaned__",!0)}}}function D0(a,N,B,S,n){if(a===void 0&&N!==null&&P){if(n!==void 0&&n._returnedNonUndefined())return;if((S._bitField&65535)===0)return;if(B)B=B+" ";var I0="",r="";if(N._trace){var z0=N._trace.stack.split(`
`),Q0=o(z0);for(var W0=Q0.length-1;W0>=0;--W0){var g0=Q0[W0];if(!G.test(g0)){var d0=g0.match(Z);if(d0)I0="at "+d0[1]+":"+d0[2]+":"+d0[3]+" ";break}}if(Q0.length>0){var c0=Q0[0];for(var W0=0;W0<z0.length;++W0)if(z0[W0]===c0){if(W0>0)r=`
`+z0[W0-1];break}}}var O1="a promise was created in a "+B+"handler "+I0+"but was not returned from it, see http://goo.gl/rRqMUw"+r;S._warn(O1,!0,N)}}function _0(a,N){var B=a+" is deprecated and will be removed in a future version.";if(N)B+=" Use "+N+" instead.";return Y1(B)}function Y1(a,N,B){if(!C0.warnings)return;var S=new U(a),n;if(N)B._attachExtraTrace(S);else if(C0.longStackTraces&&(n=$._peekContext()))n.attachExtraTrace(S);else{var I0=k0(S);S.stack=I0.message+`
`+I0.stack.join(`
`)}if(!C("warning",S))L1(S,"",!0)}function u0(a,N){for(var B=0;B<N.length-1;++B)N[B].push("From previous event:"),N[B]=N[B].join(`
`);if(B<N.length)N[B]=N[B].join(`
`);return a+`
`+N.join(`
`)}function r0(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 I1(a){var N=a[0];for(var B=1;B<a.length;++B){var S=a[B],n=N.length-1,I0=N[n],r=-1;for(var z0=S.length-1;z0>=0;--z0)if(S[z0]===I0){r=z0;break}for(var z0=r;z0>=0;--z0){var Q0=S[z0];if(N[n]===Q0)N.pop(),n--;else break}N=S}}function o(a){var N=[];for(var B=0;B<a.length;++B){var S=a[B],n=S===" (No stack trace)"||W.test(S),I0=n&&J8(S);if(n&&!I0){if(w&&S.charAt(0)!==" ")S=" "+S;N.push(S)}}return N}function E0(a){var N=a.stack.replace(/\s+$/g,"").split(`
`);for(var B=0;B<N.length;++B){var S=N[B];if(S===" (No stack trace)"||W.test(S))break}if(B>0&&a.name!="SyntaxError")N=N.slice(B);return N}function k0(a){var N=a.stack,B=a.toString();return N=typeof N==="string"&&N.length>0?E0(a):[" (No stack trace)"],{message:B,stack:a.name=="SyntaxError"?N:o(N)}}function L1(a,N,B){if(typeof console<"u"){var S;if(Y.isObject(a)){var n=a.stack;S=N+X(n,a)}else S=N+String(a);if(typeof L==="function")L(S,B);else if(typeof console.log==="function"||typeof console.log==="object")console.log(S)}}function k4(a,N,B,S){var n=!1;try{if(typeof N==="function")if(n=!0,a==="rejectionHandled")N(S);else N(B,S)}catch(I0){q.throwLater(I0)}if(a==="unhandledRejection"){if(!C(a,B,S)&&!n)L1(B,"Unhandled rejection ")}else C(a,S)}function t4(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 B=/\[object [a-zA-Z0-9$_]+\]/;if(B.test(N))try{var S=JSON.stringify(a);N=S}catch(n){}if(N.length===0)N="(empty array)"}return"(<"+Z$(N)+">, no stack trace)"}function Z$(a){var N=41;if(a.length<N)return a;return a.substr(0,N-3)+"..."}function T8(){return typeof V3==="function"}var J8=function(){return!1},W$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function m8(a){var N=a.match(W$);if(N)return{fileName:N[1],line:parseInt(N[2],10)}}function J2(a,N){if(!T8())return;var B=a.stack.split(`
`),S=N.stack.split(`
`),n=-1,I0=-1,r,z0;for(var Q0=0;Q0<B.length;++Q0){var W0=m8(B[Q0]);if(W0){r=W0.fileName,n=W0.line;break}}for(var Q0=0;Q0<S.length;++Q0){var W0=m8(S[Q0]);if(W0){z0=W0.fileName,I0=W0.line;break}}if(n<0||I0<0||!r||!z0||r!==z0||n>=I0)return;J8=function(g0){if(H.test(g0))return!0;var d0=m8(g0);if(d0){if(d0.fileName===r&&(n<=d0.line&&d0.line<=I0))return!0}return!1}}function l8(a){this._parent=a,this._promisesCreated=0;var N=this._length=1+(a===void 0?0:a._length);if(V3(this,l8),N>32)this.uncycle()}Y.inherits(l8,Error),I.CapturedTrace=l8,l8.prototype.uncycle=function(){var a=this._length;if(a<2)return;var N=[],B={};for(var S=0,n=this;n!==void 0;++S)N.push(n),n=n._parent;a=this._length=S;for(var S=a-1;S>=0;--S){var I0=N[S].stack;if(B[I0]===void 0)B[I0]=S}for(var S=0;S<a;++S){var r=N[S].stack,z0=B[r];if(z0!==void 0&&z0!==S){if(z0>0)N[z0-1]._parent=void 0,N[z0-1]._length=1;N[S]._parent=void 0,N[S]._length=1;var Q0=S>0?N[S-1]:this;if(z0<a-1)Q0._parent=N[z0+1],Q0._parent.uncycle(),Q0._length=Q0._parent._length+1;else Q0._parent=void 0,Q0._length=1;var W0=Q0._length+1;for(var g0=S-2;g0>=0;--g0)N[g0]._length=W0,W0++;return}}},l8.prototype.attachExtraTrace=function(a){if(a.__stackCleaned__)return;this.uncycle();var N=k0(a),B=N.message,S=[N.stack],n=this;while(n!==void 0)S.push(o(n.stack.split(`
`))),n=n._parent;I1(S),r0(S),Y.notEnumerableProp(a,"stack",u0(B,S)),Y.notEnumerableProp(a,"__stackCleaned__",!0)};var V3=function(){var N=/^\s*at\s*/,B=function(r,z0){if(typeof r==="string")return r;if(z0.name!==void 0&&z0.message!==void 0)return z0.toString();return t4(z0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,W=N,X=B;var S=Error.captureStackTrace;return J8=function(r){return H.test(r)},function(r,z0){Error.stackTraceLimit+=6,S(r,z0),Error.stackTraceLimit-=6}}var n=Error();if(typeof n.stack==="string"&&n.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return W=/@/,X=B,w=!0,function(z0){z0.stack=Error().stack};var I0;try{throw Error()}catch(r){I0="stack"in r}if(!("stack"in n)&&I0&&typeof Error.stackTraceLimit==="number")return W=N,X=B,function(z0){Error.stackTraceLimit+=6;try{throw Error()}catch(Q0){z0.stack=Q0.stack}Error.stackTraceLimit-=6};return X=function(r,z0){if(typeof r==="string")return r;if((typeof z0==="object"||typeof z0==="function")&&z0.name!==void 0&&z0.message!==void 0)return z0.toString();return t4(z0)},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 B=N?"\x1B[33m":"\x1B[31m";console.warn(B+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 C0={warnings:F,longStackTraces:!1,cancellation:!1,monitoring:!1};if(D)$.longStackTraces();return{longStackTraces:function(){return C0.longStackTraces},warnings:function(){return C0.warnings},cancellation:function(){return C0.cancellation},monitoring:function(){return C0.monitoring},propagateFromFunction:function(){return p},boundValueFunction:function(){return s},checkForgottenReturns:D0,setBounds:J2,warn:Y1,deprecated:_0,CapturedTrace:l8,fireDomEvent:T,fireGlobalEvent:k}}});var BO0=M((c$4,PO0)=>{PO0.exports=function($,I){var z=q4(),q=$.CancellationError,U=z.errorObj;function Y(Z,W,X){this.promise=Z,this.type=W,this.handler=X,this.called=!1,this.cancelPromise=null}Y.prototype.isFinallyHandler=function(){return this.type===0};function J(Z){this.finallyHandler=Z}J.prototype._resultCancelled=function(){Q(this.finallyHandler)};function Q(Z,W){if(Z.cancelPromise!=null){if(arguments.length>1)Z.cancelPromise._reject(W);else Z.cancelPromise._cancel();return Z.cancelPromise=null,!0}return!1}function K(){return G.call(this,this.promise._target()._settledValue())}function H(Z){if(Q(this,Z))return;return U.e=Z,U}function G(Z){var W=this.promise,X=this.handler;if(!this.called){this.called=!0;var w=this.isFinallyHandler()?X.call(W._boundValue()):X.call(W._boundValue(),Z);if(w!==void 0){W._setReturnedNonUndefined();var L=I(w,W);if(L instanceof $){if(this.cancelPromise!=null){if(L._isCancelled()){var O=new q("late cancellation observer");return W._attachExtraTrace(O),U.e=O,U}else if(L.isPending())L._attachCancellationCallback(new J(this))}return L._then(K,H,void 0,this,void 0)}}}if(W.isRejected())return Q(this),U.e=Z,U;else return Q(this),Z}return $.prototype._passThrough=function(Z,W,X,w){if(typeof Z!=="function")return this.then();return this._then(X,w,void 0,new Y(this,W,Z),void 0)},$.prototype.lastly=$.prototype.finally=function(Z){return this._passThrough(Z,0,G,G)},$.prototype.tap=function(Z){return this._passThrough(Z,1,G)},Y}});var EO0=M((p$4,TO0)=>{TO0.exports=function($){var I=q4(),z=hI().keys,q=I.tryCatch,U=I.errorObj;function Y(J,Q,K){return function(H){var G=K._boundValue();$:for(var Z=0;Z<J.length;++Z){var W=J[Z];if(W===Error||W!=null&&W.prototype instanceof Error){if(H instanceof W)return q(Q).call(G,H)}else if(typeof W==="function"){var X=q(W).call(G,H);if(X===U)return X;else if(X)return q(Q).call(G,H)}else if(I.isObject(H)){var w=z(W);for(var L=0;L<w.length;++L){var O=w[L];if(W[O]!=H[O])continue $}return q(Q).call(G,H)}}return $}}return Y}});var Cf=M((d$4,_O0)=>{var jO0=q4(),GN1=jO0.maybeWrapAsError,ZN1=d9(),WN1=ZN1.OperationalError,CO0=hI();function XN1($){return $ instanceof Error&&CO0.getPrototypeOf($)===Error.prototype}var VN1=/^(?:name|message|stack|cause)$/;function wN1($){var I;if(XN1($)){I=new WN1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var z=CO0.keys($);for(var q=0;q<z.length;++q){var U=z[q];if(!VN1.test(U))I[U]=$[U]}return I}return jO0.markAsOriginatingFromRejection($),$}function LN1($,I){return function(z,q){if($===null)return;if(z){var U=wN1(GN1(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}}_O0.exports=LN1});var vO0=M((m$4,RO0)=>{RO0.exports=function($,I,z,q,U){var Y=q4(),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 H=J(Q).apply(this,arguments),G=K._popContext();return U.checkForgottenReturns(H,G,"Promise.method",K),K._resolveFromSyncValue(H),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 H;if(arguments.length>1){U.deprecated("calling Promise.try with more than 1 argument");var G=arguments[1],Z=arguments[2];H=Y.isArray(G)?J(Q).apply(Z,G):J(Q).call(Z,G)}else H=J(Q)();var W=K._popContext();return U.checkForgottenReturns(H,W,"Promise.try",K),K._resolveFromSyncValue(H),K},$.prototype._resolveFromSyncValue=function(Q){if(Q===Y.errorObj)this._rejectCallback(Q.e,!1);else this._resolveCallback(Q,!0)}}});var gO0=M((l$4,hO0)=>{hO0.exports=function($,I,z,q){var U=!1,Y=function(H,G){this._reject(G)},J=function(H,G){G.promiseRejectionQueued=!0,G.bindingPromise._then(Y,Y,null,this,H)},Q=function(H,G){if((this._bitField&50397184)===0)this._resolveCallback(G.target)},K=function(H,G){if(!G.promiseRejectionQueued)this._reject(H)};$.prototype.bind=function(H){if(!U)U=!0,$.prototype._propagateFrom=q.propagateFromFunction(),$.prototype._boundValue=q.boundValueFunction();var G=z(H),Z=new $(I);Z._propagateFrom(this,1);var W=this._target();if(Z._setBoundTo(G),G instanceof $){var X={promiseRejectionQueued:!1,promise:Z,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 nH0=N((Nu1,bH0)=>{bH0.exports=function($,I,z,q,U,Y){var J=r1(),Q=J.canEvaluate,K=J.tryCatch,w=J.errorObj,H;if(Q){var G=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 iO0=M((t$4,bO0)=>{bO0.exports=function($,I,z,q,U,Y){var J=q4(),Q=J.canEvaluate,K=J.tryCatch,H=J.errorObj,G;if(Q){var Z=function(D){return Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
`.replace(/Index/g,A))},W=function(A){return Function("promise","holder",`
`.replace(/Index/g,D))},W=function(D){return Function("promise","holder",`
'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 j=T.join(" = ")+" = null;",x=`var promise;
`+T.map(function(f){return`
promise = `+f+`;
`.replace(/Index/g,D))},X=function(D){var P=Array(D);for(var A=0;A<P.length;++A)P[A]="this.p"+(A+1);var T=P.join(" = ")+" = null;",k=`var promise;
`+P.map(function(b){return`
promise = `+b+`;
if (promise instanceof Promise) {
promise.cancel();
}
`}).join(`
`),h=T.join(", "),b="Holder$"+A,R=`return function(tryCatch, errorObj, Promise, async) {
`),h=P.join(", "),f="Holder$"+D,C=`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 R=R.replace(/\[TheName\]/g,b).replace(/\[TheTotal\]/g,A).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,j).replace(/\[CancellationCode\]/g,x),Function("tryCatch","errorObj","Promise","async",R)(K,w,$,U)},X=[],L=[],O=[];for(var D=0;D<8;++D)X.push(V(D+1)),L.push(G(D+1)),O.push(W(D+1));H=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],j=new M(T),x=L;for(var h=0;h<A;++h){var b=z(arguments[h],p);if(b instanceof $){b=b._target();var R=b._bitField;if((R&50397184)===0)b._then(x[h],H,void 0,p,j),O[h](b,j),j.asyncNeeded=!1;else if((R&33554432)!==0)x[h].call(p,b._value(),j);else if((R&16777216)!==0)p._reject(b._reason());else p._cancel()}else x[h].call(p,b,j)}if(!p._isFateSealed()){if(j.asyncNeeded){var f=Y();if(f!==null)j.fn=J.domainBind(f,j.fn)}p._setAsyncGuaranteed(),p._setOnCancel(j)}return p}}var n=arguments.length,C=Array(n);for(var k=0;k<n;++k)C[k]=arguments[k];if(T)C.pop();var p=new I(C).promise();return T!==void 0?p.spread(T):p}}});var pH0=N((Fu1,iH0)=>{iH0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=r1(),K=Q.tryCatch,w=Q.errorObj,H=$._async;function G(V,X,L,O){this.constructor$(V),this._promise._captureStackTrace();var D=J();this._callback=D===null?X:Q.domainBind(D,X),this._preservedValues=O===U?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}Q.inherits(G,I),G.prototype._asyncInit=function(){this._init$(void 0,-2)},G.prototype._init=function(){},G.prototype._promiseFulfilled=function(V,X){var L=this._values,O=this.length(),D=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(D!==null)D[X]=V;var T=this._promise,M=this._callback,j=T._boundValue();T._pushContext();var x=K(M).call(j,V,X,O),h=T._popContext();if(Y.checkForgottenReturns(x,h,D!==null?"Promise.filter":"Promise.map",T),x===w)return this._reject(x.e),!0;var b=q(x,this._promise);if(b instanceof $){b=b._target();var R=b._bitField;if((R&50397184)===0){if(A>=1)this._inFlight++;return L[X]=b,b._proxy(this,(X+1)*-1),!1}else if((R&33554432)!==0)x=b._value();else if((R&16777216)!==0)return this._reject(b._reason()),!0;else return this._cancel(),!0}L[X]=x}var f=++this._totalResolved;if(f>=O){if(D!==null)this._filter(L,D);else this._resolve(L);return!0}return!1},G.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 O=V.pop();this._promiseFulfilled(L[O],O)}},G.prototype._filter=function(V,X){var L=X.length,O=Array(L),D=0;for(var A=0;A<L;++A)if(V[A])O[D++]=X[A];O.length=D,this._resolve(O)},G.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,L,O){if(typeof X!=="function")return z("expecting a function but got "+Q.classString(X));var D=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)));D=L.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+Q.classString(L)));return D=typeof D==="number"&&isFinite(D)&&D>=1?D:0,new G(V,X,D,O).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,L,O){return W(V,X,L,O)}}});var dH0=N((Mu1,cH0)=>{var Ty=Object.create;if(Ty)sL=Ty(null),eL=Ty(null),sL[" size"]=eL[" size"]=0;var sL,eL;cH0.exports=function($){var I=r1(),z=I.canEvaluate,q=I.isIdentifier,U,Y,J=function(V){return Function("ensureMethod",`
`;return C=C.replace(/\[TheName\]/g,f).replace(/\[TheTotal\]/g,D).replace(/\[ThePassedArguments\]/g,h).replace(/\[TheProperties\]/g,T).replace(/\[CancellationCode\]/g,k),Function("tryCatch","errorObj","Promise","async",C)(K,H,$,U)},w=[],L=[],O=[];for(var F=0;F<8;++F)w.push(X(F+1)),L.push(Z(F+1)),O.push(W(F+1));G=function(D){this._reject(D)}}$.join=function(){var D=arguments.length-1,P;if(D>0&&typeof arguments[D]==="function"){if(P=arguments[D],D<=8&&Q){var c=new $(q);c._captureStackTrace();var A=w[D-1],T=new A(P),k=L;for(var h=0;h<D;++h){var f=z(arguments[h],c);if(f instanceof $){f=f._target();var C=f._bitField;if((C&50397184)===0)f._then(k[h],G,void 0,c,T),O[h](f,T),T.asyncNeeded=!1;else if((C&33554432)!==0)k[h].call(c,f._value(),T);else if((C&16777216)!==0)c._reject(f._reason());else c._cancel()}else k[h].call(c,f,T)}if(!c._isFateSealed()){if(T.asyncNeeded){var b=Y();if(b!==null)T.fn=J.domainBind(b,T.fn)}c._setAsyncGuaranteed(),c._setOnCancel(T)}return c}}var i=arguments.length,v=Array(i);for(var y=0;y<i;++y)v[y]=arguments[y];if(P)v.pop();var c=new I(v).promise();return P!==void 0?c.spread(P):c}}});var cO0=M((a$4,nO0)=>{nO0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=q4(),K=Q.tryCatch,H=Q.errorObj,G=$._async;function Z(X,w,L,O){this.constructor$(X),this._promise._captureStackTrace();var F=J();this._callback=F===null?w:Q.domainBind(F,w),this._preservedValues=O===U?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],G.invoke(this._asyncInit,this,void 0)}Q.inherits(Z,I),Z.prototype._asyncInit=function(){this._init$(void 0,-2)},Z.prototype._init=function(){},Z.prototype._promiseFulfilled=function(X,w){var L=this._values,O=this.length(),F=this._preservedValues,D=this._limit;if(w<0){if(w=w*-1-1,L[w]=X,D>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(D>=1&&this._inFlight>=D)return L[w]=X,this._queue.push(w),!1;if(F!==null)F[w]=X;var P=this._promise,A=this._callback,T=P._boundValue();P._pushContext();var k=K(A).call(T,X,w,O),h=P._popContext();if(Y.checkForgottenReturns(k,h,F!==null?"Promise.filter":"Promise.map",P),k===H)return this._reject(k.e),!0;var f=q(k,this._promise);if(f instanceof $){f=f._target();var C=f._bitField;if((C&50397184)===0){if(D>=1)this._inFlight++;return L[w]=f,f._proxy(this,(w+1)*-1),!1}else if((C&33554432)!==0)k=f._value();else if((C&16777216)!==0)return this._reject(f._reason()),!0;else return this._cancel(),!0}L[w]=k}var b=++this._totalResolved;if(b>=O){if(F!==null)this._filter(L,F);else this._resolve(L);return!0}return!1},Z.prototype._drainQueue=function(){var X=this._queue,w=this._limit,L=this._values;while(X.length>0&&this._inFlight<w){if(this._isResolved())return;var O=X.pop();this._promiseFulfilled(L[O],O)}},Z.prototype._filter=function(X,w){var L=w.length,O=Array(L),F=0;for(var D=0;D<L;++D)if(X[D])O[F++]=w[D];O.length=F,this._resolve(O)},Z.prototype.preservedValues=function(){return this._preservedValues};function W(X,w,L,O){if(typeof w!=="function")return z("expecting a function but got "+Q.classString(w));var F=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)));F=L.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+Q.classString(L)));return F=typeof F==="number"&&isFinite(F)&&F>=1?F:0,new Z(X,w,F,O).promise()}$.prototype.map=function(X,w){return W(this,X,w,null)},$.map=function(X,w,L,O){return W(X,w,L,O)}}});var dO0=M((e$4,pO0)=>{var _f=Object.create;if(_f)rM=_f(null),sM=_f(null),rM[" size"]=sM[" size"]=0;var rM,sM;pO0.exports=function($){var I=q4(),z=I.canEvaluate,q=I.isIdentifier,U,Y,J=function(X){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
@@ -207,29 +207,29 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
return obj.methodName.apply(obj, this);
}
};
`.replace(/methodName/g,V))(w)},Q=function(V){return Function("obj",`
`.replace(/methodName/g,X))(H)},Q=function(X){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",V))},K=function(V,X,L){var O=L[V];if(typeof O!=="function"){if(!q(V))return null;if(O=X(V),L[V]=O,L[" size"]++,L[" size"]>512){var D=Object.keys(L);for(var A=0;A<256;++A)delete L[D[A]];L[" size"]=D.length-256}}return O};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 O="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(O)}return L}function H(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 O=1;O<X;++O)L[O-1]=arguments[O];if(z){var D=U(V);if(D!==null)return this._then(D,void 0,void 0,L,void 0)}return L.push(V),this._then(H,void 0,void 0,L,void 0)};function G(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 O=Y(V);L=O!==null?O:G}else L=G;else L=W;return this._then(L,void 0,void 0,V,void 0)}}});var lH0=N((Au1,mH0)=>{mH0.exports=function($,I,z,q,U,Y){var J=r1(),Q=z9().TypeError,K=r1().inherits,w=J.errorObj,H=J.tryCatch,G={};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 j=0,x=T.length,h=new $(U);function b(){if(j>=x)return h._fulfill();var R=V(T[j++]);if(R instanceof $&&R._isDisposable()){try{R=z(R._getDisposer().tryDispose(M),T.promise)}catch(f){return W(f)}if(R instanceof $)return R._then(b,W,null,null,null)}b()}return b(),h}function L(T,M,j){this._data=T,this._promise=M,this._context=j}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 G},L.prototype.tryDispose=function(T){var M=this.resource(),j=this._context;if(j!==void 0)j._pushContext();var x=M!==G?this.doDispose(M,T):null;if(j!==void 0)j._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 O(T,M,j){this.constructor$(T,M,j)}K(O,L),O.prototype.doDispose=function(T,M){var j=this.data();return j.call(T,T,M)};function D(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 j=this[M];if(j instanceof $)j.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 j,x=!0;if(T===2&&Array.isArray(arguments[0]))j=arguments[0],T=j.length,x=!1;else j=arguments,T--;var h=new A(T);for(var b=0;b<T;++b){var R=j[b];if(L.isDisposer(R)){var f=R;R=R.promise(),R._setDisposable(f)}else{var n=z(R);if(n instanceof $)R=n._then(D,null,null,{resources:h,index:b},void 0)}h[b]=R}var C=Array(h.length);for(var b=0;b<C.length;++b)C[b]=$.resolve(h[b]).reflect();var k=$.all(C).then(function(z0){for(var v=0;v<z0.length;++v){var u=z0[v];if(u.isRejected())return w.e=u.error(),w;else if(!u.isFulfilled()){k.cancel();return}z0[v]=u.value()}p._pushContext(),M=H(M);var c=x?M.apply(void 0,z0):M(z0),r=p._popContext();return Y.checkForgottenReturns(c,r,"Promise.using",p),c}),p=k.lastly(function(){var z0=new $.PromiseInspection(k);return X(h,z0)});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 O(T,this,q());throw new Q}}});var rH0=N((Pu1,oH0)=>{oH0.exports=function($,I,z){var q=r1(),U=$.TimeoutError;function Y(G){this.handle=G}Y.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(G){return Q(+this).thenReturn(G)},Q=$.delay=function(G,W){var V,X;if(W!==void 0){if(V=$.resolve(W)._then(J,null,null,G,void 0),z.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+G),z.cancellation())V._setOnCancel(new Y(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(G){return Q(G,this)};var K=function(G,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),G._attachExtraTrace(X),G._reject(X),V!=null)V.cancel()};function w(G){return clearTimeout(this.handle),G}f Line truncated
`.replace("propertyName",X))},K=function(X,w,L){var O=L[X];if(typeof O!=="function"){if(!q(X))return null;if(O=w(X),L[X]=O,L[" size"]++,L[" size"]>512){var F=Object.keys(L);for(var D=0;D<256;++D)delete L[F[D]];L[" size"]=F.length-256}}return O};U=function(X){return K(X,J,rM)},Y=function(X){return K(X,Q,sM)};function H(X,w){var L;if(X!=null)L=X[w];if(typeof L!=="function"){var O="Object "+I.classString(X)+" has no method '"+I.toString(w)+"'";throw new $.TypeError(O)}return L}function G(X){var w=this.pop(),L=H(X,w);return L.apply(X,this)}$.prototype.call=function(X){var w=arguments.length,L=Array(Math.max(w-1,0));for(var O=1;O<w;++O)L[O-1]=arguments[O];if(z){var F=U(X);if(F!==null)return this._then(F,void 0,void 0,L,void 0)}return L.push(X),this._then(G,void 0,void 0,L,void 0)};function Z(X){return X[this]}function W(X){var w=+this;if(w<0)w=Math.max(0,w+X.length);return X[w]}$.prototype.get=function(X){var w=typeof X==="number",L;if(!w)if(z){var O=Y(X);L=O!==null?O:Z}else L=Z;else L=W;return this._then(L,void 0,void 0,X,void 0)}}});var lO0=M(($54,mO0)=>{mO0.exports=function($,I,z,q,U,Y){var J=q4(),Q=d9().TypeError,K=q4().inherits,H=J.errorObj,G=J.tryCatch,Z={};function W(P){setTimeout(function(){throw P},0)}function X(P){var A=z(P);if(A!==P&&typeof P._isDisposable==="function"&&typeof P._getDisposer==="function"&&P._isDisposable())A._setDisposable(P._getDisposer());return A}function w(P,A){var T=0,k=P.length,h=new $(U);function f(){if(T>=k)return h._fulfill();var C=X(P[T++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(A),P.promise)}catch(b){return W(b)}if(C instanceof $)return C._then(f,W,null,null,null)}f()}return f(),h}function L(P,A,T){this._data=P,this._promise=A,this._context=T}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 Z},L.prototype.tryDispose=function(P){var A=this.resource(),T=this._context;if(T!==void 0)T._pushContext();var k=A!==Z?this.doDispose(A,P):null;if(T!==void 0)T._popContext();return this._promise._unsetDisposable(),this._data=null,k},L.isDisposer=function(P){return P!=null&&typeof P.resource==="function"&&typeof P.tryDispose==="function"};function O(P,A,T){this.constructor$(P,A,T)}K(O,L),O.prototype.doDispose=function(P,A){var T=this.data();return T.call(P,P,A)};function F(P){if(L.isDisposer(P))return this.resources[this.index]._setDisposable(P),P.promise();return P}function D(P){this.length=P,this.promise=null,this[P-1]=null}D.prototype._resultCancelled=function(){var P=this.length;for(var A=0;A<P;++A){var T=this[A];if(T instanceof $)T.cancel()}},$.using=function(){var P=arguments.length;if(P<2)return I("you must pass at least 2 arguments to Promise.using");var A=arguments[P-1];if(typeof A!=="function")return I("expecting a function but got "+J.classString(A));var T,k=!0;if(P===2&&Array.isArray(arguments[0]))T=arguments[0],P=T.length,k=!1;else T=arguments,P--;var h=new D(P);for(var f=0;f<P;++f){var C=T[f];if(L.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var i=z(C);if(i instanceof $)C=i._then(F,null,null,{resources:h,index:f},void 0)}h[f]=C}var v=Array(h.length);for(var f=0;f<v.length;++f)v[f]=$.resolve(h[f]).reflect();var y=$.all(v).then(function($0){for(var R=0;R<$0.length;++R){var u=$0[R];if(u.isRejected())return H.e=u.error(),H;else if(!u.isFulfilled()){y.cancel();return}$0[R]=u.value()}c._pushContext(),A=G(A);var p=k?A.apply(void 0,$0):A($0),s=c._popContext();return Y.checkForgottenReturns(p,s,"Promise.using",c),p}),c=y.lastly(function(){var $0=new $.PromiseInspection(y);return w(h,$0)});return h.promise=c,c._setOnCancel(h),c},$.prototype._setDisposable=function(P){this._bitField=this._bitField|131072,this._disposer=P},$.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(P){if(typeof P==="function")return new O(P,this,q());throw new Q}}});var rO0=M((I54,oO0)=>{oO0.exports=function($,I,z){var q=q4(),U=$.TimeoutError;function Y(Z){this.handle=Z}Y.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(Z){return Q(+this).thenReturn(Z)},Q=$.delay=function(Z,W){var X,w;if(W!==void 0){if(X=$.resolve(W)._then(J,null,null,Z,void 0),z.cancellation()&&W instanceof $)X._setOnCancel(W)}else{if(X=new $(I),w=setTimeout(function(){X._fulfill()},+Z),z.cancellation())X._setOnCancel(new Y(w));X._captureStackTrace()}return X._setAsyncGuaranteed(),X};$.prototype.delay=function(Z){return Q(Z,this)};var K=function(Z,W,X){var w;if(typeof W!=="string")if(W instanceof Error)w=W;else w=new U("operation timed out");else w=new U(W);if(q.markAsOriginatingFromRejection(w),Z._attachExtraTrace(w),Z._reject(w),X!=null)X.cancel()};function H(Z){return clearTimeout(this.handle),Z}f Line truncated
See http://goo.gl/MqrFmX
`.replace("%s",O)+`From coroutine:
`+this._stack.split(`
`).slice(1,-7).join(`
`)));return}}D=D._target();var A=D._bitField;if((A&50397184)===0)this._yieldedPromise=D,D._proxy(this,null);else if((A&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,D._value());else if((A&16777216)!==0)$._async.invoke(this._promiseRejected,this,D._reason());else this._promiseCancelled()}},$.coroutine=function(X,L){if(typeof X!=="function")throw new Q(`generatorFunction must be a function
`)));return}}F=F._target();var D=F._bitField;if((D&50397184)===0)this._yieldedPromise=F,F._proxy(this,null);else if((D&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,F._value());else if((D&16777216)!==0)$._async.invoke(this._promiseRejected,this,F._reason());else this._promiseCancelled()}},$.coroutine=function(w,L){if(typeof w!=="function")throw new Q(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var O=Object(L).yieldHandler,D=V,A=Error().stack;return function(){var T=X.apply(this,arguments),M=new D(void 0,void 0,O,A),j=M.promise();return M._generator=T,M._promiseFulfilled(void 0),j}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new Q("expecting a function but got "+K.classString(X));G.push(X)},$.spawn=function(X){if(Y.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
`);var O=Object(L).yieldHandler,F=X,D=Error().stack;return function(){var P=w.apply(this,arguments),A=new F(void 0,void 0,O,D),T=A.promise();return A._generator=P,A._promiseFulfilled(void 0),T}},$.coroutine.addYieldHandler=function(w){if(typeof w!=="function")throw new Q("expecting a function but got "+K.classString(w));Z.push(w)},$.spawn=function(w){if(Y.deprecated("Promise.spawn()","Promise.coroutine()"),typeof w!=="function")return I(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var L=new V(X,this),O=L.promise();return L._run($.spawn),O}}});var eH0=N((Eu1,sH0)=>{sH0.exports=function($){var I=r1(),z=$._async,q=I.tryCatch,U=I.errorObj;function Y(K,w){var H=this;if(!I.isArray(K))return J.call(H,K,w);var G=q(w).apply(H._boundValue(),[null].concat(K));if(G===U)z.throwLater(G.e)}function J(K,w){var H=this,G=H._boundValue(),W=K===void 0?q(w).call(G,null):q(w).call(G,null,K);if(W===U)z.throwLater(W.e)}function Q(K,w){var H=this;if(!K){var G=Error(K+"");G.cause=K,K=G}var W=q(w).call(H._boundValue(),K);if(W===U)z.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(K,w){if(typeof K=="function"){var H=J;if(w!==void 0&&Object(w).spread)H=Y;this._then(H,Q,void 0,this,K)}return this}}});var IG0=N((Bu1,$G0)=>{$G0.exports=function($,I){var z={},q=r1(),U=Py(),Y=q.withAppended,J=q.maybeWrapAsError,Q=q.canEvaluate,K=z9().TypeError,w="Async",H={__isPromisified__:!0},G=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+G.join("|")+")$"),V=function(k){return q.isIdentifier(k)&&k.charAt(0)!=="_"&&k!=="constructor"};function X(k){return!W.test(k)}function L(k){try{return k.__isPromisified__===!0}catch(p){return!1}}function O(k,p,z0){var v=q.getDataPropertyOrDefault(k,p+z0,H);return v?L(v):!1}function D(k,p,z0){for(var v=0;v<k.length;v+=2){var u=k[v];if(z0.test(u)){var c=u.replace(z0,"");for(var r=0;r<k.length;r+=2)if(k[r]===c)throw new K(`Cannot promisify an API that has normal methods with '%s'-suffix
`);var L=new X(w,this),O=L.promise();return L._run($.spawn),O}}});var eO0=M((q54,aO0)=>{aO0.exports=function($){var I=q4(),z=$._async,q=I.tryCatch,U=I.errorObj;function Y(K,H){var G=this;if(!I.isArray(K))return J.call(G,K,H);var Z=q(H).apply(G._boundValue(),[null].concat(K));if(Z===U)z.throwLater(Z.e)}function J(K,H){var G=this,Z=G._boundValue(),W=K===void 0?q(H).call(Z,null):q(H).call(Z,null,K);if(W===U)z.throwLater(W.e)}function Q(K,H){var G=this;if(!K){var Z=Error(K+"");Z.cause=K,K=Z}var W=q(H).call(G._boundValue(),K);if(W===U)z.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(K,H){if(typeof K=="function"){var G=J;if(H!==void 0&&Object(H).spread)G=Y;this._then(G,Q,void 0,this,K)}return this}}});var IF0=M((U54,$F0)=>{$F0.exports=function($,I){var z={},q=q4(),U=Cf(),Y=q.withAppended,J=q.maybeWrapAsError,Q=q.canEvaluate,K=d9().TypeError,H="Async",G={__isPromisified__:!0},Z=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+Z.join("|")+")$"),X=function(y){return q.isIdentifier(y)&&y.charAt(0)!=="_"&&y!=="constructor"};function w(y){return!W.test(y)}function L(y){try{return y.__isPromisified__===!0}catch(c){return!1}}function O(y,c,$0){var R=q.getDataPropertyOrDefault(y,c+$0,G);return R?L(R):!1}function F(y,c,$0){for(var R=0;R<y.length;R+=2){var u=y[R];if($0.test(u)){var p=u.replace($0,"");for(var s=0;s<y.length;s+=2)if(y[s]===p)throw new K(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",p))}}}function A(k,p,z0,v){var u=q.inheritedDataKeys(k),c=[];for(var r=0;r<u.length;++r){var q0=u[r],w0=k[q0],M0=v===V?!0:V(q0,w0,k);if(typeof w0==="function"&&!L(w0)&&!O(k,q0,p)&&v(q0,w0,k,M0))c.push(q0,w0)}return D(c,p,z0),c}var T=function(k){return k.replace(/([$])/,"\\$")},M,j=function(k){var p=[k],z0=Math.max(0,k-1-3);for(var v=k-1;v>=z0;--v)p.push(v);for(var v=k+1;v<=3;++v)p.push(v);return p},x=function(k){return q.filledRange(k,"_arg","")},h=function(k){return q.filledRange(Math.max(k,3),"_arg","")},b=function(k){if(typeof k.length==="number")return Math.max(Math.min(k.length,1024),0);return 0};M=function(k,p,z0,v,u,c){var r=Math.max(0,b(v)-1),q0=j(r),w0=typeof k==="string"||p===z;function M0(r0){var I1=x(r0).join(", "),m=r0>0?", ":"",B0;if(w0)B0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else B0=p===void 0?`ret = callback({{args}}, nodeback); break;
`.replace("%s",c))}}}function D(y,c,$0,R){var u=q.inheritedDataKeys(y),p=[];for(var s=0;s<u.length;++s){var U0=u[s],H0=y[U0],D0=R===X?!0:X(U0,H0,y);if(typeof H0==="function"&&!L(H0)&&!O(y,U0,c)&&R(U0,H0,y,D0))p.push(U0,H0)}return F(p,c,$0),p}var P=function(y){return y.replace(/([$])/,"\\$")},A,T=function(y){var c=[y],$0=Math.max(0,y-1-3);for(var R=y-1;R>=$0;--R)c.push(R);for(var R=y+1;R<=3;++R)c.push(R);return c},k=function(y){return q.filledRange(y,"_arg","")},h=function(y){return q.filledRange(Math.max(y,3),"_arg","")},f=function(y){if(typeof y.length==="number")return Math.max(Math.min(y.length,1024),0);return 0};A=function(y,c,$0,R,u,p){var s=Math.max(0,f(R)-1),U0=T(s),H0=typeof y==="string"||c===z;function D0(r0){var I1=k(r0).join(", "),o=r0>0?", ":"",E0;if(H0)E0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else E0=c===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return B0.replace("{{args}}",I1).replace(", ",m)}function R0(){var r0="";for(var I1=0;I1<q0.length;++I1)r0+="case "+q0[I1]+":"+M0(q0[I1]);return r0+=`
`;return E0.replace("{{args}}",I1).replace(", ",o)}function _0(){var r0="";for(var I1=0;I1<U0.length;++I1)r0+="case "+U0[I1]+":"+D0(U0[I1]);return r0+=`
default:
var args = new Array(len + 1);
var i = 0;
@@ -239,15 +239,15 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof l4))r
args[i] = nodeback;
[CodeForCall]
break;
`.replace("[CodeForCall]",w0?`ret = callback.apply(this, args);
`.replace("[CodeForCall]",H0?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),r0}var U1=typeof k==="string"?"this != null ? this['"+k+"'] : fn":"fn",x0=`'use strict';
`),r0}var Y1=typeof y==="string"?"this != null ? this['"+y+"'] : fn":"fn",u0=`'use strict';
var ret = function (Parameters) {
'use strict';
var len = arguments.length;
var promise = new Promise(INTERNAL);
promise._captureStackTrace();
var nodeback = nodebackForPromise(promise, `+c+`);
var nodeback = nodebackForPromise(promise, `+p+`);
var ret;
var callback = tryCatch([GetFunctionCode]);
switch(len) {
@@ -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]",R0()).replace("[GetFunctionCode]",U1);return x0=x0.replace("Parameters",h(r)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",x0)($,v,p,Y,J,U,q.tryCatch,q.errorObj,q.notEnumerableProp,I)};function R(k,p,z0,v,u,c){var r=function(){return this}(),q0=k;if(typeof q0==="string")k=v;function w0(){var M0=p;if(p===z)M0=this;var R0=new $(I);R0._captureStackTrace();var U1=typeof q0==="string"&&this!==r?this[q0]:k,x0=U(R0,c);try{U1.apply(M0,Y(arguments,x0))}catch(r0){R0._rejectCallback(J(r0),!0,!0)}if(!R0._isFateSealed())R0._setAsyncGuaranteed();return R0}return q.notEnumerableProp(w0,"__isPromisified__",!0),w0}var f=Q?M:R;function n(k,p,z0,v,u){var c=new RegExp(T(p)+"$"),r=A(k,p,c,z0);for(var q0=0,w0=r.length;q0<w0;q0+=2){var M0=r[q0],R0=r[q0+1],U1=M0+p;if(v===f)k[U1]=f(M0,z,M0,R0,p,u);else{var x0=v(R0,function(){return f(M0,z,M0,R0,p,u)});q.notEnumerableProp(x0,"__isPromisified__",!0),k[U1]=x0}}return q.toFastProperties(k),k}function C(k,p,z0){return f(k,p,void 0,k,null,z0)}$.promisify=function(k,p){if(typeof k!=="function")throw new K("expecting a function but got "+q.classString(k));if(L(k))return k;p=Object(p);var z0=p.context===void 0?z:p.context,v=!!p.multiArgs,u=C(k,z0,v);return q.copyDescriptors(k,u,X),u},$.promisifyAll=function(k,p){if(typeof k!=="function"&&typeof k!=="object")throw new K(`the target of promisifyAll must be an object or a function
`.replace("[CodeForSwitchCase]",_0()).replace("[GetFunctionCode]",Y1);return u0=u0.replace("Parameters",h(s)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",u0)($,R,c,Y,J,U,q.tryCatch,q.errorObj,q.notEnumerableProp,I)};function C(y,c,$0,R,u,p){var s=function(){return this}(),U0=y;if(typeof U0==="string")y=R;function H0(){var D0=c;if(c===z)D0=this;var _0=new $(I);_0._captureStackTrace();var Y1=typeof U0==="string"&&this!==s?this[U0]:y,u0=U(_0,p);try{Y1.apply(D0,Y(arguments,u0))}catch(r0){_0._rejectCallback(J(r0),!0,!0)}if(!_0._isFateSealed())_0._setAsyncGuaranteed();return _0}return q.notEnumerableProp(H0,"__isPromisified__",!0),H0}var b=Q?A:C;function i(y,c,$0,R,u){var p=new RegExp(P(c)+"$"),s=D(y,c,p,$0);for(var U0=0,H0=s.length;U0<H0;U0+=2){var D0=s[U0],_0=s[U0+1],Y1=D0+c;if(R===b)y[Y1]=b(D0,z,D0,_0,c,u);else{var u0=R(_0,function(){return b(D0,z,D0,_0,c,u)});q.notEnumerableProp(u0,"__isPromisified__",!0),y[Y1]=u0}}return q.toFastProperties(y),y}function v(y,c,$0){return b(y,c,void 0,y,null,$0)}$.promisify=function(y,c){if(typeof y!=="function")throw new K("expecting a function but got "+q.classString(y));if(L(y))return y;c=Object(c);var $0=c.context===void 0?z:c.context,R=!!c.multiArgs,u=v(y,$0,R);return q.copyDescriptors(y,u,w),u},$.promisifyAll=function(y,c){if(typeof y!=="function"&&typeof y!=="object")throw new K(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);p=Object(p);var z0=!!p.multiArgs,v=p.suffix;if(typeof v!=="string")v=w;var u=p.filter;if(typeof u!=="function")u=V;var c=p.promisifier;if(typeof c!=="function")c=f;if(!q.isIdentifier(v))throw RangeError(`suffix must be a valid identifier
`);c=Object(c);var $0=!!c.multiArgs,R=c.suffix;if(typeof R!=="string")R=H;var u=c.filter;if(typeof u!=="function")u=X;var p=c.promisifier;if(typeof p!=="function")p=b;if(!q.isIdentifier(R))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var r=q.inheritedDataKeys(k);for(var q0=0;q0<r.length;++q0){var w0=k[r[q0]];if(r[q0]!=="constructor"&&q.isClass(w0))n(w0.prototype,v,u,c,z0),n(w0,v,u,c,z0)}return n(k,v,u,c,z0)}}});var qG0=N((ju1,zG0)=>{zG0.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,O){this[W]=L,this[W+V]=O,W++}return function(O){V=O.size,W=0;var D=Array(O.size*2);return O.forEach(X,D),D}}(),w=function(W){var V=new Q,X=W.length/2|0;for(var L=0;L<X;++L){var O=W[X+L],D=W[L];V.set(O,D)}return V};function H(W){var V=!1,X;if(Q!==void 0&&W instanceof Q)X=K(W),V=!0;else{var L=J.keys(W),O=L.length;X=Array(O*2);for(var D=0;D<O;++D){var A=L[D];X[D]=W[A],X[D+O]=A}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}U.inherits(H,I),H.prototype._init=function(){},H.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 O=this.length();for(var D=0,A=this.length();D<A;++D)L[this._values[D+O]]=this._values[D]}return this._resolve(L),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(W){return W>>1};function G(W){var V,X=z(W);if(!Y(X))return q(`cannot await properties of a non-object
`);var s=q.inheritedDataKeys(y);for(var U0=0;U0<s.length;++U0){var H0=y[s[U0]];if(s[U0]!=="constructor"&&q.isClass(H0))i(H0.prototype,R,u,p,$0),i(H0,R,u,p,$0)}return i(y,R,u,p,$0)}}});var qF0=M((Y54,zF0)=>{zF0.exports=function($,I,z,q){var U=q4(),Y=U.isObject,J=hI(),Q;if(typeof Map==="function")Q=Map;var K=function(){var W=0,X=0;function w(L,O){this[W]=L,this[W+X]=O,W++}return function(O){X=O.size,W=0;var F=Array(O.size*2);return O.forEach(w,F),F}}(),H=function(W){var X=new Q,w=W.length/2|0;for(var L=0;L<w;++L){var O=W[w+L],F=W[L];X.set(O,F)}return X};function G(W){var X=!1,w;if(Q!==void 0&&W instanceof Q)w=K(W),X=!0;else{var L=J.keys(W),O=L.length;w=Array(O*2);for(var F=0;F<O;++F){var D=L[F];w[F]=W[D],w[F+O]=D}}this.constructor$(w),this._isMap=X,this._init$(void 0,-3)}U.inherits(G,I),G.prototype._init=function(){},G.prototype._promiseFulfilled=function(W,X){this._values[X]=W;var w=++this._totalResolved;if(w>=this._length){var L;if(this._isMap)L=H(this._values);else{L={};var O=this.length();for(var F=0,D=this.length();F<D;++F)L[this._values[F+O]]=this._values[F]}return this._resolve(L),!0}return!1},G.prototype.shouldCopyValues=function(){return!1},G.prototype.getActualLength=function(W){return W>>1};function Z(W){var X,w=z(W);if(!Y(w))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 H(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return G(this)},$.props=function(W){return G(W)}}});var YG0=N((vu1,UG0)=>{UG0.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 H=new $(I);if(K!==void 0)H._propagateFrom(K,3);var{_fulfill:G,_reject:W}=H;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(G,W,void 0,H,null)}return H}$.race=function(Q){return J(Q,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var QG0=N((Ru1,JG0)=>{JG0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=r1(),K=Q.tryCatch;function w(X,L,O,D){this.constructor$(X);var A=J();if(this._fn=A===null?L:Q.domainBind(A,L),O!==void 0)O=$.resolve(O),O._attachCancellationCallback(this);if(this._initialValue=O,this._currentCancellable=null,D===U)this._eachValues=Array(this._length);else if(D===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,O,D=X.length;if(this._initialValue!==void 0)L=this._initialValue,O=0;else L=$.resolve(X[0]),O=1;if(this._currentCancellable=L,!L.isRejected())for(;O<D;++O){var A={accum:null,value:X[O],index:O,length:D,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(H,H,void 0,L,this)},$.prototype.reduce=function(X,L){return G(this,X,L,null)},$.reduce=function(X,L,O,D){return G(X,L,O,D)};function H(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function G(X,L,O,D){if(typeof L!=="function")return z("expecting a function but got "+Q.classString(L));var A=new w(X,L,O,D);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,O=L._promise,D=K(L._fn);O._pushContext();var A;if(L._eachValues!==void 0)A=D.call(O._boundValue(),X,this.index,this.length);else A=D.call(O._boundValue(),this.accum,X,this.index,this.length);if(A instanceof $)L._currentCancellable=A;var T=O._popContext();return Y.checkForgottenReturns(A,T,L._eachValues!==void 0?"Promise.each":"Promise.reduce",O),A}}});var wG0=N((gu1,KG0)=>{KG0.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 GG0=N((_u1,HG0)=>{HG0.exports=function($,I,z){var q=r1(),U=z9().RangeError,Y=z9().AggregateError,J=q.isArray,Q={};function K(H){this.constructor$(H),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 H=J(this._values);if(!this._isResolved()&&H&&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(H){this._howMany=H},K.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
`);else if(w instanceof $)X=w._then($.props,void 0,void 0,void 0,void 0);else X=new G(w).promise();if(w instanceof $)X._propagateFrom(w,2);return X}$.prototype.props=function(){return Z(this)},$.props=function(W){return Z(W)}}});var YF0=M((J54,UF0)=>{UF0.exports=function($,I,z,q){var U=q4(),Y=function(Q){return Q.then(function(K){return J(K,Q)})};function J(Q,K){var H=z(Q);if(H instanceof $)return Y(H);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:Z,_reject:W}=G;for(var X=0,w=Q.length;X<w;++X){var L=Q[X];if(L===void 0&&!(X in Q))continue;$.cast(L)._then(Z,W,void 0,G,null)}return G}$.race=function(Q){return J(Q,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var QF0=M((Q54,JF0)=>{JF0.exports=function($,I,z,q,U,Y){var J=$._getDomain,Q=q4(),K=Q.tryCatch;function H(w,L,O,F){this.constructor$(w);var D=J();if(this._fn=D===null?L:Q.domainBind(D,L),O!==void 0)O=$.resolve(O),O._attachCancellationCallback(this);if(this._initialValue=O,this._currentCancellable=null,F===U)this._eachValues=Array(this._length);else if(F===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}Q.inherits(H,I),H.prototype._gotAccum=function(w){if(this._eachValues!==void 0&&this._eachValues!==null&&w!==U)this._eachValues.push(w)},H.prototype._eachComplete=function(w){if(this._eachValues!==null)this._eachValues.push(w);return this._eachValues},H.prototype._init=function(){},H.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},H.prototype.shouldCopyValues=function(){return!1},H.prototype._resolve=function(w){this._promise._resolveCallback(w),this._values=null},H.prototype._resultCancelled=function(w){if(w===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},H.prototype._iterate=function(w){this._values=w;var L,O,F=w.length;if(this._initialValue!==void 0)L=this._initialValue,O=0;else L=$.resolve(w[0]),O=1;if(this._currentCancellable=L,!L.isRejected())for(;O<F;++O){var D={accum:null,value:w[O],index:O,length:F,array:this};L=L._then(W,void 0,void 0,D,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(w,L){return Z(this,w,L,null)},$.reduce=function(w,L,O,F){return Z(w,L,O,F)};function G(w,L){if(this.isFulfilled())L._resolve(w);else L._reject(w)}function Z(w,L,O,F){if(typeof L!=="function")return z("expecting a function but got "+Q.classString(L));var D=new H(w,L,O,F);return D.promise()}function W(w){this.accum=w,this.array._gotAccum(w);var L=q(this.value,this.array._promise);if(L instanceof $)return this.array._currentCancellable=L,L._then(X,void 0,void 0,this,void 0);else return X.call(this,L)}function X(w){var L=this.array,O=L._promise,F=K(L._fn);O._pushContext();var D;if(L._eachValues!==void 0)D=F.call(O._boundValue(),w,this.index,this.length);else D=F.call(O._boundValue(),this.accum,w,this.index,this.length);if(D instanceof $)L._currentCancellable=D;var P=O._popContext();return Y.checkForgottenReturns(D,P,L._eachValues!==void 0?"Promise.each":"Promise.reduce",O),D}}});var HF0=M((K54,KF0)=>{KF0.exports=function($,I,z){var q=$.PromiseInspection,U=q4();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 ZF0=M((H54,GF0)=>{GF0.exports=function($,I,z){var q=q4(),U=d9().RangeError,Y=d9().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(H),V=W.promise();return W.setHowMany(G),W.init(),V}$.some=function(H,G){return w(H,G)},$.prototype.some=function(H){return w(this,H)},$._SomePromiseArray=K}});var VG0=N((Cu1,WG0)=>{WG0.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 XG0=N((hu1,ZG0)=>{ZG0.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 OG0=N((Su1,LG0)=>{LG0.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 DG0=N((yu1,Ey)=>{Ey.exports=function(){var $=function(){return new G(`circular promise resolution chain
`);var W=new K(G),X=W.promise();return W.setHowMany(Z),W.init(),X}$.some=function(G,Z){return H(G,Z)},$.prototype.some=function(G){return H(this,G)},$._SomePromiseArray=K}});var XF0=M((G54,WF0)=>{WF0.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 wF0=M((Z54,VF0)=>{VF0.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 OF0=M((W54,LF0)=>{LF0.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 FF0=M((X54,Rf)=>{Rf.exports=function(){var $=function(){return new Z(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},I=function(){return new C.PromiseInspection(this._target())},z=function(v){return C.reject(new G(v))};function q(){}var U={},Y=r1(),J;if(Y.isNode)J=function(){var v=process.domain;if(v===void 0)v=null;return v};else J=function(){return null};Y.notEnumerableProp(C,"_getDomain",J);var Q=MI(),K=GH0(),w=new K;Q.defineProperty(C,"_async",{value:w});var H=z9(),G=C.TypeError=H.TypeError;C.RangeError=H.RangeError;var W=C.CancellationError=H.CancellationError;C.TimeoutError=H.TimeoutError,C.OperationalError=H.OperationalError,C.RejectionError=H.OperationalError,C.AggregateError=H.AggregateError;var V=function(){},X={},L={},O=LH0()(C,V),D=DH0()(C,V,O,z,q),A=FH0()(C),T=A.create,M=AH0()(C,A),j=M.CapturedTrace,x=TH0()(C,O),h=BH0()(L),b=Py(),R=Y.errorObj,f=Y.tryCatch;function n(v,u){if(typeof u!=="function")throw new G("expecting a function but got "+Y.classString(u));if(v.constructor!==C)throw new G(`the promise constructor cannot be invoked directly
`)},I=function(){return new v.PromiseInspection(this._target())},z=function(R){return v.reject(new Z(R))};function q(){}var U={},Y=q4(),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(v,"_getDomain",J);var Q=hI(),K=ZO0(),H=new K;Q.defineProperty(v,"_async",{value:H});var G=d9(),Z=v.TypeError=G.TypeError;v.RangeError=G.RangeError;var W=v.CancellationError=G.CancellationError;v.TimeoutError=G.TimeoutError,v.OperationalError=G.OperationalError,v.RejectionError=G.OperationalError,v.AggregateError=G.AggregateError;var X=function(){},w={},L={},O=LO0()(v,X),F=FO0()(v,X,O,z,q),D=NO0()(v),P=D.create,A=AO0()(v,D),T=A.CapturedTrace,k=BO0()(v,O),h=EO0()(L),f=Cf(),C=Y.errorObj,b=Y.tryCatch;function i(R,u){if(typeof u!=="function")throw new Z("expecting a function but got "+Y.classString(u));if(R.constructor!==v)throw new Z(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function C(v){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,v!==V)n(this,v),this._resolveFromExecutor(v);this._promiseCreated(),this._fireEvent("promiseCreated",this)}C.prototype.toString=function(){return"[object Promise]"},C.prototype.caught=C.prototype.catch=function(v){var u=arguments.length;if(u>1){var c=Array(u-1),r=0,q0;for(q0=0;q0<u-1;++q0){var w0=arguments[q0];if(Y.isObject(w0))c[r++]=w0;else return z("expecting an object but got A catch statement predicate "+Y.classString(w0))}return c.length=r,v=arguments[q0],this.then(void 0,h(c,v,this))}return this.then(void 0,v)},C.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},C.prototype.then=function(v,u){if(M.warnings()&&arguments.length>0&&typeof v!=="function"&&typeof u!=="function"){var c=".then() only accepts functions but was passed: "+Y.classString(v);if(arguments.length>1)c+=", "+Y.classString(u);this._warn(c)}return this._then(v,u,void 0,void 0,void 0)},C.prototype.done=function(v,u){var c=this._then(v,u,void 0,void 0,void 0);c._setIsFinal()},C.prototype.spread=function(v){if(typeof v!=="function")return z("expecting a function but got "+Y.classString(v));return this.all()._then(v,void 0,void 0,X,void 0)},C.prototype.toJSON=function(){var v={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())v.fulfillmentValue=this.value(),v.isFulfilled=!0;else if(this.isRejected())v.rejectionReason=this.reason(),v.isRejected=!0;return v},C.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new D(this).promise()},C.prototype.error=function(v){return this.caught(Y.originatesFromRejection,v)},C.getNewLibraryCopy=Ey.exports,C.is=function(v){return v instanceof C},C.fromNode=C.fromCallback=function(v){var u=new C(V);u._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=f(v)(b(u,c));if(r===R)u._rejectCallback(r.e,!0);if(!u._isFateSealed())u._setAsyncGuaranteed();return u},C.all=function(v){return new D(v).promise()},C.cast=function(v){var u=O(v);if(!(u instanceof C))u=new C(V),u._captureStackTrace(),u._setFulfilled(),u._rejectionHandler0=v;return u},C.resolve=C.fulfilled=C.cast,C.reject=C.rejected=function(v){var u=new C(V);return u._captureStackTrace(),u._rejectCallback(v,!0),u},C.setScheduler=function(v){if(typeof v!=="function")throw new G("expecting a function but got "+Y.classString(v));return w.setScheduler(v)},C.prototype._then=function(v,u,c,r,q0){var w0=q0!==void 0,M0=w0?q0:new C(V),R0=this._target(),U1=R0._bitField;if(!w0){if(M0._propagateFrom(this,3),M0._captureStackTrace(),r===void 0&&(this._bitField&2097152)!==0)if((U1&50397184)!==0)r=this._boundValue();else r=R0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,M0)}var x0=J();if((U1&50397184)!==0){var r0,I1,m=R0._settlePromiseCtx;if((U1&33554432)!==0)I1=R0._rejectionHandler0,r0=v;else if((U1&16777216)!==0)I1=R0._fulfillmentHandler0,r0=u,R0._unsetRejectionIsUnhandled();else m=R0._settlePromiseLateCancellationObserver,I1=new W("late cancellation observer"),R0._attachExtraTrace(I1),r0=u;w.invoke(m,R0,{handler:x0===null?r0:typeof r0==="function"&&Y.domainBind(x0,r0),promise:M0,receiver:r,value:I1})}else R0._addCallbacks(v,u,M0,r,x0);return M0},C.prototype._length=function(){return this._bitField&65535},C.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},C.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},C.prototype._setLength=function(v){this._bitField=this._bitField&-65536|v&65535},C.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},C.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},C.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},C.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},C.prototype._isFinal=function(){return(this._bitField&4194304)>0},C.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},C.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},C.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},C.prototype._setAsyncGuaranteed=function(){if(w.hasCustomScheduler())return;this._bitField=this._bitField|134217728},C.prototype._receiverAt=function(v){var u=v===0?this._receiver0:this[v*4-4+3];if(u===U)return;else if(u===void 0&&this._isBound())return this._boundValue();return u},C.prototype._promiseAt=function(v){return this[v*4-4+2]},C.prototype._fulfillmentHandlerAt=function(v){return this[v*4-4+0]},C.prototype._rejectionHandlerAt=function(v){return this[v*4-4+1]},C.prototype._boundValue=function(){},C.prototype._migrateCallback0=function(v){var{_bitFie Line truncated
`)}function v(R){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,R!==X)i(this,R),this._resolveFromExecutor(R);this._promiseCreated(),this._fireEvent("promiseCreated",this)}v.prototype.toString=function(){return"[object Promise]"},v.prototype.caught=v.prototype.catch=function(R){var u=arguments.length;if(u>1){var p=Array(u-1),s=0,U0;for(U0=0;U0<u-1;++U0){var H0=arguments[U0];if(Y.isObject(H0))p[s++]=H0;else return z("expecting an object but got A catch statement predicate "+Y.classString(H0))}return p.length=s,R=arguments[U0],this.then(void 0,h(p,R,this))}return this.then(void 0,R)},v.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},v.prototype.then=function(R,u){if(A.warnings()&&arguments.length>0&&typeof R!=="function"&&typeof u!=="function"){var p=".then() only accepts functions but was passed: "+Y.classString(R);if(arguments.length>1)p+=", "+Y.classString(u);this._warn(p)}return this._then(R,u,void 0,void 0,void 0)},v.prototype.done=function(R,u){var p=this._then(R,u,void 0,void 0,void 0);p._setIsFinal()},v.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,w,void 0)},v.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},v.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new F(this).promise()},v.prototype.error=function(R){return this.caught(Y.originatesFromRejection,R)},v.getNewLibraryCopy=Rf.exports,v.is=function(R){return R instanceof v},v.fromNode=v.fromCallback=function(R){var u=new v(X);u._captureStackTrace();var p=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,s=b(R)(f(u,p));if(s===C)u._rejectCallback(s.e,!0);if(!u._isFateSealed())u._setAsyncGuaranteed();return u},v.all=function(R){return new F(R).promise()},v.cast=function(R){var u=O(R);if(!(u instanceof v))u=new v(X),u._captureStackTrace(),u._setFulfilled(),u._rejectionHandler0=R;return u},v.resolve=v.fulfilled=v.cast,v.reject=v.rejected=function(R){var u=new v(X);return u._captureStackTrace(),u._rejectCallback(R,!0),u},v.setScheduler=function(R){if(typeof R!=="function")throw new Z("expecting a function but got "+Y.classString(R));return H.setScheduler(R)},v.prototype._then=function(R,u,p,s,U0){var H0=U0!==void 0,D0=H0?U0:new v(X),_0=this._target(),Y1=_0._bitField;if(!H0){if(D0._propagateFrom(this,3),D0._captureStackTrace(),s===void 0&&(this._bitField&2097152)!==0)if((Y1&50397184)!==0)s=this._boundValue();else s=_0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,D0)}var u0=J();if((Y1&50397184)!==0){var r0,I1,o=_0._settlePromiseCtx;if((Y1&33554432)!==0)I1=_0._rejectionHandler0,r0=R;else if((Y1&16777216)!==0)I1=_0._fulfillmentHandler0,r0=u,_0._unsetRejectionIsUnhandled();else o=_0._settlePromiseLateCancellationObserver,I1=new W("late cancellation observer"),_0._attachExtraTrace(I1),r0=u;H.invoke(o,_0,{handler:u0===null?r0:typeof r0==="function"&&Y.domainBind(u0,r0),promise:D0,receiver:s,value:I1})}else _0._addCallbacks(R,u,D0,s,u0);return D0},v.prototype._length=function(){return this._bitField&65535},v.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},v.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},v.prototype._setLength=function(R){this._bitField=this._bitField&-65536|R&65535},v.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},v.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},v.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},v.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},v.prototype._isFinal=function(){return(this._bitField&4194304)>0},v.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},v.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},v.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},v.prototype._setAsyncGuaranteed=function(){if(H.hasCustomScheduler())return;this._bitField=this._bitField|134217728},v.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},v.prototype._promiseAt=function(R){return this[R*4-4+2]},v.prototype._fulfillmentHandlerAt=function(R){return this[R*4-4+0]},v.prototype._rejectionHandlerAt=function(R){return this[R*4-4+1]},v.prototype._boundValue=function(){},v.prototype._migrateCallback0=function(R){var{_bitFie 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=aW0($,I,this);if(z)throw q;else this.emit("error",q)};function aW0($,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=N((Gx1,eW0)=>{eW0.exports=MK1;function MK1($){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 Gu=N((Wx1,$V0)=>{$V0.exports=uK;var AK1=X$(),PK1=l0(),Hu=gI();PK1(uK,Hu);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);Hu.call(I,$)}uK.prototype._stat=function($){var I=this;AK1.readlink(I._path,function(z,q){if(z)return I.error(z);I.linkpath=I.props.linkpath=q,I.emit("linkpath",q),Hu.prototype._stat.call(I,$)})};uK.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Vu=N((Vx1,qV0)=>{qV0.exports=V5;var zV0=X$(),TK1=l0(),xK=a("path"),Wu=gI(),IV0=a("assert").ok;TK1(V5,Wu);function V5($){var I=this;if(!(I instanceof V5))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,$)}V5.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,zV0.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()}})};V5.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]);IV0(I!==$._path),IV0($.entries[$._index]),$._currentEntry=I,zV0[$.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))})})};V5.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};V5.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}};V5.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",$)};V5.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()};V5.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var Zu=N((Zx1,QV0)=>{QV0.exports=_I;var EK1=X$(),BK1=l0(),UV0=gI(),YV0={EOF:!0},JV0={CLOSE:!0};BK1(_I,UV0);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,UV0.call(I,$)}_I.prototype._getStream=function(){var $=this,I=$._stream=EK1.createReadStream($._path,$.pro Line truncated
`));else z.emit("warn",q)};u7.prototype.info=function($,I){this.emit("info",$,I)};u7.prototype.error=function($,I,z){var q=tM0($,I,this);if(z)throw q;else this.emit("error",q)};function tM0($,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 lG=M((c54,eM0)=>{eM0.exports=rA1;function rA1($){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 Ob=M((p54,$N0)=>{$N0.exports=oG;var sA1=b8(),tA1=n0(),Lb=iI();tA1(oG,Lb);function oG($){var I=this;if(!(I instanceof oG))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);Lb.call(I,$)}oG.prototype._stat=function($){var I=this;sA1.readlink(I._path,function(z,q){if(z)return I.error(z);I.linkpath=I.props.linkpath=q,I.emit("linkpath",q),Lb.prototype._stat.call(I,$)})};oG.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Mb=M((d54,qN0)=>{qN0.exports=s5;var zN0=b8(),aA1=n0(),rG=d("path"),Fb=iI(),IN0=d("assert").ok;aA1(s5,Fb);function s5($){var I=this;if(!(I instanceof s5))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;Fb.call(this,$)}s5.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,zN0.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()}})};s5.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=rG.resolve($._path,$.entries[$._index]);IN0(I!==$._path),IN0($.entries[$._index]),$._currentEntry=I,zN0[$.props.follow?"stat":"lstat"](I,function(z,q){if(z)return $.error(z);var U=$._proxy||$;q.path=I,q.basename=rG.basename(I),q.dirname=rG.dirname(I);var Y=$.getChildProps.call(U,q);Y.path=I,Y.basename=rG.basename(I),Y.dirname=rG.dirname(I);var J=Fb(Y,q);$._currentEntry=J,J.on("pause",function(H){if(!$._paused&&!J._disowned)$.pause(H)}),J.on("resume",function(H){if($._paused&&!J._disowned)$.resume(H)}),J.on("stat",function(H){if($.emit("_entryStat",J,H),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,H)});else $.emit("entryStat",J,H)}),J.on("ready",function H(){if($._paused)return J.pause($),$.once("resume",H);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var 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(H){if(J._swallowErrors)$.warn(H),J.emit("end"),J.emit("close");else $.emit("error",H)}),["child","childEnd","warn"].forEach(function(H){J.on(H,$.emit.bind($,H))})})};s5.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};s5.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}};s5.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",$)};s5.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()};s5.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var Nb=M((m54,QN0)=>{QN0.exports=nI;var eA1=b8(),$P1=n0(),UN0=iI(),YN0={EOF:!0},JN0={CLOSE:!0};$P1(nI,UN0);function nI($){var I=this;if(!(I instanceof nI))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,UN0.call(I,$)}nI.prototype._getStream=function(){var $=this,I=$._stream=eA1.createReadStream($._path,$.pro Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(JV0),$._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===YV0)$.emit("end");else if(U===JV0)$.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 HV0=N((Xx1,wV0)=>{wV0.exports=EO;var jK1=l0(),KV0=gI();jK1(EO,KV0);function EO($){var I=this;if(!(I instanceof EO))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);KV0.call(I,$)}EO.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Lu=N((Lx1,GV0)=>{GV0.exports=CI;var Xu=gI(),vK1=yK(),RK1=l0(),gK1=X$();RK1(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";gK1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=vK1(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=N((Ox1,ZV0)=>{ZV0.exports=h8;var _K1=X$(),CK1=a("stream").Stream,hK1=l0(),Ou=a("path"),Du=yK(),BO=h8.hardLinks={},WV0=TO();hK1(h8,WV0);var VV0=Gu();function h8($,I){var z=this;if(!(z instanceof h8))return new h8($,I);if(typeof $==="string")$={path:$};var q,U;if($.type&&typeof $.type==="function")q=$.type,U=q;else q=Du($),U=h8;if(I&&!q)q=Du(I),$[q]=!0,$.type=q;switch(q){case"Directory":U=Vu();break;case"Link":case"File":U=Zu();break;case"SymbolicLink":U=VV0;break;case"Socket":U=HV0();break;case null:U=Lu();break}if(!(z instanceof U))return new U($);if(WV0.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=Ou.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=Ou.basename(z.path),z.dirname=$.dirname=Ou.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=SK1;z._stat(I)}function SK1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}h8.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else _K1[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=Du(z),K=z.hardlinks!==!1;if(K&&Q!=="Directory"&&z.nlink&&z.nlink>1){var w=z.dev+":"+z.ino;if(BO[w]===I._path||!BO[w])BO[w]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=BO[w],I._stat=I._read=VV0.prototype._read}if(I.type&&I.type!==Q)I.error("Unexpected type: "+Q);if(I.filter){var H=I._proxy||I;if(!I.filter.call(H,H,z)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var G=["_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=G[W++];if(!X)return I._read();I.emit(X,z),V()})()}};h8.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 CK1.prototype.pipe.apply(this,arguments)};h8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};h8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};h8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Au=N((Dx1,AV0)=>{A Line truncated
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(JN0),$._read();else $.emit("close")}),I.on("error",function(z){$.emit("error",z)}),$._read()};nI.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===YN0)$.emit("end");else if(U===JN0)$.emit("close");else $.emit("data",U);if($._paused){$._buffer=I.slice(z);return}}$._buffer.length=0}};nI.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};nI.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 GN0=M((l54,HN0)=>{HN0.exports=AN;var IP1=n0(),KN0=iI();IP1(AN,KN0);function AN($){var I=this;if(!(I instanceof AN))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);KN0.call(I,$)}AN.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Ab=M((o54,ZN0)=>{ZN0.exports=cI;var Db=iI(),zP1=lG(),qP1=n0(),UP1=b8();qP1(cI,Db);function cI($){var I=this;if(!(I instanceof cI))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,Db.call(I,$)}cI.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";UP1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=zP1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Db(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 iI=M((r54,VN0)=>{VN0.exports=Z5;var YP1=b8(),JP1=d("stream").Stream,QP1=n0(),Pb=d("path"),Bb=lG(),PN=Z5.hardLinks={},WN0=DN();QP1(Z5,WN0);var XN0=Ob();function Z5($,I){var z=this;if(!(z instanceof Z5))return new Z5($,I);if(typeof $==="string")$={path:$};var q,U;if($.type&&typeof $.type==="function")q=$.type,U=q;else q=Bb($),U=Z5;if(I&&!q)q=Bb(I),$[q]=!0,$.type=q;switch(q){case"Directory":U=Mb();break;case"Link":case"File":U=Nb();break;case"SymbolicLink":U=XN0;break;case"Socket":U=GN0();break;case null:U=Ab();break}if(!(z instanceof U))return new U($);if(WN0.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=Pb.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=Pb.basename(z.path),z.dirname=$.dirname=Pb.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=KP1;z._stat(I)}function KP1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}Z5.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else YP1[q](I._path,U);function U(Y,J){if(Y)return I.error(Y);if(Object.keys(J).forEach(function(X){z[X]=J[X]}),I.size!==void 0&&z.size!==I.size)return I.error("incorrect size");I.size=z.size;var Q=Bb(z),K=z.hardlinks!==!1;if(K&&Q!=="Directory"&&z.nlink&&z.nlink>1){var H=z.dev+":"+z.ino;if(PN[H]===I._path||!PN[H])PN[H]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=PN[H],I._stat=I._read=XN0.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 Z=["_stat","stat","ready"],W=0;(function X(){if(I._aborted){I.emit("end"),I.emit("close");return}if(I._paused&&I.type!=="Directory"){I.once("resume",X);return}var w=Z[W++];if(!w)return I._read();I.emit(w,z),X()})()}};Z5.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 JP1.prototype.pipe.apply(this,arguments)};Z5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};Z5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};Z5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Cb=M((s54,AN0)=>{A Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);xO.prototype._finish.call($)}});var hu=N((ux1,GZ0)=>{GZ0.exports=i7;var Cu=dU(),Qw1=yK(),Kw1=l0(),ww1=yO(),Hw1=a("fs");Kw1(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";Hw1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=Qw1(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(ww1($),!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=N((xx1,FZ0)=>{FZ0.exports=J8;var Y8=X$(),Gw1=l0(),Ww1=Au(),Vw1=ju(),nK=a("path"),VZ0=process.platform==="win32"?0:process.umask(),ZZ0=yK(),XZ0=TO();Gw1(J8,XZ0);J8.dirmode=parseInt("0777",8)&~VZ0;J8.filemode=parseInt("0666",8)&~VZ0;var Zw1=Ru(),Xw1=gu(),Lw1=_u(),Ow1=hu();function J8($,I){var z=this;if(typeof $==="string")$={path:$};var q=ZZ0($),U=J8;switch(q){case"Directory":U=Zw1;break;case"File":U=Lw1;break;case"Link":case"SymbolicLink":U=Xw1;break;case null:default:U=Ow1;break}if(!(z instanceof U))return new U($);if(XZ0.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=ZZ0(Q);if(K!==I.type||I.type==="File"&&Q.nlink>1)return Ww1(I._path,function(w){if(w)return I.error(w);I._old=null,Su(I)});Su(I)}};function Su($){Vw1(nK.dirname($._path),J8.dirmode,function(I,z){if(I)return $.error(I);return $._madeDir=z,$._create()})}function LZ0($,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 OZ0($,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 DZ0($,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(!WZ0(K))K=new Date(K);if(!WZ0(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,LZ0($,$.props,Q,$._path,J("chmod")),OZ0($,$.props,Q,$._path,J("chown")),DZ0($,$.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 NZ0($,$._path,w);function w(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function NZ0($,I,z){var q=$._madeDir,U=nK.dirname(I);Dw1($,U,function(Y){if(Y)return z(Y);if(U===q)return z();NZ0($,U,z)})}function Dw1($,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);LZ0($,q,K,I,J),OZ0($,q,K,I,J),DZ0($,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 Nw1($){return Object.prototype.toString.call($)}function WZ0($){return typeof $==="object"&&Nw1($)==="[object Date]"}});var fu=N((Fw1)=>{Fw1.Abstract=TO();Fw1.Reader=gI();Fw1.Writer=dU();Fw1.File={Reader:Zu(),Writer:_u()};Fw1.Dir={Reader:Vu(),Writer:Ru()};Fw1.Link={Reader:Gu(),Writer:gu()};Fw1.Proxy={Reader:Lu(),Writer:hu()};Fw1.Reader.Dir=Fw1.DirReader=Fw1.Dir.Reader;Fw1.Reader.File=Fw1.FileReader=Fw1.File.Reader;Fw1.Reader.Link=Fw1.LinkReader=Fw1.Link.Reader;Fw1.Reader.Proxy=Fw1.ProxyReader=Fw1.Proxy.Reader;Fw1.Writer.Dir=Fw1.DirWriter=Fw1.Dir.Writer;Fw1.Writer.File=Fw1.FileWriter=Fw1.File.Writer;Fw1.Writer.Link=Fw1.LinkWriter=Fw1.Link.Writer;Fw1.Writer.Proxy=Fw1.ProxyWriter=Fw1.Proxy.Writer;Fw1.collect=yO()});var AZ0=N((lx1,MZ0)=>{MZ0.exports=vw1;var Pw1=XO(),Tw1=fu().Writer,bu=a("path"),Ew1=a("stream"),Bw1=Ku(),jw1=y7();function vw1($){$.path=bu.resolve(bu.normalize($.path));var I=new Pw1($),z=new Ew1.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}):Tw1({path:Q});U.pipe(K).on("error",J).on("close",J)};var q=Bw1(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 jw1(function(U,Y){q.on("close",U),q.on("error",Y)})},q}});var PZ0=N((ox1,kO)=>{var o4=function($){var I=1e7,z=7,q=9007199254740992,U=W(q),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(F,P,S,i){if(typeof F>"u")return Q[0];if(typeof P<"u")return+P===10&&!S?v0(F):$$(F,P,S,i);return v0(F)}function K(F,P){this.value=F,this.sign=P,this.isSmall=!1}K.prototype=Object.create(Q.prototype);function w(F){this.value=F,this.sign=F<0,this.isSmall=!0}w.prototype=Object.create(Q.prototype);function H(F){th Line truncated
actual: `+$._bytesWritten);SN.prototype._finish.call($)}});var fb=M((V94,ZD0)=>{ZD0.exports=n7;var kb=EY(),yP1=lG(),xP1=n0(),uP1=hN(),kP1=d("fs");xP1(n7,kb);function n7($){var I=this;if(!(I instanceof n7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,kb.call(I,$)}n7.prototype._stat=function(){var $=this,I=$.props,z=I.follow?"stat":"lstat";kP1[z](I.path,function(q,U){var Y;if(q||!U)Y="File";else Y=yP1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(kb(I,U))})};n7.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")};n7.prototype.add=function($){if(uP1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};n7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};n7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var EY=M((w94,ND0)=>{ND0.exports=S$;var g$=b8(),fP1=n0(),bP1=Cb(),iP1=gb(),eG=d("path"),XD0=process.platform==="win32"?0:process.umask(),VD0=lG(),wD0=DN();fP1(S$,wD0);S$.dirmode=parseInt("0777",8)&~XD0;S$.filemode=parseInt("0666",8)&~XD0;var nP1=yb(),cP1=xb(),pP1=ub(),dP1=fb();function S$($,I){var z=this;if(typeof $==="string")$={path:$};var q=VD0($),U=S$;switch(q){case"Directory":U=nP1;break;case"File":U=pP1;break;case"Link":case"SymbolicLink":U=cP1;break;case null:default:U=dP1;break}if(!(z instanceof U))return new U($);if(wD0.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=eG.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=eG.basename($.path),z.dirname=eG.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)}S$.prototype._create=function(){var $=this;g$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};S$.prototype._stat=function($){var I=this,z=I.props,q=z.follow?"stat":"lstat",U=I._proxy||I;if($)Y(null,$);else g$[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 bb(I);I._old=Q;var K=VD0(Q);if(K!==I.type||I.type==="File"&&Q.nlink>1)return bP1(I._path,function(H){if(H)return I.error(H);I._old=null,bb(I)});bb(I)}};function bb($){iP1(eG.dirname($._path),S$.dirmode,function(I,z){if(I)return $.error(I);return $._madeDir=z,$._create()})}function LD0($,I,z,q,U){var Y=I.mode,J=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!g$[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();g$[J](q,Y,U)}function OD0($,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(!g$[Y])return U();if(typeof I.uid!=="number")I.uid=z.uid;if(typeof I.gid!=="number")I.gid=z.gid;g$[Y](q,I.uid,I.gid,U)}function FD0($,I,z,q,U){if(!g$.utimes||process.platform==="win32")return U();var Y=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Y==="lutimes"&&!g$[Y])Y="utimes";if(!g$[Y])return U();var{atime:J,mtime:Q}=z,K=I.atime,H=I.mtime;if(K===void 0)K=J;if(H===void 0)H=Q;if(!WD0(K))K=new Date(K);if(!WD0(H))K=new Date(H);if(K.getTime()===J.getTime()&&H.getTime()===Q.getTime())return U();g$[Y](q,K,H,U)}S$.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";g$[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,LD0($,$.props,Q,$._path,J("chmod")),OD0($,$.props,Q,$._path,J("chown")),FD0($,$.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 H();else MD0($,$._path,H);function H(G){if(G)return G.fstream_finish_call="setupMadeDir",$.error(G);$.emit("end"),$.emit("close")}}}};function MD0($,I,z){var q=$._madeDir,U=eG.dirname(I);mP1($,U,function(Y){if(Y)return z(Y);if(U===q)return z();MD0($,U,z)})}function mP1($,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;g$.stat(I,function(Q,K){if(Q)return z(Y=Q);LD0($,q,K,I,J),OD0($,q,K,I,J),FD0($,q,K,I,J)});function J(Q){if(Y)return;if(Q)return z(Y=Q);if(--U===0)return z()}}S$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};S$.prototype.add=function(){this.error("Can't add to non-Directory type")};S$.prototype.write=function(){return!0};function lP1($){return Object.prototype.toString.call($)}function WD0($){return typeof $==="object"&&lP1($)==="[object Date]"}});var db=M((oP1)=>{oP1.Abstract=DN();oP1.Reader=iI();oP1.Writer=EY();oP1.File={Reader:Nb(),Writer:ub()};oP1.Dir={Reader:Mb(),Writer:yb()};oP1.Link={Reader:Ob(),Writer:xb()};oP1.Proxy={Reader:Ab(),Writer:fb()};oP1.Reader.Dir=oP1.DirReader=oP1.Dir.Reader;oP1.Reader.File=oP1.FileReader=oP1.File.Reader;oP1.Reader.Link=oP1.LinkReader=oP1.Link.Reader;oP1.Reader.Proxy=oP1.ProxyReader=oP1.Proxy.Reader;oP1.Writer.Dir=oP1.DirWriter=oP1.Dir.Writer;oP1.Writer.File=oP1.FileWriter=oP1.File.Writer;oP1.Writer.Link=oP1.LinkWriter=oP1.Link.Writer;oP1.Writer.Proxy=oP1.ProxyWriter=oP1.Proxy.Writer;oP1.collect=hN()});var AD0=M((T94,DD0)=>{DD0.exports=zB1;var tP1=WN(),aP1=db().Writer,mb=d("path"),eP1=d("stream"),$B1=Vb(),IB1=y7();function zB1($){$.path=mb.resolve(mb.normalize($.path));var I=new tP1($),z=new eP1.Writable({objectMode:!0});z._write=function(U,Y,J){if(U.type=="Directory")return J();var Q=mb.join($.path,U.path);if(Q.indexOf($.path)!=0)return J();let K=$.getWriter?$.getWriter({path:Q}):aP1({path:Q});U.pipe(K).on("error",J).on("close",J)};var q=$B1(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 IB1(function(U,Y){q.on("close",U),q.on("error",Y)})},q}});var PD0=M((E94,yN)=>{var W6=function($){var I=1e7,z=7,q=9007199254740992,U=W(q),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(N,B,S,n){if(typeof N>"u")return Q[0];if(typeof B<"u")return+B===10&&!S?C0(N):T8(N,B,S,n);return C0(N)}function K(N,B){this.value=N,this.sign=B,this.isSmall=!1}K.prototype=Object.create(Q.prototype);function H(N){this.value=N,this.sign=N<0,this.isSmall=!0}H.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=a("fs"),cO=a("os"),r4=a("path"),uZ0=a("crypto"),Z5={fs:d1.constants,os:cO.constants},bZ0=/XXXXXX/,nZ0=(Z5.O_CREAT||Z5.fs.O_CREAT)|(Z5.O_EXCL||Z5.fs.O_EXCL)|(Z5.O_RDWR||Z5.fs.O_RDWR),sw1=cO.platform()==="win32",ew1=Z5.EBADF||Z5.os.errno.EBADF,$H1=Z5.ENOENT||Z5.os.errno.ENOENT,lU=[],iZ0=d1.rmdirSync.bind(d1),pZ0=!1;function IH1($,I){return d1.rm($,{recursive:!0},I)}function cZ0($){return d1.rmSync($,{recursive:!0})}function du($,I){let z=oU($,I),q=z[0],U=z[1];GH1(q,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function K(){try{let w=mZ0(J);d1.stat(w,function(H){if(!H){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=WH1(z),U=q.tries;do{let Y=mZ0(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 zH1($,I){let z=oU($,I),q=z[0],U=z[1];du(q,function(J,Q){if(J)return U(J);d1.open(Q,nZ0,q.mode||384,function(w,H){if(w)return U(w);if(q.discardDescriptor)return d1.close(H,function(W){return U(W,Q,void 0,pu(Q,-1,q,!1))});else{let G=q.discardDescriptor||q.detachDescriptor;U(null,Q,H,pu(Q,G?-1:H,q,!1))}})})}function qH1($){let I=oU($),z=I[0],q=z.discardDescriptor||z.detachDescriptor,U=mu(z),Y=d1.openSync(U,nZ0,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 UH1($,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,dZ0(Q,q,!1))})})}function YH1($){let I=oU($),z=I[0],q=mu(z);return d1.mkdirSync(q,z.mode||448),{name:q,removeCallback:dZ0(q,z,!0)}}function JH1($,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 QH1($){let I=null;try{if(0<=$[0])d1.closeSync($[0])}catch(z){if(!VH1(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=pO(QH1,[I,$],q),Y=pO(JH1,[I,$],q,U);if(!z.keep)lU.unshift(U);return q?U:Y}function dZ0($,I,z){let q=I.unsafeCleanup?IH1:d1.rmdir.bind(d1),U=I.unsafeCleanup?cZ0:iZ0,Y=pO(U,$,z),J=pO(q,$,z,Y);if(!I.keep)lU.unshift(Y);return z?Y:J}function pO($,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||$===iZ0||$===cZ0)return $(I);else return $(I,J||function(){})}}}function KH1(){if(!pZ0)return;while(lU.length)try{lU[0]()}catch($){}}function xZ0($){let I=[],z=null;try{z=uZ0.randomBytes($)}catch(q){z=uZ0.pseudoRandomBytes($)}for(let q=0;q<$;q++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[q]%62]);return I.join("")}function O$($){return typeof $>"u"}function oU($,I){if(typeof $==="function")return[{},$];if(O$($))return[{},I];let z={};for(let q of Object.getOwnPropertyNames($))z[q]=$[q];return[z,I]}function wH1($,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 HH1($,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 mZ0($){let I=$.tmpdir;if(!O$($.name))return r4.join(I,$.dir,$.name);if(!O$($.template))return r4.join(I,$.dir,$.template).replace(bZ0,xZ0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",xZ0(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 lZ0($){if(!O$($.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(!O$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(bZ0))throw Error(`Invalid template, found "${$.template}".`)}if(!O$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=O$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=O$($.prefix)?"":iu("prefix",$.prefix),$.postfix=O$($.postfix)?"":iu("postfix",$.postfix),$.template=O$($.template)?void 0:iu("template",$.template)}function kZ0($,I,z,q){if(O$(I))return q(null);wH1(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 fZ0($,I,z){if(O$(I))return;let q=HH1(I,z),U=r4.relative(z,q);if(U.startsWith("..")||r4.isAbsolute(U))throw ELine truncated
`,{mode:384}),I}function Jx($){let I=CX0();for(let z of I){if(!x$(z))continue;for(let q of eO(z).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=X5(z,q);try{let Y=ID(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function d7($,I){let z=Jx($);if(!z)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(ID(z,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=zx.parse(U);return BX0(z,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}var Ux="SEAL_USE_ENTERPRISES_DIR",jX0="SEAL_HOME_ENTERPRISES_DIR",vX0="SEAL_USE_USER_ENTERPRISES_DIR",RX0="SEAL_HOME_USER_ENTERPRISES_DIR",gX0="SEAL_USE_CONFIG_FILE",_X0="SEAL_HOME_CONFIG_FILE",tU,$D,sO,TX0;var H9=K0(()=>{qx();tU=X5(zD(),".config","seal-use","enterprises"),$D=X5(zD(),".config","seal-home","enterprises"),sO=X5(zD(),".config","seal-use","config.json"),TX0=X5(zD(),".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((H)=>H.id===Y);if(Q)return Q;let K=$.find((H)=>H.id.toLowerCase()===Y.toLowerCase());if(K)return K;let w=$.find((H)=>H.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 Qx,mkdirSync as ZG1,readFileSync as XG1,renameSync as LG1,unlinkSync as OG1,writeFileSync as DG1}from"node:fs";import{homedir as NG1}from"node:os";import{dirname as FG1,join as MG1}from"node:path";function wx(){let $=process.env[AG1]?.trim();if($)return $;return PG1}function hX0($=new Date){return $.toISOString().slice(0,10)}function SX0($=Kx,I=new Date){let z=I.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function yX0($=wx()){if(!Qx($))return{};try{let I=XG1($,"utf-8"),z=JSON.parse(I);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function TG1($,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 EG1($,I=wx()){let z=FG1(I);if(!Qx(z))ZG1(z,{recursive:!0,mode:448});let q=`${I}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{DG1(q,JSON.stringify($,null,2),"utf-8"),LG1(q,I)}catch(U){try{if(Qx(q))OG1(q)}catch{}throw U}}function uX0($,I=new Date){if(!$||typeof $!=="string")return;try{let z=wx(),q=yX0(z),U=hX0(I),Y=SX0(Kx,I),J=TG1(q,Y);J[$]=J[$]||{},J[$][U]=(J[$][U]??0)+1,EG1(J,z)}catch{}}function BG1($,I=Kx,z=new Date){let q=new Map;try{let U=yX0(),Y=SX0(I,z),J=hX0(z),Q=$??Object.keys(U);for(let K of Q){let w=U[K];if(!w){q.set(K,0);continue}let H=0;for(let[G,W]of Object.entries(w))if(G>=Y&&G<=J&&typeof W==="number")H+=W;q.set(K,H)}}catch{if($)for(let U of $)q.set(U,0)}return q}function xX0($,I,z){let q=z??BG1($.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,H=K.localeCompare(w,"zh-CN");if(H!==0)return H;return U.id.localeCompare(Y.id)})}var AG1="SEAL_USE_USAGE_FILE",PG1,Kx=7;var Hx=K0(()=>{PG1=MG1(NG1(),".config","seal-use","usage.json")});function jG1($,I){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>I?z:z.toLowerCase())}function vG1($,I){return I?$:$.toLowerCase()}function RG1($,I,z,q){let U=vG1($,q),Y=I.filter((J)=>U.includes(J));if(z==="all"&&Y.length!==I.length)return[];return Y}function gG1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function _G1($,I){if(I.fields&&!I.fields.has($.field))return[];let z=gG1($.value),q=[];return z.forEach((U,Y)=>{let J=RG1(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:qD(U,I.maxChars),context:{before:I.snippetOnly?[]:z.slice(Q,Y).map((H)=>qD(H,I.maxChars)),line:qD(U,I.maxChars),after:I.snippetOnly?[]:z.slice(Y+1,K).map((H)=>qD(H,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)w.context={before:[],line:w.context.line,after:[]};q.push(w)}),q}function qD($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function CG1($){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 fX0($){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 Vx($,I,z){let q=I.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",U=await v$($,q);if(z||U.length>0)return cX0(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 F4(`当前租户「${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:H,dryRun:G,fetchFn:W=fetch}=$,V=[];if(I.recordId){let j=await X4(z,I.recordId);V.push(j)}else if(I.recordIds&&I.recordIds.length>0)for(let j of I.recordIds)V.push(await X4(z,j));else if(I.sn){let j=await s4(z,{sourceDocumentSN:I.sn,limit:1});if(!j.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${I.sn}」的审批记录。`);V.push(j.records[0])}else if(I.sns&&I.sns.length>0)for(let j of I.sns){let x=await s4(z,{sourceDocumentSN:j,limit:1});if(!x.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${j}」的审批记录。`);V.push(x.records[0])}else if(I.limit!==void 0){let j=await s4(z,{limit:I.limit,status:I.status,startDate:I.startDate,endDate:I.endDate});if(!j.records.length)throw Error(`在企业「${U.name}」中未检索到符合条件的审批记录。`);V=j.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((j)=>({run:j,doc:Gx(j,{snPrefix:Q,snSuffix:K,docIdPrefix:w,docIdSuffix:H})}));if(G){let j={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Y.seal.url}/api/v1/integrations/webhook/preview`};try{let b=await v$(q,Y.seal.endpoints.approvalStylePreferences);if(b.length>0){let R=cX0(b,J,Y.id);j={id:R.id,name:R.name,mode:R.mode,incomingDocumentWebhookUrl:R.incomingDocumentWebhook.url}}}catch{}let x=X.map(({run:b,doc:R})=>({originalRecord:{id:b.id,sourceSystem:b.sourceSystem,sourceDocumentSN:b.sourceDocumentSN,sourceDocumentId:b.sourceDocumentId},document:R,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:j,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 Vx(q,Y,J),O={id:L.id,name:L.name,mode:L.mode,incomingDocumentWebhookUrl:L.incomingDocumentWebhook.url},D=[],A=0,T=0;for(let{run:j,doc:x}of X){console.error(`[webhook-replay] 正在向 Webhook 通道「${L.name}」推送单据: ${x.documentSN}...`);try{let h=await Wx(L.incomingDocumentWebhook.url,L.secret,x,W,p4(Y.seal));D.push({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},replayedDocument:{documentSN:x.documentSN,documentId:x.documentId,fieldCount:x.fields.length},pushResult:h,success:!0}),A+=1}catch(h){let b=h instanceof Error?h.message:String(h);D.push({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},replayedDocument:{documentSN:x.documentSN,documentId:x.documentId,fieldCount:x.fields.length},error:b,success:!1}),T+=1}}let M=D.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:O,totalCount:D.length,successCount:A,failureCount:T,originalRecord:M?D[0].originalRecord:void 0,replayedDocument:M?D[0].replayedDocument:void 0,pushResult:M?D[0].pushResult:void 0,records:D}}var iG1;var aK=K0(()=>{UD();k$();c4();iG1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var dX0,kk1,cG1,fk1;var mX0=K0(()=>{p9();dX0=Z.object({level:Z.enum(["error","warning","info"]),code:Z.string(),message:Z.string(),snippet:Z.string().optional(),suggestion:Z.string().optional()}),kk1=Z.object({score:Z.number().min(0).max(100),passed:Z.boolean(),issues:Z.array(dX0)}),cG1=Z.object({ruleId:Z.stri Line truncated
*/var a1=d("fs"),iN=d("os"),X6=d("path"),xD0=d("crypto"),t5={fs:a1.constants,os:iN.constants},bD0=/XXXXXX/,iD0=(t5.O_CREAT||t5.fs.O_CREAT)|(t5.O_EXCL||t5.fs.O_EXCL)|(t5.O_RDWR||t5.fs.O_RDWR),EB1=iN.platform()==="win32",jB1=t5.EBADF||t5.os.errno.EBADF,CB1=t5.ENOENT||t5.os.errno.ENOENT,CY=[],nD0=a1.rmdirSync.bind(a1),cD0=!1;function _B1($,I){return a1.rm($,{recursive:!0},I)}function pD0($){return a1.rmSync($,{recursive:!0})}function tb($,I){let z=_Y($,I),q=z[0],U=z[1];fB1(q,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function K(){try{let H=mD0(J);a1.stat(H,function(G){if(!G){if(Q-- >0)return K();return U(Error("Could not get a unique tmp filename, max tries reached "+H))}U(null,H)})}catch(H){U(H)}})()})}function ab($){let I=_Y($),z=I[0],q=bB1(z),U=q.tries;do{let Y=mD0(q);try{a1.statSync(Y)}catch(J){return Y}}while(U-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function RB1($,I){let z=_Y($,I),q=z[0],U=z[1];tb(q,function(J,Q){if(J)return U(J);a1.open(Q,iD0,q.mode||384,function(H,G){if(H)return U(H);if(q.discardDescriptor)return a1.close(G,function(W){return U(W,Q,void 0,rb(Q,-1,q,!1))});else{let Z=q.discardDescriptor||q.detachDescriptor;U(null,Q,G,rb(Q,Z?-1:G,q,!1))}})})}function vB1($){let I=_Y($),z=I[0],q=z.discardDescriptor||z.detachDescriptor,U=ab(z),Y=a1.openSync(U,iD0,z.mode||384);if(z.discardDescriptor)a1.closeSync(Y),Y=void 0;return{name:U,fd:Y,removeCallback:rb(U,q?-1:Y,z,!0)}}function hB1($,I){let z=_Y($,I),q=z[0],U=z[1];tb(q,function(J,Q){if(J)return U(J);a1.mkdir(Q,q.mode||448,function(H){if(H)return U(H);U(null,Q,dD0(Q,q,!1))})})}function gB1($){let I=_Y($),z=I[0],q=ab(z);return a1.mkdirSync(q,z.mode||448),{name:q,removeCallback:dD0(q,z,!0)}}function SB1($,I){let z=function(q){if(q&&!sb(q))return I(q);I()};if(0<=$[0])a1.close($[0],function(){a1.unlink($[1],z)});else a1.unlink($[1],z)}function yB1($){let I=null;try{if(0<=$[0])a1.closeSync($[0])}catch(z){if(!iB1(z)&&!sb(z))throw z}finally{try{a1.unlinkSync($[1])}catch(z){if(!sb(z))I=z}}if(I!==null)throw I}function rb($,I,z,q){let U=bN(yB1,[I,$],q),Y=bN(SB1,[I,$],q,U);if(!z.keep)CY.unshift(U);return q?U:Y}function dD0($,I,z){let q=I.unsafeCleanup?_B1:a1.rmdir.bind(a1),U=I.unsafeCleanup?pD0:nD0,Y=bN(U,$,z),J=bN(q,$,z,Y);if(!I.keep)CY.unshift(Y);return z?Y:J}function bN($,I,z,q){let U=!1;return function Y(J){if(!U){let Q=q||Y,K=CY.indexOf(Q);if(K>=0)CY.splice(K,1);if(U=!0,z||$===nD0||$===pD0)return $(I);else return $(I,J||function(){})}}}function xB1(){if(!cD0)return;while(CY.length)try{CY[0]()}catch($){}}function uD0($){let I=[],z=null;try{z=xD0.randomBytes($)}catch(q){z=xD0.pseudoRandomBytes($)}for(let q=0;q<$;q++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[q]%62]);return I.join("")}function n8($){return typeof $>"u"}function _Y($,I){if(typeof $==="function")return[{},$];if(n8($))return[{},I];let z={};for(let q of Object.getOwnPropertyNames($))z[q]=$[q];return[z,I]}function uB1($,I,z){let q=X6.isAbsolute($)?$:X6.join(I,$);a1.stat(q,function(U){if(U)a1.realpath(X6.dirname(q),function(Y,J){if(Y)return z(Y);z(null,X6.join(J,X6.basename(q)))});else a1.realpath(q,z)})}function kB1($,I){let z=X6.isAbsolute($)?$:X6.join(I,$);try{return a1.statSync(z),a1.realpathSync(z)}catch(q){let U=a1.realpathSync(X6.dirname(z));return X6.join(U,X6.basename(z))}}function mD0($){let I=$.tmpdir;if(!n8($.name))return X6.join(I,$.dir,$.name);if(!n8($.template))return X6.join(I,$.dir,$.template).replace(bD0,uD0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",uD0(12),$.postfix?"-"+$.postfix:""].join("");return X6.join(I,$.dir,z)}function ob($,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 lD0($){if(!n8($.name)){let I=$.name;if(X6.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let z=X6.basename(I);if(z===".."||z==="."||z!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!n8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(bD0))throw Error(`Invalid template, found "${$.template}".`)}if(!n8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=n8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=n8($.prefix)?"":ob("prefix",$.prefix),$.postfix=n8($.postfix)?"":ob("postfix",$.postfix),$.template=n8($.template)?void 0:ob("template",$.template)}function kD0($,I,z,q){if(n8(I))return q(null);uB1(I,z,function(U,Y){if(U)return q(U);let J=X6.relative(z,Y);if(J.startsWith("..")||X6.isAbsolute(J))return q(Error(`${$} option must be relative to "${z}", found "${J}".`));q(null,J)})}function fD0($,I,z){if(n8(I))return;let q=kB1(I,z),U=X6.relative(z,q);if(U.startsWith("..")||X6.isAbsolute(U))throw ELine truncated
`,{mode:384}),I}function Wi($){let I=hA0();for(let z of I){if(!K$(z))continue;for(let q of sN(z).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=a5(z,q);try{let Y=aN(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function m7($,I){let z=Wi($);if(!z)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(aN(z,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=Ki.parse(U);return EA0(z,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}var Gi="SEAL_USE_ENTERPRISES_DIR",jA0="SEAL_HOME_ENTERPRISES_DIR",CA0="SEAL_USE_USER_ENTERPRISES_DIR",_A0="SEAL_HOME_USER_ENTERPRISES_DIR",RA0="SEAL_USE_CONFIG_FILE",vA0="SEAL_HOME_CONFIG_FILE",RY,tN,rN,BA0;var e9=e(()=>{Hi();RY=a5(eN(),".config","seal-use","enterprises"),tN=a5(eN(),".config","seal-home","enterprises"),rN=a5(eN(),".config","seal-use","config.json"),BA0=a5(eN(),".config","seal-home","config.json")});function l7($,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 H=$.find((G)=>G.name.toLowerCase()===Y.toLowerCase());if(H)return H;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 Xi,mkdirSync as iT1,readFileSync as nT1,renameSync as cT1,unlinkSync as pT1,writeFileSync as dT1}from"node:fs";import{homedir as mT1}from"node:os";import{dirname as lT1,join as oT1}from"node:path";function wi(){let $=process.env[rT1]?.trim();if($)return $;return sT1}function gA0($=new Date){return $.toISOString().slice(0,10)}function SA0($=Vi,I=new Date){let z=I.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function yA0($=wi()){if(!Xi($))return{};try{let I=nT1($,"utf-8"),z=JSON.parse(I);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function tT1($,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 aT1($,I=wi()){let z=lT1(I);if(!Xi(z))iT1(z,{recursive:!0,mode:448});let q=`${I}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{dT1(q,JSON.stringify($,null,2),"utf-8"),cT1(q,I)}catch(U){try{if(Xi(q))pT1(q)}catch{}throw U}}function xA0($,I=new Date){if(!$||typeof $!=="string")return;try{let z=wi(),q=yA0(z),U=gA0(I),Y=SA0(Vi,I),J=tT1(q,Y);J[$]=J[$]||{},J[$][U]=(J[$][U]??0)+1,aT1(J,z)}catch{}}function eT1($,I=Vi,z=new Date){let q=new Map;try{let U=yA0(),Y=SA0(I,z),J=gA0(z),Q=$??Object.keys(U);for(let K of Q){let H=U[K];if(!H){q.set(K,0);continue}let G=0;for(let[Z,W]of Object.entries(H))if(Z>=Y&&Z<=J&&typeof W==="number")G+=W;q.set(K,G)}}catch{if($)for(let U of $)q.set(U,0)}return q}function uA0($,I,z){let q=z??eT1($.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,H=Y.name??Y.id,G=K.localeCompare(H,"zh-CN");if(G!==0)return G;return U.id.localeCompare(Y.id)})}var rT1="SEAL_USE_USAGE_FILE",sT1,Vi=7;var Li=e(()=>{sT1=oT1(mT1(),".config","seal-use","usage.json")});function $E1($,I){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>I?z:z.toLowerCase())}function IE1($,I){return I?$:$.toLowerCase()}function zE1($,I,z,q){let U=IE1($,q),Y=I.filter((J)=>U.includes(J));if(z==="all"&&Y.length!==I.length)return[];return Y}function qE1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function UE1($,I){if(I.fields&&!I.fields.has($.field))return[];let z=qE1($.value),q=[];return z.forEach((U,Y)=>{let J=zE1(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),H={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Y+1,matchedKeywords:J,matchedText:$D(U,I.maxChars),context:{before:I.snippetOnly?[]:z.slice(Q,Y).map((G)=>$D(G,I.maxChars)),line:$D(U,I.maxChars),after:I.snippetOnly?[]:z.slice(Y+1,K).map((G)=>$D(G,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)H.context={before:[],line:H.context.line,after:[]};q.push(H)}),q}function $D($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function YE1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function fA0($){return $.rules.flatMap((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 Mi($,I,z){let q=I.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",U=await e8($,q);if(z||U.length>0)return pA0(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 gw($,Y,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${Y}/api/v1/integrations/webhook/replay-mock-callback`},I.seal.endpoints.approvalStylePreferences)}throw new h4(`当前租户「${I.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${I.id}`)}async function vY($){let{query:I,sourceClient:z,targetClient:q,sourceCorp:U,targetCorp:Y,webhookSelector:J,snPrefix:Q,snSuffix:K,docIdPrefix:H,docIdSuffix:G,dryRun:Z,fetchFn:W=fetch}=$,X=[];if(I.recordId){let T=await z4(z,I.recordId);X.push(T)}else if(I.recordIds&&I.recordIds.length>0)for(let T of I.recordIds)X.push(await z4(z,T));else if(I.sn){let T=await a4(z,{sourceDocumentSN:I.sn,limit:1});if(!T.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${I.sn}」的审批记录。`);X.push(T.records[0])}else if(I.sns&&I.sns.length>0)for(let T of I.sns){let k=await a4(z,{sourceDocumentSN:T,limit:1});if(!k.records.length)throw Error(`在企业「${U.name}」中未找到单据编号为「${T}」的审批记录。`);X.push(k.records[0])}else if(I.limit!==void 0){let T=await a4(z,{limit:I.limit,status:I.status,startDate:I.startDate,endDate:I.endDate});if(!T.records.length)throw Error(`在企业「${U.name}」中未检索到符合条件的审批记录。`);X=T.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 w=X.map((T)=>({run:T,doc:Oi(T,{snPrefix:Q,snSuffix:K,docIdPrefix:H,docIdSuffix:G})}));if(Z){let T={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Y.seal.url}/api/v1/integrations/webhook/preview`};try{let f=await e8(q,Y.seal.endpoints.approvalStylePreferences);if(f.length>0){let C=pA0(f,J,Y.id);T={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let k=w.map(({run:f,doc:C})=>({originalRecord:{id:f.id,sourceSystem:f.sourceSystem,sourceDocumentSN:f.sourceDocumentSN,sourceDocumentId:f.sourceDocumentId},document:C,success:!0})),h=k.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:T,totalCount:k.length,successCount:k.length,failureCount:0,originalRecord:h?k[0].originalRecord:void 0,document:h?k[0].document:void 0,records:k}}let L=await Mi(q,Y,J),O={id:L.id,name:L.name,mode:L.mode,incomingDocumentWebhookUrl:L.incomingDocumentWebhook.url},F=[],D=0,P=0;for(let{run:T,doc:k}of w){console.error(`[webhook-replay] 正在向 Webhook 通道「${L.name}」推送单据: ${k.documentSN}...`);try{let h=await Fi(L.incomingDocumentWebhook.url,L.secret,k,W,K6(Y.seal));F.push({originalRecord:{id:T.id,sourceSystem:T.sourceSystem,sourceDocumentSN:T.sourceDocumentSN,sourceDocumentId:T.sourceDocumentId},replayedDocument:{documentSN:k.documentSN,documentId:k.documentId,fieldCount:k.fields.length},pushResult:h,success:!0}),D+=1}catch(h){let f=h instanceof Error?h.message:String(h);F.push({originalRecord:{id:T.id,sourceSystem:T.sourceSystem,sourceDocumentSN:T.sourceDocumentSN,sourceDocumentId:T.sourceDocumentId},replayedDocument:{documentSN:k.documentSN,documentId:k.documentId,fieldCount:k.fields.length},error:f,success:!1}),P+=1}}let A=F.length===1;return{success:P===0,dryRun:!1,sourceCorp:{id:U.id,name:U.name,environment:U.environment},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment},targetWebhook:O,totalCount:F.length,successCount:D,failureCount:P,originalRecord:A?F[0].originalRecord:void 0,replayedDocument:A?F[0].replayedDocument:void 0,pushResult:A?F[0].pushResult:void 0,records:F}}var wE1;var GZ=e(()=>{ID();H$();e4();wE1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var dA0,L34,OE1,O34;var mA0=e(()=>{u3();dA0=V.object({level:V.enum(["error","warning","info"]),code:V.string(),message:V.string(),snippet:V.string().optional(),suggestion:V.string().optional()}),L34=V.object({score:V.number().min(0).max(100),passed:V.boolean(),issues:V.array(dA0)}),OE1=V.object({ruleId:V.string Line truncated
* ==============================================================================
* Seal 官方标准规则校验器 (Official Standard Rule Linter)
* ==============================================================================
@@ -866,43 +866,55 @@ export function lintRule(rule: RuleLintTarget): RuleLintResult {
}
export default lintRule;
`}});import{existsSync as xI,mkdirSync as UW1,readFileSync as YW1,readdirSync as aX0,rmSync as JW1,unlinkSync as QW1,writeFileSync as KW1}from"node:fs";import{homedir as wW1}from"node:os";import{isAbsolute as HW1,join as q6,resolve as GW1}from"node:path";import{pathToFileURL as rX0}from"node:url";function sX0($=K8){let I=[],z=[];try{if(!xI($))UW1($,{recursive:!0});let q=Object.keys(Ox);for(let[Y,J]of Object.entries(Ox)){let Q=q6($,Y),K=!0;if(xI(Q))try{if(YW1(Q,"utf8")===J)K=!1}catch{K=!0}if(K)KW1(Q,J,"utf8");I.push(Y)}let U=aX0($,{withFileTypes:!0});for(let Y of U)if(!q.includes(Y.name)){let J=q6($,Y.name);try{if(Y.isDirectory())JW1(J,{recursive:!0,force:!0});else QW1(J);z.push(Y.name)}catch{}}}catch{}return{synced:I,pruned:z}}function eX0($={syncOfficial:!0}){if($.syncOfficial!==!1)sX0();let I=[{name:"builtin",type:"builtin",path:q6(K8,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:q6(K8,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:q6(K8,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[Q8,KD];for(let q of z)if(xI(q))try{let U=aX0(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:q6(q,J),description:`用户自定义规则校验器 (${J})`})}}}catch{}return I}function VW1($){let I=($||"").trim();if(!I||I==="builtin"||I==="default"||I==="official/builtin"||I==="official/builtin.ts")return{path:q6(K8,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(I==="strict"||I==="official/strict"||I==="official/strict.ts")return{path:q6(K8,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(I==="hlab"||I==="hlab-sop"||I==="hlab-rules"||I==="hlab-standard"||I==="official/hlab"||I==="official/hlab.ts")return{path:q6(K8,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(HW1(I)||I.startsWith("./")||I.startsWith("../")){let q=GW1(I);if(xI(q))return{path:q};for(let U of[".ts",".js",".mjs"])if(xI(`${q}${U}`))return{path:`${q}${U}`}}let z=[q6(Q8,`${I}.ts`),q6(Q8,`${I}.js`),q6(Q8,`${I}.mjs`),q6(KD,`${I}.ts`),q6(KD,`${I}.js`),q6(KD,`${I}.mjs`)];for(let q of z)if(xI(q))return{path:q};return{}}async function Nx($){sX0();let I=VW1($??"builtin");if(I.isOfficial){let q=I.officialKind==="strict"?lX0:I.officialKind==="hlab"?oX0:sU,U=I.officialKind==="builtin"?"builtin":"official",Y=I.path;if(Y&&xI(Y))try{let Q=await import(rX0(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:tX0(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(rX0(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:tX0(Y,sU)}}catch(q){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${q?.message??q}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:sU}}}function tX0($,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,WW1="official",K8,KD;var Fx=K0(()=>{Zx();Lx();Dx();Xx();Q8=q6(wW1(),".config","seal-use","linters"),K8=q6(Q8,WW1),KD=q6(process.cwd(),"linters")});async function Mx($,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 $L0($,I,z,q){let U=q?.minScore??0,Y=q?.level??"all",J=[],Q=0;for(let V of $){let X=await Mx(V,I,z);Q+=X.score;let L=X.issues;if(Y==="error")L=X.issues.filter((D)=>D.level==="error");else if(Y==="warning")L=X.issues.filter((D)=>D.level==="warning"||D.level==="error");let O=L.every((D)=>D.level!=="error");if(q?.summary){if(L.length>0)J.push({...X,passed:O,issues:L})}else J.push({...X,passed:O,issues:L})}let K=$.length,w=K===0?100:Math.round(Q/K),H=J.filter((V)=>V.issues.length>0).length,G=KLine truncated
`,"utf8"),z}function UL0($){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 YL0=()=>{};var w8;var eU=K0(()=>{w8=class w8 extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}});var wL0=N((Vf1,KL0)=>{KL0.exports=wD;function wD(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}wD.prototype.go=function($){if(this.pending<this.max)QL0(this,$);else this.waiting.push($)};wD.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};wD.prototype.hold=function(){return JL0(this)};function JL0($){$.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)QL0($,$.waiting.shift());else if($.pending===0){var Y=$.listeners;$.listeners=[],Y.forEach(q)}}function q(U){U($.error)}}function QL0($,I){I(JL0($))}});var WL0=N((AW1)=>{var Tx=a("fs"),Ex=a("util"),HL0=a("stream"),GL0=HL0.Readable,FW1=HL0.PassThrough,MW1=wL0(),HD=a("events").EventEmitter;AW1.BufferSlicer=IY;AW1.FdSlicer=$Y;Ex.inherits($Y,HD);function $Y($){HD.call(this),this.fd=$,this.pend=new MW1,this.pend.max=1,this.refCount=0}$Y.prototype.read=function($,I,z,q,U){var Y=this;Y.pend.go(function(J){Tx.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;Tx.close($.fd,I);function I(z){if(z)$.emit("error",z);else $.emit("close")}};Ex.inherits(sK,GL0);function sK($,I){I=I||{},GL0.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);Tx.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};Ex.inherits(IY,HD);function IY($){HD.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 FW1($);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 ZL0=N((Xf1,VL0)=>{var EW1=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 oI,mkdirSync as vE1,readFileSync as hE1,readdirSync as tA0,rmSync as gE1,unlinkSync as SE1,writeFileSync as yE1}from"node:fs";import{homedir as xE1}from"node:os";import{isAbsolute as uE1,join as A6,resolve as kE1}from"node:path";import{pathToFileURL as rA0}from"node:url";function aA0($=x$){let I=[],z=[];try{if(!oI($))vE1($,{recursive:!0});let q=Object.keys(Pi);for(let[Y,J]of Object.entries(Pi)){let Q=A6($,Y),K=!0;if(oI(Q))try{if(hE1(Q,"utf8")===J)K=!1}catch{K=!0}if(K)yE1(Q,J,"utf8");I.push(Y)}let U=tA0($,{withFileTypes:!0});for(let Y of U)if(!q.includes(Y.name)){let J=A6($,Y.name);try{if(Y.isDirectory())gE1(J,{recursive:!0,force:!0});else SE1(J);z.push(Y.name)}catch{}}}catch{}return{synced:I,pruned:z}}function eA0($={syncOfficial:!0}){if($.syncOfficial!==!1)aA0();let I=[{name:"builtin",type:"builtin",path:A6(x$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:A6(x$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:A6(x$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[y$,YD];for(let q of z)if(oI(q))try{let U=tA0(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:A6(q,J),description:`用户自定义规则校验器 (${J})`})}}}catch{}return I}function bE1($){let I=($||"").trim();if(!I||I==="builtin"||I==="default"||I==="official/builtin"||I==="official/builtin.ts")return{path:A6(x$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(I==="strict"||I==="official/strict"||I==="official/strict.ts")return{path:A6(x$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(I==="hlab"||I==="hlab-sop"||I==="hlab-rules"||I==="hlab-standard"||I==="official/hlab"||I==="official/hlab.ts")return{path:A6(x$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(uE1(I)||I.startsWith("./")||I.startsWith("../")){let q=kE1(I);if(oI(q))return{path:q};for(let U of[".ts",".js",".mjs"])if(oI(`${q}${U}`))return{path:`${q}${U}`}}let z=[A6(y$,`${I}.ts`),A6(y$,`${I}.js`),A6(y$,`${I}.mjs`),A6(YD,`${I}.ts`),A6(YD,`${I}.js`),A6(YD,`${I}.mjs`)];for(let q of z)if(oI(q))return{path:q};return{}}async function Ti($){aA0();let I=bE1($??"builtin");if(I.isOfficial){let q=I.officialKind==="strict"?lA0:I.officialKind==="hlab"?oA0:hY,U=I.officialKind==="builtin"?"builtin":"official",Y=I.path;if(Y&&oI(Y))try{let Q=await import(rA0(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:sA0(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:hY};try{let U=await import(rA0(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:hY};return{name:$??"custom",type:"custom",filePath:z,linter:sA0(Y,hY)}}catch(q){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${q?.message??q}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:hY}}}function sA0($,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 y$,fE1="official",x$,YD;var Ei=e(()=>{Ni();Ai();Bi();Di();y$=A6(xE1(),".config","seal-use","linters"),x$=A6(y$,fE1),YD=A6(process.cwd(),"linters")});async function ji($,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 $P0($,I,z,q){let U=q?.minScore??0,Y=q?.level??"all",J=[],Q=0;for(let X of $){let w=await ji(X,I,z);Q+=w.score;let L=w.issues;if(Y==="error")L=w.issues.filter((F)=>F.level==="error");else if(Y==="warning")L=w.issues.filter((F)=>F.level==="warning"||F.level==="error");let O=L.every((F)=>F.level!=="error");if(q?.summary){if(L.length>0)J.push({...w,passed:O,issues:L})}else J.push({...w,passed:O,issues:L})}let K=$.length,H=K===0?100:Math.round(Q/K),G=J.filter((X)=>X.issues.length>0).length,Z=K-Line truncated
`,"utf8"),z}function UP0($){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 YP0=()=>{};var JP0,W5;var gY=e(()=>{JP0=class JP0 extends Error{errors;warnings;constructor($,I=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=I;this.name="ResourcePackValidationError"}};W5=JP0});var GP0=M((d34,HP0)=>{HP0.exports=JD;function JD(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}JD.prototype.go=function($){if(this.pending<this.max)KP0(this,$);else this.waiting.push($)};JD.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};JD.prototype.hold=function(){return QP0(this)};function QP0($){$.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)KP0($,$.waiting.shift());else if($.pending===0){var Y=$.listeners;$.listeners=[],Y.forEach(q)}}function q(U){U($.error)}}function KP0($,I){I(QP0($))}});var XP0=M((rE1)=>{var Ri=d("fs"),vi=d("util"),ZP0=d("stream"),WP0=ZP0.Readable,lE1=ZP0.PassThrough,oE1=GP0(),QD=d("events").EventEmitter;rE1.BufferSlicer=yY;rE1.FdSlicer=SY;vi.inherits(SY,QD);function SY($){QD.call(this),this.fd=$,this.pend=new oE1,this.pend.max=1,this.refCount=0}SY.prototype.read=function($,I,z,q,U){var Y=this;Y.pend.go(function(J){Ri.read(Y.fd,$,I,z,q,function(Q,K,H){J(),U(Q,K,H)})})};SY.prototype.createReadStream=function($){return new ZZ(this,$)};SY.prototype.ref=function(){this.refCount+=1};SY.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Ri.close($.fd,I);function I(z){if(z)$.emit("error",z);else $.emit("close")}};vi.inherits(ZZ,WP0);function ZZ($,I){I=I||{},WP0.call(this,I),this.context=$,this.context.ref(),this.start=I.start||0,this.endOffset=I.end,this.pos=this.start}ZZ.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);Ri.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()})})};ZZ.prototype._destroy=function($,I){this._cleanup(),I($)};ZZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};vi.inherits(yY,QD);function yY($){QD.call(this),this.refCount=0,this.buffer=$}yY.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)})};yY.prototype.createReadStream=function($){$=$||{};var I=new lE1($);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};yY.prototype.ref=function(){this.refCount+=1};yY.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var wP0=M((l34,VP0)=>{var aE1=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,1090 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 mL0=N((PV1)=>{var Qk=W9().Buffer;PV1._dbcs=Z9;var E6=-1,dL0=-2,W8=-10,a6=-1000,KY=Array(256),Iw=-1;for($w=0;$w<256;$w++)KY[$w]=E6;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]===E6)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 H=129;H<=254;H++){if(w[H]===E6)w[H]=a6-Y;else if(w[H]===a6-Y)continue;else if(w[H]>a6)throw Error("gb18030 decode tables conflict at byte 3");var G=this.decodeTables[a6-w[H]];for(var W=48;W<=57;W++)if(G[W]===E6)G[W]=dL0}}}}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===E6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===E6)this.defCharSB=63}Z9.prototype.encoder=PD;Z9.prototype.decoder=Kk;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==E6)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 H=0;H<K;H++)w.push(U.charCodeAt(Y++));z[I++]=W8-this.decodeTableSeq.length,this.decodeTableSeq.push(w)}else z[I++]=J}else if(typeof U==="number"){var G=z[I-1]+1;for(var Y=0;Y<U;Y++)z[I++]=G++}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 D=new FormData,A=await Zk(q.fileBuffer,O),T=L.split("/").pop()??L;D.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:D});if(!M.ok)throw Error(`附件上传失败 ${M.status}: ${await M.text()}`);let j=await M.json();H.set(L,j.attachments?.map((x)=>x.data)??(j.data===void 0?[]:[j.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 lP0=M((sj1)=>{var Xn=I3().Buffer;sj1._dbcs=q3;var p6=-1,mP0=-2,f$=-10,N8=-1000,nY=Array(256),VZ=-1;for(XZ=0;XZ<256;XZ++)nY[XZ]=p6;var XZ;function q3($,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]=nY.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(nY.slice(0));var Y=this.decodeTables.length;this.decodeTables.push(nY.slice(0));var J=this.decodeTables[0];for(var q=129;q<=254;q++){var Q=this.decodeTables[N8-J[q]];for(var K=48;K<=57;K++){if(Q[K]===p6)Q[K]=N8-U;else if(Q[K]>N8)throw Error("gb18030 decode tables conflict at byte 2");var H=this.decodeTables[N8-Q[K]];for(var G=129;G<=254;G++){if(H[G]===p6)H[G]=N8-Y;else if(H[G]===N8-Y)continue;else if(H[G]>N8)throw Error("gb18030 decode tables conflict at byte 3");var Z=this.decodeTables[N8-H[G]];for(var W=48;W<=57;W++)if(Z[W]===p6)Z[W]=mP0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var X={};if($.encodeSkipVals)for(var q=0;q<$.encodeSkipVals.length;q++){var w=$.encodeSkipVals[q];if(typeof w==="number")X[w]=!0;else for(var K=w.from;K<=w.to;K++)X[K]=!0}if(this._fillEncodeTable(0,0,X),$.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===p6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===p6)this.defCharSB=63}q3.prototype.encoder=ND;q3.prototype.decoder=Vn;q3.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==p6)z[I[q]]=N8-this.decodeTables.length,this.decodeTables.push(z=nY.slice(0));else if(U<=N8)z=this.decodeTables[N8-U];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};q3.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,H=[];for(var G=0;G<K;G++)H.push(U.charCodeAt(Y++));z[I++]=f$-this.decodeTableSeq.length,this.decodeTableSeq.push(H)}else z[I++]=J}else if(typeof U==="number"){var Z=z[I-1]+1;for(var Y=0;Y<U;Y++)z[I++]=Z++}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
`;super(I);this.name="AggregateError",this.errors=$}}zT0.exports={AggregateError:IT0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,I){return $.includes(I)},ArrayPrototypeIndexOf($,I){return $.indexOf(I)},ArrayPrototypeJoin($,I){return $.join(I)},ArrayPrototypeMap($,I){return $.map(I)},ArrayPrototypePop($,I){return $.pop(I)},ArrayPrototypePush($,I){return $.push(I)},ArrayPrototypeSlice($,I,z){return $.slice(I,z)},Error,FunctionPrototypeCall($,I,...z){return $.call(I,...z)},FunctionPrototypeSymbolHasInstance($,I){return Function.prototype[Symbol.hasInstance].call($,I)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,I){return Object.defineProperties($,I)},ObjectDefineProperty($,I,z){return Object.defineProperty($,I,z)},ObjectGetOwnPropertyDescriptor($,I){return Object.getOwnPropertyDescriptor($,I)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,I){return Object.setPrototypeOf($,I)},Promise,PromisePrototypeCatch($,I){return $.catch(I)},PromisePrototypeThen($,I,z){return $.then(I,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,I){return $.test(I)},SafeSet:Set,String,StringPrototypeSlice($,I,z){return $.slice(I,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,I,z){return $.set(I,z)},Boolean,Uint8Array}});var un=M((t74,qT0)=>{qT0.exports={format($,...I){return $.replace(/%([sdifj])/g,function(...[z,q]){let U=I.shift();if(q==="f")return U.toFixed(6);else if(q==="j")return JSON.stringify(U);else if(q==="s"&&typeof U==="object")return`${U.constructor!==Object?U.constructor.name:""} {}`.trim();else return U.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var q8=M((a74,QT0)=>{var{format:c_1,inspect:ED}=un(),{AggregateError:p_1}=T4(),d_1=globalThis.AggregateError||p_1,m_1=Symbol("kIsNodeError"),l_1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o_1=/^([A-Z][a-z0-9]*)+$/,jD={};function tI($,I){if(!$)throw new jD.ERR_INTERNAL_ASSERTION(I)}function UT0($){let I="",z=$.length,q=$[0]==="-"?1:0;for(;z>=q+4;z-=3)I=`_${$.slice(z-3,z)}${I}`;return`${$.slice(0,z)}${I}`}function r_1($,I,z){if(typeof I==="function")return tI(I.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${I.length}).`),I(...z);let q=(I.match(/%[dfijoOs]/g)||[]).length;if(tI(q===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${q}).`),z.length===0)return I;return c_1(I,...z)}function d6($,I,z){if(!z)z=Error;class q extends z{constructor(...U){super(r_1($,I,U))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(q.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),q.prototype.code=$,q.prototype[m_1]=!0,jD[$]=q}function YT0($){let I="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:I}),$}function s_1($,I){if($&&I&&$!==I){if(Array.isArray(I.errors))return I.errors.push($),I;let z=new d_1([I,$],I.message);return z.code=I.code,z}return $||I}class JT0 extends Error{constructor($="The operation was aborted",I=void 0){if(I!==void 0&&typeof I!=="object")throw new jD.ERR_INVALID_ARG_TYPE("options","Object",I);super($,I);this.code="ABORT_ERR",this.name="AbortError"}}d6("ERR_ASSERTION","%s",Error);d6("ERR_INVALID_ARG_TYPE",($,I,z)=>{if(tI(typeof $==="string","'name' must be a string"),!Array.isArray(I))I=[I];let q="The ";if($.endsWith(" argument"))q+=`${$} `;else q+=`"${$}" ${$.includes(".")?"property":"argument"} `;q+="must be ";let U=[],Y=[],J=[];for(let K of I)if(tI(typeof K==="string","All expected entries have to be of type string"),l_1.includes(K))U.push(K.toLowerCase());else if(o_1.test(K))Y.push(K);else tI(K!=="object",'The value "object" should be written as "Object"'),J.push(K);if(Y.length>0){let K=U.indexOf("object");if(K!==-1)U.splice(U,K,1),Y.push("Object")}if(U.length>0){switch(U.length){case 1:q+=`of type ${U[Line truncated
`);if(I.linkname)z+=Vp(" linkpath="+I.linkname+`
`);let q=I.pax;if(q)for(let U in q)z+=Vp(" "+U+"="+q[U]+`
`);return T1.from(z)};lx1.decodePax=function(I){let z={};while(I.length){let q=0;while(q<I.length&&I[q]!==32)q++;let U=parseInt(T1.toString(I.subarray(0,q)),10);if(!U)return z;let Y=T1.toString(I.subarray(q+1,U-1)),J=Y.indexOf("=");if(J===-1)return z;z[Y.slice(0,J)]=Y.slice(J+1),I=I.subarray(U)}return z};lx1.encode=function(I){let z=T1.alloc(512),q=I.name,U="";if(I.typeflag===5&&q[q.length-1]!=="/")q+="/";if(T1.byteLength(q)!==q.length)return null;while(T1.byteLength(q)>100){let Y=q.indexOf("/");if(Y===-1)return null;U+=U?"/"+q.slice(0,Y):q.slice(0,Y),q=q.slice(Y+1)}if(T1.byteLength(q)>100||T1.byteLength(U)>155)return null;if(I.linkname&&T1.byteLength(I.linkname)>100)return null;if(T1.write(z,q),T1.write(z,I2(I.mode&4095,6),100),T1.write(z,I2(I.uid,6),108),T1.write(z,I2(I.gid,6),116),dx1(I.size,z,124),T1.write(z,I2(I.mtime.getTime()/1000|0,11),136),z[156]=48+cx1(I.type),I.linkname)T1.write(z,I.linkname,157);if(T1.copy(v_0,z,257),T1.copy(xx1,z,263),I.uname)T1.write(z,I.uname,265);if(I.gname)T1.write(z,I.gname,297);if(T1.write(z,I2(I.devmajor||0,6),329),T1.write(z,I2(I.devminor||0,6),337),U)T1.write(z,U,345);return T1.write(z,I2(g_0(z),6),148),z};lx1.decode=function(I,z,q){let U=I[156]===0?0:I[156]-48,Y=KJ(I,0,100,z),J=$2(I,100,8),Q=$2(I,108,8),K=$2(I,116,8),H=$2(I,124,12),G=$2(I,136,12),Z=nx1(U),W=I[157]===0?null:KJ(I,157,100,z),X=KJ(I,265,32),w=KJ(I,297,32),L=$2(I,329,8),O=$2(I,337,8),F=g_0(I);if(F===256)return null;if(F!==$2(I,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(fx1(I)){if(I[345])Y=KJ(I,345,155,z)+"/"+Y}else if(bx1(I));else if(!q)throw Error("Invalid tar header: unknown format.");if(U===0&&Y&&Y[Y.length-1]==="/")U=5;return{name:Y,mode:J,uid:Q,gid:K,size:H,byteOffset:0,mtime:new Date(1000*G),type:Z,linkname:W,uname:X,gname:w,devmajor:L,devminor:O,pax:null}};function fx1($){return T1.equals(v_0,$.subarray(257,263))}function bx1($){return T1.equals(ux1,$.subarray(257,263))&&T1.equals(kx1,$.subarray(263,265))}function ix1($,I,z){if(typeof $!=="number")return z;if($=~~$,$>=I)return I;if($>=0)return $;if($+=I,$>=0)return $;return 0}function nx1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function cx1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function h_0($,I,z,q){for(;z<q;z++)if($[z]===I)return z;return q}function g_0($){let I=256;for(let z=0;z<148;z++)I+=$[z];for(let z=156;z<512;z++)I+=$[z];return I}function I2($,I){if($=$.toString(8),$.length>I)return"7777777777777777777".slice(0,I)+" ";return"0000000000000000000".slice(0,I-$.length)+$+" "}function px1($,I,z){I[z]=128;for(let q=11;q>0;q--)I[z+q]=$&255,$=Math.floor($/256)}function dx1($,I,z){if($.toString(8).length>11)px1($,I,z);else T1.write(I,I2($,11),z)}function mx1($){let I;if($[0]===128)I=!0;else if($[0]===255)I=!1;else return null;let z=[],q;for(q=$.length-1;q>0;q--){let J=$[q];if(I)z.push(J);else z.push(255-J)}let U=0,Y=z.length;for(q=0;q<Y;q++)U+=z[q]*Math.pow(256,q);return I?U:-1*U}function $2($,I,z){if($=$.subarray(I,I+z),I=0,$[I]&128)return mx1($);else{while(I<$.length&&$[I]===32)I++;let q=ix1(h_0($,32,I,$.length),$.length,$.length);while(I<q&&$[I]===0)I++;if(q===I)return 0;return parseInt(T1.toString($.subarray(I,q)),8)}}function KJ($,I,z,q){return T1.toString($.subarray(I,h_0($,0,I,I+z)),q)}function Vp($){let I=T1.byteLength($),z=Math.floor(Math.log(I)/Math.log(10))+1;if(I+z>=Math.pow(10,z))z++;return I+z+$}});var i_0=M((nI4,b_0)=>{var{Writable:ex1,Readable:$u1,getStreamError:S_0}=Xp(),Iu1=Yp(),y_0=QJ(),HJ=wp(),zu1=y_0.alloc(0);class x_0{constructor(){this.buffered=0,this.shifted=0,this.queue=new Iu1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return zu1;let I=this._next($);if($===I.byteLength)return I;let z=[I];while(($-=I.byteLength)>0)I=this._next($),z.push(I);return y_0.concat(z)}_next($){let I=this.queue.peek(),z=I.byteLength-this._offset;if($>=z){let q=this._offset?I.subarray(this._offset,I.byteLength):I;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,q}return this.buffered-=$,this.shifted+=$,I.subarray(this._offset,this._offset+=$)}}class u_0 extends $u1{constructor($,I,z){super();this.header=I,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(S_0(this))}_detach(){if(this._parent._stream= Line truncated
`),q=[await z4($,z.recordId)];else if(z.recordIds&&z.recordIds.length>0)process.stderr.write(`\uD83D\uDD0D 批量查询 ${z.recordIds.length} 条单据记录...
`),q=await Promise.all(z.recordIds.map((F)=>z4($,F)));else{let F=z.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${I.name}」(${I.id}) 的线上审核记录 (限制 ${F} 条)...
`);let P=(await a4($,{limit:F,status:z.status,startDate:z.startDate!==void 0?String(z.startDate):void 0,endDate:z.endDate!==void 0?String(z.endDate):void 0})).records??[];if(P.length===0)throw Error("未检索到符合条件的线上审核记录,无法导出 webhook 资源包。");process.stderr.write(`\uD83D\uDCE5 正在拉取 ${P.length} 条审核记录完整详情...
`),q=await Promise.all(P.map((A)=>z4($,A.id)))}let U=new Map,Y=0;for(let F of q){let D=F.document,P=F.sourceDocumentId??(typeof D?.id==="string"?D.id:void 0)??(typeof D?.sourceDocumentId==="string"?D.sourceDocumentId:void 0)??F.documentId??F.id,A=`${z.docIdPrefix??""}${P}${z.docIdSuffix??""}`,T=[];if(z.includeAttachments!==!1){let h=d7(F,{summary:!1}).attachments,f=new Set;for(let C of h){let b=C.ossSignedUrl??C.url;if(!b)continue;let i=C.fileName??C.fileId??"attachment",v=Yi(i),y=v,c=v.lastIndexOf("."),$0=c>0?v.slice(0,c):v,R=c>0?v.slice(c):"",u=1;while(f.has(y.toLowerCase()))y=`${$0}_${u}${R}`,u++;f.add(y.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${A}」附件: ${i}...
`);let p=await fetch(b);if(p.ok){let s=await p.arrayBuffer(),U0=Buffer.from(s);T.push({fileName:y,zipPath:`${A}/${y}`,buffer:U0,sourceField:C.sourceField??"附件"}),Y++}}catch(p){process.stderr.write(`⚠️ [跳过附件] 下载失败 ${i}: ${p}
`)}}}U.set(A,T)}let J=new YR0.default.Workbook;J.creator="seal-use",J.created=new Date;let Q=new Set;for(let F of U.values())for(let D of F)Q.add(D.sourceField);if(Q.size===0)Q.add("附件");let K=new Set;for(let F of q){let D=F.document,P=Array.isArray(D?.fields)?D.fields:[];for(let A of P)if(A&&typeof A==="object"){let T=A,k=typeof T.label==="string"?T.label.trim():typeof T.key==="string"?T.key.trim():"",h=typeof T.type==="string"?T.type.toUpperCase():"";if(k&&h!=="ATTACHMENT"&&h!=="LIST")K.add(k)}}let H=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],G=Array.from(K).filter((F)=>!H.includes(F)&&F!=="单据编号"&&F!=="单号"),Z=Array.from(Q).map((F)=>`[附件]${F}`),W=[...H,...G,...Z],X=J.addWorksheet("主表");X.addRow(W),X.getRow(1).font={bold:!0};for(let F of q){let D=F.document,P=F.sourceDocumentSN??(typeof D?.sn==="string"?D.sn:void 0)??(typeof D?.sourceDocumentSN==="string"?D.sourceDocumentSN:void 0)??F.id,A=F.sourceDocumentId??(typeof D?.id==="string"?D.id:void 0)??(typeof D?.sourceDocumentId==="string"?D.sourceDocumentId:void 0)??F.documentId??F.id,T=`${z.docIdPrefix??""}${A}${z.docIdSuffix??""}`,k=`${z.docIdPrefix??""}${P}${z.docIdSuffix??""}`,h=(typeof D?.title==="string"?D.title:void 0)??(typeof D?.name==="string"?D.name:void 0)??k,f="";if(typeof D?.sourceStartTime==="number")f=new Date(D.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof F.createdAt==="number")f=new Date(F.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof F.createdAt==="string")f=F.createdAt.slice(0,10);let C=new Map,b=Array.isArray(D?.fields)?D.fields:[];for(let $0 of b)if($0&&typeof $0==="object"){let R=$0,u=typeof R.label==="string"?R.label.trim():typeof R.key==="string"?R.key.trim():"";if(u)C.set(u,R.value)}let i,v=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof v==="number")i=v;else if(v&&typeof v==="object"&&"amount"in v&&typeof v.amount==="number")i=v.amount;let y=[];y.push(T),y.push(h),y.push(F.status??"已审批"),y.push(i??""),y.push(C.get("报销事由")??C.get("事由")??h),y.push(f);for(let $0 of G){let R=C.get($0);if(R===void 0||R===null)y.push("");else if(typeof R==="object")if("amount"in R)y.push(R.amount);else y.push(JSON.stringify(R));else y.push(R)}let c=U.get(T)??[];for(let $0 of Q){let R=c.filter((u)=>u.sourceField===$0||Q.size===1);if(R.length>0)y.push(R.map((u)=>u.zipPath).join(`
`));else y.push("")}X.addRow(y)}let w=Du1(z,I);Lu1(Mu1(w),{recursive:!0});let L=await J.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${w}...
`),await new Promise((F,D)=>{let P=wu1(w),A=new Np({zlib:{level:9}});P.on("close",()=>F()),A.on("error",(T)=>D(T)),A.pipe(P),A.append(Buffer.from(L),{name:"信息表.xlsx"});for(let T of U.values())for(let k of T)A.append(k.buffer,{name:k.zipPath});A.finalize()});let O=Ou1(w);return{filePath:w,corpId:I.id,corpName:I.name,recordCount:q.length,attachmentCount:Y,fileSizeBytes:O.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${w} --corp <targetCorpId>`}}var YR0;var Dp=e(()=>{qR0();e4();lN();YR0=j4(QZ(),1)});import{readFileSync as Au1}from"node:fs";function Pu1($){let I=new URL($),z=I.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${I.protocol}//${I.host}`,webhookId:z[1]}}function Bu1($,I){return I.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!I.toLowerCase().endsWith(".xlsx")}function Tu1($,I){if(!$.length)return;let z=new Set($.map((Y)=>{let J=Y.fileName.split("/")[0],Q=J.indexOf("@");return Q>=0?J.slice(0,Q):J}).filter((Y)=>Y!=="信息表.xlsx")),q=[];for(let Y of I){let J=Y.document.documentId;if((Y.documentAttachments.length>0||Object.values(Y.expenseAttachments).some((K)=>K.length>0)||Object.values(Y.personAttachments).some((K)=>K.length>0))&&!z.has(J))q.push(`Excel 会议编号「${J}」声明了附件,但在 ZIP 中找不到对应的根目录「${J}/」或「${J}@.../」。`)}let U=new Set(I.map((Y)=>Y.document.documentId));for(let Y of z)if(!U.has(Y))q.push(`ZIP 根目录对应的编号「${Y}」在信息表中找不到对应的会议编号。`);if(q.length)throw new W5(q)}async function JR0($,I,z){let q=[],U=$;if(Bu1($,I)){q=await LB0($),FB0(q,z);let K=q.find((H)=>H.fileName==="信息表.xlsx");if(!K)throw Error("ZIP 根目录缺少信息表.xlsx");U=await Nn($,K)}let Y=await TB0(U);Tu1(q,Y);let J=EB0(q,Y),Q=Y.map((K)=>K.document);return{entries:q,parsed:Y,plans:J,documents:Q,fileBuffer:$}}async function wz($,I,z){let q=await JR0($,I,z),U=q.parsed.map((Y,J)=>En(Y.document,q.plans[J],new Map));return{warnings:[],documents:U,attachmentPlan:q.plans}}async function LA($,I,z){let q=await JR0($,I,z.materialPackFilePolicy),{baseUrl:U,webhookId:Y}=Pu1(z.webhookUrl),J=[];for(let Q=0;Q<q.parsed.length;Q+=1){let K=q.parsed[Q],H=q.plans[Q],G=new Map,Z=[...H.categoryFields,...Object.values(H.personAttachments).flat(),...Object.values(H.expenseAttachments).flat()];for(let w of Z)for(let L of w.paths){if(G.has(L))continue;let O=q.entries.find((k)=>k.fileName===L);if(!O)continue;process.stderr.write(`⬆ 上传附件: ${L}
`);let F=new FormData,D=await Nn(q.fileBuffer,O),P=L.split("/").pop()??L;F.append("files",new File([new Uint8Array(D)],P));let A=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...HZ({},z.secret)},body:F});if(!A.ok)throw Error(`附件上传失败 ${A.status}: ${await A.text()}`);let T=await A.json();G.set(L,T.attachments?.map((k)=>k.data)??(T.data===void 0?[]:[T.data])),process.stderr.write(`✓ 附件上传成功: ${L}
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${K.document.documentId}
`);let W=Nk(K.document,w,H),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:UZ1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Mk=K0(()=>{UD();Fk();Dk();Xk();eU()});import{existsSync as KZ1}from"node:fs";async function gD($,I,z={}){let U=K4().stateful?"stateful":"stateless",Y="ok",J,Q,K;try{let M=await R6($);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 H=w.length===1,G=w.map((M)=>({id:M.id,name:M.name,mode:M.mode,incomingDocumentWebhookUrl:M.incomingDocumentWebhook.url,outgoingResultWebhookUrl:M.outgoingResultWebhook,autoApprovalRate:M.autoApprovalRate,...H?{isDefault:!0}:{}})),W=H?{id:w[0].id,name:w[0].name,mode:w[0].mode}:null,V=z.webhook?m9(w,z.webhook):H?w[0]:void 0,X;if(z.filePath)if(!KZ1(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),j=await bI(M.fileBuffer,M.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:z.filePath,fileName:M.fileName,documentCount:j.documents.length,warnings:j.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,O=Y==="ok"&&G.length>0&&L,D=U==="stateful"?"":` --corp ${I.id}`,A="",T="";if(Y!=="ok")T=`凭证鉴权异常: ${J}`,A=`seal-use auth diagnose${D}`;else if(G.length===0)T="当前企业尚未配置任何 Webhook 集成通道",A=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${D}`;else if(X&&!X.valid)T=`材料包预检失败: ${X.errors?.join("; ")}`,A=`seal-use webhook material-pack preview ${X.filePath}${D}`;else{T=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${G.length} 个 Webhook 通道,等待载入`;let M=X?.filePath??"<材料包.zip>",j=H?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;A=`seal-use webhook material-pack push ${M}${j}${D}`}return{ready:O,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:K},stateMode:U,authStatus:Y,authError:J,activeWebhooks:G,defaultWebhook:W,materialPack:X,statusMessage:T,nextAction:A}}var jO0=K0(()=>{H9();c4();Mk()});var Ak=K0(()=>{eU();ez();UD();Xk();Dk();Fk();Mk();jO0()});import{existsSync as vO0,mkdirSync as RO0,statSync as wZ1}from"node:fs";import{homedir as HZ1}from"node:os";import{dirname as GZ1,resolve as _D}from"node:path";function WZ1($){if($.outputFile){let J=_D($.outputFile),Q=GZ1(J);if(!vO0(Q))RO0(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=_D(HZ1(),"Downloads");else Y=_D(process.cwd(),"exports");if(!vO0(Y))RO0(Y,{recursive:!0});return _D(Y,U)}async function CD($,I,z={}){let q=I.name||I.id,U=tu({startDate:z.startDate,endDate:z.endDate,force:z.force}),Y=new Date().toISOString(),[J,Q]=await Promise.all([$V($,{startDate:U.startDateStr,endDate:U.endDateStr,limit:z.limit??100}),zV($,{startDate:U.startDateStr,endDate:U.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),K=J.tagStats||[],w=[],H=Math.min(K.length,z.limit??50);for(let R=0;R<H;R++){let f=K[R];if(!f?.tagId)continue;try{let n=await IV($,{tagId:f.tagId,startDate:U.startDateStr,endDate:U.endDateStr});for(let C of n.risks||[])w.push({tagId:f.tagId,tagName:f.tagName||f.tagId,documentSN:C.documentSN||"-",documentType:C.documentType||"-",riskLevel:C.riskLevel||"warning",confidence:C.confidence??0,riskDetails:C.riskDetails||"-",reasoning:C.reasoning||"-",sourceDocumentURL:C.sourceDocumentURL,createdAt:C.createdAt})}catch{}}let G=new gO0.default.Workbook;G.creator="seal-use",G.lastModifiedBy="seal-use",G.created=new Date,G.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=G.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.getRow(1).alignment={vertical:"middle",horizontal:"center"};let O=Q.metrics||{},D=[{category:"基本信息" 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:kD(I,["template.name","templateName","form.name","formName","formTitle"]),amount:SD(z,["金额","报销金额","付款金额","合计","价税合计"])??kD(I,["amount","totalAmount","expenseAmount"]),expenseType:SD(z,["费用类型","费用类别","报销类型"]),costCompany:SD(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:SD(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:RZ1($),attachments:rU($,{summary:!0}).attachments,aiResult:bD($),manualResult:pI($)?.value,hints:wY({amountMentions:SO0(q,["金额","合计","税率"],8),partyMentions:SO0(q,["买方","卖方","甲方","乙方","收款"],8)})}}function EZ1($){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 H=w4(w.runtimeRuleId)??w4(w.runtimeId)??w4(w.id)??w4(w.ruleId),G=w4(w.ruleCode)??w4(w.code)??(H?CZ1(H):void 0),W=wY({runtimeRuleId:H,ruleCode:G,versionNumber:jZ1(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 kD($,I){if(!$)return;for(let z of I){let q=X9($,z);if(q!==void 0)return q}return}function hO0($,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 BZ1($,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 jZ1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function vZ1($){let I=[];return Bk($,"document",I),I}function Bk($,I,z){if(Array.isArray($)){$.forEach((J,Q)=>Bk(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;Bk(Q,`${I}.${J}`,z)}}function SD($,I){return $.find((q)=>{let U=w4(q.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function RZ1($){let I=[];return fD($.result,"result",I),fD($.document,"document",I),I.slice(0,20)}function fD($,I,z){if(Array.isArray($)){$.forEach((U,Y)=>fD(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))fD(Y,`${I}.${U}`,z)}function SO0($,I,z){return $.split(/\r?\n/).filter((q)=>I.some((U)=>q.includes(U))).slice(0,z)}function yD($){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 Tk($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function gZ1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let z=await X4($,I.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`+`• 身份主体:${D}${A}
`);let W=En(K.document,H,G),X=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...HZ({webhookId:Y,...W},z.secret)},body:JSON.stringify(W)});if(!X.ok)throw Error(`Webhook 单据推送失败 ${X.status}: ${await X.text()}`);J.push({documentId:W.documentId,document:W,pushResult:await X.json()}),process.stderr.write(`✓ 单据推送成功: ${W.documentId}
`)}return{warnings:[],results:J}}function Lz($){return{fileBuffer:Au1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Ap=e(()=>{ID();jn();Tn();Dn();gY();Dp()});import{existsSync as Eu1}from"node:fs";async function OA($,I,z={}){let U=O4().stateful?"stateful":"stateless",Y="ok",J,Q,K;try{let A=await r6($);K={id:A.user.id,name:A.user.name,isAdmin:A.user.isAdmin},Q={id:A.tenant.id,name:A.tenant.name,tenantSlug:A.tenant.tenantSlug,corporationName:A.tenant.hoseCorpConfig?.corporationName}}catch(A){Y="error",J=A instanceof Error?A.message:String(A)}let H=[];if(Y==="ok")try{H=await e8($,I.seal.endpoints.approvalStylePreferences)}catch(A){Y="error",J=`读取 Webhook 配置失败: ${A instanceof Error?A.message:String(A)}`}let G=H.length===1,Z=H.map((A)=>({id:A.id,name:A.name,mode:A.mode,incomingDocumentWebhookUrl:A.incomingDocumentWebhook.url,outgoingResultWebhookUrl:A.outgoingResultWebhook,autoApprovalRate:A.autoApprovalRate,...G?{isDefault:!0}:{}})),W=G?{id:H[0].id,name:H[0].name,mode:H[0].mode}:null,X=z.webhook?b3(H,z.webhook):G?H[0]:void 0,w;if(z.filePath)if(!Eu1(z.filePath))w={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let A=Lz(z.filePath),T=await wz(A.fileBuffer,A.fileName,X?.materialPackFilePolicy);w={valid:!0,filePath:z.filePath,fileName:A.fileName,documentCount:T.documents.length,warnings:T.warnings}}catch(A){w={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[A instanceof Error?A.message:String(A)]}}let L=w?w.valid:!0,O=Y==="ok"&&Z.length>0&&L,F=U==="stateful"?"":` --corp ${I.id}`,D="",P="";if(Y!=="ok")P=`凭证鉴权异常: ${J}`,D=`seal-use auth diagnose${F}`;else if(Z.length===0)P="当前企业尚未配置任何 Webhook 集成通道",D=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${F}`;else if(w&&!w.valid)P=`资源包预检失败: ${w.errors?.join("; ")}`,D=`seal-use webhook resource-pack preview ${w.filePath}${F}`;else{P=G?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${Z.length} 个 Webhook 通道,等待载入`;let A=w?.filePath??"<资源包.zip>",T=G?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;D=`seal-use webhook resource-pack push ${A}${T}${F}`}return{ready:O,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:K},stateMode:U,authStatus:Y,authError:J,activeWebhooks:Z,defaultWebhook:W,resourcePack:w,materialPack:w,statusMessage:P,nextAction:D}}var QR0=e(()=>{e9();e4();Ap()});var Pp=e(()=>{gY();Cq();ID();Dn();Tn();jn();Ap();QR0();Dp()});import{existsSync as KR0,mkdirSync as HR0,statSync as ju1}from"node:fs";import{homedir as Cu1}from"node:os";import{dirname as _u1,resolve as FA}from"node:path";function Ru1($){if($.outputFile){let J=FA($.outputFile),Q=_u1(J);if(!KR0(Q))HR0(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=FA(Cu1(),"Downloads");else Y=FA(process.cwd(),"exports");if(!KR0(Y))HR0(Y,{recursive:!0});return FA(Y,U)}async function MA($,I,z={}){let q=I.name||I.id,U=zi({startDate:z.startDate,endDate:z.endDate,force:z.force}),Y=new Date().toISOString(),[J,Q]=await Promise.all([kw($,{startDate:U.startDateStr,endDate:U.endDateStr,limit:z.limit??100}),bw($,{startDate:U.startDateStr,endDate:U.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),K=J.tagStats||[],H=[],G=Math.min(K.length,z.limit??50);for(let C=0;C<G;C++){let b=K[C];if(!b?.tagId)continue;try{let i=await fw($,{tagId:b.tagId,startDate:U.startDateStr,endDate:U.endDateStr});for(let v of i.risks||[])H.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:v.documentSN||"-",documentType:v.documentType||"-",riskLevel:v.riskLevel||"warning",confidence:v.confidence??0,riskDetails:v.riskDetails||"-",reasoning:v.reasoning||"-",sourceDocumentURL:v.sourceDocumentURL,createdAt:v.createdAt})}catch{}}let Z=new GR0.default.Workbook;Z.creator="seal-use",Z.lastModifiedBy="seal-use",Z.created=new Date,Z.modified=new Date;let W={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},X={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},w={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=Z.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=X,L.getRow(1).fill=W,L.getRow(1).alignment={vertical:"middle",horizontal:"center"};let O=Q.metrics||{},F=[{c Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:ZJ({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:TA(I,["template.name","templateName","form.name","formName","formTitle"]),amount:DA(z,["金额","报销金额","付款金额","合计","价税合计"])??TA(I,["amount","totalAmount","expenseAmount"]),expenseType:DA(z,["费用类型","费用类别","报销类型"]),costCompany:DA(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:DA(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:lu1($),attachments:d7($,{summary:!0}).attachments,aiResult:jA($),manualResult:Fz($)?.value,hints:ZJ({amountMentions:VR0(q,["金额","合计","税率"],8),partyMentions:VR0(q,["买方","卖方","甲方","乙方","收款"],8)})}}function cu1($){let I=[["result.citedRules",H3($,"result.citedRules")],["result.matchedRules",H3($,"result.matchedRules")],["result.ruleResults",H3($,"result.ruleResults")],["result.rules",H3($,"result.rules")],["pipelineData.citedRules",H3($,"pipelineData.citedRules")],["pipelineData.matchedRules",H3($,"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 H=mZ(Q);if(!H)return;let G=N4(H.runtimeRuleId)??N4(H.runtimeId)??N4(H.id)??N4(H.ruleId),Z=N4(H.ruleCode)??N4(H.code)??(G?su1(G):void 0),W=ZJ({runtimeRuleId:G,ruleCode:Z,versionNumber:du1(H.versionNumber)??$.ruleSetVersionNumber,scope:N4(H.scope),strictness:N4(H.strictness),appliedAnalysis:H.appliedAnalysis??H.analysis??H.reasoning,checkResult:H.checkResult??H.result??H.decision,findings:H.findings??H.riskPoints??H.evidence,sourcePath:`${U}.${K}`}),X=JSON.stringify(W);if(!q.has(X))q.add(X),z.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function TA($,I){if(!$)return;for(let z of I){let q=H3($,z);if(q!==void 0)return q}return}function XR0($,I){if(!$)return 0;for(let z of I){let q=H3($,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 H3($,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 pu1($,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 ZJ($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function mZ($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function du1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function mu1($){let I=[];return jp($,"document",I),I}function jp($,I,z){if(Array.isArray($)){$.forEach((J,Q)=>jp(J,`${I}.${Q}`,z));return}let q=mZ($);if(!q)return;let U=N4(q.label)??N4(q.name)??N4(q.title)??N4(q.fieldName),Y=q.value??q.displayValue??q.text??q.content;if(U&&Y!==void 0&&typeof Y!=="object")z.push(ZJ({path:I,label:U,value:Y,type:N4(q.type)??N4(q.fieldType)}));for(let[J,Q]of Object.entries(q)){if(J==="attachments")continue;jp(Q,`${I}.${J}`,z)}}function DA($,I){return $.find((q)=>{let U=N4(q.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function lu1($){let I=[];return EA($.result,"result",I),EA($.document,"document",I),I.slice(0,20)}function EA($,I,z){if(Array.isArray($)){$.forEach((U,Y)=>EA(U,`${I}.${Y}`,z));return}let q=mZ($);if(!q)return;if(/invoice|发票/i.test(I))z.push(ZJ({path:I,fileName:N4(q.fileName)??N4(q.filename)??N4(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))EA(Y,`${I}.${U}`,z)}function VR0($,I,z){return $.split(/\r?\n/).filter((q)=>I.some((U)=>q.includes(U))).slice(0,z)}function AA($){return $.map((I)=>{let z=Oz(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 Tp($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function ou1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let z=await z4($,I.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`+`• 身份主体:${F}${D}
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
`+`• 时效性:换票凭证有效时间 ${V} 秒(${Math.round(V/60)} 分钟),在浏览器打开后将保留 30 天会话
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?H:w,sealResultUrl:w,ssoUrl:H,type:I.sso?"sso_link":"deep_link",expiresIn:I.sso?V:void 0,identity:G,warning:W,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Y.type==="hose"?uZ1(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 xZ1($,{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=CO0(I.fields),J=U.map((Q)=>hZ1(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:yD(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=Ck(await hj($,I.batchId),I.query);return{batchId:I.batchId,count:z.length,records:z.map(iI),bridge:yD(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 lZ1($){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 aO0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of sO0)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 sO0;var fk=K0(()=>{k$();sO0=[{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
`+`• 时效性:换票凭证有效时间 ${X} 秒(${Math.round(X/60)} 分钟),在浏览器打开后将保留 30 天会话
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?G:H,sealResultUrl:H,ssoUrl:G,type:I.sso?"sso_link":"deep_link",expiresIn:I.sso?X:void 0,identity:Z,warning:W,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Y.type==="hose"?$k1(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:V.object({query:V.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:V.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:V.string().optional().describe("模拟批次 ID"),latest:V.boolean().optional().describe("只返回最新一条匹配记录"),fields:V.union([V.string(),V.array(V.string())]).optional().describe("限制返回字段"),limit:V.number().int().positive().max(100).optional(),maxScan:V.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:V.boolean().optional()}),handler:async($,I)=>{let z=I.sn??I.query;if(!z)throw Error("query or sn is required");let q=await Ik1($,{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)=>z4($,Q.id))),Y=WR0(I.fields),J=U.map((Q)=>tu1(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:AA(U)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:V.object({batchId:V.string().describe("simulation batch ID"),query:V.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,I)=>{let z=gp(await Nv($,I.batchId),I.query);return{batchId:I.batchId,count:z.length,records:z.map(Oz),bridge:AA(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:V.object({mode:V.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:V.array(V.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:V.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:V.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:V.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:V.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:V.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:V.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:V.array(V.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:V.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:V.record(V.string(),V.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:V.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:V.record(V.string(),V.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,I)=>{let z=I.mode??"hosecloud",q=I.signKey;if(z==="hosecloud"&&!q){if(q=(await Av($)).find((Q)=>Q.signKey)?.signKey,!q)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`)}function Zk1($){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 vR0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of hR0)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 hR0;var bp=e(()=>{H$();hR0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",description:"Production enterprise ID (default: active enterprise)"},{flag:"--record-id <id>",description:"Replay a specific approval run ID"},{flag:"--sn <sn>",description:"Replay a specific document SN"},{flag:"--limit <n>",description:"Batch replay latest N records from production (default: 1)"},{flag:"--status <status>",descripti Line truncated
`)}
`}function Hw($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function P0($,I={}){sZ1($,I);let z=`${JSON.stringify($,null,2)}
`;if(I.outputFile){oZ1(I.outputFile,z),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function sZ1($,I={}){if(I.allowFull||I.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>aZ1)throw new YD(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function zD0($,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>rZ1||Y>tZ1)throw new YD(`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 qD0($=[]){console.log($D0($))}var rZ1=100,tZ1=120000,ID0,aZ1=200000;var u1=K0(()=>{H4();k$();fk();ID0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var UD0={};A$(UD0,{selectCorp:()=>H1,runToolResult:()=>r7,runTool:()=>F0,globalConfigSummary:()=>o7});function H1($){let I=D$(),z=K4(),q=m7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},w9());return uX0(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 F0($,I,z,q,U={}){P0(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(()=>{H9();Hx();nD();u1()});var IF0={};A$(IF0,{formatTenantDoctorDashboard:()=>YL1,diagnoseTenantContract:()=>UL1});async function UL1($,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 O=await R6($);if(J=O.user,Q=O.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(O){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${O instanceof Error?O.message:String(O)}`,details:{error:String(O)},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 O=await M3($),D=Array.isArray(O.features)?O.features:[],A=D.find((M)=>M?.code==="ai-approval");if(A){let M=typeof A.balance==="number"?A.balance:0,j=typeof A.deductionAmount==="number"&&A.deductionAmount>0?A.deductionAmount:120,x=Math.floor(M/j);if(K.balance=M,K.deductionAmount=j,K.estimatedRuns=x,M<=0)K.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:M,deductionAmount:j,estimatedRuns:x},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(x<10)K.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${M} 点 (单笔扣除 ${j} 点),仅可支持约 ${x} 笔审核`,details:{balance:M,deductionAmount:j,estimatedRuns:x},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else K.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${M} 点,预估可支持 ${x} 笔审核单据`,details:{balance:M,deductionAmount:j,estimatedRuns:x}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:D.map((M)=>M?.code)}});let T=D.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(O){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${O instanceof Error?O.message:String(OLine truncated
`)}var zF0=K0(()=>{c4()});import{dirname as Fw,resolve as nF0}from"node:path";import{fileURLToPath as kL1}from"node:url";q$();function Nz($){return!!$._zod}function _9($,I){if(Nz($))return Iz($,I);return $.safeParse(I)}function iH($){if(!$)return;let I;if(Nz($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function rn($){if(Nz($)){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 Wp=[PE,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],h9="io.modelcontextprotocol/related-task",MG="2.0",i4=NG(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),Vp=c1([Q0(),M1().int()]),Zp=Q0(),oN1=Q6({ttl:M1().optional(),pollInterval:M1().optional()}),GT0=j0({ttl:M1().optional()}),WT0=j0({taskId:Q0()}),TE=Q6({progressToken:Vp.optional(),[h9]:WT0.optional()}),B$=j0({_meta:TE.optional()}),ZJ=B$.extend({task:GT0.optional()}),Xp=($)=>ZJ.safeParse($).success,w6=j0({method:Q0(),params:B$.loose().optional()}),d$=j0({_meta:TE.optional()}),m$=j0({method:Q0(),params:d$.loose().optional()}),H6=Q6({_meta:TE.optional()}),AG=c1([Q0(),M1().int()]),Lp=j0({jsonrpc:y0(MG),id:AG,...w6.shape}).strict(),EE=($)=>Lp.safeParse($).success,Op=j0({jsonrpc:y0(MG),...m$.shape}).strict(),Dp=($)=>Op.safeParse($).success,BE=j0({jsonrpc:y0(MG),id:AG,result:H6}).strict(),XJ=($)=>BE.safeParse($).success;var G1;(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"})(G1||(G1={}));var jE=j0({jsonrpc:y0(MG),id:AG.optional(),error:j0({code:M1().int(),message:Q0(),data:p1().optional()})}).strict();var Np=($)=>jE.safeParse($).success;var Fp=c1([Lp,Op,BE,jE]),rN1=c1([BE,jE]),PG=H6.strict(),VT0=d$.extend({requestId:AG.optional(),reason:Q0().optional()}),TG=m$.extend({method:y0("notifications/cancelled"),params:VT0}),ZT0=j0({src:Q0(),mimeType:Q0().optional(),sizes:J1(Q0()).optional(),theme:K6(["light","dark"]).optional()}),LJ=j0({icons:J1(ZT0).optional()}),vz=j0({name:Q0(),title:Q0().optional()}),Mp=vz.extend({...vz.shape,...LJ.shape,version:Q0(),websiteUrl:Q0().optional(),description:Q0().optional()}),XT0=jz(j0({applyDefaults:R4().optional()}),f1(Q0(),p1())),LT0=VJ(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},jz(j0({form:XT0.optional(),url:i4.optional()}),f1(Q0(),p1()).optional())),OT0=Q6({list:i4.optional(),cancel:i4.optional(),requests:Q6({sampling:Q6({createMessage:i4.optional()}).optional(),elicitation:Q6({create:i4.optional()}).optional()}).optional()}),DT0=Q6({list:i4.optional(),cancel:i4.optional(),requests:Q6({tools:Q6({call:i4.optional()}).optional()}).optional()}),NT0=j0({experimental:f1(Q0(),i4).optional(),sampling:j0({context:i4.optional(),tools:i4.optional()}).optional(),elicitation:LT0.optional(),roots:j0({listChanged:R4().optional()}).optional(),tasks:OT0.optional(),extensions:f1(Q0(),i4).optional()}),FT0=B$.extend({protocolVersion:Q0(),capabilities:NT0,clientInfo:Mp}),vE=w6.extend({method:y0("initialize"),params:FT0});var MT0=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:DT0.optional(),extensions:f1(Q0(),i4).optional()}),AT0=H6.extend({protocolVersion:Q0(),capabilities:MT0,serverInfo:Mp,instructions:Q0().optional()}),RE=m$.extend({method:y0("notifications/initialized"),params:d$.optional()});var EG=w6.extend({method:y0("ping"),params:B$.optional()}),PT0=j0({progress:M1(),total:l1(M1()),message:l1(Q0())}),TT0=j0({...d$.shape,...PT0.shape,progressToken:Vp}),BG=m$.extend({method:y0("notifications/progress"),params:TT0}),ET0=B$.extend({cursor:Zp.optional()}),OJ=w6.extend({params:ET0.optional()}),DJ=H6.extend({nextCursor:Zp.optional()}),BT0=K6(["working","input_required","completed","failed","cancelled"]),NJ=j0({taskId:Q0(),status:BT0,ttl:c1([M1(),YJ()]),createdAt:Q0(),lastUpdatedAt:Q0(),pollInterval:l1(M1()),statusMessage:l1(Q0())}),Rz=H6.extend({task:NJ}),jT0=d$.merge(NJ),FJ=m$.extend({method:y0("notifications/tasks/status"),params:jT0}),jG=w6.extend({method:y0("tasks/get"),params:B$.extend({taskId:Q0()})}),vG=H6.merge(NJ),RG=w6.extend({method:y0("tasks/result"),params:B$.extend({taskId:Q0()})}),tN1=H6.loose(),gG=OJ.extend({method:y0("tasks/list")}),_G=DJ.extend({tasks:J1(NJ)}),CG=w6.extend({method:y0("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),DS0(I)}clear(){this._buffer=void 0}}function DS0($){return Fp.parse(JSON.parse($))}function Lo($){return JSON.stringify($)+`
`}class aB{constructor($=Oo.stdin,I=Oo.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=Lo($);if(this._stdout.write(z))I();else this._stdout.once("drain",I)})}}w$();import{dirname as Nf,join as CL1}from"node:path";import{fileURLToPath as hL1}from"node:url";import{spawnSync as Dr}from"node:child_process";var UQ={name:"seal-use",version:"0.10.21",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 Qy0($,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 Ky0($,I,z,q){let Y=z?`+g${z}${q?".dirty":""}`:q?"+dirty":"";return`${$}-dev.${I}${Y}`}function wy0($){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,H=I?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,G=$?.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"||H==="1")return{name:"seal-use",version:UQ.version,channel:"release",isRelease:!0};try{let W=Dr("git",["describe","--tags","--long","--dirty","--always"],{cwd:G,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(W.status===0&&W.stdout){let V=Qy0(W.stdout.trim(),UQ.version);if(V){if(!V.commit){let L=Dr("git",["rev-parse","--short","HEAD"],{cwd:G,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(L.status===0&&L.stdout)V.commit=L.stdout.trim()}return{name:"seal-use",version:Ky0(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=wy0(),q1=YQ.version,Nj=YQ.isRelease,Xj1=YQ.channel;c4();rO();eu();A4();H4();u1();w$();A4();c4();c4();aK();Ak();H4();u1();k$();import{existsSync as YD0}from"node:fs";async function JD0($,I){if(!YD0($))throw Error(`File not found: ${$}`);let z=nI($);console.log(JSON.stringify(await bI(z.fileBuffer,z.fileName,I),null,2))}async function mD($,I,z,q,U){if($==="ready"||$==="status"){let Y=I??E(U.options.file)??E(U.options.input),J=await gD(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
`}function oZ($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function P0($,I={}){Lk1($,I);let z=`${JSON.stringify($,null,2)}
`;if(I.outputFile){Wk1(I.outputFile,z),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function Lk1($,I={}){if(I.allowFull||I.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>wk1)throw new zD(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function xR0($,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>Xk1||Y>Vk1)throw new zD(`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 V0($){return{allowFull:X0($.full)===!0,outputFile:E($.outputFile)??E($["output-file"])}}function uR0($=[]){console.log(SR0($))}var Xk1=100,Vk1=120000,yR0,wk1=200000;var n1=e(()=>{D4();H$();bp();yR0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var kR0={};o8(kR0,{selectCorp:()=>W1,runToolResult:()=>q2,runTool:()=>N0,globalConfigSummary:()=>z2});function W1($){let I=c8(),z=O4(),q=l7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},a9());return xA0(q.id),q}function z2($=O4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:mI()}}async function N0($,I,z,q,U={}){P0(await q2($,I,z,q),U)}async function q2($,I,z,q){let U=dZ.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 x4=e(()=>{e9();Li();CA();n1()});var yh0={};o8(yh0,{formatTenantDoctorDashboard:()=>Pf1,diagnoseTenantContract:()=>Af1});async function Af1($,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 O=await r6($);if(J=O.user,Q=O.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(O){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${O instanceof Error?O.message:String(O)}`,details:{error:String(O)},recommendation:`请执行 seal-use auth login --corp ${I.id} 重新登录或更新 Token`})}let K={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},H={used:0,remaining:0};try{let O=await C2($),F=Array.isArray(O.features)?O.features:[],D=F.find((A)=>A?.code==="ai-approval");if(D){let A=typeof D.balance==="number"?D.balance:0,T=typeof D.deductionAmount==="number"&&D.deductionAmount>0?D.deductionAmount:120,k=Math.floor(A/T);if(K.balance=A,K.deductionAmount=T,K.estimatedRuns=k,A<=0)K.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:A,deductionAmount:T,estimatedRuns:k},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(k<10)K.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${A} 点 (单笔扣除 ${T} 点),仅可支持约 ${k} 笔审核`,details:{balance:A,deductionAmount:T,estimatedRuns:k},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else K.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${A} 点,预估可支持 ${k} 笔审核单据`,details:{balance:A,deductionAmount:T,estimatedRuns:k}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:F.map((A)=>A?.code)}});let P=F.find((A)=>A?.code==="approval-rules");if(P)H.used=typeof P.used==="number"?P.used:0,H.remaining=typeof P.remaining==="number"?P.remaining:0}catch(O){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${O instanceof Error?O.message:String(O)}Line truncated
`)}var xh0=e(()=>{e4()});import{dirname as UW,resolve as Dg0}from"node:path";import{fileURLToPath as zb1}from"node:url";C8();function oz($){return!!$._zod}function T3($,I){if(oz($))return Rz($,I);return $.safeParse(I)}function EX($){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 ol($){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 G_="2025-11-25";var Wr=[G_,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],j3="io.modelcontextprotocol/related-task",YV="2.0",Q6=qV(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),Xr=t1([K0(),E1().int()]),Vr=K0(),Wc1=E6({ttl:E1().optional(),pollInterval:E1().optional()}),dx0=j0({ttl:E1().optional()}),mx0=j0({taskId:K0()}),Z_=E6({progressToken:Xr.optional(),[j3]:mx0.optional()}),t8=j0({_meta:Z_.optional()}),LQ=t8.extend({task:dx0.optional()}),wr=($)=>LQ.safeParse($).success,C6=j0({method:K0(),params:t8.loose().optional()}),L$=j0({_meta:Z_.optional()}),O$=j0({method:K0(),params:L$.loose().optional()}),_6=E6({_meta:Z_.optional()}),JV=t1([K0(),E1().int()]),Lr=j0({jsonrpc:y0(YV),id:JV,...C6.shape}).strict(),W_=($)=>Lr.safeParse($).success,Or=j0({jsonrpc:y0(YV),...O$.shape}).strict(),Fr=($)=>Or.safeParse($).success,X_=j0({jsonrpc:y0(YV),id:JV,result:_6}).strict(),OQ=($)=>X_.safeParse($).success;var V1;(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"})(V1||(V1={}));var V_=j0({jsonrpc:y0(YV),id:JV.optional(),error:j0({code:E1().int(),message:K0(),data:s1().optional()})}).strict();var Mr=($)=>V_.safeParse($).success;var Nr=t1([Lr,Or,X_,V_]),Xc1=t1([X_,V_]),QV=_6.strict(),lx0=L$.extend({requestId:JV.optional(),reason:K0().optional()}),KV=O$.extend({method:y0("notifications/cancelled"),params:lx0}),ox0=j0({src:K0(),mimeType:K0().optional(),sizes:Q1(K0()).optional(),theme:j6(["light","dark"]).optional()}),FQ=j0({icons:Q1(ox0).optional()}),qq=j0({name:K0(),title:K0().optional()}),Dr=qq.extend({...qq.shape,...FQ.shape,version:K0(),websiteUrl:K0().optional(),description:K0().optional()}),rx0=zq(j0({applyDefaults:p4().optional()}),d1(K0(),s1())),sx0=wQ(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},zq(j0({form:rx0.optional(),url:Q6.optional()}),d1(K0(),s1()).optional())),tx0=E6({list:Q6.optional(),cancel:Q6.optional(),requests:E6({sampling:E6({createMessage:Q6.optional()}).optional(),elicitation:E6({create:Q6.optional()}).optional()}).optional()}),ax0=E6({list:Q6.optional(),cancel:Q6.optional(),requests:E6({tools:E6({call:Q6.optional()}).optional()}).optional()}),ex0=j0({experimental:d1(K0(),Q6).optional(),sampling:j0({context:Q6.optional(),tools:Q6.optional()}).optional(),elicitation:sx0.optional(),roots:j0({listChanged:p4().optional()}).optional(),tasks:tx0.optional(),extensions:d1(K0(),Q6).optional()}),$u0=t8.extend({protocolVersion:K0(),capabilities:ex0,clientInfo:Dr}),w_=C6.extend({method:y0("initialize"),params:$u0});var Iu0=j0({experimental:d1(K0(),Q6).optional(),logging:Q6.optional(),completions:Q6.optional(),prompts:j0({listChanged:p4().optional()}).optional(),resources:j0({subscribe:p4().optional(),listChanged:p4().optional()}).optional(),tools:j0({listChanged:p4().optional()}).optional(),tasks:ax0.optional(),extensions:d1(K0(),Q6).optional()}),zu0=_6.extend({protocolVersion:K0(),capabilities:Iu0,serverInfo:Dr,instructions:K0().optional()}),L_=O$.extend({method:y0("notifications/initialized"),params:L$.optional()});var HV=C6.extend({method:y0("ping"),params:t8.optional()}),qu0=j0({progress:E1(),total:$4(E1()),message:$4(K0())}),Uu0=j0({...L$.shape,...qu0.shape,progressToken:Xr}),GV=O$.extend({method:y0("notifications/progress"),params:Uu0}),Yu0=t8.extend({cursor:Vr.optional()}),MQ=C6.extend({params:Yu0.optional()}),NQ=_6.extend({nextCursor:Vr.optional()}),Ju0=j6(["working","input_required","completed","failed","cancelled"]),DQ=j0({taskId:K0(),status:Ju0,ttl:t1([E1(),QQ()]),createdAt:K0(),lastUpdatedAt:K0(),pollInterval:$4(E1()),statusMessage:$4(K0())}),Uq=_6.extend({task:DQ}),Qu0=L$.merge(DQ),AQ=O$.extend({method:y0("notifications/tasks/status"),params:Qu0}),ZV=C6.extend({method:y0("tasks/get"),params:t8.extend({taskId:K0()})}),WV=_6.merge(DQ),XV=C6.extend({method:y0("tasks/result"),params:t8.extend({taskId:K0()})}),Vc1=_6.loose(),VV=MQ.extend({method:y0("tasks/list")}),wV=NQ.extend({tasks:Q1(DQ)}),LV=C6.extend({method:y0("tasks/cancel"),para Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),am0(I)}clear(){this._buffer=void 0}}function am0($){return Nr.parse(JSON.parse($))}function L00($){return JSON.stringify($)+`
`}class kR{constructor($=O00.stdin,I=O00.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new uR,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=L00($);if(this._stdout.write(z))I();else this._stdout.once("drain",I)})}}S8();import{dirname as Nd,join as sf1}from"node:path";import{fileURLToPath as tf1}from"node:url";import{spawnSync as O10}from"node:child_process";var JK={name:"seal-use",version:"0.10.22",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",archiver:"^8.0.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/archiver":"^8.0.0","@types/bun":"^1.3.14","@types/yauzl":"^3.4.0","bun-types":"^1.3.14",typescript:"^5.9.3",yaml:"^2.9.0"}};function il0($,I=JK.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 nl0($,I,z,q){let Y=z?`+g${z}${q?".dirty":""}`:q?"+dirty":"";return`${$}-dev.${I}${Y}`}function cl0($){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,H=I?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,G=I?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,Z=$?.cwd;if(z){let W=q==="true",w={name:"seal-use",version:z,channel:U||(W?"release":"dev"),isRelease:W};if(Y)w.git={baseVersion:Y,commitsAhead:Number.parseInt(J||"0",10),commit:Q||"",dirty:K==="true",describe:H||z};return w}if(q==="true"||G==="1")return{name:"seal-use",version:JK.version,channel:"release",isRelease:!0};try{let W=O10("git",["describe","--tags","--long","--dirty","--always"],{cwd:Z,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(W.status===0&&W.stdout){let X=il0(W.stdout.trim(),JK.version);if(X){if(!X.commit){let L=O10("git",["rev-parse","--short","HEAD"],{cwd:Z,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(L.status===0&&L.stdout)X.commit=L.stdout.trim()}return{name:"seal-use",version:nl0(X.baseVersion,X.commitsAhead,X.commit,X.dirty),channel:"dev",isRelease:!1,git:X}}}}catch{}return{name:"seal-use",version:`${JK.version}-dev.0+local`,channel:"dev",isRelease:!1}}var QK=cl0(),q1=QK.version,Jv=QK.isRelease,gs1=QK.channel;e4();dN();lN();x4();D4();n1();S8();x4();e4();e4();GZ();Pp();D4();n1();H$();import{existsSync as fR0}from"node:fs";async function bR0($,I){if(!fR0($))throw Error(`File not found: ${$}`);let z=Lz($);console.log(JSON.stringify(await wz(z.fileBuffer,z.fileName,I),null,2))}async function gA($,I,z,q,U){if($==="ready"||$==="status"){let Y=I??E(U.options.file)??E(U.options.input),J=await OA(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.erro Line truncated
`+`\uD83D\uDC49 查看全部请添加: seal-use corps list --all
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}P0(D.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=H1(q),Y=Jx(U.id),J=gX1(U);P0({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:_X1(U.source),relations:{testCorpId:U.testCorpId,prodCorpId:U.prodCorpId},auth:{refreshTtl:U.auth.refreshTtl}});return}if($==="current"){let q=H1(E(z.options.corp));P0({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=H1(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 L5(`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});P0({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 G=E(z.options.corp),W=E(z.options["test-corp"])??E(z.options.testCorp);if(G)q=G,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=H1(q),J=H1(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 L5(`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 G=Q?" --force":"";throw L5(`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${G}`)}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}),H=d7(J.id,{environment:"test",prodCorpId:Y.id});P0({success:!0,productionEnterprise:{id:w.id,name:w.name,environment:w.environment,testCorpId:w.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let q=I??E(z.options.corp),U=H1(q);if(!U.testCorpId&&!U.prodCorpId){P0({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 L5(`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{}P0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let q=I??E(z.options.corp),U=H1(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=H1(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 Q1(U),Q=await Q1(Y),[K,w,H,G,W,V,X,L]=await Promise.all([E1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),E1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),V6(J),V6(Q),r$(J).catch(()=>[]),r$(Q).catch(()=>[]),d9(J,{limit:100}).catch(()=>({articles:[]})),d9(Q,{limit:100}).catch(()=>({articles:[]}))]),O=(X.articles||[]).filter((m)=>!m.isDeleted),D=(L.articles||[]).filter((m)=>!m.isDeleted),A=new Map(D.map((m)=>[m.title.trim(),m])),T=[],M=[],j=new Set(O.map((m)=>m.title.trim()));for(let m of O){let B0=m.title.trim(),k0=A.get(B0);if(!k0)T.push(m);else{let W1=k0.content!==m.content,T4=(k0.purpose??"")!==(m.purpose??""),S4=k0.enabled!==m.enabled,b$=k0.contentType!==m.contentType,$$=(k0.status??"")!==(m.status??""),k6=JSON.stringify([...k0.scenarios??[]].sort())!==JSON.stringify([...m.scenarios??[]].sort()),n$=JSON.stringify([...k0.tags??[]].sort())!==JSON.stringify([...m.tags??[]].sort());if(W1||T4||S4||b$||$$||k6||n$)M.push({testId:k0.id,prodDoc:m,reasons:[...W1?["content"]:[],...T4?["purpose"]:[],...S4?["enabled"]:[],...b$?["contentType"]:[],...$$?["status"]:[],...k6?["scenarios"]:[],...n$?["tags"]:[]]})}}let x=D.filter((m)=>!j.has(m.title.trim())),b=[...W].sort((m,B0)=>B0.versionNumber-m.versionNumber)[0],R=b?.versionNumber,n=([...V].sort((m,B0)=>B0.versionNumber-m.versionNumber)[0]?.versionNumber??0)+1,C=AN0(U.name,R,V),p=E(z.options["version-name"])??E(z.options.versionName)??PN0(U.name,R,C,n),z0={...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){P0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:b?{versionNumber:b.versionNumber,versionName:b.versionName}:null,documentsCount:O.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:R??null,sourceProdVersionName:b?.versionName??null,targetTestExpectedVersionNumber:n,targetTestPublishVersionName:p,iteration:C},preferencesDiff:{decisionPreferences:{before:w.decisionPreferences,after:K.decisionPreferences},thinkingDepthPreference:{before:w.thinkingDepthPreference,after:K.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:G.rules.length,toDeleteCount:G.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((m,B0)=>({index:B0+1,sourceRuleId:m.id,sourceRuleCode:m.code??B0+1,expectedTargetCode:`rule-${B0+1}`,description:m.description,scope:m.scope,strictness:m.strictness}))},documentsPlan:{sourceDocumentCount:O.length,targetExistingDocumentCount:D.length,toCreateCount:T.length,toCreate:T.map((m)=>({title:m.title,purpose:m.purpose,contentType:m.contentType,scenarios:m.scenarios})),toUpdateCount:M.length,toUpdate:M.map((m)=>({targetDocumentId:m.testId,title:m.prodDoc.title,reasons:m.reasons})),toDeleteCount:x.length,toDelete:x.map((m)=>({targetDocumentId:m.id,title:m.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 m=(K.integrations??[]).filter((W1)=>W1.type==="hosecloud"),B0=new Set,k0=m.filter((W1)=>{let T4=W1.corporationId??U.id;if(B0.has(T4))return!1;return B0.add(T4),!0});return{sourceType:"hose",outboundName:RN0(U.name),targetMode:"assisted",integrationsCount:k0.length,integrations:k0.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 L5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${H.rules.length} draft rules, and ${O.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 p8(Q,z0,Y.seal.endpoints.approvalStylePreferences);let c=[];for(let m of x)await oW(Q,m.id),c.push({id:m.id,title:m.title});let r=[];for(let m of M)await lW(Q,m.testId,{title:m.prodDoc.title,purpose:m.prodDoc.purpose,content:m.prodDoc.content,contentType:m.prodDoc.contentType,status:m.prodDoc.status,enabled:m.prodDoc.enabled,scenarios:m.prodDoc.scenarios&&m.prodDoc.scenarios.le Line truncated
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}P0(F.map((D)=>({id:D.id,name:D.name,environment:D.environment??"production",sourceType:D.source.type,provider:D.source.provider??D.source.type,staffId:D.source.staffId,testCorpId:D.testCorpId,prodCorpId:D.prodCorpId,current:D.id===H})));return}if($==="get"||$==="show"){let q=I??E(z.options.corp);if(!q)throw g4("Usage: seal-use corps get <corpId>");let U=W1(q),Y=Wi(U.id),J=ok1(U);P0({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:rk1(U.source),relations:{testCorpId:U.testCorpId,prodCorpId:U.prodCorpId},auth:{refreshTtl:U.auth.refreshTtl}});return}if($==="current"){let q=W1(E(z.options.corp));P0({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 g4("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 g4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(X0(z.options.confirm)===!0||X0(z.options.yes)===!0))throw e5(`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=m7(U.id,{environment:Y});P0({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 Z=E(z.options.corp),W=E(z.options["test-corp"])??E(z.options.testCorp);if(Z)q=Z,U=I;else if(W)q=I,U=W}if(!q||!U)throw g4(`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 g4(`Cannot bind enterprise '${Y.id}' to itself.`);if(Y.prodCorpId&&Y.prodCorpId!==J.id)throw g4(`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 g4(`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=X0(z.options.force)===!0;if(Y.testCorpId&&Y.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Y.id){if(!Q)throw e5(`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(!(X0(z.options.confirm)===!0||X0(z.options.yes)===!0)){let Z=Q?" --force":"";throw e5(`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${Z}`)}if(Y.testCorpId&&Y.testCorpId!==J.id)try{m7(Y.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Y.id)try{m7(J.prodCorpId,{testCorpId:void 0})}catch{}let H=m7(Y.id,{environment:"production",testCorpId:J.id}),G=m7(J.id,{environment:"test",prodCorpId:Y.id});P0({success:!0,productionEnterprise:{id:H.id,name:H.name,environment:H.environment,testCorpId:H.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){P0({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(!(X0(z.options.confirm)===!0||X0(z.options.yes)===!0))throw e5(`Refusing to unbind production enterprise '${Y}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${U.id} --confirm`);m7(Y,{testCorpId:void 0});try{m7(J,{prodCorpId:void 0})}catch{}P0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let q=I??E(z.options.corp),U=W1(q);if(!U.testCorpId)throw g4(`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 K1(U),Q=await K1(Y),[K,H,G,Z,W,X,w,L]=await Promise.all([v1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),v1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),h6(J),h6(Q),N$(J).catch(()=>[]),N$(Q).catch(()=>[]),f3(J,{limit:100}).catch(()=>({articles:[]})),f3(Q,{limit:100}).catch(()=>({articles:[]}))]),O=(w.articles||[]).filter((o)=>!o.isDeleted),F=(L.articles||[]).filter((o)=>!o.isDeleted),D=new Map(F.map((o)=>[o.title.trim(),o])),P=[],A=[],T=new Set(O.map((o)=>o.title.trim()));for(let o of O){let E0=o.title.trim(),k0=D.get(E0);if(!k0)P.push(o);else{let L1=k0.content!==o.content,k4=(k0.purpose??"")!==(o.purpose??""),t4=k0.enabled!==o.enabled,Z$=k0.contentType!==o.contentType,T8=(k0.status??"")!==(o.status??""),J8=JSON.stringify([...k0.scenarios??[]].sort())!==JSON.stringify([...o.scenarios??[]].sort()),W$=JSON.stringify([...k0.tags??[]].sort())!==JSON.stringify([...o.tags??[]].sort());if(L1||k4||t4||Z$||T8||J8||W$)A.push({testId:k0.id,prodDoc:o,reasons:[...L1?["content"]:[],...k4?["purpose"]:[],...t4?["enabled"]:[],...Z$?["contentType"]:[],...T8?["status"]:[],...J8?["scenarios"]:[],...W$?["tags"]:[]]})}}let k=F.filter((o)=>!T.has(o.title.trim())),f=[...W].sort((o,E0)=>E0.versionNumber-o.versionNumber)[0],C=f?.versionNumber,i=([...X].sort((o,E0)=>E0.versionNumber-o.versionNumber)[0]?.versionNumber??0)+1,v=zh0(U.name,C,X),c=E(z.options["version-name"])??E(z.options.versionName)??qh0(U.name,C,v,i),$0={...H,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(X0(z.options["dry-run"])===!0||X0(z.options.dryRun)===!0){P0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:f?{versionNumber:f.versionNumber,versionName:f.versionName}:null,documentsCount:O.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:f?.versionName??null,targetTestExpectedVersionNumber:i,targetTestPublishVersionName:c,iteration:v},preferencesDiff:{decisionPreferences:{before:H.decisionPreferences,after:K.decisionPreferences},thinkingDepthPreference:{before:H.thinkingDepthPreference,after:K.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:G.rules.length,targetExistingDraftRuleCount:Z.rules.length,toDeleteCount:Z.rules.length,toCreateCount:G.rules.length,rulesToSync:G.rules.map((o,E0)=>({index:E0+1,sourceRuleId:o.id,sourceRuleCode:o.code??E0+1,expectedTargetCode:`rule-${E0+1}`,description:o.description,scope:o.scope,strictness:o.strictness}))},documentsPlan:{sourceDocumentCount:O.length,targetExistingDocumentCount:F.length,toCreateCount:P.length,toCreate:P.map((o)=>({title:o.title,purpose:o.purpose,contentType:o.contentType,scenarios:o.scenarios})),toUpdateCount:A.length,toUpdate:A.map((o)=>({targetDocumentId:o.testId,title:o.prodDoc.title,reasons:o.reasons})),toDeleteCount:k.length,toDelete:k.map((o)=>({targetDocumentId:o.id,title:o.title}))},publishingPlan:{targetCorpId:Y.id,publishVersionName:c,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 o=(K.integrations??[]).filter((L1)=>L1.type==="hosecloud"),E0=new Set,k0=o.filter((L1)=>{let k4=L1.corporationId??U.id;if(E0.has(k4))return!1;return E0.add(k4),!0});return{sourceType:"hose",outboundName:Hh0(U.name),targetMode:"assisted",integrationsCount:k0.length,integrations:k0.map((L1)=>({corporationId:L1.corporationId,apiOrigin:L1.apiOrigin,customApiUrl:L1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(X0(z.options.yes)===!0||X0(z.options.confirm)===!0))throw e5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${G.rules.length} draft rules, and ${O.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 T5(Q,$0,Y.seal.endpoints.approvalStylePreferences);let p=[];for(let o of k)await hw(Q,o.id),p.push({id:o.id,title:o.title});let s=[];for(let o of A)await vw(Q,o.testId,{title:o.prodDoc.title,purpose:o.prodDoc.purpose,content:o.prodDoc.content,contentType:o.prodDoc.contentType,status:o.prodDoc.status,enabled:o.prodDoc.enabled,scenarios:o.prodDoc.scenarios&&o.prodDoc.scenarios.le 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=H1(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((n)=>n.trim()).filter(Boolean):void 0,H=E(z.options.sn)??E(z.options.documentSn)??E(z.options["document-sn"]),G=E(z.options.sns)??E(z.options["document-sns"]),W=G?G.split(",").map((n)=>n.trim()).filter(Boolean):void 0,V=g0(z.options.limit)??(!Q&&!w&&!H&&!W?1:void 0),X=E(z.options.status),L=E(z.options.startDate)??E(z.options["start-date"]),O=E(z.options.endDate)??E(z.options["end-date"]),D=await Q1(U),A=U.id===J.id?D:await Q1(J),T=E(z.options.webhook)??E(z.options.selector),M=E(z.options.snSuffix)??E(z.options["sn-suffix"]),j=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"]),b=V0(z.options.dryRun)??V0(z.options["dry-run"]),R={recordId:Q,recordIds:w,sn:H,sns:W,limit:V,status:X,startDate:L,endDate:O};console.error(`[corps-replay-test] 正式企业「${U.name}」(${U.id}) -> 测试企业「${J.name}」(${J.id})`);let f=await aU({query:R,sourceClient:D,targetClient:A,sourceCorp:U,targetCorp:J,webhookSelector:T,snPrefix:j,snSuffix:M,docIdPrefix:h,docIdSuffix:x,dryRun:b});if(b){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=H1(q);uI({...U,stateful:!0,defaultCorpId:Y.id}),P0({current:!0,id:Y.id,name:Y.name});return}if($==="probe-hose"){await hX1(s6(z.json));return}if($==="hose-staffs"){await SX1(s6(z.json));return}if($==="add-hose"){await yX1(s6(z.json));return}if($==="add-seal"){await uX1(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 xX1(q,E(z.options.name),V0(z.options.overwrite)===!0);return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function RN0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function CX1($,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,H=[];for(let A of K){let T=A.corporationId??$.id;if(!w.has(T))w.add(T),H.push(A)}let G=Q.integrations??[],W=new Map(G.filter((A)=>A.type==="hosecloud").map((A)=>[A.corporationId,A])),V=RN0($.name),X=[],L=H.map((A)=>{let T=W.get(A.corporationId),M=T?.signKey??RX1(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}}),O=G.filter((A)=>A.type!=="hosecloud"),D={...Q,integrations:[...O,...L]};return await p8(q,D,I.seal.endpoints.approvalStylePreferences),{skipped:!1,synced:X}}async function hX1($){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 ${R.length} candidate administrators:
- ${f}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!L)if(!H&&Y)L=Y;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let O=b1($,"id")??W,D=V??W,A=b1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,T={id:O,name:D,environment:"production",seal:{url:A,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:G,appKey:z,appSecurity:q,corpId:W,staffId:L},auth:{refreshTtl:300}};if(H)RW(O),await ZY(T);let M=Yx();EN0(M,{recursive:!0,mode:448});let j=jN0(M,`${iD(O)}.json`);if(TN0(j)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${j}. Pass "overwrite": true to replace it.`);BN0(j,`${JSON.stringify(T,null,2)}
`,{mode:384}),P0({id:O,name:D,corpId:W,domain:G,staffId:L,verified:H,path:j})}async function uX1($){let I=L9($,"token"),z=(b1($,"sealUrl")??b1($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let q=Sk($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=gN0($),J=U?await kX1(z,I,p4(Y)):void 0;_N0($,{token:I,sealUrl:z,expiresIn:q,verify:U,remote:J,custom:Y})}function gN0($){return{headers:$x.parse($.headers),cookies:Ix.parse($.cookies)}}async function xX1($,I,z){let q=await gW($),U=d6(q.sealUrl,q.token),Y=await R6(U),J={user:Y.user,tenant:Y.tenant};_W(q.corpId,J.tenant),_N0({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 _N0($,I){let{token:z,sealUrl:q,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??gN0($),K=J?.user,w=J?.tenant,H=b1($,"tenantSlug")??a7(w?.tenantSlug),G=b1($,"tenantId")??a7(w?.id),W=b1($,"tenantName")??a7(w?.name),V=b1($,"id")??H??G;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),O=b1($,"corpId")??H??G??V,D={id:V,name:b1($,"name")??W??V,environment:"production",seal:{url:q,tenantSlug:H,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:O,tenantId:G,tenantSlug:H,tenantName:W,providerUserId:a7(K?.providerUserId),provider:L},auth:{refreshTtl:300}},A=Yx();EN0(A,{recursive:!0,mode:448});let T=jN0(A,`${iD(V)}.json`);if(TN0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);BN0(T,`${JSON.stringify(D,null,2)}
`,{mode:384}),P0({id:V,name:D.name,tenantId:G,tenantSlug:H,verified:Y,path:T})}async function kX1($,I,z={}){let q=d6($,I,z),U=await R6(q);return{user:U.user??{},tenant:U.tenant??{}}}function a7($){return typeof $==="string"&&$?$:void 0}F3();w$();c4();A4();H4();u1();async function CN0($,I){let z=await gW($),q=d6(z.sealUrl,z.token),U=await R6(q);_W(z.corpId,U.tenant);let Y=await $q(q,{note:I});P0({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 hN0($,I,z,q,U){if($==="list"){await F0("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 F0("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 F0("seal_delegation_revoke",z,q,{tokenId:Y},Z0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}A4();H4();u1();c4();k$();import{readFileSync as fX1}from"node:fs";async function SN0($,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"]),H=K?K.split(",").map((i)=>i.trim()).filter(Boolean):void 0,G=E(z.options.sn)??E(z.options.documentSn)??E(z.options["document-sn"]),Z=E(z.options.sns)??E(z.options["document-sns"]),W=Z?Z.split(",").map((i)=>i.trim()).filter(Boolean):void 0,X=R0(z.options.limit)??(!Q&&!H&&!G&&!W?1:void 0),w=E(z.options.status),L=E(z.options.startDate)??E(z.options["start-date"]),O=E(z.options.endDate)??E(z.options["end-date"]),F=await K1(U),D=U.id===J.id?F:await K1(J),P=E(z.options.webhook)??E(z.options.selector),A=E(z.options.snSuffix)??E(z.options["sn-suffix"]),T=E(z.options.snPrefix)??E(z.options["sn-prefix"]),k=E(z.options.docIdSuffix)??E(z.options["doc-id-suffix"]),h=E(z.options.docIdPrefix)??E(z.options["doc-id-prefix"]),f=X0(z.options.dryRun)??X0(z.options["dry-run"]),C={recordId:Q,recordIds:H,sn:G,sns:W,limit:X,status:w,startDate:L,endDate:O};console.error(`[corps-replay-test] 正式企业「${U.name}」(${U.id}) -> 测试企业「${J.name}」(${J.id})`);let b=await vY({query:C,sourceClient:F,targetClient:D,sourceCorp:U,targetCorp:J,webhookSelector:P,snPrefix:T,snSuffix:A,docIdPrefix:h,docIdSuffix:k,dryRun:f});if(f){console.error(`[corps-replay-test] 预览模式:已成功从 ${U.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${J.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${U.name}」)至「${J.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let q=I;if(!q)throw Error("Usage: seal-use corps switch <corpId>");let U=O4();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);lI({...U,stateful:!0,defaultCorpId:Y.id}),P0({current:!0,id:Y.id,name:Y.name});return}if($==="probe-hose"){await tk1(P8(z.json));return}if($==="hose-staffs"){await ak1(P8(z.json));return}if($==="add-hose"){await ek1(P8(z.json));return}if($==="add-seal"){await $f1(P8(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 If1(q,E(z.options.name),X0(z.options.overwrite)===!0);return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function Hh0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function sk1($,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([v1(z,$.seal.endpoints.approvalStylePreferences).catch(()=>({})),v1(q,I.seal.endpoints.approvalStylePreferences).catch(()=>({}))]),K=(J.integrations??[]).filter((D)=>D.type==="hosecloud");if(K.length===0)return{skipped:!0,reason:"prod Seal enterprise has no hosecloud integrations configured"};let H=new Set,G=[];for(let D of K){let P=D.corporationId??$.id;if(!H.has(P))H.add(P),G.push(D)}let Z=Q.integrations??[],W=new Map(Z.filter((D)=>D.type==="hosecloud").map((D)=>[D.corporationId,D])),X=Hh0($.name),w=[],L=G.map((D)=>{let P=W.get(D.corporationId),A=P?.signKey??lk1(6).toString("hex");return w.push({signKey:A,outboundName:X,corporationId:D.corporationId,action:P?"updated":"created"}),{type:"hosecloud",signKey:A,outboundName:X,mode:"assisted",apiKey:U,apiSecret:Y,apiOrigin:D.apiOrigin,...D.customApiUrl?{customApiUrl:D.customApiUrl}:{},corporationId:D.corporationId}}),O=Z.filter((D)=>D.type!=="hosecloud"),F={...Q,integrations:[...O,...L]};return await T5(q,F,I.seal.endpoints.approvalStylePreferences),{skipped:!1,synced:w}}async function tk1($){let I=G3($,"appKey"),z=G3($,"appSecurity"),q=l1($,"domain"),U=await Eq(I,z,q),Y=await Mw(U.domain,U.openapiToken).catch(()=>[]) Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${C.length} candidate administrators:
- ${b}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!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 O=l1($,"id")??W,F=X??W,D=l1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,P={id:O,name:F,environment:"production",seal:{url:D,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:Z,appKey:z,appSecurity:q,corpId:W,staffId:L},auth:{refreshTtl:300}};if(G)Xw(O),await LJ(P);let A=Zi();Yh0(A,{recursive:!0,mode:448});let T=Qh0(A,`${_A(O)}.json`);if(Uh0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);Jh0(T,`${JSON.stringify(P,null,2)}
`,{mode:384}),P0({id:O,name:F,corpId:W,domain:Z,staffId:L,verified:G,path:T})}async function $f1($){let I=G3($,"token"),z=(l1($,"sealUrl")??l1($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let q=yp($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=Gh0($),J=U?await zf1(z,I,K6(Y)):void 0;Zh0($,{token:I,sealUrl:z,expiresIn:q,verify:U,remote:J,custom:Y})}function Gh0($){return{headers:Ji.parse($.headers),cookies:Qi.parse($.cookies)}}async function If1($,I,z){let q=await Vw($),U=X8(q.sealUrl,q.token),Y=await r6(U),J={user:Y.user,tenant:Y.tenant};ww(q.corpId,J.tenant),Zh0({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 Zh0($,I){let{token:z,sealUrl:q,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??Gh0($),K=J?.user,H=J?.tenant,G=l1($,"tenantSlug")??Y2(H?.tenantSlug),Z=l1($,"tenantId")??Y2(H?.id),W=l1($,"tenantName")??Y2(H?.name),X=l1($,"id")??G??Z;if(!X)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let w=l1($,"staffId")??Y2(K?.providerUserId)??Y2(K?.id)??"seal",L=l1($,"provider")??Y2(K?.provider)??Y2(H?.providerConfig?.provider),O=l1($,"corpId")??G??Z??X,F={id:X,name:l1($,"name")??W??X,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:w,corpId:O,tenantId:Z,tenantSlug:G,tenantName:W,providerUserId:Y2(K?.providerUserId),provider:L},auth:{refreshTtl:300}},D=Zi();Yh0(D,{recursive:!0,mode:448});let P=Qh0(D,`${_A(X)}.json`);if(Uh0(P)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${P}. Pass "overwrite": true to replace it.`);Jh0(P,`${JSON.stringify(F,null,2)}
`,{mode:384}),P0({id:X,name:F.name,tenantId:Z,tenantSlug:G,verified:Y,path:P})}async function zf1($,I,z={}){let q=X8($,I,z),U=await r6(q);return{user:U.user??{},tenant:U.tenant??{}}}function Y2($){return typeof $==="string"&&$?$:void 0}j2();S8();e4();x4();D4();n1();async function Wh0($,I){let z=await Vw($),q=X8(z.sealUrl,z.token),U=await r6(q);ww(z.corpId,U.tenant);let Y=await _q(q,{note:I});P0({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 Xh0($,I,z,q,U){if($==="list"){await N0("seal_delegation_list",z,q,{},V0(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},V0(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},V0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}x4();D4();n1();e4();H$();import{readFileSync as qf1}from"node:fs";async function Vh0($,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>
@@ -910,22 +922,22 @@ 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 F0("seal_deploy_hosecloud_requirements",q,U,{},Z0(Y.options));return}if(Q==="list"){await F0("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 G=((await E1(q)).integrations??[]).filter((W)=>W.type==="hosecloud");if(G.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 H=$==="maycur"?"每刻报销":"汇联易";throw Error(`${H}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${H}' --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,{},V0(Y.options));return}if(Q==="list"){await N0("seal_deploy_hosecloud_list",q,U,{},V0(Y.options));return}if(Q==="get"){let H=K??E(Y.options.signKey)??E(Y.options["sign-key"]);if(!H){let Z=((await v1(q)).integrations??[]).filter((W)=>W.type==="hosecloud");if(Z.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 G){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 F4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,G.length===1?`seal-use deploy hosecloud get ${G[0].signKey} --corp ${U.id}`:void 0)}await F0("seal_deploy_hosecloud_get",q,U,{signKey:w},Z0(Y.options));return}if(Q==="status"){await F0("seal_deploy_hosecloud_status",q,U,{},Z0(Y.options));return}if(Q==="configure"){let w=E(Y.options.input),H=w?JSON.parse(fX1(w,"utf8")):s6(Y.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await F0("seal_deploy_hosecloud_configure",q,U,{...H,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"]),H=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&&H){let X=V.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${X})`),await F0("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 审批",O=X.signKey,D=X.apiOrigin??"production";console.error(` • "${L}" (signKey: ${O}, 环境: ${D})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${O} --corp ${U.id}
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let W of Z){let X=W.outboundName??"SealAI 审批",w=W.signKey,L=W.apiOrigin??"production";console.error(` • "${X}" (signKey: ${w}, 环境: ${L})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${w} --corp ${U.id}
`)}throw new h4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,Z.length===1?`seal-use deploy hosecloud get ${Z[0].signKey} --corp ${U.id}`:void 0)}await N0("seal_deploy_hosecloud_get",q,U,{signKey:H},V0(Y.options));return}if(Q==="status"){await N0("seal_deploy_hosecloud_status",q,U,{},V0(Y.options));return}if(Q==="configure"){let H=E(Y.options.input),G=H?JSON.parse(qf1(H,"utf8")):P8(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:X0(Y.options.dryRun)??X0(Y.options["dry-run"])},V0(Y.options));return}if(Q==="sync"){let H=K??E(Y.options.signKey)??E(Y.options["sign-key"]),G=X0(Y.options.auto)??X0(Y.options.yes);if(!H){let W=((await v1(q)).integrations??[]).filter((w)=>w.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${U.id}`);let X=W[0];if(X&&W.length===1&&G){let w=X.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${w})`),await N0("seal_deploy_hosecloud_sync",q,U,{signKey:w},V0(Y.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${U.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let w of W){let L=w.outboundName??"SealAI 审批",O=w.signKey,F=w.apiOrigin??"production";console.error(` • "${L}" (signKey: ${O}, 环境: ${F})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${O} --corp ${U.id}
`)}if(W.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${U.id}
`);throw new F4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,W.length===1?`seal-use deploy hosecloud sync ${W[0].signKey} --corp ${U.id}`:void 0)}await F0("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.`)}Fx();import{accessSync as $L1,constants as IL1,existsSync as x6,readdirSync as zL1}from"node:fs";import{homedir as qL1}from"node:os";import{join as D9}from"node:path";H9();import{existsSync as ak,mkdirSync as mN0,rmSync as aX1,writeFileSync as sX1}from"node:fs";import{homedir as lN0}from"node:os";import{dirname as eX1,join as sk}from"node:path";var yN0=`---
`);throw new h4("缺少必需参数 <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:H},V0(Y.options));return}throw Error(`Unknown deploy hosecloud action: ${Q??""}. Available: requirements, list, get, status, configure, sync.`)}Ei();import{accessSync as Ff1,constants as Mf1,existsSync as Y8,readdirSync as Nf1}from"node:fs";import{homedir as Df1}from"node:os";import{join as W3}from"node:path";e9();import{existsSync as ap,mkdirSync as Eh0,rmSync as wf1,writeFileSync as Lf1}from"node:fs";import{homedir as jh0}from"node:os";import{dirname as Of1,join as ep}from"node:path";var wh0=`---
name: seal-use
description: "v0.10.21: 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."
description: "v0.10.22: 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:
version: 0.10.21
short-description: Seal tenant and Hose approval automation (v0.10.21)
version: 0.10.22
short-description: Seal tenant and Hose approval automation (v0.10.22)
---
# Seal Use (v0.10.21)
# Seal Use (v0.10.22)
Use the \`seal_cli\` MCP tool when it is available; pass the command string as its \`command\` argument. If MCP is unavailable, fall back to the global \`seal-use\` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
@@ -1015,8 +1027,8 @@ seal-use corps list
- LLM Model Config & Providers: \`seal-use llm config --corp <corpId>\`, \`seal-use llm providers --corp <corpId>\`.
- System Permissions Config: \`seal-use permissions available --corp <corpId>\`, \`seal-use permissions configs --corp <corpId>\`.
- Billing & Feature Quotas: \`seal-use billing status --corp <corpId>\`, \`seal-use billing plans --corp <corpId>\`, \`seal-use billing features --corp <corpId>\`.
- Webhook 准备看板与审批回调管理: \`seal-use webhook ready [<材料包.zip>] [--webhook <idOrName>] --corp <corpId>\` 检查企业环境、租户连通性、已激活通道与材料包预检;\`seal-use webhook <list|get|add|update|delete> --corp <corpId>\`.
- Webhook 材料包导入: \`seal-use webhook material-pack preview <材料包.zip> --corp <corpId>\` 只做本地校验和解析(无网络请求);\`... push <材料包.zip> [--webhook <idOrName>] --corp <corpId>\` 上传附件并通过入站 Webhook 触发 AI 审批(租户仅有 1 个通道时自动锁定无需指定 \`--webhook\`)。每个 Webhook 可配置材料包附件的最小字节数、可选最大字节数和文件后缀白名单;这是可修改的持久化策略,不是不可绕过的硬编码。校验不通过时不会上传附件或推送单据。材料包格式:ZIP 根目录名 = \`documentId\`(或 \`documentId@annotation\`),Excel 附件列以 \`[附件]\` 为前缀(如 \`[附件]合同协议\`),单元格值为 ZIP 相对路径(支持多行/逗号/分号分隔);系统执行严格双向验证(Excel 声明的路径必须在 ZIP 中存在,ZIP 中的文件必须在某个 \`[附件]\` 列中声明)。详见 \`references/cli.md\` 中 "Material Pack Workflow" 一节。它与 \`simulation material_pack\` 的官方服务端导入流程相互独立。
- Webhook 准备看板与审批回调管理: \`seal-use webhook ready [<资源包.zip>] [--webhook <idOrName>] --corp <corpId>\` 检查企业环境、租户连通性、已激活通道与资源包预检;\`seal-use webhook <list|get|add|update|delete> --corp <corpId>\`.
- Webhook 资源包管理 (Webhook Resource Pack): \`seal-use webhook resource-pack export [--limit <n>] [--status <status>] [--output <file.zip>] [--to-downloads] --corp <corpId>\` 从线上审核记录直接打包导出为标准 Webhook 资源包(包含根目录 \`信息表.xlsx\` 与下载好的单据附件),便于通过邮件/微信等第三方渠道离线分发;\`seal-use webhook resource-pack preview <资源包.zip> --corp <corpId>\` 本地预检单据与附件;\`seal-use webhook resource-pack push <资源包.zip> [--webhook <idOrName>] --corp <corpId>\` 上传附件并通过入站 Webhook 触发 AI 审批(租户仅有 1 个通道时自动锁定无需指定 \`--webhook\`)。CLI 简写别名 \`pack\`,旧名 \`material-pack\` 完整向下兼容保留。每个 Webhook 可配置资源包附件的最小字节数、可选最大字节数和文件后缀白名单;这是可修改的持久化策略,不是不可绕过的硬编码。校验不通过时不会上传附件或推送单据。资源包格式:ZIP 根目录名 = \`documentId\`(或 \`documentId@annotation\`),Excel 附件列以 \`[附件]\` 为前缀(如 \`[附件]合同协议\`),单元格值为 ZIP 相对路径(支持多行/逗号/分号分隔);系统执行严格双向验证(Excel 声明附件的单据必须有对应根目录,ZIP 中的文件必须在某个 \`[附件]\` 列中声明)。详见 \`references/cli.md\` 中 "Webhook Resource Pack Workflow" 一节。它与 Seal 官方在模拟测试中使用的 \`simulation material_pack\` 流程相互独立,避免混淆。
- 审批记录转 Webhook 重放 (Universal Record Replay): \`seal-use webhook replay [<recordId>] [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--sn-suffix <str>] [--dry-run] [--force] [--corp <corpId>]\` 以及生产测专用快捷命令 \`seal-use corps replay-test [<prodCorpId>] [--force]\`。通用支持从历史审批记录(Webhook 来源、Hose 来源等)汲取结构化表单与明细字段,自动清洗规范化字段类型,支持按状态/数量批量重放到目标企业 Webhook 触发审批。默认推荐并导向测试企业(测试企业无 Webhook 时自动开通辅助模式通道并锁定环境隔离);若用户未绑定测试企业或明确要求向生产企业重放,支持通过 \`--force\` 显式执行,方便环境回归验证与 Bad Case 靶向调试。
- HTTP REST API & Docs Server: \`seal-use http [--port 8787] [--host 127.0.0.1]\` (提供 \`/docs\` 交互文档、\`/openapi.json\`、\`POST /api/cli\` 与 \`/v1/*\` REST API)。
@@ -1113,11 +1125,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 uN0=`interface:
`;var Lh0=`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 xN0=`# Rule Lightweight Queries
`;var Oh0=`# 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.
@@ -1228,7 +1240,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 kN0=`# Approval Bad Case Catalog
`;var Fh0=`# 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.
@@ -1278,7 +1290,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 fN0="# 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 Mh0="# 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.
@@ -1499,7 +1511,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 iN0=`# Customer Feedback Rule Remediation
`;var Ah0=`# 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.
@@ -1669,7 +1681,7 @@ Return a compact report containing:
- New version number and version name, if published
- Verification result
- Whether a regression rerun was performed
`;var pN0=`# Enterprise Onboarding
`;var Ph0=`# 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.
@@ -1803,7 +1815,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 cN0=`# Hose Enterprise Auth
`;var Bh0=`# Hose Enterprise Auth
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
@@ -1868,7 +1880,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 dN0=`# Hose Enterprise Initialization & Automated Discovery
`;var Th0=`# 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.
@@ -1974,7 +1986,7 @@ seal-use corps hose-staffs --json '{
}'
\`\`\`
* 直接使用指定 ID 完成接入并进行连通性验证。
`;var oN0={"SKILL.md":yN0,"agents/openai.yaml":uN0,"references/rule-lightweight.md":xN0,"references/approval-bad-cases.md":kN0,"references/cli.md":fN0,"references/approval-run-lightweight.md":bN0,"references/approval-attachment-trace.md":nN0,"references/customer-feedback-rule-remediation.md":iN0,"references/enterprise-onboarding.md":pN0,"references/hose-enterprise-auth.md":cN0,"references/hose-enterprise-init.md":dN0};function rN0(){return oN0["SKILL.md"]||""}function cI(){return sk(lN0(),".agents","skills","seal-use")}function tN0(){return sk(lN0(),".agents","skills","seal-home")}function aN0(){let $=tN0();if(ak($))try{return aX1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function ek($=cI()){aN0(),mN0($,{recursive:!0});let I=[];for(let[z,q]of Object.entries(oN0)){let U=sk($,z);mN0(eX1(U),{recursive:!0}),sX1(U,q,"utf8"),I.push(z)}return{targetDir:$,files:I}}function $f(){let $=tN0(),I=cI(),z=ak($),q=ak(I);if(z||q)return aN0(),ek(I),{synced:!0,targetDir:I};return{synced:!1}}var If=[{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"}],zf=[{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 路径杜绝写文件与环境篡改。"}],qf=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同 Line truncated
`;var Ch0={"SKILL.md":wh0,"agents/openai.yaml":Lh0,"references/rule-lightweight.md":Oh0,"references/approval-bad-cases.md":Fh0,"references/cli.md":Mh0,"references/approval-run-lightweight.md":Nh0,"references/approval-attachment-trace.md":Dh0,"references/customer-feedback-rule-remediation.md":Ah0,"references/enterprise-onboarding.md":Ph0,"references/hose-enterprise-auth.md":Bh0,"references/hose-enterprise-init.md":Th0};function _h0(){return Ch0["SKILL.md"]||""}function Mz(){return ep(jh0(),".agents","skills","seal-use")}function Rh0(){return ep(jh0(),".agents","skills","seal-home")}function vh0(){let $=Rh0();if(ap($))try{return wf1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function $d($=Mz()){vh0(),Eh0($,{recursive:!0});let I=[];for(let[z,q]of Object.entries(Ch0)){let U=ep($,z);Eh0(Of1(U),{recursive:!0}),Lf1(U,q,"utf8"),I.push(z)}return{targetDir:$,files:I}}function Id(){let $=Rh0(),I=Mz(),z=ap($),q=ap(I);if(z||q)return vh0(),$d(I),{synced:!0,targetDir:I};return{synced:!1}}var zd=[{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"}],qd=[{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 路径杜绝写文件与环境篡改。"}],Ud=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同 Line truncated
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
@@ -1997,14 +2009,14 @@ seal-use corps hose-staffs --json '{
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
| :--- | :--- | :--- | :--- |
${If.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
${zd.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
`)}
---
## 3. 安全与数据隐私保证
${zf.map(($,I)=>`### 3.${I+1} ${$.topic}
${qd.map(($,I)=>`### 3.${I+1} ${$.topic}
- **安全承诺**:${$.guarantee}
- **实现约束**:${$.enforcement}
`).join(`
@@ -2014,7 +2026,7 @@ ${zf.map(($,I)=>`### 3.${I+1} ${$.topic}
## 4. 业务域能力图谱
${qf.map(($)=>`### \`seal-use ${$.domain}\`
${Ud.map(($)=>`### \`seal-use ${$.domain}\`
* **能力定位**:${$.summary}
* **核心命令**:${$.primaryCommands.map((I)=>`\`seal-use ${I}\``).join("、")}
`).join(`
@@ -2027,15 +2039,15 @@ ${qf.map(($)=>`### \`seal-use ${$.domain}\`
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
`}function eN0($){if(!x6($))return 0;try{return zL1($).filter((I)=>I.endsWith(".json")).length}catch{return 0}}function $N($){try{return $L1($,IL1.W_OK),!0}catch{return!1}}function Uf(){let $=qL1(),I=D9($,".config","seal-use"),z=D9(I,"enterprises"),q=D9(I,"config.json"),U=D9(I,"seal_tokens.json"),Y=D9(I,"mappings"),J=cI(),Q=D9($,"Downloads"),w=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",D9($,".local","bin","seal-use"),D9($,"bin","seal-use")].find((M)=>x6(M))??process.execPath,H={configDir:{name:"配置根目录",path:I,exists:x6(I),writable:x6(I)?$N(I):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:x6(z),writable:x6(z)?$N(z):!1,fileCount:eN0(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:eN0(Y),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:x6(D9(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:Q,exists:x6(Q),writable:x6(Q)?$N(Q):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:Q8,exists:x6(Q8),writable:x6(Q8)?$N(Q8):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:K8,exists:x6(K8),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:w,exists:x6(w),description:"系统全局命令执行入口"}},G=[];try{G=D$()}catch{G=[]}let V=K4().defaultCorpId??G[0]?.id,X=G.find((M)=>M.id===V),L=G.filter((M)=>(M.environment??"production").toLowerCase()==="test").length,O=G.length-L,D=[];if(D.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),H.configDir?.exists&&H.configDir.writable)D.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${I} (正常读写)`});else if(H.configDir?.exists)D.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${I} (存在但可能不可写)`});else D.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${I},首次运行配置命令时将自动创建`});if(G.length>0)D.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${G.length} 家企业 (正式: ${O}, 测试: ${L})`});else D.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(H.agentSkillDir?.exists)D.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else D.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let A=D.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:H,enterprises:{total:G.length,productionCount:O,testCount:L,activeCorpId:X?.id,activeCorpName:X?.name},checks:D,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:If.length,securityPoliciesCount:zf.length,domainCapabilitiesCount:qf.length,guideCommand:"seal-use doctor guide"}}}function $F0($){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
`)}H4();u1();async function qF0($,I,z){let q=($??I??"").toLowerCase();if(q==="guide"||q==="doc"||q==="knowledge"||q==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(sN0());return}if(q==="paths"||q==="dirs"||q==="directories"){let J=Uf();P0(J.directories);return}if(q==="tenant"||q==="corp"||q==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (A4(),UD0)),{createSealClient:Q}=await Promise.resolve().then(() => (w$(),Or)),{stringOption:K}=await Promise.resolve().then(() => (H4(),tO0)),{diagnoseTenantContract:w,formatTenantDoctorDashboard:H}=await Promise.resolve().then(() => (zF0(),IF0)),G=K(z.options.corp)??(I&&I!==q?I:void 0)??(z.command[2]&&z.command[2]!==q?z.command[2]:void 0),W=J(G),V=await Q(W),X=await w(V,W);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(H(X));P0(X);return}let U=Uf();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error($F0(U));P0(U)}H4();import{createServer as HL1}from"node:http";A4();import{URL as QL1}from"node:url";var UF0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.21",description:`Planned HTTP contract for the seal-use wrapped backend API.
`}function gh0($){if(!Y8($))return 0;try{return Nf1($).filter((I)=>I.endsWith(".json")).length}catch{return 0}}function iA($){try{return Ff1($,Mf1.W_OK),!0}catch{return!1}}function Yd(){let $=Df1(),I=W3($,".config","seal-use"),z=W3(I,"enterprises"),q=W3(I,"config.json"),U=W3(I,"seal_tokens.json"),Y=W3(I,"mappings"),J=Mz(),Q=W3($,"Downloads"),H=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",W3($,".local","bin","seal-use"),W3($,"bin","seal-use")].find((A)=>Y8(A))??process.execPath,G={configDir:{name:"配置根目录",path:I,exists:Y8(I),writable:Y8(I)?iA(I):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:Y8(z),writable:Y8(z)?iA(z):!1,fileCount:gh0(z),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:q,exists:Y8(q),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:U,exists:Y8(U),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Y,exists:Y8(Y),fileCount:gh0(Y),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:Y8(W3(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:Q,exists:Y8(Q),writable:Y8(Q)?iA(Q):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:y$,exists:Y8(y$),writable:Y8(y$)?iA(y$):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:x$,exists:Y8(x$),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:H,exists:Y8(H),description:"系统全局命令执行入口"}},Z=[];try{Z=c8()}catch{Z=[]}let X=O4().defaultCorpId??Z[0]?.id,w=Z.find((A)=>A.id===X),L=Z.filter((A)=>(A.environment??"production").toLowerCase()==="test").length,O=Z.length-L,F=[];if(F.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),G.configDir?.exists&&G.configDir.writable)F.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${I} (正常读写)`});else if(G.configDir?.exists)F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${I} (存在但可能不可写)`});else F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${I},首次运行配置命令时将自动创建`});if(Z.length>0)F.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${Z.length} 家企业 (正式: ${O}, 测试: ${L})`});else F.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(G.agentSkillDir?.exists)F.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else F.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let D=F.some((A)=>A.status==="warn"||A.status==="error"),P=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:D?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:q1,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:P},directories:G,enterprises:{total:Z.length,productionCount:O,testCount:L,activeCorpId:w?.id,activeCorpName:w?.name},checks:F,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:zd.length,securityPoliciesCount:qd.length,domainCapabilitiesCount:Ud.length,guideCommand:"seal-use doctor guide"}}}function Sh0($){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
`)}D4();n1();async function uh0($,I,z){let q=($??I??"").toLowerCase();if(q==="guide"||q==="doc"||q==="knowledge"||q==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(hh0());return}if(q==="paths"||q==="dirs"||q==="directories"){let J=Yd();P0(J.directories);return}if(q==="tenant"||q==="corp"||q==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (x4(),kR0)),{createSealClient:Q}=await Promise.resolve().then(() => (S8(),L10)),{stringOption:K}=await Promise.resolve().then(() => (D4(),RR0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:G}=await Promise.resolve().then(() => (xh0(),yh0)),Z=K(z.options.corp)??(I&&I!==q?I:void 0)??(z.command[2]&&z.command[2]!==q?z.command[2]:void 0),W=J(Z),X=await Q(W),w=await H(X,W);if(!(X0(z.options.quiet)||X0(z.options.silent)))console.error(G(w));P0(w);return}let U=Yd();if(!(X0(z.options.quiet)||X0(z.options.silent)))console.error(Sh0(U));P0(U)}D4();import{createServer as Cf1}from"node:http";x4();import{URL as Tf1}from"node:url";var kh0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.22",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" />
@@ -2059,24 +2071,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 JF0($,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 QL1($.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"){wL1(I,200,YF0());return}if(J==="GET"&&Y==="/openapi.json"){e1(I,200,IN());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 qN($),K=(typeof Q?.command==="string"?Q.command:"").trim();if(!K){zN(I,400,"Missing 'command' property in request body");return}let w=Yf(K),H=w[0]==="seal-use"||w[0]==="seal-home"||w[0]?.endsWith("/seal-use")||w[0]?.endsWith("/seal-home")?w.slice(1):w,G=await Lw(H),W=void 0;try{if(G.stdout.trim().startsWith("{")||G.stdout.trim().startsWith("["))W=JSON.parse(G.stdout)}catch{}e1(I,G.isError?400:200,{success:!G.isError,stdout:G.stdout,stderr:G.stderr,exitCode:G.exitCode,data:W});return}if(J==="POST"&&Y.startsWith("/api/tool/")){let Q=Y.slice(10).trim(),K=n4(Q);if(!K){zN(I,404,`Tool not found: '${Q}'`);return}let w=await qN($)||{},H=e6($,U,w),G=H1(H),W=await Q1(G),V={...w};delete V.corp;let X=await t4(K,W,V,G);e1(I,200,X);return}if(Y.startsWith("/v1/")){if(await KL1($,I,J,Y,U))return}zN(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let K=Q instanceof Error?Q.message:String(Q);zN(I,500,K)}}async function KL1($,I,z,q,U){let Y=Object.fromEntries(U.searchParams.entries());if(z==="GET"&&q==="/v1/corps"){let J=D$(),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=H1(J),K=await Q1(Q),w=n4("seal_whoami"),H=await t4(w,K,{},Q);return e1(I,200,H),!0}if(z==="GET"&&q==="/v1/session"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_session_get"),H=await t4(w,K,{},Q);return e1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/summary"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_approval_runs_summary"),H=await t4(w,K,Y,Q);return e1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/stats"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_approval_runs_stats"),H=await t4(w,K,Y,Q);return e1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/pick"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_approval_run_pick"),H=await t4(w,K,Y,Q);return e1(I,200,H),!0}if(z==="GET"&&q==="/v1/approval-runs/url"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_approval_run_url_get"),H=await t4(w,K,Y,Q);return e1(I,200,H),!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),H=H1(w),G=await Q1(H);if(!K){let W=n4("seal_approval_run_get"),V=await t4(W,G,{recordId:Q,...Y},H);return e1(I,200,V),!0}if(K==="attachments"){let W=n4("seal_approval_run_attachments_get"),V=await t4(W,G,{recordId:Q,...Y},H);return e1(I,200,V),!0}if(K==="cited-rules"){let W=n4("seal_approval_run_cited_rules_get"),V=await t4(W,G,{recordId:Q,...Y},H);return e1(I,200,V),!0}if(K==="document-summary"){let W=n4("seal_approval_run_document_summary_get"),V=await t4(W,G,{recordId:Q,...Y},H);return e1(I,200,V),!0}if(K==="result"){let W=n4("seal_approval_run_result_get"),V=await t4(W,G,{recordId:Q,...Y},H);return e1(I,200,V),!0}}}if(z==="GET"&&q==="/v1/approval-runs"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_approval_runs_search"),H=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,H),!0}if(z==="GET"&&q==="/v1/approval/rules"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_approval_rules_list"),H=await t4(w,K,Y,Q);return e1(I,200,H),!0}if(z==="GET"&&q==="/v1/simulation/batches"){let J=e6($,U,Y),Q=H1(J),K=await Q1(Q),w=n4("seal_simulation_batches_list"),H=await t4(w,K,Y,Q);return e1(I,200,H),!0}if(z==="POST"&&q==="/v1/simulation/create-batch"){let J=await qN($)||{},Q=e6($,U,J),K=H1(Q),w=await Q1Line truncated
</html>`}async function L6($,I,z,q){let U=$.handler;return U(I,z,{corp:q})}async function bh0($,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 Tf1($.url||"/",`${q}://${z}`),Y=U.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Y==="/"){Q4(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"){jf1(I,200,fh0());return}if(J==="GET"&&Y==="/openapi.json"){Q4(I,200,nA());return}if(J==="GET"&&Y==="/health"){Q4(I,200,{status:"ok",version:q1,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Y==="/shutdown"||Y==="/api/shutdown")){Q4(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 pA($),K=(typeof Q?.command==="string"?Q.command:"").trim();if(!K){cA(I,400,"Missing 'command' property in request body");return}let H=Jd(K),G=H[0]==="seal-use"||H[0]==="seal-home"||H[0]?.endsWith("/seal-use")||H[0]?.endsWith("/seal-home")?H.slice(1):H,Z=await $W(G),W=void 0;try{if(Z.stdout.trim().startsWith("{")||Z.stdout.trim().startsWith("["))W=JSON.parse(Z.stdout)}catch{}Q4(I,Z.isError?400:200,{success:!Z.isError,stdout:Z.stdout,stderr:Z.stderr,exitCode:Z.exitCode,data:W});return}if(J==="POST"&&Y.startsWith("/api/tool/")){let Q=Y.slice(10).trim(),K=J6(Q);if(!K){cA(I,404,`Tool not found: '${Q}'`);return}let H=await pA($)||{},G=B8($,U,H),Z=W1(G),W=await K1(Z),X={...H};delete X.corp;let w=await L6(K,W,X,Z);Q4(I,200,w);return}if(Y.startsWith("/v1/")){if(await Ef1($,I,J,Y,U))return}cA(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let K=Q instanceof Error?Q.message:String(Q);cA(I,500,K)}}async function Ef1($,I,z,q,U){let Y=Object.fromEntries(U.searchParams.entries());if(z==="GET"&&q==="/v1/corps"){let J=c8(),Q=O4();return Q4(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=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_whoami"),G=await L6(H,K,{},Q);return Q4(I,200,G),!0}if(z==="GET"&&q==="/v1/session"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_session_get"),G=await L6(H,K,{},Q);return Q4(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/summary"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_approval_runs_summary"),G=await L6(H,K,Y,Q);return Q4(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/stats"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_approval_runs_stats"),G=await L6(H,K,Y,Q);return Q4(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/pick"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_approval_run_pick"),G=await L6(H,K,Y,Q);return Q4(I,200,G),!0}if(z==="GET"&&q==="/v1/approval-runs/url"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_approval_run_url_get"),G=await L6(H,K,Y,Q);return Q4(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 H=B8($,U,Y),G=W1(H),Z=await K1(G);if(!K){let W=J6("seal_approval_run_get"),X=await L6(W,Z,{recordId:Q,...Y},G);return Q4(I,200,X),!0}if(K==="attachments"){let W=J6("seal_approval_run_attachments_get"),X=await L6(W,Z,{recordId:Q,...Y},G);return Q4(I,200,X),!0}if(K==="cited-rules"){let W=J6("seal_approval_run_cited_rules_get"),X=await L6(W,Z,{recordId:Q,...Y},G);return Q4(I,200,X),!0}if(K==="document-summary"){let W=J6("seal_approval_run_document_summary_get"),X=await L6(W,Z,{recordId:Q,...Y},G);return Q4(I,200,X),!0}if(K==="result"){let W=J6("seal_approval_run_result_get"),X=await L6(W,Z,{recordId:Q,...Y},G);return Q4(I,200,X),!0}}}if(z==="GET"&&q==="/v1/approval-runs"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_approval_runs_search"),G=await L6(H,K,{...Y,limit:Y.limit?Number(Y.limit):void 0,offset:Y.offset?Number(Y.offset):void 0,includeBridge:Y.includeBridge==="true"},Q);return Q4(I,200,G),!0}if(z==="GET"&&q==="/v1/approval/rules"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_approval_rules_list"),G=await L6(H,K,Y,Q);return Q4(I,200,G),!0}if(z==="GET"&&q==="/v1/simulation/batches"){let J=B8($,U,Y),Q=W1(J),K=await K1(Q),H=J6("seal_simulation_batches_list"),G=await L6(H,K,Y,Q);return Q4(I,200,G),!0}if(z==="POST"&&q==="/v1/simulation/create-batch"){let J=await pA($)||{},Q=B8($,U,J),K=W1(Q),H=await K1Line 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 QF0($){let I=g0($.options.port)??g0($.options.p),z=E($.options.host)??E($.options.h),q=await JN({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 KF0($,I,z,q){if($==="config"||$==="get"){await F0("seal_llm_config_get",I,z,{},Z0(q.options));return}if($==="providers"||$==="list"){await F0("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 wF0($,I){if($==="config"||$==="json"){Jf();return}await Qf()}function Jf(){P0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}u1();function HF0($){let I=IN();P0(I,{...Z0($.options),allowFull:!0})}A4();u1();async function GF0($,I,z,q){if($==="available"){await F0("seal_permissions_available_list",I,z,{},Z0(q.options));return}if($==="configs"||$==="list"){await F0("seal_permissions_configs_list",I,z,{},Z0(q.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}A4();H4();u1();import{readFileSync as WF0}from"node:fs";async function VF0($,I,z,q,U,Y,J){if(!$||$==="get"){await F0("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(WF0(Q,"utf8")):s6(J.json);if(!K||Object.keys(K).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await F0("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 F0("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 F0("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(WF0(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 F0("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 F0("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.`)}H9();w$();c4();async function ZF0($={}){let I=D$(),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 Q1(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))}H4();async function XF0($,I,z){let q=I??E(z.options.corp)??($&&$!=="--corp"?$:void 0);await ZF0({corpId:q})}Ax();A4();k$();H4();u1();async function Kf($,I,z,q,U){if($==="count"){await F0("seal_approval_rules_list",z,q,{countOnly:!0},Z0(U.options));return}if($==="list"){if(V0(U.options.count)){await F0("seal_approval_rules_list",z,q,{countOnly:!0},Z0(U.options));return}let Y=g0(U.options.limit),J=g0(U.options.offset);if(V0(U.options.summary)){await F0("seal_approval_rules_list",z,q,{fields:ID0,limit:Y,offset:J},Z0(U.options));return}let Q=await r7("seal_approval_rules_list",z,q,{limit:Y,offset:J});zD0(Q,V0(U.options.full)===!0),P0(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 L5("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"){P0({...Q,nextCommand:`seal-use rules clear --corp ${q.id} --yes`},Z0(U.options));return}P0(Q,Z0(U.options));return}if($==="versions"){await F0("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 XL1($){let I=HN($),z=Gf($),q=Ow($);NF0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):UN),Y=$.host??(process.env.HOST?process.env.HOST:YN);KN(I,`${process.pid}
`,{mode:384}),KN(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 JN({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)}`),wN(I)===process.pid)F5(I,{force:!0}),F5(z,{force:!0});throw K}let Q=()=>{if(J)J.close(),J=null;if(wN(I)===process.pid)F5(I,{force:!0}),F5(z,{force:!0});XY(q,`stopped pid=${process.pid}`)};await new Promise((K)=>{let w=!1,H=()=>{if(w)return;w=!0,Q(),process.off("SIGTERM",H),process.off("SIGINT",H),K()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function LF0($){NF0($.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=GL1(z.command,q,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=HN($);return KN(Y,`${U.pid}
`,{mode:384}),XY(Ow($),`started pid=${U.pid}`),{started:!0,...LY($)}}function OF0($,I={}){let z=HN($),q=Gf($),U=wN(z);if(!U||!DF0(U,$.appRoot))return F5(z,{force:!0}),F5(q,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),F5(z,{force:!0}),F5(q,{force:!0}),XY(Ow($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function DF0($,I){if(!LL1($))return!1;try{let z=WL1("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 LL1($){try{return process.kill($,0),!0}catch{return!1}}function HN($){return Hf($.stateDir,"service.pid")}function Gf($){return Hf($.stateDir,"service.json")}function Ow($){return Hf($.stateDir,"service.log")}function wN($){if(!QN($))return;let I=Number(wf($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function NF0($){VL1($,{recursive:!0,mode:448})}function XY($,I){KN($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}u1();H4();var Wf=DL1(OL1(),".config","seal-use");async function Vf($,I,z){let q=z?g0(z.options.port)??g0(z.options.p):void 0,U=z?E(z.options.host)??E(z.options.h):void 0,Y=z?g0(z.options.lines)??g0(z.options.n):void 0,J=await dI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Wf,version:q1,launcher:I.launcher,port:q,host:U},{maxLines:Y});if(J!==void 0)P0(J)}A4();H4();u1();import{existsSync as NL1,readFileSync as FF0}from"node:fs";async function MF0($,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 F0("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(FF0(Q,"utf8")):void 0,w=E(U.options.input),H=w?JSON.parse(FF0(w,"utf8")):s6(U.json),G=E(U.options.packageId)??E(U.options["package-id"]),W=U6(U.options.packageIds)??U6(U.options["package-ids"])??(G?[G]:void 0),V=U6(U.options.flowIds)??U6(U.options["flow-ids"])??U6(U.options.documentSn)??U6(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 F0("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:G,templateId:E(U.options.templateId)??E(U.options["template-id"]),schemaConfig:K,requestIds:U6(U.options.requestIds)??U6(U.options["request-ids"]),workflowTypeId:E(U.options.workflowTypeId)??E(U.options["workflow-type-id"]),flowStatusList:U6(U.options.flowStatusList)?.map(Number)??U6(U.options["flow-status-list"])?.map(Number),businessCodes:U6(U.options.businessCodes)??U6(U.options["business-codes"]),documentType:E(U.options.documentType)??E(U.options["document-type"]),startTime:g0(U.options.startTime)??g0(U.options["start-time"]),endTime:g0(U.options.endTime)??g0(U.options["end-time"]),status:U6(U.options.status),limit:g0(U.options.limit),noWait:L,rawParams:H},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 F0("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 F0("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 F0("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 F0("seal_simulation_specifications_list",z,q,{signKey:Y},Z0(U.options));return}if($==="approval-definitions"||$==="definitions"){await F0("seal_simulation_feishu_approval_definitions_list",z,q,{},Z0(U.options));return}if($==="list"){await F0("seal_simulation_batches_list",z,q,{limit:g0(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 F0("seal_simulation_batch_get",z,q,{batchId:Y},Z0(U.options));return}if($==="templates"){await F0("seal_simulation_templates_get",z,q,{},Z0(U.options));return}if($==="integrations"){await F0("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(!NL1(Y))throw Error(`File not found: ${Y}`);await F0("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 AF0}from"node:fs";import{join as GN}from"node:path";H4();u1();function PF0($,I,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${rN0()}
`);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?GN(process.cwd(),".agents","skills","seal-use"):cI(),J=ek(Y);P0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let q=cI(),U=GN(process.cwd(),".agents","skills","seal-use");P0({global:{dir:q,installed:AF0(GN(q,"SKILL.md"))},local:{dir:U,installed:AF0(GN(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}u1();async function TF0($,I){if($==="config"){P0(await ZY(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}k$();A4();H4();u1();w$();k$();c4();aK();function Zf($){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 EF0($){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:H=fetch}=$;if(z.environment!=="test")throw new F4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${I.id} <testCorpId>`);let G=await M3(U),V=(Array.isArray(G.features)?G.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,O=Y*L;if(X<O)throw new F4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${X} 点,本次回归抽样 ${Y} 笔需要约 ${O} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(X/L))})`);let D=await s4(q,{limit:Y,status:"completed"}),A=Array.isArray(D.records)?D.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 F4(`在母企业「${I.name}」(${I.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(A=A.slice(0,Y),J){let u=A.map((c)=>{let r=c.sourceDocumentSN??c.id,q0=c?.result?.decision??c.aiDecision??c?.decision,w0=Zf(q0),M0=c?.result?.summary??c.aiSummary;return{sn:r,sourceRecordId:c.id,prodDecision:w0,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:O},metrics:{sampleCount:u.length,successCount:u.length,failureCount:0,matchCount:u.length,flipCount:0,concordanceRate:1},flips:[],records:u}}let T=await Vx(U,z),M=[];for(let u of A){let c=Date.now(),r=u.sourceDocumentSN??u.id,q0=Zf(u?.result?.decision??u.aiDecision??u?.decision),w0=u?.result?.summary??u.aiSummary;try{let M0=await X4(q,u.id),R0=`${w}${r}`,U1=Gx(M0,{snPrefix:w,docIdPrefix:w});await Wx(T.incomingDocumentWebhook.url,T.secret,U1,H,p4(z.seal));let x0=null,r0=Date.now();while(Date.now()-r0<K){await new Promise((S4)=>setTimeout(S4,Q));let T4=await s4(U,{sourceDocumentSN:R0,limit:1});if(T4.records&&T4.records.length>0){let S4=T4.records[0];if(S4.status==="completed"||S4.status==="failed"){x0=S4;break}}}if(!x0){M.push({sn:r,sourceRecordId:u.id,prodDecision:q0,prodSummary:w0,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(K/1000)}s 未完成)`,durationMs:Date.now()-c});continue}let I1=Zf(x0?.result?.decision??x0.aiDecision??x0?.decision??(x0.status==="completed"?"APPROVE":"ERROR")),m=x0?.result?.summary??x0.aiSummary,B0=q0===I1,k0=B0?"MATCHED":"FLIPPED",W1={sn:r,sourceRecordId:u.id,prodDecision:q0,prodSummary:w0,testRecordId:x0.id,testDecision:I1,testSummary:m,status:k0,durationMs:Date.now()-c};if(!B0)W1.diff={from:q0,to:I1,reasonDiff:m&&w0&&m!==w0?`生产: ${w0.slice(0,60)}... -> 测试: ${m.slice(0,60)}...`:void 0};M.push(W1)}catch(M0){M.push({sn:r,sourceRecordId:u.id,prodDecision:q0,prodSummary:w0,status:"FAILED",error:M0 instanceof Error?M0.message:String(M0),durationMs:Date.now()-c})}}let j=M.filter((u)=>u.status==="MATCHED"||u.status==="FLIPPED"),x=M.filter((u)=>u.status==="MATCHED"),h=M.filter((u)=>u.status==="FLIPPED"),b=M.filter((u)=>u.status==="FAILED").length,R=x.length,f=h.length,n=R+f,C=n>0?R/n:0,k=f>0,p=k?"REGRESSIONS_DETECTED":"CLEAN",z0=!k&&b===0,v;try{let u=await M3(U),r=(Array.isArray(u.features)?u.features:[]).find((q0)=>q0?.code==="ai-approval");if(typeof r?.balance==="number")v=r.balance}catch{}return{ok:!k&&b===0,verdict:p,safeToPublish:z0,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:O,balanceAfter:v},metrics:{sampleCount:M.length,successCount:j.length,failureCount:b,matchCount:R,flipCount:f,concordanceRate:Number(C.toFixed(4))},flips:h,records:M}}function BF0($){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)",H=["",`\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){H.push(` ⚠️ 决策翻转清单 (${Q.length} 笔单据在新规则下结果改变):`);for(let G of Q)if(H.push(` • 单据 [${G.sn}]: 原生产判定「${G.prodDecision}」 ➔ 测试新判定「${G.testDecision}」`),G.diff?.reasonDiff)H.push(` 理由差异: ${G.diff.reasonDiff}`);H.push(" "+"─".repeat(65)),H.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(q==="CLEAN")H.push(" ✓ 全部样本在新规则下的审核决策与生产历史 1 Line truncated
`)}async function Xf($,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=H1(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 F4(`测试企业「${Y.name}」(${Y.id}) 未绑定生产母企业,无法拉取历史样本。
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${Y.id}`);J=H1(A)}else{J=Y;let A=E(z.options["test-corp"])??E(z.options.test)??Y.testCorpId;if(!A)throw new F4(`生产企业「${Y.name}」(${Y.id}) 未绑定测试靶场企业。
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);Q=H1(A)}let K=await Q1(J),w=await Q1(Q),H=g0(z.options.samples)??g0(z.options.limit)??g0(z.options.n)??10,G=V0(z.options["dry-run"]),W=V0(z.options["fail-on-flips"]),V=g0(z.options["poll-interval"])??2000,X=g0(z.options.timeout)??45000,L=E(z.options["sn-prefix"])??"REG_",O=await EF0({sourceCorp:J,targetCorp:Q,sourceClient:K,targetClient:w,samples:H,dryRun:G,pollIntervalMs:V,timeoutMs:X,snPrefix:L,failOnFlips:W});if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(BF0(O));if(P0(O),W&&!O.ok)throw new F4(`回归测试发现 ${O.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new F4(`未知的 test 子命令: "${q}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}A4();H4();u1();async function jF0($,I,z,q){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await F0($,I,z,s6(q.json),Z0(q.options))}nD();u1();function vF0(){P0(Qw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as FL1,mkdirSync as ML1,renameSync as Lf,rmSync as AL1,unlinkSync as hF0,writeFileSync as RF0}from"node:fs";import{dirname as PL1,join as gF0}from"node:path";import{spawnSync as mI}from"node:child_process";function WN($=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 SF0="yunyingk/seal-use",Nw="yunyingk/seal-home";var TL1="SEAL_USE_GITHUB_REPO",EL1="SEAL_HOME_GITHUB_REPO";async function yF0($,I={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Wf,version:q1,launcher:$.launcher},q=I.repo||process.env[TL1]?.trim()||process.env[EL1]?.trim()||SF0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let M=Y.replace(/^v/,""),j=uF0(M,q1);if(j<0)if(!Nj&&I.force);else{P0({updated:!1,currentVersion:q1,targetVersion:M,mode:WN()?"binary":"source",message:!Nj?`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(j===0&&!I.force){P0({updated:!1,currentVersion:q1,targetVersion:M,mode:WN()?"binary":"source",message:`seal-use is already at version v${q1}. Use --force to reinstall.`});return}}if(I.changelogOnly){let M=await Of(q,I.limit??10);P0({currentVersion:q1,totalQueried:M.length,releases:M.map((j)=>({version:j.version,tagName:j.tagName,publishedAt:j.publishedAt,author:j.author,releaseNotes:j.notes,releaseUrl:j.htmlUrl,isCurrent:j.version===q1,isNewer:Dw(j.version,q1)}))});return}if(!WN()){if(I.checkOnly){let j=await Of(q,30),x=j[0],h=x?.version??q1,b=j.find((n)=>n.version===q1),R=Dw(h,q1),f=j.filter((n)=>Dw(n.version,q1));P0({updated:!1,updateAvailable:R,currentVersion:q1,currentVersionPublishedAt:b?.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=LY(z).running;if(M)await dI("stop",z);try{CF0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(j){console.error(`git pull skipped: ${j instanceof Error?j.message:String(j)}`)}if(CF0("bun",["install"],{cwd:$.appRoot}),M)await dI("start",z);P0({updated:!0,serviceRestarted:M,version:q1,mode:"source"});return}let J=BL1(),Q=jL1(),K=await Of(q,30),w=Y?K.find((M)=>M.version===Y||M.tagName===Y||M.tagName===`v${Y}`)??await _F0(q,Y):K[0]??await _F0(q);if(!w){P0({updated:!1,currentVersion:q1,mode:"binary",message:`Failed to query releases from repository '${q}'`});return}let H=w.version,G=K.find((M)=>M.version===q1),W=Dw(H,q1),V=W||Boolean(I.force),X=K.filter((M)=>Dw(M.version,q1));if(I.checkOnly){P0({updated:!1,updateAvailable:W,currentVersion:q1,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,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){P0({updated:!1,currentVersion:q1,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:w.publishedAt,mode:"binary",message:`seal-use is already up to date (v${q1})`});return}let L=vL1(w.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${H}. Available assets: ${w.assets.map((M)=>M.name).join(", ")}`);let O=LY(z).running;if(O)await dI("stop",z);let D=process.execPath,A=PL1(D),T=gF0(A,`.tmp-update-${Date.now()}`);ML1(T,{recursive:!0});try{let M=gF0(T,L.name);await RL1(L.downloadUrl,M,w.tagName,L.name);let j=M;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))j=gL1(M,T,J);else if(L.name.endsWith(".zip"))j=_L1(M,T,J);if(FL1(j,493),process.platform==="darwin")try{mI("/usr/bin/codesign",["--remove-signature",j],{stdio:"ignore"}),mI("/usr/bin/codesign",["--force","--sign","-",j],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let h=`${D}.old.${Date.now()}`;try{Lf(D,h)}catch{}Lf(j,D)}else Lf(j,D);if(O)await dI("start",z);let x=$f();P0({updated:!0,fromVersion:q1,toVersion:H,serviceRestarted:O,skillSynced:x.synced?x.targetDir:!1,mode:"binary"})}finally{try{AL1(T,{recursive:!0,force:!0})}catch{}}}function BL1(){if(process.platform==="darwin")retur Line truncated
`)}catch{}}async function RL1($,I,z,q){let U=Df(),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/${SF0}/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,H=6000,G=6000,W=307200,V=1e4,X=180000;for(let L=0;L<K.length;L++){let O=K[L],D=new AbortController,A="",T=(h)=>{A=h;try{D.abort()}catch{}},M=setTimeout(()=>{T("Connection timed out (no response headers within 6s)")},H),j,x;try{VN(`==> [${L+1}/${K.length}] Downloading via: ${O}`);let h=await fetch(O,{signal:D.signal});if(M)clearTimeout(M),M=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);j=setTimeout(()=>{T("Overall download time exceeded 3 minutes")},X);let b=Number(h.headers.get("content-length"))||0,R=h.body?.getReader();if(!R){let p=Buffer.from(await h.arrayBuffer());if(p.length<1000)throw Error(`Downloaded content is suspiciously small (${p.length} bytes)`);RF0(I,p),VN(`✓ Download succeeded (${(p.length/1024/1024).toFixed(1)} MB)`);return}let f=[],n=0,C=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...`)}},G);while(!0){let p=R.read(),z0,v=new Promise((q0,w0)=>{z0=setTimeout(()=>{w0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),u;try{u=await Promise.race([p,v])}finally{if(z0)clearTimeout(z0)}let{done:c,value:r}=u;if(c)break;if(r){if(f.push(r),n+=r.length,x&&n>=W)clearTimeout(x),x=void 0;let q0=Date.now();if(q0-C>200){C=q0;let w0=b?Math.round(n/b*100):0,M0=(n/1048576).toFixed(1),R0=b?(b/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${w0}% (${M0} / ${R0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let k=Buffer.concat(f);if(k.length<1000)throw Error(`Downloaded content is suspiciously small (${k.length} bytes)`);RF0(I,k),VN(`✓ Download completed successfully (${(k.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(M)clearTimeout(M);if(x)clearTimeout(x);if(j)clearTimeout(j);let b=A||(h instanceof Error?h.message:String(h));w=Error(b),VN(`
↳ Mirror failed: ${w.message}`)}finally{if(M)clearTimeout(M);if(x)clearTimeout(x);if(j)clearTimeout(j)}}throw Error(`Failed to download asset from all mirrors: ${w?.message}`)}function gL1($,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()}`);hF0($);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 _L1($,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()}`);hF0($);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 uF0($,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 uF0($,I)>0}function CF0($,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();H4();u1();async function xF0($,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 F0("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 F0("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 F0("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 F0("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 F0("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 F0("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 F0("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();H4();fk();u1();var kF0=Nf(Nf(Nf(hL1(import.meta.url)))),SL1=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"]),yL1=new Set(["http","server","web","mcp"]);function uL1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(I&&yL1.has(I))return!0;if((I==="service"||I==="daemon")&&z==="run")return!0;return!1}var fF0=Promise.resolve();function Lw($,I={}){if(uL1($))return bF0($,I);let z=fF0.then(()=>bF0($,I));return fF0=z.then(()=>{return},()=>{return}),z}async function bF0($,I){let z=[],q=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??kF0,entryFile:I.entryFile??CL1(I.appRoot??kF0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{z.push(bk(Q))},console.error=(...Q)=>{q.push(bk(Q))};try{return await xL1($,J),{stdout:ww(z),stderr:ww(q),isError:!1,exitCode:0}}catch(Q){let K=Hw(Q instanceof Error?Q.message:String(Q)),w=JD(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 xL1($,I){let z=hk($),[q,U,Y]=z.command;if(q==="version"||q==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){P0(YQ);return}let J=eO0(z);if(J.isHelp){qD0(J.target);return}if(!q||!SL1.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 JD0(w,GY(z.options));return}if(q==="openapi"){HF0(z);return}if(q==="mcp-config"){Jf();return}if(q==="skill"){PF0(U,Y,z);return}if(q==="mcp"||q==="server"){await wF0(U,z);return}if(q==="probe"){await XF0(U,Y,z);return}if(q==="doctor"){await qF0(U,Y,z);return}if(q==="test"){await Xf(U,Y,z);return}if(q==="config"){VD0(U,Y,z);return}if(q==="service"){await Vf(U,I,z);return}if(q==="stop"){await Vf("stop",I,z);return}if(q==="http"||q==="serve"){await QF0(z);return}if(q==="update"||q==="changelog"){let w=q==="changelog"||U==="changelog"||U==="log"||U==="history"||V0(z.options.changelog)===!0,H=U==="check"||V0(z.options.check)===!0||V0(z.options["check-only"])===!0,G=E(z.options.version)??E(z.options.tag)??(!w&&!H&&U&&!U.startsWith("-")?U:void 0);await yF0(I,{checkOnly:H,changelogOnly:w,lim Line truncated
`);U(q)})})}async function ih0($){let I=R0($.options.port)??R0($.options.p),z=E($.options.host)??E($.options.h),q=await lA({port:I,host:z}),U=()=>{q.close(()=>{process.exit(0)})};process.on("SIGINT",U),process.on("SIGTERM",U),await new Promise(()=>{})}x4();n1();async function nh0($,I,z,q){if($==="config"||$==="get"){await N0("seal_llm_config_get",I,z,{},V0(q.options));return}if($==="providers"||$==="list"){await N0("seal_llm_providers_list",I,z,{},V0(q.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}n1();async function ch0($,I){if($==="config"||$==="json"){Qd();return}await Kd()}function Qd(){P0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}n1();function ph0($){let I=nA();P0(I,{...V0($.options),allowFull:!0})}x4();n1();async function dh0($,I,z,q){if($==="available"){await N0("seal_permissions_available_list",I,z,{},V0(q.options));return}if($==="configs"||$==="list"){await N0("seal_permissions_configs_list",I,z,{},V0(q.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}x4();D4();n1();import{readFileSync as mh0}from"node:fs";async function lh0($,I,z,q,U,Y,J){if(!$||$==="get"){await N0("seal_preference_get",U,Y,{},V0(J.options));return}if($==="decision"){if(I==="update"||!I){let Q=E(J.options.input),K=Q?JSON.parse(mh0(Q,"utf8")):P8(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:X0(J.options.dryRun)??X0(J.options["dry-run"])},V0(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:X0(J.options.dryRun)??X0(J.options["dry-run"])},V0(J.options));return}if(I==="policies"){if(z==="list"||!z){await N0("seal_preference_thinking_depth_policies_list",U,Y,{},V0(J.options));return}if(z==="upsert"){let Q=E(J.options.input),K=Q?JSON.parse(mh0(Q,"utf8")):P8(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:X0(J.options.dryRun)??X0(J.options["dry-run"])},V0(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:X0(J.options.dryRun)??X0(J.options["dry-run"])},V0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}e9();S8();e4();async function oh0($={}){let I=c8(),z=O4(),q=l7(I,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},a9());console.log(`[probe] corp=${q.id} source=${q.source.type}`);let U=await LJ(q);console.log("[probe] seal enterprise"),console.log(JSON.stringify(U,null,2));let Y=await K1(q),J=await xw(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))}D4();async function rh0($,I,z){let q=I??E(z.options.corp)??($&&$!=="--corp"?$:void 0);await oh0({corpId:q})}Ci();x4();H$();D4();n1();async function Hd($,I,z,q,U){if($==="count"){await N0("seal_approval_rules_list",z,q,{countOnly:!0},V0(U.options));return}if($==="list"){if(X0(U.options.count)){await N0("seal_approval_rules_list",z,q,{countOnly:!0},V0(U.options));return}let Y=R0(U.options.limit),J=R0(U.options.offset);if(X0(U.options.summary)){await N0("seal_approval_rules_list",z,q,{fields:yR0,limit:Y,offset:J},V0(U.options));return}let Q=await q2("seal_approval_rules_list",z,q,{limit:Y,offset:J});xR0(Q,X0(U.options.full)===!0),P0(Q);return}if($==="clear"){let Y=X0(U.options.yes)===!0,J=X0(U.options.dryRun)??X0(U.options["dry-run"])??!Y;if(!Y&&!J)throw e5("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${q.id} --dry-run`);let Q=await q2("seal_approval_rules_clear",z,q,{dryRun:J,recode:X0(U.options.recode)});if(!Y&&J&&Q&&typeof Q==="object"){P0({...Q,nextCommand:`seal-use rules clear --corp ${q.id} --yes`},V0(U.options));return}P0(Q,V0(U.options));return}if($==="versions"){await N0("seal_approval_rule_versions_list",z,q,{},V0(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 gf1($){let I=tA($),z=Wd($),q=IW($);eh0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):dA),Y=$.host??(process.env.HOST?process.env.HOST:mA);rA(I,`${process.pid}
`,{mode:384}),rA(z,JSON.stringify({pid:process.pid,port:U,host:Y,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),OJ(q,`service starting on http://${Y}:${U} pid=${process.pid}`);let J=null;try{J=await lA({port:U,host:Y,silent:!0}),OJ(q,`service listening pid=${process.pid}`)}catch(K){if(OJ(q,`service failed to bind port ${U}: ${K instanceof Error?K.message:String(K)}`),sA(I)===process.pid)K9(I,{force:!0}),K9(z,{force:!0});throw K}let Q=()=>{if(J)J.close(),J=null;if(sA(I)===process.pid)K9(I,{force:!0}),K9(z,{force:!0});OJ(q,`stopped pid=${process.pid}`)};await new Promise((K)=>{let H=!1,G=()=>{if(H)return;H=!0,Q(),process.off("SIGTERM",G),process.off("SIGINT",G),K()};process.once("SIGTERM",G),process.once("SIGINT",G)})}function sh0($){eh0($.stateDir);let I=FJ($);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=_f1(z.command,q,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=tA($);return rA(Y,`${U.pid}
`,{mode:384}),OJ(IW($),`started pid=${U.pid}`),{started:!0,...FJ($)}}function th0($,I={}){let z=tA($),q=Wd($),U=sA(z);if(!U||!ah0(U,$.appRoot))return K9(z,{force:!0}),K9(q,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),K9(z,{force:!0}),K9(q,{force:!0}),OJ(IW($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function ah0($,I){if(!Sf1($))return!1;try{let z=Rf1("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 Sf1($){try{return process.kill($,0),!0}catch{return!1}}function tA($){return Zd($.stateDir,"service.pid")}function Wd($){return Zd($.stateDir,"service.json")}function IW($){return Zd($.stateDir,"service.log")}function sA($){if(!oA($))return;let I=Number(Gd($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function eh0($){vf1($,{recursive:!0,mode:448})}function OJ($,I){rA($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}n1();D4();var Xd=xf1(yf1(),".config","seal-use");async function Vd($,I,z){let q=z?R0(z.options.port)??R0(z.options.p):void 0,U=z?E(z.options.host)??E(z.options.h):void 0,Y=z?R0(z.options.lines)??R0(z.options.n):void 0,J=await Nz($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Xd,version:q1,launcher:I.launcher,port:q,host:U},{maxLines:Y});if(J!==void 0)P0(J)}x4();D4();n1();import{existsSync as uf1,readFileSync as $g0}from"node:fs";async function Ig0($,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)},V0(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($g0(Q,"utf8")):void 0,H=E(U.options.input),G=H?JSON.parse($g0(H,"utf8")):P8(U.json),Z=E(U.options.packageId)??E(U.options["package-id"]),W=P6(U.options.packageIds)??P6(U.options["package-ids"])??(Z?[Z]:void 0),X=P6(U.options.flowIds)??P6(U.options["flow-ids"])??P6(U.options.documentSn)??P6(U.options["document-sn"]),w=E(U.options.signKey)??E(U.options["sign-key"])??E(U.options.integration),L=X0(U.options.noWait)??X0(U.options["no-wait"]);await N0("seal_simulation_batch_create",z,q,{mode:J,sourceSystem:J,flowIds:X,documentSn:X,rejectNodeName:E(U.options.rejectNode)??E(U.options["reject-node"])??null,thinkingDepthOverride:E(U.options.thinkingDepth)??E(U.options["thinking-depth"]),skipInvoiceGeneration:X0(U.options.skipInvoiceGeneration)??X0(U.options["skip-invoice-generation"]),skipExpenseExtraction:X0(U.options.skipExpenseExtraction)??X0(U.options["skip-expense-extraction"]),disableAttachmentCache:X0(U.options.disableAttachmentCache)??X0(U.options["disable-attachment-cache"]),signKey:w,packageIds:W,packageId:Z,templateId:E(U.options.templateId)??E(U.options["template-id"]),schemaConfig:K,requestIds:P6(U.options.requestIds)??P6(U.options["request-ids"]),workflowTypeId:E(U.options.workflowTypeId)??E(U.options["workflow-type-id"]),flowStatusList:P6(U.options.flowStatusList)?.map(Number)??P6(U.options["flow-status-list"])?.map(Number),businessCodes:P6(U.options.businessCodes)??P6(U.options["business-codes"]),documentType:E(U.options.documentType)??E(U.options["document-type"]),startTime:R0(U.options.startTime)??R0(U.options["start-time"]),endTime:R0(U.options.endTime)??R0(U.options["end-time"]),status:P6(U.options.status),limit:R0(U.options.limit),noWait:L,rawParams:G},V0(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"])},V0(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},V0(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},V0(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},V0(U.options));return}if($==="approval-definitions"||$==="definitions"){await N0("seal_simulation_feishu_approval_definitions_list",z,q,{},V0(U.options));return}if($==="list"){await N0("seal_simulation_batches_list",z,q,{limit:R0(U.options.limit)},V0(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},V0(U.options));return}if($==="templates"){await N0("seal_simulation_templates_get",z,q,{},V0(U.options));return}if($==="integrations"){await N0("seal_simulation_integrations_get",z,q,{},V0(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(!uf1(Y))throw Error(`File not found: ${Y}`);await N0("seal_simulation_material_package_upload",z,q,{filePath:Y},V0(U.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as zg0}from"node:fs";import{join as aA}from"node:path";D4();n1();function qg0($,I,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${_h0()}
`);return}if($==="install"||$==="init"||$==="sync"){let q=X0(z.options.local)||X0(z.options.workspace),U=E(z.options.dir)??E(z.options.target)??I,Y=U?U:q?aA(process.cwd(),".agents","skills","seal-use"):Mz(),J=$d(Y);P0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let q=Mz(),U=aA(process.cwd(),".agents","skills","seal-use");P0({global:{dir:q,installed:zg0(aA(q,"SKILL.md"))},local:{dir:U,installed:zg0(aA(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}n1();async function Ug0($,I){if($==="config"){P0(await LJ(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}H$();x4();D4();n1();S8();H$();e4();GZ();function wd($){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 Yg0($){let{sourceCorp:I,targetCorp:z,sourceClient:q,targetClient:U,samples:Y=10,dryRun:J=!1,pollIntervalMs:Q=2000,timeoutMs:K=45000,snPrefix:H="REG_",fetchFn:G=fetch}=$;if(z.environment!=="test")throw new h4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${I.id} <testCorpId>`);let Z=await C2(U),X=(Array.isArray(Z.features)?Z.features:[]).find((u)=>u?.code==="ai-approval"),w=typeof X?.balance==="number"?X.balance:0,L=typeof X?.deductionAmount==="number"&&X.deductionAmount>0?X.deductionAmount:120,O=Y*L;if(w<O)throw new h4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${w} 点,本次回归抽样 ${Y} 笔需要约 ${O} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(w/L))})`);let F=await a4(q,{limit:Y,status:"completed"}),D=Array.isArray(F.records)?F.records:[];if(D.length===0){let u=await a4(q,{limit:Y});D=Array.isArray(u.records)?u.records:[]}if(D.length===0)throw new h4(`在母企业「${I.name}」(${I.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(D=D.slice(0,Y),J){let u=D.map((p)=>{let s=p.sourceDocumentSN??p.id,U0=p?.result?.decision??p.aiDecision??p?.decision,H0=wd(U0),D0=p?.result?.summary??p.aiSummary;return{sn:s,sourceRecordId:p.id,prodDecision:H0,prodSummary:D0,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:w,deductionAmount:L,estimatedRequired:O},metrics:{sampleCount:u.length,successCount:u.length,failureCount:0,matchCount:u.length,flipCount:0,concordanceRate:1},flips:[],records:u}}let P=await Mi(U,z),A=[];for(let u of D){let p=Date.now(),s=u.sourceDocumentSN??u.id,U0=wd(u?.result?.decision??u.aiDecision??u?.decision),H0=u?.result?.summary??u.aiSummary;try{let D0=await z4(q,u.id),_0=`${H}${s}`,Y1=Oi(D0,{snPrefix:H,docIdPrefix:H});await Fi(P.incomingDocumentWebhook.url,P.secret,Y1,G,K6(z.seal));let u0=null,r0=Date.now();while(Date.now()-r0<K){await new Promise((t4)=>setTimeout(t4,Q));let k4=await a4(U,{sourceDocumentSN:_0,limit:1});if(k4.records&&k4.records.length>0){let t4=k4.records[0];if(t4.status==="completed"||t4.status==="failed"){u0=t4;break}}}if(!u0){A.push({sn:s,sourceRecordId:u.id,prodDecision:U0,prodSummary:H0,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(K/1000)}s 未完成)`,durationMs:Date.now()-p});continue}let I1=wd(u0?.result?.decision??u0.aiDecision??u0?.decision??(u0.status==="completed"?"APPROVE":"ERROR")),o=u0?.result?.summary??u0.aiSummary,E0=U0===I1,k0=E0?"MATCHED":"FLIPPED",L1={sn:s,sourceRecordId:u.id,prodDecision:U0,prodSummary:H0,testRecordId:u0.id,testDecision:I1,testSummary:o,status:k0,durationMs:Date.now()-p};if(!E0)L1.diff={from:U0,to:I1,reasonDiff:o&&H0&&o!==H0?`生产: ${H0.slice(0,60)}... -> 测试: ${o.slice(0,60)}...`:void 0};A.push(L1)}catch(D0){A.push({sn:s,sourceRecordId:u.id,prodDecision:U0,prodSummary:H0,status:"FAILED",error:D0 instanceof Error?D0.message:String(D0),durationMs:Date.now()-p})}}let T=A.filter((u)=>u.status==="MATCHED"||u.status==="FLIPPED"),k=A.filter((u)=>u.status==="MATCHED"),h=A.filter((u)=>u.status==="FLIPPED"),f=A.filter((u)=>u.status==="FAILED").length,C=k.length,b=h.length,i=C+b,v=i>0?C/i:0,y=b>0,c=y?"REGRESSIONS_DETECTED":"CLEAN",$0=!y&&f===0,R;try{let u=await C2(U),s=(Array.isArray(u.features)?u.features:[]).find((U0)=>U0?.code==="ai-approval");if(typeof s?.balance==="number")R=s.balance}catch{}return{ok:!y&&f===0,verdict:c,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:w,deductionAmount:L,estimatedRequired:O,balanceAfter:R},metrics:{sampleCount:A.length,successCount:T.length,failureCount:f,matchCount:C,flipCount:b,concordanceRate:Number(v.toFixed(4))},flips:h,records:A}}function Jg0($){let{sourceCorp:I,targetCorp:z,verdict:q,safeToPublish:U,metrics:Y,quota:J,flips:Q,records:K}=$,H=q==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":q==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",G=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${I.name}」-> 测试靶场「${z.name}」`,` 判定: ${H} · 准许发布: ${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 Z of Q)if(G.push(` • 单据 [${Z.sn}]: 原生产判定「${Z.prodDecision}」 ➔ 测试新判定「${Z.testDecision}」`),Z.diff?.reasonDiff)G.push(` 理由差异: ${Z.diff.reasonDiff}`);G.push(" "+"─".repeat(65)),G.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(q==="CLEAN")G.push(" ✓ 全部样本在新规则下的审核决策与生产历史 1 Line truncated
`)}async function Ld($,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 D=E(z.options["prod-corp"])??E(z.options.prod)??Y.prodCorpId;if(!D)throw new h4(`测试企业「${Y.name}」(${Y.id}) 未绑定生产母企业,无法拉取历史样本。
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${Y.id}`);J=W1(D)}else{J=Y;let D=E(z.options["test-corp"])??E(z.options.test)??Y.testCorpId;if(!D)throw new h4(`生产企业「${Y.name}」(${Y.id}) 未绑定测试靶场企业。
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);Q=W1(D)}let K=await K1(J),H=await K1(Q),G=R0(z.options.samples)??R0(z.options.limit)??R0(z.options.n)??10,Z=X0(z.options["dry-run"]),W=X0(z.options["fail-on-flips"]),X=R0(z.options["poll-interval"])??2000,w=R0(z.options.timeout)??45000,L=E(z.options["sn-prefix"])??"REG_",O=await Yg0({sourceCorp:J,targetCorp:Q,sourceClient:K,targetClient:H,samples:G,dryRun:Z,pollIntervalMs:X,timeoutMs:w,snPrefix:L,failOnFlips:W});if(!(X0(z.options.quiet)||X0(z.options.silent)))console.error(Jg0(O));if(P0(O),W&&!O.ok)throw new h4(`回归测试发现 ${O.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new h4(`未知的 test 子命令: "${q}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}x4();D4();n1();async function Qg0($,I,z,q){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await N0($,I,z,P8(q.json),V0(q.options))}CA();n1();function Kg0(){P0(dZ.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as kf1,mkdirSync as ff1,renameSync as Od,rmSync as bf1,unlinkSync as Xg0,writeFileSync as Hg0}from"node:fs";import{dirname as if1,join as Gg0}from"node:path";import{spawnSync as Dz}from"node:child_process";function eA($=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")}n1();var Vg0="yunyingk/seal-use",qW="yunyingk/seal-home";var nf1="SEAL_USE_GITHUB_REPO",cf1="SEAL_HOME_GITHUB_REPO";async function wg0($,I={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Xd,version:q1,launcher:$.launcher},q=I.repo||process.env[nf1]?.trim()||process.env[cf1]?.trim()||Vg0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let A=Y.replace(/^v/,""),T=Lg0(A,q1);if(T<0)if(!Jv&&I.force);else{P0({updated:!1,currentVersion:q1,targetVersion:A,mode:eA()?"binary":"source",message:!Jv?`Cannot downgrade seal-use from dev build v${q1} to release v${A}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${q1} to older version v${A}. Updates must be forward-only.`});return}if(T===0&&!I.force){P0({updated:!1,currentVersion:q1,targetVersion:A,mode:eA()?"binary":"source",message:`seal-use is already at version v${q1}. Use --force to reinstall.`});return}}if(I.changelogOnly){let A=await Fd(q,I.limit??10);P0({currentVersion:q1,totalQueried:A.length,releases:A.map((T)=>({version:T.version,tagName:T.tagName,publishedAt:T.publishedAt,author:T.author,releaseNotes:T.notes,releaseUrl:T.htmlUrl,isCurrent:T.version===q1,isNewer:zW(T.version,q1)}))});return}if(!eA()){if(I.checkOnly){let T=await Fd(q,30),k=T[0],h=k?.version??q1,f=T.find((i)=>i.version===q1),C=zW(h,q1),b=T.filter((i)=>zW(i.version,q1));P0({updated:!1,updateAvailable:C,currentVersion:q1,currentVersionPublishedAt:f?.publishedAt,latestVersion:h,latestVersionPublishedAt:k?.publishedAt,behindCount:b.length,pendingReleases:b.map((i)=>({version:i.version,tagName:i.tagName,publishedAt:i.publishedAt,author:i.author,releaseNotes:i.notes,releaseUrl:i.htmlUrl})),releaseNotes:k?.notes??"",releaseUrl:k?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let A=FJ(z).running;if(A)await Nz("stop",z);try{Wg0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(T){console.error(`git pull skipped: ${T instanceof Error?T.message:String(T)}`)}if(Wg0("bun",["install"],{cwd:$.appRoot}),A)await Nz("start",z);P0({updated:!0,serviceRestarted:A,version:q1,mode:"source"});return}let J=pf1(),Q=df1(),K=await Fd(q,30),H=Y?K.find((A)=>A.version===Y||A.tagName===Y||A.tagName===`v${Y}`)??await Zg0(q,Y):K[0]??await Zg0(q);if(!H){P0({updated:!1,currentVersion:q1,mode:"binary",message:`Failed to query releases from repository '${q}'`});return}let G=H.version,Z=K.find((A)=>A.version===q1),W=zW(G,q1),X=W||Boolean(I.force),w=K.filter((A)=>zW(A.version,q1));if(I.checkOnly){P0({updated:!1,updateAvailable:W,currentVersion:q1,currentVersionPublishedAt:Z?.publishedAt,latestVersion:G,latestVersionPublishedAt:H.publishedAt,behindCount:w.length,pendingReleases:w.map((A)=>({version:A.version,tagName:A.tagName,publishedAt:A.publishedAt,author:A.author,releaseNotes:A.notes,releaseUrl:A.htmlUrl})),releaseNotes:H.notes,releaseUrl:H.htmlUrl,mode:"binary"});return}if(!X){P0({updated:!1,currentVersion:q1,currentVersionPublishedAt:Z?.publishedAt,latestVersion:G,latestVersionPublishedAt:H.publishedAt,mode:"binary",message:`seal-use is already up to date (v${q1})`});return}let L=mf1(H.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${G}. Available assets: ${H.assets.map((A)=>A.name).join(", ")}`);let O=FJ(z).running;if(O)await Nz("stop",z);let F=process.execPath,D=if1(F),P=Gg0(D,`.tmp-update-${Date.now()}`);ff1(P,{recursive:!0});try{let A=Gg0(P,L.name);await lf1(L.downloadUrl,A,H.tagName,L.name);let T=A;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))T=of1(A,P,J);else if(L.name.endsWith(".zip"))T=rf1(A,P,J);if(kf1(T,493),process.platform==="darwin")try{Dz("/usr/bin/codesign",["--remove-signature",T],{stdio:"ignore"}),Dz("/usr/bin/codesign",["--force","--sign","-",T],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let h=`${F}.old.${Date.now()}`;try{Od(F,h)}catch{}Od(T,F)}else Od(T,F);if(O)await Nz("start",z);let k=Id();P0({updated:!0,fromVersion:q1,toVersion:G,serviceRestarted:O,skillSynced:k.synced?k.targetDir:!1,mode:"binary"})}finally{try{bf1(P,{recursive:!0,force:!0})}catch{}}}function pf1(){if(process.platform==="darwin")retur Line truncated
`)}catch{}}async function lf1($,I,z,q){let U=Md(),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/${Vg0}/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)),H,G=6000,Z=6000,W=307200,X=1e4,w=180000;for(let L=0;L<K.length;L++){let O=K[L],F=new AbortController,D="",P=(h)=>{D=h;try{F.abort()}catch{}},A=setTimeout(()=>{P("Connection timed out (no response headers within 6s)")},G),T,k;try{$P(`==> [${L+1}/${K.length}] Downloading via: ${O}`);let h=await fetch(O,{signal:F.signal});if(A)clearTimeout(A),A=void 0;if(!h.ok)throw Error(`HTTP ${h.status} ${h.statusText}`);T=setTimeout(()=>{P("Overall download time exceeded 3 minutes")},w);let f=Number(h.headers.get("content-length"))||0,C=h.body?.getReader();if(!C){let c=Buffer.from(await h.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);Hg0(I,c),$P(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],i=0,v=0;k=setTimeout(()=>{if(i<W){let c=(i/1024).toFixed(1);P(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},Z);while(!0){let c=C.read(),$0,R=new Promise((U0,H0)=>{$0=setTimeout(()=>{H0(Error("Data transfer stalled (no chunk received for 10s)"))},X)}),u;try{u=await Promise.race([c,R])}finally{if($0)clearTimeout($0)}let{done:p,value:s}=u;if(p)break;if(s){if(b.push(s),i+=s.length,k&&i>=W)clearTimeout(k),k=void 0;let U0=Date.now();if(U0-v>200){v=U0;let H0=f?Math.round(i/f*100):0,D0=(i/1048576).toFixed(1),_0=f?(f/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${H0}% (${D0} / ${_0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let y=Buffer.concat(b);if(y.length<1000)throw Error(`Downloaded content is suspiciously small (${y.length} bytes)`);Hg0(I,y),$P(`✓ Download completed successfully (${(y.length/1024/1024).toFixed(1)} MB)`);return}catch(h){if(A)clearTimeout(A);if(k)clearTimeout(k);if(T)clearTimeout(T);let f=D||(h instanceof Error?h.message:String(h));H=Error(f),$P(`
↳ Mirror failed: ${H.message}`)}finally{if(A)clearTimeout(A);if(k)clearTimeout(k);if(T)clearTimeout(T)}}throw Error(`Failed to download asset from all mirrors: ${H?.message}`)}function of1($,I,z){let q=Dz("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract tar archive: ${q.stderr.toString()}`);Xg0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=Dz("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 rf1($,I,z){let q=Dz("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(q.status!==0)throw Error(`Failed to extract zip archive: ${q.stderr.toString()}`);Xg0($);let U=z==="windows"?"seal-use.exe":"seal-use",Y=Dz("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 Lg0($,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 zW($,I){return Lg0($,I)>0}function Wg0($,I,z={}){let q=Dz($,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}`)}x4();D4();n1();async function Og0($,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},V0(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},V0(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},V0(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},V0(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},V0(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},V0(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},V0(U.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}H$();x4();D4();bp();n1();var Fg0=Nd(Nd(Nd(tf1(import.meta.url)))),af1=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"]),ef1=new Set(["http","server","web","mcp"]);function $b1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(I&&ef1.has(I))return!0;if((I==="service"||I==="daemon")&&z==="run")return!0;return!1}var Mg0=Promise.resolve();function $W($,I={}){if($b1($))return Ng0($,I);let z=Mg0.then(()=>Ng0($,I));return Mg0=z.then(()=>{return},()=>{return}),z}async function Ng0($,I){let z=[],q=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??Fg0,entryFile:I.entryFile??sf1(I.appRoot??Fg0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{z.push(ip(Q))},console.error=(...Q)=>{q.push(ip(Q))};try{return await Ib1($,J),{stdout:lZ(z),stderr:lZ(q),isError:!1,exitCode:0}}catch(Q){let K=oZ(Q instanceof Error?Q.message:String(Q)),H=qD(Q);if(q.push(K),H.nextAction&&!K.includes("Next action:"))q.push(`\uD83D\uDC49 Next action: ${H.nextAction}`);return{stdout:lZ(z),stderr:lZ(q),isError:!0,exitCode:H.exitCode}}finally{console.log=U,console.error=Y}}async function Ib1($,I){let z=Sp($),[q,U,Y]=z.command;if(q==="version"||q==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){P0(QK);return}let J=gR0(z);if(J.isHelp){uR0(J.target);return}if(!q||!af1.has(q))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(q==="webhook"&&(U==="resource-pack"||U==="pack"||U==="material-pack")&&Y==="preview"){let H=z.command[3]??E(z.options.file)??E(z.options.input);if(!H)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await bR0(H,XJ(z.options));return}if(q==="openapi"){ph0(z);return}if(q==="mcp-config"){Qd();return}if(q==="skill"){qg0(U,Y,z);return}if(q==="mcp"||q==="server"){await ch0(U,z);return}if(q==="probe"){await rh0(U,Y,z);return}if(q==="doctor"){await uh0(U,Y,z);return}if(q==="test"){await Ld(U,Y,z);return}if(q==="config"){lR0(U,Y,z);return}if(q==="service"){await Vd(U,I,z);return}if(q==="stop"){await Vd("stop",I,z);return}if(q==="http"||q==="serve"){await ih0(z);return}if(q==="update"||q==="changelog"){let H=q==="changelog"||U==="changelog"||U==="log"||U==="history"||X0(z.options.changelog)===!0,G=U==="check"||X0(z.options.check)===!0||X0(z.options["check-only"])===!0,Z=E(z.options.version)??E(z.options.tag)??(!H&&!G&&U&&!U.startsWith("-")?U:void 0);await wg0 Line truncated
`)?"":`
`}`);process.exitCode=$.exitCode}var mL1=Boolean(a.main==a.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&nF0(process.argv[1])===nF0(N9));if(mL1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await dL1();else Qf().catch(($)=>{console.error($),process.exitCode=1});export{Yf as tokenizeCommand,Qf as startServer,iL1 as resolveMcpEnabled,pL1 as createServer,bL1 as SEAL_MCP_ENABLED_ENV,fL1 as SEAL_CLI_TOOL_NAME,nL1 as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var Gb1=Boolean(d.main==d.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&Dg0(process.argv[1])===Dg0(X3));if(Gb1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await Hb1();else Kd().catch(($)=>{console.error($),process.exitCode=1});export{Jd as tokenizeCommand,Kd as startServer,Jb1 as resolveMcpEnabled,Qb1 as createServer,Ub1 as SEAL_MCP_ENABLED_ENV,qb1 as SEAL_CLI_TOOL_NAME,Yb1 as LEGACY_SEAL_MCP_ENABLED_ENV};
+1 -1
View File
@@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "seal-use Wrapped API",
"version": "0.10.21",
"version": "0.10.22",
"description": "Planned HTTP contract for the seal-use wrapped backend API.\n\nThese endpoints describe the intended stable API for frontend developers and agents once\nthe HTTP adapter is implemented.\nThey are not the raw downstream Seal endpoints. seal-use is responsible for enterprise\nselection, source authentication, response compaction, and diagnostics-friendly fields.\n"
},
"servers": [
+1 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: seal-use Wrapped API
version: 0.10.21
version: 0.10.22
description: |
Planned HTTP contract for the seal-use wrapped backend API.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.21",
"version": "0.10.22",
"type": "module",
"module": "src/server.ts",
"bin": {
+4 -4
View File
@@ -1,12 +1,12 @@
---
name: seal-use
description: "v0.10.21: 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."
description: "v0.10.22: 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:
version: 0.10.21
short-description: Seal tenant and Hose approval automation (v0.10.21)
version: 0.10.22
short-description: Seal tenant and Hose approval automation (v0.10.22)
---
# Seal Use (v0.10.21)
# Seal Use (v0.10.22)
Use the `seal_cli` MCP tool when it is available; pass the command string as its `command` argument. If MCP is unavailable, fall back to the global `seal-use` CLI. This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.