Add doctor command for read-only system diagnostic and embedded guide

Embed system architecture and 10-tier directory specifications directly into the binary with zero disk footprint.
This commit is contained in:
gitea committed 2026-09-11 17:57:41 +08:00
1 parent 76d288b882
commit 4c8389bf0c
10 files changed
+980 -147

No files matched your search

+205 -147
View File
@@ -1,83 +1,83 @@
import{createRequire as qO0}from"node:module";var lD0=Object.create;var{getPrototypeOf:oD0,defineProperty:DO,getOwnPropertyNames:rD0}=Object;var tD0=Object.prototype.hasOwnProperty;function aD0($){return this[$]}var sD0,eD0,TI=($,I,q)=>{var z=$!=null&&typeof $==="object";if(z){var U=I?sD0??=new WeakMap:eD0??=new WeakMap,Y=U.get($);if(Y)return Y}q=$!=null?lD0(oD0($)):{};let J=I||!$||!$.__esModule?DO(q,"default",{value:$,enumerable:!0}):q;for(let Q of rD0($))if(!tD0.call(J,Q))DO(J,Q,{get:aD0.bind($,Q),enumerable:!0});if(z)U.set($,J);return J};var O=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var $O0=($)=>$;function IO0($,I){this[$]=$O0.bind(null,I)}var z5=($,I)=>{for(var q in I)DO($,q,{get:I[q],enumerable:!0,configurable:!0,set:IO0.bind(I,q)})};var t=qO0(import.meta.url);var lY=O((yn)=>{Object.defineProperty(yn,"__esModule",{value:!0});yn.regexpCode=yn.getEsmExportName=yn.getProperty=yn.safeStringify=yn.stringify=yn.strConcat=yn.addCodeArg=yn.str=yn._=yn.nil=yn._Code=yn.Name=yn.IDENTIFIER=yn._CodeOrName=void 0;class aH{}yn._CodeOrName=aH;yn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class wq extends aH{constructor($){super();if(!yn.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}yn.Name=wq;class r$ extends aH{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,q)=>`${I}${q}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,q)=>{if(q instanceof wq)I[q.str]=(I[q.str]||0)+1;return I},{})}}yn._Code=r$;yn.nil=new r$("");function Sn($,...I){let q=[$[0]],z=0;while(z<I.length)RT(q,I[z]),q.push($[++z]);return new r$(q)}yn._=Sn;var vT=new r$("+");function un($,...I){let q=[mY($[0])],z=0;while(z<I.length)q.push(vT),RT(q,I[z]),q.push(vT,mY($[++z]));return PA0(q),new r$(q)}yn.str=un;function RT($,I){if(I instanceof r$)$.push(...I._items);else if(I instanceof wq)$.push(I);else $.push(jA0(I))}yn.addCodeArg=RT;function PA0($){let I=1;while(I<$.length-1){if($[I]===vT){let q=TA0($[I-1],$[I+1]);if(q!==void 0){$.splice(I-1,3,q);continue}$[I++]="+"}I++}}function TA0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof wq||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof wq))return`"${$}${I.slice(1)}`;return}function EA0($,I){return I.emptyStr()?$:$.emptyStr()?I:un`${$}${I}`}yn.strConcat=EA0;function jA0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:mY(Array.isArray($)?$.join(","):$)}function BA0($){return new r$(mY($))}yn.stringify=BA0;function mY($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}yn.safeStringify=mY;function gA0($){return typeof $=="string"&&yn.IDENTIFIER.test($)?new r$(`.${$}`):Sn`[${$}]`}yn.getProperty=gA0;function vA0($){if(typeof $=="string"&&yn.IDENTIFIER.test($))return new r$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}yn.getEsmExportName=vA0;function RA0($){return new r$($.toString())}yn.regexpCode=RA0});var ST=O((nn)=>{Object.defineProperty(nn,"__esModule",{value:!0});nn.ValueScope=nn.ValueScopeName=nn.Scope=nn.varKinds=nn.UsedValueState=void 0;var d6=lY();class kn extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var eH;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(eH||(nn.UsedValueState=eH={}));nn.varKinds={const:new d6.Name("const"),let:new d6.Name("let"),var:new d6.Name("var")};class _T{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof d6.Name?$:this.name($)}name($){return new d6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,q;if(((q=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||q===void 0?void 0:q.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}nn.Scope=_T;class hT extends d6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:q}){this.value=$,this.scopePath=d6._`.${new d6.Name(I)}[${q}]`}}nn.ValueScopeName=hT;var pA0=d6._`\n`;class fn extends _T{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?pA0:d6.nil}}get(){return this._scope}name($){return new hT($,this._newName($))}value($,I){var q;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let z=this.toName($),{prefix:U}=z,Y=(q=I.key)!==null&&q!==void 0?q:I.ref,J=this._values[U];if(J){let K=J.get(Y);if(Line truncated
`:""},this._extScope=$,this._scope=new t$.Scope({parent:$}),this._nodes=[new rn]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let q=this._extScope.value($,I);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,q,z){let U=this._scope.toName(I);if(q!==void 0&&z)this._constants[U.str]=q;return this._leafNode(new pn($,U,q)),U}const($,I,q){return this._def(t$.varKinds.const,$,I,q)}let($,I,q){return this._def(t$.varKinds.let,$,I,q)}var($,I,q){return this._def(t$.varKinds.var,$,I,q)}assign($,I,q){return this._leafNode(new xT($,I,q))}add($,I){return this._leafNode(new cn($,m6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==H1.nil)this._leafNode(new on($));return this}object(...$){let I=["{"];for(let[q,z]of $){if(I.length>1)I.push(",");if(I.push(q),q!==z||this.opts.es5)I.push(":"),(0,H1.addCodeArg)(I,z)}return I.push("}"),new H1._Code(I)}if($,I,q){if(this._blockNode(new w5($)),I&&q)this.code(I).else().code(q).endIf();else if(I)this.code(I).endIf();else if(q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new w5($))}else(){return this._elseNode(new oY)}endIf(){return this._endBlockNode(w5,oY)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new tn($),I)}forRange($,I,q,z,U=this.opts.es5?t$.varKinds.var:t$.varKinds.let){let Y=this._scope.toName($);return this._for(new an(U,Y,I,q),()=>z(Y))}forOf($,I,q,z=t$.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let Y=I instanceof H1.Name?I:this.var("_arr",I);return this.forRange("_i",0,H1._`${Y}.length`,(J)=>{this.var(U,H1._`${Y}[${J}]`),q(U)})}return this._for(new uT("of",z,U,I),()=>q(U))}forIn($,I,q,z=this.opts.es5?t$.varKinds.var:t$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,H1._`Object.keys(${I})`,q);let U=this._scope.toName($);return this._for(new uT("in",z,U,I),()=>q(U))}endFor(){return this._endBlockNode(Kq)}label($){return this._leafNode(new dn($))}break($){return this._leafNode(new mn($))}return($){let I=new IG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(IG)}try($,I,q){if(!I&&!q)throw Error('CodeGen: "try" without "catch" and "finally"');let z=new sn;if(this._blockNode(z),this.code($),I){let U=this.name("e");this._currNode=z.catch=new qG(U),I(U)}if(q)this._currNode=z.finally=new zG,this.code(q);return this._endBlockNode(qG,zG)}throw($){return this._leafNode(new ln($))}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 q=this._nodes.length-I;if(q<0||$!==void 0&&q!==$)throw Error(`CodeGen: wrong number of nodes: ${q} vs ${$} expected`);return this._nodes.length=I,this}func($,I=H1.nil,q,z){if(this._blockNode(new $G($,I,q)),z)this.code(z).endFunc();return this}endFunc(){return this._endBlockNode($G)}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 q=this._currNode;if(q instanceof $||I&&q 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 w5))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]=$}}m6.CodeGen=en;function i7($,I){for(let q in I)$[q]=($[q]||0)+(I[q]||0);return $}function UG($,I){return I instanceof H1._CodeOrName?i7($,I.names):$}function Hq($,I,q){if($ instanceof H1.Name)return z($);if(!U($))return $;return new H1._Code($._items.reduce((Y,J)=>{if(J instanceof H1.Name)J=z(J);if(J instanceof H1._Code)Y.push(...J._items);else Y.push(J);return Y},[]));function z(Y){let J=q[Y.str];if(J===void 0||I[Y.str]!==1)return Y;return delete I[Y.str],J}function U(Y){return Y instanceof H1._Code&&Y._items.some((J)=>J instanceof H1.Name&&I[J.str]===1&&q[J.str]!==void 0)}}function lA0($,I){for(let q in I)$[q]=($[q]||0)-(I[q]||0)}function $i($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:H1._`!${yT($)}`}m6.not=$i;var oA0=Ii(m6.operators.AND);function rA0(...$){return $.reduce(oA0)}m6.and=rA0;var tA0=Ii(m6.operators.OR);function aA0(...$){return $.reduce(tA0)}m6.or=aA0;function Ii($){return(I,q)=>I===H1.nil?q:q===H1.nil?I:H1._`${yT(I)} ${$} ${yT(q)}`}function yT($){return $ instanceof H1.Name?$:H1._`(${Line truncated
import{createRequire as VO0}from"node:module";var UO0=Object.create;var{getPrototypeOf:YO0,defineProperty:FO,getOwnPropertyNames:JO0}=Object;var QO0=Object.prototype.hasOwnProperty;function wO0($){return this[$]}var KO0,HO0,jI=($,I,q)=>{var z=$!=null&&typeof $==="object";if(z){var U=I?KO0??=new WeakMap:HO0??=new WeakMap,Y=U.get($);if(Y)return Y}q=$!=null?UO0(YO0($)):{};let J=I||!$||!$.__esModule?FO(q,"default",{value:$,enumerable:!0}):q;for(let Q of JO0($))if(!QO0.call(J,Q))FO(J,Q,{get:wO0.bind($,Q),enumerable:!0});if(z)U.set($,J);return J};var F=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var GO0=($)=>$;function WO0($,I){this[$]=GO0.bind(null,I)}var U5=($,I)=>{for(var q in I)FO($,q,{get:I[q],enumerable:!0,configurable:!0,set:WO0.bind(I,q)})};var t=VO0(import.meta.url);var tY=F((cn)=>{Object.defineProperty(cn,"__esModule",{value:!0});cn.regexpCode=cn.getEsmExportName=cn.getProperty=cn.safeStringify=cn.stringify=cn.strConcat=cn.addCodeArg=cn.str=cn._=cn.nil=cn._Code=cn.Name=cn.IDENTIFIER=cn._CodeOrName=void 0;class eH{}cn._CodeOrName=eH;cn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Gq extends eH{constructor($){super();if(!cn.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}cn.Name=Gq;class a$ extends eH{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,q)=>`${I}${q}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,q)=>{if(q instanceof Gq)I[q.str]=(I[q.str]||0)+1;return I},{})}}cn._Code=a$;cn.nil=new a$("");function bn($,...I){let q=[$[0]],z=0;while(z<I.length)_T(q,I[z]),q.push($[++z]);return new a$(q)}cn._=bn;var CT=new a$("+");function pn($,...I){let q=[rY($[0])],z=0;while(z<I.length)q.push(CT),_T(q,I[z]),q.push(CT,rY($[++z]));return SA0(q),new a$(q)}cn.str=pn;function _T($,I){if(I instanceof a$)$.push(...I._items);else if(I instanceof Gq)$.push(I);else $.push(xA0(I))}cn.addCodeArg=_T;function SA0($){let I=1;while(I<$.length-1){if($[I]===CT){let q=uA0($[I-1],$[I+1]);if(q!==void 0){$.splice(I-1,3,q);continue}$[I++]="+"}I++}}function uA0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof Gq||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof Gq))return`"${$}${I.slice(1)}`;return}function yA0($,I){return I.emptyStr()?$:$.emptyStr()?I:pn`${$}${I}`}cn.strConcat=yA0;function xA0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:rY(Array.isArray($)?$.join(","):$)}function kA0($){return new a$(rY($))}cn.stringify=kA0;function rY($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}cn.safeStringify=rY;function fA0($){return typeof $=="string"&&cn.IDENTIFIER.test($)?new a$(`.${$}`):bn`[${$}]`}cn.getProperty=fA0;function nA0($){if(typeof $=="string"&&cn.IDENTIFIER.test($))return new a$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}cn.getEsmExportName=nA0;function bA0($){return new a$($.toString())}cn.regexpCode=bA0});var yT=F((on)=>{Object.defineProperty(on,"__esModule",{value:!0});on.ValueScope=on.ValueScopeName=on.Scope=on.varKinds=on.UsedValueState=void 0;var d6=tY();class mn extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var IG;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(IG||(on.UsedValueState=IG={}));on.varKinds={const:new d6.Name("const"),let:new d6.Name("let"),var:new d6.Name("var")};class ST{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof d6.Name?$:this.name($)}name($){return new d6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,q;if(((q=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||q===void 0?void 0:q.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}on.Scope=ST;class uT extends d6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:q}){this.value=$,this.scopePath=d6._`.${new d6.Name(I)}[${q}]`}}on.ValueScopeName=uT;var $P0=d6._`\n`;class ln extends ST{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?$P0:d6.nil}}get(){return this._scope}name($){return new uT($,this._newName($))}value($,I){var q;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let z=this.toName($),{prefix:U}=z,Y=(q=I.key)!==null&&q!==void 0?q:I.ref,J=this._values[U];if(J){let K=J.get(Y);if(Line truncated
`:""},this._extScope=$,this._scope=new s$.Scope({parent:$}),this._nodes=[new qb]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let q=this._extScope.value($,I);return(this._values[q.prefix]||(this._values[q.prefix]=new Set)).add(q),q}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,q,z){let U=this._scope.toName(I);if(q!==void 0&&z)this._constants[U.str]=q;return this._leafNode(new tn($,U,q)),U}const($,I,q){return this._def(s$.varKinds.const,$,I,q)}let($,I,q){return this._def(s$.varKinds.let,$,I,q)}var($,I,q){return this._def(s$.varKinds.var,$,I,q)}assign($,I,q){return this._leafNode(new fT($,I,q))}add($,I){return this._leafNode(new an($,m6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==H1.nil)this._leafNode(new Ib($));return this}object(...$){let I=["{"];for(let[q,z]of $){if(I.length>1)I.push(",");if(I.push(q),q!==z||this.opts.es5)I.push(":"),(0,H1.addCodeArg)(I,z)}return I.push("}"),new H1._Code(I)}if($,I,q){if(this._blockNode(new K5($)),I&&q)this.code(I).else().code(q).endIf();else if(I)this.code(I).endIf();else if(q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new K5($))}else(){return this._elseNode(new aY)}endIf(){return this._endBlockNode(K5,aY)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new zb($),I)}forRange($,I,q,z,U=this.opts.es5?s$.varKinds.var:s$.varKinds.let){let Y=this._scope.toName($);return this._for(new Ub(U,Y,I,q),()=>z(Y))}forOf($,I,q,z=s$.varKinds.const){let U=this._scope.toName($);if(this.opts.es5){let Y=I instanceof H1.Name?I:this.var("_arr",I);return this.forRange("_i",0,H1._`${Y}.length`,(J)=>{this.var(U,H1._`${Y}[${J}]`),q(U)})}return this._for(new xT("of",z,U,I),()=>q(U))}forIn($,I,q,z=this.opts.es5?s$.varKinds.var:s$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,H1._`Object.keys(${I})`,q);let U=this._scope.toName($);return this._for(new xT("in",z,U,I),()=>q(U))}endFor(){return this._endBlockNode(Wq)}label($){return this._leafNode(new sn($))}break($){return this._leafNode(new en($))}return($){let I=new zG;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(zG)}try($,I,q){if(!I&&!q)throw Error('CodeGen: "try" without "catch" and "finally"');let z=new Yb;if(this._blockNode(z),this.code($),I){let U=this.name("e");this._currNode=z.catch=new UG(U),I(U)}if(q)this._currNode=z.finally=new YG,this.code(q);return this._endBlockNode(UG,YG)}throw($){return this._leafNode(new $b($))}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 q=this._nodes.length-I;if(q<0||$!==void 0&&q!==$)throw Error(`CodeGen: wrong number of nodes: ${q} vs ${$} expected`);return this._nodes.length=I,this}func($,I=H1.nil,q,z){if(this._blockNode(new qG($,I,q)),z)this.code(z).endFunc();return this}endFunc(){return this._endBlockNode(qG)}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 q=this._currNode;if(q instanceof $||I&&q 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 K5))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]=$}}m6.CodeGen=Jb;function p7($,I){for(let q in I)$[q]=($[q]||0)+(I[q]||0);return $}function JG($,I){return I instanceof H1._CodeOrName?p7($,I.names):$}function Vq($,I,q){if($ instanceof H1.Name)return z($);if(!U($))return $;return new H1._Code($._items.reduce((Y,J)=>{if(J instanceof H1.Name)J=z(J);if(J instanceof H1._Code)Y.push(...J._items);else Y.push(J);return Y},[]));function z(Y){let J=q[Y.str];if(J===void 0||I[Y.str]!==1)return Y;return delete I[Y.str],J}function U(Y){return Y instanceof H1._Code&&Y._items.some((J)=>J instanceof H1.Name&&I[J.str]===1&&q[J.str]!==void 0)}}function UP0($,I){for(let q in I)$[q]=($[q]||0)-(I[q]||0)}function Qb($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:H1._`!${kT($)}`}m6.not=Qb;var YP0=wb(m6.operators.AND);function JP0(...$){return $.reduce(YP0)}m6.and=JP0;var QP0=wb(m6.operators.OR);function wP0(...$){return $.reduce(QP0)}m6.or=wP0;function wb($){return(I,q)=>I===H1.nil?q:q===H1.nil?I:H1._`${kT(I)} ${$} ${kT(q)}`}function kT($){return $ instanceof H1.Name?$:H1._`(${Line truncated
|| (${J} == "string" && ${U} && ${U} == +${U})`).assign(Q,t0._`+${U}`);return;case"integer":z.elseIf(t0._`${J} === "boolean" || ${U} === null
|| (${J} === "string" && ${U} && ${U} == +${U} && !(${U} % 1))`).assign(Q,t0._`+${U}`);return;case"boolean":z.elseIf(t0._`${U} === "false" || ${U} === 0 || ${U} === null`).assign(Q,!1).elseIf(t0._`${U} === "true" || ${U} === 1`).assign(Q,!0);return;case"null":z.elseIf(t0._`${U} === "" || ${U} === 0 || ${U} === false`),z.assign(Q,null);return;case"array":z.elseIf(t0._`${J} === "string" || ${J} === "number"
|| ${J} === "boolean" || ${U} === null`).assign(Q,t0._`[${U}]`)}}}function HT0({gen:$,parentData:I,parentDataProperty:q},z){$.if(t0._`${I} !== undefined`,()=>$.assign(t0._`${I}[${q}]`,z))}function cT($,I,q,z=Gq.Correct){let U=z===Gq.Correct?t0.operators.EQ:t0.operators.NEQ,Y;switch($){case"null":return t0._`${I} ${U} null`;case"array":Y=t0._`Array.isArray(${I})`;break;case"object":Y=t0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J(t0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return t0._`typeof ${I} ${U} ${$}`}return z===Gq.Correct?Y:(0,t0.not)(Y);function J(Q=t0.nil){return(0,t0.and)(t0._`typeof ${I} == "number"`,Q,q?t0._`isFinite(${I})`:t0.nil)}}Ci.checkDataType=cT;function dT($,I,q,z){if($.length===1)return cT($[0],I,q,z);let U,Y=(0,gi.toHash)($);if(Y.array&&Y.object){let J=t0._`typeof ${I} != "object"`;U=Y.null?J:t0._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=t0.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,t0.and)(U,cT(J,I,q,z));return U}Ci.checkDataTypes=dT;var GT0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?t0._`{type: ${$}}`:t0._`{type: ${I}}`};function mT($){let I=WT0($);(0,YT0.reportError)(I,GT0)}Ci.reportTypeError=mT;function WT0($){let{gen:I,data:q,schema:z}=$,U=(0,gi.schemaRefOrVal)($,z,"type");return{gen:I,keyword:"type",data:q,schema:z.type,schemaCode:U,schemaValue:U,parentSchema:z,params:{},it:$}}});var yi=O((Si)=>{Object.defineProperty(Si,"__esModule",{value:!0});Si.assignDefaults=void 0;var Wq=a0(),FT0=Z1();function NT0($,I){let{properties:q,items:z}=$.schema;if(I==="object"&&q)for(let U in q)hi($,U,q[U].default);else if(I==="array"&&Array.isArray(z))z.forEach((U,Y)=>hi($,Y,U.default))}Si.assignDefaults=NT0;function hi($,I,q){let{gen:z,compositeRule:U,data:Y,opts:J}=$;if(q===void 0)return;let Q=Wq._`${Y}${(0,Wq.getProperty)(I)}`;if(U){(0,FT0.checkStrictMode)($,`default is ignored for: ${Q}`);return}let w=Wq._`${Q} === undefined`;if(J.useDefaults==="empty")w=Wq._`${w} || ${Q} === null || ${Q} === ""`;z.if(w,Wq._`${Q} = ${(0,Wq.stringify)(q)}`)}});var g$=O((fi)=>{Object.defineProperty(fi,"__esModule",{value:!0});fi.validateUnion=fi.validateArray=fi.usePattern=fi.callValidateCode=fi.schemaProperties=fi.allSchemaProperties=fi.noPropertyInData=fi.propertyInData=fi.isOwnProperty=fi.hasPropFunc=fi.reportMissingProp=fi.checkMissingProp=fi.checkReportMissingProp=void 0;var a1=a0(),lT=Z1(),O9=K5(),MT0=Z1();function AT0($,I){let{gen:q,data:z,it:U}=$;q.if(rT(q,z,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:a1._`${I}`},!0),$.error()})}fi.checkReportMissingProp=AT0;function PT0({gen:$,data:I,it:{opts:q}},z,U){return(0,a1.or)(...z.map((Y)=>(0,a1.and)(rT($,I,Y,q.ownProperties),a1._`${U} = ${Y}`)))}fi.checkMissingProp=PT0;function TT0($,I){$.setParams({missingProperty:I},!0),$.error()}fi.reportMissingProp=TT0;function xi($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:a1._`Object.prototype.hasOwnProperty`})}fi.hasPropFunc=xi;function oT($,I,q){return a1._`${xi($)}.call(${I}, ${q})`}fi.isOwnProperty=oT;function ET0($,I,q,z){let U=a1._`${I}${(0,a1.getProperty)(q)} !== undefined`;return z?a1._`${U} && ${oT($,I,q)}`:U}fi.propertyInData=ET0;function rT($,I,q,z){let U=a1._`${I}${(0,a1.getProperty)(q)} === undefined`;return z?(0,a1.or)(U,(0,a1.not)(oT($,I,q))):U}fi.noPropertyInData=rT;function ki($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}fi.allSchemaProperties=ki;function jT0($,I){return ki(I).filter((q)=>!(0,lT.alwaysValidSchema)($,I[q]))}fi.schemaProperties=jT0;function BT0({schemaCode:$,data:I,it:{gen:q,topSchemaRef:z,schemaPath:U,errorPath:Y},it:J},Q,w,K){let H=K?a1._`${$}, ${I}, ${z}${U}`:I,G=[[O9.default.instancePath,(0,a1.strConcat)(O9.default.instancePath,Y)],[O9.default.parentData,J.parentData],[O9.default.parentDataProperty,J.parentDataProperty],[O9.default.rootData,O9.default.rootData]];if(J.opts.dynamicRef)G.push([O9.default.dynamicAnchors,O9.default.dynamicAnchors]);let W=a1._`${H}, ${q.object(...G)}`;return w!==a1.nil?a1._`${Q}.call(${w}, ${W})`:a1._`${Q}(${W})`}fi.callValidateCode=BT0;var gT0=a1._`new RegExp`;function vT0({gen:$,it:{opts:I}},q){let z=I.unicodeRegExp?"u":"",{regExp:U}=I.code,Y=U(q,z);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:a1._`${U.code==="new RegExp"?gT0:(0,MT0.useFunc)($,U)}(${q}, ${z})`})}fi.usePattern=vT0;function RT0($){let{gen:I,data:q,keyword:z,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 w=I.const("len",a1._`${q}.length`);I.forRange("i",0,w,(K)=>{$.subschema({keyword:z,dataProp:K,dataPropType:lT.Type.Num},Y),I.if((0,a1.not)(Y),Q)})}}fi.validateArray=RT0;function CT0($){let{gen:I,schema:q,keyword:z,it:U}=$;if(!Array.isArray(q))throw Error("ajv implementation error");if(q.some((w)=>(0,lT.alwaysValidSchema)(U,w))&&!U.opts.unevaluated)return;le Line truncated
|| ${J} === "boolean" || ${U} === null`).assign(Q,t0._`[${U}]`)}}}function MT0({gen:$,parentData:I,parentDataProperty:q},z){$.if(t0._`${I} !== undefined`,()=>$.assign(t0._`${I}[${q}]`,z))}function mT($,I,q,z=Zq.Correct){let U=z===Zq.Correct?t0.operators.EQ:t0.operators.NEQ,Y;switch($){case"null":return t0._`${I} ${U} null`;case"array":Y=t0._`Array.isArray(${I})`;break;case"object":Y=t0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Y=J(t0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Y=J();break;default:return t0._`typeof ${I} ${U} ${$}`}return z===Zq.Correct?Y:(0,t0.not)(Y);function J(Q=t0.nil){return(0,t0.and)(t0._`typeof ${I} == "number"`,Q,q?t0._`isFinite(${I})`:t0.nil)}}kb.checkDataType=mT;function lT($,I,q,z){if($.length===1)return mT($[0],I,q,z);let U,Y=(0,ub.toHash)($);if(Y.array&&Y.object){let J=t0._`typeof ${I} != "object"`;U=Y.null?J:t0._`!${I} || ${J}`,delete Y.null,delete Y.array,delete Y.object}else U=t0.nil;if(Y.number)delete Y.integer;for(let J in Y)U=(0,t0.and)(U,mT(J,I,q,z));return U}kb.checkDataTypes=lT;var AT0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?t0._`{type: ${$}}`:t0._`{type: ${I}}`};function oT($){let I=PT0($);(0,LT0.reportError)(I,AT0)}kb.reportTypeError=oT;function PT0($){let{gen:I,data:q,schema:z}=$,U=(0,ub.schemaRefOrVal)($,z,"type");return{gen:I,keyword:"type",data:q,schema:z.type,schemaCode:U,schemaValue:U,parentSchema:z,params:{},it:$}}});var pb=F((bb)=>{Object.defineProperty(bb,"__esModule",{value:!0});bb.assignDefaults=void 0;var Xq=a0(),RT0=Z1();function CT0($,I){let{properties:q,items:z}=$.schema;if(I==="object"&&q)for(let U in q)nb($,U,q[U].default);else if(I==="array"&&Array.isArray(z))z.forEach((U,Y)=>nb($,Y,U.default))}bb.assignDefaults=CT0;function nb($,I,q){let{gen:z,compositeRule:U,data:Y,opts:J}=$;if(q===void 0)return;let Q=Xq._`${Y}${(0,Xq.getProperty)(I)}`;if(U){(0,RT0.checkStrictMode)($,`default is ignored for: ${Q}`);return}let w=Xq._`${Q} === undefined`;if(J.useDefaults==="empty")w=Xq._`${w} || ${Q} === null || ${Q} === ""`;z.if(w,Xq._`${Q} = ${(0,Xq.stringify)(q)}`)}});var v$=F((mb)=>{Object.defineProperty(mb,"__esModule",{value:!0});mb.validateUnion=mb.validateArray=mb.usePattern=mb.callValidateCode=mb.schemaProperties=mb.allSchemaProperties=mb.noPropertyInData=mb.propertyInData=mb.isOwnProperty=mb.hasPropFunc=mb.reportMissingProp=mb.checkMissingProp=mb.checkReportMissingProp=void 0;var a1=a0(),rT=Z1(),N9=H5(),_T0=Z1();function hT0($,I){let{gen:q,data:z,it:U}=$;q.if(aT(q,z,I,U.opts.ownProperties),()=>{$.setParams({missingProperty:a1._`${I}`},!0),$.error()})}mb.checkReportMissingProp=hT0;function ST0({gen:$,data:I,it:{opts:q}},z,U){return(0,a1.or)(...z.map((Y)=>(0,a1.and)(aT($,I,Y,q.ownProperties),a1._`${U} = ${Y}`)))}mb.checkMissingProp=ST0;function uT0($,I){$.setParams({missingProperty:I},!0),$.error()}mb.reportMissingProp=uT0;function cb($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:a1._`Object.prototype.hasOwnProperty`})}mb.hasPropFunc=cb;function tT($,I,q){return a1._`${cb($)}.call(${I}, ${q})`}mb.isOwnProperty=tT;function yT0($,I,q,z){let U=a1._`${I}${(0,a1.getProperty)(q)} !== undefined`;return z?a1._`${U} && ${tT($,I,q)}`:U}mb.propertyInData=yT0;function aT($,I,q,z){let U=a1._`${I}${(0,a1.getProperty)(q)} === undefined`;return z?(0,a1.or)(U,(0,a1.not)(tT($,I,q))):U}mb.noPropertyInData=aT;function db($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}mb.allSchemaProperties=db;function xT0($,I){return db(I).filter((q)=>!(0,rT.alwaysValidSchema)($,I[q]))}mb.schemaProperties=xT0;function kT0({schemaCode:$,data:I,it:{gen:q,topSchemaRef:z,schemaPath:U,errorPath:Y},it:J},Q,w,K){let H=K?a1._`${$}, ${I}, ${z}${U}`:I,G=[[N9.default.instancePath,(0,a1.strConcat)(N9.default.instancePath,Y)],[N9.default.parentData,J.parentData],[N9.default.parentDataProperty,J.parentDataProperty],[N9.default.rootData,N9.default.rootData]];if(J.opts.dynamicRef)G.push([N9.default.dynamicAnchors,N9.default.dynamicAnchors]);let W=a1._`${H}, ${q.object(...G)}`;return w!==a1.nil?a1._`${Q}.call(${w}, ${W})`:a1._`${Q}(${W})`}mb.callValidateCode=kT0;var fT0=a1._`new RegExp`;function nT0({gen:$,it:{opts:I}},q){let z=I.unicodeRegExp?"u":"",{regExp:U}=I.code,Y=U(q,z);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:a1._`${U.code==="new RegExp"?fT0:(0,_T0.useFunc)($,U)}(${q}, ${z})`})}mb.usePattern=nT0;function bT0($){let{gen:I,data:q,keyword:z,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 w=I.const("len",a1._`${q}.length`);I.forRange("i",0,w,(K)=>{$.subschema({keyword:z,dataProp:K,dataPropType:rT.Type.Num},Y),I.if((0,a1.not)(Y),Q)})}}mb.validateArray=bT0;function iT0($){let{gen:I,schema:q,keyword:z,it:U}=$;if(!Array.isArray(q))throw Error("ajv implementation error");if(q.some((w)=>(0,rT.alwaysValidSchema)(U,w))&&!U.opts.unevaluated)return;le Line truncated
missingProperty: ${z},
depsCount: ${I},
deps: ${q}}`};var tg0={keyword:"dependencies",type:"object",schemaType:"object",error:qc.error,code($){let[I,q]=ag0($);$c($,I),Ic($,q)}};function ag0({schema:$}){let I={},q={};for(let z in $){if(z==="__proto__")continue;let U=Array.isArray($[z])?I:q;U[z]=$[z]}return[I,q]}function $c($,I=$.schema){let{gen:q,data:z,it:U}=$;if(Object.keys(I).length===0)return;let Y=q.let("missing");for(let J in I){let Q=I[J];if(Q.length===0)continue;let w=(0,WJ.propertyInData)(q,z,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)q.if(w,()=>{for(let K of Q)(0,WJ.checkReportMissingProp)($,K)});else q.if(OE._`${w} && (${(0,WJ.checkMissingProp)($,Q,Y)})`),(0,WJ.reportMissingProp)($,Y),q.else()}}qc.validatePropertyDeps=$c;function Ic($,I=$.schema){let{gen:q,data:z,keyword:U,it:Y}=$,J=q.name("valid");for(let Q in I){if((0,rg0.alwaysValidSchema)(Y,I[Q]))continue;q.if((0,WJ.propertyInData)(q,z,Q,Y.opts.ownProperties),()=>{let w=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(w,J)},()=>q.var(J,!0)),$.ok(J)}}qc.validateSchemaDeps=Ic;qc.default=tg0});var wc=O((Qc)=>{Object.defineProperty(Qc,"__esModule",{value:!0});var Jc=a0(),$v0=Z1(),Iv0={message:"property name must be valid",params:({params:$})=>Jc._`{propertyName: ${$.propertyName}}`},qv0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Iv0,code($){let{gen:I,schema:q,data:z,it:U}=$;if((0,$v0.alwaysValidSchema)(U,q))return;let Y=I.name("valid");I.forIn("key",z,(J)=>{$.setParams({propertyName:J}),$.subschema({keyword:"propertyNames",data:J,dataTypes:["string"],propertyName:J,compositeRule:!0},Y),I.if((0,Jc.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};Qc.default=qv0});var FE=O((Kc)=>{Object.defineProperty(Kc,"__esModule",{value:!0});var jG=g$(),e$=a0(),Uv0=K5(),BG=Z1(),Yv0={message:"must NOT have additional properties",params:({params:$})=>e$._`{additionalProperty: ${$.additionalProperty}}`},Jv0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Yv0,code($){let{gen:I,schema:q,parentSchema:z,data:U,errsCount:Y,it:J}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:Q,opts:w}=J;if(J.props=!0,w.removeAdditional!=="all"&&(0,BG.alwaysValidSchema)(J,q))return;let K=(0,jG.allSchemaProperties)(z.properties),H=(0,jG.allSchemaProperties)(z.patternProperties);G(),$.ok(e$._`${Y} === ${Uv0.default.errors}`);function G(){I.forIn("key",U,(D)=>{if(!K.length&&!H.length)X(D);else I.if(W(D),()=>X(D))})}function W(D){let F;if(K.length>8){let P=(0,BG.schemaRefOrVal)(J,z.properties,"properties");F=(0,jG.isOwnProperty)(I,P,D)}else if(K.length)F=(0,e$.or)(...K.map((P)=>e$._`${D} === ${P}`));else F=e$.nil;if(H.length)F=(0,e$.or)(F,...H.map((P)=>e$._`${(0,jG.usePattern)($,P)}.test(${D})`));return(0,e$.not)(F)}function V(D){I.code(e$._`delete ${U}[${D}]`)}function X(D){if(w.removeAdditional==="all"||w.removeAdditional&&q===!1){V(D);return}if(q===!1){if($.setParams({additionalProperty:D}),$.error(),!Q)I.break();return}if(typeof q=="object"&&!(0,BG.alwaysValidSchema)(J,q)){let F=I.name("valid");if(w.removeAdditional==="failing")L(D,F,!1),I.if((0,e$.not)(F),()=>{$.reset(),V(D)});else if(L(D,F),!Q)I.if((0,e$.not)(F),()=>I.break())}}function L(D,F,P){let T={keyword:"additionalProperties",dataProp:D,dataPropType:BG.Type.Str};if(P===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,F)}}};Kc.default=Jv0});var Vc=O((Wc)=>{Object.defineProperty(Wc,"__esModule",{value:!0});var wv0=$J(),Hc=g$(),NE=Z1(),Gc=FE(),Kv0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,parentSchema:z,data:U,it:Y}=$;if(Y.opts.removeAdditional==="all"&&z.additionalProperties===void 0)Gc.default.code(new wv0.KeywordCxt(Y,Gc.default,"additionalProperties"));let J=(0,Hc.allSchemaProperties)(q);for(let G of J)Y.definedProperties.add(G);if(Y.opts.unevaluated&&J.length&&Y.props!==!0)Y.props=NE.mergeEvaluated.props(I,(0,NE.toHash)(J),Y.props);let Q=J.filter((G)=>!(0,NE.alwaysValidSchema)(Y,q[G]));if(Q.length===0)return;let w=I.name("valid");for(let G of Q){if(K(G))H(G);else{if(I.if((0,Hc.propertyInData)(I,U,G,Y.opts.ownProperties)),H(G),!Y.allErrors)I.else().var(w,!0);I.endIf()}$.it.definedProperties.add(G),$.ok(w)}function K(G){return Y.opts.useDefaults&&!Y.compositeRule&&q[G].default!==void 0}function H(G){$.subschema({keyword:"properties",schemaProp:G,dataProp:G},w)}}};Wc.default=Kv0});var Oc=O((Dc)=>{Object.defineProperty(Dc,"__esModule",{value:!0});var Zc=g$(),gG=a0(),Xc=Z1(),Lc=Z1(),Gv0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,data:z,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,Zc.allSchemaProperties)(q),w=Q.filter((L)=>(0,Xc.alwaysValidSchema)(Y,q[L]));if(Q.length===0||w.length===Q.length&&(!Y.opts.unevaluated||Y.props===!0))return;let K=J.strictSchema&&!J.allowMatchingProperties&&U.properties,H=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,b+=o1(f,2),b+=Q.magic,b+=o1(D,2),b+=o1(F,2),b+=o1(S.crc32,4),b+=o1(S.compressedSize,4),b+=o1(S.uncompressedSize,4),b+=o1(K.length,2),b+=o1(P.length,2);var h=QV.LOCAL_FILE_HEADER+b+K+P,n=QV.CENTRAL_FILE_HEADER+o1(p,2)+b+o1(W.length,2)+"\x00\x00\x00\x00"+o1(v,4)+o1(z,4)+K+P+W;return{fileRecord:h,dirRecord:n}},bk0=function($,I,q,z,U){var Y="",J=sq.transformTo("string",U(z));return Y=QV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+o1($,2)+o1($,2)+o1(I,4)+o1(q,4)+o1(J.length,2)+J,Y},pk0=function($){var I="";return I=QV.DATA_DESCRIPTOR+o1($.crc32,4)+o1($.compressedSize,4)+o1($.uncompressedSize,4),I};function J8($,I,q,z){eq.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=q,this.encodeFileName=z,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}sq.inherits(J8,eq);J8.prototype.push=function($){var I=$.meta.percent||0,q=this.entriesCount,z=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:q?(I+100*(q-z-1))/q:100}})};J8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var q=Ks($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};J8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,q=Ks($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(q.dirRecord),I)this.push({data:pk0($),meta:{percent:100}});else{this.push({data:q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};J8.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 q=this.bytesWritten-$,z=bk0(this.dirRecords.length,q,$,this.zipComment,this.encodeFileName);this.push({data:z,meta:{percent:100}})};J8.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};J8.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(q){I.processChunk(q)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(q){I.error(q)}),this};J8.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};J8.prototype.error=function($){var I=this._sources;if(!eq.prototype.error.call(this,$))return!1;for(var q=0;q<I.length;q++)try{I[q].error($)}catch(z){}return!0};J8.prototype.lock=function(){eq.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};Hs.exports=J8});var Ws=O((lk0)=>{var ck0=$g(),dk0=Gs(),mk0=function($,I){var q=$||I,z=ck0[q];if(!z)throw Error(q+" is not a valid compression method !");return z};lk0.generateWorker=function($,I,q){var z=new dk0(I.streamFiles,q,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=mk0(J.options.compression,I.compression),w=J.options.compressionOptions||I.compressionOptions||{},K=J.dir,H=J.date;J._compressWorker(Q,w).withStreamInfo("file",{name:Y,dir:K,date:H,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(z)}),z.entriesCount=U}catch(Y){z.error(Y)}return z}});var Zs=O((jE1,Vs)=>{var rk0=G4(),wV=G$();function VQ($,I){wV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}rk0.inherits(VQ,wV);VQ.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(q){I.push({data:q,meta:{percent:0}})}).on("error",function(q){if(I.isPaused)this.generatedError=q;else I.error(q)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};VQ.prototype.pause=function(){if(!wV.prototype.pause.call(this))return!1;return this._stream.pause(),!0};VQ.prototype.resume=function(){if(!wV.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};Vs.exports=VQ});var Ts=O((BE1,Ps)=>{var tk0=bq(),ZQ=G4(),Os=G$(),ak0=JB(),Fs=QB(),Xs=pW(),sk0=Lt(),ek0=Ws(),Ls=mJ(),$f0=Zs(),Ns=function($,I,q){var z=ZQ.getTypeOf(I),U,Y=ZQ.extend(q||{},Fs);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&16)Y.dir=!0;if(Y. Line truncated
`)}openNode($,I){let q=this.tos,z=this._xml;if(q&&this.open)z.push(">");this._stack.push($),z.push("<"),z.push($),kg(z,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)Z00(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");kg(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(V00.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,q){if(this.openNode($,I),q!==void 0)this.writeText(q);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("")}}fg.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};X00.exports=fg});var ng=O((di0)=>{var L00=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function ci0($){if(typeof $==="string")return $;if(L00)return L00.decode($);return $.toString()}di0.bufferToString=ci0});var M00=O((O00)=>{Object.defineProperty(O00,"__esModule",{value:!0});O00.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;O00.S=` \r
`;O00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";O00.NAME_CHAR="-"+O00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";O00.CHAR_RE=new RegExp("^["+O00.CHAR+"]$","u");O00.S_RE=new RegExp("^["+O00.S+"]+$","u");O00.NAME_START_CHAR_RE=new RegExp("^["+O00.NAME_START_CHAR+"]$","u");O00.NAME_CHAR_RE=new RegExp("^["+O00.NAME_CHAR+"]$","u");O00.NAME_RE=new RegExp("^["+O00.NAME_START_CHAR+"]["+O00.NAME_CHAR+"]*$","u");O00.NMTOKEN_RE=new RegExp("^["+O00.NAME_CHAR+"]+$","u");var ig=9,bg=10,pg=13,cg=32;O00.S_LIST=[cg,bg,pg,ig];function li0($){return $>=cg&&$<=55295||$===bg||$===pg||$===ig||$>=57344&&$<=65533||$>=65536&&$<=1114111}O00.isChar=li0;function oi0($){return $===cg||$===bg||$===pg||$===ig}O00.isS=oi0;function D00($){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}O00.isNameStartChar=D00;function ri0($){return D00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}O00.isNameChar=ri0});var C00=O((B00)=>{Object.defineProperty(B00,"__esModule",{value:!0});B00.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";B00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";B00.S=` \r
`;B00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";B00.NAME_CHAR="-"+B00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";B00.CHAR_RE=new RegExp("^["+B00.CHAR+"]$","u");B00.RESTRICTED_CHAR_RE=new RegExp("^["+B00.RESTRICTED_CHAR+"]$","u");B00.S_RE=new RegExp("^["+B00.S+"]+$","u");B00.NAME_START_CHAR_RE=new RegExp("^["+B00.NAME_START_CHAR+"]$","u");B00.NAME_CHAR_RE=new RegExp("^["+B00.NAME_CHAR+"]$","u");B00.NAME_RE=new RegExp("^["+B00.NAME_START_CHAR+"]["+B00.NAME_CHAR+"]*$","u");B00.NMTOKEN_RE=new RegExp("^["+B00.NAME_CHAR+"]+$","u");var A00=9,P00=10,T00=13,E00=32;B00.S_LIST=[E00,P00,T00,A00];function Qb0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}B00.isChar=Qb0;function wb0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}B00.isRestrictedChar=wb0;function Kb0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}B00.isCharAndNotRestricted=Kb0;function Hb0($){return $===E00||$===P00||$===T00||$===A00}B00.isS=Hb0;function j00($){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}B00.isNameStartChar=j00;function Gb0($){return j00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}B00.isNameChar=Gb0});var S00=O((h00)=>{Object.defineProperty(h00,"__esModule",{value:!0});h00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";h00.NC_NAME_CHAR="-"+h00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";h00.NC_NAME_START_CHAR_RE=new RegExp("^["+h00.NC_NAME_START_CHAR+"]$","u");h00.NC_NAME_CHAR_RE=new RegExp("^["+h00.NC_NAME_CHAR+"]$","u");h00.NC_NAME_RE=new RegExp("^["+h00.NC_NAME_START_CHAR+"]["+h00.NC_NAME_CHAR+"]*$","u");function _00($){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}h00.isNCNameStartChar=_00;function jb0($){return _00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}h00.isNCNameChar=jb0});var q10=O((I10)=>{Object.defineProperty(I10,"__esModule",{value:!0});var Hz=M00(),_b0=C00(),Uv=S00(),t6=Hz.isS,hb0=Hz.isChar,BQ=Hz.isNameStartChar,u00=Hz.isNameChar,r00=Hz.S_LIST,Sb0=Hz.NAME_RE,ub0=_b0.isChar,yb0=Uv.isNCNameStartChar,xb0=Uv.isNCNameChar,kb0=Uv.NC_NAME_RE,xV="http://www.w3.org/XML/1998/namespace",Kz="http://www.w3.org/2000/xmlns/",fb0={__proto__:null,xml:xV,xmlns:Kz},nb0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},w4=-1,x8=-2,y00=0,ib0=1,mg=2,bb0=3,Jz=4,pb0=5,cb0=6,db0=7,lg=8,mb0=9,lb0=10,ob0=11,rb0=12,S6=13,_V=14,og=15,tb0=16,rg=17,ab0=18,sb0=19,tg=20,eb0=21,$p0=22,Ip0=23,x00=24,ag=25,hV=26,k00=27,qp0=28,zp0=29,f00=30,Up0=31,Yp0=32,X3=33,Jp0=34,sg=35,gQ=36,eg=37,Qp0=38,n00=39,i00=40,wp0=41,b00=42,Kp0=43,Hp0=44,$v=9,w8=10,Iv=13,p00=32,c00=33,t00=34,vQ=38,a00=39,SV=45,uV=47,Gp0=59,b9=60,Qz=61,y4=62,U6=63,s00=91,wz=93,d00=133,m00=8232,yV=($)=>$===t00||$===a00,e00=[t00,a00],Wp0=[...e00,s00,y4],Vp0=[...e00,b9,wz],Zp0=[Qz,U6,...r00],Xp0=[...r00,y4,vQ,b9];function zv($,I,q){switch(I){case"xml":if(q!==xV)$.fail(`xml prefix must be bound to ${xV}.`);break;case"xmlns":if(q!==Kz)$.fail(`xmlns prefix must be bound to ${Kz}.`);break;default:}switch(q){case Kz:$.fail(I===""?`the default namespace may not be set to ${q}.`:`may not assign a prefix (even "xmlns") to the URI ${Kz}.`);break;case xV:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${q}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function Lp0($,I){for(let q of Object.keys(I))zv($,q,I[q])}var Dp0=($)=>kb0.test($),Op0=($)=>Sb0.test($),L3=0,l00=1,qv=2;I10.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var o00={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 $10{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=yb0,this.nameCheck=xb0,this.isName=Dp0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},fb0);let q=this.opt.additionalNamesp Line truncated
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:q}=this;while(!0){let z=this.getCode();switch(z){case x8:this.text+=`${q.slice(I,this.prevI)}
`,I=this.i,z=w8;break;case w4:return this.text+=q.slice(I),!1;default:}if(z===$)return this.text+=q.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let q=this.getCode();if(q===w4)return this.name+=$.slice(I),w4;if(!u00(q))return this.name+=$.slice(I,this.prevI),q===x8?w8:q}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===w4||!t6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=hb0,this.getCode=this.getCode10;else this.isChar=ub0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=ib0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case b9:if(this.state=og,this.text.length!==0)throw Error("no-empty text at start");break;case w4:break;default:this.unget(),this.state=S6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(Wp0);switch(I){case y4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6,this.doctype=!0;break}case w4:break;default:if(this.text+=String.fromCodePoint(I),I===s00)this.state=Jz;else if(yV(I))this.state=bb0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=mg}sDTD(){let $=this.captureTo(Vp0);if($===w4)return;if(this.text+=String.fromCodePoint($),$===wz)this.state=mg;else if($===b9)this.state=cb0;else if(yV($))this.state=pb0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=Jz,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case c00:this.state=db0,this.openWakaBang="";break;case U6:this.state=ob0;break;default:this.state=Jz}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?lg:Jz,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(SV))this.text+="-",this.state=mb0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===SV?lb0:lg}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===y4)this.state=Jz;else this.fail("malformed comment."),this.state=lg}sDTDPI(){if(this.captureToChar(U6))this.text+="?",this.state=rb0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===y4)this.state=Jz}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case x8:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case Gp0:{let{entityReturnState:q}=this,z=this.entity+I.slice($,this.prevI);this.state=q;let U;if(z==="")this.fail("empty entity name."),U="&;";else U=this.parseEntity(z),this.entity="";if(q!==S6||this.textHandler!==void 0)this.text+=U;break $}case w4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(BQ($))this.state=Jp0,this.unget(),this.xmlDeclPossible=!1;else switch($){case uV:this.state=Kp0,this.xmlDeclPossible=!1;break;case c00:this.state=tb0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case U6:this.state=Ip0;break;default:this.fail("disallowed character in tag name"),this.state=S6,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=tg,this.openWakaBang="";break;case"--":this.state=rg,this.openWakaBang="";break;case"DOCTYPE":if(this.state=mg,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(SV))this.state=ab0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===SV)this.state=sb0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=rg}sCommentEnded(){let $=this.getCodeNorm();if($!==y4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=rg;else this.state=S6}sCData(){if(this.captureToChar(wz))this.state=eb0}sCDataEnding(){let $=this.getCodeNorm();if($===wz)this.state=$p0;else this.text+=`]${String.fromCodePoint($)}`,this.state=tg}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case y4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6;break}case wz:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=tg}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=x00;else if($===U6||t6($))this.fail("processing instruction without a target."),this.state=$===U6?hV:ag;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=x00}sPIRest(){let{chunk:$,i:I}=this;while(!0){let q=this.getCodeNorm();if(q===w4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(q)){this.piTarget+=$.slice(I,this.prevI);let z=q===U6;if(z||t6(q))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=z?X3:k00}else this.state=z?hV:ag;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(q);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===U6)this.state=hV;else if(!t6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(U6))this.state=hV}sPIEnding(){var $;let I=this.getCodeNorm();if(I===y4){let{piTarget:q}=this;if(q.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:q,body:this.text}),this.piTarget=this.text="",this.state=S6}else if(I===U6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=ag;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===U6){this.state=X3;return}if($!==w4)this.state=qp0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(Zp0);if($===U6){this.state=X3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(t6($)||$===Qz))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=$===Qz?f00:zp0}sXMLDeclEq(){let $=this.getCodeNorm();if($===U6){this.state=X3,this.fail("XML declaration is incomplete.");return}if(t6($))return;if($!==Qz)this.fail("value required.");this.state=f00}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===U6){this.state=X3,this.fail("XML declaration is incomplete.");return}if(t6($))return;if(!yV($))this.fail("value must be quoted."),this.q=p00;else this.q=$;this.state=Up0}sXMLDeclValue(){let $=this.captureTo([this.q,U6]);if($===U6){this.state=X3,this.text="",this.fail("XML declaration is incomplete.");return}if($===w4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let q=I;if(this.xmlDecl.version=q,!/^1\.[0-9]+$/.test(q))this.fail("ver Line truncated
`;$=this.i,I=L3;break;case w4:if(z!==void 0)this.text+=q.slice($);break $;default:I=L3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:q}=this,z=!1;$:while(!0){let U=this.getCode();switch(U){case b9:{if(this.state=og,q!==void 0){let{text:Y}=this,J=I.slice($,this.prevI);if(Y.length!==0)q(Y+J),this.text="";else if(J.length!==0)q(J)}break $}case vQ:if(this.state=_V,this.entityReturnState=S6,q!==void 0)this.text+=I.slice($,this.prevI);z=!0;break $;case x8:if(q!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case w4:if(q!==void 0)this.text+=I.slice($);break $;default:if(!t6(U))z=!0}}if(!z)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 q;let{prefix:z,local:U}=this.qname($),Y={name:$,prefix:z,local:U,value:I};if(this.attribList.push(Y),(q=this.attributeHandler)===null||q===void 0||q.call(this,Y),z==="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,zv(this,U,J)}else if($==="xmlns"){let J=I.trim();this.topNS[""]=J,zv(this,"",J)}}pushAttribPlain($,I){var q;let z={name:$,value:I};this.attribList.push(z),(q=this.attributeHandler)===null||q===void 0||q.call(this,z)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:q}=this;while(q.length>0){let U=q.pop();this.fail(`unclosed tag: ${U.name}`)}if(this.state!==y00&&this.state!==S6)this.fail("unexpected end.");let{text:z}=this;if(z.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,z),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,q;let z=this.topNS[$];if(z!==void 0)return z;let{tags:U}=this;for(let Y=U.length-1;Y>=0;Y--)if(z=U[Y].ns[$],z!==void 0)return z;if(z=this.ns[$],z!==void 0)return z;return(q=(I=this.opt).resolvePrefix)===null||q===void 0?void 0:q.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let q=$.slice(I+1),z=$.slice(0,I);if(z===""||q===""||q.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:z,local:q}}processAttribsNS(){var $;let{attribList:I}=this,q=this.tag;{let{prefix:Y,local:J}=this.qname(q.name);q.prefix=Y,q.local=J;let Q=q.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)}.`),q.uri=Y}}if(I.length===0)return;let{attributes:z}=q,U=new Set;for(let Y of I){let{name:J,prefix:Q,local:w}=Y,K,H;if(Q==="")K=J==="xmlns"?Kz:"",H=J;else{if(K=this.resolve(Q),K===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),K=Q;H=`{${K}}${w}`}if(U.has(H))this.fail(`duplicate attribute: ${H}.`);U.add(H),Y.uri=K,z[J]=Y}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:q,value:z}of $){if(I[q]!==void 0)this.fail(`duplicate attribute: ${q}.`);I[q]=z}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,q=this.tag;q.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,q),I.push(q),this.state=S6,this.name=""}openSelfClosingTag(){var $,I,q;this.processAttribs();let{tags:z}=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=(q=z[z.length-1])!==null&&q!==void 0?q:null)===null)this.closedRoot=!0;this.state=S6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=S6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let q=this.closeTagHandler,z=$.length;while(z-- >0){let U=this.tag=$.pop();if(this.topNS=U.ns,q===null||q===void 0||q(U),U.name===I)break;this.fail("unexpected close tag.")}if(z===0)this.closedRoot=!0;else if(z<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let q=this.ENTITIES[$];if(q!==void 0)return q;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)}}I10.SaxesParser=$10});var RQ=O((Hj1,z10)=>{var{SaxesParser:Mp0}=q10(),{PassThrough:Ap0}=O6(),{bufferToString:Pp0}=ng();z10.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new Ap0);let I=new Mp0,q;I.on("error",(U)=>{q=U});let z=[];I.on("opentag",(U)=>z.push({eventType:"opentag",value:U})),I.on("text",(U)=>z.push({eventType:"text",value:U})),I.on("closetag",(U)=>z.push({eventType:"closetag",value:U}));for await(let U of $){if(I.write(Pp0(U)),q)throw q;yield z,z=[]}}});var L0=O((Gj1,U10)=>{var Tp0=RQ(),Ep0=z6();class Gz{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof Gz)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:q,value:z}of I)if(q==="opentag")this.parseOpen(z);else if(q==="text")this.parseText(z);else if(q==="closetag"){if(!this.parseClose(z.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}`}}S90.FormatterOptions=h90});var LZ=O((yg1,f90)=>{var ur0="[object AsyncFunction]",yr0="[object Function]",xr0="[object GeneratorFunction]",kr0="[object Null]",fr0="[object Proxy]",nr0="[object Undefined]",ir0=typeof global=="object"&&global&&global.Object===Object&&global,br0=typeof self=="object"&&self&&self.Object===Object&&self,pr0=ir0||br0||Function("return this")(),x90=Object.prototype,cr0=x90.hasOwnProperty,k90=x90.toString,y90=pr0.Symbol,P3=y90?y90.toStringTag:void 0;function dr0($){if($==null)return $===void 0?nr0:kr0;return P3&&P3 in Object($)?mr0($):lr0($)}function mr0($){var I=cr0.call($,P3),q=$[P3];try{$[P3]=void 0;var z=!0}catch(Y){}var U=k90.call($);if(z)if(I)$[P3]=q;else delete $[P3];return U}function lr0($){return k90.call($)}function or0($){if(!rr0($))return!1;var I=dr0($);return I==yr0||I==xr0||I==ur0||I==fr0}function rr0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}f90.exports=or0});var N70=O((DZ,Mz)=>{var tr0=200,BR="__lodash_hash_undefined__",EZ=1,a90=2,s90=9007199254740991,OZ="[object Arguments]",NR="[object Array]",ar0="[object AsyncFunction]",e90="[object Boolean]",$70="[object Date]",I70="[object Error]",q70="[object Function]",sr0="[object GeneratorFunction]",FZ="[object Map]",z70="[object Number]",er0="[object Null]",Nz="[object Object]",n90="[object Promise]",$t0="[object Proxy]",U70="[object RegExp]",NZ="[object Set]",Y70="[object String]",It0="[object Symbol]",qt0="[object Undefined]",MR="[object WeakMap]",J70="[object ArrayBuffer]",MZ="[object DataView]",zt0="[object Float32Array]",Ut0="[object Float64Array]",Yt0="[object Int8Array]",Jt0="[object Int16Array]",Qt0="[object Int32Array]",wt0="[object Uint8Array]",Kt0="[object Uint8ClampedArray]",Ht0="[object Uint16Array]",Gt0="[object Uint32Array]",Wt0=/[\\^$.*+?()[\]{}|]/g,Vt0=/^\[object .+?Constructor\]$/,Zt0=/^(?:0|[1-9]\d*)$/,e1={};e1[zt0]=e1[Ut0]=e1[Yt0]=e1[Jt0]=e1[Qt0]=e1[wt0]=e1[Kt0]=e1[Ht0]=e1[Gt0]=!0;e1[OZ]=e1[NR]=e1[J70]=e1[e90]=e1[MZ]=e1[$70]=e1[I70]=e1[q70]=e1[FZ]=e1[z70]=e1[Nz]=e1[U70]=e1[NZ]=e1[Y70]=e1[MR]=!1;var Q70=typeof global=="object"&&global&&global.Object===Object&&global,Xt0=typeof self=="object"&&self&&self.Object===Object&&self,g5=Q70||Xt0||Function("return this")(),w70=typeof DZ=="object"&&DZ&&!DZ.nodeType&&DZ,i90=w70&&typeof Mz=="object"&&Mz&&!Mz.nodeType&&Mz,K70=i90&&i90.exports===w70,DR=K70&&Q70.process,b90=function(){try{return DR&&DR.binding&&DR.binding("util")}catch($){}}(),p90=b90&&b90.isTypedArray;function Lt0($,I){var q=-1,z=$==null?0:$.length,U=0,Y=[];while(++q<z){var J=$[q];if(I(J,q,$))Y[U++]=J}return Y}function Dt0($,I){var q=-1,z=I.length,U=$.length;while(++q<z)$[U+q]=I[q];return $}function Ot0($,I){var q=-1,z=$==null?0:$.length;while(++q<z)if(I($[q],q,$))return!0;return!1}function Ft0($,I){var q=-1,z=Array($);while(++q<$)z[q]=I(q);return z}function Nt0($){return function(I){return $(I)}}function Mt0($,I){return $.has(I)}function At0($,I){return $==null?void 0:$[I]}function Pt0($){var I=-1,q=Array($.size);return $.forEach(function(z,U){q[++I]=[U,z]}),q}function Tt0($,I){return function(q){return $(I(q))}}function Et0($){var I=-1,q=Array($.size);return $.forEach(function(z){q[++I]=z}),q}var jt0=Array.prototype,Bt0=Function.prototype,jZ=Object.prototype,OR=g5["__core-js_shared__"],H70=Bt0.toString,f8=jZ.hasOwnProperty,c90=function(){var $=/[^.]+$/.exec(OR&&OR.keys&&OR.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),G70=jZ.toString,gt0=RegExp("^"+H70.call(f8).replace(Wt0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),d90=K70?g5.Buffer:void 0,AZ=g5.Symbol,m90=g5.Uint8Array,W70=jZ.propertyIsEnumerable,vt0=jt0.splice,T3=AZ?AZ.toStringTag:void 0,l90=Object.getOwnPropertySymbols,Rt0=d90?d90.isBuffer:void 0,Ct0=Tt0(Object.keys,Object),AR=Az(g5,"DataView"),xQ=Az(g5,"Map"),PR=Az(g5,"Promise"),TR=Az(g5,"Set"),ER=Az(g5,"WeakMap"),kQ=Az(Object,"create"),_t0=B3(AR),ht0=B3(xQ),St0=B3(PR),ut0=B3(TR),yt0=B3(ER),o90=AZ?AZ.prototype:void 0,FR=o90?o90.valueOf:void 0;function E3($){var I=-1,q=$==null?0:$.length;this.clear();while(++I<q){var z=$[I];this.set(z[0],z[1])}}function xt0(){this.__data__=kQ?kQ(null):{},this.size=0}function kt0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function ft0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let q=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(da0.default(q))return q;if(Array.isArray(q))return q[$];if(this._headers!==null)return q[this._headers[$]];return!1}format($,I,q){let z=`${ma0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:U}=this;if(U.quote!==""){if(z.indexOf(U.quote)!==-1)return this.quoteField(z.replace(this.REPLACE_REGEXP,U.escapedQuote))}if(z.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,q))return this.quoteField(z);return z}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}Pz.FieldFormatter=v70});var _R=O((R70)=>{Object.defineProperty(R70,"__esModule",{value:!0});R70.isSyncTransform=void 0;R70.isSyncTransform=($)=>$.length===1});var h70=O((Tz)=>{var _70=Tz&&Tz.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Tz,"__esModule",{value:!0});Tz.RowFormatter=void 0;var oa0=_70(LZ()),ra0=_70(N70()),ta0=CR(),aa0=_R();class g3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new ta0.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(g3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(aa0.isSyncTransform($))return(I,q)=>{let z=null;try{z=$(I)}catch(U){return q(U)}return q(null,z)};return(I,q)=>{$(I,q)}}set rowTransform($){if(!oa0.default($))throw TypeError("The transform should be a function");this._rowTransform=g3.createTransform($)}format($,I){this.callTransformer($,(q,z)=>{if(q)return I(q);if(!$)return I(null);let U=[];if(z){let{shouldFormatColumns:Y,headers:J}=this.checkHeaders(z);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)U.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Y){let Q=this.gatherColumns(z);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=g3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!ra0.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(g3.isRowHashArray($))return this.headers.map((I,q)=>{let z=$[q];if(z)return z[1];return""});if(g3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,q)=>$[q])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let q=$.map((U,Y)=>this.fieldFormatter.format(U,Y,I)).join(this.formatterOptions.delimiter),{rowCount:z}=this;if(this.rowCount+=1,z)return[this.formatterOptions.rowDelimiter,q].join("");return q}}Tz.RowFormatter=g3});var S70=O((vZ)=>{Object.defineProperty(vZ,"__esModule",{value:!0});vZ.FieldFormatter=vZ.RowFormatter=void 0;var sa0=h70();Object.defineProperty(vZ,"RowFormatter",{enumerable:!0,get:function(){return sa0.RowFormatter}});var ea0=CR();Object.defineProperty(vZ,"FieldFormatter",{enumerable:!0,get:function(){return ea0.FieldFormatter}})});var hR=O((y70)=>{Object.defineProperty(y70,"__esModule",{value:!0});y70.CsvFormatterStream=void 0;var Is0=t("stream"),qs0=S70();class u70 extends Is0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new qs0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,q){let z=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(U,Y)=>{if(U)return z=!0,q(U);if(Y)Y.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return z=!0,q()})}catch(U){if(z)throw U;q(U)}}_flush($){this.rowFormatter.finish((I,q)=>{if(I)return $(I);if(q)q.forEach((z)=>{this.push(Buffer.from(z,"utf8"))});return $()})}}y70.CsvFormatterStream=u70});var f70=O((P1)=>{var k70=P1&&P1.__createBinding||(Object.create?function($,I,q,z){if(z===void 0)z=q;Object.defineProperty($,z,{enumerable:!0,get:function(){return I[q]}})}:function($,I,q,z){if(z===void 0)z=q;$[z]=I[q]}),zs0=P1&&P1.__setModuleDefault||(Object.create?function($,I){Ob Line truncated
deps: ${q}}`};var Qv0={keyword:"dependencies",type:"object",schemaType:"object",error:Kc.error,code($){let[I,q]=wv0($);Qc($,I),wc($,q)}};function wv0({schema:$}){let I={},q={};for(let z in $){if(z==="__proto__")continue;let U=Array.isArray($[z])?I:q;U[z]=$[z]}return[I,q]}function Qc($,I=$.schema){let{gen:q,data:z,it:U}=$;if(Object.keys(I).length===0)return;let Y=q.let("missing");for(let J in I){let Q=I[J];if(Q.length===0)continue;let w=(0,XJ.propertyInData)(q,z,J,U.opts.ownProperties);if($.setParams({property:J,depsCount:Q.length,deps:Q.join(", ")}),U.allErrors)q.if(w,()=>{for(let K of Q)(0,XJ.checkReportMissingProp)($,K)});else q.if(NE._`${w} && (${(0,XJ.checkMissingProp)($,Q,Y)})`),(0,XJ.reportMissingProp)($,Y),q.else()}}Kc.validatePropertyDeps=Qc;function wc($,I=$.schema){let{gen:q,data:z,keyword:U,it:Y}=$,J=q.name("valid");for(let Q in I){if((0,Jv0.alwaysValidSchema)(Y,I[Q]))continue;q.if((0,XJ.propertyInData)(q,z,Q,Y.opts.ownProperties),()=>{let w=$.subschema({keyword:U,schemaProp:Q},J);$.mergeValidEvaluated(w,J)},()=>q.var(J,!0)),$.ok(J)}}Kc.validateSchemaDeps=wc;Kc.default=Qv0});var Xc=F((Zc)=>{Object.defineProperty(Zc,"__esModule",{value:!0});var Vc=a0(),Gv0=Z1(),Wv0={message:"property name must be valid",params:({params:$})=>Vc._`{propertyName: ${$.propertyName}}`},Vv0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Wv0,code($){let{gen:I,schema:q,data:z,it:U}=$;if((0,Gv0.alwaysValidSchema)(U,q))return;let Y=I.name("valid");I.forIn("key",z,(J)=>{$.setParams({propertyName:J}),$.subschema({keyword:"propertyNames",data:J,dataTypes:["string"],propertyName:J,compositeRule:!0},Y),I.if((0,Vc.not)(Y),()=>{if($.error(!0),!U.allErrors)I.break()})}),$.ok(Y)}};Zc.default=Vv0});var ME=F((Lc)=>{Object.defineProperty(Lc,"__esModule",{value:!0});var gG=v$(),I8=a0(),Xv0=H5(),vG=Z1(),Lv0={message:"must NOT have additional properties",params:({params:$})=>I8._`{additionalProperty: ${$.additionalProperty}}`},Dv0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Lv0,code($){let{gen:I,schema:q,parentSchema:z,data:U,errsCount:Y,it:J}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:Q,opts:w}=J;if(J.props=!0,w.removeAdditional!=="all"&&(0,vG.alwaysValidSchema)(J,q))return;let K=(0,gG.allSchemaProperties)(z.properties),H=(0,gG.allSchemaProperties)(z.patternProperties);G(),$.ok(I8._`${Y} === ${Xv0.default.errors}`);function G(){I.forIn("key",U,(D)=>{if(!K.length&&!H.length)X(D);else I.if(W(D),()=>X(D))})}function W(D){let O;if(K.length>8){let P=(0,vG.schemaRefOrVal)(J,z.properties,"properties");O=(0,gG.isOwnProperty)(I,P,D)}else if(K.length)O=(0,I8.or)(...K.map((P)=>I8._`${D} === ${P}`));else O=I8.nil;if(H.length)O=(0,I8.or)(O,...H.map((P)=>I8._`${(0,gG.usePattern)($,P)}.test(${D})`));return(0,I8.not)(O)}function V(D){I.code(I8._`delete ${U}[${D}]`)}function X(D){if(w.removeAdditional==="all"||w.removeAdditional&&q===!1){V(D);return}if(q===!1){if($.setParams({additionalProperty:D}),$.error(),!Q)I.break();return}if(typeof q=="object"&&!(0,vG.alwaysValidSchema)(J,q)){let O=I.name("valid");if(w.removeAdditional==="failing")L(D,O,!1),I.if((0,I8.not)(O),()=>{$.reset(),V(D)});else if(L(D,O),!Q)I.if((0,I8.not)(O),()=>I.break())}}function L(D,O,P){let T={keyword:"additionalProperties",dataProp:D,dataPropType:vG.Type.Str};if(P===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,O)}}};Lc.default=Dv0});var Nc=F((Fc)=>{Object.defineProperty(Fc,"__esModule",{value:!0});var Fv0=zJ(),Dc=v$(),AE=Z1(),Oc=ME(),Nv0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,parentSchema:z,data:U,it:Y}=$;if(Y.opts.removeAdditional==="all"&&z.additionalProperties===void 0)Oc.default.code(new Fv0.KeywordCxt(Y,Oc.default,"additionalProperties"));let J=(0,Dc.allSchemaProperties)(q);for(let G of J)Y.definedProperties.add(G);if(Y.opts.unevaluated&&J.length&&Y.props!==!0)Y.props=AE.mergeEvaluated.props(I,(0,AE.toHash)(J),Y.props);let Q=J.filter((G)=>!(0,AE.alwaysValidSchema)(Y,q[G]));if(Q.length===0)return;let w=I.name("valid");for(let G of Q){if(K(G))H(G);else{if(I.if((0,Dc.propertyInData)(I,U,G,Y.opts.ownProperties)),H(G),!Y.allErrors)I.else().var(w,!0);I.endIf()}$.it.definedProperties.add(G),$.ok(w)}function K(G){return Y.opts.useDefaults&&!Y.compositeRule&&q[G].default!==void 0}function H(G){$.subschema({keyword:"properties",schemaProp:G,dataProp:G},w)}}};Fc.default=Nv0});var Ec=F((Tc)=>{Object.defineProperty(Tc,"__esModule",{value:!0});var Mc=v$(),RG=a0(),Ac=Z1(),Pc=Z1(),Av0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:q,data:z,parentSchema:U,it:Y}=$,{opts:J}=Y,Q=(0,Mc.allSchemaProperties)(q),w=Q.filter((L)=>(0,Ac.alwaysValidSchema)(Y,q[L]));if(Q.length===0||w.length===Q.length&&(!Y.opts.unevaluated||Y.props===!0))return;let K=J.strictSchema&&!J.allowMatchingProperties&&U.properties,H=I.name("valid");if(Y.props!==!0&&!(Y.props instanceo Line truncated
\x00`,i+=o1(f,2),i+=Q.magic,i+=o1(D,2),i+=o1(O,2),i+=o1(S.crc32,4),i+=o1(S.compressedSize,4),i+=o1(S.uncompressedSize,4),i+=o1(K.length,2),i+=o1(P.length,2);var h=KV.LOCAL_FILE_HEADER+i+K+P,n=KV.CENTRAL_FILE_HEADER+o1(p,2)+i+o1(W.length,2)+"\x00\x00\x00\x00"+o1(v,4)+o1(z,4)+K+P+W;return{fileRecord:h,dirRecord:n}},ek0=function($,I,q,z,U){var Y="",J=Iz.transformTo("string",U(z));return Y=KV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+o1($,2)+o1($,2)+o1(I,4)+o1(q,4)+o1(J.length,2)+J,Y},$f0=function($){var I="";return I=KV.DATA_DESCRIPTOR+o1($.crc32,4)+o1($.compressedSize,4)+o1($.uncompressedSize,4),I};function w8($,I,q,z){qz.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=q,this.encodeFileName=z,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Iz.inherits(w8,qz);w8.prototype.push=function($){var I=$.meta.percent||0,q=this.entriesCount,z=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,qz.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:q?(I+100*(q-z-1))/q:100}})};w8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var q=Ls($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};w8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,q=Ls($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(q.dirRecord),I)this.push({data:$f0($),meta:{percent:100}});else{this.push({data:q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};w8.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 q=this.bytesWritten-$,z=ek0(this.dirRecords.length,q,$,this.zipComment,this.encodeFileName);this.push({data:z,meta:{percent:100}})};w8.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};w8.prototype.registerPrevious=function($){this._sources.push($);var I=this;return $.on("data",function(q){I.processChunk(q)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(q){I.error(q)}),this};w8.prototype.resume=function(){if(!qz.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};w8.prototype.error=function($){var I=this._sources;if(!qz.prototype.error.call(this,$))return!1;for(var q=0;q<I.length;q++)try{I[q].error($)}catch(z){}return!0};w8.prototype.lock=function(){qz.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};Ds.exports=w8});var Fs=F((Uf0)=>{var If0=qg(),qf0=Os(),zf0=function($,I){var q=$||I,z=If0[q];if(!z)throw Error(q+" is not a valid compression method !");return z};Uf0.generateWorker=function($,I,q){var z=new qf0(I.streamFiles,q,I.platform,I.encodeFileName),U=0;try{$.forEach(function(Y,J){U++;var Q=zf0(J.options.compression,I.compression),w=J.options.compressionOptions||I.compressionOptions||{},K=J.dir,H=J.date;J._compressWorker(Q,w).withStreamInfo("file",{name:Y,dir:K,date:H,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(z)}),z.entriesCount=U}catch(Y){z.error(Y)}return z}});var Ms=F((bE1,Ns)=>{var Jf0=W4(),HV=G$();function LQ($,I){HV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Jf0.inherits(LQ,HV);LQ.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(q){I.push({data:q,meta:{percent:0}})}).on("error",function(q){if(I.isPaused)this.generatedError=q;else I.error(q)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};LQ.prototype.pause=function(){if(!HV.prototype.pause.call(this))return!1;return this._stream.pause(),!0};LQ.prototype.resume=function(){if(!HV.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};Ns.exports=LQ});var Cs=F((iE1,Rs)=>{var Qf0=dq(),DQ=W4(),Es=G$(),wf0=wj(),Bs=Kj(),As=dW(),Kf0=Pt(),Hf0=Fs(),Ps=rJ(),Gf0=Ms(),js=function($,I,q){var z=DQ.getTypeOf(I),U,Y=DQ.extend(q||{},Bs);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&16)Y.dir=!0;if(Y. Line truncated
`)}openNode($,I){let q=this.tos,z=this._xml;if(q&&this.open)z.push(">");this._stack.push($),z.push("<"),z.push($),ng(z,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)M00(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");ng(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(N00.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,q){if(this.openNode($,I),q!==void 0)this.writeText(q);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("")}}bg.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};A00.exports=bg});var ig=F((qi0)=>{var P00=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ii0($){if(typeof $==="string")return $;if(P00)return P00.decode($);return $.toString()}qi0.bufferToString=Ii0});var g00=F((E00)=>{Object.defineProperty(E00,"__esModule",{value:!0});E00.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;E00.S=` \r
`;E00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";E00.NAME_CHAR="-"+E00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";E00.CHAR_RE=new RegExp("^["+E00.CHAR+"]$","u");E00.S_RE=new RegExp("^["+E00.S+"]+$","u");E00.NAME_START_CHAR_RE=new RegExp("^["+E00.NAME_START_CHAR+"]$","u");E00.NAME_CHAR_RE=new RegExp("^["+E00.NAME_CHAR+"]$","u");E00.NAME_RE=new RegExp("^["+E00.NAME_START_CHAR+"]["+E00.NAME_CHAR+"]*$","u");E00.NMTOKEN_RE=new RegExp("^["+E00.NAME_CHAR+"]+$","u");var pg=9,cg=10,dg=13,mg=32;E00.S_LIST=[mg,cg,dg,pg];function Ui0($){return $>=mg&&$<=55295||$===cg||$===dg||$===pg||$>=57344&&$<=65533||$>=65536&&$<=1114111}E00.isChar=Ui0;function Yi0($){return $===mg||$===cg||$===dg||$===pg}E00.isS=Yi0;function T00($){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}E00.isNameStartChar=T00;function Ji0($){return T00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}E00.isNameChar=Ji0});var k00=F((S00)=>{Object.defineProperty(S00,"__esModule",{value:!0});S00.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";S00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";S00.S=` \r
`;S00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";S00.NAME_CHAR="-"+S00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";S00.CHAR_RE=new RegExp("^["+S00.CHAR+"]$","u");S00.RESTRICTED_CHAR_RE=new RegExp("^["+S00.RESTRICTED_CHAR+"]$","u");S00.S_RE=new RegExp("^["+S00.S+"]+$","u");S00.NAME_START_CHAR_RE=new RegExp("^["+S00.NAME_START_CHAR+"]$","u");S00.NAME_CHAR_RE=new RegExp("^["+S00.NAME_CHAR+"]$","u");S00.NAME_RE=new RegExp("^["+S00.NAME_START_CHAR+"]["+S00.NAME_CHAR+"]*$","u");S00.NMTOKEN_RE=new RegExp("^["+S00.NAME_CHAR+"]+$","u");var v00=9,R00=10,C00=13,_00=32;S00.S_LIST=[_00,R00,C00,v00];function Oi0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S00.isChar=Oi0;function Fi0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}S00.isRestrictedChar=Fi0;function Ni0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S00.isCharAndNotRestricted=Ni0;function Mi0($){return $===_00||$===R00||$===C00||$===v00}S00.isS=Mi0;function h00($){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}S00.isNameStartChar=h00;function Ai0($){return h00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}S00.isNameChar=Ai0});var b00=F((n00)=>{Object.defineProperty(n00,"__esModule",{value:!0});n00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";n00.NC_NAME_CHAR="-"+n00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";n00.NC_NAME_START_CHAR_RE=new RegExp("^["+n00.NC_NAME_START_CHAR+"]$","u");n00.NC_NAME_CHAR_RE=new RegExp("^["+n00.NC_NAME_CHAR+"]$","u");n00.NC_NAME_RE=new RegExp("^["+n00.NC_NAME_START_CHAR+"]["+n00.NC_NAME_CHAR+"]*$","u");function f00($){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}n00.isNCNameStartChar=f00;function xi0($){return f00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}n00.isNCNameChar=xi0});var K10=F((w10)=>{Object.defineProperty(w10,"__esModule",{value:!0});var Vz=g00(),pi0=k00(),Jv=b00(),t6=Vz.isS,ci0=Vz.isChar,RQ=Vz.isNameStartChar,i00=Vz.isNameChar,q10=Vz.S_LIST,di0=Vz.NAME_RE,mi0=pi0.isChar,li0=Jv.isNCNameStartChar,oi0=Jv.isNCNameChar,ri0=Jv.NC_NAME_RE,fV="http://www.w3.org/XML/1998/namespace",Wz="http://www.w3.org/2000/xmlns/",ti0={__proto__:null,xml:fV,xmlns:Wz},ai0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},w4=-1,f8=-2,p00=0,si0=1,og=2,ei0=3,Kz=4,$p0=5,Ip0=6,qp0=7,rg=8,zp0=9,Up0=10,Yp0=11,Jp0=12,S6=13,SV=14,tg=15,Qp0=16,ag=17,wp0=18,Kp0=19,sg=20,Hp0=21,Gp0=22,Wp0=23,c00=24,eg=25,uV=26,d00=27,Vp0=28,Zp0=29,m00=30,Xp0=31,Lp0=32,D3=33,Dp0=34,$v=35,CQ=36,Iv=37,Op0=38,l00=39,o00=40,Fp0=41,r00=42,Np0=43,Mp0=44,qv=9,H8=10,zv=13,t00=32,a00=33,z10=34,_Q=38,U10=39,yV=45,xV=47,Ap0=59,c9=60,Hz=61,y4=62,U6=63,Y10=91,Gz=93,s00=133,e00=8232,kV=($)=>$===z10||$===U10,J10=[z10,U10],Pp0=[...J10,Y10,y4],Tp0=[...J10,c9,Gz],Ep0=[Hz,U6,...q10],Bp0=[...q10,y4,_Q,c9];function Yv($,I,q){switch(I){case"xml":if(q!==fV)$.fail(`xml prefix must be bound to ${fV}.`);break;case"xmlns":if(q!==Wz)$.fail(`xmlns prefix must be bound to ${Wz}.`);break;default:}switch(q){case Wz:$.fail(I===""?`the default namespace may not be set to ${q}.`:`may not assign a prefix (even "xmlns") to the URI ${Wz}.`);break;case fV:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${q}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function jp0($,I){for(let q of Object.keys(I))Yv($,q,I[q])}var gp0=($)=>ri0.test($),vp0=($)=>di0.test($),O3=0,$10=1,Uv=2;w10.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var I10={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 Q10{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=li0,this.nameCheck=oi0,this.isName=gp0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},ti0);let q=this.opt.additionalNamesp Line truncated
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:q}=this;while(!0){let z=this.getCode();switch(z){case f8:this.text+=`${q.slice(I,this.prevI)}
`,I=this.i,z=H8;break;case w4:return this.text+=q.slice(I),!1;default:}if(z===$)return this.text+=q.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let q=this.getCode();if(q===w4)return this.name+=$.slice(I),w4;if(!i00(q))return this.name+=$.slice(I,this.prevI),q===f8?H8:q}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===w4||!t6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=ci0,this.getCode=this.getCode10;else this.isChar=mi0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=si0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case c9:if(this.state=tg,this.text.length!==0)throw Error("no-empty text at start");break;case w4:break;default:this.unget(),this.state=S6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(Pp0);switch(I){case y4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6,this.doctype=!0;break}case w4:break;default:if(this.text+=String.fromCodePoint(I),I===Y10)this.state=Kz;else if(kV(I))this.state=ei0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=og}sDTD(){let $=this.captureTo(Tp0);if($===w4)return;if(this.text+=String.fromCodePoint($),$===Gz)this.state=og;else if($===c9)this.state=Ip0;else if(kV($))this.state=$p0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=Kz,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case a00:this.state=qp0,this.openWakaBang="";break;case U6:this.state=Yp0;break;default:this.state=Kz}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?rg:Kz,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(yV))this.text+="-",this.state=zp0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===yV?Up0:rg}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===y4)this.state=Kz;else this.fail("malformed comment."),this.state=rg}sDTDPI(){if(this.captureToChar(U6))this.text+="?",this.state=Jp0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===y4)this.state=Kz}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case f8:this.entity+=`${I.slice($,this.prevI)}
`,$=this.i;break;case Ap0:{let{entityReturnState:q}=this,z=this.entity+I.slice($,this.prevI);this.state=q;let U;if(z==="")this.fail("empty entity name."),U="&;";else U=this.parseEntity(z),this.entity="";if(q!==S6||this.textHandler!==void 0)this.text+=U;break $}case w4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(RQ($))this.state=Dp0,this.unget(),this.xmlDeclPossible=!1;else switch($){case xV:this.state=Np0,this.xmlDeclPossible=!1;break;case a00:this.state=Qp0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case U6:this.state=Wp0;break;default:this.fail("disallowed character in tag name"),this.state=S6,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=sg,this.openWakaBang="";break;case"--":this.state=ag,this.openWakaBang="";break;case"DOCTYPE":if(this.state=og,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(yV))this.state=wp0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===yV)this.state=Kp0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=ag}sCommentEnded(){let $=this.getCodeNorm();if($!==y4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=ag;else this.state=S6}sCData(){if(this.captureToChar(Gz))this.state=Hp0}sCDataEnding(){let $=this.getCodeNorm();if($===Gz)this.state=Gp0;else this.text+=`]${String.fromCodePoint($)}`,this.state=sg}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case y4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=S6;break}case Gz:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=sg}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=c00;else if($===U6||t6($))this.fail("processing instruction without a target."),this.state=$===U6?uV:eg;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=c00}sPIRest(){let{chunk:$,i:I}=this;while(!0){let q=this.getCodeNorm();if(q===w4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(q)){this.piTarget+=$.slice(I,this.prevI);let z=q===U6;if(z||t6(q))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=z?D3:d00}else this.state=z?uV:eg;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(q);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===U6)this.state=uV;else if(!t6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(U6))this.state=uV}sPIEnding(){var $;let I=this.getCodeNorm();if(I===y4){let{piTarget:q}=this;if(q.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:q,body:this.text}),this.piTarget=this.text="",this.state=S6}else if(I===U6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=eg;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===U6){this.state=D3;return}if($!==w4)this.state=Vp0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(Ep0);if($===U6){this.state=D3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(t6($)||$===Hz))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=$===Hz?m00:Zp0}sXMLDeclEq(){let $=this.getCodeNorm();if($===U6){this.state=D3,this.fail("XML declaration is incomplete.");return}if(t6($))return;if($!==Hz)this.fail("value required.");this.state=m00}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===U6){this.state=D3,this.fail("XML declaration is incomplete.");return}if(t6($))return;if(!kV($))this.fail("value must be quoted."),this.q=t00;else this.q=$;this.state=Xp0}sXMLDeclValue(){let $=this.captureTo([this.q,U6]);if($===U6){this.state=D3,this.text="",this.fail("XML declaration is incomplete.");return}if($===w4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let q=I;if(this.xmlDecl.version=q,!/^1\.[0-9]+$/.test(q))this.fail("ver Line truncated
`;$=this.i,I=O3;break;case w4:if(z!==void 0)this.text+=q.slice($);break $;default:I=O3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:q}=this,z=!1;$:while(!0){let U=this.getCode();switch(U){case c9:{if(this.state=tg,q!==void 0){let{text:Y}=this,J=I.slice($,this.prevI);if(Y.length!==0)q(Y+J),this.text="";else if(J.length!==0)q(J)}break $}case _Q:if(this.state=SV,this.entityReturnState=S6,q!==void 0)this.text+=I.slice($,this.prevI);z=!0;break $;case f8:if(q!==void 0)this.text+=`${I.slice($,this.prevI)}
`;$=this.i;break;case w4:if(q!==void 0)this.text+=I.slice($);break $;default:if(!t6(U))z=!0}}if(!z)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 q;let{prefix:z,local:U}=this.qname($),Y={name:$,prefix:z,local:U,value:I};if(this.attribList.push(Y),(q=this.attributeHandler)===null||q===void 0||q.call(this,Y),z==="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,Yv(this,U,J)}else if($==="xmlns"){let J=I.trim();this.topNS[""]=J,Yv(this,"",J)}}pushAttribPlain($,I){var q;let z={name:$,value:I};this.attribList.push(z),(q=this.attributeHandler)===null||q===void 0||q.call(this,z)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:q}=this;while(q.length>0){let U=q.pop();this.fail(`unclosed tag: ${U.name}`)}if(this.state!==p00&&this.state!==S6)this.fail("unexpected end.");let{text:z}=this;if(z.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,z),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,q;let z=this.topNS[$];if(z!==void 0)return z;let{tags:U}=this;for(let Y=U.length-1;Y>=0;Y--)if(z=U[Y].ns[$],z!==void 0)return z;if(z=this.ns[$],z!==void 0)return z;return(q=(I=this.opt).resolvePrefix)===null||q===void 0?void 0:q.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let q=$.slice(I+1),z=$.slice(0,I);if(z===""||q===""||q.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:z,local:q}}processAttribsNS(){var $;let{attribList:I}=this,q=this.tag;{let{prefix:Y,local:J}=this.qname(q.name);q.prefix=Y,q.local=J;let Q=q.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)}.`),q.uri=Y}}if(I.length===0)return;let{attributes:z}=q,U=new Set;for(let Y of I){let{name:J,prefix:Q,local:w}=Y,K,H;if(Q==="")K=J==="xmlns"?Wz:"",H=J;else{if(K=this.resolve(Q),K===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),K=Q;H=`{${K}}${w}`}if(U.has(H))this.fail(`duplicate attribute: ${H}.`);U.add(H),Y.uri=K,z[J]=Y}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:q,value:z}of $){if(I[q]!==void 0)this.fail(`duplicate attribute: ${q}.`);I[q]=z}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,q=this.tag;q.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,q),I.push(q),this.state=S6,this.name=""}openSelfClosingTag(){var $,I,q;this.processAttribs();let{tags:z}=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=(q=z[z.length-1])!==null&&q!==void 0?q:null)===null)this.closedRoot=!0;this.state=S6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=S6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let q=this.closeTagHandler,z=$.length;while(z-- >0){let U=this.tag=$.pop();if(this.topNS=U.ns,q===null||q===void 0||q(U),U.name===I)break;this.fail("unexpected close tag.")}if(z===0)this.closedRoot=!0;else if(z<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let q=this.ENTITIES[$];if(q!==void 0)return q;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)}}w10.SaxesParser=Q10});var hQ=F((EB1,H10)=>{var{SaxesParser:_p0}=K10(),{PassThrough:hp0}=O6(),{bufferToString:Sp0}=ig();H10.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new hp0);let I=new _p0,q;I.on("error",(U)=>{q=U});let z=[];I.on("opentag",(U)=>z.push({eventType:"opentag",value:U})),I.on("text",(U)=>z.push({eventType:"text",value:U})),I.on("closetag",(U)=>z.push({eventType:"closetag",value:U}));for await(let U of $){if(I.write(Sp0(U)),q)throw q;yield z,z=[]}}});var L0=F((BB1,G10)=>{var up0=hQ(),yp0=z6();class Zz{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof Zz)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:q,value:z}of I)if(q==="opentag")this.parseOpen(z);else if(q==="text")this.parseText(z);else if(q==="closetag"){if(!this.parseClose(z.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}`}}b90.FormatterOptions=n90});var OZ=F((ag1,m90)=>{var mr0="[object AsyncFunction]",lr0="[object Function]",or0="[object GeneratorFunction]",rr0="[object Null]",tr0="[object Proxy]",ar0="[object Undefined]",sr0=typeof global=="object"&&global&&global.Object===Object&&global,er0=typeof self=="object"&&self&&self.Object===Object&&self,$t0=sr0||er0||Function("return this")(),c90=Object.prototype,It0=c90.hasOwnProperty,d90=c90.toString,p90=$t0.Symbol,E3=p90?p90.toStringTag:void 0;function qt0($){if($==null)return $===void 0?ar0:rr0;return E3&&E3 in Object($)?zt0($):Ut0($)}function zt0($){var I=It0.call($,E3),q=$[E3];try{$[E3]=void 0;var z=!0}catch(Y){}var U=d90.call($);if(z)if(I)$[E3]=q;else delete $[E3];return U}function Ut0($){return d90.call($)}function Yt0($){if(!Jt0($))return!1;var I=qt0($);return I==lr0||I==or0||I==mr0||I==tr0}function Jt0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}m90.exports=Yt0});var j70=F((FZ,Tz)=>{var Qt0=200,vR="__lodash_hash_undefined__",jZ=1,U70=2,Y70=9007199254740991,NZ="[object Arguments]",AR="[object Array]",wt0="[object AsyncFunction]",J70="[object Boolean]",Q70="[object Date]",w70="[object Error]",K70="[object Function]",Kt0="[object GeneratorFunction]",MZ="[object Map]",H70="[object Number]",Ht0="[object Null]",Pz="[object Object]",l90="[object Promise]",Gt0="[object Proxy]",G70="[object RegExp]",AZ="[object Set]",W70="[object String]",Wt0="[object Symbol]",Vt0="[object Undefined]",PR="[object WeakMap]",V70="[object ArrayBuffer]",PZ="[object DataView]",Zt0="[object Float32Array]",Xt0="[object Float64Array]",Lt0="[object Int8Array]",Dt0="[object Int16Array]",Ot0="[object Int32Array]",Ft0="[object Uint8Array]",Nt0="[object Uint8ClampedArray]",Mt0="[object Uint16Array]",At0="[object Uint32Array]",Pt0=/[\\^$.*+?()[\]{}|]/g,Tt0=/^\[object .+?Constructor\]$/,Et0=/^(?:0|[1-9]\d*)$/,e1={};e1[Zt0]=e1[Xt0]=e1[Lt0]=e1[Dt0]=e1[Ot0]=e1[Ft0]=e1[Nt0]=e1[Mt0]=e1[At0]=!0;e1[NZ]=e1[AR]=e1[V70]=e1[J70]=e1[PZ]=e1[Q70]=e1[w70]=e1[K70]=e1[MZ]=e1[H70]=e1[Pz]=e1[G70]=e1[AZ]=e1[W70]=e1[PR]=!1;var Z70=typeof global=="object"&&global&&global.Object===Object&&global,Bt0=typeof self=="object"&&self&&self.Object===Object&&self,v5=Z70||Bt0||Function("return this")(),X70=typeof FZ=="object"&&FZ&&!FZ.nodeType&&FZ,o90=X70&&typeof Tz=="object"&&Tz&&!Tz.nodeType&&Tz,L70=o90&&o90.exports===X70,FR=L70&&Z70.process,r90=function(){try{return FR&&FR.binding&&FR.binding("util")}catch($){}}(),t90=r90&&r90.isTypedArray;function jt0($,I){var q=-1,z=$==null?0:$.length,U=0,Y=[];while(++q<z){var J=$[q];if(I(J,q,$))Y[U++]=J}return Y}function gt0($,I){var q=-1,z=I.length,U=$.length;while(++q<z)$[U+q]=I[q];return $}function vt0($,I){var q=-1,z=$==null?0:$.length;while(++q<z)if(I($[q],q,$))return!0;return!1}function Rt0($,I){var q=-1,z=Array($);while(++q<$)z[q]=I(q);return z}function Ct0($){return function(I){return $(I)}}function _t0($,I){return $.has(I)}function ht0($,I){return $==null?void 0:$[I]}function St0($){var I=-1,q=Array($.size);return $.forEach(function(z,U){q[++I]=[U,z]}),q}function ut0($,I){return function(q){return $(I(q))}}function yt0($){var I=-1,q=Array($.size);return $.forEach(function(z){q[++I]=z}),q}var xt0=Array.prototype,kt0=Function.prototype,gZ=Object.prototype,NR=v5["__core-js_shared__"],D70=kt0.toString,b8=gZ.hasOwnProperty,a90=function(){var $=/[^.]+$/.exec(NR&&NR.keys&&NR.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),O70=gZ.toString,ft0=RegExp("^"+D70.call(b8).replace(Pt0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),s90=L70?v5.Buffer:void 0,TZ=v5.Symbol,e90=v5.Uint8Array,F70=gZ.propertyIsEnumerable,nt0=xt0.splice,B3=TZ?TZ.toStringTag:void 0,$70=Object.getOwnPropertySymbols,bt0=s90?s90.isBuffer:void 0,it0=ut0(Object.keys,Object),TR=Ez(v5,"DataView"),nQ=Ez(v5,"Map"),ER=Ez(v5,"Promise"),BR=Ez(v5,"Set"),jR=Ez(v5,"WeakMap"),bQ=Ez(Object,"create"),pt0=v3(TR),ct0=v3(nQ),dt0=v3(ER),mt0=v3(BR),lt0=v3(jR),I70=TZ?TZ.prototype:void 0,MR=I70?I70.valueOf:void 0;function j3($){var I=-1,q=$==null?0:$.length;this.clear();while(++I<q){var z=$[I];this.set(z[0],z[1])}}function ot0(){this.__data__=bQ?bQ(null):{},this.size=0}function rt0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function tt0($){var I=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let q=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(qs0.default(q))return q;if(Array.isArray(q))return q[$];if(this._headers!==null)return q[this._headers[$]];return!1}format($,I,q){let z=`${zs0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:U}=this;if(U.quote!==""){if(z.indexOf(U.quote)!==-1)return this.quoteField(z.replace(this.REPLACE_REGEXP,U.escapedQuote))}if(z.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,q))return this.quoteField(z);return z}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}Bz.FieldFormatter=y70});var SR=F((x70)=>{Object.defineProperty(x70,"__esModule",{value:!0});x70.isSyncTransform=void 0;x70.isSyncTransform=($)=>$.length===1});var n70=F((jz)=>{var f70=jz&&jz.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(jz,"__esModule",{value:!0});jz.RowFormatter=void 0;var Ys0=f70(OZ()),Js0=f70(j70()),Qs0=hR(),ws0=SR();class R3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new Qs0.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(R3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(ws0.isSyncTransform($))return(I,q)=>{let z=null;try{z=$(I)}catch(U){return q(U)}return q(null,z)};return(I,q)=>{$(I,q)}}set rowTransform($){if(!Ys0.default($))throw TypeError("The transform should be a function");this._rowTransform=R3.createTransform($)}format($,I){this.callTransformer($,(q,z)=>{if(q)return I(q);if(!$)return I(null);let U=[];if(z){let{shouldFormatColumns:Y,headers:J}=this.checkHeaders(z);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)U.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Y){let Q=this.gatherColumns(z);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=R3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!Js0.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(R3.isRowHashArray($))return this.headers.map((I,q)=>{let z=$[q];if(z)return z[1];return""});if(R3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,q)=>$[q])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let q=$.map((U,Y)=>this.fieldFormatter.format(U,Y,I)).join(this.formatterOptions.delimiter),{rowCount:z}=this;if(this.rowCount+=1,z)return[this.formatterOptions.rowDelimiter,q].join("");return q}}jz.RowFormatter=R3});var b70=F((CZ)=>{Object.defineProperty(CZ,"__esModule",{value:!0});CZ.FieldFormatter=CZ.RowFormatter=void 0;var Ks0=n70();Object.defineProperty(CZ,"RowFormatter",{enumerable:!0,get:function(){return Ks0.RowFormatter}});var Hs0=hR();Object.defineProperty(CZ,"FieldFormatter",{enumerable:!0,get:function(){return Hs0.FieldFormatter}})});var uR=F((p70)=>{Object.defineProperty(p70,"__esModule",{value:!0});p70.CsvFormatterStream=void 0;var Ws0=t("stream"),Vs0=b70();class i70 extends Ws0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new Vs0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,q){let z=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(U,Y)=>{if(U)return z=!0,q(U);if(Y)Y.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return z=!0,q()})}catch(U){if(z)throw U;q(U)}}_flush($){this.rowFormatter.finish((I,q)=>{if(I)return $(I);if(q)q.forEach((z)=>{this.push(Buffer.from(z,"utf8"))});return $()})}}p70.CsvFormatterStream=i70});var m70=F((P1)=>{var d70=P1&&P1.__createBinding||(Object.create?function($,I,q,z){if(z===void 0)z=q;Object.defineProperty($,z,{enumerable:!0,get:function(){return I[q]}})}:function($,I,q,z){if(z===void 0)z=q;$[z]=I[q]}),Zs0=P1&&P1.__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}}n30.Token=f30});var zC=O((c30)=>{Object.defineProperty(c30,"__esModule",{value:!0});c30.Scanner=void 0;var b30=e9(),G11=/((?:\r\n)|\n|\r)/;class p30{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 q=I.exec($);if(q==null)return null;let z=q[1],U=this.cursor+(q.index||0);return new b30.Token({token:z,startCursor:U,endCursor:U+z.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new b30.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=G11.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}}c30.Scanner=p30});var sZ=O((l30)=>{Object.defineProperty(l30,"__esModule",{value:!0});l30.ColumnFormatter=void 0;class m30{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}}l30.ColumnFormatter=m30});var UC=O((a30)=>{Object.defineProperty(a30,"__esModule",{value:!0});a30.NonQuotedColumnParser=void 0;var W11=sZ(),r30=e9();class t30{constructor($){this.parserOptions=$,this.columnFormatter=new W11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,q=[],z=$.nextCharacterToken;for(;z;z=$.nextCharacterToken){if(r30.Token.isTokenDelimiter(z,I)||r30.Token.isTokenRowDelimiter(z))break;q.push(z.token),$.advancePastToken(z)}return this.columnFormatter.format(q.join(""))}}a30.NonQuotedColumnParser=t30});var YC=O(($I0)=>{Object.defineProperty($I0,"__esModule",{value:!0});$I0.QuotedColumnParser=void 0;var V11=sZ(),uz=e9();class e30{constructor($){this.parserOptions=$,this.columnFormatter=new V11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:q,col:z}=this.gatherDataBetweenQuotes($);if(!q){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($),z}gatherDataBetweenQuotes($){let{parserOptions:I}=this,q=!1,z=!1,U=[],Y=$.nextCharacterToken;for(;!z&&Y!==null;Y=$.nextCharacterToken){let J=uz.Token.isTokenQuote(Y,I);if(!q&&J)q=!0;else if(q)if(uz.Token.isTokenEscapeCharacter(Y,I)){$.advancePastToken(Y);let Q=$.nextCharacterToken;if(Q!==null&&(uz.Token.isTokenQuote(Q,I)||uz.Token.isTokenEscapeCharacter(Q,I)))U.push(Q.token),Y=Q;else if(J)z=!0;else U.push(Y.token)}else if(J)z=!0;else U.push(Y.token);$.advancePastToken(Y)}return{col:this.columnFormatter.format(U.join("")),foundClosingQuote:z}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:q}=$;if(q){let z=uz.Token.isTokenDelimiter(q,I),U=uz.Token.isTokenRowDelimiter(q);if(!(z||U)){let Y=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${q.token}'. at '${Y}`)}$.advanceToToken(q)}else if(!$.hasMoreData)$.advancePastLine()}}$I0.QuotedColumnParser=e30});var YI0=O((zI0)=>{Object.defineProperty(zI0,"__esModule",{value:!0});zI0.ColumnParser=void 0;var Z11=UC(),X11=YC(),L11=e9();class qI0{constructor($){this.parserOptions=$,this.quotedColumnParser=new X11.QuotedColumnParser($),this.nonQuotedColumnParser=new Z11.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&L11.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}zI0.ColumnParser=qI0});var JC=O((yz)=>{Object.defineProperty(yz,"__esModule",{value:!0});yz.ColumnFormatter=yz.QuotedColumnParser=yz.NonQuotedColumnParser=yz.ColumnParser=void 0;var D11=YI0();Object.defineProperty(yz,"ColumnParser",{enumerable:!0,get:function(){return D11.ColumnParser}});var O11=UC();Object.defineProperty(yz,"NonQuotedColumnParser",{enumerable:!0,get:function(){return O11.NonQuotedColumnParser}});var F11=YC();Object.defineProperty(yz,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,k,k,V,z);let S=V.type==="*"?AC:V.type==="?"?EC:"\\"+V.type;U=!0,z=z.slice(0,V.reStart)+S+"\\("+k}if(T(),Y)z+="\\\\";let A=H41[z.charAt(0)];for(let k=Q.length-1;k>-1;k--){let S=Q[k],f=z.slice(0,S.reStart),v=z.slice(S.reStart,S.reEnd-8),p=z.slice(S.reEnd),b=z.slice(S.reEnd-8,S.reEnd)+p,h=f.split(")").length,n=f.split("(").length-h,i=p;for(let j=0;j<n;j++)i=i.replace(/\)[+*?]?/,"");p=i;let q0=p===""&&I!==PC?"(?:$|\\/)":"";z=f+v+p+q0+b}if(z!==""&&U)z="(?=.)"+z;if(A)z=F()+z;if(I===PC)return[z,U];if(q.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return W41($);let g=q.nocase?"i":"";try{return Object.assign(new RegExp("^"+z+"$",g),{_glob:$,_src:z})}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,q=I.noglobstar?AC:I.dot?w41:K41,z=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?Z41(J):J===u6?u6:J._src).reduce((J,Q)=>{if(!(J[J.length-1]===u6&&Q===u6))J.push(Q);return J},[]),Y.forEach((J,Q)=>{if(J!==u6||Y[Q-1]===u6)return;if(Q===0)if(Y.length>1)Y[Q+1]="(?:\\/|"+q+"\\/)?"+Y[Q+1];else Y[Q]=q;else if(Q===Y.length-1)Y[Q-1]+="(?:\\/|"+q+")?";else Y[Q-1]+="(?:\\/|\\/"+q+"\\/)"+Y[Q+1],Y[Q+1]=u6}),Y.filter((J)=>J!==u6).join("/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,z)}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 q=this.options;if(TC.sep!=="/")$=$.split(TC.sep).join("/");$=$.split(aI0),this.debug(this.pattern,"split",$);let z=this.set;this.debug(this.pattern,"set",z);let U;for(let Y=$.length-1;Y>=0;Y--)if(U=$[Y],U)break;for(let Y=0;Y<z.length;Y++){let J=z[Y],Q=$;if(q.matchBase&&J.length===1)Q=[U];if(this.matchOne(Q,J,I)){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate}static defaults($){return Z$.defaults($).Minimatch}}Z$.Minimatch=mQ});var Yq0=O((dv1,Uq0)=>{Uq0.exports=zq0;var gC=t("fs"),{EventEmitter:L41}=t("events"),{Minimatch:BC}=$q0(),{resolve:D41}=t("path");function O41($,I){return new Promise((q,z)=>{gC.readdir($,{withFileTypes:!0},(U,Y)=>{if(U)switch(U.code){case"ENOTDIR":if(I)z(U);else q([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":q([]);break;case"ELOOP":default:z(U);break}else q(Y)})})}function Iq0($,I){return new Promise((q,z)=>{(I?gC.stat:gC.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)q(Iq0($,!1));else q(null);break;default:q(null);break}else q(J)})})}async function*qq0($,I,q,z,U,Y){let J=await O41(I+$,Y);for(let Q of J){let w=Q.name;if(w===void 0)w=Q,z=!0;let K=$+"/"+w,H=K.slice(1),G=I+"/"+H,W=null;if(z||q)W=await Iq0(G,q);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*qq0(K,I,q,z,U,!1)}else yield{relative:H,absolute:G,stats:W}}}async function*F41($,I,q,z){yield*qq0("",$,I,q,z,!0)}function N41($){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 vC extends L41{constructor($,I,q){super();if(typeof I==="function")q=I,I=null;if(this.options=N41(I||{}),this.matchers=[],this.options.pattern){let z=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=z.map((U)=>new BC(U,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let z=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=z.map((U)=>new BC(U,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let z=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=z.map((U)=>new BC(U,{dot:!0}))}if(this.iterator=F41(D41($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,q)this._matches=[],this.on("match",(z)=>this._matches.push(this.options.absolute?z.absolute:z.relative)),this.on("error",(z)=>q(z)),this.on("end",()=>q(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let q=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((z)=>z.match(q)))&&!this.ignoreMatchers.some((z)=>z.match(q))&&(!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 q=$.value.relative,z=$.value.absolute;if(this.options.mark&&I)q+="/",z+="/";if(this.options.stat)this.emit("match",{relative:q,absolute:z,stat:$.value.stats});else this.emit("match",{relative:q,ab Line truncated
`,u);u=$0===-1?E.length:$0}else if(d!==-1&&E[u]==="/"&&E[u+1]==="*"){let $0=E.indexOf("*/",u);if($0!==-1)u=$0+2,d=E.indexOf("*/",u);else B+=E[u],u++}else B+=E[u],u++;return B}function A$(E){let B=T6(E.toString()),u=B.match(i4);if(!u)u=B.match(n6);if(!u)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}}l30.Token=m30});var YC=F((a30)=>{Object.defineProperty(a30,"__esModule",{value:!0});a30.Scanner=void 0;var r30=I7(),A11=/((?:\r\n)|\n|\r)/;class t30{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 q=I.exec($);if(q==null)return null;let z=q[1],U=this.cursor+(q.index||0);return new r30.Token({token:z,startCursor:U,endCursor:U+z.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new r30.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=A11.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}}a30.Scanner=t30});var $X=F(($I0)=>{Object.defineProperty($I0,"__esModule",{value:!0});$I0.ColumnFormatter=void 0;class e30{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}}$I0.ColumnFormatter=e30});var JC=F((UI0)=>{Object.defineProperty(UI0,"__esModule",{value:!0});UI0.NonQuotedColumnParser=void 0;var P11=$X(),qI0=I7();class zI0{constructor($){this.parserOptions=$,this.columnFormatter=new P11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,q=[],z=$.nextCharacterToken;for(;z;z=$.nextCharacterToken){if(qI0.Token.isTokenDelimiter(z,I)||qI0.Token.isTokenRowDelimiter(z))break;q.push(z.token),$.advancePastToken(z)}return this.columnFormatter.format(q.join(""))}}UI0.NonQuotedColumnParser=zI0});var QC=F((QI0)=>{Object.defineProperty(QI0,"__esModule",{value:!0});QI0.QuotedColumnParser=void 0;var T11=$X(),kz=I7();class JI0{constructor($){this.parserOptions=$,this.columnFormatter=new T11.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:q,col:z}=this.gatherDataBetweenQuotes($);if(!q){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($),z}gatherDataBetweenQuotes($){let{parserOptions:I}=this,q=!1,z=!1,U=[],Y=$.nextCharacterToken;for(;!z&&Y!==null;Y=$.nextCharacterToken){let J=kz.Token.isTokenQuote(Y,I);if(!q&&J)q=!0;else if(q)if(kz.Token.isTokenEscapeCharacter(Y,I)){$.advancePastToken(Y);let Q=$.nextCharacterToken;if(Q!==null&&(kz.Token.isTokenQuote(Q,I)||kz.Token.isTokenEscapeCharacter(Q,I)))U.push(Q.token),Y=Q;else if(J)z=!0;else U.push(Y.token)}else if(J)z=!0;else U.push(Y.token);$.advancePastToken(Y)}return{col:this.columnFormatter.format(U.join("")),foundClosingQuote:z}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:q}=$;if(q){let z=kz.Token.isTokenDelimiter(q,I),U=kz.Token.isTokenRowDelimiter(q);if(!(z||U)){let Y=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${q.token}'. at '${Y}`)}$.advanceToToken(q)}else if(!$.hasMoreData)$.advancePastLine()}}QI0.QuotedColumnParser=JI0});var WI0=F((HI0)=>{Object.defineProperty(HI0,"__esModule",{value:!0});HI0.ColumnParser=void 0;var E11=JC(),B11=QC(),j11=I7();class KI0{constructor($){this.parserOptions=$,this.quotedColumnParser=new B11.QuotedColumnParser($),this.nonQuotedColumnParser=new E11.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&j11.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}HI0.ColumnParser=KI0});var wC=F((fz)=>{Object.defineProperty(fz,"__esModule",{value:!0});fz.ColumnFormatter=fz.QuotedColumnParser=fz.NonQuotedColumnParser=fz.ColumnParser=void 0;var g11=WI0();Object.defineProperty(fz,"ColumnParser",{enumerable:!0,get:function(){return g11.ColumnParser}});var v11=JC();Object.defineProperty(fz,"NonQuotedColumnParser",{enumerable:!0,get:function(){return v11.NonQuotedColumnParser}});var R11=QC();Object.defineProperty(fz,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,k,k,V,z);let S=V.type==="*"?TC:V.type==="?"?jC:"\\"+V.type;U=!0,z=z.slice(0,V.reStart)+S+"\\("+k}if(T(),Y)z+="\\\\";let A=M41[z.charAt(0)];for(let k=Q.length-1;k>-1;k--){let S=Q[k],f=z.slice(0,S.reStart),v=z.slice(S.reStart,S.reEnd-8),p=z.slice(S.reEnd),i=z.slice(S.reEnd-8,S.reEnd)+p,h=f.split(")").length,n=f.split("(").length-h,b=p;for(let B=0;B<n;B++)b=b.replace(/\)[+*?]?/,"");p=b;let q0=p===""&&I!==EC?"(?:$|\\/)":"";z=f+v+p+q0+i}if(z!==""&&U)z="(?=.)"+z;if(A)z=O()+z;if(I===EC)return[z,U];if(q.nocase&&!U)U=$.toUpperCase()!==$.toLowerCase();if(!U)return P41($);let g=q.nocase?"i":"";try{return Object.assign(new RegExp("^"+z+"$",g),{_glob:$,_src:z})}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,q=I.noglobstar?TC:I.dot?F41:N41,z=I.nocase?"i":"",U=$.map((Y)=>{return Y=Y.map((J)=>typeof J==="string"?E41(J):J===u6?u6:J._src).reduce((J,Q)=>{if(!(J[J.length-1]===u6&&Q===u6))J.push(Q);return J},[]),Y.forEach((J,Q)=>{if(J!==u6||Y[Q-1]===u6)return;if(Q===0)if(Y.length>1)Y[Q+1]="(?:\\/|"+q+"\\/)?"+Y[Q+1];else Y[Q]=q;else if(Q===Y.length-1)Y[Q-1]+="(?:\\/|"+q+")?";else Y[Q-1]+="(?:\\/|\\/"+q+"\\/)"+Y[Q+1],Y[Q+1]=u6}),Y.filter((J)=>J!==u6).join("/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,z)}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 q=this.options;if(BC.sep!=="/")$=$.split(BC.sep).join("/");$=$.split(Uq0),this.debug(this.pattern,"split",$);let z=this.set;this.debug(this.pattern,"set",z);let U;for(let Y=$.length-1;Y>=0;Y--)if(U=$[Y],U)break;for(let Y=0;Y<z.length;Y++){let J=z[Y],Q=$;if(q.matchBase&&J.length===1)Q=[U];if(this.matchOne(Q,J,I)){if(q.flipNegate)return!0;return!this.negate}}if(q.flipNegate)return!1;return this.negate}static defaults($){return Z$.defaults($).Minimatch}}Z$.Minimatch=rQ});var Wq0=F((JR1,Gq0)=>{Gq0.exports=Hq0;var RC=t("fs"),{EventEmitter:j41}=t("events"),{Minimatch:vC}=Qq0(),{resolve:g41}=t("path");function v41($,I){return new Promise((q,z)=>{RC.readdir($,{withFileTypes:!0},(U,Y)=>{if(U)switch(U.code){case"ENOTDIR":if(I)z(U);else q([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":q([]);break;case"ELOOP":default:z(U);break}else q(Y)})})}function wq0($,I){return new Promise((q,z)=>{(I?RC.stat:RC.lstat)($,(Y,J)=>{if(Y)switch(Y.code){case"ENOENT":if(I)q(wq0($,!1));else q(null);break;default:q(null);break}else q(J)})})}async function*Kq0($,I,q,z,U,Y){let J=await v41(I+$,Y);for(let Q of J){let w=Q.name;if(w===void 0)w=Q,z=!0;let K=$+"/"+w,H=K.slice(1),G=I+"/"+H,W=null;if(z||q)W=await wq0(G,q);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*Kq0(K,I,q,z,U,!1)}else yield{relative:H,absolute:G,stats:W}}}async function*R41($,I,q,z){yield*Kq0("",$,I,q,z,!0)}function C41($){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 CC extends j41{constructor($,I,q){super();if(typeof I==="function")q=I,I=null;if(this.options=C41(I||{}),this.matchers=[],this.options.pattern){let z=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=z.map((U)=>new vC(U,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let z=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=z.map((U)=>new vC(U,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let z=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=z.map((U)=>new vC(U,{dot:!0}))}if(this.iterator=R41(g41($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,q)this._matches=[],this.on("match",(z)=>this._matches.push(this.options.absolute?z.absolute:z.relative)),this.on("error",(z)=>q(z)),this.on("end",()=>q(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let q=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((z)=>z.match(q)))&&!this.ignoreMatchers.some((z)=>z.match(q))&&(!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 q=$.value.relative,z=$.value.absolute;if(this.options.mark&&I)q+="/",z+="/";if(this.options.stat)this.emit("match",{relative:q,absolute:z,stat:$.value.stats});else this.emit("match",{relative:q,ab Line truncated
`,u);u=$0===-1?E.length:$0}else if(d!==-1&&E[u]==="/"&&E[u+1]==="*"){let $0=E.indexOf("*/",u);if($0!==-1)u=$0+2,d=E.indexOf("*/",u);else j+=E[u],u++}else j+=E[u],u++;return j}function P$(E){let j=T6(E.toString()),u=j.match(b4);if(!u)u=j.match(n6);if(!u)throw Error(`could not parse args in autoInject
Source:
`+B);let[,d]=u;return d.replace(/\s/g,"").split(M$).map(($0)=>$0.replace(i6,"").trim())}function U$(E,B){var u={};return Object.keys(E).forEach((d)=>{var $0=E[d],z0,w0=V($0),K0=!w0&&$0.length===1||w0&&$0.length===0;if(Array.isArray($0))z0=[...$0],$0=z0.pop(),u[d]=z0.concat(z0.length>0?Z0:$0);else if(K0)u[d]=$0;else{if(z0=A$($0),$0.length===0&&!w0&&z0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!w0)z0.pop();u[d]=z0.concat(Z0)}function Z0(_0,K1){var F1=z0.map((W1)=>_0[W1]);F1.push(K1),D($0)(...F1)}}),O1(u,B)}class v7{constructor(){this.head=this.tail=null,this.length=0}removeLink(E){if(E.prev)E.prev.next=E.next;else this.head=E.next;if(E.next)E.next.prev=E.prev;else this.tail=E.prev;return E.prev=E.next=null,this.length-=1,E}empty(){while(this.head)this.shift();return this}insertAfter(E,B){if(B.prev=E,B.next=E.next,E.next)E.next.prev=B;else this.tail=B;E.next=B,this.length+=1}insertBefore(E,B){if(B.prev=E.prev,B.next=E,E.prev)E.prev.next=B;else this.head=B;E.prev=B,this.length+=1}unshift(E){if(this.head)this.insertBefore(this.head,E);else Y$(this,E)}push(E){if(this.tail)this.insertAfter(this.tail,E);else Y$(this,E)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var E=this.head;while(E)yield E.data,E=E.next}remove(E){var B=this.head;while(B){var{next:u}=B;if(E(B))this.removeLink(B);B=u}return this}}function Y$(E,B){E.length=1,E.head=E.tail=B}function $9(E,B,u){if(B==null)B=1;else if(B===0)throw RangeError("Concurrency must not be zero");var d=D(E),$0=0,z0=[];let w0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function K0(y0,R0){w0[y0].push(R0)}function Z0(y0,R0){let x0=(...V1)=>{_0(y0,x0),R0(...V1)};w0[y0].push(x0)}function _0(y0,R0){if(!y0)return Object.keys(w0).forEach((x0)=>w0[x0]=[]);if(!R0)return w0[y0]=[];w0[y0]=w0[y0].filter((x0)=>x0!==R0)}function K1(y0,...R0){w0[y0].forEach((x0)=>x0(...R0))}var F1=!1;function W1(y0,R0,x0,V1){if(V1!=null&&typeof V1!=="function")throw Error("task callback must be a function");N1.started=!0;var J4,b4;function T$(C7,...oU){if(C7)return x0?b4(C7):J4();if(oU.length<=1)return J4(oU[0]);J4(oU)}var PI=N1._createTaskItem(y0,x0?T$:V1||T$);if(R0)N1._tasks.unshift(PI);else N1._tasks.push(PI);if(!F1)F1=!0,K(()=>{F1=!1,N1.process()});if(x0||!V1)return new Promise((C7,oU)=>{J4=C7,b4=oU})}function P$(y0){return function(R0,...x0){$0-=1;for(var V1=0,J4=y0.length;V1<J4;V1++){var b4=y0[V1],T$=z0.indexOf(b4);if(T$===0)z0.shift();else if(T$>0)z0.splice(T$,1);if(b4.callback(R0,...x0),R0!=null)K1("error",R0,b4.data)}if($0<=N1.concurrency-N1.buffer)K1("unsaturated");if(N1.idle())K1("drain");N1.process()}}function AI(y0){if(y0.length===0&&N1.idle())return K(()=>K1("drain")),!0;return!1}let R7=(y0)=>(R0)=>{if(!R0)return new Promise((x0,V1)=>{Z0(y0,(J4,b4)=>{if(J4)return V1(J4);x0(b4)})});_0(y0),K0(y0,R0)};var lU=!1,N1={_tasks:new v7,_createTaskItem(y0,R0){return{data:y0,callback:R0}},*[Symbol.iterator](){yield*N1._tasks[Symbol.iterator]()},concurrency:B,payload:u,buffer:B/4,started:!1,paused:!1,push(y0,R0){if(Array.isArray(y0)){if(AI(y0))return;return y0.map((x0)=>W1(x0,!1,!1,R0))}return W1(y0,!1,!1,R0)},pushAsync(y0,R0){if(Array.isArray(y0)){if(AI(y0))return;return y0.map((x0)=>W1(x0,!1,!0,R0))}return W1(y0,!1,!0,R0)},kill(){_0(),N1._tasks.empty()},unshift(y0,R0){if(Array.isArray(y0)){if(AI(y0))return;return y0.map((x0)=>W1(x0,!0,!1,R0))}return W1(y0,!0,!1,R0)},unshiftAsync(y0,R0){if(Array.isArray(y0)){if(AI(y0))return;return y0.map((x0)=>W1(x0,!0,!0,R0))}return W1(y0,!0,!0,R0)},remove(y0){N1._tasks.remove(y0)},process(){if(lU)return;lU=!0;while(!N1.paused&&$0<N1.concurrency&&N1._tasks.length){var y0=[],R0=[],x0=N1._tasks.length;if(N1.payload)x0=Math.min(x0,N1.payload);for(var V1=0;V1<x0;V1++){var J4=N1._tasks.shift();y0.push(J4),z0.push(J4),R0.push(J4.data)}if($0+=1,N1._tasks.length===0)K1("empty");if($0===N1.concurrency)K1("saturated");var b4=h(P$(y0));d(R0,b4)}lU=!1},length(){return N1._tasks.length},running(){return $0},workersList(){return z0},idle(){return N1._tasks.length+$0===0},pause(){N1.paused=!0},resume(){if(N1.paused===!1)return;N1.paused=!1,K(N1.process)}};return Object.defineProperties(N1,{saturated:{writable:!1,value:R7("saturated")},unsaturated:{writable:!1,value:R7("unsaturated")},empty:{writable:!1,value:R7("empty")},drain:{writable:!1,value:R7("drain")},error:{writable:!1,value:R7("error")}}),N1}function B0(E,B){return $9(E,1,B)}function a(E,B,u){return $9(E,B,u)}function N(E,B,u,d){d=k(d);var $0=D(u);return k0(E,(z0,w0,K0)=>{$0(B,z0,(Z0,_0)=>{B=_0,K0(Z0)})},(z0)=>d(z0,B))}var M=F(N,4);function R(...E){var B=E.map(D);return function(...u){var d=this,$0=u[u.length-1];if(typeof $0=="function")u.pop();else $0=q1();return M(B,u,(z0,w0,K0)=>{w0.apply(d,z0.concat((Z0,..._0)=>{K0(Z0,_0)}))},(z0,w0)=>$0(z0,...w0)),$0[g0]}}function y(...E){return R(...E.reverse())}function s(E,B,u,d){return T(i(B),E,u,d)}var m=F(s,4);function e( Line truncated
GFS4: `),console.error($)};if(!V4[J6]){if(RC=global[J6]||[],Lq0(V4,RC),V4.close=function($){function I(q,z){return $.call(V4,q,function(U){if(!U)Xq0();if(typeof z==="function")z.apply(this,arguments)})}return Object.defineProperty(I,wX,{value:$}),I}(V4.close),V4.closeSync=function($){function I(q){$.apply(V4,arguments),Xq0()}return Object.defineProperty(I,wX,{value:$}),I}(V4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){_3(V4[J6]),t("assert").equal(V4[J6].length,0)})}var RC;if(!global[J6])Lq0(global,V4[J6]);hC.exports=CC(v41(V4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!V4.__patched)hC.exports=CC(V4),V4.__patched=!0;function CC($){B41($),$.gracefulify=CC,$.createReadStream=g,$.createWriteStream=k;var I=$.readFile;$.readFile=q;function q(v,p,b){if(typeof p==="function")b=p,p=null;return h(v,p,b);function h(n,i,q0,j){return I(n,i,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))fz([h,[n,i,q0],x,j||Date.now(),Date.now()]);else if(typeof q0==="function")q0.apply(this,arguments)})}}var z=$.writeFile;$.writeFile=U;function U(v,p,b,h){if(typeof b==="function")h=b,b=null;return n(v,p,b,h);function n(i,q0,j,x,c){return z(i,q0,j,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))fz([n,[i,q0,j,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(v,p,b,h){if(typeof b==="function")h=b,b=null;return n(v,p,b,h);function n(i,q0,j,x,c){return Y(i,q0,j,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))fz([n,[i,q0,j,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=w;function w(v,p,b,h){if(typeof b==="function")h=b,b=0;return n(v,p,b,h);function n(i,q0,j,x,c){return Q(i,q0,j,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))fz([n,[i,q0,j,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var K=$.readdir;$.readdir=G;var H=/^v[0-5]\./;function G(v,p,b){if(typeof p==="function")b=p,p=null;var h=H.test(process.version)?function(q0,j,x,c){return K(q0,n(q0,j,x,c))}:function(q0,j,x,c){return K(q0,j,n(q0,j,x,c))};return h(v,p,b);function n(i,q0,j,x){return function(c,r){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))fz([h,[i,q0,j],c,x||Date.now(),Date.now()]);else{if(r&&r.sort)r.sort();if(typeof j==="function")j.call(this,c,r)}}}}if(process.version.substr(0,4)==="v0.8"){var W=g41($);F=W.ReadStream,T=W.WriteStream}var V=$.ReadStream;if(V)F.prototype=Object.create(V.prototype),F.prototype.open=P;var X=$.WriteStream;if(X)T.prototype=Object.create(X.prototype),T.prototype.open=A;Object.defineProperty($,"ReadStream",{get:function(){return F},set:function(v){F=v},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return T},set:function(v){T=v},enumerable:!0,configurable:!0});var L=F;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(v){L=v},enumerable:!0,configurable:!0});var D=T;Object.defineProperty($,"FileWriteStream",{get:function(){return D},set:function(v){D=v},enumerable:!0,configurable:!0});function F(v,p){if(this instanceof F)return V.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function P(){var v=this;f(v.path,v.flags,v.mode,function(p,b){if(p){if(v.autoClose)v.destroy();v.emit("error",p)}else v.fd=b,v.emit("open",b),v.read()})}function T(v,p){if(this instanceof T)return X.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function A(){var v=this;f(v.path,v.flags,v.mode,function(p,b){if(p)v.destroy(),v.emit("error",p);else v.fd=b,v.emit("open",b)})}function g(v,p){return new $.ReadStream(v,p)}function k(v,p){return new $.WriteStream(v,p)}var S=$.open;$.open=f;function f(v,p,b,h){if(typeof b==="function")h=b,b=null;return n(v,p,b,h);function n(i,q0,j,x,c){return S(i,q0,j,function(r,U0){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))fz([n,[i,q0,j,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}return $}function fz($){_3("ENQUEUE",$[0].name,$[1]),V4[J6].push($),_C()}var QX;function Xq0(){var $=Date.now();for(var I=0;I<V4[J6].length;++I)if(V4[J6][I].length>2)V4[J6][I][3]=$,V4[J6][I][4]=$;_C()}function _C(){if(clearTimeout(QX),QX=void 0,V4[J6].length===0)return;var $=V4[J6].shift(),I=$[0],q=$[1],z=$[2],U=$[3],Y=$[4];if(U===void 0)_3("RETRY",I.name,q),I.apply(null,q);else if(Date.now()-U>=60000){_3("TIMEOUT",I.name,q);var J=q.pop();if(typeof J==="function")J.call(null,z)}else{var Q=Date.now()-Y,w=Math.max(Y-U,1),K=Math.min(w*1.2,100);if(Q>=K)_3("RETRY",I.name,q),I.apply(null,q.concat([U]));else V4[J6].push($)}if(QX===void 0)QX=setTimeout(_C,0)}});var Oq0=O((tv1,SC)=>{function C41($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Dq0=T4().Buffer,lQ=t("util");function _41($,I,q){$.copy(I,q)}SC.exports=function(){function $(){C41(this,$),this.head=null,this.tail=null,th Line truncated
`+j);let[,d]=u;return d.replace(/\s/g,"").split(A$).map(($0)=>$0.replace(b6,"").trim())}function U$(E,j){var u={};return Object.keys(E).forEach((d)=>{var $0=E[d],z0,w0=V($0),K0=!w0&&$0.length===1||w0&&$0.length===0;if(Array.isArray($0))z0=[...$0],$0=z0.pop(),u[d]=z0.concat(z0.length>0?Z0:$0);else if(K0)u[d]=$0;else{if(z0=P$($0),$0.length===0&&!w0&&z0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!w0)z0.pop();u[d]=z0.concat(Z0)}function Z0(_0,K1){var F1=z0.map((W1)=>_0[W1]);F1.push(K1),D($0)(...F1)}}),O1(u,j)}class C7{constructor(){this.head=this.tail=null,this.length=0}removeLink(E){if(E.prev)E.prev.next=E.next;else this.head=E.next;if(E.next)E.next.prev=E.prev;else this.tail=E.prev;return E.prev=E.next=null,this.length-=1,E}empty(){while(this.head)this.shift();return this}insertAfter(E,j){if(j.prev=E,j.next=E.next,E.next)E.next.prev=j;else this.tail=j;E.next=j,this.length+=1}insertBefore(E,j){if(j.prev=E.prev,j.next=E,E.prev)E.prev.next=j;else this.head=j;E.prev=j,this.length+=1}unshift(E){if(this.head)this.insertBefore(this.head,E);else Y$(this,E)}push(E){if(this.tail)this.insertAfter(this.tail,E);else Y$(this,E)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var E=this.head;while(E)yield E.data,E=E.next}remove(E){var j=this.head;while(j){var{next:u}=j;if(E(j))this.removeLink(j);j=u}return this}}function Y$(E,j){E.length=1,E.head=E.tail=j}function q9(E,j,u){if(j==null)j=1;else if(j===0)throw RangeError("Concurrency must not be zero");var d=D(E),$0=0,z0=[];let w0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function K0(y0,R0){w0[y0].push(R0)}function Z0(y0,R0){let x0=(...V1)=>{_0(y0,x0),R0(...V1)};w0[y0].push(x0)}function _0(y0,R0){if(!y0)return Object.keys(w0).forEach((x0)=>w0[x0]=[]);if(!R0)return w0[y0]=[];w0[y0]=w0[y0].filter((x0)=>x0!==R0)}function K1(y0,...R0){w0[y0].forEach((x0)=>x0(...R0))}var F1=!1;function W1(y0,R0,x0,V1){if(V1!=null&&typeof V1!=="function")throw Error("task callback must be a function");N1.started=!0;var J4,i4;function E$(h7,...aU){if(h7)return x0?i4(h7):J4();if(aU.length<=1)return J4(aU[0]);J4(aU)}var BI=N1._createTaskItem(y0,x0?E$:V1||E$);if(R0)N1._tasks.unshift(BI);else N1._tasks.push(BI);if(!F1)F1=!0,K(()=>{F1=!1,N1.process()});if(x0||!V1)return new Promise((h7,aU)=>{J4=h7,i4=aU})}function T$(y0){return function(R0,...x0){$0-=1;for(var V1=0,J4=y0.length;V1<J4;V1++){var i4=y0[V1],E$=z0.indexOf(i4);if(E$===0)z0.shift();else if(E$>0)z0.splice(E$,1);if(i4.callback(R0,...x0),R0!=null)K1("error",R0,i4.data)}if($0<=N1.concurrency-N1.buffer)K1("unsaturated");if(N1.idle())K1("drain");N1.process()}}function EI(y0){if(y0.length===0&&N1.idle())return K(()=>K1("drain")),!0;return!1}let _7=(y0)=>(R0)=>{if(!R0)return new Promise((x0,V1)=>{Z0(y0,(J4,i4)=>{if(J4)return V1(J4);x0(i4)})});_0(y0),K0(y0,R0)};var tU=!1,N1={_tasks:new C7,_createTaskItem(y0,R0){return{data:y0,callback:R0}},*[Symbol.iterator](){yield*N1._tasks[Symbol.iterator]()},concurrency:j,payload:u,buffer:j/4,started:!1,paused:!1,push(y0,R0){if(Array.isArray(y0)){if(EI(y0))return;return y0.map((x0)=>W1(x0,!1,!1,R0))}return W1(y0,!1,!1,R0)},pushAsync(y0,R0){if(Array.isArray(y0)){if(EI(y0))return;return y0.map((x0)=>W1(x0,!1,!0,R0))}return W1(y0,!1,!0,R0)},kill(){_0(),N1._tasks.empty()},unshift(y0,R0){if(Array.isArray(y0)){if(EI(y0))return;return y0.map((x0)=>W1(x0,!0,!1,R0))}return W1(y0,!0,!1,R0)},unshiftAsync(y0,R0){if(Array.isArray(y0)){if(EI(y0))return;return y0.map((x0)=>W1(x0,!0,!0,R0))}return W1(y0,!0,!0,R0)},remove(y0){N1._tasks.remove(y0)},process(){if(tU)return;tU=!0;while(!N1.paused&&$0<N1.concurrency&&N1._tasks.length){var y0=[],R0=[],x0=N1._tasks.length;if(N1.payload)x0=Math.min(x0,N1.payload);for(var V1=0;V1<x0;V1++){var J4=N1._tasks.shift();y0.push(J4),z0.push(J4),R0.push(J4.data)}if($0+=1,N1._tasks.length===0)K1("empty");if($0===N1.concurrency)K1("saturated");var i4=h(T$(y0));d(R0,i4)}tU=!1},length(){return N1._tasks.length},running(){return $0},workersList(){return z0},idle(){return N1._tasks.length+$0===0},pause(){N1.paused=!0},resume(){if(N1.paused===!1)return;N1.paused=!1,K(N1.process)}};return Object.defineProperties(N1,{saturated:{writable:!1,value:_7("saturated")},unsaturated:{writable:!1,value:_7("unsaturated")},empty:{writable:!1,value:_7("empty")},drain:{writable:!1,value:_7("drain")},error:{writable:!1,value:_7("error")}}),N1}function j0(E,j){return q9(E,1,j)}function a(E,j,u){return q9(E,j,u)}function N(E,j,u,d){d=k(d);var $0=D(u);return k0(E,(z0,w0,K0)=>{$0(j,z0,(Z0,_0)=>{j=_0,K0(Z0)})},(z0)=>d(z0,j))}var M=O(N,4);function R(...E){var j=E.map(D);return function(...u){var d=this,$0=u[u.length-1];if(typeof $0=="function")u.pop();else $0=z1();return M(j,u,(z0,w0,K0)=>{w0.apply(d,z0.concat((Z0,..._0)=>{K0(Z0,_0)}))},(z0,w0)=>$0(z0,...w0)),$0[g0]}}function y(...E){return R(...E.reverse())}function s(E,j,u,d){return T(b(j),E,u,d)}var m=O(s,4);function e( Line truncated
GFS4: `),console.error($)};if(!Z4[J6]){if(_C=global[J6]||[],Pq0(Z4,_C),Z4.close=function($){function I(q,z){return $.call(Z4,q,function(U){if(!U)Aq0();if(typeof z==="function")z.apply(this,arguments)})}return Object.defineProperty(I,HX,{value:$}),I}(Z4.close),Z4.closeSync=function($){function I(q){$.apply(Z4,arguments),Aq0()}return Object.defineProperty(I,HX,{value:$}),I}(Z4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){S3(Z4[J6]),t("assert").equal(Z4[J6].length,0)})}var _C;if(!global[J6])Pq0(global,Z4[J6]);uC.exports=hC(n41(Z4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Z4.__patched)uC.exports=hC(Z4),Z4.__patched=!0;function hC($){k41($),$.gracefulify=hC,$.createReadStream=g,$.createWriteStream=k;var I=$.readFile;$.readFile=q;function q(v,p,i){if(typeof p==="function")i=p,p=null;return h(v,p,i);function h(n,b,q0,B){return I(n,b,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))iz([h,[n,b,q0],x,B||Date.now(),Date.now()]);else if(typeof q0==="function")q0.apply(this,arguments)})}}var z=$.writeFile;$.writeFile=U;function U(v,p,i,h){if(typeof i==="function")h=i,i=null;return n(v,p,i,h);function n(b,q0,B,x,c){return z(b,q0,B,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))iz([n,[b,q0,B,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var Y=$.appendFile;if(Y)$.appendFile=J;function J(v,p,i,h){if(typeof i==="function")h=i,i=null;return n(v,p,i,h);function n(b,q0,B,x,c){return Y(b,q0,B,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))iz([n,[b,q0,B,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var Q=$.copyFile;if(Q)$.copyFile=w;function w(v,p,i,h){if(typeof i==="function")h=i,i=0;return n(v,p,i,h);function n(b,q0,B,x,c){return Q(b,q0,B,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))iz([n,[b,q0,B,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var K=$.readdir;$.readdir=G;var H=/^v[0-5]\./;function G(v,p,i){if(typeof p==="function")i=p,p=null;var h=H.test(process.version)?function(q0,B,x,c){return K(q0,n(q0,B,x,c))}:function(q0,B,x,c){return K(q0,B,n(q0,B,x,c))};return h(v,p,i);function n(b,q0,B,x){return function(c,r){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))iz([h,[b,q0,B],c,x||Date.now(),Date.now()]);else{if(r&&r.sort)r.sort();if(typeof B==="function")B.call(this,c,r)}}}}if(process.version.substr(0,4)==="v0.8"){var W=f41($);O=W.ReadStream,T=W.WriteStream}var V=$.ReadStream;if(V)O.prototype=Object.create(V.prototype),O.prototype.open=P;var X=$.WriteStream;if(X)T.prototype=Object.create(X.prototype),T.prototype.open=A;Object.defineProperty($,"ReadStream",{get:function(){return O},set:function(v){O=v},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return T},set:function(v){T=v},enumerable:!0,configurable:!0});var L=O;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(v){L=v},enumerable:!0,configurable:!0});var D=T;Object.defineProperty($,"FileWriteStream",{get:function(){return D},set:function(v){D=v},enumerable:!0,configurable:!0});function O(v,p){if(this instanceof O)return V.apply(this,arguments),this;else return O.apply(Object.create(O.prototype),arguments)}function P(){var v=this;f(v.path,v.flags,v.mode,function(p,i){if(p){if(v.autoClose)v.destroy();v.emit("error",p)}else v.fd=i,v.emit("open",i),v.read()})}function T(v,p){if(this instanceof T)return X.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function A(){var v=this;f(v.path,v.flags,v.mode,function(p,i){if(p)v.destroy(),v.emit("error",p);else v.fd=i,v.emit("open",i)})}function g(v,p){return new $.ReadStream(v,p)}function k(v,p){return new $.WriteStream(v,p)}var S=$.open;$.open=f;function f(v,p,i,h){if(typeof i==="function")h=i,i=null;return n(v,p,i,h);function n(b,q0,B,x,c){return S(b,q0,B,function(r,U0){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))iz([n,[b,q0,B,x],r,c||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}return $}function iz($){S3("ENQUEUE",$[0].name,$[1]),Z4[J6].push($),SC()}var KX;function Aq0(){var $=Date.now();for(var I=0;I<Z4[J6].length;++I)if(Z4[J6][I].length>2)Z4[J6][I][3]=$,Z4[J6][I][4]=$;SC()}function SC(){if(clearTimeout(KX),KX=void 0,Z4[J6].length===0)return;var $=Z4[J6].shift(),I=$[0],q=$[1],z=$[2],U=$[3],Y=$[4];if(U===void 0)S3("RETRY",I.name,q),I.apply(null,q);else if(Date.now()-U>=60000){S3("TIMEOUT",I.name,q);var J=q.pop();if(typeof J==="function")J.call(null,z)}else{var Q=Date.now()-Y,w=Math.max(Y-U,1),K=Math.min(w*1.2,100);if(Q>=K)S3("RETRY",I.name,q),I.apply(null,q.concat([U]));else Z4[J6].push($)}if(KX===void 0)KX=setTimeout(SC,0)}});var Eq0=F((GR1,yC)=>{function i41($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Tq0=T4().Buffer,tQ=t("util");function p41($,I,q){$.copy(I,q)}yC.exports=function(){function $(){i41(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.
*/Uz0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var q=$.length;if(q<=1)return $;var z="";if(q>4&&$[3]==="\\"){var U=$[2];if((U==="?"||U===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),z="//"}var Y=$.split(/[/\\]+/);if(I!==!1&&Y[Y.length-1]==="")Y.pop();return z+Y.join("/")}});var $_=O((wR1,Gz0)=>{var Jz0=9007199254740991,k61="[object Arguments]",f61="[object Function]",n61="[object GeneratorFunction]",i61=/^(?:0|[1-9]\d*)$/;function Qz0($,I,q){switch(q.length){case 0:return $.call(I);case 1:return $.call(I,q[0]);case 2:return $.call(I,q[0],q[1]);case 3:return $.call(I,q[0],q[1],q[2])}return $.apply(I,q)}function b61($,I){var q=-1,z=Array($);while(++q<$)z[q]=I(q);return z}var q2=Object.prototype,z2=q2.hasOwnProperty,wz0=q2.toString,p61=q2.propertyIsEnumerable,Yz0=Math.max;function c61($,I){var q=$$1($)||e61($)?b61($.length,String):[],z=q.length,U=!!z;for(var Y in $)if((I||z2.call($,Y))&&!(U&&(Y=="length"||Hz0(Y,z))))q.push(Y);return q}function d61($,I,q,z){if($===void 0||aC($,q2[q])&&!z2.call(z,q))return I;return $}function m61($,I,q){var z=$[I];if(!(z2.call($,I)&&aC(z,q))||q===void 0&&!(I in $))$[I]=q}function l61($){if(!eC($))return s61($);var I=a61($),q=[];for(var z in $)if(!(z=="constructor"&&(I||!z2.call($,z))))q.push(z);return q}function Kz0($,I){return I=Yz0(I===void 0?$.length-1:I,0),function(){var q=arguments,z=-1,U=Yz0(q.length-I,0),Y=Array(U);while(++z<U)Y[z]=q[I+z];z=-1;var J=Array(I+1);while(++z<I)J[z]=q[z];return J[I]=Y,Qz0($,this,J)}}function o61($,I,q,z){q||(q={});var U=-1,Y=I.length;while(++U<Y){var J=I[U],Q=z?z(q[J],$[J],J,q,$):void 0;m61(q,J,Q===void 0?$[J]:Q)}return q}function r61($){return Kz0(function(I,q){var z=-1,U=q.length,Y=U>1?q[U-1]:void 0,J=U>2?q[2]:void 0;if(Y=$.length>3&&typeof Y=="function"?(U--,Y):void 0,J&&t61(q[0],q[1],J))Y=U<3?void 0:Y,U=1;I=Object(I);while(++z<U){var Q=q[z];if(Q)$(I,Q,z,Y)}return I})}function Hz0($,I){return I=I==null?Jz0:I,!!I&&(typeof $=="number"||i61.test($))&&($>-1&&$%1==0&&$<I)}function t61($,I,q){if(!eC(q))return!1;var z=typeof I;if(z=="number"?sC(q)&&Hz0(I,q.length):z=="string"&&(I in q))return aC(q[I],$);return!1}function a61($){var I=$&&$.constructor,q=typeof I=="function"&&I.prototype||q2;return $===q}function s61($){var I=[];if($!=null)for(var q in Object($))I.push(q);return I}function aC($,I){return $===I||$!==$&&I!==I}function e61($){return I$1($)&&z2.call($,"callee")&&(!p61.call($,"callee")||wz0.call($)==k61)}var $$1=Array.isArray;function sC($){return $!=null&&z$1($.length)&&!q$1($)}function I$1($){return U$1($)&&sC($)}function q$1($){var I=eC($)?wz0.call($):"";return I==f61||I==n61}function z$1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=Jz0}function eC($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function U$1($){return!!$&&typeof $=="object"}var Y$1=r61(function($,I,q,z){o61(I,Q$1(I),$,z)}),J$1=Kz0(function($){return $.push(void 0,d61),Qz0(Y$1,void 0,$)});function Q$1($){return sC($)?c61($,!0):l61($)}Gz0.exports=J$1});var Vz0=O((KR1,I_)=>{function w$1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Wz0=T4().Buffer,U2=t("util");function K$1($,I,q){$.copy(I,q)}I_.exports=function(){function $(){w$1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(q){var z={data:q,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(q){var z={data:q,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length},$.prototype.shift=function(){if(this.length===0)return;var q=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,q},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(q){if(this.length===0)return"";var z=this.head,U=""+z.data;while(z=z.next)U+=q+z.data;return U},$.prototype.concat=function(q){if(this.length===0)return Wz0.alloc(0);var z=Wz0.allocUnsafe(q>>>0),U=this.head,Y=0;while(U)K$1(U.data,z,Y),Y+=U.data.length,U=U.next;return z},$}();if(U2&&U2.inspect&&U2.inspect.custom)I_.exports.prototype[U2.inspect.custom]=function(){var $=U2.inspect({length:this.length});return this.constructor.name+" "+$}});var q_=O((HR1,Zz0)=>{var MX=P4();function H$1($,I){var q=this,z=this._readableState&&this._readableState.destroyed,U=this._writableState&&this._writableState.destroyed;if(z||U){if(I)I($);else if($){if(!this._writableState)MX.nextTick(AX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,MX.nextTick(AX,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(!q._writableState)MX.nextTick(AX,q,Y);else if(!q._writableState.errorEmitted)q._writableState.errorEmitted=!0,MX.nextTick(AX,q,Y)}else if(I)I(Y)}),this}function G$1(){if(this._readableState)this._readable Line truncated
%s`,g,g,P,z);var k=P.type==="*"?n_:P.type==="?"?f_:"\\"+P.type;U=!0,z=z.slice(0,P.reStart)+k+"\\("+g}if(X(),Y)z+="\\\\";var S=!1;switch(z.charAt(0)){case"[":case".":case"(":S=!0}for(var f=Q.length-1;f>-1;f--){var v=Q[f],p=z.slice(0,v.reStart),b=z.slice(v.reStart,v.reEnd-8),h=z.slice(v.reEnd-8,v.reEnd),n=z.slice(v.reEnd);h+=n;var i=p.split("(").length-1,q0=n;for(L=0;L<i;L++)q0=q0.replace(/\)[+*?]?/,"");n=q0;var j="";if(n===""&&I!==kX)j="$";var x=p+b+n+j+h;z=x}if(z!==""&&U)z="(?=.)"+z;if(S)z=W+z;if(I===kX)return[z,U];if(!U)return R71($);var c=q.nocase?"i":"";try{var r=new RegExp("^"+z+"$",c)}catch(U0){return new RegExp("$.")}return r._glob=$,r._src=z,r}X$.makeRe=function($,I){return new R4($,I||{}).makeRe()};R4.prototype.makeRe=v71;function v71(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,q=I.noglobstar?n_:I.dot?M71:A71,z=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===n3?q:typeof J==="string"?C71(J):J._src}).join("\\/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,z)}catch(Y){this.regexp=!1}return this.regexp}X$.match=function($,I,q){q=q||{};var z=new R4(I,q);if($=$.filter(function(U){return z.match(U)}),z.options.nonull&&!$.length)$.push(I);return $};R4.prototype.match=function(I,q){if(typeof q>"u")q=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&q)return!0;var z=this.options;if(L2.sep!=="/")I=I.split(L2.sep).join("/");I=I.split(bU0),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],w=I;if(z.matchBase&&Q.length===1)w=[Y];var K=this.matchOne(w,Q,q);if(K){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate};R4.prototype.matchOne=function($,I,q){if(I.indexOf(n3)!==-1)return this._matchGlobstar($,I,q,0,0);return this._matchOne($,I,q,0,0)};R4.prototype._matchGlobstar=function($,I,q,z,U){var Y,J=-1;for(Y=U;Y<I.length;Y++)if(I[Y]===n3){J=Y;break}var Q=-1;for(Y=I.length-1;Y>=0;Y--)if(I[Y]===n3){Q=Y;break}var w=I.slice(U,J),K=q?I.slice(J+1):I.slice(J+1,Q),H=q?[]:I.slice(Q+1);if(w.length){var G=$.slice(z,z+w.length);if(!this._matchOne(G,w,q,0,0))return!1;z+=w.length}var W=0;if(H.length){if(H.length+z>$.length)return!1;var V=$.length-H.length;if(this._matchOne($,H,q,V,0))W=H.length;else{if($[$.length-1]!==""||z+H.length===$.length)return!1;if(V--,!this._matchOne($,H,q,V,0))return!1;W=H.length+1}}if(!K.length){var X=!!W;for(Y=z;Y<$.length-W;Y++){var L=String($[Y]);if(X=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return q||X}var D=[[[],0]],F=D[0],P=0,T=[0];for(var A=0;A<K.length;A++){var g=K[A];if(g===n3)T.push(P),F=[[],0],D.push(F);else F[0].push(g),P++}var k=D.length-1,S=$.length-W;for(var f=0;f<D.length;f++)D[f][1]=S-(T[k--]+D[f][0].length);return!!this._matchGlobStarBodySections($,D,z,0,q,0,!!W)};R4.prototype._matchGlobStarBodySections=function($,I,q,z,U,Y,J){var Q=I[z];if(!Q){for(var w=q;w<$.length;w++){J=!0;var K=$[w];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1}return J}var H=Q[0],G=Q[1];while(q<=G){var W=this._matchOne($.slice(0,q+H.length),H,U,q,0);if(W&&Y<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,q+H.length,z+1,U,Y+1,J);if(V!==!1)return V}var K=$[q];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1;q++}return U||null};R4.prototype._matchOne=function($,I,q,z,U){var Y,J,Q,w;for(Y=z,J=U,Q=$.length,w=I.length;Y<Q&&J<w;Y++,J++){this.debug("matchOne loop");var K=I[J],H=$[Y];if(this.debug(I,K,H),K===!1||K===n3)return!1;var G;if(typeof K==="string")G=H===K,this.debug("string match",K,H,G);else G=H.match(K),this.debug("pattern match",K,H,G);if(!G)return!1}if(Y===Q&&J===w)return!0;else if(Y===Q)return q;else if(J===w)return Y===Q-1&&$[Y]==="";throw Error("wtf?")};function R71($){return $.replace(/\\(.)/g,"$1")}function C71($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var bX=O((vR1,iX)=>{function dU0($){return $.charAt(0)==="/"}function mU0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,q=I.exec($),z=q[1]||"",U=Boolean(z&&z.charAt(1)!==":");return Boolean(q[2]||U)}iX.exports=process.platform==="win32"?mU0:dU0;iX.exports.posix=dU0;iX.exports.win32=mU0});var b_=O((i71)=>{i71.setopts=x71;i71.ownProp=lU0;i71.makeAbs=D2;i71.finish=k71;i71.mark=f71;i71.isIgnored=rU0;i71.childrenIgnored=n71;function lU0($,I){return Object.prototype.hasOwnProperty.call($,I)}var _71=t("fs"),sz=t("path"),h71=nX(),oU0=bX(),i_=h71.Minimatch;function S71($,I){return $.localeCompare(I,"en")}function u71($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(y71)}function y71($){var I=null;if($.slice(-3)==="/**"){var q=$.replace(/(\/\*\*)+$/,"");I=new i_(q,{dot:!0})}return{matcher Line truncated
*/Gz0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var q=$.length;if(q<=1)return $;var z="";if(q>4&&$[3]==="\\"){var U=$[2];if((U==="?"||U===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),z="//"}var Y=$.split(/[/\\]+/);if(I!==!1&&Y[Y.length-1]==="")Y.pop();return z+Y.join("/")}});var q_=F((PR1,Oz0)=>{var Vz0=9007199254740991,r61="[object Arguments]",t61="[object Function]",a61="[object GeneratorFunction]",s61=/^(?:0|[1-9]\d*)$/;function Zz0($,I,q){switch(q.length){case 0:return $.call(I);case 1:return $.call(I,q[0]);case 2:return $.call(I,q[0],q[1]);case 3:return $.call(I,q[0],q[1],q[2])}return $.apply(I,q)}function e61($,I){var q=-1,z=Array($);while(++q<$)z[q]=I(q);return z}var Y2=Object.prototype,J2=Y2.hasOwnProperty,Xz0=Y2.toString,$$1=Y2.propertyIsEnumerable,Wz0=Math.max;function I$1($,I){var q=G$1($)||H$1($)?e61($.length,String):[],z=q.length,U=!!z;for(var Y in $)if((I||J2.call($,Y))&&!(U&&(Y=="length"||Dz0(Y,z))))q.push(Y);return q}function q$1($,I,q,z){if($===void 0||eC($,Y2[q])&&!J2.call(z,q))return I;return $}function z$1($,I,q){var z=$[I];if(!(J2.call($,I)&&eC(z,q))||q===void 0&&!(I in $))$[I]=q}function U$1($){if(!I_($))return K$1($);var I=w$1($),q=[];for(var z in $)if(!(z=="constructor"&&(I||!J2.call($,z))))q.push(z);return q}function Lz0($,I){return I=Wz0(I===void 0?$.length-1:I,0),function(){var q=arguments,z=-1,U=Wz0(q.length-I,0),Y=Array(U);while(++z<U)Y[z]=q[I+z];z=-1;var J=Array(I+1);while(++z<I)J[z]=q[z];return J[I]=Y,Zz0($,this,J)}}function Y$1($,I,q,z){q||(q={});var U=-1,Y=I.length;while(++U<Y){var J=I[U],Q=z?z(q[J],$[J],J,q,$):void 0;z$1(q,J,Q===void 0?$[J]:Q)}return q}function J$1($){return Lz0(function(I,q){var z=-1,U=q.length,Y=U>1?q[U-1]:void 0,J=U>2?q[2]:void 0;if(Y=$.length>3&&typeof Y=="function"?(U--,Y):void 0,J&&Q$1(q[0],q[1],J))Y=U<3?void 0:Y,U=1;I=Object(I);while(++z<U){var Q=q[z];if(Q)$(I,Q,z,Y)}return I})}function Dz0($,I){return I=I==null?Vz0:I,!!I&&(typeof $=="number"||s61.test($))&&($>-1&&$%1==0&&$<I)}function Q$1($,I,q){if(!I_(q))return!1;var z=typeof I;if(z=="number"?$_(q)&&Dz0(I,q.length):z=="string"&&(I in q))return eC(q[I],$);return!1}function w$1($){var I=$&&$.constructor,q=typeof I=="function"&&I.prototype||Y2;return $===q}function K$1($){var I=[];if($!=null)for(var q in Object($))I.push(q);return I}function eC($,I){return $===I||$!==$&&I!==I}function H$1($){return W$1($)&&J2.call($,"callee")&&(!$$1.call($,"callee")||Xz0.call($)==r61)}var G$1=Array.isArray;function $_($){return $!=null&&Z$1($.length)&&!V$1($)}function W$1($){return X$1($)&&$_($)}function V$1($){var I=I_($)?Xz0.call($):"";return I==t61||I==a61}function Z$1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=Vz0}function I_($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function X$1($){return!!$&&typeof $=="object"}var L$1=J$1(function($,I,q,z){Y$1(I,O$1(I),$,z)}),D$1=Lz0(function($){return $.push(void 0,q$1),Zz0(L$1,void 0,$)});function O$1($){return $_($)?I$1($,!0):U$1($)}Oz0.exports=D$1});var Nz0=F((TR1,z_)=>{function F$1($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var Fz0=T4().Buffer,Q2=t("util");function N$1($,I,q){$.copy(I,q)}z_.exports=function(){function $(){F$1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(q){var z={data:q,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(q){var z={data:q,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length},$.prototype.shift=function(){if(this.length===0)return;var q=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,q},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(q){if(this.length===0)return"";var z=this.head,U=""+z.data;while(z=z.next)U+=q+z.data;return U},$.prototype.concat=function(q){if(this.length===0)return Fz0.alloc(0);var z=Fz0.allocUnsafe(q>>>0),U=this.head,Y=0;while(U)N$1(U.data,z,Y),Y+=U.data.length,U=U.next;return z},$}();if(Q2&&Q2.inspect&&Q2.inspect.custom)z_.exports.prototype[Q2.inspect.custom]=function(){var $=Q2.inspect({length:this.length});return this.constructor.name+" "+$}});var U_=F((ER1,Mz0)=>{var PX=P4();function M$1($,I){var q=this,z=this._readableState&&this._readableState.destroyed,U=this._writableState&&this._writableState.destroyed;if(z||U){if(I)I($);else if($){if(!this._writableState)PX.nextTick(TX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,PX.nextTick(TX,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(!q._writableState)PX.nextTick(TX,q,Y);else if(!q._writableState.errorEmitted)q._writableState.errorEmitted=!0,PX.nextTick(TX,q,Y)}else if(I)I(Y)}),this}function A$1(){if(this._readableState)this._readable Line truncated
%s`,g,g,P,z);var k=P.type==="*"?i_:P.type==="?"?b_:"\\"+P.type;U=!0,z=z.slice(0,P.reStart)+k+"\\("+g}if(X(),Y)z+="\\\\";var S=!1;switch(z.charAt(0)){case"[":case".":case"(":S=!0}for(var f=Q.length-1;f>-1;f--){var v=Q[f],p=z.slice(0,v.reStart),i=z.slice(v.reStart,v.reEnd-8),h=z.slice(v.reEnd-8,v.reEnd),n=z.slice(v.reEnd);h+=n;var b=p.split("(").length-1,q0=n;for(L=0;L<b;L++)q0=q0.replace(/\)[+*?]?/,"");n=q0;var B="";if(n===""&&I!==nX)B="$";var x=p+i+n+B+h;z=x}if(z!==""&&U)z="(?=.)"+z;if(S)z=W+z;if(I===nX)return[z,U];if(!U)return b71($);var c=q.nocase?"i":"";try{var r=new RegExp("^"+z+"$",c)}catch(U0){return new RegExp("$.")}return r._glob=$,r._src=z,r}X$.makeRe=function($,I){return new R4($,I||{}).makeRe()};R4.prototype.makeRe=n71;function n71(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,q=I.noglobstar?i_:I.dot?_71:h71,z=I.nocase?"i":"",U=$.map(function(Y){return Y.map(function(J){return J===i3?q:typeof J==="string"?i71(J):J._src}).join("\\/")}).join("|");if(U="^(?:"+U+")$",this.negate)U="^(?!"+U+").*$";try{this.regexp=new RegExp(U,z)}catch(Y){this.regexp=!1}return this.regexp}X$.match=function($,I,q){q=q||{};var z=new R4(I,q);if($=$.filter(function(U){return z.match(U)}),z.options.nonull&&!$.length)$.push(I);return $};R4.prototype.match=function(I,q){if(typeof q>"u")q=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&q)return!0;var z=this.options;if(F2.sep!=="/")I=I.split(F2.sep).join("/");I=I.split(rU0),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],w=I;if(z.matchBase&&Q.length===1)w=[Y];var K=this.matchOne(w,Q,q);if(K){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate};R4.prototype.matchOne=function($,I,q){if(I.indexOf(i3)!==-1)return this._matchGlobstar($,I,q,0,0);return this._matchOne($,I,q,0,0)};R4.prototype._matchGlobstar=function($,I,q,z,U){var Y,J=-1;for(Y=U;Y<I.length;Y++)if(I[Y]===i3){J=Y;break}var Q=-1;for(Y=I.length-1;Y>=0;Y--)if(I[Y]===i3){Q=Y;break}var w=I.slice(U,J),K=q?I.slice(J+1):I.slice(J+1,Q),H=q?[]:I.slice(Q+1);if(w.length){var G=$.slice(z,z+w.length);if(!this._matchOne(G,w,q,0,0))return!1;z+=w.length}var W=0;if(H.length){if(H.length+z>$.length)return!1;var V=$.length-H.length;if(this._matchOne($,H,q,V,0))W=H.length;else{if($[$.length-1]!==""||z+H.length===$.length)return!1;if(V--,!this._matchOne($,H,q,V,0))return!1;W=H.length+1}}if(!K.length){var X=!!W;for(Y=z;Y<$.length-W;Y++){var L=String($[Y]);if(X=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return q||X}var D=[[[],0]],O=D[0],P=0,T=[0];for(var A=0;A<K.length;A++){var g=K[A];if(g===i3)T.push(P),O=[[],0],D.push(O);else O[0].push(g),P++}var k=D.length-1,S=$.length-W;for(var f=0;f<D.length;f++)D[f][1]=S-(T[k--]+D[f][0].length);return!!this._matchGlobStarBodySections($,D,z,0,q,0,!!W)};R4.prototype._matchGlobStarBodySections=function($,I,q,z,U,Y,J){var Q=I[z];if(!Q){for(var w=q;w<$.length;w++){J=!0;var K=$[w];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1}return J}var H=Q[0],G=Q[1];while(q<=G){var W=this._matchOne($.slice(0,q+H.length),H,U,q,0);if(W&&Y<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,q+H.length,z+1,U,Y+1,J);if(V!==!1)return V}var K=$[q];if(K==="."||K===".."||!this.options.dot&&K.charAt(0)===".")return!1;q++}return U||null};R4.prototype._matchOne=function($,I,q,z,U){var Y,J,Q,w;for(Y=z,J=U,Q=$.length,w=I.length;Y<Q&&J<w;Y++,J++){this.debug("matchOne loop");var K=I[J],H=$[Y];if(this.debug(I,K,H),K===!1||K===i3)return!1;var G;if(typeof K==="string")G=H===K,this.debug("string match",K,H,G);else G=H.match(K),this.debug("pattern match",K,H,G);if(!G)return!1}if(Y===Q&&J===w)return!0;else if(Y===Q)return q;else if(J===w)return Y===Q-1&&$[Y]==="";throw Error("wtf?")};function b71($){return $.replace(/\\(.)/g,"$1")}function i71($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var cX=F((cR1,pX)=>{function sU0($){return $.charAt(0)==="/"}function eU0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,q=I.exec($),z=q[1]||"",U=Boolean(z&&z.charAt(1)!==":");return Boolean(q[2]||U)}pX.exports=process.platform==="win32"?eU0:sU0;pX.exports.posix=sU0;pX.exports.win32=eU0});var c_=F((s71)=>{s71.setopts=o71;s71.ownProp=$Y0;s71.makeAbs=N2;s71.finish=r71;s71.mark=t71;s71.isIgnored=qY0;s71.childrenIgnored=a71;function $Y0($,I){return Object.prototype.hasOwnProperty.call($,I)}var p71=t("fs"),IU=t("path"),c71=iX(),IY0=cX(),p_=c71.Minimatch;function d71($,I){return $.localeCompare(I,"en")}function m71($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(l71)}function l71($){var I=null;if($.slice(-3)==="/**"){var q=$.replace(/(\/\*\*)+$/,"");I=new p_(q,{dot:!0})}return{matcher Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new x4($,I).found}function x4($,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 x4))return new x4($,I);if(t71(this,$,I),this.noprocess)return this;var q=this.minimatch.set.length;this.matches=Array(q);for(var z=0;z<q;z++)this._process(this.minimatch.set[z],z,!1);this._finish()}x4.prototype._finish=function(){if(aU0.ok(this instanceof x4),this.realpath){var $=this;this.matches.forEach(function(I,q){var z=$.matches[q]=Object.create(null);for(var U in I)try{U=$._makeAbs(U);var Y=r71.realpathSync(U,$.realpathCache);z[Y]=!0}catch(J){if(J.syscall==="stat")z[$._makeAbs(U)]=!0;else throw J}})}i3.finish(this)};x4.prototype._process=function($,I,q){aU0.ok(this instanceof x4);var z=0;while(typeof $[z]==="string")z++;var U;switch(z){case $.length:this._processSimple($.join("/"),I);return;case 0:U=null;break;default:U=$.slice(0,z).join("/");break}var Y=$.slice(z),J;if(U===null)J=".";else if(pX(U)||pX($.map(function(K){return typeof K==="string"?K:"[*]"}).join("/"))){if(!U||!pX(U))U="/"+U;J=U}else J=U;var Q=this._makeAbs(J);if(a71(this,J))return;var w=Y[0]===tU0.GLOBSTAR;if(w)this._processGlobStar(U,J,Q,Y,I,q);else this._processReaddir(U,J,Q,Y,I,q)};x4.prototype._processReaddir=function($,I,q,z,U,Y){var J=this._readdir(q,Y);if(!J)return;var Q=z[0],w=!!this.minimatch.negate,K=Q._glob,H=this.dot||K.charAt(0)===".",G=[];for(var W=0;W<J.length;W++){var V=J[W];if(V.charAt(0)!=="."||H){var X;if(w&&!$)X=!V.match(Q);else X=V.match(Q);if(X)G.push(V)}}var L=G.length;if(L===0)return;if(z.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=p_.join(this.root,V);this._emitMatch(U,V)}return}z.shift();for(var W=0;W<L;W++){var V=G[W],D;if($)D=[$,V];else D=[V];this._process(D.concat(z),U,Y)}};x4.prototype._emitMatch=function($,I){if(s71(this,I))return;var q=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=q;if(this.matches[$][I])return;if(this.nodir){var z=this.cache[q];if(z==="DIR"||Array.isArray(z))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};x4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,q,z;try{q=this.fs.lstatSync($)}catch(Y){if(Y.code==="ENOENT")return null}var U=q&&q.isSymbolicLink();if(this.symlinks[$]=U,!U&&q&&!q.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};x4.prototype._readdir=function($,I){var q;if(I&&!c_(this.symlinks,$))return this._readdirInGlobStar($);if(c_(this.cache,$)){var z=this.cache[$];if(!z||z==="FILE")return null;if(Array.isArray(z))return z}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(U){return this._readdirError($,U),null}};x4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var q=0;q<I.length;q++){var z=I[q];if($==="/")z=$+z;else z=$+"/"+z;this.cache[z]=!0}return this.cache[$]=I,I};x4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var q=this._makeAbs($);if(this.cache[q]="FILE",q===this.cwdAbs){var z=Error(I.code+" invalid cwd "+this.cwd);throw z.path=this.cwd,z.code=I.code,z}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}};x4.prototype._processGlobStar=function($,I,q,z,U,Y){var J=this._readdir(q,Y);if(!J)return;var Q=z.slice(1),w=$?[$]:[],K=w.concat(Q);this._process(K,U,!1);var H=J.length,G=this.symlinks[q];if(G&&Y)return;for(var W=0;W<H;W++){var V=J[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=w.concat(J[W],Q);this._process(X,U,!0);var L=w.concat(J[W],z);this._process(L,U,!0)}};x4.prototype._processSimple=function($,I){var q=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!q)return;if($&&pX($)&&!this.nomount){var z=/[\/\\]$/.test($);if($.charAt(0)==="/")$=p_.join(this.root,$);else if($=p_.resolve(this.root,$),z)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};x4.prototype._stat=function($){var I=this._makeAbs($),q=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&c_(this.cache,I)){var J=this.cache[I];if(Array.isArray(J))J="DIR";if(!q||J==="DIR")return J;if(q&&J==="FILE")return!1}var z,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,q&&J==="FILE")return!1;return J};x4.prototype._mark=function($){return i3.mark(this,$)};x4.prototype._makeAbs=function($){return i3.makeAbs(this,$)}});var d_=O((uR1,qY0)=>{qY0.exports=IY0;function IY0($,I){if($&&I)return IY0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(z){q[z]=$[z]}),q;f Line truncated
`);if($.linkname)I+=Ph(" linkpath="+$.linkname+`
`);var q=$.pax;if(q)for(var z in q)I+=Ph(" "+z+"="+q[z]+`
`);return Buffer.from(I)};ZI1.decodePax=function($){var I={};while($.length){var q=0;while(q<$.length&&$[q]!==32)q++;var z=parseInt($.slice(0,q).toString(),10);if(!z)return I;var U=$.slice(q+1,z-1).toString(),Y=U.indexOf("=");if(Y===-1)return I;I[U.slice(0,Y)]=U.slice(Y+1),$=$.slice(z)}return I};ZI1.encode=function($){var I=zI1(512),q=$.name,z="";if($.typeflag===5&&q[q.length-1]!=="/")q+="/";if(Buffer.byteLength(q)!==q.length)return null;while(Buffer.byteLength(q)>100){var U=q.indexOf("/");if(U===-1)return null;z+=z?"/"+q.slice(0,U):q.slice(0,U),q=q.slice(U+1)}if(Buffer.byteLength(q)>100||Buffer.byteLength(z)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(q),I.write(K7($.mode&KI1,6),100),I.write(K7($.uid,6),108),I.write(K7($.gid,6),116),I.write(K7($.size,11),124),I.write(K7($.mtime.getTime()/1000|0,11),136),I[156]=NJ0+WI1($.type),$.linkname)I.write($.linkname,157);if(MJ0.copy(I,P2),JI1.copy(I,Th),$.uname)I.write($.uname,265);if($.gname)I.write($.gname,297);if(I.write(K7($.devmajor||0,6),329),I.write(K7($.devminor||0,6),337),z)I.write(z,345);return I.write(K7(PJ0(I),6),148),I};ZI1.decode=function($,I,q){var z=$[156]===0?0:$[156]-NJ0,U=qU($,0,100,I),Y=H7($,100,8),J=H7($,108,8),Q=H7($,116,8),w=H7($,124,12),K=H7($,136,12),H=GI1(z),G=$[157]===0?null:qU($,157,100,I),W=qU($,265,32),V=qU($,297,32),X=H7($,329,8),L=H7($,337,8),D=PJ0($);if(D===256)return null;if(D!==H7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(MJ0.compare($,P2,P2+6)===0){if($[345])U=qU($,345,155,I)+"/"+U}else if(QI1.compare($,P2,P2+6)===0&&wI1.compare($,Th,Th+2)===0);else if(!q)throw Error("Invalid tar header: unknown format.");if(z===0&&U&&U[U.length-1]==="/")z=5;return{name:U,mode:Y,uid:J,gid:Q,size:w,mtime:new Date(1000*K),type:H,linkname:G,uname:W,gname:V,devmajor:X,devminor:L}}});var RJ0=O((LC1,vJ0)=>{var EJ0=t("util"),NI1=FJ0(),T2=Eh(),jJ0=O6().Writable,BJ0=O6().PassThrough,gJ0=function(){},TJ0=function($){return $&=511,$&&512-$},MI1=function($,I){var q=new tX($,I);return q.end(),q},AI1=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,$},tX=function($,I){this._parent=$,this.offset=I,BJ0.call(this,{autoDestroy:!1})};EJ0.inherits(tX,BJ0);tX.prototype.destroy=function($){this._parent.destroy($)};var k5=function($){if(!(this instanceof k5))return new k5($);jJ0.call(this,$),$=$||{},this._offset=0,this._buffer=NI1(),this._missing=0,this._partial=!1,this._onparse=gJ0,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,q=I._buffer,z=function(){I._continue()},U=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)z()},Y=function(){I._stream=null;var W=TJ0(I._header.size);if(W)I._parse(W,J);else I._parse(512,G);if(!I._locked)z()},J=function(){I._buffer.consume(TJ0(I._header.size)),I._parse(512,G),z()},Q=function(){var W=I._header.size;I._paxGlobal=T2.decodePax(q.slice(0,W)),q.consume(W),Y()},w=function(){var W=I._header.size;if(I._pax=T2.decodePax(q.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);q.consume(W),Y()},K=function(){var W=I._header.size;this._gnuLongPath=T2.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),Y()},H=function(){var W=I._header.size;this._gnuLongLinkPath=T2.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),Y()},G=function(){var W=I._offset,V;try{V=I._header=T2.decode(q.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(q.consume(512),!V){I._parse(512,G),z();return}if(V.type==="gnu-long-path"){I._parse(V.size,K),z();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,H),z();return}if(V.type==="pax-global-header"){I._parse(V.size,Q),z();return}if(V.type==="pax-header"){I._parse(V.size,w),z();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=AI1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,G),I.emit("entry",V,MI1(I,W),U);return}I._stream=new tX(I,W),I.emit("entry",V,I._stream,U),I._parse(V.size,Y),z()};this._onheader=G,this._parse(512,G)};EJ0.inherits(k5,jJ0);k5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};k5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};k5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=gJ0,this._overflow)this._write(this._overflow,void 0,$);else $()};k5.prototype._write=function($,I,q){if(this._destroyed)return;var z=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="${iI1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}qQ0.exports=IQ0});var wQ0=O((jC1,QQ0)=>{var UQ0=z6(),YQ0=m9(),pI1=H4(),cI1=UR(),dI1=JR();class JQ0{constructor($,I,q){this.id=q.id,this.count=0,this._worksheet=$,this._workbook=q.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:YQ0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:YQ0.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 q=new cI1,z=new UQ0;q.render(z,$),this.commentsStream.write(z.xml);let U=new dI1,Y=new UQ0;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=pI1.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()}}QQ0.exports=JQ0});var ZQ0=O((BC1,VQ0)=>{var mI1=L4(),lI1=m9(),gh=H4(),KQ0=Aj(),HQ0=L5(),oI1=xg(),GQ0=ZW(),vh=LW(),rI1=zQ0(),tI1=wQ0(),aI1=Nj(),c4=new oI1,Rh=p9(),sI1=_v(),eI1=hv(),$q1=Sv(),Iq1=gv(),qq1=jv(),zq1=vv(),Uq1=uv(),Yq1=yv(),Jq1=xv(),Qq1=kv(),wq1=fv(),Kq1=nv(),Hq1=dv(),Gq1=bv(),Wq1=iv(),d4={dataValidations:new sI1,sheetProperties:new eI1,sheetFormatProperties:new $q1,columns:new Rh({tag:"cols",length:!1,childXform:new Iq1}),row:new qq1,hyperlinks:new Rh({tag:"hyperlinks",length:!1,childXform:new zq1}),sheetViews:new Rh({tag:"sheetViews",length:!1,childXform:new Uq1}),sheetProtection:new Yq1,pageMargins:new Jq1,pageSeteup:new Qq1,autoFilter:new wq1,picture:new Kq1,conditionalFormattings:new Hq1,headerFooter:new Gq1,rowBreaks:new Wq1};class WQ0{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 rI1($),this._sheetCommentsWriter=new tI1(this,this._sheetRelsWriter,$),this._dimensions=new HQ0,this._rowZero=1,this.committed=!1,this.dataValidations=new aI1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))return new x4($,I);if(Q31(this,$,I),this.noprocess)return this;var q=this.minimatch.set.length;this.matches=Array(q);for(var z=0;z<q;z++)this._process(this.minimatch.set[z],z,!1);this._finish()}x4.prototype._finish=function(){if(UY0.ok(this instanceof x4),this.realpath){var $=this;this.matches.forEach(function(I,q){var z=$.matches[q]=Object.create(null);for(var U in I)try{U=$._makeAbs(U);var Y=J31.realpathSync(U,$.realpathCache);z[Y]=!0}catch(J){if(J.syscall==="stat")z[$._makeAbs(U)]=!0;else throw J}})}p3.finish(this)};x4.prototype._process=function($,I,q){UY0.ok(this instanceof x4);var z=0;while(typeof $[z]==="string")z++;var U;switch(z){case $.length:this._processSimple($.join("/"),I);return;case 0:U=null;break;default:U=$.slice(0,z).join("/");break}var Y=$.slice(z),J;if(U===null)J=".";else if(dX(U)||dX($.map(function(K){return typeof K==="string"?K:"[*]"}).join("/"))){if(!U||!dX(U))U="/"+U;J=U}else J=U;var Q=this._makeAbs(J);if(w31(this,J))return;var w=Y[0]===zY0.GLOBSTAR;if(w)this._processGlobStar(U,J,Q,Y,I,q);else this._processReaddir(U,J,Q,Y,I,q)};x4.prototype._processReaddir=function($,I,q,z,U,Y){var J=this._readdir(q,Y);if(!J)return;var Q=z[0],w=!!this.minimatch.negate,K=Q._glob,H=this.dot||K.charAt(0)===".",G=[];for(var W=0;W<J.length;W++){var V=J[W];if(V.charAt(0)!=="."||H){var X;if(w&&!$)X=!V.match(Q);else X=V.match(Q);if(X)G.push(V)}}var L=G.length;if(L===0)return;if(z.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=d_.join(this.root,V);this._emitMatch(U,V)}return}z.shift();for(var W=0;W<L;W++){var V=G[W],D;if($)D=[$,V];else D=[V];this._process(D.concat(z),U,Y)}};x4.prototype._emitMatch=function($,I){if(K31(this,I))return;var q=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=q;if(this.matches[$][I])return;if(this.nodir){var z=this.cache[q];if(z==="DIR"||Array.isArray(z))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};x4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,q,z;try{q=this.fs.lstatSync($)}catch(Y){if(Y.code==="ENOENT")return null}var U=q&&q.isSymbolicLink();if(this.symlinks[$]=U,!U&&q&&!q.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};x4.prototype._readdir=function($,I){var q;if(I&&!m_(this.symlinks,$))return this._readdirInGlobStar($);if(m_(this.cache,$)){var z=this.cache[$];if(!z||z==="FILE")return null;if(Array.isArray(z))return z}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(U){return this._readdirError($,U),null}};x4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var q=0;q<I.length;q++){var z=I[q];if($==="/")z=$+z;else z=$+"/"+z;this.cache[z]=!0}return this.cache[$]=I,I};x4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var q=this._makeAbs($);if(this.cache[q]="FILE",q===this.cwdAbs){var z=Error(I.code+" invalid cwd "+this.cwd);throw z.path=this.cwd,z.code=I.code,z}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}};x4.prototype._processGlobStar=function($,I,q,z,U,Y){var J=this._readdir(q,Y);if(!J)return;var Q=z.slice(1),w=$?[$]:[],K=w.concat(Q);this._process(K,U,!1);var H=J.length,G=this.symlinks[q];if(G&&Y)return;for(var W=0;W<H;W++){var V=J[W];if(V.charAt(0)==="."&&!this.dot)continue;var X=w.concat(J[W],Q);this._process(X,U,!0);var L=w.concat(J[W],z);this._process(L,U,!0)}};x4.prototype._processSimple=function($,I){var q=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!q)return;if($&&dX($)&&!this.nomount){var z=/[\/\\]$/.test($);if($.charAt(0)==="/")$=d_.join(this.root,$);else if($=d_.resolve(this.root,$),z)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};x4.prototype._stat=function($){var I=this._makeAbs($),q=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&m_(this.cache,I)){var J=this.cache[I];if(Array.isArray(J))J="DIR";if(!q||J==="DIR")return J;if(q&&J==="FILE")return!1}var z,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,q&&J==="FILE")return!1;return J};x4.prototype._mark=function($){return p3.mark(this,$)};x4.prototype._makeAbs=function($){return p3.makeAbs(this,$)}});var l_=F((tR1,KY0)=>{KY0.exports=wY0;function wY0($,I){if($&&I)return wY0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(z){q[z]=$[z]}),q;f Line truncated
`);if($.linkname)I+=Eh(" linkpath="+$.linkname+`
`);var q=$.pax;if(q)for(var z in q)I+=Eh(" "+z+"="+q[z]+`
`);return Buffer.from(I)};EI1.decodePax=function($){var I={};while($.length){var q=0;while(q<$.length&&$[q]!==32)q++;var z=parseInt($.slice(0,q).toString(),10);if(!z)return I;var U=$.slice(q+1,z-1).toString(),Y=U.indexOf("=");if(Y===-1)return I;I[U.slice(0,Y)]=U.slice(Y+1),$=$.slice(z)}return I};EI1.encode=function($){var I=ZI1(512),q=$.name,z="";if($.typeflag===5&&q[q.length-1]!=="/")q+="/";if(Buffer.byteLength(q)!==q.length)return null;while(Buffer.byteLength(q)>100){var U=q.indexOf("/");if(U===-1)return null;z+=z?"/"+q.slice(0,U):q.slice(0,U),q=q.slice(U+1)}if(Buffer.byteLength(q)>100||Buffer.byteLength(z)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(q),I.write(G7($.mode&NI1,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]=jJ0+PI1($.type),$.linkname)I.write($.linkname,157);if(gJ0.copy(I,B2),DI1.copy(I,Bh),$.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),z)I.write(z,345);return I.write(G7(RJ0(I),6),148),I};EI1.decode=function($,I,q){var z=$[156]===0?0:$[156]-jJ0,U=YU($,0,100,I),Y=W7($,100,8),J=W7($,108,8),Q=W7($,116,8),w=W7($,124,12),K=W7($,136,12),H=AI1(z),G=$[157]===0?null:YU($,157,100,I),W=YU($,265,32),V=YU($,297,32),X=W7($,329,8),L=W7($,337,8),D=RJ0($);if(D===256)return null;if(D!==W7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(gJ0.compare($,B2,B2+6)===0){if($[345])U=YU($,345,155,I)+"/"+U}else if(OI1.compare($,B2,B2+6)===0&&FI1.compare($,Bh,Bh+2)===0);else if(!q)throw Error("Invalid tar header: unknown format.");if(z===0&&U&&U[U.length-1]==="/")z=5;return{name:U,mode:Y,uid:J,gid:Q,size:w,mtime:new Date(1000*K),type:H,linkname:G,uname:W,gname:V,devmajor:X,devminor:L}}});var xJ0=F((CC1,yJ0)=>{var _J0=t("util"),CI1=BJ0(),j2=jh(),hJ0=O6().Writable,SJ0=O6().PassThrough,uJ0=function(){},CJ0=function($){return $&=511,$&&512-$},_I1=function($,I){var q=new sX($,I);return q.end(),q},hI1=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,$},sX=function($,I){this._parent=$,this.offset=I,SJ0.call(this,{autoDestroy:!1})};_J0.inherits(sX,SJ0);sX.prototype.destroy=function($){this._parent.destroy($)};var f5=function($){if(!(this instanceof f5))return new f5($);hJ0.call(this,$),$=$||{},this._offset=0,this._buffer=CI1(),this._missing=0,this._partial=!1,this._onparse=uJ0,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,q=I._buffer,z=function(){I._continue()},U=function(W){if(I._locked=!1,W)return I.destroy(W);if(!I._stream)z()},Y=function(){I._stream=null;var W=CJ0(I._header.size);if(W)I._parse(W,J);else I._parse(512,G);if(!I._locked)z()},J=function(){I._buffer.consume(CJ0(I._header.size)),I._parse(512,G),z()},Q=function(){var W=I._header.size;I._paxGlobal=j2.decodePax(q.slice(0,W)),q.consume(W),Y()},w=function(){var W=I._header.size;if(I._pax=j2.decodePax(q.slice(0,W)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);q.consume(W),Y()},K=function(){var W=I._header.size;this._gnuLongPath=j2.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),Y()},H=function(){var W=I._header.size;this._gnuLongLinkPath=j2.decodeLongPath(q.slice(0,W),$.filenameEncoding),q.consume(W),Y()},G=function(){var W=I._offset,V;try{V=I._header=j2.decode(q.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(q.consume(512),!V){I._parse(512,G),z();return}if(V.type==="gnu-long-path"){I._parse(V.size,K),z();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,H),z();return}if(V.type==="pax-global-header"){I._parse(V.size,Q),z();return}if(V.type==="pax-header"){I._parse(V.size,w),z();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=hI1(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,G),I.emit("entry",V,_I1(I,W),U);return}I._stream=new sX(I,W),I.emit("entry",V,I._stream,U),I._parse(V.size,Y),z()};this._onheader=G,this._parse(512,G)};_J0.inherits(f5,hJ0);f5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};f5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};f5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=uJ0,this._overflow)this._write(this._overflow,void 0,$);else $()};f5.prototype._write=function($,I,q){if(this._destroyed)return;var z=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="${sI1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}KQ0.exports=wQ0});var XQ0=F((bC1,ZQ0)=>{var GQ0=z6(),WQ0=o9(),$q1=G4(),Iq1=JR(),qq1=wR();class VQ0{constructor($,I,q){this.id=q.id,this.count=0,this._worksheet=$,this._workbook=q.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:WQ0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:WQ0.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 q=new Iq1,z=new GQ0;q.render(z,$),this.commentsStream.write(z.xml);let U=new qq1,Y=new GQ0;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=$q1.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()}}ZQ0.exports=VQ0});var MQ0=F((iC1,NQ0)=>{var zq1=D4(),Uq1=o9(),Rh=G4(),LQ0=TB(),DQ0=D5(),Yq1=fg(),OQ0=LW(),Ch=OW(),Jq1=HQ0(),Qq1=XQ0(),wq1=AB(),c4=new Yq1,_h=d9(),Kq1=Sv(),Hq1=uv(),Gq1=yv(),Wq1=Rv(),Vq1=gv(),Zq1=Cv(),Xq1=xv(),Lq1=kv(),Dq1=fv(),Oq1=nv(),Fq1=bv(),Nq1=iv(),Mq1=lv(),Aq1=cv(),Pq1=pv(),d4={dataValidations:new Kq1,sheetProperties:new Hq1,sheetFormatProperties:new Gq1,columns:new _h({tag:"cols",length:!1,childXform:new Wq1}),row:new Vq1,hyperlinks:new _h({tag:"hyperlinks",length:!1,childXform:new Zq1}),sheetViews:new _h({tag:"sheetViews",length:!1,childXform:new Xq1}),sheetProtection:new Lq1,pageMargins:new Dq1,pageSeteup:new Oq1,autoFilter:new Fq1,picture:new Nq1,conditionalFormattings:new Mq1,headerFooter:new Aq1,rowBreaks:new Pq1};class FQ0{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 Jq1($),this._sheetCommentsWriter=new Qq1(this,this._sheetRelsWriter,$),this._dimensions=new DQ0,this._rowZero=1,this.committed=!1,this.dataValidations=new wq1,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
`)},oh=rh.getNativePromise();if(rh.isNode&&typeof MutationObserver>"u")th=global.setImmediate,ah=process.nextTick,r3=rh.isRecentNode?function($){th.call(global,$)}:function($){ah.call(process,$)};else if(typeof oh==="function"&&typeof oh.resolve==="function")sh=oh.resolve(),r3=function($){sh.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))r3=function(){var $=document.createElement("div"),I={attributes:!0},q=!1,z=document.createElement("div"),U=new MutationObserver(function(){$.classList.toggle("foo"),q=!1});U.observe(z,I);var Y=function(){if(q)return;q=!0,z.classList.toggle("foo")};return function(Q){var w=new MutationObserver(function(){w.disconnect(),Q()});w.observe($,I),Y()}}();else if(typeof setImmediate<"u")r3=function($){setImmediate($)};else if(typeof setTimeout<"u")r3=function($){setTimeout($,0)};else r3=zz1;var th,ah,sh;lQ0.exports=r3});var tQ0=O((fC1,rQ0)=>{function Uz1($,I,q,z,U){for(var Y=0;Y<U;++Y)q[Y+z]=$[Y+I],$[Y+I]=void 0}function V7($){this._capacity=$,this._length=0,this._front=0}V7.prototype._willBeOverCapacity=function($){return this._capacity<$};V7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var q=this._front+I&this._capacity-1;this[q]=$,this._length=I+1};V7.prototype.push=function($,I,q){var z=this.length()+3;if(this._willBeOverCapacity(z)){this._pushOne($),this._pushOne(I),this._pushOne(q);return}var U=this._front+z-3;this._checkCapacity(z);var Y=this._capacity-1;this[U+0&Y]=$,this[U+1&Y]=I,this[U+2&Y]=q,this._length=z};V7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};V7.prototype.length=function(){return this._length};V7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};V7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var q=this._front,z=this._length,U=q+z&I-1;Uz1(this,0,this,I,U)};rQ0.exports=V7});var z20=O((nC1,eh)=>{var I20;try{throw Error()}catch($){I20=$}var Yz1=oQ0(),aQ0=tQ0(),q20=d1();function m4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new aQ0(16),this._normalQueue=new aQ0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=Yz1}m4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};m4.prototype.hasCustomScheduler=function(){return this._customScheduler};m4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};m4.prototype.disableTrampolineIfNecessary=function(){if(q20.hasDevTools)this._trampolineEnabled=!1};m4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};m4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`)},th=ah.getNativePromise();if(ah.isNode&&typeof MutationObserver>"u")sh=global.setImmediate,eh=process.nextTick,a3=ah.isRecentNode?function($){sh.call(global,$)}:function($){eh.call(process,$)};else if(typeof th==="function"&&typeof th.resolve==="function")$S=th.resolve(),a3=function($){$S.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))a3=function(){var $=document.createElement("div"),I={attributes:!0},q=!1,z=document.createElement("div"),U=new MutationObserver(function(){$.classList.toggle("foo"),q=!1});U.observe(z,I);var Y=function(){if(q)return;q=!0,z.classList.toggle("foo")};return function(Q){var w=new MutationObserver(function(){w.disconnect(),Q()});w.observe($,I),Y()}}();else if(typeof setImmediate<"u")a3=function($){setImmediate($)};else if(typeof setTimeout<"u")a3=function($){setTimeout($,0)};else a3=Zz1;var sh,eh,$S;$20.exports=a3});var z20=F(($_1,q20)=>{function Xz1($,I,q,z,U){for(var Y=0;Y<U;++Y)q[Y+z]=$[Y+I],$[Y+I]=void 0}function X7($){this._capacity=$,this._length=0,this._front=0}X7.prototype._willBeOverCapacity=function($){return this._capacity<$};X7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var q=this._front+I&this._capacity-1;this[q]=$,this._length=I+1};X7.prototype.push=function($,I,q){var z=this.length()+3;if(this._willBeOverCapacity(z)){this._pushOne($),this._pushOne(I),this._pushOne(q);return}var U=this._front+z-3;this._checkCapacity(z);var Y=this._capacity-1;this[U+0&Y]=$,this[U+1&Y]=I,this[U+2&Y]=q,this._length=z};X7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};X7.prototype.length=function(){return this._length};X7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};X7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var q=this._front,z=this._length,U=q+z&I-1;Xz1(this,0,this,I,U)};q20.exports=X7});var H20=F((I_1,IS)=>{var w20;try{throw Error()}catch($){w20=$}var Lz1=I20(),U20=z20(),K20=d1();function m4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new U20(16),this._normalQueue=new U20(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=Lz1}m4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};m4.prototype.hasCustomScheduler=function(){return this._customScheduler};m4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};m4.prototype.disableTrampolineIfNecessary=function(){if(K20.hasDevTools)this._trampolineEnabled=!1};m4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};m4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};m4.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(q){throw Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function sQ0($,I,q){this._lateQueue.push($,I,q),this._queueTick()}function eQ0($,I,q){this._normalQueue.push($,I,q),this._queueTick()}function $20($){this._normalQueue._pushOne($),this._queueTick()}if(!q20.hasDevTools)m4.prototype.invokeLater=sQ0,m4.prototype.invoke=eQ0,m4.prototype.settlePromises=$20;else m4.prototype.invokeLater=function($,I,q){if(this._trampolineEnabled)sQ0.call(this,$,I,q);else this._schedule(function(){setTimeout(function(){$.call(I,q)},100)})},m4.prototype.invoke=function($,I,q){if(this._trampolineEnabled)eQ0.call(this,$,I,q);else this._schedule(function(){$.call(I,q)})},m4.prototype.settlePromises=function($){if(this._trampolineEnabled)$20.call(this,$);else this._schedule(function(){$._settlePromises()})};m4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var q=$.shift(),z=$.shift();I.call(q,z)}};m4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};m4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};m4.prototype._reset=function(){this._isTickUsed=!1};eh.exports=m4;eh.exports.firstLineError=I20});var n5=O((iC1,J20)=>{var qS=o3(),Jz1=qS.freeze,U20=d1(),Y20=U20.inherits,QU=U20.notEnumerableProp;function wU($,I){function q(z){if(!(this instanceof q))return new q(z);if(QU(this,"message",typeof z==="string"?z:I),QU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return Y20(q,Error),q}var $S,IS,Qz1=wU("Warning","warning"),wz1=wU("CancellationError","cancellation error"),Kz1=wU("TimeoutError","timeout error"),R2=wU("AggregateError","aggregate error");try{$S=TypeError,IS=RangeError}catch($){$S=wU("TypeError","type error"),IS=wU("RangeError","range error")}var YL="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(t3=0;t3<YL.length;++t3)if(typeof Array.prototype[YL[t3]]==="function")R2.prototype[YL[t3]]=Array.prototype[YL[t3]];var t3;qS.defineProperty(R2.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});R2.prototype.isOperational=!0;var JL=0;R2.prototype.toString=function(){var $=Array(JL*4+1).join(" "),I=`
`)}};function Y20($,I,q){this._lateQueue.push($,I,q),this._queueTick()}function J20($,I,q){this._normalQueue.push($,I,q),this._queueTick()}function Q20($){this._normalQueue._pushOne($),this._queueTick()}if(!K20.hasDevTools)m4.prototype.invokeLater=Y20,m4.prototype.invoke=J20,m4.prototype.settlePromises=Q20;else m4.prototype.invokeLater=function($,I,q){if(this._trampolineEnabled)Y20.call(this,$,I,q);else this._schedule(function(){setTimeout(function(){$.call(I,q)},100)})},m4.prototype.invoke=function($,I,q){if(this._trampolineEnabled)J20.call(this,$,I,q);else this._schedule(function(){$.call(I,q)})},m4.prototype.settlePromises=function($){if(this._trampolineEnabled)Q20.call(this,$);else this._schedule(function(){$._settlePromises()})};m4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var q=$.shift(),z=$.shift();I.call(q,z)}};m4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};m4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};m4.prototype._reset=function(){this._isTickUsed=!1};IS.exports=m4;IS.exports.firstLineError=w20});var b5=F((q_1,V20)=>{var US=t3(),Dz1=US.freeze,G20=d1(),W20=G20.inherits,HU=G20.notEnumerableProp;function GU($,I){function q(z){if(!(this instanceof q))return new q(z);if(HU(this,"message",typeof z==="string"?z:I),HU(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return W20(q,Error),q}var qS,zS,Oz1=GU("Warning","warning"),Fz1=GU("CancellationError","cancellation error"),Nz1=GU("TimeoutError","timeout error"),h2=GU("AggregateError","aggregate error");try{qS=TypeError,zS=RangeError}catch($){qS=GU("TypeError","type error"),zS=GU("RangeError","range error")}var QL="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(s3=0;s3<QL.length;++s3)if(typeof Array.prototype[QL[s3]]==="function")h2.prototype[QL[s3]]=Array.prototype[QL[s3]];var s3;US.defineProperty(h2.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});h2.prototype.isOperational=!0;var wL=0;h2.prototype.toString=function(){var $=Array(wL*4+1).join(" "),I=`
`+$+`AggregateError of:
`;JL++,$=Array(JL*4+1).join(" ");for(var q=0;q<this.length;++q){var z=this[q]===this?"[Circular AggregateError]":this[q]+"",U=z.split(`
`;wL++,$=Array(wL*4+1).join(" ");for(var q=0;q<this.length;++q){var z=this[q]===this?"[Circular AggregateError]":this[q]+"",U=z.split(`
`);for(var Y=0;Y<U.length;++Y)U[Y]=$+U[Y];z=U.join(`
`),I+=z+`
`}return JL--,I};function v2($){if(!(this instanceof v2))return new v2($);if(QU(this,"name","OperationalError"),QU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)QU(this,"message",$.message),QU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}Y20(v2,Error);var a3=Error.__BluebirdErrorTypes__;if(!a3)a3=Jz1({CancellationError:wz1,TimeoutError:Kz1,OperationalError:v2,RejectionError:v2,AggregateError:R2}),qS.defineProperty(Error,"__BluebirdErrorTypes__",{value:a3,writable:!1,enumerable:!1,configurable:!1});J20.exports={Error,TypeError:$S,RangeError:IS,CancellationError:a3.CancellationError,OperationalError:a3.OperationalError,TimeoutError:a3.TimeoutError,AggregateError:a3.AggregateError,Warning:Qz1}});var w20=O((bC1,Q20)=>{Q20.exports=function($,I){var q=d1(),z=q.errorObj,U=q.isObject;function Y(G,W){if(U(G)){if(G instanceof $)return G;var V=Q(G);if(V===z){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(K(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 z.e=W,z}}var w={}.hasOwnProperty;function K(G){try{return w.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 D=!0,F=q.tryCatch(W).call(G,P,T);if(D=!1,X&&F===z)X._rejectCallback(F.e,!0,!0),X=null;function P(A){if(!X)return;X._resolveCallback(A),X=null}function T(A){if(!X)return;X._rejectCallback(A,D,!0),X=null}return L}return Y}});var H20=O((pC1,K20)=>{K20.exports=function($,I,q,z,U){var Y=d1(),J=Y.isArray;function Q(K){switch(K){case-2:return[];case-3:return{}}}function w(K){var H=this._promise=new $(I);if(K instanceof $)H._propagateFrom(K,3);H._setOnCancel(this),this._values=K,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Y.inherits(w,U),w.prototype.length=function(){return this._length},w.prototype.promise=function(){return this._promise},w.prototype._init=function K(H,G){var W=q(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(K,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=z("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)},w.prototype._iterate=function(K){var H=this.getActualLength(K.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=q(K[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()},w.prototype._isResolved=function(){return this._values===null},w.prototype._resolve=function(K){this._values=null,this._promise._fulfill(K)},w.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},w.prototype._reject=function(K){this._values=null,this._promise._rejectCallback(K,!1)},w.prototype._promiseFulfilled=function(K,H){this._values[H]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},w.prototype._promiseCancelled=function(){return this._cancel(),!0},w.prototype._promiseRejected=function(K){return this._totalResolved++,this._reject(K),!0},w.prototype._resultCancelled=function(){if(this._isResolved())return;var K=this._values;if(this._cancel(),K instanceof $)K.cancel();else for(var H=0;H<K.length;++H)if(K[H]instanceof $)K[H].cancel()},w.prototype.shouldCopyValues=function(){return!0},w.prototype.getActualLength=function(K){return K},w}});var W20=O((cC1,G20)=>{G20.exports=function($){var I=!1,q=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function z(){this._trace=new z.CapturedTrace(Y())}z.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,q.push(this._trace)},z.prototype._popContext=function(){if(this._trace!==void 0){var J=q.pop(),Q=J._promiseCreated;return J._promiseCreated=null,Q}return null};function U(){if(I)return new z}function Y(){var J=q.length-1;if(J>=0)return q[J];return}return z.CapturedTrace=null,z.create=U,z.deactivateLong Line truncated
`}return wL--,I};function _2($){if(!(this instanceof _2))return new _2($);if(HU(this,"name","OperationalError"),HU(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)HU(this,"message",$.message),HU(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}W20(_2,Error);var e3=Error.__BluebirdErrorTypes__;if(!e3)e3=Dz1({CancellationError:Fz1,TimeoutError:Nz1,OperationalError:_2,RejectionError:_2,AggregateError:h2}),US.defineProperty(Error,"__BluebirdErrorTypes__",{value:e3,writable:!1,enumerable:!1,configurable:!1});V20.exports={Error,TypeError:qS,RangeError:zS,CancellationError:e3.CancellationError,OperationalError:e3.OperationalError,TimeoutError:e3.TimeoutError,AggregateError:e3.AggregateError,Warning:Oz1}});var X20=F((z_1,Z20)=>{Z20.exports=function($,I){var q=d1(),z=q.errorObj,U=q.isObject;function Y(G,W){if(U(G)){if(G instanceof $)return G;var V=Q(G);if(V===z){if(W)W._pushContext();var X=$.reject(V.e);if(W)W._popContext();return X}else if(typeof V==="function"){if(K(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 z.e=W,z}}var w={}.hasOwnProperty;function K(G){try{return w.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 D=!0,O=q.tryCatch(W).call(G,P,T);if(D=!1,X&&O===z)X._rejectCallback(O.e,!0,!0),X=null;function P(A){if(!X)return;X._resolveCallback(A),X=null}function T(A){if(!X)return;X._rejectCallback(A,D,!0),X=null}return L}return Y}});var D20=F((U_1,L20)=>{L20.exports=function($,I,q,z,U){var Y=d1(),J=Y.isArray;function Q(K){switch(K){case-2:return[];case-3:return{}}}function w(K){var H=this._promise=new $(I);if(K instanceof $)H._propagateFrom(K,3);H._setOnCancel(this),this._values=K,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Y.inherits(w,U),w.prototype.length=function(){return this._length},w.prototype.promise=function(){return this._promise},w.prototype._init=function K(H,G){var W=q(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(K,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=z("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)},w.prototype._iterate=function(K){var H=this.getActualLength(K.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=q(K[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()},w.prototype._isResolved=function(){return this._values===null},w.prototype._resolve=function(K){this._values=null,this._promise._fulfill(K)},w.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},w.prototype._reject=function(K){this._values=null,this._promise._rejectCallback(K,!1)},w.prototype._promiseFulfilled=function(K,H){this._values[H]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},w.prototype._promiseCancelled=function(){return this._cancel(),!0},w.prototype._promiseRejected=function(K){return this._totalResolved++,this._reject(K),!0},w.prototype._resultCancelled=function(){if(this._isResolved())return;var K=this._values;if(this._cancel(),K instanceof $)K.cancel();else for(var H=0;H<K.length;++H)if(K[H]instanceof $)K[H].cancel()},w.prototype.shouldCopyValues=function(){return!0},w.prototype.getActualLength=function(K){return K},w}});var F20=F((Y_1,O20)=>{O20.exports=function($){var I=!1,q=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function z(){this._trace=new z.CapturedTrace(Y())}z.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,q.push(this._trace)},z.prototype._popContext=function(){if(this._trace!==void 0){var J=q.pop(),Q=J._promiseCreated;return J._promiseCreated=null,Q}return null};function U(){if(I)return new z}function Y(){var J=q.length-1;if(J>=0)return q[J];return}return z.CapturedTrace=null,z.create=U,z.deactivateLong Line truncated
See http://goo.gl/MqrFmX
`);if(!B0.longStackTraces&&i6()){var a=$.prototype._captureStackTrace,N=$.prototype._attachExtraTrace;B0.longStackTraces=!0,A=function(){if(z.haveItemsQueued()&&!B0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
`);if(!j0.longStackTraces&&b6()){var a=$.prototype._captureStackTrace,N=$.prototype._attachExtraTrace;j0.longStackTraces=!0,A=function(){if(z.haveItemsQueued()&&!j0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),z.enableTrampoline(),B0.longStackTraces=!1},$.prototype._captureStackTrace=U0,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),z.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return B0.longStackTraces&&i6()};var g=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(a),function(N,M){var R=new CustomEvent(N.toLowerCase(),{detail:M,cancelable:!0});return!Y.global.dispatchEvent(R)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Y.global.dispatchEvent(a),function(M,R){var y=new Event(M.toLowerCase(),{cancelable:!0});return y.detail=R,!Y.global.dispatchEvent(y)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(a),function(M,R){var y=document.createEvent("CustomEvent");return y.initCustomEvent(M.toLowerCase(),!1,!0,R),!Y.global.dispatchEvent(y)}}}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(),M=Y.global[N];if(!M)return!1;return M.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function S(a,N){return{promise:N}}var f={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(a,N,M){return{promise:N,child:M}},warning:function(a,N){return{warning:N}},unhandledRejection:function(a,N,M){return{reason:N,promise:M}},rejectionHandled:S},v=function(a){var N=!1;try{N=k.apply(null,arguments)}catch(R){z.throwLater(R),N=!0}var M=!1;try{M=g(a,f[a].apply(null,arguments))}catch(R){z.throwLater(R),M=!0}return M||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(B0.warnings=!!N,T=B0.warnings,Y.isObject(N)){if("wForgottenReturn"in N)T=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!B0.cancellation){if(z.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=q0,$.prototype._propagateFrom=j,$.prototype._onCancel=n,$.prototype._setOnCancel=i,$.prototype._attachCancellationCallback=h,$.prototype._execute=b,c=j,B0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!B0.monitoring)B0.monitoring=!0,$.prototype._fireEvent=v;else if(!a.monitoring&&B0.monitoring)B0.monitoring=!1,$.prototype._fireEvent=p}return $};function p(){return!1}$.prototype._fireEvent=p,$.prototype._execute=function(a,N,M){try{a(N,M)}catch(R){return R}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(a){},$.prototype._attachCancellationCallback=function(a){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(a,N){};function b(a,N,M){var R=this;try{a(N,M,function(y){if(typeof y!=="function")throw TypeError("onCancel must be a function, got: "+Y.toString(y));R._attachCancellationCallback(y)})}catch(y){return y}}function h(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 n(){return this._onCancelField}function i(a){this._onCancelField=a}function q0(){this._cancellationParent=void 0,this._onCancelField=void 0}function j(a,N){if((N&1)!==0){this._cancellationParent=a;var M=a._branchesRemainingToCancel;if(M===void 0)M=0;a._branchesRemainingToCancel=M+1}if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}function x(a,N){if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}var c=x;function r(){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 Y$(this._peekContext())}function G0(a,N){if(J(a)){var M=this._trace;if(M!==void 0){if(N)M=M._parent}if(M!==void 0)M.attachExtraTrace(a);else if(!a.__stackCleaned__){var R=q1(a);Y.notEnumerableProp(a,"stack",R.message+`
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),z.enableTrampoline(),j0.longStackTraces=!1},$.prototype._captureStackTrace=U0,$.prototype._attachExtraTrace=G0,I.activateLongStackTraces(),z.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return j0.longStackTraces&&b6()};var g=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Y.global.dispatchEvent(a),function(N,M){var R=new CustomEvent(N.toLowerCase(),{detail:M,cancelable:!0});return!Y.global.dispatchEvent(R)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Y.global.dispatchEvent(a),function(M,R){var y=new Event(M.toLowerCase(),{cancelable:!0});return y.detail=R,!Y.global.dispatchEvent(y)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Y.global.dispatchEvent(a),function(M,R){var y=document.createEvent("CustomEvent");return y.initCustomEvent(M.toLowerCase(),!1,!0,R),!Y.global.dispatchEvent(y)}}}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(),M=Y.global[N];if(!M)return!1;return M.apply(Y.global,[].slice.call(arguments,1)),!0}}}();function S(a,N){return{promise:N}}var f={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(a,N,M){return{promise:N,child:M}},warning:function(a,N){return{warning:N}},unhandledRejection:function(a,N,M){return{reason:N,promise:M}},rejectionHandled:S},v=function(a){var N=!1;try{N=k.apply(null,arguments)}catch(R){z.throwLater(R),N=!0}var M=!1;try{M=g(a,f[a].apply(null,arguments))}catch(R){z.throwLater(R),M=!0}return M||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(j0.warnings=!!N,T=j0.warnings,Y.isObject(N)){if("wForgottenReturn"in N)T=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!j0.cancellation){if(z.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=q0,$.prototype._propagateFrom=B,$.prototype._onCancel=n,$.prototype._setOnCancel=b,$.prototype._attachCancellationCallback=h,$.prototype._execute=i,c=B,j0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!j0.monitoring)j0.monitoring=!0,$.prototype._fireEvent=v;else if(!a.monitoring&&j0.monitoring)j0.monitoring=!1,$.prototype._fireEvent=p}return $};function p(){return!1}$.prototype._fireEvent=p,$.prototype._execute=function(a,N,M){try{a(N,M)}catch(R){return R}},$.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,M){var R=this;try{a(N,M,function(y){if(typeof y!=="function")throw TypeError("onCancel must be a function, got: "+Y.toString(y));R._attachCancellationCallback(y)})}catch(y){return y}}function h(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 n(){return this._onCancelField}function b(a){this._onCancelField=a}function q0(){this._cancellationParent=void 0,this._onCancelField=void 0}function B(a,N){if((N&1)!==0){this._cancellationParent=a;var M=a._branchesRemainingToCancel;if(M===void 0)M=0;a._branchesRemainingToCancel=M+1}if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}function x(a,N){if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}var c=x;function r(){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 Y$(this._peekContext())}function G0(a,N){if(J(a)){var M=this._trace;if(M!==void 0){if(N)M=M._parent}if(M!==void 0)M.attachExtraTrace(a);else if(!a.__stackCleaned__){var R=z1(a);Y.notEnumerableProp(a,"stack",R.message+`
`+R.stack.join(`
`)),Y.notEnumerableProp(a,"__stackCleaned__",!0)}}}function A0(a,N,M,R,y){if(a===void 0&&N!==null&&T){if(y!==void 0&&y._returnedNonUndefined())return;if((R._bitField&65535)===0)return;if(M)M=M+" ";var s="",m="";if(N._trace){var e=N._trace.stack.split(`
`),J0=Y0(e);for(var H0=J0.length-1;H0>=0;--H0){var C0=J0[H0];if(!H.test(C0)){var i0=C0.match(G);if(i0)s="at "+i0[1]+":"+i0[2]+":"+i0[3]+" ";break}}if(J0.length>0){var f0=J0[0];for(var H0=0;H0<e.length;++H0)if(e[H0]===f0){if(H0>0)m=`
`+e[H0-1];break}}}var w1="a promise was created in a "+M+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+m;R._warn(w1,!0,N)}}function v0(a,N){var M=a+" is deprecated and will be removed in a future version.";if(N)M+=" Use "+N+" instead.";return Q1(M)}function Q1(a,N,M){if(!B0.warnings)return;var R=new U(a),y;if(N)M._attachExtraTrace(R);else if(B0.longStackTraces&&(y=$._peekContext()))y.attachExtraTrace(R);else{var s=q1(R);R.stack=s.message+`
`),J0=Y0(e);for(var H0=J0.length-1;H0>=0;--H0){var C0=J0[H0];if(!H.test(C0)){var b0=C0.match(G);if(b0)s="at "+b0[1]+":"+b0[2]+":"+b0[3]+" ";break}}if(J0.length>0){var f0=J0[0];for(var H0=0;H0<e.length;++H0)if(e[H0]===f0){if(H0>0)m=`
`+e[H0-1];break}}}var w1="a promise was created in a "+M+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+m;R._warn(w1,!0,N)}}function v0(a,N){var M=a+" is deprecated and will be removed in a future version.";if(N)M+=" Use "+N+" instead.";return Q1(M)}function Q1(a,N,M){if(!j0.warnings)return;var R=new U(a),y;if(N)M._attachExtraTrace(R);else if(j0.longStackTraces&&(y=$._peekContext()))y.attachExtraTrace(R);else{var s=z1(R);R.stack=s.message+`
`+s.stack.join(`
`)}if(!v("warning",R))O1(R,"",!0)}function k0(a,N){for(var M=0;M<N.length-1;++M)N[M].push("From previous event:"),N[M]=N[M].join(`
`);if(M<N.length)N[M]=N[M].join(`
`);return a+`
`+N.join(`
`)}function I1(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 M0(a){var N=a[0];for(var M=1;M<a.length;++M){var R=a[M],y=N.length-1,s=N[y],m=-1;for(var e=R.length-1;e>=0;--e)if(R[e]===s){m=e;break}for(var e=m;e>=0;--e){var J0=R[e];if(N[y]===J0)N.pop(),y--;else break}N=R}}function Y0(a){var N=[];for(var M=0;M<a.length;++M){var R=a[M],y=R===" (No stack trace)"||W.test(R),s=y&&T6(R);if(y&&!s){if(X&&R.charAt(0)!==" ")R=" "+R;N.push(R)}}return N}function g0(a){var N=a.stack.replace(/\s+$/g,"").split(`
`);for(var M=0;M<N.length;++M){var R=N[M];if(R===" (No stack trace)"||W.test(R))break}if(M>0&&a.name!="SyntaxError")N=N.slice(M);return N}function q1(a){var N=a.stack,M=a.toString();return N=typeof N==="string"&&N.length>0?g0(a):[" (No stack trace)"],{message:M,stack:a.name=="SyntaxError"?N:Y0(N)}}function O1(a,N,M){if(typeof console<"u"){var R;if(Y.isObject(a)){var y=a.stack;R=N+V(y,a)}else R=N+String(a);if(typeof L==="function")L(R,M);else if(typeof console.log==="function"||typeof console.log==="object")console.log(R)}}function i4(a,N,M,R){var y=!1;try{if(typeof N==="function")if(y=!0,a==="rejectionHandled")N(R);else N(M,R)}catch(s){z.throwLater(s)}if(a==="unhandledRejection"){if(!v(a,M,R)&&!y)O1(M,"Unhandled rejection ")}else v(a,R)}function n6(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 M=/\[object [a-zA-Z0-9$_]+\]/;if(M.test(N))try{var R=JSON.stringify(a);N=R}catch(y){}if(N.length===0)N="(empty array)"}return"(<"+M$(N)+">, no stack trace)"}function M$(a){var N=41;if(a.length<N)return a;return a.substr(0,N-3)+"..."}function i6(){return typeof $9==="function"}var T6=function(){return!1},A$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function U$(a){var N=a.match(A$);if(N)return{fileName:N[1],line:parseInt(N[2],10)}}function v7(a,N){if(!i6())return;var M=a.stack.split(`
`)}function q1(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 M0(a){var N=a[0];for(var M=1;M<a.length;++M){var R=a[M],y=N.length-1,s=N[y],m=-1;for(var e=R.length-1;e>=0;--e)if(R[e]===s){m=e;break}for(var e=m;e>=0;--e){var J0=R[e];if(N[y]===J0)N.pop(),y--;else break}N=R}}function Y0(a){var N=[];for(var M=0;M<a.length;++M){var R=a[M],y=R===" (No stack trace)"||W.test(R),s=y&&T6(R);if(y&&!s){if(X&&R.charAt(0)!==" ")R=" "+R;N.push(R)}}return N}function g0(a){var N=a.stack.replace(/\s+$/g,"").split(`
`);for(var M=0;M<N.length;++M){var R=N[M];if(R===" (No stack trace)"||W.test(R))break}if(M>0&&a.name!="SyntaxError")N=N.slice(M);return N}function z1(a){var N=a.stack,M=a.toString();return N=typeof N==="string"&&N.length>0?g0(a):[" (No stack trace)"],{message:M,stack:a.name=="SyntaxError"?N:Y0(N)}}function O1(a,N,M){if(typeof console<"u"){var R;if(Y.isObject(a)){var y=a.stack;R=N+V(y,a)}else R=N+String(a);if(typeof L==="function")L(R,M);else if(typeof console.log==="function"||typeof console.log==="object")console.log(R)}}function b4(a,N,M,R){var y=!1;try{if(typeof N==="function")if(y=!0,a==="rejectionHandled")N(R);else N(M,R)}catch(s){z.throwLater(s)}if(a==="unhandledRejection"){if(!v(a,M,R)&&!y)O1(M,"Unhandled rejection ")}else v(a,R)}function n6(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 M=/\[object [a-zA-Z0-9$_]+\]/;if(M.test(N))try{var R=JSON.stringify(a);N=R}catch(y){}if(N.length===0)N="(empty array)"}return"(<"+A$(N)+">, no stack trace)"}function A$(a){var N=41;if(a.length<N)return a;return a.substr(0,N-3)+"..."}function b6(){return typeof q9==="function"}var T6=function(){return!1},P$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function U$(a){var N=a.match(P$);if(N)return{fileName:N[1],line:parseInt(N[2],10)}}function C7(a,N){if(!b6())return;var M=a.stack.split(`
`),R=N.stack.split(`
`),y=-1,s=-1,m,e;for(var J0=0;J0<M.length;++J0){var H0=U$(M[J0]);if(H0){m=H0.fileName,y=H0.line;break}}for(var J0=0;J0<R.length;++J0){var H0=U$(R[J0]);if(H0){e=H0.fileName,s=H0.line;break}}if(y<0||s<0||!m||!e||m!==e||y>=s)return;T6=function(C0){if(K.test(C0))return!0;var i0=U$(C0);if(i0){if(i0.fileName===m&&(y<=i0.line&&i0.line<=s))return!0}return!1}}function Y$(a){this._parent=a,this._promisesCreated=0;var N=this._length=1+(a===void 0?0:a._length);if($9(this,Y$),N>32)this.uncycle()}Y.inherits(Y$,Error),I.CapturedTrace=Y$,Y$.prototype.uncycle=function(){var a=this._length;if(a<2)return;var N=[],M={};for(var R=0,y=this;y!==void 0;++R)N.push(y),y=y._parent;a=this._length=R;for(var R=a-1;R>=0;--R){var s=N[R].stack;if(M[s]===void 0)M[s]=R}for(var R=0;R<a;++R){var m=N[R].stack,e=M[m];if(e!==void 0&&e!==R){if(e>0)N[e-1]._parent=void 0,N[e-1]._length=1;N[R]._parent=void 0,N[R]._length=1;var J0=R>0?N[R-1]:this;if(e<a-1)J0._parent=N[e+1],J0._parent.uncycle(),J0._length=J0._parent._length+1;else J0._parent=void 0,J0._length=1;var H0=J0._length+1;for(var C0=R-2;C0>=0;--C0)N[C0]._length=H0,H0++;return}}},Y$.prototype.attachExtraTrace=function(a){if(a.__stackCleaned__)return;this.uncycle();var N=q1(a),M=N.message,R=[N.stack],y=this;while(y!==void 0)R.push(Y0(y.stack.split(`
`))),y=y._parent;M0(R),I1(R),Y.notEnumerableProp(a,"stack",k0(M,R)),Y.notEnumerableProp(a,"__stackCleaned__",!0)};var $9=function(){var N=/^\s*at\s*/,M=function(m,e){if(typeof m==="string")return m;if(e.name!==void 0&&e.message!==void 0)return e.toString();return n6(e)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,W=N,V=M;var R=Error.captureStackTrace;return T6=function(m){return K.test(m)},function(m,e){Error.stackTraceLimit+=6,R(m,e),Error.stackTraceLimit-=6}}var y=Error();if(typeof y.stack==="string"&&y.stack.split(`
`),y=-1,s=-1,m,e;for(var J0=0;J0<M.length;++J0){var H0=U$(M[J0]);if(H0){m=H0.fileName,y=H0.line;break}}for(var J0=0;J0<R.length;++J0){var H0=U$(R[J0]);if(H0){e=H0.fileName,s=H0.line;break}}if(y<0||s<0||!m||!e||m!==e||y>=s)return;T6=function(C0){if(K.test(C0))return!0;var b0=U$(C0);if(b0){if(b0.fileName===m&&(y<=b0.line&&b0.line<=s))return!0}return!1}}function Y$(a){this._parent=a,this._promisesCreated=0;var N=this._length=1+(a===void 0?0:a._length);if(q9(this,Y$),N>32)this.uncycle()}Y.inherits(Y$,Error),I.CapturedTrace=Y$,Y$.prototype.uncycle=function(){var a=this._length;if(a<2)return;var N=[],M={};for(var R=0,y=this;y!==void 0;++R)N.push(y),y=y._parent;a=this._length=R;for(var R=a-1;R>=0;--R){var s=N[R].stack;if(M[s]===void 0)M[s]=R}for(var R=0;R<a;++R){var m=N[R].stack,e=M[m];if(e!==void 0&&e!==R){if(e>0)N[e-1]._parent=void 0,N[e-1]._length=1;N[R]._parent=void 0,N[R]._length=1;var J0=R>0?N[R-1]:this;if(e<a-1)J0._parent=N[e+1],J0._parent.uncycle(),J0._length=J0._parent._length+1;else J0._parent=void 0,J0._length=1;var H0=J0._length+1;for(var C0=R-2;C0>=0;--C0)N[C0]._length=H0,H0++;return}}},Y$.prototype.attachExtraTrace=function(a){if(a.__stackCleaned__)return;this.uncycle();var N=z1(a),M=N.message,R=[N.stack],y=this;while(y!==void 0)R.push(Y0(y.stack.split(`
`))),y=y._parent;M0(R),q1(R),Y.notEnumerableProp(a,"stack",k0(M,R)),Y.notEnumerableProp(a,"__stackCleaned__",!0)};var q9=function(){var N=/^\s*at\s*/,M=function(m,e){if(typeof m==="string")return m;if(e.name!==void 0&&e.message!==void 0)return e.toString();return n6(e)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,W=N,V=M;var R=Error.captureStackTrace;return T6=function(m){return K.test(m)},function(m,e){Error.stackTraceLimit+=6,R(m,e),Error.stackTraceLimit-=6}}var y=Error();if(typeof y.stack==="string"&&y.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return W=/@/,V=M,X=!0,function(e){e.stack=Error().stack};var s;try{throw Error()}catch(m){s="stack"in m}if(!("stack"in y)&&s&&typeof Error.stackTraceLimit==="number")return W=N,V=M,function(e){Error.stackTraceLimit+=6;try{throw Error()}catch(J0){e.stack=J0.stack}Error.stackTraceLimit-=6};return V=function(m,e){if(typeof m==="string")return m;if((typeof e==="object"||typeof e==="function")&&e.name!==void 0&&e.message!==void 0)return e.toString();return n6(e)},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 M=N?"\x1B[33m":"\x1B[31m";console.warn(M+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 B0={warnings:F,longStackTraces:!1,cancellation:!1,monitoring:!1};if(P)$.longStackTraces();return{longStackTraces:function(){return B0.longStackTraces},warnings:function(){return B0.warnings},cancellation:function(){return B0.cancellation},monitoring:function(){return B0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return r},checkForgottenReturns:A0,setBounds:v7,warn:Q1,deprecated:v0,CapturedTrace:Y$,fireDomEvent:g,fireGlobalEvent:k}}});var L20=O((mC1,X20)=>{X20.exports=function($,I){var q=d1(),z=$.CancellationError,U=q.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 w(){return H.call(this,this.promise._target()._settledValue())}function K(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 D=new z("late cancellation observer");return W._attachExtraTrace(D),U.e=D,U}else if(L.isPending())L._attachCancellationCallback(new J(this))}return L._then(w,K,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 O20=O((lC1,D20)=>{D20.exports=function($){var I=d1(),q=o3().keys,z=I.tryCatch,U=I.errorObj;function Y(J,Q,w){return function(K){var H=w._boundValue();$:for(var G=0;G<J.length;++G){var W=J[G];if(W===Error||W!=null&&W.prototype instanceof Error){if(K instanceof W)return z(Q).call(H,K)}else if(typeof W==="function"){var V=z(W).call(H,K);if(V===U)return V;else if(V)return z(Q).call(H,K)}else if(I.isObject(K)){var X=q(W);for(var L=0;L<X.length;++L){var D=X[L];if(W[D]!=K[D])continue $}return z(Q).call(H,K)}}return $}}return Y}});var zS=O((oC1,M20)=>{var F20=d1(),Hz1=F20.maybeWrapAsError,Gz1=n5(),Wz1=Gz1.OperationalError,N20=o3();function Vz1($){return $ instanceof Error&&N20.getPrototypeOf($)===Error.prototype}var Zz1=/^(?:name|message|stack|cause)$/;function Xz1($){var I;if(Vz1($)){I=new Wz1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var q=N20.keys($);for(var z=0;z<q.length;++z){var U=q[z];if(!Zz1.test(U))I[U]=$[U]}return I}return F20.markAsOriginatingFromRejection($),$}function Lz1($,I){return function(q,z){if($===null)return;if(q){var U=Xz1(Hz1(q));$._attachExtraTrace(U),$._reject(U)}else if(!I)$._fulfill(z);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}}M20.exports=Lz1});var P20=O((rC1,A20)=>{A20.exports=function($,I,q,z,U){var Y=d1(),J=Y.tryCatch;$.method=function(Q){if(typeof Q!=="function")throw new $.TypeError("expecting a function but got "+Y.classString(Q));return function(){var w=new $(I);w._captureStackTrace(),w._pushContext();var K=J(Q).apply(this,arguments),H=w._popContext();return U.checkForgottenReturns(K,H,"Promise.method",w),w._resolveFromSyncValue(K),w}},$.attempt=$.try=function(Q){if(typeof Q!=="function")return z("expecting a function but got "+Y.classString(Q));var w=new $(I);w._captureStackTrace(),w._pushContext();var K;if(arguments.length>1){U.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],G=arguments[2];K=Y.isArray(H)?J(Q).apply(G,H):J(Q).call(G,H)}else K=J(Q)();var W=w._popContext();return U.checkForgottenReturns(K,W,"Promise.try",w),w._resolveFromSyncValue(K),w},$.prototype._resolveFromSyncValue=function(Q){if(Q===Y.errorObj)this._rejectCallback(Q.e,!1);else this._resolveCallback(Q,!0)}}});var E20=O((tC1,T20)=>{T20.exports=function($,I,q,z){var U=!1,Y=function(K,H){this._reject(H)},J=function(K,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(Y,Y,null,this,K)},Q=function(K,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},w=function(K,H){if(!H.promiseRejectionQueued)this._reject(K)};$.prototype.bind=function(K){if(!U)U=!0,$.prototype._propagateFrom=z.propagateFromFunction(),$.prototype._boundValue=z.boundValueFunction();var H=q(K),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
`)};else if(!Y.isNode&&typeof Error().stack==="string")L=function(a,N){console.warn("%c"+a,N?"color: darkorange":"color: red")}}var j0={warnings:O,longStackTraces:!1,cancellation:!1,monitoring:!1};if(P)$.longStackTraces();return{longStackTraces:function(){return j0.longStackTraces},warnings:function(){return j0.warnings},cancellation:function(){return j0.cancellation},monitoring:function(){return j0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return r},checkForgottenReturns:A0,setBounds:C7,warn:Q1,deprecated:v0,CapturedTrace:Y$,fireDomEvent:g,fireGlobalEvent:k}}});var P20=F((Q_1,A20)=>{A20.exports=function($,I){var q=d1(),z=$.CancellationError,U=q.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 w(){return H.call(this,this.promise._target()._settledValue())}function K(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 D=new z("late cancellation observer");return W._attachExtraTrace(D),U.e=D,U}else if(L.isPending())L._attachCancellationCallback(new J(this))}return L._then(w,K,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 E20=F((w_1,T20)=>{T20.exports=function($){var I=d1(),q=t3().keys,z=I.tryCatch,U=I.errorObj;function Y(J,Q,w){return function(K){var H=w._boundValue();$:for(var G=0;G<J.length;++G){var W=J[G];if(W===Error||W!=null&&W.prototype instanceof Error){if(K instanceof W)return z(Q).call(H,K)}else if(typeof W==="function"){var V=z(W).call(H,K);if(V===U)return V;else if(V)return z(Q).call(H,K)}else if(I.isObject(K)){var X=q(W);for(var L=0;L<X.length;++L){var D=X[L];if(W[D]!=K[D])continue $}return z(Q).call(H,K)}}return $}}return Y}});var YS=F((K_1,g20)=>{var B20=d1(),Mz1=B20.maybeWrapAsError,Az1=b5(),Pz1=Az1.OperationalError,j20=t3();function Tz1($){return $ instanceof Error&&j20.getPrototypeOf($)===Error.prototype}var Ez1=/^(?:name|message|stack|cause)$/;function Bz1($){var I;if(Tz1($)){I=new Pz1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var q=j20.keys($);for(var z=0;z<q.length;++z){var U=q[z];if(!Ez1.test(U))I[U]=$[U]}return I}return B20.markAsOriginatingFromRejection($),$}function jz1($,I){return function(q,z){if($===null)return;if(q){var U=Bz1(Mz1(q));$._attachExtraTrace(U),$._reject(U)}else if(!I)$._fulfill(z);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}}g20.exports=jz1});var R20=F((H_1,v20)=>{v20.exports=function($,I,q,z,U){var Y=d1(),J=Y.tryCatch;$.method=function(Q){if(typeof Q!=="function")throw new $.TypeError("expecting a function but got "+Y.classString(Q));return function(){var w=new $(I);w._captureStackTrace(),w._pushContext();var K=J(Q).apply(this,arguments),H=w._popContext();return U.checkForgottenReturns(K,H,"Promise.method",w),w._resolveFromSyncValue(K),w}},$.attempt=$.try=function(Q){if(typeof Q!=="function")return z("expecting a function but got "+Y.classString(Q));var w=new $(I);w._captureStackTrace(),w._pushContext();var K;if(arguments.length>1){U.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],G=arguments[2];K=Y.isArray(H)?J(Q).apply(G,H):J(Q).call(G,H)}else K=J(Q)();var W=w._popContext();return U.checkForgottenReturns(K,W,"Promise.try",w),w._resolveFromSyncValue(K),w},$.prototype._resolveFromSyncValue=function(Q){if(Q===Y.errorObj)this._rejectCallback(Q.e,!1);else this._resolveCallback(Q,!0)}}});var _20=F((G_1,C20)=>{C20.exports=function($,I,q,z){var U=!1,Y=function(K,H){this._reject(H)},J=function(K,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(Y,Y,null,this,K)},Q=function(K,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},w=function(K,H){if(!H.promiseRejectionQueued)this._reject(K)};$.prototype.bind=function(K){if(!U)U=!0,$.prototype._propagateFrom=z.propagateFromFunction(),$.prototype._boundValue=z.boundValueFunction();var H=q(K),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
See http://goo.gl/MqrFmX
`);return this._settledValue()},z=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 q.call(this._target())},$.prototype.reason=function(){var w=this._target();return w._unsetRejectionIsUnhandled(),z.call(w)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var h20=O(($_1,_20)=>{_20.exports=function($,I,q,z,U,Y){var J=d1(),Q=J.canEvaluate,w=J.tryCatch,K=J.errorObj,H;if(Q){var G=function(P){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 q.call(this._target())},$.prototype.reason=function(){var w=this._target();return w._unsetRejectionIsUnhandled(),z.call(w)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var n20=F((X_1,f20)=>{f20.exports=function($,I,q,z,U,Y){var J=d1(),Q=J.canEvaluate,w=J.tryCatch,K=J.errorObj,H;if(Q){var G=function(P){return Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
@@ -129,7 +129,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return v=v.replace(/\[TheName\]/g,f).replace(/\[TheTotal\]/g,P).replace(/\[ThePassedArguments\]/g,S).replace(/\[TheProperties\]/g,g).replace(/\[CancellationCode\]/g,k),Function("tryCatch","errorObj","Promise","async",v)(w,K,$,U)},X=[],L=[],D=[];for(var F=0;F<8;++F)X.push(V(F+1)),L.push(G(F+1)),D.push(W(F+1));H=function(P){this._reject(P)}}$.join=function(){var P=arguments.length-1,T;if(P>0&&typeof arguments[P]==="function"){if(T=arguments[P],P<=8&&Q){var i=new $(z);i._captureStackTrace();var A=X[P-1],g=new A(T),k=L;for(var S=0;S<P;++S){var f=q(arguments[S],i);if(f instanceof $){f=f._target();var v=f._bitField;if((v&50397184)===0)f._then(k[S],H,void 0,i,g),D[S](f,g),g.asyncNeeded=!1;else if((v&33554432)!==0)k[S].call(i,f._value(),g);else if((v&16777216)!==0)i._reject(f._reason());else i._cancel()}else k[S].call(i,f,g)}if(!i._isFateSealed()){if(g.asyncNeeded){var p=Y();if(p!==null)g.fn=J.domainBind(p,g.fn)}i._setAsyncGuaranteed(),i._setOnCancel(g)}return i}}var b=arguments.length,h=Array(b);for(var n=0;n<b;++n)h[n]=arguments[n];if(T)h.pop();var i=new I(h).promise();return T!==void 0?i.spread(T):i}}});var u20=O((I_1,S20)=>{S20.exports=function($,I,q,z,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch,K=Q.errorObj,H=$._async;function G(V,X,L,D){this.constructor$(V),this._promise._captureStackTrace();var F=J();this._callback=F===null?X:Q.domainBind(F,X),this._preservedValues=D===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,D=this.length(),F=this._preservedValues,P=this._limit;if(X<0){if(X=X*-1-1,L[X]=V,P>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(P>=1&&this._inFlight>=P)return L[X]=V,this._queue.push(X),!1;if(F!==null)F[X]=V;var T=this._promise,A=this._callback,g=T._boundValue();T._pushContext();var k=w(A).call(g,V,X,D),S=T._popContext();if(Y.checkForgottenReturns(k,S,F!==null?"Promise.filter":"Promise.map",T),k===K)return this._reject(k.e),!0;var f=z(k,this._promise);if(f instanceof $){f=f._target();var v=f._bitField;if((v&50397184)===0){if(P>=1)this._inFlight++;return L[X]=f,f._proxy(this,(X+1)*-1),!1}else if((v&33554432)!==0)k=f._value();else if((v&16777216)!==0)return this._reject(f._reason()),!0;else return this._cancel(),!0}L[X]=k}var p=++this._totalResolved;if(p>=D){if(F!==null)this._filter(L,F);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 D=V.pop();this._promiseFulfilled(L[D],D)}},G.prototype._filter=function(V,X){var L=X.length,D=Array(L),F=0;for(var P=0;P<L;++P)if(V[P])D[F++]=X[P];D.length=F,this._resolve(D)},G.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,L,D){if(typeof X!=="function")return q("expecting a function but got "+Q.classString(X));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 G(V,X,F,D).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,L,D){return W(V,X,L,D)}}});var x20=O((q_1,y20)=>{var US=Object.create;if(US)QL=US(null),wL=US(null),QL[" size"]=wL[" size"]=0;var QL,wL;y20.exports=function($){var I=d1(),q=I.canEvaluate,z=I.isIdentifier,U,Y,J=function(V){return Function("ensureMethod",`
`;return v=v.replace(/\[TheName\]/g,f).replace(/\[TheTotal\]/g,P).replace(/\[ThePassedArguments\]/g,S).replace(/\[TheProperties\]/g,g).replace(/\[CancellationCode\]/g,k),Function("tryCatch","errorObj","Promise","async",v)(w,K,$,U)},X=[],L=[],D=[];for(var O=0;O<8;++O)X.push(V(O+1)),L.push(G(O+1)),D.push(W(O+1));H=function(P){this._reject(P)}}$.join=function(){var P=arguments.length-1,T;if(P>0&&typeof arguments[P]==="function"){if(T=arguments[P],P<=8&&Q){var b=new $(z);b._captureStackTrace();var A=X[P-1],g=new A(T),k=L;for(var S=0;S<P;++S){var f=q(arguments[S],b);if(f instanceof $){f=f._target();var v=f._bitField;if((v&50397184)===0)f._then(k[S],H,void 0,b,g),D[S](f,g),g.asyncNeeded=!1;else if((v&33554432)!==0)k[S].call(b,f._value(),g);else if((v&16777216)!==0)b._reject(f._reason());else b._cancel()}else k[S].call(b,f,g)}if(!b._isFateSealed()){if(g.asyncNeeded){var p=Y();if(p!==null)g.fn=J.domainBind(p,g.fn)}b._setAsyncGuaranteed(),b._setOnCancel(g)}return b}}var i=arguments.length,h=Array(i);for(var n=0;n<i;++n)h[n]=arguments[n];if(T)h.pop();var b=new I(h).promise();return T!==void 0?b.spread(T):b}}});var i20=F((L_1,b20)=>{b20.exports=function($,I,q,z,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch,K=Q.errorObj,H=$._async;function G(V,X,L,D){this.constructor$(V),this._promise._captureStackTrace();var O=J();this._callback=O===null?X:Q.domainBind(O,X),this._preservedValues=D===U?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],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,D=this.length(),O=this._preservedValues,P=this._limit;if(X<0){if(X=X*-1-1,L[X]=V,P>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(P>=1&&this._inFlight>=P)return L[X]=V,this._queue.push(X),!1;if(O!==null)O[X]=V;var T=this._promise,A=this._callback,g=T._boundValue();T._pushContext();var k=w(A).call(g,V,X,D),S=T._popContext();if(Y.checkForgottenReturns(k,S,O!==null?"Promise.filter":"Promise.map",T),k===K)return this._reject(k.e),!0;var f=z(k,this._promise);if(f instanceof $){f=f._target();var v=f._bitField;if((v&50397184)===0){if(P>=1)this._inFlight++;return L[X]=f,f._proxy(this,(X+1)*-1),!1}else if((v&33554432)!==0)k=f._value();else if((v&16777216)!==0)return this._reject(f._reason()),!0;else return this._cancel(),!0}L[X]=k}var p=++this._totalResolved;if(p>=D){if(O!==null)this._filter(L,O);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 D=V.pop();this._promiseFulfilled(L[D],D)}},G.prototype._filter=function(V,X){var L=X.length,D=Array(L),O=0;for(var P=0;P<L;++P)if(V[P])D[O++]=X[P];D.length=O,this._resolve(D)},G.prototype.preservedValues=function(){return this._preservedValues};function W(V,X,L,D){if(typeof X!=="function")return q("expecting a function but got "+Q.classString(X));var O=0;if(L!==void 0)if(typeof L==="object"&&L!==null){if(typeof L.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+Q.classString(L.concurrency)));O=L.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+Q.classString(L)));return O=typeof O==="number"&&isFinite(O)&&O>=1?O:0,new G(V,X,O,D).promise()}$.prototype.map=function(V,X){return W(this,V,X,null)},$.map=function(V,X,L,D){return W(V,X,L,D)}}});var c20=F((D_1,p20)=>{var JS=Object.create;if(JS)KL=JS(null),HL=JS(null),KL[" size"]=HL[" size"]=0;var KL,HL;p20.exports=function($){var I=d1(),q=I.canEvaluate,z=I.isIdentifier,U,Y,J=function(V){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
@@ -146,26 +146,26 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
`.replace(/methodName/g,V))(K)},Q=function(V){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",V))},w=function(V,X,L){var D=L[V];if(typeof D!=="function"){if(!z(V))return null;if(D=X(V),L[V]=D,L[" size"]++,L[" size"]>512){var F=Object.keys(L);for(var P=0;P<256;++P)delete L[F[P]];L[" size"]=F.length-256}}return D};U=function(V){return w(V,J,QL)},Y=function(V){return w(V,Q,wL)};function K(V,X){var L;if(V!=null)L=V[X];if(typeof L!=="function"){var D="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(D)}return L}function H(V){var X=this.pop(),L=K(V,X);return L.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,L=Array(Math.max(X-1,0));for(var D=1;D<X;++D)L[D-1]=arguments[D];if(q){var F=U(V);if(F!==null)return this._then(F,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(q){var D=Y(V);L=D!==null?D:G}else L=G;else L=W;return this._then(L,void 0,void 0,V,void 0)}}});var f20=O((z_1,k20)=>{k20.exports=function($,I,q,z,U,Y){var J=d1(),Q=n5().TypeError,w=d1().inherits,K=J.errorObj,H=J.tryCatch,G={};function W(T){setTimeout(function(){throw T},0)}function V(T){var A=q(T);if(A!==T&&typeof T._isDisposable==="function"&&typeof T._getDisposer==="function"&&T._isDisposable())A._setDisposable(T._getDisposer());return A}function X(T,A){var g=0,k=T.length,S=new $(U);function f(){if(g>=k)return S._fulfill();var v=V(T[g++]);if(v instanceof $&&v._isDisposable()){try{v=q(v._getDisposer().tryDispose(A),T.promise)}catch(p){return W(p)}if(v instanceof $)return v._then(f,W,null,null,null)}f()}return f(),S}function L(T,A,g){this._data=T,this._promise=A,this._context=g}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 A=this.resource(),g=this._context;if(g!==void 0)g._pushContext();var k=A!==G?this.doDispose(A,T):null;if(g!==void 0)g._popContext();return this._promise._unsetDisposable(),this._data=null,k},L.isDisposer=function(T){return T!=null&&typeof T.resource==="function"&&typeof T.tryDispose==="function"};function D(T,A,g){this.constructor$(T,A,g)}w(D,L),D.prototype.doDispose=function(T,A){var g=this.data();return g.call(T,T,A)};function F(T){if(L.isDisposer(T))return this.resources[this.index]._setDisposable(T),T.promise();return T}function P(T){this.length=T,this.promise=null,this[T-1]=null}P.prototype._resultCancelled=function(){var T=this.length;for(var A=0;A<T;++A){var g=this[A];if(g instanceof $)g.cancel()}},$.using=function(){var T=arguments.length;if(T<2)return I("you must pass at least 2 arguments to Promise.using");var A=arguments[T-1];if(typeof A!=="function")return I("expecting a function but got "+J.classString(A));var g,k=!0;if(T===2&&Array.isArray(arguments[0]))g=arguments[0],T=g.length,k=!1;else g=arguments,T--;var S=new P(T);for(var f=0;f<T;++f){var v=g[f];if(L.isDisposer(v)){var p=v;v=v.promise(),v._setDisposable(p)}else{var b=q(v);if(b instanceof $)v=b._then(F,null,null,{resources:S,index:f},void 0)}S[f]=v}var h=Array(S.length);for(var f=0;f<h.length;++f)h[f]=$.resolve(S[f]).reflect();var n=$.all(h).then(function(q0){for(var j=0;j<q0.length;++j){var x=q0[j];if(x.isRejected())return K.e=x.error(),K;else if(!x.isFulfilled()){n.cancel();return}q0[j]=x.value()}i._pushContext(),A=H(A);var c=k?A.apply(void 0,q0):A(q0),r=i._popContext();return Y.checkForgottenReturns(c,r,"Promise.using",i),c}),i=n.lastly(function(){var q0=new $.PromiseInspection(n);return X(S,q0)});return S.promise=i,i._setOnCancel(S),i},$.prototype._setDisposable=function(T){this._bitField=this._bitField|131072,this._disposer=T},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(T){if(typeof T==="function")return new D(T,this,z());throw new Q}}});var i20=O((U_1,n20)=>{n20.exports=function($,I,q){var z=d1(),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),q.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+G),q.cancellation())V._setOnCancel(new Y(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(G){return Q(G,this)};var w=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(z.markAsOriginatingFromRejection(X),G._attachExtraTrace(X),G._reject(X),V!=null)V.cancel()};function K(G){return clearTimeout(this.handle),G}f Line truncated
`.replace("propertyName",V))},w=function(V,X,L){var D=L[V];if(typeof D!=="function"){if(!z(V))return null;if(D=X(V),L[V]=D,L[" size"]++,L[" size"]>512){var O=Object.keys(L);for(var P=0;P<256;++P)delete L[O[P]];L[" size"]=O.length-256}}return D};U=function(V){return w(V,J,KL)},Y=function(V){return w(V,Q,HL)};function K(V,X){var L;if(V!=null)L=V[X];if(typeof L!=="function"){var D="Object "+I.classString(V)+" has no method '"+I.toString(X)+"'";throw new $.TypeError(D)}return L}function H(V){var X=this.pop(),L=K(V,X);return L.apply(V,this)}$.prototype.call=function(V){var X=arguments.length,L=Array(Math.max(X-1,0));for(var D=1;D<X;++D)L[D-1]=arguments[D];if(q){var O=U(V);if(O!==null)return this._then(O,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(q){var D=Y(V);L=D!==null?D:G}else L=G;else L=W;return this._then(L,void 0,void 0,V,void 0)}}});var m20=F((O_1,d20)=>{d20.exports=function($,I,q,z,U,Y){var J=d1(),Q=b5().TypeError,w=d1().inherits,K=J.errorObj,H=J.tryCatch,G={};function W(T){setTimeout(function(){throw T},0)}function V(T){var A=q(T);if(A!==T&&typeof T._isDisposable==="function"&&typeof T._getDisposer==="function"&&T._isDisposable())A._setDisposable(T._getDisposer());return A}function X(T,A){var g=0,k=T.length,S=new $(U);function f(){if(g>=k)return S._fulfill();var v=V(T[g++]);if(v instanceof $&&v._isDisposable()){try{v=q(v._getDisposer().tryDispose(A),T.promise)}catch(p){return W(p)}if(v instanceof $)return v._then(f,W,null,null,null)}f()}return f(),S}function L(T,A,g){this._data=T,this._promise=A,this._context=g}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 A=this.resource(),g=this._context;if(g!==void 0)g._pushContext();var k=A!==G?this.doDispose(A,T):null;if(g!==void 0)g._popContext();return this._promise._unsetDisposable(),this._data=null,k},L.isDisposer=function(T){return T!=null&&typeof T.resource==="function"&&typeof T.tryDispose==="function"};function D(T,A,g){this.constructor$(T,A,g)}w(D,L),D.prototype.doDispose=function(T,A){var g=this.data();return g.call(T,T,A)};function O(T){if(L.isDisposer(T))return this.resources[this.index]._setDisposable(T),T.promise();return T}function P(T){this.length=T,this.promise=null,this[T-1]=null}P.prototype._resultCancelled=function(){var T=this.length;for(var A=0;A<T;++A){var g=this[A];if(g instanceof $)g.cancel()}},$.using=function(){var T=arguments.length;if(T<2)return I("you must pass at least 2 arguments to Promise.using");var A=arguments[T-1];if(typeof A!=="function")return I("expecting a function but got "+J.classString(A));var g,k=!0;if(T===2&&Array.isArray(arguments[0]))g=arguments[0],T=g.length,k=!1;else g=arguments,T--;var S=new P(T);for(var f=0;f<T;++f){var v=g[f];if(L.isDisposer(v)){var p=v;v=v.promise(),v._setDisposable(p)}else{var i=q(v);if(i instanceof $)v=i._then(O,null,null,{resources:S,index:f},void 0)}S[f]=v}var h=Array(S.length);for(var f=0;f<h.length;++f)h[f]=$.resolve(S[f]).reflect();var n=$.all(h).then(function(q0){for(var B=0;B<q0.length;++B){var x=q0[B];if(x.isRejected())return K.e=x.error(),K;else if(!x.isFulfilled()){n.cancel();return}q0[B]=x.value()}b._pushContext(),A=H(A);var c=k?A.apply(void 0,q0):A(q0),r=b._popContext();return Y.checkForgottenReturns(c,r,"Promise.using",b),c}),b=n.lastly(function(){var q0=new $.PromiseInspection(n);return X(S,q0)});return S.promise=b,b._setOnCancel(S),b},$.prototype._setDisposable=function(T){this._bitField=this._bitField|131072,this._disposer=T},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(T){if(typeof T==="function")return new D(T,this,z());throw new Q}}});var o20=F((F_1,l20)=>{l20.exports=function($,I,q){var z=d1(),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),q.cancellation()&&W instanceof $)V._setOnCancel(W)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+G),q.cancellation())V._setOnCancel(new Y(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(G){return Q(G,this)};var w=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(z.markAsOriginatingFromRejection(X),G._attachExtraTrace(X),G._reject(X),V!=null)V.cancel()};function K(G){return clearTimeout(this.handle),G}f Line truncated
See http://goo.gl/MqrFmX
`.replace("%s",D)+`From coroutine:
`+this._stack.split(`
`).slice(1,-7).join(`
`)));return}}F=F._target();var P=F._bitField;if((P&50397184)===0)this._yieldedPromise=F,F._proxy(this,null);else if((P&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,F._value());else if((P&16777216)!==0)$._async.invoke(this._promiseRejected,this,F._reason());else this._promiseCancelled()}},$.coroutine=function(X,L){if(typeof X!=="function")throw new Q(`generatorFunction must be a function
`)));return}}O=O._target();var P=O._bitField;if((P&50397184)===0)this._yieldedPromise=O,O._proxy(this,null);else if((P&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,O._value());else if((P&16777216)!==0)$._async.invoke(this._promiseRejected,this,O._reason());else this._promiseCancelled()}},$.coroutine=function(X,L){if(typeof X!=="function")throw new Q(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var D=Object(L).yieldHandler,F=V,P=Error().stack;return function(){var T=X.apply(this,arguments),A=new F(void 0,void 0,D,P),g=A.promise();return A._generator=T,A._promiseFulfilled(void 0),g}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new Q("expecting a function but got "+w.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 D=Object(L).yieldHandler,O=V,P=Error().stack;return function(){var T=X.apply(this,arguments),A=new O(void 0,void 0,D,P),g=A.promise();return A._generator=T,A._promiseFulfilled(void 0),g}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new Q("expecting a function but got "+w.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
See http://goo.gl/MqrFmX
`);var L=new V(X,this),D=L.promise();return L._run($.spawn),D}}});var d20=O((J_1,c20)=>{c20.exports=function($){var I=d1(),q=$._async,z=I.tryCatch,U=I.errorObj;function Y(w,K){var H=this;if(!I.isArray(w))return J.call(H,w,K);var G=z(K).apply(H._boundValue(),[null].concat(w));if(G===U)q.throwLater(G.e)}function J(w,K){var H=this,G=H._boundValue(),W=w===void 0?z(K).call(G,null):z(K).call(G,null,w);if(W===U)q.throwLater(W.e)}function Q(w,K){var H=this;if(!w){var G=Error(w+"");G.cause=w,w=G}var W=z(K).call(H._boundValue(),w);if(W===U)q.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(w,K){if(typeof w=="function"){var H=J;if(K!==void 0&&Object(K).spread)H=Y;this._then(H,Q,void 0,this,w)}return this}}});var l20=O((Q_1,m20)=>{m20.exports=function($,I){var q={},z=d1(),U=zS(),Y=z.withAppended,J=z.maybeWrapAsError,Q=z.canEvaluate,w=n5().TypeError,K="Async",H={__isPromisified__:!0},G=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+G.join("|")+")$"),V=function(n){return z.isIdentifier(n)&&n.charAt(0)!=="_"&&n!=="constructor"};function X(n){return!W.test(n)}function L(n){try{return n.__isPromisified__===!0}catch(i){return!1}}function D(n,i,q0){var j=z.getDataPropertyOrDefault(n,i+q0,H);return j?L(j):!1}function F(n,i,q0){for(var j=0;j<n.length;j+=2){var x=n[j];if(q0.test(x)){var c=x.replace(q0,"");for(var r=0;r<n.length;r+=2)if(n[r]===c)throw new w(`Cannot promisify an API that has normal methods with '%s'-suffix
`);var L=new V(X,this),D=L.promise();return L._run($.spawn),D}}});var s20=F((M_1,a20)=>{a20.exports=function($){var I=d1(),q=$._async,z=I.tryCatch,U=I.errorObj;function Y(w,K){var H=this;if(!I.isArray(w))return J.call(H,w,K);var G=z(K).apply(H._boundValue(),[null].concat(w));if(G===U)q.throwLater(G.e)}function J(w,K){var H=this,G=H._boundValue(),W=w===void 0?z(K).call(G,null):z(K).call(G,null,w);if(W===U)q.throwLater(W.e)}function Q(w,K){var H=this;if(!w){var G=Error(w+"");G.cause=w,w=G}var W=z(K).call(H._boundValue(),w);if(W===U)q.throwLater(W.e)}$.prototype.asCallback=$.prototype.nodeify=function(w,K){if(typeof w=="function"){var H=J;if(K!==void 0&&Object(K).spread)H=Y;this._then(H,Q,void 0,this,w)}return this}}});var $w0=F((A_1,e20)=>{e20.exports=function($,I){var q={},z=d1(),U=YS(),Y=z.withAppended,J=z.maybeWrapAsError,Q=z.canEvaluate,w=b5().TypeError,K="Async",H={__isPromisified__:!0},G=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],W=new RegExp("^(?:"+G.join("|")+")$"),V=function(n){return z.isIdentifier(n)&&n.charAt(0)!=="_"&&n!=="constructor"};function X(n){return!W.test(n)}function L(n){try{return n.__isPromisified__===!0}catch(b){return!1}}function D(n,b,q0){var B=z.getDataPropertyOrDefault(n,b+q0,H);return B?L(B):!1}function O(n,b,q0){for(var B=0;B<n.length;B+=2){var x=n[B];if(q0.test(x)){var c=x.replace(q0,"");for(var r=0;r<n.length;r+=2)if(n[r]===c)throw new w(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",i))}}}function P(n,i,q0,j){var x=z.inheritedDataKeys(n),c=[];for(var r=0;r<x.length;++r){var U0=x[r],G0=n[U0],A0=j===V?!0:V(U0,G0,n);if(typeof G0==="function"&&!L(G0)&&!D(n,U0,i)&&j(U0,G0,n,A0))c.push(U0,G0)}return F(c,i,q0),c}var T=function(n){return n.replace(/([$])/,"\\$")},A,g=function(n){var i=[n],q0=Math.max(0,n-1-3);for(var j=n-1;j>=q0;--j)i.push(j);for(var j=n+1;j<=3;++j)i.push(j);return i},k=function(n){return z.filledRange(n,"_arg","")},S=function(n){return z.filledRange(Math.max(n,3),"_arg","")},f=function(n){if(typeof n.length==="number")return Math.max(Math.min(n.length,1024),0);return 0};A=function(n,i,q0,j,x,c){var r=Math.max(0,f(j)-1),U0=g(r),G0=typeof n==="string"||i===q;function A0(I1){var M0=k(I1).join(", "),Y0=I1>0?", ":"",g0;if(G0)g0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else g0=i===void 0?`ret = callback({{args}}, nodeback); break;
`.replace("%s",b))}}}function P(n,b,q0,B){var x=z.inheritedDataKeys(n),c=[];for(var r=0;r<x.length;++r){var U0=x[r],G0=n[U0],A0=B===V?!0:V(U0,G0,n);if(typeof G0==="function"&&!L(G0)&&!D(n,U0,b)&&B(U0,G0,n,A0))c.push(U0,G0)}return O(c,b,q0),c}var T=function(n){return n.replace(/([$])/,"\\$")},A,g=function(n){var b=[n],q0=Math.max(0,n-1-3);for(var B=n-1;B>=q0;--B)b.push(B);for(var B=n+1;B<=3;++B)b.push(B);return b},k=function(n){return z.filledRange(n,"_arg","")},S=function(n){return z.filledRange(Math.max(n,3),"_arg","")},f=function(n){if(typeof n.length==="number")return Math.max(Math.min(n.length,1024),0);return 0};A=function(n,b,q0,B,x,c){var r=Math.max(0,f(B)-1),U0=g(r),G0=typeof n==="string"||b===q;function A0(q1){var M0=k(q1).join(", "),Y0=q1>0?", ":"",g0;if(G0)g0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else g0=b===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return g0.replace("{{args}}",M0).replace(", ",Y0)}function v0(){var I1="";for(var M0=0;M0<U0.length;++M0)I1+="case "+U0[M0]+":"+A0(U0[M0]);return I1+=`
`;return g0.replace("{{args}}",M0).replace(", ",Y0)}function v0(){var q1="";for(var M0=0;M0<U0.length;++M0)q1+="case "+U0[M0]+":"+A0(U0[M0]);return q1+=`
default:
var args = new Array(len + 1);
var i = 0;
@@ -177,7 +177,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
break;
`.replace("[CodeForCall]",G0?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),I1}var Q1=typeof n==="string"?"this != null ? this['"+n+"'] : fn":"fn",k0=`'use strict';
`),q1}var Q1=typeof n==="string"?"this != null ? this['"+n+"'] : fn":"fn",k0=`'use strict';
var ret = function (Parameters) {
'use strict';
var len = arguments.length;
@@ -197,25 +197,25 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x4))r
};
notEnumerableProp(ret, '__isPromisified__', true);
return ret;
`.replace("[CodeForSwitchCase]",v0()).replace("[GetFunctionCode]",Q1);return k0=k0.replace("Parameters",S(r)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",k0)($,j,i,Y,J,U,z.tryCatch,z.errorObj,z.notEnumerableProp,I)};function v(n,i,q0,j,x,c){var r=function(){return this}(),U0=n;if(typeof U0==="string")n=j;function G0(){var A0=i;if(i===q)A0=this;var v0=new $(I);v0._captureStackTrace();var Q1=typeof U0==="string"&&this!==r?this[U0]:n,k0=U(v0,c);try{Q1.apply(A0,Y(arguments,k0))}catch(I1){v0._rejectCallback(J(I1),!0,!0)}if(!v0._isFateSealed())v0._setAsyncGuaranteed();return v0}return z.notEnumerableProp(G0,"__isPromisified__",!0),G0}var p=Q?A:v;function b(n,i,q0,j,x){var c=new RegExp(T(i)+"$"),r=P(n,i,c,q0);for(var U0=0,G0=r.length;U0<G0;U0+=2){var A0=r[U0],v0=r[U0+1],Q1=A0+i;if(j===p)n[Q1]=p(A0,q,A0,v0,i,x);else{var k0=j(v0,function(){return p(A0,q,A0,v0,i,x)});z.notEnumerableProp(k0,"__isPromisified__",!0),n[Q1]=k0}}return z.toFastProperties(n),n}function h(n,i,q0){return p(n,i,void 0,n,null,q0)}$.promisify=function(n,i){if(typeof n!=="function")throw new w("expecting a function but got "+z.classString(n));if(L(n))return n;i=Object(i);var q0=i.context===void 0?q:i.context,j=!!i.multiArgs,x=h(n,q0,j);return z.copyDescriptors(n,x,X),x},$.promisifyAll=function(n,i){if(typeof n!=="function"&&typeof n!=="object")throw new w(`the target of promisifyAll must be an object or a function
`.replace("[CodeForSwitchCase]",v0()).replace("[GetFunctionCode]",Q1);return k0=k0.replace("Parameters",S(r)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",k0)($,B,b,Y,J,U,z.tryCatch,z.errorObj,z.notEnumerableProp,I)};function v(n,b,q0,B,x,c){var r=function(){return this}(),U0=n;if(typeof U0==="string")n=B;function G0(){var A0=b;if(b===q)A0=this;var v0=new $(I);v0._captureStackTrace();var Q1=typeof U0==="string"&&this!==r?this[U0]:n,k0=U(v0,c);try{Q1.apply(A0,Y(arguments,k0))}catch(q1){v0._rejectCallback(J(q1),!0,!0)}if(!v0._isFateSealed())v0._setAsyncGuaranteed();return v0}return z.notEnumerableProp(G0,"__isPromisified__",!0),G0}var p=Q?A:v;function i(n,b,q0,B,x){var c=new RegExp(T(b)+"$"),r=P(n,b,c,q0);for(var U0=0,G0=r.length;U0<G0;U0+=2){var A0=r[U0],v0=r[U0+1],Q1=A0+b;if(B===p)n[Q1]=p(A0,q,A0,v0,b,x);else{var k0=B(v0,function(){return p(A0,q,A0,v0,b,x)});z.notEnumerableProp(k0,"__isPromisified__",!0),n[Q1]=k0}}return z.toFastProperties(n),n}function h(n,b,q0){return p(n,b,void 0,n,null,q0)}$.promisify=function(n,b){if(typeof n!=="function")throw new w("expecting a function but got "+z.classString(n));if(L(n))return n;b=Object(b);var q0=b.context===void 0?q:b.context,B=!!b.multiArgs,x=h(n,q0,B);return z.copyDescriptors(n,x,X),x},$.promisifyAll=function(n,b){if(typeof n!=="function"&&typeof n!=="object")throw new w(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);i=Object(i);var q0=!!i.multiArgs,j=i.suffix;if(typeof j!=="string")j=K;var x=i.filter;if(typeof x!=="function")x=V;var c=i.promisifier;if(typeof c!=="function")c=p;if(!z.isIdentifier(j))throw RangeError(`suffix must be a valid identifier
`);b=Object(b);var q0=!!b.multiArgs,B=b.suffix;if(typeof B!=="string")B=K;var x=b.filter;if(typeof x!=="function")x=V;var c=b.promisifier;if(typeof c!=="function")c=p;if(!z.isIdentifier(B))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var r=z.inheritedDataKeys(n);for(var U0=0;U0<r.length;++U0){var G0=n[r[U0]];if(r[U0]!=="constructor"&&z.isClass(G0))b(G0.prototype,j,x,c,q0),b(G0,j,x,c,q0)}return b(n,j,x,c,q0)}}});var r20=O((w_1,o20)=>{o20.exports=function($,I,q,z){var U=d1(),Y=U.isObject,J=o3(),Q;if(typeof Map==="function")Q=Map;var w=function(){var W=0,V=0;function X(L,D){this[W]=L,this[W+V]=D,W++}return function(D){V=D.size,W=0;var F=Array(D.size*2);return D.forEach(X,F),F}}(),K=function(W){var V=new Q,X=W.length/2|0;for(var L=0;L<X;++L){var D=W[X+L],F=W[L];V.set(D,F)}return V};function H(W){var V=!1,X;if(Q!==void 0&&W instanceof Q)X=w(W),V=!0;else{var L=J.keys(W),D=L.length;X=Array(D*2);for(var F=0;F<D;++F){var P=L[F];X[F]=W[P],X[F+D]=P}}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=K(this._values);else{L={};var D=this.length();for(var F=0,P=this.length();F<P;++F)L[this._values[F+D]]=this._values[F]}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=q(W);if(!Y(X))return z(`cannot await properties of a non-object
`);var r=z.inheritedDataKeys(n);for(var U0=0;U0<r.length;++U0){var G0=n[r[U0]];if(r[U0]!=="constructor"&&z.isClass(G0))i(G0.prototype,B,x,c,q0),i(G0,B,x,c,q0)}return i(n,B,x,c,q0)}}});var qw0=F((P_1,Iw0)=>{Iw0.exports=function($,I,q,z){var U=d1(),Y=U.isObject,J=t3(),Q;if(typeof Map==="function")Q=Map;var w=function(){var W=0,V=0;function X(L,D){this[W]=L,this[W+V]=D,W++}return function(D){V=D.size,W=0;var O=Array(D.size*2);return D.forEach(X,O),O}}(),K=function(W){var V=new Q,X=W.length/2|0;for(var L=0;L<X;++L){var D=W[X+L],O=W[L];V.set(D,O)}return V};function H(W){var V=!1,X;if(Q!==void 0&&W instanceof Q)X=w(W),V=!0;else{var L=J.keys(W),D=L.length;X=Array(D*2);for(var O=0;O<D;++O){var P=L[O];X[O]=W[P],X[O+D]=P}}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=K(this._values);else{L={};var D=this.length();for(var O=0,P=this.length();O<P;++O)L[this._values[O+D]]=this._values[O]}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=q(W);if(!Y(X))return z(`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 a20=O((K_1,t20)=>{t20.exports=function($,I,q,z){var U=d1(),Y=function(Q){return Q.then(function(w){return J(w,Q)})};function J(Q,w){var K=q(Q);if(K instanceof $)return Y(K);else if(Q=U.asArray(Q),Q===null)return z("expecting an array or an iterable object but got "+U.classString(Q));var H=new $(I);if(w!==void 0)H._propagateFrom(w,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 e20=O((H_1,s20)=>{s20.exports=function($,I,q,z,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch;function K(X,L,D,F){this.constructor$(X);var P=J();if(this._fn=P===null?L:Q.domainBind(P,L),D!==void 0)D=$.resolve(D),D._attachCancellationCallback(this);if(this._initialValue=D,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(K,I),K.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==U)this._eachValues.push(X)},K.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},K.prototype._init=function(){},K.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},K.prototype.shouldCopyValues=function(){return!1},K.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},K.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()},K.prototype._iterate=function(X){this._values=X;var L,D,F=X.length;if(this._initialValue!==void 0)L=this._initialValue,D=0;else L=$.resolve(X[0]),D=1;if(this._currentCancellable=L,!L.isRejected())for(;D<F;++D){var P={accum:null,value:X[D],index:D,length:F,array:this};L=L._then(W,void 0,void 0,P,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,D,F){return G(X,L,D,F)};function H(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function G(X,L,D,F){if(typeof L!=="function")return q("expecting a function but got "+Q.classString(L));var P=new K(X,L,D,F);return P.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var L=z(this.value,this.array._promise);if(L instanceof $)return this.array._currentCancellable=L,L._then(V,void 0,void 0,this,void 0);else return V.call(this,L)}function V(X){var L=this.array,D=L._promise,F=w(L._fn);D._pushContext();var P;if(L._eachValues!==void 0)P=F.call(D._boundValue(),X,this.index,this.length);else P=F.call(D._boundValue(),this.accum,X,this.index,this.length);if(P instanceof $)L._currentCancellable=P;var T=D._popContext();return Y.checkForgottenReturns(P,T,L._eachValues!==void 0?"Promise.each":"Promise.reduce",D),P}}});var Iw0=O((G_1,$w0)=>{$w0.exports=function($,I,q){var z=$.PromiseInspection,U=d1();function Y(J){this.constructor$(J)}U.inherits(Y,I),Y.prototype._promiseResolved=function(J,Q){this._values[J]=Q;var w=++this._totalResolved;if(w>=this._length)return this._resolve(this._values),!0;return!1},Y.prototype._promiseFulfilled=function(J,Q){var w=new z;return w._bitField=33554432,w._settledValueField=J,this._promiseResolved(Q,w)},Y.prototype._promiseRejected=function(J,Q){var w=new z;return w._bitField=16777216,w._settledValueField=J,this._promiseResolved(Q,w)},$.settle=function(J){return q.deprecated(".settle()",".reflect()"),new Y(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var zw0=O((W_1,qw0)=>{qw0.exports=function($,I,q){var z=d1(),U=n5().RangeError,Y=n5().AggregateError,J=z.isArray,Q={};function w(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}z.inherits(w,I),w.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()))},w.prototype.init=function(){this._initialized=!0,this._init()},w.prototype.setUnwrap=function(){this._unwrap=!0},w.prototype.howMany=function(){return this._howMany},w.prototype.setHowMany=function(H){this._howMany=H},w.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
`);else if(X instanceof $)V=X._then($.props,void 0,void 0,void 0,void 0);else V=new 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 Uw0=F((T_1,zw0)=>{zw0.exports=function($,I,q,z){var U=d1(),Y=function(Q){return Q.then(function(w){return J(w,Q)})};function J(Q,w){var K=q(Q);if(K instanceof $)return Y(K);else if(Q=U.asArray(Q),Q===null)return z("expecting an array or an iterable object but got "+U.classString(Q));var H=new $(I);if(w!==void 0)H._propagateFrom(w,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 Jw0=F((E_1,Yw0)=>{Yw0.exports=function($,I,q,z,U,Y){var J=$._getDomain,Q=d1(),w=Q.tryCatch;function K(X,L,D,O){this.constructor$(X);var P=J();if(this._fn=P===null?L:Q.domainBind(P,L),D!==void 0)D=$.resolve(D),D._attachCancellationCallback(this);if(this._initialValue=D,this._currentCancellable=null,O===U)this._eachValues=Array(this._length);else if(O===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}Q.inherits(K,I),K.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==U)this._eachValues.push(X)},K.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},K.prototype._init=function(){},K.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},K.prototype.shouldCopyValues=function(){return!1},K.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},K.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()},K.prototype._iterate=function(X){this._values=X;var L,D,O=X.length;if(this._initialValue!==void 0)L=this._initialValue,D=0;else L=$.resolve(X[0]),D=1;if(this._currentCancellable=L,!L.isRejected())for(;D<O;++D){var P={accum:null,value:X[D],index:D,length:O,array:this};L=L._then(W,void 0,void 0,P,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,D,O){return G(X,L,D,O)};function H(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function G(X,L,D,O){if(typeof L!=="function")return q("expecting a function but got "+Q.classString(L));var P=new K(X,L,D,O);return P.promise()}function W(X){this.accum=X,this.array._gotAccum(X);var L=z(this.value,this.array._promise);if(L instanceof $)return this.array._currentCancellable=L,L._then(V,void 0,void 0,this,void 0);else return V.call(this,L)}function V(X){var L=this.array,D=L._promise,O=w(L._fn);D._pushContext();var P;if(L._eachValues!==void 0)P=O.call(D._boundValue(),X,this.index,this.length);else P=O.call(D._boundValue(),this.accum,X,this.index,this.length);if(P instanceof $)L._currentCancellable=P;var T=D._popContext();return Y.checkForgottenReturns(P,T,L._eachValues!==void 0?"Promise.each":"Promise.reduce",D),P}}});var ww0=F((B_1,Qw0)=>{Qw0.exports=function($,I,q){var z=$.PromiseInspection,U=d1();function Y(J){this.constructor$(J)}U.inherits(Y,I),Y.prototype._promiseResolved=function(J,Q){this._values[J]=Q;var w=++this._totalResolved;if(w>=this._length)return this._resolve(this._values),!0;return!1},Y.prototype._promiseFulfilled=function(J,Q){var w=new z;return w._bitField=33554432,w._settledValueField=J,this._promiseResolved(Q,w)},Y.prototype._promiseRejected=function(J,Q){var w=new z;return w._bitField=16777216,w._settledValueField=J,this._promiseResolved(Q,w)},$.settle=function(J){return q.deprecated(".settle()",".reflect()"),new Y(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Hw0=F((j_1,Kw0)=>{Kw0.exports=function($,I,q){var z=d1(),U=b5().RangeError,Y=b5().AggregateError,J=z.isArray,Q={};function w(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}z.inherits(w,I),w.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()))},w.prototype.init=function(){this._initialized=!0,this._init()},w.prototype.setUnwrap=function(){this._unwrap=!0},w.prototype.howMany=function(){return this._howMany},w.prototype.setHowMany=function(H){this._howMany=H},w.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
See http://goo.gl/MqrFmX
`);var W=new w(H),V=W.promise();return W.setHowMany(G),W.init(),V}$.some=function(H,G){return K(H,G)},$.prototype.some=function(H){return K(this,H)},$._SomePromiseArray=w}});var Yw0=O((V_1,Uw0)=>{Uw0.exports=function($,I){var q=$.map;$.prototype.filter=function(z,U){return q(this,z,U,I)},$.filter=function(z,U,Y){return q(z,U,Y,I)}}});var Qw0=O((Z_1,Jw0)=>{Jw0.exports=function($,I){var{reduce:q,all:z}=$;function U(){return z(this)}function Y(J,Q){return q(J,Q,I,I)}$.prototype.each=function(J){return q(this,J,I,0)._then(U,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return q(this,J,I,I)},$.each=function(J,Q){return q(J,Q,I,0)._then(U,void 0,void 0,J,void 0)},$.mapSeries=Y}});var Kw0=O((X_1,ww0)=>{ww0.exports=function($){var I=$._SomePromiseArray;function q(z){var U=new I(z),Y=U.promise();return U.setHowMany(1),U.setUnwrap(),U.init(),Y}$.any=function(z){return q(z)},$.prototype.any=function(){return q(this)}}});var Hw0=O((L_1,YS)=>{YS.exports=function(){var $=function(){return new G(`circular promise resolution chain
`);var W=new w(H),V=W.promise();return W.setHowMany(G),W.init(),V}$.some=function(H,G){return K(H,G)},$.prototype.some=function(H){return K(this,H)},$._SomePromiseArray=w}});var Ww0=F((g_1,Gw0)=>{Gw0.exports=function($,I){var q=$.map;$.prototype.filter=function(z,U){return q(this,z,U,I)},$.filter=function(z,U,Y){return q(z,U,Y,I)}}});var Zw0=F((v_1,Vw0)=>{Vw0.exports=function($,I){var{reduce:q,all:z}=$;function U(){return z(this)}function Y(J,Q){return q(J,Q,I,I)}$.prototype.each=function(J){return q(this,J,I,0)._then(U,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return q(this,J,I,I)},$.each=function(J,Q){return q(J,Q,I,0)._then(U,void 0,void 0,J,void 0)},$.mapSeries=Y}});var Lw0=F((R_1,Xw0)=>{Xw0.exports=function($){var I=$._SomePromiseArray;function q(z){var U=new I(z),Y=U.promise();return U.setHowMany(1),U.setUnwrap(),U.init(),Y}$.any=function(z){return q(z)},$.prototype.any=function(){return q(this)}}});var Dw0=F((C_1,QS)=>{QS.exports=function(){var $=function(){return new G(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},I=function(){return new h.PromiseInspection(this._target())},q=function(j){return h.reject(new G(j))};function z(){}var U={},Y=d1(),J;if(Y.isNode)J=function(){var j=process.domain;if(j===void 0)j=null;return j};else J=function(){return null};Y.notEnumerableProp(h,"_getDomain",J);var Q=o3(),w=z20(),K=new w;Q.defineProperty(h,"_async",{value:K});var H=n5(),G=h.TypeError=H.TypeError;h.RangeError=H.RangeError;var W=h.CancellationError=H.CancellationError;h.TimeoutError=H.TimeoutError,h.OperationalError=H.OperationalError,h.RejectionError=H.OperationalError,h.AggregateError=H.AggregateError;var V=function(){},X={},L={},D=w20()(h,V),F=H20()(h,V,D,q,z),P=W20()(h),T=P.create,A=Z20()(h,P),g=A.CapturedTrace,k=L20()(h,D),S=O20()(L),f=zS(),v=Y.errorObj,p=Y.tryCatch;function b(j,x){if(typeof x!=="function")throw new G("expecting a function but got "+Y.classString(x));if(j.constructor!==h)throw new G(`the promise constructor cannot be invoked directly
`)},I=function(){return new h.PromiseInspection(this._target())},q=function(B){return h.reject(new G(B))};function z(){}var U={},Y=d1(),J;if(Y.isNode)J=function(){var B=process.domain;if(B===void 0)B=null;return B};else J=function(){return null};Y.notEnumerableProp(h,"_getDomain",J);var Q=t3(),w=H20(),K=new w;Q.defineProperty(h,"_async",{value:K});var H=b5(),G=h.TypeError=H.TypeError;h.RangeError=H.RangeError;var W=h.CancellationError=H.CancellationError;h.TimeoutError=H.TimeoutError,h.OperationalError=H.OperationalError,h.RejectionError=H.OperationalError,h.AggregateError=H.AggregateError;var V=function(){},X={},L={},D=X20()(h,V),O=D20()(h,V,D,q,z),P=F20()(h),T=P.create,A=M20()(h,P),g=A.CapturedTrace,k=P20()(h,D),S=E20()(L),f=YS(),v=Y.errorObj,p=Y.tryCatch;function i(B,x){if(typeof x!=="function")throw new G("expecting a function but got "+Y.classString(x));if(B.constructor!==h)throw new G(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function h(j){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,j!==V)b(this,j),this._resolveFromExecutor(j);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(j){var x=arguments.length;if(x>1){var c=Array(x-1),r=0,U0;for(U0=0;U0<x-1;++U0){var G0=arguments[U0];if(Y.isObject(G0))c[r++]=G0;else return q("expecting an object but got A catch statement predicate "+Y.classString(G0))}return c.length=r,j=arguments[U0],this.then(void 0,S(c,j,this))}return this.then(void 0,j)},h.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},h.prototype.then=function(j,x){if(A.warnings()&&arguments.length>0&&typeof j!=="function"&&typeof x!=="function"){var c=".then() only accepts functions but was passed: "+Y.classString(j);if(arguments.length>1)c+=", "+Y.classString(x);this._warn(c)}return this._then(j,x,void 0,void 0,void 0)},h.prototype.done=function(j,x){var c=this._then(j,x,void 0,void 0,void 0);c._setIsFinal()},h.prototype.spread=function(j){if(typeof j!=="function")return q("expecting a function but got "+Y.classString(j));return this.all()._then(j,void 0,void 0,X,void 0)},h.prototype.toJSON=function(){var j={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())j.fulfillmentValue=this.value(),j.isFulfilled=!0;else if(this.isRejected())j.rejectionReason=this.reason(),j.isRejected=!0;return j},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new F(this).promise()},h.prototype.error=function(j){return this.caught(Y.originatesFromRejection,j)},h.getNewLibraryCopy=YS.exports,h.is=function(j){return j instanceof h},h.fromNode=h.fromCallback=function(j){var x=new h(V);x._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=p(j)(f(x,c));if(r===v)x._rejectCallback(r.e,!0);if(!x._isFateSealed())x._setAsyncGuaranteed();return x},h.all=function(j){return new F(j).promise()},h.cast=function(j){var x=D(j);if(!(x instanceof h))x=new h(V),x._captureStackTrace(),x._setFulfilled(),x._rejectionHandler0=j;return x},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(j){var x=new h(V);return x._captureStackTrace(),x._rejectCallback(j,!0),x},h.setScheduler=function(j){if(typeof j!=="function")throw new G("expecting a function but got "+Y.classString(j));return K.setScheduler(j)},h.prototype._then=function(j,x,c,r,U0){var G0=U0!==void 0,A0=G0?U0:new h(V),v0=this._target(),Q1=v0._bitField;if(!G0){if(A0._propagateFrom(this,3),A0._captureStackTrace(),r===void 0&&(this._bitField&2097152)!==0)if((Q1&50397184)!==0)r=this._boundValue();else r=v0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,A0)}var k0=J();if((Q1&50397184)!==0){var I1,M0,Y0=v0._settlePromiseCtx;if((Q1&33554432)!==0)M0=v0._rejectionHandler0,I1=j;else if((Q1&16777216)!==0)M0=v0._fulfillmentHandler0,I1=x,v0._unsetRejectionIsUnhandled();else Y0=v0._settlePromiseLateCancellationObserver,M0=new W("late cancellation observer"),v0._attachExtraTrace(M0),I1=x;K.invoke(Y0,v0,{handler:k0===null?I1:typeof I1==="function"&&Y.domainBind(k0,I1),promise:A0,receiver:r,value:M0})}else v0._addCallbacks(j,x,A0,r,k0);return A0},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(j){this._bitField=this._bitField&-65536|j&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(K.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(j){var x=j===0?this._receiver0:this[j*4-4+3];if(x===U)return;else if(x===void 0&&this._isBound())return this._boundValue();return x},h.prototype._promiseAt=function(j){return this[j*4-4+2]},h.prototype._fulfillmentHandlerAt=function(j){return this[j*4-4+0]},h.prototype._rejectionHandlerAt=function(j){return this[j*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(j){var{_bit Line truncated
`)}function h(B){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,B!==V)i(this,B),this._resolveFromExecutor(B);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(B){var x=arguments.length;if(x>1){var c=Array(x-1),r=0,U0;for(U0=0;U0<x-1;++U0){var G0=arguments[U0];if(Y.isObject(G0))c[r++]=G0;else return q("expecting an object but got A catch statement predicate "+Y.classString(G0))}return c.length=r,B=arguments[U0],this.then(void 0,S(c,B,this))}return this.then(void 0,B)},h.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},h.prototype.then=function(B,x){if(A.warnings()&&arguments.length>0&&typeof B!=="function"&&typeof x!=="function"){var c=".then() only accepts functions but was passed: "+Y.classString(B);if(arguments.length>1)c+=", "+Y.classString(x);this._warn(c)}return this._then(B,x,void 0,void 0,void 0)},h.prototype.done=function(B,x){var c=this._then(B,x,void 0,void 0,void 0);c._setIsFinal()},h.prototype.spread=function(B){if(typeof B!=="function")return q("expecting a function but got "+Y.classString(B));return this.all()._then(B,void 0,void 0,X,void 0)},h.prototype.toJSON=function(){var B={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())B.fulfillmentValue=this.value(),B.isFulfilled=!0;else if(this.isRejected())B.rejectionReason=this.reason(),B.isRejected=!0;return B},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new O(this).promise()},h.prototype.error=function(B){return this.caught(Y.originatesFromRejection,B)},h.getNewLibraryCopy=QS.exports,h.is=function(B){return B instanceof h},h.fromNode=h.fromCallback=function(B){var x=new h(V);x._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=p(B)(f(x,c));if(r===v)x._rejectCallback(r.e,!0);if(!x._isFateSealed())x._setAsyncGuaranteed();return x},h.all=function(B){return new O(B).promise()},h.cast=function(B){var x=D(B);if(!(x instanceof h))x=new h(V),x._captureStackTrace(),x._setFulfilled(),x._rejectionHandler0=B;return x},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(B){var x=new h(V);return x._captureStackTrace(),x._rejectCallback(B,!0),x},h.setScheduler=function(B){if(typeof B!=="function")throw new G("expecting a function but got "+Y.classString(B));return K.setScheduler(B)},h.prototype._then=function(B,x,c,r,U0){var G0=U0!==void 0,A0=G0?U0:new h(V),v0=this._target(),Q1=v0._bitField;if(!G0){if(A0._propagateFrom(this,3),A0._captureStackTrace(),r===void 0&&(this._bitField&2097152)!==0)if((Q1&50397184)!==0)r=this._boundValue();else r=v0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,A0)}var k0=J();if((Q1&50397184)!==0){var q1,M0,Y0=v0._settlePromiseCtx;if((Q1&33554432)!==0)M0=v0._rejectionHandler0,q1=B;else if((Q1&16777216)!==0)M0=v0._fulfillmentHandler0,q1=x,v0._unsetRejectionIsUnhandled();else Y0=v0._settlePromiseLateCancellationObserver,M0=new W("late cancellation observer"),v0._attachExtraTrace(M0),q1=x;K.invoke(Y0,v0,{handler:k0===null?q1:typeof q1==="function"&&Y.domainBind(k0,q1),promise:A0,receiver:r,value:M0})}else v0._addCallbacks(B,x,A0,r,k0);return A0},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(B){this._bitField=this._bitField&-65536|B&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(K.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(B){var x=B===0?this._receiver0:this[B*4-4+3];if(x===U)return;else if(x===void 0&&this._isBound())return this._boundValue();return x},h.prototype._promiseAt=function(B){return this[B*4-4+2]},h.prototype._fulfillmentHandlerAt=function(B){return this[B*4-4+0]},h.prototype._rejectionHandlerAt=function(B){return this[B*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(B){var{_bit Line truncated
path = %s
syscall = %s
fstream_type = %s
@@ -225,26 +225,26 @@ fstream_class = %s
fstream_stack =
%s
`,I||"UNKNOWN",z.stack,z.path,z.syscall,z.fstream_type,z.fstream_path,z.fstream_unc_path,z.fstream_class,z.fstream_stack.join(`
`));else q.emit("warn",z)};L7.prototype.info=function($,I){this.emit("info",$,I)};L7.prototype.error=function($,I,q){var z=pK0($,I,this);if(q)throw z;else this.emit("error",z)};function pK0($,I,q){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||q.path,$.fstream_type=$.fstream_type||q.type,$.fstream_path=$.fstream_path||q.path,q._path!==q.path)$.fstream_unc_path=$.fstream_unc_path||q._path;if(q.linkpath)$.fstream_linkpath=$.fstream_linkpath||q.linkpath;return $.fstream_class=$.fstream_class||q.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(z){return z.replace(/^ {4}at /,"")}),$}});var e2=O((m_1,dK0)=>{dK0.exports=rY1;function rY1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],q;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var z=0,U=I.length;z<U;z++){q=I[z];var Y=$[q]||$["is"+q];if(typeof Y==="function")Y=Y.call($);if(Y)return $[q]=!0,$.type=q,q}return null}});var dS=O((l_1,mK0)=>{mK0.exports=$w;var tY1=e6(),aY1=d0(),cS=zI();aY1($w,cS);function $w($){var I=this;if(!(I instanceof $w))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);cS.call(I,$)}$w.prototype._stat=function($){var I=this;tY1.readlink(I._path,function(q,z){if(q)return I.error(q);I.linkpath=I.props.linkpath=z,I.emit("linkpath",z),cS.prototype._stat.call(I,$)})};$w.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var lS=O((o_1,rK0)=>{rK0.exports=o8;var oK0=e6(),sY1=d0(),Iw=t("path"),mS=zI(),lK0=t("assert").ok;sY1(o8,mS);function o8($){var I=this;if(!(I instanceof o8))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;mS.call(this,$)}o8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,oK0.readdir($._path,function(I,q){if(I)return $.error(I);if($.entries=q,$.emit("entries",q),$._paused)$.once("resume",z);else z();function z(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};o8.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=Iw.resolve($._path,$.entries[$._index]);lK0(I!==$._path),lK0($.entries[$._index]),$._currentEntry=I,oK0[$.props.follow?"stat":"lstat"](I,function(q,z){if(q)return $.error(q);var U=$._proxy||$;z.path=I,z.basename=Iw.basename(I),z.dirname=Iw.dirname(I);var Y=$.getChildProps.call(U,z);Y.path=I,Y.basename=Iw.basename(I),Y.dirname=Iw.dirname(I);var J=mS(Y,z);$._currentEntry=J,J.on("pause",function(K){if(!$._paused&&!J._disowned)$.pause(K)}),J.on("resume",function(K){if($._paused&&!J._disowned)$.resume(K)}),J.on("stat",function(K){if($.emit("_entryStat",J,K),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,K)});else $.emit("entryStat",J,K)}),J.on("ready",function K(){if($._paused)return J.pause($),$.once("resume",K);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var Q=!1;J.on("close",w),J.on("disown",w);function w(){if(Q)return;if(Q=!0,$.emit("childEnd",J),$.emit("entryEnd",J),$._currentEntry=null,!$._paused)$._read()}J.on("error",function(K){if(J._swallowErrors)$.warn(K),J.emit("end"),J.emit("close");else $.emit("error",K)}),["child","childEnd","warn"].forEach(function(K){J.on(K,$.emit.bind($,K))})})};o8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};o8.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}};o8.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",$)};o8.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()};o8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var oS=O((r_1,eK0)=>{eK0.exports=UI;var eY1=e6(),$J1=d0(),tK0=zI(),aK0={EOF:!0},sK0={CLOSE:!0};$J1(UI,tK0);function UI($){var I=this;if(!(I instanceof UI))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,tK0.call(I,$)}UI.prototype._getStream=function(){var $=this,I=$._stream=eY1.createReadStream($._path,$.pro Line truncated
`));else q.emit("warn",z)};O7.prototype.info=function($,I){this.emit("info",$,I)};O7.prototype.error=function($,I,q){var z=tK0($,I,this);if(q)throw z;else this.emit("error",z)};function tK0($,I,q){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||q.path,$.fstream_type=$.fstream_type||q.type,$.fstream_path=$.fstream_path||q.path,q._path!==q.path)$.fstream_unc_path=$.fstream_unc_path||q._path;if(q.linkpath)$.fstream_linkpath=$.fstream_linkpath||q.linkpath;return $.fstream_class=$.fstream_class||q.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(z){return z.replace(/^ {4}at /,"")}),$}});var qw=F((Qh1,sK0)=>{sK0.exports=JJ1;function JJ1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],q;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var z=0,U=I.length;z<U;z++){q=I[z];var Y=$[q]||$["is"+q];if(typeof Y==="function")Y=Y.call($);if(Y)return $[q]=!0,$.type=q,q}return null}});var lS=F((wh1,eK0)=>{eK0.exports=zw;var QJ1=e6(),wJ1=d0(),mS=YI();wJ1(zw,mS);function zw($){var I=this;if(!(I instanceof zw))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);mS.call(I,$)}zw.prototype._stat=function($){var I=this;QJ1.readlink(I._path,function(q,z){if(q)return I.error(q);I.linkpath=I.props.linkpath=z,I.emit("linkpath",z),mS.prototype._stat.call(I,$)})};zw.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var rS=F((Kh1,qH0)=>{qH0.exports=t8;var IH0=e6(),KJ1=d0(),Uw=t("path"),oS=YI(),$H0=t("assert").ok;KJ1(t8,oS);function t8($){var I=this;if(!(I instanceof t8))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;oS.call(this,$)}t8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,IH0.readdir($._path,function(I,q){if(I)return $.error(I);if($.entries=q,$.emit("entries",q),$._paused)$.once("resume",z);else z();function z(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};t8.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=Uw.resolve($._path,$.entries[$._index]);$H0(I!==$._path),$H0($.entries[$._index]),$._currentEntry=I,IH0[$.props.follow?"stat":"lstat"](I,function(q,z){if(q)return $.error(q);var U=$._proxy||$;z.path=I,z.basename=Uw.basename(I),z.dirname=Uw.dirname(I);var Y=$.getChildProps.call(U,z);Y.path=I,Y.basename=Uw.basename(I),Y.dirname=Uw.dirname(I);var J=oS(Y,z);$._currentEntry=J,J.on("pause",function(K){if(!$._paused&&!J._disowned)$.pause(K)}),J.on("resume",function(K){if($._paused&&!J._disowned)$.resume(K)}),J.on("stat",function(K){if($.emit("_entryStat",J,K),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,K)});else $.emit("entryStat",J,K)}),J.on("ready",function K(){if($._paused)return J.pause($),$.once("resume",K);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var Q=!1;J.on("close",w),J.on("disown",w);function w(){if(Q)return;if(Q=!0,$.emit("childEnd",J),$.emit("entryEnd",J),$._currentEntry=null,!$._paused)$._read()}J.on("error",function(K){if(J._swallowErrors)$.warn(K),J.emit("end"),J.emit("close");else $.emit("error",K)}),["child","childEnd","warn"].forEach(function(K){J.on(K,$.emit.bind($,K))})})};t8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};t8.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}};t8.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",$)};t8.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()};t8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var tS=F((Hh1,JH0)=>{JH0.exports=JI;var HJ1=e6(),GJ1=d0(),zH0=YI(),UH0={EOF:!0},YH0={CLOSE:!0};GJ1(JI,zH0);function JI($){var I=this;if(!(I instanceof JI))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,zH0.call(I,$)}JI.prototype._getStream=function(){var $=this,I=$._stream=HJ1.createReadStream($._path,$.pro Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(sK0),$._read();else $.emit("close")}),I.on("error",function(q){$.emit("error",q)}),$._read()};UI.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var q=0,z=I.length;q<z;q++){var U=I[q];if(U===aK0)$.emit("end");else if(U===sK0)$.emit("close");else $.emit("data",U);if($._paused){$._buffer=I.slice(q);return}}$._buffer.length=0}};UI.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};UI.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 qH0=O((t_1,IH0)=>{IH0.exports=SL;var IJ1=d0(),$H0=zI();IJ1(SL,$H0);function SL($){var I=this;if(!(I instanceof SL))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);$H0.call(I,$)}SL.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var tS=O((a_1,zH0)=>{zH0.exports=YI;var rS=zI(),qJ1=e2(),zJ1=d0(),UJ1=e6();zJ1(YI,rS);function YI($){var I=this;if(!(I instanceof YI))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,rS.call(I,$)}YI.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";UJ1[q](I.path,function(z,U){var Y;if(z||!U)Y="File";else Y=qJ1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(rS(I,U))})};YI.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(z){$.on(z,I.emit.bind(I,z))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var q=I._buffer;I._buffer.length=0,q.forEach(function(z){$[z[0]].apply($,z[1])})};YI.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};YI.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var zI=O((s_1,JH0)=>{JH0.exports=Z8;var YJ1=e6(),JJ1=t("stream").Stream,QJ1=d0(),aS=t("path"),sS=e2(),uL=Z8.hardLinks={},UH0=hL();QJ1(Z8,UH0);var YH0=dS();function Z8($,I){var q=this;if(!(q instanceof Z8))return new Z8($,I);if(typeof $==="string")$={path:$};var z,U;if($.type&&typeof $.type==="function")z=$.type,U=z;else z=sS($),U=Z8;if(I&&!z)z=sS(I),$[z]=!0,$.type=z;switch(z){case"Directory":U=lS();break;case"Link":case"File":U=oS();break;case"SymbolicLink":U=YH0;break;case"Socket":U=qH0();break;case null:U=tS();break}if(!(q instanceof U))return new U($);if(UH0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.readable=!0,q.writable=!1,q.type=z,q.props=$,q.depth=$.depth=$.depth||0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=aS.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=$.basename=aS.basename(q.path),q.dirname=$.dirname=aS.dirname(q.path),$.parent=$.root=null,q.size=$.size,q.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=wJ1;q._stat(I)}function wJ1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}Z8.prototype._stat=function($){var I=this,q=I.props,z=q.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else YJ1[z](I._path,U);function U(Y,J){if(Y)return I.error(Y);if(Object.keys(J).forEach(function(V){q[V]=J[V]}),I.size!==void 0&&q.size!==I.size)return I.error("incorrect size");I.size=q.size;var Q=sS(q),w=q.hardlinks!==!1;if(w&&Q!=="Directory"&&q.nlink&&q.nlink>1){var K=q.dev+":"+q.ino;if(uL[K]===I._path||!uL[K])uL[K]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=uL[K],I._stat=I._read=YH0.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,q)){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,q),V()})()}};Z8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(q){var z=$.add(q);if(z===!1)I.pause()});return JJ1.prototype.pipe.apply(this,arguments)};Z8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};Z8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};Z8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var qu=O((e_1,ZH0)=>{Z Line truncated
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(YH0),$._read();else $.emit("close")}),I.on("error",function(q){$.emit("error",q)}),$._read()};JI.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var q=0,z=I.length;q<z;q++){var U=I[q];if(U===UH0)$.emit("end");else if(U===YH0)$.emit("close");else $.emit("data",U);if($._paused){$._buffer=I.slice(q);return}}$._buffer.length=0}};JI.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};JI.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 KH0=F((Gh1,wH0)=>{wH0.exports=yL;var WJ1=d0(),QH0=YI();WJ1(yL,QH0);function yL($){var I=this;if(!(I instanceof yL))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);QH0.call(I,$)}yL.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var sS=F((Wh1,HH0)=>{HH0.exports=QI;var aS=YI(),VJ1=qw(),ZJ1=d0(),XJ1=e6();ZJ1(QI,aS);function QI($){var I=this;if(!(I instanceof QI))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,aS.call(I,$)}QI.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";XJ1[q](I.path,function(z,U){var Y;if(z||!U)Y="File";else Y=VJ1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(aS(I,U))})};QI.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(z){$.on(z,I.emit.bind(I,z))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var q=I._buffer;I._buffer.length=0,q.forEach(function(z){$[z[0]].apply($,z[1])})};QI.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};QI.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var YI=F((Vh1,VH0)=>{VH0.exports=L8;var LJ1=e6(),DJ1=t("stream").Stream,OJ1=d0(),eS=t("path"),$u=qw(),xL=L8.hardLinks={},GH0=uL();OJ1(L8,GH0);var WH0=lS();function L8($,I){var q=this;if(!(q instanceof L8))return new L8($,I);if(typeof $==="string")$={path:$};var z,U;if($.type&&typeof $.type==="function")z=$.type,U=z;else z=$u($),U=L8;if(I&&!z)z=$u(I),$[z]=!0,$.type=z;switch(z){case"Directory":U=rS();break;case"Link":case"File":U=tS();break;case"SymbolicLink":U=WH0;break;case"Socket":U=KH0();break;case null:U=sS();break}if(!(q instanceof U))return new U($);if(GH0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.readable=!0,q.writable=!1,q.type=z,q.props=$,q.depth=$.depth=$.depth||0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=eS.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=$.basename=eS.basename(q.path),q.dirname=$.dirname=eS.dirname(q.path),$.parent=$.root=null,q.size=$.size,q.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=FJ1;q._stat(I)}function FJ1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}L8.prototype._stat=function($){var I=this,q=I.props,z=q.follow?"stat":"lstat";if($)process.nextTick(U.bind(null,null,$));else LJ1[z](I._path,U);function U(Y,J){if(Y)return I.error(Y);if(Object.keys(J).forEach(function(V){q[V]=J[V]}),I.size!==void 0&&q.size!==I.size)return I.error("incorrect size");I.size=q.size;var Q=$u(q),w=q.hardlinks!==!1;if(w&&Q!=="Directory"&&q.nlink&&q.nlink>1){var K=q.dev+":"+q.ino;if(xL[K]===I._path||!xL[K])xL[K]=I._path;else Q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=xL[K],I._stat=I._read=WH0.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,q)){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,q),V()})()}};L8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(q){var z=$.add(q);if(z===!1)I.pause()});return DJ1.prototype.pipe.apply(this,arguments)};L8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};L8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};L8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Uu=F((Zh1,MH0)=>{M Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);mL.prototype._finish.call($)}});var Vu=O((Dh1,zG0)=>{zG0.exports=M7;var Wu=NU(),uJ1=e2(),yJ1=d0(),xJ1=cL(),kJ1=t("fs");yJ1(M7,Wu);function M7($){var I=this;if(!(I instanceof M7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,Wu.call(I,$)}M7.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";kJ1[q](I.path,function(z,U){var Y;if(z||!U)Y="File";else Y=uJ1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Wu(I,U))})};M7.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(z){$.on(z,I.emit.bind(I,z))}),I.emit("proxy",$);var q=I._buffer;if(q.forEach(function(z){$[z[0]].apply($,z[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};M7.prototype.add=function($){if(xJ1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};M7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};M7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var NU=O((Oh1,WG0)=>{WG0.exports=b$;var i$=e6(),fJ1=d0(),nJ1=qu(),iJ1=Qu(),Yw=t("path"),YG0=process.platform==="win32"?0:process.umask(),JG0=e2(),QG0=hL();fJ1(b$,QG0);b$.dirmode=parseInt("0777",8)&~YG0;b$.filemode=parseInt("0666",8)&~YG0;var bJ1=Ku(),pJ1=Hu(),cJ1=Gu(),dJ1=Vu();function b$($,I){var q=this;if(typeof $==="string")$={path:$};var z=JG0($),U=b$;switch(z){case"Directory":U=bJ1;break;case"File":U=cJ1;break;case"Link":case"SymbolicLink":U=pJ1;break;case null:default:U=dJ1;break}if(!(q instanceof U))return new U($);if(QG0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.type=$.type,q.props=$,q.depth=$.depth||0,q.clobber=$.clobber===!1?$.clobber:!0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=Yw.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=Yw.basename($.path),q.dirname=Yw.dirname($.path),q.linkpath=$.linkpath||null,$.parent=$.root=null,q.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);q.readable=!1,q.writable=!0,q._buffer=[],q.ready=!1,q.filter=typeof $.filter==="function"?$.filter:null,q._stat(I)}b$.prototype._create=function(){var $=this;i$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};b$.prototype._stat=function($){var I=this,q=I.props,z=q.follow?"stat":"lstat",U=I._proxy||I;if($)Y(null,$);else i$[z](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 Zu(I);I._old=Q;var w=JG0(Q);if(w!==I.type||I.type==="File"&&Q.nlink>1)return nJ1(I._path,function(K){if(K)return I.error(K);I._old=null,Zu(I)});Zu(I)}};function Zu($){iJ1(Yw.dirname($._path),b$.dirmode,function(I,q){if(I)return $.error(I);return $._madeDir=q,$._create()})}function wG0($,I,q,z,U){var Y=I.mode,J=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!i$[J])return U();if(typeof Y!=="number")return U();var Q=q.mode&parseInt("0777",8);if(Y=Y&parseInt("0777",8),Y===Q)return U();i$[J](z,Y,U)}function KG0($,I,q,z,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(q.uid===I.uid&&q.gid===I.gid)return U();var Y=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!i$[Y])return U();if(typeof I.uid!=="number")I.uid=q.uid;if(typeof I.gid!=="number")I.gid=q.gid;i$[Y](z,I.uid,I.gid,U)}function HG0($,I,q,z,U){if(!i$.utimes||process.platform==="win32")return U();var Y=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Y==="lutimes"&&!i$[Y])Y="utimes";if(!i$[Y])return U();var{atime:J,mtime:Q}=q,w=I.atime,K=I.mtime;if(w===void 0)w=J;if(K===void 0)K=Q;if(!UG0(w))w=new Date(w);if(!UG0(K))w=new Date(K);if(w.getTime()===J.getTime()&&K.getTime()===Q.getTime())return U();i$[Y](z,w,K,U)}b$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,q=null,z=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Y($._old);else{var U=$.props.follow?"stat":"lstat";i$[U]($._path,function(Q,w){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=w)})}return;function Y(Q){I+=3,wG0($,$.props,Q,$._path,J("chmod")),KG0($,$.props,Q,$._path,J("chown")),HG0($,$.props,Q,$._path,J("utimes"))}function J(Q){return function(w){if(q)return;if(w)return w.fstream_finish_call=Q,$.error(q=w);if(--I>0)return;if(z)return;if(z=!0,!$._madeDir)return K();else GG0($,$._path,K);function K(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function GG0($,I,q){var z=$._madeDir,U=Yw.dirname(I);mJ1($,U,function(Y){if(Y)return q(Y);if(U===z)return q();GG0($,U,q)})}function mJ1($,I,q){var z={};Object.keys($.props).forEach(function(Q){if(z[Q]=$.props[Q],Q==="mode"&&$.type!=="Directory")z[Q]=z[Q]|parseInt("0111",8)});var U=3,Y=null;i$.stat(I,function(Q,w){if(Q)return q(Y=Q);wG0($,z,w,I,J),KG0($,z,w,I,J),HG0($,z,w,I,J)});function J(Q){if(Y)return;if(Q)return q(Y=Q);if(--U===0)return q()}}b$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};b$.prototype.add=function(){this.error("Can't add to non-Directory type")};b$.prototype.write=function(){return!0};function lJ1($){return Object.prototype.toString.call($)}function UG0($){return typeof $==="object"&&lJ1($)==="[object Date]"}});var Fu=O((oJ1)=>{oJ1.Abstract=hL();oJ1.Reader=zI();oJ1.Writer=NU();oJ1.File={Reader:oS(),Writer:Gu()};oJ1.Dir={Reader:lS(),Writer:Ku()};oJ1.Link={Reader:dS(),Writer:Hu()};oJ1.Proxy={Reader:tS(),Writer:Vu()};oJ1.Reader.Dir=oJ1.DirReader=oJ1.Dir.Reader;oJ1.Reader.File=oJ1.FileReader=oJ1.File.Reader;oJ1.Reader.Link=oJ1.LinkReader=oJ1.Link.Reader;oJ1.Reader.Proxy=oJ1.ProxyReader=oJ1.Proxy.Reader;oJ1.Writer.Dir=oJ1.DirWriter=oJ1.Dir.Writer;oJ1.Writer.File=oJ1.FileWriter=oJ1.File.Writer;oJ1.Writer.Link=oJ1.LinkWriter=oJ1.Link.Writer;oJ1.Writer.Proxy=oJ1.ProxyWriter=oJ1.Proxy.Writer;oJ1.collect=cL()});var ZG0=O((gh1,VG0)=>{VG0.exports=qQ1;var aJ1=TL(),sJ1=Fu().Writer,Nu=t("path"),eJ1=t("stream"),$Q1=bS(),IQ1=Z7();function qQ1($){$.path=Nu.resolve(Nu.normalize($.path));var I=new aJ1($),q=new eJ1.Writable({objectMode:!0});q._write=function(U,Y,J){if(U.type=="Directory")return J();var Q=Nu.join($.path,U.path);if(Q.indexOf($.path)!=0)return J();let w=$.getWriter?$.getWriter({path:Q}):sJ1({path:Q});U.pipe(w).on("error",J).on("close",J)};var z=$Q1(I,q);return I.once("crx-header",function(U){z.crxHeader=U}),I.pipe(q).on("finish",function(){z.emit("close")}),z.promise=function(){return new IQ1(function(U,Y){z.on("close",U),z.on("error",Y)})},z}});var XG0=O((vh1,lL)=>{var k4=function($){var I=1e7,q=7,z=9007199254740992,U=W(z),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(N,M,R,y){if(typeof N>"u")return Q[0];if(typeof M<"u")return+M===10&&!R?B0(N):i6(N,M,R,y);return B0(N)}function w(N,M){this.value=N,this.sign=M,this.isSmall=!1}w.prototype=Object.create(Q.prototype);function K(N){this.value=N,this.sign=N<0,this.isSmall=!0}K.prototype=Object.create(Q.prototype);function H(N){th Line truncated
actual: `+$._bytesWritten);oL.prototype._finish.call($)}});var Xu=F((_h1,HG0)=>{HG0.exports=P7;var Zu=PU(),mJ1=qw(),lJ1=d0(),oJ1=mL(),rJ1=t("fs");lJ1(P7,Zu);function P7($){var I=this;if(!(I instanceof P7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,Zu.call(I,$)}P7.prototype._stat=function(){var $=this,I=$.props,q=I.follow?"stat":"lstat";rJ1[q](I.path,function(z,U){var Y;if(z||!U)Y="File";else Y=mJ1(U);I[Y]=!0,I.type=$.type=Y,$._old=U,$._addProxy(Zu(I,U))})};P7.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(z){$.on(z,I.emit.bind(I,z))}),I.emit("proxy",$);var q=I._buffer;if(q.forEach(function(z){$[z[0]].apply($,z[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};P7.prototype.add=function($){if(oJ1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};P7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};P7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var PU=F((hh1,FG0)=>{FG0.exports=p$;var i$=e6(),tJ1=d0(),aJ1=Uu(),sJ1=Ku(),ww=t("path"),WG0=process.platform==="win32"?0:process.umask(),VG0=qw(),ZG0=uL();tJ1(p$,ZG0);p$.dirmode=parseInt("0777",8)&~WG0;p$.filemode=parseInt("0666",8)&~WG0;var eJ1=Gu(),$Q1=Wu(),IQ1=Vu(),qQ1=Xu();function p$($,I){var q=this;if(typeof $==="string")$={path:$};var z=VG0($),U=p$;switch(z){case"Directory":U=eJ1;break;case"File":U=IQ1;break;case"Link":case"SymbolicLink":U=$Q1;break;case null:default:U=qQ1;break}if(!(q instanceof U))return new U($);if(ZG0.call(q),!$.path)q.error("Must provide a path",null,!0);if(q.type=$.type,q.props=$,q.depth=$.depth||0,q.clobber=$.clobber===!1?$.clobber:!0,q.parent=$.parent||null,q.root=$.root||$.parent&&$.parent.root||q,q._path=q.path=ww.resolve($.path),process.platform==="win32"){if(q.path=q._path=q.path.replace(/\?/g,"_"),q._path.length>=260)q._swallowErrors=!0,q._path="\\\\?\\"+q.path.replace(/\//g,"\\")}if(q.basename=ww.basename($.path),q.dirname=ww.dirname($.path),q.linkpath=$.linkpath||null,$.parent=$.root=null,q.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);q.readable=!1,q.writable=!0,q._buffer=[],q.ready=!1,q.filter=typeof $.filter==="function"?$.filter:null,q._stat(I)}p$.prototype._create=function(){var $=this;i$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};p$.prototype._stat=function($){var I=this,q=I.props,z=q.follow?"stat":"lstat",U=I._proxy||I;if($)Y(null,$);else i$[z](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 Lu(I);I._old=Q;var w=VG0(Q);if(w!==I.type||I.type==="File"&&Q.nlink>1)return aJ1(I._path,function(K){if(K)return I.error(K);I._old=null,Lu(I)});Lu(I)}};function Lu($){sJ1(ww.dirname($._path),p$.dirmode,function(I,q){if(I)return $.error(I);return $._madeDir=q,$._create()})}function XG0($,I,q,z,U){var Y=I.mode,J=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!i$[J])return U();if(typeof Y!=="number")return U();var Q=q.mode&parseInt("0777",8);if(Y=Y&parseInt("0777",8),Y===Q)return U();i$[J](z,Y,U)}function LG0($,I,q,z,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(q.uid===I.uid&&q.gid===I.gid)return U();var Y=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!i$[Y])return U();if(typeof I.uid!=="number")I.uid=q.uid;if(typeof I.gid!=="number")I.gid=q.gid;i$[Y](z,I.uid,I.gid,U)}function DG0($,I,q,z,U){if(!i$.utimes||process.platform==="win32")return U();var Y=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Y==="lutimes"&&!i$[Y])Y="utimes";if(!i$[Y])return U();var{atime:J,mtime:Q}=q,w=I.atime,K=I.mtime;if(w===void 0)w=J;if(K===void 0)K=Q;if(!GG0(w))w=new Date(w);if(!GG0(K))w=new Date(K);if(w.getTime()===J.getTime()&&K.getTime()===Q.getTime())return U();i$[Y](z,w,K,U)}p$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,q=null,z=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Y($._old);else{var U=$.props.follow?"stat":"lstat";i$[U]($._path,function(Q,w){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=w)})}return;function Y(Q){I+=3,XG0($,$.props,Q,$._path,J("chmod")),LG0($,$.props,Q,$._path,J("chown")),DG0($,$.props,Q,$._path,J("utimes"))}function J(Q){return function(w){if(q)return;if(w)return w.fstream_finish_call=Q,$.error(q=w);if(--I>0)return;if(z)return;if(z=!0,!$._madeDir)return K();else OG0($,$._path,K);function K(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function OG0($,I,q){var z=$._madeDir,U=ww.dirname(I);zQ1($,U,function(Y){if(Y)return q(Y);if(U===z)return q();OG0($,U,q)})}function zQ1($,I,q){var z={};Object.keys($.props).forEach(function(Q){if(z[Q]=$.props[Q],Q==="mode"&&$.type!=="Directory")z[Q]=z[Q]|parseInt("0111",8)});var U=3,Y=null;i$.stat(I,function(Q,w){if(Q)return q(Y=Q);XG0($,z,w,I,J),LG0($,z,w,I,J),DG0($,z,w,I,J)});function J(Q){if(Y)return;if(Q)return q(Y=Q);if(--U===0)return q()}}p$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};p$.prototype.add=function(){this.error("Can't add to non-Directory type")};p$.prototype.write=function(){return!0};function UQ1($){return Object.prototype.toString.call($)}function GG0($){return typeof $==="object"&&UQ1($)==="[object Date]"}});var Mu=F((YQ1)=>{YQ1.Abstract=uL();YQ1.Reader=YI();YQ1.Writer=PU();YQ1.File={Reader:tS(),Writer:Vu()};YQ1.Dir={Reader:rS(),Writer:Gu()};YQ1.Link={Reader:lS(),Writer:Wu()};YQ1.Proxy={Reader:sS(),Writer:Xu()};YQ1.Reader.Dir=YQ1.DirReader=YQ1.Dir.Reader;YQ1.Reader.File=YQ1.FileReader=YQ1.File.Reader;YQ1.Reader.Link=YQ1.LinkReader=YQ1.Link.Reader;YQ1.Reader.Proxy=YQ1.ProxyReader=YQ1.Proxy.Reader;YQ1.Writer.Dir=YQ1.DirWriter=YQ1.Dir.Writer;YQ1.Writer.File=YQ1.FileWriter=YQ1.File.Writer;YQ1.Writer.Link=YQ1.LinkWriter=YQ1.Link.Writer;YQ1.Writer.Proxy=YQ1.ProxyWriter=YQ1.Proxy.Writer;YQ1.collect=mL()});var MG0=F((ph1,NG0)=>{NG0.exports=VQ1;var wQ1=BL(),KQ1=Mu().Writer,Au=t("path"),HQ1=t("stream"),GQ1=cS(),WQ1=L7();function VQ1($){$.path=Au.resolve(Au.normalize($.path));var I=new wQ1($),q=new HQ1.Writable({objectMode:!0});q._write=function(U,Y,J){if(U.type=="Directory")return J();var Q=Au.join($.path,U.path);if(Q.indexOf($.path)!=0)return J();let w=$.getWriter?$.getWriter({path:Q}):KQ1({path:Q});U.pipe(w).on("error",J).on("close",J)};var z=GQ1(I,q);return I.once("crx-header",function(U){z.crxHeader=U}),I.pipe(q).on("finish",function(){z.emit("close")}),z.promise=function(){return new WQ1(function(U,Y){z.on("close",U),z.on("error",Y)})},z}});var AG0=F((ch1,rL)=>{var k4=function($){var I=1e7,q=7,z=9007199254740992,U=W(z),Y="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function Q(N,M,R,y){if(typeof N>"u")return Q[0];if(typeof M<"u")return+M===10&&!R?j0(N):b6(N,M,R,y);return j0(N)}function w(N,M){this.value=N,this.sign=M,this.isSmall=!1}w.prototype=Object.create(Q.prototype);function K(N){this.value=N,this.sign=N<0,this.isSmall=!0}K.prototype=Object.create(Q.prototype);function H(N){th Line truncated
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var i1=t("fs"),eL=t("os"),f4=t("path"),gG0=t("crypto"),r8={fs:i1.constants,os:eL.constants},_G0=/XXXXXX/,hG0=(r8.O_CREAT||r8.fs.O_CREAT)|(r8.O_EXCL||r8.fs.O_EXCL)|(r8.O_RDWR||r8.fs.O_RDWR),jQ1=eL.platform()==="win32",BQ1=r8.EBADF||r8.os.errno.EBADF,gQ1=r8.ENOENT||r8.os.errno.ENOENT,AU=[],SG0=i1.rmdirSync.bind(i1),uG0=!1;function vQ1($,I){return i1.rm($,{recursive:!0},I)}function yG0($){return i1.rmSync($,{recursive:!0})}function Eu($,I){let q=PU($,I),z=q[0],U=q[1];fQ1(z,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function w(){try{let K=kG0(J);i1.stat(K,function(H){if(!H){if(Q-- >0)return w();return U(Error("Could not get a unique tmp filename, max tries reached "+K))}U(null,K)})}catch(K){U(K)}})()})}function ju($){let I=PU($),q=I[0],z=nQ1(q),U=z.tries;do{let Y=kG0(z);try{i1.statSync(Y)}catch(J){return Y}}while(U-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function RQ1($,I){let q=PU($,I),z=q[0],U=q[1];Eu(z,function(J,Q){if(J)return U(J);i1.open(Q,hG0,z.mode||384,function(K,H){if(K)return U(K);if(z.discardDescriptor)return i1.close(H,function(W){return U(W,Q,void 0,Pu(Q,-1,z,!1))});else{let G=z.discardDescriptor||z.detachDescriptor;U(null,Q,H,Pu(Q,G?-1:H,z,!1))}})})}function CQ1($){let I=PU($),q=I[0],z=q.discardDescriptor||q.detachDescriptor,U=ju(q),Y=i1.openSync(U,hG0,q.mode||384);if(q.discardDescriptor)i1.closeSync(Y),Y=void 0;return{name:U,fd:Y,removeCallback:Pu(U,z?-1:Y,q,!0)}}function _Q1($,I){let q=PU($,I),z=q[0],U=q[1];Eu(z,function(J,Q){if(J)return U(J);i1.mkdir(Q,z.mode||448,function(K){if(K)return U(K);U(null,Q,xG0(Q,z,!1))})})}function hQ1($){let I=PU($),q=I[0],z=ju(q);return i1.mkdirSync(z,q.mode||448),{name:z,removeCallback:xG0(z,q,!0)}}function SQ1($,I){let q=function(z){if(z&&!Tu(z))return I(z);I()};if(0<=$[0])i1.close($[0],function(){i1.unlink($[1],q)});else i1.unlink($[1],q)}function uQ1($){let I=null;try{if(0<=$[0])i1.closeSync($[0])}catch(q){if(!iQ1(q)&&!Tu(q))throw q}finally{try{i1.unlinkSync($[1])}catch(q){if(!Tu(q))I=q}}if(I!==null)throw I}function Pu($,I,q,z){let U=sL(uQ1,[I,$],z),Y=sL(SQ1,[I,$],z,U);if(!q.keep)AU.unshift(U);return z?U:Y}function xG0($,I,q){let z=I.unsafeCleanup?vQ1:i1.rmdir.bind(i1),U=I.unsafeCleanup?yG0:SG0,Y=sL(U,$,q),J=sL(z,$,q,Y);if(!I.keep)AU.unshift(Y);return q?Y:J}function sL($,I,q,z){let U=!1;return function Y(J){if(!U){let Q=z||Y,w=AU.indexOf(Q);if(w>=0)AU.splice(w,1);if(U=!0,q||$===SG0||$===yG0)return $(I);else return $(I,J||function(){})}}}function yQ1(){if(!uG0)return;while(AU.length)try{AU[0]()}catch($){}}function vG0($){let I=[],q=null;try{q=gG0.randomBytes($)}catch(z){q=gG0.pseudoRandomBytes($)}for(let z=0;z<$;z++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[q[z]%62]);return I.join("")}function I$($){return typeof $>"u"}function PU($,I){if(typeof $==="function")return[{},$];if(I$($))return[{},I];let q={};for(let z of Object.getOwnPropertyNames($))q[z]=$[z];return[q,I]}function xQ1($,I,q){let z=f4.isAbsolute($)?$:f4.join(I,$);i1.stat(z,function(U){if(U)i1.realpath(f4.dirname(z),function(Y,J){if(Y)return q(Y);q(null,f4.join(J,f4.basename(z)))});else i1.realpath(z,q)})}function kQ1($,I){let q=f4.isAbsolute($)?$:f4.join(I,$);try{return i1.statSync(q),i1.realpathSync(q)}catch(z){let U=i1.realpathSync(f4.dirname(q));return f4.join(U,f4.basename(q))}}function kG0($){let I=$.tmpdir;if(!I$($.name))return f4.join(I,$.dir,$.name);if(!I$($.template))return f4.join(I,$.dir,$.template).replace(_G0,vG0(6));let q=[$.prefix?$.prefix:"tmp","-",process.pid,"-",vG0(12),$.postfix?"-"+$.postfix:""].join("");return f4.join(I,$.dir,q)}function Au($,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 fG0($){if(!I$($.name)){let I=$.name;if(f4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let q=f4.basename(I);if(q===".."||q==="."||q!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!I$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(_G0))throw Error(`Invalid template, found "${$.template}".`)}if(!I$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=I$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=I$($.prefix)?"":Au("prefix",$.prefix),$.postfix=I$($.postfix)?"":Au("postfix",$.postfix),$.template=I$($.template)?void 0:Au("template",$.template)}function RG0($,I,q,z){if(I$(I))return z(null);xQ1(I,q,function(U,Y){if(U)return z(U);let J=f4.relative(q,Y);if(J.startsWith("..")||f4.isAbsolute(J))return z(Error(`${$} option must be relative to "${q}", found "${J}".`));z(null,J)})}function CG0($,I,q){if(I$(I))return;let z=kQ1(I,q),U=f4.relative(q,z);if(U.startsWith("..")||f4.isAbsolute(U))throw ELine truncated
*/var b1=t("fs"),ID=t("os"),f4=t("path"),uG0=t("crypto"),a8={fs:b1.constants,os:ID.constants},fG0=/XXXXXX/,nG0=(a8.O_CREAT||a8.fs.O_CREAT)|(a8.O_EXCL||a8.fs.O_EXCL)|(a8.O_RDWR||a8.fs.O_RDWR),xQ1=ID.platform()==="win32",kQ1=a8.EBADF||a8.os.errno.EBADF,fQ1=a8.ENOENT||a8.os.errno.ENOENT,EU=[],bG0=b1.rmdirSync.bind(b1),iG0=!1;function nQ1($,I){return b1.rm($,{recursive:!0},I)}function pG0($){return b1.rmSync($,{recursive:!0})}function ju($,I){let q=BU($,I),z=q[0],U=q[1];tQ1(z,function(Y,J){if(Y)return U(Y);let Q=J.tries;(function w(){try{let K=dG0(J);b1.stat(K,function(H){if(!H){if(Q-- >0)return w();return U(Error("Could not get a unique tmp filename, max tries reached "+K))}U(null,K)})}catch(K){U(K)}})()})}function gu($){let I=BU($),q=I[0],z=aQ1(q),U=z.tries;do{let Y=dG0(z);try{b1.statSync(Y)}catch(J){return Y}}while(U-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function bQ1($,I){let q=BU($,I),z=q[0],U=q[1];ju(z,function(J,Q){if(J)return U(J);b1.open(Q,nG0,z.mode||384,function(K,H){if(K)return U(K);if(z.discardDescriptor)return b1.close(H,function(W){return U(W,Q,void 0,Eu(Q,-1,z,!1))});else{let G=z.discardDescriptor||z.detachDescriptor;U(null,Q,H,Eu(Q,G?-1:H,z,!1))}})})}function iQ1($){let I=BU($),q=I[0],z=q.discardDescriptor||q.detachDescriptor,U=gu(q),Y=b1.openSync(U,nG0,q.mode||384);if(q.discardDescriptor)b1.closeSync(Y),Y=void 0;return{name:U,fd:Y,removeCallback:Eu(U,z?-1:Y,q,!0)}}function pQ1($,I){let q=BU($,I),z=q[0],U=q[1];ju(z,function(J,Q){if(J)return U(J);b1.mkdir(Q,z.mode||448,function(K){if(K)return U(K);U(null,Q,cG0(Q,z,!1))})})}function cQ1($){let I=BU($),q=I[0],z=gu(q);return b1.mkdirSync(z,q.mode||448),{name:z,removeCallback:cG0(z,q,!0)}}function dQ1($,I){let q=function(z){if(z&&!Bu(z))return I(z);I()};if(0<=$[0])b1.close($[0],function(){b1.unlink($[1],q)});else b1.unlink($[1],q)}function mQ1($){let I=null;try{if(0<=$[0])b1.closeSync($[0])}catch(q){if(!sQ1(q)&&!Bu(q))throw q}finally{try{b1.unlinkSync($[1])}catch(q){if(!Bu(q))I=q}}if(I!==null)throw I}function Eu($,I,q,z){let U=$D(mQ1,[I,$],z),Y=$D(dQ1,[I,$],z,U);if(!q.keep)EU.unshift(U);return z?U:Y}function cG0($,I,q){let z=I.unsafeCleanup?nQ1:b1.rmdir.bind(b1),U=I.unsafeCleanup?pG0:bG0,Y=$D(U,$,q),J=$D(z,$,q,Y);if(!I.keep)EU.unshift(Y);return q?Y:J}function $D($,I,q,z){let U=!1;return function Y(J){if(!U){let Q=z||Y,w=EU.indexOf(Q);if(w>=0)EU.splice(w,1);if(U=!0,q||$===bG0||$===pG0)return $(I);else return $(I,J||function(){})}}}function lQ1(){if(!iG0)return;while(EU.length)try{EU[0]()}catch($){}}function yG0($){let I=[],q=null;try{q=uG0.randomBytes($)}catch(z){q=uG0.pseudoRandomBytes($)}for(let z=0;z<$;z++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[q[z]%62]);return I.join("")}function I$($){return typeof $>"u"}function BU($,I){if(typeof $==="function")return[{},$];if(I$($))return[{},I];let q={};for(let z of Object.getOwnPropertyNames($))q[z]=$[z];return[q,I]}function oQ1($,I,q){let z=f4.isAbsolute($)?$:f4.join(I,$);b1.stat(z,function(U){if(U)b1.realpath(f4.dirname(z),function(Y,J){if(Y)return q(Y);q(null,f4.join(J,f4.basename(z)))});else b1.realpath(z,q)})}function rQ1($,I){let q=f4.isAbsolute($)?$:f4.join(I,$);try{return b1.statSync(q),b1.realpathSync(q)}catch(z){let U=b1.realpathSync(f4.dirname(q));return f4.join(U,f4.basename(q))}}function dG0($){let I=$.tmpdir;if(!I$($.name))return f4.join(I,$.dir,$.name);if(!I$($.template))return f4.join(I,$.dir,$.template).replace(fG0,yG0(6));let q=[$.prefix?$.prefix:"tmp","-",process.pid,"-",yG0(12),$.postfix?"-"+$.postfix:""].join("");return f4.join(I,$.dir,q)}function Tu($,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 mG0($){if(!I$($.name)){let I=$.name;if(f4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let q=f4.basename(I);if(q===".."||q==="."||q!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!I$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(fG0))throw Error(`Invalid template, found "${$.template}".`)}if(!I$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=I$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=I$($.prefix)?"":Tu("prefix",$.prefix),$.postfix=I$($.postfix)?"":Tu("postfix",$.postfix),$.template=I$($.template)?void 0:Tu("template",$.template)}function xG0($,I,q,z){if(I$(I))return z(null);oQ1(I,q,function(U,Y){if(U)return z(U);let J=f4.relative(q,Y);if(J.startsWith("..")||f4.isAbsolute(J))return z(Error(`${$} option must be relative to "${q}", found "${J}".`));z(null,J)})}function kG0($,I,q){if(I$(I))return;let z=rQ1(I,q),U=f4.relative(q,z);if(U.startsWith("..")||f4.isAbsolute(U))throw ELine 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 MV0=O((FK1)=>{var By=o5().Buffer;FK1._dbcs=t5;var W6=-1,NV0=-2,m$=-10,k6=-1000,uU=Array(256),Ow=-1;for(Dw=0;Dw<256;Dw++)uU[Dw]=W6;var Dw;function t5($,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 q=$.table();this.decodeTables=[],this.decodeTables[0]=uU.slice(0),this.decodeTableSeq=[];for(var z=0;z<q.length;z++)this._addDecodeChunk(q[z]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var U=this.decodeTables.length;this.decodeTables.push(uU.slice(0));var Y=this.decodeTables.length;this.decodeTables.push(uU.slice(0));var J=this.decodeTables[0];for(var z=129;z<=254;z++){var Q=this.decodeTables[k6-J[z]];for(var w=48;w<=57;w++){if(Q[w]===W6)Q[w]=k6-U;else if(Q[w]>k6)throw Error("gb18030 decode tables conflict at byte 2");var K=this.decodeTables[k6-Q[w]];for(var H=129;H<=254;H++){if(K[H]===W6)K[H]=k6-Y;else if(K[H]===k6-Y)continue;else if(K[H]>k6)throw Error("gb18030 decode tables conflict at byte 3");var G=this.decodeTables[k6-K[H]];for(var W=48;W<=57;W++)if(G[W]===W6)G[W]=NV0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var z=0;z<$.encodeSkipVals.length;z++){var X=$.encodeSkipVals[z];if(typeof X==="number")V[X]=!0;else for(var w=X.from;w<=X.to;w++)V[w]=!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===W6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===W6)this.defCharSB=63}t5.prototype.encoder=ED;t5.prototype.decoder=gy;t5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var q=this.decodeTables[0];for(var z=I.length-1;z>0;z--){var U=q[I[z]];if(U==W6)q[I[z]]=k6-this.decodeTables.length,this.decodeTables.push(q=uU.slice(0));else if(U<=k6)q=this.decodeTables[k6-U];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return q};t5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),q=this._getDecodeTrieNode(I);I=I&255;for(var z=1;z<$.length;z++){var U=$[z];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)q[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 w=4095-J+2,K=[];for(var H=0;H<w;H++)K.push(U.charCodeAt(Y++));q[I++]=m$-this.decodeTableSeq.length,this.decodeTableSeq.push(K)}else q[I++]=J}else if(typeof U==="number"){var G=q[I-1]+1;for(var Y=0;Y<U;Y++)q[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
`)}var gI=($)=>(I,q,z,U)=>{let Y=z?{...z,async:!1}:{async:!1},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)throw new L8;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>j6(w,Y,X4())));throw wK(Q,U?.callee),Q}return J.value},UY=gI(p6),vI=($)=>async(I,q,z,U)=>{let Y=z?{...z,async:!0}:{async:!0},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)J=await J;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>j6(w,Y,X4())));throw wK(Q,U?.callee),Q}return J.value},YY=vI(p6),RI=($)=>(I,q,z)=>{let U=z?{...z,async:!1}:{async:!1},Y=I._zod.run({value:q,issues:[]},U);if(Y instanceof Promise)throw new L8;return Y.issues.length?{success:!1,error:new($??IY)(Y.issues.map((J)=>j6(J,U,X4())))}:{success:!0,data:Y.value}},CI=RI(p6),_I=($)=>async(I,q,z)=>{let U=z?{...z,async:!0}:{async:!0},Y=I._zod.run({value:q,issues:[]},U);if(Y instanceof Promise)Y=await Y;return Y.issues.length?{success:!1,error:new $(Y.issues.map((J)=>j6(J,U,X4())))}:{success:!0,data:Y.value}},JY=_I(p6),KK=($)=>(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return gI($)(I,q,U)},Zk=KK(p6),HK=($)=>(I,q,z)=>{return gI($)(I,q,z)},Xk=HK(p6),GK=($)=>async(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return vI($)(I,q,U)},Lk=GK(p6),WK=($)=>async(I,q,z)=>{return vI($)(I,q,z)},Dk=WK(p6),VK=($)=>(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return RI($)(I,q,U)},Ok=VK(p6),ZK=($)=>(I,q,z)=>{return RI($)(I,q,z)},Fk=ZK(p6),XK=($)=>async(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return _I($)(I,q,U)},Nk=XK(p6),LK=($)=>async(I,q,z)=>{return _I($)(I,q,z)},Mk=LK(p6);var J$={};z5(J$,{xid:()=>uO,uuid7:()=>_O0,uuid6:()=>CO0,uuid4:()=>RO0,uuid:()=>u7,uppercase:()=>JF,unicodeEmail:()=>Ak,undefined:()=>UF,ulid:()=>SO,time:()=>aO,string:()=>eO,sha512_hex:()=>eO0,sha512_base64url:()=>IF0,sha512_base64:()=>$F0,sha384_hex:()=>tO0,sha384_base64url:()=>sO0,sha384_base64:()=>aO0,sha256_hex:()=>lO0,sha256_base64url:()=>rO0,sha256_base64:()=>oO0,sha1_hex:()=>cO0,sha1_base64url:()=>mO0,sha1_base64:()=>dO0,rfc5322Email:()=>SO0,number:()=>QY,null:()=>zF,nanoid:()=>xO,md5_hex:()=>iO0,md5_base64url:()=>pO0,md5_base64:()=>bO0,mac:()=>cO,lowercase:()=>YF,ksuid:()=>yO,ipv6:()=>pO,ipv4:()=>bO,integer:()=>IF,idnEmail:()=>uO0,httpProtocol:()=>oO,html5Email:()=>hO0,hostname:()=>kO0,hex:()=>nO0,guid:()=>fO,extendedDuration:()=>vO0,emoji:()=>iO,email:()=>nO,e164:()=>rO,duration:()=>kO,domain:()=>fO0,datetime:()=>sO,date:()=>tO,cuid2:()=>hO,cuid:()=>_O,cidrv6:()=>mO,cidrv4:()=>dO,browserEmail:()=>yO0,boolean:()=>qF,bigint:()=>$F,base64url:()=>DK,base64:()=>lO});var _O=/^[cC][0-9a-z]{6,}$/,hO=/^[0-9a-z]+$/,SO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uO=/^[0-9a-vA-V]{20}$/,yO=/^[A-Za-z0-9]{27}$/,xO=/^[a-zA-Z0-9_-]{21}$/,kO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vO0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fO=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,u7=($)=>{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})$`)},RO0=u7(4),CO0=u7(6),_O0=u7(7),nO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hO0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,SO0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ak=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,uO0=Ak,yO0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,xO0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iO(){return new RegExp(xO0,"u")}var bO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pO=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,cO=($)=>{let I=E$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},dO=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line 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{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var gV0=F((RK1)=>{var vy=r5().Buffer;RK1._dbcs=a5;var W6=-1,jV0=-2,o$=-10,k6=-1000,kU=Array(256),Mw=-1;for(Nw=0;Nw<256;Nw++)kU[Nw]=W6;var Nw;function a5($,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 q=$.table();this.decodeTables=[],this.decodeTables[0]=kU.slice(0),this.decodeTableSeq=[];for(var z=0;z<q.length;z++)this._addDecodeChunk(q[z]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var U=this.decodeTables.length;this.decodeTables.push(kU.slice(0));var Y=this.decodeTables.length;this.decodeTables.push(kU.slice(0));var J=this.decodeTables[0];for(var z=129;z<=254;z++){var Q=this.decodeTables[k6-J[z]];for(var w=48;w<=57;w++){if(Q[w]===W6)Q[w]=k6-U;else if(Q[w]>k6)throw Error("gb18030 decode tables conflict at byte 2");var K=this.decodeTables[k6-Q[w]];for(var H=129;H<=254;H++){if(K[H]===W6)K[H]=k6-Y;else if(K[H]===k6-Y)continue;else if(K[H]>k6)throw Error("gb18030 decode tables conflict at byte 3");var G=this.decodeTables[k6-K[H]];for(var W=48;W<=57;W++)if(G[W]===W6)G[W]=jV0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var z=0;z<$.encodeSkipVals.length;z++){var X=$.encodeSkipVals[z];if(typeof X==="number")V[X]=!0;else for(var w=X.from;w<=X.to;w++)V[w]=!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===W6)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===W6)this.defCharSB=63}a5.prototype.encoder=jD;a5.prototype.decoder=Ry;a5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var q=this.decodeTables[0];for(var z=I.length-1;z>0;z--){var U=q[I[z]];if(U==W6)q[I[z]]=k6-this.decodeTables.length,this.decodeTables.push(q=kU.slice(0));else if(U<=k6)q=this.decodeTables[k6-U];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return q};a5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),q=this._getDecodeTrieNode(I);I=I&255;for(var z=1;z<$.length;z++){var U=$[z];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)q[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 w=4095-J+2,K=[];for(var H=0;H<w;H++)K.push(U.charCodeAt(Y++));q[I++]=o$-this.decodeTableSeq.length,this.decodeTableSeq.push(K)}else q[I++]=J}else if(typeof U==="number"){var G=q[I-1]+1;for(var Y=0;Y<U;Y++)q[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
`)}var CI=($)=>(I,q,z,U)=>{let Y=z?{...z,async:!1}:{async:!1},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)throw new O8;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>B6(w,Y,L4())));throw HK(Q,U?.callee),Q}return J.value},QY=CI(p6),_I=($)=>async(I,q,z,U)=>{let Y=z?{...z,async:!0}:{async:!0},J=I._zod.run({value:q,issues:[]},Y);if(J instanceof Promise)J=await J;if(J.issues.length){let Q=new(U?.Err??$)(J.issues.map((w)=>B6(w,Y,L4())));throw HK(Q,U?.callee),Q}return J.value},wY=_I(p6),hI=($)=>(I,q,z)=>{let U=z?{...z,async:!1}:{async:!1},Y=I._zod.run({value:q,issues:[]},U);if(Y instanceof Promise)throw new O8;return Y.issues.length?{success:!1,error:new($??UY)(Y.issues.map((J)=>B6(J,U,L4())))}:{success:!0,data:Y.value}},SI=hI(p6),uI=($)=>async(I,q,z)=>{let U=z?{...z,async:!0}:{async:!0},Y=I._zod.run({value:q,issues:[]},U);if(Y instanceof Promise)Y=await Y;return Y.issues.length?{success:!1,error:new $(Y.issues.map((J)=>B6(J,U,L4())))}:{success:!0,data:Y.value}},KY=uI(p6),GK=($)=>(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return CI($)(I,q,U)},Mk=GK(p6),WK=($)=>(I,q,z)=>{return CI($)(I,q,z)},Ak=WK(p6),VK=($)=>async(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return _I($)(I,q,U)},Pk=VK(p6),ZK=($)=>async(I,q,z)=>{return _I($)(I,q,z)},Tk=ZK(p6),XK=($)=>(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return hI($)(I,q,U)},Ek=XK(p6),LK=($)=>(I,q,z)=>{return hI($)(I,q,z)},Bk=LK(p6),DK=($)=>async(I,q,z)=>{let U=z?{...z,direction:"backward"}:{direction:"backward"};return uI($)(I,q,U)},jk=DK(p6),OK=($)=>async(I,q,z)=>{return uI($)(I,q,z)},gk=OK(p6);var J$={};U5(J$,{xid:()=>xO,uuid7:()=>pO0,uuid6:()=>iO0,uuid4:()=>bO0,uuid:()=>x7,uppercase:()=>wF,unicodeEmail:()=>vk,undefined:()=>JF,ulid:()=>yO,time:()=>eO,string:()=>IF,sha512_hex:()=>HF0,sha512_base64url:()=>WF0,sha512_base64:()=>GF0,sha384_hex:()=>QF0,sha384_base64url:()=>KF0,sha384_base64:()=>wF0,sha256_hex:()=>UF0,sha256_base64url:()=>JF0,sha256_base64:()=>YF0,sha1_hex:()=>IF0,sha1_base64url:()=>zF0,sha1_base64:()=>qF0,rfc5322Email:()=>dO0,number:()=>HY,null:()=>YF,nanoid:()=>fO,md5_hex:()=>sO0,md5_base64url:()=>$F0,md5_base64:()=>eO0,mac:()=>mO,lowercase:()=>QF,ksuid:()=>kO,ipv6:()=>dO,ipv4:()=>cO,integer:()=>zF,idnEmail:()=>mO0,httpProtocol:()=>tO,html5Email:()=>cO0,hostname:()=>rO0,hex:()=>aO0,guid:()=>bO,extendedDuration:()=>nO0,emoji:()=>pO,email:()=>iO,e164:()=>aO,duration:()=>nO,domain:()=>tO0,datetime:()=>$F,date:()=>sO,cuid2:()=>uO,cuid:()=>SO,cidrv6:()=>oO,cidrv4:()=>lO,browserEmail:()=>lO0,boolean:()=>UF,bigint:()=>qF,base64url:()=>FK,base64:()=>rO});var SO=/^[cC][0-9a-z]{6,}$/,uO=/^[0-9a-z]+$/,yO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xO=/^[0-9a-vA-V]{20}$/,kO=/^[A-Za-z0-9]{27}$/,fO=/^[a-zA-Z0-9_-]{21}$/,nO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nO0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bO=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,x7=($)=>{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})$`)},bO0=x7(4),iO0=x7(6),pO0=x7(7),iO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cO0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,dO0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,vk=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mO0=vk,lO0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oO0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function pO(){return new RegExp(oO0,"u")}var cO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dO=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,mO=($)=>{let I=B$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},lO=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line truncated
`).filter((Y)=>Y),z=Math.min(...q.map((Y)=>Y.length-Y.trimStart().length)),U=q.map((Y)=>Y.slice(z)).map((Y)=>" ".repeat(this.indent*2)+Y);for(let Y of U)this.content.push(Y)}compile(){let $=Function,I=this?.args,z=[...(this?.content??[""]).map((U)=>` ${U}`)];return new $(...I,z.join(`
`))}}var EF={major:4,minor:4,patch:3};var p0=o("$ZodType",($,I)=>{var q;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=EF;let z=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))z.unshift($);for(let U of z)for(let Y of U._zod.onattach)Y($);if(z.length===0)(q=$._zod).deferred??(q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(J,Q,w)=>{let K=Y9(J),H;for(let G of Q){if(G._zod.def.when){if(vO(J))continue;if(!G._zod.def.when(J))continue}else if(K)continue;let W=J.issues.length,V=G._zod.check(J);if(V instanceof Promise&&w?.async===!1)throw new L8;if(H||V instanceof Promise)H=(H??Promise.resolve()).then(async()=>{if(await V,J.issues.length===W)return;if(!K)K=Y9(J,W)});else{if(J.issues.length===W)continue;if(!K)K=Y9(J,W)}}if(H)return H.then(()=>{return J});return J},Y=(J,Q,w)=>{if(Y9(J))return J.aborted=!0,J;let K=U(Q,z,w);if(K instanceof Promise){if(w.async===!1)throw new L8;return K.then((H)=>$._zod.parse(H,w))}return $._zod.parse(K,w)};$._zod.run=(J,Q)=>{if(Q.skipChecks)return $._zod.parse(J,Q);if(Q.direction==="backward"){let K=$._zod.parse({value:J.value,issues:[]},{...Q,skipChecks:!0});if(K instanceof Promise)return K.then((H)=>{return Y(H,J,Q)});return Y(K,J,Q)}let w=$._zod.parse(J,Q);if(w instanceof Promise){if(Q.async===!1)throw new L8;return w.then((K)=>U(K,z,Q))}return U(w,z,Q)}}e0($,"~standard",()=>({validate:(U)=>{try{let Y=CI($,U);return Y.success?{value:Y.data}:{issues:Y.error?.issues}}catch(Y){return JY($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),y7=o("$ZodString",($,I)=>{p0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??eO($._zod.bag),$._zod.parse=(q,z)=>{if(I.coerce)try{q.value=String(q.value)}catch(U){}if(typeof q.value==="string")return q;return q.issues.push({expected:"string",code:"invalid_type",input:q.value,inst:$}),q}}),x1=o("$ZodStringFormat",($,I)=>{hI.init($,I),y7.init($,I)}),BF=o("$ZodGUID",($,I)=>{I.pattern??(I.pattern=fO),x1.init($,I)}),gF=o("$ZodUUID",($,I)=>{if(I.version){let z={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(z===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=u7(z))}else I.pattern??(I.pattern=u7());x1.init($,I)}),vF=o("$ZodEmail",($,I)=>{I.pattern??(I.pattern=nO),x1.init($,I)}),RF=o("$ZodURL",($,I)=>{x1.init($,I),$._zod.check=(q)=>{try{let z=q.value.trim();if(!I.normalize&&I.protocol?.source===oO.source){if(!/^https?:\/\//i.test(z)){q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:q.value,inst:$,continue:!I.abort});return}}let U=new URL(z);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:q.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:q.value,inst:$,continue:!I.abort})}if(I.normalize)q.value=U.href;else q.value=z;return}catch(z){q.issues.push({code:"invalid_format",format:"url",input:q.value,inst:$,continue:!I.abort})}}}),CF=o("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=iO()),x1.init($,I)}),_F=o("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=xO),x1.init($,I)}),hF=o("$ZodCUID",($,I)=>{I.pattern??(I.pattern=_O),x1.init($,I)}),SF=o("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=hO),x1.init($,I)}),uF=o("$ZodULID",($,I)=>{I.pattern??(I.pattern=SO),x1.init($,I)}),yF=o("$ZodXID",($,I)=>{I.pattern??(I.pattern=uO),x1.init($,I)}),xF=o("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=yO),x1.init($,I)}),kF=o("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=sO(I)),x1.init($,I)}),fF=o("$ZodISODate",($,I)=>{I.pattern??(I.pattern=tO),x1.init($,I)}),nF=o("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=aO(I)),x1.init($,I)}),iF=o("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=kO),x1.init($,I)}),bF=o("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=bO),x1.init($,I),$._zod.bag.format="ipv4"}),pF=o("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=pO),x1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(q)=>{try{new URL(`http://[${q.value}]`)}catch{q.issues.push({code:"invalid_format",format:"ipv6",input:q.value,inst:$,continue:!I.abort})}}}),cF=o("$ZodMAC",($,I)=>{I.pattern??(I.pattern=cO(I.delimiter)),x1.init($,I),$._zod.bag.format="mac"}),dF=o("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=dO),x1.init($,I)}),mF=o("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=mO),x1.init($,I),$._zod.check=(q)=>{let z=q.value.split("/");try{if(z.length!==2)throw Error();let[U,Y]=z;if(!Y)throw Error();let J=Number(Y);if(`${J}`!==Y)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${U}]`)}catch{q.issues.push({code:"invalid_format",format:"cidrv6",input:q.value,inst:$,continue:!I.abort})}}});function lF($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}} Line truncated
`))}}var jF={major:4,minor:4,patch:3};var p0=o("$ZodType",($,I)=>{var q;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=jF;let z=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))z.unshift($);for(let U of z)for(let Y of U._zod.onattach)Y($);if(z.length===0)(q=$._zod).deferred??(q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(J,Q,w)=>{let K=Q9(J),H;for(let G of Q){if(G._zod.def.when){if(CO(J))continue;if(!G._zod.def.when(J))continue}else if(K)continue;let W=J.issues.length,V=G._zod.check(J);if(V instanceof Promise&&w?.async===!1)throw new O8;if(H||V instanceof Promise)H=(H??Promise.resolve()).then(async()=>{if(await V,J.issues.length===W)return;if(!K)K=Q9(J,W)});else{if(J.issues.length===W)continue;if(!K)K=Q9(J,W)}}if(H)return H.then(()=>{return J});return J},Y=(J,Q,w)=>{if(Q9(J))return J.aborted=!0,J;let K=U(Q,z,w);if(K instanceof Promise){if(w.async===!1)throw new O8;return K.then((H)=>$._zod.parse(H,w))}return $._zod.parse(K,w)};$._zod.run=(J,Q)=>{if(Q.skipChecks)return $._zod.parse(J,Q);if(Q.direction==="backward"){let K=$._zod.parse({value:J.value,issues:[]},{...Q,skipChecks:!0});if(K instanceof Promise)return K.then((H)=>{return Y(H,J,Q)});return Y(K,J,Q)}let w=$._zod.parse(J,Q);if(w instanceof Promise){if(Q.async===!1)throw new O8;return w.then((K)=>U(K,z,Q))}return U(w,z,Q)}}$1($,"~standard",()=>({validate:(U)=>{try{let Y=SI($,U);return Y.success?{value:Y.data}:{issues:Y.error?.issues}}catch(Y){return KY($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),k7=o("$ZodString",($,I)=>{p0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??IF($._zod.bag),$._zod.parse=(q,z)=>{if(I.coerce)try{q.value=String(q.value)}catch(U){}if(typeof q.value==="string")return q;return q.issues.push({expected:"string",code:"invalid_type",input:q.value,inst:$}),q}}),x1=o("$ZodStringFormat",($,I)=>{yI.init($,I),k7.init($,I)}),vF=o("$ZodGUID",($,I)=>{I.pattern??(I.pattern=bO),x1.init($,I)}),RF=o("$ZodUUID",($,I)=>{if(I.version){let z={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(z===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=x7(z))}else I.pattern??(I.pattern=x7());x1.init($,I)}),CF=o("$ZodEmail",($,I)=>{I.pattern??(I.pattern=iO),x1.init($,I)}),_F=o("$ZodURL",($,I)=>{x1.init($,I),$._zod.check=(q)=>{try{let z=q.value.trim();if(!I.normalize&&I.protocol?.source===tO.source){if(!/^https?:\/\//i.test(z)){q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:q.value,inst:$,continue:!I.abort});return}}let U=new URL(z);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(U.hostname))q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:q.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:q.value,inst:$,continue:!I.abort})}if(I.normalize)q.value=U.href;else q.value=z;return}catch(z){q.issues.push({code:"invalid_format",format:"url",input:q.value,inst:$,continue:!I.abort})}}}),hF=o("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=pO()),x1.init($,I)}),SF=o("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=fO),x1.init($,I)}),uF=o("$ZodCUID",($,I)=>{I.pattern??(I.pattern=SO),x1.init($,I)}),yF=o("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=uO),x1.init($,I)}),xF=o("$ZodULID",($,I)=>{I.pattern??(I.pattern=yO),x1.init($,I)}),kF=o("$ZodXID",($,I)=>{I.pattern??(I.pattern=xO),x1.init($,I)}),fF=o("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=kO),x1.init($,I)}),nF=o("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=$F(I)),x1.init($,I)}),bF=o("$ZodISODate",($,I)=>{I.pattern??(I.pattern=sO),x1.init($,I)}),iF=o("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=eO(I)),x1.init($,I)}),pF=o("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=nO),x1.init($,I)}),cF=o("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=cO),x1.init($,I),$._zod.bag.format="ipv4"}),dF=o("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=dO),x1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(q)=>{try{new URL(`http://[${q.value}]`)}catch{q.issues.push({code:"invalid_format",format:"ipv6",input:q.value,inst:$,continue:!I.abort})}}}),mF=o("$ZodMAC",($,I)=>{I.pattern??(I.pattern=mO(I.delimiter)),x1.init($,I),$._zod.bag.format="mac"}),lF=o("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=lO),x1.init($,I)}),oF=o("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=oO),x1.init($,I),$._zod.check=(q)=>{let z=q.value.split("/");try{if(z.length!==2)throw Error();let[U,Y]=z;if(!Y)throw Error();let J=Number(Y);if(`${J}`!==Y)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${U}]`)}catch{q.issues.push({code:"invalid_format",format:"cidrv6",input:q.value,inst:$,continue:!I.abort})}}});function rF($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}} Line truncated
if (${A}.issues.length) {
if (${g} in input) {
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
@@ -303,38 +303,38 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};b$.prototype._stat=function
newResult[${g}] = ${A}.value;
}
`)}V.write("payload.value = newResult;"),V.write("return payload;");let P=V.compile();return(T,A)=>P(W,T,A)},Y,J=S7,Q=!_7.jitless,K=Q&&PO.value,H=I.catchall,G;$._zod.parse=(W,V)=>{G??(G=z.value);let X=W.value;if(!J(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(Q&&K&&V?.async===!1&&V.jitless!==!0){if(!Y)Y=U(I.shape);if(W=Y(W,V),!H)return W;return dk([],X,W,V,G,$)}return q(W,V)}});function vk($,I,q,z){for(let Y of $)if(Y.issues.length===0)return I.value=Y.value,I;let U=$.filter((Y)=>!Y9(Y));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((Y)=>Y.issues.map((J)=>j6(J,z,X4())))}),I}var GY=o("$ZodUnion",($,I)=>{p0.init($,I),e0($._zod,"optin",()=>I.options.some((z)=>z._zod.optin==="optional")?"optional":void 0),e0($._zod,"optout",()=>I.options.some((z)=>z._zod.optout==="optional")?"optional":void 0),e0($._zod,"values",()=>{if(I.options.every((z)=>z._zod.values))return new Set(I.options.flatMap((z)=>Array.from(z._zod.values)));return}),e0($._zod,"pattern",()=>{if(I.options.every((z)=>z._zod.pattern)){let z=I.options.map((U)=>U._zod.pattern);return new RegExp(`^(${z.map((U)=>aU(U.source)).join("|")})$`)}return});let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(z,U)=>{if(q)return q(z,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:z.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else{if(w.issues.length===0)return w;J.push(w)}}if(!Y)return vk(J,z,$,U);return Promise.all(J).then((Q)=>{return vk(Q,z,$,U)})}});function Rk($,I,q,z){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:q,errors:$.map((Y)=>Y.issues.map((J)=>j6(J,z,X4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:[],inclusive:!1});return I}var GN=o("$ZodXor",($,I)=>{GY.init($,I),I.inclusive=!1;let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(z,U)=>{if(q)return q(z,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:z.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else J.push(w)}if(!Y)return Rk(J,z,$,U);return Promise.all(J).then((Q)=>{return Rk(Q,z,$,U)})}}),WN=o("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,GY.init($,I);let q=$._zod.parse;e0($._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,w]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let K of w)U[Q].add(K)}}return U});let z=jI(()=>{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 w of Q){if(Y.has(w))throw Error(`Duplicate discriminator value "${String(w)}"`);Y.set(w,J)}}return Y});$._zod.parse=(U,Y)=>{let J=U.value;if(!S7(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let Q=z.value.get(J?.[I.discriminator]);if(Q)return Q._zod.run(U,Y);if(I.unionFallback||Y.direction==="backward")return q(U,Y);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(z.value.keys()),input:J,path:[I.discriminator],inst:$}),U}}),VN=o("$ZodIntersection",($,I)=>{p0.init($,I),$._zod.parse=(q,z)=>{let U=q.value,Y=I.left._zod.run({value:U,issues:[]},z),J=I.right._zod.run({value:U,issues:[]},z);if(Y instanceof Promise||J instanceof Promise)return Promise.all([Y,J]).then(([w,K])=>{return Ck(q,w,K)});return Ck(q,Y,J)}});function jF($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(U9($)&&U9(I)){let q=Object.keys(I),z=Object.keys($).filter((Y)=>q.indexOf(Y)!==-1),U={...$,...I};for(let Y of z){let J=jF($[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 q=[];for(let z=0;z<$.length;z++){let U=$[z],Y=I[z],J=jF(U,Y);if(!J.valid)return{valid:!1,mergeErrorPath:[z,...J.mergeErrorPath]};q.push(J.data)}return{valid:!0,data:q}}return{valid:!1,mergeErrorPath:[]}}function Ck($,I,q){let z=new Map,U;for(let Q of I.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let w of Q.keys){if(!z.has(w))z.set(w,{});z.get(w).l=!0}}else $.issues.push(Q);for(let Q of q.issues)if(Q.code==="unrecognized_keys")for(let w of Q.keys){if(!z.has(w))z.set(w,{});z.get(w).r=!0}else $.issues.push(Q);let Y=[...z].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(Y.length&&U)$.issues.push({...U,keys:Y});if(Y9($))return $;let J=jF(I.value,q.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var BK=o("$ZodTuple",($,I)=>{p0. Line truncated
`)}V.write("payload.value = newResult;"),V.write("return payload;");let P=V.compile();return(T,A)=>P(W,T,A)},Y,J=y7,Q=!S7.jitless,K=Q&&EO.value,H=I.catchall,G;$._zod.parse=(W,V)=>{G??(G=z.value);let X=W.value;if(!J(X))return W.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),W;if(Q&&K&&V?.async===!1&&V.jitless!==!0){if(!Y)Y=U(I.shape);if(W=Y(W,V),!H)return W;return sk([],X,W,V,G,$)}return q(W,V)}});function yk($,I,q,z){for(let Y of $)if(Y.issues.length===0)return I.value=Y.value,I;let U=$.filter((Y)=>!Q9(Y));if(U.length===1)return I.value=U[0].value,U[0];return I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:$.map((Y)=>Y.issues.map((J)=>B6(J,z,L4())))}),I}var ZY=o("$ZodUnion",($,I)=>{p0.init($,I),$1($._zod,"optin",()=>I.options.some((z)=>z._zod.optin==="optional")?"optional":void 0),$1($._zod,"optout",()=>I.options.some((z)=>z._zod.optout==="optional")?"optional":void 0),$1($._zod,"values",()=>{if(I.options.every((z)=>z._zod.values))return new Set(I.options.flatMap((z)=>Array.from(z._zod.values)));return}),$1($._zod,"pattern",()=>{if(I.options.every((z)=>z._zod.pattern)){let z=I.options.map((U)=>U._zod.pattern);return new RegExp(`^(${z.map((U)=>$Y(U.source)).join("|")})$`)}return});let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(z,U)=>{if(q)return q(z,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:z.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else{if(w.issues.length===0)return w;J.push(w)}}if(!Y)return yk(J,z,$,U);return Promise.all(J).then((Q)=>{return yk(Q,z,$,U)})}});function xk($,I,q,z){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:q,errors:$.map((Y)=>Y.issues.map((J)=>B6(J,z,L4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:q,errors:[],inclusive:!1});return I}var VN=o("$ZodXor",($,I)=>{ZY.init($,I),I.inclusive=!1;let q=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(z,U)=>{if(q)return q(z,U);let Y=!1,J=[];for(let Q of I.options){let w=Q._zod.run({value:z.value,issues:[]},U);if(w instanceof Promise)J.push(w),Y=!0;else J.push(w)}if(!Y)return xk(J,z,$,U);return Promise.all(J).then((Q)=>{return xk(Q,z,$,U)})}}),ZN=o("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,ZY.init($,I);let q=$._zod.parse;$1($._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,w]of Object.entries(J)){if(!U[Q])U[Q]=new Set;for(let K of w)U[Q].add(K)}}return U});let z=vI(()=>{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 w of Q){if(Y.has(w))throw Error(`Duplicate discriminator value "${String(w)}"`);Y.set(w,J)}}return Y});$._zod.parse=(U,Y)=>{let J=U.value;if(!y7(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let Q=z.value.get(J?.[I.discriminator]);if(Q)return Q._zod.run(U,Y);if(I.unionFallback||Y.direction==="backward")return q(U,Y);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(z.value.keys()),input:J,path:[I.discriminator],inst:$}),U}}),XN=o("$ZodIntersection",($,I)=>{p0.init($,I),$._zod.parse=(q,z)=>{let U=q.value,Y=I.left._zod.run({value:U,issues:[]},z),J=I.right._zod.run({value:U,issues:[]},z);if(Y instanceof Promise||J instanceof Promise)return Promise.all([Y,J]).then(([w,K])=>{return kk(q,w,K)});return kk(q,Y,J)}});function gF($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(J9($)&&J9(I)){let q=Object.keys(I),z=Object.keys($).filter((Y)=>q.indexOf(Y)!==-1),U={...$,...I};for(let Y of z){let J=gF($[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 q=[];for(let z=0;z<$.length;z++){let U=$[z],Y=I[z],J=gF(U,Y);if(!J.valid)return{valid:!1,mergeErrorPath:[z,...J.mergeErrorPath]};q.push(J.data)}return{valid:!0,data:q}}return{valid:!1,mergeErrorPath:[]}}function kk($,I,q){let z=new Map,U;for(let Q of I.issues)if(Q.code==="unrecognized_keys"){U??(U=Q);for(let w of Q.keys){if(!z.has(w))z.set(w,{});z.get(w).l=!0}}else $.issues.push(Q);for(let Q of q.issues)if(Q.code==="unrecognized_keys")for(let w of Q.keys){if(!z.has(w))z.set(w,{});z.get(w).r=!0}else $.issues.push(Q);let Y=[...z].filter(([,Q])=>Q.l&&Q.r).map(([Q])=>Q);if(Y.length&&U)$.issues.push({...U,keys:Y});if(Q9($))return $;let J=gF(I.value,q.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var vK=o("$ZodTuple",($,I)=>{p0. 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 K=$.external.registry.get(J[0])?.id;if(I!==J[0]&&K){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 H9($,I){let q=$.seen.get(I);if(!q)throw Error("Unprocessed schema. This is a bug in Zod.");let z=(Q)=>{let w=$.seen.get(Q);if(w.ref===null)return;let K=w.def??w.schema,H={...K},G=w.ref;if(w.ref=null,G){z(G);let V=$.seen.get(G),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))K.allOf=K.allOf??[],K.allOf.push(X);else Object.assign(K,X);if(Object.assign(K,H),Q._zod.parent===G)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(!(D in H))delete K[D]}if(X.$ref&&V.def)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(D in V.def&&JSON.stringify(K[D])===JSON.stringify(V.def[D]))delete K[D]}}let W=Q._zod.parent;if(W&&W!==G){z(W);let V=$.seen.get(W);if(V?.schema.$ref){if(K.$ref=V.schema.$ref,V.def)for(let X in K){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(K[X])===JSON.stringify(V.def[X]))delete K[X]}}}$.override({zodSchema:Q,jsonSchema:K,path:w.path??[]})};for(let Q of[...$.seen.entries()].reverse())z(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,q.def??q.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 w=Q[1];if(w.def&&w.defId){if(w.def.id===w.defId)delete w.def.id;J[w.defId]=w.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:oI(I,"input",$.processors),output:oI(I,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function g6($,I){let q=I??{seen:new Set};if(q.seen.has($))return!1;q.seen.add($);let z=$._zod.def;if(z.type==="transform")return!0;if(z.type==="array")return g6(z.element,q);if(z.type==="set")return g6(z.valueType,q);if(z.type==="lazy")return g6(z.getter(),q);if(z.type==="promise"||z.type==="optional"||z.type==="nonoptional"||z.type==="nullable"||z.type==="readonly"||z.type==="default"||z.type==="prefault")return g6(z.innerType,q);if(z.type==="intersection")return g6(z.left,q)||g6(z.right,q);if(z.type==="record"||z.type==="map")return g6(z.keyType,q)||g6(z.valueType,q);if(z.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return g6(z.in,q)||g6(z.out,q)}if(z.type==="object"){for(let U in z.shape)if(g6(z.shape[U],q))return!0;return!1}if(z.type==="union"){for(let U of z.options)if(g6(U,q))return!0;return!1}if(z.type==="tuple"){for(let U of z.items)if(g6(U,q))return!0;if(z.rest&&g6(z.rest,q))return!0;return!1}return!1}var FA=($,I={})=>(q)=>{let z=w9({...q,processors:I});return h1($,z),K9(z,$),H9(z,$)},oI=($,I,q={})=>(z)=>{let{libraryOptions:U,target:Y}=z??{},J=w9({...U??{},target:Y,io:I,processors:q});return h1($,J),K9(J,$),H9(J,$)};var PN0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},NA=($,I,q,z)=>{let U=q;U.type="string";let{minimum:Y,maximum:J,format:Q,patterns:w,contentEncoding:K}=$._zod.bag;if(typeof Y==="number")U.minLength=Y;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=PN0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(K)U.contentEncoding=K;if(w&&w.size>0){let H=[...w];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}))]}},MA=($,I,q,z)=>{let U=q,{minimum:Y,maximum:J,format:Q,multipleOf:w,exclusiveMaximum:K,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 K==="number"&&K<=(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.exclusiveMinimum=H;else if(typeof Y==="number")U.minimum=Y;if(W)if(V)U.maximum=K,U.exclusiveMaximum=!0;else U.exclusiveMaximum=K;else if(typeof J==="number")U.maximum=J;if(typeof w==="number")U.multipleOf=w},AA=($,I,q,z)=>{q.type="boolean"},PA=($,I,q,z)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},TA=($,I,q,z)=>{if(I.unrepresentable==Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),dR0(I)}clear(){this._buffer=void 0}}function dR0($){return Pn.parse(JSON.parse($))}function Nd($){return JSON.stringify($)+`
`}class xE{constructor($=Md.stdin,I=Md.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new yE,this._started=!1,this._ondata=(q)=>{this._readBuffer.append(q),this.processReadBuffer()},this._onerror=(q)=>{this.onerror?.(q)}}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 q=Nd($);if(this._stdout.write(q))I();else this._stdout.once("drain",I)})}}import{dirname as Tx,join as FW1}from"node:path";import{fileURLToPath as NW1}from"node:url";class W5 extends Error{name="KyError";get isKyError(){return!0}}class K$ extends W5{name="HTTPError";response;request;options;data;constructor($,I,q){let z=$.status||$.status===0?$.status:"",U=$.statusText??"",Y=`${z} ${U}`.trim(),J=Y?`status code ${Y}`:"an unknown error";super(`Request failed with ${J}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=q}}class XJ extends W5{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class LJ extends Error{name="NonError";value;constructor($){let I="Non-error value was thrown";try{if(typeof $==="string")I=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")I=$.message}catch{}super(I);this.value=$}}class Mq extends W5{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new LJ($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",I?{cause:I}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}class kE extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class I8 extends W5{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var fE=(()=>{let $=!1,I=!1,q=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(q&&z)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(U){if(U instanceof Error&&U.message==="unsupported BodyInit type")return!1;throw U}return $&&!I})(),Ad=typeof globalThis.AbortController==="function",hG=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Pd=typeof globalThis.ReadableStream==="function",Td=typeof globalThis.FormData==="function",SG=["get","post","put","patch","head","delete"],mR0=()=>{return};mR0();var Ed={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Aq=2147483647,jd=40,uG=Symbol("stop");class yG{options;constructor($){this.options=$}}var Bd=($)=>new yG($),gd={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},vd={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var xG=new TextEncoder,lR0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[q,z]of $)I+=jd,I+=xG.encode(`Content-Disposition: form-data; name="${q}"`).byteLength,I+=typeof z==="string"?xG.encode(z).byteLength:z.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return xG.encode($).byteLength;if($ instanceof URLSearchParams)return xG.encode($.toString()).byteLength;return 0},Rd=($,I,q)=>{let z,U=0;return $.pipeThrough(new TransformStream({transform(Y,J){if(J.enqueue(Y),z){U+=z.byteLength;let Q=I===0?0:U/I;if(Q>=1)Q=1-Number.EPSILON;q?.({percent:Q,totalBytes:Math.max(I,U),transferredBytes:U},z)}z=Y},flush(){if(z)U+=z.byteLength,q?.({percent:1,totalBytes:Math.max(I,U),transferredBytes:U},z)}}))},Cd=($,I)=>{if(!$.body)return $;let q={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,q);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(Rd($.body,z,I),q)},_d=($,I,q)=>{if(!$.body)return $;let z=lR0(q??$.body);return new Request($,{duplex:"half",body:Rd($.body,z,I)})};var P8=($)=>$!==null&&typeof $==="object";var oR0=Symbol("replaceOption"),nE=($)=>P8($)&&$[oR0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var OJ=(...$)=>{for(let I of $)if( Line truncated
`,{mode:384}),I}function xu($){let I=TW0();for(let q of I){if(!F$(q))continue;for(let z of JD(q).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=t8(q,z);try{let Y=wD(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function P7($,I){let q=xu($);if(!q)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(wD(q,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=Su.parse(U);return OW0(q,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}function jU($,I,q=[]){let z=I.corpId?.trim()||void 0,U=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,Y=z??U;if(Y){let Q=$.find((H)=>H.id===Y);if(Q)return Q;let w=$.find((H)=>H.id.toLowerCase()===Y.toLowerCase());if(w)return w;let K=$.find((H)=>H.name.toLowerCase()===Y.toLowerCase());if(K)return K;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: "+(q.length?q.join(", "):"the configured enterprise directories"))}import{readFileSync as YH1}from"node:fs";import{randomBytes as JH1}from"node:crypto";var BW0=300000,EW0=new Map;function i21($,I){return $.map((q)=>q.trim()).filter(Boolean).map((q)=>I?q:q.toLowerCase())}function b21($,I){return I?$:$.toLowerCase()}function p21($,I,q,z){let U=b21($,z),Y=I.filter((J)=>U.includes(J));if(q==="all"&&Y.length!==I.length)return[];return Y}function c21($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function d21($,I){if(I.fields&&!I.fields.has($.field))return[];let q=c21($.value),z=[];return q.forEach((U,Y)=>{let J=p21(U,I.keywords,I.matchMode,I.caseSensitive);if(J.length===0)return;let Q=Math.max(0,Y-I.contextLines),w=Math.min(q.length,Y+I.contextLines+1),K={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Y+1,matchedKeywords:J,matchedText:HD(U,I.maxChars),context:{before:I.snippetOnly?[]:q.slice(Q,Y).map((H)=>HD(H,I.maxChars)),line:HD(U,I.maxChars),after:I.snippetOnly?[]:q.slice(Y+1,w).map((H)=>HD(H,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)K.context={before:[],line:K.context.line,after:[]};z.push(K)}),z}function HD($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function m21($){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 jW0($){return $.rules.flatMap((I,q)=>{let z=`${$.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:q};return[{area:"rules",entityType:"rule",entityId:z,title:`${$.versionName} / ${I.scope}`,field:"history.description",value:I.description,metadata:U},{area:"rules",entityType:"rule",entityId:z,title:`${$.versionName} / ${I.scope}`,field:"history.scope",value:I.scope,metadata:U}]})}function l21($){return[{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"title",value:$.title,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"purpose",value:$.purpose,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"content",value:$.content,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}}]}function o21($){let I=[];if($.decisionPreferences)for(let[q,z]of Object.entries($.decisionPreferences))I.push({area:"preferences",entityType:"preference",field:`decisionPreferences.${q}`,value:z,metadata:{integrationSystem:$.integrationSystem}});return $.integrations.forEach((q,z)=>{I.push({area:"preferences",entityType:"integration",title:q.outboundName,field:`integrations[${z}]`,value:q,metadata:{type:q.type,outboundName:q.outboundName,mode:q.mode,corporationId:q.corporationId}})}),I}async function r21($,I,q){let z=q.ruleVersionScope??"current",U=[I.id,`ruleVersionScope=${z}`,`ruleVersionId=${q.ruleVersionId??""}`,`ruleVersionNumber=${q.ruleVersionNumber??""}`,`latestRuleVersion=${q.latestRuleVersion??!1}`,`documentLimit=${q.documentLimit??100}`].join("|"),Y=EW0.get(U);if(!q.refresh&&Y&&Date.now()<Y.expiresAt)return Y;let[J,Q,w]=await Promise.all([t21($,{scope:z,versionId:q.ruleVersionId,versionNumber:q.ruleVersionNumber,latest:q.latestRuleVersion}),T9($,{limit:q.documentLimit??100}),M1($,I.seal.endpoints.approvalStylePreferences)]),K=Date.now(),H={entries:[...J,...Q.articles.flatMap(l21),...o21(w)],fetchedAt:K,expiresAt:K+BW0};return EW0.set(U,H),H}async function t21($,I){if(I.scope==="current")return(await _6($)).rules.flatMap(m21);if(I.scope==="version"){let z=await a21($,I);return jW0(z)}return(await R$($)).flatMap(jW0)}async function a21($,I){if(I.versionId)return vJ($,I.versionId);let q=await R$($),z=I.versionNumber?q.find((U)=>U.versionNumber===I.versionNumber):q[0];if(!z)throw Error(I.versionNumber?`Rule version not found: ${I.versionNumber}`:"No rule versions found");return z}async func Line truncated
`,"utf8"),q}function SW0($){return $.map((I,q)=>{let z;if(typeof I.code==="number")z=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")z=I.code.startsWith("#")?I.code:`#${I.code}`;else z=`#${String(q+1).padStart(4,"0")}`;return{id:I.id,code:z,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}class p$ extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((q)=>`- ${q}`)].join(`
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}import{createHmac as Vw1,randomBytes as Zw1}from"node:crypto";function Xw1($,I,q,z){return Vw1("sha256",z).update(`${$}.${I}.${JSON.stringify(q)}`).digest("hex")}function Zw($,I){let q=Math.floor(Date.now()/1000),z=Zw1(16).toString("hex");return{Authorization:`Bearer ${I}`,"x-webhook-signature":Xw1(q,z,$,I),"x-webhook-timestamp":String(q),"x-webhook-nonce":z}}var hy=TI($V0(),1),pV0=TI(bV0(),1);var vD={maxEntries:1000,maxTotalSize:524288000,maxCompressionRatio:150};async function cV0($){return new Promise((I,q)=>{hy.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(z,U)=>{if(z||!U)return q(z??Error("无法打开 ZIP"));let Y=[];U.readEntry(),U.on("entry",(J)=>{let Q=dV0(J);if(!Q.endsWith("/")&&!cK1(Q))Y.push({fileName:Q,uncompressedSize:J.uncompressedSize,compressedSize:J.compressedSize,raw:J});U.readEntry()}),U.on("end",()=>I(Y)),U.on("error",q)})})}function dV0($){let I=Buffer.isBuffer($.fileName)?$.fileName:Buffer.from(String($.fileName),"binary"),q=I.toString("utf8");if(!q.includes("�"))return q;let z=pV0.default.decode(I,"gbk");if(!z.includes("�"))return z;return q}function cK1($){let I=$.split("/").pop()??"";return $.split("/").includes("__MACOSX")||I===".DS_Store"||I.startsWith("._")||I.startsWith(".~")||I.startsWith("~$")}function mV0($,I){let q=[],z=gq(I);if($.length>vD.maxEntries)q.push(`文件数超过 ${vD.maxEntries}`);if($.reduce((J,Q)=>J+Q.uncompressedSize,0)>vD.maxTotalSize)q.push("解压后总大小超过 500MB");for(let J of $){if(J.fileName.startsWith("/")||J.fileName.split("/").includes(".."))q.push(`存在不安全路径: ${J.fileName}`);if(J.compressedSize>0&&J.uncompressedSize/J.compressedSize>vD.maxCompressionRatio)q.push(`压缩比超过 150: ${J.fileName}`);if(J.fileName==="信息表.xlsx")continue;dK1(J,z,q)}if(!$.find((J)=>J.fileName==="信息表.xlsx"))q.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");if($.some((J)=>J.fileName.toLowerCase().endsWith(".zip")))q.push("不允许嵌套 ZIP");if(q.length)throw new p$(q)}function dK1($,I,q){let z=mK1($.fileName);if(!z||!I.allowedExtensions.includes(z))q.push(`附件后缀不在白名单中: ${$.fileName}(允许: ${I.allowedExtensions.join(", ")})`);if($.uncompressedSize<I.minFileSizeBytes)q.push(`附件文件过小: ${$.fileName}(${$.uncompressedSize} B,小于最小值 ${I.minFileSizeBytes} B)`);if(I.maxFileSizeBytes!==void 0&&I.maxFileSizeBytes!==null&&$.uncompressedSize>I.maxFileSizeBytes)q.push(`附件文件过大: ${$.fileName}(${$.uncompressedSize} B,大于最大值 ${I.maxFileSizeBytes} B)`)}function mK1($){let I=$.split("/").pop()??$,q=I.lastIndexOf(".");return q>0?I.slice(q).toLowerCase():""}function Sy($,I){return new Promise((q,z)=>{hy.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(U,Y)=>{if(U||!Y)return z(U??Error("无法打开 ZIP"));Y.readEntry(),Y.on("entry",(J)=>{if(dV0(J)!==I.fileName)return Y.readEntry();Y.openReadStream(J,(Q,w)=>{if(Q||!w)return z(Q??Error(`无法读取 ${I.fileName}`));let K=[];w.on("data",(H)=>K.push(H)),w.on("end",()=>q(Buffer.concat(K))),w.on("error",z)})}),Y.on("error",z)})})}var oV0=TI(vu(),1);function lK1($){return $.startsWith("[附件]")}function rV0($){return $.startsWith("[附件]")?$.slice(4):$}function oK1($){return rV0($).toLowerCase().replace(/\s+/g,"_")||"attachment"}function rK1($){if($==null||$==="")return[];return String($).split(/[\n,;,;]/).map((I)=>I.trim()).filter(Boolean)}function uy($,I){let q=[];for(let[z,U]of I.entries()){if(!lK1(z))continue;let Y=$.getCell(U).value,J=rK1(Y);if(!J.length)continue;q.push({key:oK1(z),label:rV0(z),paths:J})}return q}function yy($){let I=new Map;return $.map((q)=>{let z=(I.get(q.key)??0)+1;return I.set(q.key,z),z===1?q:{...q,key:`${q.key}-${z}`}})}function RD($,I,q,z){return{key:$,label:I,type:q,value:z}}function tV0($,I,q){return RD($,I,"TEXT",q==null?"":String(q))}function aV0($,I,q){return RD($,I,"AMOUNT",typeof q==="number"?{amount:q,currency:"CNY"}:null)}function sV0($){if($ instanceof Date)return $.toISOString();if(typeof $==="string"&&$.trim())return $.trim();return null}function tK1($){if($ instanceof Date)return Math.floor($.getTime()/1000);if(typeof $==="string"&&$.trim()){let I=Date.parse($.trim().replace(" ","T"));if(Number.isFinite(I))return Math.floor(I/1000)}return null}function Aw($){let I=new Map;return $.getRow(1).eachCell((q,z)=>I.set(String(q.value??"").trim(),z)),I}function VI($,I,q){let z=I.get(q);return z?$.getCell(z).value:void 0}function aK1($,I){return[["会议编号","meeting_id","TEXT"],["会议名称","meeting_name","TEXT"],["状态","status","TEXT"],["总金额","total_amount","AMOUNT"],["税前劳务总额","pretax_labor_total","AMOUNT"],["报销事由","reimbursement_reason","TEXT"],["po码","po_code","TEXT"],["快递单号","tracking_number","TEXT"],["申请日期","application_date","DATE"],["更新日期","updated_date","DATE"] Line truncated
`);let F=new FormData,P=await Sy(z.fileBuffer,D),T=L.split("/").pop()??L;F.append("files",new File([new Uint8Array(P)],T));let A=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/attachments`,{method:"POST",headers:Zw({},q.secret),body:F});if(!A.ok)throw Error(`附件上传失败 ${A.status}: ${await A.text()}`);let g=await A.json();H.set(L,g.attachments?.map((k)=>k.data)??(g.data===void 0?[]:[g.data])),process.stderr.write(`✓ 附件上传成功: ${L}
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 K=$.external.registry.get(J[0])?.id;if(I!==J[0]&&K){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 W9($,I){let q=$.seen.get(I);if(!q)throw Error("Unprocessed schema. This is a bug in Zod.");let z=(Q)=>{let w=$.seen.get(Q);if(w.ref===null)return;let K=w.def??w.schema,H={...K},G=w.ref;if(w.ref=null,G){z(G);let V=$.seen.get(G),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))K.allOf=K.allOf??[],K.allOf.push(X);else Object.assign(K,X);if(Object.assign(K,H),Q._zod.parent===G)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(!(D in H))delete K[D]}if(X.$ref&&V.def)for(let D in K){if(D==="$ref"||D==="allOf")continue;if(D in V.def&&JSON.stringify(K[D])===JSON.stringify(V.def[D]))delete K[D]}}let W=Q._zod.parent;if(W&&W!==G){z(W);let V=$.seen.get(W);if(V?.schema.$ref){if(K.$ref=V.schema.$ref,V.def)for(let X in K){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(K[X])===JSON.stringify(V.def[X]))delete K[X]}}}$.override({zodSchema:Q,jsonSchema:K,path:w.path??[]})};for(let Q of[...$.seen.entries()].reverse())z(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,q.def??q.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 w=Q[1];if(w.def&&w.defId){if(w.def.id===w.defId)delete w.def.id;J[w.defId]=w.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:aI(I,"input",$.processors),output:aI(I,"output",$.processors)}},enumerable:!1,writable:!1}),Q}catch(Q){throw Error("Error converting schema to JSON.")}}function g6($,I){let q=I??{seen:new Set};if(q.seen.has($))return!1;q.seen.add($);let z=$._zod.def;if(z.type==="transform")return!0;if(z.type==="array")return g6(z.element,q);if(z.type==="set")return g6(z.valueType,q);if(z.type==="lazy")return g6(z.getter(),q);if(z.type==="promise"||z.type==="optional"||z.type==="nonoptional"||z.type==="nullable"||z.type==="readonly"||z.type==="default"||z.type==="prefault")return g6(z.innerType,q);if(z.type==="intersection")return g6(z.left,q)||g6(z.right,q);if(z.type==="record"||z.type==="map")return g6(z.keyType,q)||g6(z.valueType,q);if(z.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return g6(z.in,q)||g6(z.out,q)}if(z.type==="object"){for(let U in z.shape)if(g6(z.shape[U],q))return!0;return!1}if(z.type==="union"){for(let U of z.options)if(g6(U,q))return!0;return!1}if(z.type==="tuple"){for(let U of z.items)if(g6(U,q))return!0;if(z.rest&&g6(z.rest,q))return!0;return!1}return!1}var MA=($,I={})=>(q)=>{let z=H9({...q,processors:I});return h1($,z),G9(z,$),W9(z,$)},aI=($,I,q={})=>(z)=>{let{libraryOptions:U,target:Y}=z??{},J=H9({...U??{},target:Y,io:I,processors:q});return h1($,J),G9(J,$),W9(J,$)};var SN0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},AA=($,I,q,z)=>{let U=q;U.type="string";let{minimum:Y,maximum:J,format:Q,patterns:w,contentEncoding:K}=$._zod.bag;if(typeof Y==="number")U.minLength=Y;if(typeof J==="number")U.maxLength=J;if(Q){if(U.format=SN0[Q]??Q,U.format==="")delete U.format;if(Q==="time")delete U.format}if(K)U.contentEncoding=K;if(w&&w.size>0){let H=[...w];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}))]}},PA=($,I,q,z)=>{let U=q,{minimum:Y,maximum:J,format:Q,multipleOf:w,exclusiveMaximum:K,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 K==="number"&&K<=(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.exclusiveMinimum=H;else if(typeof Y==="number")U.minimum=Y;if(W)if(V)U.maximum=K,U.exclusiveMaximum=!0;else U.exclusiveMaximum=K;else if(typeof J==="number")U.maximum=J;if(typeof w==="number")U.multipleOf=w},TA=($,I,q,z)=>{q.type="boolean"},EA=($,I,q,z)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},BA=($,I,q,z)=>{if(I.unrepresentable==Line truncated
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),qC0(I)}clear(){this._buffer=void 0}}function qC0($){return Rn.parse(JSON.parse($))}function jd($){return JSON.stringify($)+`
`}class fE{constructor($=gd.stdin,I=gd.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new kE,this._started=!1,this._ondata=(q)=>{this._readBuffer.append(q),this.processReadBuffer()},this._onerror=(q)=>{this.onerror?.(q)}}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 q=jd($);if(this._stdout.write(q))I();else this._stdout.once("drain",I)})}}import{dirname as Cx,join as SW1}from"node:path";import{fileURLToPath as uW1}from"node:url";class V5 extends Error{name="KyError";get isKyError(){return!0}}class K$ extends V5{name="HTTPError";response;request;options;data;constructor($,I,q){let z=$.status||$.status===0?$.status:"",U=$.statusText??"",Y=`${z} ${U}`.trim(),J=Y?`status code ${Y}`:"an unknown error";super(`Request failed with ${J}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=q}}class OJ extends V5{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class FJ extends Error{name="NonError";value;constructor($){let I="Non-error value was thrown";try{if(typeof $==="string")I=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")I=$.message}catch{}super(I);this.value=$}}class Tq extends V5{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new FJ($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",I?{cause:I}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}class nE extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class z8 extends V5{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var bE=(()=>{let $=!1,I=!1,q=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(q&&z)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(U){if(U instanceof Error&&U.message==="unsupported BodyInit type")return!1;throw U}return $&&!I})(),vd=typeof globalThis.AbortController==="function",uG=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Rd=typeof globalThis.ReadableStream==="function",Cd=typeof globalThis.FormData==="function",yG=["get","post","put","patch","head","delete"],zC0=()=>{return};zC0();var _d={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Eq=2147483647,hd=40,xG=Symbol("stop");class kG{options;constructor($){this.options=$}}var Sd=($)=>new kG($),ud={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},yd={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var fG=new TextEncoder,UC0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[q,z]of $)I+=hd,I+=fG.encode(`Content-Disposition: form-data; name="${q}"`).byteLength,I+=typeof z==="string"?fG.encode(z).byteLength:z.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return fG.encode($).byteLength;if($ instanceof URLSearchParams)return fG.encode($.toString()).byteLength;return 0},xd=($,I,q)=>{let z,U=0;return $.pipeThrough(new TransformStream({transform(Y,J){if(J.enqueue(Y),z){U+=z.byteLength;let Q=I===0?0:U/I;if(Q>=1)Q=1-Number.EPSILON;q?.({percent:Q,totalBytes:Math.max(I,U),transferredBytes:U},z)}z=Y},flush(){if(z)U+=z.byteLength,q?.({percent:1,totalBytes:Math.max(I,U),transferredBytes:U},z)}}))},kd=($,I)=>{if(!$.body)return $;let q={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,q);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(xd($.body,z,I),q)},fd=($,I,q)=>{if(!$.body)return $;let z=UC0(q??$.body);return new Request($,{duplex:"half",body:xd($.body,z,I)})};var E8=($)=>$!==null&&typeof $==="object";var YC0=Symbol("replaceOption"),iE=($)=>E8($)&&$[YC0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var MJ=(...$)=>{for(let I of $)if( Line truncated
`,{mode:384}),I}function fu($){let I=CW0();for(let q of I){if(!F$(q))continue;for(let z of wD(q).filter((U)=>U.endsWith(".json")).filter((U)=>!U.startsWith("example."))){let U=s8(q,z);try{let Y=HD(U,"utf-8"),J=JSON.parse(Y);if(J&&typeof J==="object"&&J.id===$)return U}catch{}}}return}function E7($,I){let q=fu($);if(!q)throw Error(`Enterprise config not found: ${$}`);let U={...JSON.parse(HD(q,"utf-8")),...I};for(let J of Object.keys(I))if(I[J]===void 0)delete U[J];let Y=yu.parse(U);return EW0(q,`${JSON.stringify(Y,null,2)}
`,"utf-8"),Y}function vU($,I,q=[]){let z=I.corpId?.trim()||void 0,U=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,Y=z??U;if(Y){let Q=$.find((H)=>H.id===Y);if(Q)return Q;let w=$.find((H)=>H.id.toLowerCase()===Y.toLowerCase());if(w)return w;let K=$.find((H)=>H.name.toLowerCase()===Y.toLowerCase());if(K)return K;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: "+(q.length?q.join(", "):"the configured enterprise directories"))}import{readFileSync as LH1}from"node:fs";import{randomBytes as DH1}from"node:crypto";var SW0=300000,_W0=new Map;function s21($,I){return $.map((q)=>q.trim()).filter(Boolean).map((q)=>I?q:q.toLowerCase())}function e21($,I){return I?$:$.toLowerCase()}function $w1($,I,q,z){let U=e21($,z),Y=I.filter((J)=>U.includes(J));if(q==="all"&&Y.length!==I.length)return[];return Y}function Iw1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function qw1($,I){if(I.fields&&!I.fields.has($.field))return[];let q=Iw1($.value),z=[];return q.forEach((U,Y)=>{let J=$w1(U,I.keywords,I.matchMode,I.caseSensitive);if(J.length===0)return;let Q=Math.max(0,Y-I.contextLines),w=Math.min(q.length,Y+I.contextLines+1),K={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Y+1,matchedKeywords:J,matchedText:WD(U,I.maxChars),context:{before:I.snippetOnly?[]:q.slice(Q,Y).map((H)=>WD(H,I.maxChars)),line:WD(U,I.maxChars),after:I.snippetOnly?[]:q.slice(Y+1,w).map((H)=>WD(H,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)K.context={before:[],line:K.context.line,after:[]};z.push(K)}),z}function WD($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function zw1($){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 hW0($){return $.rules.flatMap((I,q)=>{let z=`${$.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:q};return[{area:"rules",entityType:"rule",entityId:z,title:`${$.versionName} / ${I.scope}`,field:"history.description",value:I.description,metadata:U},{area:"rules",entityType:"rule",entityId:z,title:`${$.versionName} / ${I.scope}`,field:"history.scope",value:I.scope,metadata:U}]})}function Uw1($){return[{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"title",value:$.title,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"purpose",value:$.purpose,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}},{area:"documents",entityType:"document",entityId:$.id,title:$.title,field:"content",value:$.content,metadata:{status:$.status,scenarios:$.scenarios,tags:$.tags}}]}function Yw1($){let I=[];if($.decisionPreferences)for(let[q,z]of Object.entries($.decisionPreferences))I.push({area:"preferences",entityType:"preference",field:`decisionPreferences.${q}`,value:z,metadata:{integrationSystem:$.integrationSystem}});return $.integrations.forEach((q,z)=>{I.push({area:"preferences",entityType:"integration",title:q.outboundName,field:`integrations[${z}]`,value:q,metadata:{type:q.type,outboundName:q.outboundName,mode:q.mode,corporationId:q.corporationId}})}),I}async function Jw1($,I,q){let z=q.ruleVersionScope??"current",U=[I.id,`ruleVersionScope=${z}`,`ruleVersionId=${q.ruleVersionId??""}`,`ruleVersionNumber=${q.ruleVersionNumber??""}`,`latestRuleVersion=${q.latestRuleVersion??!1}`,`documentLimit=${q.documentLimit??100}`].join("|"),Y=_W0.get(U);if(!q.refresh&&Y&&Date.now()<Y.expiresAt)return Y;let[J,Q,w]=await Promise.all([Qw1($,{scope:z,versionId:q.ruleVersionId,versionNumber:q.ruleVersionNumber,latest:q.latestRuleVersion}),B9($,{limit:q.documentLimit??100}),M1($,I.seal.endpoints.approvalStylePreferences)]),K=Date.now(),H={entries:[...J,...Q.articles.flatMap(Uw1),...Yw1(w)],fetchedAt:K,expiresAt:K+SW0};return _W0.set(U,H),H}async function Qw1($,I){if(I.scope==="current")return(await _6($)).rules.flatMap(zw1);if(I.scope==="version"){let z=await ww1($,I);return hW0(z)}return(await C$($)).flatMap(hW0)}async function ww1($,I){if(I.versionId)return _J($,I.versionId);let q=await C$($),z=I.versionNumber?q.find((U)=>U.versionNumber===I.versionNumber):q[0];if(!z)throw Error(I.versionNumber?`Rule version not found: ${I.versionNumber}`:"No rule versions found");return z}async func Line truncated
`,"utf8"),q}function bW0($){return $.map((I,q)=>{let z;if(typeof I.code==="number")z=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")z=I.code.startsWith("#")?I.code:`#${I.code}`;else z=`#${String(q+1).padStart(4,"0")}`;return{id:I.id,code:z,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}class d$ extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((q)=>`- ${q}`)].join(`
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}import{createHmac as Tw1,randomBytes as Ew1}from"node:crypto";function Bw1($,I,q,z){return Tw1("sha256",z).update(`${$}.${I}.${JSON.stringify(q)}`).digest("hex")}function Dw($,I){let q=Math.floor(Date.now()/1000),z=Ew1(16).toString("hex");return{Authorization:`Bearer ${I}`,"x-webhook-signature":Bw1(q,z,$,I),"x-webhook-timestamp":String(q),"x-webhook-nonce":z}}var uy=jI(QV0(),1),tV0=jI(rV0(),1);var CD={maxEntries:1000,maxTotalSize:524288000,maxCompressionRatio:150};async function aV0($){return new Promise((I,q)=>{uy.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(z,U)=>{if(z||!U)return q(z??Error("无法打开 ZIP"));let Y=[];U.readEntry(),U.on("entry",(J)=>{let Q=sV0(J);if(!Q.endsWith("/")&&!IH1(Q))Y.push({fileName:Q,uncompressedSize:J.uncompressedSize,compressedSize:J.compressedSize,raw:J});U.readEntry()}),U.on("end",()=>I(Y)),U.on("error",q)})})}function sV0($){let I=Buffer.isBuffer($.fileName)?$.fileName:Buffer.from(String($.fileName),"binary"),q=I.toString("utf8");if(!q.includes("�"))return q;let z=tV0.default.decode(I,"gbk");if(!z.includes("�"))return z;return q}function IH1($){let I=$.split("/").pop()??"";return $.split("/").includes("__MACOSX")||I===".DS_Store"||I.startsWith("._")||I.startsWith(".~")||I.startsWith("~$")}function eV0($,I){let q=[],z=Cq(I);if($.length>CD.maxEntries)q.push(`文件数超过 ${CD.maxEntries}`);if($.reduce((J,Q)=>J+Q.uncompressedSize,0)>CD.maxTotalSize)q.push("解压后总大小超过 500MB");for(let J of $){if(J.fileName.startsWith("/")||J.fileName.split("/").includes(".."))q.push(`存在不安全路径: ${J.fileName}`);if(J.compressedSize>0&&J.uncompressedSize/J.compressedSize>CD.maxCompressionRatio)q.push(`压缩比超过 150: ${J.fileName}`);if(J.fileName==="信息表.xlsx")continue;qH1(J,z,q)}if(!$.find((J)=>J.fileName==="信息表.xlsx"))q.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");if($.some((J)=>J.fileName.toLowerCase().endsWith(".zip")))q.push("不允许嵌套 ZIP");if(q.length)throw new d$(q)}function qH1($,I,q){let z=zH1($.fileName);if(!z||!I.allowedExtensions.includes(z))q.push(`附件后缀不在白名单中: ${$.fileName}(允许: ${I.allowedExtensions.join(", ")})`);if($.uncompressedSize<I.minFileSizeBytes)q.push(`附件文件过小: ${$.fileName}(${$.uncompressedSize} B,小于最小值 ${I.minFileSizeBytes} B)`);if(I.maxFileSizeBytes!==void 0&&I.maxFileSizeBytes!==null&&$.uncompressedSize>I.maxFileSizeBytes)q.push(`附件文件过大: ${$.fileName}(${$.uncompressedSize} B,大于最大值 ${I.maxFileSizeBytes} B)`)}function zH1($){let I=$.split("/").pop()??$,q=I.lastIndexOf(".");return q>0?I.slice(q).toLowerCase():""}function yy($,I){return new Promise((q,z)=>{uy.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(U,Y)=>{if(U||!Y)return z(U??Error("无法打开 ZIP"));Y.readEntry(),Y.on("entry",(J)=>{if(sV0(J)!==I.fileName)return Y.readEntry();Y.openReadStream(J,(Q,w)=>{if(Q||!w)return z(Q??Error(`无法读取 ${I.fileName}`));let K=[];w.on("data",(H)=>K.push(H)),w.on("end",()=>q(Buffer.concat(K))),w.on("error",z)})}),Y.on("error",z)})})}var IZ0=jI(Cu(),1);function UH1($){return $.startsWith("[附件]")}function qZ0($){return $.startsWith("[附件]")?$.slice(4):$}function YH1($){return qZ0($).toLowerCase().replace(/\s+/g,"_")||"attachment"}function JH1($){if($==null||$==="")return[];return String($).split(/[\n,;,;]/).map((I)=>I.trim()).filter(Boolean)}function xy($,I){let q=[];for(let[z,U]of I.entries()){if(!UH1(z))continue;let Y=$.getCell(U).value,J=JH1(Y);if(!J.length)continue;q.push({key:YH1(z),label:qZ0(z),paths:J})}return q}function ky($){let I=new Map;return $.map((q)=>{let z=(I.get(q.key)??0)+1;return I.set(q.key,z),z===1?q:{...q,key:`${q.key}-${z}`}})}function _D($,I,q,z){return{key:$,label:I,type:q,value:z}}function zZ0($,I,q){return _D($,I,"TEXT",q==null?"":String(q))}function UZ0($,I,q){return _D($,I,"AMOUNT",typeof q==="number"?{amount:q,currency:"CNY"}:null)}function YZ0($){if($ instanceof Date)return $.toISOString();if(typeof $==="string"&&$.trim())return $.trim();return null}function QH1($){if($ instanceof Date)return Math.floor($.getTime()/1000);if(typeof $==="string"&&$.trim()){let I=Date.parse($.trim().replace(" ","T"));if(Number.isFinite(I))return Math.floor(I/1000)}return null}function Ew($){let I=new Map;return $.getRow(1).eachCell((q,z)=>I.set(String(q.value??"").trim(),z)),I}function XI($,I,q){let z=I.get(q);return z?$.getCell(z).value:void 0}function wH1($,I){return[["会议编号","meeting_id","TEXT"],["会议名称","meeting_name","TEXT"],["状态","status","TEXT"],["总金额","total_amount","AMOUNT"],["税前劳务总额","pretax_labor_total","AMOUNT"],["报销事由","reimbursement_reason","TEXT"],["po码","po_code","TEXT"],["快递单号","tracking_number","TEXT"],["申请日期","application_date","DATE"],["更新日期","updated_date","DATE"] Line truncated
`);let O=new FormData,P=await yy(z.fileBuffer,D),T=L.split("/").pop()??L;O.append("files",new File([new Uint8Array(P)],T));let A=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/attachments`,{method:"POST",headers:Dw({},q.secret),body:O});if(!A.ok)throw Error(`附件上传失败 ${A.status}: ${await A.text()}`);let g=await A.json();H.set(L,g.attachments?.map((k)=>k.data)??(g.data===void 0?[]:[g.data])),process.stderr.write(`✓ 附件上传成功: ${L}
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${w.document.documentId}
`);let W=xy(w.document,K,H),V=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`,{method:"POST",headers:{"Content-Type":"application/json",...Zw({webhookId:Y,...W},q.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 XI($){return{fileBuffer:$H1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}import{existsSync as UH1}from"node:fs";async function _D($,I,q={}){let U=F4().stateful?"stateful":"stateless",Y="ok",J,Q,w;try{let A=await H$($);w={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 K=[];if(Y==="ok")try{K=await Z5($,I.seal.endpoints.approvalStylePreferences)}catch(A){Y="error",J=`读取 Webhook 配置失败: ${A instanceof Error?A.message:String(A)}`}let H=K.length===1,G=K.map((A)=>({id:A.id,name:A.name,mode:A.mode,incomingDocumentWebhookUrl:A.incomingDocumentWebhook.url,outgoingResultWebhookUrl:A.outgoingResultWebhook,autoApprovalRate:A.autoApprovalRate,...H?{isDefault:!0}:{}})),W=H?{id:K[0].id,name:K[0].name,mode:K[0].mode}:null,V=q.webhook?E9(K,q.webhook):H?K[0]:void 0,X;if(q.filePath)if(!UH1(q.filePath))X={valid:!1,filePath:q.filePath,fileName:q.filePath.split(/[\\/]/).pop()??q.filePath,documentCount:0,errors:[`文件不存在: ${q.filePath}`]};else try{let A=XI(q.filePath),g=await ZI(A.fileBuffer,A.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:q.filePath,fileName:A.fileName,documentCount:g.documents.length,warnings:g.warnings}}catch(A){X={valid:!1,filePath:q.filePath,fileName:q.filePath.split(/[\\/]/).pop()??q.filePath,documentCount:0,errors:[A instanceof Error?A.message:String(A)]}}let L=X?X.valid:!0,D=Y==="ok"&&G.length>0&&L,F=U==="stateful"?"":` --corp ${I.id}`,P="",T="";if(Y!=="ok")T=`凭证鉴权异常: ${J}`,P=`seal-use auth diagnose${F}`;else if(G.length===0)T="当前企业尚未配置任何 Webhook 集成通道",P=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${F}`;else if(X&&!X.valid)T=`材料包预检失败: ${X.errors?.join("; ")}`,P=`seal-use webhook material-pack preview ${X.filePath}${F}`;else{T=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${G.length} 个 Webhook 通道,等待载入`;let A=X?.filePath??"<材料包.zip>",g=H?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;P=`seal-use webhook material-pack push ${A}${g}${F}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:w},stateMode:U,authStatus:Y,authError:J,activeWebhooks:G,defaultWebhook:W,materialPack:X,statusMessage:T,nextAction:P}}var Tw=[{name:"seal_whoami",description:"查询当前 Seal 用户身份及租户信息",parameters:Z.object({}),handler:async($)=>H$($)},{name:"seal_session_get",description:"查询当前 Seal Bearer session、用户和过期时间",parameters:Z.object({}),handler:async($)=>om($)},{name:"seal_delegation_list",description:"查询当前 Seal 租户下的授权链接 (Delegation) 列表",parameters:Z.object({}),handler:async($)=>Dl($)},{name:"seal_delegation_create",description:"创建新的 Seal 授权链接 (Delegation)",parameters:Z.object({note:Z.string().optional().describe("授权链接的备注或说明信息")}),handler:async($,I)=>vq($,I)},{name:"seal_delegation_revoke",description:"撤销/废除指定的 Seal 授权链接 (Delegation)",parameters:Z.object({tokenId:Z.string().describe("授权链接 ID (delegation record ID)")}),handler:async($,I)=>Ol($,I.tokenId)},{name:"seal_user_create",description:"创建本地 Seal 用户,生成并返回初始随机密码",parameters:Z.object({name:Z.string().describe("用户姓名"),phone:Z.string().describe("手机号码 (例如 13300001111 或 +8613300001111)"),permissions:Z.array(Z.string()).optional().describe("权限列表,默认为 []"),departmentIds:Z.array(Z.string()).optional().describe("关联部门 ID 数组")}),handler:async($,I)=>Fl($,I)},{name:"seal_user_reset_password",description:"重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>Dj($,I.userId)},{name:"seal_user_get",description:"获取指定 Seal 用户的详细信息",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>IW($,I.userId)},{name:"seal_user_search",description:"按姓名、手机号或邮箱搜索 Seal 成员用户列表",parameters:Z.object({keyword:Z.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")}),handler:async($,I)=>qW($,I.keyword??"")},{name:"seal_user_delete",description:"删除指定 Seal 本地用户",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>Rl($,I.userId)},{name:"seal_user_activate",description:"启用/激活已离职的 Seal 用户账号",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>Oj($,I.userId)},{name:"seal_user_delegation_create",description:"为指定 S Line truncated
`+`• 身份主体:${F}${P}
`);let W=fy(w.document,K,H),V=await fetch(`${U}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`,{method:"POST",headers:{"Content-Type":"application/json",...Dw({webhookId:Y,...W},q.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 DI($){return{fileBuffer:GH1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}import{existsSync as XH1}from"node:fs";async function SD($,I,q={}){let U=K4().stateful?"stateful":"stateless",Y="ok",J,Q,w;try{let A=await H$($);w={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 K=[];if(Y==="ok")try{K=await X5($,I.seal.endpoints.approvalStylePreferences)}catch(A){Y="error",J=`读取 Webhook 配置失败: ${A instanceof Error?A.message:String(A)}`}let H=K.length===1,G=K.map((A)=>({id:A.id,name:A.name,mode:A.mode,incomingDocumentWebhookUrl:A.incomingDocumentWebhook.url,outgoingResultWebhookUrl:A.outgoingResultWebhook,autoApprovalRate:A.autoApprovalRate,...H?{isDefault:!0}:{}})),W=H?{id:K[0].id,name:K[0].name,mode:K[0].mode}:null,V=q.webhook?j9(K,q.webhook):H?K[0]:void 0,X;if(q.filePath)if(!XH1(q.filePath))X={valid:!1,filePath:q.filePath,fileName:q.filePath.split(/[\\/]/).pop()??q.filePath,documentCount:0,errors:[`文件不存在: ${q.filePath}`]};else try{let A=DI(q.filePath),g=await LI(A.fileBuffer,A.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:q.filePath,fileName:A.fileName,documentCount:g.documents.length,warnings:g.warnings}}catch(A){X={valid:!1,filePath:q.filePath,fileName:q.filePath.split(/[\\/]/).pop()??q.filePath,documentCount:0,errors:[A instanceof Error?A.message:String(A)]}}let L=X?X.valid:!0,D=Y==="ok"&&G.length>0&&L,O=U==="stateful"?"":` --corp ${I.id}`,P="",T="";if(Y!=="ok")T=`凭证鉴权异常: ${J}`,P=`seal-use auth diagnose${O}`;else if(G.length===0)T="当前企业尚未配置任何 Webhook 集成通道",P=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${O}`;else if(X&&!X.valid)T=`材料包预检失败: ${X.errors?.join("; ")}`,P=`seal-use webhook material-pack preview ${X.filePath}${O}`;else{T=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${G.length} 个 Webhook 通道,等待载入`;let A=X?.filePath??"<材料包.zip>",g=H?"":` --webhook ${W?W.id:"<webhookIdOrName>"}`;P=`seal-use webhook material-pack push ${A}${g}${O}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:Q,user:w},stateMode:U,authStatus:Y,authError:J,activeWebhooks:G,defaultWebhook:W,materialPack:X,statusMessage:T,nextAction:P}}var jw=[{name:"seal_whoami",description:"查询当前 Seal 用户身份及租户信息",parameters:Z.object({}),handler:async($)=>H$($)},{name:"seal_session_get",description:"查询当前 Seal Bearer session、用户和过期时间",parameters:Z.object({}),handler:async($)=>Il($)},{name:"seal_delegation_list",description:"查询当前 Seal 租户下的授权链接 (Delegation) 列表",parameters:Z.object({}),handler:async($)=>Tl($)},{name:"seal_delegation_create",description:"创建新的 Seal 授权链接 (Delegation)",parameters:Z.object({note:Z.string().optional().describe("授权链接的备注或说明信息")}),handler:async($,I)=>_q($,I)},{name:"seal_delegation_revoke",description:"撤销/废除指定的 Seal 授权链接 (Delegation)",parameters:Z.object({tokenId:Z.string().describe("授权链接 ID (delegation record ID)")}),handler:async($,I)=>El($,I.tokenId)},{name:"seal_user_create",description:"创建本地 Seal 用户,生成并返回初始随机密码",parameters:Z.object({name:Z.string().describe("用户姓名"),phone:Z.string().describe("手机号码 (例如 13300001111 或 +8613300001111)"),permissions:Z.array(Z.string()).optional().describe("权限列表,默认为 []"),departmentIds:Z.array(Z.string()).optional().describe("关联部门 ID 数组")}),handler:async($,I)=>Bl($,I)},{name:"seal_user_reset_password",description:"重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>FB($,I.userId)},{name:"seal_user_get",description:"获取指定 Seal 用户的详细信息",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>zW($,I.userId)},{name:"seal_user_search",description:"按姓名、手机号或邮箱搜索 Seal 成员用户列表",parameters:Z.object({keyword:Z.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")}),handler:async($,I)=>UW($,I.keyword??"")},{name:"seal_user_delete",description:"删除指定 Seal 本地用户",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>xl($,I.userId)},{name:"seal_user_activate",description:"启用/激活已离职的 Seal 用户账号",parameters:Z.object({userId:Z.string().describe("用户 ID (_id)")}),handler:async($,I)=>NB($,I.userId)},{name:"seal_user_delegation_create",description:"为指定 S Line truncated
`+`• 身份主体:${O}${P}
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
`+`• 时效性:换票凭证有效时间 ${V} 秒(${Math.round(V/60)} 分钟),在浏览器打开后将保留 30 天会话
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?H:K,sealResultUrl:K,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"?gH1(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:z&&!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 q=I.sn??I.query;if(!q)throw Error("query or sn is required");let z=await vH1($,{query:q,sn:I.sn,batchId:I.batchId,latest:I.latest,limit:I.latest?1:I.limit??20,maxScan:I.maxScan??1000}),U=await Promise.all(z.records.map((Q)=>j4($,Q.id))),Y=zZ0(I.fields),J=U.map((Q)=>EH1(Q,Y));return{query:q,sourceDocumentSN:I.sn,simulationBatchId:I.batchId,latest:I.latest??!1,total:z.total,scanned:z.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:uD(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 q=my(await Zj($,I.batchId),I.query);return{batchId:I.batchId,count:q.length,records:q.map(LI),bridge:uD(q)}}},{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 q=I.mode??"hosecloud",z=I.signKey;if(q==="hosecloud"&&!z){if(z=(await Lj($)).find((Q)=>Q.signKey)?.signKey,!z)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:yU({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(q,["金额","报销金额","付款金额","合计","价税合计"])??kD(I,["amount","totalAmount","expenseAmount"]),expenseType:SD(q,["费用类型","费用类别","报销类型"]),costCompany:SD(q,["费用承担公司","承担公司","成本中心","费用归属"]),payee:SD(q,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:q.slice(0,30)}),invoices:MH1($),attachments:TU($,{summary:!0}).attachments,aiResult:nD($),manualResult:DI($)?.value,hints:yU({amountMentions:YZ0(z,["金额","合计","税率"],8),partyMentions:YZ0(z,["买方","卖方","甲方","乙方","收款"],8)})}}function DH1($){let I=[["result.citedRules",a5($,"result.citedRules")],["result.matchedRules",a5($,"result.matchedRules")],["result.ruleResults",a5($,"result.ruleResults")],["result.rules",a5($,"result.rules")],["pipelineData.citedRules",a5($,"pipelineData.citedRules")],["pipelineData.matchedRules",a5($,"pipelineData.matchedRules")]],q=[],z=new Set;for(let[U,Y]of I)(Array.isArray(Y)?Y:Y&&typeof Y==="object"?Object.values(Y):[]).forEach((Q,w)=>{let K=Ew(Q);if(!K)return;let H=Y4(K.runtimeRuleId)??Y4(K.runtimeId)??Y4(K.id)??Y4(K.ruleId),G=Y4(K.ruleCode)??Y4(K.code)??(H?TH1(H):void 0),W=yU({runtimeRuleId:H,ruleCode:G,versionNumber:FH1(K.versionNumber)??$.ruleSetVersionNumber,scope:Y4(K.scope),strictness:Y4(K.strictness),appliedAnalysis:K.appliedAnalysis??K.analysis??K.reasoning,checkResult:K.checkResult??K.result??K.decision,findings:K.findings??K.riskPoints??K.evidence,sourcePath:`${U}.${w}`}),V=JSON.stringify(W);if(!z.has(V))z.add(V),q.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:q.length,rules:q}}function kD($,I){if(!$)return;for(let q of I){let z=a5($,q);if(z!==void 0)return z}return}function UZ0($,I){if(!$)return 0;for(let q of I){let z=a5($,q);if(Array.isArray(z))return z.length;if(z&&typeof z==="object")return Object.keys(z).length;if(typeof z==="number")return z}return 0}function a5($,I){return I.split(".").reduce((q,z)=>{if(q===void 0||q===null)return;if(Array.isArray(q)){let U=Number(z);return Number.isInteger(U)?q[U]:void 0}if(typeof q==="object")return q[z];return},$)}function OH1($,I,q){let z=I.split("."),U=$;for(let Y of z.slice(0,-1)){let J=U[Y];if(!J||typeof J!=="object"||Array.isArray(J))U[Y]={};U=U[Y]}U[z[z.length-1]??I]=q}function yU($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function Ew($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function FH1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function NH1($){let I=[];return ny($,"document",I),I}function ny($,I,q){if(Array.isArray($)){$.forEach((J,Q)=>ny(J,`${I}.${Q}`,q));return}let z=Ew($);if(!z)return;let U=Y4(z.label)??Y4(z.name)??Y4(z.title)??Y4(z.fieldName),Y=z.value??z.displayValue??z.text??z.content;if(U&&Y!==void 0&&typeof Y!=="object")q.push(yU({path:I,label:U,value:Y,type:Y4(z.type)??Y4(z.fieldType)}));for(let[J,Q]of Object.entries(z)){if(J==="attachments")continue;ny(Q,`${I}.${J}`,q)}}function SD($,I){return $.find((z)=>{let U=Y4(z.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function MH1($){let I=[];return fD($.result,"result",I),fD($.document,"document",I),I.slice(0,20)}function fD($,I,q){if(Array.isArray($)){$.forEach((U,Y)=>fD(U,`${I}.${Y}`,q));return}let z=Ew($);if(!z)return;if(/invoice|发票/i.test(I))q.push(yU({path:I,fileName:Y4(z.fileName)??Y4(z.filename)??Y4(z.name),buyer:z.buyer??z.buyerName??z.purchaserName,seller:z.seller??z.sellerName,amount:z.amount??z.totalAmount??z.total,taxRate:z.taxRate,category:z.category??z.type}));for(let[U,Y]of Object.entries(z))fD(Y,`${I}.${U}`,q)}function YZ0($,I,q){return $.split(/\r?\n/).filter((z)=>I.some((U)=>z.includes(U))).slice(0,q)}function uD($){return $.map((I)=>{let q=LI(I);return{recordId:q.id,tenantId:q.tenantId,agentId:q.agentId,sourceDocumentSN:q.sourceDocumentSN,sourceDocumentId:q.sourceDocumentId,simulationBatchId:q.simulationBatchId,langfuseTraceId:q.langfuseTraceId,langfuseSessionFallback:q.langfuseSessionFallback,ruleSetVersionNumber:q.ruleSetVersionNumber,ruleSetPublishedAt:q.ruleSetPublishedAt,ruleSetPublishedByName:q.ruleSetPublishedByName,resolution:q.langfuseTraceId?"trace":q.langfuseSessionFallback?"session-fallback":"unresolved"}})}function ky($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function AH1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let q=await j4($,I.recordId);if(!q.ruleSetVersionNumber)throw Er Line truncated
`)}function kH1($){let I=[];if(I.push(`seal-use ${$.area} - ${$.title}`),$.description)I.push($.description);I.push(""),I.push("Usage:");for(let q of $.commands)for(let z of q.usage)I.push(` ${z}`);if($.commands.some((q)=>q.name))I.push(""),I.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return I.join(`
`)}function BZ0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of gZ0)for(let q of I.commands)for(let z of q.usage)$.push(` ${z}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var nH1=100,iH1=120000,CZ0=["id","code","status","strictness","scope","createdAt","updatedAt"],bH1=200000;function ay($){return $.map((I)=>typeof I==="string"?I:String(I)).join(" ")}function gw($){if(!$.length)return"";return`${$.join(`
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?H:K,sealResultUrl:K,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"?fH1(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:z&&!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 q=I.sn??I.query;if(!q)throw Error("query or sn is required");let z=await nH1($,{query:q,sn:I.sn,batchId:I.batchId,latest:I.latest,limit:I.latest?1:I.limit??20,maxScan:I.maxScan??1000}),U=await Promise.all(z.records.map((Q)=>B4($,Q.id))),Y=HZ0(I.fields),J=U.map((Q)=>yH1(Q,Y));return{query:q,sourceDocumentSN:I.sn,simulationBatchId:I.batchId,latest:I.latest??!1,total:z.total,scanned:z.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:xD(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 q=oy(await LB($,I.batchId),I.query);return{batchId:I.batchId,count:q.length,records:q.map(OI),bridge:xD(q)}}},{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 q=I.mode??"hosecloud",z=I.signKey;if(q==="hosecloud"&&!z){if(z=(await OB($)).find((Q)=>Q.signKey)?.signKey,!z)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:fU({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:nD(I,["template.name","templateName","form.name","formName","formTitle"]),amount:yD(q,["金额","报销金额","付款金额","合计","价税合计"])??nD(I,["amount","totalAmount","expenseAmount"]),expenseType:yD(q,["费用类型","费用类别","报销类型"]),costCompany:yD(q,["费用承担公司","承担公司","成本中心","费用归属"]),payee:yD(q,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:q.slice(0,30)}),invoices:_H1($),attachments:jU($,{summary:!0}).attachments,aiResult:iD($),manualResult:FI($)?.value,hints:fU({amountMentions:WZ0(z,["金额","合计","税率"],8),partyMentions:WZ0(z,["买方","卖方","甲方","乙方","收款"],8)})}}function gH1($){let I=[["result.citedRules",s5($,"result.citedRules")],["result.matchedRules",s5($,"result.matchedRules")],["result.ruleResults",s5($,"result.ruleResults")],["result.rules",s5($,"result.rules")],["pipelineData.citedRules",s5($,"pipelineData.citedRules")],["pipelineData.matchedRules",s5($,"pipelineData.matchedRules")]],q=[],z=new Set;for(let[U,Y]of I)(Array.isArray(Y)?Y:Y&&typeof Y==="object"?Object.values(Y):[]).forEach((Q,w)=>{let K=gw(Q);if(!K)return;let H=Y4(K.runtimeRuleId)??Y4(K.runtimeId)??Y4(K.id)??Y4(K.ruleId),G=Y4(K.ruleCode)??Y4(K.code)??(H?uH1(H):void 0),W=fU({runtimeRuleId:H,ruleCode:G,versionNumber:RH1(K.versionNumber)??$.ruleSetVersionNumber,scope:Y4(K.scope),strictness:Y4(K.strictness),appliedAnalysis:K.appliedAnalysis??K.analysis??K.reasoning,checkResult:K.checkResult??K.result??K.decision,findings:K.findings??K.riskPoints??K.evidence,sourcePath:`${U}.${w}`}),V=JSON.stringify(W);if(!z.has(V))z.add(V),q.push(W)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:q.length,rules:q}}function nD($,I){if(!$)return;for(let q of I){let z=s5($,q);if(z!==void 0)return z}return}function GZ0($,I){if(!$)return 0;for(let q of I){let z=s5($,q);if(Array.isArray(z))return z.length;if(z&&typeof z==="object")return Object.keys(z).length;if(typeof z==="number")return z}return 0}function s5($,I){return I.split(".").reduce((q,z)=>{if(q===void 0||q===null)return;if(Array.isArray(q)){let U=Number(z);return Number.isInteger(U)?q[U]:void 0}if(typeof q==="object")return q[z];return},$)}function vH1($,I,q){let z=I.split("."),U=$;for(let Y of z.slice(0,-1)){let J=U[Y];if(!J||typeof J!=="object"||Array.isArray(J))U[Y]={};U=U[Y]}U[z[z.length-1]??I]=q}function fU($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function gw($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function RH1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function CH1($){let I=[];return iy($,"document",I),I}function iy($,I,q){if(Array.isArray($)){$.forEach((J,Q)=>iy(J,`${I}.${Q}`,q));return}let z=gw($);if(!z)return;let U=Y4(z.label)??Y4(z.name)??Y4(z.title)??Y4(z.fieldName),Y=z.value??z.displayValue??z.text??z.content;if(U&&Y!==void 0&&typeof Y!=="object")q.push(fU({path:I,label:U,value:Y,type:Y4(z.type)??Y4(z.fieldType)}));for(let[J,Q]of Object.entries(z)){if(J==="attachments")continue;iy(Q,`${I}.${J}`,q)}}function yD($,I){return $.find((z)=>{let U=Y4(z.label)??"";return I.some((Y)=>U.includes(Y))})?.value}function _H1($){let I=[];return bD($.result,"result",I),bD($.document,"document",I),I.slice(0,20)}function bD($,I,q){if(Array.isArray($)){$.forEach((U,Y)=>bD(U,`${I}.${Y}`,q));return}let z=gw($);if(!z)return;if(/invoice|发票/i.test(I))q.push(fU({path:I,fileName:Y4(z.fileName)??Y4(z.filename)??Y4(z.name),buyer:z.buyer??z.buyerName??z.purchaserName,seller:z.seller??z.sellerName,amount:z.amount??z.totalAmount??z.total,taxRate:z.taxRate,category:z.category??z.type}));for(let[U,Y]of Object.entries(z))bD(Y,`${I}.${U}`,q)}function WZ0($,I,q){return $.split(/\r?\n/).filter((z)=>I.some((U)=>z.includes(U))).slice(0,q)}function xD($){return $.map((I)=>{let q=OI(I);return{recordId:q.id,tenantId:q.tenantId,agentId:q.agentId,sourceDocumentSN:q.sourceDocumentSN,sourceDocumentId:q.sourceDocumentId,simulationBatchId:q.simulationBatchId,langfuseTraceId:q.langfuseTraceId,langfuseSessionFallback:q.langfuseSessionFallback,ruleSetVersionNumber:q.ruleSetVersionNumber,ruleSetPublishedAt:q.ruleSetPublishedAt,ruleSetPublishedByName:q.ruleSetPublishedByName,resolution:q.langfuseTraceId?"trace":q.langfuseSessionFallback?"session-fallback":"unresolved"}})}function ny($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function hH1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let q=await B4($,I.recordId);if(!q.ruleSetVersionNumber)throw Er Line truncated
`)}function rH1($){let I=[];if(I.push(`seal-use ${$.area} - ${$.title}`),$.description)I.push($.description);I.push(""),I.push("Usage:");for(let q of $.commands)for(let z of q.usage)I.push(` ${z}`);if($.commands.some((q)=>q.name))I.push(""),I.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return I.join(`
`)}function SZ0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of uZ0)for(let q of I.commands)for(let z of q.usage)$.push(` ${z}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var aH1=100,sH1=120000,kZ0=["id","code","status","strictness","scope","createdAt","updatedAt"],eH1=200000;function ey($){return $.map((I)=>typeof I==="string"?I:String(I)).join(" ")}function Cw($){if(!$.length)return"";return`${$.join(`
`)}
`}function vw($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function E0($,I={}){pH1($,I);let q=`${JSON.stringify($,null,2)}
`;if(I.outputFile){fH1(I.outputFile,q),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(q,"utf-8")},null,2));return}console.log(q.trimEnd())}function pH1($,I={}){if(I.allowFull||I.outputFile)return;let q=Buffer.byteLength(JSON.stringify($),"utf-8");if(q>bH1)throw new iD(`Output is large (${q} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function _Z0($,I){if(I)return;let q=$&&typeof $==="object"?$:{},z=typeof q.count==="number"?q.count:void 0,U=Array.isArray(q.rules)?q.rules.length:void 0,Y=Buffer.byteLength(JSON.stringify($),"utf-8"),J=z??U??0;if(J>nH1||Y>iH1)throw new iD(`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 W0($){return{allowFull:O0($.full)===!0,outputFile:C($.outputFile)??C($["output-file"])}}function hZ0($=[]){console.log(RZ0($))}function _1($){let I=a8(),q=F4();return jU(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$},wI())}function OI($=F4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:KI()}}async function F0($,I,q,z,U={}){E0(await FI($,I,q,z),U)}async function FI($,I,q,z){let U=Tw.find((Q)=>Q.name===$);if(!U)throw Error(`Unknown Seal tool: ${$}`);let Y=Object.fromEntries(Object.entries(z).filter(([,Q])=>Q!==void 0)),J=U.handler;return J(I,Y,{corp:q})}import{existsSync as kZ0}from"node:fs";var cH1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"]);function SZ0($,I){let q=$&&typeof $==="object"?$:{},z=typeof q.type==="string"?q.type.toUpperCase().trim():"",U=typeof q.key==="string"&&q.key.trim()?q.key.trim():typeof q.label==="string"&&q.label.trim()?q.label.trim():`field_${I}`,Y=typeof q.label==="string"&&q.label.trim()?q.label.trim():U,J=q.value!==void 0?q.value:null;if(z==="LIST"&&Array.isArray(J))J=J.map((w)=>{if(Array.isArray(w))return w.map((K,H)=>SZ0(K,H));return w});let Q=z;if(!cH1.has(Q))if(Array.isArray(J))Q="LIST";else if(J&&typeof J==="object")Q="OBJECT";else if(typeof J==="number")Q="NUMBER";else Q="TEXT";return{key:U,label:Y,type:Q,value:J}}function uZ0($,I={}){let q=$.document,z=$.sourceDocumentSN??(typeof q?.sn==="string"?q.sn:void 0)??(typeof q?.sourceDocumentSN==="string"?q.sourceDocumentSN:void 0)??$.id,U=$.sourceDocumentId??(typeof q?.id==="string"?q.id:void 0)??(typeof q?.sourceDocumentId==="string"?q.sourceDocumentId:void 0)??$.documentId??$.id,Y=I.snPrefix??"",J=I.snSuffix??"",Q=I.docIdPrefix??Y,w=I.docIdSuffix??J,K=`${Y}${z}${J}`,H=`${Q}${U}${w}`,G=typeof q?.sourceStartTime==="number"?q.sourceStartTime:typeof $.createdAt==="number"?Math.floor($.createdAt/1000):null,V=(Array.isArray(q?.fields)?q.fields:[]).map((X,L)=>SZ0(X,L));return{type:"document",documentId:H,documentSN:K,startTime:G,fields:V}}function dH1($){let I=new URL($),q=I.pathname.match(/\/webhook\/([^/]+)/);if(!q)throw Error(`Webhook URL 必须包含 /webhook/{webhookId}/document,收到: ${$}`);let z=q[1],U=`${I.protocol}//${I.host}`,Y=`${U}/api/v1/integrations/webhook/${encodeURIComponent(z)}/document`;return{baseUrl:U,webhookId:z,documentEndpoint:Y}}async function yZ0($,I,q,z=fetch){let{webhookId:U,documentEndpoint:Y}=dH1($),J={"Content-Type":"application/json",...Zw({webhookId:U,...q},I)},Q=await z(Y,{method:"POST",headers:J,body:JSON.stringify(q)});if(!Q.ok){let w=await Q.text();throw Error(`Webhook 单据推送失败 (${Q.status}): ${w}`)}return Q.json()}function xZ0($,I,q){if(I){let z=I.trim().toLowerCase(),U=$.find((Y)=>Y.id.toLowerCase()===z||Y.name.toLowerCase()===z||Y.incomingDocumentWebhook.id.toLowerCase()===z);if(!U){let Y=$.map((J)=>`"${J.name}" (${J.id})`).join(", ");throw Error(`未找到匹配 "${I}" 的 Webhook 集成通道。可用通道: [${Y}]`)}return U}if($.length===1)return $[0];if($.length>1){let z=$.map((U)=>`"${U.name}" (${U.id})`).join(", ");throw Error(`当前租户存在多个 Webhook 通道 [${z}],请通过 --webhook <idOrName> 指定目标通道。`)}throw new l$("当前租户未配置任何 Webhook 集成通道。",1,`seal-use webhook add --name <name> --result-url <url>${q?` --corp ${q}`:""}`)}async function fZ0($,I){if(!kZ0($))throw Error(`File not found: ${$}`);let q=XI($);console.log(JSON.stringify(await ZI(q.fileBuffer,q.fileName,I),null,2))}async function pD($,I,q,z,U){if($==="ready"||$==="status"){let Y=I??C(U.options.file)??C(U.options.input),J=await _D(q,z,{filePath:Y,webhook:C(U.options.webhook)??C(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-read Line truncated
`);let A=await yZ0(V.incomingDocumentWebhook.url,V.secret,P),g={success:!0,sourceCorp:{id:w.id,name:w.name},targetCorp:{id:z.id,name:z.name},targetWebhook:{id:V.id,name:V.name,mode:V.mode,incomingDocumentWebhookUrl:V.incomingDocumentWebhook.url},originalRecord:{id:H.id,sourceSystem:H.sourceSystem,sourceDocumentSN:H.sourceDocumentSN,sourceDocumentId:H.sourceDocumentId},replayedDocument:{documentSN:P.documentSN,documentId:P.documentId,fieldCount:P.fields.length},pushResult:A};console.error(`\uD83D\uDFE2 成功重放单据「${P.documentSN}」至 ${z.name} (${V.name})`),console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${z.id} --limit 1`),console.log(JSON.stringify(g,null,2));return}if($==="material-pack"||$==="material-pack-push"){let Y=$==="material-pack-push"?"push":I,J=$==="material-pack-push"?C(U.options.file)??C(U.options.input):U.command[3]??C(U.options.file)??C(U.options.input);if(!J)throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");if(!kZ0(J))throw Error(`File not found: ${J}`);let Q=XI(J);if(Y==="preview"){console.log(JSON.stringify(await ZI(Q.fileBuffer,Q.fileName),null,2));return}if(Y!=="push")throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");let w=C(U.options.webhook)??C(U.options.selector),K=await Z5(q,z.seal.endpoints.approvalStylePreferences),H;if(w)H=E9(K,w);else if(K.length===1)H=K[0],console.error(`\uD83D\uDC49 自动锁定唯一可用 Webhook 通道: ${H.name} (${H.id})`);else if(K.length>1){let W=K.map((V)=>`"${V.name}" (${V.id})`).join(", ");throw Error(`当前租户存在多个 Webhook 通道 [${W}],请通过 --webhook <idOrName> 指定目标通道。`)}else throw new l$("当前租户未配置任何 Webhook 集成通道。",1,`seal-use webhook add --name <name> --result-url <url> --corp ${z.id}`);let G=await CD(Q.fileBuffer,Q.fileName,{webhookUrl:H.incomingDocumentWebhook.url,secret:H.secret,materialPackFilePolicy:H.materialPackFilePolicy});console.log(JSON.stringify(G,null,2));return}if($==="list"){await F0("seal_webhook_list",q,z,{query:C(U.options.query)??C(U.options.keyword),includeSecret:ty(U.options)},W0(U.options));return}if($==="get"||$==="find"){let Y=I??C(U.options.selector)??C(U.options.id);if(!Y)throw Error("Usage: seal-use webhook get <idOrName> [--show-secret]");await F0("seal_webhook_get",q,z,{selector:Y,includeSecret:ty(U.options)},W0(U.options));return}if($==="add"||$==="create"){let Y=C(U.options.name)??I,J=C(U.options.resultUrl)??C(U.options["result-url"])??C(U.options.outgoingResultWebhook)??C(U.options["outgoing-result-webhook"]);if(!Y||!J)throw Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");let Q=ry(U.options),w=Bw(U.options),K=O0(U.options.dryRun)??O0(U.options["dry-run"]);await F0("seal_webhook_add",q,z,{name:Y,mode:oy(C(U.options.mode)),outgoingResultWebhook:J,autoApprovalRate:Q,secret:C(U.options.secret),materialPackFilePolicy:w,dryRun:K},W0(U.options));return}if($==="update"){let Y=I??C(U.options.selector)??C(U.options.id);if(!Y)throw Error("Usage: seal-use webhook update <idOrName> [options]");let J=C(U.options.secret),Q=O0(U.options.rotateSecret)??O0(U.options["rotate-secret"]);if(J!==void 0&&Q)throw N4("Use either --secret or --rotate-secret, not both");let w=C(U.options.name),K=oy(C(U.options.mode)),H=C(U.options.resultUrl)??C(U.options["result-url"])??C(U.options.outgoingResultWebhook)??C(U.options["outgoing-result-webhook"]),G=ry(U.options),W=Bw(U.options),V=O0(U.options.dryRun)??O0(U.options["dry-run"]);if(w===void 0&&K===void 0&&H===void 0&&G===void 0&&J===void 0&&!Q&&W===void 0&&!V)throw N4("Webhook update requires at least one field option");await F0("seal_webhook_update",q,z,{selector:Y,name:w,mode:K,outgoingResultWebhook:H,autoApprovalRate:G,secret:J,rotateSecret:Q,materialPackFilePolicy:W,dryRun:V},W0(U.options));return}if($==="delete"){let Y=I??C(U.options.selector)??C(U.options.id),J=O0(U.options.dryRun)??O0(U.options["dry-run"]);if(!Y)throw Error("Usage: seal-use webhook delete <idOrName> [--yes|--dry-run]");if(O0(U.options.yes)!==!0&&!J)throw I5("Refusing to delete Webhook integration without --yes",`seal-use webhook delete ${Y} --corp ${z.id} --yes`);await F0("seal_webhook_delete",q,z,{selector:Y,confirm:!0,dryRun:J},W0(U.options));return}throw Error(`Unknown webhook command: ${$??""}. Run 'seal-use help' for available commands.`)}async function nZ0($,I,q,z,U){if($==="replay"){await pD("replay",I,q,z,U);return}if($==="summary"){let Y=await FI("seal_approval_runs_summary",q,z,{date:C(U.options.date),timezone:C(U.options.timezone),limit:b0(U.options.limit),startDate:C(U.options.startDate),endDate:C(U.options.endDate),status:C(U.options.status),taskMode:C(U.options.taskMode),manualApprovalStatus:C(U.options.manualApprovalStatus),sourceDocumentSN:C(U.options.sourceDocumentSN),sourceDocumentId:C(U.options.sourceDocumentId),humanResult:C(U.options.humanResult),query:C(U.options.query Line truncated
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Y=_1(z),J=_1(U);if(Y.id===J.id)throw N4(`Cannot bind enterprise '${Y.id}' to itself.`);if(Y.prodCorpId&&Y.prodCorpId!==J.id)throw N4(`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 N4(`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=O0(q.options.force)===!0;if(Y.testCorpId&&Y.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Y.id){if(!Q)throw I5(`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(!(O0(q.options.confirm)===!0||O0(q.options.yes)===!0)){let G=Q?" --force":"";throw I5(`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{P7(Y.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Y.id)try{P7(J.prodCorpId,{testCorpId:void 0})}catch{}let K=P7(Y.id,{environment:"production",testCorpId:J.id}),H=P7(J.id,{environment:"test",prodCorpId:Y.id});E0({success:!0,productionEnterprise:{id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let z=I??C(q.options.corp),U=_1(z);if(!U.testCorpId&&!U.prodCorpId){E0({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(!(O0(q.options.confirm)===!0||O0(q.options.yes)===!0))throw I5(`Refusing to unbind production enterprise '${Y}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${U.id} --confirm`);P7(Y,{testCorpId:void 0});try{P7(J,{prodCorpId:void 0})}catch{}E0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let z=I??C(q.options.corp),U=_1(z);if(!U.testCorpId)throw N4(`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=_1(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 y1(U),Q=await y1(Y),[w,K,H,G,W,V,X,L]=await Promise.all([M1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),M1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),_6(J),_6(Q),R$(J).catch(()=>[]),R$(Q).catch(()=>[]),T9(J,{limit:100}).catch(()=>({articles:[]})),T9(Q,{limit:100}).catch(()=>({articles:[]}))]),D=(X.articles||[]).filter((Y0)=>!Y0.isDeleted),F=(L.articles||[]).filter((Y0)=>!Y0.isDeleted),P=new Map(F.map((Y0)=>[Y0.title.trim(),Y0])),T=[],A=[],g=new Set(D.map((Y0)=>Y0.title.trim()));for(let Y0 of D){let g0=Y0.title.trim(),q1=P.get(g0);if(!q1)T.push(Y0);else{let O1=q1.content!==Y0.content,i4=(q1.purpose??"")!==(Y0.purpose??""),n6=q1.enabled!==Y0.enabled,M$=q1.contentType!==Y0.contentType,i6=(q1.status??"")!==(Y0.status??""),T6=JSON.stringify([...q1.scenarios??[]].sort())!==JSON.stringify([...Y0.scenarios??[]].sort()),A$=JSON.stringify([...q1.tags??[]].sort())!==JSON.stringify([...Y0.tags??[]].sort());if(O1||i4||n6||M$||i6||T6||A$)A.push({testId:q1.id,prodDoc:Y0,reasons:[...O1?["content"]:[],...i4?["purpose"]:[],...n6?["enabled"]:[],...M$?["contentType"]:[],...i6?["status"]:[],...T6?["scenarios"]:[],...A$?["tags"]:[]]})}}let k=F.filter((Y0)=>!g.has(Y0.title.trim())),f=[...W].sort((Y0,g0)=>g0.versionNumber-Y0.versionNumber)[0],v=f?.versionNumber,b=([...V].sort((Y0,g0)=>g0.versionNumber-Y0.versionNumber)[0]?.versionNumber??0)+1,h=zL0(U.name,v,V),i=C(q.options["version-name"])??C(q.options.versionName)??UL0(U.name,v,h,b),q0={...K,tone:w.tone,language:w.language,detailLevel:w.detailLevel,outputFormat:w.outputFormat,examples:w.examples??[],prohibitedPhrases:w.prohibitedPhrases??[],customInstructions:w.customInstructions,decisionPreferences:w.decisionPreferences,thinkingDepthPreference:w.thinkingDepthPreference};if(O0(q.options["dry-run"])===!0||O0(q.options.dryRun)===!0){E0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:f?{versionNumber:f.versionNumber,versionName:f.versionName}:null,documentsCount:D.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:v??null,sourceProdVersionName:f?.versionName??null,targetTestExpectedVersionNumber:b,targetTestPublishVersionName:i,iteration:h},preferencesDiff:{decisionPreferences:{before:K.decisionPreferences,after:w.decisionPreferences},thinkingDepthPreference:{before:K.thinkingDepthPreference,after:w.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:G.rules.length,toDeleteCount:G.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((Y0,g0)=>({index:g0+1,sourceRuleId:Y0.id,sourceRuleCode:Y0.code??g0+1,expectedTargetCode:`rule-${g0+1}`,description:Y0.description,scope:Y0.scope,strictness:Y0.strictness}))},documentsPlan:{sourceDocumentCount:D.length,targetExistingDocumentCount:F.length,toCreateCount:T.length,toCreate:T.map((Y0)=>({title:Y0.title,purpose:Y0.purpose,contentType:Y0.contentType,scenarios:Y0.scenarios})),toUpdateCount:A.length,toUpdate:A.map((Y0)=>({targetDocumentId:Y0.testId,title:Y0.prodDoc.title,reasons:Y0.reasons})),toDeleteCount:k.length,toDelete:k.map((Y0)=>({targetDocumentId:Y0.id,title:Y0.title}))},publishingPlan:{targetCorpId:Y.id,publishVersionName:i,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 Y0=(w.integrations??[]).filter((O1)=>O1.type==="hosecloud"),g0=new Set,q1=Y0.filter((O1)=>{let i4=O1.corporationId??U.id;if(g0.has(i4))return!1;return g0.add(i4),!0});return{sourceType:"hose",outboundName:HL0(U.name),targetMode:"assisted",integrationsCount:q1.length,integrations:q1.map((O1)=>({corporationId:O1.corporationId,apiOrigin:O1.apiOrigin,customApiUrl:O1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(O0(q.options.yes)===!0||O0(q.options.confirm)===!0))throw I5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${H.rules.length} draft rules, and ${D.length} knowledge documents from production enterprise '${U.name}' (${U.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${U.id} --yes`);await T8(Q,q0,Y.seal.endpoints.approvalStylePreferences);let c=[];for(let Y0 of k)await QW(Q,Y0.id),c.push({id:Y0.id,title:Y0.title});let r=[];for(let Y0 of A)await JW(Q,Y0.testId,{title:Y0.prodDoc.title,purpose:Y0.prodDoc.purpose,content:Y0.prodDoc.content,contentType:Y0.prodDoc.contentType,status:Y0.prodDoc.status,enabled:Y0.prodDoc.ena Line truncated
`}function _w($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function E0($,I={}){$G1($,I);let q=`${JSON.stringify($,null,2)}
`;if(I.outputFile){tH1(I.outputFile,q),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(q,"utf-8")},null,2));return}console.log(q.trimEnd())}function $G1($,I={}){if(I.allowFull||I.outputFile)return;let q=Buffer.byteLength(JSON.stringify($),"utf-8");if(q>eH1)throw new pD(`Output is large (${q} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function fZ0($,I){if(I)return;let q=$&&typeof $==="object"?$:{},z=typeof q.count==="number"?q.count:void 0,U=Array.isArray(q.rules)?q.rules.length:void 0,Y=Buffer.byteLength(JSON.stringify($),"utf-8"),J=z??U??0;if(J>aH1||Y>sH1)throw new pD(`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 W0($){return{allowFull:O0($.full)===!0,outputFile:C($.outputFile)??C($["output-file"])}}function nZ0($=[]){console.log(xZ0($))}function _1($){let I=c$(),q=K4();return vU(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$},HI())}function NI($=K4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:GI()}}async function F0($,I,q,z,U={}){E0(await MI($,I,q,z),U)}async function MI($,I,q,z){let U=jw.find((Q)=>Q.name===$);if(!U)throw Error(`Unknown Seal tool: ${$}`);let Y=Object.fromEntries(Object.entries(z).filter(([,Q])=>Q!==void 0)),J=U.handler;return J(I,Y,{corp:q})}import{existsSync as dZ0}from"node:fs";var IG1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"]);function bZ0($,I){let q=$&&typeof $==="object"?$:{},z=typeof q.type==="string"?q.type.toUpperCase().trim():"",U=typeof q.key==="string"&&q.key.trim()?q.key.trim():typeof q.label==="string"&&q.label.trim()?q.label.trim():`field_${I}`,Y=typeof q.label==="string"&&q.label.trim()?q.label.trim():U,J=q.value!==void 0?q.value:null;if(z==="LIST"&&Array.isArray(J))J=J.map((w)=>{if(Array.isArray(w))return w.map((K,H)=>bZ0(K,H));return w});let Q=z;if(!IG1.has(Q))if(Array.isArray(J))Q="LIST";else if(J&&typeof J==="object")Q="OBJECT";else if(typeof J==="number")Q="NUMBER";else Q="TEXT";return{key:U,label:Y,type:Q,value:J}}function iZ0($,I={}){let q=$.document,z=$.sourceDocumentSN??(typeof q?.sn==="string"?q.sn:void 0)??(typeof q?.sourceDocumentSN==="string"?q.sourceDocumentSN:void 0)??$.id,U=$.sourceDocumentId??(typeof q?.id==="string"?q.id:void 0)??(typeof q?.sourceDocumentId==="string"?q.sourceDocumentId:void 0)??$.documentId??$.id,Y=I.snPrefix??"",J=I.snSuffix??"",Q=I.docIdPrefix??Y,w=I.docIdSuffix??J,K=`${Y}${z}${J}`,H=`${Q}${U}${w}`,G=typeof q?.sourceStartTime==="number"?q.sourceStartTime:typeof $.createdAt==="number"?Math.floor($.createdAt/1000):null,V=(Array.isArray(q?.fields)?q.fields:[]).map((X,L)=>bZ0(X,L));return{type:"document",documentId:H,documentSN:K,startTime:G,fields:V}}function qG1($){let I=new URL($),q=I.pathname.match(/\/webhook\/([^/]+)/);if(!q)throw Error(`Webhook URL 必须包含 /webhook/{webhookId}/document,收到: ${$}`);let z=q[1],U=`${I.protocol}//${I.host}`,Y=`${U}/api/v1/integrations/webhook/${encodeURIComponent(z)}/document`;return{baseUrl:U,webhookId:z,documentEndpoint:Y}}async function pZ0($,I,q,z=fetch){let{webhookId:U,documentEndpoint:Y}=qG1($),J={"Content-Type":"application/json",...Dw({webhookId:U,...q},I)},Q=await z(Y,{method:"POST",headers:J,body:JSON.stringify(q)});if(!Q.ok){let w=await Q.text();throw Error(`Webhook 单据推送失败 (${Q.status}): ${w}`)}return Q.json()}function cZ0($,I,q){if(I){let z=I.trim().toLowerCase(),U=$.find((Y)=>Y.id.toLowerCase()===z||Y.name.toLowerCase()===z||Y.incomingDocumentWebhook.id.toLowerCase()===z);if(!U){let Y=$.map((J)=>`"${J.name}" (${J.id})`).join(", ");throw Error(`未找到匹配 "${I}" 的 Webhook 集成通道。可用通道: [${Y}]`)}return U}if($.length===1)return $[0];if($.length>1){let z=$.map((U)=>`"${U.name}" (${U.id})`).join(", ");throw Error(`当前租户存在多个 Webhook 通道 [${z}],请通过 --webhook <idOrName> 指定目标通道。`)}throw new r$("当前租户未配置任何 Webhook 集成通道。",1,`seal-use webhook add --name <name> --result-url <url>${q?` --corp ${q}`:""}`)}async function mZ0($,I){if(!dZ0($))throw Error(`File not found: ${$}`);let q=DI($);console.log(JSON.stringify(await LI(q.fileBuffer,q.fileName,I),null,2))}async function dD($,I,q,z,U){if($==="ready"||$==="status"){let Y=I??C(U.options.file)??C(U.options.input),J=await SD(q,z,{filePath:Y,webhook:C(U.options.webhook)??C(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-read Line truncated
`);let A=await pZ0(V.incomingDocumentWebhook.url,V.secret,P),g={success:!0,sourceCorp:{id:w.id,name:w.name},targetCorp:{id:z.id,name:z.name},targetWebhook:{id:V.id,name:V.name,mode:V.mode,incomingDocumentWebhookUrl:V.incomingDocumentWebhook.url},originalRecord:{id:H.id,sourceSystem:H.sourceSystem,sourceDocumentSN:H.sourceDocumentSN,sourceDocumentId:H.sourceDocumentId},replayedDocument:{documentSN:P.documentSN,documentId:P.documentId,fieldCount:P.fields.length},pushResult:A};console.error(`\uD83D\uDFE2 成功重放单据「${P.documentSN}」至 ${z.name} (${V.name})`),console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${z.id} --limit 1`),console.log(JSON.stringify(g,null,2));return}if($==="material-pack"||$==="material-pack-push"){let Y=$==="material-pack-push"?"push":I,J=$==="material-pack-push"?C(U.options.file)??C(U.options.input):U.command[3]??C(U.options.file)??C(U.options.input);if(!J)throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");if(!dZ0(J))throw Error(`File not found: ${J}`);let Q=DI(J);if(Y==="preview"){console.log(JSON.stringify(await LI(Q.fileBuffer,Q.fileName),null,2));return}if(Y!=="push")throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");let w=C(U.options.webhook)??C(U.options.selector),K=await X5(q,z.seal.endpoints.approvalStylePreferences),H;if(w)H=j9(K,w);else if(K.length===1)H=K[0],console.error(`\uD83D\uDC49 自动锁定唯一可用 Webhook 通道: ${H.name} (${H.id})`);else if(K.length>1){let W=K.map((V)=>`"${V.name}" (${V.id})`).join(", ");throw Error(`当前租户存在多个 Webhook 通道 [${W}],请通过 --webhook <idOrName> 指定目标通道。`)}else throw new r$("当前租户未配置任何 Webhook 集成通道。",1,`seal-use webhook add --name <name> --result-url <url> --corp ${z.id}`);let G=await hD(Q.fileBuffer,Q.fileName,{webhookUrl:H.incomingDocumentWebhook.url,secret:H.secret,materialPackFilePolicy:H.materialPackFilePolicy});console.log(JSON.stringify(G,null,2));return}if($==="list"){await F0("seal_webhook_list",q,z,{query:C(U.options.query)??C(U.options.keyword),includeSecret:sy(U.options)},W0(U.options));return}if($==="get"||$==="find"){let Y=I??C(U.options.selector)??C(U.options.id);if(!Y)throw Error("Usage: seal-use webhook get <idOrName> [--show-secret]");await F0("seal_webhook_get",q,z,{selector:Y,includeSecret:sy(U.options)},W0(U.options));return}if($==="add"||$==="create"){let Y=C(U.options.name)??I,J=C(U.options.resultUrl)??C(U.options["result-url"])??C(U.options.outgoingResultWebhook)??C(U.options["outgoing-result-webhook"]);if(!Y||!J)throw Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");let Q=ay(U.options),w=Rw(U.options),K=O0(U.options.dryRun)??O0(U.options["dry-run"]);await F0("seal_webhook_add",q,z,{name:Y,mode:ty(C(U.options.mode)),outgoingResultWebhook:J,autoApprovalRate:Q,secret:C(U.options.secret),materialPackFilePolicy:w,dryRun:K},W0(U.options));return}if($==="update"){let Y=I??C(U.options.selector)??C(U.options.id);if(!Y)throw Error("Usage: seal-use webhook update <idOrName> [options]");let J=C(U.options.secret),Q=O0(U.options.rotateSecret)??O0(U.options["rotate-secret"]);if(J!==void 0&&Q)throw N4("Use either --secret or --rotate-secret, not both");let w=C(U.options.name),K=ty(C(U.options.mode)),H=C(U.options.resultUrl)??C(U.options["result-url"])??C(U.options.outgoingResultWebhook)??C(U.options["outgoing-result-webhook"]),G=ay(U.options),W=Rw(U.options),V=O0(U.options.dryRun)??O0(U.options["dry-run"]);if(w===void 0&&K===void 0&&H===void 0&&G===void 0&&J===void 0&&!Q&&W===void 0&&!V)throw N4("Webhook update requires at least one field option");await F0("seal_webhook_update",q,z,{selector:Y,name:w,mode:K,outgoingResultWebhook:H,autoApprovalRate:G,secret:J,rotateSecret:Q,materialPackFilePolicy:W,dryRun:V},W0(U.options));return}if($==="delete"){let Y=I??C(U.options.selector)??C(U.options.id),J=O0(U.options.dryRun)??O0(U.options["dry-run"]);if(!Y)throw Error("Usage: seal-use webhook delete <idOrName> [--yes|--dry-run]");if(O0(U.options.yes)!==!0&&!J)throw q5("Refusing to delete Webhook integration without --yes",`seal-use webhook delete ${Y} --corp ${z.id} --yes`);await F0("seal_webhook_delete",q,z,{selector:Y,confirm:!0,dryRun:J},W0(U.options));return}throw Error(`Unknown webhook command: ${$??""}. Run 'seal-use help' for available commands.`)}async function lZ0($,I,q,z,U){if($==="replay"){await dD("replay",I,q,z,U);return}if($==="summary"){let Y=await MI("seal_approval_runs_summary",q,z,{date:C(U.options.date),timezone:C(U.options.timezone),limit:i0(U.options.limit),startDate:C(U.options.startDate),endDate:C(U.options.endDate),status:C(U.options.status),taskMode:C(U.options.taskMode),manualApprovalStatus:C(U.options.manualApprovalStatus),sourceDocumentSN:C(U.options.sourceDocumentSN),sourceDocumentId:C(U.options.sourceDocumentId),humanResult:C(U.options.humanResult),query:C(U.options.query Line truncated
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Y=_1(z),J=_1(U);if(Y.id===J.id)throw N4(`Cannot bind enterprise '${Y.id}' to itself.`);if(Y.prodCorpId&&Y.prodCorpId!==J.id)throw N4(`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 N4(`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=O0(q.options.force)===!0;if(Y.testCorpId&&Y.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Y.id){if(!Q)throw q5(`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(!(O0(q.options.confirm)===!0||O0(q.options.yes)===!0)){let G=Q?" --force":"";throw q5(`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{E7(Y.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Y.id)try{E7(J.prodCorpId,{testCorpId:void 0})}catch{}let K=E7(Y.id,{environment:"production",testCorpId:J.id}),H=E7(J.id,{environment:"test",prodCorpId:Y.id});E0({success:!0,productionEnterprise:{id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let z=I??C(q.options.corp),U=_1(z);if(!U.testCorpId&&!U.prodCorpId){E0({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(!(O0(q.options.confirm)===!0||O0(q.options.yes)===!0))throw q5(`Refusing to unbind production enterprise '${Y}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${U.id} --confirm`);E7(Y,{testCorpId:void 0});try{E7(J,{prodCorpId:void 0})}catch{}E0({success:!0,unboundProduction:Y,unboundTest:J});return}if($==="sync-test"){let z=I??C(q.options.corp),U=_1(z);if(!U.testCorpId)throw N4(`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=_1(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 y1(U),Q=await y1(Y),[w,K,H,G,W,V,X,L]=await Promise.all([M1(J,U.seal.endpoints.approvalStylePreferences).catch(()=>({})),M1(Q,Y.seal.endpoints.approvalStylePreferences).catch(()=>({})),_6(J),_6(Q),C$(J).catch(()=>[]),C$(Q).catch(()=>[]),B9(J,{limit:100}).catch(()=>({articles:[]})),B9(Q,{limit:100}).catch(()=>({articles:[]}))]),D=(X.articles||[]).filter((Y0)=>!Y0.isDeleted),O=(L.articles||[]).filter((Y0)=>!Y0.isDeleted),P=new Map(O.map((Y0)=>[Y0.title.trim(),Y0])),T=[],A=[],g=new Set(D.map((Y0)=>Y0.title.trim()));for(let Y0 of D){let g0=Y0.title.trim(),z1=P.get(g0);if(!z1)T.push(Y0);else{let O1=z1.content!==Y0.content,b4=(z1.purpose??"")!==(Y0.purpose??""),n6=z1.enabled!==Y0.enabled,A$=z1.contentType!==Y0.contentType,b6=(z1.status??"")!==(Y0.status??""),T6=JSON.stringify([...z1.scenarios??[]].sort())!==JSON.stringify([...Y0.scenarios??[]].sort()),P$=JSON.stringify([...z1.tags??[]].sort())!==JSON.stringify([...Y0.tags??[]].sort());if(O1||b4||n6||A$||b6||T6||P$)A.push({testId:z1.id,prodDoc:Y0,reasons:[...O1?["content"]:[],...b4?["purpose"]:[],...n6?["enabled"]:[],...A$?["contentType"]:[],...b6?["status"]:[],...T6?["scenarios"]:[],...P$?["tags"]:[]]})}}let k=O.filter((Y0)=>!g.has(Y0.title.trim())),f=[...W].sort((Y0,g0)=>g0.versionNumber-Y0.versionNumber)[0],v=f?.versionNumber,i=([...V].sort((Y0,g0)=>g0.versionNumber-Y0.versionNumber)[0]?.versionNumber??0)+1,h=HL0(U.name,v,V),b=C(q.options["version-name"])??C(q.options.versionName)??GL0(U.name,v,h,i),q0={...K,tone:w.tone,language:w.language,detailLevel:w.detailLevel,outputFormat:w.outputFormat,examples:w.examples??[],prohibitedPhrases:w.prohibitedPhrases??[],customInstructions:w.customInstructions,decisionPreferences:w.decisionPreferences,thinkingDepthPreference:w.thinkingDepthPreference};if(O0(q.options["dry-run"])===!0||O0(q.options.dryRun)===!0){E0({dryRun:!0,source:{id:U.id,name:U.name,environment:U.environment,latestPublishedVersion:f?{versionNumber:f.versionNumber,versionName:f.versionName}:null,documentsCount:D.length},target:{id:Y.id,name:Y.name,environment:Y.environment},versionMappingPlan:{sourceProdVersionNumber:v??null,sourceProdVersionName:f?.versionName??null,targetTestExpectedVersionNumber:i,targetTestPublishVersionName:b,iteration:h},preferencesDiff:{decisionPreferences:{before:K.decisionPreferences,after:w.decisionPreferences},thinkingDepthPreference:{before:K.thinkingDepthPreference,after:w.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:G.rules.length,toDeleteCount:G.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((Y0,g0)=>({index:g0+1,sourceRuleId:Y0.id,sourceRuleCode:Y0.code??g0+1,expectedTargetCode:`rule-${g0+1}`,description:Y0.description,scope:Y0.scope,strictness:Y0.strictness}))},documentsPlan:{sourceDocumentCount:D.length,targetExistingDocumentCount:O.length,toCreateCount:T.length,toCreate:T.map((Y0)=>({title:Y0.title,purpose:Y0.purpose,contentType:Y0.contentType,scenarios:Y0.scenarios})),toUpdateCount:A.length,toUpdate:A.map((Y0)=>({targetDocumentId:Y0.testId,title:Y0.prodDoc.title,reasons:Y0.reasons})),toDeleteCount:k.length,toDelete:k.map((Y0)=>({targetDocumentId:Y0.id,title:Y0.title}))},publishingPlan:{targetCorpId:Y.id,publishVersionName:b,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 Y0=(w.integrations??[]).filter((O1)=>O1.type==="hosecloud"),g0=new Set,z1=Y0.filter((O1)=>{let b4=O1.corporationId??U.id;if(g0.has(b4))return!1;return g0.add(b4),!0});return{sourceType:"hose",outboundName:DL0(U.name),targetMode:"assisted",integrationsCount:z1.length,integrations:z1.map((O1)=>({corporationId:O1.corporationId,apiOrigin:O1.apiOrigin,customApiUrl:O1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(O0(q.options.yes)===!0||O0(q.options.confirm)===!0))throw q5(`Refusing to overwrite test enterprise '${Y.name}' (${Y.id}) with preferences, ${H.rules.length} draft rules, and ${D.length} knowledge documents from production enterprise '${U.name}' (${U.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${U.id} --yes`);await B8(Q,q0,Y.seal.endpoints.approvalStylePreferences);let c=[];for(let Y0 of k)await KW(Q,Y0.id),c.push({id:Y0.id,title:Y0.title});let r=[];for(let Y0 of A)await wW(Q,Y0.testId,{title:Y0.prodDoc.title,purpose:Y0.prodDoc.purpose,content:Y0.prodDoc.content,contentType:Y0.prodDoc.contentType,status:Y0.prodDoc.status,enabled:Y0.prodDoc.ena Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${v.length} candidate administrators:
- ${p}
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 D=m1($,"id")??W,F=V??W,P=m1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,T={id:D,name:F,environment:"production",seal:{url:P,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:G,appKey:q,appSecurity:z,corpId:W,staffId:L},auth:{refreshTtl:300}};if(H)bG(D),await fU(T);let A=yu();JL0(A,{recursive:!0,mode:448});let g=wL0(A,`${ly(D)}.json`);if(YL0(g)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${g}. Pass "overwrite": true to replace it.`);QL0(g,`${JSON.stringify(T,null,2)}
`,{mode:384}),E0({id:D,name:F,corpId:W,domain:G,staffId:L,verified:H,path:g})}async function gG1($){let I=j7($,"token"),q=(m1($,"sealUrl")??m1($,"url")??"").replace(/\/+$/,"");if(!q)throw Error("Missing required JSON field: sealUrl");let z=AZ0($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=GL0($),J=U?await RG1(q,I,MJ(Y)):void 0;WL0($,{token:I,sealUrl:q,expiresIn:z,verify:U,remote:J,custom:Y})}function GL0($){return{headers:_u.parse($.headers),cookies:hu.parse($.cookies)}}async function vG1($,I,q){let z=await pG($),U=AJ(z.sealUrl,z.token),Y=await H$(U),J={user:Y.user,tenant:Y.tenant};cG(z.corpId,J.tenant),WL0({id:z.corpId,corpId:z.corpId,name:I,provider:"hosecloud",overwrite:q},{token:z.token,sealUrl:z.sealUrl,expiresIn:z.expiresIn,verify:!0,remote:J})}function WL0($,I){let{token:q,sealUrl:z,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??GL0($),w=J?.user,K=J?.tenant,H=m1($,"tenantSlug")??g7(K?.tenantSlug),G=m1($,"tenantId")??g7(K?.id),W=m1($,"tenantName")??g7(K?.name),V=m1($,"id")??H??G;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let X=m1($,"staffId")??g7(w?.providerUserId)??g7(w?.id)??"seal",L=m1($,"provider")??g7(w?.provider)??g7(K?.providerConfig?.provider),D=m1($,"corpId")??H??G??V,F={id:V,name:m1($,"name")??W??V,environment:"production",seal:{url:z,tenantSlug:H,headers:Q.headers,cookies:Q.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:q,sealUrl:z,expiresIn:U,staffId:X,corpId:D,tenantId:G,tenantSlug:H,tenantName:W,providerUserId:g7(w?.providerUserId),provider:L},auth:{refreshTtl:300}},P=yu();JL0(P,{recursive:!0,mode:448});let T=wL0(P,`${ly(V)}.json`);if(YL0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);QL0(T,`${JSON.stringify(F,null,2)}
`,{mode:384}),E0({id:V,name:F.name,tenantId:G,tenantSlug:H,verified:Y,path:T})}async function RG1($,I,q={}){let z=await CG1(`${$}/api/v1/auth/me`,{...q,authorization:`Bearer ${I}`}),U=aD(z.data);return{user:aD(U.user??z.user),tenant:aD(U.tenant??z.tenant)}}async function CG1($,I={}){let q=await fetch($,{headers:I}),z=await q.text();if(!q.ok)throw Error(`${q.status} ${z}`);let U=JSON.parse(z);return aD(U)}function aD($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function g7($){return typeof $==="string"&&$?$:void 0}async function VL0($,I){let q=await pG($),z=AJ(q.sealUrl,q.token),U=await H$(z);cG(q.corpId,U.tenant);let Y=await vq(z,{note:I});E0({tenant:{id:U.tenant.id,name:U.tenant.name,tenantSlug:U.tenant.tenantSlug,corpId:q.corpId},user:{id:U.user.id,name:U.user.name,providerUserId:U.user.providerUserId,isAdmin:U.user.isAdmin},delegation:Y,expiresIn:q.expiresIn})}async function ZL0($,I,q,z,U){if($==="list"){await F0("seal_delegation_list",q,z,{},W0(U.options));return}if($==="create"){let Y=C(U.options.note)??(I?[I,...U.command.slice(2)].join(" "):void 0);await F0("seal_delegation_create",q,z,{note:Y},W0(U.options));return}if($==="revoke"){let Y=I??C(U.options.tokenId);if(!Y)throw Error("Usage: seal-use delegation revoke <tokenId>");await F0("seal_delegation_revoke",q,z,{tokenId:Y},W0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as _G1}from"node:fs";async function XL0($,I,q,z,U,Y){if(!$||$==="help")throw Error(`Usage: seal-use deploy <system> <action> [options]
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 D=m1($,"id")??W,O=V??W,P=m1($,"sealUrl")??`https://${W.toLowerCase()}.sealai.cc`,T={id:D,name:O,environment:"production",seal:{url:P,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:G,appKey:q,appSecurity:z,corpId:W,staffId:L},auth:{refreshTtl:300}};if(H)cG(D),await iU(T);let A=ku();VL0(A,{recursive:!0,mode:448});let g=XL0(A,`${ry(D)}.json`);if(WL0(g)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${g}. Pass "overwrite": true to replace it.`);ZL0(g,`${JSON.stringify(T,null,2)}
`,{mode:384}),E0({id:D,name:O,corpId:W,domain:G,staffId:L,verified:H,path:g})}async function fG1($){let I=g7($,"token"),q=(m1($,"sealUrl")??m1($,"url")??"").replace(/\/+$/,"");if(!q)throw Error("Missing required JSON field: sealUrl");let z=vZ0($,"expiresIn")??2592000,U=$.force===!0||$.verify===!1?!1:!0,Y=OL0($),J=U?await bG1(q,I,TJ(Y)):void 0;FL0($,{token:I,sealUrl:q,expiresIn:z,verify:U,remote:J,custom:Y})}function OL0($){return{headers:Su.parse($.headers),cookies:uu.parse($.cookies)}}async function nG1($,I,q){let z=await dG($),U=EJ(z.sealUrl,z.token),Y=await H$(U),J={user:Y.user,tenant:Y.tenant};mG(z.corpId,J.tenant),FL0({id:z.corpId,corpId:z.corpId,name:I,provider:"hosecloud",overwrite:q},{token:z.token,sealUrl:z.sealUrl,expiresIn:z.expiresIn,verify:!0,remote:J})}function FL0($,I){let{token:q,sealUrl:z,expiresIn:U,verify:Y,remote:J}=I,Q=I.custom??OL0($),w=J?.user,K=J?.tenant,H=m1($,"tenantSlug")??R7(K?.tenantSlug),G=m1($,"tenantId")??R7(K?.id),W=m1($,"tenantName")??R7(K?.name),V=m1($,"id")??H??G;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let X=m1($,"staffId")??R7(w?.providerUserId)??R7(w?.id)??"seal",L=m1($,"provider")??R7(w?.provider)??R7(K?.providerConfig?.provider),D=m1($,"corpId")??H??G??V,O={id:V,name:m1($,"name")??W??V,environment:"production",seal:{url:z,tenantSlug:H,headers:Q.headers,cookies:Q.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:q,sealUrl:z,expiresIn:U,staffId:X,corpId:D,tenantId:G,tenantSlug:H,tenantName:W,providerUserId:R7(w?.providerUserId),provider:L},auth:{refreshTtl:300}},P=ku();VL0(P,{recursive:!0,mode:448});let T=XL0(P,`${ry(V)}.json`);if(WL0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);ZL0(T,`${JSON.stringify(O,null,2)}
`,{mode:384}),E0({id:V,name:O.name,tenantId:G,tenantSlug:H,verified:Y,path:T})}async function bG1($,I,q={}){let z=await iG1(`${$}/api/v1/auth/me`,{...q,authorization:`Bearer ${I}`}),U=eD(z.data);return{user:eD(U.user??z.user),tenant:eD(U.tenant??z.tenant)}}async function iG1($,I={}){let q=await fetch($,{headers:I}),z=await q.text();if(!q.ok)throw Error(`${q.status} ${z}`);let U=JSON.parse(z);return eD(U)}function eD($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function R7($){return typeof $==="string"&&$?$:void 0}async function NL0($,I){let q=await dG($),z=EJ(q.sealUrl,q.token),U=await H$(z);mG(q.corpId,U.tenant);let Y=await _q(z,{note:I});E0({tenant:{id:U.tenant.id,name:U.tenant.name,tenantSlug:U.tenant.tenantSlug,corpId:q.corpId},user:{id:U.user.id,name:U.user.name,providerUserId:U.user.providerUserId,isAdmin:U.user.isAdmin},delegation:Y,expiresIn:q.expiresIn})}async function ML0($,I,q,z,U){if($==="list"){await F0("seal_delegation_list",q,z,{},W0(U.options));return}if($==="create"){let Y=C(U.options.note)??(I?[I,...U.command.slice(2)].join(" "):void 0);await F0("seal_delegation_create",q,z,{note:Y},W0(U.options));return}if($==="revoke"){let Y=I??C(U.options.tokenId);if(!Y)throw Error("Usage: seal-use delegation revoke <tokenId>");await F0("seal_delegation_revoke",q,z,{tokenId:Y},W0(U.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as pG1}from"node:fs";async function AL0($,I,q,z,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>
@@ -345,47 +345,11 @@ Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an a
`+" • 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 K=$==="maycur"?"每刻报销":"汇联易";throw Error(`${K}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${K}' --result-url <url> --corp <corpId>`)}let J=$==="hosecloud",Q=$==="hosecloud"?I:$,w=$==="hosecloud"?q:I;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(Q==="requirements"){await F0("seal_deploy_hosecloud_requirements",z,U,{},W0(Y.options));return}if(Q==="list"){await F0("seal_deploy_hosecloud_list",z,U,{},W0(Y.options));return}if(Q==="get"){let K=w??C(Y.options.signKey)??C(Y.options["sign-key"]);if(!K){let G=((await M1(z)).integrations??[]).filter((W)=>W.type==="hosecloud");if(G.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 l$("缺少必需参数 <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",z,U,{signKey:K},W0(Y.options));return}if(Q==="status"){await F0("seal_deploy_hosecloud_status",z,U,{},W0(Y.options));return}if(Q==="configure"){let K=C(Y.options.input),H=K?JSON.parse(_G1(K,"utf8")):z$(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",z,U,{...H,dryRun:O0(Y.options.dryRun)??O0(Y.options["dry-run"])},W0(Y.options));return}if(Q==="sync"){let K=w??C(Y.options.signKey)??C(Y.options["sign-key"]),H=O0(Y.options.auto)??O0(Y.options.yes);if(!K){let W=((await M1(z)).integrations??[]).filter((X)=>X.type==="hosecloud");if(W.length===0)throw Error(`当前企业 (${U.name}) 尚未添加合思发布配置。
`)}throw new r$("缺少必需参数 <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",z,U,{signKey:K},W0(Y.options));return}if(Q==="status"){await F0("seal_deploy_hosecloud_status",z,U,{},W0(Y.options));return}if(Q==="configure"){let K=C(Y.options.input),H=K?JSON.parse(pG1(K,"utf8")):z$(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",z,U,{...H,dryRun:O0(Y.options.dryRun)??O0(Y.options["dry-run"])},W0(Y.options));return}if(Q==="sync"){let K=w??C(Y.options.signKey)??C(Y.options["sign-key"]),H=O0(Y.options.auto)??O0(Y.options.yes);if(!K){let W=((await M1(z)).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",z,U,{signKey:X},W0(Y.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${U.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of W){let L=X.outboundName??"SealAI 审批",D=X.signKey,F=X.apiOrigin??"production";console.error(` • "${L}" (signKey: ${D}, 环境: ${F})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${D} --corp ${U.id}
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of W){let L=X.outboundName??"SealAI 审批",D=X.signKey,O=X.apiOrigin??"production";console.error(` • "${L}" (signKey: ${D}, 环境: ${O})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${D} --corp ${U.id}
`)}if(W.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${U.id}
`);throw new l$("缺少必需参数 <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",z,U,{signKey:K},W0(Y.options));return}throw Error(`Unknown deploy hosecloud action: ${Q??""}. Available: requirements, list, get, status, configure, sync.`)}import{createServer as xG1}from"node:http";import{URL as SG1}from"node:url";var LL0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.17",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
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Seal Home API Docs (v${z1})</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>\uD83E\uDDAD</text></svg>" />
<style>
body {
margin: 0;
padding: 0;
background-color: #0f172a;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
</style>
</head>
<body>
<script
id="api-reference"
data-url="/openapi.json"
data-configuration='{"theme":"purple","layout":"modern","showSidebar":true}'
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
></script>
</body>
</html>`}async function n4($,I,q,z){let U=$.handler;return U(I,q,{corp:z})}async function OL0($,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 q=$.headers.host||"localhost",z=$.headers["x-forwarded-proto"]||"http",U=new SG1($.url||"/",`${z}://${q}`),Y=U.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Y==="/"){t1(I,200,{name:"seal-use",version:z1,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"){yG1(I,200,DL0());return}if(J==="GET"&&Y==="/openapi.json"){t1(I,200,sD());return}if(J==="GET"&&Y==="/health"){t1(I,200,{status:"ok",version:z1,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Y==="/shutdown"||Y==="/api/shutdown")){t1(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 $O($),w=(typeof Q?.command==="string"?Q.command:"").trim();if(!w){eD(I,400,"Missing 'command' property in request body");return}let K=wx(w),H=K[0]==="seal-use"||K[0]==="seal-home"||K[0]?.endsWith("/seal-use")||K[0]?.endsWith("/seal-home")?K.slice(1):K,G=await uw(H),W=void 0;try{if(G.stdout.trim().startsWith("{")||G.stdout.trim().startsWith("["))W=JSON.parse(G.stdout)}catch{}t1(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(),w=h4(Q);if(!w){eD(I,404,`Tool not found: '${Q}'`);return}let K=await $O($)||{},H=f6($,U,K),G=_1(H),W=await y1(G),V={...K};delete V.corp;let X=await n4(w,W,V,G);t1(I,200,X);return}if(Y.startsWith("/v1/")){if(await uG1($,I,J,Y,U))return}eD(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let w=Q instanceof Error?Q.message:String(Q);eD(I,500,w)}}async function uG1($,I,q,z,U){let Y=Object.fromEntries(U.searchParams.entries());if(q==="GET"&&z==="/v1/corps"){let J=a8(),Q=F4();return t1(I,200,{count:J.length,mode:Q.stateful?"stateful":"stateless",defaultCorpId:Q.defaultCorpId,corps:J.map((w)=>({id:w.id,name:w.name,sourceType:w.source.type,sealUrl:w.seal?.url}))}),!0}if(q==="GET"&&z==="/v1/whoami"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_whoami"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/session"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_session_get"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/summary"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_runs_summary"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/stats"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_runs_stats"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/pick"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_run_pick"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/url"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_run_url_get"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z.startsWith("/v1/approval-runs/")){let J=z.slice(18).split("/"),Q=J[0],w=J[1];if(Q&&!["summary","pick","stats","url","bridge"].includes(Q)){let K=f6($,U,Y),H=_1(K),G=await y1(H);if(!w){let W=h4("seal_approval_run_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="attachments"){let W=h4("seal_approval_run_attachments_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="cited-rules"){let W=h4("seal_approval_run_cited_rules_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="document-summary"){let W=h4("seal_approval_run_document_summary_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="result"){let W=h4("seal_approval_run_result_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}}}if(q==="GET"&&z==="/v1/approval-runs"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_runs_search"),H=await n4(K,w,{...Y,limit:Y.limit?Number(Y.limit):void 0,offset:Y.offset?Number(Y.offset):void 0,includeBridge:Y.includeBridge==="true"},Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval/rules"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_rules_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/simulation/batches"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_simulation_batches_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="POST"&&z==="/v1/simulation/create-batch"){let J=await $O($)||{},Q=f6($,U,J),w=_1(Q),K=await y1Line truncated
\uD83D\uDE80 seal-use HTTP Server (v${z1}) started`),console.error(` URL: http://${q}:${I}`),console.error(` Docs: http://${q}:${I}/docs`),console.error(` OpenAPI: http://${q}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${q}:${I}/api/cli`),console.error(` REST API: http://${q}:${I}/v1/...
`);U(z)})})}async function FL0($){let I=b0($.options.port)??b0($.options.p),q=C($.options.host)??C($.options.h),z=await zO({port:I,host:q}),U=()=>{z.close(()=>{process.exit(0)})};process.on("SIGINT",U),process.on("SIGTERM",U),await new Promise(()=>{})}async function NL0($,I,q,z){if($==="config"||$==="get"){await F0("seal_llm_config_get",I,q,{},W0(z.options));return}if($==="providers"||$==="list"){await F0("seal_llm_providers_list",I,q,{},W0(z.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function ML0($,I){if($==="config"||$==="json"){Kx();return}await Hx()}function Kx(){E0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function AL0($){let I=sD();E0(I,{...W0($.options),allowFull:!0})}async function PL0($,I,q,z){if($==="available"){await F0("seal_permissions_available_list",I,q,{},W0(z.options));return}if($==="configs"||$==="list"){await F0("seal_permissions_configs_list",I,q,{},W0(z.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as TL0}from"node:fs";async function EL0($,I,q,z,U,Y,J){if(!$||$==="get"){await F0("seal_preference_get",U,Y,{},W0(J.options));return}if($==="decision"){if(I==="update"||!I){let Q=C(J.options.input),w=Q?JSON.parse(TL0(Q,"utf8")):z$(J.json);if(!w||Object.keys(w).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await F0("seal_preference_decision_update",U,Y,{...w,dryRun:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let Q=C(J.options.default)??C(J.options.level)??z;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:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}if(I==="policies"){if(q==="list"||!q){await F0("seal_preference_thinking_depth_policies_list",U,Y,{},W0(J.options));return}if(q==="upsert"){let Q=C(J.options.input),w=Q?JSON.parse(TL0(Q,"utf8")):z$(J.json);if(!w||!w.id||!w.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,{...w,dryRun:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}if(q==="remove"||q==="delete"){let Q=z??C(J.options.id)??C(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:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function jL0($={}){let I=a8(),q=F4(),z=jU(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$.corpId},wI());console.log(`[probe] corp=${z.id} source=${z.source.type}`);let U=await fU(z);console.log("[probe] seal enterprise"),console.log(JSON.stringify(U,null,2));let Y=await y1(z),J=await HW(Y,{documentLimit:20,stylePreferencesEndpoint:z.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))}async function BL0($,I,q){let z=I??C(q.options.corp)??($&&$!=="--corp"?$:void 0);await jL0({corpId:z})}async function Gx($,I,q,z,U){if($==="count"){await F0("seal_approval_rules_list",q,z,{countOnly:!0},W0(U.options));return}if($==="list"){if(O0(U.options.count)){await F0("seal_approval_rules_list",q,z,{countOnly:!0},W0(U.options));return}let Y=b0(U.options.limit),J=b0(U.options.offset);if(O0(U.options.summary)){await F0("seal_approval_rules_list",q,z,{fields:CZ0,limit:Y,offset:J},W0(U.options));return}let Q=await FI("seal_approval_rules_list",q,z,{limit:Y,offset:J});_Z0(Q,O0(U.options.full)===!0),E0(Q);return}if($==="clear"){let Y=O0(U.options.yes)===!0,J=O0(U.options.dryRun)??O0(U.options["dry-run"])??!Y;if(!Y&&!J)throw I5("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${z.id} --dry-run`);let Q=await FI("seal_approval_rules_clear",q,z,{dryRun:J,recode:O0(U.options.recode)});if(!Y&&J&&Q&&typeof Q==="object"){E0({...Q,nextCommand:`seal-use rules clear --corp ${z.id} --yes`},W0(U.options));return}E0(Q,W0(U.options));return}if($==="versions"){await F0("seal_approval_rule_versions_list",q,z,{},W0(U.options));return}if($==="version"){let Y=I??C(U.options.version);if(!Y)throw Error("Usage: seal-use rules version <versionId|versionNumber|l Line truncated
`).filter(Boolean),Y=U.slice(-I);return{logFile:q,lines:Y,totalLines:U.length}}async function bG1($){let I=QO($),q=Zx($),z=yw($);CL0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):IO),Y=$.host??(process.env.HOST?process.env.HOST:qO);YO(I,`${process.pid}
`,{mode:384}),YO(q,JSON.stringify({pid:process.pid,port:U,host:Y,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),nU(z,`service starting on http://${Y}:${U} pid=${process.pid}`);let J=null;try{J=await zO({port:U,host:Y,silent:!0}),nU(z,`service listening pid=${process.pid}`)}catch(w){if(nU(z,`service failed to bind port ${U}: ${w instanceof Error?w.message:String(w)}`),JO(I)===process.pid)q5(I,{force:!0}),q5(q,{force:!0});throw w}let Q=()=>{if(J)J.close(),J=null;if(JO(I)===process.pid)q5(I,{force:!0}),q5(q,{force:!0});nU(z,`stopped pid=${process.pid}`)};await new Promise((w)=>{let K=!1,H=()=>{if(K)return;K=!0,Q(),process.off("SIGTERM",H),process.off("SIGINT",H),w()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function gL0($){CL0($.stateDir);let I=iU($);if(I.running)return I;let q=$.launcher??{command:process.execPath,args:[$.entryFile]},z=[...q.args??[],"service","run"];if($.port)z.push("--port",String($.port));if($.host)z.push("--host",String($.host));let U=kG1(q.command,z,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=QO($);return YO(Y,`${U.pid}
`,{mode:384}),nU(yw($),`started pid=${U.pid}`),{started:!0,...iU($)}}function vL0($,I={}){let q=QO($),z=Zx($),U=JO(q);if(!U||!RL0(U,$.appRoot))return q5(q,{force:!0}),q5(z,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),q5(q,{force:!0}),q5(z,{force:!0}),nU(yw($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function RL0($,I){if(!pG1($))return!1;try{let q=fG1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(q.includes(I)||q.includes("seal-use")||q.includes("src/cli.ts"))&&q.includes("service")&&q.includes("run")}catch{return!1}}function pG1($){try{return process.kill($,0),!0}catch{return!1}}function QO($){return Vx($.stateDir,"service.pid")}function Zx($){return Vx($.stateDir,"service.json")}function yw($){return Vx($.stateDir,"service.log")}function JO($){if(!UO($))return;let I=Number(Wx($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function CL0($){nG1($,{recursive:!0,mode:448})}function nU($,I){YO($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}var Xx=dG1(cG1(),".config","seal-use");async function Lx($,I,q){let z=q?b0(q.options.port)??b0(q.options.p):void 0,U=q?C(q.options.host)??C(q.options.h):void 0,Y=q?b0(q.options.lines)??b0(q.options.n):void 0,J=await NI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Xx,version:z1,launcher:I.launcher,port:z,host:U},{maxLines:Y});if(J!==void 0)E0(J)}import{existsSync as mG1,readFileSync as _L0}from"node:fs";async function hL0($,I,q,z,U){if($==="batch-records"||$==="records"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation batch-records <batchId>");await F0("seal_simulation_batch_records_get",q,z,{batchId:Y,query:C(U.options.query)},W0(U.options));return}if($==="create"||$==="run"){let Y=C(U.options.mode)??C(U.options.sourceSystem)??C(U.options["source-system"])??"hosecloud",J=Y==="material-pack"?"material_pack":Y,Q=C(U.options.schemaConfig)??C(U.options["schema-config"]),w=Q?JSON.parse(_L0(Q,"utf8")):void 0,K=C(U.options.input),H=K?JSON.parse(_L0(K,"utf8")):z$(U.json),G=C(U.options.packageId)??C(U.options["package-id"]),W=V6(U.options.packageIds)??V6(U.options["package-ids"])??(G?[G]:void 0),V=V6(U.options.flowIds)??V6(U.options["flow-ids"])??V6(U.options.documentSn)??V6(U.options["document-sn"]),X=C(U.options.signKey)??C(U.options["sign-key"])??C(U.options.integration),L=O0(U.options.noWait)??O0(U.options["no-wait"]);await F0("seal_simulation_batch_create",q,z,{mode:J,sourceSystem:J,flowIds:V,documentSn:V,rejectNodeName:C(U.options.rejectNode)??C(U.options["reject-node"])??null,thinkingDepthOverride:C(U.options.thinkingDepth)??C(U.options["thinking-depth"]),skipInvoiceGeneration:O0(U.options.skipInvoiceGeneration)??O0(U.options["skip-invoice-generation"]),skipExpenseExtraction:O0(U.options.skipExpenseExtraction)??O0(U.options["skip-expense-extraction"]),disableAttachmentCache:O0(U.options.disableAttachmentCache)??O0(U.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:G,templateId:C(U.options.templateId)??C(U.options["template-id"]),schemaConfig:w,requestIds:V6(U.options.requestIds)??V6(U.options["request-ids"]),workflowTypeId:C(U.options.workflowTypeId)??C(U.options["workflow-type-id"]),flowStatusList:V6(U.options.flowStatusList)?.map(Number)??V6(U.options["flow-status-list"])?.map(Number),businessCodes:V6(U.options.businessCodes)??V6(U.options["business-codes"]),documentType:C(U.options.documentType)??C(U.options["document-type"]),startTime:b0(U.options.startTime)??b0(U.options["start-time"]),endTime:b0(U.options.endTime)??b0(U.options["end-time"]),status:V6(U.options.status),limit:b0(U.options.limit),noWait:L,rawParams:H},W0(U.options));return}if($==="wait"){let Y=I??C(U.options.batchId)??C(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",q,z,{batchId:Y,timeout:C(U.options.timeout),pollInterval:C(U.options.pollInterval)??C(U.options["poll-interval"])},W0(U.options));return}if($==="status"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation status <batchId>");await F0("seal_simulation_batch_status",q,z,{batchId:Y},W0(U.options));return}if($==="clean"||$==="delete"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation clean <batchId>");await F0("seal_simulation_batch_clean",q,z,{batchId:Y},W0(U.options));return}if($==="specifications"){let Y=I??C(U.options.integration)??C(U.options.signKey)??C(U.options["sign-key"]);await F0("seal_simulation_specifications_list",q,z,{signKey:Y},W0(U.options));return}if($==="approval-definitions"||$==="definitions"){await F0("seal_simulation_feishu_approval_definitions_list",q,z,{},W0(U.options));return}if($==="list"){await F0("seal_simulation_batches_list",q,z,{limit:b0(U.options.limit)},W0(U.options));return}if($==="get"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation get <batchId>");await F0("seal_simulation_batch_get",q,z,{batchId:Y},W0(U.options));return}if($==="templates"){await F0("seal_simulation_templates_get",q,z,{},W0(U.options));return}if($==="integrations"){await F0("seal_simulation_integrations_get",q,z,{},W0(U.options));return}if($==="package-upload"){let Y=I??C(U.options.file);if(!Y)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!mG1(Y))throw Error(`File not found: ${Y}`);await F0("seal_simulation_material_package_upload",q,z,{filePath:Y},W0(U.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as aL0}from"node:fs";import{join as wO}from"node:path";import{existsSync as Dx,mkdirSync as dL0,rmSync as UW1,writeFileSync as YW1}from"node:fs";import{homedir as mL0}from"node:os";import{dirname as JW1,join as Ox}from"node:path";var SL0=`---
`);throw new r$("缺少必需参数 <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",z,U,{signKey:K},W0(Y.options));return}throw Error(`Unknown deploy hosecloud action: ${Q??""}. Available: requirements, list, get, status, configure, sync.`)}import{accessSync as UW1,constants as YW1,existsSync as M$,readdirSync as JW1}from"node:fs";import{homedir as QW1}from"node:os";import{join as $9}from"node:path";import{existsSync as Hx,mkdirSync as SL0,rmSync as IW1,writeFileSync as qW1}from"node:fs";import{homedir as uL0}from"node:os";import{dirname as zW1,join as Gx}from"node:path";var PL0=`---
name: seal-use
description: "v0.10.17: 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:
@@ -485,6 +449,7 @@ seal-use corps list
- HTTP REST API & Docs Server: \`seal-use http [--port 8787] [--host 127.0.0.1]\` (提供 \`/docs\` 交互文档、\`/openapi.json\`、\`POST /api/cli\` 与 \`/v1/*\` REST API)。
- 审批规则质量校验 (Linter): \`seal-use rules lint [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary] --corp <corpId>\`; read \`references/rule-lint.md\`. 全局配置默认关闭 (\`config lint <enable|disable>\`)。
- 系统自检、环境体检与内嵌架构规范白皮书: \`seal-use doctor\` (整机环境、目录状态、企业资产统计与健康自检,零磁盘写入), \`seal-use doctor guide\` (纯内存只读输出内嵌白皮书与目录规范), \`seal-use doctor paths\` (紧凑型核心目录健康检查)。
- Full CLI inventory: read \`references/cli.md\`.
## Material-pack Webhook policy and recovery
@@ -505,6 +470,8 @@ push 会重新读取最新 Webhook 配置;校验通过后才会开始上传附
## High-Value Commands
\`\`\`bash
seal-use doctor
seal-use doctor guide
seal-use corps list [query] [--env production|test] [--strict]
seal-use corps search <keyword> [--env production|test] [--strict]
seal-use corps get <corpId>
@@ -571,11 +538,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 uL0=`interface:
`;var TL0=`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 yL0=`# Rule Lightweight Queries
`;var EL0=`# 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.
@@ -686,7 +653,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 xL0=`# Approval Bad Case Catalog
`;var BL0=`# 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.
@@ -736,7 +703,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 kL0="# 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 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 openapi\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--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 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]\nseal-use delegation list [--corp <corpId>]\nseal-use delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]\nseal-use delegation revoke <tokenId> [--corp <corpId>]\nseal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]\nseal-use users search <keyword> [--corp <corpId>]\nseal-use users delegation <userIdOrPhone|name> [--note <note>] [--corp <corpId>]\nseal-use users activate <userId> [--corp <corpId>]\nseal-use users reset-password <userId> [--corp <corpId>]\nseal-use users get <userId> [--corLine truncated
`;var jL0="# 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 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 openapi\nseal-use doctor [--quiet]\nseal-use doctor guide\nseal-use doctor paths\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--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 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]\nseal-use delegation list [--corp <corpId>]\nseal-use delegation create [--note <note>] [--from-link <url>] [--corp <corpId>]\nseal-use delegation revoke <tokenId> [--corp <corpId>]\nseal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]\nseal-use users search <keyword> [--corp <corpId>]\nseal-use users delegation <userIdOrPhone|name> [--note <note>] [--corp <corpId>]\nseal-use users activate <userId> [--corp <corpId>]\nseal-use users reseLine 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.
@@ -957,7 +924,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 iL0=`# Customer Feedback Rule Remediation
`;var RL0=`# 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.
@@ -1127,7 +1094,7 @@ Return a compact report containing:
- New version number and version name, if published
- Verification result
- Whether a regression rerun was performed
`;var bL0=`# Enterprise Onboarding
`;var CL0=`# 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.
@@ -1261,7 +1228,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 pL0=`# Hose Enterprise Auth
`;var _L0=`# Hose Enterprise Auth
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
@@ -1326,7 +1293,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 cL0=`# Hose Enterprise Initialization & Automated Discovery
`;var hL0=`# 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.
@@ -1432,12 +1399,103 @@ seal-use corps hose-staffs --json '{
}'
\`\`\`
* 直接使用指定 ID 完成接入并进行连通性验证。
`;var lL0={"SKILL.md":SL0,"agents/openai.yaml":uL0,"references/rule-lightweight.md":yL0,"references/approval-bad-cases.md":xL0,"references/cli.md":kL0,"references/approval-run-lightweight.md":fL0,"references/approval-attachment-trace.md":nL0,"references/customer-feedback-rule-remediation.md":iL0,"references/enterprise-onboarding.md":bL0,"references/hose-enterprise-auth.md":pL0,"references/hose-enterprise-init.md":cL0};function oL0(){return lL0["SKILL.md"]||""}function xw(){return Ox(mL0(),".agents","skills","seal-use")}function rL0(){return Ox(mL0(),".agents","skills","seal-home")}function tL0(){let $=rL0();if(Dx($))try{return UW1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function Fx($=xw()){tL0(),dL0($,{recursive:!0});let I=[];for(let[q,z]of Object.entries(lL0)){let U=Ox($,q);dL0(JW1(U),{recursive:!0}),YW1(U,z,"utf8"),I.push(q)}return{targetDir:$,files:I}}function Nx(){let $=rL0(),I=xw(),q=Dx($),z=Dx(I);if(q||z)return tL0(),Fx(I),{synced:!0,targetDir:I};return{synced:!1}}function sL0($,I,q){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${oL0()}
`);return}if($==="install"||$==="init"||$==="sync"){let z=O0(q.options.local)||O0(q.options.workspace),U=C(q.options.dir)??C(q.options.target)??I,Y=U?U:z?wO(process.cwd(),".agents","skills","seal-use"):xw(),J=Fx(Y);E0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let z=xw(),U=wO(process.cwd(),".agents","skills","seal-use");E0({global:{dir:z,installed:aL0(wO(z,"SKILL.md"))},local:{dir:U,installed:aL0(wO(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function eL0($,I){if($==="config"){E0(await fU(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function $D0($,I,q,z){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await F0($,I,q,z$(z.json),W0(z.options))}function ID0(){E0(Tw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as QW1,mkdirSync as wW1,renameSync as Mx,rmSync as KW1,unlinkSync as JD0,writeFileSync as qD0}from"node:fs";import{dirname as HW1,join as zD0}from"node:path";import{spawnSync as MI}from"node:child_process";function KO($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let q=$.toLowerCase().replace(/\\/g,"/");return!q.endsWith("/bun")&&!q.endsWith("/bun.exe")&&!q.endsWith("/node")&&!q.endsWith("/node.exe")}var QD0="yunyingk/seal-use",fw="yunyingk/seal-home";var GW1="SEAL_USE_GITHUB_REPO",WW1="SEAL_HOME_GITHUB_REPO";async function wD0($,I={}){let q={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Xx,version:z1,launcher:$.launcher},z=I.repo||process.env[GW1]?.trim()||process.env[WW1]?.trim()||QD0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let A=Y.replace(/^v/,""),g=KD0(A,z1);if(g<0)if(!Ij&&I.force);else{E0({updated:!1,currentVersion:z1,targetVersion:A,mode:KO()?"binary":"source",message:!Ij?`Cannot downgrade seal-use from dev build v${z1} to release v${A}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${z1} to older version v${A}. Updates must be forward-only.`});return}if(g===0&&!I.force){E0({updated:!1,currentVersion:z1,targetVersion:A,mode:KO()?"binary":"source",message:`seal-use is already at version v${z1}. Use --force to reinstall.`});return}}if(I.changelogOnly){let A=await Ax(z,I.limit??10);E0({currentVersion:z1,totalQueried:A.length,releases:A.map((g)=>({version:g.version,tagName:g.tagName,publishedAt:g.publishedAt,author:g.author,releaseNotes:g.notes,releaseUrl:g.htmlUrl,isCurrent:g.version===z1,isNewer:kw(g.version,z1)}))});return}if(!KO()){if(I.checkOnly){let g=await Ax(z,30),k=g[0],S=k?.version??z1,f=g.find((b)=>b.version===z1),v=kw(S,z1),p=g.filter((b)=>kw(b.version,z1));E0({updated:!1,updateAvailable:v,currentVersion:z1,currentVersionPublishedAt:f?.publishedAt,latestVersion:S,latestVersionPublishedAt:k?.publishedAt,behindCount:p.length,pendingReleases:p.map((b)=>({version:b.version,tagName:b.tagName,publishedAt:b.publishedAt,author:b.author,releaseNotes:b.notes,releaseUrl:b.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=iU(q).running;if(A)await NI("stop",q);try{YD0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(g){console.error(`git pull skipped: ${g instanceof Error?g.message:String(g)}`)}if(YD0("bun",["install"],{cwd:$.appRoot}),A)await NI("start",q);E0({updated:!0,serviceRestarted:A,version:z1,mode:"source"});return}let J=VW1(),Q=ZW1(),w=await Ax(z,30),K=Y?w.find((A)=>A.version===Y||A.tagName===Y||A.tagName===`v${Y}`)??await UD0(z,Y):w[0]??await UD0(z);if(!K){E0({updated:!1,currentVersion:z1,mode:"binary",message:`Failed to query releases from repository '${z}'`});return}let H=K.version,G=w.find((A)=>A.version===z1),W=kw(H,z1),V=W||Boolean(I.force),X=w.filter((A)=>kw(A.version,z1));if(I.checkOnly){E0({updated:!1,updateAvailable:W,currentVersion:z1,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,behindCount:X.length,pendingReleases:X.map((A)=>({version:A.version,tagName:A.tagName,publishedAt:A.publishedAt,author:A.author,releaseNotes:A.notes,releaseUrl:A.htmlUrl})),releaseNotes:K.notes,releaseUrl:K.htmlUrl,mode:"binary"});return}if(!V){E0({updated:!1,currentVersion:z1,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,mode:"binary",message:`seal-use is already up to date (v${z1})`});return}let L=XW1(K.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${H}. Available assets: ${K.assets.map((A)=>A.name).join(", ")}`);let D=iU(q).running;if(D)await NI("stop",q);let F=process.execPath,P=HW1(F),T=zD0(P,`.tmp-update-${Date.now()}`);wW1(T,{recursive:!0});try{let A=zD0(T,L.name);await LW1(L.downloadUrl,A,K.tagName,L.name);let g=A;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))g=DW1 Line truncated
`)}catch{}}async function LW1($,I,q,z){let U=Px(),Y=[],J=q?q.startsWith("v")?q:`v${q}`:void 0,Q=z||$.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/${QD0}/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 w=Array.from(new Set(Y)),K,H=6000,G=6000,W=307200,V=1e4,X=180000;for(let L=0;L<w.length;L++){let D=w[L],F=new AbortController,P="",T=(S)=>{P=S;try{F.abort()}catch{}},A=setTimeout(()=>{T("Connection timed out (no response headers within 6s)")},H),g,k;try{HO(`==> [${L+1}/${w.length}] Downloading via: ${D}`);let S=await fetch(D,{signal:F.signal});if(A)clearTimeout(A),A=void 0;if(!S.ok)throw Error(`HTTP ${S.status} ${S.statusText}`);g=setTimeout(()=>{T("Overall download time exceeded 3 minutes")},X);let f=Number(S.headers.get("content-length"))||0,v=S.body?.getReader();if(!v){let i=Buffer.from(await S.arrayBuffer());if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);qD0(I,i),HO(`✓ Download succeeded (${(i.length/1024/1024).toFixed(1)} MB)`);return}let p=[],b=0,h=0;k=setTimeout(()=>{if(b<W){let i=(b/1024).toFixed(1);T(`Initial transfer too slow (${i} KB < 300 KB in 6s), switching mirror...`)}},G);while(!0){let i=v.read(),q0,j=new Promise((U0,G0)=>{q0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),x;try{x=await Promise.race([i,j])}finally{if(q0)clearTimeout(q0)}let{done:c,value:r}=x;if(c)break;if(r){if(p.push(r),b+=r.length,k&&b>=W)clearTimeout(k),k=void 0;let U0=Date.now();if(U0-h>200){h=U0;let G0=f?Math.round(b/f*100):0,A0=(b/1048576).toFixed(1),v0=f?(f/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${A0} / ${v0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let n=Buffer.concat(p);if(n.length<1000)throw Error(`Downloaded content is suspiciously small (${n.length} bytes)`);qD0(I,n),HO(`✓ Download completed successfully (${(n.length/1024/1024).toFixed(1)} MB)`);return}catch(S){if(A)clearTimeout(A);if(k)clearTimeout(k);if(g)clearTimeout(g);let f=P||(S instanceof Error?S.message:String(S));K=Error(f),HO(`
↳ Mirror failed: ${K.message}`)}finally{if(A)clearTimeout(A);if(k)clearTimeout(k);if(g)clearTimeout(g)}}throw Error(`Failed to download asset from all mirrors: ${K?.message}`)}function DW1($,I,q){let z=MI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(z.status!==0)throw Error(`Failed to extract tar archive: ${z.stderr.toString()}`);JD0($);let U=q==="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 OW1($,I,q){let z=MI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(z.status!==0)throw Error(`Failed to extract zip archive: ${z.stderr.toString()}`);JD0($);let U=q==="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 KD0($,I){let q=$.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0),z=I.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0);for(let U=0;U<Math.max(q.length,z.length);U++){let Y=q[U]??0,J=z[U]??0;if(Y>J)return 1;if(Y<J)return-1}return 0}function kw($,I){return KD0($,I)>0}function YD0($,I,q={}){let z=MI($,I,{cwd:q.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(z.stdout)console.error(z.stdout.trimEnd());if(z.stderr)console.error(z.stderr.trimEnd());if(z.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${z.status}`)}async function HD0($,I,q,z,U){if($==="create"){let Y=C(U.options.name)??I,J=C(U.options.phone);if(!Y||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let Q=C(U.options.dept)??C(U.options.departmentId);await F0("seal_user_create",q,z,{name:Y,phone:J,departmentIds:Q?[Q]:void 0},W0(U.options));return}if($==="reset-password"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users reset-password <userId>");await F0("seal_user_reset_password",q,z,{userId:Y},W0(U.options));return}if($==="search"||$==="list"){let Y=I??C(U.options.keyword)??C(U.options.query)??"";await F0("seal_user_search",q,z,{keyword:Y},W0(U.options));return}if($==="get"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users get <userId>");await F0("seal_user_get",q,z,{userId:Y},W0(U.options));return}if($==="delete"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users delete <userId>");await F0("seal_user_delete",q,z,{userId:Y},W0(U.options));return}if($==="activate"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users activate <userId>");await F0("seal_user_activate",q,z,{userId:Y},W0(U.options));return}if($==="delegation"||$==="impersonate"){let Y=I??C(U.options.userId)??C(U.options.phone);if(!Y)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=C(U.options.note);await F0("seal_user_delegation_create",q,z,{userIdOrPhone:Y,note:J},W0(U.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var GD0=Tx(Tx(Tx(NW1(import.meta.url)))),MW1=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","changelog"]),AW1=new Set(["http","server","web","mcp"]);function PW1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),q=$[1]?.toLowerCase();if(I&&AW1.has(I))return!0;if((I==="service"||I==="daemon")&&q==="run")return!0;return!1}var WD0=Promise.resolve();function uw($,I={}){if(PW1($))return VD0($,I);let q=WD0.then(()=>VD0($,I));return WD0=q.then(()=>{return},()=>{return}),q}async function VD0($,I){let q=[],z=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??GD0,entryFile:I.entryFile??FW1(I.appRoot??GD0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{q.push(ay(Q))},console.error=(...Q)=>{z.push(ay(Q))};try{return await TW1($,J),{stdout:gw(q),stderr:gw(z),isError:!1,exitCode:0}}catch(Q){let w=vw(Q instanceof Error?Q.message:String(Q)),K=bD(Q);if(z.push(w),K.nextAction&&!w.includes("Next action:"))z.push(`\uD83D\uDC49 Next action: ${K.nextAction}`);return{stdout:gw(q),stderr:gw(z),isError:!0,exitCode:K.exitCode}}finally{console.log=U,console.error=Y}}async function TW1($,I){let q=MZ0($),[z,U,Y]=q.command;if(z==="version"||z==="v"||Boolean(q.options.version)||Boolean(q.options.v)||Boolean(q.options.V)){E0(TJ);return}let J=vZ0(q);if(J.isHelp){hZ0(J.target);return}if(!z||!MW1.has(z))throw Error(`Unknown command: ${q.command.join(" ")}. Run 'seal-use help' for available commands.`);if(z==="webhook"&&U==="material-pack"&&Y==="preview"){let K=q.command[3]??C(q.options.file)??C(q.options.input);if(!K)throw Error("Usage: seal-use webhook material-pack preview <材料包.zip>");await fZ0(K,Bw(q.options));return}if(z==="openapi"){AL0(q);return}if(z==="mcp-config"){Kx();return}if(z==="skill"){sL0(U,Y,q);return}if(z==="mcp"||z==="server"){await ML0(U,q);return}if(z==="probe"){await BL0(U,Y,q);return}if(z==="config"){oZ0(U,Y,q);return}if(z==="service"){await Lx(U,I,q);return}if(z==="stop"){await Lx("stop",I,q);return}if(z==="http"||z==="serve"){await FL0(q);return}if(z==="update"||z==="changelog"){let K=z==="changelog"||U==="changelog"||U==="log"||U==="history"||O0(q.options.changelog)===!0,H=U==="check"||O0(q.options.check)===!0||O0(q.options["check-only"])===!0,G=C(q.options.version)??C(q.options.tag)??(!K&&!H&&U&&!U.startsWith("-")?U:void 0);await wD0(I,{checkOnly:H,changelogOnly:K,limit:b0(q.options.limit),force:O0(q.options.force),targetVersion:G,repo:C(q.options.repo)});return}if(z==="tools"&&U==="list"){ID0();ret Line truncated
`;var yL0={"SKILL.md":PL0,"agents/openai.yaml":TL0,"references/rule-lightweight.md":EL0,"references/approval-bad-cases.md":BL0,"references/cli.md":jL0,"references/approval-run-lightweight.md":gL0,"references/approval-attachment-trace.md":vL0,"references/customer-feedback-rule-remediation.md":RL0,"references/enterprise-onboarding.md":CL0,"references/hose-enterprise-auth.md":_L0,"references/hose-enterprise-init.md":hL0};function xL0(){return yL0["SKILL.md"]||""}function AI(){return Gx(uL0(),".agents","skills","seal-use")}function kL0(){return Gx(uL0(),".agents","skills","seal-home")}function fL0(){let $=kL0();if(Hx($))try{return IW1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function Wx($=AI()){fL0(),SL0($,{recursive:!0});let I=[];for(let[q,z]of Object.entries(yL0)){let U=Gx($,q);SL0(zW1(U),{recursive:!0}),qW1(U,z,"utf8"),I.push(q)}return{targetDir:$,files:I}}function Vx(){let $=kL0(),I=AI(),q=Hx($),z=Hx(I);if(q||z)return fL0(),Wx(I),{synced:!0,targetDir:I};return{synced:!1}}var Zx=[{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"}],Xx=[{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 路径杜绝写文件与环境篡改。"}],Lx=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同 Line truncated
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
---
## 1. 系统定位与设计哲学
\`seal-use\` 是合思与 Seal AI 体系的企业级智能审核、规则治理与模拟演练 CLI 工具包,兼具人类工程师命令行使用与 AI Agent Harness 自动化集成能力。
### 核心交互契约
- **机器通道 (\`stdout\`)**:所有命令默认在标准输出返回干净、严格类型化的 JSON 载荷,供自动化脚本及 AI Agent 解析。
- **指导与诊断通道 (\`stderr\`)**:标准错误专用于输出运行状态、网络探测日志、自愈指引以及显式的下一步动作建议(如 \`\uD83D\uDC49 Next action: seal-use ...\`)。
- **退出码契约**:成功为 \`0\`,参数校验失败、未确认拦截或上游 API 报错均赋予非零退出码(如 \`1\`、\`2\`、\`10\`),杜绝盲目吞错。
---
## 2. 系统目录全景规范
\`seal-use\` 在用户计算机上的所有文件访问严格收敛于以下明确定义的目录中:
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
| :--- | :--- | :--- | :--- |
${Zx.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
`)}
---
## 3. 安全与数据隐私保证
${Xx.map(($,I)=>`### 3.${I+1} ${$.topic}
- **安全承诺**:${$.guarantee}
- **实现约束**:${$.enforcement}
`).join(`
`)}
---
## 4. 业务域能力图谱
${Lx.map(($)=>`### \`seal-use ${$.domain}\`
* **能力定位**:${$.summary}
* **核心命令**:${$.primaryCommands.map((I)=>`\`seal-use ${I}\``).join("、")}
`).join(`
`)}
---
## 5. 快速排错与健康诊断指引
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
`}function bL0($){if(!M$($))return 0;try{return JW1($).filter((I)=>I.endsWith(".json")).length}catch{return 0}}function Dx($){try{return UW1($,YW1.W_OK),!0}catch{return!1}}function Ox(){let $=QW1(),I=$9($,".config","seal-use"),q=$9(I,"enterprises"),z=$9(I,"config.json"),U=$9(I,"seal_tokens.json"),Y=$9(I,"mappings"),J=AI(),Q=$9($,"Downloads"),K=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",$9($,".local","bin","seal-use"),$9($,"bin","seal-use")].find((A)=>M$(A))??process.execPath,H={configDir:{name:"配置根目录",path:I,exists:M$(I),writable:M$(I)?Dx(I):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:q,exists:M$(q),writable:M$(q)?Dx(q):!1,fileCount:bL0(q),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:z,exists:M$(z),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:U,exists:M$(U),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Y,exists:M$(Y),fileCount:bL0(Y),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:M$($9(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:Q,exists:M$(Q),writable:M$(Q)?Dx(Q):!1,description:"审核大盘报表默认写入目录"},globalBinary:{name:"全局命令行二进制",path:K,exists:M$(K),description:"系统全局命令执行入口"}},G=[];try{G=c$()}catch{G=[]}let V=K4().defaultCorpId??G[0]?.id,X=G.find((A)=>A.id===V),L=G.filter((A)=>(A.environment??"production").toLowerCase()==="test").length,D=G.length-L,O=[];if(O.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),H.configDir?.exists&&H.configDir.writable)O.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${I} (正常读写)`});else if(H.configDir?.exists)O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${I} (存在但可能不可写)`});else O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${I},首次运行配置命令时将自动创建`});if(G.length>0)O.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${G.length} 家企业 (正式: ${D}, 测试: ${L})`});else O.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(H.agentSkillDir?.exists)O.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else O.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let P=O.some((A)=>A.status==="warn"||A.status==="error"),T=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:P?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:s0,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:T},directories:H,enterprises:{total:G.length,productionCount:D,testCount:L,activeCorpId:X?.id,activeCorpName:X?.name},checks:O,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:Zx.length,securityPoliciesCount:Xx.length,domainCapabilitiesCount:Lx.length,guideCommand:"seal-use doctor guide"}}}function iL0($){let I=[],q=$.doctor==="ok"?"✨":"⚠️";I.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${q}`),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[,z]of Object.entries($.directories)){let U=z.exists?"✓":"○",Y=z.exists?z.fileCount!==void 0?`(${z.fileCount} 个文件)`:z.writable?"(就绪/可写)":"(存在)":"(未创建)";I.push(` ${U} ${z.name.padEnd(16," ")}: ${z.path} ${Y}`)}if(I.push(""),I.push("【企业资产概览】"),I.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)I.push(` 当前激活企业: ${$.enterprises.activeCorpName} (${$.enterprises.activeCorpId})`);else I.push(" 当前激活企业: 无默认企业 (无状态模式)");I.push(""),I.push("【健康自检】");for(let z of $.checks){let U=z.status==="ok"?"✓":z.status==="warn"?"⚠️":"✗";I.push(` ${U} [${z.title}]: ${z.message}`)}return I.push(""),I.push("───────── Line truncated
`)}async function pL0($,I,q){let z=($??I??"").toLowerCase();if(z==="guide"||z==="doc"||z==="knowledge"||z==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(nL0());return}if(z==="paths"||z==="dirs"||z==="directories"){let J=Ox();E0(J.directories);return}let U=Ox();if(!(O0(q.options.quiet)||O0(q.options.silent)))console.error(iL0(U));E0(U)}import{createServer as WW1}from"node:http";import{URL as KW1}from"node:url";var cL0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.17",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
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Seal Home API Docs (v${s0})</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>\uD83E\uDDAD</text></svg>" />
<style>
body {
margin: 0;
padding: 0;
background-color: #0f172a;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
</style>
</head>
<body>
<script
id="api-reference"
data-url="/openapi.json"
data-configuration='{"theme":"purple","layout":"modern","showSidebar":true}'
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
></script>
</body>
</html>`}async function n4($,I,q,z){let U=$.handler;return U(I,q,{corp:z})}async function mL0($,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 q=$.headers.host||"localhost",z=$.headers["x-forwarded-proto"]||"http",U=new KW1($.url||"/",`${z}://${q}`),Y=U.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Y==="/"){t1(I,200,{name:"seal-use",version:s0,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"){GW1(I,200,dL0());return}if(J==="GET"&&Y==="/openapi.json"){t1(I,200,$O());return}if(J==="GET"&&Y==="/health"){t1(I,200,{status:"ok",version:s0,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Y==="/shutdown"||Y==="/api/shutdown")){t1(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 qO($),w=(typeof Q?.command==="string"?Q.command:"").trim();if(!w){IO(I,400,"Missing 'command' property in request body");return}let K=Fx(w),H=K[0]==="seal-use"||K[0]==="seal-home"||K[0]?.endsWith("/seal-use")||K[0]?.endsWith("/seal-home")?K.slice(1):K,G=await kw(H),W=void 0;try{if(G.stdout.trim().startsWith("{")||G.stdout.trim().startsWith("["))W=JSON.parse(G.stdout)}catch{}t1(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(),w=h4(Q);if(!w){IO(I,404,`Tool not found: '${Q}'`);return}let K=await qO($)||{},H=f6($,U,K),G=_1(H),W=await y1(G),V={...K};delete V.corp;let X=await n4(w,W,V,G);t1(I,200,X);return}if(Y.startsWith("/v1/")){if(await HW1($,I,J,Y,U))return}IO(I,404,`Cannot ${J} ${Y}. Visit /docs for available endpoints.`)}catch(Q){let w=Q instanceof Error?Q.message:String(Q);IO(I,500,w)}}async function HW1($,I,q,z,U){let Y=Object.fromEntries(U.searchParams.entries());if(q==="GET"&&z==="/v1/corps"){let J=c$(),Q=K4();return t1(I,200,{count:J.length,mode:Q.stateful?"stateful":"stateless",defaultCorpId:Q.defaultCorpId,corps:J.map((w)=>({id:w.id,name:w.name,sourceType:w.source.type,sealUrl:w.seal?.url}))}),!0}if(q==="GET"&&z==="/v1/whoami"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_whoami"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/session"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_session_get"),H=await n4(K,w,{},Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/summary"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_runs_summary"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/stats"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_runs_stats"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/pick"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_run_pick"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval-runs/url"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_run_url_get"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(z.startsWith("/v1/approval-runs/")){let J=z.slice(18).split("/"),Q=J[0],w=J[1];if(Q&&!["summary","pick","stats","url","bridge"].includes(Q)){let K=f6($,U,Y),H=_1(K),G=await y1(H);if(!w){let W=h4("seal_approval_run_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="attachments"){let W=h4("seal_approval_run_attachments_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="cited-rules"){let W=h4("seal_approval_run_cited_rules_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="document-summary"){let W=h4("seal_approval_run_document_summary_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}if(w==="result"){let W=h4("seal_approval_run_result_get"),V=await n4(W,G,{recordId:Q,...Y},H);return t1(I,200,V),!0}}}if(q==="GET"&&z==="/v1/approval-runs"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_runs_search"),H=await n4(K,w,{...Y,limit:Y.limit?Number(Y.limit):void 0,offset:Y.offset?Number(Y.offset):void 0,includeBridge:Y.includeBridge==="true"},Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/approval/rules"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_approval_rules_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="GET"&&z==="/v1/simulation/batches"){let J=f6($,U,Y),Q=_1(J),w=await y1(Q),K=h4("seal_simulation_batches_list"),H=await n4(K,w,Y,Q);return t1(I,200,H),!0}if(q==="POST"&&z==="/v1/simulation/create-batch"){let J=await qO($)||{},Q=f6($,U,J),w=_1(Q),K=await y1Line truncated
\uD83D\uDE80 seal-use HTTP Server (v${s0}) started`),console.error(` URL: http://${q}:${I}`),console.error(` Docs: http://${q}:${I}/docs`),console.error(` OpenAPI: http://${q}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${q}:${I}/api/cli`),console.error(` REST API: http://${q}:${I}/v1/...
`);U(z)})})}async function lL0($){let I=i0($.options.port)??i0($.options.p),q=C($.options.host)??C($.options.h),z=await YO({port:I,host:q}),U=()=>{z.close(()=>{process.exit(0)})};process.on("SIGINT",U),process.on("SIGTERM",U),await new Promise(()=>{})}async function oL0($,I,q,z){if($==="config"||$==="get"){await F0("seal_llm_config_get",I,q,{},W0(z.options));return}if($==="providers"||$==="list"){await F0("seal_llm_providers_list",I,q,{},W0(z.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function rL0($,I){if($==="config"||$==="json"){Nx();return}await Mx()}function Nx(){E0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function tL0($){let I=$O();E0(I,{...W0($.options),allowFull:!0})}async function aL0($,I,q,z){if($==="available"){await F0("seal_permissions_available_list",I,q,{},W0(z.options));return}if($==="configs"||$==="list"){await F0("seal_permissions_configs_list",I,q,{},W0(z.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as sL0}from"node:fs";async function eL0($,I,q,z,U,Y,J){if(!$||$==="get"){await F0("seal_preference_get",U,Y,{},W0(J.options));return}if($==="decision"){if(I==="update"||!I){let Q=C(J.options.input),w=Q?JSON.parse(sL0(Q,"utf8")):z$(J.json);if(!w||Object.keys(w).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await F0("seal_preference_decision_update",U,Y,{...w,dryRun:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let Q=C(J.options.default)??C(J.options.level)??z;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:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}if(I==="policies"){if(q==="list"||!q){await F0("seal_preference_thinking_depth_policies_list",U,Y,{},W0(J.options));return}if(q==="upsert"){let Q=C(J.options.input),w=Q?JSON.parse(sL0(Q,"utf8")):z$(J.json);if(!w||!w.id||!w.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,{...w,dryRun:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}if(q==="remove"||q==="delete"){let Q=z??C(J.options.id)??C(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:O0(J.options.dryRun)??O0(J.options["dry-run"])},W0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function $D0($={}){let I=c$(),q=K4(),z=vU(I,{stateful:q.stateful,defaultCorpId:q.defaultCorpId,corpId:$.corpId},HI());console.log(`[probe] corp=${z.id} source=${z.source.type}`);let U=await iU(z);console.log("[probe] seal enterprise"),console.log(JSON.stringify(U,null,2));let Y=await y1(z),J=await WW(Y,{documentLimit:20,stylePreferencesEndpoint:z.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))}async function ID0($,I,q){let z=I??C(q.options.corp)??($&&$!=="--corp"?$:void 0);await $D0({corpId:z})}async function Ax($,I,q,z,U){if($==="count"){await F0("seal_approval_rules_list",q,z,{countOnly:!0},W0(U.options));return}if($==="list"){if(O0(U.options.count)){await F0("seal_approval_rules_list",q,z,{countOnly:!0},W0(U.options));return}let Y=i0(U.options.limit),J=i0(U.options.offset);if(O0(U.options.summary)){await F0("seal_approval_rules_list",q,z,{fields:kZ0,limit:Y,offset:J},W0(U.options));return}let Q=await MI("seal_approval_rules_list",q,z,{limit:Y,offset:J});fZ0(Q,O0(U.options.full)===!0),E0(Q);return}if($==="clear"){let Y=O0(U.options.yes)===!0,J=O0(U.options.dryRun)??O0(U.options["dry-run"])??!Y;if(!Y&&!J)throw q5("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${z.id} --dry-run`);let Q=await MI("seal_approval_rules_clear",q,z,{dryRun:J,recode:O0(U.options.recode)});if(!Y&&J&&Q&&typeof Q==="object"){E0({...Q,nextCommand:`seal-use rules clear --corp ${z.id} --yes`},W0(U.options));return}E0(Q,W0(U.options));return}if($==="versions"){await F0("seal_approval_rule_versions_list",q,z,{},W0(U.options));return}if($==="version"){let Y=I??C(U.options.version);if(!Y)throw Error("Usage: seal-use rules version <versionId|versionNumber|l Line truncated
`).filter(Boolean),Y=U.slice(-I);return{logFile:q,lines:Y,totalLines:U.length}}async function DW1($){let I=KO($),q=Ex($),z=fw($);YD0($.stateDir);let U=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):zO),Y=$.host??(process.env.HOST?process.env.HOST:UO);QO(I,`${process.pid}
`,{mode:384}),QO(q,JSON.stringify({pid:process.pid,port:U,host:Y,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),pU(z,`service starting on http://${Y}:${U} pid=${process.pid}`);let J=null;try{J=await YO({port:U,host:Y,silent:!0}),pU(z,`service listening pid=${process.pid}`)}catch(w){if(pU(z,`service failed to bind port ${U}: ${w instanceof Error?w.message:String(w)}`),wO(I)===process.pid)z5(I,{force:!0}),z5(q,{force:!0});throw w}let Q=()=>{if(J)J.close(),J=null;if(wO(I)===process.pid)z5(I,{force:!0}),z5(q,{force:!0});pU(z,`stopped pid=${process.pid}`)};await new Promise((w)=>{let K=!1,H=()=>{if(K)return;K=!0,Q(),process.off("SIGTERM",H),process.off("SIGINT",H),w()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function qD0($){YD0($.stateDir);let I=cU($);if(I.running)return I;let q=$.launcher??{command:process.execPath,args:[$.entryFile]},z=[...q.args??[],"service","run"];if($.port)z.push("--port",String($.port));if($.host)z.push("--host",String($.host));let U=VW1(q.command,z,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});U.unref();let Y=KO($);return QO(Y,`${U.pid}
`,{mode:384}),pU(fw($),`started pid=${U.pid}`),{started:!0,...cU($)}}function zD0($,I={}){let q=KO($),z=Ex($),U=wO(q);if(!U||!UD0(U,$.appRoot))return z5(q,{force:!0}),z5(z,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(U,"SIGTERM"),z5(q,{force:!0}),z5(z,{force:!0}),pU(fw($),`stop requested pid=${U}`),I.quiet?void 0:{stopped:!0,pid:U}}function UD0($,I){if(!OW1($))return!1;try{let q=ZW1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(q.includes(I)||q.includes("seal-use")||q.includes("src/cli.ts"))&&q.includes("service")&&q.includes("run")}catch{return!1}}function OW1($){try{return process.kill($,0),!0}catch{return!1}}function KO($){return Tx($.stateDir,"service.pid")}function Ex($){return Tx($.stateDir,"service.json")}function fw($){return Tx($.stateDir,"service.log")}function wO($){if(!JO($))return;let I=Number(Px($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function YD0($){XW1($,{recursive:!0,mode:448})}function pU($,I){QO($,`${new Date().toISOString()} ${I}
`,{flag:"a",mode:384})}var Bx=NW1(FW1(),".config","seal-use");async function jx($,I,q){let z=q?i0(q.options.port)??i0(q.options.p):void 0,U=q?C(q.options.host)??C(q.options.h):void 0,Y=q?i0(q.options.lines)??i0(q.options.n):void 0,J=await PI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Bx,version:s0,launcher:I.launcher,port:z,host:U},{maxLines:Y});if(J!==void 0)E0(J)}import{existsSync as MW1,readFileSync as JD0}from"node:fs";async function QD0($,I,q,z,U){if($==="batch-records"||$==="records"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation batch-records <batchId>");await F0("seal_simulation_batch_records_get",q,z,{batchId:Y,query:C(U.options.query)},W0(U.options));return}if($==="create"||$==="run"){let Y=C(U.options.mode)??C(U.options.sourceSystem)??C(U.options["source-system"])??"hosecloud",J=Y==="material-pack"?"material_pack":Y,Q=C(U.options.schemaConfig)??C(U.options["schema-config"]),w=Q?JSON.parse(JD0(Q,"utf8")):void 0,K=C(U.options.input),H=K?JSON.parse(JD0(K,"utf8")):z$(U.json),G=C(U.options.packageId)??C(U.options["package-id"]),W=V6(U.options.packageIds)??V6(U.options["package-ids"])??(G?[G]:void 0),V=V6(U.options.flowIds)??V6(U.options["flow-ids"])??V6(U.options.documentSn)??V6(U.options["document-sn"]),X=C(U.options.signKey)??C(U.options["sign-key"])??C(U.options.integration),L=O0(U.options.noWait)??O0(U.options["no-wait"]);await F0("seal_simulation_batch_create",q,z,{mode:J,sourceSystem:J,flowIds:V,documentSn:V,rejectNodeName:C(U.options.rejectNode)??C(U.options["reject-node"])??null,thinkingDepthOverride:C(U.options.thinkingDepth)??C(U.options["thinking-depth"]),skipInvoiceGeneration:O0(U.options.skipInvoiceGeneration)??O0(U.options["skip-invoice-generation"]),skipExpenseExtraction:O0(U.options.skipExpenseExtraction)??O0(U.options["skip-expense-extraction"]),disableAttachmentCache:O0(U.options.disableAttachmentCache)??O0(U.options["disable-attachment-cache"]),signKey:X,packageIds:W,packageId:G,templateId:C(U.options.templateId)??C(U.options["template-id"]),schemaConfig:w,requestIds:V6(U.options.requestIds)??V6(U.options["request-ids"]),workflowTypeId:C(U.options.workflowTypeId)??C(U.options["workflow-type-id"]),flowStatusList:V6(U.options.flowStatusList)?.map(Number)??V6(U.options["flow-status-list"])?.map(Number),businessCodes:V6(U.options.businessCodes)??V6(U.options["business-codes"]),documentType:C(U.options.documentType)??C(U.options["document-type"]),startTime:i0(U.options.startTime)??i0(U.options["start-time"]),endTime:i0(U.options.endTime)??i0(U.options["end-time"]),status:V6(U.options.status),limit:i0(U.options.limit),noWait:L,rawParams:H},W0(U.options));return}if($==="wait"){let Y=I??C(U.options.batchId)??C(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",q,z,{batchId:Y,timeout:C(U.options.timeout),pollInterval:C(U.options.pollInterval)??C(U.options["poll-interval"])},W0(U.options));return}if($==="status"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation status <batchId>");await F0("seal_simulation_batch_status",q,z,{batchId:Y},W0(U.options));return}if($==="clean"||$==="delete"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation clean <batchId>");await F0("seal_simulation_batch_clean",q,z,{batchId:Y},W0(U.options));return}if($==="specifications"){let Y=I??C(U.options.integration)??C(U.options.signKey)??C(U.options["sign-key"]);await F0("seal_simulation_specifications_list",q,z,{signKey:Y},W0(U.options));return}if($==="approval-definitions"||$==="definitions"){await F0("seal_simulation_feishu_approval_definitions_list",q,z,{},W0(U.options));return}if($==="list"){await F0("seal_simulation_batches_list",q,z,{limit:i0(U.options.limit)},W0(U.options));return}if($==="get"){let Y=I??C(U.options.batchId)??C(U.options["batch-id"]);if(!Y)throw Error("Usage: seal-use simulation get <batchId>");await F0("seal_simulation_batch_get",q,z,{batchId:Y},W0(U.options));return}if($==="templates"){await F0("seal_simulation_templates_get",q,z,{},W0(U.options));return}if($==="integrations"){await F0("seal_simulation_integrations_get",q,z,{},W0(U.options));return}if($==="package-upload"){let Y=I??C(U.options.file);if(!Y)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!MW1(Y))throw Error(`File not found: ${Y}`);await F0("seal_simulation_material_package_upload",q,z,{filePath:Y},W0(U.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as wD0}from"node:fs";import{join as HO}from"node:path";function KD0($,I,q){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${xL0()}
`);return}if($==="install"||$==="init"||$==="sync"){let z=O0(q.options.local)||O0(q.options.workspace),U=C(q.options.dir)??C(q.options.target)??I,Y=U?U:z?HO(process.cwd(),".agents","skills","seal-use"):AI(),J=Wx(Y);E0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files});return}if($==="status"||$==="get"||!$){let z=AI(),U=HO(process.cwd(),".agents","skills","seal-use");E0({global:{dir:z,installed:wD0(HO(z,"SKILL.md"))},local:{dir:U,installed:wD0(HO(U,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function HD0($,I){if($==="config"){E0(await iU(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function GD0($,I,q,z){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await F0($,I,q,z$(z.json),W0(z.options))}function WD0(){E0(jw.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as AW1,mkdirSync as PW1,renameSync as gx,rmSync as TW1,unlinkSync as DD0,writeFileSync as VD0}from"node:fs";import{dirname as EW1,join as ZD0}from"node:path";import{spawnSync as TI}from"node:child_process";function GO($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let q=$.toLowerCase().replace(/\\/g,"/");return!q.endsWith("/bun")&&!q.endsWith("/bun.exe")&&!q.endsWith("/node")&&!q.endsWith("/node.exe")}var OD0="yunyingk/seal-use",bw="yunyingk/seal-home";var BW1="SEAL_USE_GITHUB_REPO",jW1="SEAL_HOME_GITHUB_REPO";async function FD0($,I={}){let q={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Bx,version:s0,launcher:$.launcher},z=I.repo||process.env[BW1]?.trim()||process.env[jW1]?.trim()||OD0,U=I.targetVersion?.trim(),Y=U&&U.toLowerCase()!=="latest"?U:void 0;if(Y){let A=Y.replace(/^v/,""),g=ND0(A,s0);if(g<0)if(!zB&&I.force);else{E0({updated:!1,currentVersion:s0,targetVersion:A,mode:GO()?"binary":"source",message:!zB?`Cannot downgrade seal-use from dev build v${s0} to release v${A}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${s0} to older version v${A}. Updates must be forward-only.`});return}if(g===0&&!I.force){E0({updated:!1,currentVersion:s0,targetVersion:A,mode:GO()?"binary":"source",message:`seal-use is already at version v${s0}. Use --force to reinstall.`});return}}if(I.changelogOnly){let A=await vx(z,I.limit??10);E0({currentVersion:s0,totalQueried:A.length,releases:A.map((g)=>({version:g.version,tagName:g.tagName,publishedAt:g.publishedAt,author:g.author,releaseNotes:g.notes,releaseUrl:g.htmlUrl,isCurrent:g.version===s0,isNewer:nw(g.version,s0)}))});return}if(!GO()){if(I.checkOnly){let g=await vx(z,30),k=g[0],S=k?.version??s0,f=g.find((i)=>i.version===s0),v=nw(S,s0),p=g.filter((i)=>nw(i.version,s0));E0({updated:!1,updateAvailable:v,currentVersion:s0,currentVersionPublishedAt:f?.publishedAt,latestVersion:S,latestVersionPublishedAt:k?.publishedAt,behindCount:p.length,pendingReleases:p.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=cU(q).running;if(A)await PI("stop",q);try{LD0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(g){console.error(`git pull skipped: ${g instanceof Error?g.message:String(g)}`)}if(LD0("bun",["install"],{cwd:$.appRoot}),A)await PI("start",q);E0({updated:!0,serviceRestarted:A,version:s0,mode:"source"});return}let J=gW1(),Q=vW1(),w=await vx(z,30),K=Y?w.find((A)=>A.version===Y||A.tagName===Y||A.tagName===`v${Y}`)??await XD0(z,Y):w[0]??await XD0(z);if(!K){E0({updated:!1,currentVersion:s0,mode:"binary",message:`Failed to query releases from repository '${z}'`});return}let H=K.version,G=w.find((A)=>A.version===s0),W=nw(H,s0),V=W||Boolean(I.force),X=w.filter((A)=>nw(A.version,s0));if(I.checkOnly){E0({updated:!1,updateAvailable:W,currentVersion:s0,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,behindCount:X.length,pendingReleases:X.map((A)=>({version:A.version,tagName:A.tagName,publishedAt:A.publishedAt,author:A.author,releaseNotes:A.notes,releaseUrl:A.htmlUrl})),releaseNotes:K.notes,releaseUrl:K.htmlUrl,mode:"binary"});return}if(!V){E0({updated:!1,currentVersion:s0,currentVersionPublishedAt:G?.publishedAt,latestVersion:H,latestVersionPublishedAt:K.publishedAt,mode:"binary",message:`seal-use is already up to date (v${s0})`});return}let L=RW1(K.assets,J,Q);if(!L)throw Error(`No compatible binary found for ${J}-${Q} in release v${H}. Available assets: ${K.assets.map((A)=>A.name).join(", ")}`);let D=cU(q).running;if(D)await PI("stop",q);let O=process.execPath,P=EW1(O),T=ZD0(P,`.tmp-update-${Date.now()}`);PW1(T,{recursive:!0});try{let A=ZD0(T,L.name);await CW1(L.downloadUrl,A,K.tagName,L.name);let g=A;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))g=_W1 Line truncated
`)}catch{}}async function CW1($,I,q,z){let U=Rx(),Y=[],J=q?q.startsWith("v")?q:`v${q}`:void 0,Q=z||$.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/${OD0}/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 w=Array.from(new Set(Y)),K,H=6000,G=6000,W=307200,V=1e4,X=180000;for(let L=0;L<w.length;L++){let D=w[L],O=new AbortController,P="",T=(S)=>{P=S;try{O.abort()}catch{}},A=setTimeout(()=>{T("Connection timed out (no response headers within 6s)")},H),g,k;try{WO(`==> [${L+1}/${w.length}] Downloading via: ${D}`);let S=await fetch(D,{signal:O.signal});if(A)clearTimeout(A),A=void 0;if(!S.ok)throw Error(`HTTP ${S.status} ${S.statusText}`);g=setTimeout(()=>{T("Overall download time exceeded 3 minutes")},X);let f=Number(S.headers.get("content-length"))||0,v=S.body?.getReader();if(!v){let b=Buffer.from(await S.arrayBuffer());if(b.length<1000)throw Error(`Downloaded content is suspiciously small (${b.length} bytes)`);VD0(I,b),WO(`✓ Download succeeded (${(b.length/1024/1024).toFixed(1)} MB)`);return}let p=[],i=0,h=0;k=setTimeout(()=>{if(i<W){let b=(i/1024).toFixed(1);T(`Initial transfer too slow (${b} KB < 300 KB in 6s), switching mirror...`)}},G);while(!0){let b=v.read(),q0,B=new Promise((U0,G0)=>{q0=setTimeout(()=>{G0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),x;try{x=await Promise.race([b,B])}finally{if(q0)clearTimeout(q0)}let{done:c,value:r}=x;if(c)break;if(r){if(p.push(r),i+=r.length,k&&i>=W)clearTimeout(k),k=void 0;let U0=Date.now();if(U0-h>200){h=U0;let G0=f?Math.round(i/f*100):0,A0=(i/1048576).toFixed(1),v0=f?(f/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${G0}% (${A0} / ${v0} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let n=Buffer.concat(p);if(n.length<1000)throw Error(`Downloaded content is suspiciously small (${n.length} bytes)`);VD0(I,n),WO(`✓ Download completed successfully (${(n.length/1024/1024).toFixed(1)} MB)`);return}catch(S){if(A)clearTimeout(A);if(k)clearTimeout(k);if(g)clearTimeout(g);let f=P||(S instanceof Error?S.message:String(S));K=Error(f),WO(`
↳ Mirror failed: ${K.message}`)}finally{if(A)clearTimeout(A);if(k)clearTimeout(k);if(g)clearTimeout(g)}}throw Error(`Failed to download asset from all mirrors: ${K?.message}`)}function _W1($,I,q){let z=TI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(z.status!==0)throw Error(`Failed to extract tar archive: ${z.stderr.toString()}`);DD0($);let U=q==="windows"?"seal-use.exe":"seal-use",Y=TI("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 hW1($,I,q){let z=TI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(z.status!==0)throw Error(`Failed to extract zip archive: ${z.stderr.toString()}`);DD0($);let U=q==="windows"?"seal-use.exe":"seal-use",Y=TI("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 ND0($,I){let q=$.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0),z=I.replace(/^v/,"").split(".").map((U)=>Number.parseInt(U,10)||0);for(let U=0;U<Math.max(q.length,z.length);U++){let Y=q[U]??0,J=z[U]??0;if(Y>J)return 1;if(Y<J)return-1}return 0}function nw($,I){return ND0($,I)>0}function LD0($,I,q={}){let z=TI($,I,{cwd:q.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(z.stdout)console.error(z.stdout.trimEnd());if(z.stderr)console.error(z.stderr.trimEnd());if(z.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${z.status}`)}async function MD0($,I,q,z,U){if($==="create"){let Y=C(U.options.name)??I,J=C(U.options.phone);if(!Y||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let Q=C(U.options.dept)??C(U.options.departmentId);await F0("seal_user_create",q,z,{name:Y,phone:J,departmentIds:Q?[Q]:void 0},W0(U.options));return}if($==="reset-password"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users reset-password <userId>");await F0("seal_user_reset_password",q,z,{userId:Y},W0(U.options));return}if($==="search"||$==="list"){let Y=I??C(U.options.keyword)??C(U.options.query)??"";await F0("seal_user_search",q,z,{keyword:Y},W0(U.options));return}if($==="get"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users get <userId>");await F0("seal_user_get",q,z,{userId:Y},W0(U.options));return}if($==="delete"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users delete <userId>");await F0("seal_user_delete",q,z,{userId:Y},W0(U.options));return}if($==="activate"){let Y=I??C(U.options.userId);if(!Y)throw Error("Usage: seal-use users activate <userId>");await F0("seal_user_activate",q,z,{userId:Y},W0(U.options));return}if($==="delegation"||$==="impersonate"){let Y=I??C(U.options.userId)??C(U.options.phone);if(!Y)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=C(U.options.note);await F0("seal_user_delegation_create",q,z,{userIdOrPhone:Y,note:J},W0(U.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var AD0=Cx(Cx(Cx(uW1(import.meta.url)))),yW1=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"]),xW1=new Set(["http","server","web","mcp"]);function kW1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),q=$[1]?.toLowerCase();if(I&&xW1.has(I))return!0;if((I==="service"||I==="daemon")&&q==="run")return!0;return!1}var PD0=Promise.resolve();function kw($,I={}){if(kW1($))return TD0($,I);let q=PD0.then(()=>TD0($,I));return PD0=q.then(()=>{return},()=>{return}),q}async function TD0($,I){let q=[],z=[],U=console.log,Y=console.error,J={appRoot:I.appRoot??AD0,entryFile:I.entryFile??SW1(I.appRoot??AD0,"src","cli.ts"),launcher:I.launcher};console.log=(...Q)=>{q.push(ey(Q))},console.error=(...Q)=>{z.push(ey(Q))};try{return await fW1($,J),{stdout:Cw(q),stderr:Cw(z),isError:!1,exitCode:0}}catch(Q){let w=_w(Q instanceof Error?Q.message:String(Q)),K=cD(Q);if(z.push(w),K.nextAction&&!w.includes("Next action:"))z.push(`\uD83D\uDC49 Next action: ${K.nextAction}`);return{stdout:Cw(q),stderr:Cw(z),isError:!0,exitCode:K.exitCode}}finally{console.log=U,console.error=Y}}async function fW1($,I){let q=gZ0($),[z,U,Y]=q.command;if(z==="version"||z==="v"||Boolean(q.options.version)||Boolean(q.options.v)||Boolean(q.options.V)){E0(jJ);return}let J=yZ0(q);if(J.isHelp){nZ0(J.target);return}if(!z||!yW1.has(z))throw Error(`Unknown command: ${q.command.join(" ")}. Run 'seal-use help' for available commands.`);if(z==="webhook"&&U==="material-pack"&&Y==="preview"){let K=q.command[3]??C(q.options.file)??C(q.options.input);if(!K)throw Error("Usage: seal-use webhook material-pack preview <材料包.zip>");await mZ0(K,Rw(q.options));return}if(z==="openapi"){tL0(q);return}if(z==="mcp-config"){Nx();return}if(z==="skill"){KD0(U,Y,q);return}if(z==="mcp"||z==="server"){await rL0(U,q);return}if(z==="probe"){await ID0(U,Y,q);return}if(z==="doctor"){await pL0(U,Y,q);return}if(z==="config"){IX0(U,Y,q);return}if(z==="service"){await jx(U,I,q);return}if(z==="stop"){await jx("stop",I,q);return}if(z==="http"||z==="serve"){await lL0(q);return}if(z==="update"||z==="changelog"){let K=z==="changelog"||U==="changelog"||U==="log"||U==="history"||O0(q.options.changelog)===!0,H=U==="check"||O0(q.options.check)===!0||O0(q.options["check-only"])===!0,G=C(q.options.version)??C(q.options.tag)??(!K&&!H&&U&&!U.startsWith("-")?U:void 0);await FD0(I,{checkOnly:H,changelogOnly:K,limit:i0(q.options.limit),force:O0(q.options.force),targetVersion:G,repo:C(q.options.re Line truncated
`)?"":`
`}`);process.exitCode=$.exitCode}var hW1=Boolean(t.main==t.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&ZD0(process.argv[1])===ZD0(e5));if(hW1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await _W1();else Hx().catch(($)=>{console.error($),process.exitCode=1});export{wx as tokenizeCommand,Hx as startServer,vW1 as resolveMcpEnabled,RW1 as createServer,BW1 as SEAL_MCP_ENABLED_ENV,jW1 as SEAL_CLI_TOOL_NAME,gW1 as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var oW1=Boolean(t.main==t.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&ED0(process.argv[1])===ED0(I9));if(oW1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await lW1();else Mx().catch(($)=>{console.error($),process.exitCode=1});export{Fx as tokenizeCommand,Mx as startServer,cW1 as resolveMcpEnabled,dW1 as createServer,iW1 as SEAL_MCP_ENABLED_ENV,bW1 as SEAL_CLI_TOOL_NAME,pW1 as LEGACY_SEAL_MCP_ENABLED_ENV};
+3
View File
@@ -98,6 +98,7 @@ seal-use corps list
- HTTP REST API & Docs Server: `seal-use http [--port 8787] [--host 127.0.0.1]` (提供 `/docs` 交互文档、`/openapi.json`、`POST /api/cli` 与 `/v1/*` REST API)。
- 审批规则质量校验 (Linter): `seal-use rules lint [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary] --corp <corpId>`; read `references/rule-lint.md`. 全局配置默认关闭 (`config lint <enable|disable>`)。
- 系统自检、环境体检与内嵌架构规范白皮书: `seal-use doctor` (整机环境、目录状态、企业资产统计与健康自检,零磁盘写入), `seal-use doctor guide` (纯内存只读输出内嵌白皮书与目录规范), `seal-use doctor paths` (紧凑型核心目录健康检查)。
- Full CLI inventory: read `references/cli.md`.
## Material-pack Webhook policy and recovery
@@ -118,6 +119,8 @@ push 会重新读取最新 Webhook 配置;校验通过后才会开始上传附
## High-Value Commands
```bash
seal-use doctor
seal-use doctor guide
seal-use corps list [query] [--env production|test] [--strict]
seal-use corps search <keyword> [--env production|test] [--strict]
seal-use corps get <corpId>
+9
View File
@@ -68,6 +68,9 @@ seal-use skill dump
seal-use skill install [--dir <path>|--local]
seal-use skill status
seal-use openapi
seal-use doctor [--quiet]
seal-use doctor guide
seal-use doctor paths
seal-use probe [<corpId>]
seal-use tools list
seal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]
@@ -177,6 +180,12 @@ seal-use simulation package-upload <材料包.zip> --corp <corpId>
`seal-use update` updates the git checkout, runs `bun install`, and restarts the local service if it was running.
System diagnostic & embedded architecture specifications:
- `seal-use doctor [--quiet]` executes a comprehensive read-only environment diagnostic health check (runtime executable, filesystem paths health, enterprise assets summary, daemon status) with zero disk footprint.
- `seal-use doctor guide` reads the complete embedded system architecture & directory specification whitepaper directly from binary memory without touching disk.
- `seal-use doctor paths` outputs compact JSON audit of all filesystem paths touched by the CLI.
Enterprise and tenant management:
- `seal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]`
+48
View File
@@ -0,0 +1,48 @@
import { describe, expect, test } from "bun:test";
import { runCli } from "../runner.js";
describe("seal-use doctor CLI", () => {
test("runs full system diagnosis and outputs JSON to stdout and dashboard to stderr", async () => {
const result = await runCli(["doctor"]);
expect(result.exitCode).toBe(0);
expect(result.isError).toBe(false);
// stdout must be clean, parseable JSON
const data = JSON.parse(result.stdout);
expect(["ok", "warning"]).toContain(data.doctor);
expect(data.runtime).toBeDefined();
expect(data.runtime.version).toBeDefined();
expect(data.directories).toBeDefined();
expect(data.directories.configDir).toBeDefined();
expect(data.enterprises).toBeDefined();
expect(data.knowledge).toBeDefined();
expect(data.knowledge.guideCommand).toBe("seal-use doctor guide");
// stderr must contain human-friendly dashboard
expect(result.stderr).toContain("Seal Use Doctor");
expect(result.stderr).toContain("【运行环境】");
expect(result.stderr).toContain("【核心路径状态】");
});
test("doctor guide dumps embedded documentation in Markdown", async () => {
const result = await runCli(["doctor", "guide"]);
expect(result.exitCode).toBe(0);
expect(result.stdout).toContain("# Seal Use 系统架构与运行规范白皮书");
expect(result.stdout).toContain("系统目录全景规范");
expect(result.stdout).toContain("安全与数据隐私保证");
expect(result.stderr).toContain("纯内存只读");
});
test("doctor paths outputs compact directory specifications JSON", async () => {
const result = await runCli(["doctor", "paths"]);
expect(result.exitCode).toBe(0);
const paths = JSON.parse(result.stdout);
expect(paths.configDir).toBeDefined();
expect(paths.enterprisesDir).toBeDefined();
expect(paths.tokenStore).toBeDefined();
expect(paths.agentSkillDir).toBeDefined();
});
});
+39
View File
@@ -0,0 +1,39 @@
import { diagnoseSystem, formatDoctorDashboard } from "../../core/doctor/diagnose.js";
import { getEmbeddedGuideMarkdown } from "../../core/doctor/knowledge.js";
import { booleanOption } from "../parser.js";
import { printJson } from "../printer.js";
import type { ParsedArgs } from "../types.js";
export async function handleDoctorCommand(
action: string | undefined,
maybeName: string | undefined,
args: ParsedArgs
) {
const subAction = (action ?? maybeName ?? "").toLowerCase();
// 1. Output embedded guide / documentation
if (subAction === "guide" || subAction === "doc" || subAction === "knowledge" || subAction === "book") {
console.error("📖 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...\n");
console.log(getEmbeddedGuideMarkdown());
return;
}
// 2. Output compact directory specifications
if (subAction === "paths" || subAction === "dirs" || subAction === "directories") {
const diagnosis = diagnoseSystem();
printJson(diagnosis.directories);
return;
}
// 3. Default: Full system diagnostic inspection
const diagnosis = diagnoseSystem();
// If quiet or json-only is not explicitly disabled, output formatted dashboard on stderr
const isQuiet = booleanOption(args.options.quiet) || booleanOption(args.options.silent);
if (!isQuiet) {
console.error(formatDoctorDashboard(diagnosis));
}
// Machine channel (stdout): clean, structured JSON
printJson(diagnosis);
}
+27
View File
@@ -921,6 +921,33 @@ export const HELP_REGISTRY: AreaHelp[] = [
usage: ["seal-use openapi"]
}
]
},
{
area: "doctor",
title: "System diagnostic and environment health check",
description: "Inspects runtime executable, filesystem paths, enterprise assets, and embedded specifications without modifying any files.",
commands: [
{
name: "",
summary: "Run complete system diagnostic health check",
usage: ["seal-use doctor [--quiet]"],
options: [
{ flag: "--quiet", description: "Suppress formatted human dashboard on stderr" }
]
},
{
name: "guide",
aliases: ["doc", "knowledge"],
summary: "Read embedded system architecture & directory specification whitepaper",
usage: ["seal-use doctor guide"]
},
{
name: "paths",
aliases: ["dirs"],
summary: "Inspect core filesystem paths and directory health",
usage: ["seal-use doctor paths"]
}
]
}
];
+7
View File
@@ -16,6 +16,7 @@ import { handleContextCommand } from "./commands/context.js";
import { handleCorpsCommand } from "./commands/corps.js";
import { handleDelegationCommand, handleDelegationFromHoseLink } from "./commands/delegation.js";
import { handleDeployCommand } from "./commands/deploy.js";
import { handleDoctorCommand } from "./commands/doctor.js";
import { handleHttpCommand } from "./commands/http.js";
import { handleLlmCommand } from "./commands/llm.js";
import { handleMcpCommand, printMcpConfig } from "./commands/mcp.js";
@@ -89,6 +90,7 @@ export const KNOWN_AREAS = new Set([
"skill",
"openapi",
"probe",
"doctor",
"changelog"
]);
@@ -221,6 +223,11 @@ async function dispatch(argv: string[], runtime: CliRuntime) {
return;
}
if (area === "doctor") {
await handleDoctorCommand(action, maybeName, args);
return;
}
if (area === "config") {
handleConfigCommand(action, maybeName, args);
return;
+75
View File
@@ -0,0 +1,75 @@
import { describe, expect, test } from "bun:test";
import { VERSION } from "../../version.js";
import { diagnoseSystem, formatDoctorDashboard } from "./diagnose.js";
import {
EMBEDDED_DIRECTORY_SPECS,
EMBEDDED_DOMAIN_CAPABILITIES,
EMBEDDED_SECURITY_POLICIES,
getEmbeddedGuideMarkdown
} from "./knowledge.js";
describe("Doctor Embedded Knowledge", () => {
test("EMBEDDED_DIRECTORY_SPECS defines core paths", () => {
expect(EMBEDDED_DIRECTORY_SPECS.length).toBeGreaterThanOrEqual(8);
const names = EMBEDDED_DIRECTORY_SPECS.map((s) => s.name);
expect(names).toContain("配置与状态根目录");
expect(names).toContain("企业配置文件目录");
expect(names).toContain("全局命令行程序");
expect(names).toContain("AI Agent 技能主目录");
});
test("EMBEDDED_SECURITY_POLICIES contains core privacy guarantees", () => {
expect(EMBEDDED_SECURITY_POLICIES.length).toBeGreaterThanOrEqual(3);
const topics = EMBEDDED_SECURITY_POLICIES.map((p) => p.topic);
expect(topics).toContain("敏感凭据脱敏保护");
expect(topics).toContain("正式环境与测试环境严格隔离");
});
test("EMBEDDED_DOMAIN_CAPABILITIES covers main CLI areas", () => {
const domains = EMBEDDED_DOMAIN_CAPABILITIES.map((d) => d.domain);
expect(domains.some((d) => d.startsWith("corps"))).toBe(true);
expect(domains.some((d) => d.startsWith("approval-runs"))).toBe(true);
expect(domains.some((d) => d.startsWith("rules"))).toBe(true);
expect(domains.some((d) => d.startsWith("doctor"))).toBe(true);
});
test("getEmbeddedGuideMarkdown renders complete Markdown documentation", () => {
const md = getEmbeddedGuideMarkdown();
expect(md).toContain("# Seal Use 系统架构与运行规范白皮书");
expect(md).toContain("系统目录全景规范");
expect(md).toContain("安全与数据隐私保证");
expect(md).toContain("业务域能力图谱");
expect(md).toContain("seal-use doctor guide");
});
});
describe("Doctor Diagnosis Engine", () => {
test("diagnoseSystem returns valid read-only diagnostic object without throwing", () => {
const diagnosis = diagnoseSystem();
expect(["ok", "warning"]).toContain(diagnosis.doctor);
expect(diagnosis.runtime.version).toBe(VERSION);
expect(diagnosis.runtime.executablePath.length).toBeGreaterThan(0);
expect(diagnosis.runtime.platform.length).toBeGreaterThan(0);
expect(diagnosis.directories.configDir).toBeDefined();
expect(diagnosis.directories.configDir!.path).toContain(".config");
expect(diagnosis.directories.enterprisesDir).toBeDefined();
expect(diagnosis.directories.agentSkillDir).toBeDefined();
expect(diagnosis.checks.length).toBeGreaterThanOrEqual(3);
expect(diagnosis.knowledge.directorySpecsCount).toBe(EMBEDDED_DIRECTORY_SPECS.length);
});
test("formatDoctorDashboard renders human-readable summary dashboard", () => {
const diagnosis = diagnoseSystem();
const dashboard = formatDoctorDashboard(diagnosis);
expect(dashboard).toContain("Seal Use Doctor");
expect(dashboard).toContain("【运行环境】");
expect(dashboard).toContain("【核心路径状态】");
expect(dashboard).toContain("【企业资产概览】");
expect(dashboard).toContain("【健康自检】");
expect(dashboard).toContain("seal-use doctor guide");
});
});
+327
View File
@@ -0,0 +1,327 @@
import { accessSync, constants, existsSync, readdirSync, statSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { VERSION } from "../../version.js";
import { loadCorpConfigs, loadGlobalConfig } from "../config/loader.js";
import { getDefaultGlobalSkillDir } from "../embedded-skill.js";
import {
EMBEDDED_DIRECTORY_SPECS,
EMBEDDED_DOMAIN_CAPABILITIES,
EMBEDDED_SECURITY_POLICIES
} from "./knowledge.js";
export interface DirectoryHealth {
name: string;
path: string;
exists: boolean;
writable?: boolean;
fileCount?: number;
description: string;
}
export interface HealthCheckItem {
id: string;
title: string;
status: "ok" | "warn" | "error";
message: string;
}
export interface DoctorDiagnosis {
doctor: "ok" | "warning";
timestamp: string;
runtime: {
version: string;
executablePath: string;
platform: string;
engine: string;
};
directories: Record<string, DirectoryHealth>;
enterprises: {
total: number;
productionCount: number;
testCount: number;
activeCorpId?: string;
activeCorpName?: string;
};
checks: HealthCheckItem[];
knowledge: {
summary: string;
directorySpecsCount: number;
securityPoliciesCount: number;
domainCapabilitiesCount: number;
guideCommand: string;
};
}
function countJsonFiles(dir: string): number {
if (!existsSync(dir)) return 0;
try {
return readdirSync(dir).filter((file) => file.endsWith(".json")).length;
} catch {
return 0;
}
}
function isPathWritable(path: string): boolean {
try {
accessSync(path, constants.W_OK);
return true;
} catch {
return false;
}
}
/**
* Pure, read-only system diagnostic and health inspection.
* Never creates, mutates, or deletes any files on the filesystem.
*/
export function diagnoseSystem(): DoctorDiagnosis {
const home = homedir();
const configDir = join(home, ".config", "seal-use");
const enterprisesDir = join(configDir, "enterprises");
const globalConfigFile = join(configDir, "config.json");
const tokenStore = join(configDir, "seal_tokens.json");
const mappingsDir = join(configDir, "mappings");
const agentSkillDir = getDefaultGlobalSkillDir();
const exportDir = join(home, "Downloads");
const globalBinaryCandidates = [
"/opt/homebrew/bin/seal-use",
"/usr/local/bin/seal-use",
join(home, ".local", "bin", "seal-use"),
join(home, "bin", "seal-use")
];
const detectedBinary = globalBinaryCandidates.find((p) => existsSync(p)) ?? process.execPath;
const directories: Record<string, DirectoryHealth> = {
configDir: {
name: "配置根目录",
path: configDir,
exists: existsSync(configDir),
writable: existsSync(configDir) ? isPathWritable(configDir) : false,
description: "用户持久化配置与企业状态根目录"
},
enterprisesDir: {
name: "企业配置目录",
path: enterprisesDir,
exists: existsSync(enterprisesDir),
writable: existsSync(enterprisesDir) ? isPathWritable(enterprisesDir) : false,
fileCount: countJsonFiles(enterprisesDir),
description: "企业连接配置(JSON)保存路径"
},
globalConfigFile: {
name: "全局配置文件",
path: globalConfigFile,
exists: existsSync(globalConfigFile),
description: "全局工作模式与默认企业配置"
},
tokenStore: {
name: "凭据缓存",
path: tokenStore,
exists: existsSync(tokenStore),
description: "会话凭据与令牌缓存"
},
mappingsDir: {
name: "规则版本映射快照",
path: mappingsDir,
exists: existsSync(mappingsDir),
fileCount: countJsonFiles(mappingsDir),
description: "生产与测试规则版本映射对照表"
},
agentSkillDir: {
name: "AI Agent 技能目录",
path: agentSkillDir,
exists: existsSync(join(agentSkillDir, "SKILL.md")),
description: "本地 Agent 技能主目录"
},
exportDefaultDir: {
name: "报表默认导出目录",
path: exportDir,
exists: existsSync(exportDir),
writable: existsSync(exportDir) ? isPathWritable(exportDir) : false,
description: "审核大盘报表默认写入目录"
},
globalBinary: {
name: "全局命令行二进制",
path: detectedBinary,
exists: existsSync(detectedBinary),
description: "系统全局命令执行入口"
}
};
// Safe read of loaded corps without side-effects
let corps: ReturnType<typeof loadCorpConfigs> = [];
try {
corps = loadCorpConfigs();
} catch {
corps = [];
}
const globalConfig = loadGlobalConfig();
const currentCorpId = globalConfig.defaultCorpId ?? corps[0]?.id;
const currentCorp = corps.find((c) => c.id === currentCorpId);
const testCount = corps.filter((c) => (c.environment ?? "production").toLowerCase() === "test").length;
const prodCount = corps.length - testCount;
// Build health checks
const checks: HealthCheckItem[] = [];
// Check 1: Executable
checks.push({
id: "executable",
title: "命令行二进制",
status: "ok",
message: `当前执行路径: ${process.execPath}`
});
// Check 2: Config Directory
if (directories.configDir?.exists && directories.configDir.writable) {
checks.push({
id: "config_dir",
title: "配置目录访问",
status: "ok",
message: `${configDir} (正常读写)`
});
} else if (directories.configDir?.exists) {
checks.push({
id: "config_dir",
title: "配置目录访问",
status: "warn",
message: `${configDir} (存在但可能不可写)`
});
} else {
checks.push({
id: "config_dir",
title: "配置目录访问",
status: "warn",
message: `未检测到配置目录 ${configDir},首次运行配置命令时将自动创建`
});
}
// Check 3: Enterprises Configured
if (corps.length > 0) {
checks.push({
id: "enterprises",
title: "企业接入状态",
status: "ok",
message: `已接入 ${corps.length} 家企业 (正式: ${prodCount}, 测试: ${testCount})`
});
} else {
checks.push({
id: "enterprises",
title: "企业接入状态",
status: "warn",
message: "当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"
});
}
// Check 4: Agent Skill
if (directories.agentSkillDir?.exists) {
checks.push({
id: "agent_skill",
title: "AI Agent 技能",
status: "ok",
message: `已就绪于 ${agentSkillDir}`
});
} else {
checks.push({
id: "agent_skill",
title: "AI Agent 技能",
status: "warn",
message: `未在 ${agentSkillDir} 检测到技能,可运行 'seal-use skill sync' 安装`
});
}
const hasWarning = checks.some((c) => c.status === "warn" || c.status === "error");
const engine = typeof (globalThis as any).Bun !== "undefined"
? `Bun ${(globalThis as any).Bun.version}`
: `Node ${process.version}`;
return {
doctor: hasWarning ? "warning" : "ok",
timestamp: new Date().toISOString(),
runtime: {
version: VERSION,
executablePath: process.execPath,
platform: `${process.platform} (${process.arch})`,
engine
},
directories,
enterprises: {
total: corps.length,
productionCount: prodCount,
testCount,
activeCorpId: currentCorp?.id,
activeCorpName: currentCorp?.name
},
checks,
knowledge: {
summary: "内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",
directorySpecsCount: EMBEDDED_DIRECTORY_SPECS.length,
securityPoliciesCount: EMBEDDED_SECURITY_POLICIES.length,
domainCapabilitiesCount: EMBEDDED_DOMAIN_CAPABILITIES.length,
guideCommand: "seal-use doctor guide"
}
};
}
/**
* Formats a terminal-friendly, human-readable diagnostic dashboard for stderr.
*/
export function formatDoctorDashboard(diagnosis: DoctorDiagnosis): string {
const lines: string[] = [];
const symbol = diagnosis.doctor === "ok" ? "✨" : "⚠️";
lines.push(`🩺 [Seal Use Doctor] 系统健康诊断看板 ${symbol}`);
lines.push("─────────────────────────────────────────────────────────────");
// Runtime section
lines.push("【运行环境】");
lines.push(` 版本号: ${diagnosis.runtime.version}`);
lines.push(` 程序路径: ${diagnosis.runtime.executablePath}`);
lines.push(` 操作系统: ${diagnosis.runtime.platform}`);
lines.push(` 执行引擎: ${diagnosis.runtime.engine}`);
lines.push("");
// Directory section
lines.push("【核心路径状态】");
for (const [, dir] of Object.entries(diagnosis.directories)) {
const icon = dir.exists ? "✓" : "○";
const statusText = dir.exists
? dir.fileCount !== undefined
? `(${dir.fileCount} 个文件)`
: dir.writable
? "(就绪/可写)"
: "(存在)"
: "(未创建)";
lines.push(` ${icon} ${dir.name.padEnd(16, " ")}: ${dir.path} ${statusText}`);
}
lines.push("");
// Enterprise section
lines.push("【企业资产概览】");
lines.push(` 接入企业总计: ${diagnosis.enterprises.total} 家 (生产: ${diagnosis.enterprises.productionCount}, 测试: ${diagnosis.enterprises.testCount})`);
if (diagnosis.enterprises.activeCorpId) {
lines.push(` 当前激活企业: ${diagnosis.enterprises.activeCorpName} (${diagnosis.enterprises.activeCorpId})`);
} else {
lines.push(" 当前激活企业: 无默认企业 (无状态模式)");
}
lines.push("");
// Health checks section
lines.push("【健康自检】");
for (const c of diagnosis.checks) {
const icon = c.status === "ok" ? "✓" : c.status === "warn" ? "⚠️" : "✗";
lines.push(` ${icon} [${c.title}]: ${c.message}`);
}
lines.push("");
// Next steps hint
lines.push("─────────────────────────────────────────────────────────────");
lines.push("👉 查阅内嵌白皮书与目录规范: seal-use doctor guide");
lines.push("👉 检索企业: seal-use corps search <keyword>");
return lines.join("\n");
}
+240
View File
@@ -0,0 +1,240 @@
/**
* Embedded System Knowledge & Architectural Specifications
*
* This file contains static, read-only documentation and system contracts
* bundled directly into the standalone binary. It requires zero network access
* and performs zero disk writes.
*/
export interface DirectorySpec {
name: string;
category: "config" | "binary" | "skill" | "export" | "temp";
standardPath: string;
purpose: string;
accessMode: "read-write" | "executable" | "transient";
retention: "persistent" | "cache" | "ephemeral";
}
export interface SecurityPolicySpec {
topic: string;
guarantee: string;
enforcement: string;
}
export interface DomainCapabilitySpec {
domain: string;
summary: string;
primaryCommands: string[];
}
export const EMBEDDED_DIRECTORY_SPECS: DirectorySpec[] = [
{
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"
}
];
export const EMBEDDED_SECURITY_POLICIES: SecurityPolicySpec[] = [
{
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 路径杜绝写文件与环境篡改。"
}
];
export const EMBEDDED_DOMAIN_CAPABILITIES: DomainCapabilitySpec[] = [
{
domain: "corps (企业管理)",
summary: "多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",
primaryCommands: ["corps list", "corps search <query>", "corps get <corpId>", "corps mark", "corps bind-test", "corps sync-test"]
},
{
domain: "approval-runs (审核大盘)",
summary: "AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",
primaryCommands: ["approval-runs list", "approval-runs stats", "approval-runs get", "approval-runs export", "approval-runs url"]
},
{
domain: "rules (规则治理)",
summary: "审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",
primaryCommands: ["rules pull", "rules lint", "rules push", "rules map", "rules count"]
},
{
domain: "preference (决策偏好)",
summary: "AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",
primaryCommands: ["preference get", "preference decision update", "preference thinking-depth set"]
},
{
domain: "simulation (模拟演练)",
summary: "合思单据指定、材料包导入、飞书/泛微三方审批定义演练、批次轮询等待与数据清理",
primaryCommands: ["simulation create", "simulation status", "simulation wait", "simulation clean"]
},
{
domain: "webhook (通道与重放)",
summary: "Webhook 回调通道配置、材料包校验推送、线上单据向 Webhook 通道测试重放",
primaryCommands: ["webhook list", "webhook add", "webhook replay", "webhook material-pack push"]
},
{
domain: "deploy (费控集成)",
summary: "Seal AI 智能审核能力发布到合思费控企业、对接要求检测与配置同步",
primaryCommands: ["deploy hosecloud requirements", "deploy hosecloud status", "deploy hosecloud sync"]
},
{
domain: "doctor (系统诊断)",
summary: "整机环境健康自检、目录全景体检看板、内置架构与规范白皮书离线查阅",
primaryCommands: ["doctor", "doctor guide", "doctor paths"]
}
];
/**
* Generates the full formatted embedded documentation in Markdown.
*/
export function getEmbeddedGuideMarkdown(): string {
return `# Seal Use 系统架构与运行规范白皮书
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
---
## 1. 系统定位与设计哲学
\`seal-use\` 是合思与 Seal AI 体系的企业级智能审核、规则治理与模拟演练 CLI 工具包,兼具人类工程师命令行使用与 AI Agent Harness 自动化集成能力。
### 核心交互契约
- **机器通道 (\`stdout\`)**:所有命令默认在标准输出返回干净、严格类型化的 JSON 载荷,供自动化脚本及 AI Agent 解析。
- **指导与诊断通道 (\`stderr\`)**:标准错误专用于输出运行状态、网络探测日志、自愈指引以及显式的下一步动作建议(如 \`👉 Next action: seal-use ...\`)。
- **退出码契约**:成功为 \`0\`,参数校验失败、未确认拦截或上游 API 报错均赋予非零退出码(如 \`1\`、\`2\`、\`10\`),杜绝盲目吞错。
---
## 2. 系统目录全景规范
\`seal-use\` 在用户计算机上的所有文件访问严格收敛于以下明确定义的目录中:
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
| :--- | :--- | :--- | :--- |
${EMBEDDED_DIRECTORY_SPECS.map(
(s) => `| **${s.name}** | \`${s.category}\` | \`${s.standardPath}\` | ${s.purpose} (${s.retention}) |`
).join("\n")}
---
## 3. 安全与数据隐私保证
${EMBEDDED_SECURITY_POLICIES.map(
(p, idx) => `### 3.${idx + 1} ${p.topic}
- **安全承诺**:${p.guarantee}
- **实现约束**:${p.enforcement}
`
).join("\n")}
---
## 4. 业务域能力图谱
${EMBEDDED_DOMAIN_CAPABILITIES.map(
(c) => `### \`seal-use ${c.domain}\`
* **能力定位**:${c.summary}
* **核心命令**:${c.primaryCommands.map((cmd) => `\`seal-use ${cmd}\``).join("、")}
`
).join("\n")}
---
## 5. 快速排错与健康诊断指引
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
`;
}