Merge pull request #87 from yunyingk/codex/corps-soft-fuzzy-search
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
Add intelligent soft fuzzy search to corps search command
This commit is contained in:
8 files changed
+772
-211
No files matched your search
Vendored
+165
-165
@@ -1,97 +1,97 @@
|
||||
import{createRequire as gL0}from"node:module";var TL0=Object.create;var{getPrototypeOf:EL0,defineProperty:UO,getOwnPropertyNames:BL0}=Object;var vL0=Object.prototype.hasOwnProperty;function RL0($){return this[$]}var jL0,CL0,NI=($,I,U)=>{var Y=$!=null&&typeof $==="object";if(Y){var J=I?jL0??=new WeakMap:CL0??=new WeakMap,Q=J.get($);if(Q)return Q}U=$!=null?TL0(EL0($)):{};let K=I||!$||!$.__esModule?UO(U,"default",{value:$,enumerable:!0}):U;for(let q of BL0($))if(!vL0.call(K,q))UO(K,q,{get:RL0.bind($,q),enumerable:!0});if(Y)J.set($,K);return K};var F=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var _L0=($)=>$;function SL0($,I){this[$]=_L0.bind(null,I)}var $5=($,I)=>{for(var U in I)UO($,U,{get:I[U],enumerable:!0,configurable:!0,set:SL0.bind(I,U)})};var t=gL0(import.meta.url);var bQ=F((Zi)=>{Object.defineProperty(Zi,"__esModule",{value:!0});Zi.regexpCode=Zi.getEsmExportName=Zi.getProperty=Zi.safeStringify=Zi.stringify=Zi.strConcat=Zi.addCodeArg=Zi.str=Zi._=Zi.nil=Zi._Code=Zi.Name=Zi.IDENTIFIER=Zi._CodeOrName=void 0;class bW{}Zi._CodeOrName=bW;Zi.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class JU extends bW{constructor($){super();if(!Zi.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}}}Zi.Name=JU;class l$ extends bW{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,U)=>`${I}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,U)=>{if(U instanceof JU)I[U.str]=(I[U.str]||0)+1;return I},{})}}Zi._Code=l$;Zi.nil=new l$("");function wi($,...I){let U=[$[0]],Y=0;while(Y<I.length)XT(U,I[Y]),U.push($[++Y]);return new l$(U)}Zi._=wi;var zT=new l$("+");function Vi($,...I){let U=[iQ($[0])],Y=0;while(Y<I.length)U.push(zT),XT(U,I[Y]),U.push(zT,iQ($[++Y]));return $M0(U),new l$(U)}Zi.str=Vi;function XT($,I){if(I instanceof l$)$.push(...I._items);else if(I instanceof JU)$.push(I);else $.push(YM0(I))}Zi.addCodeArg=XT;function $M0($){let I=1;while(I<$.length-1){if($[I]===zT){let U=IM0($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function IM0($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof JU||$[$.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 JU))return`"${$}${I.slice(1)}`;return}function UM0($,I){return I.emptyStr()?$:$.emptyStr()?I:Vi`${$}${I}`}Zi.strConcat=UM0;function YM0($){return typeof $=="number"||typeof $=="boolean"||$===null?$:iQ(Array.isArray($)?$.join(","):$)}function JM0($){return new l$(iQ($))}Zi.stringify=JM0;function iQ($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Zi.safeStringify=iQ;function QM0($){return typeof $=="string"&&Zi.IDENTIFIER.test($)?new l$(`.${$}`):wi`[${$}]`}Zi.getProperty=QM0;function KM0($){if(typeof $=="string"&&Zi.IDENTIFIER.test($))return new l$(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Zi.getEsmExportName=KM0;function qM0($){return new l$($.toString())}Zi.regexpCode=qM0});var FT=F((Di)=>{Object.defineProperty(Di,"__esModule",{value:!0});Di.ValueScope=Di.ValueScopeName=Di.Scope=Di.varKinds=Di.UsedValueState=void 0;var c6=bQ();class Xi extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var pW;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(pW||(Di.UsedValueState=pW={}));Di.varKinds={const:new c6.Name("const"),let:new c6.Name("let"),var:new c6.Name("var")};class DT{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof c6.Name?$:this.name($)}name($){return new c6.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,U;if(((U=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}Di.Scope=DT;class OT extends c6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=c6._`.${new c6.Name(I)}[${U}]`}}Di.ValueScopeName=OT;var NM0=c6._`\n`;class Li extends DT{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?NM0:c6.nil}}get(){return this._scope}name($){return new OT($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Y=this.toName($),{prefix:J}=Y,Q=(U=I.key)!==null&&U!==void 0?U:I.ref,K=this._values[J];if(K){let G=K.get(Q);if(Line truncated
|
||||
`:""},this._extScope=$,this._scope=new o$.Scope({parent:$}),this._nodes=[new Ei]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let U=this._extScope.value($,I);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,U,Y){let J=this._scope.toName(I);if(U!==void 0&&Y)this._constants[J.str]=U;return this._leafNode(new Fi($,J,U)),J}const($,I,U){return this._def(o$.varKinds.const,$,I,U)}let($,I,U){return this._def(o$.varKinds.let,$,I,U)}var($,I,U){return this._def(o$.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new AT($,I,U))}add($,I){return this._leafNode(new Ni($,d6.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==W1.nil)this._leafNode(new Ti($));return this}object(...$){let I=["{"];for(let[U,Y]of $){if(I.length>1)I.push(",");if(I.push(U),U!==Y||this.opts.es5)I.push(":"),(0,W1.addCodeArg)(I,Y)}return I.push("}"),new W1._Code(I)}if($,I,U){if(this._blockNode(new Q5($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new Q5($))}else(){return this._elseNode(new nQ)}endIf(){return this._endBlockNode(Q5,nQ)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new Bi($),I)}forRange($,I,U,Y,J=this.opts.es5?o$.varKinds.var:o$.varKinds.let){let Q=this._scope.toName($);return this._for(new vi(J,Q,I,U),()=>Y(Q))}forOf($,I,U,Y=o$.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let Q=I instanceof W1.Name?I:this.var("_arr",I);return this.forRange("_i",0,W1._`${Q}.length`,(K)=>{this.var(J,W1._`${Q}[${K}]`),U(J)})}return this._for(new NT("of",Y,J,I),()=>U(J))}forIn($,I,U,Y=this.opts.es5?o$.varKinds.var:o$.varKinds.const){if(this.opts.ownProperties)return this.forOf($,W1._`Object.keys(${I})`,U);let J=this._scope.toName($);return this._for(new NT("in",Y,J,I),()=>U(J))}endFor(){return this._endBlockNode(QU)}label($){return this._leafNode(new Mi($))}break($){return this._leafNode(new Ai($))}return($){let I=new dW;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(dW)}try($,I,U){if(!I&&!U)throw Error('CodeGen: "try" without "catch" and "finally"');let Y=new Ri;if(this._blockNode(Y),this.code($),I){let J=this.name("e");this._currNode=Y.catch=new mW(J),I(J)}if(U)this._currNode=Y.finally=new lW,this.code(U);return this._endBlockNode(mW,lW)}throw($){return this._leafNode(new Pi($))}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 U=this._nodes.length-I;if(U<0||$!==void 0&&U!==$)throw Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=I,this}func($,I=W1.nil,U,Y){if(this._blockNode(new cW($,I,U)),Y)this.code(Y).endFunc();return this}endFunc(){return this._endBlockNode(cW)}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 U=this._currNode;if(U instanceof $||I&&U 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 Q5))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]=$}}d6.CodeGen=ji;function k7($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function oW($,I){return I instanceof W1._CodeOrName?k7($,I.names):$}function KU($,I,U){if($ instanceof W1.Name)return Y($);if(!J($))return $;return new W1._Code($._items.reduce((Q,K)=>{if(K instanceof W1.Name)K=Y(K);if(K instanceof W1._Code)Q.push(...K._items);else Q.push(K);return Q},[]));function Y(Q){let K=U[Q.str];if(K===void 0||I[Q.str]!==1)return Q;return delete I[Q.str],K}function J(Q){return Q instanceof W1._Code&&Q._items.some((K)=>K instanceof W1.Name&&I[K.str]===1&&U[K.str]!==void 0)}}function TM0($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function Ci($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:W1._`!${MT($)}`}d6.not=Ci;var EM0=_i(d6.operators.AND);function BM0(...$){return $.reduce(EM0)}d6.and=BM0;var vM0=_i(d6.operators.OR);function RM0(...$){return $.reduce(vM0)}d6.or=RM0;function _i($){return(I,U)=>I===W1.nil?U:U===W1.nil?I:W1._`${MT(I)} ${$} ${MT(U)}`}function MT($){return $ instanceof W1.Name?$:W1._`(${Line truncated
|
||||
|| (${K} == "string" && ${J} && ${J} == +${J})`).assign(q,t0._`+${J}`);return;case"integer":Y.elseIf(t0._`${K} === "boolean" || ${J} === null
|
||||
|| (${K} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(q,t0._`+${J}`);return;case"boolean":Y.elseIf(t0._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(q,!1).elseIf(t0._`${J} === "true" || ${J} === 1`).assign(q,!0);return;case"null":Y.elseIf(t0._`${J} === "" || ${J} === 0 || ${J} === false`),Y.assign(q,null);return;case"array":Y.elseIf(t0._`${K} === "string" || ${K} === "number"
|
||||
|| ${K} === "boolean" || ${J} === null`).assign(q,t0._`[${J}]`)}}}function bA0({gen:$,parentData:I,parentDataProperty:U},Y){$.if(t0._`${I} !== undefined`,()=>$.assign(t0._`${I}[${U}]`,Y))}function jT($,I,U,Y=qU.Correct){let J=Y===qU.Correct?t0.operators.EQ:t0.operators.NEQ,Q;switch($){case"null":return t0._`${I} ${J} null`;case"array":Q=t0._`Array.isArray(${I})`;break;case"object":Q=t0._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":Q=K(t0._`!(${I} % 1) && !isNaN(${I})`);break;case"number":Q=K();break;default:return t0._`typeof ${I} ${J} ${$}`}return Y===qU.Correct?Q:(0,t0.not)(Q);function K(q=t0.nil){return(0,t0.and)(t0._`typeof ${I} == "number"`,q,U?t0._`isFinite(${I})`:t0.nil)}}qb.checkDataType=jT;function CT($,I,U,Y){if($.length===1)return jT($[0],I,U,Y);let J,Q=(0,Jb.toHash)($);if(Q.array&&Q.object){let K=t0._`typeof ${I} != "object"`;J=Q.null?K:t0._`!${I} || ${K}`,delete Q.null,delete Q.array,delete Q.object}else J=t0.nil;if(Q.number)delete Q.integer;for(let K in Q)J=(0,t0.and)(J,jT(K,I,U,Y));return J}qb.checkDataTypes=CT;var nA0={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?t0._`{type: ${$}}`:t0._`{type: ${I}}`};function _T($){let I=pA0($);(0,uA0.reportError)(I,nA0)}qb.reportTypeError=_T;function pA0($){let{gen:I,data:U,schema:Y}=$,J=(0,Jb.schemaRefOrVal)($,Y,"type");return{gen:I,keyword:"type",data:U,schema:Y.type,schemaCode:J,schemaValue:J,parentSchema:Y,params:{},it:$}}});var Vb=F((Wb)=>{Object.defineProperty(Wb,"__esModule",{value:!0});Wb.assignDefaults=void 0;var HU=a0(),tA0=z1();function aA0($,I){let{properties:U,items:Y}=$.schema;if(I==="object"&&U)for(let J in U)Gb($,J,U[J].default);else if(I==="array"&&Array.isArray(Y))Y.forEach((J,Q)=>Gb($,Q,J.default))}Wb.assignDefaults=aA0;function Gb($,I,U){let{gen:Y,compositeRule:J,data:Q,opts:K}=$;if(U===void 0)return;let q=HU._`${Q}${(0,HU.getProperty)(I)}`;if(J){(0,tA0.checkStrictMode)($,`default is ignored for: ${q}`);return}let H=HU._`${q} === undefined`;if(K.useDefaults==="empty")H=HU._`${H} || ${q} === null || ${q} === ""`;Y.if(H,HU._`${q} = ${(0,HU.stringify)(U)}`)}});var B$=F((Xb)=>{Object.defineProperty(Xb,"__esModule",{value:!0});Xb.validateUnion=Xb.validateArray=Xb.usePattern=Xb.callValidateCode=Xb.schemaProperties=Xb.allSchemaProperties=Xb.noPropertyInData=Xb.propertyInData=Xb.isOwnProperty=Xb.hasPropFunc=Xb.reportMissingProp=Xb.checkMissingProp=Xb.checkReportMissingProp=void 0;var a1=a0(),ST=z1(),X9=K5(),sA0=z1();function eA0($,I){let{gen:U,data:Y,it:J}=$;U.if(yT(U,Y,I,J.opts.ownProperties),()=>{$.setParams({missingProperty:a1._`${I}`},!0),$.error()})}Xb.checkReportMissingProp=eA0;function $P0({gen:$,data:I,it:{opts:U}},Y,J){return(0,a1.or)(...Y.map((Q)=>(0,a1.and)(yT($,I,Q,U.ownProperties),a1._`${J} = ${Q}`)))}Xb.checkMissingProp=$P0;function IP0($,I){$.setParams({missingProperty:I},!0),$.error()}Xb.reportMissingProp=IP0;function Zb($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:a1._`Object.prototype.hasOwnProperty`})}Xb.hasPropFunc=Zb;function gT($,I,U){return a1._`${Zb($)}.call(${I}, ${U})`}Xb.isOwnProperty=gT;function UP0($,I,U,Y){let J=a1._`${I}${(0,a1.getProperty)(U)} !== undefined`;return Y?a1._`${J} && ${gT($,I,U)}`:J}Xb.propertyInData=UP0;function yT($,I,U,Y){let J=a1._`${I}${(0,a1.getProperty)(U)} === undefined`;return Y?(0,a1.or)(J,(0,a1.not)(gT($,I,U))):J}Xb.noPropertyInData=yT;function zb($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}Xb.allSchemaProperties=zb;function YP0($,I){return zb(I).filter((U)=>!(0,ST.alwaysValidSchema)($,I[U]))}Xb.schemaProperties=YP0;function JP0({schemaCode:$,data:I,it:{gen:U,topSchemaRef:Y,schemaPath:J,errorPath:Q},it:K},q,H,G){let W=G?a1._`${$}, ${I}, ${Y}${J}`:I,w=[[X9.default.instancePath,(0,a1.strConcat)(X9.default.instancePath,Q)],[X9.default.parentData,K.parentData],[X9.default.parentDataProperty,K.parentDataProperty],[X9.default.rootData,X9.default.rootData]];if(K.opts.dynamicRef)w.push([X9.default.dynamicAnchors,X9.default.dynamicAnchors]);let Z=a1._`${W}, ${U.object(...w)}`;return H!==a1.nil?a1._`${q}.call(${H}, ${Z})`:a1._`${q}(${Z})`}Xb.callValidateCode=JP0;var QP0=a1._`new RegExp`;function KP0({gen:$,it:{opts:I}},U){let Y=I.unicodeRegExp?"u":"",{regExp:J}=I.code,Q=J(U,Y);return $.scopeValue("pattern",{key:Q.toString(),ref:Q,code:a1._`${J.code==="new RegExp"?QP0:(0,sA0.useFunc)($,J)}(${U}, ${Y})`})}Xb.usePattern=KP0;function qP0($){let{gen:I,data:U,keyword:Y,it:J}=$,Q=I.name("valid");if(J.allErrors){let q=I.let("valid",!0);return K(()=>I.assign(q,!1)),q}return I.var(Q,!0),K(()=>I.break()),Q;function K(q){let H=I.const("len",a1._`${U}.length`);I.forRange("i",0,H,(G)=>{$.subschema({keyword:Y,dataProp:G,dataPropType:ST.Type.Num},Q),I.if((0,a1.not)(Q),q)})}}Xb.validateArray=qP0;function HP0($){let{gen:I,schema:U,keyword:Y,it:J}=$;if(!Array.isArray(U))throw Error("ajv implementation error");if(U.some((H)=>(0,ST.alwaysValidSchema)(J,H))&&!J.opts.unevaluated)return;le
Line truncated
|
||||
missingProperty: ${Y},
|
||||
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
|
||||
|| (${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
|
||||
missingProperty: ${z},
|
||||
depsCount: ${I},
|
||||
deps: ${U}}`};var vv0={keyword:"dependencies",type:"object",schemaType:"object",error:gp.error,code($){let[I,U]=Rv0($);_p($,I),Sp($,U)}};function Rv0({schema:$}){let I={},U={};for(let Y in $){if(Y==="__proto__")continue;let J=Array.isArray($[Y])?I:U;J[Y]=$[Y]}return[I,U]}function _p($,I=$.schema){let{gen:U,data:Y,it:J}=$;if(Object.keys(I).length===0)return;let Q=U.let("missing");for(let K in I){let q=I[K];if(q.length===0)continue;let H=(0,K2.propertyInData)(U,Y,K,J.opts.ownProperties);if($.setParams({property:K,depsCount:q.length,deps:q.join(", ")}),J.allErrors)U.if(H,()=>{for(let G of q)(0,K2.checkReportMissingProp)($,G)});else U.if(YE._`${H} && (${(0,K2.checkMissingProp)($,q,Q)})`),(0,K2.reportMissingProp)($,Q),U.else()}}gp.validatePropertyDeps=_p;function Sp($,I=$.schema){let{gen:U,data:Y,keyword:J,it:Q}=$,K=U.name("valid");for(let q in I){if((0,Bv0.alwaysValidSchema)(Q,I[q]))continue;U.if((0,K2.propertyInData)(U,Y,q,Q.opts.ownProperties),()=>{let H=$.subschema({keyword:J,schemaProp:q},K);$.mergeValidEvaluated(H,K)},()=>U.var(K,!0)),$.ok(K)}}gp.validateSchemaDeps=Sp;gp.default=vv0});var fp=F((xp)=>{Object.defineProperty(xp,"__esModule",{value:!0});var kp=a0(),_v0=z1(),Sv0={message:"property name must be valid",params:({params:$})=>kp._`{propertyName: ${$.propertyName}}`},gv0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Sv0,code($){let{gen:I,schema:U,data:Y,it:J}=$;if((0,_v0.alwaysValidSchema)(J,U))return;let Q=I.name("valid");I.forIn("key",Y,(K)=>{$.setParams({propertyName:K}),$.subschema({keyword:"propertyNames",data:K,dataTypes:["string"],propertyName:K,compositeRule:!0},Q),I.if((0,kp.not)(Q),()=>{if($.error(!0),!J.allErrors)I.break()})}),$.ok(Q)}};xp.default=gv0});var JE=F((ip)=>{Object.defineProperty(ip,"__esModule",{value:!0});var Lw=B$(),a$=a0(),hv0=K5(),Dw=z1(),uv0={message:"must NOT have additional properties",params:({params:$})=>a$._`{additionalProperty: ${$.additionalProperty}}`},kv0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:uv0,code($){let{gen:I,schema:U,parentSchema:Y,data:J,errsCount:Q,it:K}=$;if(!Q)throw Error("ajv implementation error");let{allErrors:q,opts:H}=K;if(K.props=!0,H.removeAdditional!=="all"&&(0,Dw.alwaysValidSchema)(K,U))return;let G=(0,Lw.allSchemaProperties)(Y.properties),W=(0,Lw.allSchemaProperties)(Y.patternProperties);w(),$.ok(a$._`${Q} === ${hv0.default.errors}`);function w(){I.forIn("key",J,(D)=>{if(!G.length&&!W.length)X(D);else I.if(Z(D),()=>X(D))})}function Z(D){let O;if(G.length>8){let P=(0,Dw.schemaRefOrVal)(K,Y.properties,"properties");O=(0,Lw.isOwnProperty)(I,P,D)}else if(G.length)O=(0,a$.or)(...G.map((P)=>a$._`${D} === ${P}`));else O=a$.nil;if(W.length)O=(0,a$.or)(O,...W.map((P)=>a$._`${(0,Lw.usePattern)($,P)}.test(${D})`));return(0,a$.not)(O)}function V(D){I.code(a$._`delete ${J}[${D}]`)}function X(D){if(H.removeAdditional==="all"||H.removeAdditional&&U===!1){V(D);return}if(U===!1){if($.setParams({additionalProperty:D}),$.error(),!q)I.break();return}if(typeof U=="object"&&!(0,Dw.alwaysValidSchema)(K,U)){let O=I.name("valid");if(H.removeAdditional==="failing")L(D,O,!1),I.if((0,a$.not)(O),()=>{$.reset(),V(D)});else if(L(D,O),!q)I.if((0,a$.not)(O),()=>I.break())}}function L(D,O,P){let T={keyword:"additionalProperties",dataProp:D,dataPropType:Dw.Type.Str};if(P===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,O)}}};ip.default=kv0});var cp=F((pp)=>{Object.defineProperty(pp,"__esModule",{value:!0});var fv0=oQ(),bp=B$(),QE=z1(),np=JE(),iv0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:Y,data:J,it:Q}=$;if(Q.opts.removeAdditional==="all"&&Y.additionalProperties===void 0)np.default.code(new fv0.KeywordCxt(Q,np.default,"additionalProperties"));let K=(0,bp.allSchemaProperties)(U);for(let w of K)Q.definedProperties.add(w);if(Q.opts.unevaluated&&K.length&&Q.props!==!0)Q.props=QE.mergeEvaluated.props(I,(0,QE.toHash)(K),Q.props);let q=K.filter((w)=>!(0,QE.alwaysValidSchema)(Q,U[w]));if(q.length===0)return;let H=I.name("valid");for(let w of q){if(G(w))W(w);else{if(I.if((0,bp.propertyInData)(I,J,w,Q.opts.ownProperties)),W(w),!Q.allErrors)I.else().var(H,!0);I.endIf()}$.it.definedProperties.add(w),$.ok(H)}function G(w){return Q.opts.useDefaults&&!Q.compositeRule&&U[w].default!==void 0}function W(w){$.subschema({keyword:"properties",schemaProp:w,dataProp:w},H)}}};pp.default=iv0});var rp=F((op)=>{Object.defineProperty(op,"__esModule",{value:!0});var dp=B$(),Ow=a0(),mp=z1(),lp=z1(),nv0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:Y,parentSchema:J,it:Q}=$,{opts:K}=Q,q=(0,dp.allSchemaProperties)(U),H=q.filter((L)=>(0,mp.alwaysValidSchema)(Q,U[L]));if(q.length===0||H.length===q.length&&(!Q.opts.unevaluated||Q.props===!0))return;let G=K.strictSchema&&!K.allowMatchingProperties&&J.properties,W=I.name("valid");if(Q.props!==!0&&!(Q.props instanceo
Line truncated
|
||||
\x00`,n+=o1(f,2),n+=q.magic,n+=o1(D,2),n+=o1(O,2),n+=o1(y.crc32,4),n+=o1(y.compressedSize,4),n+=o1(y.uncompressedSize,4),n+=o1(G.length,2),n+=o1(P.length,2);var g=aV.LOCAL_FILE_HEADER+n+G+P,i=aV.CENTRAL_FILE_HEADER+o1(p,2)+n+o1(Z.length,2)+"\x00\x00\x00\x00"+o1(j,4)+o1(Y,4)+G+P+Z;return{fileRecord:g,dirRecord:i}},Fk0=function($,I,U,Y,J){var Q="",K=oU.transformTo("string",J(Y));return Q=aV.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+o1($,2)+o1($,2)+o1(I,4)+o1(U,4)+o1(K.length,2)+K,Q},Nk0=function($){var I="";return I=aV.DATA_DESCRIPTOR+o1($.crc32,4)+o1($.compressedSize,4)+o1($.uncompressedSize,4),I};function J8($,I,U,Y){rU.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=U,this.encodeFileName=Y,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}oU.inherits(J8,rU);J8.prototype.push=function($){var I=$.meta.percent||0,U=this.entriesCount,Y=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,rU.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:U?(I+100*(U-Y-1))/U:100}})};J8.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var I=this.streamFiles&&!$.file.dir;if(I){var U=ia($,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:U.fileRecord,meta:{percent:0}})}else this.accumulate=!0};J8.prototype.closedSource=function($){this.accumulate=!1;var I=this.streamFiles&&!$.file.dir,U=ia($,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(U.dirRecord),I)this.push({data:Nk0($),meta:{percent:100}});else{this.push({data:U.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 U=this.bytesWritten-$,Y=Fk0(this.dirRecords.length,U,$,this.zipComment,this.encodeFileName);this.push({data:Y,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(U){I.processChunk(U)}),$.on("end",function(){if(I.closedSource(I.previous.streamInfo),I._sources.length)I.prepareNextSource();else I.end()}),$.on("error",function(U){I.error(U)}),this};J8.prototype.resume=function(){if(!rU.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(!rU.prototype.error.call(this,$))return!1;for(var U=0;U<I.length;U++)try{I[U].error($)}catch(Y){}return!0};J8.prototype.lock=function(){rU.prototype.lock.call(this);var $=this._sources;for(var I=0;I<$.length;I++)$[I].lock()};ba.exports=J8});var pa=F((Tk0)=>{var Mk0=fv(),Ak0=na(),Pk0=function($,I){var U=$||I,Y=Mk0[U];if(!Y)throw Error(U+" is not a valid compression method !");return Y};Tk0.generateWorker=function($,I,U){var Y=new Ak0(I.streamFiles,U,I.platform,I.encodeFileName),J=0;try{$.forEach(function(Q,K){J++;var q=Pk0(K.options.compression,I.compression),H=K.options.compressionOptions||I.compressionOptions||{},G=K.dir,W=K.date;K._compressWorker(q,H).withStreamInfo("file",{name:Q,dir:G,date:W,comment:K.comment||"",unixPermissions:K.unixPermissions,dosPermissions:K.dosPermissions}).pipe(Y)}),Y.entriesCount=J}catch(Q){Y.error(Q)}return Y}});var da=F((hP1,ca)=>{var Bk0=w4(),sV=W$();function qK($,I){sV.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(I)}Bk0.inherits(qK,sV);qK.prototype._bindStream=function($){var I=this;this._stream=$,$.pause(),$.on("data",function(U){I.push({data:U,meta:{percent:0}})}).on("error",function(U){if(I.isPaused)this.generatedError=U;else I.error(U)}).on("end",function(){if(I.isPaused)I._upstreamEnded=!0;else I.end()})};qK.prototype.pause=function(){if(!sV.prototype.pause.call(this))return!1;return this._stream.pause(),!0};qK.prototype.resume=function(){if(!sV.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};ca.exports=qK});var Is=F((uP1,$s)=>{var vk0=xU(),HK=w4(),ra=W$(),Rk0=dB(),ta=mB(),ma=gV(),jk0=lr(),Ck0=pa(),la=i2(),_k0=da(),aa=function($,I,U){var Y=HK.getTypeOf(I),J,Q=HK.extend(U||{},ta);if(Q.date=Q.date||new Date,Q.compression!==null)Q.compression=Q.compression.toUpperCase();if(typeof Q.unixPermissions==="string")Q.unixPermissions=parseInt(Q.unixPermissions,8);if(Q.unixPermissions&&Q.unixPermissions&16384)Q.dir=!0;if(Q.dosPermissions&&Q.dosPermissions&16)Q.dir=!0;if(Q.
Line truncated
|
||||
`)}openNode($,I){let U=this.tos,Y=this._xml;if(U&&this.open)Y.push(">");this._stack.push($),Y.push("<"),Y.push($),PR(Y,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)de(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");PR(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(ce.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,U){if(this.openNode($,I),U!==void 0)this.writeText(U);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("")}}TR.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};me.exports=TR});var ER=F((Ai0)=>{var le=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Mi0($){if(typeof $==="string")return $;if(le)return le.decode($);return $.toString()}Ai0.bufferToString=Mi0});var se=F((re)=>{Object.defineProperty(re,"__esModule",{value:!0});re.CHAR=`
|
||||
\r --�\uD800\uDC00-\uDBFF\uDFFF`;re.S=` \r
|
||||
`;re.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";re.NAME_CHAR="-"+re.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";re.CHAR_RE=new RegExp("^["+re.CHAR+"]$","u");re.S_RE=new RegExp("^["+re.S+"]+$","u");re.NAME_START_CHAR_RE=new RegExp("^["+re.NAME_START_CHAR+"]$","u");re.NAME_CHAR_RE=new RegExp("^["+re.NAME_CHAR+"]$","u");re.NAME_RE=new RegExp("^["+re.NAME_START_CHAR+"]["+re.NAME_CHAR+"]*$","u");re.NMTOKEN_RE=new RegExp("^["+re.NAME_CHAR+"]+$","u");var BR=9,vR=10,RR=13,jR=32;re.S_LIST=[jR,vR,RR,BR];function Ti0($){return $>=jR&&$<=55295||$===vR||$===RR||$===BR||$>=57344&&$<=65533||$>=65536&&$<=1114111}re.isChar=Ti0;function Ei0($){return $===jR||$===vR||$===RR||$===BR}re.isS=Ei0;function oe($){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}re.isNameStartChar=oe;function Bi0($){return oe($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}re.isNameChar=Bi0});var H00=F((J00)=>{Object.defineProperty(J00,"__esModule",{value:!0});J00.CHAR="\x01--�\uD800\uDC00-\uDBFF\uDFFF";J00.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F--";J00.S=` \r
|
||||
`;J00.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";J00.NAME_CHAR="-"+J00.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";J00.CHAR_RE=new RegExp("^["+J00.CHAR+"]$","u");J00.RESTRICTED_CHAR_RE=new RegExp("^["+J00.RESTRICTED_CHAR+"]$","u");J00.S_RE=new RegExp("^["+J00.S+"]+$","u");J00.NAME_START_CHAR_RE=new RegExp("^["+J00.NAME_START_CHAR+"]$","u");J00.NAME_CHAR_RE=new RegExp("^["+J00.NAME_CHAR+"]$","u");J00.NAME_RE=new RegExp("^["+J00.NAME_START_CHAR+"]["+J00.NAME_CHAR+"]*$","u");J00.NMTOKEN_RE=new RegExp("^["+J00.NAME_CHAR+"]+$","u");var ee=9,$00=10,I00=13,U00=32;J00.S_LIST=[U00,$00,I00,ee];function xi0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}J00.isChar=xi0;function fi0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}J00.isRestrictedChar=fi0;function ii0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}J00.isCharAndNotRestricted=ii0;function bi0($){return $===U00||$===$00||$===I00||$===ee}J00.isS=bi0;function Y00($){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}J00.isNameStartChar=Y00;function ni0($){return Y00($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}J00.isNameChar=ni0});var w00=F((W00)=>{Object.defineProperty(W00,"__esModule",{value:!0});W00.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";W00.NC_NAME_CHAR="-"+W00.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";W00.NC_NAME_START_CHAR_RE=new RegExp("^["+W00.NC_NAME_START_CHAR+"]$","u");W00.NC_NAME_CHAR_RE=new RegExp("^["+W00.NC_NAME_CHAR+"]$","u");W00.NC_NAME_RE=new RegExp("^["+W00.NC_NAME_START_CHAR+"]["+W00.NC_NAME_CHAR+"]*$","u");function G00($){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}W00.isNCNameStartChar=G00;function Yb0($){return G00($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}W00.isNCNameChar=Yb0});var g00=F((S00)=>{Object.defineProperty(S00,"__esModule",{value:!0});var KY=se(),Gb0=H00(),pR=w00(),r6=KY.isS,Wb0=KY.isChar,MK=KY.isNameStartChar,V00=KY.isNameChar,B00=KY.S_LIST,wb0=KY.NAME_RE,Vb0=Gb0.isChar,Zb0=pR.isNCNameStartChar,zb0=pR.isNCNameChar,Xb0=pR.NC_NAME_RE,vZ="http://www.w3.org/XML/1998/namespace",QY="http://www.w3.org/2000/xmlns/",Lb0={__proto__:null,xml:vZ,xmlns:QY},Db0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},H4=-1,y8=-2,Z00=0,Ob0=1,_R=2,Fb0=3,UY=4,Nb0=5,Mb0=6,Ab0=7,SR=8,Pb0=9,Tb0=10,Eb0=11,Bb0=12,g6=13,AZ=14,gR=15,vb0=16,yR=17,Rb0=18,jb0=19,hR=20,Cb0=21,_b0=22,Sb0=23,z00=24,uR=25,PZ=26,X00=27,gb0=28,yb0=29,L00=30,hb0=31,ub0=32,w3=33,kb0=34,kR=35,AK=36,xR=37,xb0=38,D00=39,O00=40,fb0=41,F00=42,ib0=43,bb0=44,fR=9,K8=10,iR=13,N00=32,M00=33,v00=34,PK=38,R00=39,TZ=45,EZ=47,nb0=59,f9=60,YY=61,h4=62,Y6=63,j00=91,JY=93,A00=133,P00=8232,BZ=($)=>$===v00||$===R00,C00=[v00,R00],pb0=[...C00,j00,h4],cb0=[...C00,f9,JY],db0=[YY,Y6,...B00],mb0=[...B00,h4,PK,f9];function nR($,I,U){switch(I){case"xml":if(U!==vZ)$.fail(`xml prefix must be bound to ${vZ}.`);break;case"xmlns":if(U!==QY)$.fail(`xmlns prefix must be bound to ${QY}.`);break;default:}switch(U){case QY:$.fail(I===""?`the default namespace may not be set to ${U}.`:`may not assign a prefix (even "xmlns") to the URI ${QY}.`);break;case vZ:switch(I){case"xml":break;case"":$.fail(`the default namespace may not be set to ${U}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function lb0($,I){for(let U of Object.keys(I))nR($,U,I[U])}var ob0=($)=>Xb0.test($),rb0=($)=>wb0.test($),V3=0,T00=1,bR=2;S00.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var E00={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 _00{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=Zb0,this.nameCheck=zb0,this.isName=ob0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Lb0);let U=this.opt.additionalNamespaces
Line truncated
|
||||
`,I=this.i}}captureToChar($){let{i:I}=this,{chunk:U}=this;while(!0){let Y=this.getCode();switch(Y){case y8:this.text+=`${U.slice(I,this.prevI)}
|
||||
`,I=this.i,Y=K8;break;case H4:return this.text+=U.slice(I),!1;default:}if(Y===$)return this.text+=U.slice(I,this.prevI),!0}}captureNameChars(){let{chunk:$,i:I}=this;while(!0){let U=this.getCode();if(U===H4)return this.name+=$.slice(I),H4;if(!V00(U))return this.name+=$.slice(I,this.prevI),U===y8?K8:U}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===H4||!r6($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=Wb0,this.getCode=this.getCode10;else this.isChar=Vb0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Ob0}sBeginWhitespace(){let $=this.i,I=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(I){case f9:if(this.state=gR,this.text.length!==0)throw Error("no-empty text at start");break;case H4:break;default:this.unget(),this.state=g6,this.xmlDeclPossible=!1}}sDoctype(){var $;let I=this.captureTo(pb0);switch(I){case h4:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=g6,this.doctype=!0;break}case H4:break;default:if(this.text+=String.fromCodePoint(I),I===j00)this.state=UY;else if(BZ(I))this.state=Fb0,this.q=I}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=_R}sDTD(){let $=this.captureTo(cb0);if($===H4)return;if(this.text+=String.fromCodePoint($),$===JY)this.state=_R;else if($===f9)this.state=Mb0;else if(BZ($))this.state=Nb0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=UY,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case M00:this.state=Ab0,this.openWakaBang="";break;case Y6:this.state=Eb0;break;default:this.state=UY}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),I=this.openWakaBang+=$;if(this.text+=$,I!=="-")this.state=I==="--"?SR:UY,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(TZ))this.text+="-",this.state=Pb0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===TZ?Tb0:SR}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===h4)this.state=UY;else this.fail("malformed comment."),this.state=SR}sDTDPI(){if(this.captureToChar(Y6))this.text+="?",this.state=Bb0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===h4)this.state=UY}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:I}=this;$:while(!0)switch(this.getCode()){case y8:this.entity+=`${I.slice($,this.prevI)}
|
||||
`,$=this.i;break;case nb0:{let{entityReturnState:U}=this,Y=this.entity+I.slice($,this.prevI);this.state=U;let J;if(Y==="")this.fail("empty entity name."),J="&;";else J=this.parseEntity(Y),this.entity="";if(U!==g6||this.textHandler!==void 0)this.text+=J;break $}case H4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(MK($))this.state=kb0,this.unget(),this.xmlDeclPossible=!1;else switch($){case EZ:this.state=ib0,this.xmlDeclPossible=!1;break;case M00:this.state=vb0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case Y6:this.state=Sb0;break;default:this.fail("disallowed character in tag name"),this.state=g6,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=hR,this.openWakaBang="";break;case"--":this.state=yR,this.openWakaBang="";break;case"DOCTYPE":if(this.state=_R,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(TZ))this.state=Rb0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===TZ)this.state=jb0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=yR}sCommentEnded(){let $=this.getCodeNorm();if($!==h4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=yR;else this.state=g6}sCData(){if(this.captureToChar(JY))this.state=Cb0}sCDataEnding(){let $=this.getCodeNorm();if($===JY)this.state=_b0;else this.text+=`]${String.fromCodePoint($)}`,this.state=hR}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case h4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=g6;break}case JY:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=hR}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=z00;else if($===Y6||r6($))this.fail("processing instruction without a target."),this.state=$===Y6?PZ:uR;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=z00}sPIRest(){let{chunk:$,i:I}=this;while(!0){let U=this.getCodeNorm();if(U===H4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(U)){this.piTarget+=$.slice(I,this.prevI);let Y=U===Y6;if(Y||r6(U))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=Y?w3:X00}else this.state=Y?PZ:uR;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(U);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===Y6)this.state=PZ;else if(!r6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(Y6))this.state=PZ}sPIEnding(){var $;let I=this.getCodeNorm();if(I===h4){let{piTarget:U}=this;if(U.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:U,body:this.text}),this.piTarget=this.text="",this.state=g6}else if(I===Y6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=uR;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===Y6){this.state=w3;return}if($!==H4)this.state=gb0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(db0);if($===Y6){this.state=w3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(r6($)||$===YY))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=$===YY?L00:yb0}sXMLDeclEq(){let $=this.getCodeNorm();if($===Y6){this.state=w3,this.fail("XML declaration is incomplete.");return}if(r6($))return;if($!==YY)this.fail("value required.");this.state=L00}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===Y6){this.state=w3,this.fail("XML declaration is incomplete.");return}if(r6($))return;if(!BZ($))this.fail("value must be quoted."),this.q=N00;else this.q=$;this.state=hb0}sXMLDeclValue(){let $=this.captureTo([this.q,Y6]);if($===Y6){this.state=w3,this.text="",this.fail("XML declaration is incomplete.");return}if($===H4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let U=I;if(this.xmlDecl.version=U,!/^1\.[0-9]+$/.test(U))this.fail("ver
Line truncated
|
||||
`;$=this.i,I=V3;break;case H4:if(Y!==void 0)this.text+=U.slice($);break $;default:I=V3}this.forbiddenState=I}handleTextOutsideRoot(){let{i:$}=this,{chunk:I,textHandler:U}=this,Y=!1;$:while(!0){let J=this.getCode();switch(J){case f9:{if(this.state=gR,U!==void 0){let{text:Q}=this,K=I.slice($,this.prevI);if(Q.length!==0)U(Q+K),this.text="";else if(K.length!==0)U(K)}break $}case PK:if(this.state=AZ,this.entityReturnState=g6,U!==void 0)this.text+=I.slice($,this.prevI);Y=!0;break $;case y8:if(U!==void 0)this.text+=`${I.slice($,this.prevI)}
|
||||
`;$=this.i;break;case H4:if(U!==void 0)this.text+=I.slice($);break $;default:if(!r6(J))Y=!0}}if(!Y)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 U;let{prefix:Y,local:J}=this.qname($),Q={name:$,prefix:Y,local:J,value:I};if(this.attribList.push(Q),(U=this.attributeHandler)===null||U===void 0||U.call(this,Q),Y==="xmlns"){let K=I.trim();if(this.currentXMLVersion==="1.0"&&K==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[J]=K,nR(this,J,K)}else if($==="xmlns"){let K=I.trim();this.topNS[""]=K,nR(this,"",K)}}pushAttribPlain($,I){var U;let Y={name:$,value:I};this.attribList.push(Y),(U=this.attributeHandler)===null||U===void 0||U.call(this,Y)}end(){var $,I;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:U}=this;while(U.length>0){let J=U.pop();this.fail(`unclosed tag: ${J.name}`)}if(this.state!==Z00&&this.state!==g6)this.fail("unexpected end.");let{text:Y}=this;if(Y.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,Y),this.text="";return this._closed=!0,(I=this.endHandler)===null||I===void 0||I.call(this),this._init(),this}resolve($){var I,U;let Y=this.topNS[$];if(Y!==void 0)return Y;let{tags:J}=this;for(let Q=J.length-1;Q>=0;Q--)if(Y=J[Q].ns[$],Y!==void 0)return Y;if(Y=this.ns[$],Y!==void 0)return Y;return(U=(I=this.opt).resolvePrefix)===null||U===void 0?void 0:U.call(I,$)}qname($){let I=$.indexOf(":");if(I===-1)return{prefix:"",local:$};let U=$.slice(I+1),Y=$.slice(0,I);if(Y===""||U===""||U.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:Y,local:U}}processAttribsNS(){var $;let{attribList:I}=this,U=this.tag;{let{prefix:Q,local:K}=this.qname(U.name);U.prefix=Q,U.local=K;let q=U.uri=($=this.resolve(Q))!==null&&$!==void 0?$:"";if(Q!==""){if(Q==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(q==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),U.uri=Q}}if(I.length===0)return;let{attributes:Y}=U,J=new Set;for(let Q of I){let{name:K,prefix:q,local:H}=Q,G,W;if(q==="")G=K==="xmlns"?QY:"",W=K;else{if(G=this.resolve(q),G===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(q)}.`),G=q;W=`{${G}}${H}`}if(J.has(W))this.fail(`duplicate attribute: ${W}.`);J.add(W),Q.uri=G,Y[K]=Q}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,I=this.tag.attributes;for(let{name:U,value:Y}of $){if(I[U]!==void 0)this.fail(`duplicate attribute: ${U}.`);I[U]=Y}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:I}=this,U=this.tag;U.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,U),I.push(U),this.state=g6,this.name=""}openSelfClosingTag(){var $,I,U;this.processAttribs();let{tags:Y}=this,J=this.tag;if(J.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,J),(I=this.closeTagHandler)===null||I===void 0||I.call(this,J),(this.tag=(U=Y[Y.length-1])!==null&&U!==void 0?U:null)===null)this.closedRoot=!0;this.state=g6,this.name=""}closeTag(){let{tags:$,name:I}=this;if(this.state=g6,this.name="",I===""){this.fail("weird empty close tag."),this.text+="</>";return}let U=this.closeTagHandler,Y=$.length;while(Y-- >0){let J=this.tag=$.pop();if(this.topNS=J.ns,U===null||U===void 0||U(J),J.name===I)break;this.fail("unexpected close tag.")}if(Y===0)this.closedRoot=!0;else if(Y<0)this.fail(`unmatched closing tag: ${I}.`),this.text+=`</${I}>`}parseEntity($){if($[0]!=="#"){let U=this.ENTITIES[$];if(U!==void 0)return U;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)}}S00.SaxesParser=_00});var TK=F((FT1,y00)=>{var{SaxesParser:sb0}=g00(),{PassThrough:eb0}=D6(),{bufferToString:$n0}=ER();y00.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new eb0);let I=new sb0,U;I.on("error",(J)=>{U=J});let Y=[];I.on("opentag",(J)=>Y.push({eventType:"opentag",value:J})),I.on("text",(J)=>Y.push({eventType:"text",value:J})),I.on("closetag",(J)=>Y.push({eventType:"closetag",value:J}));for await(let J of $){if(I.write($n0(J)),U)throw U;yield Y,Y=[]}}});var L0=F((NT1,h00)=>{var In0=TK(),Un0=U6();class qY{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,I){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof qY)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let I of $)for(let{eventType:U,value:Y}of I)if(U==="opentag")this.parseOpen(Y);else if(U==="text")this.parseText(Y);else if(U==="closetag"){if(!this.parseClose(Y.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}`}}w90.FormatterOptions=W90});var Kz=F((dB1,L90)=>{var Vo0="[object AsyncFunction]",Zo0="[object Function]",zo0="[object GeneratorFunction]",Xo0="[object Null]",Lo0="[object Proxy]",Do0="[object Undefined]",Oo0=typeof global=="object"&&global&&global.Object===Object&&global,Fo0=typeof self=="object"&&self&&self.Object===Object&&self,No0=Oo0||Fo0||Function("return this")(),z90=Object.prototype,Mo0=z90.hasOwnProperty,X90=z90.toString,Z90=No0.Symbol,F3=Z90?Z90.toStringTag:void 0;function Ao0($){if($==null)return $===void 0?Do0:Xo0;return F3&&F3 in Object($)?Po0($):To0($)}function Po0($){var I=Mo0.call($,F3),U=$[F3];try{$[F3]=void 0;var Y=!0}catch(Q){}var J=X90.call($);if(Y)if(I)$[F3]=U;else delete $[F3];return J}function To0($){return X90.call($)}function Eo0($){if(!Bo0($))return!1;var I=Ao0($);return I==Zo0||I==zo0||I==Vo0||I==Lo0}function Bo0($){var I=typeof $;return $!=null&&(I=="object"||I=="function")}L90.exports=Eo0});var a90=F((qz,DY)=>{var vo0=200,VC="__lodash_hash_undefined__",Xz=1,R90=2,j90=9007199254740991,Hz="[object Arguments]",QC="[object Array]",Ro0="[object AsyncFunction]",C90="[object Boolean]",_90="[object Date]",S90="[object Error]",g90="[object Function]",jo0="[object GeneratorFunction]",Gz="[object Map]",y90="[object Number]",Co0="[object Null]",LY="[object Object]",D90="[object Promise]",_o0="[object Proxy]",h90="[object RegExp]",Wz="[object Set]",u90="[object String]",So0="[object Symbol]",go0="[object Undefined]",KC="[object WeakMap]",k90="[object ArrayBuffer]",wz="[object DataView]",yo0="[object Float32Array]",ho0="[object Float64Array]",uo0="[object Int8Array]",ko0="[object Int16Array]",xo0="[object Int32Array]",fo0="[object Uint8Array]",io0="[object Uint8ClampedArray]",bo0="[object Uint16Array]",no0="[object Uint32Array]",po0=/[\\^$.*+?()[\]{}|]/g,co0=/^\[object .+?Constructor\]$/,do0=/^(?:0|[1-9]\d*)$/,e1={};e1[yo0]=e1[ho0]=e1[uo0]=e1[ko0]=e1[xo0]=e1[fo0]=e1[io0]=e1[bo0]=e1[no0]=!0;e1[Hz]=e1[QC]=e1[k90]=e1[C90]=e1[wz]=e1[_90]=e1[S90]=e1[g90]=e1[Gz]=e1[y90]=e1[LY]=e1[h90]=e1[Wz]=e1[u90]=e1[KC]=!1;var x90=typeof global=="object"&&global&&global.Object===Object&&global,mo0=typeof self=="object"&&self&&self.Object===Object&&self,E5=x90||mo0||Function("return this")(),f90=typeof qz=="object"&&qz&&!qz.nodeType&&qz,O90=f90&&typeof DY=="object"&&DY&&!DY.nodeType&&DY,i90=O90&&O90.exports===f90,UC=i90&&x90.process,F90=function(){try{return UC&&UC.binding&&UC.binding("util")}catch($){}}(),N90=F90&&F90.isTypedArray;function lo0($,I){var U=-1,Y=$==null?0:$.length,J=0,Q=[];while(++U<Y){var K=$[U];if(I(K,U,$))Q[J++]=K}return Q}function oo0($,I){var U=-1,Y=I.length,J=$.length;while(++U<Y)$[J+U]=I[U];return $}function ro0($,I){var U=-1,Y=$==null?0:$.length;while(++U<Y)if(I($[U],U,$))return!0;return!1}function to0($,I){var U=-1,Y=Array($);while(++U<$)Y[U]=I(U);return Y}function ao0($){return function(I){return $(I)}}function so0($,I){return $.has(I)}function eo0($,I){return $==null?void 0:$[I]}function $r0($){var I=-1,U=Array($.size);return $.forEach(function(Y,J){U[++I]=[J,Y]}),U}function Ir0($,I){return function(U){return $(I(U))}}function Ur0($){var I=-1,U=Array($.size);return $.forEach(function(Y){U[++I]=Y}),U}var Yr0=Array.prototype,Jr0=Function.prototype,Lz=Object.prototype,YC=E5["__core-js_shared__"],b90=Jr0.toString,u8=Lz.hasOwnProperty,M90=function(){var $=/[^.]+$/.exec(YC&&YC.keys&&YC.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),n90=Lz.toString,Qr0=RegExp("^"+b90.call(u8).replace(po0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),A90=i90?E5.Buffer:void 0,Vz=E5.Symbol,P90=E5.Uint8Array,p90=Lz.propertyIsEnumerable,Kr0=Yr0.splice,N3=Vz?Vz.toStringTag:void 0,T90=Object.getOwnPropertySymbols,qr0=A90?A90.isBuffer:void 0,Hr0=Ir0(Object.keys,Object),qC=OY(E5,"DataView"),_K=OY(E5,"Map"),HC=OY(E5,"Promise"),GC=OY(E5,"Set"),WC=OY(E5,"WeakMap"),SK=OY(Object,"create"),Gr0=P3(qC),Wr0=P3(_K),wr0=P3(HC),Vr0=P3(GC),Zr0=P3(WC),E90=Vz?Vz.prototype:void 0,JC=E90?E90.valueOf:void 0;function M3($){var I=-1,U=$==null?0:$.length;this.clear();while(++I<U){var Y=$[I];this.set(Y[0],Y[1])}}function zr0(){this.__data__=SK?SK(null):{},this.size=0}function Xr0($){var I=this.has($)&&delete this.__data__[$];return this.size-=I?1:0,I}function Lr0($){var I=this.__data
Line truncated
|
||||
]`;this.ESCAPE_REGEXP=new RegExp(I)}set headers($){this._headers=$}shouldQuote($,I){let U=I?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(At0.default(U))return U;if(Array.isArray(U))return U[$];if(this._headers!==null)return U[this._headers[$]];return!1}format($,I,U){let Y=`${Pt0.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:J}=this;if(J.quote!==""){if(Y.indexOf(J.quote)!==-1)return this.quoteField(Y.replace(this.REPLACE_REGEXP,J.escapedQuote))}if(Y.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(I,U))return this.quoteField(Y);return Y}quoteField($){let{quote:I}=this.formatterOptions;return`${I}${$}${I}`}}FY.FieldFormatter=K70});var DC=F((q70)=>{Object.defineProperty(q70,"__esModule",{value:!0});q70.isSyncTransform=void 0;q70.isSyncTransform=($)=>$.length===1});var W70=F((NY)=>{var G70=NY&&NY.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(NY,"__esModule",{value:!0});NY.RowFormatter=void 0;var Et0=G70(Kz()),Bt0=G70(a90()),vt0=LC(),Rt0=DC();class T3{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new vt0.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(T3.isRowHashArray($))return $.map((I)=>I[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(Rt0.isSyncTransform($))return(I,U)=>{let Y=null;try{Y=$(I)}catch(J){return U(J)}return U(null,Y)};return(I,U)=>{$(I,U)}}set rowTransform($){if(!Et0.default($))throw TypeError("The transform should be a function");this._rowTransform=T3.createTransform($)}format($,I){this.callTransformer($,(U,Y)=>{if(U)return I(U);if(!$)return I(null);let J=[];if(Y){let{shouldFormatColumns:Q,headers:K}=this.checkHeaders(Y);if(this.shouldWriteHeaders&&K&&!this.hasWrittenHeaders)J.push(this.formatColumns(K,!0)),this.hasWrittenHeaders=!0;if(Q){let q=this.gatherColumns(Y);J.push(this.formatColumns(q,!1))}}return I(null,J)})}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=T3.gatherHeaders($);if(this.headers=I,this.fieldFormatter.headers=I,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!Bt0.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(T3.isRowHashArray($))return this.headers.map((I,U)=>{let Y=$[U];if(Y)return Y[1];return""});if(T3.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((I,U)=>$[U])}callTransformer($,I){if(!this._rowTransform)return I(null,$);return this._rowTransform($,I)}formatColumns($,I){let U=$.map((J,Q)=>this.fieldFormatter.format(J,Q,I)).join(this.formatterOptions.delimiter),{rowCount:Y}=this;if(this.rowCount+=1,Y)return[this.formatterOptions.rowDelimiter,U].join("");return U}}NY.RowFormatter=T3});var w70=F((Fz)=>{Object.defineProperty(Fz,"__esModule",{value:!0});Fz.FieldFormatter=Fz.RowFormatter=void 0;var jt0=W70();Object.defineProperty(Fz,"RowFormatter",{enumerable:!0,get:function(){return jt0.RowFormatter}});var Ct0=LC();Object.defineProperty(Fz,"FieldFormatter",{enumerable:!0,get:function(){return Ct0.FieldFormatter}})});var OC=F((Z70)=>{Object.defineProperty(Z70,"__esModule",{value:!0});Z70.CsvFormatterStream=void 0;var St0=t("stream"),gt0=w70();class V70 extends St0.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new gt0.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,I,U){let Y=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(J,Q)=>{if(J)return Y=!0,U(J);if(Q)Q.forEach((K)=>{this.push(Buffer.from(K,"utf8"))});return Y=!0,U()})}catch(J){if(Y)throw J;U(J)}}_flush($){this.rowFormatter.finish((I,U)=>{if(I)return $(I);if(U)U.forEach((Y)=>{this.push(Buffer.from(Y,"utf8"))});return $()})}}Z70.CsvFormatterStream=V70});var L70=F((P1)=>{var X70=P1&&P1.__createBinding||(Object.create?function($,I,U,Y){if(Y===void 0)Y=U;Object.defineProperty($,Y,{enumerable:!0,get:function(){return I[U]}})}:function($,I,U,Y){if(Y===void 0)Y=U;$[Y]=I[U]}),yt0=P1&&P1.__setModuleDefault||(Object.create?function($,I){Ob
Line truncated
|
||||
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
|
||||
`||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}}D30.Token=L30});var nC=F((M30)=>{Object.defineProperty(M30,"__esModule",{value:!0});M30.Scanner=void 0;var F30=t9(),ne0=/((?:\r\n)|\n|\r)/;class N30{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 U=I.exec($);if(U==null)return null;let Y=U[1],J=this.cursor+(U.index||0);return new F30.Token({token:Y,startCursor:J,endCursor:J+Y.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:I}=this;if(I<=$)return null;return new F30.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=ne0.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}}M30.Scanner=N30});var nz=F((T30)=>{Object.defineProperty(T30,"__esModule",{value:!0});T30.ColumnFormatter=void 0;class P30{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}}T30.ColumnFormatter=P30});var pC=F((R30)=>{Object.defineProperty(R30,"__esModule",{value:!0});R30.NonQuotedColumnParser=void 0;var pe0=nz(),B30=t9();class v30{constructor($){this.parserOptions=$,this.columnFormatter=new pe0.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:I}=this,U=[],Y=$.nextCharacterToken;for(;Y;Y=$.nextCharacterToken){if(B30.Token.isTokenDelimiter(Y,I)||B30.Token.isTokenRowDelimiter(Y))break;U.push(Y.token),$.advancePastToken(Y)}return this.columnFormatter.format(U.join(""))}}R30.NonQuotedColumnParser=v30});var cC=F((_30)=>{Object.defineProperty(_30,"__esModule",{value:!0});_30.QuotedColumnParser=void 0;var ce0=nz(),_Y=t9();class C30{constructor($){this.parserOptions=$,this.columnFormatter=new ce0.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let I=$.cursor,{foundClosingQuote:U,col:Y}=this.gatherDataBetweenQuotes($);if(!U){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($),Y}gatherDataBetweenQuotes($){let{parserOptions:I}=this,U=!1,Y=!1,J=[],Q=$.nextCharacterToken;for(;!Y&&Q!==null;Q=$.nextCharacterToken){let K=_Y.Token.isTokenQuote(Q,I);if(!U&&K)U=!0;else if(U)if(_Y.Token.isTokenEscapeCharacter(Q,I)){$.advancePastToken(Q);let q=$.nextCharacterToken;if(q!==null&&(_Y.Token.isTokenQuote(q,I)||_Y.Token.isTokenEscapeCharacter(q,I)))J.push(q.token),Q=q;else if(K)Y=!0;else J.push(Q.token)}else if(K)Y=!0;else J.push(Q.token);$.advancePastToken(Q)}return{col:this.columnFormatter.format(J.join("")),foundClosingQuote:Y}}checkForMalformedColumn($){let{parserOptions:I}=this,{nextNonSpaceToken:U}=$;if(U){let Y=_Y.Token.isTokenDelimiter(U,I),J=_Y.Token.isTokenRowDelimiter(U);if(!(Y||J)){let Q=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${I.escapedDelimiter}' OR new line got: '${U.token}'. at '${Q}`)}$.advanceToToken(U)}else if(!$.hasMoreData)$.advancePastLine()}}_30.QuotedColumnParser=C30});var u30=F((y30)=>{Object.defineProperty(y30,"__esModule",{value:!0});y30.ColumnParser=void 0;var de0=pC(),me0=cC(),le0=t9();class g30{constructor($){this.parserOptions=$,this.quotedColumnParser=new me0.QuotedColumnParser($),this.nonQuotedColumnParser=new de0.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:I}=$;if(I!==null&&le0.Token.isTokenQuote(I,this.parserOptions))return $.advanceToToken(I),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}y30.ColumnParser=g30});var dC=F((SY)=>{Object.defineProperty(SY,"__esModule",{value:!0});SY.ColumnFormatter=SY.QuotedColumnParser=SY.NonQuotedColumnParser=SY.ColumnParser=void 0;var oe0=u30();Object.defineProperty(SY,"ColumnParser",{enumerable:!0,get:function(){return oe0.ColumnParser}});var re0=pC();Object.defineProperty(SY,"NonQuotedColumnParser",{enumerable:!0,get:function(){return re0.NonQuotedColumnParser}});var te0=cC();Object.defineProperty(SY,"QuotedColumnParser",{enumerable:!0,get:function(){re
Line truncated
|
||||
%s`,x,x,V,Y);let y=V.type==="*"?q_:V.type==="?"?W_:"\\"+V.type;J=!0,Y=Y.slice(0,V.reStart)+y+"\\("+x}if(T(),Q)Y+="\\\\";let A=b01[Y.charAt(0)];for(let x=q.length-1;x>-1;x--){let y=q[x],f=Y.slice(0,y.reStart),j=Y.slice(y.reStart,y.reEnd-8),p=Y.slice(y.reEnd),n=Y.slice(y.reEnd-8,y.reEnd)+p,g=f.split(")").length,i=f.split("(").length-g,b=p;for(let B=0;B<i;B++)b=b.replace(/\)[+*?]?/,"");p=b;let U0=p===""&&I!==H_?"(?:$|\\/)":"";Y=f+j+p+U0+n}if(Y!==""&&J)Y="(?=.)"+Y;if(A)Y=O()+Y;if(I===H_)return[Y,J];if(U.nocase&&!J)J=$.toUpperCase()!==$.toLowerCase();if(!J)return p01($);let R=U.nocase?"i":"";try{return Object.assign(new RegExp("^"+Y+"$",R),{_glob:$,_src:Y})}catch(x){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let I=this.options,U=I.noglobstar?q_:I.dot?f01:i01,Y=I.nocase?"i":"",J=$.map((Q)=>{return Q=Q.map((K)=>typeof K==="string"?d01(K):K===y6?y6:K._src).reduce((K,q)=>{if(!(K[K.length-1]===y6&&q===y6))K.push(q);return K},[]),Q.forEach((K,q)=>{if(K!==y6||Q[q-1]===y6)return;if(q===0)if(Q.length>1)Q[q+1]="(?:\\/|"+U+"\\/)?"+Q[q+1];else Q[q]=U;else if(q===Q.length-1)Q[q-1]+="(?:\\/|"+U+")?";else Q[q-1]+="(?:\\/|\\/"+U+"\\/)"+Q[q+1],Q[q+1]=y6}),Q.filter((K)=>K!==y6).join("/")}).join("|");if(J="^(?:"+J+")$",this.negate)J="^(?!"+J+").*$";try{this.regexp=new RegExp(J,Y)}catch(Q){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 U=this.options;if(G_.sep!=="/")$=$.split(G_.sep).join("/");$=$.split(RI0),this.debug(this.pattern,"split",$);let Y=this.set;this.debug(this.pattern,"set",Y);let J;for(let Q=$.length-1;Q>=0;Q--)if(J=$[Q],J)break;for(let Q=0;Q<Y.length;Q++){let K=Y[Q],q=$;if(U.matchBase&&K.length===1)q=[J];if(this.matchOne(q,K,I)){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate}static defaults($){return Z$.defaults($).Minimatch}}Z$.Minimatch=iK});var uI0=F(($R1,hI0)=>{hI0.exports=yI0;var Z_=t("fs"),{EventEmitter:l01}=t("events"),{Minimatch:V_}=_I0(),{resolve:o01}=t("path");function r01($,I){return new Promise((U,Y)=>{Z_.readdir($,{withFileTypes:!0},(J,Q)=>{if(J)switch(J.code){case"ENOTDIR":if(I)Y(J);else U([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":U([]);break;case"ELOOP":default:Y(J);break}else U(Q)})})}function SI0($,I){return new Promise((U,Y)=>{(I?Z_.stat:Z_.lstat)($,(Q,K)=>{if(Q)switch(Q.code){case"ENOENT":if(I)U(SI0($,!1));else U(null);break;default:U(null);break}else U(K)})})}async function*gI0($,I,U,Y,J,Q){let K=await r01(I+$,Q);for(let q of K){let H=q.name;if(H===void 0)H=q,Y=!0;let G=$+"/"+H,W=G.slice(1),w=I+"/"+W,Z=null;if(Y||U)Z=await SI0(w,U);if(!Z&&q.name!==void 0)Z=q;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!J(W))yield{relative:W,absolute:w,stats:Z},yield*gI0(G,I,U,Y,J,!1)}else yield{relative:W,absolute:w,stats:Z}}}async function*t01($,I,U,Y){yield*gI0("",$,I,U,Y,!0)}function a01($){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 z_ extends l01{constructor($,I,U){super();if(typeof I==="function")U=I,I=null;if(this.options=a01(I||{}),this.matchers=[],this.options.pattern){let Y=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=Y.map((J)=>new V_(J,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let Y=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=Y.map((J)=>new V_(J,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let Y=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=Y.map((J)=>new V_(J,{dot:!0}))}if(this.iterator=t01(o01($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,U)this._matches=[],this.on("match",(Y)=>this._matches.push(this.options.absolute?Y.absolute:Y.relative)),this.on("error",(Y)=>U(Y)),this.on("end",()=>U(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((I)=>I.match($))}_fileMatches($,I){let U=$+(I?"/":"");return(this.matchers.length===0||this.matchers.some((Y)=>Y.match(U)))&&!this.ignoreMatchers.some((Y)=>Y.match(U))&&(!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 U=$.value.relative,Y=$.value.absolute;if(this.options.mark&&I)U+="/",Y+="/";if(this.options.stat)this.emit("match",{relative:U,absolute:Y,stat:$.value.stats});else this.emit("match",{relative:U,ab
Line truncated
|
||||
`,h);h=$0===-1?E.length:$0}else if(d!==-1&&E[h]==="/"&&E[h+1]==="*"){let $0=E.indexOf("*/",h);if($0!==-1)h=$0+2,d=E.indexOf("*/",h);else v+=E[h],h++}else v+=E[h],h++;return v}function N$(E){let v=P6(E.toString()),h=v.match(i4);if(!h)h=v.match(f6);if(!h)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}}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
|
||||
Source:
|
||||
`+v);let[,d]=h;return d.replace(/\s/g,"").split(F$).map(($0)=>$0.replace(i6,"").trim())}function Y$(E,v){var h={};return Object.keys(E).forEach((d)=>{var $0=E[d],Y0,H0=V($0),G0=!H0&&$0.length===1||H0&&$0.length===0;if(Array.isArray($0))Y0=[...$0],$0=Y0.pop(),h[d]=Y0.concat(Y0.length>0?z0:$0);else if(G0)h[d]=$0;else{if(Y0=N$($0),$0.length===0&&!H0&&Y0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!H0)Y0.pop();h[d]=Y0.concat(z0)}function z0(S0,G1){var F1=Y0.map((V1)=>S0[V1]);F1.push(G1),D($0)(...F1)}}),O1(h,v)}class E7{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,v){if(v.prev=E,v.next=E.next,E.next)E.next.prev=v;else this.tail=v;E.next=v,this.length+=1}insertBefore(E,v){if(v.prev=E.prev,v.next=E,E.prev)E.prev.next=v;else this.head=v;E.prev=v,this.length+=1}unshift(E){if(this.head)this.insertBefore(this.head,E);else J$(this,E)}push(E){if(this.tail)this.insertAfter(this.tail,E);else J$(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 v=this.head;while(v){var{next:h}=v;if(E(v))this.removeLink(v);v=h}return this}}function J$(E,v){E.length=1,E.head=E.tail=v}function a5(E,v,h){if(v==null)v=1;else if(v===0)throw RangeError("Concurrency must not be zero");var d=D(E),$0=0,Y0=[];let H0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function G0(u0,C0){H0[u0].push(C0)}function z0(u0,C0){let k0=(...Z1)=>{S0(u0,k0),C0(...Z1)};H0[u0].push(k0)}function S0(u0,C0){if(!u0)return Object.keys(H0).forEach((k0)=>H0[k0]=[]);if(!C0)return H0[u0]=[];H0[u0]=H0[u0].filter((k0)=>k0!==C0)}function G1(u0,...C0){H0[u0].forEach((k0)=>k0(...C0))}var F1=!1;function V1(u0,C0,k0,Z1){if(Z1!=null&&typeof Z1!=="function")throw Error("task callback must be a function");N1.started=!0;var K4,b4;function A$(v7,...nJ){if(v7)return k0?b4(v7):K4();if(nJ.length<=1)return K4(nJ[0]);K4(nJ)}var FI=N1._createTaskItem(u0,k0?A$:Z1||A$);if(C0)N1._tasks.unshift(FI);else N1._tasks.push(FI);if(!F1)F1=!0,G(()=>{F1=!1,N1.process()});if(k0||!Z1)return new Promise((v7,nJ)=>{K4=v7,b4=nJ})}function M$(u0){return function(C0,...k0){$0-=1;for(var Z1=0,K4=u0.length;Z1<K4;Z1++){var b4=u0[Z1],A$=Y0.indexOf(b4);if(A$===0)Y0.shift();else if(A$>0)Y0.splice(A$,1);if(b4.callback(C0,...k0),C0!=null)G1("error",C0,b4.data)}if($0<=N1.concurrency-N1.buffer)G1("unsaturated");if(N1.idle())G1("drain");N1.process()}}function OI(u0){if(u0.length===0&&N1.idle())return G(()=>G1("drain")),!0;return!1}let B7=(u0)=>(C0)=>{if(!C0)return new Promise((k0,Z1)=>{z0(u0,(K4,b4)=>{if(K4)return Z1(K4);k0(b4)})});S0(u0),G0(u0,C0)};var bJ=!1,N1={_tasks:new E7,_createTaskItem(u0,C0){return{data:u0,callback:C0}},*[Symbol.iterator](){yield*N1._tasks[Symbol.iterator]()},concurrency:v,payload:h,buffer:v/4,started:!1,paused:!1,push(u0,C0){if(Array.isArray(u0)){if(OI(u0))return;return u0.map((k0)=>V1(k0,!1,!1,C0))}return V1(u0,!1,!1,C0)},pushAsync(u0,C0){if(Array.isArray(u0)){if(OI(u0))return;return u0.map((k0)=>V1(k0,!1,!0,C0))}return V1(u0,!1,!0,C0)},kill(){S0(),N1._tasks.empty()},unshift(u0,C0){if(Array.isArray(u0)){if(OI(u0))return;return u0.map((k0)=>V1(k0,!0,!1,C0))}return V1(u0,!0,!1,C0)},unshiftAsync(u0,C0){if(Array.isArray(u0)){if(OI(u0))return;return u0.map((k0)=>V1(k0,!0,!0,C0))}return V1(u0,!0,!0,C0)},remove(u0){N1._tasks.remove(u0)},process(){if(bJ)return;bJ=!0;while(!N1.paused&&$0<N1.concurrency&&N1._tasks.length){var u0=[],C0=[],k0=N1._tasks.length;if(N1.payload)k0=Math.min(k0,N1.payload);for(var Z1=0;Z1<k0;Z1++){var K4=N1._tasks.shift();u0.push(K4),Y0.push(K4),C0.push(K4.data)}if($0+=1,N1._tasks.length===0)G1("empty");if($0===N1.concurrency)G1("saturated");var b4=g(M$(u0));d(C0,b4)}bJ=!1},length(){return N1._tasks.length},running(){return $0},workersList(){return Y0},idle(){return N1._tasks.length+$0===0},pause(){N1.paused=!0},resume(){if(N1.paused===!1)return;N1.paused=!1,G(N1.process)}};return Object.defineProperties(N1,{saturated:{writable:!1,value:B7("saturated")},unsaturated:{writable:!1,value:B7("unsaturated")},empty:{writable:!1,value:B7("empty")},drain:{writable:!1,value:B7("drain")},error:{writable:!1,value:B7("error")}}),N1}function v0(E,v){return a5(E,1,v)}function a(E,v,h){return a5(E,v,h)}function N(E,v,h,d){d=x(d);var $0=D(h);return x0(E,(Y0,H0,G0)=>{$0(v,Y0,(z0,S0)=>{v=S0,G0(z0)})},(Y0)=>d(Y0,v))}var M=O(N,4);function C(...E){var v=E.map(D);return function(...h){var d=this,$0=h[h.length-1];if(typeof $0=="function")h.pop();else $0=U1();return M(v,h,(Y0,H0,G0)=>{H0.apply(d,Y0.concat((z0,...S0)=>{G0(z0,S0)}))},(Y0,H0)=>$0(Y0,...H0)),$0[R0]}}function u(...E){return C(...E.reverse())}function s(E,v,h,d){return T(b(v),E,h,d)}var m=O(s,4);function e(
Line truncated
|
||||
GFS4: `),console.error($)};if(!Z4[Q6]){if(X_=global[Q6]||[],lI0(Z4,X_),Z4.close=function($){function I(U,Y){return $.call(Z4,U,function(J){if(!J)mI0();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty(I,sz,{value:$}),I}(Z4.close),Z4.closeSync=function($){function I(U){$.apply(Z4,arguments),mI0()}return Object.defineProperty(I,sz,{value:$}),I}(Z4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){R3(Z4[Q6]),t("assert").equal(Z4[Q6].length,0)})}var X_;if(!global[Q6])lI0(global,Z4[Q6]);O_.exports=L_(K11(Z4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Z4.__patched)O_.exports=L_(Z4),Z4.__patched=!0;function L_($){J11($),$.gracefulify=L_,$.createReadStream=R,$.createWriteStream=x;var I=$.readFile;$.readFile=U;function U(j,p,n){if(typeof p==="function")n=p,p=null;return g(j,p,n);function g(i,b,U0,B){return I(i,b,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))hY([g,[i,b,U0],k,B||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var Y=$.writeFile;$.writeFile=J;function J(j,p,n,g){if(typeof n==="function")g=n,n=null;return i(j,p,n,g);function i(b,U0,B,k,c){return Y(b,U0,B,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))hY([i,[b,U0,B,k],r,c||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}var Q=$.appendFile;if(Q)$.appendFile=K;function K(j,p,n,g){if(typeof n==="function")g=n,n=null;return i(j,p,n,g);function i(b,U0,B,k,c){return Q(b,U0,B,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))hY([i,[b,U0,B,k],r,c||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}var q=$.copyFile;if(q)$.copyFile=H;function H(j,p,n,g){if(typeof n==="function")g=n,n=0;return i(j,p,n,g);function i(b,U0,B,k,c){return q(b,U0,B,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))hY([i,[b,U0,B,k],r,c||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}var G=$.readdir;$.readdir=w;var W=/^v[0-5]\./;function w(j,p,n){if(typeof p==="function")n=p,p=null;var g=W.test(process.version)?function(U0,B,k,c){return G(U0,i(U0,B,k,c))}:function(U0,B,k,c){return G(U0,B,i(U0,B,k,c))};return g(j,p,n);function i(b,U0,B,k){return function(c,r){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))hY([g,[b,U0,B],c,k||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 Z=Q11($);O=Z.ReadStream,T=Z.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(j){O=j},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return T},set:function(j){T=j},enumerable:!0,configurable:!0});var L=O;Object.defineProperty($,"FileReadStream",{get:function(){return L},set:function(j){L=j},enumerable:!0,configurable:!0});var D=T;Object.defineProperty($,"FileWriteStream",{get:function(){return D},set:function(j){D=j},enumerable:!0,configurable:!0});function O(j,p){if(this instanceof O)return V.apply(this,arguments),this;else return O.apply(Object.create(O.prototype),arguments)}function P(){var j=this;f(j.path,j.flags,j.mode,function(p,n){if(p){if(j.autoClose)j.destroy();j.emit("error",p)}else j.fd=n,j.emit("open",n),j.read()})}function T(j,p){if(this instanceof T)return X.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function A(){var j=this;f(j.path,j.flags,j.mode,function(p,n){if(p)j.destroy(),j.emit("error",p);else j.fd=n,j.emit("open",n)})}function R(j,p){return new $.ReadStream(j,p)}function x(j,p){return new $.WriteStream(j,p)}var y=$.open;$.open=f;function f(j,p,n,g){if(typeof n==="function")g=n,n=null;return i(j,p,n,g);function i(b,U0,B,k,c){return y(b,U0,B,function(r,J0){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))hY([i,[b,U0,B,k],r,c||Date.now(),Date.now()]);else if(typeof k==="function")k.apply(this,arguments)})}}return $}function hY($){R3("ENQUEUE",$[0].name,$[1]),Z4[Q6].push($),D_()}var az;function mI0(){var $=Date.now();for(var I=0;I<Z4[Q6].length;++I)if(Z4[Q6][I].length>2)Z4[Q6][I][3]=$,Z4[Q6][I][4]=$;D_()}function D_(){if(clearTimeout(az),az=void 0,Z4[Q6].length===0)return;var $=Z4[Q6].shift(),I=$[0],U=$[1],Y=$[2],J=$[3],Q=$[4];if(J===void 0)R3("RETRY",I.name,U),I.apply(null,U);else if(Date.now()-J>=60000){R3("TIMEOUT",I.name,U);var K=U.pop();if(typeof K==="function")K.call(null,Y)}else{var q=Date.now()-Q,H=Math.max(Q-J,1),G=Math.min(H*1.2,100);if(q>=G)R3("RETRY",I.name,U),I.apply(null,U.concat([J]));else Z4[Q6].push($)}if(az===void 0)az=setTimeout(D_,0)}});var rI0=F((QR1,F_)=>{function H11($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var oI0=P4().Buffer,bK=t("util");function G11($,I,U){$.copy(I,U)}F_.exports=function(){function $(){H11(this,$),this.head=null,this.tail=null,th
Line truncated
|
||||
`+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
|
||||
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
||||
*
|
||||
* Copyright (c) 2014-2018, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/hU0.exports=function($,I){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var U=$.length;if(U<=1)return $;var Y="";if(U>4&&$[3]==="\\"){var J=$[2];if((J==="?"||J===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),Y="//"}var Q=$.split(/[/\\]+/);if(I!==!1&&Q[Q.length-1]==="")Q.pop();return Y+Q.join("/")}});var f_=F((DR1,nU0)=>{var kU0=9007199254740991,X41="[object Arguments]",L41="[object Function]",D41="[object GeneratorFunction]",O41=/^(?:0|[1-9]\d*)$/;function xU0($,I,U){switch(U.length){case 0:return $.call(I);case 1:return $.call(I,U[0]);case 2:return $.call(I,U[0],U[1]);case 3:return $.call(I,U[0],U[1],U[2])}return $.apply(I,U)}function F41($,I){var U=-1,Y=Array($);while(++U<$)Y[U]=I(U);return Y}var tK=Object.prototype,aK=tK.hasOwnProperty,fU0=tK.toString,N41=tK.propertyIsEnumerable,uU0=Math.max;function M41($,I){var U=_41($)||C41($)?F41($.length,String):[],Y=U.length,J=!!Y;for(var Q in $)if((I||aK.call($,Q))&&!(J&&(Q=="length"||bU0(Q,Y))))U.push(Q);return U}function A41($,I,U,Y){if($===void 0||u_($,tK[U])&&!aK.call(Y,U))return I;return $}function P41($,I,U){var Y=$[I];if(!(aK.call($,I)&&u_(Y,U))||U===void 0&&!(I in $))$[I]=U}function T41($){if(!x_($))return j41($);var I=R41($),U=[];for(var Y in $)if(!(Y=="constructor"&&(I||!aK.call($,Y))))U.push(Y);return U}function iU0($,I){return I=uU0(I===void 0?$.length-1:I,0),function(){var U=arguments,Y=-1,J=uU0(U.length-I,0),Q=Array(J);while(++Y<J)Q[Y]=U[I+Y];Y=-1;var K=Array(I+1);while(++Y<I)K[Y]=U[Y];return K[I]=Q,xU0($,this,K)}}function E41($,I,U,Y){U||(U={});var J=-1,Q=I.length;while(++J<Q){var K=I[J],q=Y?Y(U[K],$[K],K,U,$):void 0;P41(U,K,q===void 0?$[K]:q)}return U}function B41($){return iU0(function(I,U){var Y=-1,J=U.length,Q=J>1?U[J-1]:void 0,K=J>2?U[2]:void 0;if(Q=$.length>3&&typeof Q=="function"?(J--,Q):void 0,K&&v41(U[0],U[1],K))Q=J<3?void 0:Q,J=1;I=Object(I);while(++Y<J){var q=U[Y];if(q)$(I,q,Y,Q)}return I})}function bU0($,I){return I=I==null?kU0:I,!!I&&(typeof $=="number"||O41.test($))&&($>-1&&$%1==0&&$<I)}function v41($,I,U){if(!x_(U))return!1;var Y=typeof I;if(Y=="number"?k_(U)&&bU0(I,U.length):Y=="string"&&(I in U))return u_(U[I],$);return!1}function R41($){var I=$&&$.constructor,U=typeof I=="function"&&I.prototype||tK;return $===U}function j41($){var I=[];if($!=null)for(var U in Object($))I.push(U);return I}function u_($,I){return $===I||$!==$&&I!==I}function C41($){return S41($)&&aK.call($,"callee")&&(!N41.call($,"callee")||fU0.call($)==X41)}var _41=Array.isArray;function k_($){return $!=null&&y41($.length)&&!g41($)}function S41($){return h41($)&&k_($)}function g41($){var I=x_($)?fU0.call($):"";return I==L41||I==D41}function y41($){return typeof $=="number"&&$>-1&&$%1==0&&$<=kU0}function x_($){var I=typeof $;return!!$&&(I=="object"||I=="function")}function h41($){return!!$&&typeof $=="object"}var u41=B41(function($,I,U,Y){E41(I,x41(I),$,Y)}),k41=iU0(function($){return $.push(void 0,A41),xU0(u41,void 0,$)});function x41($){return k_($)?M41($,!0):T41($)}nU0.exports=k41});var cU0=F((OR1,i_)=>{function f41($,I){if(!($ instanceof I))throw TypeError("Cannot call a class as a function")}var pU0=P4().Buffer,sK=t("util");function i41($,I,U){$.copy(I,U)}i_.exports=function(){function $(){f41(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(U){var Y={data:U,next:null};if(this.length>0)this.tail.next=Y;else this.head=Y;this.tail=Y,++this.length},$.prototype.unshift=function(U){var Y={data:U,next:this.head};if(this.length===0)this.tail=Y;this.head=Y,++this.length},$.prototype.shift=function(){if(this.length===0)return;var U=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,U},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(U){if(this.length===0)return"";var Y=this.head,J=""+Y.data;while(Y=Y.next)J+=U+Y.data;return J},$.prototype.concat=function(U){if(this.length===0)return pU0.alloc(0);var Y=pU0.allocUnsafe(U>>>0),J=this.head,Q=0;while(J)i41(J.data,Y,Q),Q+=J.data.length,J=J.next;return Y},$}();if(sK&&sK.inspect&&sK.inspect.custom)i_.exports.prototype[sK.inspect.custom]=function(){var $=sK.inspect({length:this.length});return this.constructor.name+" "+$}});var b_=F((FR1,dU0)=>{var wX=A4();function b41($,I){var U=this,Y=this._readableState&&this._readableState.destroyed,J=this._writableState&&this._writableState.destroyed;if(Y||J){if(I)I($);else if($){if(!this._writableState)wX.nextTick(VX,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,wX.nextTick(VX,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Q){if(!I&&Q){if(!U._writableState)wX.nextTick(VX,U,Q);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,wX.nextTick(VX,U,Q)}else if(I)I(Q)}),this}function n41(){if(this._readableState)this._readable
Line truncated
|
||||
%s`,R,R,P,Y);var x=P.type==="*"?ES:P.type==="?"?TS:"\\"+P.type;J=!0,Y=Y.slice(0,P.reStart)+x+"\\("+R}if(X(),Q)Y+="\\\\";var y=!1;switch(Y.charAt(0)){case"[":case".":case"(":y=!0}for(var f=q.length-1;f>-1;f--){var j=q[f],p=Y.slice(0,j.reStart),n=Y.slice(j.reStart,j.reEnd-8),g=Y.slice(j.reEnd-8,j.reEnd),i=Y.slice(j.reEnd);g+=i;var b=p.split("(").length-1,U0=i;for(L=0;L<b;L++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var B="";if(i===""&&I!==RX)B="$";var k=p+n+i+B+g;Y=k}if(Y!==""&&J)Y="(?=.)"+Y;if(y)Y=Z+Y;if(I===RX)return[Y,J];if(!J)return q91($);var c=U.nocase?"i":"";try{var r=new RegExp("^"+Y+"$",c)}catch(J0){return new RegExp("$.")}return r._glob=$,r._src=Y,r}z$.makeRe=function($,I){return new j4($,I||{}).makeRe()};j4.prototype.makeRe=K91;function K91(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var I=this.options,U=I.noglobstar?ES:I.dot?s51:e51,Y=I.nocase?"i":"",J=$.map(function(Q){return Q.map(function(K){return K===u3?U:typeof K==="string"?H91(K):K._src}).join("\\/")}).join("|");if(J="^(?:"+J+")$",this.negate)J="^(?!"+J+").*$";try{this.regexp=new RegExp(J,Y)}catch(Q){this.regexp=!1}return this.regexp}z$.match=function($,I,U){U=U||{};var Y=new j4(I,U);if($=$.filter(function(J){return Y.match(J)}),Y.options.nonull&&!$.length)$.push(I);return $};j4.prototype.match=function(I,U){if(typeof U>"u")U=this.partial;if(this.debug("match",I,this.pattern),this.comment)return!1;if(this.empty)return I==="";if(I==="/"&&U)return!0;var Y=this.options;if(Wq.sep!=="/")I=I.split(Wq.sep).join("/");I=I.split(FJ0),this.debug(this.pattern,"split",I);var J=this.set;this.debug(this.pattern,"set",J);var Q,K;for(K=I.length-1;K>=0;K--)if(Q=I[K],Q)break;for(K=0;K<J.length;K++){var q=J[K],H=I;if(Y.matchBase&&q.length===1)H=[Q];var G=this.matchOne(H,q,U);if(G){if(Y.flipNegate)return!0;return!this.negate}}if(Y.flipNegate)return!1;return this.negate};j4.prototype.matchOne=function($,I,U){if(I.indexOf(u3)!==-1)return this._matchGlobstar($,I,U,0,0);return this._matchOne($,I,U,0,0)};j4.prototype._matchGlobstar=function($,I,U,Y,J){var Q,K=-1;for(Q=J;Q<I.length;Q++)if(I[Q]===u3){K=Q;break}var q=-1;for(Q=I.length-1;Q>=0;Q--)if(I[Q]===u3){q=Q;break}var H=I.slice(J,K),G=U?I.slice(K+1):I.slice(K+1,q),W=U?[]:I.slice(q+1);if(H.length){var w=$.slice(Y,Y+H.length);if(!this._matchOne(w,H,U,0,0))return!1;Y+=H.length}var Z=0;if(W.length){if(W.length+Y>$.length)return!1;var V=$.length-W.length;if(this._matchOne($,W,U,V,0))Z=W.length;else{if($[$.length-1]!==""||Y+W.length===$.length)return!1;if(V--,!this._matchOne($,W,U,V,0))return!1;Z=W.length+1}}if(!G.length){var X=!!Z;for(Q=Y;Q<$.length-Z;Q++){var L=String($[Q]);if(X=!0,L==="."||L===".."||!this.options.dot&&L.charAt(0)===".")return!1}return U||X}var D=[[[],0]],O=D[0],P=0,T=[0];for(var A=0;A<G.length;A++){var R=G[A];if(R===u3)T.push(P),O=[[],0],D.push(O);else O[0].push(R),P++}var x=D.length-1,y=$.length-Z;for(var f=0;f<D.length;f++)D[f][1]=y-(T[x--]+D[f][0].length);return!!this._matchGlobStarBodySections($,D,Y,0,U,0,!!Z)};j4.prototype._matchGlobStarBodySections=function($,I,U,Y,J,Q,K){var q=I[Y];if(!q){for(var H=U;H<$.length;H++){K=!0;var G=$[H];if(G==="."||G===".."||!this.options.dot&&G.charAt(0)===".")return!1}return K}var W=q[0],w=q[1];while(U<=w){var Z=this._matchOne($.slice(0,U+W.length),W,J,U,0);if(Z&&Q<this.maxGlobstarRecursion){var V=this._matchGlobStarBodySections($,I,U+W.length,Y+1,J,Q+1,K);if(V!==!1)return V}var G=$[U];if(G==="."||G===".."||!this.options.dot&&G.charAt(0)===".")return!1;U++}return J||null};j4.prototype._matchOne=function($,I,U,Y,J){var Q,K,q,H;for(Q=Y,K=J,q=$.length,H=I.length;Q<q&&K<H;Q++,K++){this.debug("matchOne loop");var G=I[K],W=$[Q];if(this.debug(I,G,W),G===!1||G===u3)return!1;var w;if(typeof G==="string")w=W===G,this.debug("string match",G,W,w);else w=W.match(G),this.debug("pattern match",G,W,w);if(!w)return!1}if(Q===q&&K===H)return!0;else if(Q===q)return U;else if(K===H)return Q===q-1&&$[Q]==="";throw Error("wtf?")};function q91($){return $.replace(/\\(.)/g,"$1")}function H91($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var SX=F((xR1,_X)=>{function AJ0($){return $.charAt(0)==="/"}function PJ0($){var I=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,U=I.exec($),Y=U[1]||"",J=Boolean(Y&&Y.charAt(1)!==":");return Boolean(U[2]||J)}_X.exports=process.platform==="win32"?PJ0:AJ0;_X.exports.posix=AJ0;_X.exports.win32=PJ0});var vS=F((O91)=>{O91.setopts=z91;O91.ownProp=TJ0;O91.makeAbs=wq;O91.finish=X91;O91.mark=L91;O91.isIgnored=BJ0;O91.childrenIgnored=D91;function TJ0($,I){return Object.prototype.hasOwnProperty.call($,I)}var G91=t("fs"),oY=t("path"),W91=CX(),EJ0=SX(),BS=W91.Minimatch;function w91($,I){return $.localeCompare(I,"en")}function V91($,I){if($.ignore=I.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(Z91)}function Z91($){var I=null;if($.slice(-3)==="/**"){var U=$.replace(/(\/\*\*)+$/,"");I=new BS(U,{dot:!0})}return{matcher
Line truncated
|
||||
See: https://github.com/isaacs/node-glob/issues/167`);return new u4($,I).found}function u4($,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 u4))return new u4($,I);if(v91(this,$,I),this.noprocess)return this;var U=this.minimatch.set.length;this.matches=Array(U);for(var Y=0;Y<U;Y++)this._process(this.minimatch.set[Y],Y,!1);this._finish()}u4.prototype._finish=function(){if(RJ0.ok(this instanceof u4),this.realpath){var $=this;this.matches.forEach(function(I,U){var Y=$.matches[U]=Object.create(null);for(var J in I)try{J=$._makeAbs(J);var Q=B91.realpathSync(J,$.realpathCache);Y[Q]=!0}catch(K){if(K.syscall==="stat")Y[$._makeAbs(J)]=!0;else throw K}})}k3.finish(this)};u4.prototype._process=function($,I,U){RJ0.ok(this instanceof u4);var Y=0;while(typeof $[Y]==="string")Y++;var J;switch(Y){case $.length:this._processSimple($.join("/"),I);return;case 0:J=null;break;default:J=$.slice(0,Y).join("/");break}var Q=$.slice(Y),K;if(J===null)K=".";else if(gX(J)||gX($.map(function(G){return typeof G==="string"?G:"[*]"}).join("/"))){if(!J||!gX(J))J="/"+J;K=J}else K=J;var q=this._makeAbs(K);if(R91(this,K))return;var H=Q[0]===vJ0.GLOBSTAR;if(H)this._processGlobStar(J,K,q,Q,I,U);else this._processReaddir(J,K,q,Q,I,U)};u4.prototype._processReaddir=function($,I,U,Y,J,Q){var K=this._readdir(U,Q);if(!K)return;var q=Y[0],H=!!this.minimatch.negate,G=q._glob,W=this.dot||G.charAt(0)===".",w=[];for(var Z=0;Z<K.length;Z++){var V=K[Z];if(V.charAt(0)!=="."||W){var X;if(H&&!$)X=!V.match(q);else X=V.match(q);if(X)w.push(V)}}var L=w.length;if(L===0)return;if(Y.length===1&&!this.mark&&!this.stat){if(!this.matches[J])this.matches[J]=Object.create(null);for(var Z=0;Z<L;Z++){var V=w[Z];if($)if($.slice(-1)!=="/")V=$+"/"+V;else V=$+V;if(V.charAt(0)==="/"&&!this.nomount)V=RS.join(this.root,V);this._emitMatch(J,V)}return}Y.shift();for(var Z=0;Z<L;Z++){var V=w[Z],D;if($)D=[$,V];else D=[V];this._process(D.concat(Y),J,Q)}};u4.prototype._emitMatch=function($,I){if(j91(this,I))return;var U=this._makeAbs(I);if(this.mark)I=this._mark(I);if(this.absolute)I=U;if(this.matches[$][I])return;if(this.nodir){var Y=this.cache[U];if(Y==="DIR"||Array.isArray(Y))return}if(this.matches[$][I]=!0,this.stat)this._stat(I)};u4.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var I,U,Y;try{U=this.fs.lstatSync($)}catch(Q){if(Q.code==="ENOENT")return null}var J=U&&U.isSymbolicLink();if(this.symlinks[$]=J,!J&&U&&!U.isDirectory())this.cache[$]="FILE";else I=this._readdir($,!1);return I};u4.prototype._readdir=function($,I){var U;if(I&&!jS(this.symlinks,$))return this._readdirInGlobStar($);if(jS(this.cache,$)){var Y=this.cache[$];if(!Y||Y==="FILE")return null;if(Array.isArray(Y))return Y}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(J){return this._readdirError($,J),null}};u4.prototype._readdirEntries=function($,I){if(!this.mark&&!this.stat)for(var U=0;U<I.length;U++){var Y=I[U];if($==="/")Y=$+Y;else Y=$+"/"+Y;this.cache[Y]=!0}return this.cache[$]=I,I};u4.prototype._readdirError=function($,I){switch(I.code){case"ENOTSUP":case"ENOTDIR":var U=this._makeAbs($);if(this.cache[U]="FILE",U===this.cwdAbs){var Y=Error(I.code+" invalid cwd "+this.cwd);throw Y.path=this.cwd,Y.code=I.code,Y}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}};u4.prototype._processGlobStar=function($,I,U,Y,J,Q){var K=this._readdir(U,Q);if(!K)return;var q=Y.slice(1),H=$?[$]:[],G=H.concat(q);this._process(G,J,!1);var W=K.length,w=this.symlinks[U];if(w&&Q)return;for(var Z=0;Z<W;Z++){var V=K[Z];if(V.charAt(0)==="."&&!this.dot)continue;var X=H.concat(K[Z],q);this._process(X,J,!0);var L=H.concat(K[Z],Y);this._process(L,J,!0)}};u4.prototype._processSimple=function($,I){var U=this._stat($);if(!this.matches[I])this.matches[I]=Object.create(null);if(!U)return;if($&&gX($)&&!this.nomount){var Y=/[\/\\]$/.test($);if($.charAt(0)==="/")$=RS.join(this.root,$);else if($=RS.resolve(this.root,$),Y)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(I,$)};u4.prototype._stat=function($){var I=this._makeAbs($),U=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&jS(this.cache,I)){var K=this.cache[I];if(Array.isArray(K))K="DIR";if(!U||K==="DIR")return K;if(U&&K==="FILE")return!1}var Y,J=this.statCache[I];if(!J){var Q;try{Q=this.fs.lstatSync(I)}catch(q){if(q&&(q.code==="ENOENT"||q.code==="ENOTDIR"))return this.statCache[I]=!1,!1}if(Q&&Q.isSymbolicLink())try{J=this.fs.statSync(I)}catch(q){J=Q}else J=Q}this.statCache[I]=J;var K=!0;if(J)K=J.isDirectory()?"DIR":"FILE";if(this.cache[I]=this.cache[I]||K,U&&K==="FILE")return!1;return K};u4.prototype._mark=function($){return k3.mark(this,$)};u4.prototype._makeAbs=function($){return k3.makeAbs(this,$)}});var CS=F((cR1,gJ0)=>{gJ0.exports=SJ0;function SJ0($,I){if($&&I)return SJ0($)(I);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(Y){U[Y]=$[Y]}),U;f
Line truncated
|
||||
`);if($.linkname)I+=Hg(" linkpath="+$.linkname+`
|
||||
`);var U=$.pax;if(U)for(var Y in U)I+=Hg(" "+Y+"="+U[Y]+`
|
||||
`);return Buffer.from(I)};d71.decodePax=function($){var I={};while($.length){var U=0;while(U<$.length&&$[U]!==32)U++;var Y=parseInt($.slice(0,U).toString(),10);if(!Y)return I;var J=$.slice(U+1,Y-1).toString(),Q=J.indexOf("=");if(Q===-1)return I;I[J.slice(0,Q)]=J.slice(Q+1),$=$.slice(Y)}return I};d71.encode=function($){var I=y71(512),U=$.name,Y="";if($.typeflag===5&&U[U.length-1]!=="/")U+="/";if(Buffer.byteLength(U)!==U.length)return null;while(Buffer.byteLength(U)>100){var J=U.indexOf("/");if(J===-1)return null;Y+=Y?"/"+U.slice(0,J):U.slice(0,J),U=U.slice(J+1)}if(Buffer.byteLength(U)>100||Buffer.byteLength(Y)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(I.write(U),I.write(K7($.mode&i71,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]=aQ0+p71($.type),$.linkname)I.write($.linkname,157);if(sQ0.copy(I,Dq),k71.copy(I,Gg),$.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),Y)I.write(Y,345);return I.write(K7($20(I),6),148),I};d71.decode=function($,I,U){var Y=$[156]===0?0:$[156]-aQ0,J=sY($,0,100,I),Q=q7($,100,8),K=q7($,108,8),q=q7($,116,8),H=q7($,124,12),G=q7($,136,12),W=n71(Y),w=$[157]===0?null:sY($,157,100,I),Z=sY($,265,32),V=sY($,297,32),X=q7($,329,8),L=q7($,337,8),D=$20($);if(D===256)return null;if(D!==q7($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(sQ0.compare($,Dq,Dq+6)===0){if($[345])J=sY($,345,155,I)+"/"+J}else if(x71.compare($,Dq,Dq+6)===0&&f71.compare($,Gg,Gg+2)===0);else if(!U)throw Error("Invalid tar header: unknown format.");if(Y===0&&J&&J[J.length-1]==="/")Y=5;return{name:J,mode:Q,uid:K,gid:q,size:H,mtime:new Date(1000*G),type:W,linkname:w,uname:Z,gname:V,devmajor:X,devminor:L}}});var q20=F((Ej1,K20)=>{var U20=t("util"),a71=tQ0(),Oq=Wg(),Y20=D6().Writable,J20=D6().PassThrough,Q20=function(){},I20=function($){return $&=511,$&&512-$},s71=function($,I){var U=new iX($,I);return U.end(),U},e71=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,$},iX=function($,I){this._parent=$,this.offset=I,J20.call(this,{autoDestroy:!1})};U20.inherits(iX,J20);iX.prototype.destroy=function($){this._parent.destroy($)};var h5=function($){if(!(this instanceof h5))return new h5($);Y20.call(this,$),$=$||{},this._offset=0,this._buffer=a71(),this._missing=0,this._partial=!1,this._onparse=Q20,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,U=I._buffer,Y=function(){I._continue()},J=function(Z){if(I._locked=!1,Z)return I.destroy(Z);if(!I._stream)Y()},Q=function(){I._stream=null;var Z=I20(I._header.size);if(Z)I._parse(Z,K);else I._parse(512,w);if(!I._locked)Y()},K=function(){I._buffer.consume(I20(I._header.size)),I._parse(512,w),Y()},q=function(){var Z=I._header.size;I._paxGlobal=Oq.decodePax(U.slice(0,Z)),U.consume(Z),Q()},H=function(){var Z=I._header.size;if(I._pax=Oq.decodePax(U.slice(0,Z)),I._paxGlobal)I._pax=Object.assign({},I._paxGlobal,I._pax);U.consume(Z),Q()},G=function(){var Z=I._header.size;this._gnuLongPath=Oq.decodeLongPath(U.slice(0,Z),$.filenameEncoding),U.consume(Z),Q()},W=function(){var Z=I._header.size;this._gnuLongLinkPath=Oq.decodeLongPath(U.slice(0,Z),$.filenameEncoding),U.consume(Z),Q()},w=function(){var Z=I._offset,V;try{V=I._header=Oq.decode(U.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(X){I.emit("error",X)}if(U.consume(512),!V){I._parse(512,w),Y();return}if(V.type==="gnu-long-path"){I._parse(V.size,G),Y();return}if(V.type==="gnu-long-link-path"){I._parse(V.size,W),Y();return}if(V.type==="pax-global-header"){I._parse(V.size,q),Y();return}if(V.type==="pax-header"){I._parse(V.size,H),Y();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=e71(V,I._pax),I._pax=null;if(I._locked=!0,!V.size||V.type==="directory"){I._parse(512,w),I.emit("entry",V,s71(I,Z),J);return}I._stream=new iX(I,Z),I.emit("entry",V,I._stream,J),I._parse(V.size,Q),Y()};this._onheader=w,this._parse(512,w)};U20.inherits(h5,Y20);h5.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};h5.prototype._parse=function($,I){if(this._destroyed)return;if(this._offset+=$,this._missing=$,I===this._onheader)this._partial=!1;this._onparse=I};h5.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=Q20,this._overflow)this._write(this._overflow,void 0,$);else $()};h5.prototype._write=function($,I,U){if(this._destroyed)return;var Y=this._stream,J=this._buffer,Q=this._missing;if($.length)this._partial=!0;if($.length<Q){
Line truncated
|
||||
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let I=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${O31.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${I}" Type="${$.Type}" Target="${$.Target}"/>`);return I}_writeClose(){this.stream.write("</Relationships>")}}g20.exports=S20});var f20=F((hj1,x20)=>{var h20=U6(),u20=p9(),N31=W4(),M31=pj(),A31=dj();class k20{constructor($,I,U){this.id=U.id,this.count=0,this._worksheet=$,this._workbook=U.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:u20.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let I={Type:u20.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 U=new M31,Y=new h20;U.render(Y,$),this.commentsStream.write(Y.xml);let J=new A31,Q=new h20;J.render(Q,$,I),this.vmlStream.write(Q.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((I)=>{I.refAddress=N31.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()}}x20.exports=k20});var d20=F((uj1,c20)=>{var P31=X4(),T31=p9(),Zg=W4(),i20=qB(),b20=Z5(),E31=AR(),n20=JV(),zg=KV(),B31=y20(),v31=f20(),R31=QB(),p4=new E31,Xg=i9(),j31=Dj(),C31=Oj(),_31=Fj(),S31=Zj(),g31=wj(),y31=zj(),h31=Nj(),u31=Mj(),k31=Aj(),x31=Pj(),f31=Tj(),i31=Ej(),b31=Cj(),n31=vj(),p31=Bj(),c4={dataValidations:new j31,sheetProperties:new C31,sheetFormatProperties:new _31,columns:new Xg({tag:"cols",length:!1,childXform:new S31}),row:new g31,hyperlinks:new Xg({tag:"hyperlinks",length:!1,childXform:new y31}),sheetViews:new Xg({tag:"sheetViews",length:!1,childXform:new h31}),sheetProtection:new u31,pageMargins:new k31,pageSeteup:new x31,autoFilter:new f31,picture:new i31,conditionalFormattings:new b31,headerFooter:new n31,rowBreaks:new p31};class p20{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 B31($),this._sheetCommentsWriter=new v31(this,this._sheetRelsWriter,$),this._dimensions=new b20,this._rowZero=1,this.committed=!1,this.dataValidations=new R31,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
|
||||
*/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
|
||||
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 http://goo.gl/MqrFmX
|
||||
`)},gg=yg.getNativePromise();if(yg.isNode&&typeof MutationObserver>"u")hg=global.setImmediate,ug=process.nextTick,d3=yg.isRecentNode?function($){hg.call(global,$)}:function($){ug.call(process,$)};else if(typeof gg==="function"&&typeof gg.resolve==="function")kg=gg.resolve(),d3=function($){kg.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))d3=function(){var $=document.createElement("div"),I={attributes:!0},U=!1,Y=document.createElement("div"),J=new MutationObserver(function(){$.classList.toggle("foo"),U=!1});J.observe(Y,I);var Q=function(){if(U)return;U=!0,Y.classList.toggle("foo")};return function(q){var H=new MutationObserver(function(){H.disconnect(),q()});H.observe($,I),Q()}}();else if(typeof setImmediate<"u")d3=function($){setImmediate($)};else if(typeof setTimeout<"u")d3=function($){setTimeout($,0)};else d3=yI1;var hg,ug,kg;TK0.exports=d3});var vK0=F((oj1,BK0)=>{function hI1($,I,U,Y,J){for(var Q=0;Q<J;++Q)U[Q+Y]=$[Q+I],$[Q+I]=void 0}function W7($){this._capacity=$,this._length=0,this._front=0}W7.prototype._willBeOverCapacity=function($){return this._capacity<$};W7.prototype._pushOne=function($){var I=this.length();this._checkCapacity(I+1);var U=this._front+I&this._capacity-1;this[U]=$,this._length=I+1};W7.prototype.push=function($,I,U){var Y=this.length()+3;if(this._willBeOverCapacity(Y)){this._pushOne($),this._pushOne(I),this._pushOne(U);return}var J=this._front+Y-3;this._checkCapacity(Y);var Q=this._capacity-1;this[J+0&Q]=$,this[J+1&Q]=I,this[J+2&Q]=U,this._length=Y};W7.prototype.shift=function(){var $=this._front,I=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,I};W7.prototype.length=function(){return this._length};W7.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};W7.prototype._resizeTo=function($){var I=this._capacity;this._capacity=$;var U=this._front,Y=this._length,J=U+Y&I-1;hI1(this,0,this,I,J)};BK0.exports=W7});var yK0=F((rj1,xg)=>{var SK0;try{throw Error()}catch($){SK0=$}var uI1=EK0(),RK0=vK0(),gK0=d1();function d4(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new RK0(16),this._normalQueue=new RK0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=uI1}d4.prototype.setScheduler=function($){var I=this._schedule;return this._schedule=$,this._customScheduler=!0,I};d4.prototype.hasCustomScheduler=function(){return this._customScheduler};d4.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};d4.prototype.disableTrampolineIfNecessary=function(){if(gK0.hasDevTools)this._trampolineEnabled=!1};d4.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};d4.prototype.fatalError=function($,I){if(I)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
|
||||
`),process.exit(2);else this.throwLater($)};d4.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(U){throw Error(`No async scheduler available
|
||||
`)},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:$)+`
|
||||
`),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 jK0($,I,U){this._lateQueue.push($,I,U),this._queueTick()}function CK0($,I,U){this._normalQueue.push($,I,U),this._queueTick()}function _K0($){this._normalQueue._pushOne($),this._queueTick()}if(!gK0.hasDevTools)d4.prototype.invokeLater=jK0,d4.prototype.invoke=CK0,d4.prototype.settlePromises=_K0;else d4.prototype.invokeLater=function($,I,U){if(this._trampolineEnabled)jK0.call(this,$,I,U);else this._schedule(function(){setTimeout(function(){$.call(I,U)},100)})},d4.prototype.invoke=function($,I,U){if(this._trampolineEnabled)CK0.call(this,$,I,U);else this._schedule(function(){$.call(I,U)})},d4.prototype.settlePromises=function($){if(this._trampolineEnabled)_K0.call(this,$);else this._schedule(function(){$._settlePromises()})};d4.prototype._drainQueue=function($){while($.length()>0){var I=$.shift();if(typeof I!=="function"){I._settlePromises();continue}var U=$.shift(),Y=$.shift();I.call(U,Y)}};d4.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};d4.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};d4.prototype._reset=function(){this._isTickUsed=!1};xg.exports=d4;xg.exports.firstLineError=SK0});var k5=F((tj1,kK0)=>{var bg=c3(),kI1=bg.freeze,hK0=d1(),uK0=hK0.inherits,YJ=hK0.notEnumerableProp;function JJ($,I){function U(Y){if(!(this instanceof U))return new U(Y);if(YJ(this,"message",typeof Y==="string"?Y:I),YJ(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return uK0(U,Error),U}var fg,ig,xI1=JJ("Warning","warning"),fI1=JJ("CancellationError","cancellation error"),iI1=JJ("TimeoutError","timeout error"),Tq=JJ("AggregateError","aggregate error");try{fg=TypeError,ig=RangeError}catch($){fg=JJ("TypeError","type error"),ig=JJ("RangeError","range error")}var rX="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(m3=0;m3<rX.length;++m3)if(typeof Array.prototype[rX[m3]]==="function")Tq.prototype[rX[m3]]=Array.prototype[rX[m3]];var m3;bg.defineProperty(Tq.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});Tq.prototype.isOperational=!0;var tX=0;Tq.prototype.toString=function(){var $=Array(tX*4+1).join(" "),I=`
|
||||
`)}};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=`
|
||||
`+$+`AggregateError of:
|
||||
`;tX++,$=Array(tX*4+1).join(" ");for(var U=0;U<this.length;++U){var Y=this[U]===this?"[Circular AggregateError]":this[U]+"",J=Y.split(`
|
||||
`);for(var Q=0;Q<J.length;++Q)J[Q]=$+J[Q];Y=J.join(`
|
||||
`),I+=Y+`
|
||||
`}return tX--,I};function Pq($){if(!(this instanceof Pq))return new Pq($);if(YJ(this,"name","OperationalError"),YJ(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)YJ(this,"message",$.message),YJ(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}uK0(Pq,Error);var l3=Error.__BluebirdErrorTypes__;if(!l3)l3=kI1({CancellationError:fI1,TimeoutError:iI1,OperationalError:Pq,RejectionError:Pq,AggregateError:Tq}),bg.defineProperty(Error,"__BluebirdErrorTypes__",{value:l3,writable:!1,enumerable:!1,configurable:!1});kK0.exports={Error,TypeError:fg,RangeError:ig,CancellationError:l3.CancellationError,OperationalError:l3.OperationalError,TimeoutError:l3.TimeoutError,AggregateError:l3.AggregateError,Warning:xI1}});var fK0=F((aj1,xK0)=>{xK0.exports=function($,I){var U=d1(),Y=U.errorObj,J=U.isObject;function Q(w,Z){if(J(w)){if(w instanceof $)return w;var V=q(w);if(V===Y){if(Z)Z._pushContext();var X=$.reject(V.e);if(Z)Z._popContext();return X}else if(typeof V==="function"){if(G(w)){var X=new $(I);return w._then(X._fulfill,X._reject,void 0,X,null),X}return W(w,V,Z)}}return w}function K(w){return w.then}function q(w){try{return K(w)}catch(Z){return Y.e=Z,Y}}var H={}.hasOwnProperty;function G(w){try{return H.call(w,"_promise0")}catch(Z){return!1}}function W(w,Z,V){var X=new $(I),L=X;if(V)V._pushContext();if(X._captureStackTrace(),V)V._popContext();var D=!0,O=U.tryCatch(Z).call(w,P,T);if(D=!1,X&&O===Y)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 Q}});var bK0=F((sj1,iK0)=>{iK0.exports=function($,I,U,Y,J){var Q=d1(),K=Q.isArray;function q(G){switch(G){case-2:return[];case-3:return{}}}function H(G){var W=this._promise=new $(I);if(G instanceof $)W._propagateFrom(G,3);W._setOnCancel(this),this._values=G,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Q.inherits(H,J),H.prototype.length=function(){return this._length},H.prototype.promise=function(){return this._promise},H.prototype._init=function G(W,w){var Z=U(this._values,this._promise);if(Z instanceof $){Z=Z._target();var V=Z._bitField;if(this._values=Z,(V&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(G,this._reject,void 0,this,w);else if((V&33554432)!==0)Z=Z._value();else if((V&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=Q.asArray(Z),Z===null){var X=Y("expecting an array or an iterable object but got "+Q.classString(Z)).reason();this._promise._rejectCallback(X,!1);return}if(Z.length===0){if(w===-5)this._resolveEmptyArray();else this._resolve(q(w));return}this._iterate(Z)},H.prototype._iterate=function(G){var W=this.getActualLength(G.length);this._length=W,this._values=this.shouldCopyValues()?Array(W):this._values;var w=this._promise,Z=!1,V=null;for(var X=0;X<W;++X){var L=U(G[X],w);if(L instanceof $)L=L._target(),V=L._bitField;else V=null;if(Z){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)Z=this._promiseFulfilled(L._value(),X);else if((V&16777216)!==0)Z=this._promiseRejected(L._reason(),X);else Z=this._promiseCancelled(X);else Z=this._promiseFulfilled(L,X)}if(!Z)w._setAsyncGuaranteed()},H.prototype._isResolved=function(){return this._values===null},H.prototype._resolve=function(G){this._values=null,this._promise._fulfill(G)},H.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},H.prototype._reject=function(G){this._values=null,this._promise._rejectCallback(G,!1)},H.prototype._promiseFulfilled=function(G,W){this._values[W]=G;var w=++this._totalResolved;if(w>=this._length)return this._resolve(this._values),!0;return!1},H.prototype._promiseCancelled=function(){return this._cancel(),!0},H.prototype._promiseRejected=function(G){return this._totalResolved++,this._reject(G),!0},H.prototype._resultCancelled=function(){if(this._isResolved())return;var G=this._values;if(this._cancel(),G instanceof $)G.cancel();else for(var W=0;W<G.length;++W)if(G[W]instanceof $)G[W].cancel()},H.prototype.shouldCopyValues=function(){return!0},H.prototype.getActualLength=function(G){return G},H}});var pK0=F((ej1,nK0)=>{nK0.exports=function($){var I=!1,U=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function Y(){this._trace=new Y.CapturedTrace(Q())}Y.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,U.push(this._trace)},Y.prototype._popContext=function(){if(this._trace!==void 0){var K=U.pop(),q=K._promiseCreated;return K._promiseCreated=null,q}return null};function J(){if(I)return new Y}function Q(){var K=U.length-1;if(K>=0)return U[K];return}return Y.CapturedTrace=null,Y.create=J,Y.deactivateLong
Line truncated
|
||||
`;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(`
|
||||
`);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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);if(!v0.longStackTraces&&i6()){var a=$.prototype._captureStackTrace,N=$.prototype._attachExtraTrace;v0.longStackTraces=!0,A=function(){if(Y.haveItemsQueued()&&!v0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
|
||||
`);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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);$.prototype._captureStackTrace=a,$.prototype._attachExtraTrace=N,I.deactivateLongStackTraces(),Y.enableTrampoline(),v0.longStackTraces=!1},$.prototype._captureStackTrace=J0,$.prototype._attachExtraTrace=w0,I.activateLongStackTraces(),Y.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return v0.longStackTraces&&i6()};var R=function(){try{if(typeof CustomEvent==="function"){var a=new CustomEvent("CustomEvent");return Q.global.dispatchEvent(a),function(N,M){var C=new CustomEvent(N.toLowerCase(),{detail:M,cancelable:!0});return!Q.global.dispatchEvent(C)}}else if(typeof Event==="function"){var a=new Event("CustomEvent");return Q.global.dispatchEvent(a),function(M,C){var u=new Event(M.toLowerCase(),{cancelable:!0});return u.detail=C,!Q.global.dispatchEvent(u)}}else{var a=document.createEvent("CustomEvent");return a.initCustomEvent("testingtheevent",!1,!0,{}),Q.global.dispatchEvent(a),function(M,C){var u=document.createEvent("CustomEvent");return u.initCustomEvent(M.toLowerCase(),!1,!0,C),!Q.global.dispatchEvent(u)}}}catch(N){}return function(){return!1}}(),x=function(){if(Q.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Q.global)return function(){return!1};return function(a){var N="on"+a.toLowerCase(),M=Q.global[N];if(!M)return!1;return M.apply(Q.global,[].slice.call(arguments,1)),!0}}}();function y(a,N){return{promise:N}}var f={promiseCreated:y,promiseFulfilled:y,promiseRejected:y,promiseResolved:y,promiseCancelled:y,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:y},j=function(a){var N=!1;try{N=x.apply(null,arguments)}catch(C){Y.throwLater(C),N=!0}var M=!1;try{M=R(a,f[a].apply(null,arguments))}catch(C){Y.throwLater(C),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(v0.warnings=!!N,T=v0.warnings,Q.isObject(N)){if("wForgottenReturn"in N)T=!!N.wForgottenReturn}}if("cancellation"in a&&a.cancellation&&!v0.cancellation){if(Y.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=U0,$.prototype._propagateFrom=B,$.prototype._onCancel=i,$.prototype._setOnCancel=b,$.prototype._attachCancellationCallback=g,$.prototype._execute=n,c=B,v0.cancellation=!0}if("monitoring"in a){if(a.monitoring&&!v0.monitoring)v0.monitoring=!0,$.prototype._fireEvent=j;else if(!a.monitoring&&v0.monitoring)v0.monitoring=!1,$.prototype._fireEvent=p}return $};function p(){return!1}$.prototype._fireEvent=p,$.prototype._execute=function(a,N,M){try{a(N,M)}catch(C){return C}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(a){},$.prototype._attachCancellationCallback=function(a){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(a,N){};function n(a,N,M){var C=this;try{a(N,M,function(u){if(typeof u!=="function")throw TypeError("onCancel must be a function, got: "+Q.toString(u));C._attachCancellationCallback(u)})}catch(u){return u}}function g(a){if(!this._isCancellable())return this;var N=this._onCancel();if(N!==void 0)if(Q.isArray(N))N.push(a);else this._setOnCancel([N,a]);else this._setOnCancel(a)}function i(){return this._onCancelField}function b(a){this._onCancelField=a}function U0(){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 k(a,N){if((N&2)!==0&&a._isBound())this._setBoundTo(a._boundTo)}var c=k;function r(){var a=this._boundTo;if(a!==void 0){if(a instanceof $)if(a.isFulfilled())return a.value();else return}return a}function J0(){this._trace=new J$(this._peekContext())}function w0(a,N){if(K(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 C=U1(a);Q.notEnumerableProp(a,"stack",C.message+`
|
||||
`+C.stack.join(`
|
||||
`)),Q.notEnumerableProp(a,"__stackCleaned__",!0)}}}function A0(a,N,M,C,u){if(a===void 0&&N!==null&&T){if(u!==void 0&&u._returnedNonUndefined())return;if((C._bitField&65535)===0)return;if(M)M=M+" ";var s="",m="";if(N._trace){var e=N._trace.stack.split(`
|
||||
`),K0=Q0(e);for(var W0=K0.length-1;W0>=0;--W0){var _0=K0[W0];if(!W.test(_0)){var b0=_0.match(w);if(b0)s="at "+b0[1]+":"+b0[2]+":"+b0[3]+" ";break}}if(K0.length>0){var f0=K0[0];for(var W0=0;W0<e.length;++W0)if(e[W0]===f0){if(W0>0)m=`
|
||||
`+e[W0-1];break}}}var H1="a promise was created in a "+M+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+m;C._warn(H1,!0,N)}}function j0(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(!v0.warnings)return;var C=new J(a),u;if(N)M._attachExtraTrace(C);else if(v0.longStackTraces&&(u=$._peekContext()))u.attachExtraTrace(C);else{var s=U1(C);C.stack=s.message+`
|
||||
`);$.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+`
|
||||
`+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+`
|
||||
`+s.stack.join(`
|
||||
`)}if(!j("warning",C))O1(C,"",!0)}function x0(a,N){for(var M=0;M<N.length-1;++M)N[M].push("From previous event:"),N[M]=N[M].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 C=a[M],u=N.length-1,s=N[u],m=-1;for(var e=C.length-1;e>=0;--e)if(C[e]===s){m=e;break}for(var e=m;e>=0;--e){var K0=C[e];if(N[u]===K0)N.pop(),u--;else break}N=C}}function Q0(a){var N=[];for(var M=0;M<a.length;++M){var C=a[M],u=C===" (No stack trace)"||Z.test(C),s=u&&P6(C);if(u&&!s){if(X&&C.charAt(0)!==" ")C=" "+C;N.push(C)}}return N}function R0(a){var N=a.stack.replace(/\s+$/g,"").split(`
|
||||
`);for(var M=0;M<N.length;++M){var C=N[M];if(C===" (No stack trace)"||Z.test(C))break}if(M>0&&a.name!="SyntaxError")N=N.slice(M);return N}function U1(a){var N=a.stack,M=a.toString();return N=typeof N==="string"&&N.length>0?R0(a):[" (No stack trace)"],{message:M,stack:a.name=="SyntaxError"?N:Q0(N)}}function O1(a,N,M){if(typeof console<"u"){var C;if(Q.isObject(a)){var u=a.stack;C=N+V(u,a)}else C=N+String(a);if(typeof L==="function")L(C,M);else if(typeof console.log==="function"||typeof console.log==="object")console.log(C)}}function i4(a,N,M,C){var u=!1;try{if(typeof N==="function")if(u=!0,a==="rejectionHandled")N(C);else N(M,C)}catch(s){Y.throwLater(s)}if(a==="unhandledRejection"){if(!j(a,M,C)&&!u)O1(M,"Unhandled rejection ")}else j(a,C)}function f6(a){var N;if(typeof a==="function")N="[function "+(a.name||"anonymous")+"]";else{N=a&&typeof a.toString==="function"?a.toString():Q.toString(a);var M=/\[object [a-zA-Z0-9$_]+\]/;if(M.test(N))try{var C=JSON.stringify(a);N=C}catch(u){}if(N.length===0)N="(empty array)"}return"(<"+F$(N)+">, no stack trace)"}function F$(a){var N=41;if(a.length<N)return a;return a.substr(0,N-3)+"..."}function i6(){return typeof a5==="function"}var P6=function(){return!1},N$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y$(a){var N=a.match(N$);if(N)return{fileName:N[1],line:parseInt(N[2],10)}}function E7(a,N){if(!i6())return;var M=a.stack.split(`
|
||||
`),C=N.stack.split(`
|
||||
`),u=-1,s=-1,m,e;for(var K0=0;K0<M.length;++K0){var W0=Y$(M[K0]);if(W0){m=W0.fileName,u=W0.line;break}}for(var K0=0;K0<C.length;++K0){var W0=Y$(C[K0]);if(W0){e=W0.fileName,s=W0.line;break}}if(u<0||s<0||!m||!e||m!==e||u>=s)return;P6=function(_0){if(G.test(_0))return!0;var b0=Y$(_0);if(b0){if(b0.fileName===m&&(u<=b0.line&&b0.line<=s))return!0}return!1}}function J$(a){this._parent=a,this._promisesCreated=0;var N=this._length=1+(a===void 0?0:a._length);if(a5(this,J$),N>32)this.uncycle()}Q.inherits(J$,Error),I.CapturedTrace=J$,J$.prototype.uncycle=function(){var a=this._length;if(a<2)return;var N=[],M={};for(var C=0,u=this;u!==void 0;++C)N.push(u),u=u._parent;a=this._length=C;for(var C=a-1;C>=0;--C){var s=N[C].stack;if(M[s]===void 0)M[s]=C}for(var C=0;C<a;++C){var m=N[C].stack,e=M[m];if(e!==void 0&&e!==C){if(e>0)N[e-1]._parent=void 0,N[e-1]._length=1;N[C]._parent=void 0,N[C]._length=1;var K0=C>0?N[C-1]:this;if(e<a-1)K0._parent=N[e+1],K0._parent.uncycle(),K0._length=K0._parent._length+1;else K0._parent=void 0,K0._length=1;var W0=K0._length+1;for(var _0=C-2;_0>=0;--_0)N[_0]._length=W0,W0++;return}}},J$.prototype.attachExtraTrace=function(a){if(a.__stackCleaned__)return;this.uncycle();var N=U1(a),M=N.message,C=[N.stack],u=this;while(u!==void 0)C.push(Q0(u.stack.split(`
|
||||
`))),u=u._parent;M0(C),I1(C),Q.notEnumerableProp(a,"stack",x0(M,C)),Q.notEnumerableProp(a,"__stackCleaned__",!0)};var a5=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 f6(e)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,Z=N,V=M;var C=Error.captureStackTrace;return P6=function(m){return G.test(m)},function(m,e){Error.stackTraceLimit+=6,C(m,e),Error.stackTraceLimit-=6}}var u=Error();if(typeof u.stack==="string"&&u.stack.split(`
|
||||
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,V=M,X=!0,function(e){e.stack=Error().stack};var s;try{throw Error()}catch(m){s="stack"in m}if(!("stack"in u)&&s&&typeof Error.stackTraceLimit==="number")return Z=N,V=M,function(e){Error.stackTraceLimit+=6;try{throw Error()}catch(K0){e.stack=K0.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 f6(e)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(L=function(a){console.warn(a)},Q.isNode&&process.stderr.isTTY)L=function(a,N){var M=N?"\x1B[33m":"\x1B[31m";console.warn(M+a+`\x1B[0m
|
||||
`)};else if(!Q.isNode&&typeof Error().stack==="string")L=function(a,N){console.warn("%c"+a,N?"color: darkorange":"color: red")}}var v0={warnings:O,longStackTraces:!1,cancellation:!1,monitoring:!1};if(P)$.longStackTraces();return{longStackTraces:function(){return v0.longStackTraces},warnings:function(){return v0.warnings},cancellation:function(){return v0.cancellation},monitoring:function(){return v0.monitoring},propagateFromFunction:function(){return c},boundValueFunction:function(){return r},checkForgottenReturns:A0,setBounds:E7,warn:q1,deprecated:j0,CapturedTrace:J$,fireDomEvent:R,fireGlobalEvent:x}}});var lK0=F((IC1,mK0)=>{mK0.exports=function($,I){var U=d1(),Y=$.CancellationError,J=U.errorObj;function Q(w,Z,V){this.promise=w,this.type=Z,this.handler=V,this.called=!1,this.cancelPromise=null}Q.prototype.isFinallyHandler=function(){return this.type===0};function K(w){this.finallyHandler=w}K.prototype._resultCancelled=function(){q(this.finallyHandler)};function q(w,Z){if(w.cancelPromise!=null){if(arguments.length>1)w.cancelPromise._reject(Z);else w.cancelPromise._cancel();return w.cancelPromise=null,!0}return!1}function H(){return W.call(this,this.promise._target()._settledValue())}function G(w){if(q(this,w))return;return J.e=w,J}function W(w){var Z=this.promise,V=this.handler;if(!this.called){this.called=!0;var X=this.isFinallyHandler()?V.call(Z._boundValue()):V.call(Z._boundValue(),w);if(X!==void 0){Z._setReturnedNonUndefined();var L=I(X,Z);if(L instanceof $){if(this.cancelPromise!=null){if(L._isCancelled()){var D=new Y("late cancellation observer");return Z._attachExtraTrace(D),J.e=D,J}else if(L.isPending())L._attachCancellationCallback(new K(this))}return L._then(H,G,void 0,this,void 0)}}}if(Z.isRejected())return q(this),J.e=w,J;else return q(this),w}return $.prototype._passThrough=function(w,Z,V,X){if(typeof w!=="function")return this.then();return this._then(V,X,void 0,new Q(this,Z,w),void 0)},$.prototype.lastly=$.prototype.finally=function(w){return this._passThrough(w,0,W,W)},$.prototype.tap=function(w){return this._passThrough(w,1,W)},Q}});var rK0=F((UC1,oK0)=>{oK0.exports=function($){var I=d1(),U=c3().keys,Y=I.tryCatch,J=I.errorObj;function Q(K,q,H){return function(G){var W=H._boundValue();$:for(var w=0;w<K.length;++w){var Z=K[w];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(G instanceof Z)return Y(q).call(W,G)}else if(typeof Z==="function"){var V=Y(Z).call(W,G);if(V===J)return V;else if(V)return Y(q).call(W,G)}else if(I.isObject(G)){var X=U(Z);for(var L=0;L<X.length;++L){var D=X[L];if(Z[D]!=G[D])continue $}return Y(q).call(W,G)}}return $}}return Q}});var ng=F((YC1,sK0)=>{var tK0=d1(),bI1=tK0.maybeWrapAsError,nI1=k5(),pI1=nI1.OperationalError,aK0=c3();function cI1($){return $ instanceof Error&&aK0.getPrototypeOf($)===Error.prototype}var dI1=/^(?:name|message|stack|cause)$/;function mI1($){var I;if(cI1($)){I=new pI1($),I.name=$.name,I.message=$.message,I.stack=$.stack;var U=aK0.keys($);for(var Y=0;Y<U.length;++Y){var J=U[Y];if(!dI1.test(J))I[J]=$[J]}return I}return tK0.markAsOriginatingFromRejection($),$}function lI1($,I){return function(U,Y){if($===null)return;if(U){var J=mI1(bI1(U));$._attachExtraTrace(J),$._reject(J)}else if(!I)$._fulfill(Y);else{var Q=arguments.length,K=Array(Math.max(Q-1,0));for(var q=1;q<Q;++q)K[q-1]=arguments[q];$._fulfill(K)}$=null}}sK0.exports=lI1});var $q0=F((JC1,eK0)=>{eK0.exports=function($,I,U,Y,J){var Q=d1(),K=Q.tryCatch;$.method=function(q){if(typeof q!=="function")throw new $.TypeError("expecting a function but got "+Q.classString(q));return function(){var H=new $(I);H._captureStackTrace(),H._pushContext();var G=K(q).apply(this,arguments),W=H._popContext();return J.checkForgottenReturns(G,W,"Promise.method",H),H._resolveFromSyncValue(G),H}},$.attempt=$.try=function(q){if(typeof q!=="function")return Y("expecting a function but got "+Q.classString(q));var H=new $(I);H._captureStackTrace(),H._pushContext();var G;if(arguments.length>1){J.deprecated("calling Promise.try with more than 1 argument");var W=arguments[1],w=arguments[2];G=Q.isArray(W)?K(q).apply(w,W):K(q).call(w,W)}else G=K(q)();var Z=H._popContext();return J.checkForgottenReturns(G,Z,"Promise.try",H),H._resolveFromSyncValue(G),H},$.prototype._resolveFromSyncValue=function(q){if(q===Q.errorObj)this._rejectCallback(q.e,!1);else this._resolveCallback(q,!0)}}});var Uq0=F((QC1,Iq0)=>{Iq0.exports=function($,I,U,Y){var J=!1,Q=function(G,W){this._reject(W)},K=function(G,W){W.promiseRejectionQueued=!0,W.bindingPromise._then(Q,Q,null,this,G)},q=function(G,W){if((this._bitField&50397184)===0)this._resolveCallback(W.target)},H=function(G,W){if(!W.promiseRejectionQueued)this._reject(G)};$.prototype.bind=function(G){if(!J)J=!0,$.prototype._propagateFrom=Y.propagateFromFunction(),$.prototype._boundValue=Y.boundValueFunction();var W=U(G),w=new $(I);w._propagateFrom(this,1);var Z=this._target();if(w._setBoundTo(W),W instanceof $){var V={promiseRejectionQueued:!1,promise:w,target:Z,bindingPromise:W};Z._then(I,K,voi
Line truncated
|
||||
`)}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(`
|
||||
`),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(`
|
||||
`)[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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);return this._settledValue()},Y=I.prototype.error=I.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
|
||||
`);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()},J=I.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Q=I.prototype.isRejected=function(){return(this._bitField&16777216)!==0},K=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 K.call(this._target())},$.prototype.isRejected=function(){return Q.call(this._target())},$.prototype.isFulfilled=function(){return J.call(this._target())},$.prototype.isResolved=function(){return q.call(this._target())},$.prototype.value=function(){return U.call(this._target())},$.prototype.reason=function(){var H=this._target();return H._unsetRejectionIsUnhandled(),Y.call(H)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=I}});var Wq0=F((GC1,Gq0)=>{Gq0.exports=function($,I,U,Y,J,Q){var K=d1(),q=K.canEvaluate,H=K.tryCatch,G=K.errorObj,W;if(q){var w=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 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",`
|
||||
'use strict';
|
||||
holder.pIndex = value;
|
||||
holder.checkFulfillment(this);
|
||||
`.replace(/Index/g,P))},Z=function(P){return Function("promise","holder",`
|
||||
`.replace(/Index/g,P))},W=function(P){return Function("promise","holder",`
|
||||
'use strict';
|
||||
holder.pIndex = promise;
|
||||
`.replace(/Index/g,P))},V=function(P){var T=Array(P);for(var A=0;A<T.length;++A)T[A]="this.p"+(A+1);var R=T.join(" = ")+" = null;",x=`var promise;
|
||||
`.replace(/Index/g,P))},V=function(P){var T=Array(P);for(var A=0;A<T.length;++A)T[A]="this.p"+(A+1);var g=T.join(" = ")+" = null;",k=`var promise;
|
||||
`+T.map(function(p){return`
|
||||
promise = `+p+`;
|
||||
if (promise instanceof Promise) {
|
||||
promise.cancel();
|
||||
}
|
||||
`}).join(`
|
||||
`),y=T.join(", "),f="Holder$"+P,j=`return function(tryCatch, errorObj, Promise, async) {
|
||||
`),S=T.join(", "),f="Holder$"+P,v=`return function(tryCatch, errorObj, Promise, async) {
|
||||
'use strict';
|
||||
function [TheName](fn) {
|
||||
[TheProperties]
|
||||
@@ -129,7 +129,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof u4))r
|
||||
|
||||
return [TheName];
|
||||
}(tryCatch, errorObj, Promise, async);
|
||||
`;return j=j.replace(/\[TheName\]/g,f).replace(/\[TheTotal\]/g,P).replace(/\[ThePassedArguments\]/g,y).replace(/\[TheProperties\]/g,R).replace(/\[CancellationCode\]/g,x),Function("tryCatch","errorObj","Promise","async",j)(H,G,$,J)},X=[],L=[],D=[];for(var O=0;O<8;++O)X.push(V(O+1)),L.push(w(O+1)),D.push(Z(O+1));W=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 $(Y);b._captureStackTrace();var A=X[P-1],R=new A(T),x=L;for(var y=0;y<P;++y){var f=U(arguments[y],b);if(f instanceof $){f=f._target();var j=f._bitField;if((j&50397184)===0)f._then(x[y],W,void 0,b,R),D[y](f,R),R.asyncNeeded=!1;else if((j&33554432)!==0)x[y].call(b,f._value(),R);else if((j&16777216)!==0)b._reject(f._reason());else b._cancel()}else x[y].call(b,f,R)}if(!b._isFateSealed()){if(R.asyncNeeded){var p=Q();if(p!==null)R.fn=K.domainBind(p,R.fn)}b._setAsyncGuaranteed(),b._setOnCancel(R)}return b}}var n=arguments.length,g=Array(n);for(var i=0;i<n;++i)g[i]=arguments[i];if(T)g.pop();var b=new I(g).promise();return T!==void 0?b.spread(T):b}}});var Vq0=F((WC1,wq0)=>{wq0.exports=function($,I,U,Y,J,Q){var K=$._getDomain,q=d1(),H=q.tryCatch,G=q.errorObj,W=$._async;function w(V,X,L,D){this.constructor$(V),this._promise._captureStackTrace();var O=K();this._callback=O===null?X:q.domainBind(O,X),this._preservedValues=D===J?Array(this.length()):null,this._limit=L,this._inFlight=0,this._queue=[],W.invoke(this._asyncInit,this,void 0)}q.inherits(w,I),w.prototype._asyncInit=function(){this._init$(void 0,-2)},w.prototype._init=function(){},w.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,R=T._boundValue();T._pushContext();var x=H(A).call(R,V,X,D),y=T._popContext();if(Q.checkForgottenReturns(x,y,O!==null?"Promise.filter":"Promise.map",T),x===G)return this._reject(x.e),!0;var f=Y(x,this._promise);if(f instanceof $){f=f._target();var j=f._bitField;if((j&50397184)===0){if(P>=1)this._inFlight++;return L[X]=f,f._proxy(this,(X+1)*-1),!1}else if((j&33554432)!==0)x=f._value();else if((j&16777216)!==0)return this._reject(f._reason()),!0;else return this._cancel(),!0}L[X]=x}var p=++this._totalResolved;if(p>=D){if(O!==null)this._filter(L,O);else this._resolve(L);return!0}return!1},w.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)}},w.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)},w.prototype.preservedValues=function(){return this._preservedValues};function Z(V,X,L,D){if(typeof X!=="function")return U("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 w(V,X,O,D).promise()}$.prototype.map=function(V,X){return Z(this,V,X,null)},$.map=function(V,X,L,D){return Z(V,X,L,D)}}});var zq0=F((wC1,Zq0)=>{var pg=Object.create;if(pg)aX=pg(null),sX=pg(null),aX[" size"]=sX[" size"]=0;var aX,sX;Zq0.exports=function($){var I=d1(),U=I.canEvaluate,Y=I.isIdentifier,J,Q,K=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 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 function(obj) {
|
||||
'use strict'
|
||||
var len = this.length;
|
||||
@@ -143,29 +143,29 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof u4))r
|
||||
return obj.methodName.apply(obj, this);
|
||||
}
|
||||
};
|
||||
`.replace(/methodName/g,V))(G)},q=function(V){return Function("obj",`
|
||||
`.replace(/methodName/g,V))(K)},Q=function(V){return Function("obj",`
|
||||
'use strict';
|
||||
return obj.propertyName;
|
||||
`.replace("propertyName",V))},H=function(V,X,L){var D=L[V];if(typeof D!=="function"){if(!Y(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};J=function(V){return H(V,K,aX)},Q=function(V){return H(V,q,sX)};function G(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 W(V){var X=this.pop(),L=G(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(U){var O=J(V);if(O!==null)return this._then(O,void 0,void 0,L,void 0)}return L.push(V),this._then(W,void 0,void 0,L,void 0)};function w(V){return V[this]}function Z(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(U){var D=Q(V);L=D!==null?D:w}else L=w;else L=Z;return this._then(L,void 0,void 0,V,void 0)}}});var Lq0=F((VC1,Xq0)=>{Xq0.exports=function($,I,U,Y,J,Q){var K=d1(),q=k5().TypeError,H=d1().inherits,G=K.errorObj,W=K.tryCatch,w={};function Z(T){setTimeout(function(){throw T},0)}function V(T){var A=U(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 R=0,x=T.length,y=new $(J);function f(){if(R>=x)return y._fulfill();var j=V(T[R++]);if(j instanceof $&&j._isDisposable()){try{j=U(j._getDisposer().tryDispose(A),T.promise)}catch(p){return Z(p)}if(j instanceof $)return j._then(f,Z,null,null,null)}f()}return f(),y}function L(T,A,R){this._data=T,this._promise=A,this._context=R}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 w},L.prototype.tryDispose=function(T){var A=this.resource(),R=this._context;if(R!==void 0)R._pushContext();var x=A!==w?this.doDispose(A,T):null;if(R!==void 0)R._popContext();return this._promise._unsetDisposable(),this._data=null,x},L.isDisposer=function(T){return T!=null&&typeof T.resource==="function"&&typeof T.tryDispose==="function"};function D(T,A,R){this.constructor$(T,A,R)}H(D,L),D.prototype.doDispose=function(T,A){var R=this.data();return R.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 R=this[A];if(R instanceof $)R.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 "+K.classString(A));var R,x=!0;if(T===2&&Array.isArray(arguments[0]))R=arguments[0],T=R.length,x=!1;else R=arguments,T--;var y=new P(T);for(var f=0;f<T;++f){var j=R[f];if(L.isDisposer(j)){var p=j;j=j.promise(),j._setDisposable(p)}else{var n=U(j);if(n instanceof $)j=n._then(O,null,null,{resources:y,index:f},void 0)}y[f]=j}var g=Array(y.length);for(var f=0;f<g.length;++f)g[f]=$.resolve(y[f]).reflect();var i=$.all(g).then(function(U0){for(var B=0;B<U0.length;++B){var k=U0[B];if(k.isRejected())return G.e=k.error(),G;else if(!k.isFulfilled()){i.cancel();return}U0[B]=k.value()}b._pushContext(),A=W(A);var c=x?A.apply(void 0,U0):A(U0),r=b._popContext();return Q.checkForgottenReturns(c,r,"Promise.using",b),c}),b=i.lastly(function(){var U0=new $.PromiseInspection(i);return X(y,U0)});return y.promise=b,b._setOnCancel(y),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,Y());throw new q}}});var Oq0=F((ZC1,Dq0)=>{Dq0.exports=function($,I,U){var Y=d1(),J=$.TimeoutError;function Q(w){this.handle=w}Q.prototype._resultCancelled=function(){clearTimeout(this.handle)};var K=function(w){return q(+this).thenReturn(w)},q=$.delay=function(w,Z){var V,X;if(Z!==void 0){if(V=$.resolve(Z)._then(K,null,null,w,void 0),U.cancellation()&&Z instanceof $)V._setOnCancel(Z)}else{if(V=new $(I),X=setTimeout(function(){V._fulfill()},+w),U.cancellation())V._setOnCancel(new Q(X));V._captureStackTrace()}return V._setAsyncGuaranteed(),V};$.prototype.delay=function(w){return q(w,this)};var H=function(w,Z,V){var X;if(typeof Z!=="string")if(Z instanceof Error)X=Z;else X=new J("operation timed out");else X=new J(Z);if(Y.markAsOriginatingFromRejection(X),w._attachExtraTrace(X),w._reject(X),V!=null)V.cancel()};function G(w){return clearTimeout(this.handle),w}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 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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
|
||||
`.replace("%s",D)+`From coroutine:
|
||||
`+this._stack.split(`
|
||||
`).slice(1,-7).join(`
|
||||
`)));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
|
||||
`)));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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);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),R=A.promise();return A._generator=T,A._promiseFulfilled(void 0),R}},$.coroutine.addYieldHandler=function(X){if(typeof X!=="function")throw new q("expecting a function but got "+H.classString(X));w.push(X)},$.spawn=function(X){if(Q.deprecated("Promise.spawn()","Promise.coroutine()"),typeof X!=="function")return I(`generatorFunction must be a function
|
||||
`);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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var L=new V(X,this),D=L.promise();return L._run($.spawn),D}}});var Aq0=F((XC1,Mq0)=>{Mq0.exports=function($){var I=d1(),U=$._async,Y=I.tryCatch,J=I.errorObj;function Q(H,G){var W=this;if(!I.isArray(H))return K.call(W,H,G);var w=Y(G).apply(W._boundValue(),[null].concat(H));if(w===J)U.throwLater(w.e)}function K(H,G){var W=this,w=W._boundValue(),Z=H===void 0?Y(G).call(w,null):Y(G).call(w,null,H);if(Z===J)U.throwLater(Z.e)}function q(H,G){var W=this;if(!H){var w=Error(H+"");w.cause=H,H=w}var Z=Y(G).call(W._boundValue(),H);if(Z===J)U.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(H,G){if(typeof H=="function"){var W=K;if(G!==void 0&&Object(G).spread)W=Q;this._then(W,q,void 0,this,H)}return this}}});var Tq0=F((LC1,Pq0)=>{Pq0.exports=function($,I){var U={},Y=d1(),J=ng(),Q=Y.withAppended,K=Y.maybeWrapAsError,q=Y.canEvaluate,H=k5().TypeError,G="Async",W={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+w.join("|")+")$"),V=function(i){return Y.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function X(i){return!Z.test(i)}function L(i){try{return i.__isPromisified__===!0}catch(b){return!1}}function D(i,b,U0){var B=Y.getDataPropertyOrDefault(i,b+U0,W);return B?L(B):!1}function O(i,b,U0){for(var B=0;B<i.length;B+=2){var k=i[B];if(U0.test(k)){var c=k.replace(U0,"");for(var r=0;r<i.length;r+=2)if(i[r]===c)throw new H(`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 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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`.replace("%s",b))}}}function P(i,b,U0,B){var k=Y.inheritedDataKeys(i),c=[];for(var r=0;r<k.length;++r){var J0=k[r],w0=i[J0],A0=B===V?!0:V(J0,w0,i);if(typeof w0==="function"&&!L(w0)&&!D(i,J0,b)&&B(J0,w0,i,A0))c.push(J0,w0)}return O(c,b,U0),c}var T=function(i){return i.replace(/([$])/,"\\$")},A,R=function(i){var b=[i],U0=Math.max(0,i-1-3);for(var B=i-1;B>=U0;--B)b.push(B);for(var B=i+1;B<=3;++B)b.push(B);return b},x=function(i){return Y.filledRange(i,"_arg","")},y=function(i){return Y.filledRange(Math.max(i,3),"_arg","")},f=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};A=function(i,b,U0,B,k,c){var r=Math.max(0,f(B)-1),J0=R(r),w0=typeof i==="string"||b===U;function A0(I1){var M0=x(I1).join(", "),Q0=I1>0?", ":"",R0;if(w0)R0=`ret = callback.call(this, {{args}}, nodeback); break;
|
||||
`;else R0=b===void 0?`ret = callback({{args}}, nodeback); break;
|
||||
`.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;
|
||||
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
|
||||
`;return R0.replace("{{args}}",M0).replace(", ",Q0)}function j0(){var I1="";for(var M0=0;M0<J0.length;++M0)I1+="case "+J0[M0]+":"+A0(J0[M0]);return I1+=`
|
||||
`;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+=`
|
||||
default:
|
||||
var args = new Array(len + 1);
|
||||
var i = 0;
|
||||
@@ -175,9 +175,9 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof u4))r
|
||||
args[i] = nodeback;
|
||||
[CodeForCall]
|
||||
break;
|
||||
`.replace("[CodeForCall]",w0?`ret = callback.apply(this, args);
|
||||
`.replace("[CodeForCall]",G0?`ret = callback.apply(this, args);
|
||||
`:`ret = callback.apply(receiver, args);
|
||||
`),I1}var q1=typeof i==="string"?"this != null ? this['"+i+"'] : fn":"fn",x0=`'use strict';
|
||||
`),I1}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 u4))r
|
||||
};
|
||||
notEnumerableProp(ret, '__isPromisified__', true);
|
||||
return ret;
|
||||
`.replace("[CodeForSwitchCase]",j0()).replace("[GetFunctionCode]",q1);return x0=x0.replace("Parameters",y(r)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",x0)($,B,b,Q,K,J,Y.tryCatch,Y.errorObj,Y.notEnumerableProp,I)};function j(i,b,U0,B,k,c){var r=function(){return this}(),J0=i;if(typeof J0==="string")i=B;function w0(){var A0=b;if(b===U)A0=this;var j0=new $(I);j0._captureStackTrace();var q1=typeof J0==="string"&&this!==r?this[J0]:i,x0=J(j0,c);try{q1.apply(A0,Q(arguments,x0))}catch(I1){j0._rejectCallback(K(I1),!0,!0)}if(!j0._isFateSealed())j0._setAsyncGuaranteed();return j0}return Y.notEnumerableProp(w0,"__isPromisified__",!0),w0}var p=q?A:j;function n(i,b,U0,B,k){var c=new RegExp(T(b)+"$"),r=P(i,b,c,U0);for(var J0=0,w0=r.length;J0<w0;J0+=2){var A0=r[J0],j0=r[J0+1],q1=A0+b;if(B===p)i[q1]=p(A0,U,A0,j0,b,k);else{var x0=B(j0,function(){return p(A0,U,A0,j0,b,k)});Y.notEnumerableProp(x0,"__isPromisified__",!0),i[q1]=x0}}return Y.toFastProperties(i),i}function g(i,b,U0){return p(i,b,void 0,i,null,U0)}$.promisify=function(i,b){if(typeof i!=="function")throw new H("expecting a function but got "+Y.classString(i));if(L(i))return i;b=Object(b);var U0=b.context===void 0?U:b.context,B=!!b.multiArgs,k=g(i,U0,B);return Y.copyDescriptors(i,k,X),k},$.promisifyAll=function(i,b){if(typeof i!=="function"&&typeof i!=="object")throw new H(`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)($,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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);b=Object(b);var U0=!!b.multiArgs,B=b.suffix;if(typeof B!=="string")B=G;var k=b.filter;if(typeof k!=="function")k=V;var c=b.promisifier;if(typeof c!=="function")c=p;if(!Y.isIdentifier(B))throw RangeError(`suffix must be a valid identifier
|
||||
`);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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var r=Y.inheritedDataKeys(i);for(var J0=0;J0<r.length;++J0){var w0=i[r[J0]];if(r[J0]!=="constructor"&&Y.isClass(w0))n(w0.prototype,B,k,c,U0),n(w0,B,k,c,U0)}return n(i,B,k,c,U0)}}});var Bq0=F((DC1,Eq0)=>{Eq0.exports=function($,I,U,Y){var J=d1(),Q=J.isObject,K=c3(),q;if(typeof Map==="function")q=Map;var H=function(){var Z=0,V=0;function X(L,D){this[Z]=L,this[Z+V]=D,Z++}return function(D){V=D.size,Z=0;var O=Array(D.size*2);return D.forEach(X,O),O}}(),G=function(Z){var V=new q,X=Z.length/2|0;for(var L=0;L<X;++L){var D=Z[X+L],O=Z[L];V.set(D,O)}return V};function W(Z){var V=!1,X;if(q!==void 0&&Z instanceof q)X=H(Z),V=!0;else{var L=K.keys(Z),D=L.length;X=Array(D*2);for(var O=0;O<D;++O){var P=L[O];X[O]=Z[P],X[O+D]=P}}this.constructor$(X),this._isMap=V,this._init$(void 0,-3)}J.inherits(W,I),W.prototype._init=function(){},W.prototype._promiseFulfilled=function(Z,V){this._values[V]=Z;var X=++this._totalResolved;if(X>=this._length){var L;if(this._isMap)L=G(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},W.prototype.shouldCopyValues=function(){return!1},W.prototype.getActualLength=function(Z){return Z>>1};function w(Z){var V,X=U(Z);if(!Q(X))return Y(`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))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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);else if(X instanceof $)V=X._then($.props,void 0,void 0,void 0,void 0);else V=new W(X).promise();if(X instanceof $)V._propagateFrom(X,2);return V}$.prototype.props=function(){return w(this)},$.props=function(Z){return w(Z)}}});var Rq0=F((OC1,vq0)=>{vq0.exports=function($,I,U,Y){var J=d1(),Q=function(q){return q.then(function(H){return K(H,q)})};function K(q,H){var G=U(q);if(G instanceof $)return Q(G);else if(q=J.asArray(q),q===null)return Y("expecting an array or an iterable object but got "+J.classString(q));var W=new $(I);if(H!==void 0)W._propagateFrom(H,3);var{_fulfill:w,_reject:Z}=W;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(w,Z,void 0,W,null)}return W}$.race=function(q){return K(q,void 0)},$.prototype.race=function(){return K(this,void 0)}}});var Cq0=F((FC1,jq0)=>{jq0.exports=function($,I,U,Y,J,Q){var K=$._getDomain,q=d1(),H=q.tryCatch;function G(X,L,D,O){this.constructor$(X);var P=K();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===J)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(G,I),G.prototype._gotAccum=function(X){if(this._eachValues!==void 0&&this._eachValues!==null&&X!==J)this._eachValues.push(X)},G.prototype._eachComplete=function(X){if(this._eachValues!==null)this._eachValues.push(X);return this._eachValues},G.prototype._init=function(){},G.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},G.prototype.shouldCopyValues=function(){return!1},G.prototype._resolve=function(X){this._promise._resolveCallback(X),this._values=null},G.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()},G.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(Z,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(W,W,void 0,L,this)},$.prototype.reduce=function(X,L){return w(this,X,L,null)},$.reduce=function(X,L,D,O){return w(X,L,D,O)};function W(X,L){if(this.isFulfilled())L._resolve(X);else L._reject(X)}function w(X,L,D,O){if(typeof L!=="function")return U("expecting a function but got "+q.classString(L));var P=new G(X,L,D,O);return P.promise()}function Z(X){this.accum=X,this.array._gotAccum(X);var L=Y(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=H(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 Q.checkForgottenReturns(P,T,L._eachValues!==void 0?"Promise.each":"Promise.reduce",D),P}}});var Sq0=F((NC1,_q0)=>{_q0.exports=function($,I,U){var Y=$.PromiseInspection,J=d1();function Q(K){this.constructor$(K)}J.inherits(Q,I),Q.prototype._promiseResolved=function(K,q){this._values[K]=q;var H=++this._totalResolved;if(H>=this._length)return this._resolve(this._values),!0;return!1},Q.prototype._promiseFulfilled=function(K,q){var H=new Y;return H._bitField=33554432,H._settledValueField=K,this._promiseResolved(q,H)},Q.prototype._promiseRejected=function(K,q){var H=new Y;return H._bitField=16777216,H._settledValueField=K,this._promiseResolved(q,H)},$.settle=function(K){return U.deprecated(".settle()",".reflect()"),new Q(K).promise()},$.prototype.settle=function(){return $.settle(this)}}});var yq0=F((MC1,gq0)=>{gq0.exports=function($,I,U){var Y=d1(),J=k5().RangeError,Q=k5().AggregateError,K=Y.isArray,q={};function H(W){this.constructor$(W),this._howMany=0,this._unwrap=!1,this._initialized=!1}Y.inherits(H,I),H.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var W=K(this._values);if(!this._isResolved()&&W&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},H.prototype.init=function(){this._initialized=!0,this._init()},H.prototype.setUnwrap=function(){this._unwrap=!0},H.prototype.howMany=function(){return this._howMany},H.prototype.setHowMany=function(W){this._howMany=W},H.prototype._promiseFulfilled=function(W){if(this._addFulfilled(W),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 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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var Z=new H(W),V=Z.promise();return Z.setHowMany(w),Z.init(),V}$.some=function(W,w){return G(W,w)},$.prototype.some=function(W){return G(this,W)},$._SomePromiseArray=H}});var uq0=F((AC1,hq0)=>{hq0.exports=function($,I){var U=$.map;$.prototype.filter=function(Y,J){return U(this,Y,J,I)},$.filter=function(Y,J,Q){return U(Y,J,Q,I)}}});var xq0=F((PC1,kq0)=>{kq0.exports=function($,I){var{reduce:U,all:Y}=$;function J(){return Y(this)}function Q(K,q){return U(K,q,I,I)}$.prototype.each=function(K){return U(this,K,I,0)._then(J,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(K){return U(this,K,I,I)},$.each=function(K,q){return U(K,q,I,0)._then(J,void 0,void 0,K,void 0)},$.mapSeries=Q}});var iq0=F((TC1,fq0)=>{fq0.exports=function($){var I=$._SomePromiseArray;function U(Y){var J=new I(Y),Q=J.promise();return J.setHowMany(1),J.setUnwrap(),J.init(),Q}$.any=function(Y){return U(Y)},$.prototype.any=function(){return U(this)}}});var bq0=F((EC1,cg)=>{cg.exports=function(){var $=function(){return new w(`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 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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)},I=function(){return new g.PromiseInspection(this._target())},U=function(B){return g.reject(new w(B))};function Y(){}var J={},Q=d1(),K;if(Q.isNode)K=function(){var B=process.domain;if(B===void 0)B=null;return B};else K=function(){return null};Q.notEnumerableProp(g,"_getDomain",K);var q=c3(),H=yK0(),G=new H;q.defineProperty(g,"_async",{value:G});var W=k5(),w=g.TypeError=W.TypeError;g.RangeError=W.RangeError;var Z=g.CancellationError=W.CancellationError;g.TimeoutError=W.TimeoutError,g.OperationalError=W.OperationalError,g.RejectionError=W.OperationalError,g.AggregateError=W.AggregateError;var V=function(){},X={},L={},D=fK0()(g,V),O=bK0()(g,V,D,U,Y),P=pK0()(g),T=P.create,A=dK0()(g,P),R=A.CapturedTrace,x=lK0()(g,D),y=rK0()(L),f=ng(),j=Q.errorObj,p=Q.tryCatch;function n(B,k){if(typeof k!=="function")throw new w("expecting a function but got "+Q.classString(k));if(B.constructor!==g)throw new w(`the promise constructor cannot be invoked directly
|
||||
`)},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
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)}function g(B){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,B!==V)n(this,B),this._resolveFromExecutor(B);this._promiseCreated(),this._fireEvent("promiseCreated",this)}g.prototype.toString=function(){return"[object Promise]"},g.prototype.caught=g.prototype.catch=function(B){var k=arguments.length;if(k>1){var c=Array(k-1),r=0,J0;for(J0=0;J0<k-1;++J0){var w0=arguments[J0];if(Q.isObject(w0))c[r++]=w0;else return U("expecting an object but got A catch statement predicate "+Q.classString(w0))}return c.length=r,B=arguments[J0],this.then(void 0,y(c,B,this))}return this.then(void 0,B)},g.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},g.prototype.then=function(B,k){if(A.warnings()&&arguments.length>0&&typeof B!=="function"&&typeof k!=="function"){var c=".then() only accepts functions but was passed: "+Q.classString(B);if(arguments.length>1)c+=", "+Q.classString(k);this._warn(c)}return this._then(B,k,void 0,void 0,void 0)},g.prototype.done=function(B,k){var c=this._then(B,k,void 0,void 0,void 0);c._setIsFinal()},g.prototype.spread=function(B){if(typeof B!=="function")return U("expecting a function but got "+Q.classString(B));return this.all()._then(B,void 0,void 0,X,void 0)},g.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},g.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new O(this).promise()},g.prototype.error=function(B){return this.caught(Q.originatesFromRejection,B)},g.getNewLibraryCopy=cg.exports,g.is=function(B){return B instanceof g},g.fromNode=g.fromCallback=function(B){var k=new g(V);k._captureStackTrace();var c=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=p(B)(f(k,c));if(r===j)k._rejectCallback(r.e,!0);if(!k._isFateSealed())k._setAsyncGuaranteed();return k},g.all=function(B){return new O(B).promise()},g.cast=function(B){var k=D(B);if(!(k instanceof g))k=new g(V),k._captureStackTrace(),k._setFulfilled(),k._rejectionHandler0=B;return k},g.resolve=g.fulfilled=g.cast,g.reject=g.rejected=function(B){var k=new g(V);return k._captureStackTrace(),k._rejectCallback(B,!0),k},g.setScheduler=function(B){if(typeof B!=="function")throw new w("expecting a function but got "+Q.classString(B));return G.setScheduler(B)},g.prototype._then=function(B,k,c,r,J0){var w0=J0!==void 0,A0=w0?J0:new g(V),j0=this._target(),q1=j0._bitField;if(!w0){if(A0._propagateFrom(this,3),A0._captureStackTrace(),r===void 0&&(this._bitField&2097152)!==0)if((q1&50397184)!==0)r=this._boundValue();else r=j0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,A0)}var x0=K();if((q1&50397184)!==0){var I1,M0,Q0=j0._settlePromiseCtx;if((q1&33554432)!==0)M0=j0._rejectionHandler0,I1=B;else if((q1&16777216)!==0)M0=j0._fulfillmentHandler0,I1=k,j0._unsetRejectionIsUnhandled();else Q0=j0._settlePromiseLateCancellationObserver,M0=new Z("late cancellation observer"),j0._attachExtraTrace(M0),I1=k;G.invoke(Q0,j0,{handler:x0===null?I1:typeof I1==="function"&&Q.domainBind(x0,I1),promise:A0,receiver:r,value:M0})}else j0._addCallbacks(B,k,A0,r,x0);return A0},g.prototype._length=function(){return this._bitField&65535},g.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},g.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},g.prototype._setLength=function(B){this._bitField=this._bitField&-65536|B&65535},g.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},g.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},g.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},g.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},g.prototype._isFinal=function(){return(this._bitField&4194304)>0},g.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},g.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},g.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},g.prototype._setAsyncGuaranteed=function(){if(G.hasCustomScheduler())return;this._bitField=this._bitField|134217728},g.prototype._receiverAt=function(B){var k=B===0?this._receiver0:this[B*4-4+3];if(k===J)return;else if(k===void 0&&this._isBound())return this._boundValue();return k},g.prototype._promiseAt=function(B){return this[B*4-4+2]},g.prototype._fulfillmentHandlerAt=function(B){return this[B*4-4+0]},g.prototype._rejectionHandlerAt=function(B){return this[B*4-4+1]},g.prototype._boundValue=function(){},g.prototype._migrateCallback0=function(B){var{_bit
Line truncated
|
||||
`)}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
|
||||
path = %s
|
||||
syscall = %s
|
||||
fstream_type = %s
|
||||
@@ -224,50 +224,50 @@ fstream_unc_path = %s
|
||||
fstream_class = %s
|
||||
fstream_stack =
|
||||
%s
|
||||
`,I||"UNKNOWN",Y.stack,Y.path,Y.syscall,Y.fstream_type,Y.fstream_path,Y.fstream_unc_path,Y.fstream_class,Y.fstream_stack.join(`
|
||||
`));else U.emit("warn",Y)};Z7.prototype.info=function($,I){this.emit("info",$,I)};Z7.prototype.error=function($,I,U){var Y=NG0($,I,this);if(U)throw Y;else this.emit("error",Y)};function NG0($,I,U){if(!($ instanceof Error))$=Error($);if($.code=$.code||I,$.path=$.path||U.path,$.fstream_type=$.fstream_type||U.type,$.fstream_path=$.fstream_path||U.path,U._path!==U.path)$.fstream_unc_path=$.fstream_unc_path||U._path;if(U.linkpath)$.fstream_linkpath=$.fstream_linkpath||U.linkpath;return $.fstream_class=$.fstream_class||U.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(Y){return Y.replace(/^ {4}at /,"")}),$}});var lq=F((I_1,AG0)=>{AG0.exports=BJ1;function BJ1($){var I=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],U;if($.type&&I.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var Y=0,J=I.length;Y<J;Y++){U=I[Y];var Q=$[U]||$["is"+U];if(typeof Q==="function")Q=Q.call($);if(Q)return $[U]=!0,$.type=U,U}return null}});var Cy=F((U_1,PG0)=>{PG0.exports=oq;var vJ1=s6(),RJ1=d0(),jy=e3();RJ1(oq,jy);function oq($){var I=this;if(!(I instanceof oq))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);jy.call(I,$)}oq.prototype._stat=function($){var I=this;vJ1.readlink(I._path,function(U,Y){if(U)return I.error(U);I.linkpath=I.props.linkpath=Y,I.emit("linkpath",Y),jy.prototype._stat.call(I,$)})};oq.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Sy=F((Y_1,BG0)=>{BG0.exports=d8;var EG0=s6(),jJ1=d0(),rq=t("path"),_y=e3(),TG0=t("assert").ok;jJ1(d8,_y);function d8($){var I=this;if(!(I instanceof d8))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;_y.call(this,$)}d8.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,EG0.readdir($._path,function(I,U){if(I)return $.error(I);if($.entries=U,$.emit("entries",U),$._paused)$.once("resume",Y);else Y();function Y(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};d8.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=rq.resolve($._path,$.entries[$._index]);TG0(I!==$._path),TG0($.entries[$._index]),$._currentEntry=I,EG0[$.props.follow?"stat":"lstat"](I,function(U,Y){if(U)return $.error(U);var J=$._proxy||$;Y.path=I,Y.basename=rq.basename(I),Y.dirname=rq.dirname(I);var Q=$.getChildProps.call(J,Y);Q.path=I,Q.basename=rq.basename(I),Q.dirname=rq.dirname(I);var K=_y(Q,Y);$._currentEntry=K,K.on("pause",function(G){if(!$._paused&&!K._disowned)$.pause(G)}),K.on("resume",function(G){if($._paused&&!K._disowned)$.resume(G)}),K.on("stat",function(G){if($.emit("_entryStat",K,G),K._aborted)return;if(K._paused)K.once("resume",function(){$.emit("entryStat",K,G)});else $.emit("entryStat",K,G)}),K.on("ready",function G(){if($._paused)return K.pause($),$.once("resume",G);if(K.type==="Socket")$.emit("socket",K);else $.emitEntry(K)});var q=!1;K.on("close",H),K.on("disown",H);function H(){if(q)return;if(q=!0,$.emit("childEnd",K),$.emit("entryEnd",K),$._currentEntry=null,!$._paused)$._read()}K.on("error",function(G){if(K._swallowErrors)$.warn(G),K.emit("end"),K.emit("close");else $.emit("error",G)}),["child","childEnd","warn"].forEach(function(G){K.on(G,$.emit.bind($,G))})})};d8.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};d8.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}};d8.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",$)};d8.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()};d8.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var gy=F((J_1,CG0)=>{CG0.exports=$I;var CJ1=s6(),_J1=d0(),vG0=e3(),RG0={EOF:!0},jG0={CLOSE:!0};_J1($I,vG0);function $I($){var I=this;if(!(I instanceof $I))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);I._buffer=[],I._bytesEmitted=0,vG0.call(I,$)}$I.prototype._getStream=function(){var $=this,I=$._stream=CJ1.createReadStream($._path,$.pro
Line truncated
|
||||
`,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
|
||||
expect: `+$.props.size+`
|
||||
actual: `+$._bytesEmitted)}),I.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(jG0),$._read();else $.emit("close")}),I.on("error",function(U){$.emit("error",U)}),$._read()};$I.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var I=$._buffer;for(var U=0,Y=I.length;U<Y;U++){var J=I[U];if(J===RG0)$.emit("end");else if(J===jG0)$.emit("close");else $.emit("data",J);if($._paused){$._buffer=I.slice(U);return}}$._buffer.length=0}};$I.prototype.pause=function($){var I=this;if(I._paused)return;if($=$||I,I._paused=!0,I._stream)I._stream.pause();I.emit("pause",$)};$I.prototype.resume=function($){var I=this;if(!I._paused)return;if($=$||I,I.emit("resume",$),I._paused=!1,I._stream)I._stream.resume();I._read()}});var gG0=F((Q_1,SG0)=>{SG0.exports=TL;var SJ1=d0(),_G0=e3();SJ1(TL,_G0);function TL($){var I=this;if(!(I instanceof TL))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);_G0.call(I,$)}TL.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var hy=F((K_1,yG0)=>{yG0.exports=II;var yy=e3(),gJ1=lq(),yJ1=d0(),hJ1=s6();yJ1(II,yy);function II($){var I=this;if(!(I instanceof II))throw Error("ProxyReader must be called as constructor.");I.props=$,I._buffer=[],I.ready=!1,yy.call(I,$)}II.prototype._stat=function(){var $=this,I=$.props,U=I.follow?"stat":"lstat";hJ1[U](I.path,function(Y,J){var Q;if(Y||!J)Q="File";else Q=gJ1(J);I[Q]=!0,I.type=$.type=Q,$._old=J,$._addProxy(yy(I,J))})};II.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(Y){$.on(Y,I.emit.bind(I,Y))}),I.emit("proxy",$),$.on("ready",function(){I.ready=!0,I.emit("ready")});var U=I._buffer;I._buffer.length=0,U.forEach(function(Y){$[Y[0]].apply($,Y[1])})};II.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};II.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var e3=F((q_1,kG0)=>{kG0.exports=V8;var uJ1=s6(),kJ1=t("stream").Stream,xJ1=d0(),uy=t("path"),ky=lq(),EL=V8.hardLinks={},hG0=PL();xJ1(V8,hG0);var uG0=Cy();function V8($,I){var U=this;if(!(U instanceof V8))return new V8($,I);if(typeof $==="string")$={path:$};var Y,J;if($.type&&typeof $.type==="function")Y=$.type,J=Y;else Y=ky($),J=V8;if(I&&!Y)Y=ky(I),$[Y]=!0,$.type=Y;switch(Y){case"Directory":J=Sy();break;case"Link":case"File":J=gy();break;case"SymbolicLink":J=uG0;break;case"Socket":J=gG0();break;case null:J=hy();break}if(!(U instanceof J))return new J($);if(hG0.call(U),!$.path)U.error("Must provide a path",null,!0);if(U.readable=!0,U.writable=!1,U.type=Y,U.props=$,U.depth=$.depth=$.depth||0,U.parent=$.parent||null,U.root=$.root||$.parent&&$.parent.root||U,U._path=U.path=uy.resolve($.path),process.platform==="win32"){if(U.path=U._path=U.path.replace(/\?/g,"_"),U._path.length>=260)U._swallowErrors=!0,U._path="\\\\?\\"+U.path.replace(/\//g,"\\")}if(U.basename=$.basename=uy.basename(U.path),U.dirname=$.dirname=uy.dirname(U.path),$.parent=$.root=null,U.size=$.size,U.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=fJ1;U._stat(I)}function fJ1($,I){return $===I?0:$.toLowerCase()>I.toLowerCase()?1:$.toLowerCase()<I.toLowerCase()?-1:$>I?1:-1}V8.prototype._stat=function($){var I=this,U=I.props,Y=U.follow?"stat":"lstat";if($)process.nextTick(J.bind(null,null,$));else uJ1[Y](I._path,J);function J(Q,K){if(Q)return I.error(Q);if(Object.keys(K).forEach(function(V){U[V]=K[V]}),I.size!==void 0&&U.size!==I.size)return I.error("incorrect size");I.size=U.size;var q=ky(U),H=U.hardlinks!==!1;if(H&&q!=="Directory"&&U.nlink&&U.nlink>1){var G=U.dev+":"+U.ino;if(EL[G]===I._path||!EL[G])EL[G]=I._path;else q=I.type=I.props.type="Link",I.Link=I.props.Link=!0,I.linkpath=I.props.linkpath=EL[G],I._stat=I._read=uG0.prototype._read}if(I.type&&I.type!==q)I.error("Unexpected type: "+q);if(I.filter){var W=I._proxy||I;if(!I.filter.call(W,W,U)){if(!I._disowned)I.abort(),I.emit("end"),I.emit("close");return}}var w=["_stat","stat","ready"],Z=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=w[Z++];if(!X)return I._read();I.emit(X,U),V()})()}};V8.prototype.pipe=function($){var I=this;if(typeof $.add==="function")I.on("entry",function(U){var Y=$.add(U);if(Y===!1)I.pause()});return kJ1.prototype.pipe.apply(this,arguments)};V8.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};V8.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};V8.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var by=F((H_1,dG0)=>{d
Line truncated
|
||||
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
|
||||
expect: `+$.size+`
|
||||
actual: `+$._bytesWritten);uL.prototype._finish.call($)}});var sy=F((B_1,yW0)=>{yW0.exports=O7;var ay=LJ(),VQ1=lq(),ZQ1=d0(),zQ1=yL(),XQ1=t("fs");ZQ1(O7,ay);function O7($){var I=this;if(!(I instanceof O7))throw Error("ProxyWriter must be called as constructor.");I.props=$,I._needDrain=!1,ay.call(I,$)}O7.prototype._stat=function(){var $=this,I=$.props,U=I.follow?"stat":"lstat";XQ1[U](I.path,function(Y,J){var Q;if(Y||!J)Q="File";else Q=VQ1(J);I[Q]=!0,I.type=$.type=Q,$._old=J,$._addProxy(ay(I,J))})};O7.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(Y){$.on(Y,I.emit.bind(I,Y))}),I.emit("proxy",$);var U=I._buffer;if(U.forEach(function(Y){$[Y[0]].apply($,Y[1])}),I._buffer.length=0,I._needsDrain)I.emit("drain")};O7.prototype.add=function($){if(zQ1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};O7.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};O7.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var LJ=F((v_1,pW0)=>{pW0.exports=i$;var f$=s6(),LQ1=d0(),DQ1=by(),OQ1=my(),eq=t("path"),uW0=process.platform==="win32"?0:process.umask(),kW0=lq(),xW0=PL();LQ1(i$,xW0);i$.dirmode=parseInt("0777",8)&~uW0;i$.filemode=parseInt("0666",8)&~uW0;var FQ1=oy(),NQ1=ry(),MQ1=ty(),AQ1=sy();function i$($,I){var U=this;if(typeof $==="string")$={path:$};var Y=kW0($),J=i$;switch(Y){case"Directory":J=FQ1;break;case"File":J=MQ1;break;case"Link":case"SymbolicLink":J=NQ1;break;case null:default:J=AQ1;break}if(!(U instanceof J))return new J($);if(xW0.call(U),!$.path)U.error("Must provide a path",null,!0);if(U.type=$.type,U.props=$,U.depth=$.depth||0,U.clobber=$.clobber===!1?$.clobber:!0,U.parent=$.parent||null,U.root=$.root||$.parent&&$.parent.root||U,U._path=U.path=eq.resolve($.path),process.platform==="win32"){if(U.path=U._path=U.path.replace(/\?/g,"_"),U._path.length>=260)U._swallowErrors=!0,U._path="\\\\?\\"+U.path.replace(/\//g,"\\")}if(U.basename=eq.basename($.path),U.dirname=eq.dirname($.path),U.linkpath=$.linkpath||null,$.parent=$.root=null,U.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);U.readable=!1,U.writable=!0,U._buffer=[],U.ready=!1,U.filter=typeof $.filter==="function"?$.filter:null,U._stat(I)}i$.prototype._create=function(){var $=this;f$[$.props.follow?"stat":"lstat"]($._path,function(I){if(I)return $.warn("Cannot create "+$._path+`
|
||||
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};i$.prototype._stat=function($){var I=this,U=I.props,Y=U.follow?"stat":"lstat",J=I._proxy||I;if($)Q(null,$);else f$[Y](I._path,Q);function Q(K,q){if(I.filter&&!I.filter.call(J,J,q)){I._aborted=!0,I.emit("end"),I.emit("close");return}if(K||!q)return ey(I);I._old=q;var H=kW0(q);if(H!==I.type||I.type==="File"&&q.nlink>1)return DQ1(I._path,function(G){if(G)return I.error(G);I._old=null,ey(I)});ey(I)}};function ey($){OQ1(eq.dirname($._path),i$.dirmode,function(I,U){if(I)return $.error(I);return $._madeDir=U,$._create()})}function fW0($,I,U,Y,J){var Q=I.mode,K=I.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!f$[K])return J();if(typeof Q!=="number")return J();var q=U.mode&parseInt("0777",8);if(Q=Q&parseInt("0777",8),Q===q)return J();f$[K](Y,Q,J)}function iW0($,I,U,Y,J){if(process.platform==="win32")return J();if(!process.getuid||process.getuid()!==0)return J();if(typeof I.uid!=="number"&&typeof I.gid!=="number")return J();if(U.uid===I.uid&&U.gid===I.gid)return J();var Q=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!f$[Q])return J();if(typeof I.uid!=="number")I.uid=U.uid;if(typeof I.gid!=="number")I.gid=U.gid;f$[Q](Y,I.uid,I.gid,J)}function bW0($,I,U,Y,J){if(!f$.utimes||process.platform==="win32")return J();var Q=I.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Q==="lutimes"&&!f$[Q])Q="utimes";if(!f$[Q])return J();var{atime:K,mtime:q}=U,H=I.atime,G=I.mtime;if(H===void 0)H=K;if(G===void 0)G=q;if(!hW0(H))H=new Date(H);if(!hW0(G))H=new Date(G);if(H.getTime()===K.getTime()&&G.getTime()===q.getTime())return J();f$[Q](Y,H,G,J)}i$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var I=0,U=null,Y=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Q($._old);else{var J=$.props.follow?"stat":"lstat";f$[J]($._path,function(q,H){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);Q($._old=H)})}return;function Q(q){I+=3,fW0($,$.props,q,$._path,K("chmod")),iW0($,$.props,q,$._path,K("chown")),bW0($,$.props,q,$._path,K("utimes"))}function K(q){return function(H){if(U)return;if(H)return H.fstream_finish_call=q,$.error(U=H);if(--I>0)return;if(Y)return;if(Y=!0,!$._madeDir)return G();else nW0($,$._path,G);function G(W){if(W)return W.fstream_finish_call="setupMadeDir",$.error(W);$.emit("end"),$.emit("close")}}}};function nW0($,I,U){var Y=$._madeDir,J=eq.dirname(I);PQ1($,J,function(Q){if(Q)return U(Q);if(J===Y)return U();nW0($,J,U)})}function PQ1($,I,U){var Y={};Object.keys($.props).forEach(function(q){if(Y[q]=$.props[q],q==="mode"&&$.type!=="Directory")Y[q]=Y[q]|parseInt("0111",8)});var J=3,Q=null;f$.stat(I,function(q,H){if(q)return U(Q=q);fW0($,Y,H,I,K),iW0($,Y,H,I,K),bW0($,Y,H,I,K)});function K(q){if(Q)return;if(q)return U(Q=q);if(--J===0)return U()}}i$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};i$.prototype.add=function(){this.error("Can't add to non-Directory type")};i$.prototype.write=function(){return!0};function TQ1($){return Object.prototype.toString.call($)}function hW0($){return typeof $==="object"&&TQ1($)==="[object Date]"}});var Jh=F((EQ1)=>{EQ1.Abstract=PL();EQ1.Reader=e3();EQ1.Writer=LJ();EQ1.File={Reader:gy(),Writer:ty()};EQ1.Dir={Reader:Sy(),Writer:oy()};EQ1.Link={Reader:Cy(),Writer:ry()};EQ1.Proxy={Reader:hy(),Writer:sy()};EQ1.Reader.Dir=EQ1.DirReader=EQ1.Dir.Reader;EQ1.Reader.File=EQ1.FileReader=EQ1.File.Reader;EQ1.Reader.Link=EQ1.LinkReader=EQ1.Link.Reader;EQ1.Reader.Proxy=EQ1.ProxyReader=EQ1.Proxy.Reader;EQ1.Writer.Dir=EQ1.DirWriter=EQ1.Dir.Writer;EQ1.Writer.File=EQ1.FileWriter=EQ1.File.Writer;EQ1.Writer.Link=EQ1.LinkWriter=EQ1.Link.Writer;EQ1.Writer.Proxy=EQ1.ProxyWriter=EQ1.Proxy.Writer;EQ1.collect=yL()});var dW0=F((k_1,cW0)=>{cW0.exports=gQ1;var RQ1=zL(),jQ1=Jh().Writer,Qh=t("path"),CQ1=t("stream"),_Q1=vy(),SQ1=w7();function gQ1($){$.path=Qh.resolve(Qh.normalize($.path));var I=new RQ1($),U=new CQ1.Writable({objectMode:!0});U._write=function(J,Q,K){if(J.type=="Directory")return K();var q=Qh.join($.path,J.path);if(q.indexOf($.path)!=0)return K();let H=$.getWriter?$.getWriter({path:q}):jQ1({path:q});J.pipe(H).on("error",K).on("close",K)};var Y=_Q1(I,U);return I.once("crx-header",function(J){Y.crxHeader=J}),I.pipe(U).on("finish",function(){Y.emit("close")}),Y.promise=function(){return new SQ1(function(J,Q){Y.on("close",J),Y.on("error",Q)})},Y}});var mW0=F((x_1,kL)=>{var k4=function($){var I=1e7,U=7,Y=9007199254740992,J=Z(Y),Q="0123456789abcdefghijklmnopqrstuvwxyz",K=typeof BigInt==="function";function q(N,M,C,u){if(typeof N>"u")return q[0];if(typeof M<"u")return+M===10&&!C?v0(N):i6(N,M,C,u);return v0(N)}function H(N,M){this.value=N,this.sign=M,this.isSmall=!1}H.prototype=Object.create(q.prototype);function G(N){this.value=N,this.sign=N<0,this.isSmall=!0}G.prototype=Object.create(q.prototype);function W(N){th
Line truncated
|
||||
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
|
||||
* Tmp
|
||||
*
|
||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||||
*
|
||||
* MIT Licensed
|
||||
*/var b1=t("fs"),pL=t("os"),x4=t("path"),Qw0=t("crypto"),m8={fs:b1.constants,os:pL.constants},Gw0=/XXXXXX/,Ww0=(m8.O_CREAT||m8.fs.O_CREAT)|(m8.O_EXCL||m8.fs.O_EXCL)|(m8.O_RDWR||m8.fs.O_RDWR),Y21=pL.platform()==="win32",J21=m8.EBADF||m8.os.errno.EBADF,Q21=m8.ENOENT||m8.os.errno.ENOENT,OJ=[],ww0=b1.rmdirSync.bind(b1),Vw0=!1;function K21($,I){return b1.rm($,{recursive:!0},I)}function Zw0($){return b1.rmSync($,{recursive:!0})}function Wh($,I){let U=FJ($,I),Y=U[0],J=U[1];L21(Y,function(Q,K){if(Q)return J(Q);let q=K.tries;(function H(){try{let G=Xw0(K);b1.stat(G,function(W){if(!W){if(q-- >0)return H();return J(Error("Could not get a unique tmp filename, max tries reached "+G))}J(null,G)})}catch(G){J(G)}})()})}function wh($){let I=FJ($),U=I[0],Y=D21(U),J=Y.tries;do{let Q=Xw0(Y);try{b1.statSync(Q)}catch(K){return Q}}while(J-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function q21($,I){let U=FJ($,I),Y=U[0],J=U[1];Wh(Y,function(K,q){if(K)return J(K);b1.open(q,Ww0,Y.mode||384,function(G,W){if(G)return J(G);if(Y.discardDescriptor)return b1.close(W,function(Z){return J(Z,q,void 0,Hh(q,-1,Y,!1))});else{let w=Y.discardDescriptor||Y.detachDescriptor;J(null,q,W,Hh(q,w?-1:W,Y,!1))}})})}function H21($){let I=FJ($),U=I[0],Y=U.discardDescriptor||U.detachDescriptor,J=wh(U),Q=b1.openSync(J,Ww0,U.mode||384);if(U.discardDescriptor)b1.closeSync(Q),Q=void 0;return{name:J,fd:Q,removeCallback:Hh(J,Y?-1:Q,U,!0)}}function G21($,I){let U=FJ($,I),Y=U[0],J=U[1];Wh(Y,function(K,q){if(K)return J(K);b1.mkdir(q,Y.mode||448,function(G){if(G)return J(G);J(null,q,zw0(q,Y,!1))})})}function W21($){let I=FJ($),U=I[0],Y=wh(U);return b1.mkdirSync(Y,U.mode||448),{name:Y,removeCallback:zw0(Y,U,!0)}}function w21($,I){let U=function(Y){if(Y&&!Gh(Y))return I(Y);I()};if(0<=$[0])b1.close($[0],function(){b1.unlink($[1],U)});else b1.unlink($[1],U)}function V21($){let I=null;try{if(0<=$[0])b1.closeSync($[0])}catch(U){if(!O21(U)&&!Gh(U))throw U}finally{try{b1.unlinkSync($[1])}catch(U){if(!Gh(U))I=U}}if(I!==null)throw I}function Hh($,I,U,Y){let J=nL(V21,[I,$],Y),Q=nL(w21,[I,$],Y,J);if(!U.keep)OJ.unshift(J);return Y?J:Q}function zw0($,I,U){let Y=I.unsafeCleanup?K21:b1.rmdir.bind(b1),J=I.unsafeCleanup?Zw0:ww0,Q=nL(J,$,U),K=nL(Y,$,U,Q);if(!I.keep)OJ.unshift(Q);return U?Q:K}function nL($,I,U,Y){let J=!1;return function Q(K){if(!J){let q=Y||Q,H=OJ.indexOf(q);if(H>=0)OJ.splice(H,1);if(J=!0,U||$===ww0||$===Zw0)return $(I);else return $(I,K||function(){})}}}function Z21(){if(!Vw0)return;while(OJ.length)try{OJ[0]()}catch($){}}function Kw0($){let I=[],U=null;try{U=Qw0.randomBytes($)}catch(Y){U=Qw0.pseudoRandomBytes($)}for(let Y=0;Y<$;Y++)I.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[U[Y]%62]);return I.join("")}function $$($){return typeof $>"u"}function FJ($,I){if(typeof $==="function")return[{},$];if($$($))return[{},I];let U={};for(let Y of Object.getOwnPropertyNames($))U[Y]=$[Y];return[U,I]}function z21($,I,U){let Y=x4.isAbsolute($)?$:x4.join(I,$);b1.stat(Y,function(J){if(J)b1.realpath(x4.dirname(Y),function(Q,K){if(Q)return U(Q);U(null,x4.join(K,x4.basename(Y)))});else b1.realpath(Y,U)})}function X21($,I){let U=x4.isAbsolute($)?$:x4.join(I,$);try{return b1.statSync(U),b1.realpathSync(U)}catch(Y){let J=b1.realpathSync(x4.dirname(U));return x4.join(J,x4.basename(U))}}function Xw0($){let I=$.tmpdir;if(!$$($.name))return x4.join(I,$.dir,$.name);if(!$$($.template))return x4.join(I,$.dir,$.template).replace(Gw0,Kw0(6));let U=[$.prefix?$.prefix:"tmp","-",process.pid,"-",Kw0(12),$.postfix?"-"+$.postfix:""].join("");return x4.join(I,$.dir,U)}function qh($,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 Lw0($){if(!$$($.name)){let I=$.name;if(x4.isAbsolute(I))throw Error(`name option must not contain an absolute path, found "${I}".`);let U=x4.basename(I);if(U===".."||U==="."||U!==I)throw Error(`name option must not contain a path, found "${I}".`)}if(!$$($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(Gw0))throw Error(`Invalid template, found "${$.template}".`)}if(!$$($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=$$($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=$$($.prefix)?"":qh("prefix",$.prefix),$.postfix=$$($.postfix)?"":qh("postfix",$.postfix),$.template=$$($.template)?void 0:qh("template",$.template)}function qw0($,I,U,Y){if($$(I))return Y(null);z21(I,U,function(J,Q){if(J)return Y(J);let K=x4.relative(U,Q);if(K.startsWith("..")||x4.isAbsolute(K))return Y(Error(`${$} option must be relative to "${U}", found "${K}".`));Y(null,K)})}function Hw0($,I,U){if($$(I))return;let Y=X21(I,U),J=x4.relative(U,Y);if(J.startsWith("..")||x4.isAbsolute(J))throw ELine truncated
|
||||
*/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
|
||||
\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 sV0=F((tq1)=>{var Vu=d5().Buffer;tq1._dbcs=l5;var w6=-1,aV0=-2,c$=-10,k6=-1000,_J=Array(256),VH=-1;for(wH=0;wH<256;wH++)_J[wH]=w6;var wH;function l5($,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 U=$.table();this.decodeTables=[],this.decodeTables[0]=_J.slice(0),this.decodeTableSeq=[];for(var Y=0;Y<U.length;Y++)this._addDecodeChunk(U[Y]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var J=this.decodeTables.length;this.decodeTables.push(_J.slice(0));var Q=this.decodeTables.length;this.decodeTables.push(_J.slice(0));var K=this.decodeTables[0];for(var Y=129;Y<=254;Y++){var q=this.decodeTables[k6-K[Y]];for(var H=48;H<=57;H++){if(q[H]===w6)q[H]=k6-J;else if(q[H]>k6)throw Error("gb18030 decode tables conflict at byte 2");var G=this.decodeTables[k6-q[H]];for(var W=129;W<=254;W++){if(G[W]===w6)G[W]=k6-Q;else if(G[W]===k6-Q)continue;else if(G[W]>k6)throw Error("gb18030 decode tables conflict at byte 3");var w=this.decodeTables[k6-G[W]];for(var Z=48;Z<=57;Z++)if(w[Z]===w6)w[Z]=aV0}}}}this.defaultCharUnicode=I.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var V={};if($.encodeSkipVals)for(var Y=0;Y<$.encodeSkipVals.length;Y++){var X=$.encodeSkipVals[Y];if(typeof X==="number")V[X]=!0;else for(var H=X.from;H<=X.to;H++)V[H]=!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}l5.prototype.encoder=XD;l5.prototype.decoder=Zu;l5.prototype._getDecodeTrieNode=function($){var I=[];for(;$>0;$>>>=8)I.push($&255);if(I.length==0)I.push(0);var U=this.decodeTables[0];for(var Y=I.length-1;Y>0;Y--){var J=U[I[Y]];if(J==w6)U[I[Y]]=k6-this.decodeTables.length,this.decodeTables.push(U=_J.slice(0));else if(J<=k6)U=this.decodeTables[k6-J];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return U};l5.prototype._addDecodeChunk=function($){var I=parseInt($[0],16),U=this._getDecodeTrieNode(I);I=I&255;for(var Y=1;Y<$.length;Y++){var J=$[Y];if(typeof J==="string")for(var Q=0;Q<J.length;){var K=J.charCodeAt(Q++);if(K>=55296&&K<56320){var q=J.charCodeAt(Q++);if(q>=56320&&q<57344)U[I++]=65536+(K-55296)*1024+(q-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(K>4080&&K<=4095){var H=4095-K+2,G=[];for(var W=0;W<H;W++)G.push(J.charCodeAt(Q++));U[I++]=c$-this.decodeTableSeq.length,this.decodeTableSeq.push(G)}else U[I++]=K}else if(typeof J==="number"){var w=U[I-1]+1;for(var Q=0;Q<J;Q++)U[I++]=w++}else throw Error("Incorrect type '"+typeof J+"' given in "+this.encodingName+" at chunk "+$[0])}if(I>255)throw Error("Incorrect chunk in "+this.encoLine truncated
|
||||
`)}var TI=($)=>(I,U,Y,J)=>{let Q=Y?{...Y,async:!1}:{async:!1},K=I._zod.run({value:U,issues:[]},Q);if(K instanceof Promise)throw new Z8;if(K.issues.length){let q=new(J?.Err??$)(K.issues.map((H)=>E6(H,Q,z4())));throw sH(q,J?.callee),q}return K.value},sJ=TI(n6),EI=($)=>async(I,U,Y,J)=>{let Q=Y?{...Y,async:!0}:{async:!0},K=I._zod.run({value:U,issues:[]},Q);if(K instanceof Promise)K=await K;if(K.issues.length){let q=new(J?.Err??$)(K.issues.map((H)=>E6(H,Q,z4())));throw sH(q,J?.callee),q}return K.value},eJ=EI(n6),BI=($)=>(I,U,Y)=>{let J=Y?{...Y,async:!1}:{async:!1},Q=I._zod.run({value:U,issues:[]},J);if(Q instanceof Promise)throw new Z8;return Q.issues.length?{success:!1,error:new($??rJ)(Q.issues.map((K)=>E6(K,J,z4())))}:{success:!0,data:Q.value}},vI=BI(n6),RI=($)=>async(I,U,Y)=>{let J=Y?{...Y,async:!0}:{async:!0},Q=I._zod.run({value:U,issues:[]},J);if(Q instanceof Promise)Q=await Q;return Q.issues.length?{success:!1,error:new $(Q.issues.map((K)=>E6(K,J,z4())))}:{success:!0,data:Q.value}},$Q=RI(n6),eH=($)=>(I,U,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return TI($)(I,U,J)},dk=eH(n6),$G=($)=>(I,U,Y)=>{return TI($)(I,U,Y)},mk=$G(n6),IG=($)=>async(I,U,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return EI($)(I,U,J)},lk=IG(n6),UG=($)=>async(I,U,Y)=>{return EI($)(I,U,Y)},ok=UG(n6),YG=($)=>(I,U,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return BI($)(I,U,J)},rk=YG(n6),JG=($)=>(I,U,Y)=>{return BI($)(I,U,Y)},tk=JG(n6),QG=($)=>async(I,U,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return RI($)(I,U,J)},ak=QG(n6),KG=($)=>async(I,U,Y)=>{return RI($)(I,U,Y)},sk=KG(n6);var Q$={};$5(Q$,{xid:()=>NO,uuid7:()=>GD0,uuid6:()=>HD0,uuid4:()=>qD0,uuid:()=>_7,uppercase:()=>dO,unicodeEmail:()=>ek,undefined:()=>pO,ulid:()=>FO,time:()=>uO,string:()=>xO,sha512_hex:()=>CD0,sha512_base64url:()=>SD0,sha512_base64:()=>_D0,sha384_hex:()=>vD0,sha384_base64url:()=>jD0,sha384_base64:()=>RD0,sha256_hex:()=>TD0,sha256_base64url:()=>BD0,sha256_base64:()=>ED0,sha1_hex:()=>MD0,sha1_base64url:()=>PD0,sha1_base64:()=>AD0,rfc5322Email:()=>wD0,number:()=>IQ,null:()=>nO,nanoid:()=>AO,md5_hex:()=>OD0,md5_base64url:()=>ND0,md5_base64:()=>FD0,mac:()=>jO,lowercase:()=>cO,ksuid:()=>MO,ipv6:()=>RO,ipv4:()=>vO,integer:()=>iO,idnEmail:()=>VD0,httpProtocol:()=>gO,html5Email:()=>WD0,hostname:()=>XD0,hex:()=>DD0,guid:()=>TO,extendedDuration:()=>KD0,emoji:()=>BO,email:()=>EO,e164:()=>yO,duration:()=>PO,domain:()=>LD0,datetime:()=>kO,date:()=>hO,cuid2:()=>OO,cuid:()=>DO,cidrv6:()=>_O,cidrv4:()=>CO,browserEmail:()=>ZD0,boolean:()=>bO,bigint:()=>fO,base64url:()=>qG,base64:()=>SO});var DO=/^[cC][0-9a-z]{6,}$/,OO=/^[0-9a-z]+$/,FO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,NO=/^[0-9a-vA-V]{20}$/,MO=/^[A-Za-z0-9]{27}$/,AO=/^[a-zA-Z0-9_-]{21}$/,PO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,KD0=/^[-+]?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)?)??$/,TO=/^([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})$/,_7=($)=>{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})$`)},qD0=_7(4),HD0=_7(6),GD0=_7(7),EO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WD0=/^[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])?)*$/,wD0=/^(([^<>()\[\]\\.,;:\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,}))$/,ek=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,VD0=ek,ZD0=/^[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])?)*$/,zD0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function BO(){return new RegExp(zD0,"u")}var vO=/^(?:(?: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])$/,RO=/^(([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}|:))$/,jO=($)=>{let I=P$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},CO=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0Line truncated
|
||||
`).filter((Q)=>Q),Y=Math.min(...U.map((Q)=>Q.length-Q.trimStart().length)),J=U.map((Q)=>Q.slice(Y)).map((Q)=>" ".repeat(this.indent*2)+Q);for(let Q of J)this.content.push(Q)}compile(){let $=Function,I=this?.args,Y=[...(this?.content??[""]).map((J)=>` ${J}`)];return new $(...I,Y.join(`
|
||||
`))}}var WF={major:4,minor:4,patch:3};var p0=o("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=WF;let Y=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Y.unshift($);for(let J of Y)for(let Q of J._zod.onattach)Q($);if(Y.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let J=(K,q,H)=>{let G=U9(K),W;for(let w of q){if(w._zod.def.when){if(zO(K))continue;if(!w._zod.def.when(K))continue}else if(G)continue;let Z=K.issues.length,V=w._zod.check(K);if(V instanceof Promise&&H?.async===!1)throw new Z8;if(W||V instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await V,K.issues.length===Z)return;if(!G)G=U9(K,Z)});else{if(K.issues.length===Z)continue;if(!G)G=U9(K,Z)}}if(W)return W.then(()=>{return K});return K},Q=(K,q,H)=>{if(U9(K))return K.aborted=!0,K;let G=J(q,Y,H);if(G instanceof Promise){if(H.async===!1)throw new Z8;return G.then((W)=>$._zod.parse(W,H))}return $._zod.parse(G,H)};$._zod.run=(K,q)=>{if(q.skipChecks)return $._zod.parse(K,q);if(q.direction==="backward"){let G=$._zod.parse({value:K.value,issues:[]},{...q,skipChecks:!0});if(G instanceof Promise)return G.then((W)=>{return Q(W,K,q)});return Q(G,K,q)}let H=$._zod.parse(K,q);if(H instanceof Promise){if(q.async===!1)throw new Z8;return H.then((G)=>J(G,Y,q))}return J(H,Y,q)}}e0($,"~standard",()=>({validate:(J)=>{try{let Q=vI($,J);return Q.success?{value:Q.data}:{issues:Q.error?.issues}}catch(Q){return $Q($,J).then((K)=>K.success?{value:K.data}:{issues:K.error?.issues})}},vendor:"zod",version:1}))}),S7=o("$ZodString",($,I)=>{p0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??xO($._zod.bag),$._zod.parse=(U,Y)=>{if(I.coerce)try{U.value=String(U.value)}catch(J){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),k1=o("$ZodStringFormat",($,I)=>{jI.init($,I),S7.init($,I)}),VF=o("$ZodGUID",($,I)=>{I.pattern??(I.pattern=TO),k1.init($,I)}),ZF=o("$ZodUUID",($,I)=>{if(I.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(Y===void 0)throw Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=_7(Y))}else I.pattern??(I.pattern=_7());k1.init($,I)}),zF=o("$ZodEmail",($,I)=>{I.pattern??(I.pattern=EO),k1.init($,I)}),XF=o("$ZodURL",($,I)=>{k1.init($,I),$._zod.check=(U)=>{try{let Y=U.value.trim();if(!I.normalize&&I.protocol?.source===gO.source){if(!/^https?:\/\//i.test(Y)){U.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:U.value,inst:$,continue:!I.abort});return}}let J=new URL(Y);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(J.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=J.href;else U.value=Y;return}catch(Y){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),LF=o("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=BO()),k1.init($,I)}),DF=o("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=AO),k1.init($,I)}),OF=o("$ZodCUID",($,I)=>{I.pattern??(I.pattern=DO),k1.init($,I)}),FF=o("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=OO),k1.init($,I)}),NF=o("$ZodULID",($,I)=>{I.pattern??(I.pattern=FO),k1.init($,I)}),MF=o("$ZodXID",($,I)=>{I.pattern??(I.pattern=NO),k1.init($,I)}),AF=o("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=MO),k1.init($,I)}),PF=o("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=kO(I)),k1.init($,I)}),TF=o("$ZodISODate",($,I)=>{I.pattern??(I.pattern=hO),k1.init($,I)}),EF=o("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=uO(I)),k1.init($,I)}),BF=o("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=PO),k1.init($,I)}),vF=o("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=vO),k1.init($,I),$._zod.bag.format="ipv4"}),RF=o("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=RO),k1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),jF=o("$ZodMAC",($,I)=>{I.pattern??(I.pattern=jO(I.delimiter)),k1.init($,I),$._zod.bag.format="mac"}),CF=o("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=CO),k1.init($,I)}),_F=o("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=_O),k1.init($,I),$._zod.check=(U)=>{let Y=U.value.split("/");try{if(Y.length!==2)throw Error();let[J,Q]=Y;if(!Q)throw Error();let K=Number(Q);if(`${K}`!==Q)throw Error();if(K<0||K>128)throw Error();new URL(`http://[${J}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function SF($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}
Line truncated
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},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
|
||||
`).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
|
||||
if (${A}.issues.length) {
|
||||
if (${R} in input) {
|
||||
if (${g} in input) {
|
||||
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
||||
...iss,
|
||||
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
||||
path: iss.path ? [${g}, ...iss.path] : [${g}]
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
||||
if (${A}.value === undefined) {
|
||||
if (${R} in input) {
|
||||
newResult[${R}] = undefined;
|
||||
if (${g} in input) {
|
||||
newResult[${g}] = undefined;
|
||||
}
|
||||
} else {
|
||||
newResult[${R}] = ${A}.value;
|
||||
newResult[${g}] = ${A}.value;
|
||||
}
|
||||
|
||||
`);else if(!y)V.write(`
|
||||
const ${A}_present = ${R} in input;
|
||||
`);else if(!S)V.write(`
|
||||
const ${A}_present = ${g} in input;
|
||||
if (${A}.issues.length) {
|
||||
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
||||
...iss,
|
||||
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
||||
path: iss.path ? [${g}, ...iss.path] : [${g}]
|
||||
})));
|
||||
}
|
||||
if (!${A}_present && !${A}.issues.length) {
|
||||
@@ -275,15 +275,15 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};i$.prototype._stat=function
|
||||
code: "invalid_type",
|
||||
expected: "nonoptional",
|
||||
input: undefined,
|
||||
path: [${R}]
|
||||
path: [${g}]
|
||||
});
|
||||
}
|
||||
|
||||
if (${A}_present) {
|
||||
if (${A}.value === undefined) {
|
||||
newResult[${R}] = undefined;
|
||||
newResult[${g}] = undefined;
|
||||
} else {
|
||||
newResult[${R}] = ${A}.value;
|
||||
newResult[${g}] = ${A}.value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,50 +291,50 @@ Unsupported type: `+$.type,"ENOTSUP");$._finish()})};i$.prototype._stat=function
|
||||
if (${A}.issues.length) {
|
||||
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
||||
...iss,
|
||||
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
||||
path: iss.path ? [${g}, ...iss.path] : [${g}]
|
||||
})));
|
||||
}
|
||||
|
||||
if (${A}.value === undefined) {
|
||||
if (${R} in input) {
|
||||
newResult[${R}] = undefined;
|
||||
if (${g} in input) {
|
||||
newResult[${g}] = undefined;
|
||||
}
|
||||
} else {
|
||||
newResult[${R}] = ${A}.value;
|
||||
newResult[${g}] = ${A}.value;
|
||||
}
|
||||
|
||||
`)}V.write("payload.value = newResult;"),V.write("return payload;");let P=V.compile();return(T,A)=>P(Z,T,A)},Q,K=C7,q=!R7.jitless,G=q&&HO.value,W=I.catchall,w;$._zod.parse=(Z,V)=>{w??(w=Y.value);let X=Z.value;if(!K(X))return Z.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),Z;if(q&&G&&V?.async===!1&&V.jitless!==!0){if(!Q)Q=J(I.shape);if(Z=Q(Z,V),!W)return Z;return Ax([],X,Z,V,w,$)}return U(Z,V)}});function Kx($,I,U,Y){for(let Q of $)if(Q.issues.length===0)return I.value=Q.value,I;let J=$.filter((Q)=>!U9(Q));if(J.length===1)return I.value=J[0].value,J[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((Q)=>Q.issues.map((K)=>E6(K,Y,z4())))}),I}var QQ=o("$ZodUnion",($,I)=>{p0.init($,I),e0($._zod,"optin",()=>I.options.some((Y)=>Y._zod.optin==="optional")?"optional":void 0),e0($._zod,"optout",()=>I.options.some((Y)=>Y._zod.optout==="optional")?"optional":void 0),e0($._zod,"values",()=>{if(I.options.every((Y)=>Y._zod.values))return new Set(I.options.flatMap((Y)=>Array.from(Y._zod.values)));return}),e0($._zod,"pattern",()=>{if(I.options.every((Y)=>Y._zod.pattern)){let Y=I.options.map((J)=>J._zod.pattern);return new RegExp(`^(${Y.map((J)=>dJ(J.source)).join("|")})$`)}return});let U=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(Y,J)=>{if(U)return U(Y,J);let Q=!1,K=[];for(let q of I.options){let H=q._zod.run({value:Y.value,issues:[]},J);if(H instanceof Promise)K.push(H),Q=!0;else{if(H.issues.length===0)return H;K.push(H)}}if(!Q)return Kx(K,Y,$,J);return Promise.all(K).then((q)=>{return Kx(q,Y,$,J)})}});function qx($,I,U,Y){let J=$.filter((Q)=>Q.issues.length===0);if(J.length===1)return I.value=J[0].value,I;if(J.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((Q)=>Q.issues.map((K)=>E6(K,Y,z4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var tF=o("$ZodXor",($,I)=>{QQ.init($,I),I.inclusive=!1;let U=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(Y,J)=>{if(U)return U(Y,J);let Q=!1,K=[];for(let q of I.options){let H=q._zod.run({value:Y.value,issues:[]},J);if(H instanceof Promise)K.push(H),Q=!0;else K.push(H)}if(!Q)return qx(K,Y,$,J);return Promise.all(K).then((q)=>{return qx(q,Y,$,J)})}}),aF=o("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,QQ.init($,I);let U=$._zod.parse;e0($._zod,"propValues",()=>{let J={};for(let Q of I.options){let K=Q._zod.propValues;if(!K||Object.keys(K).length===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(Q)}"`);for(let[q,H]of Object.entries(K)){if(!J[q])J[q]=new Set;for(let G of H)J[q].add(G)}}return J});let Y=AI(()=>{let J=I.options,Q=new Map;for(let K of J){let q=K._zod.propValues?.[I.discriminator];if(!q||q.size===0)throw Error(`Invalid discriminated union option at index "${I.options.indexOf(K)}"`);for(let H of q){if(Q.has(H))throw Error(`Duplicate discriminator value "${String(H)}"`);Q.set(H,K)}}return Q});$._zod.parse=(J,Q)=>{let K=J.value;if(!C7(K))return J.issues.push({code:"invalid_type",expected:"object",input:K,inst:$}),J;let q=Y.value.get(K?.[I.discriminator]);if(q)return q._zod.run(J,Q);if(I.unionFallback||Q.direction==="backward")return U(J,Q);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(Y.value.keys()),input:K,path:[I.discriminator],inst:$}),J}}),sF=o("$ZodIntersection",($,I)=>{p0.init($,I),$._zod.parse=(U,Y)=>{let J=U.value,Q=I.left._zod.run({value:J,issues:[]},Y),K=I.right._zod.run({value:J,issues:[]},Y);if(Q instanceof Promise||K instanceof Promise)return Promise.all([Q,K]).then(([H,G])=>{return Hx(U,H,G)});return Hx(U,Q,K)}});function wF($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(I9($)&&I9(I)){let U=Object.keys(I),Y=Object.keys($).filter((Q)=>U.indexOf(Q)!==-1),J={...$,...I};for(let Q of Y){let K=wF($[Q],I[Q]);if(!K.valid)return{valid:!1,mergeErrorPath:[Q,...K.mergeErrorPath]};J[Q]=K.data}return{valid:!0,data:J}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let Y=0;Y<$.length;Y++){let J=$[Y],Q=I[Y],K=wF(J,Q);if(!K.valid)return{valid:!1,mergeErrorPath:[Y,...K.mergeErrorPath]};U.push(K.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function Hx($,I,U){let Y=new Map,J;for(let q of I.issues)if(q.code==="unrecognized_keys"){J??(J=q);for(let H of q.keys){if(!Y.has(H))Y.set(H,{});Y.get(H).l=!0}}else $.issues.push(q);for(let q of U.issues)if(q.code==="unrecognized_keys")for(let H of q.keys){if(!Y.has(H))Y.set(H,{});Y.get(H).r=!0}else $.issues.push(q);let Q=[...Y].filter(([,q])=>q.l&&q.r).map(([q])=>q);if(Q.length&&J)$.issues.push({...J,keys:Q});if(U9($))return $;let K=wF(I.value,U.value);if(!K.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(K.mergeErrorPath)}`);return $.value=K.data,$}var DG=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=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
|
||||
|
||||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let K of $.seen.entries()){let q=K[1];if(I===K[0]){Q(K);continue}if($.external){let G=$.external.registry.get(K[0])?.id;if(I!==K[0]&&G){Q(K);continue}}if($.metadataRegistry.get(K[0])?.id){Q(K);continue}if(q.cycle){Q(K);continue}if(q.count>1){if($.reused==="ref"){Q(K);continue}}}}function q9($,I){let U=$.seen.get(I);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let Y=(q)=>{let H=$.seen.get(q);if(H.ref===null)return;let G=H.def??H.schema,W={...G},w=H.ref;if(H.ref=null,w){Y(w);let V=$.seen.get(w),X=V.schema;if(X.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(X);else Object.assign(G,X);if(Object.assign(G,W),q._zod.parent===w)for(let D in G){if(D==="$ref"||D==="allOf")continue;if(!(D in W))delete G[D]}if(X.$ref&&V.def)for(let D in G){if(D==="$ref"||D==="allOf")continue;if(D in V.def&&JSON.stringify(G[D])===JSON.stringify(V.def[D]))delete G[D]}}let Z=q._zod.parent;if(Z&&Z!==w){Y(Z);let V=$.seen.get(Z);if(V?.schema.$ref){if(G.$ref=V.schema.$ref,V.def)for(let X in G){if(X==="$ref"||X==="allOf")continue;if(X in V.def&&JSON.stringify(G[X])===JSON.stringify(V.def[X]))delete G[X]}}}$.override({zodSchema:q,jsonSchema:G,path:H.path??[]})};for(let q of[...$.seen.entries()].reverse())Y(q[0]);let J={};if($.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")J.$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");J.$id=$.external.uri(q)}Object.assign(J,U.def??U.schema);let Q=$.metadataRegistry.get(I)?.id;if(Q!==void 0&&J.id===Q)delete J.id;let K=$.external?.defs??{};for(let q of $.seen.entries()){let H=q[1];if(H.def&&H.defId){if(H.def.id===H.defId)delete H.def.id;K[H.defId]=H.def}}if($.external);else if(Object.keys(K).length>0)if($.target==="draft-2020-12")J.$defs=K;else J.definitions=K;try{let q=JSON.parse(JSON.stringify(J));return Object.defineProperty(q,"~standard",{value:{...I["~standard"],jsonSchema:{input:cI(I,"input",$.processors),output:cI(I,"output",$.processors)}},enumerable:!1,writable:!1}),q}catch(q){throw Error("Error converting schema to JSON.")}}function v6($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let Y=$._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")return v6(Y.element,U);if(Y.type==="set")return v6(Y.valueType,U);if(Y.type==="lazy")return v6(Y.getter(),U);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")return v6(Y.innerType,U);if(Y.type==="intersection")return v6(Y.left,U)||v6(Y.right,U);if(Y.type==="record"||Y.type==="map")return v6(Y.keyType,U)||v6(Y.valueType,U);if(Y.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return v6(Y.in,U)||v6(Y.out,U)}if(Y.type==="object"){for(let J in Y.shape)if(v6(Y.shape[J],U))return!0;return!1}if(Y.type==="union"){for(let J of Y.options)if(v6(J,U))return!0;return!1}if(Y.type==="tuple"){for(let J of Y.items)if(v6(J,U))return!0;if(Y.rest&&v6(Y.rest,U))return!0;return!1}return!1}var JA=($,I={})=>(U)=>{let Y=Q9({...U,processors:I});return g1($,Y),K9(Y,$),q9(Y,$)},cI=($,I,U={})=>(Y)=>{let{libraryOptions:J,target:Q}=Y??{},K=Q9({...J??{},target:Q,io:I,processors:U});return g1($,K),K9(K,$),q9(K,$)};var $F0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},QA=($,I,U,Y)=>{let J=U;J.type="string";let{minimum:Q,maximum:K,format:q,patterns:H,contentEncoding:G}=$._zod.bag;if(typeof Q==="number")J.minLength=Q;if(typeof K==="number")J.maxLength=K;if(q){if(J.format=$F0[q]??q,J.format==="")delete J.format;if(q==="time")delete J.format}if(G)J.contentEncoding=G;if(H&&H.size>0){let W=[...H];if(W.length===1)J.pattern=W[0].source;else if(W.length>1)J.allOf=[...W.map((w)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))]}},KA=($,I,U,Y)=>{let J=U,{minimum:Q,maximum:K,format:q,multipleOf:H,exclusiveMaximum:G,exclusiveMinimum:W}=$._zod.bag;if(typeof q==="string"&&q.includes("int"))J.type="integer";else J.type="number";let w=typeof W==="number"&&W>=(Q??Number.NEGATIVE_INFINITY),Z=typeof G==="number"&&G<=(K??Number.POSITIVE_INFINITY),V=I.target==="draft-04"||I.target==="openapi-3.0";if(w)if(V)J.minimum=W,J.exclusiveMinimum=!0;else J.exclusiveMinimum=W;else if(typeof Q==="number")J.minimum=Q;if(Z)if(V)J.maximum=G,J.exclusiveMaximum=!0;else J.exclusiveMaximum=G;else if(typeof K==="number")J.maximum=K;if(typeof H==="number")J.multipleOf=H},qA=($,I,U,Y)=>{U.type="boolean"},HA=($,I,U,Y)=>{if(I.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},GA=($,I,U,Y)=>{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),Aj0(I)}clear(){this._buffer=void 0}}function Aj0($){return $i.parse(JSON.parse($))}function ac($){return JSON.stringify($)+`
|
||||
`}class AE{constructor($=sc.stdin,I=sc.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new ME,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{this.onerror?.(U)}}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 U=ac($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}import{dirname as Ik,join as RW1}from"node:path";import{fileURLToPath as jW1}from"node:url";class G5 extends Error{name="KyError";get isKyError(){return!0}}class H$ extends G5{name="HTTPError";response;request;options;data;constructor($,I,U){let Y=$.status||$.status===0?$.status:"",J=$.statusText??"",Q=`${Y} ${J}`.trim(),K=Q?`status code ${Q}`:"an unknown error";super(`Request failed with ${K}: ${I.method} ${I.url}`);this.response=$,this.request=I,this.options=U}}class G2 extends G5{name="NetworkError";request;constructor($,I){super(`Request failed due to a network error: ${$.method} ${$.url}`,I);this.request=$}}class W2 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 DU extends G5{name="ForceRetryError";customDelay;code;customRequest;constructor($){let I=$?.cause?$.cause instanceof Error?$.cause:new W2($.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 PE extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}class e$ extends G5{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}var TE=(()=>{let $=!1,I=!1,U=typeof globalThis.ReadableStream==="function",Y=typeof globalThis.Request==="function";if(U&&Y)try{I=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(J){if(J instanceof Error&&J.message==="unsupported BodyInit type")return!1;throw J}return $&&!I})(),ec=typeof globalThis.AbortController==="function",Pw=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",$d=typeof globalThis.ReadableStream==="function",Id=typeof globalThis.FormData==="function",Tw=["get","post","put","patch","head","delete"],Pj0=()=>{return};Pj0();var Ud={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},OU=2147483647,Yd=40,Ew=Symbol("stop");class Bw{options;constructor($){this.options=$}}var Jd=($)=>new Bw($),Qd={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},Kd={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 vw=new TextEncoder,Tj0=($)=>{if(!$)return 0;if($ instanceof FormData){let I=0;for(let[U,Y]of $)I+=Yd,I+=vw.encode(`Content-Disposition: form-data; name="${U}"`).byteLength,I+=typeof Y==="string"?vw.encode(Y).byteLength:Y.size;return I}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return vw.encode($).byteLength;if($ instanceof URLSearchParams)return vw.encode($.toString()).byteLength;return 0},qd=($,I,U)=>{let Y,J=0;return $.pipeThrough(new TransformStream({transform(Q,K){if(K.enqueue(Q),Y){J+=Y.byteLength;let q=I===0?0:J/I;if(q>=1)q=1-Number.EPSILON;U?.({percent:q,totalBytes:Math.max(I,J),transferredBytes:J},Y)}Y=Q},flush(){if(Y)J+=Y.byteLength,U?.({percent:1,totalBytes:Math.max(I,J),transferredBytes:J},Y)}}))},Hd=($,I)=>{if(!$.body)return $;let U={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,U);let Y=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(qd($.body,Y,I),U)},Gd=($,I,U)=>{if(!$.body)return $;let Y=Tj0(U??$.body);return new Request($,{duplex:"half",body:qd($.body,Y,I)})};var N8=($)=>$!==null&&typeof $==="object";var Ej0=Symbol("replaceOption"),EE=($)=>N8($)&&$[Ej0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$};var V2=(...$)=>{for(let I of $)if(
Line truncated
|
||||
`,{mode:384}),I}function Ah($){let I=IV0();for(let U of I){if(!O$(U))continue;for(let Y of tL(U).filter((J)=>J.endsWith(".json")).filter((J)=>!J.startsWith("example."))){let J=l8(U,Y);try{let Q=sL(J,"utf-8"),K=JSON.parse(Q);if(K&&typeof K==="object"&&K.id===$)return J}catch{}}}return}function N7($,I){let U=Ah($);if(!U)throw Error(`Enterprise config not found: ${$}`);let J={...JSON.parse(sL(U,"utf-8")),...I};for(let K of Object.keys(I))if(I[K]===void 0)delete J[K];let Q=Fh.parse(J);return rw0(U,`${JSON.stringify(Q,null,2)}
|
||||
`,"utf-8"),Q}function AJ($,I,U=[]){let Y=I.corpId?.trim()||void 0,J=I.stateful?I.defaultCorpId?.trim()||void 0:void 0,Q=Y??J;if(Q){let q=$.find((W)=>W.id===Q);if(q)return q;let H=$.find((W)=>W.id.toLowerCase()===Q.toLowerCase());if(H)return H;let G=$.find((W)=>W.name.toLowerCase()===Q.toLowerCase());if(G)return G;throw Error(`No enterprise config found for ${Q}`)}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 K=$[0];if(K)return K;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(U.length?U.join(", "):"the configured enterprise directories"))}import{readFileSync as uH1}from"node:fs";import{randomBytes as kH1}from"node:crypto";var JV0=300000,UV0=new Map;function OK1($,I){return $.map((U)=>U.trim()).filter(Boolean).map((U)=>I?U:U.toLowerCase())}function FK1($,I){return I?$:$.toLowerCase()}function NK1($,I,U,Y){let J=FK1($,Y),Q=I.filter((K)=>J.includes(K));if(U==="all"&&Q.length!==I.length)return[];return Q}function MK1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function AK1($,I){if(I.fields&&!I.fields.has($.field))return[];let U=MK1($.value),Y=[];return U.forEach((J,Q)=>{let K=NK1(J,I.keywords,I.matchMode,I.caseSensitive);if(K.length===0)return;let q=Math.max(0,Q-I.contextLines),H=Math.min(U.length,Q+I.contextLines+1),G={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Q+1,matchedKeywords:K,matchedText:$D(J,I.maxChars),context:{before:I.snippetOnly?[]:U.slice(q,Q).map((W)=>$D(W,I.maxChars)),line:$D(J,I.maxChars),after:I.snippetOnly?[]:U.slice(Q+1,H).map((W)=>$D(W,I.maxChars))},metadata:$.metadata};if(I.snippetOnly)G.context={before:[],line:G.context.line,after:[]};Y.push(G)}),Y}function $D($,I){if(!I||$.length<=I)return $;return`${$.slice(0,Math.max(0,I))}...`}function PK1($){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 YV0($){return $.rules.flatMap((I,U)=>{let Y=`${$.id}:${I.description.slice(0,32)}`,J={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:U};return[{area:"rules",entityType:"rule",entityId:Y,title:`${$.versionName} / ${I.scope}`,field:"history.description",value:I.description,metadata:J},{area:"rules",entityType:"rule",entityId:Y,title:`${$.versionName} / ${I.scope}`,field:"history.scope",value:I.scope,metadata:J}]})}function TK1($){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 EK1($){let I=[];if($.decisionPreferences)for(let[U,Y]of Object.entries($.decisionPreferences))I.push({area:"preferences",entityType:"preference",field:`decisionPreferences.${U}`,value:Y,metadata:{integrationSystem:$.integrationSystem}});return $.integrations.forEach((U,Y)=>{I.push({area:"preferences",entityType:"integration",title:U.outboundName,field:`integrations[${Y}]`,value:U,metadata:{type:U.type,outboundName:U.outboundName,mode:U.mode,corporationId:U.corporationId}})}),I}async function BK1($,I,U){let Y=U.ruleVersionScope??"current",J=[I.id,`ruleVersionScope=${Y}`,`ruleVersionId=${U.ruleVersionId??""}`,`ruleVersionNumber=${U.ruleVersionNumber??""}`,`latestRuleVersion=${U.latestRuleVersion??!1}`,`documentLimit=${U.documentLimit??100}`].join("|"),Q=UV0.get(J);if(!U.refresh&&Q&&Date.now()<Q.expiresAt)return Q;let[K,q,H]=await Promise.all([vK1($,{scope:Y,versionId:U.ruleVersionId,versionNumber:U.ruleVersionNumber,latest:U.latestRuleVersion}),M9($,{limit:U.documentLimit??100}),M1($,I.seal.endpoints.approvalStylePreferences)]),G=Date.now(),W={entries:[...K,...q.articles.flatMap(TK1),...EK1(H)],fetchedAt:G,expiresAt:G+JV0};return UV0.set(J,W),W}async function vK1($,I){if(I.scope==="current")return(await _6($)).rules.flatMap(PK1);if(I.scope==="version"){let Y=await RK1($,I);return YV0(Y)}return(await R$($)).flatMap(YV0)}async function RK1($,I){if(I.versionId)return P2($,I.versionId);let U=await R$($),Y=I.versionNumber?U.find((J)=>J.versionNumber===I.versionNumber):U[0];if(!Y)throw Error(I.versionNumber?`Rule version not found: ${I.versionNumber}`:"No rule versions found");return Y}async func
Line truncated
|
||||
`,"utf8"),U}function wV0($){return $.map((I,U)=>{let Y;if(typeof I.code==="number")Y=`#${String(I.code).padStart(4,"0")}`;else if(typeof I.code==="string")Y=I.code.startsWith("#")?I.code:`#${I.code}`;else Y=`#${String(U+1).padStart(4,"0")}`;return{id:I.id,code:Y,name:I.name,description:I.description,scope:I.scope,strictness:I.strictness}})}class b$ extends Error{errors;warnings;constructor($,I=[]){super([`材料包校验失败:${$.length} 个错误`,...$.map((U)=>`- ${U}`)].join(`
|
||||
`));this.errors=$;this.warnings=I;this.name="MaterialPackValidationError"}}import{createHmac as cK1,randomBytes as dK1}from"node:crypto";function mK1($,I,U,Y){return cK1("sha256",Y).update(`${$}.${I}.${JSON.stringify(U)}`).digest("hex")}function HH($,I){let U=Math.floor(Date.now()/1000),Y=dK1(16).toString("hex");return{Authorization:`Bearer ${I}`,"x-webhook-signature":mK1(U,Y,$,I),"x-webhook-timestamp":String(U),"x-webhook-nonce":Y}}var Ou=NI(_V0(),1),NZ0=NI(FZ0(),1);var FD={maxEntries:1000,maxTotalSize:524288000,maxCompressionRatio:150};async function MZ0($){return new Promise((I,U)=>{Ou.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(Y,J)=>{if(Y||!J)return U(Y??Error("无法打开 ZIP"));let Q=[];J.readEntry(),J.on("entry",(K)=>{let q=AZ0(K);if(!q.endsWith("/")&&!MH1(q))Q.push({fileName:q,uncompressedSize:K.uncompressedSize,compressedSize:K.compressedSize,raw:K});J.readEntry()}),J.on("end",()=>I(Q)),J.on("error",U)})})}function AZ0($){let I=Buffer.isBuffer($.fileName)?$.fileName:Buffer.from(String($.fileName),"binary"),U=I.toString("utf8");if(!U.includes("�"))return U;let Y=NZ0.default.decode(I,"gbk");if(!Y.includes("�"))return Y;return U}function MH1($){let I=$.split("/").pop()??"";return $.split("/").includes("__MACOSX")||I===".DS_Store"||I.startsWith("._")||I.startsWith(".~")||I.startsWith("~$")}function PZ0($,I){let U=[],Y=TU(I);if($.length>FD.maxEntries)U.push(`文件数超过 ${FD.maxEntries}`);if($.reduce((K,q)=>K+q.uncompressedSize,0)>FD.maxTotalSize)U.push("解压后总大小超过 500MB");for(let K of $){if(K.fileName.startsWith("/")||K.fileName.split("/").includes(".."))U.push(`存在不安全路径: ${K.fileName}`);if(K.compressedSize>0&&K.uncompressedSize/K.compressedSize>FD.maxCompressionRatio)U.push(`压缩比超过 150: ${K.fileName}`);if(K.fileName==="信息表.xlsx")continue;AH1(K,Y,U)}if(!$.find((K)=>K.fileName==="信息表.xlsx"))U.push("ZIP 根目录缺少精确名为「信息表.xlsx」的文件");if($.some((K)=>K.fileName.toLowerCase().endsWith(".zip")))U.push("不允许嵌套 ZIP");if(U.length)throw new b$(U)}function AH1($,I,U){let Y=PH1($.fileName);if(!Y||!I.allowedExtensions.includes(Y))U.push(`附件后缀不在白名单中: ${$.fileName}(允许: ${I.allowedExtensions.join(", ")})`);if($.uncompressedSize<I.minFileSizeBytes)U.push(`附件文件过小: ${$.fileName}(${$.uncompressedSize} B,小于最小值 ${I.minFileSizeBytes} B)`);if(I.maxFileSizeBytes!==void 0&&I.maxFileSizeBytes!==null&&$.uncompressedSize>I.maxFileSizeBytes)U.push(`附件文件过大: ${$.fileName}(${$.uncompressedSize} B,大于最大值 ${I.maxFileSizeBytes} B)`)}function PH1($){let I=$.split("/").pop()??$,U=I.lastIndexOf(".");return U>0?I.slice(U).toLowerCase():""}function Fu($,I){return new Promise((U,Y)=>{Ou.default.fromBuffer(Buffer.from($),{lazyEntries:!0,autoClose:!0,decodeStrings:!1},(J,Q)=>{if(J||!Q)return Y(J??Error("无法打开 ZIP"));Q.readEntry(),Q.on("entry",(K)=>{if(AZ0(K)!==I.fileName)return Q.readEntry();Q.openReadStream(K,(q,H)=>{if(q||!H)return Y(q??Error(`无法读取 ${I.fileName}`));let G=[];H.on("data",(W)=>G.push(W)),H.on("end",()=>U(Buffer.concat(G))),H.on("error",Y)})}),Q.on("error",Y)})})}var EZ0=NI(zh(),1);function TH1($){return $.startsWith("[附件]")}function BZ0($){return $.startsWith("[附件]")?$.slice(4):$}function EH1($){return BZ0($).toLowerCase().replace(/\s+/g,"_")||"attachment"}function BH1($){if($==null||$==="")return[];return String($).split(/[\n,;,;]/).map((I)=>I.trim()).filter(Boolean)}function Nu($,I){let U=[];for(let[Y,J]of I.entries()){if(!TH1(Y))continue;let Q=$.getCell(J).value,K=BH1(Q);if(!K.length)continue;U.push({key:EH1(Y),label:BZ0(Y),paths:K})}return U}function Mu($){let I=new Map;return $.map((U)=>{let Y=(I.get(U.key)??0)+1;return I.set(U.key,Y),Y===1?U:{...U,key:`${U.key}-${Y}`}})}function ND($,I,U,Y){return{key:$,label:I,type:U,value:Y}}function vZ0($,I,U){return ND($,I,"TEXT",U==null?"":String(U))}function RZ0($,I,U){return ND($,I,"AMOUNT",typeof U==="number"?{amount:U,currency:"CNY"}:null)}function jZ0($){if($ instanceof Date)return $.toISOString();if(typeof $==="string"&&$.trim())return $.trim();return null}function vH1($){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 LH($){let I=new Map;return $.getRow(1).eachCell((U,Y)=>I.set(String(U.value??"").trim(),Y)),I}function GI($,I,U){let Y=I.get(U);return Y?$.getCell(Y).value:void 0}function RH1($,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 Fu(Y.fileBuffer,D),T=L.split("/").pop()??L;O.append("files",new File([new Uint8Array(P)],T));let A=await fetch(`${J}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/attachments`,{method:"POST",headers:HH({},U.secret),body:O});if(!A.ok)throw Error(`附件上传失败 ${A.status}: ${await A.text()}`);let R=await A.json();W.set(L,R.attachments?.map((x)=>x.data)??(R.data===void 0?[]:[R.data])),process.stderr.write(`✓ 附件上传成功: ${L}
|
||||
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${H.document.documentId}
|
||||
`);let Z=Au(H.document,G,W),V=await fetch(`${J}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/document`,{method:"POST",headers:{"Content-Type":"application/json",...HH({webhookId:Q,...Z},U.secret)},body:JSON.stringify(Z)});if(!V.ok)throw Error(`Webhook 单据推送失败 ${V.status}: ${await V.text()}`);K.push({documentId:Z.documentId,document:Z,pushResult:await V.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
|
||||
`)}return{warnings:[],results:K}}function wI($){return{fileBuffer:_H1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}import{existsSync as hH1}from"node:fs";async function AD($,I,U={}){let J=O4().stateful?"stateful":"stateless",Q="ok",K,q,H;try{let A=await G$($);H={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){Q="error",K=A instanceof Error?A.message:String(A)}let G=[];if(Q==="ok")try{G=await w5($,I.seal.endpoints.approvalStylePreferences)}catch(A){Q="error",K=`读取 Webhook 配置失败: ${A instanceof Error?A.message:String(A)}`}let W=G.length===1,w=G.map((A)=>({id:A.id,name:A.name,mode:A.mode,incomingDocumentWebhookUrl:A.incomingDocumentWebhook.url,outgoingResultWebhookUrl:A.outgoingResultWebhook,autoApprovalRate:A.autoApprovalRate,...W?{isDefault:!0}:{}})),Z=W?{id:G[0].id,name:G[0].name,mode:G[0].mode}:null,V=U.webhook?A9(G,U.webhook):W?G[0]:void 0,X;if(U.filePath)if(!hH1(U.filePath))X={valid:!1,filePath:U.filePath,fileName:U.filePath.split(/[\\/]/).pop()??U.filePath,documentCount:0,errors:[`文件不存在: ${U.filePath}`]};else try{let A=wI(U.filePath),R=await WI(A.fileBuffer,A.fileName,V?.materialPackFilePolicy);X={valid:!0,filePath:U.filePath,fileName:A.fileName,documentCount:R.documents.length,warnings:R.warnings}}catch(A){X={valid:!1,filePath:U.filePath,fileName:U.filePath.split(/[\\/]/).pop()??U.filePath,documentCount:0,errors:[A instanceof Error?A.message:String(A)]}}let L=X?X.valid:!0,D=Q==="ok"&&w.length>0&&L,O=J==="stateful"?"":` --corp ${I.id}`,P="",T="";if(Q!=="ok")T=`凭证鉴权异常: ${K}`,P=`seal-use auth diagnose${O}`;else if(w.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=W?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${w.length} 个 Webhook 通道,等待载入`;let A=X?.filePath??"<材料包.zip>",R=W?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;P=`seal-use webhook material-pack push ${A}${R}${O}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:q,user:H},stateMode:J,authStatus:Q,authError:K,activeWebhooks:w,defaultWebhook:Z,materialPack:X,statusMessage:T,nextAction:P}}var OH=[{name:"seal_whoami",description:"查询当前 Seal 用户身份及租户信息",parameters:z.object({}),handler:async($)=>G$($)},{name:"seal_session_get",description:"查询当前 Seal Bearer session、用户和过期时间",parameters:z.object({}),handler:async($)=>Em($)},{name:"seal_delegation_list",description:"查询当前 Seal 租户下的授权链接 (Delegation) 列表",parameters:z.object({}),handler:async($)=>om($)},{name:"seal_delegation_create",description:"创建新的 Seal 授权链接 (Delegation)",parameters:z.object({note:z.string().optional().describe("授权链接的备注或说明信息")}),handler:async($,I)=>EU($,I)},{name:"seal_delegation_revoke",description:"撤销/废除指定的 Seal 授权链接 (Delegation)",parameters:z.object({tokenId:z.string().describe("授权链接 ID (delegation record ID)")}),handler:async($,I)=>rm($,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)=>tm($,I)},{name:"seal_user_reset_password",description:"重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",parameters:z.object({userId:z.string().describe("用户 ID (_id)")}),handler:async($,I)=>UB($,I.userId)},{name:"seal_user_get",description:"获取指定 Seal 用户的详细信息",parameters:z.object({userId:z.string().describe("用户 ID (_id)")}),handler:async($,I)=>dw($,I.userId)},{name:"seal_user_search",description:"按姓名、手机号或邮箱搜索 Seal 成员用户列表",parameters:z.object({keyword:z.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")}),handler:async($,I)=>mw($,I.keyword??"")},{name:"seal_user_delete",description:"删除指定 Seal 本地用户",parameters:z.object({userId:z.string().describe("用户 ID (_id)")}),handler:async($,I)=>ql($,I.userId)},{name:"seal_user_activate",description:"启用/激活已离职的 Seal 用户账号",parameters:z.object({userId:z.string().describe("用户 ID (_id)")}),handler:async($,I)=>YB($,I.userId)},{name:"seal_user_delegation_create",description:"为指定 S
Line truncated
|
||||
`+`• 身份主体:${O}${P}
|
||||
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}
|
||||
`)}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}
|
||||
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
|
||||
`+`• 时效性:换票凭证有效时间 ${V} 秒(${Math.round(V/60)} 分钟),在浏览器打开后将保留 30 天会话
|
||||
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:I.sso?W:G,sealResultUrl:G,ssoUrl:W,type:I.sso?"sso_link":"deep_link",expiresIn:I.sso?V:void 0,identity:w,warning:Z,enterpriseAssistUrl:K,enterpriseUrl:K,hoseDomain:Q.type==="hose"?QG1(Q.domain):void 0,documentUrl:q,recordId:J?.id,sourceDocumentSN:J?.sourceDocumentSN,sourceDocumentId:J?.sourceDocumentId,sourceSystem:J?.sourceSystem,missing:{enterpriseAssistUrl:K?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:Y&&!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 U=I.sn??I.query;if(!U)throw Error("query or sn is required");let Y=await KG1($,{query:U,sn:I.sn,batchId:I.batchId,latest:I.latest,limit:I.latest?1:I.limit??20,maxScan:I.maxScan??1000}),J=await Promise.all(Y.records.map((q)=>E4($,q.id))),Q=yZ0(I.fields),K=J.map((q)=>UG1(q,Q));return{query:U,sourceDocumentSN:I.sn,simulationBatchId:I.batchId,latest:I.latest??!1,total:Y.total,scanned:Y.scanned,matched:K.length,records:K,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:ED(J)}:{}}}},{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 U=_u(await eE($,I.batchId),I.query);return{batchId:I.batchId,count:U.length,records:U.map(VI),bridge:ED(U)}}},{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 U=I.mode??"hosecloud",Y=I.signKey;if(U==="hosecloud"&&!Y){if(Y=(await IB($)).find((q)=>q.signKey)?.signKey,!Y)throw Error("未找到合思集成 signKey, 请通过 signKey
Line truncated
|
||||
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:SJ({id:I?.id,sn:I?.sn??I?.sourceDocumentSN??$.sourceDocumentSN,title:I?.title??I?.name,template:RD(I,["template.name","templateName","form.name","formName","formTitle"]),amount:TD(U,["金额","报销金额","付款金额","合计","价税合计"])??RD(I,["amount","totalAmount","expenseAmount"]),expenseType:TD(U,["费用类型","费用类别","报销类型"]),costCompany:TD(U,["费用承担公司","承担公司","成本中心","费用归属"]),payee:TD(U,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:U.slice(0,30)}),invoices:sH1($),attachments:NJ($,{summary:!0}).attachments,aiResult:CD($),manualResult:ZI($)?.value,hints:SJ({amountMentions:uZ0(Y,["金额","合计","税率"],8),partyMentions:uZ0(Y,["买方","卖方","甲方","乙方","收款"],8)})}}function oH1($){let I=[["result.citedRules",o5($,"result.citedRules")],["result.matchedRules",o5($,"result.matchedRules")],["result.ruleResults",o5($,"result.ruleResults")],["result.rules",o5($,"result.rules")],["pipelineData.citedRules",o5($,"pipelineData.citedRules")],["pipelineData.matchedRules",o5($,"pipelineData.matchedRules")]],U=[],Y=new Set;for(let[J,Q]of I)(Array.isArray(Q)?Q:Q&&typeof Q==="object"?Object.values(Q):[]).forEach((q,H)=>{let G=FH(q);if(!G)return;let W=Q4(G.runtimeRuleId)??Q4(G.runtimeId)??Q4(G.id)??Q4(G.ruleId),w=Q4(G.ruleCode)??Q4(G.code)??(W?IG1(W):void 0),Z=SJ({runtimeRuleId:W,ruleCode:w,versionNumber:tH1(G.versionNumber)??$.ruleSetVersionNumber,scope:Q4(G.scope),strictness:Q4(G.strictness),appliedAnalysis:G.appliedAnalysis??G.analysis??G.reasoning,checkResult:G.checkResult??G.result??G.decision,findings:G.findings??G.riskPoints??G.evidence,sourcePath:`${J}.${H}`}),V=JSON.stringify(Z);if(!Y.has(V))Y.add(V),U.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:U.length,rules:U}}function RD($,I){if(!$)return;for(let U of I){let Y=o5($,U);if(Y!==void 0)return Y}return}function hZ0($,I){if(!$)return 0;for(let U of I){let Y=o5($,U);if(Array.isArray(Y))return Y.length;if(Y&&typeof Y==="object")return Object.keys(Y).length;if(typeof Y==="number")return Y}return 0}function o5($,I){return I.split(".").reduce((U,Y)=>{if(U===void 0||U===null)return;if(Array.isArray(U)){let J=Number(Y);return Number.isInteger(J)?U[J]:void 0}if(typeof U==="object")return U[Y];return},$)}function rH1($,I,U){let Y=I.split("."),J=$;for(let Q of Y.slice(0,-1)){let K=J[Q];if(!K||typeof K!=="object"||Array.isArray(K))J[Q]={};J=J[Q]}J[Y[Y.length-1]??I]=U}function SJ($){return Object.fromEntries(Object.entries($).filter(([,I])=>I!==void 0))}function FH($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function tH1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function aH1($){let I=[];return Eu($,"document",I),I}function Eu($,I,U){if(Array.isArray($)){$.forEach((K,q)=>Eu(K,`${I}.${q}`,U));return}let Y=FH($);if(!Y)return;let J=Q4(Y.label)??Q4(Y.name)??Q4(Y.title)??Q4(Y.fieldName),Q=Y.value??Y.displayValue??Y.text??Y.content;if(J&&Q!==void 0&&typeof Q!=="object")U.push(SJ({path:I,label:J,value:Q,type:Q4(Y.type)??Q4(Y.fieldType)}));for(let[K,q]of Object.entries(Y)){if(K==="attachments")continue;Eu(q,`${I}.${K}`,U)}}function TD($,I){return $.find((Y)=>{let J=Q4(Y.label)??"";return I.some((Q)=>J.includes(Q))})?.value}function sH1($){let I=[];return jD($.result,"result",I),jD($.document,"document",I),I.slice(0,20)}function jD($,I,U){if(Array.isArray($)){$.forEach((J,Q)=>jD(J,`${I}.${Q}`,U));return}let Y=FH($);if(!Y)return;if(/invoice|发票/i.test(I))U.push(SJ({path:I,fileName:Q4(Y.fileName)??Q4(Y.filename)??Q4(Y.name),buyer:Y.buyer??Y.buyerName??Y.purchaserName,seller:Y.seller??Y.sellerName,amount:Y.amount??Y.totalAmount??Y.total,taxRate:Y.taxRate,category:Y.category??Y.type}));for(let[J,Q]of Object.entries(Y))jD(Q,`${I}.${J}`,U)}function uZ0($,I,U){return $.split(/\r?\n/).filter((Y)=>I.some((J)=>Y.includes(J))).slice(0,U)}function ED($){return $.map((I)=>{let U=VI(I);return{recordId:U.id,tenantId:U.tenantId,agentId:U.agentId,sourceDocumentSN:U.sourceDocumentSN,sourceDocumentId:U.sourceDocumentId,simulationBatchId:U.simulationBatchId,langfuseTraceId:U.langfuseTraceId,langfuseSessionFallback:U.langfuseSessionFallback,ruleSetVersionNumber:U.ruleSetVersionNumber,ruleSetPublishedAt:U.ruleSetPublishedAt,ruleSetPublishedByName:U.ruleSetPublishedByName,resolution:U.langfuseTraceId?"trace":U.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Pu($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function eH1($,I){if(I.recordId&&!I.versionId&&!I.versionNumber&&!I.latest){let U=await E4($,I.recordId);if(!U.ruleSetVersionNumber)throw Er
Line truncated
|
||||
`)}function XG1($){let I=[];if(I.push(`seal-use ${$.area} - ${$.title}`),$.description)I.push($.description);I.push(""),I.push("Usage:");for(let U of $.commands)for(let Y of U.usage)I.push(` ${Y}`);if($.commands.some((U)=>U.name))I.push(""),I.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return I.join(`
|
||||
`)}function Jz0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let I of Qz0)for(let U of I.commands)for(let Y of U.usage)$.push(` ${Y}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
|
||||
`)}var DG1=100,OG1=120000,Hz0=["id","code","status","strictness","scope","createdAt","updatedAt"],FG1=200000;function uu($){return $.map((I)=>typeof I==="string"?I:String(I)).join(" ")}function AH($){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"?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(`
|
||||
`)}
|
||||
`}function PH($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function E0($,I={}){NG1($,I);let U=`${JSON.stringify($,null,2)}
|
||||
`;if(I.outputFile){LG1(I.outputFile,U),console.log(JSON.stringify({outputFile:I.outputFile,bytes:Buffer.byteLength(U,"utf-8")},null,2));return}console.log(U.trimEnd())}function NG1($,I={}){if(I.allowFull||I.outputFile)return;let U=Buffer.byteLength(JSON.stringify($),"utf-8");if(U>FG1)throw new _D(`Output is large (${U} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function Gz0($,I){if(I)return;let U=$&&typeof $==="object"?$:{},Y=typeof U.count==="number"?U.count:void 0,J=Array.isArray(U.rules)?U.rules.length:void 0,Q=Buffer.byteLength(JSON.stringify($),"utf-8"),K=Y??J??0;if(K>DG1||Q>OG1)throw new _D(`Rule list is large (${K} rules, ${Q} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function V0($){return{allowFull:O0($.full)===!0,outputFile:S($.outputFile)??S($["output-file"])}}function Wz0($=[]){console.log(qz0($))}function S1($){let I=o8(),U=O4();return AJ(I,{stateful:U.stateful,defaultCorpId:U.defaultCorpId,corpId:$},JI())}function zI($=O4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:QI()}}async function F0($,I,U,Y,J={}){E0(await XI($,I,U,Y),J)}async function XI($,I,U,Y){let J=OH.find((q)=>q.name===$);if(!J)throw Error(`Unknown Seal tool: ${$}`);let Q=Object.fromEntries(Object.entries(Y).filter(([,q])=>q!==void 0)),K=J.handler;return K(I,Q,{corp:U})}import{existsSync as Xz0}from"node:fs";var MG1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"]);function wz0($,I){let U=$&&typeof $==="object"?$:{},Y=typeof U.type==="string"?U.type.toUpperCase().trim():"",J=typeof U.key==="string"&&U.key.trim()?U.key.trim():typeof U.label==="string"&&U.label.trim()?U.label.trim():`field_${I}`,Q=typeof U.label==="string"&&U.label.trim()?U.label.trim():J,K=U.value!==void 0?U.value:null;if(Y==="LIST"&&Array.isArray(K))K=K.map((H)=>{if(Array.isArray(H))return H.map((G,W)=>wz0(G,W));return H});let q=Y;if(!MG1.has(q))if(Array.isArray(K))q="LIST";else if(K&&typeof K==="object")q="OBJECT";else if(typeof K==="number")q="NUMBER";else q="TEXT";return{key:J,label:Q,type:q,value:K}}function Vz0($,I={}){let U=$.document,Y=$.sourceDocumentSN??(typeof U?.sn==="string"?U.sn:void 0)??(typeof U?.sourceDocumentSN==="string"?U.sourceDocumentSN:void 0)??$.id,J=$.sourceDocumentId??(typeof U?.id==="string"?U.id:void 0)??(typeof U?.sourceDocumentId==="string"?U.sourceDocumentId:void 0)??$.documentId??$.id,Q=I.snPrefix??"",K=I.snSuffix??"",q=I.docIdPrefix??Q,H=I.docIdSuffix??K,G=`${Q}${Y}${K}`,W=`${q}${J}${H}`,w=typeof U?.sourceStartTime==="number"?U.sourceStartTime:typeof $.createdAt==="number"?Math.floor($.createdAt/1000):null,V=(Array.isArray(U?.fields)?U.fields:[]).map((X,L)=>wz0(X,L));return{type:"document",documentId:W,documentSN:G,startTime:w,fields:V}}function AG1($){let I=new URL($),U=I.pathname.match(/\/webhook\/([^/]+)/);if(!U)throw Error(`Webhook URL 必须包含 /webhook/{webhookId}/document,收到: ${$}`);let Y=U[1],J=`${I.protocol}//${I.host}`,Q=`${J}/api/v1/integrations/webhook/${encodeURIComponent(Y)}/document`;return{baseUrl:J,webhookId:Y,documentEndpoint:Q}}async function Zz0($,I,U,Y=fetch){let{webhookId:J,documentEndpoint:Q}=AG1($),K={"Content-Type":"application/json",...HH({webhookId:J,...U},I)},q=await Y(Q,{method:"POST",headers:K,body:JSON.stringify(U)});if(!q.ok){let H=await q.text();throw Error(`Webhook 单据推送失败 (${q.status}): ${H}`)}return q.json()}function zz0($,I,U){if(I){let Y=I.trim().toLowerCase(),J=$.find((Q)=>Q.id.toLowerCase()===Y||Q.name.toLowerCase()===Y||Q.incomingDocumentWebhook.id.toLowerCase()===Y);if(!J){let Q=$.map((K)=>`"${K.name}" (${K.id})`).join(", ");throw Error(`未找到匹配 "${I}" 的 Webhook 集成通道。可用通道: [${Q}]`)}return J}if($.length===1)return $[0];if($.length>1){let Y=$.map((J)=>`"${J.name}" (${J.id})`).join(", ");throw Error(`当前租户存在多个 Webhook 通道 [${Y}],请通过 --webhook <idOrName> 指定目标通道。`)}throw new d$("当前租户未配置任何 Webhook 集成通道。",1,`seal-use webhook add --name <name> --result-url <url>${U?` --corp ${U}`:""}`)}async function Lz0($,I){if(!Xz0($))throw Error(`File not found: ${$}`);let U=wI($);console.log(JSON.stringify(await WI(U.fileBuffer,U.fileName,I),null,2))}async function gD($,I,U,Y,J){if($==="ready"||$==="status"){let Q=I??S(J.options.file)??S(J.options.input),K=await AD(U,Y,{filePath:Q,webhook:S(J.options.webhook)??S(J.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${K.corp.name} (${K.corp.id}) [${K.stateMode}]`),K.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${K.corp.tenant.name} (${K.corp.tenant.id})`);console.error(`[webhook-read
Line truncated
|
||||
`);let A=await Zz0(V.incomingDocumentWebhook.url,V.secret,P),R={success:!0,sourceCorp:{id:H.id,name:H.name},targetCorp:{id:Y.id,name:Y.name},targetWebhook:{id:V.id,name:V.name,mode:V.mode,incomingDocumentWebhookUrl:V.incomingDocumentWebhook.url},originalRecord:{id:W.id,sourceSystem:W.sourceSystem,sourceDocumentSN:W.sourceDocumentSN,sourceDocumentId:W.sourceDocumentId},replayedDocument:{documentSN:P.documentSN,documentId:P.documentId,fieldCount:P.fields.length},pushResult:A};console.error(`\uD83D\uDFE2 成功重放单据「${P.documentSN}」至 ${Y.name} (${V.name})`),console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${Y.id} --limit 1`),console.log(JSON.stringify(R,null,2));return}if($==="material-pack"||$==="material-pack-push"){let Q=$==="material-pack-push"?"push":I,K=$==="material-pack-push"?S(J.options.file)??S(J.options.input):J.command[3]??S(J.options.file)??S(J.options.input);if(!K)throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");if(!Xz0(K))throw Error(`File not found: ${K}`);let q=wI(K);if(Q==="preview"){console.log(JSON.stringify(await WI(q.fileBuffer,q.fileName),null,2));return}if(Q!=="push")throw Error("Usage: seal-use webhook material-pack <preview|push> <材料包.zip>");let H=S(J.options.webhook)??S(J.options.selector),G=await w5(U,Y.seal.endpoints.approvalStylePreferences),W;if(H)W=A9(G,H);else if(G.length===1)W=G[0],console.error(`\uD83D\uDC49 自动锁定唯一可用 Webhook 通道: ${W.name} (${W.id})`);else if(G.length>1){let Z=G.map((V)=>`"${V.name}" (${V.id})`).join(", ");throw Error(`当前租户存在多个 Webhook 通道 [${Z}],请通过 --webhook <idOrName> 指定目标通道。`)}else throw new d$("当前租户未配置任何 Webhook 集成通道。",1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`);let w=await MD(q.fileBuffer,q.fileName,{webhookUrl:W.incomingDocumentWebhook.url,secret:W.secret,materialPackFilePolicy:W.materialPackFilePolicy});console.log(JSON.stringify(w,null,2));return}if($==="list"){await F0("seal_webhook_list",U,Y,{query:S(J.options.query)??S(J.options.keyword),includeSecret:hu(J.options)},V0(J.options));return}if($==="get"||$==="find"){let Q=I??S(J.options.selector)??S(J.options.id);if(!Q)throw Error("Usage: seal-use webhook get <idOrName> [--show-secret]");await F0("seal_webhook_get",U,Y,{selector:Q,includeSecret:hu(J.options)},V0(J.options));return}if($==="add"||$==="create"){let Q=S(J.options.name)??I,K=S(J.options.resultUrl)??S(J.options["result-url"])??S(J.options.outgoingResultWebhook)??S(J.options["outgoing-result-webhook"]);if(!Q||!K)throw Error("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");let q=yu(J.options),H=MH(J.options),G=O0(J.options.dryRun)??O0(J.options["dry-run"]);await F0("seal_webhook_add",U,Y,{name:Q,mode:gu(S(J.options.mode)),outgoingResultWebhook:K,autoApprovalRate:q,secret:S(J.options.secret),materialPackFilePolicy:H,dryRun:G},V0(J.options));return}if($==="update"){let Q=I??S(J.options.selector)??S(J.options.id);if(!Q)throw Error("Usage: seal-use webhook update <idOrName> [options]");let K=S(J.options.secret),q=O0(J.options.rotateSecret)??O0(J.options["rotate-secret"]);if(K!==void 0&&q)throw F4("Use either --secret or --rotate-secret, not both");let H=S(J.options.name),G=gu(S(J.options.mode)),W=S(J.options.resultUrl)??S(J.options["result-url"])??S(J.options.outgoingResultWebhook)??S(J.options["outgoing-result-webhook"]),w=yu(J.options),Z=MH(J.options),V=O0(J.options.dryRun)??O0(J.options["dry-run"]);if(H===void 0&&G===void 0&&W===void 0&&w===void 0&&K===void 0&&!q&&Z===void 0&&!V)throw F4("Webhook update requires at least one field option");await F0("seal_webhook_update",U,Y,{selector:Q,name:H,mode:G,outgoingResultWebhook:W,autoApprovalRate:w,secret:K,rotateSecret:q,materialPackFilePolicy:Z,dryRun:V},V0(J.options));return}if($==="delete"){let Q=I??S(J.options.selector)??S(J.options.id),K=O0(J.options.dryRun)??O0(J.options["dry-run"]);if(!Q)throw Error("Usage: seal-use webhook delete <idOrName> [--yes|--dry-run]");if(O0(J.options.yes)!==!0&&!K)throw s8("Refusing to delete Webhook integration without --yes",`seal-use webhook delete ${Q} --corp ${Y.id} --yes`);await F0("seal_webhook_delete",U,Y,{selector:Q,confirm:!0,dryRun:K},V0(J.options));return}throw Error(`Unknown webhook command: ${$??""}. Run 'seal-use help' for available commands.`)}async function Dz0($,I,U,Y,J){if($==="replay"){await gD("replay",I,U,Y,J);return}if($==="summary"){let Q=await XI("seal_approval_runs_summary",U,Y,{date:S(J.options.date),timezone:S(J.options.timezone),limit:n0(J.options.limit),startDate:S(J.options.startDate),endDate:S(J.options.endDate),status:S(J.options.status),taskMode:S(J.options.taskMode),manualApprovalStatus:S(J.options.manualApprovalStatus),sourceDocumentSN:S(J.options.sourceDocumentSN),sourceDocumentId:S(J.options.sourceDocumentId),humanResult:S(J.options.humanResult),query:S(J.options.query
Line truncated
|
||||
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Q=S1(Y),K=S1(J);if(Q.id===K.id)throw F4(`Cannot bind enterprise '${Q.id}' to itself.`);if(Q.prodCorpId&&Q.prodCorpId!==K.id)throw F4(`Cannot use '${Q.id}' as a production enterprise because it is already registered as a test enterprise for '${Q.prodCorpId}'. Multi-tier chaining is not permitted.`);if(K.testCorpId&&K.testCorpId!==Q.id)throw F4(`Cannot bind '${K.id}' as a test enterprise because it already has a bound test enterprise '${K.testCorpId}'. Multi-tier chaining is not permitted.`);let q=O0(U.options.force)===!0;if(Q.testCorpId&&Q.testCorpId!==K.id||K.prodCorpId&&K.prodCorpId!==Q.id){if(!q)throw s8(`Enterprise binding conflict: production enterprise '${Q.id}' is bound to '${Q.testCorpId??"none"}', and test enterprise '${K.id}' is bound to '${K.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${Q.id} ${K.id} --confirm --force`)}if(!(O0(U.options.confirm)===!0||O0(U.options.yes)===!0)){let w=q?" --force":"";throw s8(`Refusing to bind test enterprise '${K.name}' (${K.id}) to production enterprise '${Q.name}' (${Q.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${K.id}' as a test environment.`,`seal-use corps bind-test ${Q.id} ${K.id} --confirm${w}`)}if(Q.testCorpId&&Q.testCorpId!==K.id)try{N7(Q.testCorpId,{prodCorpId:void 0})}catch{}if(K.prodCorpId&&K.prodCorpId!==Q.id)try{N7(K.prodCorpId,{testCorpId:void 0})}catch{}let G=N7(Q.id,{environment:"production",testCorpId:K.id}),W=N7(K.id,{environment:"test",prodCorpId:Q.id});E0({success:!0,productionEnterprise:{id:G.id,name:G.name,environment:G.environment,testCorpId:G.testCorpId},testEnterprise:{id:W.id,name:W.name,environment:W.environment,prodCorpId:W.prodCorpId}});return}if($==="unbind-test"){let Y=I??S(U.options.corp),J=S1(Y);if(!J.testCorpId&&!J.prodCorpId){E0({unbound:!1,message:`Enterprise '${J.name}' (${J.id}) does not have an active test enterprise binding.`});return}let Q=J.testCorpId?J.id:J.prodCorpId,K=J.testCorpId?J.testCorpId:J.id;if(!(O0(U.options.confirm)===!0||O0(U.options.yes)===!0))throw s8(`Refusing to unbind production enterprise '${Q}' and test enterprise '${K}' without --confirm.`,`seal-use corps unbind-test ${J.id} --confirm`);N7(Q,{testCorpId:void 0});try{N7(K,{prodCorpId:void 0})}catch{}E0({success:!0,unboundProduction:Q,unboundTest:K});return}if($==="sync-test"){let Y=I??S(U.options.corp),J=S1(Y);if(!J.testCorpId)throw F4(`Production enterprise '${J.name}' (${J.id}) has no bound test enterprise.
|
||||
Run 'seal-use corps bind-test ${J.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Q=S1(J.testCorpId);if(Q.environment!=="test")throw Error(`Target enterprise '${Q.name}' (${Q.id}) is marked as '${Q.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let K=await u1(J),q=await u1(Q),[H,G,W,w,Z,V,X,L]=await Promise.all([M1(K,J.seal.endpoints.approvalStylePreferences).catch(()=>({})),M1(q,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),_6(K),_6(q),R$(K).catch(()=>[]),R$(q).catch(()=>[]),M9(K,{limit:100}).catch(()=>({articles:[]})),M9(q,{limit:100}).catch(()=>({articles:[]}))]),D=(X.articles||[]).filter((Q0)=>!Q0.isDeleted),O=(L.articles||[]).filter((Q0)=>!Q0.isDeleted),P=new Map(O.map((Q0)=>[Q0.title.trim(),Q0])),T=[],A=[],R=new Set(D.map((Q0)=>Q0.title.trim()));for(let Q0 of D){let R0=Q0.title.trim(),U1=P.get(R0);if(!U1)T.push(Q0);else{let O1=U1.content!==Q0.content,i4=(U1.purpose??"")!==(Q0.purpose??""),f6=U1.enabled!==Q0.enabled,F$=U1.contentType!==Q0.contentType,i6=(U1.status??"")!==(Q0.status??""),P6=JSON.stringify([...U1.scenarios??[]].sort())!==JSON.stringify([...Q0.scenarios??[]].sort()),N$=JSON.stringify([...U1.tags??[]].sort())!==JSON.stringify([...Q0.tags??[]].sort());if(O1||i4||f6||F$||i6||P6||N$)A.push({testId:U1.id,prodDoc:Q0,reasons:[...O1?["content"]:[],...i4?["purpose"]:[],...f6?["enabled"]:[],...F$?["contentType"]:[],...i6?["status"]:[],...P6?["scenarios"]:[],...N$?["tags"]:[]]})}}let x=O.filter((Q0)=>!R.has(Q0.title.trim())),f=[...Z].sort((Q0,R0)=>R0.versionNumber-Q0.versionNumber)[0],j=f?.versionNumber,n=([...V].sort((Q0,R0)=>R0.versionNumber-Q0.versionNumber)[0]?.versionNumber??0)+1,g=yz0(J.name,j,V),b=S(U.options["version-name"])??S(U.options.versionName)??hz0(J.name,j,g,n),U0={...G,tone:H.tone,language:H.language,detailLevel:H.detailLevel,outputFormat:H.outputFormat,examples:H.examples??[],prohibitedPhrases:H.prohibitedPhrases??[],customInstructions:H.customInstructions,decisionPreferences:H.decisionPreferences,thinkingDepthPreference:H.thinkingDepthPreference};if(O0(U.options["dry-run"])===!0||O0(U.options.dryRun)===!0){E0({dryRun:!0,source:{id:J.id,name:J.name,environment:J.environment,latestPublishedVersion:f?{versionNumber:f.versionNumber,versionName:f.versionName}:null,documentsCount:D.length},target:{id:Q.id,name:Q.name,environment:Q.environment},versionMappingPlan:{sourceProdVersionNumber:j??null,sourceProdVersionName:f?.versionName??null,targetTestExpectedVersionNumber:n,targetTestPublishVersionName:b,iteration:g},preferencesDiff:{decisionPreferences:{before:G.decisionPreferences,after:H.decisionPreferences},thinkingDepthPreference:{before:G.thinkingDepthPreference,after:H.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:W.rules.length,targetExistingDraftRuleCount:w.rules.length,toDeleteCount:w.rules.length,toCreateCount:W.rules.length,rulesToSync:W.rules.map((Q0,R0)=>({index:R0+1,sourceRuleId:Q0.id,sourceRuleCode:Q0.code??R0+1,expectedTargetCode:`rule-${R0+1}`,description:Q0.description,scope:Q0.scope,strictness:Q0.strictness}))},documentsPlan:{sourceDocumentCount:D.length,targetExistingDocumentCount:O.length,toCreateCount:T.length,toCreate:T.map((Q0)=>({title:Q0.title,purpose:Q0.purpose,contentType:Q0.contentType,scenarios:Q0.scenarios})),toUpdateCount:A.length,toUpdate:A.map((Q0)=>({targetDocumentId:Q0.testId,title:Q0.prodDoc.title,reasons:Q0.reasons})),toDeleteCount:x.length,toDelete:x.map((Q0)=>({targetDocumentId:Q0.id,title:Q0.title}))},publishingPlan:{targetCorpId:Q.id,publishVersionName:b,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(J.source.type!=="hose")return{sourceType:J.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let Q0=(H.integrations??[]).filter((O1)=>O1.type==="hosecloud"),R0=new Set,U1=Q0.filter((O1)=>{let i4=O1.corporationId??J.id;if(R0.has(i4))return!1;return R0.add(i4),!0});return{sourceType:"hose",outboundName:bz0(J.name),targetMode:"assisted",integrationsCount:U1.length,integrations:U1.map((O1)=>({corporationId:O1.corporationId,apiOrigin:O1.apiOrigin,customApiUrl:O1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(O0(U.options.yes)===!0||O0(U.options.confirm)===!0))throw s8(`Refusing to overwrite test enterprise '${Q.name}' (${Q.id}) with preferences, ${W.rules.length} draft rules, and ${D.length} knowledge documents from production enterprise '${J.name}' (${J.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 ${J.id} --yes`);await M8(q,U0,Q.seal.endpoints.approvalStylePreferences);let c=[];for(let Q0 of x)await aw(q,Q0.id),c.push({id:Q0.id,title:Q0.title});let r=[];for(let Q0 of A)await tw(q,Q0.testId,{title:Q0.prodDoc.title,purpose:Q0.prodDoc.purpose,content:Q0.prodDoc.content,contentType:Q0.prodDoc.contentType,status:Q0.prodDoc.status,enabled:Q0.prodDoc.ena
Line truncated
|
||||
- `);throw Error(`Missing required parameter: staffId. Found ${j.length} candidate administrators:
|
||||
`}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
|
||||
- `);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(!W&&Q)L=Q;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let D=m1($,"id")??Z,O=V??Z,P=m1($,"sealUrl")??`https://${Z.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:w,appKey:U,appSecurity:Y,corpId:Z,staffId:L},auth:{refreshTtl:300}};if(W)Sw(D),await gJ(T);let A=Mh();kz0(A,{recursive:!0,mode:448});let R=fz0(A,`${Su(D)}.json`);if(uz0(R)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${R}. Pass "overwrite": true to replace it.`);xz0(R,`${JSON.stringify(T,null,2)}
|
||||
`,{mode:384}),E0({id:D,name:O,corpId:Z,domain:w,staffId:L,verified:W,path:R})}async function kG1($){let I=P7($,"token"),U=(m1($,"sealUrl")??m1($,"url")??"").replace(/\/+$/,"");if(!U)throw Error("Missing required JSON field: sealUrl");let Y=eZ0($,"expiresIn")??2592000,J=$.force===!0||$.verify===!1?!1:!0,Q=nz0($),K=J?await fG1(U,I,X2(Q)):void 0;pz0($,{token:I,sealUrl:U,expiresIn:Y,verify:J,remote:K,custom:Q})}function nz0($){return{headers:Dh.parse($.headers),cookies:Oh.parse($.cookies)}}async function xG1($,I,U){let Y=await gw($),J=L2(Y.sealUrl,Y.token),Q=await G$(J),K={user:Q.user,tenant:Q.tenant};yw(Y.corpId,K.tenant),pz0({id:Y.corpId,corpId:Y.corpId,name:I,provider:"hosecloud",overwrite:U},{token:Y.token,sealUrl:Y.sealUrl,expiresIn:Y.expiresIn,verify:!0,remote:K})}function pz0($,I){let{token:U,sealUrl:Y,expiresIn:J,verify:Q,remote:K}=I,q=I.custom??nz0($),H=K?.user,G=K?.tenant,W=m1($,"tenantSlug")??T7(G?.tenantSlug),w=m1($,"tenantId")??T7(G?.id),Z=m1($,"tenantName")??T7(G?.name),V=m1($,"id")??W??w;if(!V)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let X=m1($,"staffId")??T7(H?.providerUserId)??T7(H?.id)??"seal",L=m1($,"provider")??T7(H?.provider)??T7(G?.providerConfig?.provider),D=m1($,"corpId")??W??w??V,O={id:V,name:m1($,"name")??Z??V,environment:"production",seal:{url:Y,tenantSlug:W,headers:q.headers,cookies:q.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:U,sealUrl:Y,expiresIn:J,staffId:X,corpId:D,tenantId:w,tenantSlug:W,tenantName:Z,providerUserId:T7(H?.providerUserId),provider:L},auth:{refreshTtl:300}},P=Mh();kz0(P,{recursive:!0,mode:448});let T=fz0(P,`${Su(V)}.json`);if(uz0(T)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${T}. Pass "overwrite": true to replace it.`);xz0(T,`${JSON.stringify(O,null,2)}
|
||||
`,{mode:384}),E0({id:V,name:O.name,tenantId:w,tenantSlug:W,verified:Q,path:T})}async function fG1($,I,U={}){let Y=await iG1(`${$}/api/v1/auth/me`,{...U,authorization:`Bearer ${I}`}),J=uD(Y.data);return{user:uD(J.user??Y.user),tenant:uD(J.tenant??Y.tenant)}}async function iG1($,I={}){let U=await fetch($,{headers:I}),Y=await U.text();if(!U.ok)throw Error(`${U.status} ${Y}`);let J=JSON.parse(Y);return uD(J)}function uD($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function T7($){return typeof $==="string"&&$?$:void 0}async function cz0($,I){let U=await gw($),Y=L2(U.sealUrl,U.token),J=await G$(Y);yw(U.corpId,J.tenant);let Q=await EU(Y,{note:I});E0({tenant:{id:J.tenant.id,name:J.tenant.name,tenantSlug:J.tenant.tenantSlug,corpId:U.corpId},user:{id:J.user.id,name:J.user.name,providerUserId:J.user.providerUserId,isAdmin:J.user.isAdmin},delegation:Q,expiresIn:U.expiresIn})}async function dz0($,I,U,Y,J){if($==="list"){await F0("seal_delegation_list",U,Y,{},V0(J.options));return}if($==="create"){let Q=S(J.options.note)??(I?[I,...J.command.slice(2)].join(" "):void 0);await F0("seal_delegation_create",U,Y,{note:Q},V0(J.options));return}if($==="revoke"){let Q=I??S(J.options.tokenId);if(!Q)throw Error("Usage: seal-use delegation revoke <tokenId>");await F0("seal_delegation_revoke",U,Y,{tokenId:Q},V0(J.options));return}throw Error(`Unknown delegation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as bG1}from"node:fs";async function mz0($,I,U,Y,J,Q){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,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]
|
||||
|
||||
`+`支持的审批系统与发布目标:
|
||||
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
|
||||
@@ -342,25 +342,25 @@ Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an a
|
||||
`+` • feishu (飞书审批): 建议使用 Webhook 模式对接
|
||||
`+` • weaver (泛微 OA): 建议使用 Webhook 模式对接
|
||||
`+` • helios (汇联易): 建议使用 Webhook 模式对接
|
||||
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let G=$==="maycur"?"每刻报销":"汇联易";throw Error(`${G}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${G}' --result-url <url> --corp <corpId>`)}let K=$==="hosecloud",q=$==="hosecloud"?I:$,H=$==="hosecloud"?U:I;if(!K)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(q==="requirements"){await F0("seal_deploy_hosecloud_requirements",Y,J,{},V0(Q.options));return}if(q==="list"){await F0("seal_deploy_hosecloud_list",Y,J,{},V0(Q.options));return}if(q==="get"){let G=H??S(Q.options.signKey)??S(Q.options["sign-key"]);if(!G){let w=((await M1(Y)).integrations??[]).filter((Z)=>Z.type==="hosecloud");if(w.length===0)throw Error(`当前企业 (${J.name}) 尚未添加合思发布配置。
|
||||
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${J.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${J.id}]
|
||||
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let Z of w){let V=Z.outboundName??"SealAI 审批",X=Z.signKey,L=Z.apiOrigin??"production";console.error(` • "${V}" (signKey: ${X}, 环境: ${L})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${X} --corp ${J.id}
|
||||
`)}throw new d$("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,w.length===1?`seal-use deploy hosecloud get ${w[0].signKey} --corp ${J.id}`:void 0)}await F0("seal_deploy_hosecloud_get",Y,J,{signKey:G},V0(Q.options));return}if(q==="status"){await F0("seal_deploy_hosecloud_status",Y,J,{},V0(Q.options));return}if(q==="configure"){let G=S(Q.options.input),W=G?JSON.parse(bG1(G,"utf8")):U$(Q.json);if(!W||Object.keys(W).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await F0("seal_deploy_hosecloud_configure",Y,J,{...W,dryRun:O0(Q.options.dryRun)??O0(Q.options["dry-run"])},V0(Q.options));return}if(q==="sync"){let G=H??S(Q.options.signKey)??S(Q.options["sign-key"]),W=O0(Q.options.auto)??O0(Q.options.yes);if(!G){let Z=((await M1(Y)).integrations??[]).filter((X)=>X.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${J.name}) 尚未添加合思发布配置。
|
||||
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${J.id}`);let V=Z[0];if(V&&Z.length===1&&W){let X=V.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${X})`),await F0("seal_deploy_hosecloud_sync",Y,J,{signKey:X},V0(Q.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${J.id}]
|
||||
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of Z){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 ${J.id}
|
||||
`)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${J.id}
|
||||
`);throw new d$("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${J.id}`:void 0)}await F0("seal_deploy_hosecloud_sync",Y,J,{signKey:G},V0(Q.options));return}throw Error(`Unknown deploy hosecloud action: ${q??""}. Available: requirements, list, get, status, configure, sync.`)}import{createServer as mG1}from"node:http";import{URL as pG1}from"node:url";var lz0={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.
|
||||
`+" • 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}) 尚未添加合思发布配置。
|
||||
`+`\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}
|
||||
`)}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
|
||||
`},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${Y1})</title>
|
||||
<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 {
|
||||
@@ -379,13 +379,13 @@ selection, source authentication, response compaction, and diagnostics-friendly
|
||||
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
|
||||
></script>
|
||||
</body>
|
||||
</html>`}async function f4($,I,U,Y){let J=$.handler;return J(I,U,{corp:Y})}async function rz0($,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 U=$.headers.host||"localhost",Y=$.headers["x-forwarded-proto"]||"http",J=new pG1($.url||"/",`${Y}://${U}`),Q=J.pathname.replace(/\/+$/,"")||"/",K=($.method||"GET").toUpperCase();try{if(K==="GET"&&Q==="/"){t1(I,200,{name:"seal-use",version:Y1,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(K==="GET"&&Q==="/docs"){dG1(I,200,oz0());return}if(K==="GET"&&Q==="/openapi.json"){t1(I,200,kD());return}if(K==="GET"&&Q==="/health"){t1(I,200,{status:"ok",version:Y1,name:"seal-use",timestamp:new Date().toISOString()});return}if(K==="POST"&&(Q==="/shutdown"||Q==="/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(K==="POST"&&Q==="/api/cli"){let q=await fD($),H=(typeof q?.command==="string"?q.command:"").trim();if(!H){xD(I,400,"Missing 'command' property in request body");return}let G=fu(H),W=G[0]==="seal-use"||G[0]==="seal-home"||G[0]?.endsWith("/seal-use")||G[0]?.endsWith("/seal-home")?G.slice(1):G,w=await EH(W),Z=void 0;try{if(w.stdout.trim().startsWith("{")||w.stdout.trim().startsWith("["))Z=JSON.parse(w.stdout)}catch{}t1(I,w.isError?400:200,{success:!w.isError,stdout:w.stdout,stderr:w.stderr,exitCode:w.exitCode,data:Z});return}if(K==="POST"&&Q.startsWith("/api/tool/")){let q=Q.slice(10).trim(),H=S4(q);if(!H){xD(I,404,`Tool not found: '${q}'`);return}let G=await fD($)||{},W=x6($,J,G),w=S1(W),Z=await u1(w),V={...G};delete V.corp;let X=await f4(H,Z,V,w);t1(I,200,X);return}if(Q.startsWith("/v1/")){if(await cG1($,I,K,Q,J))return}xD(I,404,`Cannot ${K} ${Q}. Visit /docs for available endpoints.`)}catch(q){let H=q instanceof Error?q.message:String(q);xD(I,500,H)}}async function cG1($,I,U,Y,J){let Q=Object.fromEntries(J.searchParams.entries());if(U==="GET"&&Y==="/v1/corps"){let K=o8(),q=O4();return t1(I,200,{count:K.length,mode:q.stateful?"stateful":"stateless",defaultCorpId:q.defaultCorpId,corps:K.map((H)=>({id:H.id,name:H.name,sourceType:H.source.type,sealUrl:H.seal?.url}))}),!0}if(U==="GET"&&Y==="/v1/whoami"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_whoami"),W=await f4(G,H,{},q);return t1(I,200,W),!0}if(U==="GET"&&Y==="/v1/session"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_session_get"),W=await f4(G,H,{},q);return t1(I,200,W),!0}if(U==="GET"&&Y==="/v1/approval-runs/summary"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_approval_runs_summary"),W=await f4(G,H,Q,q);return t1(I,200,W),!0}if(U==="GET"&&Y==="/v1/approval-runs/stats"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_approval_runs_stats"),W=await f4(G,H,Q,q);return t1(I,200,W),!0}if(U==="GET"&&Y==="/v1/approval-runs/pick"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_approval_run_pick"),W=await f4(G,H,Q,q);return t1(I,200,W),!0}if(U==="GET"&&Y==="/v1/approval-runs/url"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_approval_run_url_get"),W=await f4(G,H,Q,q);return t1(I,200,W),!0}if(Y.startsWith("/v1/approval-runs/")){let K=Y.slice(18).split("/"),q=K[0],H=K[1];if(q&&!["summary","pick","stats","url","bridge"].includes(q)){let G=x6($,J,Q),W=S1(G),w=await u1(W);if(!H){let Z=S4("seal_approval_run_get"),V=await f4(Z,w,{recordId:q,...Q},W);return t1(I,200,V),!0}if(H==="attachments"){let Z=S4("seal_approval_run_attachments_get"),V=await f4(Z,w,{recordId:q,...Q},W);return t1(I,200,V),!0}if(H==="cited-rules"){let Z=S4("seal_approval_run_cited_rules_get"),V=await f4(Z,w,{recordId:q,...Q},W);return t1(I,200,V),!0}if(H==="document-summary"){let Z=S4("seal_approval_run_document_summary_get"),V=await f4(Z,w,{recordId:q,...Q},W);return t1(I,200,V),!0}if(H==="result"){let Z=S4("seal_approval_run_result_get"),V=await f4(Z,w,{recordId:q,...Q},W);return t1(I,200,V),!0}}}if(U==="GET"&&Y==="/v1/approval-runs"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_approval_runs_search"),W=await f4(G,H,{...Q,limit:Q.limit?Number(Q.limit):void 0,offset:Q.offset?Number(Q.offset):void 0,includeBridge:Q.includeBridge==="true"},q);return t1(I,200,W),!0}if(U==="GET"&&Y==="/v1/approval/rules"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_approval_rules_list"),W=await f4(G,H,Q,q);return t1(I,200,W),!0}if(U==="GET"&&Y==="/v1/simulation/batches"){let K=x6($,J,Q),q=S1(K),H=await u1(q),G=S4("seal_simulation_batches_list"),W=await f4(G,H,Q,q);return t1(I,200,W),!0}if(U==="POST"&&Y==="/v1/simulation/create-batch"){let K=await fD($)||{},q=x6($,J,K),H=S1(q),G=await u1Line truncated
|
||||
\uD83D\uDE80 seal-use HTTP Server (v${Y1}) started`),console.error(` URL: http://${U}:${I}`),console.error(` Docs: http://${U}:${I}/docs`),console.error(` OpenAPI: http://${U}:${I}/openapi.json`),console.error(` CLI Exec: POST http://${U}:${I}/api/cli`),console.error(` REST API: http://${U}:${I}/v1/...
|
||||
`);J(Y)})})}async function tz0($){let I=n0($.options.port)??n0($.options.p),U=S($.options.host)??S($.options.h),Y=await nD({port:I,host:U}),J=()=>{Y.close(()=>{process.exit(0)})};process.on("SIGINT",J),process.on("SIGTERM",J),await new Promise(()=>{})}async function az0($,I,U,Y){if($==="config"||$==="get"){await F0("seal_llm_config_get",I,U,{},V0(Y.options));return}if($==="providers"||$==="list"){await F0("seal_llm_providers_list",I,U,{},V0(Y.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}async function sz0($,I){if($==="config"||$==="json"){iu();return}await bu()}function iu(){E0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function ez0($){let I=kD();E0(I,{...V0($.options),allowFull:!0})}async function $X0($,I,U,Y){if($==="available"){await F0("seal_permissions_available_list",I,U,{},V0(Y.options));return}if($==="configs"||$==="list"){await F0("seal_permissions_configs_list",I,U,{},V0(Y.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}import{readFileSync as IX0}from"node:fs";async function UX0($,I,U,Y,J,Q,K){if(!$||$==="get"){await F0("seal_preference_get",J,Q,{},V0(K.options));return}if($==="decision"){if(I==="update"||!I){let q=S(K.options.input),H=q?JSON.parse(IX0(q,"utf8")):U$(K.json);if(!H||Object.keys(H).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await F0("seal_preference_decision_update",J,Q,{...H,dryRun:O0(K.options.dryRun)??O0(K.options["dry-run"])},V0(K.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let q=S(K.options.default)??S(K.options.level)??Y;if(q!=="medium"&&q!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await F0("seal_preference_thinking_depth_set",J,Q,{defaultLevel:q,dryRun:O0(K.options.dryRun)??O0(K.options["dry-run"])},V0(K.options));return}if(I==="policies"){if(U==="list"||!U){await F0("seal_preference_thinking_depth_policies_list",J,Q,{},V0(K.options));return}if(U==="upsert"){let q=S(K.options.input),H=q?JSON.parse(IX0(q,"utf8")):U$(K.json);if(!H||!H.id||!H.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await F0("seal_preference_thinking_depth_policies_upsert",J,Q,{...H,dryRun:O0(K.options.dryRun)??O0(K.options["dry-run"])},V0(K.options));return}if(U==="remove"||U==="delete"){let q=Y??S(K.options.id)??S(K.options.policyId);if(!q)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await F0("seal_preference_thinking_depth_policies_remove",J,Q,{policyId:q,dryRun:O0(K.options.dryRun)??O0(K.options["dry-run"])},V0(K.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}async function YX0($={}){let I=o8(),U=O4(),Y=AJ(I,{stateful:U.stateful,defaultCorpId:U.defaultCorpId,corpId:$.corpId},JI());console.log(`[probe] corp=${Y.id} source=${Y.source.type}`);let J=await gJ(Y);console.log("[probe] seal enterprise"),console.log(JSON.stringify(J,null,2));let Q=await u1(Y),K=await $V(Q,{documentLimit:20,stylePreferencesEndpoint:Y.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:K.rules.rules.length,hasPendingRuleDeletes:K.rules.hasPendingDeletes,documents:K.documents.articles.length,documentsTotal:K.documents.total,stylePreferences:K.stylePreferences.ok?"ok":`error: ${K.stylePreferences.error}`},null,2))}async function JX0($,I,U){let Y=I??S(U.options.corp)??($&&$!=="--corp"?$:void 0);await YX0({corpId:Y})}async function nu($,I,U,Y,J){if($==="count"){await F0("seal_approval_rules_list",U,Y,{countOnly:!0},V0(J.options));return}if($==="list"){if(O0(J.options.count)){await F0("seal_approval_rules_list",U,Y,{countOnly:!0},V0(J.options));return}let Q=n0(J.options.limit),K=n0(J.options.offset);if(O0(J.options.summary)){await F0("seal_approval_rules_list",U,Y,{fields:Hz0,limit:Q,offset:K},V0(J.options));return}let q=await XI("seal_approval_rules_list",U,Y,{limit:Q,offset:K});Gz0(q,O0(J.options.full)===!0),E0(q);return}if($==="clear"){let Q=O0(J.options.yes)===!0,K=O0(J.options.dryRun)??O0(J.options["dry-run"])??!Q;if(!Q&&!K)throw s8("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${Y.id} --dry-run`);let q=await XI("seal_approval_rules_clear",U,Y,{dryRun:K,recode:O0(J.options.recode)});if(!Q&&K&&q&&typeof q==="object"){E0({...q,nextCommand:`seal-use rules clear --corp ${Y.id} --yes`},V0(J.options));return}E0(q,V0(J.options));return}if($==="versions"){await F0("seal_approval_rule_versions_list",U,Y,{},V0(J.options));return}if($==="version"){let Q=I??S(J.options.version);if(!Q)throw Error("Usage: seal-use rules version <versionId|versionNumber|l
Line truncated
|
||||
`).filter(Boolean),Q=J.slice(-I);return{logFile:U,lines:Q,totalLines:J.length}}async function aG1($){let I=mD($),U=du($),Y=BH($);HX0($.stateDir);let J=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):iD),Q=$.host??(process.env.HOST?process.env.HOST:bD);cD(I,`${process.pid}
|
||||
`,{mode:384}),cD(U,JSON.stringify({pid:process.pid,port:J,host:Q,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),yJ(Y,`service starting on http://${Q}:${J} pid=${process.pid}`);let K=null;try{K=await nD({port:J,host:Q,silent:!0}),yJ(Y,`service listening pid=${process.pid}`)}catch(H){if(yJ(Y,`service failed to bind port ${J}: ${H instanceof Error?H.message:String(H)}`),dD(I)===process.pid)e8(I,{force:!0}),e8(U,{force:!0});throw H}let q=()=>{if(K)K.close(),K=null;if(dD(I)===process.pid)e8(I,{force:!0}),e8(U,{force:!0});yJ(Y,`stopped pid=${process.pid}`)};await new Promise((H)=>{let G=!1,W=()=>{if(G)return;G=!0,q(),process.off("SIGTERM",W),process.off("SIGINT",W),H()};process.once("SIGTERM",W),process.once("SIGINT",W)})}function QX0($){HX0($.stateDir);let I=hJ($);if(I.running)return I;let U=$.launcher??{command:process.execPath,args:[$.entryFile]},Y=[...U.args??[],"service","run"];if($.port)Y.push("--port",String($.port));if($.host)Y.push("--host",String($.host));let J=lG1(U.command,Y,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});J.unref();let Q=mD($);return cD(Q,`${J.pid}
|
||||
`,{mode:384}),yJ(BH($),`started pid=${J.pid}`),{started:!0,...hJ($)}}function KX0($,I={}){let U=mD($),Y=du($),J=dD(U);if(!J||!qX0(J,$.appRoot))return e8(U,{force:!0}),e8(Y,{force:!0}),I.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(J,"SIGTERM"),e8(U,{force:!0}),e8(Y,{force:!0}),yJ(BH($),`stop requested pid=${J}`),I.quiet?void 0:{stopped:!0,pid:J}}function qX0($,I){if(!sG1($))return!1;try{let U=oG1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(U.includes(I)||U.includes("seal-use")||U.includes("src/cli.ts"))&&U.includes("service")&&U.includes("run")}catch{return!1}}function sG1($){try{return process.kill($,0),!0}catch{return!1}}function mD($){return cu($.stateDir,"service.pid")}function du($){return cu($.stateDir,"service.json")}function BH($){return cu($.stateDir,"service.log")}function dD($){if(!pD($))return;let I=Number(pu($,"utf8").trim());return Number.isInteger(I)&&I>0?I:void 0}function HX0($){rG1($,{recursive:!0,mode:448})}function yJ($,I){cD($,`${new Date().toISOString()} ${I}
|
||||
`,{flag:"a",mode:384})}var mu=$W1(eG1(),".config","seal-use");async function lu($,I,U){let Y=U?n0(U.options.port)??n0(U.options.p):void 0,J=U?S(U.options.host)??S(U.options.h):void 0,Q=U?n0(U.options.lines)??n0(U.options.n):void 0,K=await LI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:mu,version:Y1,launcher:I.launcher,port:Y,host:J},{maxLines:Q});if(K!==void 0)E0(K)}import{existsSync as IW1,readFileSync as GX0}from"node:fs";async function WX0($,I,U,Y,J){if($==="batch-records"||$==="records"){let Q=I??S(J.options.batchId)??S(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation batch-records <batchId>");await F0("seal_simulation_batch_records_get",U,Y,{batchId:Q,query:S(J.options.query)},V0(J.options));return}if($==="create"||$==="run"){let Q=S(J.options.mode)??S(J.options.sourceSystem)??S(J.options["source-system"])??"hosecloud",K=Q==="material-pack"?"material_pack":Q,q=S(J.options.schemaConfig)??S(J.options["schema-config"]),H=q?JSON.parse(GX0(q,"utf8")):void 0,G=S(J.options.input),W=G?JSON.parse(GX0(G,"utf8")):U$(J.json),w=S(J.options.packageId)??S(J.options["package-id"]),Z=V6(J.options.packageIds)??V6(J.options["package-ids"])??(w?[w]:void 0),V=V6(J.options.flowIds)??V6(J.options["flow-ids"])??V6(J.options.documentSn)??V6(J.options["document-sn"]),X=S(J.options.signKey)??S(J.options["sign-key"])??S(J.options.integration),L=O0(J.options.noWait)??O0(J.options["no-wait"]);await F0("seal_simulation_batch_create",U,Y,{mode:K,sourceSystem:K,flowIds:V,documentSn:V,rejectNodeName:S(J.options.rejectNode)??S(J.options["reject-node"])??null,thinkingDepthOverride:S(J.options.thinkingDepth)??S(J.options["thinking-depth"]),skipInvoiceGeneration:O0(J.options.skipInvoiceGeneration)??O0(J.options["skip-invoice-generation"]),skipExpenseExtraction:O0(J.options.skipExpenseExtraction)??O0(J.options["skip-expense-extraction"]),disableAttachmentCache:O0(J.options.disableAttachmentCache)??O0(J.options["disable-attachment-cache"]),signKey:X,packageIds:Z,packageId:w,templateId:S(J.options.templateId)??S(J.options["template-id"]),schemaConfig:H,requestIds:V6(J.options.requestIds)??V6(J.options["request-ids"]),workflowTypeId:S(J.options.workflowTypeId)??S(J.options["workflow-type-id"]),flowStatusList:V6(J.options.flowStatusList)?.map(Number)??V6(J.options["flow-status-list"])?.map(Number),businessCodes:V6(J.options.businessCodes)??V6(J.options["business-codes"]),documentType:S(J.options.documentType)??S(J.options["document-type"]),startTime:n0(J.options.startTime)??n0(J.options["start-time"]),endTime:n0(J.options.endTime)??n0(J.options["end-time"]),status:V6(J.options.status),limit:n0(J.options.limit),noWait:L,rawParams:W},V0(J.options));return}if($==="wait"){let Q=I??S(J.options.batchId)??S(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await F0("seal_simulation_batch_wait",U,Y,{batchId:Q,timeout:S(J.options.timeout),pollInterval:S(J.options.pollInterval)??S(J.options["poll-interval"])},V0(J.options));return}if($==="status"){let Q=I??S(J.options.batchId)??S(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation status <batchId>");await F0("seal_simulation_batch_status",U,Y,{batchId:Q},V0(J.options));return}if($==="clean"||$==="delete"){let Q=I??S(J.options.batchId)??S(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation clean <batchId>");await F0("seal_simulation_batch_clean",U,Y,{batchId:Q},V0(J.options));return}if($==="specifications"){let Q=I??S(J.options.integration)??S(J.options.signKey)??S(J.options["sign-key"]);await F0("seal_simulation_specifications_list",U,Y,{signKey:Q},V0(J.options));return}if($==="approval-definitions"||$==="definitions"){await F0("seal_simulation_feishu_approval_definitions_list",U,Y,{},V0(J.options));return}if($==="list"){await F0("seal_simulation_batches_list",U,Y,{limit:n0(J.options.limit)},V0(J.options));return}if($==="get"){let Q=I??S(J.options.batchId)??S(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation get <batchId>");await F0("seal_simulation_batch_get",U,Y,{batchId:Q},V0(J.options));return}if($==="templates"){await F0("seal_simulation_templates_get",U,Y,{},V0(J.options));return}if($==="integrations"){await F0("seal_simulation_integrations_get",U,Y,{},V0(J.options));return}if($==="package-upload"){let Q=I??S(J.options.file);if(!Q)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!IW1(Q))throw Error(`File not found: ${Q}`);await F0("seal_simulation_material_package_upload",U,Y,{filePath:Q},V0(J.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}import{existsSync as RX0}from"node:fs";import{join as lD}from"node:path";import{existsSync as ou,mkdirSync as AX0,rmSync as ZW1,writeFileSync as zW1}from"node:fs";import{homedir as PX0}from"node:os";import{dirname as XW1,join as ru}from"node:path";var wX0=`---
|
||||
</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=`---
|
||||
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:
|
||||
@@ -467,7 +467,7 @@ seal-use corps list
|
||||
- User-facing Seal tenant assistance link (Seal 协助/Seal 授权/委托): resolve the named enterprise first, then run \`seal-use delegation create --corp <corpId> --note '<enterprise>'\`; verify the returned hostname is that tenant's Seal hostname. Always provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) AND a hyperlink.
|
||||
- Packaged customer feedback → approval-rule remediation: read \`references/customer-feedback-rule-remediation.md\`. Use this route for WeChat messages, screenshots, rejection notifications, document numbers, customer complaints, expected approval behavior, rule-only mitigation, exact diffs, or requests to update and publish a rule version.
|
||||
- 模拟测试发布闭环: \`seal-use simulation create --mode hosecloud --flow-ids ... --no-wait --corp <corpId>\` (合思指定单号) 或 \`--mode material_pack --package-ids ... --schema-config file.json\` (材料包导入), 支持多源系统 \`--source-system <hosecloud|feishu|weaver|helios|maycur|material_pack>\`, \`simulation status <batchId>\` 单次查询状态, \`simulation wait <batchId>\` 轮询等待完成, \`simulation clean <batchId>\` 清理数据, \`simulation specifications\` 列出单据模板, \`simulation approval-definitions\` 查询飞书审批定义, \`simulation list\`/\`get\`/\`batch-records\` 查看批次与记录。创建前确认目标环境为测试环境。
|
||||
- 企业检索、详情查看、环境标记、关联与配置规则同步: \`seal-use corps list [query] [--env <production|test>]\` (列表与轻量检索), \`seal-use corps search <query> [--env <production|test>]\` (跨字段深度搜索), \`seal-use corps get <corpId>\` (富属性安全查看,敏感信息脱敏), \`seal-use corps mark <corpId> --env <production|test> --confirm\` (严格标记环境), \`seal-use corps bind-test <prodCorpId> <testCorpId> --confirm\` (严格1对1下挂,禁止多层级串联), \`seal-use corps unbind-test <corpId> --confirm\`, \`seal-use corps sync-test <prodCorpId> [--dry-run|--yes] [--version-name <name>]\` (将正式企业的偏好、草稿规则和知识文档覆盖同步到测试企业并自动发布语义版本 \`[Prod vN · #M -> Test vM]\`,输出并本地缓存 \`versionMapping\`/\`ruleMapping\`,正式企业规则保持草稿态不发布), \`seal-use rules map [--corp <corpId>] [--version <v|latest>] [--code <code>]\` (离线毫秒级速查测试与生产规则对照映射)。
|
||||
- 企业检索、详情查看、环境标记、关联与配置规则同步: \`seal-use corps list [query] [--env <production|test>] [--strict]\` (列表与轻量检索), \`seal-use corps search <query> [--env <production|test>] [--strict]\` (跨字段智能软搜索:默认支持同音字、前后鼻音、平翘舌音、拼音与简拼、拼音或字母缺漏容错;\`--strict\` 切换为严格子串匹配), \`seal-use corps get <corpId>\` (富属性安全查看,敏感信息脱敏), \`seal-use corps mark <corpId> --env <production|test> --confirm\` (严格标记环境), \`seal-use corps bind-test <prodCorpId> <testCorpId> --confirm\` (严格1对1下挂,禁止多层级串联), \`seal-use corps unbind-test <corpId> --confirm\`, \`seal-use corps sync-test <prodCorpId> [--dry-run|--yes] [--version-name <name>]\` (将正式企业的偏好、草稿规则和知识文档覆盖同步到测试企业并自动发布语义版本 \`[Prod vN · #M -> Test vM]\`,输出并本地缓存 \`versionMapping\`/\`ruleMapping\`,正式企业规则保持草稿态不发布), \`seal-use rules map [--corp <corpId>] [--version <v|latest>] [--code <code>]\` (离线毫秒级速查测试与生产规则对照映射)。
|
||||
- 规则本地工作流: \`seal-use rules pull\` 导出草稿规则,\`rules lint\` 做质量检查,\`rules push --dry-run\` 预览增量更新,确认后用 \`--yes\` 写入;\`rules map\` 查询 \`corps sync-test\` 生成的跨企业规则映射。规则版本与草稿/发布 code 空间的区别详见 \`references/rule-lightweight.md\` 和 \`references/cli.md\`。
|
||||
- Seal AI 智能审核发布到合思费控: \`seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>\`; read \`references/hose-enterprise-deploy.md\`.
|
||||
- 审核决策偏好与思考深度: \`seal-use preference get --corp <corpId>\`, \`preference decision update --json '...' --corp <corpId>\`, \`preference thinking-depth set --default <medium|high> --corp <corpId>\`, \`preference thinking-depth policies <list|upsert|remove> --corp <corpId>\`.
|
||||
@@ -505,8 +505,8 @@ push 会重新读取最新 Webhook 配置;校验通过后才会开始上传附
|
||||
## High-Value Commands
|
||||
|
||||
\`\`\`bash
|
||||
seal-use corps list [query] [--env production|test]
|
||||
seal-use corps search <keyword> [--env production|test]
|
||||
seal-use corps list [query] [--env production|test] [--strict]
|
||||
seal-use corps search <keyword> [--env production|test] [--strict]
|
||||
seal-use corps get <corpId>
|
||||
seal-use approval-runs url <recordId> --corp <corpId>
|
||||
seal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest
|
||||
@@ -571,11 +571,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 VX0=`interface:
|
||||
`;var uL0=`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 ZX0=`# Rule Lightweight Queries
|
||||
`;var yL0=`# 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 +686,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 zX0=`# Approval Bad Case Catalog
|
||||
`;var xL0=`# 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 +736,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 XX0="# 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>] [--corp <corpId>]\nseal-use corps search <query> [--env <production|test>]\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> [--corp <corpId>]\nseal-use Line truncated
|
||||
`;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
|
||||
|
||||
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 +957,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 OX0=`# Customer Feedback Rule Remediation
|
||||
`;var iL0=`# 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 +1127,7 @@ Return a compact report containing:
|
||||
- New version number and version name, if published
|
||||
- Verification result
|
||||
- Whether a regression rerun was performed
|
||||
`;var FX0=`# Enterprise Onboarding
|
||||
`;var bL0=`# 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 +1261,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 NX0=`# Hose Enterprise Auth
|
||||
`;var pL0=`# Hose Enterprise Auth
|
||||
|
||||
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
|
||||
|
||||
@@ -1326,7 +1326,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 MX0=`# Hose Enterprise Initialization & Automated Discovery
|
||||
`;var cL0=`# 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 +1432,12 @@ seal-use corps hose-staffs --json '{
|
||||
}'
|
||||
\`\`\`
|
||||
* 直接使用指定 ID 完成接入并进行连通性验证。
|
||||
`;var TX0={"SKILL.md":wX0,"agents/openai.yaml":VX0,"references/rule-lightweight.md":ZX0,"references/approval-bad-cases.md":zX0,"references/cli.md":XX0,"references/approval-run-lightweight.md":LX0,"references/approval-attachment-trace.md":DX0,"references/customer-feedback-rule-remediation.md":OX0,"references/enterprise-onboarding.md":FX0,"references/hose-enterprise-auth.md":NX0,"references/hose-enterprise-init.md":MX0};function EX0(){return TX0["SKILL.md"]||""}function vH(){return ru(PX0(),".agents","skills","seal-use")}function BX0(){return ru(PX0(),".agents","skills","seal-home")}function vX0(){let $=BX0();if(ou($))try{return ZW1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function tu($=vH()){vX0(),AX0($,{recursive:!0});let I=[];for(let[U,Y]of Object.entries(TX0)){let J=ru($,U);AX0(XW1(J),{recursive:!0}),zW1(J,Y,"utf8"),I.push(U)}return{targetDir:$,files:I}}function au(){let $=BX0(),I=vH(),U=ou($),Y=ou(I);if(U||Y)return vX0(),tu(I),{synced:!0,targetDir:I};return{synced:!1}}function jX0($,I,U){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${EX0()}
|
||||
`);return}if($==="install"||$==="init"||$==="sync"){let Y=O0(U.options.local)||O0(U.options.workspace),J=S(U.options.dir)??S(U.options.target)??I,Q=J?J:Y?lD(process.cwd(),".agents","skills","seal-use"):vH(),K=tu(Q);E0({installed:!0,targetDir:K.targetDir,fileCount:K.files.length,files:K.files});return}if($==="status"||$==="get"||!$){let Y=vH(),J=lD(process.cwd(),".agents","skills","seal-use");E0({global:{dir:Y,installed:RX0(lD(Y,"SKILL.md"))},local:{dir:J,installed:RX0(lD(J,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}async function CX0($,I){if($==="config"){E0(await gJ(I));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}async function _X0($,I,U,Y){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await F0($,I,U,U$(Y.json),V0(Y.options))}function SX0(){E0(OH.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as LW1,mkdirSync as DW1,renameSync as su,rmSync as OW1,unlinkSync as kX0,writeFileSync as gX0}from"node:fs";import{dirname as FW1,join as yX0}from"node:path";import{spawnSync as DI}from"node:child_process";function oD($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let U=$.toLowerCase().replace(/\\/g,"/");return!U.endsWith("/bun")&&!U.endsWith("/bun.exe")&&!U.endsWith("/node")&&!U.endsWith("/node.exe")}var xX0="yunyingk/seal-use",jH="yunyingk/seal-home";var NW1="SEAL_USE_GITHUB_REPO",MW1="SEAL_HOME_GITHUB_REPO";async function fX0($,I={}){let U={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:mu,version:Y1,launcher:$.launcher},Y=I.repo||process.env[NW1]?.trim()||process.env[MW1]?.trim()||xX0,J=I.targetVersion?.trim(),Q=J&&J.toLowerCase()!=="latest"?J:void 0;if(Q){let A=Q.replace(/^v/,""),R=iX0(A,Y1);if(R<0)if(!iE&&I.force);else{E0({updated:!1,currentVersion:Y1,targetVersion:A,mode:oD()?"binary":"source",message:!iE?`Cannot downgrade seal-use from dev build v${Y1} to release v${A}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${Y1} to older version v${A}. Updates must be forward-only.`});return}if(R===0&&!I.force){E0({updated:!1,currentVersion:Y1,targetVersion:A,mode:oD()?"binary":"source",message:`seal-use is already at version v${Y1}. Use --force to reinstall.`});return}}if(I.changelogOnly){let A=await eu(Y,I.limit??10);E0({currentVersion:Y1,totalQueried:A.length,releases:A.map((R)=>({version:R.version,tagName:R.tagName,publishedAt:R.publishedAt,author:R.author,releaseNotes:R.notes,releaseUrl:R.htmlUrl,isCurrent:R.version===Y1,isNewer:RH(R.version,Y1)}))});return}if(!oD()){if(I.checkOnly){let R=await eu(Y,30),x=R[0],y=x?.version??Y1,f=R.find((n)=>n.version===Y1),j=RH(y,Y1),p=R.filter((n)=>RH(n.version,Y1));E0({updated:!1,updateAvailable:j,currentVersion:Y1,currentVersionPublishedAt:f?.publishedAt,latestVersion:y,latestVersionPublishedAt:x?.publishedAt,behindCount:p.length,pendingReleases:p.map((n)=>({version:n.version,tagName:n.tagName,publishedAt:n.publishedAt,author:n.author,releaseNotes:n.notes,releaseUrl:n.htmlUrl})),releaseNotes:x?.notes??"",releaseUrl:x?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let A=hJ(U).running;if(A)await LI("stop",U);try{uX0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(R){console.error(`git pull skipped: ${R instanceof Error?R.message:String(R)}`)}if(uX0("bun",["install"],{cwd:$.appRoot}),A)await LI("start",U);E0({updated:!0,serviceRestarted:A,version:Y1,mode:"source"});return}let K=AW1(),q=PW1(),H=await eu(Y,30),G=Q?H.find((A)=>A.version===Q||A.tagName===Q||A.tagName===`v${Q}`)??await hX0(Y,Q):H[0]??await hX0(Y);if(!G){E0({updated:!1,currentVersion:Y1,mode:"binary",message:`Failed to query releases from repository '${Y}'`});return}let W=G.version,w=H.find((A)=>A.version===Y1),Z=RH(W,Y1),V=Z||Boolean(I.force),X=H.filter((A)=>RH(A.version,Y1));if(I.checkOnly){E0({updated:!1,updateAvailable:Z,currentVersion:Y1,currentVersionPublishedAt:w?.publishedAt,latestVersion:W,latestVersionPublishedAt:G.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:G.notes,releaseUrl:G.htmlUrl,mode:"binary"});return}if(!V){E0({updated:!1,currentVersion:Y1,currentVersionPublishedAt:w?.publishedAt,latestVersion:W,latestVersionPublishedAt:G.publishedAt,mode:"binary",message:`seal-use is already up to date (v${Y1})`});return}let L=TW1(G.assets,K,q);if(!L)throw Error(`No compatible binary found for ${K}-${q} in release v${W}. Available assets: ${G.assets.map((A)=>A.name).join(", ")}`);let D=hJ(U).running;if(D)await LI("stop",U);let O=process.execPath,P=FW1(O),T=yX0(P,`.tmp-update-${Date.now()}`);DW1(T,{recursive:!0});try{let A=yX0(T,L.name);await EW1(L.downloadUrl,A,G.tagName,L.name);let R=A;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))R=BW1
Line truncated
|
||||
`)}catch{}}async function EW1($,I,U,Y){let J=$k(),Q=[],K=U?U.startsWith("v")?U:`v${U}`:void 0,q=Y||$.split("/").pop()||"";if(J!=="github"){if(K&&q)Q.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${K}/${q}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${K}/${q}`);if($.startsWith("https://git.ying-qing.cn"))Q.push($)}if(J!=="gitea")if(K&&q){let L=`https://github.com/${xX0}/releases/download/${K}/${q}`;if(!process.env.CI)Q.push(`https://ghfast.top/${L}`,`https://gh.ddlc.top/${L}`);Q.push(L)}else if($.includes("github.com")){if(!process.env.CI)Q.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Q.push($)}else Q.push($);let H=Array.from(new Set(Q)),G,W=6000,w=6000,Z=307200,V=1e4,X=180000;for(let L=0;L<H.length;L++){let D=H[L],O=new AbortController,P="",T=(y)=>{P=y;try{O.abort()}catch{}},A=setTimeout(()=>{T("Connection timed out (no response headers within 6s)")},W),R,x;try{rD(`==> [${L+1}/${H.length}] Downloading via: ${D}`);let y=await fetch(D,{signal:O.signal});if(A)clearTimeout(A),A=void 0;if(!y.ok)throw Error(`HTTP ${y.status} ${y.statusText}`);R=setTimeout(()=>{T("Overall download time exceeded 3 minutes")},X);let f=Number(y.headers.get("content-length"))||0,j=y.body?.getReader();if(!j){let b=Buffer.from(await y.arrayBuffer());if(b.length<1000)throw Error(`Downloaded content is suspiciously small (${b.length} bytes)`);gX0(I,b),rD(`✓ Download succeeded (${(b.length/1024/1024).toFixed(1)} MB)`);return}let p=[],n=0,g=0;x=setTimeout(()=>{if(n<Z){let b=(n/1024).toFixed(1);T(`Initial transfer too slow (${b} KB < 300 KB in 6s), switching mirror...`)}},w);while(!0){let b=j.read(),U0,B=new Promise((J0,w0)=>{U0=setTimeout(()=>{w0(Error("Data transfer stalled (no chunk received for 10s)"))},V)}),k;try{k=await Promise.race([b,B])}finally{if(U0)clearTimeout(U0)}let{done:c,value:r}=k;if(c)break;if(r){if(p.push(r),n+=r.length,x&&n>=Z)clearTimeout(x),x=void 0;let J0=Date.now();if(J0-g>200){g=J0;let w0=f?Math.round(n/f*100):0,A0=(n/1048576).toFixed(1),j0=f?(f/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${w0}% (${A0} / ${j0} MB)...`)}catch{}}}}try{process.stderr.write(`
|
||||
`)}catch{}let i=Buffer.concat(p);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);gX0(I,i),rD(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(y){if(A)clearTimeout(A);if(x)clearTimeout(x);if(R)clearTimeout(R);let f=P||(y instanceof Error?y.message:String(y));G=Error(f),rD(`
|
||||
↳ Mirror failed: ${G.message}`)}finally{if(A)clearTimeout(A);if(x)clearTimeout(x);if(R)clearTimeout(R)}}throw Error(`Failed to download asset from all mirrors: ${G?.message}`)}function BW1($,I,U){let Y=DI("tar",["-xzf",$,"-C",I],{stdio:"pipe"});if(Y.status!==0)throw Error(`Failed to extract tar archive: ${Y.stderr.toString()}`);kX0($);let J=U==="windows"?"seal-use.exe":"seal-use",Q=DI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
|
||||
`).filter(Boolean),K=Q.find((q)=>q.endsWith(`/${J}`)||q.endsWith(J));if(K)return K;return Q[0]||$}function vW1($,I,U){let Y=DI("unzip",["-q","-o",$,"-d",I],{stdio:"pipe"});if(Y.status!==0)throw Error(`Failed to extract zip archive: ${Y.stderr.toString()}`);kX0($);let J=U==="windows"?"seal-use.exe":"seal-use",Q=DI("find",[I,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
|
||||
`).filter(Boolean),K=Q.find((q)=>q.endsWith(`/${J}`)||q.endsWith(J));if(K)return K;return Q[0]||$}function iX0($,I){let U=$.replace(/^v/,"").split(".").map((J)=>Number.parseInt(J,10)||0),Y=I.replace(/^v/,"").split(".").map((J)=>Number.parseInt(J,10)||0);for(let J=0;J<Math.max(U.length,Y.length);J++){let Q=U[J]??0,K=Y[J]??0;if(Q>K)return 1;if(Q<K)return-1}return 0}function RH($,I){return iX0($,I)>0}function uX0($,I,U={}){let Y=DI($,I,{cwd:U.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(Y.stdout)console.error(Y.stdout.trimEnd());if(Y.stderr)console.error(Y.stderr.trimEnd());if(Y.status!==0)throw Error(`${$} ${I.join(" ")} failed with status ${Y.status}`)}async function bX0($,I,U,Y,J){if($==="create"){let Q=S(J.options.name)??I,K=S(J.options.phone);if(!Q||!K)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let q=S(J.options.dept)??S(J.options.departmentId);await F0("seal_user_create",U,Y,{name:Q,phone:K,departmentIds:q?[q]:void 0},V0(J.options));return}if($==="reset-password"){let Q=I??S(J.options.userId);if(!Q)throw Error("Usage: seal-use users reset-password <userId>");await F0("seal_user_reset_password",U,Y,{userId:Q},V0(J.options));return}if($==="search"||$==="list"){let Q=I??S(J.options.keyword)??S(J.options.query)??"";await F0("seal_user_search",U,Y,{keyword:Q},V0(J.options));return}if($==="get"){let Q=I??S(J.options.userId);if(!Q)throw Error("Usage: seal-use users get <userId>");await F0("seal_user_get",U,Y,{userId:Q},V0(J.options));return}if($==="delete"){let Q=I??S(J.options.userId);if(!Q)throw Error("Usage: seal-use users delete <userId>");await F0("seal_user_delete",U,Y,{userId:Q},V0(J.options));return}if($==="activate"){let Q=I??S(J.options.userId);if(!Q)throw Error("Usage: seal-use users activate <userId>");await F0("seal_user_activate",U,Y,{userId:Q},V0(J.options));return}if($==="delegation"||$==="impersonate"){let Q=I??S(J.options.userId)??S(J.options.phone);if(!Q)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let K=S(J.options.note);await F0("seal_user_delegation_create",U,Y,{userIdOrPhone:Q,note:K},V0(J.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var nX0=Ik(Ik(Ik(jW1(import.meta.url)))),CW1=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"]),_W1=new Set(["http","server","web","mcp"]);function SW1($){if(!$.length)return!1;let I=$[0]?.toLowerCase(),U=$[1]?.toLowerCase();if(I&&_W1.has(I))return!0;if((I==="service"||I==="daemon")&&U==="run")return!0;return!1}var pX0=Promise.resolve();function EH($,I={}){if(SW1($))return cX0($,I);let U=pX0.then(()=>cX0($,I));return pX0=U.then(()=>{return},()=>{return}),U}async function cX0($,I){let U=[],Y=[],J=console.log,Q=console.error,K={appRoot:I.appRoot??nX0,entryFile:I.entryFile??RW1(I.appRoot??nX0,"src","cli.ts"),launcher:I.launcher};console.log=(...q)=>{U.push(uu(q))},console.error=(...q)=>{Y.push(uu(q))};try{return await gW1($,K),{stdout:AH(U),stderr:AH(Y),isError:!1,exitCode:0}}catch(q){let H=PH(q instanceof Error?q.message:String(q)),G=SD(q);if(Y.push(H),G.nextAction&&!H.includes("Next action:"))Y.push(`\uD83D\uDC49 Next action: ${G.nextAction}`);return{stdout:AH(U),stderr:AH(Y),isError:!0,exitCode:G.exitCode}}finally{console.log=J,console.error=Q}}async function gW1($,I){let U=sZ0($),[Y,J,Q]=U.command;if(Y==="version"||Y==="v"||Boolean(U.options.version)||Boolean(U.options.v)||Boolean(U.options.V)){E0(O2);return}let K=Kz0(U);if(K.isHelp){Wz0(K.target);return}if(!Y||!CW1.has(Y))throw Error(`Unknown command: ${U.command.join(" ")}. Run 'seal-use help' for available commands.`);if(Y==="webhook"&&J==="material-pack"&&Q==="preview"){let G=U.command[3]??S(U.options.file)??S(U.options.input);if(!G)throw Error("Usage: seal-use webhook material-pack preview <材料包.zip>");await Lz0(G,MH(U.options));return}if(Y==="openapi"){ez0(U);return}if(Y==="mcp-config"){iu();return}if(Y==="skill"){jX0(J,Q,U);return}if(Y==="mcp"||Y==="server"){await sz0(J,U);return}if(Y==="probe"){await JX0(J,Q,U);return}if(Y==="config"){Ez0(J,Q,U);return}if(Y==="service"){await lu(J,I,U);return}if(Y==="stop"){await lu("stop",I,U);return}if(Y==="http"||Y==="serve"){await tz0(U);return}if(Y==="update"||Y==="changelog"){let G=Y==="changelog"||J==="changelog"||J==="log"||J==="history"||O0(U.options.changelog)===!0,W=J==="check"||O0(U.options.check)===!0||O0(U.options["check-only"])===!0,w=S(U.options.version)??S(U.options.tag)??(!G&&!W&&J&&!J.startsWith("-")?J:void 0);await fX0(I,{checkOnly:W,changelogOnly:G,limit:n0(U.options.limit),force:O0(U.options.force),targetVersion:w,repo:S(U.options.repo)});return}if(Y==="tools"&&J==="list"){SX0();ret
Line truncated
|
||||
`;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
|
||||
`)?"":`
|
||||
`}`);process.exitCode=$.exitCode}var nW1=Boolean(t.main==t.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&dX0(process.argv[1])===dX0(t5));if(nW1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await bW1();else bu().catch(($)=>{console.error($),process.exitCode=1});export{fu as tokenizeCommand,bu as startServer,xW1 as resolveMcpEnabled,fW1 as createServer,uW1 as SEAL_MCP_ENABLED_ENV,hW1 as SEAL_CLI_TOOL_NAME,kW1 as LEGACY_SEAL_MCP_ENABLED_ENV};
|
||||
`}`);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};
|
||||
@@ -80,7 +80,7 @@ seal-use corps list
|
||||
- User-facing Seal tenant assistance link (Seal 协助/Seal 授权/委托): resolve the named enterprise first, then run `seal-use delegation create --corp <corpId> --note '<enterprise>'`; verify the returned hostname is that tenant's Seal hostname. Always provide BOTH a code block (` ```text ... ``` `) AND a hyperlink.
|
||||
- Packaged customer feedback → approval-rule remediation: read `references/customer-feedback-rule-remediation.md`. Use this route for WeChat messages, screenshots, rejection notifications, document numbers, customer complaints, expected approval behavior, rule-only mitigation, exact diffs, or requests to update and publish a rule version.
|
||||
- 模拟测试发布闭环: `seal-use simulation create --mode hosecloud --flow-ids ... --no-wait --corp <corpId>` (合思指定单号) 或 `--mode material_pack --package-ids ... --schema-config file.json` (材料包导入), 支持多源系统 `--source-system <hosecloud|feishu|weaver|helios|maycur|material_pack>`, `simulation status <batchId>` 单次查询状态, `simulation wait <batchId>` 轮询等待完成, `simulation clean <batchId>` 清理数据, `simulation specifications` 列出单据模板, `simulation approval-definitions` 查询飞书审批定义, `simulation list`/`get`/`batch-records` 查看批次与记录。创建前确认目标环境为测试环境。
|
||||
- 企业检索、详情查看、环境标记、关联与配置规则同步: `seal-use corps list [query] [--env <production|test>]` (列表与轻量检索), `seal-use corps search <query> [--env <production|test>]` (跨字段深度搜索), `seal-use corps get <corpId>` (富属性安全查看,敏感信息脱敏), `seal-use corps mark <corpId> --env <production|test> --confirm` (严格标记环境), `seal-use corps bind-test <prodCorpId> <testCorpId> --confirm` (严格1对1下挂,禁止多层级串联), `seal-use corps unbind-test <corpId> --confirm`, `seal-use corps sync-test <prodCorpId> [--dry-run|--yes] [--version-name <name>]` (将正式企业的偏好、草稿规则和知识文档覆盖同步到测试企业并自动发布语义版本 `[Prod vN · #M -> Test vM]`,输出并本地缓存 `versionMapping`/`ruleMapping`,正式企业规则保持草稿态不发布), `seal-use rules map [--corp <corpId>] [--version <v|latest>] [--code <code>]` (离线毫秒级速查测试与生产规则对照映射)。
|
||||
- 企业检索、详情查看、环境标记、关联与配置规则同步: `seal-use corps list [query] [--env <production|test>] [--strict]` (列表与轻量检索), `seal-use corps search <query> [--env <production|test>] [--strict]` (跨字段智能软搜索:默认支持同音字、前后鼻音、平翘舌音、拼音与简拼、拼音或字母缺漏容错;`--strict` 切换为严格子串匹配), `seal-use corps get <corpId>` (富属性安全查看,敏感信息脱敏), `seal-use corps mark <corpId> --env <production|test> --confirm` (严格标记环境), `seal-use corps bind-test <prodCorpId> <testCorpId> --confirm` (严格1对1下挂,禁止多层级串联), `seal-use corps unbind-test <corpId> --confirm`, `seal-use corps sync-test <prodCorpId> [--dry-run|--yes] [--version-name <name>]` (将正式企业的偏好、草稿规则和知识文档覆盖同步到测试企业并自动发布语义版本 `[Prod vN · #M -> Test vM]`,输出并本地缓存 `versionMapping`/`ruleMapping`,正式企业规则保持草稿态不发布), `seal-use rules map [--corp <corpId>] [--version <v|latest>] [--code <code>]` (离线毫秒级速查测试与生产规则对照映射)。
|
||||
- 规则本地工作流: `seal-use rules pull` 导出草稿规则,`rules lint` 做质量检查,`rules push --dry-run` 预览增量更新,确认后用 `--yes` 写入;`rules map` 查询 `corps sync-test` 生成的跨企业规则映射。规则版本与草稿/发布 code 空间的区别详见 `references/rule-lightweight.md` 和 `references/cli.md`。
|
||||
- Seal AI 智能审核发布到合思费控: `seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>`; read `references/hose-enterprise-deploy.md`.
|
||||
- 审核决策偏好与思考深度: `seal-use preference get --corp <corpId>`, `preference decision update --json '...' --corp <corpId>`, `preference thinking-depth set --default <medium|high> --corp <corpId>`, `preference thinking-depth policies <list|upsert|remove> --corp <corpId>`.
|
||||
@@ -118,8 +118,8 @@ push 会重新读取最新 Webhook 配置;校验通过后才会开始上传附
|
||||
## High-Value Commands
|
||||
|
||||
```bash
|
||||
seal-use corps list [query] [--env production|test]
|
||||
seal-use corps search <keyword> [--env production|test]
|
||||
seal-use corps list [query] [--env production|test] [--strict]
|
||||
seal-use corps search <keyword> [--env production|test] [--strict]
|
||||
seal-use corps get <corpId>
|
||||
seal-use approval-runs url <recordId> --corp <corpId>
|
||||
seal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest
|
||||
|
||||
@@ -70,8 +70,8 @@ seal-use skill status
|
||||
seal-use openapi
|
||||
seal-use probe [<corpId>]
|
||||
seal-use tools list
|
||||
seal-use corps list [query] [--env <production|test>] [--corp <corpId>]
|
||||
seal-use corps search <query> [--env <production|test>]
|
||||
seal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]
|
||||
seal-use corps search <query> [--env <production|test>] [--strict]
|
||||
seal-use corps get <corpId>
|
||||
seal-use corps current [--corp <corpId>]
|
||||
seal-use corps switch <corpId>
|
||||
@@ -179,8 +179,8 @@ seal-use simulation package-upload <材料包.zip> --corp <corpId>
|
||||
|
||||
Enterprise and tenant management:
|
||||
|
||||
- `seal-use corps list [query] [--env <production|test>] [--corp <corpId>]`
|
||||
- `seal-use corps search <query> [--env <production|test>]`
|
||||
- `seal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]`
|
||||
- `seal-use corps search <query> [--env <production|test>] [--strict]` (intelligent soft search by default: case-insensitive, Chinese homophones, front/back nasal vowels, flat/retroflex consonants, initials, typo/missing letter tolerance; pass `--strict` for exact substring match)
|
||||
- `seal-use corps get <corpId>` (rich enterprise attributes with sensitive secrets safely redacted)
|
||||
- `seal-use corps current [--corp <corpId>]`
|
||||
- `seal-use corps switch <corpId>`
|
||||
|
||||
@@ -293,6 +293,38 @@ describe("corps get and search", () => {
|
||||
const listWithQuery = await runCli(["corps", "list", "演练"]);
|
||||
expect(listWithQuery.exitCode).toBe(0);
|
||||
expect(JSON.parse(listWithQuery.stdout).length).toBe(1);
|
||||
|
||||
// Soft search by homophone (盛产 -> 生产正式企业)
|
||||
const softHomophone = await runCli(["corps", "search", "盛产"]);
|
||||
expect(softHomophone.exitCode).toBe(0);
|
||||
const softHResults = JSON.parse(softHomophone.stdout);
|
||||
expect(softHResults.length).toBe(1);
|
||||
expect(softHResults[0].id).toBe("corp-prod");
|
||||
|
||||
// Soft search by initials (sc -> 生产)
|
||||
const softInitials = await runCli(["corps", "search", "sc"]);
|
||||
expect(softInitials.exitCode).toBe(0);
|
||||
const softIResults = JSON.parse(softInitials.stdout);
|
||||
expect(softIResults.length).toBe(1);
|
||||
expect(softIResults[0].id).toBe("corp-prod");
|
||||
|
||||
// Soft search with missing letter / typo (zhangsa -> admin-zhangsan)
|
||||
const softTypo = await runCli(["corps", "search", "zhangsa"]);
|
||||
expect(softTypo.exitCode).toBe(0);
|
||||
const softTResults = JSON.parse(softTypo.stdout);
|
||||
expect(softTResults.length).toBe(1);
|
||||
expect(softTResults[0].id).toBe("corp-prod");
|
||||
|
||||
// Strict mode rejects fuzzy matches
|
||||
const strictFuzzy = await runCli(["corps", "search", "盛产", "--strict"]);
|
||||
expect(strictFuzzy.exitCode).toBe(0);
|
||||
expect(JSON.parse(strictFuzzy.stdout).length).toBe(0);
|
||||
expect(strictFuzzy.stderr).toContain("智能软搜索");
|
||||
|
||||
// Strict mode accepts exact substring
|
||||
const strictExact = await runCli(["corps", "search", "生产", "--strict"]);
|
||||
expect(strictExact.exitCode).toBe(0);
|
||||
expect(JSON.parse(strictExact.stdout).length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
saveGlobalConfig,
|
||||
updateCorpConfig
|
||||
} from "../../core/config/loader.js";
|
||||
import { filterCorpsFuzzy } from "../../core/search/fuzzy.js";
|
||||
import { SealCookieMapSchema, SealHeaderMapSchema } from "../../core/config/types.js";
|
||||
import type { CorpConfig, CorpEnvironment, SealSource } from "../../core/config/types.js";
|
||||
import * as api from "../../domains/seal/api.js";
|
||||
@@ -109,14 +110,14 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
|
||||
const rawQuery = (
|
||||
maybeName ?? stringOption(args.options.query) ?? stringOption(args.options.q)
|
||||
)?.trim();
|
||||
const query = rawQuery?.toLowerCase();
|
||||
const isStrict = booleanOption(args.options.strict) === true;
|
||||
|
||||
const envFilter = (
|
||||
stringOption(args.options.env) ?? stringOption(args.options.environment)
|
||||
)?.trim().toLowerCase();
|
||||
|
||||
if ((action === "search" || action === "find") && !query && !envFilter) {
|
||||
throw usageError("Usage: seal-use corps search <query> [--env <production|test>]");
|
||||
if ((action === "search" || action === "find") && !rawQuery && !envFilter) {
|
||||
throw usageError("Usage: seal-use corps search <query> [--env <production|test>] [--strict]");
|
||||
}
|
||||
|
||||
const corpId = stringOption(args.options.corp);
|
||||
@@ -134,40 +135,14 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
|
||||
filtered = filtered.filter((item) => (item.environment ?? "production").toLowerCase() === envFilter);
|
||||
}
|
||||
|
||||
if (query) {
|
||||
filtered = filtered.filter((item) => {
|
||||
const id = item.id.toLowerCase();
|
||||
const name = item.name.toLowerCase();
|
||||
const env = (item.environment ?? "production").toLowerCase();
|
||||
const sourceType = item.source.type.toLowerCase();
|
||||
const provider = String((item.source as any).provider ?? item.source.type).toLowerCase();
|
||||
const staffId = String(item.source.staffId ?? "").toLowerCase();
|
||||
const domain = String((item.source as any).domain ?? "").toLowerCase();
|
||||
const sourceCorpId = String((item.source as any).corpId ?? "").toLowerCase();
|
||||
const tenantSlug = String(item.seal.tenantSlug ?? (item.source as any).tenantSlug ?? "").toLowerCase();
|
||||
const tenantName = String((item.source as any).tenantName ?? "").toLowerCase();
|
||||
const testCorpId = String(item.testCorpId ?? "").toLowerCase();
|
||||
const prodCorpId = String(item.prodCorpId ?? "").toLowerCase();
|
||||
|
||||
return (
|
||||
id.includes(query) ||
|
||||
name.includes(query) ||
|
||||
env.includes(query) ||
|
||||
sourceType.includes(query) ||
|
||||
provider.includes(query) ||
|
||||
staffId.includes(query) ||
|
||||
domain.includes(query) ||
|
||||
sourceCorpId.includes(query) ||
|
||||
tenantSlug.includes(query) ||
|
||||
tenantName.includes(query) ||
|
||||
testCorpId.includes(query) ||
|
||||
prodCorpId.includes(query)
|
||||
);
|
||||
});
|
||||
if (rawQuery) {
|
||||
filtered = filterCorpsFuzzy(filtered, rawQuery, { strict: isStrict });
|
||||
}
|
||||
|
||||
if (allCorps.length === 0) {
|
||||
console.error("提示:当前未检测到企业配置。你可以使用 seal-use corps add-hose 或 seal-use corps add-seal 添加企业,或运行 seal-use help 查看说明。");
|
||||
} else if (isStrict && filtered.length === 0 && (action === "search" || action === "find") && rawQuery) {
|
||||
console.error(`提示:未在严格模式下匹配到企业 "${rawQuery}"。可以尝试省略 --strict 进行智能软搜索。`);
|
||||
}
|
||||
|
||||
printJson(filtered.map((item) => ({
|
||||
|
||||
+8
-6
@@ -31,20 +31,22 @@ export const HELP_REGISTRY: AreaHelp[] = [
|
||||
{
|
||||
name: "list",
|
||||
summary: "List all configured enterprises",
|
||||
usage: ["seal-use corps list [query] [--env <production|test>] [--corp <corpId>]"],
|
||||
usage: ["seal-use corps list [query] [--env <production|test>] [--strict] [--corp <corpId>]"],
|
||||
options: [
|
||||
{ flag: "--env <production|test>", description: "Filter enterprises by environment ('production' or 'test')" }
|
||||
{ flag: "--env <production|test>", description: "Filter enterprises by environment ('production' or 'test')" },
|
||||
{ flag: "--strict", description: "Use strict exact substring matching instead of default soft fuzzy search" }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "search",
|
||||
aliases: ["find"],
|
||||
summary: "Search configured enterprises by keyword or environment",
|
||||
usage: ["seal-use corps search <query> [--env <production|test>]"],
|
||||
summary: "Search configured enterprises with intelligent soft fuzzy matching",
|
||||
usage: ["seal-use corps search <query> [--env <production|test>] [--strict]"],
|
||||
options: [
|
||||
{ flag: "--env <production|test>", description: "Filter enterprises by environment ('production' or 'test')" }
|
||||
{ flag: "--env <production|test>", description: "Filter enterprises by environment ('production' or 'test')" },
|
||||
{ flag: "--strict", description: "Use strict exact substring matching instead of default soft fuzzy search" }
|
||||
],
|
||||
description: "Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings."
|
||||
description: "Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."
|
||||
},
|
||||
{
|
||||
name: "get",
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import type { CorpConfig } from "../config/types.js";
|
||||
import {
|
||||
filterCorpsFuzzy,
|
||||
fuzzyMatchString,
|
||||
levenshteinDistance,
|
||||
matchCorp,
|
||||
minSubstringLevenshtein,
|
||||
normalizeFuzzyPinyin
|
||||
} from "./fuzzy.js";
|
||||
|
||||
function makeCorp(id: string, name: string, overrides: Partial<CorpConfig> = {}): CorpConfig {
|
||||
return {
|
||||
id,
|
||||
name,
|
||||
environment: "production",
|
||||
seal: {
|
||||
tenantSlug: `${id}-slug`,
|
||||
endpoints: {
|
||||
approvalStylePreferences: "api/v1/agent/ai-approval/config"
|
||||
}
|
||||
},
|
||||
source: {
|
||||
type: "direct",
|
||||
token: `${id}-token`,
|
||||
sealUrl: `https://${id}.seal.test`,
|
||||
expiresIn: 3600,
|
||||
staffId: `staff-${id}`
|
||||
},
|
||||
auth: {
|
||||
refreshTtl: 300
|
||||
},
|
||||
...overrides
|
||||
};
|
||||
}
|
||||
|
||||
describe("fuzzy search utilities", () => {
|
||||
describe("levenshteinDistance", () => {
|
||||
test("calculates distance correctly", () => {
|
||||
expect(levenshteinDistance("", "")).toBe(0);
|
||||
expect(levenshteinDistance("abc", "abc")).toBe(0);
|
||||
expect(levenshteinDistance("abc", "ab")).toBe(1);
|
||||
expect(levenshteinDistance("abc", "abcd")).toBe(1);
|
||||
expect(levenshteinDistance("kitten", "sitting")).toBe(3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("minSubstringLevenshtein", () => {
|
||||
test("detects exact substring with distance 0", () => {
|
||||
expect(minSubstringLevenshtein("abc", "xyzabcdef")).toBe(0);
|
||||
});
|
||||
|
||||
test("detects missing letter with distance 1", () => {
|
||||
expect(minSubstringLevenshtein("acm", "acme corp")).toBe(0); // acm is substring of acme
|
||||
expect(minSubstringLevenshtein("xiezihao", "xieziha")).toBe(1); // target missing 'o'
|
||||
expect(minSubstringLevenshtein("xiezhao", "xiezihao")).toBe(1); // query missing 'i'
|
||||
});
|
||||
|
||||
test("detects single substitution typo with distance 1", () => {
|
||||
expect(minSubstringLevenshtein("xiezhao", "xiezihao")).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeFuzzyPinyin", () => {
|
||||
test("normalizes retroflex to flat consonants", () => {
|
||||
expect(normalizeFuzzyPinyin("张")).toBe(normalizeFuzzyPinyin("詹")); // zhang -> zhang/zhan -> zan
|
||||
expect(normalizeFuzzyPinyin("超")).toContain("cao");
|
||||
expect(normalizeFuzzyPinyin("沙")).toContain("sa");
|
||||
});
|
||||
|
||||
test("normalizes front and back nasals", () => {
|
||||
expect(normalizeFuzzyPinyin("陈")).toBe(normalizeFuzzyPinyin("程")); // chen / cheng -> cen
|
||||
expect(normalizeFuzzyPinyin("金")).toBe(normalizeFuzzyPinyin("京")); // jin / jing -> jin
|
||||
});
|
||||
|
||||
test("normalizes homophones to identical representations", () => {
|
||||
expect(normalizeFuzzyPinyin("谢子豪")).toBe(normalizeFuzzyPinyin("鞋子豪"));
|
||||
expect(normalizeFuzzyPinyin("渠道")).toBe(normalizeFuzzyPinyin("渠到"));
|
||||
});
|
||||
});
|
||||
|
||||
describe("fuzzyMatchString", () => {
|
||||
test("exact match", () => {
|
||||
const res = fuzzyMatchString("谢子豪", "谢子豪");
|
||||
expect(res.matched).toBe(true);
|
||||
expect(res.reason).toBe("exact");
|
||||
expect(res.score).toBe(1.0);
|
||||
});
|
||||
|
||||
test("substring match", () => {
|
||||
const res = fuzzyMatchString("谢子", "谢子豪");
|
||||
expect(res.matched).toBe(true);
|
||||
expect(res.reason).toBe("substring");
|
||||
expect(res.score).toBe(0.95);
|
||||
});
|
||||
|
||||
test("initials match (简拼)", () => {
|
||||
const res = fuzzyMatchString("xzh", "谢子豪");
|
||||
expect(res.matched).toBe(true);
|
||||
expect(res.reason).toBe("initials");
|
||||
expect(res.score).toBe(0.9);
|
||||
});
|
||||
|
||||
test("pinyin match (全拼)", () => {
|
||||
const res = fuzzyMatchString("xiezihao", "谢子豪");
|
||||
expect(res.matched).toBe(true);
|
||||
expect(res.reason).toBe("pinyin");
|
||||
});
|
||||
|
||||
test("homophones (同音字)", () => {
|
||||
const res1 = fuzzyMatchString("鞋子豪", "谢子豪");
|
||||
expect(res1.matched).toBe(true);
|
||||
expect(res1.reason).toBe("fuzzy_pinyin");
|
||||
|
||||
const res2 = fuzzyMatchString("渠到", "渠道AI演示环境");
|
||||
expect(res2.matched).toBe(true);
|
||||
expect(res2.reason).toBe("fuzzy_pinyin");
|
||||
});
|
||||
|
||||
test("front/back nasals & flat/retroflex (不区分前后鼻音和平翘舌)", () => {
|
||||
const res1 = fuzzyMatchString("詹三", "张三");
|
||||
expect(res1.matched).toBe(true);
|
||||
|
||||
const res2 = fuzzyMatchString("谢自豪", "谢子豪");
|
||||
expect(res2.matched).toBe(true);
|
||||
});
|
||||
|
||||
test("missing 1 letter or typo tolerance (缺失字母或轻微拼写错误)", () => {
|
||||
const res1 = fuzzyMatchString("xieziha", "谢子豪");
|
||||
expect(res1.matched).toBe(true);
|
||||
|
||||
const res2 = fuzzyMatchString("xiezhao", "谢子豪");
|
||||
expect(res2.matched).toBe(true);
|
||||
|
||||
const res3 = fuzzyMatchString("acme", "acm corp");
|
||||
expect(res3.matched).toBe(true);
|
||||
expect(res3.reason).toBe("levenshtein");
|
||||
});
|
||||
|
||||
test("strict mode rejects fuzzy / homophone / typo matches", () => {
|
||||
expect(fuzzyMatchString("鞋子豪", "谢子豪", { strict: true }).matched).toBe(false);
|
||||
expect(fuzzyMatchString("xzh", "谢子豪", { strict: true }).matched).toBe(false);
|
||||
expect(fuzzyMatchString("xieziha", "谢子豪", { strict: true }).matched).toBe(false);
|
||||
|
||||
// But exact substring is allowed in strict mode
|
||||
expect(fuzzyMatchString("谢子", "谢子豪", { strict: true }).matched).toBe(true);
|
||||
expect(fuzzyMatchString("谢子豪", "谢子豪", { strict: true }).matched).toBe(true);
|
||||
});
|
||||
|
||||
test("rejects completely unrelated terms", () => {
|
||||
expect(fuzzyMatchString("alibaba", "谢子豪").matched).toBe(false);
|
||||
expect(fuzzyMatchString("tencent", "ID01VAdCnJEdFd").matched).toBe(false);
|
||||
expect(fuzzyMatchString("xyz", "渠道环境").matched).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("filterCorpsFuzzy", () => {
|
||||
const corp1 = makeCorp("xiezihao", "谢子豪", {
|
||||
testCorpId: "test-xzh"
|
||||
});
|
||||
const corp2 = makeCorp("ID01VAdCnJEdFd", "渠道AI演示环境", {
|
||||
source: {
|
||||
type: "hose",
|
||||
corpId: "ID01VAdCnJEdFd",
|
||||
staffId: "staff-channel",
|
||||
domain: "https://app.ekuaibao.com"
|
||||
} as any
|
||||
});
|
||||
const corp3 = makeCorp("acme-corp", "Acme Global", {
|
||||
environment: "test"
|
||||
});
|
||||
|
||||
const corps = [corp1, corp2, corp3];
|
||||
|
||||
test("finds enterprise by homophone", () => {
|
||||
const results = filterCorpsFuzzy(corps, "鞋子豪");
|
||||
expect(results.length).toBe(1);
|
||||
expect(results[0]!.id).toBe("xiezihao");
|
||||
});
|
||||
|
||||
test("finds enterprise by initials", () => {
|
||||
const results = filterCorpsFuzzy(corps, "xzh");
|
||||
expect(results.length).toBe(1);
|
||||
expect(results[0]!.id).toBe("xiezihao");
|
||||
});
|
||||
|
||||
test("finds enterprise by missing letter query", () => {
|
||||
const results = filterCorpsFuzzy(corps, "xieziha");
|
||||
expect(results.length).toBe(1);
|
||||
expect(results[0]!.id).toBe("xiezihao");
|
||||
});
|
||||
|
||||
test("finds enterprise by pinyin of Chinese name", () => {
|
||||
const results = filterCorpsFuzzy(corps, "qudao");
|
||||
expect(results.length).toBe(1);
|
||||
expect(results[0]!.id).toBe("ID01VAdCnJEdFd");
|
||||
});
|
||||
|
||||
test("finds enterprise by hose corpId or staffId", () => {
|
||||
const results = filterCorpsFuzzy(corps, "ID01VAdCnJEdFd");
|
||||
expect(results.length).toBe(1);
|
||||
expect(results[0]!.id).toBe("ID01VAdCnJEdFd");
|
||||
|
||||
const staffResults = filterCorpsFuzzy(corps, "staff-channel");
|
||||
expect(staffResults.length).toBe(1);
|
||||
expect(staffResults[0]!.id).toBe("ID01VAdCnJEdFd");
|
||||
});
|
||||
|
||||
test("strict mode filtering excludes fuzzy homophone matches", () => {
|
||||
const fuzzyRes = filterCorpsFuzzy(corps, "鞋子豪", { strict: false });
|
||||
expect(fuzzyRes.length).toBe(1);
|
||||
|
||||
const strictRes = filterCorpsFuzzy(corps, "鞋子豪", { strict: true });
|
||||
expect(strictRes.length).toBe(0);
|
||||
|
||||
const strictExact = filterCorpsFuzzy(corps, "谢子豪", { strict: true });
|
||||
expect(strictExact.length).toBe(1);
|
||||
});
|
||||
|
||||
test("ranks exact match higher than fuzzy matches", () => {
|
||||
const cExact = makeCorp("test-qudao", "渠道");
|
||||
const cFuzzy = makeCorp("test-other", "渠到另外一家");
|
||||
const ranked = filterCorpsFuzzy([cFuzzy, cExact], "渠道");
|
||||
expect(ranked[0]!.id).toBe("test-qudao");
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,325 @@
|
||||
import { pinyin, match as pinyinMatch } from "pinyin-pro";
|
||||
import type { CorpConfig } from "../config/types.js";
|
||||
|
||||
export interface FuzzyMatchOptions {
|
||||
/**
|
||||
* If true, disables fuzzy/soft matching and requires exact substring matching.
|
||||
* Defaults to false (soft search by default).
|
||||
*/
|
||||
strict?: boolean;
|
||||
|
||||
/**
|
||||
* Maximum edit distance allowed for typo / missing letter tolerance.
|
||||
* Defaults based on query length:
|
||||
* - length <= 2: 0 (no fuzzy edits)
|
||||
* - length 3..5: 1 (missing 1 letter or 1 typo)
|
||||
* - length >= 6: 2 (missing 1-2 letters)
|
||||
*/
|
||||
maxDistance?: number;
|
||||
}
|
||||
|
||||
export type MatchReason =
|
||||
| "exact"
|
||||
| "substring"
|
||||
| "initials"
|
||||
| "pinyin"
|
||||
| "fuzzy_pinyin"
|
||||
| "levenshtein"
|
||||
| "subsequence"
|
||||
| "none";
|
||||
|
||||
export interface MatchScoreResult {
|
||||
matched: boolean;
|
||||
score: number;
|
||||
reason: MatchReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard Levenshtein distance between two strings.
|
||||
*/
|
||||
export function levenshteinDistance(a: string, b: string): number {
|
||||
const m = a.length;
|
||||
const n = b.length;
|
||||
if (m === 0) return n;
|
||||
if (n === 0) return m;
|
||||
|
||||
let prevRow = Array.from({ length: n + 1 }, (_, j) => j);
|
||||
let currRow = new Array<number>(n + 1).fill(0);
|
||||
|
||||
for (let i = 1; i <= m; i += 1) {
|
||||
currRow[0] = i;
|
||||
for (let j = 1; j <= n; j += 1) {
|
||||
if (a[i - 1] === b[j - 1]) {
|
||||
currRow[j] = prevRow[j - 1] ?? 0;
|
||||
} else {
|
||||
const sub = prevRow[j - 1] ?? 0;
|
||||
const ins = currRow[j - 1] ?? 0;
|
||||
const del = prevRow[j] ?? 0;
|
||||
currRow[j] = Math.min(sub, ins, del) + 1;
|
||||
}
|
||||
}
|
||||
const temp = prevRow;
|
||||
prevRow = currRow;
|
||||
currRow = temp;
|
||||
}
|
||||
return prevRow[n] ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the minimum Levenshtein distance between `query` and any sliding window substring in `target`.
|
||||
* Supports queries missing a letter, having an extra letter, or having an internal typo.
|
||||
*/
|
||||
export function minSubstringLevenshtein(query: string, target: string): number {
|
||||
if (!query || !target) return 999;
|
||||
if (target.includes(query)) return 0;
|
||||
|
||||
const qLen = query.length;
|
||||
if (target.length < qLen - 2) {
|
||||
return levenshteinDistance(query, target);
|
||||
}
|
||||
|
||||
let min = 999;
|
||||
const minWindow = Math.max(1, qLen - 2);
|
||||
const maxWindow = Math.min(target.length, qLen + 2);
|
||||
|
||||
for (let len = minWindow; len <= maxWindow; len += 1) {
|
||||
for (let i = 0; i <= target.length - len; i += 1) {
|
||||
const sub = target.slice(i, i + len);
|
||||
const dist = levenshteinDistance(query, sub);
|
||||
if (dist < min) min = dist;
|
||||
if (min === 0) return 0;
|
||||
}
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes Chinese text to toneless pinyin with fuzzy sound rules:
|
||||
* - Retroflex vs flat consonants: zh -> z, ch -> c, sh -> s
|
||||
* - Front vs back nasal sounds: ang -> an, eng -> en, ing -> in, iang -> ian, uang -> uan
|
||||
* - Strips non-alphanumeric whitespace
|
||||
*/
|
||||
export function normalizeFuzzyPinyin(str: string): string {
|
||||
if (!str) return "";
|
||||
const pyTokens = pinyin(str, { toneType: "none", type: "array" });
|
||||
return pyTokens
|
||||
.map((token) =>
|
||||
token
|
||||
.toLowerCase()
|
||||
.replace(/zh/g, "z")
|
||||
.replace(/ch/g, "c")
|
||||
.replace(/sh/g, "s")
|
||||
.replace(/iang/g, "ian")
|
||||
.replace(/uang/g, "uan")
|
||||
.replace(/ang/g, "an")
|
||||
.replace(/eng/g, "en")
|
||||
.replace(/ing/g, "in")
|
||||
)
|
||||
.join("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if all characters of `query` appear in order inside `target` (subsequence).
|
||||
*/
|
||||
export function isSubsequence(query: string, target: string): boolean {
|
||||
if (!query || !target) return false;
|
||||
let qIdx = 0;
|
||||
for (let tIdx = 0; tIdx < target.length && qIdx < query.length; tIdx += 1) {
|
||||
if (query[qIdx] === target[tIdx]) {
|
||||
qIdx += 1;
|
||||
}
|
||||
}
|
||||
return qIdx === query.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Core fuzzy string match engine:
|
||||
* Evaluates match across exact, substring, initials, pinyin, homophone/fuzzy pinyin,
|
||||
* sliding-window edit distance (missing/typo tolerance), and character subsequence.
|
||||
*/
|
||||
export function fuzzyMatchString(
|
||||
query: string,
|
||||
target: string,
|
||||
options: FuzzyMatchOptions = {}
|
||||
): MatchScoreResult {
|
||||
const normQuery = query.trim().toLowerCase();
|
||||
const normTarget = target.trim().toLowerCase();
|
||||
|
||||
if (!normQuery || !normTarget) {
|
||||
return { matched: false, score: 0, reason: "none" };
|
||||
}
|
||||
|
||||
// 1. Exact match
|
||||
if (normTarget === normQuery) {
|
||||
return { matched: true, score: 1.0, reason: "exact" };
|
||||
}
|
||||
|
||||
// 2. Substring match
|
||||
if (normTarget.includes(normQuery)) {
|
||||
return { matched: true, score: 0.95, reason: "substring" };
|
||||
}
|
||||
|
||||
// If strict mode is requested, only exact or substring matches are accepted.
|
||||
if (options.strict) {
|
||||
return { matched: false, score: 0, reason: "none" };
|
||||
}
|
||||
|
||||
const targetHasChinese = /[\u4e00-\u9fa5]/.test(normTarget);
|
||||
const queryHasChinese = /[\u4e00-\u9fa5]/.test(normQuery);
|
||||
|
||||
// 3. Initials / Acronym match (e.g. "xzh" matches "谢子豪", "sc" matches "生产")
|
||||
if (targetHasChinese && normQuery.length >= 2) {
|
||||
const targetInitials = pinyin(normTarget, { pattern: "first", toneType: "none", type: "array" })
|
||||
.join("")
|
||||
.toLowerCase();
|
||||
if (targetInitials.includes(normQuery)) {
|
||||
return { matched: true, score: 0.9, reason: "initials" };
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Pinyin-pro built-in match (handles full/partial pinyin matching against Chinese targets)
|
||||
if (targetHasChinese) {
|
||||
try {
|
||||
const pm = pinyinMatch(normTarget, normQuery, { precision: "start" });
|
||||
if (pm && pm.length > 0) {
|
||||
return { matched: true, score: 0.88, reason: "pinyin" };
|
||||
}
|
||||
} catch {
|
||||
// ignore match errors if non-standard regex chars
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Fuzzy Pinyin & Homophones (同音字、前后鼻音、平翘舌音)
|
||||
let targetFuzzyPinyin = "";
|
||||
let queryFuzzyPinyin = "";
|
||||
if (targetHasChinese || queryHasChinese) {
|
||||
targetFuzzyPinyin = normalizeFuzzyPinyin(normTarget);
|
||||
queryFuzzyPinyin = normalizeFuzzyPinyin(normQuery);
|
||||
|
||||
if (queryFuzzyPinyin.length >= 2 && targetFuzzyPinyin.includes(queryFuzzyPinyin)) {
|
||||
return { matched: true, score: 0.85, reason: "fuzzy_pinyin" };
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Missing letter / Typo tolerance (Levenshtein Distance)
|
||||
// Determine allowed distance based on query length:
|
||||
// - <= 2: 0 (no fuzzy edits to prevent excessive false positives)
|
||||
// - 3..5: 1 (missing 1 letter or 1 typo)
|
||||
// - >= 6: 2 (missing 1-2 letters)
|
||||
const defaultMaxDist = normQuery.length <= 2 ? 0 : normQuery.length <= 5 ? 1 : 2;
|
||||
const maxAllowedDist = options.maxDistance ?? defaultMaxDist;
|
||||
|
||||
if (maxAllowedDist > 0) {
|
||||
// Check raw string distance
|
||||
const rawDist = minSubstringLevenshtein(normQuery, normTarget);
|
||||
if (rawDist <= maxAllowedDist) {
|
||||
return {
|
||||
matched: true,
|
||||
score: Math.max(0.6, 0.8 - rawDist * 0.1),
|
||||
reason: "levenshtein"
|
||||
};
|
||||
}
|
||||
|
||||
// Check fuzzy pinyin distance (e.g. pinyin with 1 missing letter)
|
||||
if (
|
||||
(targetHasChinese || queryHasChinese) &&
|
||||
queryFuzzyPinyin.length >= 3 &&
|
||||
targetFuzzyPinyin.length >= 3
|
||||
) {
|
||||
const pinyinDist = minSubstringLevenshtein(queryFuzzyPinyin, targetFuzzyPinyin);
|
||||
if (pinyinDist <= maxAllowedDist) {
|
||||
return {
|
||||
matched: true,
|
||||
score: Math.max(0.6, 0.78 - pinyinDist * 0.1),
|
||||
reason: "levenshtein"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 7. Subsequence match (loose character order, min query length 3)
|
||||
if (normQuery.length >= 3) {
|
||||
if (
|
||||
isSubsequence(normQuery, normTarget) ||
|
||||
((targetHasChinese || queryHasChinese) && isSubsequence(queryFuzzyPinyin, targetFuzzyPinyin))
|
||||
) {
|
||||
return { matched: true, score: 0.65, reason: "subsequence" };
|
||||
}
|
||||
}
|
||||
|
||||
return { matched: false, score: 0, reason: "none" };
|
||||
}
|
||||
|
||||
/**
|
||||
* Matches an enterprise (`CorpConfig`) against a query across all its searchable fields,
|
||||
* returning the highest match score and reason.
|
||||
*/
|
||||
export function matchCorp(
|
||||
corp: CorpConfig,
|
||||
query: string,
|
||||
options: FuzzyMatchOptions = {}
|
||||
): MatchScoreResult {
|
||||
const fields: Array<{ text: string | undefined; weight: number }> = [
|
||||
{ text: corp.name, weight: 1.2 },
|
||||
{ text: corp.id, weight: 1.1 },
|
||||
{ text: corp.source.staffId, weight: 1.0 },
|
||||
{ text: (corp.source as any).domain, weight: 1.0 },
|
||||
{ text: (corp.source as any).corpId, weight: 1.0 },
|
||||
{ text: corp.seal.tenantSlug, weight: 1.0 },
|
||||
{ text: (corp.source as any).tenantSlug, weight: 1.0 },
|
||||
{ text: (corp.source as any).tenantName, weight: 1.1 },
|
||||
{ text: corp.testCorpId, weight: 1.0 },
|
||||
{ text: corp.prodCorpId, weight: 1.0 },
|
||||
{ text: corp.environment ?? "production", weight: 0.8 },
|
||||
{ text: corp.source.type, weight: 0.8 },
|
||||
{ text: (corp.source as any).provider, weight: 0.8 }
|
||||
];
|
||||
|
||||
let bestScore = 0;
|
||||
let bestReason: MatchReason = "none";
|
||||
|
||||
for (const field of fields) {
|
||||
if (!field.text) continue;
|
||||
const res = fuzzyMatchString(query, field.text, options);
|
||||
if (res.matched) {
|
||||
const weightedScore = res.score * field.weight;
|
||||
if (weightedScore > bestScore) {
|
||||
bestScore = weightedScore;
|
||||
bestReason = res.reason;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
matched: bestScore > 0,
|
||||
score: bestScore,
|
||||
reason: bestReason
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters a list of enterprises using soft fuzzy search (or strict search if requested),
|
||||
* and automatically sorts the matching results from highest relevance to lowest.
|
||||
*/
|
||||
export function filterCorpsFuzzy(
|
||||
corps: CorpConfig[],
|
||||
query: string,
|
||||
options: FuzzyMatchOptions = {}
|
||||
): CorpConfig[] {
|
||||
const trimmed = query.trim();
|
||||
if (!trimmed) return corps;
|
||||
|
||||
const scored: Array<{ corp: CorpConfig; score: number }> = [];
|
||||
|
||||
for (const corp of corps) {
|
||||
const res = matchCorp(corp, trimmed, options);
|
||||
if (res.matched) {
|
||||
scored.push({ corp, score: res.score });
|
||||
}
|
||||
}
|
||||
|
||||
// Sort by match score descending (highest confidence first)
|
||||
scored.sort((a, b) => b.score - a.score);
|
||||
|
||||
return scored.map((item) => item.corp);
|
||||
}
|
||||
Reference in new issue
Block a user