diff --git a/.zcode-plugin/plugin.json b/.zcode-plugin/plugin.json index 0a2e9f3..becf48e 100644 --- a/.zcode-plugin/plugin.json +++ b/.zcode-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.37", + "version": "0.10.38", "description": "Seal Use tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, and search.", "author": { "name": "yingqing" diff --git a/CHANGELOG.md b/CHANGELOG.md index c75ffe2..e826043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.38] - 2026-09-22 + +### Added +- Merge pull request #170 from yunyingk/codex/improve-update-feedback +- Refine skill routing and silent CLI compatibility +- Merge pull request #169 from yunyingk/codex/improve-update-feedback +- Move enterprise workflows into domains +- Split corps command by domain +- Fix Hose web-session source persistence +- Remove legacy direct enterprise source +- Add explicit enterprise session commands + + ## [0.10.37] - 2026-09-22 ### Added diff --git a/dist/mcp/server.js b/dist/mcp/server.js index 7da748c..9cb0554 100644 --- a/dist/mcp/server.js +++ b/dist/mcp/server.js @@ -75,7 +75,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. || ${C} === "boolean" || ${A} === null`).assign(b,I._`[${A}]`)}}}function q({gen:O,parentData:D,parentDataProperty:P},T){O.if(I._`${D} !== undefined`,()=>O.assign(I._`${D}[${P}]`,T))}function V(O,D,P,T=J.Correct){let A=T===J.Correct?I.operators.EQ:I.operators.NEQ,j;switch(O){case"null":return I._`${D} ${A} null`;case"array":j=I._`Array.isArray(${D})`;break;case"object":j=I._`${D} && typeof ${D} == "object" && !Array.isArray(${D})`;break;case"integer":j=C(I._`!(${D} % 1) && !isNaN(${D})`);break;case"number":j=C();break;default:return I._`typeof ${D} ${A} ${O}`}return T===J.Correct?j:(0,I.not)(j);function C(b=I.nil){return(0,I.and)(I._`typeof ${D} == "number"`,b,P?I._`isFinite(${D})`:I.nil)}}$.checkDataType=V;function w(O,D,P,T){if(O.length===1)return V(O[0],D,P,T);let A,j=(0,Q.toHash)(O);if(j.array&&j.object){let C=I._`typeof ${D} != "object"`;A=j.null?C:I._`!${D} || ${C}`,delete j.null,delete j.array,delete j.object}else A=I.nil;if(j.number)delete j.integer;for(let C in j)A=(0,I.and)(A,V(C,D,P,T));return A}$.checkDataTypes=w;let M={message:({schema:O})=>`must be ${O}`,params:({schema:O,schemaValue:D})=>typeof O=="string"?I._`{type: ${O}}`:I._`{type: ${D}}`};function F(O){let D=N(O);(0,z.reportError)(D,M)}$.reportTypeError=F;function N(O){let{gen:D,data:P,schema:T}=O,A=(0,Q.schemaRefOrVal)(O,T,"type");return{gen:D,keyword:"type",data:P,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:O}}}),mb0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=F1(),U=v1();function z(Q,J){let{properties:K,items:G}=Q.schema;if(J==="object"&&K)for(let H in K)I(Q,H,K[H].default);else if(J==="array"&&Array.isArray(G))G.forEach((H,W)=>I(Q,W,H.default))}$.assignDefaults=z;function I(Q,J,K){let{gen:G,compositeRule:H,data:W,opts:X}=Q;if(K===void 0)return;let Z=Y._`${W}${(0,Y.getProperty)(J)}`;if(H){(0,U.checkStrictMode)(Q,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(K)}`)}}),G5=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=F1(),U=v1(),z=K5(),I=v1();function Q(O,D){let{gen:P,data:T,it:A}=O;P.if(X(P,T,D,A.opts.ownProperties),()=>{O.setParams({missingProperty:Y._`${D}`},!0),O.error()})}$.checkReportMissingProp=Q;function J({gen:O,data:D,it:{opts:P}},T,A){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(O,D,j,P.ownProperties),Y._`${A} = ${j}`)))}$.checkMissingProp=J;function K(O,D){O.setParams({missingProperty:D},!0),O.error()}$.reportMissingProp=K;function G(O){return O.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(O,D,P){return Y._`${G(O)}.call(${D}, ${P})`}$.isOwnProperty=H;function W(O,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} !== undefined`;return T?Y._`${A} && ${H(O,D,P)}`:A}$.propertyInData=W;function X(O,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} === undefined`;return T?(0,Y.or)(A,(0,Y.not)(H(O,D,P))):A}$.noPropertyInData=X;function Z(O){return O?Object.keys(O).filter((D)=>D!=="__proto__"):[]}$.allSchemaProperties=Z;function q(O,D){return Z(D).filter((P)=>!(0,U.alwaysValidSchema)(O,D[P]))}$.schemaProperties=q;function V({schemaCode:O,data:D,it:{gen:P,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,x,g){let i=g?Y._`${O}, ${D}, ${T}${A}`:D,c=[[z.default.instancePath,(0,Y.strConcat)(z.default.instancePath,j)],[z.default.parentData,C.parentData],[z.default.parentDataProperty,C.parentDataProperty],[z.default.rootData,z.default.rootData]];if(C.opts.dynamicRef)c.push([z.default.dynamicAnchors,z.default.dynamicAnchors]);let z0=Y._`${i}, ${P.object(...c)}`;return x!==Y.nil?Y._`${b}.call(${x}, ${z0})`:Y._`${b}(${z0})`}$.callValidateCode=V;let w=Y._`new RegExp`;function M({gen:O,it:{opts:D}},P){let T=D.unicodeRegExp?"u":"",{regExp:A}=D.code,j=A(P,T);return O.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${A.code==="new RegExp"?w:(0,I.useFunc)(O,A)}(${P}, ${T})`})}$.usePattern=M;function F(O){let{gen:D,data:P,keyword:T,it:A}=O,j=D.name("valid");if(A.allErrors){let b=D.let("valid",!0);return C(()=>D.assign(b,!1)),b}return D.var(j,!0),C(()=>D.break()),j;function C(b){let x=D.const("len",Y._`${P}.length`);D.forRange("i",0,x,(g)=>{O.subschema({keyword:T,dataProp:g,dataPropType:U.Type.Num},j),D.if((0,Y.not)(j),b)})}}$.validateArray=F;function N(O){let{gen:D,schema:P,keyword:T,it:A}=O;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((b)=>(0,U.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=D.let("valid",!1),C=D.name("_valid");D.block(()=>P.forEach((b,x)=>{let g=O.subschema({keyword:T,schemaProp:x,compositeRule:!0},C);if(D.assign(j,Y._`${j} || ${C}`),!O.mergeValidEvaluated(g,C))D.if((0,Y.not)(j))})),O.result(j,()=>O.reset(),()=>O.error(!0))}$.validateUnion=N}),lb0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateKeywordUsage=$.validSchemaType=$.funcKeywordCode=$.macroKeywordCode=void 0;let Y=F1(),U=K5(),z=G5(),I=mw();function Q(q,V){let{gen:w,keyword:M,schema:F,parentSchema:N,it:O}=q,D=V.macro.call(O.self,F,N,O),P=W(w,M,D);if(O.opts.validateSchema!==!1)O.self.validateSchema(D,!0);let T=w.name("valid");q.subschema({schema:D,schemaPath:Y.nil,errSchemaPath:`${O.errSchemaPath}/${M}`,topSchemaRef:P,compositeRule:!0},T),q.pass(T,()=>q.error(!0))}$.macroKeywordCode=Q;function J(q,V){var w;let{gen:M,keyword:F,schema:N,parentSchema:O,$data:D,it:P}=q;H(P,V);let T=W(M,F,!D&&V.compile?V.compile.call(P.self,N,O,P):V.validate),A=M.let("valid");q.block$data(A,j),q.ok((w=V.valid)!==null&&w!==void 0?w:A);function j(){if(V.errors===!1){if(x(),V.modifying)K(q);g(()=>q.error())}else{let i=V.async?C():b();if(V.modifying)K(q);g(()=>G(q,i))}}function C(){let i=M.let("ruleErrs",null);return M.try(()=>x(Y._`await `),(c)=>M.assign(A,!1).if(Y._`${c} instanceof ${P.ValidationError}`,()=>M.assign(i,Y._`${c}.errors`),()=>M.throw(c))),i}function b(){let i=Y._`${T}.errors`;return M.assign(i,null),x(Y.nil),i}function x(i=V.async?Y._`await `:Y.nil){let c=P.opts.passContext?U.default.this:U.default.self,z0=!(("compile"in V)&&!D||V.schema===!1);M.assign(A,Y._`${i}${(0,z.callValidateCode)(q,T,c,z0)}`,V.modifying)}function g(i){var c;M.if((0,Y.not)((c=V.valid)!==null&&c!==void 0?c:A),i)}}$.funcKeywordCode=J;function K(q){let{gen:V,data:w,it:M}=q;V.if(M.parentData,()=>V.assign(w,Y._`${M.parentData}[${M.parentDataProperty}]`))}function G(q,V){let{gen:w}=q;w.if(Y._`Array.isArray(${V})`,()=>{w.assign(U.default.vErrors,Y._`${U.default.vErrors} === null ? ${V} : ${U.default.vErrors}.concat(${V})`).assign(U.default.errors,Y._`${U.default.vErrors}.length`),(0,I.extendErrors)(q)},()=>q.error())}function H({schemaEnv:q},V){if(V.async&&!q.$async)throw Error("async keyword in sync schema")}function W(q,V,w){if(w===void 0)throw Error(`keyword "${V}" failed to compile`);return q.scopeValue("keyword",typeof w=="function"?{ref:w}:{ref:w,code:(0,Y.stringify)(w)})}function X(q,V,w=!1){return!V.length||V.some((M)=>M==="array"?Array.isArray(q):M==="object"?q&&typeof q=="object"&&!Array.isArray(q):typeof q==M||w&&typeof q>"u")}$.validSchemaType=X;function Z({schema:q,opts:V,self:w,errSchemaPath:M},F,N){if(Array.isArray(F.keyword)?!F.keyword.includes(N):F.keyword!==N)throw Error("ajv implementation error");let O=F.dependencies;if(O===null||O===void 0?void 0:O.some((D)=>!Object.prototype.hasOwnProperty.call(q,D)))throw Error(`parent schema must have dependencies of ${N}: ${O.join(",")}`);if(F.validateSchema){if(!F.validateSchema(q[N])){let D=`keyword "${N}" value is invalid at path "${M}": `+w.errorsText(F.validateSchema.errors);if(V.validateSchema==="log")w.logger.error(D);else throw Error(D)}}}$.validateKeywordUsage=Z}),ob0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.extendSubschemaMode=$.extendSubschemaData=$.getSubschema=void 0;let Y=F1(),U=v1();function z(J,{keyword:K,schemaProp:G,schema:H,schemaPath:W,errSchemaPath:X,topSchemaRef:Z}){if(K!==void 0&&H!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(K!==void 0){let q=J.schema[K];return G===void 0?{schema:q,schemaPath:Y._`${J.schemaPath}${(0,Y.getProperty)(K)}`,errSchemaPath:`${J.errSchemaPath}/${K}`}:{schema:q[G],schemaPath:Y._`${J.schemaPath}${(0,Y.getProperty)(K)}${(0,Y.getProperty)(G)}`,errSchemaPath:`${J.errSchemaPath}/${K}/${(0,U.escapeFragment)(G)}`}}if(H!==void 0){if(W===void 0||X===void 0||Z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:H,schemaPath:W,topSchemaRef:Z,errSchemaPath:X}}throw Error('either "keyword" or "schema" must be passed')}$.getSubschema=z;function I(J,K,{dataProp:G,dataPropType:H,data:W,dataTypes:X,propertyName:Z}){if(W!==void 0&&G!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:q}=K;if(G!==void 0){let{errorPath:w,dataPathArr:M,opts:F}=K;V(q.let("data",Y._`${K.data}${(0,Y.getProperty)(G)}`,!0)),J.errorPath=Y.str`${w}${(0,U.getErrorPath)(G,H,F.jsPropertySyntax)}`,J.parentDataProperty=Y._`${G}`,J.dataPathArr=[...M,J.parentDataProperty]}if(W!==void 0){if(V(W instanceof Y.Name?W:q.let("data",W,!0)),Z!==void 0)J.propertyName=Z}if(X)J.dataTypes=X;function V(w){J.data=w,J.dataLevel=K.dataLevel+1,J.dataTypes=[],K.definedProperties=new Set,J.parentData=K.data,J.dataNames=[...K.dataNames,w]}}$.extendSubschemaData=I;function Q(J,{jtdDiscriminator:K,jtdMetadata:G,compositeRule:H,createErrors:W,allErrors:X}){if(H!==void 0)J.compositeRule=H;if(W!==void 0)J.createErrors=W;if(X!==void 0)J.allErrors=X;J.jtdDiscriminator=K,J.jtdMetadata=G}$.extendSubschemaMode=Q}),Ee=E0(($,Y)=>{Y.exports=function U(z,I){if(z===I)return!0;if(z&&I&&typeof z=="object"&&typeof I=="object"){if(z.constructor!==I.constructor)return!1;var Q,J,K;if(Array.isArray(z)){if(Q=z.length,Q!=I.length)return!1;for(J=Q;J--!==0;)if(!U(z[J],I[J]))return!1;return!0}if(z.constructor===RegExp)return z.source===I.source&&z.flags===I.flags;if(z.valueOf!==Object.prototype.valueOf)return z.valueOf()===I.valueOf();if(z.toString!==Object.prototype.toString)return z.toString()===I.toString();if(K=Object.keys(z),Q=K.length,Q!==Object.keys(I).length)return!1;for(J=Q;J--!==0;)if(!Object.prototype.hasOwnProperty.call(I,K[J]))return!1;for(J=Q;J--!==0;){var G=K[J];if(!U(z[G],I[G]))return!1}return!0}return z!==z&&I!==I}}),rb0=E0(($,Y)=>{var U=Y.exports=function(Q,J,K){if(typeof J=="function")K=J,J={};K=J.cb||K;var G=typeof K=="function"?K:K.pre||function(){},H=K.post||function(){};z(J,G,H,Q,"",Q)};U.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},U.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},U.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},U.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function z(Q,J,K,G,H,W,X,Z,q,V){if(G&&typeof G=="object"&&!Array.isArray(G)){J(G,H,W,X,Z,q,V);for(var w in G){var M=G[w];if(Array.isArray(M)){if(w in U.arrayKeywords)for(var F=0;F{Object.defineProperty($,"__esModule",{value:!0}),$.getSchemaRefs=$.resolveUrl=$.normalizeId=$._getFullPath=$.getFullPath=$.inlineRef=void 0;let Y=v1(),U=Ee(),z=rb0(),I=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Q(M,F=!0){if(typeof M=="boolean")return!0;if(F===!0)return!K(M);if(!F)return!1;return G(M)<=F}$.inlineRef=Q;let J=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function K(M){for(let F in M){if(J.has(F))return!0;let N=M[F];if(Array.isArray(N)&&N.some(K))return!0;if(typeof N=="object"&&K(N))return!0}return!1}function G(M){let F=0;for(let N in M){if(N==="$ref")return 1/0;if(F++,I.has(N))continue;if(typeof M[N]=="object")(0,Y.eachItem)(M[N],(O)=>F+=G(O));if(F===1/0)return 1/0}return F}function H(M,F="",N){if(N!==!1)F=Z(F);return W(M,M.parse(F))}$.getFullPath=H;function W(M,F){return M.serialize(F).split("#")[0]+"#"}$._getFullPath=W;let X=/#\/?$/;function Z(M){return M?M.replace(X,""):""}$.normalizeId=Z;function q(M,F,N){return N=Z(N),M.resolve(F,N)}$.resolveUrl=q;let V=/^[a-z_][-a-z0-9._]*$/i;function w(M,F){if(typeof M=="boolean")return{};let{schemaId:N,uriResolver:O}=this.opts,D=Z(M[N]||F),P={"":D},T=H(O,D,!1),A={},j=new Set;return z(M,{allKeys:!0},(x,g,i,c)=>{if(c===void 0)return;let z0=T+g,k=P[c];if(typeof x[N]=="string")k=d.call(this,x[N]);a.call(this,x.$anchor),a.call(this,x.$dynamicAnchor),P[g]=k;function d($0){let y=this.opts.uriResolver.resolve;if($0=Z(k?y(k,$0):$0),j.has($0))throw b($0);j.add($0);let p=this.refs[$0];if(typeof p=="string")p=this.refs[p];if(typeof p=="object")C(x,p.schema,$0);else if($0!==Z(z0))if($0[0]==="#")C(x,A[$0],$0),A[$0]=x;else this.refs[$0]=z0;return $0}function a($0){if(typeof $0=="string"){if(!V.test($0))throw Error(`invalid anchor "${$0}"`);d.call(this,`#${$0}`)}}}),A;function C(x,g,i){if(g!==void 0&&!U(x,g))throw b(i)}function b(x){return Error(`reference "${x}" resolves to more than one schema`)}}$.getSchemaRefs=w}),bI=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.getData=$.KeywordCxt=$.validateFunctionCode=void 0;let Y=db0(),U=dw(),z=je(),I=dw(),Q=mb0(),J=lb0(),K=ob0(),G=F1(),H=K5(),W=lw(),X=v1(),Z=mw();function q(t){if(T(t)){if(j(t),P(t)){F(t);return}}V(t,()=>(0,Y.topBoolOrEmptySchema)(t))}$.validateFunctionCode=q;function V({gen:t,validateName:X0,schema:F0,schemaEnv:u0,opts:b0},c0){if(b0.code.es5)t.func(X0,G._`${H.default.data}, ${H.default.valCxt}`,u0.$async,()=>{t.code(G._`"use strict"; ${O(F0,b0)}`),M(t,b0),t.code(c0)});else t.func(X0,G._`${H.default.data}, ${w(b0)}`,u0.$async,()=>t.code(O(F0,b0)).code(c0))}function w(t){return G._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${t.dynamicRef?G._`, ${H.default.dynamicAnchors}={}`:G.nil}}={}`}function M(t,X0){t.if(H.default.valCxt,()=>{if(t.var(H.default.instancePath,G._`${H.default.valCxt}.${H.default.instancePath}`),t.var(H.default.parentData,G._`${H.default.valCxt}.${H.default.parentData}`),t.var(H.default.parentDataProperty,G._`${H.default.valCxt}.${H.default.parentDataProperty}`),t.var(H.default.rootData,G._`${H.default.valCxt}.${H.default.rootData}`),X0.dynamicRef)t.var(H.default.dynamicAnchors,G._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(t.var(H.default.instancePath,G._`""`),t.var(H.default.parentData,G._`undefined`),t.var(H.default.parentDataProperty,G._`undefined`),t.var(H.default.rootData,H.default.data),X0.dynamicRef)t.var(H.default.dynamicAnchors,G._`{}`)})}function F(t){let{schema:X0,opts:F0,gen:u0}=t;V(t,()=>{if(F0.$comment&&X0.$comment)c(t);if(x(t),u0.let(H.default.vErrors,null),u0.let(H.default.errors,0),F0.unevaluated)N(t);C(t),z0(t)})}function N(t){let{gen:X0,validateName:F0}=t;t.evaluated=X0.const("evaluated",G._`${F0}.evaluated`),X0.if(G._`${t.evaluated}.dynamicProps`,()=>X0.assign(G._`${t.evaluated}.props`,G._`undefined`)),X0.if(G._`${t.evaluated}.dynamicItems`,()=>X0.assign(G._`${t.evaluated}.items`,G._`undefined`))}function O(t,X0){let F0=typeof t=="object"&&t[X0.schemaId];return F0&&(X0.code.source||X0.code.process)?G._`/*# sourceURL=${F0} */`:G.nil}function D(t,X0){if(T(t)){if(j(t),P(t)){A(t,X0);return}}(0,Y.boolOrEmptySchema)(t,X0)}function P({schema:t,self:X0}){if(typeof t=="boolean")return!t;for(let F0 in t)if(X0.RULES.all[F0])return!0;return!1}function T(t){return typeof t.schema!="boolean"}function A(t,X0){let{schema:F0,gen:u0,opts:b0}=t;if(b0.$comment&&F0.$comment)c(t);g(t),i(t);let c0=u0.const("_errs",H.default.errors);C(t,c0),u0.var(X0,G._`${c0} === ${H.default.errors}`)}function j(t){(0,X.checkUnknownRules)(t),b(t)}function C(t,X0){if(t.opts.jtd)return d(t,[],!1,X0);let F0=(0,U.getSchemaTypes)(t.schema);d(t,F0,!(0,U.coerceAndCheckDataType)(t,F0),X0)}function b(t){let{schema:X0,errSchemaPath:F0,opts:u0,self:b0}=t;if(X0.$ref&&u0.ignoreKeywordsWithRef&&(0,X.schemaHasRulesButRef)(X0,b0.RULES))b0.logger.warn(`$ref: keywords ignored in schema at path "${F0}"`)}function x(t){let{schema:X0,opts:F0}=t;if(X0.default!==void 0&&F0.useDefaults&&F0.strictSchema)(0,X.checkStrictMode)(t,"default is ignored in the schema root")}function g(t){let X0=t.schema[t.opts.schemaId];if(X0)t.baseId=(0,W.resolveUrl)(t.opts.uriResolver,t.baseId,X0)}function i(t){if(t.schema.$async&&!t.schemaEnv.$async)throw Error("async schema in sync schema")}function c({gen:t,schemaEnv:X0,schema:F0,errSchemaPath:u0,opts:b0}){let c0=F0.$comment;if(b0.$comment===!0)t.code(G._`${H.default.self}.logger.log(${c0})`);else if(typeof b0.$comment=="function"){let P1=G.str`${u0}/$comment`,k1=t.scopeValue("root",{ref:X0.root});t.code(G._`${H.default.self}.opts.$comment(${c0}, ${P1}, ${k1}.schema)`)}}function z0(t){let{gen:X0,schemaEnv:F0,validateName:u0,ValidationError:b0,opts:c0}=t;if(F0.$async)X0.if(G._`${H.default.errors} === 0`,()=>X0.return(H.default.data),()=>X0.throw(G._`new ${b0}(${H.default.vErrors})`));else{if(X0.assign(G._`${u0}.errors`,H.default.vErrors),c0.unevaluated)k(t);X0.return(G._`${H.default.errors} === 0`)}}function k({gen:t,evaluated:X0,props:F0,items:u0}){if(F0 instanceof G.Name)t.assign(G._`${X0}.props`,F0);if(u0 instanceof G.Name)t.assign(G._`${X0}.items`,u0)}function d(t,X0,F0,u0){let{gen:b0,schema:c0,data:P1,allErrors:k1,opts:u1,self:b1}=t,{RULES:D0}=b1;if(c0.$ref&&(u1.ignoreKeywordsWithRef||!(0,X.schemaHasRulesButRef)(c0,D0))){b0.block(()=>y0(t,"$ref",D0.all.$ref.definition));return}if(!u1.jtd)$0(t,X0);b0.block(()=>{for(let B of D0.rules)I0(B);I0(D0.post)});function I0(B){if(!(0,z.shouldUseGroup)(c0,B))return;if(B.type){if(b0.if((0,I.checkDataType)(B.type,P1,u1.strictNumbers)),a(t,B),X0.length===1&&X0[0]===B.type&&F0)b0.else(),(0,I.reportTypeError)(t);b0.endIf()}else a(t,B);if(!k1)b0.if(G._`${H.default.errors} === ${u0||0}`)}}function a(t,X0){let{gen:F0,schema:u0,opts:{useDefaults:b0}}=t;if(b0)(0,Q.assignDefaults)(t,X0.type);F0.block(()=>{for(let c0 of X0.rules)if((0,z.shouldUseRule)(u0,c0))y0(t,c0.keyword,c0.definition,X0.type)})}function $0(t,X0){if(t.schemaEnv.meta||!t.opts.strictTypes)return;if(y(t,X0),!t.opts.allowUnionTypes)p(t,X0);Y0(t,t.dataTypes)}function y(t,X0){if(!X0.length)return;if(!t.dataTypes.length){t.dataTypes=X0;return}X0.forEach((F0)=>{if(!o(t.dataTypes,F0))O0(t,`type "${F0}" not allowed by context "${t.dataTypes.join(",")}"`)}),e(t,X0)}function p(t,X0){if(X0.length>1&&!(X0.length===2&&X0.includes("null")))O0(t,"use allowUnionTypes to allow union type keyword")}function Y0(t,X0){let F0=t.self.RULES.all;for(let u0 in F0){let b0=F0[u0];if(typeof b0=="object"&&(0,z.shouldUseRule)(t.schema,b0)){let{type:c0}=b0.definition;if(c0.length&&!c0.some((P1)=>R(X0,P1)))O0(t,`missing type "${c0.join(",")}" for keyword "${u0}"`)}}}function R(t,X0){return t.includes(X0)||X0==="number"&&t.includes("integer")}function o(t,X0){return t.includes(X0)||X0==="integer"&&t.includes("number")}function e(t,X0){let F0=[];for(let u0 of t.dataTypes)if(o(X0,u0))F0.push(u0);else if(X0.includes("integer")&&u0==="number")F0.push("integer");t.dataTypes=F0}function O0(t,X0){let F0=t.schemaEnv.baseId+t.errSchemaPath;X0+=` at "${F0}" (strictTypes)`,(0,X.checkStrictMode)(t,X0,t.opts.strictTypes)}var T0=class{constructor(t,X0,F0){if((0,J.validateKeywordUsage)(t,X0,F0),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=F0,this.data=t.data,this.schema=t.schema[F0],this.$data=X0.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,X.schemaRefOrVal)(t,this.schema,F0,this.$data),this.schemaType=X0.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=X0,this.$data)this.schemaCode=t.gen.const("vSchema",q1(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,J.validSchemaType)(this.schema,X0.schemaType,X0.allowUndefined))throw Error(`${F0} value must be ${JSON.stringify(X0.schemaType)}`);if("code"in X0?X0.trackErrors:X0.errors!==!1)this.errsCount=t.gen.const("_errs",H.default.errors)}result(t,X0,F0){this.failResult((0,G.not)(t),X0,F0)}failResult(t,X0,F0){if(this.gen.if(t),F0)F0();else this.error();if(X0){if(this.gen.else(),X0(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(t,X0){this.failResult((0,G.not)(t),void 0,X0)}fail(t){if(t===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(t),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:X0}=this;this.fail(G._`${X0} !== undefined && (${(0,G.or)(this.invalid$data(),t)})`)}error(t,X0,F0){if(X0){this.setParams(X0),this._error(t,F0),this.setParams({});return}this._error(t,F0)}_error(t,X0){(t?Z.reportExtraError:Z.reportError)(this,this.def.error,X0)}$dataError(){(0,Z.reportError)(this,this.def.$dataError||Z.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Z.resetErrorsCount)(this.gen,this.errsCount)}ok(t){if(!this.allErrors)this.gen.if(t)}setParams(t,X0){if(X0)Object.assign(this.params,t);else this.params=t}block$data(t,X0,F0=G.nil){this.gen.block(()=>{this.check$data(t,F0),X0()})}check$data(t=G.nil,X0=G.nil){if(!this.$data)return;let{gen:F0,schemaCode:u0,schemaType:b0,def:c0}=this;if(F0.if((0,G.or)(G._`${u0} === undefined`,X0)),t!==G.nil)F0.assign(t,!0);if(b0.length||c0.validateSchema){if(F0.elseIf(this.invalid$data()),this.$dataError(),t!==G.nil)F0.assign(t,!1)}F0.else()}invalid$data(){let{gen:t,schemaCode:X0,schemaType:F0,def:u0,it:b0}=this;return(0,G.or)(c0(),P1());function c0(){if(F0.length){if(!(X0 instanceof G.Name))throw Error("ajv implementation error");let k1=Array.isArray(F0)?F0:[F0];return G._`${(0,I.checkDataTypes)(k1,X0,b0.opts.strictNumbers,I.DataType.Wrong)}`}return G.nil}function P1(){if(u0.validateSchema){let k1=t.scopeValue("validate$data",{ref:u0.validateSchema});return G._`!${k1}(${X0})`}return G.nil}}subschema(t,X0){let F0=(0,K.getSubschema)(this.it,t);(0,K.extendSubschemaData)(F0,this.it,t),(0,K.extendSubschemaMode)(F0,t);let u0={...this.it,...F0,items:void 0,props:void 0};return D(u0,X0),u0}mergeEvaluated(t,X0){let{it:F0,gen:u0}=this;if(!F0.opts.unevaluated)return;if(F0.props!==!0&&t.props!==void 0)F0.props=X.mergeEvaluated.props(u0,t.props,F0.props,X0);if(F0.items!==!0&&t.items!==void 0)F0.items=X.mergeEvaluated.items(u0,t.items,F0.items,X0)}mergeValidEvaluated(t,X0){let{it:F0,gen:u0}=this;if(F0.opts.unevaluated&&(F0.props!==!0||F0.items!==!0))return u0.if(X0,()=>this.mergeEvaluated(t,G.Name)),!0}};$.KeywordCxt=T0;function y0(t,X0,F0,u0){let b0=new T0(t,F0,X0);if("code"in F0)F0.code(b0,u0);else if(b0.$data&&F0.validate)(0,J.funcKeywordCode)(b0,F0);else if("macro"in F0)(0,J.macroKeywordCode)(b0,F0);else if(F0.compile||F0.validate)(0,J.funcKeywordCode)(b0,F0)}let v0=/^\/(?:[^~]|~0|~1)*$/,o0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function q1(t,{dataLevel:X0,dataNames:F0,dataPathArr:u0}){let b0,c0;if(t==="")return H.default.rootData;if(t[0]==="/"){if(!v0.test(t))throw Error(`Invalid JSON-pointer: ${t}`);b0=t,c0=H.default.rootData}else{let b1=o0.exec(t);if(!b1)throw Error(`Invalid JSON-pointer: ${t}`);let D0=+b1[1];if(b0=b1[2],b0==="#"){if(D0>=X0)throw Error(u1("property/index",D0));return u0[X0-D0]}if(D0>X0)throw Error(u1("data",D0));if(c0=F0[X0-D0],!b0)return c0}let P1=c0,k1=b0.split("/");for(let b1 of k1)if(b1)c0=G._`${c0}${(0,G.getProperty)((0,X.unescapeJsonPointer)(b1))}`,P1=G._`${P1} && ${c0}`;return P1;function u1(b1,D0){return`Cannot access ${b1} ${D0} levels up, current level is ${X0}`}}$.getData=q1}),MH=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});var Y=class extends Error{constructor(U){super("validation failed");this.errors=U,this.ajv=this.validation=!0}};$.default=Y}),iI=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=lw();var U=class extends Error{constructor(z,I,Q,J){super(J||`can't resolve reference ${Q} from id ${I}`);this.missingRef=(0,Y.resolveUrl)(z,I,Q),this.missingSchema=(0,Y.normalizeId)((0,Y.getFullPath)(z,this.missingRef))}};$.default=U}),ow=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.resolveSchema=$.getCompilingSchema=$.resolveRef=$.compileSchema=$.SchemaEnv=void 0;let Y=F1(),U=MH(),z=K5(),I=lw(),Q=v1(),J=bI();var K=class{constructor(F){var N;this.refs={},this.dynamicAnchors={};let O;if(typeof F.schema=="object")O=F.schema;this.schema=F.schema,this.schemaId=F.schemaId,this.root=F.root||this,this.baseId=(N=F.baseId)!==null&&N!==void 0?N:(0,I.normalizeId)(O===null||O===void 0?void 0:O[F.schemaId||"$id"]),this.schemaPath=F.schemaPath,this.localRefs=F.localRefs,this.meta=F.meta,this.$async=O===null||O===void 0?void 0:O.$async,this.refs={}}};$.SchemaEnv=K;function G(F){let N=X.call(this,F);if(N)return N;let O=(0,I.getFullPath)(this.opts.uriResolver,F.root.baseId),{es5:D,lines:P}=this.opts.code,{ownProperties:T}=this.opts,A=new Y.CodeGen(this.scope,{es5:D,lines:P,ownProperties:T}),j;if(F.$async)j=A.scopeValue("Error",{ref:U.default,code:Y._`require("ajv/dist/runtime/validation_error").default`});let C=A.scopeName("validate");F.validateName=C;let b={gen:A,allErrors:this.opts.allErrors,data:z.default.data,parentData:z.default.parentData,parentDataProperty:z.default.parentDataProperty,dataNames:[z.default.data],dataPathArr:[Y.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:F.schema,code:(0,Y.stringify)(F.schema)}:{ref:F.schema}),validateName:C,ValidationError:j,schema:F.schema,schemaEnv:F,rootId:O,baseId:F.baseId||O,schemaPath:Y.nil,errSchemaPath:F.schemaPath||(this.opts.jtd?"":"#"),errorPath:Y._`""`,opts:this.opts,self:this},x;try{this._compilations.add(F),(0,J.validateFunctionCode)(b),A.optimize(this.opts.code.optimize);let g=A.toString();if(x=`${A.scopeRefs(z.default.scope)}return ${g}`,this.opts.code.process)x=this.opts.code.process(x,F);let i=Function(`${z.default.self}`,`${z.default.scope}`,x)(this,this.scope.get());if(this.scope.value(C,{ref:i}),i.errors=null,i.schema=F.schema,i.schemaEnv=F,F.$async)i.$async=!0;if(this.opts.code.source===!0)i.source={validateName:C,validateCode:g,scopeValues:A._values};if(this.opts.unevaluated){let{props:c,items:z0}=b;if(i.evaluated={props:c instanceof Y.Name?void 0:c,items:z0 instanceof Y.Name?void 0:z0,dynamicProps:c instanceof Y.Name,dynamicItems:z0 instanceof Y.Name},i.source)i.source.evaluated=(0,Y.stringify)(i.evaluated)}return F.validate=i,F}catch(g){if(delete F.validate,delete F.validateName,x)this.logger.error("Error compiling schema, function code:",x);throw g}finally{this._compilations.delete(F)}}$.compileSchema=G;function H(F,N,O){var D;O=(0,I.resolveUrl)(this.opts.uriResolver,N,O);let P=F.refs[O];if(P)return P;let T=q.call(this,F,O);if(T===void 0){let A=(D=F.localRefs)===null||D===void 0?void 0:D[O],{schemaId:j}=this.opts;if(A)T=new K({schema:A,schemaId:j,root:F,baseId:N})}if(T===void 0)return;return F.refs[O]=W.call(this,T)}$.resolveRef=H;function W(F){if((0,I.inlineRef)(F.schema,this.opts.inlineRefs))return F.schema;return F.validate?F:G.call(this,F)}function X(F){for(let N of this._compilations)if(Z(N,F))return N}$.getCompilingSchema=X;function Z(F,N){return F.schema===N.schema&&F.root===N.root&&F.baseId===N.baseId}function q(F,N){let O;while(typeof(O=this.refs[N])=="string")N=O;return O||this.schemas[N]||V.call(this,F,N)}function V(F,N){let O=this.opts.uriResolver.parse(N),D=(0,I._getFullPath)(this.opts.uriResolver,O),P=(0,I.getFullPath)(this.opts.uriResolver,F.baseId,void 0);if(Object.keys(F.schema).length>0&&D===P)return M.call(this,O,F);let T=(0,I.normalizeId)(D),A=this.refs[T]||this.schemas[T];if(typeof A=="string"){let j=V.call(this,F,A);if(typeof(j===null||j===void 0?void 0:j.schema)!=="object")return;return M.call(this,O,j)}if(typeof(A===null||A===void 0?void 0:A.schema)!=="object")return;if(!A.validate)G.call(this,A);if(T===(0,I.normalizeId)(N)){let{schema:j}=A,{schemaId:C}=this.opts,b=j[C];if(b)P=(0,I.resolveUrl)(this.opts.uriResolver,P,b);return new K({schema:j,schemaId:C,root:F,baseId:P})}return M.call(this,O,A)}$.resolveSchema=V;let w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function M(F,{baseId:N,schema:O,root:D}){var P;if(((P=F.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(let j of F.fragment.slice(1).split("/")){if(typeof O==="boolean")return;let C=O[(0,Q.unescapeFragment)(j)];if(C===void 0)return;O=C;let b=typeof O==="object"&&O[this.opts.schemaId];if(!w.has(j)&&b)N=(0,I.resolveUrl)(this.opts.uriResolver,N,b)}let T;if(typeof O!="boolean"&&O.$ref&&!(0,Q.schemaHasRulesButRef)(O,this.RULES)){let j=(0,I.resolveUrl)(this.opts.uriResolver,N,O.$ref);T=V.call(this,D,j)}let{schemaId:A}=this.opts;if(T=T||new K({schema:O,schemaId:A,root:D,baseId:N}),T.schema!==T.root.schema)return T}}),sb0=E0(($,Y)=>{Y.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),Ce=E0(($,Y)=>{let U=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),z=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function I(V){let w="",M=0,F=0;for(F=0;F=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";w+=V[F];break}for(F+=1;F=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";w+=V[F]}return w}let Q=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function J(V){return V.length=0,!0}function K(V,w,M){if(V.length){let F=I(V);if(F!=="")w.push(F);else return M.error=!0,!1;V.length=0}return!0}function G(V){let w=0,M={error:!1,address:"",zone:""},F=[],N=[],O=!1,D=!1,P=K;for(let T=0;T7){M.error=!0;break}if(T>0&&V[T-1]===":")O=!0;F.push(":");continue}else if(A==="%"){if(!P(N,F,M))break;P=J}else{N.push(A);continue}}if(N.length)if(P===J)M.zone=N.join("");else if(D)F.push(N.join(""));else F.push(I(N));return M.address=F.join(""),M}function H(V){if(W(V,":")<2)return{host:V,isIPV6:!1};let w=G(V);if(!w.error){let{address:M,address:F}=w;if(w.zone)M+="%"+w.zone,F+="%25"+w.zone;return{host:M,isIPV6:!0,escapedHost:F}}else return{host:V,isIPV6:!1}}function W(V,w){let M=0;for(let F=0;F{let{isUUID:U}=Ce(),z=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,I=["http","https","ws","wss","urn","urn:uuid"];function Q(A){return I.indexOf(A)!==-1}function J(A){if(A.secure===!0)return!0;else if(A.secure===!1)return!1;else if(A.scheme)return A.scheme.length===3&&(A.scheme[0]==="w"||A.scheme[0]==="W")&&(A.scheme[1]==="s"||A.scheme[1]==="S")&&(A.scheme[2]==="s"||A.scheme[2]==="S");else return!1}function K(A){if(!A.host)A.error=A.error||"HTTP URIs must have a host.";return A}function G(A){let j=String(A.scheme).toLowerCase()==="https";if(A.port===(j?443:80)||A.port==="")A.port=void 0;if(!A.path)A.path="/";return A}function H(A){return A.secure=J(A),A.resourceName=(A.path||"/")+(A.query?"?"+A.query:""),A.path=void 0,A.query=void 0,A}function W(A){if(A.port===(J(A)?443:80)||A.port==="")A.port=void 0;if(typeof A.secure==="boolean")A.scheme=A.secure?"wss":"ws",A.secure=void 0;if(A.resourceName){let[j,C]=A.resourceName.split("?");A.path=j&&j!=="/"?j:void 0,A.query=C,A.resourceName=void 0}return A.fragment=void 0,A}function X(A,j){if(!A.path)return A.error="URN can not be parsed",A;let C=A.path.match(z);if(C){let b=j.scheme||A.scheme||"urn";A.nid=C[1].toLowerCase(),A.nss=C[2];let x=T(`${b}:${j.nid||A.nid}`);if(A.path=void 0,x)A=x.parse(A,j)}else A.error=A.error||"URN can not be parsed.";return A}function Z(A,j){if(A.nid===void 0)throw Error("URN without nid cannot be serialized");let C=j.scheme||A.scheme||"urn",b=A.nid.toLowerCase(),x=T(`${C}:${j.nid||b}`);if(x)A=x.serialize(A,j);let g=A,i=A.nss;return g.path=`${b||j.nid}:${i}`,j.skipEscape=!0,g}function q(A,j){let C=A;if(C.uuid=C.nss,C.nss=void 0,!j.tolerant&&(!C.uuid||!U(C.uuid)))C.error=C.error||"UUID is not valid.";return C}function V(A){let j=A;return j.nss=(A.uuid||"").toLowerCase(),j}let w={scheme:"http",domainHost:!0,parse:K,serialize:G},M={scheme:"https",domainHost:w.domainHost,parse:K,serialize:G},F={scheme:"ws",domainHost:!0,parse:H,serialize:W},N={scheme:"wss",domainHost:F.domainHost,parse:F.parse,serialize:F.serialize},P={http:w,https:M,ws:F,wss:N,urn:{scheme:"urn",parse:X,serialize:Z,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:q,serialize:V,skipNormalize:!0}};Object.setPrototypeOf(P,null);function T(A){return A&&(P[A]||P[A.toLowerCase()])||void 0}Y.exports={wsIsSecure:J,SCHEMES:P,isValidSchemeName:Q,getSchemeHandler:T}}),tb0=E0(($,Y)=>{let{normalizeIPv6:U,removeDotSegments:z,recomposeAuthority:I,normalizeComponentEncoding:Q,isIPv4:J,nonSimpleDomain:K}=Ce(),{SCHEMES:G,getSchemeHandler:H}=ab0();function W(N,O){if(typeof N==="string")N=V(M(N,O),O);else if(typeof N==="object")N=M(V(N,O),O);return N}function X(N,O,D){let P=D?Object.assign({scheme:"null"},D):{scheme:"null"},T=Z(M(N,P),M(O,P),P,!0);return P.skipEscape=!0,V(T,P)}function Z(N,O,D,P){let T={};if(!P)N=M(V(N,D),D),O=M(V(O,D),D);if(D=D||{},!D.tolerant&&O.scheme)T.scheme=O.scheme,T.userinfo=O.userinfo,T.host=O.host,T.port=O.port,T.path=z(O.path||""),T.query=O.query;else{if(O.userinfo!==void 0||O.host!==void 0||O.port!==void 0)T.userinfo=O.userinfo,T.host=O.host,T.port=O.port,T.path=z(O.path||""),T.query=O.query;else{if(!O.path)if(T.path=N.path,O.query!==void 0)T.query=O.query;else T.query=N.query;else{if(O.path[0]==="/")T.path=z(O.path);else{if((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path)T.path="/"+O.path;else if(!N.path)T.path=O.path;else T.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+O.path;T.path=z(T.path)}T.query=O.query}T.userinfo=N.userinfo,T.host=N.host,T.port=N.port}T.scheme=N.scheme}return T.fragment=O.fragment,T}function q(N,O,D){if(typeof N==="string")N=unescape(N),N=V(Q(M(N,D),!0),{...D,skipEscape:!0});else if(typeof N==="object")N=V(Q(N,!0),{...D,skipEscape:!0});if(typeof O==="string")O=unescape(O),O=V(Q(M(O,D),!0),{...D,skipEscape:!0});else if(typeof O==="object")O=V(Q(O,!0),{...D,skipEscape:!0});return N.toLowerCase()===O.toLowerCase()}function V(N,O){let D={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},P=Object.assign({},O),T=[],A=H(P.scheme||D.scheme);if(A&&A.serialize)A.serialize(D,P);if(D.path!==void 0)if(!P.skipEscape){if(D.path=escape(D.path),D.scheme!==void 0)D.path=D.path.split("%3A").join(":")}else D.path=unescape(D.path);if(P.reference!=="suffix"&&D.scheme)T.push(D.scheme,":");let j=I(D);if(j!==void 0){if(P.reference!=="suffix")T.push("//");if(T.push(j),D.path&&D.path[0]!=="/")T.push("/")}if(D.path!==void 0){let C=D.path;if(!P.absolutePath&&(!A||!A.absolutePath))C=z(C);if(j===void 0&&C[0]==="/"&&C[1]==="/")C="/%2F"+C.slice(2);T.push(C)}if(D.query!==void 0)T.push("?",D.query);if(D.fragment!==void 0)T.push("#",D.fragment);return T.join("")}let w=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function M(N,O){let D=Object.assign({},O),P={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},T=!1;if(D.reference==="suffix")if(D.scheme)N=D.scheme+":"+N;else N="//"+N;let A=N.match(w);if(A){if(P.scheme=A[1],P.userinfo=A[3],P.host=A[4],P.port=parseInt(A[5],10),P.path=A[6]||"",P.query=A[7],P.fragment=A[8],isNaN(P.port))P.port=A[5];if(P.host)if(J(P.host)===!1){let C=U(P.host);P.host=C.host.toLowerCase(),T=C.isIPV6}else T=!0;if(P.scheme===void 0&&P.userinfo===void 0&&P.host===void 0&&P.port===void 0&&P.query===void 0&&!P.path)P.reference="same-document";else if(P.scheme===void 0)P.reference="relative";else if(P.fragment===void 0)P.reference="absolute";else P.reference="uri";if(D.reference&&D.reference!=="suffix"&&D.reference!==P.reference)P.error=P.error||"URI is not a "+D.reference+" reference.";let j=H(D.scheme||P.scheme);if(!D.unicodeSupport&&(!j||!j.unicodeSupport)){if(P.host&&(D.domainHost||j&&j.domainHost)&&T===!1&&K(P.host))try{P.host=URL.domainToASCII(P.host.toLowerCase())}catch(C){P.error=P.error||"Host's domain name can not be converted to ASCII: "+C}}if(!j||j&&!j.skipNormalize){if(N.indexOf("%")!==-1){if(P.scheme!==void 0)P.scheme=unescape(P.scheme);if(P.host!==void 0)P.host=unescape(P.host)}if(P.path)P.path=escape(unescape(P.path));if(P.fragment)P.fragment=encodeURI(decodeURIComponent(P.fragment))}if(j&&j.parse)j.parse(P,D)}else P.error=P.error||"URI can not be parsed.";return P}let F={SCHEMES:G,normalize:W,resolve:X,resolveComponent:Z,equal:q,serialize:V,parse:M};Y.exports=F,Y.exports.default=F,Y.exports.fastUri=F}),eb0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=tb0();Y.code='require("ajv/dist/runtime/uri").default',$.default=Y}),vS=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=void 0;var Y=bI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return Y.KeywordCxt}});var U=F1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return U._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return U.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return U.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return U.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return U.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return U.CodeGen}});let z=MH(),I=iI(),Q=Te(),J=ow(),K=F1(),G=lw(),H=dw(),W=v1(),X=sb0(),Z=eb0(),q=(y,p)=>new RegExp(y,p);q.code="new RegExp";let V=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),M={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},F={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},N=200;function O(y){var p,Y0,R,o,e,O0,T0,y0,v0,o0,q1,t,X0,F0,u0,b0,c0,P1,k1,u1,b1,D0,I0,B,h;let u=y.strict,s=(p=y.code)===null||p===void 0?void 0:p.optimize,W0=s===!0||s===void 0?1:s||0,Q0=(R=(Y0=y.code)===null||Y0===void 0?void 0:Y0.regExp)!==null&&R!==void 0?R:q,Z0=(o=y.uriResolver)!==null&&o!==void 0?o:Z.default;return{strictSchema:(O0=(e=y.strictSchema)!==null&&e!==void 0?e:u)!==null&&O0!==void 0?O0:!0,strictNumbers:(y0=(T0=y.strictNumbers)!==null&&T0!==void 0?T0:u)!==null&&y0!==void 0?y0:!0,strictTypes:(o0=(v0=y.strictTypes)!==null&&v0!==void 0?v0:u)!==null&&o0!==void 0?o0:"log",strictTuples:(t=(q1=y.strictTuples)!==null&&q1!==void 0?q1:u)!==null&&t!==void 0?t:"log",strictRequired:(F0=(X0=y.strictRequired)!==null&&X0!==void 0?X0:u)!==null&&F0!==void 0?F0:!1,code:y.code?{...y.code,optimize:W0,regExp:Q0}:{optimize:W0,regExp:Q0},loopRequired:(u0=y.loopRequired)!==null&&u0!==void 0?u0:N,loopEnum:(b0=y.loopEnum)!==null&&b0!==void 0?b0:N,meta:(c0=y.meta)!==null&&c0!==void 0?c0:!0,messages:(P1=y.messages)!==null&&P1!==void 0?P1:!0,inlineRefs:(k1=y.inlineRefs)!==null&&k1!==void 0?k1:!0,schemaId:(u1=y.schemaId)!==null&&u1!==void 0?u1:"$id",addUsedSchema:(b1=y.addUsedSchema)!==null&&b1!==void 0?b1:!0,validateSchema:(D0=y.validateSchema)!==null&&D0!==void 0?D0:!0,validateFormats:(I0=y.validateFormats)!==null&&I0!==void 0?I0:!0,unicodeRegExp:(B=y.unicodeRegExp)!==null&&B!==void 0?B:!0,int32range:(h=y.int32range)!==null&&h!==void 0?h:!0,uriResolver:Z0}}var D=class{constructor(y={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,y=this.opts={...y,...O(y)};let{es5:p,lines:Y0}=this.opts.code;this.scope=new K.ValueScope({scope:{},prefixes:w,es5:p,lines:Y0}),this.logger=g(y.logger);let R=y.validateFormats;if(y.validateFormats=!1,this.RULES=(0,Q.getRules)(),P.call(this,M,y,"NOT SUPPORTED"),P.call(this,F,y,"DEPRECATED","warn"),this._metaOpts=b.call(this),y.formats)j.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),y.keywords)C.call(this,y.keywords);if(typeof y.meta=="object")this.addMetaSchema(y.meta);A.call(this),y.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:y,meta:p,schemaId:Y0}=this.opts,R=X;if(Y0==="id")R={...X},R.id=R.$id,delete R.$id;if(p&&y)this.addMetaSchema(R,R[Y0],!1)}defaultMeta(){let{meta:y,schemaId:p}=this.opts;return this.opts.defaultMeta=typeof y=="object"?y[p]||y:void 0}validate(y,p){let Y0;if(typeof y=="string"){if(Y0=this.getSchema(y),!Y0)throw Error(`no schema with key or ref "${y}"`)}else Y0=this.compile(y);let R=Y0(p);if(!("$async"in Y0))this.errors=Y0.errors;return R}compile(y,p){let Y0=this._addSchema(y,p);return Y0.validate||this._compileSchemaEnv(Y0)}compileAsync(y,p){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Y0}=this.opts;return R.call(this,y,p);async function R(v0,o0){await o.call(this,v0.$schema);let q1=this._addSchema(v0,o0);return q1.validate||e.call(this,q1)}async function o(v0){if(v0&&!this.getSchema(v0))await R.call(this,{$ref:v0},!0)}async function e(v0){try{return this._compileSchemaEnv(v0)}catch(o0){if(!(o0 instanceof I.default))throw o0;return O0.call(this,o0),await T0.call(this,o0.missingSchema),e.call(this,v0)}}function O0({missingSchema:v0,missingRef:o0}){if(this.refs[v0])throw Error(`AnySchema ${v0} is loaded but ${o0} cannot be resolved`)}async function T0(v0){let o0=await y0.call(this,v0);if(!this.refs[v0])await o.call(this,o0.$schema);if(!this.refs[v0])this.addSchema(o0,v0,p)}async function y0(v0){let o0=this._loading[v0];if(o0)return o0;try{return await(this._loading[v0]=Y0(v0))}finally{delete this._loading[v0]}}}addSchema(y,p,Y0,R=this.opts.validateSchema){if(Array.isArray(y)){for(let e of y)this.addSchema(e,void 0,Y0,R);return this}let o;if(typeof y==="object"){let{schemaId:e}=this.opts;if(o=y[e],o!==void 0&&typeof o!="string")throw Error(`schema ${e} must be string`)}return p=(0,G.normalizeId)(p||o),this._checkUnique(p),this.schemas[p]=this._addSchema(y,Y0,p,R,!0),this}addMetaSchema(y,p,Y0=this.opts.validateSchema){return this.addSchema(y,p,!0,Y0),this}validateSchema(y,p){if(typeof y=="boolean")return!0;let Y0;if(Y0=y.$schema,Y0!==void 0&&typeof Y0!="string")throw Error("$schema must be a string");if(Y0=Y0||this.opts.defaultMeta||this.defaultMeta(),!Y0)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let R=this.validate(Y0,y);if(!R&&p){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw Error(o)}return R}getSchema(y){let p;while(typeof(p=T.call(this,y))=="string")y=p;if(p===void 0){let{schemaId:Y0}=this.opts,R=new J.SchemaEnv({schema:{},schemaId:Y0});if(p=J.resolveSchema.call(this,R,y),!p)return;this.refs[y]=p}return p.validate||this._compileSchemaEnv(p)}removeSchema(y){if(y instanceof RegExp)return this._removeAllSchemas(this.schemas,y),this._removeAllSchemas(this.refs,y),this;switch(typeof y){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let p=T.call(this,y);if(typeof p=="object")this._cache.delete(p.schema);return delete this.schemas[y],delete this.refs[y],this}case"object":{let p=y;this._cache.delete(p);let Y0=y[this.opts.schemaId];if(Y0)Y0=(0,G.normalizeId)(Y0),delete this.schemas[Y0],delete this.refs[Y0];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(y){for(let p of y)this.addKeyword(p);return this}addKeyword(y,p){let Y0;if(typeof y=="string"){if(Y0=y,typeof p=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),p.keyword=Y0}else if(typeof y=="object"&&p===void 0){if(p=y,Y0=p.keyword,Array.isArray(Y0)&&!Y0.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(c.call(this,Y0,p),!p)return(0,W.eachItem)(Y0,(o)=>z0.call(this,o)),this;d.call(this,p);let R={...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)};return(0,W.eachItem)(Y0,R.type.length===0?(o)=>z0.call(this,o,R):(o)=>R.type.forEach((e)=>z0.call(this,o,R,e))),this}getKeyword(y){let p=this.RULES.all[y];return typeof p=="object"?p.definition:!!p}removeKeyword(y){let{RULES:p}=this;delete p.keywords[y],delete p.all[y];for(let Y0 of p.rules){let R=Y0.rules.findIndex((o)=>o.keyword===y);if(R>=0)Y0.rules.splice(R,1)}return this}addFormat(y,p){if(typeof p=="string")p=new RegExp(p);return this.formats[y]=p,this}errorsText(y=this.errors,{separator:p=", ",dataVar:Y0="data"}={}){if(!y||y.length===0)return"No errors";return y.map((R)=>`${Y0}${R.instancePath} ${R.message}`).reduce((R,o)=>R+p+o)}$dataMetaSchema(y,p){let Y0=this.RULES.all;y=JSON.parse(JSON.stringify(y));for(let R of p){let o=R.split("/").slice(1),e=y;for(let O0 of o)e=e[O0];for(let O0 in Y0){let T0=Y0[O0];if(typeof T0!="object")continue;let{$data:y0}=T0.definition,v0=e[O0];if(y0&&v0)e[O0]=$0(v0)}}return y}_removeAllSchemas(y,p){for(let Y0 in y){let R=y[Y0];if(!p||p.test(Y0)){if(typeof R=="string")delete y[Y0];else if(R&&!R.meta)this._cache.delete(R.schema),delete y[Y0]}}}_addSchema(y,p,Y0,R=this.opts.validateSchema,o=this.opts.addUsedSchema){let e,{schemaId:O0}=this.opts;if(typeof y=="object")e=y[O0];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof y!="boolean")throw Error("schema must be object or boolean");let T0=this._cache.get(y);if(T0!==void 0)return T0;Y0=(0,G.normalizeId)(e||Y0);let y0=G.getSchemaRefs.call(this,y,Y0);if(T0=new J.SchemaEnv({schema:y,schemaId:O0,meta:p,baseId:Y0,localRefs:y0}),this._cache.set(T0.schema,T0),o&&!Y0.startsWith("#")){if(Y0)this._checkUnique(Y0);this.refs[Y0]=T0}if(R)this.validateSchema(y,!0);return T0}_checkUnique(y){if(this.schemas[y]||this.refs[y])throw Error(`schema with key or id "${y}" already exists`)}_compileSchemaEnv(y){if(y.meta)this._compileMetaSchema(y);else J.compileSchema.call(this,y);if(!y.validate)throw Error("ajv implementation error");return y.validate}_compileMetaSchema(y){let p=this.opts;this.opts=this._metaOpts;try{J.compileSchema.call(this,y)}finally{this.opts=p}}};D.ValidationError=z.default,D.MissingRefError=I.default,$.default=D;function P(y,p,Y0,R="error"){for(let o in y){let e=o;if(e in p)this.logger[R](`${Y0}: option ${o}. ${y[e]}`)}}function T(y){return y=(0,G.normalizeId)(y),this.schemas[y]||this.refs[y]}function A(){let y=this.opts.schemas;if(!y)return;if(Array.isArray(y))this.addSchema(y);else for(let p in y)this.addSchema(y[p],p)}function j(){for(let y in this.opts.formats){let p=this.opts.formats[y];if(p)this.addFormat(y,p)}}function C(y){if(Array.isArray(y)){this.addVocabulary(y);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let p in y){let Y0=y[p];if(!Y0.keyword)Y0.keyword=p;this.addKeyword(Y0)}}function b(){let y={...this.opts};for(let p of V)delete y[p];return y}let x={log(){},warn(){},error(){}};function g(y){if(y===!1)return x;if(y===void 0)return console;if(y.log&&y.warn&&y.error)return y;throw Error("logger must implement log, warn and error methods")}let i=/^[a-z_$][a-z0-9_$:-]*$/i;function c(y,p){let{RULES:Y0}=this;if((0,W.eachItem)(y,(R)=>{if(Y0.keywords[R])throw Error(`Keyword ${R} is already defined`);if(!i.test(R))throw Error(`Keyword ${R} has invalid name`)}),!p)return;if(p.$data&&!(("code"in p)||("validate"in p)))throw Error('$data keyword must have "code" or "validate" function')}function z0(y,p,Y0){var R;let o=p===null||p===void 0?void 0:p.post;if(Y0&&o)throw Error('keyword with "post" flag cannot have "type"');let{RULES:e}=this,O0=o?e.post:e.rules.find(({type:y0})=>y0===Y0);if(!O0)O0={type:Y0,rules:[]},e.rules.push(O0);if(e.keywords[y]=!0,!p)return;let T0={keyword:y,definition:{...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)}};if(p.before)k.call(this,O0,T0,p.before);else O0.rules.push(T0);e.all[y]=T0,(R=p.implements)===null||R===void 0||R.forEach((y0)=>this.addKeyword(y0))}function k(y,p,Y0){let R=y.rules.findIndex((o)=>o.keyword===Y0);if(R>=0)y.rules.splice(R,0,p);else y.rules.push(p),this.logger.warn(`rule ${Y0} is not defined`)}function d(y){let{metaSchema:p}=y;if(p===void 0)return;if(y.$data&&this.opts.$data)p=$0(p);y.validateSchema=this.compile(p,!0)}let a={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $0(y){return{anyOf:[y,a]}}}),$i0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$.default=Y}),hS=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.callRef=$.getValidate=void 0;let Y=iI(),U=G5(),z=F1(),I=K5(),Q=ow(),J=v1(),K={keyword:"$ref",schemaType:"string",code(W){let{gen:X,schema:Z,it:q}=W,{baseId:V,schemaEnv:w,validateName:M,opts:F,self:N}=q,{root:O}=w;if((Z==="#"||Z==="#/")&&V===O.baseId)return P();let D=Q.resolveRef.call(N,O,V,Z);if(D===void 0)throw new Y.default(q.opts.uriResolver,V,Z);if(D instanceof Q.SchemaEnv)return T(D);return A(D);function P(){if(w===O)return H(W,M,w,w.$async);let j=X.scopeValue("root",{ref:O});return H(W,z._`${j}.validate`,O,O.$async)}function T(j){H(W,G(W,j),j,j.$async)}function A(j){let C=X.scopeValue("schema",F.code.source===!0?{ref:j,code:(0,z.stringify)(j)}:{ref:j}),b=X.name("valid"),x=W.subschema({schema:j,dataTypes:[],schemaPath:z.nil,topSchemaRef:C,errSchemaPath:Z},b);W.mergeEvaluated(x),W.ok(b)}}};function G(W,X){let{gen:Z}=W;return X.validate?Z.scopeValue("validate",{ref:X.validate}):z._`${Z.scopeValue("wrapper",{ref:X})}.validate`}$.getValidate=G;function H(W,X,Z,q){let{gen:V,it:w}=W,{allErrors:M,schemaEnv:F,opts:N}=w,O=N.passContext?I.default.this:z.nil;if(q)D();else P();function D(){if(!F.$async)throw Error("async schema referenced by sync schema");let j=V.let("valid");V.try(()=>{if(V.code(z._`await ${(0,U.callValidateCode)(W,X,O)}`),A(X),!M)V.assign(j,!0)},(C)=>{if(V.if(z._`!(${C} instanceof ${w.ValidationError})`,()=>V.throw(C)),T(C),!M)V.assign(j,!1)}),W.ok(j)}function P(){W.result((0,U.callValidateCode)(W,X,O),()=>A(X),()=>T(X))}function T(j){let C=z._`${j}.errors`;V.assign(I.default.vErrors,z._`${I.default.vErrors} === null ? ${C} : ${I.default.vErrors}.concat(${C})`),V.assign(I.default.errors,z._`${I.default.vErrors}.length`)}function A(j){var C;if(!w.opts.unevaluated)return;let b=(C=Z===null||Z===void 0?void 0:Z.validate)===null||C===void 0?void 0:C.evaluated;if(w.props!==!0)if(b&&!b.dynamicProps){if(b.props!==void 0)w.props=J.mergeEvaluated.props(V,b.props,w.props)}else{let x=V.var("props",z._`${j}.evaluated.props`);w.props=J.mergeEvaluated.props(V,x,w.props,z.Name)}if(w.items!==!0)if(b&&!b.dynamicItems){if(b.items!==void 0)w.items=J.mergeEvaluated.items(V,b.items,w.items)}else{let x=V.var("items",z._`${j}.evaluated.items`);w.items=J.mergeEvaluated.items(V,x,w.items,z.Name)}}}$.callRef=H,$.default=K}),Re=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=$i0(),U=hS(),z=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Y.default,U.default];$.default=z}),Yi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=Y.operators,z={maximum:{okStr:"<=",ok:U.LTE,fail:U.GT},minimum:{okStr:">=",ok:U.GTE,fail:U.LT},exclusiveMaximum:{okStr:"<",ok:U.LT,fail:U.GTE},exclusiveMinimum:{okStr:">",ok:U.GT,fail:U.LTE}},I={keyword:Object.keys(z),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:Q,schemaCode:J})=>Y.str`must be ${z[Q].okStr} ${J}`,params:({keyword:Q,schemaCode:J})=>Y._`{comparison: ${z[Q].okStr}, limit: ${J}}`},code(Q){let{keyword:J,data:K,schemaCode:G}=Q;Q.fail$data(Y._`${K} ${z[J].fail} ${G} || isNaN(${K})`)}};$.default=I}),Ui0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:z})=>Y.str`must be multiple of ${z}`,params:({schemaCode:z})=>Y._`{multipleOf: ${z}}`},code(z){let{gen:I,data:Q,schemaCode:J,it:K}=z,G=K.opts.multipleOfPrecision,H=I.let("res"),W=G?Y._`Math.abs(Math.round(${H}) - ${H}) > 1e-${G}`:Y._`${H} !== parseInt(${H})`;z.fail$data(Y._`(${J} === 0 || (${H} = ${Q}/${J}, ${W}))`)}};$.default=U}),zi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});function Y(U){let z=U.length,I=0,Q=0,J;while(Q=55296&&J<=56319&&Q{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z=zi0(),I={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:Q,schemaCode:J}){let K=Q==="maxLength"?"more":"fewer";return Y.str`must NOT have ${K} than ${J} characters`},params:({schemaCode:Q})=>Y._`{limit: ${Q}}`},code(Q){let{keyword:J,data:K,schemaCode:G,it:H}=Q,W=J==="maxLength"?Y.operators.GT:Y.operators.LT,X=H.opts.unicode===!1?Y._`${K}.length`:Y._`${(0,U.useFunc)(Q.gen,z.default)}(${K})`;Q.fail$data(Y._`${X} ${W} ${G}`)}};$.default=I}),Qi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=G5(),U=v1(),z=F1(),I={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:Q})=>z.str`must match pattern "${Q}"`,params:({schemaCode:Q})=>z._`{pattern: ${Q}}`},code(Q){let{gen:J,data:K,$data:G,schema:H,schemaCode:W,it:X}=Q,Z=X.opts.unicodeRegExp?"u":"";if(G){let{regExp:q}=X.opts.code,V=q.code==="new RegExp"?z._`new RegExp`:(0,U.useFunc)(J,q),w=J.let("valid");J.try(()=>J.assign(w,z._`${V}(${W}, ${Z}).test(${K})`),()=>J.assign(w,!1)),Q.fail$data(z._`!${w}`)}else{let q=(0,Y.usePattern)(Q,H);Q.fail$data(z._`!${q}.test(${K})`)}}};$.default=I}),Ji0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:z,schemaCode:I}){let Q=z==="maxProperties"?"more":"fewer";return Y.str`must NOT have ${Q} than ${I} properties`},params:({schemaCode:z})=>Y._`{limit: ${z}}`},code(z){let{keyword:I,data:Q,schemaCode:J}=z,K=I==="maxProperties"?Y.operators.GT:Y.operators.LT;z.fail$data(Y._`Object.keys(${Q}).length ${K} ${J}`)}};$.default=U}),Ki0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=G5(),U=F1(),z=v1(),I={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:Q}})=>U.str`must have required property '${Q}'`,params:({params:{missingProperty:Q}})=>U._`{missingProperty: ${Q}}`},code(Q){let{gen:J,schema:K,schemaCode:G,data:H,$data:W,it:X}=Q,{opts:Z}=X;if(!W&&K.length===0)return;let q=K.length>=Z.loopRequired;if(X.allErrors)V();else w();if(Z.strictRequired){let N=Q.parentSchema.properties,{definedProperties:O}=Q.it;for(let D of K)if((N===null||N===void 0?void 0:N[D])===void 0&&!O.has(D)){let P=`required property "${D}" is not defined at "${X.schemaEnv.baseId+X.errSchemaPath}" (strictRequired)`;(0,z.checkStrictMode)(X,P,X.opts.strictRequired)}}function V(){if(q||W)Q.block$data(U.nil,M);else for(let N of K)(0,Y.checkReportMissingProp)(Q,N)}function w(){let N=J.let("missing");if(q||W){let O=J.let("valid",!0);Q.block$data(O,()=>F(N,O)),Q.ok(O)}else J.if((0,Y.checkMissingProp)(Q,K,N)),(0,Y.reportMissingProp)(Q,N),J.else()}function M(){J.forOf("prop",G,(N)=>{Q.setParams({missingProperty:N}),J.if((0,Y.noPropertyInData)(J,H,N,Z.ownProperties),()=>Q.error())})}function F(N,O){Q.setParams({missingProperty:N}),J.forOf(N,G,()=>{J.assign(O,(0,Y.propertyInData)(J,H,N,Z.ownProperties)),J.if((0,U.not)(O),()=>{Q.error(),J.break()})},U.nil)}}};$.default=I}),Gi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:z,schemaCode:I}){let Q=z==="maxItems"?"more":"fewer";return Y.str`must NOT have ${Q} than ${I} items`},params:({schemaCode:z})=>Y._`{limit: ${z}}`},code(z){let{keyword:I,data:Q,schemaCode:J}=z,K=I==="maxItems"?Y.operators.GT:Y.operators.LT;z.fail$data(Y._`${Q}.length ${K} ${J}`)}};$.default=U}),SS=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ee();Y.code='require("ajv/dist/runtime/equal").default',$.default=Y}),Hi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=dw(),U=F1(),z=v1(),I=SS(),Q={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:J,j:K}})=>U.str`must NOT have duplicate items (items ## ${K} and ${J} are identical)`,params:({params:{i:J,j:K}})=>U._`{i: ${J}, j: ${K}}`},code(J){let{gen:K,data:G,$data:H,schema:W,parentSchema:X,schemaCode:Z,it:q}=J;if(!H&&!W)return;let V=K.let("valid"),w=X.items?(0,Y.getSchemaTypes)(X.items):[];J.block$data(V,M,U._`${Z} === false`),J.ok(V);function M(){let D=K.let("i",U._`${G}.length`),P=K.let("j");J.setParams({i:D,j:P}),K.assign(V,!0),K.if(U._`${D} > 1`,()=>(F()?N:O)(D,P))}function F(){return w.length>0&&!w.some((D)=>D==="object"||D==="array")}function N(D,P){let T=K.name("item"),A=(0,Y.checkDataTypes)(w,T,q.opts.strictNumbers,Y.DataType.Wrong),j=K.const("indices",U._`{}`);K.for(U._`;${D}--;`,()=>{if(K.let(T,U._`${G}[${D}]`),K.if(A,U._`continue`),w.length>1)K.if(U._`typeof ${T} == "string"`,U._`${T} += "_"`);K.if(U._`typeof ${j}[${T}] == "number"`,()=>{K.assign(P,U._`${j}[${T}]`),J.error(),K.assign(V,!1).break()}).code(U._`${j}[${T}] = ${D}`)})}function O(D,P){let T=(0,z.useFunc)(K,I.default),A=K.name("outer");K.label(A).for(U._`;${D}--;`,()=>K.for(U._`${P} = ${D}; ${P}--;`,()=>K.if(U._`${T}(${G}[${D}], ${G}[${P}])`,()=>{J.error(),K.assign(V,!1).break(A)})))}}};$.default=Q}),Wi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z=SS(),I={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:Q})=>Y._`{allowedValue: ${Q}}`},code(Q){let{gen:J,data:K,$data:G,schemaCode:H,schema:W}=Q;if(G||W&&typeof W=="object")Q.fail$data(Y._`!${(0,U.useFunc)(J,z.default)}(${K}, ${H})`);else Q.fail(Y._`${W} !== ${K}`)}};$.default=I}),Xi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z=SS(),I={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:Q})=>Y._`{allowedValues: ${Q}}`},code(Q){let{gen:J,data:K,$data:G,schema:H,schemaCode:W,it:X}=Q;if(!G&&H.length===0)throw Error("enum must have non-empty array");let Z=H.length>=X.opts.loopEnum,q,V=()=>q!==null&&q!==void 0?q:q=(0,U.useFunc)(J,z.default),w;if(Z||G)w=J.let("valid"),Q.block$data(w,M);else{if(!Array.isArray(H))throw Error("ajv implementation error");let N=J.const("vSchema",W);w=(0,Y.or)(...H.map((O,D)=>F(N,D)))}Q.pass(w);function M(){J.assign(w,!1),J.forOf("v",W,(N)=>J.if(Y._`${V()}(${K}, ${N})`,()=>J.assign(w,!0).break()))}function F(N,O){let D=H[O];return typeof D==="object"&&D!==null?Y._`${V()}(${K}, ${N}[${O}])`:Y._`${K} === ${D}`}}};$.default=I}),_e=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Yi0(),U=Ui0(),z=Ii0(),I=Qi0(),Q=Ji0(),J=Ki0(),K=Gi0(),G=Hi0(),H=Wi0(),W=Xi0(),X=[Y.default,U.default,z.default,I.default,Q.default,J.default,K.default,G.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},H.default,W.default];$.default=X}),ve=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateAdditionalItems=void 0;let Y=F1(),U=v1(),z={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:Q}})=>Y.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>Y._`{limit: ${Q}}`},code(Q){let{parentSchema:J,it:K}=Q,{items:G}=J;if(!Array.isArray(G)){(0,U.checkStrictMode)(K,'"additionalItems" is ignored when "items" is not an array of schemas');return}I(Q,G)}};function I(Q,J){let{gen:K,schema:G,data:H,keyword:W,it:X}=Q;X.items=!0;let Z=K.const("len",Y._`${H}.length`);if(G===!1)Q.setParams({len:J.length}),Q.pass(Y._`${Z} <= ${J.length}`);else if(typeof G=="object"&&!(0,U.alwaysValidSchema)(X,G)){let V=K.var("valid",Y._`${Z} <= ${J.length}`);K.if((0,Y.not)(V),()=>q(V)),Q.ok(V)}function q(V){K.forRange("i",J.length,Z,(w)=>{if(Q.subschema({keyword:W,dataProp:w,dataPropType:U.Type.Num},V),!X.allErrors)K.if((0,Y.not)(V),()=>K.break())})}}$.validateAdditionalItems=I,$.default=z}),he=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateTuple=void 0;let Y=F1(),U=v1(),z=G5(),I={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(J){let{schema:K,it:G}=J;if(Array.isArray(K))return Q(J,"additionalItems",K);if(G.items=!0,(0,U.alwaysValidSchema)(G,K))return;J.ok((0,z.validateArray)(J))}};function Q(J,K,G=J.schema){let{gen:H,parentSchema:W,data:X,keyword:Z,it:q}=J;if(M(W),q.opts.unevaluated&&G.length&&q.items!==!0)q.items=U.mergeEvaluated.items(H,G.length,q.items);let V=H.name("valid"),w=H.const("len",Y._`${X}.length`);G.forEach((F,N)=>{if((0,U.alwaysValidSchema)(q,F))return;H.if(Y._`${w} > ${N}`,()=>J.subschema({keyword:Z,schemaProp:N,dataProp:N},V)),J.ok(V)});function M(F){let{opts:N,errSchemaPath:O}=q,D=G.length,P=D===F.minItems&&(D===F.maxItems||F[K]===!1);if(N.strictTuples&&!P){let T=`"${Z}" is ${D}-tuple, but minItems or maxItems/${K} are not specified or different at path "${O}"`;(0,U.checkStrictMode)(q,T,N.strictTuples)}}}$.validateTuple=Q,$.default=I}),Zi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=he(),U={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(z)=>(0,Y.validateTuple)(z,"items")};$.default=U}),qi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z=G5(),I=ve(),Q={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:J}})=>Y.str`must NOT have more than ${J} items`,params:({params:{len:J}})=>Y._`{limit: ${J}}`},code(J){let{schema:K,parentSchema:G,it:H}=J,{prefixItems:W}=G;if(H.items=!0,(0,U.alwaysValidSchema)(H,K))return;if(W)(0,I.validateAdditionalItems)(J,W);else J.ok((0,z.validateArray)(J))}};$.default=Q}),Vi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:I,max:Q}})=>Q===void 0?Y.str`must contain at least ${I} valid item(s)`:Y.str`must contain at least ${I} and no more than ${Q} valid item(s)`,params:({params:{min:I,max:Q}})=>Q===void 0?Y._`{minContains: ${I}}`:Y._`{minContains: ${I}, maxContains: ${Q}}`},code(I){let{gen:Q,schema:J,parentSchema:K,data:G,it:H}=I,W,X,{minContains:Z,maxContains:q}=K;if(H.opts.next)W=Z===void 0?1:Z,X=q;else W=1;let V=Q.const("len",Y._`${G}.length`);if(I.setParams({min:W,max:X}),X===void 0&&W===0){(0,U.checkStrictMode)(H,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(X!==void 0&&W>X){(0,U.checkStrictMode)(H,'"minContains" > "maxContains" is always invalid'),I.fail();return}if((0,U.alwaysValidSchema)(H,J)){let O=Y._`${V} >= ${W}`;if(X!==void 0)O=Y._`${O} && ${V} <= ${X}`;I.pass(O);return}H.items=!0;let w=Q.name("valid");if(X===void 0&&W===1)F(w,()=>Q.if(w,()=>Q.break()));else if(W===0){if(Q.let(w,!0),X!==void 0)Q.if(Y._`${G}.length > 0`,M)}else Q.let(w,!1),M();I.result(w,()=>I.reset());function M(){let O=Q.name("_valid"),D=Q.let("count",0);F(O,()=>Q.if(O,()=>N(D)))}function F(O,D){Q.forRange("i",0,V,(P)=>{I.subschema({keyword:"contains",dataProp:P,dataPropType:U.Type.Num,compositeRule:!0},O),D()})}function N(O){if(Q.code(Y._`${O}++`),X===void 0)Q.if(Y._`${O} >= ${W}`,()=>Q.assign(w,!0).break());else if(Q.if(Y._`${O} > ${X}`,()=>Q.assign(w,!1).break()),W===1)Q.assign(w,!0);else Q.if(Y._`${O} >= ${W}`,()=>Q.assign(w,!0))}}};$.default=z}),gS=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateSchemaDeps=$.validatePropertyDeps=$.error=void 0;let Y=F1(),U=v1(),z=G5();$.error={message:({params:{property:G,depsCount:H,deps:W}})=>{let X=H===1?"property":"properties";return Y.str`must have ${X} ${W} when property ${G} is present`},params:({params:{property:G,depsCount:H,deps:W,missingProperty:X}})=>Y._`{property: ${G}, missingProperty: ${X}, depsCount: ${H}, - deps: ${W}}`};let I={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=Q(G);J(G,H),K(G,W)}};function Q({schema:G}){let H={},W={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?H:W;Z[X]=G[X]}return[H,W]}function J(G,H=G.schema){let{gen:W,data:X,it:Z}=G;if(Object.keys(H).length===0)return;let q=W.let("missing");for(let V in H){let w=H[V];if(w.length===0)continue;let M=(0,z.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:w.length,deps:w.join(", ")}),Z.allErrors)W.if(M,()=>{for(let F of w)(0,z.checkReportMissingProp)(G,F)});else W.if(Y._`${M} && (${(0,z.checkMissingProp)(G,w,q)})`),(0,z.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=J;function K(G,H=G.schema){let{gen:W,data:X,keyword:Z,it:q}=G,V=W.name("valid");for(let w in H){if((0,U.alwaysValidSchema)(q,H[w]))continue;W.if((0,z.propertyInData)(W,X,w,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:w},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=I}),Li0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:I})=>Y._`{propertyName: ${I.propertyName}}`},code(I){let{gen:Q,schema:J,data:K,it:G}=I;if((0,U.alwaysValidSchema)(G,J))return;let H=Q.name("valid");Q.forIn("key",K,(W)=>{I.setParams({propertyName:W}),I.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),Q.if((0,Y.not)(H),()=>{if(I.error(!0),!G.allErrors)Q.break()})}),I.ok(H)}};$.default=z}),Se=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=G5(),U=F1(),z=K5(),I=v1(),Q={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:J})=>U._`{additionalProperty: ${J.additionalProperty}}`},code(J){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=J;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,I.alwaysValidSchema)(Z,G))return;let w=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);F(),J.ok(U._`${X} === ${z.default.errors}`);function F(){K.forIn("key",W,(T)=>{if(!w.length&&!M.length)D(T);else K.if(N(T),()=>D(T))})}function N(T){let A;if(w.length>8){let j=(0,I.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(w.length)A=(0,U.or)(...w.map((j)=>U._`${T} === ${j}`));else A=U.nil;if(M.length)A=(0,U.or)(A,...M.map((j)=>U._`${(0,Y.usePattern)(J,j)}.test(${T})`));return(0,U.not)(A)}function O(T){K.code(U._`delete ${W}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){O(T);return}if(G===!1){if(J.setParams({additionalProperty:T}),J.error(),!q)K.break();return}if(typeof G=="object"&&!(0,I.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")P(T,A,!1),K.if((0,U.not)(A),()=>{J.reset(),O(T)});else if(P(T,A),!q)K.if((0,U.not)(A),()=>K.break())}}function P(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:I.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});J.subschema(C,A)}}};$.default=Q}),Fi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=bI(),U=G5(),z=v1(),I=Se(),Q={keyword:"properties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=J;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)I.default.code(new Y.KeywordCxt(X,I.default,"additionalProperties"));let Z=(0,U.allSchemaProperties)(G);for(let F of Z)X.definedProperties.add(F);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=z.mergeEvaluated.props(K,(0,z.toHash)(Z),X.props);let q=Z.filter((F)=>!(0,z.alwaysValidSchema)(X,G[F]));if(q.length===0)return;let V=K.name("valid");for(let F of q){if(w(F))M(F);else{if(K.if((0,U.propertyInData)(K,W,F,X.opts.ownProperties)),M(F),!X.allErrors)K.else().var(V,!0);K.endIf()}J.it.definedProperties.add(F),J.ok(V)}function w(F){return X.opts.useDefaults&&!X.compositeRule&&G[F].default!==void 0}function M(F){J.subschema({keyword:"properties",schemaProp:F,dataProp:F},V)}}};$.default=Q}),wi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=G5(),U=F1(),z=v1(),I=v1(),Q={keyword:"patternProperties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=J,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((P)=>(0,z.alwaysValidSchema)(X,G[P]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let w=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof U.Name))X.props=(0,I.evaluatedPropsToName)(K,X.props);let{props:F}=X;N();function N(){for(let P of q){if(w)O(P);if(X.allErrors)D(P);else K.var(M,!0),D(P),K.if(M)}}function O(P){for(let T in w)if(new RegExp(P).test(T))(0,z.checkStrictMode)(X,`property ${T} matches pattern ${P} (use allowMatchingProperties)`)}function D(P){K.forIn("key",H,(T)=>{K.if(U._`${(0,Y.usePattern)(J,P)}.test(${T})`,()=>{let A=V.includes(P);if(!A)J.subschema({keyword:"patternProperties",schemaProp:P,dataProp:T,dataPropType:I.Type.Str},M);if(X.opts.unevaluated&&F!==!0)K.assign(U._`${F}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,U.not)(M),()=>K.break())})})}}};$.default=Q}),Mi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(z){let{gen:I,schema:Q,it:J}=z;if((0,Y.alwaysValidSchema)(J,Q)){z.fail();return}let K=I.name("valid");z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),z.failResult(K,()=>z.reset(),()=>z.error())},error:{message:"must NOT be valid"}};$.default=U}),Oi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:G5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),Ni0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:I})=>Y._`{passingSchemas: ${I.passing}}`},code(I){let{gen:Q,schema:J,parentSchema:K,it:G}=I;if(!Array.isArray(J))throw Error("ajv implementation error");if(G.opts.discriminator&&K.discriminator)return;let H=J,W=Q.let("valid",!1),X=Q.let("passing",null),Z=Q.name("_valid");I.setParams({passing:X}),Q.block(q),I.result(W,()=>I.reset(),()=>I.error(!0));function q(){H.forEach((V,w)=>{let M;if((0,U.alwaysValidSchema)(G,V))Q.var(Z,!0);else M=I.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},Z);if(w>0)Q.if(Y._`${Z} && ${W}`).assign(W,!1).assign(X,Y._`[${X}, ${w}]`).else();Q.if(Z,()=>{if(Q.assign(W,!0),Q.assign(X,w),M)I.mergeEvaluated(M,Y.Name)})})}}};$.default=z}),Di0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"allOf",schemaType:"array",code(z){let{gen:I,schema:Q,it:J}=z;if(!Array.isArray(Q))throw Error("ajv implementation error");let K=I.name("valid");Q.forEach((G,H)=>{if((0,Y.alwaysValidSchema)(J,G))return;let W=z.subschema({keyword:"allOf",schemaProp:H},K);z.ok(K),z.mergeEvaluated(W)})}};$.default=U}),Ai0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:Q})=>Y.str`must match "${Q.ifClause}" schema`,params:({params:Q})=>Y._`{failingKeyword: ${Q.ifClause}}`},code(Q){let{gen:J,parentSchema:K,it:G}=Q;if(K.then===void 0&&K.else===void 0)(0,U.checkStrictMode)(G,'"if" without "then" and "else" is ignored');let H=I(G,"then"),W=I(G,"else");if(!H&&!W)return;let X=J.let("valid",!0),Z=J.name("_valid");if(q(),Q.reset(),H&&W){let w=J.let("ifClause");Q.setParams({ifClause:w}),J.if(Z,V("then",w),V("else",w))}else if(H)J.if(Z,V("then"));else J.if((0,Y.not)(Z),V("else"));Q.pass(X,()=>Q.error(!0));function q(){let w=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);Q.mergeEvaluated(w)}function V(w,M){return()=>{let F=Q.subschema({keyword:w},Z);if(J.assign(X,Z),Q.mergeValidEvaluated(F,X),M)J.assign(M,Y._`${w}`);else Q.setParams({ifClause:w})}}}};function I(Q,J){let K=Q.schema[J];return K!==void 0&&!(0,U.alwaysValidSchema)(Q,K)}$.default=z}),Bi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:z,parentSchema:I,it:Q}){if(I.if===void 0)(0,Y.checkStrictMode)(Q,`"${z}" without "if" is ignored`)}};$.default=U}),ge=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=ve(),U=Zi0(),z=he(),I=qi0(),Q=Vi0(),J=gS(),K=Li0(),G=Se(),H=Fi0(),W=wi0(),X=Mi0(),Z=Oi0(),q=Ni0(),V=Di0(),w=Ai0(),M=Bi0();function F(N=!1){let O=[X.default,Z.default,q.default,V.default,w.default,M.default,K.default,G.default,J.default,H.default,W.default];if(N)O.push(U.default,I.default);else O.push(Y.default,z.default);return O.push(Q.default),O}$.default=F}),Pi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:z})=>Y.str`must match format "${z}"`,params:({schemaCode:z})=>Y._`{format: ${z}}`},code(z,I){let{gen:Q,data:J,$data:K,schema:G,schemaCode:H,it:W}=z,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)w();else M();function w(){let F=Q.scopeValue("formats",{ref:V.formats,code:X.code.formats}),N=Q.const("fDef",Y._`${F}[${H}]`),O=Q.let("fType"),D=Q.let("format");Q.if(Y._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>Q.assign(O,Y._`${N}.type || "string"`).assign(D,Y._`${N}.validate`),()=>Q.assign(O,Y._`"string"`).assign(D,N)),z.fail$data((0,Y.or)(P(),T()));function P(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${D}`}function T(){let A=q.$async?Y._`(${N}.async ? await ${D}(${J}) : ${D}(${J}))`:Y._`${D}(${J})`,j=Y._`(typeof ${D} == "function" ? ${A} : ${D}.test(${J}))`;return Y._`${D} && ${D} !== true && ${O} === ${I} && !${j}`}}function M(){let F=V.formats[G];if(!F){P();return}if(F===!0)return;let[N,O,D]=T(F);if(N===I)z.pass(A());function P(){if(X.strictSchema===!1){V.logger.warn(j());return}throw Error(j());function j(){return`unknown format "${G}" ignored in schema at path "${Z}"`}}function T(j){let C=j instanceof RegExp?(0,Y.regexpCode)(j):X.code.formats?Y._`${X.code.formats}${(0,Y.getProperty)(G)}`:void 0,b=Q.scopeValue("formats",{key:G,ref:j,code:C});if(typeof j=="object"&&!(j instanceof RegExp))return[j.type||"string",j.validate,Y._`${b}.validate`];return["string",j,b]}function A(){if(typeof F=="object"&&!(F instanceof RegExp)&&F.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${D}(${J})`}return typeof O=="function"?Y._`${D}(${J})`:Y._`${D}.test(${J})`}}}};$.default=U}),ye=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[Pi0().default];$.default=Y}),ke=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),xe=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Re(),U=_e(),z=ge(),I=ye(),Q=ke(),J=[Y.default,U.default,(0,z.default)(),I.default,Q.metadataVocabulary,Q.contentVocabulary];$.default=J}),Ti0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(U){U.Tag="tag",U.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),yS=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=Ti0(),z=ow(),I=iI(),Q=v1(),J={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===U.DiscrError.Tag?`tag "${G}" must be string`:`value of tag "${G}" must be in oneOf`,params:({params:{discrError:K,tag:G,tagName:H}})=>Y._`{error: ${K}, tag: ${H}, tagValue: ${G}}`},code(K){let{gen:G,data:H,schema:W,parentSchema:X,it:Z}=K,{oneOf:q}=X;if(!Z.opts.discriminator)throw Error("discriminator: requires discriminator option");let V=W.propertyName;if(typeof V!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!q)throw Error("discriminator: requires oneOf keyword");let w=G.let("valid",!1),M=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${M} == "string"`,()=>F(),()=>K.error(!1,{discrError:U.DiscrError.Tag,tag:M,tagName:V})),K.ok(w);function F(){let D=O();G.if(!1);for(let P in D)G.elseIf(Y._`${M} === ${P}`),G.assign(w,N(D[P]));G.else(),K.error(!1,{discrError:U.DiscrError.Mapping,tag:M,tagName:V}),G.endIf()}function N(D){let P=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:D},P);return K.mergeEvaluated(T,Y.Name),P}function O(){var D;let P={},T=j(X),A=!0;for(let x=0;x{Y.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),fe=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let U=vS(),z=xe(),I=yS(),Q=ji0(),J=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends U.default{_addVocabularies(){if(super._addVocabularies(),z.default.forEach((q)=>this.addVocabulary(q)),this.opts.discriminator)this.addKeyword(I.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let q=this.opts.$data?this.$dataMetaSchema(Q,J):Q;this.addMetaSchema(q,K,!1),this.refs["http://json-schema.org/schema"]=K}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(K)?K:void 0)}};$.Ajv=G,Y.exports=$=G,Y.exports.Ajv=G,Object.defineProperty($,"__esModule",{value:!0}),$.default=G;var H=bI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=F1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return W._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return W.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return W.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return W.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return W.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return W.CodeGen}});var X=MH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=iI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),ue=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=F1(),U=K5(),z=ow(),I=hS(),Q={keyword:"$dynamicAnchor",schemaType:"string",code:(G)=>J(G,G.schema)};function J(G,H){let{gen:W,it:X}=G;X.schemaEnv.root.dynamicAnchors[H]=!0;let Z=Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(H)}`,q=X.errSchemaPath==="#"?X.validateName:K(G);W.if(Y._`!${Z}`,()=>W.assign(Z,q))}$.dynamicAnchor=J;function K(G){let{schemaEnv:H,schema:W,self:X}=G.it,{root:Z,baseId:q,localRefs:V,meta:w}=H.root,{schemaId:M}=X.opts,F=new z.SchemaEnv({schema:W,schemaId:M,root:Z,baseId:q,localRefs:V,meta:w});return z.compileSchema.call(X,F),(0,I.getValidate)(G,F)}$.default=Q}),be=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=F1(),U=K5(),z=hS(),I={keyword:"$dynamicRef",schemaType:"string",code:(J)=>Q(J,J.schema)};function Q(J,K){let{gen:G,keyword:H,it:W}=J;if(K[0]!=="#")throw Error(`"${H}" only supports hash fragment reference`);let X=K.slice(1);if(W.allErrors)Z();else{let V=G.let("valid",!1);Z(V),J.ok(V)}function Z(V){if(W.schemaEnv.root.dynamicAnchors[X]){let w=G.let("_v",Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(X)}`);G.if(w,q(w,V),q(W.validateName,V))}else q(W.validateName,V)()}function q(V,w){return w?()=>G.block(()=>{(0,z.callRef)(J,V),G.let(w,!0)}):()=>(0,z.callRef)(J,V)}}$.dynamicRef=Q,$.default=I}),Ei0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=ue(),U=v1(),z={keyword:"$recursiveAnchor",schemaType:"boolean",code(I){if(I.schema)(0,Y.dynamicAnchor)(I,"");else(0,U.checkStrictMode)(I.it,"$recursiveAnchor: false is ignored")}};$.default=z}),Ci0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=be(),U={keyword:"$recursiveRef",schemaType:"string",code:(z)=>(0,Y.dynamicRef)(z,z.schema)};$.default=U}),ie=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=ue(),U=be(),z=Ei0(),I=Ci0(),Q=[Y.default,U.default,z.default,I.default];$.default=Q}),Ri0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gS(),U={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(z)=>(0,Y.validatePropertyDeps)(z)};$.default=U}),_i0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gS(),U={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(z)=>(0,Y.validateSchemaDeps)(z)};$.default=U}),vi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:z,parentSchema:I,it:Q}){if(I.contains===void 0)(0,Y.checkStrictMode)(Q,`"${z}" without "contains" is ignored`)}};$.default=U}),ce=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ri0(),U=_i0(),z=vi0(),I=[Y.default,U.default,z.default];$.default=I}),hi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z=K5(),I={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:Q})=>Y._`{unevaluatedProperty: ${Q.unevaluatedProperty}}`},code(Q){let{gen:J,schema:K,data:G,errsCount:H,it:W}=Q;if(!H)throw Error("ajv implementation error");let{allErrors:X,props:Z}=W;if(Z instanceof Y.Name)J.if(Y._`${Z} !== true`,()=>J.forIn("key",G,(M)=>J.if(V(Z,M),()=>q(M))));else if(Z!==!0)J.forIn("key",G,(M)=>Z===void 0?q(M):J.if(w(Z,M),()=>q(M)));W.props=!0,Q.ok(Y._`${H} === ${z.default.errors}`);function q(M){if(K===!1){if(Q.setParams({unevaluatedProperty:M}),Q.error(),!X)J.break();return}if(!(0,U.alwaysValidSchema)(W,K)){let F=J.name("valid");if(Q.subschema({keyword:"unevaluatedProperties",dataProp:M,dataPropType:U.Type.Str},F),!X)J.if((0,Y.not)(F),()=>J.break())}}function V(M,F){return Y._`!${M} || !${M}[${F}]`}function w(M,F){let N=[];for(let O in M)if(M[O]===!0)N.push(Y._`${F} !== ${O}`);return(0,Y.and)(...N)}}};$.default=I}),Si0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:I}})=>Y.str`must NOT have more than ${I} items`,params:({params:{len:I}})=>Y._`{limit: ${I}}`},code(I){let{gen:Q,schema:J,data:K,it:G}=I,H=G.items||0;if(H===!0)return;let W=Q.const("len",Y._`${K}.length`);if(J===!1)I.setParams({len:H}),I.fail(Y._`${W} > ${H}`);else if(typeof J=="object"&&!(0,U.alwaysValidSchema)(G,J)){let Z=Q.var("valid",Y._`${W} <= ${H}`);Q.if((0,Y.not)(Z),()=>X(Z,H)),I.ok(Z)}G.items=!0;function X(Z,q){Q.forRange("i",q,W,(V)=>{if(I.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:U.Type.Num},Z),!G.allErrors)Q.if((0,Y.not)(Z),()=>Q.break())})}}};$.default=z}),ne=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hi0(),U=Si0(),z=[Y.default,U.default];$.default=z}),gi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),yi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),ki0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),xi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),fi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),ui0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),bi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),ii0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gi0(),U=yi0(),z=ki0(),I=xi0(),Q=fi0(),J=ui0(),K=bi0(),G=["/properties"];function H(W){return[Y,U,z,I,X(this,Q),J,X(this,K)].forEach((Z)=>this.addMetaSchema(Z,void 0,!1)),this;function X(Z,q){return W?Z.$dataMetaSchema(q,G):q}}$.default=H}),ci0=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let U=vS(),z=xe(),I=ie(),Q=ce(),J=ne(),K=yS(),G=ii0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends U.default{constructor(w={}){super({...w,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(I.default),z.default.forEach((w)=>this.addVocabulary(w)),this.addVocabulary(Q.default),this.addVocabulary(J.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:w,meta:M}=this.opts;if(!M)return;G.default.call(this,w),this.refs["http://json-schema.org/schema"]=H}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(H)?H:void 0)}};$.Ajv2019=W,Y.exports=$=W,Y.exports.Ajv2019=W,Object.defineProperty($,"__esModule",{value:!0}),$.default=W;var X=bI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=F1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return Z._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return Z.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return Z.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return Z.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return Z.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return Z.CodeGen}});var q=MH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=iI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),ni0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Re(),U=_e(),z=ge(),I=ie(),Q=ce(),J=ne(),K=ye(),G=ke(),H=[I.default,Y.default,U.default,(0,z.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,Q.default,J.default];$.default=H}),pi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),di0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),mi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),li0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),oi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),ri0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),si0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),ai0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),ti0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=pi0(),U=di0(),z=mi0(),I=li0(),Q=oi0(),J=ri0(),K=si0(),G=ai0(),H=["/properties"];function W(X){return[Y,U,z,I,Q,Z(this,J),K,Z(this,G)].forEach((q)=>this.addMetaSchema(q,void 0,!1)),this;function Z(q,V){return X?q.$dataMetaSchema(V,H):V}}$.default=W}),ei0=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let U=vS(),z=ni0(),I=yS(),Q=ti0(),J="https://json-schema.org/draft/2020-12/schema";var K=class extends U.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),z.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(I.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:q}=this.opts;if(!q)return;Q.default.call(this,Z),this.refs["http://json-schema.org/schema"]=J}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(J)?J:void 0)}};$.Ajv2020=K,Y.exports=$=K,Y.exports.Ajv2020=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K;var G=bI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=F1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return H._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return H.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return H.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return H.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return H.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return H.CodeGen}});var W=MH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=iI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),$c0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(x,g){return{validate:x,compare:g}}$.fullFormats={date:Y(Q,J),time:Y(G(!0),H),"date-time":Y(Z(!0),q),"iso-time":Y(G(),W),"iso-date-time":Y(Z(),V),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:F,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:b,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:O,int32:{type:"number",validate:T},int64:{type:"number",validate:A},float:{type:"number",validate:j},double:{type:"number",validate:j},password:!0,binary:!0},$.fastFormats={...$.fullFormats,date:Y(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,J),time:Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H),"date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,q),"iso-time":Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,W),"iso-date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,V),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},$.formatNames=Object.keys($.fullFormats);function U(x){return x%4===0&&(x%100!==0||x%400===0)}let z=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,I=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Q(x){let g=z.exec(x);if(!g)return!1;let i=+g[1],c=+g[2],z0=+g[3];return c>=1&&c<=12&&z0>=1&&z0<=(c===2&&U(i)?29:I[c])}function J(x,g){if(!(x&&g))return;if(x>g)return 1;if(x23||p>59||x&&!a)return!1;if(z0<=23&&k<=59&&d<60)return!0;let Y0=k-p*$0,R=z0-y*$0-(Y0<0?1:0);return(R===23||R===-1)&&(Y0===59||Y0===-1)&&d<61}}function H(x,g){if(!(x&&g))return;let i=new Date("2020-01-01T"+x).valueOf(),c=new Date("2020-01-01T"+g).valueOf();if(!(i&&c))return;return i-c}function W(x,g){if(!(x&&g))return;let i=K.exec(x),c=K.exec(g);if(!(i&&c))return;if(x=i[1]+i[2]+i[3],g=c[1]+c[2]+c[3],x>g)return 1;if(x=D}function A(x){return Number.isInteger(x)}function j(){return!0}let C=/[^\\]\\Z/;function b(x){if(C.test(x))return!1;try{return new RegExp(x),!0}catch(g){return!1}}}),Yc0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=fe(),U=F1(),z=U.operators,I={formatMaximum:{okStr:"<=",ok:z.LTE,fail:z.GT},formatMinimum:{okStr:">=",ok:z.GTE,fail:z.LT},formatExclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},formatExclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},Q={message:({keyword:K,schemaCode:G})=>U.str`should be ${I[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>U._`{comparison: ${I[K].okStr}, limit: ${G}}`};$.formatLimitDefinition={keyword:Object.keys(I),type:"string",schemaType:"string",$data:!0,error:Q,code(K){let{gen:G,data:H,schemaCode:W,keyword:X,it:Z}=K,{opts:q,self:V}=Z;if(!q.validateFormats)return;let w=new Y.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(w.$data)M();else F();function M(){let O=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",U._`${O}[${w.schemaCode}]`);K.fail$data((0,U.or)(U._`typeof ${D} != "object"`,U._`${D} instanceof RegExp`,U._`typeof ${D}.compare != "function"`,N(D)))}function F(){let O=w.schema,D=V.formats[O];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${O}" does not define "compare" function`);let P=G.scopeValue("formats",{key:O,ref:D,code:q.code.formats?U._`${q.code.formats}${(0,U.getProperty)(O)}`:void 0});K.fail$data(N(P))}function N(O){return U._`${O}.compare(${H}, ${W}) ${I[X].fail} 0`}},dependencies:["format"]};let J=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=J}),Uc0=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let U=$c0(),z=Yc0(),I=F1(),Q=new I.Name("fullFormats"),J=new I.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,U.fullFormats,Q),H;let[X,Z]=W.mode==="fast"?[U.fastFormats,J]:[U.fullFormats,Q];if(G(H,W.formats||U.formatNames,X,Z),W.keywords)(0,z.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?U.fastFormats:U.fullFormats)[H];if(!X)throw Error(`Unknown format "${H}"`);return X};function G(H,W,X,Z){var q,V;(q=(V=H.opts.code).formats)!==null&&q!==void 0||(V.formats=I._`require("ajv-formats/dist/formats").${Z}`);for(let w of W)H.addFormat(w,X[w])}Y.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),pe=fe(),zc0=ci0(),Ic0=ei0(),Qc0=UV(Uc0(),1),Jc0=Qc0.default;db1=pe.Ajv});import kS from"node:process";var sw=m(()=>{de()});function fS($){return!!$&&typeof $==="object"&&$00 in $}function Gc0($){return $[$00]?.complete}function Hc0($,Y){switch(Y.kind){case"tools_list_changed":return $.toolsListChanged===!0;case"prompts_list_changed":return $.promptsListChanged===!0;case"resources_list_changed":return $.resourcesListChanged===!0;case"resource_updated":return $.resourceSubscriptions!==void 0&&$.resourceSubscriptions.includes(Y.uri)}}function Wc0($,Y){let U={},z=(I)=>Y===void 0||I===!0;if($.toolsListChanged===!0&&z(Y?.tools?.listChanged))U.toolsListChanged=!0;if($.promptsListChanged===!0&&z(Y?.prompts?.listChanged))U.promptsListChanged=!0;if($.resourcesListChanged===!0&&z(Y?.resources?.listChanged))U.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&z(Y?.resources?.subscribe))U.resourceSubscriptions=[...$.resourceSubscriptions];return U}function me($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[fY]:Y}}}}function Xc0($){let Y=_7(FH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function qc0($,Y){switch($){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:Y??""}}}function Fc0($){if($?.maxRounds!==void 0&&(!Number.isInteger($.maxRounds)||$.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${$.maxRounds})`);if($?.roundTimeoutMs!==void 0&&(!Number.isFinite($.roundTimeoutMs)||$.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${$.roundTimeoutMs})`);return{maxRounds:$?.maxRounds??Vc0,roundTimeoutMs:$?.roundTimeoutMs??Lc0,legacyShim:$?.legacyShim??!0}}function U00($,Y,U){if(U===null||typeof U!=="object"||typeof U.method!=="string")throw new I1(i0.InternalError,`Handler for ${$} returned an invalid input request '${Y}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let z=U,I=lt(z);if(I===void 0)throw new I1(i0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${z.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:z,required:I}}function wc0(){let $=globalThis.crypto;if($?.randomUUID!==void 0)return $.randomUUID();let Y=new Uint8Array(16);$.getRandomValues(Y),Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128;let U=[...Y].map((z)=>z.toString(16).padStart(2,"0")).join("");return`${U.slice(0,8)}-${U.slice(8,12)}-${U.slice(12,16)}-${U.slice(16,20)}-${U.slice(20)}`}function xS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new I1(i0.InternalError,Y)}function uS($,Y){z00($,Y)}function bS($){return I00($)}function Dc0($){return{...$}}function le($,Y){if($){let z=Y;return async(I,Q)=>z(I,Q)}let U=Y;return async(z,I)=>U(I)}function re($){if($===void 0)return;try{return S7($,"output")}catch{return}}function se($,Y,U){if(Y){let z=U;return async(I,Q)=>{let J=await iY(Y,I);if(!J.success)throw new I1(i0.InvalidParams,`Invalid arguments for prompt ${$}: ${J.error}`);return z(J.data,Q)}}else{let z=U;return async(I,Q)=>{return z(Q)}}}function ae($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function te($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function Ac0($){return $?.type==="optional"}function ee($){if(!Ac0($))return $;return $.def?.innerType??$}var $00,aw=1024,Zc0,Y00=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=aw,Y,U){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=U}setServerCapabilities($,Y){if(this._serverCapabilities=$,Y!==void 0)this._serverInfo=Y}has($){return this._subs.has($)}serve($){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:"Subscription limit reached"}};let Y=Xc0($);if(Y===void 0)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let U=Wc0(Y,this._serverCapabilities);return this._subs.set($.id,U),me({method:"notifications/subscriptions/acknowledged",params:{notifications:U}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!Zc0.has($.method))return"passthrough";let Y=$.params?.uri,U=typeof Y==="string"?Y:void 0,z=qc0($.method,U),I=[];for(let[Q,J]of this._subs)if(Hc0(J,z))I.push(me({method:$.method,params:$.params??{}},Q));return I}teardownAll(){let $=[];for(let Y of this._subs.keys())$.push({jsonrpc:"2.0",id:Y,result:{resultType:"complete",_meta:{[fY]:Y,...this._serverInfo!==void 0&&{[s5]:this._serverInfo}}}});return this._subs.clear(),$}},Vc0=8,Lc0=600000,Mc0=class{constructor($){this._host=$}async fulfill($,Y,U,z,I){let{maxRounds:Q,roundTimeoutMs:J}=this._host,K=z.mcpReq.signal,G=I,H=0;while(!0){if(H+=1,H>Q)return xS($,Ve($,Q));let W=G.inputRequests,X=W!=null&&Object.keys(W).length>0,Z=typeof G.requestState==="string"?G.requestState:void 0;if(!X&&Z===void 0)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let q;if(X){let M=this._host.resolvedClientCapabilities(z),F=[];for(let[O,D]of Object.entries(W)){let{embedded:P,required:T}=U00($,O,D);if(P.method!=="roots/list"&&P.params===void 0)throw new I1(i0.InternalError,`Handler for ${$} returned an input request '${O}' of kind '${P.method}' without params`);if(Sw(T,M)!==void 0)return xS($,`Cannot request input '${O}' (${P.method}): the client on this 2025-era connection did not declare the required capability${M===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);F.push([O,P])}let N=Fe(K);try{let O={relatedRequestId:z.mcpReq.id,timeout:J,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:N.signal},D=await Promise.all(F.map(async([P,T])=>{try{return[P,await this._dispatchLeg(T,O)]}catch(A){throw N.abort(A),A}}));q=Object.fromEntries(D)}catch(O){if(K.aborted)throw O;return xS($,`Fulfilling input required by '${$}' failed: ${O instanceof Error?O.message:String(O)}`)}finally{N.dispose()}}else await Le(qe,K);let V={...z,mcpReq:{...z.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:wH(Z)}};if(Z!==void 0){let M=await this._host.verifyRequestState(Z,V,$);if(M!==void 0)V=BS(V,M)}let w=await Y(U,V);if(!Y3(w))return w;G=w}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let U=$.params;if(U.mode==="url"&&U.elicitationId===void 0)U={...U,elicitationId:wc0()};return await this._host.sendElicitation(U,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},Oc0,Nc0,z00,I00,Q00,NH=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson($){let Y=this._registeredTools[$];if(Y===void 0||!Y.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,$))return this._toolInputSchemaJson[$];if(Y.inputSchema===void 0)return oe;try{let U=S7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=U,U}catch{return}}constructor($,Y){if(this.server=new Q00($,Y),Y?.capabilities?.tools)this.setToolRequestHandlers();if(Y?.capabilities?.resources)this.setResourceRequestHandlers();if(Y?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect($){return await this.server.connect($)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,Y])=>{let U={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?S7(Y.inputSchema,"input"):oe,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)U.outputSchema=S7(Y.outputSchema,"output");return U})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let U=this._registeredTools[$.params.name];if(!U)throw new I1(i0.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new I1(i0.InvalidParams,`Tool ${$.params.name} disabled`);try{let z=await this.validateToolInput(U,$.params.arguments,$.params.name),I=await this.executeToolHandler(U,z,Y);if(await this.validateToolOutput(U,I,$.params.name),Y3(I))return I;return this.server.projectCallToolResult(I,U.outputSchemaJson)}catch(z){if(z instanceof I1&&z.code===i0.UrlElicitationRequired)throw z;return this.createToolError(z instanceof Error?z.message:String(z))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,U){if(!$.inputSchema)return;let z=await iY($.inputSchema,Y??{});if(!z.success)throw new I1(i0.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${z.error}`);return z.data}async validateToolOutput($,Y,U){if(!$.outputSchema)return;if(Y3(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new I1(i0.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let z=await iY($.outputSchema,Y.structuredContent);if(!z.success)throw new I1(i0.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${z.error}`)}async executeToolHandler($,Y,U){return $.executor(Y,U)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async($)=>{switch($.params.ref.type){case"ref/prompt":return wS($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return MS($),this.handleResourceCompletion($,$.params.ref);default:throw new I1(i0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let U=this._registeredPrompts[Y.name];if(!U)throw new I1(i0.InvalidParams,`Prompt ${Y.name} not found`);if(!U.enabled)throw new I1(i0.InvalidParams,`Prompt ${Y.name} disabled`);if(!U.argsSchema)return OH;let z=ee(te(U.argsSchema)?.[$.params.argument.name]);if(!fS(z))return OH;let I=Gc0(z);if(!I)return OH;return ae(await I($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let U=Object.values(this._registeredResourceTemplates).find((I)=>I.resourceTemplate.uriTemplate.toString()===Y.uri);if(!U){if(this._registeredResources[Y.uri])return OH;throw new I1(i0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let z=U.resourceTemplate.completeCallback($.params.argument.name);if(!z)return OH;return ae(await z($.params.argument.value,$.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async($,Y)=>{let U=Object.entries(this._registeredResources).filter(([I,Q])=>Q.enabled).map(([I,Q])=>({uri:I,name:Q.name,...Q.metadata})),z=[];for(let I of Object.values(this._registeredResourceTemplates)){if(!I.resourceTemplate.listCallback)continue;let Q=await I.resourceTemplate.listCallback(Y);for(let J of Q.resources)z.push({...I.metadata,...J})}return{resources:[...U,...z]}}),this.server.setRequestHandler("resources/templates/list",async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([$,Y])=>({name:$,uriTemplate:Y.resourceTemplate.uriTemplate.toString(),...Y.metadata}))}}),this.server.setRequestHandler("resources/read",async($,Y)=>{let U;try{U=new URL($.params.uri)}catch{throw new I1(i0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let z=this._registeredResources[U.toString()];if(z){if(!z.enabled)throw new I1(i0.InvalidParams,`Resource ${U} disabled`);return gw(await z.readCallback(U,Y),z.cacheHint)}for(let I of Object.values(this._registeredResourceTemplates)){let Q=I.resourceTemplate.uriTemplate.match(U.toString());if(Q)return gw(await I.readCallback(U,Q,Y),I.cacheHint)}throw new yw($.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,Y])=>{return{name:$,title:Y.title,description:Y.description,arguments:Y.argsSchema?Ze(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new I1(i0.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new I1(i0.InvalidParams,`Prompt ${$.params.name} disabled`);return U.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,U,z){let I=U.cacheHint,Q=U;if(I!==void 0){VS(I,`resource ${$}`);let J={...U};delete J.cacheHint,Q=J}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let J=this._createRegisteredResource($,U.title,Y,Q,z);if(I!==void 0)J.cacheHint=I;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let J=this._createRegisteredResourceTemplate($,U.title,Y,Q,z);if(I!==void 0)J.cacheHint=I;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}}_createRegisteredResource($,Y,U,z,I){let Q={name:$,title:Y,metadata:z,readCallback:I,enabled:!0,disable:()=>Q.update({enabled:!1}),enable:()=>Q.update({enabled:!0}),remove:()=>Q.update({uri:null}),update:(J)=>{if(J.uri!==void 0&&J.uri!==U){if(delete this._registeredResources[U],J.uri)this._registeredResources[J.uri]=Q}if(J.name!==void 0)Q.name=J.name;if(J.title!==void 0)Q.title=J.title;if(J.metadata!==void 0)Q.metadata=J.metadata;if(J.callback!==void 0)Q.readCallback=J.callback;if(J.enabled!==void 0)Q.enabled=J.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=Q,Q}_createRegisteredResourceTemplate($,Y,U,z,I){let Q={resourceTemplate:U,title:Y,metadata:z,readCallback:I,enabled:!0,disable:()=>Q.update({enabled:!1}),enable:()=>Q.update({enabled:!0}),remove:()=>Q.update({name:null}),update:(K)=>{if(K.name!==void 0&&K.name!==$){if(delete this._registeredResourceTemplates[$],K.name)this._registeredResourceTemplates[K.name]=Q}if(K.title!==void 0)Q.title=K.title;if(K.template!==void 0)Q.resourceTemplate=K.template;if(K.metadata!==void 0)Q.metadata=K.metadata;if(K.callback!==void 0)Q.readCallback=K.callback;if(K.enabled!==void 0)Q.enabled=K.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=Q;let J=U.uriTemplate.variableNames;if(Array.isArray(J)&&J.some((K)=>!!U.completeCallback(K)))this.setCompletionRequestHandler();return Q}_createRegisteredPrompt($,Y,U,z,I,Q,J){let K=z,G=I,H={title:Y,description:U,argsSchema:z,icons:Q,_meta:J,handler:se($,z,I),enabled:!0,disable:()=>H.update({enabled:!1}),enable:()=>H.update({enabled:!0}),remove:()=>H.update({name:null}),update:(W)=>{if(W.name!==void 0&&W.name!==$){if(delete this._registeredPrompts[$],W.name)this._registeredPrompts[W.name]=H}if(W.title!==void 0)H.title=W.title;if(W.description!==void 0)H.description=W.description;if(W.icons!==void 0)H.icons=W.icons;if(W._meta!==void 0)H._meta=W._meta;let X=!1;if(W.argsSchema!==void 0)H.argsSchema=W.argsSchema,K=W.argsSchema,X=!0;if(W.callback!==void 0)G=W.callback,X=!0;if(X)H.handler=se($,K,G);if(W.enabled!==void 0)H.enabled=W.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=H,z){let W=te(z);if(W){if(Object.values(W).some((X)=>{return fS(ee(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,U,z,I,Q,J,K,G,H){if(RS($),z!==void 0)try{let Z=S7(z,"input");this._toolInputSchemaJson[$]=Z;let q=OS(Z);if(!q.valid)console.warn(`[mcp-sdk] tool '${$}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${q.reason}`)}catch{}let W=H,X={title:Y,description:U,inputSchema:z,outputSchema:I,outputSchemaJson:re(I),annotations:Q,icons:J,execution:K,_meta:G,handler:H,executor:le(z,H),enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Z)=>{if(Z.name!==void 0&&Z.name!==$){if(typeof Z.name==="string")RS(Z.name);if(delete this._registeredTools[$],delete this._toolInputSchemaJson[$],Z.name)delete this._toolInputSchemaJson[Z.name],this._registeredTools[Z.name]=X,$=Z.name}if(Z.title!==void 0)X.title=Z.title;if(Z.description!==void 0)X.description=Z.description;let q=!1;if(Z.paramsSchema!==void 0)X.inputSchema=Z.paramsSchema,delete this._toolInputSchemaJson[$],q=!0;if(Z.callback!==void 0)X.handler=Z.callback,W=Z.callback,q=!0;if(q)X.executor=le(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=re(Z.outputSchema);if(Z.annotations!==void 0)X.annotations=Z.annotations;if(Z.icons!==void 0)X.icons=Z.icons;if(Z._meta!==void 0)X._meta=Z._meta;if(Z.enabled!==void 0)X.enabled=Z.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=X,this.setToolRequestHandlers(),this.sendToolListChanged(),X}registerTool($,Y,U){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:z,description:I,inputSchema:Q,outputSchema:J,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,z,I,cw(Q),cw(J),K,G,void 0,H,U)}registerPrompt($,Y,U){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:z,description:I,argsSchema:Q,icons:J,_meta:K}=Y,G=this._createRegisteredPrompt($,z,I,cw(Q),U,J,K);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),G}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,Y){return this.server.sendLoggingMessage($,Y)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}},oe,OH;var iS=m(()=>{nw();sw();$00=Symbol.for("mcp.completable");Zc0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);Oc0=new Set(["tools/call","prompts/get","resources/read"]);Q00=class extends TS{_clientCapabilities;_clientVersion;static{Nc0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},z00=($,Y)=>{let U=Y.filter((z)=>!$._supportedProtocolVersions.includes(z));if(U.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...U];$.setRequestHandler("server/discover",()=>$._ondiscover())},I00=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Mc0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,U)=>this._verifyRequestState($,Y,U),sendElicitation:($,Y)=>this._sendElicitationLeg($,Y,{validateAcceptedContent:!1}),sendSampling:($,Y)=>this.createMessage($,Y),listRoots:($,Y)=>this.listRoots($,Y)})}oninitialized;constructor($,Y){super(Y);if(this._serverInfo=$,this._capabilities=Y?.capabilities?{...Y.capabilities}:{},this._instructions=Y?.instructions,this._jsonSchemaValidator=Y?.jsonSchemaValidator??new rw,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=Fc0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[U,z]of Object.entries(Y.cacheHints))if(z!==void 0)VS(z,`cacheHints['${U}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(U)=>this._oninitialize(U)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),GS(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let U=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:z}=$.params,I=iw(C7,z);if(I.success)this._loggingLevels.set(U,I.data);return{}})}buildContext($,Y){let U=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(z,I,Q)=>{if(!this._capabilities.logging)return Promise.resolve();let J;if(this._servedModernEra()){if(J=$.mcpReq.envelope?.[A7],J===void 0)return Promise.resolve()}else J=this._loggingLevels.get($.sessionId)??this._loggingLevels.get(void 0);if(J!==void 0&&this.LOG_LEVEL_SEVERITY.get(z)this.elicitInput(z,I),requestSampling:(z,I)=>this.createMessage(z,I)},http:U?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(C7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let U=this._loggingLevels.get(Y);return U?this.LOG_LEVEL_SEVERITY.get($){let J=await Y(I,Q);if(Y3(J))throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return J};return async(I,Q)=>{let J=z?await this._invokeInputRequiredCapableHandler($,Y,I,Q):await Y(I,Q);if(Y3(J)){if(!z)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return J}return U===void 0?J:gw(J,U)}}return async(U,z)=>{let I=_7(this._negotiatedProtocolVersion),Q=I.validateRequest("tools/call",U);if(!Q.ok)throw new I1(Q.reason==="not-in-era"?i0.InternalError:i0.InvalidParams,Q.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${Q.message}`);let J=await this._invokeInputRequiredCapableHandler("tools/call",Y,U,z);if(Y3(J))return J;let K=HS(J),G=I.validateResult("tools/call",K);if(!G.ok)throw new I1(G.reason==="not-in-era"?i0.InternalError:i0.InvalidParams,G.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${G.message}`);return G.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&fI(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,U,z){let I=this._servedModernEra(),Q=z.mcpReq.requestState();if(Q!==void 0&&typeof Q!=="string")throw new I1(i0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let J=z;if(typeof Q==="string"){let X=await this._verifyRequestState(Q,z,$);if(X!==void 0)J=BS(z,X)}let K;try{K=await Y(U,J)}catch(X){if(X instanceof I1&&X.code===i0.UrlElicitationRequired){if(!I)throw X;throw new I1(i0.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw X}if(!Y3(K))return K;if(!I){if(!this._inputRequiredServing.legacyShim)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??xY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,U,J,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(H){let X=this._inputRequestCapabilityView(z);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:w}=U00($,Z,q),M=Sw(w,X);if(M!==void 0)throw new kw({requiredCapabilities:M},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,U){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(z){throw this.onerror?.(Error(`requestState verification rejected ${U}: ${z instanceof Error?z.message:String(z)}`)),new I1(i0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[e9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new L1(T1.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${$}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:$,era:"2026-07-28"})}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new L1(T1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new L1(T1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new L1(T1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new L1(T1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new L1(T1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new L1(T1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new L1(T1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new L1(T1.CapabilityNotSupported,`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"completion/complete":if(!this._capabilities.completions)throw new L1(T1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new L1(T1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new L1(T1.CapabilityNotSupported,`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new L1(T1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new L1(T1.CapabilityNotSupported,`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let Y=$.params.protocolVersion;this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo;let U=rt(this._supportedProtocolVersions),z=U.includes(Y)?Y:U[0]??xY;return this._negotiatedProtocolVersion=z,this.transport?.setProtocolVersion?.(z),{protocolVersion:z,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:GS(this._supportedProtocolVersions),capabilities:Dc0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult($,Y){return this._wireCodec().projectCallToolResult($,Y)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage($,Y){if(this._assertPushApiInServedEra("sampling/createMessage"),($.tools||$.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new L1(T1.CapabilityNotSupported,"Client does not support sampling tools capability.");if($.messages.length>0){let Q=$.messages.at(-1),J=Array.isArray(Q.content)?Q.content:[Q.content],K=J.some((X)=>X.type==="tool_result"),G=$.messages.length>1?$.messages.at(-2):void 0,H=G?Array.isArray(G.content)?G.content:[G.content]:[],W=H.some((X)=>X.type==="tool_use");if(K){if(J.some((X)=>X.type!=="tool_result"))throw new I1(i0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new I1(i0.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(W){let X=new Set(H.filter((q)=>q.type==="tool_use").map((q)=>q.id)),Z=new Set(J.filter((q)=>q.type==="tool_result").map((q)=>q.toolUseId));if(X.size!==Z.size||![...X].every((q)=>Z.has(q)))throw new I1(i0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let U=Boolean($.tools||$.toolChoice),z=await this.request({method:"sampling/createMessage",params:$},Y),I=this._wireCodec().samplingResultVariant(U,z);if(!I.ok)throw new L1(T1.InvalidResult,`Invalid sampling/createMessage result: ${I.reason==="invalid"?I.message:I.reason}`);return I.value}async elicitInput($,Y){switch(this._assertPushApiInServedEra("elicitation/create"),$.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new L1(T1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new L1(T1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,U){let z=$.mode??"form",I=U?.validateAcceptedContent??!0;switch(z){case"url":{let Q=$;return this.request({method:"elicitation/create",params:Q},Y)}case"form":{let Q=$.mode==="form"?$:{...$,mode:"form"},J=await this.request({method:"elicitation/create",params:Q},Y);if(I&&J.action==="accept"&&J.content&&Q.requestedSchema)try{let K=this._jsonSchemaValidator.getValidator(Q.requestedSchema)(J.content);if(!K.valid)throw new I1(i0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof I1)throw K;throw new I1(i0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return J}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new L1(T1.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},Y)}async listRoots($,Y){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:$},Y)}async sendLoggingMessage($,Y){if(this._capabilities.logging&&!this.isMessageIgnored($.level,Y))return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};oe={type:"object",properties:{}};OH={completion:{values:[],hasMore:!1}}});var J00=m(()=>{iS();nw();sw()});function Tc0($){let Y=$.params;if($.method==="initialize"&&!NS(Y)){let Q=Y!==null&&typeof Y==="object"&&typeof Y.protocolVersion==="string"?Y.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...Q!==void 0&&{requestedVersion:Q}}}if(!xw(Y))return{kind:"legacy",reason:"no-claim"};let U=nY(Y),z=(U===void 0?[]:uw(U))[0];if(z!==void 0)return{kind:"invalid-envelope",issue:z};let I=fw(Y);if(I===void 0||!v7.includes(I))return{kind:"unsupported-revision",requested:I??"unknown"};return{kind:"modern",revision:I,classification:{era:"modern",revision:I}}}function G00($,Y={}){let U=Y.legacy??"serve",z=Y.transport??new Bc0,I={phase:"opening"},Q,J=!1,K=()=>J||I.phase==="closed",G=(j)=>{try{Y.onerror?.(j)}catch{}},H=(j,C,b,x)=>z.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...x!==void 0&&{data:x}}}).catch((g)=>G(H5(g))),W=new Y00(Y.maxSubscriptions??aw),X=(j)=>{if(!h7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)z.send({jsonrpc:"2.0",...b}).catch((x)=>G(H5(x)));return"handled"},Z=async(j)=>{if(P$(j)&&j.method==="subscriptions/listen"){let C=nY(j.params),b=xw(j.params)?(C===void 0?[]:uw(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},x=fw(j.params),g;if(b!==void 0)g={jsonrpc:"2.0",id:j.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(x===void 0||!v7.includes(x)){let i=new uI({supported:[...v7],requested:x??"unknown"});g={jsonrpc:"2.0",id:j.id,error:{code:i.code,message:i.message,data:i.data}}}else g=W.serve(j);return await z.send("error"in g?g:{jsonrpc:"2.0",method:g.method,params:g.params}).catch((i)=>G(H5(i))),!0}if(h7(j)&&j.method==="notifications/cancelled"){let C=j.params?.requestId;if(C!==void 0&&W.cancel(C))return!0}return!1},q=(j,C,b)=>{let x=DS({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},v7);if(x===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${x.cell}): ${x.message}`)),H(j.id,x.code,x.message,x.data)},V=(j)=>{if(J||j===Q)return;T()},w=async(j,C)=>{let b=await $({era:j}),x=b instanceof NH?b.server:b;if(j==="modern")PS(x,C),uS(x,v7),W.setServerCapabilities(x.getCapabilities(),bS(x));let g=new Pc0(z,()=>V(g),j==="modern"?X:void 0);return await b.connect(g),{product:b,channel:g}},M=(j)=>j.product.close().catch((C)=>G(H5(C))),F=async(j)=>{Q=j.channel;try{if(!await j.channel.whenRequestsAnswered(K00))G(Error(`Discarded the probe instance with requests still unanswered after ${K00}ms; continuing with the fallback`));await j.product.close()}catch(C){G(H5(C))}finally{Q=void 0}},N=async(j)=>{if(I.phase==="closed")return;if(I.phase==="pinned"){if(I.era==="modern"&&P$(j)&&j.method==="initialize"&&!NS(j.params)){await q(j,"initialize",j.params!==null&&typeof j.params==="object"&&typeof j.params.protocolVersion==="string"?j.params.protocolVersion:void 0);return}if(I.era==="modern"&&await Z(j))return;I.instance.channel.deliver(j);return}if(!P$(j)&&!h7(j)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=Tc0(j);switch(C.kind){case"invalid-envelope":{let b=`Invalid _meta envelope for protocol revision 2026-07-28: ${C.issue.key}: ${C.issue.problem}`;if(P$(j))await H(j.id,i0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(P$(j)){let b=new uI({supported:[...v7],requested:C.requested});G(b),await H(j.id,b.code,b.message,b.data)}else G(Error(`Discarded a notification claiming unsupported protocol revision ${C.requested}`));return;case"modern":if(P$(j)&&j.method==="server/discover"){if(I.phase==="probe"){I.instance.channel.deliver(j,{classification:C.classification});return}let b=await w("modern",C.revision);if(K()){await M(b);return}I={phase:"probe",instance:b},b.channel.deliver(j,{classification:C.classification});return}if(I.phase==="probe"){if(h7(j)){I.instance.channel.deliver(j,{classification:C.classification});return}I={phase:"pinned",era:"modern",instance:I.instance}}else{let b=await w("modern",C.revision);if(K()){await M(b);return}I={phase:"pinned",era:"modern",instance:b}}if(await Z(j))return;I.instance.channel.deliver(j,{classification:C.classification});return;case"legacy":{if(U==="reject"){if(P$(j))await q(j,C.reason,C.requestedVersion);return}if(I.phase==="probe"){if(await F(I.instance),K())return;I={phase:"opening"}}let b=await w("legacy");if(K()){await M(b);return}I={phase:"pinned",era:"legacy",instance:b},I.instance.channel.deliver(j);return}}},O=[],D=!1,P=async()=>{if(D)return;D=!0;try{while(O.length>0){let j=O.shift();try{await N(j)}catch(C){if(P$(j))await H(j.id,i0.InternalError,"Internal server error");G(H5(C))}}}finally{D=!1}},T=async()=>{if(J||I.phase==="closed")return;J=!0;let j=I;I={phase:"closed"};for(let C of W.teardownAll())await z.send(C).catch((b)=>G(H5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(H5(C)));await z.close().catch((C)=>G(H5(C)))};z.onmessage=(j)=>{O.push(j),P()},z.onerror=(j)=>{if(G(j),I.phase==="probe"||I.phase==="pinned")I.instance.channel.onerror?.(j)},z.onclose=()=>{if(J||I.phase==="closed")return;J=!0;let j=I;if(I={phase:"closed"},j.phase==="probe"||j.phase==="pinned")j.instance.product.close().catch((C)=>G(H5(C)))};let A=z.start().catch((j)=>{throw G(H5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function H5($){return $ instanceof Error?$:Error(String($))}var Bc0=class{_readBuffer;_started=!1;_closed=!1;constructor($=kS.stdin,Y=kS.stdout,U){this._stdin=$,this._stdout=Y,this._readBuffer=new ES({maxBufferSize:U?.maxBufferSize})}onclose;onerror;onmessage;_ondata=($)=>{try{this._readBuffer.append($),this.processReadBuffer()}catch(Y){this.onerror?.(Y),this.close().catch(()=>{})}};_onerror=($)=>{this.onerror?.($)};_onstdouterror=($)=>{this.onerror?.($),this.close().catch(()=>{})};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),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._closed)return;if(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){if(this._closed)return Promise.reject(Error("StdioServerTransport is closed"));return new Promise((Y,U)=>{let z=CS($),I=!1,Q=(K)=>{if(I)return;I=!0,this._stdout.off("error",Q),this._stdout.off("drain",J),U(K)},J=()=>{if(I)return;I=!0,this._stdout.off("error",Q),this._stdout.off("drain",J),Y()};if(this._stdout.once("error",Q),this._stdout.write(z)){if(I)return;I=!0,this._stdout.off("error",Q),Y()}else if(!I)this._stdout.once("drain",J)})}},K00=3000,Pc0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,U){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=U}async start(){}async send($,Y){if(VH($)||bw($)){let{id:U}=$;if(U!==void 0)this._settle(U)}if(this._closed)return;if(this._outboundIntercept?.($)==="handled")return;return this._wire.send($,Y)}setProtocolVersion=($)=>{this._wire.setProtocolVersion?.($)};deliver($,Y){if(this._closed)return;if(P$($))this._pendingRequests.add($.id);else if(h7($)&&$.method==="notifications/cancelled"){let U=$.params?.requestId;if(U!==void 0)this._settle(U)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let U=()=>{clearTimeout(z),Y(!0)},z=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((I)=>I!==U),Y(!1)},$);this._drainWaiters.push(U)})}async close(){if(this._closed)return;this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}_settle($){if(this._pendingRequests.delete($),this._pendingRequests.size===0)this._releaseDrainWaiters()}_releaseDrainWaiters(){let $=this._drainWaiters;this._drainWaiters=[];for(let Y of $)Y()}};var H00=m(()=>{iS();nw();sw()});var T$=m(()=>{xL();xL()});var U3;var DH=m(()=>{U3=class U3 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var tw=m(()=>{DH();D6=class D6 extends U3{name="HTTPError";response;request;options;data;constructor($,Y,U){let z=$.status||$.status===0?$.status:"",I=$.statusText??"",Q=`${z} ${I}`.trim(),J=Q?`status code ${Q}`:"an unknown error";super(`Request failed with ${J}: ${Y.method} ${Y.url}`);this.response=$,this.request=Y,this.options=U}}});var AH;var cS=m(()=>{DH();AH=class AH extends U3{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var BH;var nS=m(()=>{BH=class BH extends Error{name="NonError";value;constructor($){let Y="Non-error value was thrown";try{if(typeof $==="string")Y=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")Y=$.message}catch{}super(Y);this.value=$}}});var cI;var W00=m(()=>{DH();nS();cI=class cI extends U3{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new BH($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",Y?{cause:Y}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}});var pS;var X00=m(()=>{pS=class pS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var W5;var ew=m(()=>{DH();W5=class W5 extends U3{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class zM{options;constructor($){this.options=$}}var dS,Z00,$M,q00,V00,YM,jc0=()=>{return},L00,nI=2147483647,F00=40,UM,w00=($)=>new zM($),M00,O00;var pY=m(()=>{dS=(()=>{let $=!1,Y=!1,U=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(U&&z)try{Y=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(I){if(I instanceof Error&&I.message==="unsupported BodyInit type")return!1;throw I}return $&&!Y})(),Z00=typeof globalThis.AbortController==="function",$M=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",q00=typeof globalThis.ReadableStream==="function",V00=typeof globalThis.FormData==="function",YM=["get","post","put","patch","head","delete"];jc0();L00={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},UM=Symbol("stop");M00={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},O00={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 IM,Ec0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[U,z]of $)Y+=F00,Y+=IM.encode(`Content-Disposition: form-data; name="${U}"`).byteLength,Y+=typeof z==="string"?IM.encode(z).byteLength:z.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return IM.encode($).byteLength;if($ instanceof URLSearchParams)return IM.encode($.toString()).byteLength;return 0},N00=($,Y,U)=>{let z,I=0;return $.pipeThrough(new TransformStream({transform(Q,J){if(J.enqueue(Q),z){I+=z.byteLength;let K=Y===0?0:I/Y;if(K>=1)K=1-Number.EPSILON;U?.({percent:K,totalBytes:Math.max(Y,I),transferredBytes:I},z)}z=Q},flush(){if(z)I+=z.byteLength,U?.({percent:1,totalBytes:Math.max(Y,I),transferredBytes:I},z)}}))},D00=($,Y)=>{if(!$.body)return $;let U={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,U);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(N00($.body,z,Y),U)},A00=($,Y,U)=>{if(!$.body)return $;let z=Ec0(U??$.body);return new Request($,{duplex:"half",body:N00($.body,z,Y)})};var B00=m(()=>{pY();IM=new TextEncoder});var a5=($)=>$!==null&&typeof $==="object";function PH($,Y,U){return Object.hasOwn(Y,U)&&Y[U]===void 0?[]:rS($[U]??[],Y[U]??[])}var Cc0,mS=($)=>a5($)&&$[Cc0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},TH=(...$)=>{for(let Y of $)if((!a5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return rS({},...$)},oS=($={},Y={})=>{let U=new globalThis.Headers($),z=Y instanceof globalThis.Headers,I=new globalThis.Headers(Y);for(let[Q,J]of I.entries())if(z&&J==="undefined"||J===void 0)U.delete(Q);else U.set(Q,J);return U},lS=($)=>{if(!a5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},pI=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),U=$[g7];if(U)Y[g7]=new Set(U);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(lS($))return{...$};return $},Rc0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),_c0=($,Y)=>{if(lS($)&&lS(Y))return Rc0({...$,...Y});return oS($,Y)},QM=($={},Y={})=>({init:PH($,Y,"init"),beforeRequest:PH($,Y,"beforeRequest"),beforeRetry:PH($,Y,"beforeRetry"),beforeError:PH($,Y,"beforeError"),afterResponse:PH($,Y,"afterResponse")}),g7,vc0=($,Y)=>{let U=new URLSearchParams,z=new Set;for(let I of[$,Y]){if(I===void 0)continue;if(I instanceof URLSearchParams){for(let[J,K]of I.entries())U.append(J,K),z.delete(J);let Q=I[g7];if(Q)for(let J of Q)U.delete(J),z.add(J)}else if(Array.isArray(I))for(let Q of I){if(!Array.isArray(Q)||Q.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");U.append(String(Q[0]),String(Q[1])),z.delete(String(Q[0]))}else if(a5(I))for(let[Q,J]of Object.entries(I))if(J===void 0)U.delete(Q),z.add(Q);else U.append(Q,String(J)),z.delete(Q);else{let Q=new URLSearchParams(I);for(let[J,K]of Q.entries())U.append(J,K),z.delete(J)}}if(z.size>0)U[g7]=z;return U},rS=(...$)=>{let Y={},U={},z={},I,Q=[];for(let J of $)if(Array.isArray(J)){if(!Array.isArray(Y))Y=[];Y=[...Y,...J]}else if(a5(J)){for(let[K,G]of Object.entries(J)){if(K==="signal"&&G instanceof globalThis.AbortSignal){Q.push(G);continue}let H=mS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!a5(G)||Array.isArray(G)))throw TypeError("The `context` option must be an object");Y={...Y,context:G===void 0||G===null?{}:W?{...G}:{...Y.context,...G}};continue}if(K==="searchParams"){if(G===void 0||G===null)I=void 0;else if(W)I=G;else I=I===void 0?G:vc0(I,G);continue}if(a5(G)&&!W&&K in Y)G=rS(Y[K],G);Y={...Y,[K]:G}}if(a5(J.hooks)){let{value:K,isReplace:G}=mS(J.hooks);z=G?QM({},K):QM(z,K),Y.hooks=z}if(a5(J.headers)){let{value:K,isReplace:G}=mS(J.headers);U=G?pI(K):_c0(U,K),Y.headers=U}}if(I!==void 0)Y.searchParams=I;if(Q.length>0)if(Q.length===1)Y.signal=Q[0];else if($M)Y.signal=AbortSignal.any(Q);else Y.signal=Q.at(-1);return Y};var JM=m(()=>{pY();Cc0=Symbol("replaceOption");g7=Symbol("deletedParameters")});var T00=($)=>YM.includes($)?$.toUpperCase():$,hc0,Sc0,gc0,P00,j00=($={})=>{if(typeof $==="number")return{...P00,limit:$};if($.methods&&!Array.isArray($.methods))throw Error("retry.methods must be an array");if($.statusCodes&&!Array.isArray($.statusCodes))throw Error("retry.statusCodes must be an array");let Y=Object.fromEntries(Object.entries({...$,methods:$.methods?.map((U)=>U.toLowerCase())}).filter(([,U])=>U!==void 0));return{...P00,...Y}};var E00=m(()=>{pY();hc0=["get","put","head","delete","options","trace"],Sc0=[408,413,429,500,502,503,504],gc0=[413,429,503],P00={limit:2,methods:hc0,statusCodes:Sc0,afterStatusCodes:gc0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function sS($,Y,U,z){return new Promise((I,Q)=>{let J=setTimeout(()=>{if(U)U.abort();Q(new W5($))},z.timeout);z.fetch($,Y).then(I).catch(Q).then(()=>{clearTimeout(J)})})}var C00=m(()=>{ew()});async function KM($,{signal:Y}){return new Promise((U,z)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",I,{once:!0});function I(){clearTimeout(Q),z(Y.reason)}let Q=setTimeout(()=>{Y?.removeEventListener("abort",I),U()},$)})}var R00=($)=>{let Y={};for(let U in $){if(!Object.hasOwn($,U))continue;if(!(U in O00)&&!(U in M00))Y[U]=$[U]}return Y},_00=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[g7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var v00=m(()=>{pY();JM()});function aS($){if(!($&&kc0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:U,stack:z}=$;if(U==="Load failed")return z===void 0||"__sentry_captured__"in $;if(U.startsWith("error sending request for url"))return!0;if(U==="Failed to fetch"||U.startsWith("Failed to fetch (")&&U.endsWith(")"))return!0;return xc0.has(U)}var yc0,kc0=($)=>yc0.call($)==="[object Error]",xc0;var h00=m(()=>{yc0=Object.prototype.toString,xc0=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"])});function S00($){return tS($,D6)}function g00($){return tS($,AH)}function y00($){return tS($,W5)}var tS=($,Y)=>$ instanceof Y||$?.name===Y.name;var k00=m(()=>{tw();cS();ew()});function nc0($){let Y={...$,json:pI($.json),context:pI($.context),headers:pI($.headers),searchParams:cc0($.searchParams)};if($.retry!==void 0)Y.retry=ic0($.retry);return Y}class dI{static create($,Y){let U=Y.hooks?.init??[],z=U.length>0?nc0(Y):Y;for(let K of U)K(z);let I=new dI($,z),Q=async()=>{if(typeof I.#$.timeout==="number"&&I.#$.timeout>nI)throw RangeError(`The \`timeout\` option cannot be greater than ${nI}`);if(typeof I.#$.totalTimeout==="number"&&I.#$.totalTimeout>nI)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${nI}`);await Promise.resolve();let K=await I.#g(),G=K??await I.#h(async()=>I.#R()),H=K!==void 0||I.#C();for(;;){if(G===void 0)return G;if(EH(G))try{G=await I.#y(G)}catch(X){if(!(X instanceof cI))throw X;let Z=await I.#E(X,async()=>I.#R());if(Z===void 0)return Z;G=Z,H=I.#C();continue}let W=G;if(!W.ok&&W.type!=="opaque"&&(typeof I.#$.throwHttpErrors==="function"?I.#$.throwHttpErrors(W.status):I.#$.throwHttpErrors)){let X=new D6(W,I.#O(W),I.#M()),Z=X;if(X.data=await I.#L(W),H)throw Z;let q=await I.#E(X,async()=>I.#R());if(q===void 0)return q;G=q,H=I.#C();continue}break}if(!EH(G))return G;if(I.#V(G),I.#$.onDownloadProgress){if(typeof I.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!q00)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return I.#K(G),D00(W,I.#$.onDownloadProgress)}return G},J=(async()=>{try{return await Q()}catch(K){if(!(K instanceof Error))throw K;if(I.#X.has(K))throw K;let G=K;for(let H of I.#$.hooks.beforeError){let W=await H({request:I.request,options:I.#M(),error:G,retryCount:I.#I});if(W instanceof Error)G=W}throw G}finally{let K=I.#W;if(I.#F(K?.body??void 0),I.request!==K)I.#F(I.request.body??void 0)}})();for(let[K,G]of Object.entries(L00)){if(K==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;J[K]=async(H)=>{I.request.headers.set("accept",I.request.headers.get("accept")||G);let W=await J;if(K!=="json")return W[K]();let X=await W.text();if(X===""){if(H!==void 0)return u00(void 0,H);return JSON.parse(X)}let Z=z.parseJson?await z.parseJson(X,{request:I.#O(W),response:W}):JSON.parse(X);return H===void 0?Z:u00(Z,H)}}return J}static#z($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#U;#I=0;#Y;#$;#W;#H;#X=new WeakSet;#Q;#J;#Z=!1;#N=new WeakMap;constructor($,Y={}){if(this.#Y=$,Object.hasOwn(Y,"prefixUrl"))throw Error(uc0);if(this.#$={...Y,headers:oS(this.#Y.headers,Y.headers),hooks:QM({},Y.hooks),method:T00(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:j00(Y.retry),throwHttpErrors:Y.throwHttpErrors??!0,timeout:Y.timeout??1e4,totalTimeout:Y.totalTimeout??!1,fetch:Y.fetch??globalThis.fetch.bind(globalThis),context:Y.context??{}},typeof this.#Y!=="string"&&!(this.#Y instanceof URL||this.#Y instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#Y==="string"){if(this.#$.prefix){let z=this.#$.prefix.replace(/\/+$/,""),I=this.#Y.replace(/^\/+/,"");this.#Y=`${z}/${I}`}if(this.#$.baseUrl){let z;try{z=new URL(this.#Y)}catch{}if(!z)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if(Z00&&$M)this.#H=this.#$.signal??this.#Y.signal,this.#U=new globalThis.AbortController,this.#$.signal=this.#w();if(dS)this.#$.duplex="half";if(this.#$.json!==void 0)this.#$.body=this.#$.stringifyJson?.(this.#$.json)??JSON.stringify(this.#$.json),this.#$.headers.set("content-type",this.#$.headers.get("content-type")??"application/json");let U=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(V00&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!U)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),_00(this.#$.searchParams)){let z=new URL(this.request.url),I=this.#$.searchParams?.[g7];if(I)for(let Q of I)z.searchParams.delete(Q);if(typeof this.#$.searchParams==="string"){let Q=this.#$.searchParams.replace(/^\?/,"");if(Q!=="")z.search=z.search?`${z.search}&${Q}`:`?${Q}`}else{let Q=new URLSearchParams(dI.#z(this.#$.searchParams));for(let[J,K]of Q.entries())z.searchParams.append(J,K)}if(this.#$.searchParams&&typeof this.#$.searchParams==="object"&&!Array.isArray(this.#$.searchParams)&&!(this.#$.searchParams instanceof URLSearchParams)){for(let[Q,J]of Object.entries(this.#$.searchParams))if(J===void 0)z.searchParams.delete(Q)}this.request=new globalThis.Request(z,this.#$)}if(this.#$.onUploadProgress&&typeof this.#$.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");this.#J=typeof this.#$.totalTimeout==="number"?this.#S():void 0}#G(){let $=this.#$.retry.delay(this.#I+1),Y=$;if(this.#$.retry.jitter===!0)Y=Math.random()*$;else if(typeof this.#$.retry.jitter==="function"){if(Y=this.#$.retry.jitter($),!Number.isFinite(Y)||Y<0)Y=$}return Math.min(this.#$.retry.backoffLimit,Y)}async#P($){if(this.#I>=this.#$.retry.limit)throw $;let Y=$ instanceof Error?$:new BH($);if(Y instanceof cI)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let U=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#I+1});if(U===!1)throw $;if(U===!0)return this.#G()}if(y00($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(S00($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let U=$.response.headers.get("Retry-After")??$.response.headers.get("RateLimit-Reset")??$.response.headers.get("X-RateLimit-Retry-After")??$.response.headers.get("X-RateLimit-Reset")??$.response.headers.get("X-Rate-Limit-Reset");if(U&&this.#$.retry.afterStatusCodes.includes($.response.status)){let z=Number(U)*1000;if(Number.isNaN(z))z=Date.parse(U)-Date.now();else if(z>=Date.parse("2024-01-01"))z-=Date.now();if(!Number.isFinite(z))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return z=Math.max(0,z),Math.min(this.#$.retry.maxRetryAfter,z)}if($.response.status===413)throw $;return this.#G()}if(!g00($))throw $;return this.#G()}#V($){let Y=this.#O($);if(this.#$.parseJson)$.json=async()=>{let U=await $.text();if(U==="")return JSON.parse(U);return this.#$.parseJson(U,{request:Y,response:$})};return $}async#L($){let Y=await this.#T($,this.#D());if(Y===jH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let U=await this.#j(Y,$,this.#D(),this.#O($));if(U===jH){this.#q();return}return U}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#B();if(Y===void 0)return $;if(Y<=0)throw new W5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#T($,Y){let{body:U}=$;if(!U)try{return await $.text()}catch{return}let z;try{z=U.getReader()}catch{return}let I=bc0($.headers.get("content-type")??""),Q=[],J=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await z.read();if(W)break;if(J+=X.byteLength,J>fc0){z.cancel().catch(()=>{return});return}Q.push(I.decode(X,{stream:!0}))}}catch{return}return Q.push(I.decode()),Q.join("")})(),G=new Promise((W)=>{let X=setTimeout(()=>{W(jH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===jH)z.cancel().catch(()=>{return});return H}async#j($,Y,U,z){let I;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:z,response:Y}):JSON.parse($)),new Promise((Q)=>{I=setTimeout(()=>{Q(jH)},U)})])}catch{return}finally{clearTimeout(I)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#w(){return this.#H?AbortSignal.any([this.#H,this.#U.signal]):this.#U.signal}#q(){let $=this.#B();if($!==void 0&&$<=0)throw new W5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#M(),retryCount:0});if(f00(Y))this.#_(Y);else if(EH(Y))return Y}return}async#y($){let Y=this.#O($);for(let U of this.#$.hooks.afterResponse){let z=this.#v($.clone(),Y);this.#V(z);let I;try{I=await U({request:this.request,options:this.#M(),response:z,retryCount:this.#I})}catch(J){if(z!==$)this.#K(z);throw this.#K($),J}if(I instanceof zM){if(z!==$)this.#K(z);throw this.#K($),new cI(I.options)}let Q=EH(I)?this.#v(I,Y):$;if(z!==$&&z!==Q&&z.body!==Q.body)this.#K(z);if($!==Q&&$.body!==Q.body)this.#K($);$=Q}return $}async#h($){try{return await $()}catch(Y){return this.#E(Y,$)}}async#E($,Y){this.#Z=!1;let U=Math.min(await this.#P($),nI),z={signal:this.#H},I=this.#B();if(I!==void 0){if(I<=0)throw new W5(this.request);if(U>=I)throw await KM(I,z),new W5(this.request)}if(await KM(U,z),this.#q(),$ instanceof cI&&$.customRequest){let Q=new globalThis.Request($.customRequest,this.#$.signal?{signal:this.#$.signal}:void 0);this.#_(Q)}for(let Q of this.#$.hooks.beforeRetry){let J;try{J=await Q({request:this.request,options:this.#M(),error:$,retryCount:this.#I+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(f00(J)){this.#_(J);break}if(EH(J))return this.#Z=!0,this.#I++,J;if(J===UM)return}return this.#q(),this.#I++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#U?.signal.aborted)this.#U=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=R00(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,U=this.#k(this.request,this.#$.body??void 0);if(this.#W=U,Y)this.request=Y;try{let z=this.#B();if(z!==void 0&&z<=0)throw new W5(this.request);let I=this.#$.timeout===!1?z:z===void 0?this.#$.timeout:Math.min(this.#$.timeout,z),Q=I===void 0?await this.#$.fetch(U,$):await sS(U,$,this.#U,{timeout:I,fetch:this.#$.fetch});return this.#v(Q,U)}catch(z){if(aS(z))throw new AH(this.request,{cause:z});throw z}}#B(){if(this.#J===void 0)return;let $=this.#S()-this.#J;return Math.max(0,this.#$.totalTimeout-$)}#S(){return globalThis.performance?.now()??Date.now()}#M(){if(!this.#Q){let{hooks:$,json:Y,parseJson:U,stringifyJson:z,searchParams:I,timeout:Q,totalTimeout:J,throwHttpErrors:K,fetch:G,...H}=this.#$;this.#Q=Object.freeze(H)}return this.#Q}#_($){this.#Q=void 0,this.request=$}#O($){return this.#N.get($)??this.request}#v($,Y){return this.#N.set($,Y),$}#k($,Y){if(!this.#$.onUploadProgress||!$.body||!dS)return $;return A00($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var fc0=10485760,uc0="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",jH,bc0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),U=Y?.[1]??Y?.[2];if(U)try{return new TextDecoder(U)}catch{}return new TextDecoder},x00="The `schema` argument must follow the Standard Schema specification",ic0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},b00,f00=($)=>$ instanceof globalThis.Request||b00.call($)==="[object Request]",EH=($)=>$ instanceof globalThis.Response||b00.call($)==="[object Response]",cc0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return pI($)},u00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(x00);let U=Y["~standard"];if(typeof U!=="object"||U===null||typeof U.validate!=="function")throw TypeError(x00);let z=await U.validate($);if(z.issues)throw new pS(z.issues);return z.value};var i00=m(()=>{tw();cS();nS();W00();X00();ew();B00();JM();E00();C00();v00();h00();k00();pY();jH=Symbol("timedOutResponseData"),b00=Object.prototype.toString});var eS=($)=>{let Y=(U,z)=>dI.create(U,TH($,z));for(let U of YM)Y[U]=(z,I)=>dI.create(z,TH($,I,{method:U}));return Y.create=(U)=>eS(TH(U)),Y.extend=(U)=>{if(typeof U==="function")U=U($??{});return eS(TH($,U))},Y.stop=UM,Y.retry=w00,Y},pc0,X5;var mI=m(()=>{i00();pY();JM();tw();/*! MIT License © Sindre Sorhus */pc0=eS(),X5=pc0});async function c00($){if($.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,U=$.source.expiresAt?new Date($.source.expiresAt).getTime():Date.now()+$.source.expiresIn*1000;return{token:$.source.token,expiresAt:U,enterprise:{provider:$.source.provider??"seal",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:$.source.tenantId,tenantSlug:$.seal.tenantSlug??$.source.tenantSlug,tenantName:$.source.tenantName,raw:{sourceType:$.source.type}}}}function dc0($){let Y=Object.entries($??{}).map(([U,z])=>`${U}=${z}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},U=dc0($?.cookies);if(U)Y.Cookie=U;return Y}var n00,mc0,lc0,oc0,rc0,p00;var d00=m(()=>{T$();n00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),mc0=L.object({provider:L.string(),corpId:L.string().optional(),staffId:L.string(),sealUrl:L.string().url(),tenantId:L.string().optional(),tenantSlug:L.string().optional(),tenantName:L.string().optional(),raw:L.unknown().optional()}),lc0=L.object({token:L.string(),expiresAt:L.number(),enterprise:mc0}),oc0=L.object({openapi:n00.optional(),closeapi:n00.optional()}),rc0=L.object({seal:lc0.optional(),hose:oc0.optional()}),p00=L.record(L.string(),rc0)});import{existsSync as $g,mkdirSync as sc0,readFileSync as ac0,writeFileSync as tc0}from"node:fs";import{dirname as ec0,join as l00}from"node:path";import{homedir as o00}from"node:os";function $n0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if($g(GM))return GM;if($g(m00))return m00;return GM}function Yn0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return GM}function lI(){let $=$n0();if(!$g($))return{};try{return p00.parse(JSON.parse(ac0($,"utf-8")))}catch{return{}}}function HM($){let Y=Yn0();sc0(ec0(Y),{recursive:!0,mode:448}),tc0(Y,JSON.stringify($,null,2),{mode:384})}function r00($){return lI()[$]?.seal}function s00($,Y){let U=lI();HM({...U,[$]:{...U[$],seal:Y}})}function a00($){let Y=lI(),U=Y[$];if(!U)return;HM({...Y,[$]:{...U,seal:void 0}})}function CH($){return lI()[$]?.hose??{}}function Yg($,Y){let U=lI();HM({...U,[$]:{...U[$],hose:Y}})}function WM($){let Y=lI();delete Y[$],HM(Y)}var GM,m00;var RH=m(()=>{d00();GM=l00(o00(),".config","seal-use","seal_tokens.json"),m00=l00(o00(),".config","seal-home","seal_tokens.json")});function j$($){return $.replace(/\/+$/,"")}function XM($){let Y;try{Y=new URL($.trim())}catch{throw Error("Invalid Hose assistance link: expected a valid HTTPS URL")}if(Y.protocol!=="https:"||Y.port||!Qn0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==In0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let U=Y.searchParams.getAll("accessToken").filter(Boolean),z=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(U.length!==1||z.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let I=z[0].trim().toLowerCase();if(!e00.test(I))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:I,accessToken:U[0],baseUrl:Y.origin}}async function ZM($,Y){let U=typeof $==="string"?XM($):$10($),z=`https://${U.corpId}.sealai.cc`,Q=await B6(z,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:U.accessToken,returnToken:"1"}}).json(),J=Q.token??Q.accessToken??Q.data?.token??Q.data?.accessToken;if(!J)throw Error("Seal SSO did not return a bearer token");let K=Q.expiresIn??Q.expires_in??Q.data?.expiresIn??Q.data?.expires_in??3600;return{corpId:U.corpId,sealUrl:z,token:J,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function qM($,Y){let U=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,z=[Y.tenantSlug,U?.corporationId].filter((J)=>typeof J==="string"&&Boolean(J)),I=$.trim().toLowerCase(),Q=z.map((J)=>J.trim().toLowerCase()).filter(Boolean);if(Q.length===0||Q.some((J)=>J!==I))throw Error("Hose assistance link tenant mismatch: the Seal tenant does not match ekbCorpId")}function Qn0($){let Y=$.toLowerCase();return zn0.some((U)=>Y.endsWith(U))}function $10($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",U=typeof $?.accessToken==="string"?$.accessToken.trim():"",z=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!e00.test(Y)||!U)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:U,...z?{baseUrl:z}:{}}}function Y10($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function y7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function Jn0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function U10($){return X5.create({prefix:j$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let U=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${U?`: ${U}`:""}`,Y}]}})}async function Kn0($){let Y=U10($),U=$.appKey??$.key,z=$.appSecurity??$.password;if(!U||!z)throw Error("Hose source has no OpenAPI credentials; the configured closeToken is only valid for Hose web-session APIs");let I=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:U,appSecurity:z}}).json(),Q=I.value?.accessToken??I.accessToken??I.token;if(!Q)throw Error("Hose login did not return an access token");return{token:Q,expiresAt:Date.now()+3600000}}async function oI($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=CH($.id);if(Y10(Y.openapi))return Y.openapi.token;let U=Ug.get($.id);if(U)return U;let z=Kn0($.source).then((I)=>{return Yg($.id,{...CH($.id),openapi:I}),I.token}).finally(()=>Ug.delete($.id));return Ug.set($.id,z),z}async function VM($,Y,U=7200){let z=U10($),I=Jn0($),J=(await z.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:I,pageType:"home",expireDate:U}}).json()).value?.message;if(!J)throw Error("Hose CloseAPI did not return a provisional auth URL");let K=new URL(J).searchParams.get("accessToken");if(!K)throw Error("Hose provisional auth URL did not include accessToken");return{token:K,url:J,expiresAt:Date.now()+U*1000}}async function LM($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source;if(Y.closeToken){let Q=Y.expiresAt?Date.parse(Y.expiresAt):Number.MAX_SAFE_INTEGER;if(Q!==Number.MAX_SAFE_INTEGER&&Date.now()>=Q)throw Error("Configured Hose closeToken has expired; import a fresh Hose web session");return{token:Y.closeToken,expiresAt:Q}}let U=CH($.id);if(Y10(U.closeapi)&&U.closeapi.url)return U.closeapi;let z=zg.get($.id);if(z)return z;let I=oI($).then((Q)=>VM(Y,Q)).then((Q)=>{return Yg($.id,{...CH($.id),closeapi:Q}),Q}).finally(()=>zg.delete($.id));return zg.set($.id,I),I}async function z10($,Y=7200,U){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);if(!Number.isFinite(Y)||Y<=0)throw Error(`Invalid expire seconds: ${Y}. Must be a positive integer.`);let z=await oI($),I=await VM($.source,z,Y);if(!I.url)throw Error("Hose provisional auth URL was not available");return{corpId:$.source.corpId,staffId:$.source.staffId,url:I.url,token:I.token,expiresIn:Y}}async function I10($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await LM($),U=y7($,$.source),z=A6($.seal),Q=await B6(U,void 0,z).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:Y.token,returnToken:"1"}}).json(),J=Q.token??Q.accessToken??Q.data?.token??Q.data?.accessToken;if(!J)throw Error("Seal SSO did not return a bearer token");let K=Q.expiresIn??Q.expires_in??Q.data?.expiresIn??Q.data?.expires_in??3600,G={provider:"hose",corpId:$.source.corpId,staffId:$.source.staffId,sealUrl:j$(U),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:j$($.source.domain)}};return{token:J,expiresAt:Date.now()+K*1000,enterprise:G}}async function rI($,Y,U){if(U){let J=j$(U),K=await t00(J,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${J}. Please verify appKey/appSecurity and domain connectivity.`);return K}let z=Un0.map(async(J)=>{try{return await t00(J,$,Y)}catch{return}}),Q=(await Promise.all(z)).filter((J)=>Boolean(J));if(Q.length>0&&Q[0])return Q[0];throw Error("Failed to authenticate with appKey/appSecurity on all 6 standard Hose domains (app.ekuaibao.com, dd2.hosecloud.com, wx2.ekuaibao.com, kdcloud2.ekuaibao.com, ddenterprise.ekuaibao.com, feishu.ekuaibao.com). "+'If your enterprise uses a private cloud or custom domain (such as 美年大健康), please specify the "domain" parameter explicitly.')}async function t00($,Y,U){try{let z=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:U}),signal:AbortSignal.timeout(8000)});if(!z.ok)return;let I=await z.json();if(I.value?.errorCode)return;let Q=I.value?.accessToken??I.accessToken,J=I.value?.corporationId??I.value?.corporation?.id;if(!Q||!J)return;return{domain:$,corpId:J,corpName:I.value?.corporation?.name,openapiToken:Q,expireTime:I.value?.expireTime}}catch{return}}async function FM($,Y){let U=`${j$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,z=await fetch(U,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!z.ok){let J=await z.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${z.status} ${J}`)}return((await z.json()).items??[]).map((J)=>({id:J.id,name:J.name,enName:J.enName,roleDefs:(J.roleDefs??[]).map((K)=>({id:K.id,name:K.name,enName:K.enName,sourceType:K.sourceType,sourceTypeValue:K.sourceTypeValue,groupId:J.id,groupName:J.name}))}))}async function Ig($,Y,U,z="id"){let I=U.startsWith("$")?U.slice(1):U,Q=`${j$($)}/api/openapi/v1/roledefs/$${I}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(z)}&pathType=name`,J=await fetch(Q,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!J.ok){let W=await J.text().catch(()=>"");throw Error(`Failed to fetch Hose role staffs for ${I}: ${J.status} ${W}`)}let G=(await J.json()).value;if(!G)throw Error(`Hose role staff query returned empty result for ${I}`);let H=[];for(let W of G.contents??[])for(let X of W.staffs??[])if(X&&!H.includes(X))H.push(X);return{id:G.id??I,name:G.name??"",count:G.count??H.length,staffs:H}}async function Qg($,Y,U){if(U.length===0)return[];let z=`${j$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,I=await fetch(z,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:U.slice(0,100)}),signal:AbortSignal.timeout(1e4)});if(!I.ok){let J=await I.text().catch(()=>"");throw Error(`Failed to fetch Hose staff details: ${I.status} ${J}`)}return(await I.json()).items??[]}function _H($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function Jg($){let Y=typeof $==="string"?XM($):$10($),U=Y.baseUrl||"https://app.ekuaibao.com",z,I,Q,J,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await X5.get(`${U}/api/engine/realm/$UNITY/actions/jwt`,{searchParams:{corpId:Y.corpId},headers:G,timeout:1e4}).json(),W=H.id||H.value;if(W){let X=W.split(".");if(X.length>=2){let Z=X[1].replace(/-/g,"+").replace(/_/g,"/"),q=JSON.parse(Buffer.from(Z,"base64").toString("utf-8"));if(typeof q.staffId==="string")z=q.staffId;if(typeof q.corporationName==="string")I=q.corporationName;if(typeof q.staffName==="string")Q=q.staffName;if(typeof q.cellphone==="string")K=q.cellphone;if(q.isAdmin!==void 0)J=q.isAdmin===!0||q.isAdmin==="true"}}}catch{}if(!z||!I)try{let W=(await X5.get(`${U}/api/account/v2/session`,{headers:{...G,...z?{staffid:z}:{}},timeout:1e4}).json())?.value;if(W){if(!z&&W.loginStaffId)z=W.loginStaffId;if(!I&&W.corporationName)I=W.corporationName;if(!Q&&W.privilege)Q=W.privilege}}catch{}if(!z)z=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:U,accessToken:Y.accessToken,staffId:z,corpName:I,staffName:Q,isAdmin:J,cellphone:K}}async function Kg($){let Y=await Jg($),U={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},z;try{z=await(await X5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:U,timeout:15000})).json()}catch(J){let K=J instanceof Error?J.message:String(J);throw Error(`Failed to query Hose OpenAPI keys from assistance link: ${K}`)}let I=z.items??[],Q=[];for(let J of I)if(typeof J==="object"&&J!==null){let K=J;if(typeof K.appKey==="string"&&typeof K.appSecurity==="string")Q.push({id:String(K.id??K.appKey),name:typeof K.name==="string"?K.name:void 0,appKey:K.appKey,appSecurity:K.appSecurity,active:typeof K.active==="boolean"?K.active:!0,corporationId:typeof K.corporationId==="string"?K.corporationId:Y.corpId,createTime:typeof K.createTime==="number"?K.createTime:void 0,updateTime:typeof K.updateTime==="number"?K.updateTime:void 0})}return{corpId:Y.corpId,corpName:Y.corpName,baseUrl:Y.baseUrl,staffId:Y.staffId,keys:Q}}var Un0,zn0,In0="/web/thirdparty.html",e00,Ug,zg;var E$=m(()=>{mI();m6();RH();Un0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],zn0=[".ekuaibao.com",".hosecloud.com"],e00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,Ug=new Map,zg=new Map});function Q10($,Y){return Date.now()>=$.expiresAt-Y*1000}async function Gn0($){switch($.source.type){case"hose":return I10($);case"seal":return c00($)}}async function MM($){let Y=$.auth.refreshTtl,U=wM.get($.id);if(U&&!Q10(U,Y))return U;let z=r00($.id);if(z&&!Q10(z,Y))return wM.set($.id,z),z;let I=await Gn0($);return wM.set($.id,I),s00($.id,I),I}async function J10($){return(await MM($)).enterprise}function K10($){wM.delete($),a00($)}var wM;var Gg=m(()=>{E$();RH();wM=new Map});var H10={};T8(H10,{createSealClientForUrl:()=>B6,createSealClientForToken:()=>Hg,createSealClient:()=>B1});function Hn0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function Wn0($){if(!($ instanceof D6))return $;let Y=Hn0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function G10($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)K10($);return Wn0(Y)}}async function B1($){let Y=await MM($);return X5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[G10($.id)]}})}async function Hg($,Y){let U=await MM($);return B6(U.enterprise.sealUrl,Y,A6($.seal))}function B6($,Y,U={}){let z={...U};if(Y)z.Authorization=`Bearer ${Y}`;return X5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:z,hooks:{beforeError:[G10()]}})}var m6=m(()=>{mI();Gg()});var vH;var W10=m(()=>{vH={name:"seal-use",version:"0.10.37",private:!0,description:"Seal tenant operations toolkit: approval-run diagnosis, rule remediation, Hose/合思 auth, plus a CLI and an optional MCP server.",license:"MIT",author:{name:"yingqing"},repository:{type:"git",url:"git+https://github.com/yunyingk/seal-use.git"},type:"module",module:"src/server.ts",bin:{"seal-use":"src/cli.ts"},packageManager:"bun@1.3.14",engines:{bun:">=1.3.14"},scripts:{dev:"bun run --watch src/server.ts",start:"bun run src/server.ts",probe:"bun run src/probe.ts",cli:"bun run src/cli.ts",check:"tsc --noEmit","build:binary":"node scripts/build-binary.mjs","build:plugin":"node scripts/build-plugin.mjs",bump:"bun run scripts/bump-version.ts",release:"bun run scripts/release.ts","dev:override":"bun run scripts/dev-override.ts","dev:link":"bun run scripts/dev-override.ts","openapi:bundle":"bun run scripts/bundle-openapi.ts","openapi:raw":"bun run scripts/generate-raw-openapi.ts",test:"bun test",prepare:"git config core.hooksPath .githooks"},dependencies:{"@modelcontextprotocol/server":"^2.0.0",archiver:"^8.0.0",exceljs:"^4.4.0","iconv-lite":"^0.7.3",ky:"^2.0.2","pinyin-pro":"^3.29.3",yauzl:"^3.4.0",zod:"^4.4.3"},devDependencies:{"@modelcontextprotocol/client":"^2.0.0","@types/archiver":"^8.0.0","@types/bun":"^1.3.14","@types/yauzl":"^3.4.0","bun-types":"^1.3.14",typescript:"^5.9.3",yaml:"^2.9.0"}}});import{spawnSync as X10}from"node:child_process";function Zn0($,Y=vH.version){let U=$.trim();if(!U)return null;let z=U.endsWith("-dirty"),I=z?U.slice(0,-6):U,Q=I.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(Q&&Q[1]&&Q[2]&&Q[3])return{baseVersion:Q[1],commitsAhead:Number.parseInt(Q[2],10),commit:Q[3],dirty:z,describe:U};let J=I.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(J&&J[1])return{baseVersion:J[1],commitsAhead:0,commit:"",dirty:z,describe:U};let K=I.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:z,describe:U};return null}function qn0($,Y,U,z){let Q=U?`+g${U}${z?".dirty":""}`:z?"+dirty":"";return`${$}-dev.${Y}${Q}`}function Vn0($){let Y=$?.env,U=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,z=Y?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,I=Y?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,Q=Y?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,J=Y?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,K=Y?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,G=Y?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,H=Y?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,W=Y?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,X=$?.cwd;if(U){let Z=z==="true",V={name:"seal-use",version:U,channel:I||(Z?"release":"dev"),isRelease:Z};if(Q)V.git={baseVersion:Q,commitsAhead:Number.parseInt(J||"0",10),commit:K||"",dirty:G==="true",describe:H||U};return V}if(z==="true"||W==="1")return{name:"seal-use",version:vH.version,channel:"release",isRelease:!0};try{let Z=X10("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=Zn0(Z.stdout.trim(),vH.version);if(q){if(!q.commit){let w=X10("git",["rev-parse","--short","HEAD"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(w.status===0&&w.stdout)q.commit=w.stdout.trim()}return{name:"seal-use",version:qn0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${vH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var dY,X1,Wg,Qp1;var z3=m(()=>{W10();dY=Vn0(),X1=dY.version,Wg=dY.isRelease,Qp1=dY.channel});function sI($=void 0){return Zg.parse($??{})}function V10($,Y){return sI({...sI($),...Y})}var Z10,Xg,q10,Zg,qg;var aI=m(()=>{T$();Z10=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],Xg={minFileSizeBytes:500,allowedExtensions:[...Z10]},q10=L.string().trim().min(1).transform(($)=>{let Y=$.toLowerCase();return Y.startsWith(".")?Y:`.${Y}`}).refine(($)=>/^\.[a-z0-9][a-z0-9+_-]*$/.test($),{message:"文件后缀必须是简单扩展名,例如 .pdf 或 xlsx"}),Zg=L.object({minFileSizeBytes:L.number().int().min(0).default(Xg.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(q10).min(1).default([...Z10]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),qg=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(q10).min(1).transform(($)=>[...new Set($)])}).optional()});var Ln0,Fn0,wn0,Mn0,F10,On0,Nn0,w10,OM,M10,Dn0,NM,O10,SH,N10,An0,Bn0,Pn0,L10,gH,D10,Tn0,jn0,DM,Vg,A10,B10,P10,T10,AM,j10,Lg,Fg,E10,C10,En0,R10,Cn0,_10,hH,v10,h10,S10,g10,y10,k10,x10,f10,u10,b10,i10,Rn0,c10,_n0,vn0,hn0,wg,Mg,Sn0,n10,p10,d10,m10,gn0,Og,Xp1,Zp1,l10,qp1;var Ng=m(()=>{T$();aI();Ln0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Fn0=L.object({id:L.string(),tenantId:L.string(),name:L.string(),isAdmin:L.boolean().default(!1),permissions:L.array(L.string()).default([]),providerUserId:L.string().optional(),hosecloudStaff:Ln0.optional()}),wn0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),Mn0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:wn0.optional()}),F10=L.object({user:Fn0,tenant:Mn0}),On0=L.object({id:L.string(),name:L.string(),email:L.string().nullable().optional(),emailVerified:L.boolean().optional(),image:L.string().nullable().optional(),tenantId:L.string().optional(),provider:L.string().optional(),providerUserId:L.string().optional(),mobile:L.string().nullable().optional(),status:L.string().optional(),permissions:L.array(L.string()).default([]),isAdmin:L.boolean().default(!1),hosecloudStaff:L.unknown().optional()}).passthrough(),Nn0=L.object({id:L.string(),token:L.string().optional(),expiresAt:L.string(),createdAt:L.string().optional(),updatedAt:L.string().optional(),ipAddress:L.string().optional(),userAgent:L.string().optional(),userId:L.string(),delegationId:L.string().nullable().optional()}).passthrough(),w10=L.object({user:On0,session:Nn0}),OM=L.object({id:L.string(),tenantId:L.string().optional(),code:L.union([L.number(),L.string()]).optional(),description:L.string(),scope:L.string(),strictness:L.string(),status:L.string().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional()}),M10=L.object({rules:L.array(OM),hasPendingDeletes:L.boolean().default(!1)}),Dn0=L.object({id:L.union([L.string(),L.number()]).optional(),ruleId:L.union([L.string(),L.number()]).optional(),stableId:L.union([L.string(),L.number()]).optional(),runtimeRuleId:L.union([L.string(),L.number()]).optional(),runtimeId:L.union([L.string(),L.number()]).optional(),code:L.union([L.string(),L.number()]).optional(),description:L.string(),scope:L.string(),strictness:L.string()}).passthrough(),NM=L.object({id:L.string(),tenantId:L.string().optional(),versionNumber:L.number(),versionName:L.string().nullable().optional(),publishedBy:L.string().nullable().optional(),publishedByName:L.string().nullable().optional(),rules:L.array(Dn0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}).passthrough(),O10=L.object({version:NM,rulesCount:L.number()}),SH=L.object({id:L.string(),tenantId:L.string().optional(),title:L.string(),purpose:L.string().default(""),contentType:L.string().default("policy"),content:L.string(),status:L.string().default("published"),enabled:L.boolean().default(!0),scenarios:L.array(L.string()).default([]),tags:L.array(L.string()).default([]),category:L.string().nullable().optional(),categoryTags:L.array(L.string()).default([]),createdBy:L.string().nullable().optional(),createdByName:L.string().nullable().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional(),updatedBy:L.string().nullable().optional(),updatedByName:L.string().nullable().optional(),isDeleted:L.boolean().default(!1)}),N10=L.object({articles:L.array(SH),total:L.number().optional()}),An0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),Bn0=L.object({type:L.string(),signKey:L.string().optional(),outboundName:L.string().optional(),mode:L.string().optional(),autoApprovalRate:L.number().optional(),apiKey:L.string().optional(),apiSecret:L.string().optional(),apiOrigin:L.string().optional(),corporationId:L.string().optional(),ebotSignKey:L.string().optional(),completionSignKey:L.string().optional(),outboundMessageId:L.string().optional(),completionMessageId:L.string().optional()}).passthrough(),Pn0=L.enum(["assisted","semi_automatic","fully_automatic"]),L10=L.object({id:L.string(),url:L.string().url()}).passthrough(),gH=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:Pn0,incomingDocumentWebhook:L10,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:L10,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:Zg.default(Xg)}).passthrough(),D10=L.object({id:L.string().optional(),tenantId:L.string().optional(),tone:L.string().optional(),language:L.string().optional(),detailLevel:L.string().optional(),outputFormat:L.string().optional(),examples:L.array(L.string()).default([]),prohibitedPhrases:L.array(L.string()).default([]),customInstructions:L.string().optional(),updatedAt:L.number().optional(),decisionPreferences:An0.optional(),integrationSystem:L.string().optional(),integrations:L.array(Bn0).default([])}).passthrough(),Tn0=L.object({id:L.string().optional(),sn:L.string().optional(),title:L.string().optional(),name:L.string().optional(),fields:L.array(L.unknown()).optional()}).passthrough(),jn0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),DM=L.object({id:L.string(),tenantId:L.string().optional(),agentId:L.string().optional(),status:L.string().optional(),taskMode:L.string().optional(),finalExecutionMode:L.string().optional(),sourceSystem:L.string().optional(),sourceDocumentSN:L.string().optional(),sourceDocumentId:L.string().optional(),documentId:L.string().optional(),document:Tn0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:jn0.optional(),ruleSetVersionNumber:L.number().optional(),ruleSetPublishedAt:L.number().optional(),ruleSetPublishedByName:L.string().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Vg=L.object({records:L.array(DM).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),A10=L.object({id:L.string(),expiresAt:L.number().nullable().optional(),revokedAt:L.number().nullable().optional(),createdAt:L.number().nullable().optional(),lastUsedAt:L.number().nullable().optional(),useCount:L.number().default(0),note:L.string().nullable().optional(),link:L.string()}).passthrough(),B10=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),P10=L.object({userId:L.string(),password:L.string()}).passthrough(),T10=L.object({password:L.string()}).passthrough(),AM=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string(),mobile:L.string().optional(),email:L.string().optional(),departmentIds:L.array(L.string()).default([]),status:L.string().optional(),permissions:L.array(L.string()).default([]),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),j10=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(AM).default([])}).passthrough(),Lg=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),parentId:L.string().nullable().optional(),ancestors:L.array(L.string()).default([]),provider:L.string().optional(),permissions:L.array(L.string()).default([]),isDeleted:L.boolean().optional(),syncedAt:L.string().optional(),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),Fg=L.object({items:L.array(Lg).default([])}).passthrough(),E10=L.object({items:L.array(AM).default([])}).passthrough(),C10=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),En0=L.object({tagId:L.string().optional(),tagName:L.string().optional(),tagPath:L.string().optional(),count:L.number().default(0),avgConfidence:L.number().default(0),errorCount:L.number().default(0),warningCount:L.number().default(0)}).passthrough(),R10=L.object({tagStats:L.array(En0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),Cn0=L.object({riskId:L.string().optional(),recordId:L.string().optional(),riskDetails:L.string().default(""),riskLevel:L.string().default("warning"),documentType:L.string().default(""),documentSN:L.string().default(""),sourceSystem:L.string().default(""),sourceDocumentURL:L.string().nullable().optional(),confidence:L.number().default(0),reasoning:L.string().default(""),createdAt:L.union([L.string(),L.number(),L.date()]).optional()}).passthrough(),_10=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array(Cn0).default([]),total:L.number().default(0)}).passthrough(),hH=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),v10=L.object({metrics:L.object({approvalCount:hH.optional(),accuracy:hH.optional(),automationRate:hH.optional(),riskCount:hH.optional(),avgDuration:hH.optional()}).passthrough().default({}),sankeyData:L.object({nodes:L.array(L.object({id:L.string()}).passthrough()).default([]),links:L.array(L.object({source:L.string(),target:L.string(),value:L.number().default(0)}).passthrough()).default([])}).passthrough().default({nodes:[],links:[]})}).passthrough(),h10=L.record(L.string(),L.unknown()),S10=L.object({expenses:L.array(h10).default([]),total:L.number().optional()}).passthrough(),g10=L.object({invoices:L.array(h10).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),y10=L.record(L.string(),L.unknown()),k10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),x10=L.object({id:L.string(),name:L.string(),description:L.string().optional(),available:L.boolean().default(!0),fields:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),f10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),u10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),b10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),i10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Rn0=L.object({columns:L.array(i10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),c10=L.object({id:L.string().optional(),listSheets:L.array(Rn0).default([]),mainColumns:L.array(i10).default([]),workbookName:L.string().optional(),mainKeyColumn:L.string().optional(),mainSheetName:L.string().optional(),titleColumn:L.string().optional(),statusColumn:L.string().optional(),applicationDateColumn:L.string().optional(),updatedDateColumn:L.string().optional(),attachmentFieldKey:L.string().optional(),attachmentFieldLabel:L.string().optional()}).passthrough(),_n0=L.object({approvalCode:L.string(),nodeId:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),limit:L.number().int().positive().max(100).optional(),dataCollectionMode:L.string().optional(),signKey:L.string().optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional(),disableAttachmentCache:L.boolean().optional(),thinkingDepthOverride:L.enum(["default","medium","high"]).optional(),startTime:L.number().optional(),endTime:L.number().optional(),templateId:L.string().optional(),packageIds:L.array(L.string()).optional(),packageLabel:L.string().optional(),runMode:L.string().optional(),schemaConfig:c10.optional()}).passthrough(),vn0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),hn0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),wg=L.object({id:L.string(),tenantId:L.string().optional(),approvalCode:L.string().optional(),nodeId:L.string().optional(),sourceSystem:L.string().optional(),status:L.string().optional(),totalCount:L.number().default(0),processedCount:L.number().default(0),successCount:L.number().default(0),failedCount:L.number().default(0),createdCount:L.number().default(0),createFailedCount:L.number().default(0),params:_n0.optional(),requestSummary:vn0.nullable().optional(),resultSummary:hn0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Mg=L.object({batchId:L.string()}).passthrough(),Sn0=L.object({dataCollectionMode:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional()}).passthrough(),n10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Sn0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),p10=L.object({hasFeishu:L.boolean().default(!1),hasHosecloud:L.boolean().default(!1),hasWeaver:L.boolean().default(!1),hasHelios:L.boolean().default(!1),hasMaycur:L.boolean().default(!1),hasMaycurStandard:L.boolean().default(!1)}).passthrough(),d10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),m10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),templateId:L.string().optional(),originalFileName:L.string().optional(),status:L.string().optional(),documentCount:L.number().optional(),attachmentCount:L.number().optional(),uploadedBy:L.string().optional(),schemaConfig:c10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),gn0=L.object({hitScopes:L.array(L.string()).default([]),hitRuleIds:L.array(L.string()).default([]),notHitScopes:L.array(L.string()).default([]),notHitRuleIds:L.array(L.string()).default([])}).passthrough(),Og=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:gn0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),Xp1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(Og).default([])}).passthrough(),Zp1=L.object({dryRun:L.boolean().optional(),signKey:L.string().min(1).optional(),outboundName:L.string().optional(),specificationId:L.string().optional(),specificationName:L.string().optional(),mode:L.enum(["fully_automatic","semi_automatic","assisted"]).default("assisted"),autoApprovalRate:L.number().min(0).max(100).optional(),rejectResubmitMethod:L.enum(["node_default","to_ebot","from_start"]).optional(),autoApproveNodeNames:L.array(L.string()).optional(),apiKey:L.string().min(1),apiSecret:L.string().min(1),apiOrigin:L.string().default("production"),customApiUrl:L.string().optional()}).passthrough(),l10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),qp1=L.object({total:L.number(),dedupeBy:L.string(),unique:L.number(),byStatus:L.record(L.string(),L.number()),bySourceSystem:L.record(L.string(),L.number())}).passthrough()});import{randomBytes as s10}from"node:crypto";async function N1($,Y){let U=await $.json();return Y.parse(U.data??U)}async function Z8($){return N1(await $.get("api/v1/auth/me"),F10)}async function t10($){return N1(await $.get("api/auth/get-session"),w10)}async function W6($){return N1(await $.get("api/v1/rules"),M10)}async function kH($,Y){return N1(await $.post("api/v1/rules",{json:Y}),OM)}async function Dg($,Y,U){return N1(await $.put(`api/v1/rules/${Y}`,{json:U}),OM)}async function eI($,Y){await $.delete(`api/v1/rules/${Y}`)}async function jM($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),U=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:U})}async function p8($){return N1(await $.get("api/v1/rule-set-versions"),L.array(NM))}async function k7($,Y){return N1(await $.get(`api/v1/rule-set-versions/${Y}`),NM)}async function xH($,Y){return N1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),O10)}async function mY($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??20)),U.set("sortBy",Y.sortBy??"createdAt"),U.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((z,I)=>{U.set(`filter[scenarios][${I}]`,z)}),N1(await $.get("api/v1/knowledge/articles",{searchParams:U}),N10)}async function e10($,Y){return N1(await $.get(`api/v1/knowledge/articles/${Y}`),SH)}async function EM($,Y){return N1(await $.post("api/v1/knowledge/articles",{json:{...Y,contentType:Y.contentType??"policy",status:Y.status??"published",enabled:Y.enabled??!0,scenarios:Y.scenarios&&Y.scenarios.length>0?Y.scenarios:["audit"],tags:Y.tags??[]}}),SH)}async function CM($,Y,U){let z=Object.fromEntries(Object.entries(U).filter(([,I])=>I!==void 0));return N1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:z}}),SH)}async function RM($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function r1($,Y="api/v1/agent/ai-approval/config"){return N1(await $.get(Y),D10)}async function t5($,Y,U="api/v1/agent/ai-approval/config"){return await $.post(U,{json:Y}),r1($,U)}async function Ag($,Y,U="api/v1/agent/ai-approval/config"){let z=await $.post(U,{json:Y}),I=await z.json().catch(()=>({})),Q=TM.safeParse(I.data??I);return Q.success?Q.data.success??z.ok:z.ok}async function K$($,Y="api/v1/agent/ai-approval/config"){let U=await r1($,Y);return Bg(U.integrations)}async function _M($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=Bg(I.integrations),J=J40(Y,Q,U);if(!await Ag($,{...I,integrations:[...I.integrations,J]},z))throw Error("Seal did not confirm saving the Webhook integration");return J}async function $40($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=Bg(I.integrations),J=J40(Y,Q,U);return{before:I,after:{...I,integrations:[...I.integrations,J]},integration:J}}async function Y40($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=vM(I.integrations),J=hM(Q,Y),K=K40(J.integration,U);if(!await Ag($,{...I,integrations:I.integrations.map((H,W)=>W===J.index?K:H)},z))throw Error("Seal did not confirm saving the Webhook integration");return K}async function U40($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=vM(I.integrations),J=hM(Q,Y),K=K40(J.integration,U);return{before:I,after:{...I,integrations:I.integrations.map((G,H)=>H===J.index?K:G)},integration:K}}async function z40($,Y,U="api/v1/agent/ai-approval/config"){let z=await r1($,U),I=vM(z.integrations),Q=hM(I,Y);if(!await Ag($,{...z,integrations:z.integrations.filter((K,G)=>G!==Q.index)},U))throw Error("Seal did not confirm deleting the Webhook integration");return Q.integration}async function I40($,Y,U="api/v1/agent/ai-approval/config"){let z=await r1($,U),I=vM(z.integrations),Q=hM(I,Y);return{before:z,after:{...z,integrations:z.integrations.filter((J,K)=>K!==Q.index)},integration:Q.integration}}function x7($,Y){let U=Y.trim();if(!U)throw Error("Webhook selector must not be empty");let z=$.find((Q)=>Q.id===U);if(z)return z;let I=$.filter((Q)=>Q.name===U);if(I.length===1)return I[0];if(I.length>1)throw Error(`Multiple Webhook integrations match name: ${U}. Use the integration ID.`);throw Error(`Webhook integration not found: ${U}`)}function Q40($,Y){let U=Y?.trim().toLowerCase();if(!U)return $;return $.filter((z)=>[z.id,z.name,z.mode,z.outgoingResultWebhook,z.incomingDocumentWebhook.url,z.incomingManualResultWebhook.url].some((I)=>I.toLowerCase().includes(U)))}function Bg($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>gH.parse(Y))}function vM($){return $.flatMap((Y,U)=>{if(Y.type!=="webhook")return[];return[{index:U,integration:gH.parse(Y)}]})}function hM($,Y){let U=x7($.map((z)=>z.integration),Y);return $.find((z)=>z.integration.id===U.id)}function J40($,Y,U){let z=yH(U.name,"name"),I=U.mode??"assisted",Q=H40(U.outgoingResultWebhook,"outgoingResultWebhook"),J=W40(U.autoApprovalRate??60),K=xn0(Y),G=`wh_${K}_${s10(8).toString("hex").slice(0,7)}`,H=j$($);return gH.parse({type:"webhook",id:`integration-${K}`,name:z,mode:I,incomingDocumentWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/document`},outgoingResultWebhook:Q,incomingManualResultWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/manual-result`},secret:U.secret?yH(U.secret,"secret"):G40(),autoApprovalRate:J,materialPackFilePolicy:sI(U.materialPackFilePolicy)})}function K40($,Y){return gH.parse({...$,...Y.name===void 0?{}:{name:yH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:H40(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:W40(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?G40():yH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:V10($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function xn0($){let Y=new Set($.map((z)=>z.id)),U=Date.now();while(Y.has(`integration-${U}`))U+=1;return U}function G40(){return s10(16).toString("hex")}function yH($,Y){let U=$.trim();if(!U)throw Error(`Webhook ${Y} must not be empty`);return U}function H40($,Y){let U=yH($,Y);try{return new URL(U).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function W40($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function SM($,Y={}){let[U,z,I]=await Promise.all([W6($),mY($,{limit:Y.documentLimit??50}),r1($,Y.stylePreferencesEndpoint).then((Q)=>({ok:!0,data:Q}),(Q)=>({ok:!1,error:Q instanceof Error?Q.message:String(Q)}))]);return{rules:U,documents:z,stylePreferences:I}}async function i4($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??50)),n8(U,"fromTimestamp",Y.fromTimestamp),n8(U,"toTimestamp",Y.toTimestamp),n8(U,"startDate",Y.startDate),n8(U,"endDate",Y.endDate),o10(U,"status",Y.status),n8(U,"sourceSystem",Y.sourceSystem),n8(U,"taskMode",Y.taskMode),n8(U,"search",Y.search),n8(U,"sourceDocumentSN",Y.sourceDocumentSN),n8(U,"sourceDocumentId",Y.sourceDocumentId),o10(U,"manualApprovalStatus",Y.manualApprovalStatus),N1(await $.get("api/v1/approvals",{searchParams:U}),Vg)}async function H4($,Y){return N1(await $.get(`api/v1/approvals/${Y}`),DM)}async function Pg($,Y){let U=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),z=U.data??U;if(Array.isArray(z))return L.array(DM).parse(z);return Vg.parse(z).records}async function X40($,Y){return N1(await $.post("api/v1/simulation/create-batch",{json:Y}),Mg)}async function Z40($,Y){return N1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),Mg)}async function q40($,Y={}){let U=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),z=U.data??U;return L.array(wg).parse(z)}async function gM($,Y){return N1(await $.get(`api/v1/simulation/batch/${Y}`),wg)}async function V40($){let Y=await $.get("api/v1/simulation/templates").json(),U=Y.data??Y;return L.array(n10).parse(U)}async function Tg($){return N1(await $.get("api/v1/simulation/integration-status"),p10)}async function jg($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),U=Y.data??Y;return L.array(d10).parse(U)}async function L40($,Y){let z=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return z.data??z}async function F40($,Y){let U=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",z=Y?new URLSearchParams({signKey:Y}):void 0,I=await $.get(U,{searchParams:z}).json(),Q=I.data??I;return L.array(l10).parse(Q)}async function w40($,Y){let U=await $.post("api/hosecloud/corporation",{json:Y}).json(),z=U.data??U;return L.object({corporationId:L.string()}).parse(z)}async function M40($,Y){let z=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return z.data??z}async function O40($,Y){let U=new FormData;return U.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),N1(await $.post("api/v1/material-packages/upload",{body:U}),m10)}function n8($,Y,U){if(U)$.set(Y,U)}function o10($,Y,U){if(!U)return;(Array.isArray(U)?U:[U]).map((I)=>I.trim()).filter(Boolean).forEach((I,Q)=>{$.set(`${Y}[${Q}]`,I)})}async function N40($){return N1(await $.get("api/v1/delegation/list"),L.array(A10))}async function tI($,Y){return N1(await $.post("api/v1/delegation/create",{json:Y??{}}),B10)}async function D40($,Y){let U=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),z=await U.json(),I=TM.safeParse(z.data??z);return I.success?I.data.success??U.ok:U.ok}async function A40($,Y){let U=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!U){let z=await $.get("api/v1/contacts/departments/root/children").json(),I=yn0.safeParse(z.data??z),Q=I.success?I.data.items?.[0]?._id:void 0;if(Q)U=[Q]}return N1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:U??[]}}),P10)}async function Eg($,Y){return N1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),T10)}async function BM($,Y){return N1(await $.get(`api/v1/contacts/users/${Y}`),AM)}async function PM($,Y=""){return N1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),j10)}async function B40($){return N1(await $.get("api/v1/contacts/departments/root/children"),Fg)}async function P40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),Lg)}async function T40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),Fg)}async function j40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),E10)}async function E40($){return N1(await $.get("api/v1/contacts/last-sync-time"),C10)}async function yM($,Y={}){let U=Cg(),z=new URLSearchParams;if(n8(z,"startDate",Y.startDate??U.startDate),n8(z,"endDate",Y.endDate??U.endDate),Y.limit!==void 0)z.set("limit",String(Y.limit));return N1(await $.get("api/v1/insight/stats",{searchParams:z}),R10)}async function kM($,Y){let U=Cg(),z=new URLSearchParams;return z.set("tagId",Y.tagId),z.set("startDate",Y.startDate??U.startDate),z.set("endDate",Y.endDate??U.endDate),N1(await $.get("api/v1/insight/risks-by-tag",{searchParams:z}),_10)}async function xM($,Y={}){let U=Cg(),z=r10(Y.startDate??U.startDate),I=r10(Y.endDate??U.endDate),Q=new URLSearchParams;return Q.set("startDate",String(z)),Q.set("endDate",String(I)),N1(await $.get("api/v1/insight/performance",{searchParams:Q}),v10)}async function C40($,Y){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(Y)}`),{success:!0,recordId:Y}}function r10($){if(typeof $==="number")return $<100000000000?$*1000:$;let Y=Number($);if(!isNaN(Y)&&$.trim()!=="")return Y<100000000000?Y*1000:Y;let U=new Date($);if(isNaN(U.getTime()))throw Error(`Invalid date format: ${$}`);return U.getTime()}function Cg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),U=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:U.toISOString()}}function R40($){let Y=new URLSearchParams;return n8(Y,"filter[startDate]",$.startDate),n8(Y,"filter[endDate]",$.endDate),n8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function _40($,Y={}){return N1(await $.get("api/v1/expenses/list",{searchParams:R40(Y)}),S10)}async function v40($,Y={}){return N1(await $.get("api/v1/invoice/list",{searchParams:R40(Y)}),g10)}async function h40($){return N1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(y10))}async function S40($,Y){let U=await $.delete(`api/v1/contacts/local/users/${Y}`),z=await U.json(),I=TM.safeParse(z.data??z);return I.success?I.data.success??U.ok:U.ok}async function Rg($,Y){let U=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),z=await U.json(),I=TM.safeParse(z.data??z);return I.success?I.data.success??U.ok:U.ok}async function fn0($,Y){let U=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),z=U.headers.get("set-auth-token"),I=kn0.parse(await U.json()),Q=z??I.session?.token;if(!Q)throw Error("Failed to retrieve authentication token from login response");return{token:Q,user:I.user}}async function g40($,Y,U,z){let I;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await PM($,Y.userIdOrPhone),V=q.users.find((w)=>w.mobile?.includes(Y.userIdOrPhone)||w._id===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${Y.userIdOrPhone}`);I=V}else I=await BM($,Y.userIdOrPhone).catch(async()=>{let q=await PM($,Y.userIdOrPhone),V=q.users.find((w)=>w.name===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${Y.userIdOrPhone}`);return V});if(I.status==="resigned")await Rg($,I._id),I=await BM($,I._id);let Q=I,J=Array.isArray(Q.identities)&&Q.identities.some((q)=>q.provider&&q.provider!=="local")||!!Q.apps?.hosecloud;if(J&&z&&z.source.type==="hose"){let V=(I.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,""),w=Q.identities?.find((F)=>F.provider==="hosecloud")?.providerId,M=Q.apps?.hosecloud?.boundId||w||(V?`${z.source.corpId}:${V}`:void 0);if(M){let F=await oI(z),O=(await VM({...z.source,staffId:M},F)).token,D=y7(z,z.source),P=A6(z.seal),T=B6(D,void 0,P),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:O,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${I.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let j=A.token??A.accessToken??A.data?.token;if(j){let C=await U(j),b=await tI(C,{note:Y.note??`Delegation generated by admin for ${I.name}`});return{targetUser:I,delegation:b,temporaryPassword:"N/A (Hose SSO)"}}}}let K;try{K=await Eg($,I._id)}catch(q){if(J)throw Error(`用户 "${I.name}" (${I.mobile||I._id}) 为合思同步账号 (provider: hosecloud),无 Seal 本地密码。`+"Seal 系统暂不支持对同步账号直接重置本地密码。");throw q}let H=(I.mobile||I.identities?.[0]?.providerId||"").replace(/^\+86/,"");if(!H)throw Error(`User ${I.name} has no associated phone number for password login`);let{token:W}=await fn0($,{phone:H,password:K.password}),X=await U(W),Z=await tI(X,{note:Y.note??`Delegation generated by admin for ${I.name}`});return{targetUser:I,delegation:Z,temporaryPassword:K.password}}async function y40($){return N1(await $.get("api/v1/llm/config"),k10)}async function k40($){return N1(await $.get("api/v1/llm/providers"),L.array(x10))}async function x40($){return N1(await $.get("api/v1/permissions/available"),f10)}async function f40($){return N1(await $.get("api/v1/permissions/configs"),u10)}async function lY($){return N1(await $.get("api/v1/billing/status"),b10)}async function u40($){let U=await(await $.get("api/v1/billing/plans")).json();return a10.parse(U.data??U)}async function b40($){let U=await(await $.get("api/v1/billing/features")).json();return a10.parse(U.data??U)}var TM,yn0,kn0,a10;var X6=m(()=>{mI();T$();aI();E$();m6();Ng();TM=L.object({success:L.boolean().optional()}).passthrough(),yn0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),kn0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),a10=L.json()});var $6=E((Vd1,c40)=>{var{toString:i40}=Object.prototype,un0=/["&<>]/,I3={each:function(Y,U){if(Y)if(Array.isArray(Y))Y.forEach(U);else Object.keys(Y).forEach((z)=>{U(Y[z],z)})},some:function(Y,U){if(Y){if(Array.isArray(Y))return Y.some(U);return Object.keys(Y).some((z)=>U(Y[z],z))}return!1},every:function(Y,U){if(Y){if(Array.isArray(Y))return Y.every(U);return Object.keys(Y).every((z)=>U(Y[z],z))}return!0},map:function(Y,U){if(Y){if(Array.isArray(Y))return Y.map(U);return Object.keys(Y).map((z)=>U(Y[z],z))}return[]},keyBy($,Y){return $.reduce((U,z)=>{return U[z[Y]]=z,U},{})},isEqual:function(Y,U){let z=typeof Y,I=typeof U,Q=Array.isArray(Y),J=Array.isArray(U),K;if(z!==I)return!1;switch(typeof Y){case"object":if(Q||J){if(Q&&J)return Y.length===U.length&&Y.every((G,H)=>{let W=U[H];return I3.isEqual(G,W)});return!1}if(Y===null||U===null)return Y===U;if(K=Object.keys(Y),Object.keys(U).length!==K.length)return!1;for(let G of K)if(!U.hasOwnProperty(G))return!1;return I3.every(Y,(G,H)=>{let W=U[H];return I3.isEqual(G,W)});default:return Y===U}},escapeHtml($){let Y=un0.exec($);if(!Y)return $;let U="",z="",I=0,Q=Y.index;for(;Q<$.length;Q++){switch($.charAt(Q)){case'"':z=""";break;case"&":z="&";break;case"'":z="'";break;case"<":z="<";break;case">":z=">";break;default:continue}if(I!==Q)U+=$.substring(I,Q);I=Q+1,U+=z}if(I!==Q)return U+$.substring(I,Q);return U},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return i40.call($)==="[object Undefined]"},isObject($){return i40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,U,z,I;function Q(J,K){if(U=$[K],I=Array.isArray(J),I3.isObject(J)||I){if(I)I=!1,z=U&&Array.isArray(U)?U:[];else z=U&&I3.isObject(U)?U:{};$[K]=I3.deepMerge(z,J)}else if(!I3.isUndefined(J))$[K]=J}for(let J=0;J{var bn0=/^[A-Z]+\d+$/,fH={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level($){if($<=26)return 1;if($<=676)return 2;return 3},_fill($){let Y,U,z,I,Q,J=1;if($>=4)throw Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&$>=1){while(J<=26)Y=this._dictionary[J-1],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=1}if(this._l2nFill<2&&$>=2){J=27;while(J<=702)U=J-27,z=U%26,I=Math.floor(U/26),Y=this._dictionary[I]+this._dictionary[z],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){J=703;while(J<=16384)U=J-703,z=U%26,I=Math.floor(U/26)%26,Q=Math.floor(U/676),Y=this._dictionary[Q]+this._dictionary[I]+this._dictionary[z],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=3}},l2n($){if(!this._l2n[$])this._fill($.length);if(!this._l2n[$])throw Error(`Out of bounds. Invalid column letter: ${$}`);return this._l2n[$]},n2l($){if($<1||$>16384)throw Error(`${$} is out of bounds. Excel supports columns from 1 to 16384`);if(!this._n2l[$])this._fill(this._level($));return this._n2l[$]},_hash:{},validateAddress($){if(!bn0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let U=!1,z="",I=0,Q=!1,J="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!Q&&W>=65&&W<=90)U=!0,z+=$[H],I=I*26+W-64;else if(W>=48&&W<=57)Q=!0,J+=$[H],K=K*10+W-48;else if(Q&&U&&W!==36)break;if(!U)I=void 0;else if(I>16384)throw Error(`Out of bounds. Invalid column letter: ${z}`);if(!Q)K=void 0;$=z+J;let G={address:$,col:I,row:K,$col$row:`$${z}$${J}`};if(I<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let U=this.n2l(Y)+$;return this.decodeAddress(U)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let U=this.decodeAddress(Y[0]),z=this.decodeAddress(Y[1]),I={top:Math.min(U.row,z.row),left:Math.min(U.col,z.col),bottom:Math.max(U.row,z.row),right:Math.max(U.col,z.col)};return I.tl=this.n2l(I.left)+I.top,I.br=this.n2l(I.right)+I.bottom,I.dimensions=`${I.tl}:${I.br}`,I}return this.decodeAddress($)},decodeEx($){let Y=$.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),U=Y[1]||Y[2],z=Y[3],I=z.split(":");if(I.length>1){let J=this.decodeAddress(I[0]),K=this.decodeAddress(I[1]),G=Math.min(J.row,K.row),H=Math.min(J.col,K.col),W=Math.max(J.row,K.row),X=Math.max(J.col,K.col);return J=this.n2l(H)+G,K=this.n2l(X)+W,{top:G,left:H,bottom:W,right:X,sheetName:U,tl:{address:J,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:U},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:U},dimensions:`${J}:${K}`}}if(z.startsWith("#"))return U?{sheetName:U,error:z}:{error:z};let Q=this.decodeAddress(z);return U?{sheetName:U,...Q}:Q},encodeAddress($,Y){return fH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return fH.encodeAddress(arguments[0],arguments[1]);case 4:return`${fH.encodeAddress(arguments[0],arguments[1])}:${fH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[U,z,,I,Q]=$,[J,K]=Y;return J>=U&&J<=I&&K>=z&&K<=Q}};n40.exports=fH});var Q3=E((Fd1,p40)=>{var e5=c4();class _g{constructor(){this.decode(arguments)}setTLBR($,Y,U,z,I){if(arguments.length<4){let Q=e5.decodeAddress($),J=e5.decodeAddress(Y);this.model={top:Math.min(Q.row,J.row),left:Math.min(Q.col,J.col),bottom:Math.max(Q.row,J.row),right:Math.max(Q.col,J.col),sheetName:U},this.setTLBR(Q.row,Q.col,J.row,J.col,I)}else this.model={top:Math.min($,U),left:Math.min(Y,z),bottom:Math.max($,U),right:Math.max(Y,z),sheetName:I}}decode($){switch($.length){case 5:this.setTLBR($[0],$[1],$[2],$[3],$[4]);break;case 4:this.setTLBR($[0],$[1],$[2],$[3]);break;case 3:this.setTLBR($[0],$[1],$[2]);break;case 2:this.setTLBR($[0],$[1]);break;case 1:{let Y=$[0];if(Y instanceof _g)this.model={top:Y.model.top,left:Y.model.left,bottom:Y.model.bottom,right:Y.model.right,sheetName:Y.sheetName};else if(Y instanceof Array)this.decode(Y);else if(Y.top&&Y.left&&Y.bottom&&Y.right)this.model={top:Y.top,left:Y.left,bottom:Y.bottom,right:Y.right,sheetName:Y.sheetName};else{let U=e5.decodeEx(Y);if(U.top)this.model={top:U.top,left:U.left,bottom:U.bottom,right:U.right,sheetName:U.sheetName};else this.model={top:U.row,left:U.col,bottom:U.row,right:U.col,sheetName:U.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw Error(`Invalid number of arguments to _getDimensions() - ${$.length}`)}}get top(){return this.model.top||1}set top($){this.model.top=$}get left(){return this.model.left||1}set left($){this.model.left=$}get bottom(){return this.model.bottom||1}set bottom($){this.model.bottom=$}get right(){return this.model.right||1}set right($){this.model.right=$}get sheetName(){return this.model.sheetName}set sheetName($){this.model.sheetName=$}get _serialisedSheetName(){let{sheetName:$}=this.model;if($){if(/^[a-zA-Z0-9]*$/.test($))return`${$}!`;return`'${$}'!`}return""}expand($,Y,U,z){if(!this.model.top||$this.bottom)this.bottom=U;if(!this.model.right||z>this.right)this.right=z}expandRow($){if($){let{dimensions:Y,number:U}=$;if(Y)this.expand(U,Y.min,U,Y.max)}}expandToAddress($){let Y=e5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return e5.n2l(this.left)+this.top}get $t$l(){return`$${e5.n2l(this.left)}$${this.top}`}get br(){return e5.n2l(this.right)+this.bottom}get $b$r(){return`$${e5.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;if($.bottomthis.bottom)return!1;if($.rightthis.right)return!1;return!0}contains($){let Y=e5.decodeEx($);return this.containsEx(Y)}containsEx($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;return $.row>=this.top&&$.row<=this.bottom&&$.col>=this.left&&$.col<=this.right}forEachAddress($){for(let Y=this.left;Y<=this.right;Y++)for(let U=this.top;U<=this.bottom;U++)$(e5.encodeAddress(U,Y),U,Y)}}p40.exports=_g});var Z5=E((wd1,d40)=>{d40.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}});var l40=E((Md1,m40)=>{var fM=c4(),in0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,cn0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function nn0($,Y,U){let z=fM.decode(Y),I=fM.decode(U);return $.replace(in0,(Q,J,K,G,H)=>{if(H)return Q;let W=cn0.exec(G);if(W){let X=W[1],Z=W[2].toUpperCase(),q=W[3],V=W[4];if(Z.length>3||Z.length===3&&Z>"XFD")return Q;let w=fM.l2n(Z),M=parseInt(V,10);if(!X)w+=I.col-z.col;if(!q)M+=I.row-z.row;return(J||"")+(X||"")+fM.n2l(w)+(q||"")+M}return Q})}m40.exports={slideFormula:nn0}});var r40=E((Od1,o40)=>{var pn0=$6();class uH{constructor($){this.note=$}get model(){let $=null;switch(typeof this.note){case"string":$={type:"note",note:{texts:[{text:this.note}]}};break;default:$={type:"note",note:this.note};break}return pn0.deepMerge({},uH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:U}=Y;if(U.length===1&&Object.keys(U[0]).length===1)this.note=U[0].text;else this.note=Y}static fromModel($){let Y=new uH;return Y.model=$,Y}}uH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};o40.exports=uH});var W60=E((Nd1,H60)=>{var dn0=c4(),mn0=$6(),q5=Z5(),{slideFormula:ln0}=l40(),s40=r40();class p0{constructor($,Y,U){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,dn0.validateAddress(U),this._address=U,this._value=f7.create(p0.Types.Null,this),this.style=this._mergeStyle($.style,Y.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt($){this.style.numFmt=$}get font(){return this.style.font}set font($){this.style.font=$}get alignment(){return this.style.alignment}set alignment($){this.style.alignment=$}get border(){return this.style.border}set border($){this.style.border=$}get fill(){return this.style.fill}set fill($){this.style.fill=$}get protection(){return this.style.protection}set protection($){this.style.protection=$}_mergeStyle($,Y,U){let z=$&&$.numFmt||Y&&Y.numFmt;if(z)U.numFmt=z;let I=$&&$.font||Y&&Y.font;if(I)U.font=I;let Q=$&&$.alignment||Y&&Y.alignment;if(Q)U.alignment=Q;let J=$&&$.border||Y&&Y.border;if(J)U.border=J;let K=$&&$.fill||Y&&Y.fill;if(K)U.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)U.protection=G;return U}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===p0.Types.Merge}merge($,Y){if(this._value.release(),this._value=f7.create(p0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===p0.Types.Merge)this._value.release(),this._value=f7.create(p0.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{})}isMergedTo($){if(this._value.type!==p0.Types.Merge)return!1;return this._value.isMergedTo($)}get master(){if(this.type===p0.Types.Merge)return this._value.master;return this}get isHyperlink(){return this._value.type===p0.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value($){if(this.type===p0.Types.Merge){this._value.master.value=$;return}this._value.release(),this._value=f7.create(f7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new s40($)}get text(){return this._value.toString()}get html(){return mn0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===p0.Types.String)this._value=f7.create(p0.Types.Hyperlink,this,{text:this._value.value,hyperlink:$})}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){let{worksheet:$}=this._row;return{sheetName:$.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name($){this.names=[$]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names($){let{definedNames:Y}=this.workbook;Y.removeAllNames(this.fullAddress),$.forEach((U)=>{Y.addEx(this.fullAddress,U)})}addName($){this.workbook.definedNames.addEx(this.fullAddress,$)}removeName($){this.workbook.definedNames.removeEx(this.fullAddress,$)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation($){this._dataValidations.add(this.address,$)}get model(){let{model:$}=this._value;if($.style=this.style,this._comment)$.comment=this._comment.model;return $}set model($){if(this._value.release(),this._value=f7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=s40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}p0.Types=q5.ValueType;class a40{constructor($){this.model={address:$.address,type:p0.Types.Null}}get value(){return null}set value($){}get type(){return p0.Types.Null}get effectiveType(){return p0.Types.Null}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){}toString(){return""}}class t40{constructor($,Y){this.model={address:$.address,type:p0.Types.Number,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Number}get effectiveType(){return p0.Types.Number}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class e40{constructor($,Y){this.model={address:$.address,type:p0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.String}get effectiveType(){return p0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}class $60{constructor($,Y){this.model={address:$.address,type:p0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}toString(){return this.model.value.richText.map(($)=>$.text).join("")}get type(){return p0.Types.RichText}get effectiveType(){return p0.Types.RichText}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}class Y60{constructor($,Y){this.model={address:$.address,type:p0.Types.Date,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Date}get effectiveType(){return p0.Types.Date}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}class U60{constructor($,Y){if(this.model={address:$.address,type:p0.Types.Hyperlink,text:Y?Y.text:void 0,hyperlink:Y?Y.hyperlink:void 0},Y&&Y.tooltip)this.model.tooltip=Y.tooltip}get value(){let $={text:this.model.text,hyperlink:this.model.hyperlink};if(this.model.tooltip)$.tooltip=this.model.tooltip;return $}set value($){if(this.model={text:$.text,hyperlink:$.hyperlink},$.tooltip)this.model.tooltip=$.tooltip}get text(){return this.model.text}set text($){this.model.text=$}get hyperlink(){return this.model.hyperlink}set hyperlink($){this.model.hyperlink=$}get type(){return p0.Types.Hyperlink}get effectiveType(){return p0.Types.Hyperlink}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}class z60{constructor($,Y){if(this.model={address:$.address,type:p0.Types.Merge,master:Y?Y.address:void 0},this._master=Y,Y)Y.addMergeRef()}get value(){return this._master.value}set value($){if($ instanceof p0){if(this._master)this._master.releaseMergeRef();$.addMergeRef(),this._master=$}else this._master.value=$}isMergedTo($){return $===this._master}get master(){return this._master}get type(){return p0.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}class I60{constructor($,Y){this.cell=$,this.model={address:$.address,type:p0.Types.Formula,shareType:Y?Y.shareType:void 0,ref:Y?Y.ref:void 0,formula:Y?Y.formula:void 0,sharedFormula:Y?Y.sharedFormula:void 0,result:Y?Y.result:void 0}}_copyModel($){let Y={},U=(z)=>{let I=$[z];if(I)Y[z]=I};return U("formula"),U("result"),U("ref"),U("shareType"),U("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(f7.getType($)){case p0.Types.Null:case p0.Types.String:case p0.Types.Number:case p0.Types.Date:break;case p0.Types.Hyperlink:case p0.Types.Formula:default:throw Error("Cannot process that type of result value")}}get dependencies(){let $=this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),Y=this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g);return{ranges:$,cells:Y}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula($){this.model.formula=$}get formulaType(){if(this.model.formula)return q5.FormulaType.Master;if(this.model.sharedFormula)return q5.FormulaType.Shared;return q5.FormulaType.None}get result(){return this.model.result}set result($){this.model.result=$}get type(){return p0.Types.Formula}get effectiveType(){let $=this.model.result;if($===null||$===void 0)return q5.ValueType.Null;if($ instanceof String||typeof $==="string")return q5.ValueType.String;if(typeof $==="number")return q5.ValueType.Number;if($ instanceof Date)return q5.ValueType.Date;if($.text&&$.hyperlink)return q5.ValueType.Hyperlink;if($.formula)return q5.ValueType.Formula;return q5.ValueType.Null}get address(){return this.model.address}set address($){this.model.address=$}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:$}=this.cell,Y=$.findCell(this.model.sharedFormula);this._translatedFormula=Y&&ln0(Y.formula,Y.address,this.model.address)}return this._translatedFormula}toCsvString(){return`${this.model.result||""}`}release(){}toString(){return this.model.result?this.model.result.toString():""}}class Q60{constructor($,Y){this.model={address:$.address,type:p0.Types.SharedString,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.SharedString}get effectiveType(){return p0.Types.SharedString}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class J60{constructor($,Y){this.model={address:$.address,type:p0.Types.Boolean,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Boolean}get effectiveType(){return p0.Types.Boolean}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}class K60{constructor($,Y){this.model={address:$.address,type:p0.Types.Error,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Error}get effectiveType(){return p0.Types.Error}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}class G60{constructor($,Y){this.model={address:$.address,type:p0.Types.String,value:JSON.stringify(Y),rawValue:Y}}get value(){return this.model.rawValue}set value($){this.model.rawValue=$,this.model.value=JSON.stringify($)}get type(){return p0.Types.String}get effectiveType(){return p0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}var f7={getType($){if($===null||$===void 0)return p0.Types.Null;if($ instanceof String||typeof $==="string")return p0.Types.String;if(typeof $==="number")return p0.Types.Number;if(typeof $==="boolean")return p0.Types.Boolean;if($ instanceof Date)return p0.Types.Date;if($.text&&$.hyperlink)return p0.Types.Hyperlink;if($.formula||$.sharedFormula)return p0.Types.Formula;if($.richText)return p0.Types.RichText;if($.sharedString)return p0.Types.SharedString;if($.error)return p0.Types.Error;return p0.Types.JSON},types:[{t:p0.Types.Null,f:a40},{t:p0.Types.Number,f:t40},{t:p0.Types.String,f:e40},{t:p0.Types.Date,f:Y60},{t:p0.Types.Hyperlink,f:U60},{t:p0.Types.Formula,f:I60},{t:p0.Types.Merge,f:z60},{t:p0.Types.JSON,f:G60},{t:p0.Types.SharedString,f:Q60},{t:p0.Types.RichText,f:$60},{t:p0.Types.Boolean,f:J60},{t:p0.Types.Error,f:K60}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,U){let z=this.types[$];if(!z)throw Error(`Could not create Value of type ${$}`);return new z(Y,U)}};H60.exports=p0});var bM=E((Dd1,q60)=>{var on0=$6(),uM=Z5(),oY=c4(),X60=W60();class Z60{constructor($,Y){this._worksheet=$,this._number=Y,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell($){return this._cells[$-1]}getCellEx($){let Y=this._cells[$.col-1];if(!Y){let U=this._worksheet.getColumn($.col);Y=new X60(this,U,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=oY.l2n($)}return this._cells[$-1]||this.getCellEx({address:oY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...U){let z=$+Y,I=U.length-Y,Q=this._cells.length,J,K,G;if(I<0){for(J=$+U.length;J<=Q;J++)if(G=this._cells[J-1],K=this._cells[J-I-1],K)G=this.getCell(J),G.value=K.value,G.style=K.style,G._comment=K._comment;else if(G)G.value=null,G.style={},G._comment=void 0}else if(I>0)for(J=Q;J>=z;J--)if(K=this._cells[J-1],K)G=this.getCell(J+I),G.value=K.value,G.style=K.style,G._comment=K._comment;else this._cells[J+I-1]=void 0;for(J=0;J{if(U&&U.type!==uM.ValueType.Null)Y(U,z+1)})}addPageBreak($,Y){let U=this._worksheet,z=Math.max(0,$-1)||0,I=Math.max(0,Y-1)||16838,Q={id:this._number,max:I,man:1};if(z)Q.min=z;U.rowBreaks.push(Q)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==uM.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((U,z)=>{if(U!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,z+Y),row:this._number,col:z+Y}).value=U})}else this._worksheet.eachColumnKey((Y,U)=>{if($[U]!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[U]})}get hasValues(){return on0.some(this._cells,($)=>$&&$.type!==uM.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let $=0;return this.eachCell(()=>{$++}),$}get dimensions(){let $=0,Y=0;return this._cells.forEach((U)=>{if(U&&U.type!==uM.ValueType.Null){if(!$||$>U.col)$=U.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((U)=>{if(U)U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){let $=[],Y=0,U=0;return this._cells.forEach((z)=>{if(z){let I=z.model;if(I){if(!Y||Y>z.col)Y=z.col;if(U{switch(U.type){case X60.Types.Merge:break;default:{let z;if(U.address)z=oY.decodeAddress(U.address);else if(Y){let{row:Q}=Y,J=Y.col+1;z={row:Q,col:J,address:oY.encodeAddress(Q,J),$col$row:`$${oY.n2l(J)}$${Q}`}}Y=z;let I=this.getCellEx(z);I.model=U;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}q60.exports=Z60});var cM=E((Ad1,V60)=>{var rn0=$6(),sn0=Z5(),an0=c4();class iM{constructor($,Y,U){if(this._worksheet=$,this._number=Y,U!==!1)this.defn=U}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return an0.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn($){if($){if(this.key=$.key,this.width=$.width!==void 0?$.width:9,this.outlineLevel=$.outlineLevel,$.style)this.style=$.style;else this.style={};this.header=$.header,this._hidden=!!$.hidden}else delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header($){if($!==void 0)this._header=$,this.headers.forEach((Y,U)=>{this._worksheet.getCell(U+1,this.number).value=Y});else this._header=void 0}get key(){return this._key}set key($){if((this._key&&this._worksheet.getColumnKey(this._key))===this)this._worksheet.deleteColumnKey(this._key);if(this._key=$,$)this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo($){return this.width===$.width&&this.hidden===$.hidden&&this.outlineLevel===$.outlineLevel&&rn0.isEqual(this.style,$.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;let $=this.style;if($&&($.font||$.numFmt||$.alignment||$.border||$.fill||$.protection))return!1;return!0}get headerCount(){return this.headers.length}eachCell($,Y){let U=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(z,I)=>{Y(z.getCell(U),I)})}get values(){let $=[];return this.eachCell((Y,U)=>{if(Y&&Y.type!==sn0.ValueType.Null)$[U]=Y.value}),$}set values($){if(!$)return;let Y=this.number,U=0;if($.hasOwnProperty("0"))U=1;$.forEach((z,I)=>{this._worksheet.getCell(I+U,Y).value=z})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((U)=>{U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}static toModel($){let Y=[],U=null;if($)$.forEach((z,I)=>{if(z.isDefault){if(U)U=null}else if(!U||!z.equivalentTo(U))U={min:I+1,max:I+1,width:z.width!==void 0?z.width:9,style:z.style,isCustomWidth:z.isCustomWidth,hidden:z.hidden,outlineLevel:z.outlineLevel,collapsed:z.collapsed},Y.push(U);else U.max=I+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let U=[],z=1,I=0;Y=Y.sort(function(Q,J){return Q.min-J.min});while(I{var tn0=c4();class nM{constructor($,Y,U=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let z=tn0.decodeAddress(Y);this.nativeCol=z.col+U,this.nativeColOff=0,this.nativeRow=z.row+U,this.nativeRowOff=0}else if(Y.nativeCol!==void 0)this.nativeCol=Y.nativeCol||0,this.nativeColOff=Y.nativeColOff||0,this.nativeRow=Y.nativeRow||0,this.nativeRowOff=Y.nativeRowOff||0;else if(Y.col!==void 0)this.col=Y.col+U,this.row=Y.row+U;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof nM||$==null?$:new nM($)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col($){this.nativeCol=Math.floor($),this.nativeColOff=Math.floor(($-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row($){this.nativeRow=Math.floor($),this.nativeRowOff=Math.floor(($-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(this.worksheet.getColumn(this.nativeCol+1).width*1e4):640000}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(this.worksheet.getRow(this.nativeRow+1).height*1e4):180000}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model($){this.nativeCol=$.nativeCol,this.nativeColOff=$.nativeColOff,this.nativeRow=$.nativeRow,this.nativeRowOff=$.nativeRowOff}}L60.exports=nM});var O60=E((Pd1,M60)=>{var en0=c4(),pM=F60();class w60{constructor($,Y){this.worksheet=$,this.model=Y}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw Error("Invalid Image Type")}}set model({type:$,imageId:Y,range:U,hyperlinks:z}){if(this.type=$,this.imageId=Y,$==="image")if(typeof U==="string"){let I=en0.decode(U);this.range={tl:new pM(this.worksheet,{col:I.left,row:I.top},-1),br:new pM(this.worksheet,{col:I.right,row:I.bottom},0),editAs:"oneCell"}}else this.range={tl:new pM(this.worksheet,U.tl,0),br:U.br&&new pM(this.worksheet,U.br,0),ext:U.ext,editAs:U.editAs,hyperlinks:z||U.hyperlinks}}}M60.exports=w60});var B60=E((Td1,A60)=>{var dM=c4();class N60{constructor($,Y,U){this.table=$,this.column=Y,this.index=U}_set($,Y){this.table.cacheState(),this.column[$]=Y}get name(){return this.column.name}set name($){this._set("name",$)}get filterButton(){return this.column.filterButton}set filterButton($){this.column.filterButton=$}get style(){return this.column.style}set style($){this.column.style=$}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel($){this._set("totalsRowLabel",$)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction($){this._set("totalsRowFunction",$)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult($){this._set("totalsRowResult",$)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula($){this._set("totalsRowFormula",$)}}class D60{constructor($,Y){if(this.worksheet=$,Y)this.table=Y,this.validate(),this.store()}getFormula($){switch($.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${$.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${$.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${$.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${$.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${$.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${$.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${$.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${$.name}])`;case"custom":return $.totalsRowFormula;default:throw Error(`Invalid Totals Row Function: ${$.totalsRowFunction}`)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){let{table:$}=this,Y=(G,H,W)=>{if(G[H]===void 0)G[H]=W};Y($,"headerRow",!0),Y($,"totalsRow",!1),Y($,"style",{}),Y($.style,"theme","TableStyleMedium2"),Y($.style,"showFirstColumn",!1),Y($.style,"showLastColumn",!1),Y($.style,"showRowStripes",!1),Y($.style,"showColumnStripes",!1);let U=(G,H)=>{if(!G)throw Error(H)};U($.ref,"Table must have ref"),U($.columns,"Table must have column definitions"),U($.rows,"Table must have row definitions"),$.tl=dM.decodeAddress($.ref);let{row:z,col:I}=$.tl;U(z>0,"Table must be on valid row"),U(I>0,"Table must be on valid col");let{width:Q,filterHeight:J,tableHeight:K}=this;$.autoFilterRef=dM.encode(z,I,z+J-1,I+Q-1),$.tableRef=dM.encode(z,I,z+K-1,I+Q-1),$.columns.forEach((G,H)=>{if(U(G.name,`Column ${H} must have a name`),H===0)Y(G,"totalsRowLabel","Total");else Y(G,"totalsRowFunction","none"),G.totalsRowFormula=this.getFormula(G)})}store(){let $=(J,K)=>{if(K)Object.keys(K).forEach((G)=>{J[G]=K[G]})},{worksheet:Y,table:U}=this,{row:z,col:I}=U.tl,Q=0;if(U.headerRow){let J=Y.getRow(z+Q++);U.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=J.getCell(I+G);X.value=W,$(X,H)})}if(U.rows.forEach((J)=>{let K=Y.getRow(z+Q++);J.forEach((G,H)=>{let W=K.getCell(I+H);W.value=G,$(W,U.columns[H].style)})}),U.totalsRow){let J=Y.getRow(z+Q++);U.columns.forEach((K,G)=>{let H=J.getCell(I+G);if(G===0)H.value=K.totalsRowLabel;else if(this.getFormula(K))H.value={formula:K.totalsRowFormula,result:K.totalsRowResult};else H.value=null;$(H,K.style)})}}load($){let{table:Y}=this,{row:U,col:z}=Y.tl,I=0;if(Y.headerRow){let Q=$.getRow(U+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(z+K);G.value=J.name})}if(Y.rows.forEach((Q)=>{let J=$.getRow(U+I++);Q.forEach((K,G)=>{let H=J.getCell(z+G);H.value=K})}),Y.totalsRow){let Q=$.getRow(U+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(z+K);if(K===0)G.value=J.totalsRowLabel;else if(this.getFormula(J))G.value={formula:J.totalsRowFormula,result:J.totalsRowResult}})}}get model(){return this.table}set model($){this.table=$}cacheState(){if(!this._cache)this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let $=dM.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{z.push(Y[I])});else this.table.columns.splice(U,0,$),this.table.rows.forEach((z,I)=>{z.splice(U,0,Y[I])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((U)=>{U.splice($,Y)})}_assign($,Y,U){this.cacheState(),$[Y]=U}get ref(){return this.table.ref}set ref($){this._assign(this.table,"ref",$)}get name(){return this.table.name}set name($){this.table.name=$}get displayName(){return this.table.displyName||this.table.name}set displayNamename($){this.table.displayName=$}get headerRow(){return this.table.headerRow}set headerRow($){this._assign(this.table,"headerRow",$)}get totalsRow(){return this.table.totalsRow}set totalsRow($){this._assign(this.table,"totalsRow",$)}get theme(){return this.table.style.name}set theme($){this.table.style.name=$}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn($){this.table.style.showFirstColumn=$}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn($){this.table.style.showLastColumn=$}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes($){this.table.style.showRowStripes=$}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes($){this.table.style.showColumnStripes=$}}A60.exports=D60});var vg=E((jd1,T60)=>{class P60{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}T60.exports=P60});var Sg=E((Ed1,j60)=>{var hg=J0("crypto"),$p0={hash($,...Y){let U=hg.createHash($);return U.update(Buffer.concat(Y)),U.digest()},convertPasswordToHash($,Y,U,z){if(Y=Y.toLowerCase(),hg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let Q=Buffer.from($,"utf16le"),J=this.hash(Y,Buffer.from(U,"base64"),Q);for(let K=0;K{var E60=($,Y)=>({...$,...Y.reduce((U,z)=>{if($[z])U[z]={...$[z]};return U},{})}),$9=($,Y,U,z=[])=>{if($[U])Y[U]=E60($[U],z)},Yp0=($)=>Object.keys($).length===0,Up0=($)=>{if(!$)return $;if(Yp0($))return{};let Y={...$};if($9($,Y,"font",["color"]),$9($,Y,"alignment"),$9($,Y,"protection"),$.border)$9($,Y,"border"),$9($.border,Y.border,"top",["color"]),$9($.border,Y.border,"left",["color"]),$9($.border,Y.border,"bottom",["color"]),$9($.border,Y.border,"right",["color"]),$9($.border,Y.border,"diagonal",["color"]);if($.fill){if($9($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((U)=>E60(U,["color"]))}return Y};zp0.copyStyle=Up0});var k60=E((Rd1,y60)=>{var bH=$6(),iH=c4(),cH=Q3(),R60=bM(),mM=cM(),Qp0=Z5(),gg=O60(),_60=B60(),v60=vg(),h60=Sg(),{copyStyle:S60}=C60();class g60{constructor($){$=$||{},this._workbook=$.workbook,this.id=$.id,this.orderNo=$.orderNo,this.name=$.name,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),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,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.dataValidations=new v60,this.views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name($){if($===void 0)$=`sheet${this.id}`;if(this._name===$)return;if(typeof $!=="string")throw Error("The name has to be a string.");if($==="")throw Error("The name can't be empty.");if($==="History")throw Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test($))throw Error(`Worksheet name ${$} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test($))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${$}`);if($&&$.length>31)console.warn(`Worksheet name ${$} exceeds 31 chars. This will be truncated`),$=$.substring(0,31);if(this._workbook._worksheets.find((Y)=>Y&&Y.name.toLowerCase()===$.toLowerCase()))throw Error(`Worksheet name already exists: ${$}`);this._name=$}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let $=new cH;return this._rows.forEach((Y)=>{if(Y){let U=Y.dimensions;if(U)$.expand(Y.number,U.min,Y.number,U.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((z,I)=>{let Q=I.header&&1||I.headers&&I.headers.length||0;return Math.max(z,Q)},0);let Y=1,U=this._columns=[];$.forEach((z)=>{let I=new mM(this,Y++,!1);U.push(I),I.defn=z})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){bH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=iH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new mM(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...U){let I=this._rows.length;if(U.length>0)for(let G=0;G{H.push(X[G]||null)});let W=this.getRow(G+1);W.splice.apply(W,H)}else this._rows.forEach((G)=>{if(G)G.splice($,Y)});let Q=U.length-Y,J=$+Y,K=this._columns.length;if(Q<0)for(let G=$+U.length;G<=K;G++)this.getColumn(G).defn=this.getColumn(G-Q).defn;else if(Q>0)for(let G=K;G>=J;G--)this.getColumn(G+Q).defn=this.getColumn(G).defn;for(let G=$;G<$+U.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,U.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let $=0;return this.eachRow((Y)=>{$=Math.max($,Y.cellCount)}),$}get actualColumnCount(){let $=[],Y=0;return this.eachRow((U)=>{U.eachCell(({col:z})=>{if(!$[z])$[z]=!0,Y++})}),Y}_commitRow(){}get _lastRowNumber(){let $=this._rows,Y=$.length;while(Y>0&&$[Y-1]===void 0)Y--;return Y}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1];return}findRow($){return this._rows[$-1]}findRows($,Y){return this._rows.slice($-1,$-1+Y)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let $=0;return this.eachRow(()=>{$++}),$}getRow($){let Y=this._rows[$-1];if(!Y)Y=this._rows[$-1]=new R60(this,$);return Y}getRows($,Y){if(Y<1)return;let U=[];for(let z=$;z<$+Y;z++)U.push(this.getRow(z));return U}addRow($,Y="n"){let U=this._nextRow,z=this.getRow(U);return z.values=$,this._setStyleOption(U,Y[0]==="i"?Y:"n"),z}addRows($,Y="n"){let U=[];return $.forEach((z)=>{U.push(this.addRow(z,Y))}),U}insertRow($,Y,U="n"){return this.spliceRows($,0,Y),this._setStyleOption($,U),this.getRow($)}insertRows($,Y,U="n"){if(this.spliceRows($,0,...Y),U!=="n"){for(let z=0;z{I.getCell(J).style=S60(Q.style)}),I.height=z.height}duplicateRow($,Y,U=!1){let z=this._rows[$-1],I=Array(Y).fill(z.values);this.spliceRows($+1,U?0:Y,...I);for(let Q=0;Q{J.getCell(G).style=K.style})}}spliceRows($,Y,...U){let z=$+Y,I=U.length,Q=I-Y,J=this._rows.length,K,G;if(Q<0){if($===J)this._rows[J-1]=void 0;for(K=z;K<=J;K++)if(G=this._rows[K-1],G){let H=this.getRow(K+Q);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{H.getCell(X).style=W.style}),this._rows[K-1]=void 0}else this._rows[K+Q-1]=void 0}else if(Q>0)for(K=J;K>=z;K--)if(G=this._rows[K-1],G){let H=this.getRow(K+Q);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{if(H.getCell(X).style=W.style,W._value.constructor.name==="MergeValue"){let Z=this.getRow(W._row._number+I).getCell(X),q=W._value._master,V=this.getRow(q._row._number+I).getCell(q._column._number);Z.merge(V)}})}else this._rows[K+Q-1]=void 0;for(K=0;K{if(U&&U.hasValues)Y(U,U.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let U=iH.getAddress($,Y),z=this._rows[U.row-1];return z?z.findCell(U.col):void 0}getCell($,Y){let U=iH.getAddress($,Y);return this.getRow(U.row).getCellEx(U)}mergeCells(...$){let Y=new cH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new cH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){bH.each(this._merges,(z)=>{if(z.intersects($))throw Error("Cannot merge already merged cells")});let U=this.getCell($.top,$.left);for(let z=$.top;z<=$.bottom;z++)for(let I=$.left;I<=$.right;I++)if(z>$.top||I>$.left)this.getCell(z,I).merge(U,Y);this._merges[U.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++)this.getCell(U,z).unmerge();delete this._merges[$.address]}}get hasMerges(){return bH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new cH($);for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++){let I=this.findCell(U,z);if(I){if(I.type===Qp0.ValueType.Merge)this._unMergeMaster(I.master);else if(this._merges[I.address])this._unMergeMaster(I)}}}fillFormula($,Y,U,z="shared"){let I=iH.decode($),{top:Q,left:J,bottom:K,right:G}=I,H=G-J+1,W=iH.encodeAddress(Q,J),X=z==="shared",Z;if(typeof U==="function")Z=U;else if(Array.isArray(U))if(Array.isArray(U[0]))Z=(V,w)=>U[V-Q][w-J];else Z=(V,w)=>U[(V-Q)*H+(w-J)];else Z=()=>{return};let q=!0;for(let V=Q;V<=K;V++)for(let w=J;w<=G;w++)if(q)this.getCell(V,w).value={shareType:z,formula:Y,ref:$,result:Z(V,w)},q=!1;else this.getCell(V,w).value=X?{sharedFormula:W,result:Z(V,w)}:Z(V,w)}addImage($,Y){let U={type:"image",imageId:$,range:Y};this._media.push(new gg(this,U))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new gg(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((U)=>{if(this.sheetProtection={sheet:!0},Y&&"spinCount"in Y)Y.spinCount=Number.isFinite(Y.spinCount)?Math.round(Math.max(0,Y.spinCount)):1e5;if($)this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=h60.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=h60.convertPasswordToHash($,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount);if(Y){if(this.sheetProtection=Object.assign(this.sheetProtection,Y),!$&&"spinCount"in Y)delete this.sheetProtection.spinCount}U()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new _60(this,$);return this.tables[$.name]=Y,Y}getTable($){return this.tables[$]}removeTable($){delete this.tables[$]}getTables(){return Object.values(this.tables)}addConditionalFormatting($){this.conditionalFormattings.push($)}removeConditionalFormatting($){if(typeof $==="number")this.conditionalFormattings.splice($,1);else if($ instanceof Function)this.conditionalFormattings=this.conditionalFormattings.filter($);else this.conditionalFormattings=[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor($){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=$}get model(){let $={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((z)=>z.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((z)=>z.model),conditionalFormattings:this.conditionalFormattings};$.cols=mM.toModel(this.columns);let Y=$.rows=[],U=$.dimensions=new cH;return this._rows.forEach((z)=>{let I=z&&z.model;if(I)U.expand(I.number,I.min,I.number,I.max),Y.push(I)}),$.merges=[],bH.each(this._merges,(z)=>{$.merges.push(z.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let U=new R60(this,Y.number);this._rows[U.number-1]=U,U.model=Y})}_parseMergeCells($){bH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=mM.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new v60($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new gg(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,U)=>{let z=new _60;return z.model=U,Y[U.name]=z,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}y60.exports=g60});var b60=E((_d1,u60)=>{var x60=$6(),lM=c4();class f60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(lM.decodeEx($))}getCell($){return this.findCellEx(lM.decodeEx($),!0)}findCell($){return this.findCellEx(lM.decodeEx($),!1)}findCellAt($,Y,U){let z=this.sheets[$],I=z&&z[Y];return I&&I[U]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let U=$.left;U<=$.right;U++)this.getCellAt($.sheetName,Y,U);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let U=this.findSheet($,Y),z=this.findSheetRow(U,$,Y);return this.findRowCell(z,$,Y)}getCellAt($,Y,U){let z=this.sheets[$]||(this.sheets[$]=[]),I=z[Y]||(z[Y]=[]);return I[U]||(I[U]={sheetName:$,address:lM.n2l(U)+Y,row:Y,col:U})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let U=this.findSheetRow(Y,$);if(!U)return;delete U[$.col]}forEachInSheet($,Y){let U=this.sheets[$];if(U)U.forEach((z,I)=>{if(z)z.forEach((Q,J)=>{if(Q)Y(Q,I,J)})})}forEach($){x60.each(this.sheets,(Y,U)=>{this.forEachInSheet(U,$)})}map($){let Y=[];return this.forEach((U)=>{Y.push($(U))}),Y}findSheet($,Y){let U=$.sheetName;if(this.sheets[U])return this.sheets[U];if(Y)return this.sheets[U]=[];return}findSheetRow($,Y,U){let{row:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=[];return}findRowCell($,Y,U){let{col:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,U,z){let I=this.sheets[$];if(I){let Q=[];for(let J=0;J{J.splice(Y,U,...Q)})}}}u60.exports=f60});var yg=E((vd1,n60)=>{var $Q=$6(),nH=c4(),i60=b60(),Jp0=Q3(),Kp0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class c60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new i60)}add($,Y){let U=nH.decodeEx($);this.addEx(U,Y)}addEx($,Y){let U=this.getMatrix(Y);if($.top)for(let z=$.left;z<=$.right;z++)for(let I=$.top;I<=$.bottom;I++){let Q={sheetName:$.sheetName,address:nH.n2l(z)+I,row:I,col:z};U.addCellEx(Q)}else U.addCellEx($)}remove($,Y){let U=nH.decodeEx($);this.removeEx(U,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){$Q.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){$Q.each(this.matrixMap,(Y,U)=>{Y.forEach((z)=>{$(U,z)})})}getNames($){return this.getNamesEx(nH.decodeEx($))}getNamesEx($){return $Q.map(this.matrixMap,(Y,U)=>Y.findCellEx($)&&U).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:U}=Y,z=new Jp0(Y.row,Y.col,Y.row,Y.col,U),I,Q;function J(G,H){let W=$.findCellAt(U,G,Y.col);if(!W||!W.mark)return!1;return z[H]=G,W.mark=!1,!0}for(Q=Y.row-1;J(Q,"top");Q--);for(Q=Y.row+1;J(Q,"bottom");Q++);function K(G,H){let W=[];for(Q=z.top;Q<=z.bottom;Q++){let X=$.findCellAt(U,Q,G);if(X&&X.mark)W.push(X);else return!1}z[H]=G;for(let X=0;X{z.mark=!0});let U=Y.map((z)=>z.mark&&this._explore(Y,z)).filter(Boolean).map((z)=>z.$shortRange);return{name:$,ranges:U}}normaliseMatrix($,Y){$.forEachInSheet(Y,(U,z,I)=>{if(U){if(U.row!==z||U.col!==I)U.row=z,U.col=I,U.address=nH.n2l(I)+z}})}spliceRows($,Y,U,z){$Q.each(this.matrixMap,(I)=>{I.spliceRows($,Y,U,z),this.normaliseMatrix(I,$)})}spliceColumns($,Y,U,z){$Q.each(this.matrixMap,(I)=>{I.spliceColumns($,Y,U,z),this.normaliseMatrix(I,$)})}get model(){return $Q.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((U)=>{let z=Y[U.name]=new i60;U.ranges.forEach((I)=>{if(Kp0.test(I.split("!").pop()||""))z.addCell(I)})})}}n60.exports=c60});var Q6=E((hd1,kg)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)kg.exports={nextTick:Gp0};else kg.exports=process;function Gp0($,Y,U,z){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var I=arguments.length,Q,J;switch(I){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,Y)});case 3:return process.nextTick(function(){$.call(null,Y,U)});case 4:return process.nextTick(function(){$.call(null,Y,U,z)});default:Q=Array(I-1),J=0;while(J{var Hp0={}.toString;p60.exports=Array.isArray||function($){return Hp0.call($)=="[object Array]"}});var J6=E((xg,m60)=>{var oM=J0("buffer"),J3=oM.Buffer;function d60($,Y){for(var U in $)Y[U]=$[U]}if(J3.from&&J3.alloc&&J3.allocUnsafe&&J3.allocUnsafeSlow)m60.exports=oM;else d60(oM,xg),xg.Buffer=UQ;function UQ($,Y,U){return J3($,Y,U)}d60(J3,UQ);UQ.from=function($,Y,U){if(typeof $==="number")throw TypeError("Argument must not be a number");return J3($,Y,U)};UQ.alloc=function($,Y,U){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=J3($);if(Y!==void 0)if(typeof U==="string")z.fill(Y,U);else z.fill(Y);else z.fill(0);return z};UQ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return J3($)};UQ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return oM.SlowBuffer($)}});var N4=E((Pp0)=>{function Wp0($){if(Array.isArray)return Array.isArray($);return rM($)==="[object Array]"}Pp0.isArray=Wp0;function Xp0($){return typeof $==="boolean"}Pp0.isBoolean=Xp0;function Zp0($){return $===null}Pp0.isNull=Zp0;function qp0($){return $==null}Pp0.isNullOrUndefined=qp0;function Vp0($){return typeof $==="number"}Pp0.isNumber=Vp0;function Lp0($){return typeof $==="string"}Pp0.isString=Lp0;function Fp0($){return typeof $==="symbol"}Pp0.isSymbol=Fp0;function wp0($){return $===void 0}Pp0.isUndefined=wp0;function Mp0($){return rM($)==="[object RegExp]"}Pp0.isRegExp=Mp0;function Op0($){return typeof $==="object"&&$!==null}Pp0.isObject=Op0;function Np0($){return rM($)==="[object Date]"}Pp0.isDate=Np0;function Dp0($){return rM($)==="[object Error]"||$ instanceof Error}Pp0.isError=Dp0;function Ap0($){return typeof $==="function"}Pp0.isFunction=Ap0;function Bp0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}Pp0.isPrimitive=Bp0;Pp0.isBuffer=J0("buffer").Buffer.isBuffer;function rM($){return Object.prototype.toString.call($)}});var l60=E((yd1,fg)=>{if(typeof Object.create==="function")fg.exports=function(Y,U){if(U)Y.super_=U,Y.prototype=Object.create(U.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else fg.exports=function(Y,U){if(U){Y.super_=U;var z=function(){};z.prototype=U.prototype,Y.prototype=new z,Y.prototype.constructor=Y}}});var W1=E((kd1,ug)=>{try{if(sM=J0("util"),typeof sM.inherits!=="function")throw"";ug.exports=sM.inherits}catch($){ug.exports=l60()}var sM});var r60=E((xd1,bg)=>{function bp0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var o60=J6().Buffer,pH=J0("util");function ip0($,Y,U){$.copy(Y,U)}bg.exports=function(){function $(){bp0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(U){var z={data:U,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(U){var z={data:U,next:this.head};if(this.length===0)this.tail=z;this.head=z,++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 z=this.head,I=""+z.data;while(z=z.next)I+=U+z.data;return I},$.prototype.concat=function(U){if(this.length===0)return o60.alloc(0);var z=o60.allocUnsafe(U>>>0),I=this.head,Q=0;while(I)ip0(I.data,z,Q),Q+=I.data.length,I=I.next;return z},$}();if(pH&&pH.inspect&&pH.inspect.custom)bg.exports.prototype[pH.inspect.custom]=function(){var $=pH.inspect({length:this.length});return this.constructor.name+" "+$}});var ig=E((fd1,s60)=>{var aM=Q6();function cp0($,Y){var U=this,z=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(z||I){if(Y)Y($);else if($){if(!this._writableState)aM.nextTick(tM,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,aM.nextTick(tM,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Q){if(!Y&&Q){if(!U._writableState)aM.nextTick(tM,U,Q);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,aM.nextTick(tM,U,Q)}else if(Y)Y(Q)}),this}function np0(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function tM($,Y){$.emit("error",Y)}s60.exports={destroy:cp0,undestroy:np0}});var u7=E((ud1,a60)=>{a60.exports=J0("util").deprecate});var ng=E((bd1,Q80)=>{var rY=Q6();Q80.exports=Z6;function e60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){Kd0(Y,$)}}var pp0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:rY.nextTick,zQ;Z6.WritableState=mH;var $80=Object.create(N4());$80.inherits=W1();var dp0={deprecate:u7()},Y80=J0("stream"),$O=J6().Buffer,mp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function lp0($){return $O.from($)}function op0($){return $O.isBuffer($)||$ instanceof mp0}var U80=ig();$80.inherits(Z6,Y80);function rp0(){}function mH($,Y){zQ=zQ||sY(),$=$||{};var U=Y instanceof zQ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:z,writableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(I||I===0))this.highWaterMark=I;else this.highWaterMark=Q;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=$.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){Ud0(Y,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new e60(this)}mH.prototype.getBuffer=function(){var Y=this.bufferedRequest,U=[];while(Y)U.push(Y),Y=Y.next;return U};(function(){try{Object.defineProperty(mH.prototype,"buffer",{get:dp0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var eM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")eM=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(eM.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof mH}});else eM=function($){return $ instanceof this};function Z6($){if(zQ=zQ||sY(),!eM.call(Z6,this)&&!(this instanceof zQ))return new Z6($);if(this._writableState=new mH($,this),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}Y80.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function sp0($,Y){var U=Error("write after end");$.emit("error",U),rY.nextTick(Y,U)}function ap0($,Y,U,z){var I=!0,Q=!1;if(U===null)Q=TypeError("May not write null values to stream");else if(typeof U!=="string"&&U!==void 0&&!Y.objectMode)Q=TypeError("Invalid non-string/buffer chunk");if(Q)$.emit("error",Q),rY.nextTick(z,Q),I=!1;return I}Z6.prototype.write=function($,Y,U){var z=this._writableState,I=!1,Q=!z.objectMode&&op0($);if(Q&&!$O.isBuffer($))$=lp0($);if(typeof Y==="function")U=Y,Y=null;if(Q)Y="buffer";else if(!Y)Y=z.defaultEncoding;if(typeof U!=="function")U=rp0;if(z.ended)sp0(this,U);else if(Q||ap0(this,z,$,U))z.pendingcb++,I=ep0(this,z,Q,$,Y,U);return I};Z6.prototype.cork=function(){var $=this._writableState;$.corked++};Z6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)z80(this,$)}};Z6.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=Y.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+Y);return this._writableState.defaultEncoding=Y,this};function tp0($,Y,U){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=$O.from(Y,U);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ep0($,Y,U,z,I,Q){if(!U){var J=tp0(Y,z,I);if(z!==J)U=!0,I="buffer",z=J}var K=Y.objectMode?1:z.length;Y.length+=K;var G=Y.length{var J80=Q6(),Gd0=Object.keys||function($){var Y=[];for(var U in $)Y.push(U);return Y};H80.exports=K3;var K80=Object.create(N4());K80.inherits=W1();var G80=dg(),pg=ng();K80.inherits(K3,G80);{YO=Gd0(pg.prototype);for(lH=0;lH{var lg=J6().Buffer,W80=lg.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Xd0($){if(!$)return"utf8";var Y;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Y)return;$=(""+$).toLowerCase(),Y=!0}}function Zd0($){var Y=Xd0($);if(typeof Y!=="string"&&(lg.isEncoding===W80||!W80($)))throw Error("Unknown encoding: "+$);return Y||$}Pd0.StringDecoder=rH;function rH($){this.encoding=Zd0($);var Y;switch(this.encoding){case"utf16le":this.text=Md0,this.end=Od0,Y=4;break;case"utf8":this.fillLast=Ld0,Y=4;break;case"base64":this.text=Nd0,this.end=Dd0,Y=3;break;default:this.write=Ad0,this.end=Bd0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lg.allocUnsafe(Y)}rH.prototype.write=function($){if($.length===0)return"";var Y,U;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";U=this.lastNeed,this.lastNeed=0}else U=0;if(U<$.length)return Y?Y+this.text($,U):this.text($,U);return Y||""};rH.prototype.end=wd0;rH.prototype.text=Fd0;rH.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function mg($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function qd0($,Y,U){var z=Y.length-1;if(z=0){if(I>0)$.lastNeed=I-1;return I}if(--z=0){if(I>0)$.lastNeed=I-2;return I}if(--z=0){if(I>0)if(I===2)I=0;else $.lastNeed=I-3;return I}return 0}function Vd0($,Y,U){if((Y[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Y.length>1){if((Y[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Y.length>2){if((Y[2]&192)!==128)return $.lastNeed=2,"�"}}}function Ld0($){var Y=this.lastTotal-this.lastNeed,U=Vd0(this,$,Y);if(U!==void 0)return U;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Y,0,$.length),this.lastNeed-=$.length}function Fd0($,Y){var U=qd0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=U;var z=$.length-(U-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",Y,z)}function wd0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function Md0($,Y){if(($.length-Y)%2===0){var U=$.toString("utf16le",Y);if(U){var z=U.charCodeAt(U.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],U.slice(0,-1)}return U}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function Od0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var U=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,U)}return Y}function Nd0($,Y){var U=($.length-Y)%3;if(U===0)return $.toString("base64",Y);if(this.lastNeed=3-U,this.lastTotal=3,U===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-U)}function Dd0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Ad0($){return $.toString(this.encoding)}function Bd0($){return $&&$.length?this.write($):""}});var dg=E((pd1,A80)=>{var QQ=Q6();A80.exports=P4;var jd0=YQ(),sH;P4.ReadableState=w80;var nd1=J0("events").EventEmitter,V80=function($,Y){return $.listeners(Y).length},eg=J0("stream"),aH=J6().Buffer,Ed0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Cd0($){return aH.from($)}function Rd0($){return aH.isBuffer($)||$ instanceof Ed0}var L80=Object.create(N4());L80.inherits=W1();var rg=J0("util"),$4=void 0;if(rg&&rg.debuglog)$4=rg.debuglog("stream");else $4=function(){};var _d0=r60(),F80=ig(),IQ;L80.inherits(P4,eg);var sg=["error","close","destroy","pause","resume"];function vd0($,Y,U){if(typeof $.prependListener==="function")return $.prependListener(Y,U);if(!$._events||!$._events[Y])$.on(Y,U);else if(jd0($._events[Y]))$._events[Y].unshift(U);else $._events[Y]=[U,$._events[Y]]}function w80($,Y){sH=sH||sY(),$=$||{};var U=Y instanceof sH;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:z,readableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(I||I===0))this.highWaterMark=I;else this.highWaterMark=Q;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new _d0,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!IQ)IQ=og().StringDecoder;this.decoder=new IQ($.encoding),this.encoding=$.encoding}}function P4($){if(sH=sH||sY(),!(this instanceof P4))return new P4($);if(this._readableState=new w80($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}eg.call(this)}Object.defineProperty(P4.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});P4.prototype.destroy=F80.destroy;P4.prototype._undestroy=F80.undestroy;P4.prototype._destroy=function($,Y){this.push(null),Y($)};P4.prototype.push=function($,Y){var U=this._readableState,z;if(!U.objectMode){if(typeof $==="string"){if(Y=Y||U.defaultEncoding,Y!==U.encoding)$=aH.from($,Y),Y="";z=!0}}else z=!0;return M80(this,$,Y,!1,z)};P4.prototype.unshift=function($){return M80(this,$,null,!0,!1)};function M80($,Y,U,z,I){var Q=$._readableState;if(Y===null)Q.reading=!1,yd0($,Q);else{var J;if(!I)J=hd0(Q,Y);if(J)$.emit("error",J);else if(Q.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!Q.objectMode&&Object.getPrototypeOf(Y)!==aH.prototype)Y=Cd0(Y);if(z)if(Q.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else ag($,Q,Y,!0);else if(Q.ended)$.emit("error",Error("stream.push() after EOF"));else if(Q.reading=!1,Q.decoder&&!U)if(Y=Q.decoder.write(Y),Q.objectMode||Y.length!==0)ag($,Q,Y,!1);else O80($,Q);else ag($,Q,Y,!1)}else if(!z)Q.reading=!1}return Sd0(Q)}function ag($,Y,U,z){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",U),$.read(0);else{if(Y.length+=Y.objectMode?1:U.length,z)Y.buffer.unshift(U);else Y.buffer.push(U);if(Y.needReadable)UO($)}O80($,Y)}function hd0($,Y){var U;if(!Rd0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)U=TypeError("Invalid non-string/buffer chunk");return U}function Sd0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!IQ)IQ=og().StringDecoder;return this._readableState.decoder=new IQ($),this._readableState.encoding=$,this};var X80=8388608;function gd0($){if($>=X80)$=X80;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function Z80($,Y){if($<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if($!==$)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if($>Y.highWaterMark)Y.highWaterMark=gd0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}P4.prototype.read=function($){$4("read",$),$=parseInt($,10);var Y=this._readableState,U=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&(Y.length>=Y.highWaterMark||Y.ended)){if($4("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)tg(this);else UO(this);return null}if($=Z80($,Y),$===0&&Y.ended){if(Y.length===0)tg(this);return null}var z=Y.needReadable;if($4("need readable",z),Y.length===0||Y.length-$0)I=N80($,Y);else I=null;if(I===null)Y.needReadable=!0,$=0;else Y.length-=$;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(U!==$&&Y.ended)tg(this)}if(I!==null)this.emit("data",I);return I};function yd0($,Y){if(Y.ended)return;if(Y.decoder){var U=Y.decoder.end();if(U&&U.length)Y.buffer.push(U),Y.length+=Y.objectMode?1:U.length}Y.ended=!0,UO($)}function UO($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if($4("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)QQ.nextTick(q80,$);else q80($)}function q80($){$4("emit readable"),$.emit("readable"),$y($)}function O80($,Y){if(!Y.readingMore)Y.readingMore=!0,QQ.nextTick(kd0,$,Y)}function kd0($,Y){var U=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&D80(z.pipes,$)!==-1)&&!H)$4("false write response, pause",z.awaitDrain),z.awaitDrain++,X=!0;U.pause()}}function q(F){if($4("onerror",F),M(),$.removeListener("error",q),V80($,"error")===0)$.emit("error",F)}vd0($,"error",q);function V(){$.removeListener("finish",w),M()}$.once("close",V);function w(){$4("onfinish"),$.removeListener("close",V),M()}$.once("finish",w);function M(){$4("unpipe"),U.unpipe($)}if($.emit("pipe",U),!z.flowing)$4("pipe resume"),U.resume();return $};function xd0($){return function(){var Y=$._readableState;if($4("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&V80($,"data"))Y.flowing=!0,$y($)}}P4.prototype.unpipe=function($){var Y=this._readableState,U={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if($&&$!==Y.pipes)return this;if(!$)$=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,$)$.emit("unpipe",this,U);return this}if(!$){var{pipes:z,pipesCount:I}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Q=0;Q=Y.length){if(Y.decoder)U=Y.buffer.join("");else if(Y.buffer.length===1)U=Y.buffer.head.data;else U=Y.buffer.concat(Y.length);Y.buffer.clear()}else U=id0($,Y.buffer,Y.decoder);return U}function id0($,Y,U){var z;if($Q.length?Q.length:$;if(J===Q.length)I+=Q;else I+=Q.slice(0,$);if($-=J,$===0){if(J===Q.length)if(++z,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=Q.slice(J);break}++z}return Y.length-=z,I}function nd0($,Y){var U=aH.allocUnsafe($),z=Y.head,I=1;z.data.copy(U),$-=z.data.length;while(z=z.next){var Q=z.data,J=$>Q.length?Q.length:$;if(Q.copy(U,U.length-$,0,J),$-=J,$===0){if(J===Q.length)if(++I,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=Q.slice(J);break}++I}return Y.length-=I,U}function tg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,QQ.nextTick(pd0,Y,$)}function pd0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function D80($,Y){for(var U=0,z=$.length;U{T80.exports=G3;var zO=sY(),P80=Object.create(N4());P80.inherits=W1();P80.inherits(G3,zO);function dd0($,Y){var U=this._transformState;U.transforming=!1;var z=U.writecb;if(!z)return this.emit("error",Error("write callback called multiple times"));if(U.writechunk=null,U.writecb=null,Y!=null)this.push(Y);z($);var I=this._readableState;if(I.reading=!1,I.needReadable||I.length{C80.exports=tH;var j80=Yy(),E80=Object.create(N4());E80.inherits=W1();E80.inherits(tH,j80);function tH($){if(!(this instanceof tH))return new tH($);j80.call(this,$)}tH.prototype._transform=function($,Y,U){U(null,$)}});var Uy=E((l6,IO)=>{var Y9=J0("stream");if(process.env.READABLE_STREAM==="disable"&&Y9)IO.exports=Y9,l6=IO.exports=Y9.Readable,l6.Readable=Y9.Readable,l6.Writable=Y9.Writable,l6.Duplex=Y9.Duplex,l6.Transform=Y9.Transform,l6.PassThrough=Y9.PassThrough,l6.Stream=Y9;else l6=IO.exports=dg(),l6.Stream=Y9||l6,l6.Readable=l6,l6.Writable=ng(),l6.Duplex=sY(),l6.Transform=Yy(),l6.PassThrough=R80()});var H3=E((od0)=>{od0.base64=!0;od0.array=!0;od0.string=!0;od0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";od0.nodebuffer=typeof Buffer<"u";od0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")od0.blob=!1;else{QO=new ArrayBuffer(0);try{od0.blob=new Blob([QO],{type:"application/zip"}).size===0}catch($){try{Iy=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,JO=new Iy,JO.append(QO),od0.blob=JO.getBlob("application/zip").size===0}catch(Y){od0.blob=!1}}}var QO,Iy,JO;try{od0.nodestream=!!Uy().Readable}catch($){od0.nodestream=!1}});var Qy=E((zm0)=>{var Ym0=n4(),Um0=H3(),U9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";zm0.encode=function($){var Y=[],U,z,I,Q,J,K,G,H=0,W=$.length,X=W,Z=Ym0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)U=$.charCodeAt(H++),z=H>2,J=(U&3)<<4|z>>4,K=X>1?(z&15)<<2|I>>6:64,G=X>2?I&63:64,Y.push(U9.charAt(Q)+U9.charAt(J)+U9.charAt(K)+U9.charAt(G))}return Y.join("")};zm0.decode=function($){var Y,U,z,I,Q,J,K,G=0,H=0,W="data:";if($.substr(0,W.length)===W)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var X=$.length*3/4;if($.charAt($.length-1)===U9.charAt(64))X--;if($.charAt($.length-2)===U9.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(Um0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(I=U9.indexOf($.charAt(G++)),Q=U9.indexOf($.charAt(G++)),J=U9.indexOf($.charAt(G++)),K=U9.indexOf($.charAt(G++)),Y=I<<2|Q>>4,U=(Q&15)<<4|J>>2,z=(J&3)<<6|K,Z[H++]=Y,J!==64)Z[H++]=U;if(K!==64)Z[H++]=z}return Z}});var eH=E((rd1,_80)=>{_80.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,Y){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,Y);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,Y)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var Y=new Buffer($);return Y.fill(0),Y}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var S80=E((ad1,h80)=>{var sd1=global.MutationObserver||global.WebKitMutationObserver,v80;v80=function(){process.nextTick(Wm0)};var Jm0,Km0,Gm0,Hm0,Jy,$W=[];function Wm0(){Jy=!0;var $,Y,U=$W.length;while(U){Y=$W,$W=[],$=-1;while(++${var g80=S80();function KQ(){}var q8={},y80=["REJECTED"],Ky=["FULFILLED"],k80=["PENDING"];JQ=["UNHANDLED"];var JQ;u80.exports=b7;function b7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=k80,this.queue=[],this.outcome=void 0,this.handled=JQ,$!==KQ)x80(this,$)}b7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(U,z);function U(I){function Q(){return I}return Y.resolve($()).then(Q)}function z(I){function Q(){throw I}return Y.resolve($()).then(Q)}};b7.prototype.catch=function($){return this.then(null,$)};b7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===Ky||typeof Y!=="function"&&this.state===y80)return this;var U=new this.constructor(KQ);if(this.handled===JQ)this.handled=null;if(this.state!==k80){var z=this.state===Ky?$:Y;Gy(U,z,this.outcome)}else this.queue.push(new YW(U,$,Y));return U};function YW($,Y,U){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof U==="function")this.onRejected=U,this.callRejected=this.otherCallRejected}YW.prototype.callFulfilled=function($){q8.resolve(this.promise,$)};YW.prototype.otherCallFulfilled=function($){Gy(this.promise,this.onFulfilled,$)};YW.prototype.callRejected=function($){q8.reject(this.promise,$)};YW.prototype.otherCallRejected=function($){Gy(this.promise,this.onRejected,$)};function Gy($,Y,U){g80(function(){var z;try{z=Y(U)}catch(I){return q8.reject($,I)}if(z===$)q8.reject($,TypeError("Cannot resolve promise with itself"));else q8.resolve($,z)})}q8.resolve=function($,Y){var U=f80(Zm0,Y);if(U.status==="error")return q8.reject($,U.value);var z=U.value;if(z)x80($,z);else{$.state=Ky,$.outcome=Y;var I=-1,Q=$.queue.length;while(++I{var Hy=null;if(typeof Promise<"u")Hy=Promise;else Hy=b80();i80.exports={Promise:Hy}});var Wy=E((c80)=>{(function($,Y){if($.setImmediate)return;var U=1,z={},I=!1,Q=$.document,J;function K(N){if(typeof N!=="function")N=Function(""+N);var O=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?c80:global:self)});var n4=E((Om0)=>{var i7=H3(),wm0=Qy(),HQ=eH(),Xy=GQ();Wy();function Mm0($){var Y=null;if(i7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return GO($,Y)}Om0.newBlob=function($,Y){Om0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(I){try{var U=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,z=new U;return z.append($),z.getBlob(Y)}catch(Q){throw Error("Bug : can't construct the Blob.")}}};function UW($){return $}function GO($,Y){for(var U=0;U<$.length;++U)Y[U]=$.charCodeAt(U)&255;return Y}var KO={stringifyByChunk:function($,Y,U){var z=[],I=0,Q=$.length;if(Q<=U)return String.fromCharCode.apply(null,$);while(I1)try{return KO.stringifyByChunk($,U,Y)}catch(I){Y=Math.floor(Y/2)}return KO.stringifyByChar($)}Om0.applyFromCharCode=zW;function HO($,Y){for(var U=0;U<$.length;U++)Y[U]=$[U];return Y}var c7={};c7.string={string:UW,array:function($){return GO($,Array($.length))},arraybuffer:function($){return c7.string.uint8array($).buffer},uint8array:function($){return GO($,new Uint8Array($.length))},nodebuffer:function($){return GO($,HQ.allocBuffer($.length))}};c7.array={string:zW,array:UW,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return HQ.newBufferFrom($)}};c7.arraybuffer={string:function($){return zW(new Uint8Array($))},array:function($){return HO(new Uint8Array($),Array($.byteLength))},arraybuffer:UW,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return HQ.newBufferFrom(new Uint8Array($))}};c7.uint8array={string:zW,array:function($){return HO($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:UW,nodebuffer:function($){return HQ.newBufferFrom($)}};c7.nodebuffer={string:zW,array:function($){return HO($,Array($.length))},arraybuffer:function($){return c7.nodebuffer.uint8array($).buffer},uint8array:function($){return HO($,new Uint8Array($.length))},nodebuffer:UW};Om0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;Om0.checkSupport($);var U=Om0.getTypeOf(Y),z=c7[U][$](Y);return z};Om0.resolve=function($){var Y=$.split("/"),U=[];for(var z=0;z"u")$[U]=arguments[Y][U];return $};Om0.prepareContent=function($,Y,U,z,I){var Q=Xy.Promise.resolve(Y).then(function(J){var K=i7.blob&&(J instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(J))!==-1);if(K&&typeof FileReader<"u")return new Xy.Promise(function(G,H){var W=new FileReader;W.onload=function(X){G(X.target.result)},W.onerror=function(X){H(X.target.error)},W.readAsArrayBuffer(J)});else return J});return Q.then(function(J){var K=Om0.getTypeOf(J);if(!K)return Xy.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")J=Om0.transformTo("uint8array",J);else if(K==="string"){if(I)J=wm0.decode(J);else if(U){if(z!==!0)J=Mm0(J)}}return J})}});var G$=E((Um1,m80)=>{function d80($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}d80.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,Y){return this._listeners[$].push(Y),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,Y){if(this._listeners[$])for(var U=0;U "+$;else return $}};m80.exports=d80});var XQ=E((gm0)=>{var WQ=n4(),aY=H3(),_m0=eH(),WO=G$(),IW=Array(256);for(z9=0;z9<256;z9++)IW[z9]=z9>=252?6:z9>=248?5:z9>=240?4:z9>=224?3:z9>=192?2:1;var z9;IW[254]=IW[254]=1;var vm0=function($){var Y,U,z,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|U&63;else if(U<65536)Y[Q++]=224|U>>>12,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63;else Y[Q++]=240|U>>>18,Y[Q++]=128|U>>>12&63,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63}return Y},hm0=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+IW[$[U]]>Y?U:Y},Sm0=function($){var Y,U,z,I,Q=$.length,J=Array(Q*2);for(U=0,Y=0;Y4){J[U++]=65533,Y+=I-1;continue}z&=I===2?31:I===3?15:7;while(I>1&&Y1){J[U++]=65533;continue}if(z<65536)J[U++]=z;else z-=65536,J[U++]=55296|z>>10&1023,J[U++]=56320|z&1023}if(J.length!==U)if(J.subarray)J=J.subarray(0,U);else J.length=U;return WQ.applyFromCharCode(J)};gm0.utf8encode=function(Y){if(aY.nodebuffer)return _m0.newBufferFrom(Y,"utf-8");return vm0(Y)};gm0.utf8decode=function(Y){if(aY.nodebuffer)return WQ.transformTo("nodebuffer",Y).toString("utf-8");return Y=WQ.transformTo(aY.uint8array?"uint8array":"array",Y),Sm0(Y)};function XO(){WO.call(this,"utf-8 decode"),this.leftOver=null}WQ.inherits(XO,WO);XO.prototype.processChunk=function($){var Y=WQ.transformTo(aY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(aY.uint8array){var U=Y;Y=new Uint8Array(U.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(U,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var z=hm0(Y),I=Y;if(z!==Y.length)if(aY.uint8array)I=Y.subarray(0,z),this.leftOver=Y.subarray(z,Y.length);else I=Y.slice(0,z),this.leftOver=Y.slice(z,Y.length);this.push({data:gm0.utf8decode(I),meta:$.meta})};XO.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:gm0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};gm0.Utf8DecodeWorker=XO;function qy(){WO.call(this,"utf-8 encode")}WQ.inherits(qy,WO);qy.prototype.processChunk=function($){this.push({data:gm0.utf8encode($.data),meta:$.meta})};gm0.Utf8EncodeWorker=qy});var a80=E((Im1,s80)=>{var o80=G$(),r80=n4();function Ly($){o80.call(this,"ConvertWorker to "+$),this.destType=$}r80.inherits(Ly,o80);Ly.prototype.processChunk=function($){this.push({data:r80.transformTo(this.destType,$.data),meta:$.meta})};s80.exports=Ly});var $$0=E((Qm1,e80)=>{var t80=Uy().Readable,xm0=n4();xm0.inherits(Fy,t80);function Fy($,Y,U){t80.call(this,Y),this._helper=$;var z=this;$.on("data",function(I,Q){if(!z.push(I))z._helper.pause();if(U)U(Q)}).on("error",function(I){z.emit("error",I)}).on("end",function(){z.push(null)})}Fy.prototype._read=function(){this._helper.resume()};e80.exports=Fy});var wy=E((Jm1,z$0)=>{var tY=n4(),fm0=a80(),um0=G$(),bm0=Qy(),im0=H3(),cm0=GQ(),Y$0=null;if(im0.nodestream)try{Y$0=$$0()}catch($){}function nm0($,Y,U){switch($){case"blob":return tY.newBlob(tY.transformTo("arraybuffer",Y),U);case"base64":return bm0.encode(Y);default:return tY.transformTo($,Y)}}function pm0($,Y){var U,z=0,I=null,Q=0;for(U=0;U{mm0.base64=!1;mm0.binary=!1;mm0.dir=!1;mm0.createFolders=!0;mm0.date=null;mm0.compression=null;mm0.compressionOptions=null;mm0.comment=null;mm0.unixPermissions=null;mm0.dosPermissions=null});var Oy=E((Gm1,I$0)=>{var ZO=n4(),qO=G$(),zl0=16384;function ZQ($){qO.call(this,"DataWorker");var Y=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(U){if(Y.dataIsReady=!0,Y.data=U,Y.max=U&&U.length||0,Y.type=ZO.getTypeOf(U),!Y.isPaused)Y._tickAndRepeat()},function(U){Y.error(U)})}ZO.inherits(ZQ,qO);ZQ.prototype.cleanUp=function(){qO.prototype.cleanUp.call(this),this.data=null};ZQ.prototype.resume=function(){if(!qO.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,ZO.delay(this._tickAndRepeat,[],this);return!0};ZQ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)ZO.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};ZQ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=zl0,Y=null,U=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":Y=this.data.substring(this.index,U);break;case"uint8array":Y=this.data.subarray(this.index,U);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,U);break}return this.index=U,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};I$0.exports=ZQ});var VO=E((Hm1,J$0)=>{var Il0=n4();function Ql0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var Q$0=Ql0();function Jl0($,Y,U,z){var I=Q$0,Q=z+U;$=$^-1;for(var J=z;J>>8^I[($^Y[J])&255];return $^-1}function Kl0($,Y,U,z){var I=Q$0,Q=z+U;$=$^-1;for(var J=z;J>>8^I[($^Y.charCodeAt(J))&255];return $^-1}J$0.exports=function(Y,U){if(typeof Y>"u"||!Y.length)return 0;var z=Il0.getTypeOf(Y)!=="string";if(z)return Jl0(U|0,Y,Y.length,0);else return Kl0(U|0,Y,Y.length,0)}});var Dy=E((Wm1,G$0)=>{var K$0=G$(),Gl0=VO(),Hl0=n4();function Ny(){K$0.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Hl0.inherits(Ny,K$0);Ny.prototype.processChunk=function($){this.streamInfo.crc32=Gl0($.data,this.streamInfo.crc32||0),this.push($)};G$0.exports=Ny});var W$0=E((Xm1,H$0)=>{var Wl0=n4(),Ay=G$();function By($){Ay.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}Wl0.inherits(By,Ay);By.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}Ay.prototype.processChunk.call(this,$)};H$0.exports=By});var LO=E((Zm1,q$0)=>{var X$0=GQ(),Z$0=Oy(),Xl0=Dy(),Py=W$0();function Ty($,Y,U,z,I){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=U,this.compression=z,this.compressedContent=I}Ty.prototype={getContentWorker:function(){var $=new Z$0(X$0.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Py("data_length")),Y=this;return $.on("end",function(){if(this.streamInfo.data_length!==Y.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new Z$0(X$0.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};Ty.createWorkerFrom=function($,Y,U){return $.pipe(new Xl0).pipe(new Py("uncompressedSize")).pipe(Y.compressWorker(U)).pipe(new Py("compressedSize")).withStreamInfo("compression",Y)};q$0.exports=Ty});var w$0=E((qm1,F$0)=>{var Zl0=wy(),ql0=Oy(),jy=XQ(),Ey=LO(),V$0=G$(),Cy=function($,Y,U){this.name=$,this.dir=U.dir,this.date=U.date,this.comment=U.comment,this.unixPermissions=U.unixPermissions,this.dosPermissions=U.dosPermissions,this._data=Y,this._dataBinary=U.binary,this.options={compression:U.compression,compressionOptions:U.compressionOptions}};Cy.prototype={internalStream:function($){var Y=null,U="string";try{if(!$)throw Error("No output type specified.");U=$.toLowerCase();var z=U==="string"||U==="text";if(U==="binarystring"||U==="text")U="string";Y=this._decompressWorker();var I=!this._dataBinary;if(I&&!z)Y=Y.pipe(new jy.Utf8EncodeWorker);if(!I&&z)Y=Y.pipe(new jy.Utf8DecodeWorker)}catch(Q){Y=new V$0("error"),Y.error(Q)}return new Zl0(Y,U,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof Ey&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var U=this._decompressWorker();if(!this._dataBinary)U=U.pipe(new jy.Utf8EncodeWorker);return Ey.createWorkerFrom(U,$,Y)}},_decompressWorker:function(){if(this._data instanceof Ey)return this._data.getContentWorker();else if(this._data instanceof V$0)return this._data;else return new ql0(this._data)}};var L$0=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Vl0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(QW=0;QW{var Ml0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Ol0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}Ry.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var U=Y.shift();if(!U)continue;if(typeof U!=="object")throw TypeError(U+"must be non-object");for(var z in U)if(Ol0(U,z))$[z]=U[z]}return $};Ry.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var Nl0={arraySet:function($,Y,U,z,I){if(Y.subarray&&$.subarray){$.set(Y.subarray(U,U+z),I);return}for(var Q=0;Q{var Bl0=W3(),Pl0=4,O$0=0,N$0=1,Tl0=2;function VQ($){var Y=$.length;while(--Y>=0)$[Y]=0}var jl0=0,j$0=1,El0=2,Cl0=3,Rl0=258,xy=29,XW=256,KW=XW+1+xy,qQ=30,fy=19,E$0=2*KW+1,eY=15,vy=16,_l0=7,uy=256,C$0=16,R$0=17,_$0=18,yy=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],FO=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],vl0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v$0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],hl0=512,X3=Array((KW+2)*2);VQ(X3);var JW=Array(qQ*2);VQ(JW);var GW=Array(hl0);VQ(GW);var HW=Array(Rl0-Cl0+1);VQ(HW);var by=Array(xy);VQ(by);var wO=Array(qQ);VQ(wO);function hy($,Y,U,z,I){this.static_tree=$,this.extra_bits=Y,this.extra_base=U,this.elems=z,this.max_length=I,this.has_stree=$&&$.length}var h$0,S$0,g$0;function Sy($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function y$0($){return $<256?GW[$]:GW[256+($>>>7)]}function WW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function d8($,Y,U){if($.bi_valid>vy-U)$.bi_buf|=Y<<$.bi_valid&65535,WW($,$.bi_buf),$.bi_buf=Y>>vy-$.bi_valid,$.bi_valid+=U-vy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=U}function I9($,Y,U){d8($,U[Y*2],U[Y*2+1])}function k$0($,Y){var U=0;do U|=$&1,$>>>=1,U<<=1;while(--Y>0);return U>>>1}function Sl0($){if($.bi_valid===16)WW($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function gl0($,Y){var{dyn_tree:U,max_code:z}=Y,I=Y.stat_desc.static_tree,Q=Y.stat_desc.has_stree,J=Y.stat_desc.extra_bits,K=Y.stat_desc.extra_base,G=Y.stat_desc.max_length,H,W,X,Z,q,V,w=0;for(Z=0;Z<=eY;Z++)$.bl_count[Z]=0;U[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,w++;if(U[W*2+1]=Z,W>z)continue;if($.bl_count[Z]++,q=0,W>=K)q=J[W-K];if(V=U[W*2],$.opt_len+=V*(Z+q),Q)$.static_len+=V*(I[W*2+1]+q)}if(w===0)return;do{Z=G-1;while($.bl_count[Z]===0)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[G]--,w-=2}while(w>0);for(Z=G;Z!==0;Z--){W=$.bl_count[Z];while(W!==0){if(X=$.heap[--H],X>z)continue;if(U[X*2+1]!==Z)$.opt_len+=(Z-U[X*2+1])*U[X*2],U[X*2+1]=Z;W--}}}function x$0($,Y,U){var z=Array(eY+1),I=0,Q,J;for(Q=1;Q<=eY;Q++)z[Q]=I=I+U[Q-1]<<1;for(J=0;J<=Y;J++){var K=$[J*2+1];if(K===0)continue;$[J*2]=k$0(z[K]++,K)}}function yl0(){var $,Y,U,z,I,Q=Array(eY+1);U=0;for(z=0;z>=7;for(;z8)WW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function kl0($,Y,U,z){if(u$0($),z)WW($,U),WW($,~U);Bl0.arraySet($.pending_buf,$.window,Y,U,$.pending),$.pending+=U}function D$0($,Y,U,z){var I=Y*2,Q=U*2;return $[I]<$[Q]||$[I]===$[Q]&&z[Y]<=z[U]}function gy($,Y,U){var z=$.heap[U],I=U<<1;while(I<=$.heap_len){if(I<$.heap_len&&D$0(Y,$.heap[I+1],$.heap[I],$.depth))I++;if(D$0(Y,z,$.heap[I],$.depth))break;$.heap[U]=$.heap[I],U=I,I<<=1}$.heap[U]=z}function A$0($,Y,U){var z,I,Q=0,J,K;if($.last_lit!==0)do if(z=$.pending_buf[$.d_buf+Q*2]<<8|$.pending_buf[$.d_buf+Q*2+1],I=$.pending_buf[$.l_buf+Q],Q++,z===0)I9($,I,Y);else{if(J=HW[I],I9($,J+XW+1,Y),K=yy[J],K!==0)I-=by[J],d8($,I,K);if(z--,J=y$0(z),I9($,J,U),K=FO[J],K!==0)z-=wO[J],d8($,z,K)}while(Q<$.last_lit);I9($,uy,Y)}function ky($,Y){var U=Y.dyn_tree,z=Y.stat_desc.static_tree,I=Y.stat_desc.has_stree,Q=Y.stat_desc.elems,J,K,G=-1,H;$.heap_len=0,$.heap_max=E$0;for(J=0;J>1;J>=1;J--)gy($,U,J);H=Q;do J=$.heap[1],$.heap[1]=$.heap[$.heap_len--],gy($,U,1),K=$.heap[1],$.heap[--$.heap_max]=J,$.heap[--$.heap_max]=K,U[H*2]=U[J*2]+U[K*2],$.depth[H]=($.depth[J]>=$.depth[K]?$.depth[J]:$.depth[K])+1,U[J*2+1]=U[K*2+1]=H,$.heap[1]=H++,gy($,U,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],gl0($,Y),x$0(U,G,$.bl_count)}function B$0($,Y,U){var z,I=-1,Q,J=Y[1],K=0,G=7,H=4;if(J===0)G=138,H=3;Y[(U+1)*2+1]=65535;for(z=0;z<=U;z++){if(Q=J,J=Y[(z+1)*2+1],++K=3;Y--)if($.bl_tree[v$0[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function fl0($,Y,U,z){var I;d8($,Y-257,5),d8($,U-1,5),d8($,z-4,4);for(I=0;I>>=1)if(Y&1&&$.dyn_ltree[U*2]!==0)return O$0;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return N$0;for(U=32;U0){if($.strm.data_type===Tl0)$.strm.data_type=ul0($);if(ky($,$.l_desc),ky($,$.d_desc),J=xl0($),I=$.opt_len+3+7>>>3,Q=$.static_len+3+7>>>3,Q<=I)I=Q}else I=Q=U+5;if(U+4<=I&&Y!==-1)b$0($,Y,U,z);else if($.strategy===Pl0||Q===I)d8($,(j$0<<1)+(z?1:0),3),A$0($,X3,JW);else d8($,(El0<<1)+(z?1:0),3),fl0($,$.l_desc.max_code+1,$.d_desc.max_code+1,J+1),A$0($,$.dyn_ltree,$.dyn_dtree);if(f$0($),z)u$0($)}function nl0($,Y,U){if($.pending_buf[$.d_buf+$.last_lit*2]=Y>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=Y&255,$.pending_buf[$.l_buf+$.last_lit]=U&255,$.last_lit++,Y===0)$.dyn_ltree[U*2]++;else $.matches++,Y--,$.dyn_ltree[(HW[U]+XW+1)*2]++,$.dyn_dtree[y$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}pl0._tr_init=bl0;pl0._tr_stored_block=b$0;pl0._tr_flush_block=cl0;pl0._tr_tally=nl0;pl0._tr_align=il0});var iy=E((Fm1,c$0)=>{function sl0($,Y,U,z){var I=$&65535|0,Q=$>>>16&65535|0,J=0;while(U!==0){J=U>2000?2000:U,U-=J;do I=I+Y[z++]|0,Q=Q+I|0;while(--J);I%=65521,Q%=65521}return I|Q<<16|0}c$0.exports=sl0});var cy=E((wm1,n$0)=>{function al0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var tl0=al0();function el0($,Y,U,z){var I=tl0,Q=z+U;$^=-1;for(var J=z;J>>8^I[($^Y[J])&255];return $^-1}n$0.exports=el0});var MO=E((Mm1,p$0)=>{p$0.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var e$0=E((ho0)=>{var _8=W3(),R$=i$0(),o$0=iy(),n7=cy(),$o0=MO(),zU=0,Yo0=1,Uo0=3,o7=4,d$0=5,J9=0,m$0=1,_$=-2,zo0=-3,ny=-5,Io0=-1,Qo0=1,OO=2,Jo0=3,Ko0=4,Go0=0,Ho0=2,BO=8,Wo0=9,Xo0=15,Zo0=8,qo0=29,Vo0=256,dy=Vo0+1+qo0,Lo0=30,Fo0=19,wo0=2*dy+1,Mo0=15,f1=3,m7=258,V5=m7+f1+1,Oo0=32,PO=42,my=69,NO=73,DO=91,AO=103,$U=113,qW=666,P6=1,VW=2,YU=3,wQ=4,No0=3;function l7($,Y){return $.msg=$o0[Y],Y}function l$0($){return($<<1)-($>4?9:0)}function d7($){var Y=$.length;while(--Y>=0)$[Y]=0}function p7($){var Y=$.state,U=Y.pending;if(U>$.avail_out)U=$.avail_out;if(U===0)return;if(_8.arraySet($.output,Y.pending_buf,Y.pending_out,U,$.next_out),$.next_out+=U,Y.pending_out+=U,$.total_out+=U,$.avail_out-=U,Y.pending-=U,Y.pending===0)Y.pending_out=0}function o6($,Y){R$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,p7($.strm)}function s1($,Y){$.pending_buf[$.pending++]=Y}function ZW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function Do0($,Y,U,z){var I=$.avail_in;if(I>z)I=z;if(I===0)return 0;if($.avail_in-=I,_8.arraySet(Y,$.input,$.next_in,I,U),$.state.wrap===1)$.adler=o$0($.adler,Y,I,U);else if($.state.wrap===2)$.adler=n7($.adler,Y,I,U);return $.next_in+=I,$.total_in+=I,I}function r$0($,Y){var{max_chain_length:U,strstart:z}=$,I,Q,J=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-V5?$.strstart-($.w_size-V5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+m7,q=H[z+J-1],V=H[z+J];if($.prev_length>=$.good_match)U>>=2;if(K>$.lookahead)K=$.lookahead;do{if(I=Y,H[I+J]!==V||H[I+J-1]!==q||H[I]!==H[z]||H[++I]!==H[z+1])continue;z+=2,I++;do;while(H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&zJ){if($.match_start=Y,J=Q,Q>=K)break;q=H[z+J-1],V=H[z+J]}}while((Y=X[Y&W])>G&&--U!==0);if(J<=$.lookahead)return J;return $.lookahead}function UU($){var Y=$.w_size,U,z,I,Q,J;do{if(Q=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-V5)){_8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,z=$.hash_size,U=z;do I=$.head[--U],$.head[U]=I>=Y?I-Y:0;while(--z);z=Y,U=z;do I=$.prev[--U],$.prev[U]=I>=Y?I-Y:0;while(--z);Q+=Y}if($.strm.avail_in===0)break;if(z=Do0($.strm,$.window,$.strstart+$.lookahead,Q),$.lookahead+=z,$.lookahead+$.insert>=f1){J=$.strstart-$.insert,$.ins_h=$.window[J],$.ins_h=($.ins_h<<$.hash_shift^$.window[J+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[J+f1-1])&$.hash_mask,$.prev[J&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=J,J++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)U=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(UU($),$.lookahead===0&&Y===zU)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var z=$.block_start+U;if($.strstart===0||$.strstart>=z){if($.lookahead=$.strstart-z,$.strstart=z,o6($,!1),$.strm.avail_out===0)return P6}if($.strstart-$.block_start>=$.w_size-V5){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===o7){if(o6($,!0),$.strm.avail_out===0)return YU;return wQ}if($.strstart>$.block_start){if(o6($,!1),$.strm.avail_out===0)return P6}return P6}function py($,Y){var U,z;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(U!==0&&$.strstart-U<=$.w_size-V5)$.match_length=r$0($,U);if($.match_length>=f1)if(z=R$._tr_tally($,$.strstart-$.match_start,$.match_length-f1),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=f1){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else z=R$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,U!==0&&$.prev_length<$.max_lazy_match&&$.strstart-U<=$.w_size-V5){if($.match_length=r$0($,U),$.match_length<=5&&($.strategy===Qo0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){I=$.strstart+$.lookahead-f1,z=R$._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f1),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=I)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,z){if(o6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(z=R$._tr_tally($,0,$.window[$.strstart-1]),z)o6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)z=R$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(I=$.strstart-1,z=J[I],z===J[++I]&&z===J[++I]&&z===J[++I]){Q=$.strstart+m7;do;while(z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&I$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)U=R$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else U=R$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===o7){if(o6($,!0),$.strm.avail_out===0)return YU;return wQ}if($.last_lit){if(o6($,!1),$.strm.avail_out===0)return P6}return VW}function Po0($,Y){var U;for(;;){if($.lookahead===0){if(UU($),$.lookahead===0){if(Y===zU)return P6;break}}if($.match_length=0,U=R$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,U){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===o7){if(o6($,!0),$.strm.avail_out===0)return YU;return wQ}if($.last_lit){if(o6($,!1),$.strm.avail_out===0)return P6}return VW}function Q9($,Y,U,z,I){this.good_length=$,this.max_lazy=Y,this.nice_length=U,this.max_chain=z,this.func=I}var FQ;FQ=[new Q9(0,0,0,0,Ao0),new Q9(4,4,8,4,py),new Q9(4,5,16,8,py),new Q9(4,6,32,32,py),new Q9(4,4,16,16,LQ),new Q9(8,16,32,32,LQ),new Q9(8,16,128,128,LQ),new Q9(8,32,128,256,LQ),new Q9(32,128,258,1024,LQ),new Q9(32,258,258,4096,LQ)];function To0($){$.window_size=2*$.w_size,d7($.head),$.max_lazy_match=FQ[$.level].max_lazy,$.good_match=FQ[$.level].good_length,$.nice_match=FQ[$.level].nice_length,$.max_chain_length=FQ[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=f1-1,$.match_available=0,$.ins_h=0}function jo0(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=BO,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new _8.Buf16(wo0*2),this.dyn_dtree=new _8.Buf16((2*Lo0+1)*2),this.bl_tree=new _8.Buf16((2*Fo0+1)*2),d7(this.dyn_ltree),d7(this.dyn_dtree),d7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new _8.Buf16(Mo0+1),this.heap=new _8.Buf16(2*dy+1),d7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new _8.Buf16(2*dy+1),d7(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function s$0($){var Y;if(!$||!$.state)return l7($,_$);if($.total_in=$.total_out=0,$.data_type=Ho0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?PO:$U,$.adler=Y.wrap===2?0:1,Y.last_flush=zU,R$._tr_init(Y),J9}function a$0($){var Y=s$0($);if(Y===J9)To0($.state);return Y}function Eo0($,Y){if(!$||!$.state)return _$;if($.state.wrap!==2)return _$;return $.state.gzhead=Y,J9}function t$0($,Y,U,z,I,Q){if(!$)return _$;var J=1;if(Y===Io0)Y=6;if(z<0)J=0,z=-z;else if(z>15)J=2,z-=16;if(I<1||I>Wo0||U!==BO||z<8||z>15||Y<0||Y>9||Q<0||Q>Ko0)return l7($,_$);if(z===8)z=9;var K=new jo0;return $.state=K,K.strm=$,K.wrap=J,K.gzhead=null,K.w_bits=z,K.w_size=1<d$0||Y<0)return $?l7($,_$):_$;if(z=$.state,!$.output||!$.input&&$.avail_in!==0||z.status===qW&&Y!==o7)return l7($,$.avail_out===0?ny:_$);if(z.strm=$,U=z.last_flush,z.last_flush=Y,z.status===PO)if(z.wrap===2)if($.adler=0,s1(z,31),s1(z,139),s1(z,8),!z.gzhead)s1(z,0),s1(z,0),s1(z,0),s1(z,0),s1(z,0),s1(z,z.level===9?2:z.strategy>=OO||z.level<2?4:0),s1(z,No0),z.status=$U;else{if(s1(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(!z.gzhead.extra?0:4)+(!z.gzhead.name?0:8)+(!z.gzhead.comment?0:16)),s1(z,z.gzhead.time&255),s1(z,z.gzhead.time>>8&255),s1(z,z.gzhead.time>>16&255),s1(z,z.gzhead.time>>24&255),s1(z,z.level===9?2:z.strategy>=OO||z.level<2?4:0),s1(z,z.gzhead.os&255),z.gzhead.extra&&z.gzhead.extra.length)s1(z,z.gzhead.extra.length&255),s1(z,z.gzhead.extra.length>>8&255);if(z.gzhead.hcrc)$.adler=n7($.adler,z.pending_buf,z.pending,0);z.gzindex=0,z.status=my}else{var J=BO+(z.w_bits-8<<4)<<8,K=-1;if(z.strategy>=OO||z.level<2)K=0;else if(z.level<6)K=1;else if(z.level===6)K=2;else K=3;if(J|=K<<6,z.strstart!==0)J|=Oo0;if(J+=31-J%31,z.status=$U,ZW(z,J),z.strstart!==0)ZW(z,$.adler>>>16),ZW(z,$.adler&65535);$.adler=1}if(z.status===my)if(z.gzhead.extra){I=z.pending;while(z.gzindex<(z.gzhead.extra.length&65535)){if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(p7($),I=z.pending,z.pending===z.pending_buf_size)break}s1(z,z.gzhead.extra[z.gzindex]&255),z.gzindex++}if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(z.gzindex===z.gzhead.extra.length)z.gzindex=0,z.status=NO}else z.status=NO;if(z.status===NO)if(z.gzhead.name){I=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(p7($),I=z.pending,z.pending===z.pending_buf_size){Q=1;break}}if(z.gzindexI)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(Q===0)z.gzindex=0,z.status=DO}else z.status=DO;if(z.status===DO)if(z.gzhead.comment){I=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(p7($),I=z.pending,z.pending===z.pending_buf_size){Q=1;break}}if(z.gzindexI)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(Q===0)z.status=AO}else z.status=AO;if(z.status===AO)if(z.gzhead.hcrc){if(z.pending+2>z.pending_buf_size)p7($);if(z.pending+2<=z.pending_buf_size)s1(z,$.adler&255),s1(z,$.adler>>8&255),$.adler=0,z.status=$U}else z.status=$U;if(z.pending!==0){if(p7($),$.avail_out===0)return z.last_flush=-1,J9}else if($.avail_in===0&&l$0(Y)<=l$0(U)&&Y!==o7)return l7($,ny);if(z.status===qW&&$.avail_in!==0)return l7($,ny);if($.avail_in!==0||z.lookahead!==0||Y!==zU&&z.status!==qW){var G=z.strategy===OO?Po0(z,Y):z.strategy===Jo0?Bo0(z,Y):FQ[z.level].func(z,Y);if(G===YU||G===wQ)z.status=qW;if(G===P6||G===YU){if($.avail_out===0)z.last_flush=-1;return J9}if(G===VW){if(Y===Yo0)R$._tr_align(z);else if(Y!==d$0){if(R$._tr_stored_block(z,0,0,!1),Y===Uo0){if(d7(z.head),z.lookahead===0)z.strstart=0,z.block_start=0,z.insert=0}}if(p7($),$.avail_out===0)return z.last_flush=-1,J9}}if(Y!==o7)return J9;if(z.wrap<=0)return m$0;if(z.wrap===2)s1(z,$.adler&255),s1(z,$.adler>>8&255),s1(z,$.adler>>16&255),s1(z,$.adler>>24&255),s1(z,$.total_in&255),s1(z,$.total_in>>8&255),s1(z,$.total_in>>16&255),s1(z,$.total_in>>24&255);else ZW(z,$.adler>>>16),ZW(z,$.adler&65535);if(p7($),z.wrap>0)z.wrap=-z.wrap;return z.pending!==0?J9:m$0}function _o0($){var Y;if(!$||!$.state)return _$;if(Y=$.state.status,Y!==PO&&Y!==my&&Y!==NO&&Y!==DO&&Y!==AO&&Y!==$U&&Y!==qW)return l7($,_$);return $.state=null,Y===$U?l7($,zo0):J9}function vo0($,Y){var U=Y.length,z,I,Q,J,K,G,H,W;if(!$||!$.state)return _$;if(z=$.state,J=z.wrap,J===2||J===1&&z.status!==PO||z.lookahead)return _$;if(J===1)$.adler=o$0($.adler,Y,U,0);if(z.wrap=0,U>=z.w_size){if(J===0)d7(z.head),z.strstart=0,z.block_start=0,z.insert=0;W=new _8.Buf8(z.w_size),_8.arraySet(W,Y,U-z.w_size,z.w_size,0),Y=W,U=z.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=U,$.next_in=0,$.input=Y,UU(z);while(z.lookahead>=f1){I=z.strstart,Q=z.lookahead-(f1-1);do z.ins_h=(z.ins_h<{var TO=W3(),$50=!0,Y50=!0;try{String.fromCharCode.apply(null,[0])}catch($){$50=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){Y50=!1}var LW=new TO.Buf8(256);for(K9=0;K9<256;K9++)LW[K9]=K9>=252?6:K9>=248?5:K9>=240?4:K9>=224?3:K9>=192?2:1;var K9;LW[254]=LW[254]=1;co0.string2buf=function($){var Y,U,z,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|U&63;else if(U<65536)Y[Q++]=224|U>>>12,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63;else Y[Q++]=240|U>>>18,Y[Q++]=128|U>>>12&63,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63}return Y};function U50($,Y){if(Y<65534){if($.subarray&&Y50||!$.subarray&&$50)return String.fromCharCode.apply(null,TO.shrinkBuf($,Y))}var U="";for(var z=0;z4){K[z++]=65533,U+=Q-1;continue}I&=Q===2?31:Q===3?15:7;while(Q>1&&U1){K[z++]=65533;continue}if(I<65536)K[z++]=I;else I-=65536,K[z++]=55296|I>>10&1023,K[z++]=56320|I&1023}return U50(K,z)};co0.utf8border=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+LW[$[U]]>Y?U:Y}});var oy=E((Dm1,z50)=>{function oo0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}z50.exports=oo0});var K50=E((Ur0)=>{var FW=e$0(),wW=W3(),sy=ly(),ay=MO(),ro0=oy(),J50=Object.prototype.toString,so0=0,ry=4,MQ=0,I50=1,Q50=2,ao0=-1,to0=0,eo0=8;function IU($){if(!(this instanceof IU))return new IU($);this.options=wW.assign({level:ao0,method:eo0,chunkSize:16384,windowBits:15,memLevel:8,strategy:to0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>0)Y.windowBits=-Y.windowBits;else if(Y.gzip&&Y.windowBits>0&&Y.windowBits<16)Y.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ro0,this.strm.avail_out=0;var U=FW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(U!==MQ)throw Error(ay[U]);if(Y.header)FW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var z;if(typeof Y.dictionary==="string")z=sy.string2buf(Y.dictionary);else if(J50.call(Y.dictionary)==="[object ArrayBuffer]")z=new Uint8Array(Y.dictionary);else z=Y.dictionary;if(U=FW.deflateSetDictionary(this.strm,z),U!==MQ)throw Error(ay[U]);this._dict_set=!0}}IU.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,I,Q;if(this.ended)return!1;if(Q=Y===~~Y?Y:Y===!0?ry:so0,typeof $==="string")U.input=sy.string2buf($);else if(J50.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new wW.Buf8(z),U.next_out=0,U.avail_out=z;if(I=FW.deflate(U,Q),I!==I50&&I!==MQ)return this.onEnd(I),this.ended=!0,!1;if(U.avail_out===0||U.avail_in===0&&(Q===ry||Q===Q50))if(this.options.to==="string")this.onData(sy.buf2binstring(wW.shrinkBuf(U.output,U.next_out)));else this.onData(wW.shrinkBuf(U.output,U.next_out))}while((U.avail_in>0||U.avail_out===0)&&I!==I50);if(Q===ry)return I=FW.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===MQ;if(Q===Q50)return this.onEnd(MQ),U.avail_out=0,!0;return!0};IU.prototype.onData=function($){this.chunks.push($)};IU.prototype.onEnd=function($){if($===MQ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=wW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function ty($,Y){var U=new IU(Y);if(U.push($,!0),U.err)throw U.msg||ay[U.err];return U.result}function $r0($,Y){return Y=Y||{},Y.raw=!0,ty($,Y)}function Yr0($,Y){return Y=Y||{},Y.gzip=!0,ty($,Y)}Ur0.Deflate=IU;Ur0.deflate=ty;Ur0.deflateRaw=$r0;Ur0.gzip=Yr0});var H50=E((Bm1,G50)=>{var jO=30,Kr0=12;G50.exports=function(Y,U){var z,I,Q,J,K,G,H,W,X,Z,q,V,w,M,F,N,O,D,P,T,A,j,C,b,x;z=Y.state,I=Y.next_in,b=Y.input,Q=I+(Y.avail_in-5),J=Y.next_out,x=Y.output,K=J-(U-Y.avail_out),G=J+(Y.avail_out-257),H=z.dmax,W=z.wsize,X=z.whave,Z=z.wnext,q=z.window,V=z.hold,w=z.bits,M=z.lencode,F=z.distcode,N=(1<>>24,V>>>=P,w-=P,P=D>>>16&255,P===0)x[J++]=D&65535;else if(P&16){if(T=D&65535,P&=15,P){if(w>>=P,w-=P}if(w<15)V+=b[I++]<>>24,V>>>=P,w-=P,P=D>>>16&255,P&16){if(A=D&65535,P&=15,wH){Y.msg="invalid distance too far back",z.mode=jO;break $}if(V>>>=P,w-=P,P=J-K,A>P){if(P=A-P,P>X){if(z.sane){Y.msg="invalid distance too far back",z.mode=jO;break $}}if(j=0,C=q,Z===0){if(j+=W-P,P2)x[J++]=C[j++],x[J++]=C[j++],x[J++]=C[j++],T-=3;if(T){if(x[J++]=C[j++],T>1)x[J++]=C[j++]}}else{j=J-A;do x[J++]=x[j++],x[J++]=x[j++],x[J++]=x[j++],T-=3;while(T>2);if(T){if(x[J++]=x[j++],T>1)x[J++]=x[j++]}}}else if((P&64)===0){D=F[(D&65535)+(V&(1<>3,I-=T,w-=T<<3,V&=(1<{var W50=W3(),OQ=15,X50=852,Z50=592,q50=0,ey=1,V50=2,Gr0=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Hr0=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Wr0=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Xr0=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];L50.exports=function(Y,U,z,I,Q,J,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,w=0,M=0,F=0,N=0,O=0,D,P,T,A,j,C=null,b=0,x,g=new W50.Buf16(OQ+1),i=new W50.Buf16(OQ+1),c=null,z0=0,k,d,a;for(W=0;W<=OQ;W++)g[W]=0;for(X=0;X=1;q--)if(g[q]!==0)break;if(V>q)V=q;if(q===0)return Q[J++]=20971520,Q[J++]=20971520,G.bits=1,0;for(Z=1;Z0&&(Y===q50||q!==1))return-1;i[1]=0;for(W=1;WX50||Y===V50&&N>Z50)return 1;for(;;){if(k=W-M,K[X]x)d=c[z0+K[X]],a=C[b+K[X]];else d=96,a=0;D=1<>M)+P]=k<<24|d<<16|a|0;while(P!==0);D=1<>=1;if(D!==0)O&=D-1,O+=D;else O=0;if(X++,--g[W]===0){if(W===q)break;W=U[z+K[X]]}if(W>V&&(O&A)!==T){if(M===0)M=V;j+=Z,w=W-M,F=1<X50||Y===V50&&N>Z50)return 1;T=O&A,Q[T]=V<<24|w<<16|j-J|0}}if(O!==0)Q[j+O]=W-M<<24|4194304|0;return G.bits=V,0}});var a50=E((_r0)=>{var H$=W3(),Qk=iy(),G9=cy(),Zr0=H50(),MW=F50(),qr0=0,c50=1,n50=2,w50=4,Vr0=5,EO=6,QU=0,Lr0=1,Fr0=2,v$=-2,p50=-3,Jk=-4,wr0=-5,M50=8,d50=1,O50=2,N50=3,D50=4,A50=5,B50=6,P50=7,T50=8,j50=9,E50=10,_O=11,Z3=12,$k=13,C50=14,Yk=15,R50=16,_50=17,v50=18,h50=19,CO=20,RO=21,S50=22,g50=23,y50=24,k50=25,x50=26,Uk=27,f50=28,u50=29,k4=30,Kk=31,Mr0=32,Or0=852,Nr0=592,Dr0=15,Ar0=Dr0;function b50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function Br0(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new H$.Buf16(320),this.work=new H$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m50($){var Y;if(!$||!$.state)return v$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=d50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new H$.Buf32(Or0),Y.distcode=Y.distdyn=new H$.Buf32(Nr0),Y.sane=1,Y.back=-1,QU}function l50($){var Y;if(!$||!$.state)return v$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,m50($)}function o50($,Y){var U,z;if(!$||!$.state)return v$;if(z=$.state,Y<0)U=0,Y=-Y;else if(U=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return v$;if(z.window!==null&&z.wbits!==Y)z.window=null;return z.wrap=U,z.wbits=Y,l50($)}function r50($,Y){var U,z;if(!$)return v$;if(z=new Br0,$.state=z,z.window=null,U=o50($,Y),U!==QU)$.state=null;return U}function Pr0($){return r50($,Ar0)}var i50=!0,zk,Ik;function Tr0($){if(i50){var Y;zk=new H$.Buf32(512),Ik=new H$.Buf32(32),Y=0;while(Y<144)$.lens[Y++]=8;while(Y<256)$.lens[Y++]=9;while(Y<280)$.lens[Y++]=7;while(Y<288)$.lens[Y++]=8;MW(c50,$.lens,0,288,zk,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;MW(n50,$.lens,0,32,Ik,0,$.work,{bits:5}),i50=!1}$.lencode=zk,$.lenbits=9,$.distcode=Ik,$.distbits=5}function s50($,Y,U,z){var I,Q=$.state;if(Q.window===null)Q.wsize=1<=Q.wsize)H$.arraySet(Q.window,Y,U-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize;else{if(I=Q.wsize-Q.wnext,I>z)I=z;if(H$.arraySet(Q.window,Y,U-z,I,Q.wnext),z-=I,z)H$.arraySet(Q.window,Y,U-z,z,0),Q.wnext=z,Q.whave=Q.wsize;else{if(Q.wnext+=I,Q.wnext===Q.wsize)Q.wnext=0;if(Q.whave>>8&255,U.check=G9(U.check,C,2,0),H=0,W=0,U.mode=O50;break}if(U.flags=0,U.head)U.head.done=!1;if(!(U.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",U.mode=k4;break}if((H&15)!==M50){$.msg="unknown compression method",U.mode=k4;break}if(H>>>=4,W-=4,A=(H&15)+8,U.wbits===0)U.wbits=A;else if(A>U.wbits){$.msg="invalid window size",U.mode=k4;break}U.dmax=1<>8&1;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=G9(U.check,C,2,0);H=0,W=0,U.mode=N50;case N50:while(W<32){if(K===0)break $;K--,H+=z[Q++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,U.check=G9(U.check,C,4,0);H=0,W=0,U.mode=D50;case D50:while(W<16){if(K===0)break $;K--,H+=z[Q++]<>8;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=G9(U.check,C,2,0);H=0,W=0,U.mode=A50;case A50:if(U.flags&1024){while(W<16){if(K===0)break $;K--,H+=z[Q++]<>>8&255,U.check=G9(U.check,C,2,0);H=0,W=0}else if(U.head)U.head.extra=null;U.mode=B50;case B50:if(U.flags&1024){if(q=U.length,q>K)q=K;if(q){if(U.head){if(A=U.head.extra_len-U.length,!U.head.extra)U.head.extra=Array(U.head.extra_len);H$.arraySet(U.head.extra,z,Q,q,A)}if(U.flags&512)U.check=G9(U.check,z,q,Q);K-=q,Q+=q,U.length-=q}if(U.length)break $}U.length=0,U.mode=P50;case P50:if(U.flags&2048){if(K===0)break $;q=0;do if(A=z[Q+q++],U.head&&A&&U.length<65536)U.head.name+=String.fromCharCode(A);while(A&&q>9&1,U.head.done=!0;$.adler=U.check=0,U.mode=Z3;break;case E50:while(W<32){if(K===0)break $;K--,H+=z[Q++]<>>=W&7,W-=W&7,U.mode=Uk;break}while(W<3){if(K===0)break $;K--,H+=z[Q++]<>>=1,W-=1,H&3){case 0:U.mode=C50;break;case 1:if(Tr0(U),U.mode=CO,Y===EO){H>>>=2,W-=2;break $}break;case 2:U.mode=_50;break;case 3:$.msg="invalid block type",U.mode=k4}H>>>=2,W-=2;break;case C50:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=z[Q++]<>>16^65535)){$.msg="invalid stored block lengths",U.mode=k4;break}if(U.length=H&65535,H=0,W=0,U.mode=Yk,Y===EO)break $;case Yk:U.mode=R50;case R50:if(q=U.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;H$.arraySet(I,z,Q,q,J),K-=q,Q+=q,G-=q,J+=q,U.length-=q;break}U.mode=Z3;break;case _50:while(W<14){if(K===0)break $;K--,H+=z[Q++]<>>=5,W-=5,U.ndist=(H&31)+1,H>>>=5,W-=5,U.ncode=(H&15)+4,H>>>=4,W-=4,U.nlen>286||U.ndist>30){$.msg="too many length or distance symbols",U.mode=k4;break}U.have=0,U.mode=v50;case v50:while(U.have>>=3,W-=3}while(U.have<19)U.lens[g[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,b={bits:U.lenbits},j=MW(qr0,U.lens,0,19,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid code lengths set",U.mode=k4;break}U.have=0,U.mode=h50;case h50:while(U.have>>24,N=M>>>16&255,O=M&65535,F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>>=F,W-=F,U.lens[U.have++]=O;else{if(O===16){x=F+2;while(W>>=F,W-=F,U.have===0){$.msg="invalid bit length repeat",U.mode=k4;break}A=U.lens[U.have-1],q=3+(H&3),H>>>=2,W-=2}else if(O===17){x=F+3;while(W>>=F,W-=F,A=0,q=3+(H&7),H>>>=3,W-=3}else{x=F+7;while(W>>=F,W-=F,A=0,q=11+(H&127),H>>>=7,W-=7}if(U.have+q>U.nlen+U.ndist){$.msg="invalid bit length repeat",U.mode=k4;break}while(q--)U.lens[U.have++]=A}}if(U.mode===k4)break;if(U.lens[256]===0){$.msg="invalid code -- missing end-of-block",U.mode=k4;break}if(U.lenbits=9,b={bits:U.lenbits},j=MW(c50,U.lens,0,U.nlen,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid literal/lengths set",U.mode=k4;break}if(U.distbits=6,U.distcode=U.distdyn,b={bits:U.distbits},j=MW(n50,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,b),U.distbits=b.bits,j){$.msg="invalid distances set",U.mode=k4;break}if(U.mode=CO,Y===EO)break $;case CO:U.mode=RO;case RO:if(K>=6&&G>=258){if($.next_out=J,$.avail_out=G,$.next_in=Q,$.avail_in=K,U.hold=H,U.bits=W,Zr0($,Z),J=$.next_out,I=$.output,G=$.avail_out,Q=$.next_in,z=$.input,K=$.avail_in,H=U.hold,W=U.bits,U.mode===Z3)U.back=-1;break}U.back=0;for(;;){if(M=U.lencode[H&(1<>>24,N=M>>>16&255,O=M&65535,F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>D)],F=M>>>24,N=M>>>16&255,O=M&65535,D+F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>>=D,W-=D,U.back+=D}if(H>>>=F,W-=F,U.back+=F,U.length=O,N===0){U.mode=x50;break}if(N&32){U.back=-1,U.mode=Z3;break}if(N&64){$.msg="invalid literal/length code",U.mode=k4;break}U.extra=N&15,U.mode=S50;case S50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=g50;case g50:for(;;){if(M=U.distcode[H&(1<>>24,N=M>>>16&255,O=M&65535,F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>D)],F=M>>>24,N=M>>>16&255,O=M&65535,D+F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>>=D,W-=D,U.back+=D}if(H>>>=F,W-=F,U.back+=F,N&64){$.msg="invalid distance code",U.mode=k4;break}U.offset=O,U.extra=N&15,U.mode=y50;case y50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){$.msg="invalid distance too far back",U.mode=k4;break}U.mode=k50;case k50:if(G===0)break $;if(q=Z-G,U.offset>q){if(q=U.offset-q,q>U.whave){if(U.sane){$.msg="invalid distance too far back",U.mode=k4;break}}if(q>U.wnext)q-=U.wnext,V=U.wsize-q;else V=U.wnext-q;if(q>U.length)q=U.length;w=U.window}else w=I,V=J-U.offset,q=U.length;if(q>G)q=G;G-=q,U.length-=q;do I[J++]=w[V++];while(--q);if(U.length===0)U.mode=RO;break;case x50:if(G===0)break $;I[J++]=U.length,G--,U.mode=RO;break;case Uk:if(U.wrap){while(W<32){if(K===0)break $;K--,H|=z[Q++]<{t50.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var $90=E((Em1,e50)=>{function ir0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e50.exports=ir0});var U90=E((dr0)=>{var NQ=a50(),OW=W3(),vO=ly(),K6=Gk(),Hk=MO(),cr0=oy(),nr0=$90(),Y90=Object.prototype.toString;function JU($){if(!(this instanceof JU))return new JU($);this.options=OW.assign({chunkSize:16384,windowBits:0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>=0&&Y.windowBits<16){if(Y.windowBits=-Y.windowBits,Y.windowBits===0)Y.windowBits=-15}if(Y.windowBits>=0&&Y.windowBits<16&&!($&&$.windowBits))Y.windowBits+=32;if(Y.windowBits>15&&Y.windowBits<48){if((Y.windowBits&15)===0)Y.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new cr0,this.strm.avail_out=0;var U=NQ.inflateInit2(this.strm,Y.windowBits);if(U!==K6.Z_OK)throw Error(Hk[U]);if(this.header=new nr0,NQ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=vO.string2buf(Y.dictionary);else if(Y90.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(U=NQ.inflateSetDictionary(this.strm,Y.dictionary),U!==K6.Z_OK)throw Error(Hk[U])}}}JU.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,I=this.options.dictionary,Q,J,K,G,H,W=!1;if(this.ended)return!1;if(J=Y===~~Y?Y:Y===!0?K6.Z_FINISH:K6.Z_NO_FLUSH,typeof $==="string")U.input=vO.binstring2buf($);else if(Y90.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new OW.Buf8(z),U.next_out=0,U.avail_out=z;if(Q=NQ.inflate(U,K6.Z_NO_FLUSH),Q===K6.Z_NEED_DICT&&I)Q=NQ.inflateSetDictionary(this.strm,I);if(Q===K6.Z_BUF_ERROR&&W===!0)Q=K6.Z_OK,W=!1;if(Q!==K6.Z_STREAM_END&&Q!==K6.Z_OK)return this.onEnd(Q),this.ended=!0,!1;if(U.next_out){if(U.avail_out===0||Q===K6.Z_STREAM_END||U.avail_in===0&&(J===K6.Z_FINISH||J===K6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=vO.utf8border(U.output,U.next_out),G=U.next_out-K,H=vO.buf2string(U.output,K),U.next_out=G,U.avail_out=z-G,G)OW.arraySet(U.output,U.output,K,G,0);this.onData(H)}else this.onData(OW.shrinkBuf(U.output,U.next_out))}if(U.avail_in===0&&U.avail_out===0)W=!0}while((U.avail_in>0||U.avail_out===0)&&Q!==K6.Z_STREAM_END);if(Q===K6.Z_STREAM_END)J=K6.Z_FINISH;if(J===K6.Z_FINISH)return Q=NQ.inflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===K6.Z_OK;if(J===K6.Z_SYNC_FLUSH)return this.onEnd(K6.Z_OK),U.avail_out=0,!0;return!0};JU.prototype.onData=function($){this.chunks.push($)};JU.prototype.onEnd=function($){if($===K6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=OW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function Wk($,Y){var U=new JU(Y);if(U.push($,!0),U.err)throw U.msg||Hk[U.err];return U.result}function pr0($,Y){return Y=Y||{},Y.raw=!0,Wk($,Y)}dr0.Inflate=JU;dr0.inflate=Wk;dr0.inflateRaw=pr0;dr0.ungzip=Wk});var Q90=E((Rm1,I90)=>{var sr0=W3().assign,ar0=K50(),tr0=U90(),er0=Gk(),z90={};sr0(z90,ar0,tr0,er0);I90.exports=z90});var K90=E((zs0)=>{var $s0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",Ys0=Q90(),J90=n4(),hO=G$(),Us0=$s0?"uint8array":"array";zs0.magic="\b\x00";function KU($,Y){hO.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}J90.inherits(KU,hO);KU.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(J90.transformTo(Us0,$.data),!1)};KU.prototype.flush=function(){if(hO.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};KU.prototype.cleanUp=function(){hO.prototype.cleanUp.call(this),this._pako=null};KU.prototype._createPako=function(){this._pako=new Ys0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};zs0.compressWorker=function($){return new KU("Deflate",$)};zs0.uncompressWorker=function(){return new KU("Inflate",{})}});var Xk=E((Ks0)=>{var G90=G$();Ks0.STORE={magic:"\x00\x00",compressWorker:function(){return new G90("STORE compression")},uncompressWorker:function(){return new G90("STORE decompression")}};Ks0.DEFLATE=K90()});var Zk=E((Ws0)=>{Ws0.LOCAL_FILE_HEADER="PK\x03\x04";Ws0.CENTRAL_FILE_HEADER="PK\x01\x02";Ws0.CENTRAL_DIRECTORY_END="PK\x05\x06";Ws0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";Ws0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";Ws0.DATA_DESCRIPTOR="PK\x07\b"});var Z90=E((Sm1,X90)=>{var DQ=n4(),AQ=G$(),qk=XQ(),H90=VO(),SO=Zk(),D4=function($,Y){var U="",z;for(z=0;z>>8;return U},ws0=function($,Y){var U=$;if(!$)U=Y?16893:33204;return(U&65535)<<16},Ms0=function($){return($||0)&63},W90=function($,Y,U,z,I,Q){var{file:J,compression:K}=$,G=Q!==qk.utf8encode,H=DQ.transformTo("string",Q(J.name)),W=DQ.transformTo("string",qk.utf8encode(J.name)),X=J.comment,Z=DQ.transformTo("string",Q(X)),q=DQ.transformTo("string",qk.utf8encode(X)),V=W.length!==J.name.length,w=q.length!==X.length,M,F,N="",O="",D="",P=J.dir,T=J.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||U)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(Y)j|=8;if(!G&&(V||w))j|=2048;var C=0,b=0;if(P)C|=16;if(I==="UNIX")b=798,C|=ws0(J.unixPermissions,P);else b=20,C|=Ms0(J.dosPermissions,P);if(M=T.getUTCHours(),M=M<<6,M=M|T.getUTCMinutes(),M=M<<5,M=M|T.getUTCSeconds()/2,F=T.getUTCFullYear()-1980,F=F<<4,F=F|T.getUTCMonth()+1,F=F<<5,F=F|T.getUTCDate(),V)O=D4(1,1)+D4(H90(H),4)+W,N+="up"+D4(O.length,2)+O;if(w)D=D4(1,1)+D4(H90(Z),4)+q,N+="uc"+D4(D.length,2)+D;var x="";x+=` + deps: ${W}}`};let I={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=Q(G);J(G,H),K(G,W)}};function Q({schema:G}){let H={},W={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?H:W;Z[X]=G[X]}return[H,W]}function J(G,H=G.schema){let{gen:W,data:X,it:Z}=G;if(Object.keys(H).length===0)return;let q=W.let("missing");for(let V in H){let w=H[V];if(w.length===0)continue;let M=(0,z.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:w.length,deps:w.join(", ")}),Z.allErrors)W.if(M,()=>{for(let F of w)(0,z.checkReportMissingProp)(G,F)});else W.if(Y._`${M} && (${(0,z.checkMissingProp)(G,w,q)})`),(0,z.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=J;function K(G,H=G.schema){let{gen:W,data:X,keyword:Z,it:q}=G,V=W.name("valid");for(let w in H){if((0,U.alwaysValidSchema)(q,H[w]))continue;W.if((0,z.propertyInData)(W,X,w,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:w},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=I}),Li0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:I})=>Y._`{propertyName: ${I.propertyName}}`},code(I){let{gen:Q,schema:J,data:K,it:G}=I;if((0,U.alwaysValidSchema)(G,J))return;let H=Q.name("valid");Q.forIn("key",K,(W)=>{I.setParams({propertyName:W}),I.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),Q.if((0,Y.not)(H),()=>{if(I.error(!0),!G.allErrors)Q.break()})}),I.ok(H)}};$.default=z}),Se=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=G5(),U=F1(),z=K5(),I=v1(),Q={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:J})=>U._`{additionalProperty: ${J.additionalProperty}}`},code(J){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=J;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,I.alwaysValidSchema)(Z,G))return;let w=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);F(),J.ok(U._`${X} === ${z.default.errors}`);function F(){K.forIn("key",W,(T)=>{if(!w.length&&!M.length)D(T);else K.if(N(T),()=>D(T))})}function N(T){let A;if(w.length>8){let j=(0,I.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(w.length)A=(0,U.or)(...w.map((j)=>U._`${T} === ${j}`));else A=U.nil;if(M.length)A=(0,U.or)(A,...M.map((j)=>U._`${(0,Y.usePattern)(J,j)}.test(${T})`));return(0,U.not)(A)}function O(T){K.code(U._`delete ${W}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){O(T);return}if(G===!1){if(J.setParams({additionalProperty:T}),J.error(),!q)K.break();return}if(typeof G=="object"&&!(0,I.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")P(T,A,!1),K.if((0,U.not)(A),()=>{J.reset(),O(T)});else if(P(T,A),!q)K.if((0,U.not)(A),()=>K.break())}}function P(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:I.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});J.subschema(C,A)}}};$.default=Q}),Fi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=bI(),U=G5(),z=v1(),I=Se(),Q={keyword:"properties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=J;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)I.default.code(new Y.KeywordCxt(X,I.default,"additionalProperties"));let Z=(0,U.allSchemaProperties)(G);for(let F of Z)X.definedProperties.add(F);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=z.mergeEvaluated.props(K,(0,z.toHash)(Z),X.props);let q=Z.filter((F)=>!(0,z.alwaysValidSchema)(X,G[F]));if(q.length===0)return;let V=K.name("valid");for(let F of q){if(w(F))M(F);else{if(K.if((0,U.propertyInData)(K,W,F,X.opts.ownProperties)),M(F),!X.allErrors)K.else().var(V,!0);K.endIf()}J.it.definedProperties.add(F),J.ok(V)}function w(F){return X.opts.useDefaults&&!X.compositeRule&&G[F].default!==void 0}function M(F){J.subschema({keyword:"properties",schemaProp:F,dataProp:F},V)}}};$.default=Q}),wi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=G5(),U=F1(),z=v1(),I=v1(),Q={keyword:"patternProperties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=J,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((P)=>(0,z.alwaysValidSchema)(X,G[P]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let w=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof U.Name))X.props=(0,I.evaluatedPropsToName)(K,X.props);let{props:F}=X;N();function N(){for(let P of q){if(w)O(P);if(X.allErrors)D(P);else K.var(M,!0),D(P),K.if(M)}}function O(P){for(let T in w)if(new RegExp(P).test(T))(0,z.checkStrictMode)(X,`property ${T} matches pattern ${P} (use allowMatchingProperties)`)}function D(P){K.forIn("key",H,(T)=>{K.if(U._`${(0,Y.usePattern)(J,P)}.test(${T})`,()=>{let A=V.includes(P);if(!A)J.subschema({keyword:"patternProperties",schemaProp:P,dataProp:T,dataPropType:I.Type.Str},M);if(X.opts.unevaluated&&F!==!0)K.assign(U._`${F}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,U.not)(M),()=>K.break())})})}}};$.default=Q}),Mi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(z){let{gen:I,schema:Q,it:J}=z;if((0,Y.alwaysValidSchema)(J,Q)){z.fail();return}let K=I.name("valid");z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),z.failResult(K,()=>z.reset(),()=>z.error())},error:{message:"must NOT be valid"}};$.default=U}),Oi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:G5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),Ni0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:I})=>Y._`{passingSchemas: ${I.passing}}`},code(I){let{gen:Q,schema:J,parentSchema:K,it:G}=I;if(!Array.isArray(J))throw Error("ajv implementation error");if(G.opts.discriminator&&K.discriminator)return;let H=J,W=Q.let("valid",!1),X=Q.let("passing",null),Z=Q.name("_valid");I.setParams({passing:X}),Q.block(q),I.result(W,()=>I.reset(),()=>I.error(!0));function q(){H.forEach((V,w)=>{let M;if((0,U.alwaysValidSchema)(G,V))Q.var(Z,!0);else M=I.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},Z);if(w>0)Q.if(Y._`${Z} && ${W}`).assign(W,!1).assign(X,Y._`[${X}, ${w}]`).else();Q.if(Z,()=>{if(Q.assign(W,!0),Q.assign(X,w),M)I.mergeEvaluated(M,Y.Name)})})}}};$.default=z}),Di0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"allOf",schemaType:"array",code(z){let{gen:I,schema:Q,it:J}=z;if(!Array.isArray(Q))throw Error("ajv implementation error");let K=I.name("valid");Q.forEach((G,H)=>{if((0,Y.alwaysValidSchema)(J,G))return;let W=z.subschema({keyword:"allOf",schemaProp:H},K);z.ok(K),z.mergeEvaluated(W)})}};$.default=U}),Ai0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:Q})=>Y.str`must match "${Q.ifClause}" schema`,params:({params:Q})=>Y._`{failingKeyword: ${Q.ifClause}}`},code(Q){let{gen:J,parentSchema:K,it:G}=Q;if(K.then===void 0&&K.else===void 0)(0,U.checkStrictMode)(G,'"if" without "then" and "else" is ignored');let H=I(G,"then"),W=I(G,"else");if(!H&&!W)return;let X=J.let("valid",!0),Z=J.name("_valid");if(q(),Q.reset(),H&&W){let w=J.let("ifClause");Q.setParams({ifClause:w}),J.if(Z,V("then",w),V("else",w))}else if(H)J.if(Z,V("then"));else J.if((0,Y.not)(Z),V("else"));Q.pass(X,()=>Q.error(!0));function q(){let w=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);Q.mergeEvaluated(w)}function V(w,M){return()=>{let F=Q.subschema({keyword:w},Z);if(J.assign(X,Z),Q.mergeValidEvaluated(F,X),M)J.assign(M,Y._`${w}`);else Q.setParams({ifClause:w})}}}};function I(Q,J){let K=Q.schema[J];return K!==void 0&&!(0,U.alwaysValidSchema)(Q,K)}$.default=z}),Bi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:z,parentSchema:I,it:Q}){if(I.if===void 0)(0,Y.checkStrictMode)(Q,`"${z}" without "if" is ignored`)}};$.default=U}),ge=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=ve(),U=Zi0(),z=he(),I=qi0(),Q=Vi0(),J=gS(),K=Li0(),G=Se(),H=Fi0(),W=wi0(),X=Mi0(),Z=Oi0(),q=Ni0(),V=Di0(),w=Ai0(),M=Bi0();function F(N=!1){let O=[X.default,Z.default,q.default,V.default,w.default,M.default,K.default,G.default,J.default,H.default,W.default];if(N)O.push(U.default,I.default);else O.push(Y.default,z.default);return O.push(Q.default),O}$.default=F}),Pi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:z})=>Y.str`must match format "${z}"`,params:({schemaCode:z})=>Y._`{format: ${z}}`},code(z,I){let{gen:Q,data:J,$data:K,schema:G,schemaCode:H,it:W}=z,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)w();else M();function w(){let F=Q.scopeValue("formats",{ref:V.formats,code:X.code.formats}),N=Q.const("fDef",Y._`${F}[${H}]`),O=Q.let("fType"),D=Q.let("format");Q.if(Y._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>Q.assign(O,Y._`${N}.type || "string"`).assign(D,Y._`${N}.validate`),()=>Q.assign(O,Y._`"string"`).assign(D,N)),z.fail$data((0,Y.or)(P(),T()));function P(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${D}`}function T(){let A=q.$async?Y._`(${N}.async ? await ${D}(${J}) : ${D}(${J}))`:Y._`${D}(${J})`,j=Y._`(typeof ${D} == "function" ? ${A} : ${D}.test(${J}))`;return Y._`${D} && ${D} !== true && ${O} === ${I} && !${j}`}}function M(){let F=V.formats[G];if(!F){P();return}if(F===!0)return;let[N,O,D]=T(F);if(N===I)z.pass(A());function P(){if(X.strictSchema===!1){V.logger.warn(j());return}throw Error(j());function j(){return`unknown format "${G}" ignored in schema at path "${Z}"`}}function T(j){let C=j instanceof RegExp?(0,Y.regexpCode)(j):X.code.formats?Y._`${X.code.formats}${(0,Y.getProperty)(G)}`:void 0,b=Q.scopeValue("formats",{key:G,ref:j,code:C});if(typeof j=="object"&&!(j instanceof RegExp))return[j.type||"string",j.validate,Y._`${b}.validate`];return["string",j,b]}function A(){if(typeof F=="object"&&!(F instanceof RegExp)&&F.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${D}(${J})`}return typeof O=="function"?Y._`${D}(${J})`:Y._`${D}.test(${J})`}}}};$.default=U}),ye=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[Pi0().default];$.default=Y}),ke=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),xe=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Re(),U=_e(),z=ge(),I=ye(),Q=ke(),J=[Y.default,U.default,(0,z.default)(),I.default,Q.metadataVocabulary,Q.contentVocabulary];$.default=J}),Ti0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(U){U.Tag="tag",U.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),yS=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=Ti0(),z=ow(),I=iI(),Q=v1(),J={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===U.DiscrError.Tag?`tag "${G}" must be string`:`value of tag "${G}" must be in oneOf`,params:({params:{discrError:K,tag:G,tagName:H}})=>Y._`{error: ${K}, tag: ${H}, tagValue: ${G}}`},code(K){let{gen:G,data:H,schema:W,parentSchema:X,it:Z}=K,{oneOf:q}=X;if(!Z.opts.discriminator)throw Error("discriminator: requires discriminator option");let V=W.propertyName;if(typeof V!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!q)throw Error("discriminator: requires oneOf keyword");let w=G.let("valid",!1),M=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${M} == "string"`,()=>F(),()=>K.error(!1,{discrError:U.DiscrError.Tag,tag:M,tagName:V})),K.ok(w);function F(){let D=O();G.if(!1);for(let P in D)G.elseIf(Y._`${M} === ${P}`),G.assign(w,N(D[P]));G.else(),K.error(!1,{discrError:U.DiscrError.Mapping,tag:M,tagName:V}),G.endIf()}function N(D){let P=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:D},P);return K.mergeEvaluated(T,Y.Name),P}function O(){var D;let P={},T=j(X),A=!0;for(let x=0;x{Y.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),fe=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let U=vS(),z=xe(),I=yS(),Q=ji0(),J=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends U.default{_addVocabularies(){if(super._addVocabularies(),z.default.forEach((q)=>this.addVocabulary(q)),this.opts.discriminator)this.addKeyword(I.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let q=this.opts.$data?this.$dataMetaSchema(Q,J):Q;this.addMetaSchema(q,K,!1),this.refs["http://json-schema.org/schema"]=K}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(K)?K:void 0)}};$.Ajv=G,Y.exports=$=G,Y.exports.Ajv=G,Object.defineProperty($,"__esModule",{value:!0}),$.default=G;var H=bI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=F1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return W._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return W.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return W.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return W.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return W.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return W.CodeGen}});var X=MH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=iI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),ue=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=F1(),U=K5(),z=ow(),I=hS(),Q={keyword:"$dynamicAnchor",schemaType:"string",code:(G)=>J(G,G.schema)};function J(G,H){let{gen:W,it:X}=G;X.schemaEnv.root.dynamicAnchors[H]=!0;let Z=Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(H)}`,q=X.errSchemaPath==="#"?X.validateName:K(G);W.if(Y._`!${Z}`,()=>W.assign(Z,q))}$.dynamicAnchor=J;function K(G){let{schemaEnv:H,schema:W,self:X}=G.it,{root:Z,baseId:q,localRefs:V,meta:w}=H.root,{schemaId:M}=X.opts,F=new z.SchemaEnv({schema:W,schemaId:M,root:Z,baseId:q,localRefs:V,meta:w});return z.compileSchema.call(X,F),(0,I.getValidate)(G,F)}$.default=Q}),be=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=F1(),U=K5(),z=hS(),I={keyword:"$dynamicRef",schemaType:"string",code:(J)=>Q(J,J.schema)};function Q(J,K){let{gen:G,keyword:H,it:W}=J;if(K[0]!=="#")throw Error(`"${H}" only supports hash fragment reference`);let X=K.slice(1);if(W.allErrors)Z();else{let V=G.let("valid",!1);Z(V),J.ok(V)}function Z(V){if(W.schemaEnv.root.dynamicAnchors[X]){let w=G.let("_v",Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(X)}`);G.if(w,q(w,V),q(W.validateName,V))}else q(W.validateName,V)()}function q(V,w){return w?()=>G.block(()=>{(0,z.callRef)(J,V),G.let(w,!0)}):()=>(0,z.callRef)(J,V)}}$.dynamicRef=Q,$.default=I}),Ei0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=ue(),U=v1(),z={keyword:"$recursiveAnchor",schemaType:"boolean",code(I){if(I.schema)(0,Y.dynamicAnchor)(I,"");else(0,U.checkStrictMode)(I.it,"$recursiveAnchor: false is ignored")}};$.default=z}),Ci0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=be(),U={keyword:"$recursiveRef",schemaType:"string",code:(z)=>(0,Y.dynamicRef)(z,z.schema)};$.default=U}),ie=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=ue(),U=be(),z=Ei0(),I=Ci0(),Q=[Y.default,U.default,z.default,I.default];$.default=Q}),Ri0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gS(),U={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(z)=>(0,Y.validatePropertyDeps)(z)};$.default=U}),_i0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gS(),U={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(z)=>(0,Y.validateSchemaDeps)(z)};$.default=U}),vi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:z,parentSchema:I,it:Q}){if(I.contains===void 0)(0,Y.checkStrictMode)(Q,`"${z}" without "contains" is ignored`)}};$.default=U}),ce=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ri0(),U=_i0(),z=vi0(),I=[Y.default,U.default,z.default];$.default=I}),hi0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z=K5(),I={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:Q})=>Y._`{unevaluatedProperty: ${Q.unevaluatedProperty}}`},code(Q){let{gen:J,schema:K,data:G,errsCount:H,it:W}=Q;if(!H)throw Error("ajv implementation error");let{allErrors:X,props:Z}=W;if(Z instanceof Y.Name)J.if(Y._`${Z} !== true`,()=>J.forIn("key",G,(M)=>J.if(V(Z,M),()=>q(M))));else if(Z!==!0)J.forIn("key",G,(M)=>Z===void 0?q(M):J.if(w(Z,M),()=>q(M)));W.props=!0,Q.ok(Y._`${H} === ${z.default.errors}`);function q(M){if(K===!1){if(Q.setParams({unevaluatedProperty:M}),Q.error(),!X)J.break();return}if(!(0,U.alwaysValidSchema)(W,K)){let F=J.name("valid");if(Q.subschema({keyword:"unevaluatedProperties",dataProp:M,dataPropType:U.Type.Str},F),!X)J.if((0,Y.not)(F),()=>J.break())}}function V(M,F){return Y._`!${M} || !${M}[${F}]`}function w(M,F){let N=[];for(let O in M)if(M[O]===!0)N.push(Y._`${F} !== ${O}`);return(0,Y.and)(...N)}}};$.default=I}),Si0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),U=v1(),z={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:I}})=>Y.str`must NOT have more than ${I} items`,params:({params:{len:I}})=>Y._`{limit: ${I}}`},code(I){let{gen:Q,schema:J,data:K,it:G}=I,H=G.items||0;if(H===!0)return;let W=Q.const("len",Y._`${K}.length`);if(J===!1)I.setParams({len:H}),I.fail(Y._`${W} > ${H}`);else if(typeof J=="object"&&!(0,U.alwaysValidSchema)(G,J)){let Z=Q.var("valid",Y._`${W} <= ${H}`);Q.if((0,Y.not)(Z),()=>X(Z,H)),I.ok(Z)}G.items=!0;function X(Z,q){Q.forRange("i",q,W,(V)=>{if(I.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:U.Type.Num},Z),!G.allErrors)Q.if((0,Y.not)(Z),()=>Q.break())})}}};$.default=z}),ne=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hi0(),U=Si0(),z=[Y.default,U.default];$.default=z}),gi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),yi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),ki0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),xi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),fi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),ui0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),bi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),ii0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gi0(),U=yi0(),z=ki0(),I=xi0(),Q=fi0(),J=ui0(),K=bi0(),G=["/properties"];function H(W){return[Y,U,z,I,X(this,Q),J,X(this,K)].forEach((Z)=>this.addMetaSchema(Z,void 0,!1)),this;function X(Z,q){return W?Z.$dataMetaSchema(q,G):q}}$.default=H}),ci0=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let U=vS(),z=xe(),I=ie(),Q=ce(),J=ne(),K=yS(),G=ii0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends U.default{constructor(w={}){super({...w,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(I.default),z.default.forEach((w)=>this.addVocabulary(w)),this.addVocabulary(Q.default),this.addVocabulary(J.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:w,meta:M}=this.opts;if(!M)return;G.default.call(this,w),this.refs["http://json-schema.org/schema"]=H}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(H)?H:void 0)}};$.Ajv2019=W,Y.exports=$=W,Y.exports.Ajv2019=W,Object.defineProperty($,"__esModule",{value:!0}),$.default=W;var X=bI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=F1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return Z._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return Z.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return Z.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return Z.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return Z.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return Z.CodeGen}});var q=MH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=iI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),ni0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Re(),U=_e(),z=ge(),I=ie(),Q=ce(),J=ne(),K=ye(),G=ke(),H=[I.default,Y.default,U.default,(0,z.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,Q.default,J.default];$.default=H}),pi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),di0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),mi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),li0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),oi0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),ri0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),si0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),ai0=E0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),ti0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=pi0(),U=di0(),z=mi0(),I=li0(),Q=oi0(),J=ri0(),K=si0(),G=ai0(),H=["/properties"];function W(X){return[Y,U,z,I,Q,Z(this,J),K,Z(this,G)].forEach((q)=>this.addMetaSchema(q,void 0,!1)),this;function Z(q,V){return X?q.$dataMetaSchema(V,H):V}}$.default=W}),ei0=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let U=vS(),z=ni0(),I=yS(),Q=ti0(),J="https://json-schema.org/draft/2020-12/schema";var K=class extends U.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),z.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(I.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:q}=this.opts;if(!q)return;Q.default.call(this,Z),this.refs["http://json-schema.org/schema"]=J}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(J)?J:void 0)}};$.Ajv2020=K,Y.exports=$=K,Y.exports.Ajv2020=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K;var G=bI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=F1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return H._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return H.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return H.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return H.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return H.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return H.CodeGen}});var W=MH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=iI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),$c0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(x,g){return{validate:x,compare:g}}$.fullFormats={date:Y(Q,J),time:Y(G(!0),H),"date-time":Y(Z(!0),q),"iso-time":Y(G(),W),"iso-date-time":Y(Z(),V),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:F,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:b,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:O,int32:{type:"number",validate:T},int64:{type:"number",validate:A},float:{type:"number",validate:j},double:{type:"number",validate:j},password:!0,binary:!0},$.fastFormats={...$.fullFormats,date:Y(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,J),time:Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H),"date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,q),"iso-time":Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,W),"iso-date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,V),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},$.formatNames=Object.keys($.fullFormats);function U(x){return x%4===0&&(x%100!==0||x%400===0)}let z=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,I=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Q(x){let g=z.exec(x);if(!g)return!1;let i=+g[1],c=+g[2],z0=+g[3];return c>=1&&c<=12&&z0>=1&&z0<=(c===2&&U(i)?29:I[c])}function J(x,g){if(!(x&&g))return;if(x>g)return 1;if(x23||p>59||x&&!a)return!1;if(z0<=23&&k<=59&&d<60)return!0;let Y0=k-p*$0,R=z0-y*$0-(Y0<0?1:0);return(R===23||R===-1)&&(Y0===59||Y0===-1)&&d<61}}function H(x,g){if(!(x&&g))return;let i=new Date("2020-01-01T"+x).valueOf(),c=new Date("2020-01-01T"+g).valueOf();if(!(i&&c))return;return i-c}function W(x,g){if(!(x&&g))return;let i=K.exec(x),c=K.exec(g);if(!(i&&c))return;if(x=i[1]+i[2]+i[3],g=c[1]+c[2]+c[3],x>g)return 1;if(x=D}function A(x){return Number.isInteger(x)}function j(){return!0}let C=/[^\\]\\Z/;function b(x){if(C.test(x))return!1;try{return new RegExp(x),!0}catch(g){return!1}}}),Yc0=E0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=fe(),U=F1(),z=U.operators,I={formatMaximum:{okStr:"<=",ok:z.LTE,fail:z.GT},formatMinimum:{okStr:">=",ok:z.GTE,fail:z.LT},formatExclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},formatExclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},Q={message:({keyword:K,schemaCode:G})=>U.str`should be ${I[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>U._`{comparison: ${I[K].okStr}, limit: ${G}}`};$.formatLimitDefinition={keyword:Object.keys(I),type:"string",schemaType:"string",$data:!0,error:Q,code(K){let{gen:G,data:H,schemaCode:W,keyword:X,it:Z}=K,{opts:q,self:V}=Z;if(!q.validateFormats)return;let w=new Y.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(w.$data)M();else F();function M(){let O=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",U._`${O}[${w.schemaCode}]`);K.fail$data((0,U.or)(U._`typeof ${D} != "object"`,U._`${D} instanceof RegExp`,U._`typeof ${D}.compare != "function"`,N(D)))}function F(){let O=w.schema,D=V.formats[O];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${O}" does not define "compare" function`);let P=G.scopeValue("formats",{key:O,ref:D,code:q.code.formats?U._`${q.code.formats}${(0,U.getProperty)(O)}`:void 0});K.fail$data(N(P))}function N(O){return U._`${O}.compare(${H}, ${W}) ${I[X].fail} 0`}},dependencies:["format"]};let J=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=J}),Uc0=E0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let U=$c0(),z=Yc0(),I=F1(),Q=new I.Name("fullFormats"),J=new I.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,U.fullFormats,Q),H;let[X,Z]=W.mode==="fast"?[U.fastFormats,J]:[U.fullFormats,Q];if(G(H,W.formats||U.formatNames,X,Z),W.keywords)(0,z.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?U.fastFormats:U.fullFormats)[H];if(!X)throw Error(`Unknown format "${H}"`);return X};function G(H,W,X,Z){var q,V;(q=(V=H.opts.code).formats)!==null&&q!==void 0||(V.formats=I._`require("ajv-formats/dist/formats").${Z}`);for(let w of W)H.addFormat(w,X[w])}Y.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),pe=fe(),zc0=ci0(),Ic0=ei0(),Qc0=UV(Uc0(),1),Jc0=Qc0.default;db1=pe.Ajv});import kS from"node:process";var sw=m(()=>{de()});function fS($){return!!$&&typeof $==="object"&&$00 in $}function Gc0($){return $[$00]?.complete}function Hc0($,Y){switch(Y.kind){case"tools_list_changed":return $.toolsListChanged===!0;case"prompts_list_changed":return $.promptsListChanged===!0;case"resources_list_changed":return $.resourcesListChanged===!0;case"resource_updated":return $.resourceSubscriptions!==void 0&&$.resourceSubscriptions.includes(Y.uri)}}function Wc0($,Y){let U={},z=(I)=>Y===void 0||I===!0;if($.toolsListChanged===!0&&z(Y?.tools?.listChanged))U.toolsListChanged=!0;if($.promptsListChanged===!0&&z(Y?.prompts?.listChanged))U.promptsListChanged=!0;if($.resourcesListChanged===!0&&z(Y?.resources?.listChanged))U.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&z(Y?.resources?.subscribe))U.resourceSubscriptions=[...$.resourceSubscriptions];return U}function me($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[fY]:Y}}}}function Xc0($){let Y=_7(FH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function qc0($,Y){switch($){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:Y??""}}}function Fc0($){if($?.maxRounds!==void 0&&(!Number.isInteger($.maxRounds)||$.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${$.maxRounds})`);if($?.roundTimeoutMs!==void 0&&(!Number.isFinite($.roundTimeoutMs)||$.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${$.roundTimeoutMs})`);return{maxRounds:$?.maxRounds??Vc0,roundTimeoutMs:$?.roundTimeoutMs??Lc0,legacyShim:$?.legacyShim??!0}}function U00($,Y,U){if(U===null||typeof U!=="object"||typeof U.method!=="string")throw new I1(i0.InternalError,`Handler for ${$} returned an invalid input request '${Y}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let z=U,I=lt(z);if(I===void 0)throw new I1(i0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${z.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:z,required:I}}function wc0(){let $=globalThis.crypto;if($?.randomUUID!==void 0)return $.randomUUID();let Y=new Uint8Array(16);$.getRandomValues(Y),Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128;let U=[...Y].map((z)=>z.toString(16).padStart(2,"0")).join("");return`${U.slice(0,8)}-${U.slice(8,12)}-${U.slice(12,16)}-${U.slice(16,20)}-${U.slice(20)}`}function xS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new I1(i0.InternalError,Y)}function uS($,Y){z00($,Y)}function bS($){return I00($)}function Dc0($){return{...$}}function le($,Y){if($){let z=Y;return async(I,Q)=>z(I,Q)}let U=Y;return async(z,I)=>U(I)}function re($){if($===void 0)return;try{return S7($,"output")}catch{return}}function se($,Y,U){if(Y){let z=U;return async(I,Q)=>{let J=await iY(Y,I);if(!J.success)throw new I1(i0.InvalidParams,`Invalid arguments for prompt ${$}: ${J.error}`);return z(J.data,Q)}}else{let z=U;return async(I,Q)=>{return z(Q)}}}function ae($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function te($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function Ac0($){return $?.type==="optional"}function ee($){if(!Ac0($))return $;return $.def?.innerType??$}var $00,aw=1024,Zc0,Y00=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=aw,Y,U){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=U}setServerCapabilities($,Y){if(this._serverCapabilities=$,Y!==void 0)this._serverInfo=Y}has($){return this._subs.has($)}serve($){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:"Subscription limit reached"}};let Y=Xc0($);if(Y===void 0)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let U=Wc0(Y,this._serverCapabilities);return this._subs.set($.id,U),me({method:"notifications/subscriptions/acknowledged",params:{notifications:U}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!Zc0.has($.method))return"passthrough";let Y=$.params?.uri,U=typeof Y==="string"?Y:void 0,z=qc0($.method,U),I=[];for(let[Q,J]of this._subs)if(Hc0(J,z))I.push(me({method:$.method,params:$.params??{}},Q));return I}teardownAll(){let $=[];for(let Y of this._subs.keys())$.push({jsonrpc:"2.0",id:Y,result:{resultType:"complete",_meta:{[fY]:Y,...this._serverInfo!==void 0&&{[s5]:this._serverInfo}}}});return this._subs.clear(),$}},Vc0=8,Lc0=600000,Mc0=class{constructor($){this._host=$}async fulfill($,Y,U,z,I){let{maxRounds:Q,roundTimeoutMs:J}=this._host,K=z.mcpReq.signal,G=I,H=0;while(!0){if(H+=1,H>Q)return xS($,Ve($,Q));let W=G.inputRequests,X=W!=null&&Object.keys(W).length>0,Z=typeof G.requestState==="string"?G.requestState:void 0;if(!X&&Z===void 0)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let q;if(X){let M=this._host.resolvedClientCapabilities(z),F=[];for(let[O,D]of Object.entries(W)){let{embedded:P,required:T}=U00($,O,D);if(P.method!=="roots/list"&&P.params===void 0)throw new I1(i0.InternalError,`Handler for ${$} returned an input request '${O}' of kind '${P.method}' without params`);if(Sw(T,M)!==void 0)return xS($,`Cannot request input '${O}' (${P.method}): the client on this 2025-era connection did not declare the required capability${M===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);F.push([O,P])}let N=Fe(K);try{let O={relatedRequestId:z.mcpReq.id,timeout:J,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:N.signal},D=await Promise.all(F.map(async([P,T])=>{try{return[P,await this._dispatchLeg(T,O)]}catch(A){throw N.abort(A),A}}));q=Object.fromEntries(D)}catch(O){if(K.aborted)throw O;return xS($,`Fulfilling input required by '${$}' failed: ${O instanceof Error?O.message:String(O)}`)}finally{N.dispose()}}else await Le(qe,K);let V={...z,mcpReq:{...z.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:wH(Z)}};if(Z!==void 0){let M=await this._host.verifyRequestState(Z,V,$);if(M!==void 0)V=BS(V,M)}let w=await Y(U,V);if(!Y3(w))return w;G=w}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let U=$.params;if(U.mode==="url"&&U.elicitationId===void 0)U={...U,elicitationId:wc0()};return await this._host.sendElicitation(U,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},Oc0,Nc0,z00,I00,Q00,NH=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson($){let Y=this._registeredTools[$];if(Y===void 0||!Y.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,$))return this._toolInputSchemaJson[$];if(Y.inputSchema===void 0)return oe;try{let U=S7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=U,U}catch{return}}constructor($,Y){if(this.server=new Q00($,Y),Y?.capabilities?.tools)this.setToolRequestHandlers();if(Y?.capabilities?.resources)this.setResourceRequestHandlers();if(Y?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect($){return await this.server.connect($)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,Y])=>{let U={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?S7(Y.inputSchema,"input"):oe,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)U.outputSchema=S7(Y.outputSchema,"output");return U})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let U=this._registeredTools[$.params.name];if(!U)throw new I1(i0.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new I1(i0.InvalidParams,`Tool ${$.params.name} disabled`);try{let z=await this.validateToolInput(U,$.params.arguments,$.params.name),I=await this.executeToolHandler(U,z,Y);if(await this.validateToolOutput(U,I,$.params.name),Y3(I))return I;return this.server.projectCallToolResult(I,U.outputSchemaJson)}catch(z){if(z instanceof I1&&z.code===i0.UrlElicitationRequired)throw z;return this.createToolError(z instanceof Error?z.message:String(z))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,U){if(!$.inputSchema)return;let z=await iY($.inputSchema,Y??{});if(!z.success)throw new I1(i0.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${z.error}`);return z.data}async validateToolOutput($,Y,U){if(!$.outputSchema)return;if(Y3(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new I1(i0.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let z=await iY($.outputSchema,Y.structuredContent);if(!z.success)throw new I1(i0.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${z.error}`)}async executeToolHandler($,Y,U){return $.executor(Y,U)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async($)=>{switch($.params.ref.type){case"ref/prompt":return wS($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return MS($),this.handleResourceCompletion($,$.params.ref);default:throw new I1(i0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let U=this._registeredPrompts[Y.name];if(!U)throw new I1(i0.InvalidParams,`Prompt ${Y.name} not found`);if(!U.enabled)throw new I1(i0.InvalidParams,`Prompt ${Y.name} disabled`);if(!U.argsSchema)return OH;let z=ee(te(U.argsSchema)?.[$.params.argument.name]);if(!fS(z))return OH;let I=Gc0(z);if(!I)return OH;return ae(await I($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let U=Object.values(this._registeredResourceTemplates).find((I)=>I.resourceTemplate.uriTemplate.toString()===Y.uri);if(!U){if(this._registeredResources[Y.uri])return OH;throw new I1(i0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let z=U.resourceTemplate.completeCallback($.params.argument.name);if(!z)return OH;return ae(await z($.params.argument.value,$.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async($,Y)=>{let U=Object.entries(this._registeredResources).filter(([I,Q])=>Q.enabled).map(([I,Q])=>({uri:I,name:Q.name,...Q.metadata})),z=[];for(let I of Object.values(this._registeredResourceTemplates)){if(!I.resourceTemplate.listCallback)continue;let Q=await I.resourceTemplate.listCallback(Y);for(let J of Q.resources)z.push({...I.metadata,...J})}return{resources:[...U,...z]}}),this.server.setRequestHandler("resources/templates/list",async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([$,Y])=>({name:$,uriTemplate:Y.resourceTemplate.uriTemplate.toString(),...Y.metadata}))}}),this.server.setRequestHandler("resources/read",async($,Y)=>{let U;try{U=new URL($.params.uri)}catch{throw new I1(i0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let z=this._registeredResources[U.toString()];if(z){if(!z.enabled)throw new I1(i0.InvalidParams,`Resource ${U} disabled`);return gw(await z.readCallback(U,Y),z.cacheHint)}for(let I of Object.values(this._registeredResourceTemplates)){let Q=I.resourceTemplate.uriTemplate.match(U.toString());if(Q)return gw(await I.readCallback(U,Q,Y),I.cacheHint)}throw new yw($.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,Y])=>{return{name:$,title:Y.title,description:Y.description,arguments:Y.argsSchema?Ze(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new I1(i0.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new I1(i0.InvalidParams,`Prompt ${$.params.name} disabled`);return U.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,U,z){let I=U.cacheHint,Q=U;if(I!==void 0){VS(I,`resource ${$}`);let J={...U};delete J.cacheHint,Q=J}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let J=this._createRegisteredResource($,U.title,Y,Q,z);if(I!==void 0)J.cacheHint=I;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let J=this._createRegisteredResourceTemplate($,U.title,Y,Q,z);if(I!==void 0)J.cacheHint=I;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}}_createRegisteredResource($,Y,U,z,I){let Q={name:$,title:Y,metadata:z,readCallback:I,enabled:!0,disable:()=>Q.update({enabled:!1}),enable:()=>Q.update({enabled:!0}),remove:()=>Q.update({uri:null}),update:(J)=>{if(J.uri!==void 0&&J.uri!==U){if(delete this._registeredResources[U],J.uri)this._registeredResources[J.uri]=Q}if(J.name!==void 0)Q.name=J.name;if(J.title!==void 0)Q.title=J.title;if(J.metadata!==void 0)Q.metadata=J.metadata;if(J.callback!==void 0)Q.readCallback=J.callback;if(J.enabled!==void 0)Q.enabled=J.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=Q,Q}_createRegisteredResourceTemplate($,Y,U,z,I){let Q={resourceTemplate:U,title:Y,metadata:z,readCallback:I,enabled:!0,disable:()=>Q.update({enabled:!1}),enable:()=>Q.update({enabled:!0}),remove:()=>Q.update({name:null}),update:(K)=>{if(K.name!==void 0&&K.name!==$){if(delete this._registeredResourceTemplates[$],K.name)this._registeredResourceTemplates[K.name]=Q}if(K.title!==void 0)Q.title=K.title;if(K.template!==void 0)Q.resourceTemplate=K.template;if(K.metadata!==void 0)Q.metadata=K.metadata;if(K.callback!==void 0)Q.readCallback=K.callback;if(K.enabled!==void 0)Q.enabled=K.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=Q;let J=U.uriTemplate.variableNames;if(Array.isArray(J)&&J.some((K)=>!!U.completeCallback(K)))this.setCompletionRequestHandler();return Q}_createRegisteredPrompt($,Y,U,z,I,Q,J){let K=z,G=I,H={title:Y,description:U,argsSchema:z,icons:Q,_meta:J,handler:se($,z,I),enabled:!0,disable:()=>H.update({enabled:!1}),enable:()=>H.update({enabled:!0}),remove:()=>H.update({name:null}),update:(W)=>{if(W.name!==void 0&&W.name!==$){if(delete this._registeredPrompts[$],W.name)this._registeredPrompts[W.name]=H}if(W.title!==void 0)H.title=W.title;if(W.description!==void 0)H.description=W.description;if(W.icons!==void 0)H.icons=W.icons;if(W._meta!==void 0)H._meta=W._meta;let X=!1;if(W.argsSchema!==void 0)H.argsSchema=W.argsSchema,K=W.argsSchema,X=!0;if(W.callback!==void 0)G=W.callback,X=!0;if(X)H.handler=se($,K,G);if(W.enabled!==void 0)H.enabled=W.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=H,z){let W=te(z);if(W){if(Object.values(W).some((X)=>{return fS(ee(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,U,z,I,Q,J,K,G,H){if(RS($),z!==void 0)try{let Z=S7(z,"input");this._toolInputSchemaJson[$]=Z;let q=OS(Z);if(!q.valid)console.warn(`[mcp-sdk] tool '${$}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${q.reason}`)}catch{}let W=H,X={title:Y,description:U,inputSchema:z,outputSchema:I,outputSchemaJson:re(I),annotations:Q,icons:J,execution:K,_meta:G,handler:H,executor:le(z,H),enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Z)=>{if(Z.name!==void 0&&Z.name!==$){if(typeof Z.name==="string")RS(Z.name);if(delete this._registeredTools[$],delete this._toolInputSchemaJson[$],Z.name)delete this._toolInputSchemaJson[Z.name],this._registeredTools[Z.name]=X,$=Z.name}if(Z.title!==void 0)X.title=Z.title;if(Z.description!==void 0)X.description=Z.description;let q=!1;if(Z.paramsSchema!==void 0)X.inputSchema=Z.paramsSchema,delete this._toolInputSchemaJson[$],q=!0;if(Z.callback!==void 0)X.handler=Z.callback,W=Z.callback,q=!0;if(q)X.executor=le(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=re(Z.outputSchema);if(Z.annotations!==void 0)X.annotations=Z.annotations;if(Z.icons!==void 0)X.icons=Z.icons;if(Z._meta!==void 0)X._meta=Z._meta;if(Z.enabled!==void 0)X.enabled=Z.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=X,this.setToolRequestHandlers(),this.sendToolListChanged(),X}registerTool($,Y,U){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:z,description:I,inputSchema:Q,outputSchema:J,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,z,I,cw(Q),cw(J),K,G,void 0,H,U)}registerPrompt($,Y,U){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:z,description:I,argsSchema:Q,icons:J,_meta:K}=Y,G=this._createRegisteredPrompt($,z,I,cw(Q),U,J,K);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),G}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,Y){return this.server.sendLoggingMessage($,Y)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}},oe,OH;var iS=m(()=>{nw();sw();$00=Symbol.for("mcp.completable");Zc0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);Oc0=new Set(["tools/call","prompts/get","resources/read"]);Q00=class extends TS{_clientCapabilities;_clientVersion;static{Nc0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},z00=($,Y)=>{let U=Y.filter((z)=>!$._supportedProtocolVersions.includes(z));if(U.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...U];$.setRequestHandler("server/discover",()=>$._ondiscover())},I00=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Mc0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,U)=>this._verifyRequestState($,Y,U),sendElicitation:($,Y)=>this._sendElicitationLeg($,Y,{validateAcceptedContent:!1}),sendSampling:($,Y)=>this.createMessage($,Y),listRoots:($,Y)=>this.listRoots($,Y)})}oninitialized;constructor($,Y){super(Y);if(this._serverInfo=$,this._capabilities=Y?.capabilities?{...Y.capabilities}:{},this._instructions=Y?.instructions,this._jsonSchemaValidator=Y?.jsonSchemaValidator??new rw,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=Fc0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[U,z]of Object.entries(Y.cacheHints))if(z!==void 0)VS(z,`cacheHints['${U}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(U)=>this._oninitialize(U)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),GS(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let U=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:z}=$.params,I=iw(C7,z);if(I.success)this._loggingLevels.set(U,I.data);return{}})}buildContext($,Y){let U=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(z,I,Q)=>{if(!this._capabilities.logging)return Promise.resolve();let J;if(this._servedModernEra()){if(J=$.mcpReq.envelope?.[A7],J===void 0)return Promise.resolve()}else J=this._loggingLevels.get($.sessionId)??this._loggingLevels.get(void 0);if(J!==void 0&&this.LOG_LEVEL_SEVERITY.get(z)this.elicitInput(z,I),requestSampling:(z,I)=>this.createMessage(z,I)},http:U?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(C7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let U=this._loggingLevels.get(Y);return U?this.LOG_LEVEL_SEVERITY.get($){let J=await Y(I,Q);if(Y3(J))throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return J};return async(I,Q)=>{let J=z?await this._invokeInputRequiredCapableHandler($,Y,I,Q):await Y(I,Q);if(Y3(J)){if(!z)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return J}return U===void 0?J:gw(J,U)}}return async(U,z)=>{let I=_7(this._negotiatedProtocolVersion),Q=I.validateRequest("tools/call",U);if(!Q.ok)throw new I1(Q.reason==="not-in-era"?i0.InternalError:i0.InvalidParams,Q.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${Q.message}`);let J=await this._invokeInputRequiredCapableHandler("tools/call",Y,U,z);if(Y3(J))return J;let K=HS(J),G=I.validateResult("tools/call",K);if(!G.ok)throw new I1(G.reason==="not-in-era"?i0.InternalError:i0.InvalidParams,G.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${G.message}`);return G.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&fI(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,U,z){let I=this._servedModernEra(),Q=z.mcpReq.requestState();if(Q!==void 0&&typeof Q!=="string")throw new I1(i0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let J=z;if(typeof Q==="string"){let X=await this._verifyRequestState(Q,z,$);if(X!==void 0)J=BS(z,X)}let K;try{K=await Y(U,J)}catch(X){if(X instanceof I1&&X.code===i0.UrlElicitationRequired){if(!I)throw X;throw new I1(i0.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw X}if(!Y3(K))return K;if(!I){if(!this._inputRequiredServing.legacyShim)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??xY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,U,J,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new I1(i0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(H){let X=this._inputRequestCapabilityView(z);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:w}=U00($,Z,q),M=Sw(w,X);if(M!==void 0)throw new kw({requiredCapabilities:M},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,U){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(z){throw this.onerror?.(Error(`requestState verification rejected ${U}: ${z instanceof Error?z.message:String(z)}`)),new I1(i0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[e9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new L1(T1.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${$}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:$,era:"2026-07-28"})}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new L1(T1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new L1(T1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new L1(T1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new L1(T1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new L1(T1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new L1(T1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new L1(T1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new L1(T1.CapabilityNotSupported,`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"completion/complete":if(!this._capabilities.completions)throw new L1(T1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new L1(T1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new L1(T1.CapabilityNotSupported,`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new L1(T1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new L1(T1.CapabilityNotSupported,`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let Y=$.params.protocolVersion;this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo;let U=rt(this._supportedProtocolVersions),z=U.includes(Y)?Y:U[0]??xY;return this._negotiatedProtocolVersion=z,this.transport?.setProtocolVersion?.(z),{protocolVersion:z,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:GS(this._supportedProtocolVersions),capabilities:Dc0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult($,Y){return this._wireCodec().projectCallToolResult($,Y)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage($,Y){if(this._assertPushApiInServedEra("sampling/createMessage"),($.tools||$.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new L1(T1.CapabilityNotSupported,"Client does not support sampling tools capability.");if($.messages.length>0){let Q=$.messages.at(-1),J=Array.isArray(Q.content)?Q.content:[Q.content],K=J.some((X)=>X.type==="tool_result"),G=$.messages.length>1?$.messages.at(-2):void 0,H=G?Array.isArray(G.content)?G.content:[G.content]:[],W=H.some((X)=>X.type==="tool_use");if(K){if(J.some((X)=>X.type!=="tool_result"))throw new I1(i0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new I1(i0.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(W){let X=new Set(H.filter((q)=>q.type==="tool_use").map((q)=>q.id)),Z=new Set(J.filter((q)=>q.type==="tool_result").map((q)=>q.toolUseId));if(X.size!==Z.size||![...X].every((q)=>Z.has(q)))throw new I1(i0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let U=Boolean($.tools||$.toolChoice),z=await this.request({method:"sampling/createMessage",params:$},Y),I=this._wireCodec().samplingResultVariant(U,z);if(!I.ok)throw new L1(T1.InvalidResult,`Invalid sampling/createMessage result: ${I.reason==="invalid"?I.message:I.reason}`);return I.value}async elicitInput($,Y){switch(this._assertPushApiInServedEra("elicitation/create"),$.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new L1(T1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new L1(T1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,U){let z=$.mode??"form",I=U?.validateAcceptedContent??!0;switch(z){case"url":{let Q=$;return this.request({method:"elicitation/create",params:Q},Y)}case"form":{let Q=$.mode==="form"?$:{...$,mode:"form"},J=await this.request({method:"elicitation/create",params:Q},Y);if(I&&J.action==="accept"&&J.content&&Q.requestedSchema)try{let K=this._jsonSchemaValidator.getValidator(Q.requestedSchema)(J.content);if(!K.valid)throw new I1(i0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof I1)throw K;throw new I1(i0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return J}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new L1(T1.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},Y)}async listRoots($,Y){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:$},Y)}async sendLoggingMessage($,Y){if(this._capabilities.logging&&!this.isMessageIgnored($.level,Y))return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};oe={type:"object",properties:{}};OH={completion:{values:[],hasMore:!1}}});var J00=m(()=>{iS();nw();sw()});function Tc0($){let Y=$.params;if($.method==="initialize"&&!NS(Y)){let Q=Y!==null&&typeof Y==="object"&&typeof Y.protocolVersion==="string"?Y.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...Q!==void 0&&{requestedVersion:Q}}}if(!xw(Y))return{kind:"legacy",reason:"no-claim"};let U=nY(Y),z=(U===void 0?[]:uw(U))[0];if(z!==void 0)return{kind:"invalid-envelope",issue:z};let I=fw(Y);if(I===void 0||!v7.includes(I))return{kind:"unsupported-revision",requested:I??"unknown"};return{kind:"modern",revision:I,classification:{era:"modern",revision:I}}}function G00($,Y={}){let U=Y.legacy??"serve",z=Y.transport??new Bc0,I={phase:"opening"},Q,J=!1,K=()=>J||I.phase==="closed",G=(j)=>{try{Y.onerror?.(j)}catch{}},H=(j,C,b,x)=>z.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...x!==void 0&&{data:x}}}).catch((g)=>G(H5(g))),W=new Y00(Y.maxSubscriptions??aw),X=(j)=>{if(!h7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)z.send({jsonrpc:"2.0",...b}).catch((x)=>G(H5(x)));return"handled"},Z=async(j)=>{if(P$(j)&&j.method==="subscriptions/listen"){let C=nY(j.params),b=xw(j.params)?(C===void 0?[]:uw(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},x=fw(j.params),g;if(b!==void 0)g={jsonrpc:"2.0",id:j.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(x===void 0||!v7.includes(x)){let i=new uI({supported:[...v7],requested:x??"unknown"});g={jsonrpc:"2.0",id:j.id,error:{code:i.code,message:i.message,data:i.data}}}else g=W.serve(j);return await z.send("error"in g?g:{jsonrpc:"2.0",method:g.method,params:g.params}).catch((i)=>G(H5(i))),!0}if(h7(j)&&j.method==="notifications/cancelled"){let C=j.params?.requestId;if(C!==void 0&&W.cancel(C))return!0}return!1},q=(j,C,b)=>{let x=DS({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},v7);if(x===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${x.cell}): ${x.message}`)),H(j.id,x.code,x.message,x.data)},V=(j)=>{if(J||j===Q)return;T()},w=async(j,C)=>{let b=await $({era:j}),x=b instanceof NH?b.server:b;if(j==="modern")PS(x,C),uS(x,v7),W.setServerCapabilities(x.getCapabilities(),bS(x));let g=new Pc0(z,()=>V(g),j==="modern"?X:void 0);return await b.connect(g),{product:b,channel:g}},M=(j)=>j.product.close().catch((C)=>G(H5(C))),F=async(j)=>{Q=j.channel;try{if(!await j.channel.whenRequestsAnswered(K00))G(Error(`Discarded the probe instance with requests still unanswered after ${K00}ms; continuing with the fallback`));await j.product.close()}catch(C){G(H5(C))}finally{Q=void 0}},N=async(j)=>{if(I.phase==="closed")return;if(I.phase==="pinned"){if(I.era==="modern"&&P$(j)&&j.method==="initialize"&&!NS(j.params)){await q(j,"initialize",j.params!==null&&typeof j.params==="object"&&typeof j.params.protocolVersion==="string"?j.params.protocolVersion:void 0);return}if(I.era==="modern"&&await Z(j))return;I.instance.channel.deliver(j);return}if(!P$(j)&&!h7(j)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=Tc0(j);switch(C.kind){case"invalid-envelope":{let b=`Invalid _meta envelope for protocol revision 2026-07-28: ${C.issue.key}: ${C.issue.problem}`;if(P$(j))await H(j.id,i0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(P$(j)){let b=new uI({supported:[...v7],requested:C.requested});G(b),await H(j.id,b.code,b.message,b.data)}else G(Error(`Discarded a notification claiming unsupported protocol revision ${C.requested}`));return;case"modern":if(P$(j)&&j.method==="server/discover"){if(I.phase==="probe"){I.instance.channel.deliver(j,{classification:C.classification});return}let b=await w("modern",C.revision);if(K()){await M(b);return}I={phase:"probe",instance:b},b.channel.deliver(j,{classification:C.classification});return}if(I.phase==="probe"){if(h7(j)){I.instance.channel.deliver(j,{classification:C.classification});return}I={phase:"pinned",era:"modern",instance:I.instance}}else{let b=await w("modern",C.revision);if(K()){await M(b);return}I={phase:"pinned",era:"modern",instance:b}}if(await Z(j))return;I.instance.channel.deliver(j,{classification:C.classification});return;case"legacy":{if(U==="reject"){if(P$(j))await q(j,C.reason,C.requestedVersion);return}if(I.phase==="probe"){if(await F(I.instance),K())return;I={phase:"opening"}}let b=await w("legacy");if(K()){await M(b);return}I={phase:"pinned",era:"legacy",instance:b},I.instance.channel.deliver(j);return}}},O=[],D=!1,P=async()=>{if(D)return;D=!0;try{while(O.length>0){let j=O.shift();try{await N(j)}catch(C){if(P$(j))await H(j.id,i0.InternalError,"Internal server error");G(H5(C))}}}finally{D=!1}},T=async()=>{if(J||I.phase==="closed")return;J=!0;let j=I;I={phase:"closed"};for(let C of W.teardownAll())await z.send(C).catch((b)=>G(H5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(H5(C)));await z.close().catch((C)=>G(H5(C)))};z.onmessage=(j)=>{O.push(j),P()},z.onerror=(j)=>{if(G(j),I.phase==="probe"||I.phase==="pinned")I.instance.channel.onerror?.(j)},z.onclose=()=>{if(J||I.phase==="closed")return;J=!0;let j=I;if(I={phase:"closed"},j.phase==="probe"||j.phase==="pinned")j.instance.product.close().catch((C)=>G(H5(C)))};let A=z.start().catch((j)=>{throw G(H5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function H5($){return $ instanceof Error?$:Error(String($))}var Bc0=class{_readBuffer;_started=!1;_closed=!1;constructor($=kS.stdin,Y=kS.stdout,U){this._stdin=$,this._stdout=Y,this._readBuffer=new ES({maxBufferSize:U?.maxBufferSize})}onclose;onerror;onmessage;_ondata=($)=>{try{this._readBuffer.append($),this.processReadBuffer()}catch(Y){this.onerror?.(Y),this.close().catch(()=>{})}};_onerror=($)=>{this.onerror?.($)};_onstdouterror=($)=>{this.onerror?.($),this.close().catch(()=>{})};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),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._closed)return;if(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){if(this._closed)return Promise.reject(Error("StdioServerTransport is closed"));return new Promise((Y,U)=>{let z=CS($),I=!1,Q=(K)=>{if(I)return;I=!0,this._stdout.off("error",Q),this._stdout.off("drain",J),U(K)},J=()=>{if(I)return;I=!0,this._stdout.off("error",Q),this._stdout.off("drain",J),Y()};if(this._stdout.once("error",Q),this._stdout.write(z)){if(I)return;I=!0,this._stdout.off("error",Q),Y()}else if(!I)this._stdout.once("drain",J)})}},K00=3000,Pc0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,U){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=U}async start(){}async send($,Y){if(VH($)||bw($)){let{id:U}=$;if(U!==void 0)this._settle(U)}if(this._closed)return;if(this._outboundIntercept?.($)==="handled")return;return this._wire.send($,Y)}setProtocolVersion=($)=>{this._wire.setProtocolVersion?.($)};deliver($,Y){if(this._closed)return;if(P$($))this._pendingRequests.add($.id);else if(h7($)&&$.method==="notifications/cancelled"){let U=$.params?.requestId;if(U!==void 0)this._settle(U)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let U=()=>{clearTimeout(z),Y(!0)},z=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((I)=>I!==U),Y(!1)},$);this._drainWaiters.push(U)})}async close(){if(this._closed)return;this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}_settle($){if(this._pendingRequests.delete($),this._pendingRequests.size===0)this._releaseDrainWaiters()}_releaseDrainWaiters(){let $=this._drainWaiters;this._drainWaiters=[];for(let Y of $)Y()}};var H00=m(()=>{iS();nw();sw()});var T$=m(()=>{xL();xL()});var U3;var DH=m(()=>{U3=class U3 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var tw=m(()=>{DH();D6=class D6 extends U3{name="HTTPError";response;request;options;data;constructor($,Y,U){let z=$.status||$.status===0?$.status:"",I=$.statusText??"",Q=`${z} ${I}`.trim(),J=Q?`status code ${Q}`:"an unknown error";super(`Request failed with ${J}: ${Y.method} ${Y.url}`);this.response=$,this.request=Y,this.options=U}}});var AH;var cS=m(()=>{DH();AH=class AH extends U3{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var BH;var nS=m(()=>{BH=class BH extends Error{name="NonError";value;constructor($){let Y="Non-error value was thrown";try{if(typeof $==="string")Y=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")Y=$.message}catch{}super(Y);this.value=$}}});var cI;var W00=m(()=>{DH();nS();cI=class cI extends U3{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new BH($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",Y?{cause:Y}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}});var pS;var X00=m(()=>{pS=class pS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var W5;var ew=m(()=>{DH();W5=class W5 extends U3{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class zM{options;constructor($){this.options=$}}var dS,Z00,$M,q00,V00,YM,jc0=()=>{return},L00,nI=2147483647,F00=40,UM,w00=($)=>new zM($),M00,O00;var pY=m(()=>{dS=(()=>{let $=!1,Y=!1,U=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(U&&z)try{Y=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(I){if(I instanceof Error&&I.message==="unsupported BodyInit type")return!1;throw I}return $&&!Y})(),Z00=typeof globalThis.AbortController==="function",$M=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",q00=typeof globalThis.ReadableStream==="function",V00=typeof globalThis.FormData==="function",YM=["get","post","put","patch","head","delete"];jc0();L00={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},UM=Symbol("stop");M00={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},O00={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 IM,Ec0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[U,z]of $)Y+=F00,Y+=IM.encode(`Content-Disposition: form-data; name="${U}"`).byteLength,Y+=typeof z==="string"?IM.encode(z).byteLength:z.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return IM.encode($).byteLength;if($ instanceof URLSearchParams)return IM.encode($.toString()).byteLength;return 0},N00=($,Y,U)=>{let z,I=0;return $.pipeThrough(new TransformStream({transform(Q,J){if(J.enqueue(Q),z){I+=z.byteLength;let K=Y===0?0:I/Y;if(K>=1)K=1-Number.EPSILON;U?.({percent:K,totalBytes:Math.max(Y,I),transferredBytes:I},z)}z=Q},flush(){if(z)I+=z.byteLength,U?.({percent:1,totalBytes:Math.max(Y,I),transferredBytes:I},z)}}))},D00=($,Y)=>{if(!$.body)return $;let U={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,U);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(N00($.body,z,Y),U)},A00=($,Y,U)=>{if(!$.body)return $;let z=Ec0(U??$.body);return new Request($,{duplex:"half",body:N00($.body,z,Y)})};var B00=m(()=>{pY();IM=new TextEncoder});var a5=($)=>$!==null&&typeof $==="object";function PH($,Y,U){return Object.hasOwn(Y,U)&&Y[U]===void 0?[]:rS($[U]??[],Y[U]??[])}var Cc0,mS=($)=>a5($)&&$[Cc0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},TH=(...$)=>{for(let Y of $)if((!a5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return rS({},...$)},oS=($={},Y={})=>{let U=new globalThis.Headers($),z=Y instanceof globalThis.Headers,I=new globalThis.Headers(Y);for(let[Q,J]of I.entries())if(z&&J==="undefined"||J===void 0)U.delete(Q);else U.set(Q,J);return U},lS=($)=>{if(!a5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},pI=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),U=$[g7];if(U)Y[g7]=new Set(U);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(lS($))return{...$};return $},Rc0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),_c0=($,Y)=>{if(lS($)&&lS(Y))return Rc0({...$,...Y});return oS($,Y)},QM=($={},Y={})=>({init:PH($,Y,"init"),beforeRequest:PH($,Y,"beforeRequest"),beforeRetry:PH($,Y,"beforeRetry"),beforeError:PH($,Y,"beforeError"),afterResponse:PH($,Y,"afterResponse")}),g7,vc0=($,Y)=>{let U=new URLSearchParams,z=new Set;for(let I of[$,Y]){if(I===void 0)continue;if(I instanceof URLSearchParams){for(let[J,K]of I.entries())U.append(J,K),z.delete(J);let Q=I[g7];if(Q)for(let J of Q)U.delete(J),z.add(J)}else if(Array.isArray(I))for(let Q of I){if(!Array.isArray(Q)||Q.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");U.append(String(Q[0]),String(Q[1])),z.delete(String(Q[0]))}else if(a5(I))for(let[Q,J]of Object.entries(I))if(J===void 0)U.delete(Q),z.add(Q);else U.append(Q,String(J)),z.delete(Q);else{let Q=new URLSearchParams(I);for(let[J,K]of Q.entries())U.append(J,K),z.delete(J)}}if(z.size>0)U[g7]=z;return U},rS=(...$)=>{let Y={},U={},z={},I,Q=[];for(let J of $)if(Array.isArray(J)){if(!Array.isArray(Y))Y=[];Y=[...Y,...J]}else if(a5(J)){for(let[K,G]of Object.entries(J)){if(K==="signal"&&G instanceof globalThis.AbortSignal){Q.push(G);continue}let H=mS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!a5(G)||Array.isArray(G)))throw TypeError("The `context` option must be an object");Y={...Y,context:G===void 0||G===null?{}:W?{...G}:{...Y.context,...G}};continue}if(K==="searchParams"){if(G===void 0||G===null)I=void 0;else if(W)I=G;else I=I===void 0?G:vc0(I,G);continue}if(a5(G)&&!W&&K in Y)G=rS(Y[K],G);Y={...Y,[K]:G}}if(a5(J.hooks)){let{value:K,isReplace:G}=mS(J.hooks);z=G?QM({},K):QM(z,K),Y.hooks=z}if(a5(J.headers)){let{value:K,isReplace:G}=mS(J.headers);U=G?pI(K):_c0(U,K),Y.headers=U}}if(I!==void 0)Y.searchParams=I;if(Q.length>0)if(Q.length===1)Y.signal=Q[0];else if($M)Y.signal=AbortSignal.any(Q);else Y.signal=Q.at(-1);return Y};var JM=m(()=>{pY();Cc0=Symbol("replaceOption");g7=Symbol("deletedParameters")});var T00=($)=>YM.includes($)?$.toUpperCase():$,hc0,Sc0,gc0,P00,j00=($={})=>{if(typeof $==="number")return{...P00,limit:$};if($.methods&&!Array.isArray($.methods))throw Error("retry.methods must be an array");if($.statusCodes&&!Array.isArray($.statusCodes))throw Error("retry.statusCodes must be an array");let Y=Object.fromEntries(Object.entries({...$,methods:$.methods?.map((U)=>U.toLowerCase())}).filter(([,U])=>U!==void 0));return{...P00,...Y}};var E00=m(()=>{pY();hc0=["get","put","head","delete","options","trace"],Sc0=[408,413,429,500,502,503,504],gc0=[413,429,503],P00={limit:2,methods:hc0,statusCodes:Sc0,afterStatusCodes:gc0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function sS($,Y,U,z){return new Promise((I,Q)=>{let J=setTimeout(()=>{if(U)U.abort();Q(new W5($))},z.timeout);z.fetch($,Y).then(I).catch(Q).then(()=>{clearTimeout(J)})})}var C00=m(()=>{ew()});async function KM($,{signal:Y}){return new Promise((U,z)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",I,{once:!0});function I(){clearTimeout(Q),z(Y.reason)}let Q=setTimeout(()=>{Y?.removeEventListener("abort",I),U()},$)})}var R00=($)=>{let Y={};for(let U in $){if(!Object.hasOwn($,U))continue;if(!(U in O00)&&!(U in M00))Y[U]=$[U]}return Y},_00=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[g7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var v00=m(()=>{pY();JM()});function aS($){if(!($&&kc0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:U,stack:z}=$;if(U==="Load failed")return z===void 0||"__sentry_captured__"in $;if(U.startsWith("error sending request for url"))return!0;if(U==="Failed to fetch"||U.startsWith("Failed to fetch (")&&U.endsWith(")"))return!0;return xc0.has(U)}var yc0,kc0=($)=>yc0.call($)==="[object Error]",xc0;var h00=m(()=>{yc0=Object.prototype.toString,xc0=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"])});function S00($){return tS($,D6)}function g00($){return tS($,AH)}function y00($){return tS($,W5)}var tS=($,Y)=>$ instanceof Y||$?.name===Y.name;var k00=m(()=>{tw();cS();ew()});function nc0($){let Y={...$,json:pI($.json),context:pI($.context),headers:pI($.headers),searchParams:cc0($.searchParams)};if($.retry!==void 0)Y.retry=ic0($.retry);return Y}class dI{static create($,Y){let U=Y.hooks?.init??[],z=U.length>0?nc0(Y):Y;for(let K of U)K(z);let I=new dI($,z),Q=async()=>{if(typeof I.#$.timeout==="number"&&I.#$.timeout>nI)throw RangeError(`The \`timeout\` option cannot be greater than ${nI}`);if(typeof I.#$.totalTimeout==="number"&&I.#$.totalTimeout>nI)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${nI}`);await Promise.resolve();let K=await I.#g(),G=K??await I.#h(async()=>I.#R()),H=K!==void 0||I.#C();for(;;){if(G===void 0)return G;if(EH(G))try{G=await I.#y(G)}catch(X){if(!(X instanceof cI))throw X;let Z=await I.#E(X,async()=>I.#R());if(Z===void 0)return Z;G=Z,H=I.#C();continue}let W=G;if(!W.ok&&W.type!=="opaque"&&(typeof I.#$.throwHttpErrors==="function"?I.#$.throwHttpErrors(W.status):I.#$.throwHttpErrors)){let X=new D6(W,I.#O(W),I.#M()),Z=X;if(X.data=await I.#L(W),H)throw Z;let q=await I.#E(X,async()=>I.#R());if(q===void 0)return q;G=q,H=I.#C();continue}break}if(!EH(G))return G;if(I.#V(G),I.#$.onDownloadProgress){if(typeof I.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!q00)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return I.#K(G),D00(W,I.#$.onDownloadProgress)}return G},J=(async()=>{try{return await Q()}catch(K){if(!(K instanceof Error))throw K;if(I.#X.has(K))throw K;let G=K;for(let H of I.#$.hooks.beforeError){let W=await H({request:I.request,options:I.#M(),error:G,retryCount:I.#I});if(W instanceof Error)G=W}throw G}finally{let K=I.#W;if(I.#F(K?.body??void 0),I.request!==K)I.#F(I.request.body??void 0)}})();for(let[K,G]of Object.entries(L00)){if(K==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;J[K]=async(H)=>{I.request.headers.set("accept",I.request.headers.get("accept")||G);let W=await J;if(K!=="json")return W[K]();let X=await W.text();if(X===""){if(H!==void 0)return u00(void 0,H);return JSON.parse(X)}let Z=z.parseJson?await z.parseJson(X,{request:I.#O(W),response:W}):JSON.parse(X);return H===void 0?Z:u00(Z,H)}}return J}static#z($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#U;#I=0;#Y;#$;#W;#H;#X=new WeakSet;#Q;#J;#Z=!1;#N=new WeakMap;constructor($,Y={}){if(this.#Y=$,Object.hasOwn(Y,"prefixUrl"))throw Error(uc0);if(this.#$={...Y,headers:oS(this.#Y.headers,Y.headers),hooks:QM({},Y.hooks),method:T00(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:j00(Y.retry),throwHttpErrors:Y.throwHttpErrors??!0,timeout:Y.timeout??1e4,totalTimeout:Y.totalTimeout??!1,fetch:Y.fetch??globalThis.fetch.bind(globalThis),context:Y.context??{}},typeof this.#Y!=="string"&&!(this.#Y instanceof URL||this.#Y instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#Y==="string"){if(this.#$.prefix){let z=this.#$.prefix.replace(/\/+$/,""),I=this.#Y.replace(/^\/+/,"");this.#Y=`${z}/${I}`}if(this.#$.baseUrl){let z;try{z=new URL(this.#Y)}catch{}if(!z)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if(Z00&&$M)this.#H=this.#$.signal??this.#Y.signal,this.#U=new globalThis.AbortController,this.#$.signal=this.#w();if(dS)this.#$.duplex="half";if(this.#$.json!==void 0)this.#$.body=this.#$.stringifyJson?.(this.#$.json)??JSON.stringify(this.#$.json),this.#$.headers.set("content-type",this.#$.headers.get("content-type")??"application/json");let U=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(V00&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!U)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),_00(this.#$.searchParams)){let z=new URL(this.request.url),I=this.#$.searchParams?.[g7];if(I)for(let Q of I)z.searchParams.delete(Q);if(typeof this.#$.searchParams==="string"){let Q=this.#$.searchParams.replace(/^\?/,"");if(Q!=="")z.search=z.search?`${z.search}&${Q}`:`?${Q}`}else{let Q=new URLSearchParams(dI.#z(this.#$.searchParams));for(let[J,K]of Q.entries())z.searchParams.append(J,K)}if(this.#$.searchParams&&typeof this.#$.searchParams==="object"&&!Array.isArray(this.#$.searchParams)&&!(this.#$.searchParams instanceof URLSearchParams)){for(let[Q,J]of Object.entries(this.#$.searchParams))if(J===void 0)z.searchParams.delete(Q)}this.request=new globalThis.Request(z,this.#$)}if(this.#$.onUploadProgress&&typeof this.#$.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");this.#J=typeof this.#$.totalTimeout==="number"?this.#S():void 0}#G(){let $=this.#$.retry.delay(this.#I+1),Y=$;if(this.#$.retry.jitter===!0)Y=Math.random()*$;else if(typeof this.#$.retry.jitter==="function"){if(Y=this.#$.retry.jitter($),!Number.isFinite(Y)||Y<0)Y=$}return Math.min(this.#$.retry.backoffLimit,Y)}async#P($){if(this.#I>=this.#$.retry.limit)throw $;let Y=$ instanceof Error?$:new BH($);if(Y instanceof cI)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let U=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#I+1});if(U===!1)throw $;if(U===!0)return this.#G()}if(y00($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(S00($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let U=$.response.headers.get("Retry-After")??$.response.headers.get("RateLimit-Reset")??$.response.headers.get("X-RateLimit-Retry-After")??$.response.headers.get("X-RateLimit-Reset")??$.response.headers.get("X-Rate-Limit-Reset");if(U&&this.#$.retry.afterStatusCodes.includes($.response.status)){let z=Number(U)*1000;if(Number.isNaN(z))z=Date.parse(U)-Date.now();else if(z>=Date.parse("2024-01-01"))z-=Date.now();if(!Number.isFinite(z))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return z=Math.max(0,z),Math.min(this.#$.retry.maxRetryAfter,z)}if($.response.status===413)throw $;return this.#G()}if(!g00($))throw $;return this.#G()}#V($){let Y=this.#O($);if(this.#$.parseJson)$.json=async()=>{let U=await $.text();if(U==="")return JSON.parse(U);return this.#$.parseJson(U,{request:Y,response:$})};return $}async#L($){let Y=await this.#T($,this.#D());if(Y===jH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let U=await this.#j(Y,$,this.#D(),this.#O($));if(U===jH){this.#q();return}return U}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#B();if(Y===void 0)return $;if(Y<=0)throw new W5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#T($,Y){let{body:U}=$;if(!U)try{return await $.text()}catch{return}let z;try{z=U.getReader()}catch{return}let I=bc0($.headers.get("content-type")??""),Q=[],J=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await z.read();if(W)break;if(J+=X.byteLength,J>fc0){z.cancel().catch(()=>{return});return}Q.push(I.decode(X,{stream:!0}))}}catch{return}return Q.push(I.decode()),Q.join("")})(),G=new Promise((W)=>{let X=setTimeout(()=>{W(jH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===jH)z.cancel().catch(()=>{return});return H}async#j($,Y,U,z){let I;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:z,response:Y}):JSON.parse($)),new Promise((Q)=>{I=setTimeout(()=>{Q(jH)},U)})])}catch{return}finally{clearTimeout(I)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#w(){return this.#H?AbortSignal.any([this.#H,this.#U.signal]):this.#U.signal}#q(){let $=this.#B();if($!==void 0&&$<=0)throw new W5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#M(),retryCount:0});if(f00(Y))this.#_(Y);else if(EH(Y))return Y}return}async#y($){let Y=this.#O($);for(let U of this.#$.hooks.afterResponse){let z=this.#v($.clone(),Y);this.#V(z);let I;try{I=await U({request:this.request,options:this.#M(),response:z,retryCount:this.#I})}catch(J){if(z!==$)this.#K(z);throw this.#K($),J}if(I instanceof zM){if(z!==$)this.#K(z);throw this.#K($),new cI(I.options)}let Q=EH(I)?this.#v(I,Y):$;if(z!==$&&z!==Q&&z.body!==Q.body)this.#K(z);if($!==Q&&$.body!==Q.body)this.#K($);$=Q}return $}async#h($){try{return await $()}catch(Y){return this.#E(Y,$)}}async#E($,Y){this.#Z=!1;let U=Math.min(await this.#P($),nI),z={signal:this.#H},I=this.#B();if(I!==void 0){if(I<=0)throw new W5(this.request);if(U>=I)throw await KM(I,z),new W5(this.request)}if(await KM(U,z),this.#q(),$ instanceof cI&&$.customRequest){let Q=new globalThis.Request($.customRequest,this.#$.signal?{signal:this.#$.signal}:void 0);this.#_(Q)}for(let Q of this.#$.hooks.beforeRetry){let J;try{J=await Q({request:this.request,options:this.#M(),error:$,retryCount:this.#I+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(f00(J)){this.#_(J);break}if(EH(J))return this.#Z=!0,this.#I++,J;if(J===UM)return}return this.#q(),this.#I++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#U?.signal.aborted)this.#U=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=R00(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,U=this.#k(this.request,this.#$.body??void 0);if(this.#W=U,Y)this.request=Y;try{let z=this.#B();if(z!==void 0&&z<=0)throw new W5(this.request);let I=this.#$.timeout===!1?z:z===void 0?this.#$.timeout:Math.min(this.#$.timeout,z),Q=I===void 0?await this.#$.fetch(U,$):await sS(U,$,this.#U,{timeout:I,fetch:this.#$.fetch});return this.#v(Q,U)}catch(z){if(aS(z))throw new AH(this.request,{cause:z});throw z}}#B(){if(this.#J===void 0)return;let $=this.#S()-this.#J;return Math.max(0,this.#$.totalTimeout-$)}#S(){return globalThis.performance?.now()??Date.now()}#M(){if(!this.#Q){let{hooks:$,json:Y,parseJson:U,stringifyJson:z,searchParams:I,timeout:Q,totalTimeout:J,throwHttpErrors:K,fetch:G,...H}=this.#$;this.#Q=Object.freeze(H)}return this.#Q}#_($){this.#Q=void 0,this.request=$}#O($){return this.#N.get($)??this.request}#v($,Y){return this.#N.set($,Y),$}#k($,Y){if(!this.#$.onUploadProgress||!$.body||!dS)return $;return A00($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var fc0=10485760,uc0="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",jH,bc0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),U=Y?.[1]??Y?.[2];if(U)try{return new TextDecoder(U)}catch{}return new TextDecoder},x00="The `schema` argument must follow the Standard Schema specification",ic0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},b00,f00=($)=>$ instanceof globalThis.Request||b00.call($)==="[object Request]",EH=($)=>$ instanceof globalThis.Response||b00.call($)==="[object Response]",cc0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return pI($)},u00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(x00);let U=Y["~standard"];if(typeof U!=="object"||U===null||typeof U.validate!=="function")throw TypeError(x00);let z=await U.validate($);if(z.issues)throw new pS(z.issues);return z.value};var i00=m(()=>{tw();cS();nS();W00();X00();ew();B00();JM();E00();C00();v00();h00();k00();pY();jH=Symbol("timedOutResponseData"),b00=Object.prototype.toString});var eS=($)=>{let Y=(U,z)=>dI.create(U,TH($,z));for(let U of YM)Y[U]=(z,I)=>dI.create(z,TH($,I,{method:U}));return Y.create=(U)=>eS(TH(U)),Y.extend=(U)=>{if(typeof U==="function")U=U($??{});return eS(TH($,U))},Y.stop=UM,Y.retry=w00,Y},pc0,X5;var mI=m(()=>{i00();pY();JM();tw();/*! MIT License © Sindre Sorhus */pc0=eS(),X5=pc0});async function c00($){if($.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,U=$.source.expiresAt?new Date($.source.expiresAt).getTime():Date.now()+$.source.expiresIn*1000;return{token:$.source.token,expiresAt:U,enterprise:{provider:$.source.provider??"seal",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:$.source.tenantId,tenantSlug:$.seal.tenantSlug??$.source.tenantSlug,tenantName:$.source.tenantName,raw:{sourceType:$.source.type}}}}function dc0($){let Y=Object.entries($??{}).map(([U,z])=>`${U}=${z}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},U=dc0($?.cookies);if(U)Y.Cookie=U;return Y}var n00,mc0,lc0,oc0,rc0,p00;var d00=m(()=>{T$();n00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),mc0=L.object({provider:L.string(),corpId:L.string().optional(),staffId:L.string(),sealUrl:L.string().url(),tenantId:L.string().optional(),tenantSlug:L.string().optional(),tenantName:L.string().optional(),raw:L.unknown().optional()}),lc0=L.object({token:L.string(),expiresAt:L.number(),enterprise:mc0}),oc0=L.object({openapi:n00.optional(),closeapi:n00.optional()}),rc0=L.object({seal:lc0.optional(),hose:oc0.optional()}),p00=L.record(L.string(),rc0)});import{existsSync as $g,mkdirSync as sc0,readFileSync as ac0,writeFileSync as tc0}from"node:fs";import{dirname as ec0,join as l00}from"node:path";import{homedir as o00}from"node:os";function $n0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if($g(GM))return GM;if($g(m00))return m00;return GM}function Yn0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return GM}function lI(){let $=$n0();if(!$g($))return{};try{return p00.parse(JSON.parse(ac0($,"utf-8")))}catch{return{}}}function HM($){let Y=Yn0();sc0(ec0(Y),{recursive:!0,mode:448}),tc0(Y,JSON.stringify($,null,2),{mode:384})}function r00($){return lI()[$]?.seal}function s00($,Y){let U=lI();HM({...U,[$]:{...U[$],seal:Y}})}function a00($){let Y=lI(),U=Y[$];if(!U)return;HM({...Y,[$]:{...U,seal:void 0}})}function CH($){return lI()[$]?.hose??{}}function Yg($,Y){let U=lI();HM({...U,[$]:{...U[$],hose:Y}})}function WM($){let Y=lI();delete Y[$],HM(Y)}var GM,m00;var RH=m(()=>{d00();GM=l00(o00(),".config","seal-use","seal_tokens.json"),m00=l00(o00(),".config","seal-home","seal_tokens.json")});function j$($){return $.replace(/\/+$/,"")}function XM($){let Y;try{Y=new URL($.trim())}catch{throw Error("Invalid Hose assistance link: expected a valid HTTPS URL")}if(Y.protocol!=="https:"||Y.port||!Qn0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==In0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let U=Y.searchParams.getAll("accessToken").filter(Boolean),z=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(U.length!==1||z.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let I=z[0].trim().toLowerCase();if(!e00.test(I))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:I,accessToken:U[0],baseUrl:Y.origin}}async function ZM($,Y){let U=typeof $==="string"?XM($):$10($),z=`https://${U.corpId}.sealai.cc`,Q=await B6(z,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:U.accessToken,returnToken:"1"}}).json(),J=Q.token??Q.accessToken??Q.data?.token??Q.data?.accessToken;if(!J)throw Error("Seal SSO did not return a bearer token");let K=Q.expiresIn??Q.expires_in??Q.data?.expiresIn??Q.data?.expires_in??3600;return{corpId:U.corpId,sealUrl:z,token:J,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function qM($,Y){let U=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,z=[Y.tenantSlug,U?.corporationId].filter((J)=>typeof J==="string"&&Boolean(J)),I=$.trim().toLowerCase(),Q=z.map((J)=>J.trim().toLowerCase()).filter(Boolean);if(Q.length===0||Q.some((J)=>J!==I))throw Error("Hose assistance link tenant mismatch: the Seal tenant does not match ekbCorpId")}function Qn0($){let Y=$.toLowerCase();return zn0.some((U)=>Y.endsWith(U))}function $10($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",U=typeof $?.accessToken==="string"?$.accessToken.trim():"",z=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!e00.test(Y)||!U)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:U,...z?{baseUrl:z}:{}}}function Y10($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function y7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function Jn0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function U10($){return X5.create({prefix:j$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let U=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${U?`: ${U}`:""}`,Y}]}})}async function Kn0($){let Y=U10($),U=$.appKey??$.key,z=$.appSecurity??$.password;if(!U||!z)throw Error("Hose source has no OpenAPI credentials; the configured closeToken is only valid for Hose web-session APIs");let I=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:U,appSecurity:z}}).json(),Q=I.value?.accessToken??I.accessToken??I.token;if(!Q)throw Error("Hose login did not return an access token");return{token:Q,expiresAt:Date.now()+3600000}}async function oI($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=CH($.id);if(Y10(Y.openapi))return Y.openapi.token;let U=Ug.get($.id);if(U)return U;let z=Kn0($.source).then((I)=>{return Yg($.id,{...CH($.id),openapi:I}),I.token}).finally(()=>Ug.delete($.id));return Ug.set($.id,z),z}async function VM($,Y,U=7200){let z=U10($),I=Jn0($),J=(await z.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:I,pageType:"home",expireDate:U}}).json()).value?.message;if(!J)throw Error("Hose CloseAPI did not return a provisional auth URL");let K=new URL(J).searchParams.get("accessToken");if(!K)throw Error("Hose provisional auth URL did not include accessToken");return{token:K,url:J,expiresAt:Date.now()+U*1000}}async function LM($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source;if(Y.closeToken){let Q=Y.expiresAt?Date.parse(Y.expiresAt):Number.MAX_SAFE_INTEGER;if(Q!==Number.MAX_SAFE_INTEGER&&Date.now()>=Q)throw Error("Configured Hose closeToken has expired; import a fresh Hose web session");return{token:Y.closeToken,expiresAt:Q}}let U=CH($.id);if(Y10(U.closeapi)&&U.closeapi.url)return U.closeapi;let z=zg.get($.id);if(z)return z;let I=oI($).then((Q)=>VM(Y,Q)).then((Q)=>{return Yg($.id,{...CH($.id),closeapi:Q}),Q}).finally(()=>zg.delete($.id));return zg.set($.id,I),I}async function z10($,Y=7200,U){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);if(!Number.isFinite(Y)||Y<=0)throw Error(`Invalid expire seconds: ${Y}. Must be a positive integer.`);let z=await oI($),I=await VM($.source,z,Y);if(!I.url)throw Error("Hose provisional auth URL was not available");return{corpId:$.source.corpId,staffId:$.source.staffId,url:I.url,token:I.token,expiresIn:Y}}async function I10($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await LM($),U=y7($,$.source),z=A6($.seal),Q=await B6(U,void 0,z).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:Y.token,returnToken:"1"}}).json(),J=Q.token??Q.accessToken??Q.data?.token??Q.data?.accessToken;if(!J)throw Error("Seal SSO did not return a bearer token");let K=Q.expiresIn??Q.expires_in??Q.data?.expiresIn??Q.data?.expires_in??3600,G={provider:"hose",corpId:$.source.corpId,staffId:$.source.staffId,sealUrl:j$(U),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:j$($.source.domain)}};return{token:J,expiresAt:Date.now()+K*1000,enterprise:G}}async function rI($,Y,U){if(U){let J=j$(U),K=await t00(J,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${J}. Please verify appKey/appSecurity and domain connectivity.`);return K}let z=Un0.map(async(J)=>{try{return await t00(J,$,Y)}catch{return}}),Q=(await Promise.all(z)).filter((J)=>Boolean(J));if(Q.length>0&&Q[0])return Q[0];throw Error("Failed to authenticate with appKey/appSecurity on all 6 standard Hose domains (app.ekuaibao.com, dd2.hosecloud.com, wx2.ekuaibao.com, kdcloud2.ekuaibao.com, ddenterprise.ekuaibao.com, feishu.ekuaibao.com). "+'If your enterprise uses a private cloud or custom domain (such as 美年大健康), please specify the "domain" parameter explicitly.')}async function t00($,Y,U){try{let z=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:U}),signal:AbortSignal.timeout(8000)});if(!z.ok)return;let I=await z.json();if(I.value?.errorCode)return;let Q=I.value?.accessToken??I.accessToken,J=I.value?.corporationId??I.value?.corporation?.id;if(!Q||!J)return;return{domain:$,corpId:J,corpName:I.value?.corporation?.name,openapiToken:Q,expireTime:I.value?.expireTime}}catch{return}}async function FM($,Y){let U=`${j$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,z=await fetch(U,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!z.ok){let J=await z.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${z.status} ${J}`)}return((await z.json()).items??[]).map((J)=>({id:J.id,name:J.name,enName:J.enName,roleDefs:(J.roleDefs??[]).map((K)=>({id:K.id,name:K.name,enName:K.enName,sourceType:K.sourceType,sourceTypeValue:K.sourceTypeValue,groupId:J.id,groupName:J.name}))}))}async function Ig($,Y,U,z="id"){let I=U.startsWith("$")?U.slice(1):U,Q=`${j$($)}/api/openapi/v1/roledefs/$${I}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(z)}&pathType=name`,J=await fetch(Q,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!J.ok){let W=await J.text().catch(()=>"");throw Error(`Failed to fetch Hose role staffs for ${I}: ${J.status} ${W}`)}let G=(await J.json()).value;if(!G)throw Error(`Hose role staff query returned empty result for ${I}`);let H=[];for(let W of G.contents??[])for(let X of W.staffs??[])if(X&&!H.includes(X))H.push(X);return{id:G.id??I,name:G.name??"",count:G.count??H.length,staffs:H}}async function Qg($,Y,U){if(U.length===0)return[];let z=`${j$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,I=await fetch(z,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:U.slice(0,100)}),signal:AbortSignal.timeout(1e4)});if(!I.ok){let J=await I.text().catch(()=>"");throw Error(`Failed to fetch Hose staff details: ${I.status} ${J}`)}return(await I.json()).items??[]}function _H($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function Jg($){let Y=typeof $==="string"?XM($):$10($),U=Y.baseUrl||"https://app.ekuaibao.com",z,I,Q,J,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await X5.get(`${U}/api/engine/realm/$UNITY/actions/jwt`,{searchParams:{corpId:Y.corpId},headers:G,timeout:1e4}).json(),W=H.id||H.value;if(W){let X=W.split(".");if(X.length>=2){let Z=X[1].replace(/-/g,"+").replace(/_/g,"/"),q=JSON.parse(Buffer.from(Z,"base64").toString("utf-8"));if(typeof q.staffId==="string")z=q.staffId;if(typeof q.corporationName==="string")I=q.corporationName;if(typeof q.staffName==="string")Q=q.staffName;if(typeof q.cellphone==="string")K=q.cellphone;if(q.isAdmin!==void 0)J=q.isAdmin===!0||q.isAdmin==="true"}}}catch{}if(!z||!I)try{let W=(await X5.get(`${U}/api/account/v2/session`,{headers:{...G,...z?{staffid:z}:{}},timeout:1e4}).json())?.value;if(W){if(!z&&W.loginStaffId)z=W.loginStaffId;if(!I&&W.corporationName)I=W.corporationName;if(!Q&&W.privilege)Q=W.privilege}}catch{}if(!z)z=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:U,accessToken:Y.accessToken,staffId:z,corpName:I,staffName:Q,isAdmin:J,cellphone:K}}async function Kg($){let Y=await Jg($),U={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},z;try{z=await(await X5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:U,timeout:15000})).json()}catch(J){let K=J instanceof Error?J.message:String(J);throw Error(`Failed to query Hose OpenAPI keys from assistance link: ${K}`)}let I=z.items??[],Q=[];for(let J of I)if(typeof J==="object"&&J!==null){let K=J;if(typeof K.appKey==="string"&&typeof K.appSecurity==="string")Q.push({id:String(K.id??K.appKey),name:typeof K.name==="string"?K.name:void 0,appKey:K.appKey,appSecurity:K.appSecurity,active:typeof K.active==="boolean"?K.active:!0,corporationId:typeof K.corporationId==="string"?K.corporationId:Y.corpId,createTime:typeof K.createTime==="number"?K.createTime:void 0,updateTime:typeof K.updateTime==="number"?K.updateTime:void 0})}return{corpId:Y.corpId,corpName:Y.corpName,baseUrl:Y.baseUrl,staffId:Y.staffId,keys:Q}}var Un0,zn0,In0="/web/thirdparty.html",e00,Ug,zg;var E$=m(()=>{mI();m6();RH();Un0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],zn0=[".ekuaibao.com",".hosecloud.com"],e00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,Ug=new Map,zg=new Map});function Q10($,Y){return Date.now()>=$.expiresAt-Y*1000}async function Gn0($){switch($.source.type){case"hose":return I10($);case"seal":return c00($)}}async function MM($){let Y=$.auth.refreshTtl,U=wM.get($.id);if(U&&!Q10(U,Y))return U;let z=r00($.id);if(z&&!Q10(z,Y))return wM.set($.id,z),z;let I=await Gn0($);return wM.set($.id,I),s00($.id,I),I}async function J10($){return(await MM($)).enterprise}function K10($){wM.delete($),a00($)}var wM;var Gg=m(()=>{E$();RH();wM=new Map});var H10={};T8(H10,{createSealClientForUrl:()=>B6,createSealClientForToken:()=>Hg,createSealClient:()=>B1});function Hn0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function Wn0($){if(!($ instanceof D6))return $;let Y=Hn0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function G10($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)K10($);return Wn0(Y)}}async function B1($){let Y=await MM($);return X5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[G10($.id)]}})}async function Hg($,Y){let U=await MM($);return B6(U.enterprise.sealUrl,Y,A6($.seal))}function B6($,Y,U={}){let z={...U};if(Y)z.Authorization=`Bearer ${Y}`;return X5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:z,hooks:{beforeError:[G10()]}})}var m6=m(()=>{mI();Gg()});var vH;var W10=m(()=>{vH={name:"seal-use",version:"0.10.38",private:!0,description:"Seal tenant operations toolkit: approval-run diagnosis, rule remediation, Hose/合思 auth, plus a CLI and an optional MCP server.",license:"MIT",author:{name:"yingqing"},repository:{type:"git",url:"git+https://github.com/yunyingk/seal-use.git"},type:"module",module:"src/server.ts",bin:{"seal-use":"src/cli.ts"},packageManager:"bun@1.3.14",engines:{bun:">=1.3.14"},scripts:{dev:"bun run --watch src/server.ts",start:"bun run src/server.ts",probe:"bun run src/probe.ts",cli:"bun run src/cli.ts",check:"tsc --noEmit","build:binary":"node scripts/build-binary.mjs","build:plugin":"node scripts/build-plugin.mjs",bump:"bun run scripts/bump-version.ts",release:"bun run scripts/release.ts","dev:override":"bun run scripts/dev-override.ts","dev:link":"bun run scripts/dev-override.ts","openapi:bundle":"bun run scripts/bundle-openapi.ts","openapi:raw":"bun run scripts/generate-raw-openapi.ts",test:"bun test",prepare:"git config core.hooksPath .githooks"},dependencies:{"@modelcontextprotocol/server":"^2.0.0",archiver:"^8.0.0",exceljs:"^4.4.0","iconv-lite":"^0.7.3",ky:"^2.0.2","pinyin-pro":"^3.29.3",yauzl:"^3.4.0",zod:"^4.4.3"},devDependencies:{"@modelcontextprotocol/client":"^2.0.0","@types/archiver":"^8.0.0","@types/bun":"^1.3.14","@types/yauzl":"^3.4.0","bun-types":"^1.3.14",typescript:"^5.9.3",yaml:"^2.9.0"}}});import{spawnSync as X10}from"node:child_process";function Zn0($,Y=vH.version){let U=$.trim();if(!U)return null;let z=U.endsWith("-dirty"),I=z?U.slice(0,-6):U,Q=I.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(Q&&Q[1]&&Q[2]&&Q[3])return{baseVersion:Q[1],commitsAhead:Number.parseInt(Q[2],10),commit:Q[3],dirty:z,describe:U};let J=I.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(J&&J[1])return{baseVersion:J[1],commitsAhead:0,commit:"",dirty:z,describe:U};let K=I.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:z,describe:U};return null}function qn0($,Y,U,z){let Q=U?`+g${U}${z?".dirty":""}`:z?"+dirty":"";return`${$}-dev.${Y}${Q}`}function Vn0($){let Y=$?.env,U=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,z=Y?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,I=Y?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,Q=Y?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,J=Y?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,K=Y?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,G=Y?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,H=Y?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,W=Y?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,X=$?.cwd;if(U){let Z=z==="true",V={name:"seal-use",version:U,channel:I||(Z?"release":"dev"),isRelease:Z};if(Q)V.git={baseVersion:Q,commitsAhead:Number.parseInt(J||"0",10),commit:K||"",dirty:G==="true",describe:H||U};return V}if(z==="true"||W==="1")return{name:"seal-use",version:vH.version,channel:"release",isRelease:!0};try{let Z=X10("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=Zn0(Z.stdout.trim(),vH.version);if(q){if(!q.commit){let w=X10("git",["rev-parse","--short","HEAD"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(w.status===0&&w.stdout)q.commit=w.stdout.trim()}return{name:"seal-use",version:qn0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${vH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var dY,X1,Wg,Qp1;var z3=m(()=>{W10();dY=Vn0(),X1=dY.version,Wg=dY.isRelease,Qp1=dY.channel});function sI($=void 0){return Zg.parse($??{})}function V10($,Y){return sI({...sI($),...Y})}var Z10,Xg,q10,Zg,qg;var aI=m(()=>{T$();Z10=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],Xg={minFileSizeBytes:500,allowedExtensions:[...Z10]},q10=L.string().trim().min(1).transform(($)=>{let Y=$.toLowerCase();return Y.startsWith(".")?Y:`.${Y}`}).refine(($)=>/^\.[a-z0-9][a-z0-9+_-]*$/.test($),{message:"文件后缀必须是简单扩展名,例如 .pdf 或 xlsx"}),Zg=L.object({minFileSizeBytes:L.number().int().min(0).default(Xg.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(q10).min(1).default([...Z10]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),qg=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(q10).min(1).transform(($)=>[...new Set($)])}).optional()});var Ln0,Fn0,wn0,Mn0,F10,On0,Nn0,w10,OM,M10,Dn0,NM,O10,SH,N10,An0,Bn0,Pn0,L10,gH,D10,Tn0,jn0,DM,Vg,A10,B10,P10,T10,AM,j10,Lg,Fg,E10,C10,En0,R10,Cn0,_10,hH,v10,h10,S10,g10,y10,k10,x10,f10,u10,b10,i10,Rn0,c10,_n0,vn0,hn0,wg,Mg,Sn0,n10,p10,d10,m10,gn0,Og,Xp1,Zp1,l10,qp1;var Ng=m(()=>{T$();aI();Ln0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Fn0=L.object({id:L.string(),tenantId:L.string(),name:L.string(),isAdmin:L.boolean().default(!1),permissions:L.array(L.string()).default([]),providerUserId:L.string().optional(),hosecloudStaff:Ln0.optional()}),wn0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),Mn0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:wn0.optional()}),F10=L.object({user:Fn0,tenant:Mn0}),On0=L.object({id:L.string(),name:L.string(),email:L.string().nullable().optional(),emailVerified:L.boolean().optional(),image:L.string().nullable().optional(),tenantId:L.string().optional(),provider:L.string().optional(),providerUserId:L.string().optional(),mobile:L.string().nullable().optional(),status:L.string().optional(),permissions:L.array(L.string()).default([]),isAdmin:L.boolean().default(!1),hosecloudStaff:L.unknown().optional()}).passthrough(),Nn0=L.object({id:L.string(),token:L.string().optional(),expiresAt:L.string(),createdAt:L.string().optional(),updatedAt:L.string().optional(),ipAddress:L.string().optional(),userAgent:L.string().optional(),userId:L.string(),delegationId:L.string().nullable().optional()}).passthrough(),w10=L.object({user:On0,session:Nn0}),OM=L.object({id:L.string(),tenantId:L.string().optional(),code:L.union([L.number(),L.string()]).optional(),description:L.string(),scope:L.string(),strictness:L.string(),status:L.string().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional()}),M10=L.object({rules:L.array(OM),hasPendingDeletes:L.boolean().default(!1)}),Dn0=L.object({id:L.union([L.string(),L.number()]).optional(),ruleId:L.union([L.string(),L.number()]).optional(),stableId:L.union([L.string(),L.number()]).optional(),runtimeRuleId:L.union([L.string(),L.number()]).optional(),runtimeId:L.union([L.string(),L.number()]).optional(),code:L.union([L.string(),L.number()]).optional(),description:L.string(),scope:L.string(),strictness:L.string()}).passthrough(),NM=L.object({id:L.string(),tenantId:L.string().optional(),versionNumber:L.number(),versionName:L.string().nullable().optional(),publishedBy:L.string().nullable().optional(),publishedByName:L.string().nullable().optional(),rules:L.array(Dn0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}).passthrough(),O10=L.object({version:NM,rulesCount:L.number()}),SH=L.object({id:L.string(),tenantId:L.string().optional(),title:L.string(),purpose:L.string().default(""),contentType:L.string().default("policy"),content:L.string(),status:L.string().default("published"),enabled:L.boolean().default(!0),scenarios:L.array(L.string()).default([]),tags:L.array(L.string()).default([]),category:L.string().nullable().optional(),categoryTags:L.array(L.string()).default([]),createdBy:L.string().nullable().optional(),createdByName:L.string().nullable().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional(),updatedBy:L.string().nullable().optional(),updatedByName:L.string().nullable().optional(),isDeleted:L.boolean().default(!1)}),N10=L.object({articles:L.array(SH),total:L.number().optional()}),An0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),Bn0=L.object({type:L.string(),signKey:L.string().optional(),outboundName:L.string().optional(),mode:L.string().optional(),autoApprovalRate:L.number().optional(),apiKey:L.string().optional(),apiSecret:L.string().optional(),apiOrigin:L.string().optional(),corporationId:L.string().optional(),ebotSignKey:L.string().optional(),completionSignKey:L.string().optional(),outboundMessageId:L.string().optional(),completionMessageId:L.string().optional()}).passthrough(),Pn0=L.enum(["assisted","semi_automatic","fully_automatic"]),L10=L.object({id:L.string(),url:L.string().url()}).passthrough(),gH=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:Pn0,incomingDocumentWebhook:L10,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:L10,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:Zg.default(Xg)}).passthrough(),D10=L.object({id:L.string().optional(),tenantId:L.string().optional(),tone:L.string().optional(),language:L.string().optional(),detailLevel:L.string().optional(),outputFormat:L.string().optional(),examples:L.array(L.string()).default([]),prohibitedPhrases:L.array(L.string()).default([]),customInstructions:L.string().optional(),updatedAt:L.number().optional(),decisionPreferences:An0.optional(),integrationSystem:L.string().optional(),integrations:L.array(Bn0).default([])}).passthrough(),Tn0=L.object({id:L.string().optional(),sn:L.string().optional(),title:L.string().optional(),name:L.string().optional(),fields:L.array(L.unknown()).optional()}).passthrough(),jn0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),DM=L.object({id:L.string(),tenantId:L.string().optional(),agentId:L.string().optional(),status:L.string().optional(),taskMode:L.string().optional(),finalExecutionMode:L.string().optional(),sourceSystem:L.string().optional(),sourceDocumentSN:L.string().optional(),sourceDocumentId:L.string().optional(),documentId:L.string().optional(),document:Tn0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:jn0.optional(),ruleSetVersionNumber:L.number().optional(),ruleSetPublishedAt:L.number().optional(),ruleSetPublishedByName:L.string().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Vg=L.object({records:L.array(DM).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),A10=L.object({id:L.string(),expiresAt:L.number().nullable().optional(),revokedAt:L.number().nullable().optional(),createdAt:L.number().nullable().optional(),lastUsedAt:L.number().nullable().optional(),useCount:L.number().default(0),note:L.string().nullable().optional(),link:L.string()}).passthrough(),B10=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),P10=L.object({userId:L.string(),password:L.string()}).passthrough(),T10=L.object({password:L.string()}).passthrough(),AM=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string(),mobile:L.string().optional(),email:L.string().optional(),departmentIds:L.array(L.string()).default([]),status:L.string().optional(),permissions:L.array(L.string()).default([]),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),j10=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(AM).default([])}).passthrough(),Lg=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),parentId:L.string().nullable().optional(),ancestors:L.array(L.string()).default([]),provider:L.string().optional(),permissions:L.array(L.string()).default([]),isDeleted:L.boolean().optional(),syncedAt:L.string().optional(),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),Fg=L.object({items:L.array(Lg).default([])}).passthrough(),E10=L.object({items:L.array(AM).default([])}).passthrough(),C10=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),En0=L.object({tagId:L.string().optional(),tagName:L.string().optional(),tagPath:L.string().optional(),count:L.number().default(0),avgConfidence:L.number().default(0),errorCount:L.number().default(0),warningCount:L.number().default(0)}).passthrough(),R10=L.object({tagStats:L.array(En0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),Cn0=L.object({riskId:L.string().optional(),recordId:L.string().optional(),riskDetails:L.string().default(""),riskLevel:L.string().default("warning"),documentType:L.string().default(""),documentSN:L.string().default(""),sourceSystem:L.string().default(""),sourceDocumentURL:L.string().nullable().optional(),confidence:L.number().default(0),reasoning:L.string().default(""),createdAt:L.union([L.string(),L.number(),L.date()]).optional()}).passthrough(),_10=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array(Cn0).default([]),total:L.number().default(0)}).passthrough(),hH=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),v10=L.object({metrics:L.object({approvalCount:hH.optional(),accuracy:hH.optional(),automationRate:hH.optional(),riskCount:hH.optional(),avgDuration:hH.optional()}).passthrough().default({}),sankeyData:L.object({nodes:L.array(L.object({id:L.string()}).passthrough()).default([]),links:L.array(L.object({source:L.string(),target:L.string(),value:L.number().default(0)}).passthrough()).default([])}).passthrough().default({nodes:[],links:[]})}).passthrough(),h10=L.record(L.string(),L.unknown()),S10=L.object({expenses:L.array(h10).default([]),total:L.number().optional()}).passthrough(),g10=L.object({invoices:L.array(h10).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),y10=L.record(L.string(),L.unknown()),k10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),x10=L.object({id:L.string(),name:L.string(),description:L.string().optional(),available:L.boolean().default(!0),fields:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),f10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),u10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),b10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),i10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Rn0=L.object({columns:L.array(i10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),c10=L.object({id:L.string().optional(),listSheets:L.array(Rn0).default([]),mainColumns:L.array(i10).default([]),workbookName:L.string().optional(),mainKeyColumn:L.string().optional(),mainSheetName:L.string().optional(),titleColumn:L.string().optional(),statusColumn:L.string().optional(),applicationDateColumn:L.string().optional(),updatedDateColumn:L.string().optional(),attachmentFieldKey:L.string().optional(),attachmentFieldLabel:L.string().optional()}).passthrough(),_n0=L.object({approvalCode:L.string(),nodeId:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),limit:L.number().int().positive().max(100).optional(),dataCollectionMode:L.string().optional(),signKey:L.string().optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional(),disableAttachmentCache:L.boolean().optional(),thinkingDepthOverride:L.enum(["default","medium","high"]).optional(),startTime:L.number().optional(),endTime:L.number().optional(),templateId:L.string().optional(),packageIds:L.array(L.string()).optional(),packageLabel:L.string().optional(),runMode:L.string().optional(),schemaConfig:c10.optional()}).passthrough(),vn0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),hn0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),wg=L.object({id:L.string(),tenantId:L.string().optional(),approvalCode:L.string().optional(),nodeId:L.string().optional(),sourceSystem:L.string().optional(),status:L.string().optional(),totalCount:L.number().default(0),processedCount:L.number().default(0),successCount:L.number().default(0),failedCount:L.number().default(0),createdCount:L.number().default(0),createFailedCount:L.number().default(0),params:_n0.optional(),requestSummary:vn0.nullable().optional(),resultSummary:hn0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Mg=L.object({batchId:L.string()}).passthrough(),Sn0=L.object({dataCollectionMode:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional()}).passthrough(),n10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Sn0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),p10=L.object({hasFeishu:L.boolean().default(!1),hasHosecloud:L.boolean().default(!1),hasWeaver:L.boolean().default(!1),hasHelios:L.boolean().default(!1),hasMaycur:L.boolean().default(!1),hasMaycurStandard:L.boolean().default(!1)}).passthrough(),d10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),m10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),templateId:L.string().optional(),originalFileName:L.string().optional(),status:L.string().optional(),documentCount:L.number().optional(),attachmentCount:L.number().optional(),uploadedBy:L.string().optional(),schemaConfig:c10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),gn0=L.object({hitScopes:L.array(L.string()).default([]),hitRuleIds:L.array(L.string()).default([]),notHitScopes:L.array(L.string()).default([]),notHitRuleIds:L.array(L.string()).default([])}).passthrough(),Og=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:gn0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),Xp1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(Og).default([])}).passthrough(),Zp1=L.object({dryRun:L.boolean().optional(),signKey:L.string().min(1).optional(),outboundName:L.string().optional(),specificationId:L.string().optional(),specificationName:L.string().optional(),mode:L.enum(["fully_automatic","semi_automatic","assisted"]).default("assisted"),autoApprovalRate:L.number().min(0).max(100).optional(),rejectResubmitMethod:L.enum(["node_default","to_ebot","from_start"]).optional(),autoApproveNodeNames:L.array(L.string()).optional(),apiKey:L.string().min(1),apiSecret:L.string().min(1),apiOrigin:L.string().default("production"),customApiUrl:L.string().optional()}).passthrough(),l10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),qp1=L.object({total:L.number(),dedupeBy:L.string(),unique:L.number(),byStatus:L.record(L.string(),L.number()),bySourceSystem:L.record(L.string(),L.number())}).passthrough()});import{randomBytes as s10}from"node:crypto";async function N1($,Y){let U=await $.json();return Y.parse(U.data??U)}async function Z8($){return N1(await $.get("api/v1/auth/me"),F10)}async function t10($){return N1(await $.get("api/auth/get-session"),w10)}async function W6($){return N1(await $.get("api/v1/rules"),M10)}async function kH($,Y){return N1(await $.post("api/v1/rules",{json:Y}),OM)}async function Dg($,Y,U){return N1(await $.put(`api/v1/rules/${Y}`,{json:U}),OM)}async function eI($,Y){await $.delete(`api/v1/rules/${Y}`)}async function jM($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),U=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:U})}async function p8($){return N1(await $.get("api/v1/rule-set-versions"),L.array(NM))}async function k7($,Y){return N1(await $.get(`api/v1/rule-set-versions/${Y}`),NM)}async function xH($,Y){return N1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),O10)}async function mY($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??20)),U.set("sortBy",Y.sortBy??"createdAt"),U.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((z,I)=>{U.set(`filter[scenarios][${I}]`,z)}),N1(await $.get("api/v1/knowledge/articles",{searchParams:U}),N10)}async function e10($,Y){return N1(await $.get(`api/v1/knowledge/articles/${Y}`),SH)}async function EM($,Y){return N1(await $.post("api/v1/knowledge/articles",{json:{...Y,contentType:Y.contentType??"policy",status:Y.status??"published",enabled:Y.enabled??!0,scenarios:Y.scenarios&&Y.scenarios.length>0?Y.scenarios:["audit"],tags:Y.tags??[]}}),SH)}async function CM($,Y,U){let z=Object.fromEntries(Object.entries(U).filter(([,I])=>I!==void 0));return N1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:z}}),SH)}async function RM($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function r1($,Y="api/v1/agent/ai-approval/config"){return N1(await $.get(Y),D10)}async function t5($,Y,U="api/v1/agent/ai-approval/config"){return await $.post(U,{json:Y}),r1($,U)}async function Ag($,Y,U="api/v1/agent/ai-approval/config"){let z=await $.post(U,{json:Y}),I=await z.json().catch(()=>({})),Q=TM.safeParse(I.data??I);return Q.success?Q.data.success??z.ok:z.ok}async function K$($,Y="api/v1/agent/ai-approval/config"){let U=await r1($,Y);return Bg(U.integrations)}async function _M($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=Bg(I.integrations),J=J40(Y,Q,U);if(!await Ag($,{...I,integrations:[...I.integrations,J]},z))throw Error("Seal did not confirm saving the Webhook integration");return J}async function $40($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=Bg(I.integrations),J=J40(Y,Q,U);return{before:I,after:{...I,integrations:[...I.integrations,J]},integration:J}}async function Y40($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=vM(I.integrations),J=hM(Q,Y),K=K40(J.integration,U);if(!await Ag($,{...I,integrations:I.integrations.map((H,W)=>W===J.index?K:H)},z))throw Error("Seal did not confirm saving the Webhook integration");return K}async function U40($,Y,U,z="api/v1/agent/ai-approval/config"){let I=await r1($,z),Q=vM(I.integrations),J=hM(Q,Y),K=K40(J.integration,U);return{before:I,after:{...I,integrations:I.integrations.map((G,H)=>H===J.index?K:G)},integration:K}}async function z40($,Y,U="api/v1/agent/ai-approval/config"){let z=await r1($,U),I=vM(z.integrations),Q=hM(I,Y);if(!await Ag($,{...z,integrations:z.integrations.filter((K,G)=>G!==Q.index)},U))throw Error("Seal did not confirm deleting the Webhook integration");return Q.integration}async function I40($,Y,U="api/v1/agent/ai-approval/config"){let z=await r1($,U),I=vM(z.integrations),Q=hM(I,Y);return{before:z,after:{...z,integrations:z.integrations.filter((J,K)=>K!==Q.index)},integration:Q.integration}}function x7($,Y){let U=Y.trim();if(!U)throw Error("Webhook selector must not be empty");let z=$.find((Q)=>Q.id===U);if(z)return z;let I=$.filter((Q)=>Q.name===U);if(I.length===1)return I[0];if(I.length>1)throw Error(`Multiple Webhook integrations match name: ${U}. Use the integration ID.`);throw Error(`Webhook integration not found: ${U}`)}function Q40($,Y){let U=Y?.trim().toLowerCase();if(!U)return $;return $.filter((z)=>[z.id,z.name,z.mode,z.outgoingResultWebhook,z.incomingDocumentWebhook.url,z.incomingManualResultWebhook.url].some((I)=>I.toLowerCase().includes(U)))}function Bg($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>gH.parse(Y))}function vM($){return $.flatMap((Y,U)=>{if(Y.type!=="webhook")return[];return[{index:U,integration:gH.parse(Y)}]})}function hM($,Y){let U=x7($.map((z)=>z.integration),Y);return $.find((z)=>z.integration.id===U.id)}function J40($,Y,U){let z=yH(U.name,"name"),I=U.mode??"assisted",Q=H40(U.outgoingResultWebhook,"outgoingResultWebhook"),J=W40(U.autoApprovalRate??60),K=xn0(Y),G=`wh_${K}_${s10(8).toString("hex").slice(0,7)}`,H=j$($);return gH.parse({type:"webhook",id:`integration-${K}`,name:z,mode:I,incomingDocumentWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/document`},outgoingResultWebhook:Q,incomingManualResultWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/manual-result`},secret:U.secret?yH(U.secret,"secret"):G40(),autoApprovalRate:J,materialPackFilePolicy:sI(U.materialPackFilePolicy)})}function K40($,Y){return gH.parse({...$,...Y.name===void 0?{}:{name:yH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:H40(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:W40(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?G40():yH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:V10($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function xn0($){let Y=new Set($.map((z)=>z.id)),U=Date.now();while(Y.has(`integration-${U}`))U+=1;return U}function G40(){return s10(16).toString("hex")}function yH($,Y){let U=$.trim();if(!U)throw Error(`Webhook ${Y} must not be empty`);return U}function H40($,Y){let U=yH($,Y);try{return new URL(U).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function W40($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function SM($,Y={}){let[U,z,I]=await Promise.all([W6($),mY($,{limit:Y.documentLimit??50}),r1($,Y.stylePreferencesEndpoint).then((Q)=>({ok:!0,data:Q}),(Q)=>({ok:!1,error:Q instanceof Error?Q.message:String(Q)}))]);return{rules:U,documents:z,stylePreferences:I}}async function i4($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??50)),n8(U,"fromTimestamp",Y.fromTimestamp),n8(U,"toTimestamp",Y.toTimestamp),n8(U,"startDate",Y.startDate),n8(U,"endDate",Y.endDate),o10(U,"status",Y.status),n8(U,"sourceSystem",Y.sourceSystem),n8(U,"taskMode",Y.taskMode),n8(U,"search",Y.search),n8(U,"sourceDocumentSN",Y.sourceDocumentSN),n8(U,"sourceDocumentId",Y.sourceDocumentId),o10(U,"manualApprovalStatus",Y.manualApprovalStatus),N1(await $.get("api/v1/approvals",{searchParams:U}),Vg)}async function H4($,Y){return N1(await $.get(`api/v1/approvals/${Y}`),DM)}async function Pg($,Y){let U=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),z=U.data??U;if(Array.isArray(z))return L.array(DM).parse(z);return Vg.parse(z).records}async function X40($,Y){return N1(await $.post("api/v1/simulation/create-batch",{json:Y}),Mg)}async function Z40($,Y){return N1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),Mg)}async function q40($,Y={}){let U=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),z=U.data??U;return L.array(wg).parse(z)}async function gM($,Y){return N1(await $.get(`api/v1/simulation/batch/${Y}`),wg)}async function V40($){let Y=await $.get("api/v1/simulation/templates").json(),U=Y.data??Y;return L.array(n10).parse(U)}async function Tg($){return N1(await $.get("api/v1/simulation/integration-status"),p10)}async function jg($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),U=Y.data??Y;return L.array(d10).parse(U)}async function L40($,Y){let z=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return z.data??z}async function F40($,Y){let U=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",z=Y?new URLSearchParams({signKey:Y}):void 0,I=await $.get(U,{searchParams:z}).json(),Q=I.data??I;return L.array(l10).parse(Q)}async function w40($,Y){let U=await $.post("api/hosecloud/corporation",{json:Y}).json(),z=U.data??U;return L.object({corporationId:L.string()}).parse(z)}async function M40($,Y){let z=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return z.data??z}async function O40($,Y){let U=new FormData;return U.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),N1(await $.post("api/v1/material-packages/upload",{body:U}),m10)}function n8($,Y,U){if(U)$.set(Y,U)}function o10($,Y,U){if(!U)return;(Array.isArray(U)?U:[U]).map((I)=>I.trim()).filter(Boolean).forEach((I,Q)=>{$.set(`${Y}[${Q}]`,I)})}async function N40($){return N1(await $.get("api/v1/delegation/list"),L.array(A10))}async function tI($,Y){return N1(await $.post("api/v1/delegation/create",{json:Y??{}}),B10)}async function D40($,Y){let U=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),z=await U.json(),I=TM.safeParse(z.data??z);return I.success?I.data.success??U.ok:U.ok}async function A40($,Y){let U=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!U){let z=await $.get("api/v1/contacts/departments/root/children").json(),I=yn0.safeParse(z.data??z),Q=I.success?I.data.items?.[0]?._id:void 0;if(Q)U=[Q]}return N1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:U??[]}}),P10)}async function Eg($,Y){return N1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),T10)}async function BM($,Y){return N1(await $.get(`api/v1/contacts/users/${Y}`),AM)}async function PM($,Y=""){return N1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),j10)}async function B40($){return N1(await $.get("api/v1/contacts/departments/root/children"),Fg)}async function P40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),Lg)}async function T40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),Fg)}async function j40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),E10)}async function E40($){return N1(await $.get("api/v1/contacts/last-sync-time"),C10)}async function yM($,Y={}){let U=Cg(),z=new URLSearchParams;if(n8(z,"startDate",Y.startDate??U.startDate),n8(z,"endDate",Y.endDate??U.endDate),Y.limit!==void 0)z.set("limit",String(Y.limit));return N1(await $.get("api/v1/insight/stats",{searchParams:z}),R10)}async function kM($,Y){let U=Cg(),z=new URLSearchParams;return z.set("tagId",Y.tagId),z.set("startDate",Y.startDate??U.startDate),z.set("endDate",Y.endDate??U.endDate),N1(await $.get("api/v1/insight/risks-by-tag",{searchParams:z}),_10)}async function xM($,Y={}){let U=Cg(),z=r10(Y.startDate??U.startDate),I=r10(Y.endDate??U.endDate),Q=new URLSearchParams;return Q.set("startDate",String(z)),Q.set("endDate",String(I)),N1(await $.get("api/v1/insight/performance",{searchParams:Q}),v10)}async function C40($,Y){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(Y)}`),{success:!0,recordId:Y}}function r10($){if(typeof $==="number")return $<100000000000?$*1000:$;let Y=Number($);if(!isNaN(Y)&&$.trim()!=="")return Y<100000000000?Y*1000:Y;let U=new Date($);if(isNaN(U.getTime()))throw Error(`Invalid date format: ${$}`);return U.getTime()}function Cg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),U=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:U.toISOString()}}function R40($){let Y=new URLSearchParams;return n8(Y,"filter[startDate]",$.startDate),n8(Y,"filter[endDate]",$.endDate),n8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function _40($,Y={}){return N1(await $.get("api/v1/expenses/list",{searchParams:R40(Y)}),S10)}async function v40($,Y={}){return N1(await $.get("api/v1/invoice/list",{searchParams:R40(Y)}),g10)}async function h40($){return N1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(y10))}async function S40($,Y){let U=await $.delete(`api/v1/contacts/local/users/${Y}`),z=await U.json(),I=TM.safeParse(z.data??z);return I.success?I.data.success??U.ok:U.ok}async function Rg($,Y){let U=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),z=await U.json(),I=TM.safeParse(z.data??z);return I.success?I.data.success??U.ok:U.ok}async function fn0($,Y){let U=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),z=U.headers.get("set-auth-token"),I=kn0.parse(await U.json()),Q=z??I.session?.token;if(!Q)throw Error("Failed to retrieve authentication token from login response");return{token:Q,user:I.user}}async function g40($,Y,U,z){let I;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await PM($,Y.userIdOrPhone),V=q.users.find((w)=>w.mobile?.includes(Y.userIdOrPhone)||w._id===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${Y.userIdOrPhone}`);I=V}else I=await BM($,Y.userIdOrPhone).catch(async()=>{let q=await PM($,Y.userIdOrPhone),V=q.users.find((w)=>w.name===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${Y.userIdOrPhone}`);return V});if(I.status==="resigned")await Rg($,I._id),I=await BM($,I._id);let Q=I,J=Array.isArray(Q.identities)&&Q.identities.some((q)=>q.provider&&q.provider!=="local")||!!Q.apps?.hosecloud;if(J&&z&&z.source.type==="hose"){let V=(I.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,""),w=Q.identities?.find((F)=>F.provider==="hosecloud")?.providerId,M=Q.apps?.hosecloud?.boundId||w||(V?`${z.source.corpId}:${V}`:void 0);if(M){let F=await oI(z),O=(await VM({...z.source,staffId:M},F)).token,D=y7(z,z.source),P=A6(z.seal),T=B6(D,void 0,P),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:O,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${I.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let j=A.token??A.accessToken??A.data?.token;if(j){let C=await U(j),b=await tI(C,{note:Y.note??`Delegation generated by admin for ${I.name}`});return{targetUser:I,delegation:b,temporaryPassword:"N/A (Hose SSO)"}}}}let K;try{K=await Eg($,I._id)}catch(q){if(J)throw Error(`用户 "${I.name}" (${I.mobile||I._id}) 为合思同步账号 (provider: hosecloud),无 Seal 本地密码。`+"Seal 系统暂不支持对同步账号直接重置本地密码。");throw q}let H=(I.mobile||I.identities?.[0]?.providerId||"").replace(/^\+86/,"");if(!H)throw Error(`User ${I.name} has no associated phone number for password login`);let{token:W}=await fn0($,{phone:H,password:K.password}),X=await U(W),Z=await tI(X,{note:Y.note??`Delegation generated by admin for ${I.name}`});return{targetUser:I,delegation:Z,temporaryPassword:K.password}}async function y40($){return N1(await $.get("api/v1/llm/config"),k10)}async function k40($){return N1(await $.get("api/v1/llm/providers"),L.array(x10))}async function x40($){return N1(await $.get("api/v1/permissions/available"),f10)}async function f40($){return N1(await $.get("api/v1/permissions/configs"),u10)}async function lY($){return N1(await $.get("api/v1/billing/status"),b10)}async function u40($){let U=await(await $.get("api/v1/billing/plans")).json();return a10.parse(U.data??U)}async function b40($){let U=await(await $.get("api/v1/billing/features")).json();return a10.parse(U.data??U)}var TM,yn0,kn0,a10;var X6=m(()=>{mI();T$();aI();E$();m6();Ng();TM=L.object({success:L.boolean().optional()}).passthrough(),yn0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),kn0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),a10=L.json()});var $6=E((Vd1,c40)=>{var{toString:i40}=Object.prototype,un0=/["&<>]/,I3={each:function(Y,U){if(Y)if(Array.isArray(Y))Y.forEach(U);else Object.keys(Y).forEach((z)=>{U(Y[z],z)})},some:function(Y,U){if(Y){if(Array.isArray(Y))return Y.some(U);return Object.keys(Y).some((z)=>U(Y[z],z))}return!1},every:function(Y,U){if(Y){if(Array.isArray(Y))return Y.every(U);return Object.keys(Y).every((z)=>U(Y[z],z))}return!0},map:function(Y,U){if(Y){if(Array.isArray(Y))return Y.map(U);return Object.keys(Y).map((z)=>U(Y[z],z))}return[]},keyBy($,Y){return $.reduce((U,z)=>{return U[z[Y]]=z,U},{})},isEqual:function(Y,U){let z=typeof Y,I=typeof U,Q=Array.isArray(Y),J=Array.isArray(U),K;if(z!==I)return!1;switch(typeof Y){case"object":if(Q||J){if(Q&&J)return Y.length===U.length&&Y.every((G,H)=>{let W=U[H];return I3.isEqual(G,W)});return!1}if(Y===null||U===null)return Y===U;if(K=Object.keys(Y),Object.keys(U).length!==K.length)return!1;for(let G of K)if(!U.hasOwnProperty(G))return!1;return I3.every(Y,(G,H)=>{let W=U[H];return I3.isEqual(G,W)});default:return Y===U}},escapeHtml($){let Y=un0.exec($);if(!Y)return $;let U="",z="",I=0,Q=Y.index;for(;Q<$.length;Q++){switch($.charAt(Q)){case'"':z=""";break;case"&":z="&";break;case"'":z="'";break;case"<":z="<";break;case">":z=">";break;default:continue}if(I!==Q)U+=$.substring(I,Q);I=Q+1,U+=z}if(I!==Q)return U+$.substring(I,Q);return U},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return i40.call($)==="[object Undefined]"},isObject($){return i40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,U,z,I;function Q(J,K){if(U=$[K],I=Array.isArray(J),I3.isObject(J)||I){if(I)I=!1,z=U&&Array.isArray(U)?U:[];else z=U&&I3.isObject(U)?U:{};$[K]=I3.deepMerge(z,J)}else if(!I3.isUndefined(J))$[K]=J}for(let J=0;J{var bn0=/^[A-Z]+\d+$/,fH={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level($){if($<=26)return 1;if($<=676)return 2;return 3},_fill($){let Y,U,z,I,Q,J=1;if($>=4)throw Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&$>=1){while(J<=26)Y=this._dictionary[J-1],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=1}if(this._l2nFill<2&&$>=2){J=27;while(J<=702)U=J-27,z=U%26,I=Math.floor(U/26),Y=this._dictionary[I]+this._dictionary[z],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){J=703;while(J<=16384)U=J-703,z=U%26,I=Math.floor(U/26)%26,Q=Math.floor(U/676),Y=this._dictionary[Q]+this._dictionary[I]+this._dictionary[z],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=3}},l2n($){if(!this._l2n[$])this._fill($.length);if(!this._l2n[$])throw Error(`Out of bounds. Invalid column letter: ${$}`);return this._l2n[$]},n2l($){if($<1||$>16384)throw Error(`${$} is out of bounds. Excel supports columns from 1 to 16384`);if(!this._n2l[$])this._fill(this._level($));return this._n2l[$]},_hash:{},validateAddress($){if(!bn0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let U=!1,z="",I=0,Q=!1,J="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!Q&&W>=65&&W<=90)U=!0,z+=$[H],I=I*26+W-64;else if(W>=48&&W<=57)Q=!0,J+=$[H],K=K*10+W-48;else if(Q&&U&&W!==36)break;if(!U)I=void 0;else if(I>16384)throw Error(`Out of bounds. Invalid column letter: ${z}`);if(!Q)K=void 0;$=z+J;let G={address:$,col:I,row:K,$col$row:`$${z}$${J}`};if(I<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let U=this.n2l(Y)+$;return this.decodeAddress(U)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let U=this.decodeAddress(Y[0]),z=this.decodeAddress(Y[1]),I={top:Math.min(U.row,z.row),left:Math.min(U.col,z.col),bottom:Math.max(U.row,z.row),right:Math.max(U.col,z.col)};return I.tl=this.n2l(I.left)+I.top,I.br=this.n2l(I.right)+I.bottom,I.dimensions=`${I.tl}:${I.br}`,I}return this.decodeAddress($)},decodeEx($){let Y=$.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),U=Y[1]||Y[2],z=Y[3],I=z.split(":");if(I.length>1){let J=this.decodeAddress(I[0]),K=this.decodeAddress(I[1]),G=Math.min(J.row,K.row),H=Math.min(J.col,K.col),W=Math.max(J.row,K.row),X=Math.max(J.col,K.col);return J=this.n2l(H)+G,K=this.n2l(X)+W,{top:G,left:H,bottom:W,right:X,sheetName:U,tl:{address:J,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:U},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:U},dimensions:`${J}:${K}`}}if(z.startsWith("#"))return U?{sheetName:U,error:z}:{error:z};let Q=this.decodeAddress(z);return U?{sheetName:U,...Q}:Q},encodeAddress($,Y){return fH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return fH.encodeAddress(arguments[0],arguments[1]);case 4:return`${fH.encodeAddress(arguments[0],arguments[1])}:${fH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[U,z,,I,Q]=$,[J,K]=Y;return J>=U&&J<=I&&K>=z&&K<=Q}};n40.exports=fH});var Q3=E((Fd1,p40)=>{var e5=c4();class _g{constructor(){this.decode(arguments)}setTLBR($,Y,U,z,I){if(arguments.length<4){let Q=e5.decodeAddress($),J=e5.decodeAddress(Y);this.model={top:Math.min(Q.row,J.row),left:Math.min(Q.col,J.col),bottom:Math.max(Q.row,J.row),right:Math.max(Q.col,J.col),sheetName:U},this.setTLBR(Q.row,Q.col,J.row,J.col,I)}else this.model={top:Math.min($,U),left:Math.min(Y,z),bottom:Math.max($,U),right:Math.max(Y,z),sheetName:I}}decode($){switch($.length){case 5:this.setTLBR($[0],$[1],$[2],$[3],$[4]);break;case 4:this.setTLBR($[0],$[1],$[2],$[3]);break;case 3:this.setTLBR($[0],$[1],$[2]);break;case 2:this.setTLBR($[0],$[1]);break;case 1:{let Y=$[0];if(Y instanceof _g)this.model={top:Y.model.top,left:Y.model.left,bottom:Y.model.bottom,right:Y.model.right,sheetName:Y.sheetName};else if(Y instanceof Array)this.decode(Y);else if(Y.top&&Y.left&&Y.bottom&&Y.right)this.model={top:Y.top,left:Y.left,bottom:Y.bottom,right:Y.right,sheetName:Y.sheetName};else{let U=e5.decodeEx(Y);if(U.top)this.model={top:U.top,left:U.left,bottom:U.bottom,right:U.right,sheetName:U.sheetName};else this.model={top:U.row,left:U.col,bottom:U.row,right:U.col,sheetName:U.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw Error(`Invalid number of arguments to _getDimensions() - ${$.length}`)}}get top(){return this.model.top||1}set top($){this.model.top=$}get left(){return this.model.left||1}set left($){this.model.left=$}get bottom(){return this.model.bottom||1}set bottom($){this.model.bottom=$}get right(){return this.model.right||1}set right($){this.model.right=$}get sheetName(){return this.model.sheetName}set sheetName($){this.model.sheetName=$}get _serialisedSheetName(){let{sheetName:$}=this.model;if($){if(/^[a-zA-Z0-9]*$/.test($))return`${$}!`;return`'${$}'!`}return""}expand($,Y,U,z){if(!this.model.top||$this.bottom)this.bottom=U;if(!this.model.right||z>this.right)this.right=z}expandRow($){if($){let{dimensions:Y,number:U}=$;if(Y)this.expand(U,Y.min,U,Y.max)}}expandToAddress($){let Y=e5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return e5.n2l(this.left)+this.top}get $t$l(){return`$${e5.n2l(this.left)}$${this.top}`}get br(){return e5.n2l(this.right)+this.bottom}get $b$r(){return`$${e5.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;if($.bottomthis.bottom)return!1;if($.rightthis.right)return!1;return!0}contains($){let Y=e5.decodeEx($);return this.containsEx(Y)}containsEx($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;return $.row>=this.top&&$.row<=this.bottom&&$.col>=this.left&&$.col<=this.right}forEachAddress($){for(let Y=this.left;Y<=this.right;Y++)for(let U=this.top;U<=this.bottom;U++)$(e5.encodeAddress(U,Y),U,Y)}}p40.exports=_g});var Z5=E((wd1,d40)=>{d40.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}});var l40=E((Md1,m40)=>{var fM=c4(),in0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,cn0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function nn0($,Y,U){let z=fM.decode(Y),I=fM.decode(U);return $.replace(in0,(Q,J,K,G,H)=>{if(H)return Q;let W=cn0.exec(G);if(W){let X=W[1],Z=W[2].toUpperCase(),q=W[3],V=W[4];if(Z.length>3||Z.length===3&&Z>"XFD")return Q;let w=fM.l2n(Z),M=parseInt(V,10);if(!X)w+=I.col-z.col;if(!q)M+=I.row-z.row;return(J||"")+(X||"")+fM.n2l(w)+(q||"")+M}return Q})}m40.exports={slideFormula:nn0}});var r40=E((Od1,o40)=>{var pn0=$6();class uH{constructor($){this.note=$}get model(){let $=null;switch(typeof this.note){case"string":$={type:"note",note:{texts:[{text:this.note}]}};break;default:$={type:"note",note:this.note};break}return pn0.deepMerge({},uH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:U}=Y;if(U.length===1&&Object.keys(U[0]).length===1)this.note=U[0].text;else this.note=Y}static fromModel($){let Y=new uH;return Y.model=$,Y}}uH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};o40.exports=uH});var W60=E((Nd1,H60)=>{var dn0=c4(),mn0=$6(),q5=Z5(),{slideFormula:ln0}=l40(),s40=r40();class p0{constructor($,Y,U){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,dn0.validateAddress(U),this._address=U,this._value=f7.create(p0.Types.Null,this),this.style=this._mergeStyle($.style,Y.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt($){this.style.numFmt=$}get font(){return this.style.font}set font($){this.style.font=$}get alignment(){return this.style.alignment}set alignment($){this.style.alignment=$}get border(){return this.style.border}set border($){this.style.border=$}get fill(){return this.style.fill}set fill($){this.style.fill=$}get protection(){return this.style.protection}set protection($){this.style.protection=$}_mergeStyle($,Y,U){let z=$&&$.numFmt||Y&&Y.numFmt;if(z)U.numFmt=z;let I=$&&$.font||Y&&Y.font;if(I)U.font=I;let Q=$&&$.alignment||Y&&Y.alignment;if(Q)U.alignment=Q;let J=$&&$.border||Y&&Y.border;if(J)U.border=J;let K=$&&$.fill||Y&&Y.fill;if(K)U.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)U.protection=G;return U}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===p0.Types.Merge}merge($,Y){if(this._value.release(),this._value=f7.create(p0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===p0.Types.Merge)this._value.release(),this._value=f7.create(p0.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{})}isMergedTo($){if(this._value.type!==p0.Types.Merge)return!1;return this._value.isMergedTo($)}get master(){if(this.type===p0.Types.Merge)return this._value.master;return this}get isHyperlink(){return this._value.type===p0.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value($){if(this.type===p0.Types.Merge){this._value.master.value=$;return}this._value.release(),this._value=f7.create(f7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new s40($)}get text(){return this._value.toString()}get html(){return mn0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===p0.Types.String)this._value=f7.create(p0.Types.Hyperlink,this,{text:this._value.value,hyperlink:$})}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){let{worksheet:$}=this._row;return{sheetName:$.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name($){this.names=[$]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names($){let{definedNames:Y}=this.workbook;Y.removeAllNames(this.fullAddress),$.forEach((U)=>{Y.addEx(this.fullAddress,U)})}addName($){this.workbook.definedNames.addEx(this.fullAddress,$)}removeName($){this.workbook.definedNames.removeEx(this.fullAddress,$)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation($){this._dataValidations.add(this.address,$)}get model(){let{model:$}=this._value;if($.style=this.style,this._comment)$.comment=this._comment.model;return $}set model($){if(this._value.release(),this._value=f7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=s40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}p0.Types=q5.ValueType;class a40{constructor($){this.model={address:$.address,type:p0.Types.Null}}get value(){return null}set value($){}get type(){return p0.Types.Null}get effectiveType(){return p0.Types.Null}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){}toString(){return""}}class t40{constructor($,Y){this.model={address:$.address,type:p0.Types.Number,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Number}get effectiveType(){return p0.Types.Number}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class e40{constructor($,Y){this.model={address:$.address,type:p0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.String}get effectiveType(){return p0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}class $60{constructor($,Y){this.model={address:$.address,type:p0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}toString(){return this.model.value.richText.map(($)=>$.text).join("")}get type(){return p0.Types.RichText}get effectiveType(){return p0.Types.RichText}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}class Y60{constructor($,Y){this.model={address:$.address,type:p0.Types.Date,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Date}get effectiveType(){return p0.Types.Date}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}class U60{constructor($,Y){if(this.model={address:$.address,type:p0.Types.Hyperlink,text:Y?Y.text:void 0,hyperlink:Y?Y.hyperlink:void 0},Y&&Y.tooltip)this.model.tooltip=Y.tooltip}get value(){let $={text:this.model.text,hyperlink:this.model.hyperlink};if(this.model.tooltip)$.tooltip=this.model.tooltip;return $}set value($){if(this.model={text:$.text,hyperlink:$.hyperlink},$.tooltip)this.model.tooltip=$.tooltip}get text(){return this.model.text}set text($){this.model.text=$}get hyperlink(){return this.model.hyperlink}set hyperlink($){this.model.hyperlink=$}get type(){return p0.Types.Hyperlink}get effectiveType(){return p0.Types.Hyperlink}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}class z60{constructor($,Y){if(this.model={address:$.address,type:p0.Types.Merge,master:Y?Y.address:void 0},this._master=Y,Y)Y.addMergeRef()}get value(){return this._master.value}set value($){if($ instanceof p0){if(this._master)this._master.releaseMergeRef();$.addMergeRef(),this._master=$}else this._master.value=$}isMergedTo($){return $===this._master}get master(){return this._master}get type(){return p0.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}class I60{constructor($,Y){this.cell=$,this.model={address:$.address,type:p0.Types.Formula,shareType:Y?Y.shareType:void 0,ref:Y?Y.ref:void 0,formula:Y?Y.formula:void 0,sharedFormula:Y?Y.sharedFormula:void 0,result:Y?Y.result:void 0}}_copyModel($){let Y={},U=(z)=>{let I=$[z];if(I)Y[z]=I};return U("formula"),U("result"),U("ref"),U("shareType"),U("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(f7.getType($)){case p0.Types.Null:case p0.Types.String:case p0.Types.Number:case p0.Types.Date:break;case p0.Types.Hyperlink:case p0.Types.Formula:default:throw Error("Cannot process that type of result value")}}get dependencies(){let $=this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),Y=this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g);return{ranges:$,cells:Y}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula($){this.model.formula=$}get formulaType(){if(this.model.formula)return q5.FormulaType.Master;if(this.model.sharedFormula)return q5.FormulaType.Shared;return q5.FormulaType.None}get result(){return this.model.result}set result($){this.model.result=$}get type(){return p0.Types.Formula}get effectiveType(){let $=this.model.result;if($===null||$===void 0)return q5.ValueType.Null;if($ instanceof String||typeof $==="string")return q5.ValueType.String;if(typeof $==="number")return q5.ValueType.Number;if($ instanceof Date)return q5.ValueType.Date;if($.text&&$.hyperlink)return q5.ValueType.Hyperlink;if($.formula)return q5.ValueType.Formula;return q5.ValueType.Null}get address(){return this.model.address}set address($){this.model.address=$}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:$}=this.cell,Y=$.findCell(this.model.sharedFormula);this._translatedFormula=Y&&ln0(Y.formula,Y.address,this.model.address)}return this._translatedFormula}toCsvString(){return`${this.model.result||""}`}release(){}toString(){return this.model.result?this.model.result.toString():""}}class Q60{constructor($,Y){this.model={address:$.address,type:p0.Types.SharedString,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.SharedString}get effectiveType(){return p0.Types.SharedString}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class J60{constructor($,Y){this.model={address:$.address,type:p0.Types.Boolean,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Boolean}get effectiveType(){return p0.Types.Boolean}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}class K60{constructor($,Y){this.model={address:$.address,type:p0.Types.Error,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return p0.Types.Error}get effectiveType(){return p0.Types.Error}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}class G60{constructor($,Y){this.model={address:$.address,type:p0.Types.String,value:JSON.stringify(Y),rawValue:Y}}get value(){return this.model.rawValue}set value($){this.model.rawValue=$,this.model.value=JSON.stringify($)}get type(){return p0.Types.String}get effectiveType(){return p0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}var f7={getType($){if($===null||$===void 0)return p0.Types.Null;if($ instanceof String||typeof $==="string")return p0.Types.String;if(typeof $==="number")return p0.Types.Number;if(typeof $==="boolean")return p0.Types.Boolean;if($ instanceof Date)return p0.Types.Date;if($.text&&$.hyperlink)return p0.Types.Hyperlink;if($.formula||$.sharedFormula)return p0.Types.Formula;if($.richText)return p0.Types.RichText;if($.sharedString)return p0.Types.SharedString;if($.error)return p0.Types.Error;return p0.Types.JSON},types:[{t:p0.Types.Null,f:a40},{t:p0.Types.Number,f:t40},{t:p0.Types.String,f:e40},{t:p0.Types.Date,f:Y60},{t:p0.Types.Hyperlink,f:U60},{t:p0.Types.Formula,f:I60},{t:p0.Types.Merge,f:z60},{t:p0.Types.JSON,f:G60},{t:p0.Types.SharedString,f:Q60},{t:p0.Types.RichText,f:$60},{t:p0.Types.Boolean,f:J60},{t:p0.Types.Error,f:K60}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,U){let z=this.types[$];if(!z)throw Error(`Could not create Value of type ${$}`);return new z(Y,U)}};H60.exports=p0});var bM=E((Dd1,q60)=>{var on0=$6(),uM=Z5(),oY=c4(),X60=W60();class Z60{constructor($,Y){this._worksheet=$,this._number=Y,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell($){return this._cells[$-1]}getCellEx($){let Y=this._cells[$.col-1];if(!Y){let U=this._worksheet.getColumn($.col);Y=new X60(this,U,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=oY.l2n($)}return this._cells[$-1]||this.getCellEx({address:oY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...U){let z=$+Y,I=U.length-Y,Q=this._cells.length,J,K,G;if(I<0){for(J=$+U.length;J<=Q;J++)if(G=this._cells[J-1],K=this._cells[J-I-1],K)G=this.getCell(J),G.value=K.value,G.style=K.style,G._comment=K._comment;else if(G)G.value=null,G.style={},G._comment=void 0}else if(I>0)for(J=Q;J>=z;J--)if(K=this._cells[J-1],K)G=this.getCell(J+I),G.value=K.value,G.style=K.style,G._comment=K._comment;else this._cells[J+I-1]=void 0;for(J=0;J{if(U&&U.type!==uM.ValueType.Null)Y(U,z+1)})}addPageBreak($,Y){let U=this._worksheet,z=Math.max(0,$-1)||0,I=Math.max(0,Y-1)||16838,Q={id:this._number,max:I,man:1};if(z)Q.min=z;U.rowBreaks.push(Q)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==uM.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((U,z)=>{if(U!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,z+Y),row:this._number,col:z+Y}).value=U})}else this._worksheet.eachColumnKey((Y,U)=>{if($[U]!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[U]})}get hasValues(){return on0.some(this._cells,($)=>$&&$.type!==uM.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let $=0;return this.eachCell(()=>{$++}),$}get dimensions(){let $=0,Y=0;return this._cells.forEach((U)=>{if(U&&U.type!==uM.ValueType.Null){if(!$||$>U.col)$=U.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((U)=>{if(U)U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){let $=[],Y=0,U=0;return this._cells.forEach((z)=>{if(z){let I=z.model;if(I){if(!Y||Y>z.col)Y=z.col;if(U{switch(U.type){case X60.Types.Merge:break;default:{let z;if(U.address)z=oY.decodeAddress(U.address);else if(Y){let{row:Q}=Y,J=Y.col+1;z={row:Q,col:J,address:oY.encodeAddress(Q,J),$col$row:`$${oY.n2l(J)}$${Q}`}}Y=z;let I=this.getCellEx(z);I.model=U;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}q60.exports=Z60});var cM=E((Ad1,V60)=>{var rn0=$6(),sn0=Z5(),an0=c4();class iM{constructor($,Y,U){if(this._worksheet=$,this._number=Y,U!==!1)this.defn=U}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return an0.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn($){if($){if(this.key=$.key,this.width=$.width!==void 0?$.width:9,this.outlineLevel=$.outlineLevel,$.style)this.style=$.style;else this.style={};this.header=$.header,this._hidden=!!$.hidden}else delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header($){if($!==void 0)this._header=$,this.headers.forEach((Y,U)=>{this._worksheet.getCell(U+1,this.number).value=Y});else this._header=void 0}get key(){return this._key}set key($){if((this._key&&this._worksheet.getColumnKey(this._key))===this)this._worksheet.deleteColumnKey(this._key);if(this._key=$,$)this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo($){return this.width===$.width&&this.hidden===$.hidden&&this.outlineLevel===$.outlineLevel&&rn0.isEqual(this.style,$.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;let $=this.style;if($&&($.font||$.numFmt||$.alignment||$.border||$.fill||$.protection))return!1;return!0}get headerCount(){return this.headers.length}eachCell($,Y){let U=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(z,I)=>{Y(z.getCell(U),I)})}get values(){let $=[];return this.eachCell((Y,U)=>{if(Y&&Y.type!==sn0.ValueType.Null)$[U]=Y.value}),$}set values($){if(!$)return;let Y=this.number,U=0;if($.hasOwnProperty("0"))U=1;$.forEach((z,I)=>{this._worksheet.getCell(I+U,Y).value=z})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((U)=>{U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}static toModel($){let Y=[],U=null;if($)$.forEach((z,I)=>{if(z.isDefault){if(U)U=null}else if(!U||!z.equivalentTo(U))U={min:I+1,max:I+1,width:z.width!==void 0?z.width:9,style:z.style,isCustomWidth:z.isCustomWidth,hidden:z.hidden,outlineLevel:z.outlineLevel,collapsed:z.collapsed},Y.push(U);else U.max=I+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let U=[],z=1,I=0;Y=Y.sort(function(Q,J){return Q.min-J.min});while(I{var tn0=c4();class nM{constructor($,Y,U=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let z=tn0.decodeAddress(Y);this.nativeCol=z.col+U,this.nativeColOff=0,this.nativeRow=z.row+U,this.nativeRowOff=0}else if(Y.nativeCol!==void 0)this.nativeCol=Y.nativeCol||0,this.nativeColOff=Y.nativeColOff||0,this.nativeRow=Y.nativeRow||0,this.nativeRowOff=Y.nativeRowOff||0;else if(Y.col!==void 0)this.col=Y.col+U,this.row=Y.row+U;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof nM||$==null?$:new nM($)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col($){this.nativeCol=Math.floor($),this.nativeColOff=Math.floor(($-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row($){this.nativeRow=Math.floor($),this.nativeRowOff=Math.floor(($-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(this.worksheet.getColumn(this.nativeCol+1).width*1e4):640000}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(this.worksheet.getRow(this.nativeRow+1).height*1e4):180000}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model($){this.nativeCol=$.nativeCol,this.nativeColOff=$.nativeColOff,this.nativeRow=$.nativeRow,this.nativeRowOff=$.nativeRowOff}}L60.exports=nM});var O60=E((Pd1,M60)=>{var en0=c4(),pM=F60();class w60{constructor($,Y){this.worksheet=$,this.model=Y}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw Error("Invalid Image Type")}}set model({type:$,imageId:Y,range:U,hyperlinks:z}){if(this.type=$,this.imageId=Y,$==="image")if(typeof U==="string"){let I=en0.decode(U);this.range={tl:new pM(this.worksheet,{col:I.left,row:I.top},-1),br:new pM(this.worksheet,{col:I.right,row:I.bottom},0),editAs:"oneCell"}}else this.range={tl:new pM(this.worksheet,U.tl,0),br:U.br&&new pM(this.worksheet,U.br,0),ext:U.ext,editAs:U.editAs,hyperlinks:z||U.hyperlinks}}}M60.exports=w60});var B60=E((Td1,A60)=>{var dM=c4();class N60{constructor($,Y,U){this.table=$,this.column=Y,this.index=U}_set($,Y){this.table.cacheState(),this.column[$]=Y}get name(){return this.column.name}set name($){this._set("name",$)}get filterButton(){return this.column.filterButton}set filterButton($){this.column.filterButton=$}get style(){return this.column.style}set style($){this.column.style=$}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel($){this._set("totalsRowLabel",$)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction($){this._set("totalsRowFunction",$)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult($){this._set("totalsRowResult",$)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula($){this._set("totalsRowFormula",$)}}class D60{constructor($,Y){if(this.worksheet=$,Y)this.table=Y,this.validate(),this.store()}getFormula($){switch($.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${$.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${$.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${$.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${$.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${$.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${$.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${$.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${$.name}])`;case"custom":return $.totalsRowFormula;default:throw Error(`Invalid Totals Row Function: ${$.totalsRowFunction}`)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){let{table:$}=this,Y=(G,H,W)=>{if(G[H]===void 0)G[H]=W};Y($,"headerRow",!0),Y($,"totalsRow",!1),Y($,"style",{}),Y($.style,"theme","TableStyleMedium2"),Y($.style,"showFirstColumn",!1),Y($.style,"showLastColumn",!1),Y($.style,"showRowStripes",!1),Y($.style,"showColumnStripes",!1);let U=(G,H)=>{if(!G)throw Error(H)};U($.ref,"Table must have ref"),U($.columns,"Table must have column definitions"),U($.rows,"Table must have row definitions"),$.tl=dM.decodeAddress($.ref);let{row:z,col:I}=$.tl;U(z>0,"Table must be on valid row"),U(I>0,"Table must be on valid col");let{width:Q,filterHeight:J,tableHeight:K}=this;$.autoFilterRef=dM.encode(z,I,z+J-1,I+Q-1),$.tableRef=dM.encode(z,I,z+K-1,I+Q-1),$.columns.forEach((G,H)=>{if(U(G.name,`Column ${H} must have a name`),H===0)Y(G,"totalsRowLabel","Total");else Y(G,"totalsRowFunction","none"),G.totalsRowFormula=this.getFormula(G)})}store(){let $=(J,K)=>{if(K)Object.keys(K).forEach((G)=>{J[G]=K[G]})},{worksheet:Y,table:U}=this,{row:z,col:I}=U.tl,Q=0;if(U.headerRow){let J=Y.getRow(z+Q++);U.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=J.getCell(I+G);X.value=W,$(X,H)})}if(U.rows.forEach((J)=>{let K=Y.getRow(z+Q++);J.forEach((G,H)=>{let W=K.getCell(I+H);W.value=G,$(W,U.columns[H].style)})}),U.totalsRow){let J=Y.getRow(z+Q++);U.columns.forEach((K,G)=>{let H=J.getCell(I+G);if(G===0)H.value=K.totalsRowLabel;else if(this.getFormula(K))H.value={formula:K.totalsRowFormula,result:K.totalsRowResult};else H.value=null;$(H,K.style)})}}load($){let{table:Y}=this,{row:U,col:z}=Y.tl,I=0;if(Y.headerRow){let Q=$.getRow(U+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(z+K);G.value=J.name})}if(Y.rows.forEach((Q)=>{let J=$.getRow(U+I++);Q.forEach((K,G)=>{let H=J.getCell(z+G);H.value=K})}),Y.totalsRow){let Q=$.getRow(U+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(z+K);if(K===0)G.value=J.totalsRowLabel;else if(this.getFormula(J))G.value={formula:J.totalsRowFormula,result:J.totalsRowResult}})}}get model(){return this.table}set model($){this.table=$}cacheState(){if(!this._cache)this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let $=dM.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{z.push(Y[I])});else this.table.columns.splice(U,0,$),this.table.rows.forEach((z,I)=>{z.splice(U,0,Y[I])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((U)=>{U.splice($,Y)})}_assign($,Y,U){this.cacheState(),$[Y]=U}get ref(){return this.table.ref}set ref($){this._assign(this.table,"ref",$)}get name(){return this.table.name}set name($){this.table.name=$}get displayName(){return this.table.displyName||this.table.name}set displayNamename($){this.table.displayName=$}get headerRow(){return this.table.headerRow}set headerRow($){this._assign(this.table,"headerRow",$)}get totalsRow(){return this.table.totalsRow}set totalsRow($){this._assign(this.table,"totalsRow",$)}get theme(){return this.table.style.name}set theme($){this.table.style.name=$}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn($){this.table.style.showFirstColumn=$}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn($){this.table.style.showLastColumn=$}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes($){this.table.style.showRowStripes=$}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes($){this.table.style.showColumnStripes=$}}A60.exports=D60});var vg=E((jd1,T60)=>{class P60{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}T60.exports=P60});var Sg=E((Ed1,j60)=>{var hg=J0("crypto"),$p0={hash($,...Y){let U=hg.createHash($);return U.update(Buffer.concat(Y)),U.digest()},convertPasswordToHash($,Y,U,z){if(Y=Y.toLowerCase(),hg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let Q=Buffer.from($,"utf16le"),J=this.hash(Y,Buffer.from(U,"base64"),Q);for(let K=0;K{var E60=($,Y)=>({...$,...Y.reduce((U,z)=>{if($[z])U[z]={...$[z]};return U},{})}),$9=($,Y,U,z=[])=>{if($[U])Y[U]=E60($[U],z)},Yp0=($)=>Object.keys($).length===0,Up0=($)=>{if(!$)return $;if(Yp0($))return{};let Y={...$};if($9($,Y,"font",["color"]),$9($,Y,"alignment"),$9($,Y,"protection"),$.border)$9($,Y,"border"),$9($.border,Y.border,"top",["color"]),$9($.border,Y.border,"left",["color"]),$9($.border,Y.border,"bottom",["color"]),$9($.border,Y.border,"right",["color"]),$9($.border,Y.border,"diagonal",["color"]);if($.fill){if($9($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((U)=>E60(U,["color"]))}return Y};zp0.copyStyle=Up0});var k60=E((Rd1,y60)=>{var bH=$6(),iH=c4(),cH=Q3(),R60=bM(),mM=cM(),Qp0=Z5(),gg=O60(),_60=B60(),v60=vg(),h60=Sg(),{copyStyle:S60}=C60();class g60{constructor($){$=$||{},this._workbook=$.workbook,this.id=$.id,this.orderNo=$.orderNo,this.name=$.name,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),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,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.dataValidations=new v60,this.views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name($){if($===void 0)$=`sheet${this.id}`;if(this._name===$)return;if(typeof $!=="string")throw Error("The name has to be a string.");if($==="")throw Error("The name can't be empty.");if($==="History")throw Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test($))throw Error(`Worksheet name ${$} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test($))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${$}`);if($&&$.length>31)console.warn(`Worksheet name ${$} exceeds 31 chars. This will be truncated`),$=$.substring(0,31);if(this._workbook._worksheets.find((Y)=>Y&&Y.name.toLowerCase()===$.toLowerCase()))throw Error(`Worksheet name already exists: ${$}`);this._name=$}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let $=new cH;return this._rows.forEach((Y)=>{if(Y){let U=Y.dimensions;if(U)$.expand(Y.number,U.min,Y.number,U.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((z,I)=>{let Q=I.header&&1||I.headers&&I.headers.length||0;return Math.max(z,Q)},0);let Y=1,U=this._columns=[];$.forEach((z)=>{let I=new mM(this,Y++,!1);U.push(I),I.defn=z})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){bH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=iH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new mM(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...U){let I=this._rows.length;if(U.length>0)for(let G=0;G{H.push(X[G]||null)});let W=this.getRow(G+1);W.splice.apply(W,H)}else this._rows.forEach((G)=>{if(G)G.splice($,Y)});let Q=U.length-Y,J=$+Y,K=this._columns.length;if(Q<0)for(let G=$+U.length;G<=K;G++)this.getColumn(G).defn=this.getColumn(G-Q).defn;else if(Q>0)for(let G=K;G>=J;G--)this.getColumn(G+Q).defn=this.getColumn(G).defn;for(let G=$;G<$+U.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,U.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let $=0;return this.eachRow((Y)=>{$=Math.max($,Y.cellCount)}),$}get actualColumnCount(){let $=[],Y=0;return this.eachRow((U)=>{U.eachCell(({col:z})=>{if(!$[z])$[z]=!0,Y++})}),Y}_commitRow(){}get _lastRowNumber(){let $=this._rows,Y=$.length;while(Y>0&&$[Y-1]===void 0)Y--;return Y}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1];return}findRow($){return this._rows[$-1]}findRows($,Y){return this._rows.slice($-1,$-1+Y)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let $=0;return this.eachRow(()=>{$++}),$}getRow($){let Y=this._rows[$-1];if(!Y)Y=this._rows[$-1]=new R60(this,$);return Y}getRows($,Y){if(Y<1)return;let U=[];for(let z=$;z<$+Y;z++)U.push(this.getRow(z));return U}addRow($,Y="n"){let U=this._nextRow,z=this.getRow(U);return z.values=$,this._setStyleOption(U,Y[0]==="i"?Y:"n"),z}addRows($,Y="n"){let U=[];return $.forEach((z)=>{U.push(this.addRow(z,Y))}),U}insertRow($,Y,U="n"){return this.spliceRows($,0,Y),this._setStyleOption($,U),this.getRow($)}insertRows($,Y,U="n"){if(this.spliceRows($,0,...Y),U!=="n"){for(let z=0;z{I.getCell(J).style=S60(Q.style)}),I.height=z.height}duplicateRow($,Y,U=!1){let z=this._rows[$-1],I=Array(Y).fill(z.values);this.spliceRows($+1,U?0:Y,...I);for(let Q=0;Q{J.getCell(G).style=K.style})}}spliceRows($,Y,...U){let z=$+Y,I=U.length,Q=I-Y,J=this._rows.length,K,G;if(Q<0){if($===J)this._rows[J-1]=void 0;for(K=z;K<=J;K++)if(G=this._rows[K-1],G){let H=this.getRow(K+Q);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{H.getCell(X).style=W.style}),this._rows[K-1]=void 0}else this._rows[K+Q-1]=void 0}else if(Q>0)for(K=J;K>=z;K--)if(G=this._rows[K-1],G){let H=this.getRow(K+Q);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{if(H.getCell(X).style=W.style,W._value.constructor.name==="MergeValue"){let Z=this.getRow(W._row._number+I).getCell(X),q=W._value._master,V=this.getRow(q._row._number+I).getCell(q._column._number);Z.merge(V)}})}else this._rows[K+Q-1]=void 0;for(K=0;K{if(U&&U.hasValues)Y(U,U.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let U=iH.getAddress($,Y),z=this._rows[U.row-1];return z?z.findCell(U.col):void 0}getCell($,Y){let U=iH.getAddress($,Y);return this.getRow(U.row).getCellEx(U)}mergeCells(...$){let Y=new cH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new cH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){bH.each(this._merges,(z)=>{if(z.intersects($))throw Error("Cannot merge already merged cells")});let U=this.getCell($.top,$.left);for(let z=$.top;z<=$.bottom;z++)for(let I=$.left;I<=$.right;I++)if(z>$.top||I>$.left)this.getCell(z,I).merge(U,Y);this._merges[U.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++)this.getCell(U,z).unmerge();delete this._merges[$.address]}}get hasMerges(){return bH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new cH($);for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++){let I=this.findCell(U,z);if(I){if(I.type===Qp0.ValueType.Merge)this._unMergeMaster(I.master);else if(this._merges[I.address])this._unMergeMaster(I)}}}fillFormula($,Y,U,z="shared"){let I=iH.decode($),{top:Q,left:J,bottom:K,right:G}=I,H=G-J+1,W=iH.encodeAddress(Q,J),X=z==="shared",Z;if(typeof U==="function")Z=U;else if(Array.isArray(U))if(Array.isArray(U[0]))Z=(V,w)=>U[V-Q][w-J];else Z=(V,w)=>U[(V-Q)*H+(w-J)];else Z=()=>{return};let q=!0;for(let V=Q;V<=K;V++)for(let w=J;w<=G;w++)if(q)this.getCell(V,w).value={shareType:z,formula:Y,ref:$,result:Z(V,w)},q=!1;else this.getCell(V,w).value=X?{sharedFormula:W,result:Z(V,w)}:Z(V,w)}addImage($,Y){let U={type:"image",imageId:$,range:Y};this._media.push(new gg(this,U))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new gg(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((U)=>{if(this.sheetProtection={sheet:!0},Y&&"spinCount"in Y)Y.spinCount=Number.isFinite(Y.spinCount)?Math.round(Math.max(0,Y.spinCount)):1e5;if($)this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=h60.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=h60.convertPasswordToHash($,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount);if(Y){if(this.sheetProtection=Object.assign(this.sheetProtection,Y),!$&&"spinCount"in Y)delete this.sheetProtection.spinCount}U()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new _60(this,$);return this.tables[$.name]=Y,Y}getTable($){return this.tables[$]}removeTable($){delete this.tables[$]}getTables(){return Object.values(this.tables)}addConditionalFormatting($){this.conditionalFormattings.push($)}removeConditionalFormatting($){if(typeof $==="number")this.conditionalFormattings.splice($,1);else if($ instanceof Function)this.conditionalFormattings=this.conditionalFormattings.filter($);else this.conditionalFormattings=[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor($){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=$}get model(){let $={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((z)=>z.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((z)=>z.model),conditionalFormattings:this.conditionalFormattings};$.cols=mM.toModel(this.columns);let Y=$.rows=[],U=$.dimensions=new cH;return this._rows.forEach((z)=>{let I=z&&z.model;if(I)U.expand(I.number,I.min,I.number,I.max),Y.push(I)}),$.merges=[],bH.each(this._merges,(z)=>{$.merges.push(z.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let U=new R60(this,Y.number);this._rows[U.number-1]=U,U.model=Y})}_parseMergeCells($){bH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=mM.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new v60($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new gg(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,U)=>{let z=new _60;return z.model=U,Y[U.name]=z,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}y60.exports=g60});var b60=E((_d1,u60)=>{var x60=$6(),lM=c4();class f60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(lM.decodeEx($))}getCell($){return this.findCellEx(lM.decodeEx($),!0)}findCell($){return this.findCellEx(lM.decodeEx($),!1)}findCellAt($,Y,U){let z=this.sheets[$],I=z&&z[Y];return I&&I[U]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let U=$.left;U<=$.right;U++)this.getCellAt($.sheetName,Y,U);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let U=this.findSheet($,Y),z=this.findSheetRow(U,$,Y);return this.findRowCell(z,$,Y)}getCellAt($,Y,U){let z=this.sheets[$]||(this.sheets[$]=[]),I=z[Y]||(z[Y]=[]);return I[U]||(I[U]={sheetName:$,address:lM.n2l(U)+Y,row:Y,col:U})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let U=this.findSheetRow(Y,$);if(!U)return;delete U[$.col]}forEachInSheet($,Y){let U=this.sheets[$];if(U)U.forEach((z,I)=>{if(z)z.forEach((Q,J)=>{if(Q)Y(Q,I,J)})})}forEach($){x60.each(this.sheets,(Y,U)=>{this.forEachInSheet(U,$)})}map($){let Y=[];return this.forEach((U)=>{Y.push($(U))}),Y}findSheet($,Y){let U=$.sheetName;if(this.sheets[U])return this.sheets[U];if(Y)return this.sheets[U]=[];return}findSheetRow($,Y,U){let{row:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=[];return}findRowCell($,Y,U){let{col:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,U,z){let I=this.sheets[$];if(I){let Q=[];for(let J=0;J{J.splice(Y,U,...Q)})}}}u60.exports=f60});var yg=E((vd1,n60)=>{var $Q=$6(),nH=c4(),i60=b60(),Jp0=Q3(),Kp0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class c60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new i60)}add($,Y){let U=nH.decodeEx($);this.addEx(U,Y)}addEx($,Y){let U=this.getMatrix(Y);if($.top)for(let z=$.left;z<=$.right;z++)for(let I=$.top;I<=$.bottom;I++){let Q={sheetName:$.sheetName,address:nH.n2l(z)+I,row:I,col:z};U.addCellEx(Q)}else U.addCellEx($)}remove($,Y){let U=nH.decodeEx($);this.removeEx(U,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){$Q.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){$Q.each(this.matrixMap,(Y,U)=>{Y.forEach((z)=>{$(U,z)})})}getNames($){return this.getNamesEx(nH.decodeEx($))}getNamesEx($){return $Q.map(this.matrixMap,(Y,U)=>Y.findCellEx($)&&U).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:U}=Y,z=new Jp0(Y.row,Y.col,Y.row,Y.col,U),I,Q;function J(G,H){let W=$.findCellAt(U,G,Y.col);if(!W||!W.mark)return!1;return z[H]=G,W.mark=!1,!0}for(Q=Y.row-1;J(Q,"top");Q--);for(Q=Y.row+1;J(Q,"bottom");Q++);function K(G,H){let W=[];for(Q=z.top;Q<=z.bottom;Q++){let X=$.findCellAt(U,Q,G);if(X&&X.mark)W.push(X);else return!1}z[H]=G;for(let X=0;X{z.mark=!0});let U=Y.map((z)=>z.mark&&this._explore(Y,z)).filter(Boolean).map((z)=>z.$shortRange);return{name:$,ranges:U}}normaliseMatrix($,Y){$.forEachInSheet(Y,(U,z,I)=>{if(U){if(U.row!==z||U.col!==I)U.row=z,U.col=I,U.address=nH.n2l(I)+z}})}spliceRows($,Y,U,z){$Q.each(this.matrixMap,(I)=>{I.spliceRows($,Y,U,z),this.normaliseMatrix(I,$)})}spliceColumns($,Y,U,z){$Q.each(this.matrixMap,(I)=>{I.spliceColumns($,Y,U,z),this.normaliseMatrix(I,$)})}get model(){return $Q.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((U)=>{let z=Y[U.name]=new i60;U.ranges.forEach((I)=>{if(Kp0.test(I.split("!").pop()||""))z.addCell(I)})})}}n60.exports=c60});var Q6=E((hd1,kg)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)kg.exports={nextTick:Gp0};else kg.exports=process;function Gp0($,Y,U,z){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var I=arguments.length,Q,J;switch(I){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,Y)});case 3:return process.nextTick(function(){$.call(null,Y,U)});case 4:return process.nextTick(function(){$.call(null,Y,U,z)});default:Q=Array(I-1),J=0;while(J{var Hp0={}.toString;p60.exports=Array.isArray||function($){return Hp0.call($)=="[object Array]"}});var J6=E((xg,m60)=>{var oM=J0("buffer"),J3=oM.Buffer;function d60($,Y){for(var U in $)Y[U]=$[U]}if(J3.from&&J3.alloc&&J3.allocUnsafe&&J3.allocUnsafeSlow)m60.exports=oM;else d60(oM,xg),xg.Buffer=UQ;function UQ($,Y,U){return J3($,Y,U)}d60(J3,UQ);UQ.from=function($,Y,U){if(typeof $==="number")throw TypeError("Argument must not be a number");return J3($,Y,U)};UQ.alloc=function($,Y,U){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=J3($);if(Y!==void 0)if(typeof U==="string")z.fill(Y,U);else z.fill(Y);else z.fill(0);return z};UQ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return J3($)};UQ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return oM.SlowBuffer($)}});var N4=E((Pp0)=>{function Wp0($){if(Array.isArray)return Array.isArray($);return rM($)==="[object Array]"}Pp0.isArray=Wp0;function Xp0($){return typeof $==="boolean"}Pp0.isBoolean=Xp0;function Zp0($){return $===null}Pp0.isNull=Zp0;function qp0($){return $==null}Pp0.isNullOrUndefined=qp0;function Vp0($){return typeof $==="number"}Pp0.isNumber=Vp0;function Lp0($){return typeof $==="string"}Pp0.isString=Lp0;function Fp0($){return typeof $==="symbol"}Pp0.isSymbol=Fp0;function wp0($){return $===void 0}Pp0.isUndefined=wp0;function Mp0($){return rM($)==="[object RegExp]"}Pp0.isRegExp=Mp0;function Op0($){return typeof $==="object"&&$!==null}Pp0.isObject=Op0;function Np0($){return rM($)==="[object Date]"}Pp0.isDate=Np0;function Dp0($){return rM($)==="[object Error]"||$ instanceof Error}Pp0.isError=Dp0;function Ap0($){return typeof $==="function"}Pp0.isFunction=Ap0;function Bp0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}Pp0.isPrimitive=Bp0;Pp0.isBuffer=J0("buffer").Buffer.isBuffer;function rM($){return Object.prototype.toString.call($)}});var l60=E((yd1,fg)=>{if(typeof Object.create==="function")fg.exports=function(Y,U){if(U)Y.super_=U,Y.prototype=Object.create(U.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else fg.exports=function(Y,U){if(U){Y.super_=U;var z=function(){};z.prototype=U.prototype,Y.prototype=new z,Y.prototype.constructor=Y}}});var W1=E((kd1,ug)=>{try{if(sM=J0("util"),typeof sM.inherits!=="function")throw"";ug.exports=sM.inherits}catch($){ug.exports=l60()}var sM});var r60=E((xd1,bg)=>{function bp0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var o60=J6().Buffer,pH=J0("util");function ip0($,Y,U){$.copy(Y,U)}bg.exports=function(){function $(){bp0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(U){var z={data:U,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(U){var z={data:U,next:this.head};if(this.length===0)this.tail=z;this.head=z,++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 z=this.head,I=""+z.data;while(z=z.next)I+=U+z.data;return I},$.prototype.concat=function(U){if(this.length===0)return o60.alloc(0);var z=o60.allocUnsafe(U>>>0),I=this.head,Q=0;while(I)ip0(I.data,z,Q),Q+=I.data.length,I=I.next;return z},$}();if(pH&&pH.inspect&&pH.inspect.custom)bg.exports.prototype[pH.inspect.custom]=function(){var $=pH.inspect({length:this.length});return this.constructor.name+" "+$}});var ig=E((fd1,s60)=>{var aM=Q6();function cp0($,Y){var U=this,z=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(z||I){if(Y)Y($);else if($){if(!this._writableState)aM.nextTick(tM,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,aM.nextTick(tM,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Q){if(!Y&&Q){if(!U._writableState)aM.nextTick(tM,U,Q);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,aM.nextTick(tM,U,Q)}else if(Y)Y(Q)}),this}function np0(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function tM($,Y){$.emit("error",Y)}s60.exports={destroy:cp0,undestroy:np0}});var u7=E((ud1,a60)=>{a60.exports=J0("util").deprecate});var ng=E((bd1,Q80)=>{var rY=Q6();Q80.exports=Z6;function e60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){Kd0(Y,$)}}var pp0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:rY.nextTick,zQ;Z6.WritableState=mH;var $80=Object.create(N4());$80.inherits=W1();var dp0={deprecate:u7()},Y80=J0("stream"),$O=J6().Buffer,mp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function lp0($){return $O.from($)}function op0($){return $O.isBuffer($)||$ instanceof mp0}var U80=ig();$80.inherits(Z6,Y80);function rp0(){}function mH($,Y){zQ=zQ||sY(),$=$||{};var U=Y instanceof zQ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:z,writableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(I||I===0))this.highWaterMark=I;else this.highWaterMark=Q;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=$.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){Ud0(Y,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new e60(this)}mH.prototype.getBuffer=function(){var Y=this.bufferedRequest,U=[];while(Y)U.push(Y),Y=Y.next;return U};(function(){try{Object.defineProperty(mH.prototype,"buffer",{get:dp0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var eM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")eM=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(eM.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof mH}});else eM=function($){return $ instanceof this};function Z6($){if(zQ=zQ||sY(),!eM.call(Z6,this)&&!(this instanceof zQ))return new Z6($);if(this._writableState=new mH($,this),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}Y80.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function sp0($,Y){var U=Error("write after end");$.emit("error",U),rY.nextTick(Y,U)}function ap0($,Y,U,z){var I=!0,Q=!1;if(U===null)Q=TypeError("May not write null values to stream");else if(typeof U!=="string"&&U!==void 0&&!Y.objectMode)Q=TypeError("Invalid non-string/buffer chunk");if(Q)$.emit("error",Q),rY.nextTick(z,Q),I=!1;return I}Z6.prototype.write=function($,Y,U){var z=this._writableState,I=!1,Q=!z.objectMode&&op0($);if(Q&&!$O.isBuffer($))$=lp0($);if(typeof Y==="function")U=Y,Y=null;if(Q)Y="buffer";else if(!Y)Y=z.defaultEncoding;if(typeof U!=="function")U=rp0;if(z.ended)sp0(this,U);else if(Q||ap0(this,z,$,U))z.pendingcb++,I=ep0(this,z,Q,$,Y,U);return I};Z6.prototype.cork=function(){var $=this._writableState;$.corked++};Z6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)z80(this,$)}};Z6.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=Y.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+Y);return this._writableState.defaultEncoding=Y,this};function tp0($,Y,U){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=$O.from(Y,U);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ep0($,Y,U,z,I,Q){if(!U){var J=tp0(Y,z,I);if(z!==J)U=!0,I="buffer",z=J}var K=Y.objectMode?1:z.length;Y.length+=K;var G=Y.length{var J80=Q6(),Gd0=Object.keys||function($){var Y=[];for(var U in $)Y.push(U);return Y};H80.exports=K3;var K80=Object.create(N4());K80.inherits=W1();var G80=dg(),pg=ng();K80.inherits(K3,G80);{YO=Gd0(pg.prototype);for(lH=0;lH{var lg=J6().Buffer,W80=lg.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Xd0($){if(!$)return"utf8";var Y;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Y)return;$=(""+$).toLowerCase(),Y=!0}}function Zd0($){var Y=Xd0($);if(typeof Y!=="string"&&(lg.isEncoding===W80||!W80($)))throw Error("Unknown encoding: "+$);return Y||$}Pd0.StringDecoder=rH;function rH($){this.encoding=Zd0($);var Y;switch(this.encoding){case"utf16le":this.text=Md0,this.end=Od0,Y=4;break;case"utf8":this.fillLast=Ld0,Y=4;break;case"base64":this.text=Nd0,this.end=Dd0,Y=3;break;default:this.write=Ad0,this.end=Bd0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lg.allocUnsafe(Y)}rH.prototype.write=function($){if($.length===0)return"";var Y,U;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";U=this.lastNeed,this.lastNeed=0}else U=0;if(U<$.length)return Y?Y+this.text($,U):this.text($,U);return Y||""};rH.prototype.end=wd0;rH.prototype.text=Fd0;rH.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function mg($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function qd0($,Y,U){var z=Y.length-1;if(z=0){if(I>0)$.lastNeed=I-1;return I}if(--z=0){if(I>0)$.lastNeed=I-2;return I}if(--z=0){if(I>0)if(I===2)I=0;else $.lastNeed=I-3;return I}return 0}function Vd0($,Y,U){if((Y[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Y.length>1){if((Y[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Y.length>2){if((Y[2]&192)!==128)return $.lastNeed=2,"�"}}}function Ld0($){var Y=this.lastTotal-this.lastNeed,U=Vd0(this,$,Y);if(U!==void 0)return U;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Y,0,$.length),this.lastNeed-=$.length}function Fd0($,Y){var U=qd0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=U;var z=$.length-(U-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",Y,z)}function wd0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function Md0($,Y){if(($.length-Y)%2===0){var U=$.toString("utf16le",Y);if(U){var z=U.charCodeAt(U.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],U.slice(0,-1)}return U}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function Od0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var U=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,U)}return Y}function Nd0($,Y){var U=($.length-Y)%3;if(U===0)return $.toString("base64",Y);if(this.lastNeed=3-U,this.lastTotal=3,U===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-U)}function Dd0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Ad0($){return $.toString(this.encoding)}function Bd0($){return $&&$.length?this.write($):""}});var dg=E((pd1,A80)=>{var QQ=Q6();A80.exports=P4;var jd0=YQ(),sH;P4.ReadableState=w80;var nd1=J0("events").EventEmitter,V80=function($,Y){return $.listeners(Y).length},eg=J0("stream"),aH=J6().Buffer,Ed0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Cd0($){return aH.from($)}function Rd0($){return aH.isBuffer($)||$ instanceof Ed0}var L80=Object.create(N4());L80.inherits=W1();var rg=J0("util"),$4=void 0;if(rg&&rg.debuglog)$4=rg.debuglog("stream");else $4=function(){};var _d0=r60(),F80=ig(),IQ;L80.inherits(P4,eg);var sg=["error","close","destroy","pause","resume"];function vd0($,Y,U){if(typeof $.prependListener==="function")return $.prependListener(Y,U);if(!$._events||!$._events[Y])$.on(Y,U);else if(jd0($._events[Y]))$._events[Y].unshift(U);else $._events[Y]=[U,$._events[Y]]}function w80($,Y){sH=sH||sY(),$=$||{};var U=Y instanceof sH;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:z,readableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(I||I===0))this.highWaterMark=I;else this.highWaterMark=Q;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new _d0,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!IQ)IQ=og().StringDecoder;this.decoder=new IQ($.encoding),this.encoding=$.encoding}}function P4($){if(sH=sH||sY(),!(this instanceof P4))return new P4($);if(this._readableState=new w80($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}eg.call(this)}Object.defineProperty(P4.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});P4.prototype.destroy=F80.destroy;P4.prototype._undestroy=F80.undestroy;P4.prototype._destroy=function($,Y){this.push(null),Y($)};P4.prototype.push=function($,Y){var U=this._readableState,z;if(!U.objectMode){if(typeof $==="string"){if(Y=Y||U.defaultEncoding,Y!==U.encoding)$=aH.from($,Y),Y="";z=!0}}else z=!0;return M80(this,$,Y,!1,z)};P4.prototype.unshift=function($){return M80(this,$,null,!0,!1)};function M80($,Y,U,z,I){var Q=$._readableState;if(Y===null)Q.reading=!1,yd0($,Q);else{var J;if(!I)J=hd0(Q,Y);if(J)$.emit("error",J);else if(Q.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!Q.objectMode&&Object.getPrototypeOf(Y)!==aH.prototype)Y=Cd0(Y);if(z)if(Q.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else ag($,Q,Y,!0);else if(Q.ended)$.emit("error",Error("stream.push() after EOF"));else if(Q.reading=!1,Q.decoder&&!U)if(Y=Q.decoder.write(Y),Q.objectMode||Y.length!==0)ag($,Q,Y,!1);else O80($,Q);else ag($,Q,Y,!1)}else if(!z)Q.reading=!1}return Sd0(Q)}function ag($,Y,U,z){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",U),$.read(0);else{if(Y.length+=Y.objectMode?1:U.length,z)Y.buffer.unshift(U);else Y.buffer.push(U);if(Y.needReadable)UO($)}O80($,Y)}function hd0($,Y){var U;if(!Rd0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)U=TypeError("Invalid non-string/buffer chunk");return U}function Sd0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!IQ)IQ=og().StringDecoder;return this._readableState.decoder=new IQ($),this._readableState.encoding=$,this};var X80=8388608;function gd0($){if($>=X80)$=X80;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function Z80($,Y){if($<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if($!==$)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if($>Y.highWaterMark)Y.highWaterMark=gd0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}P4.prototype.read=function($){$4("read",$),$=parseInt($,10);var Y=this._readableState,U=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&(Y.length>=Y.highWaterMark||Y.ended)){if($4("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)tg(this);else UO(this);return null}if($=Z80($,Y),$===0&&Y.ended){if(Y.length===0)tg(this);return null}var z=Y.needReadable;if($4("need readable",z),Y.length===0||Y.length-$0)I=N80($,Y);else I=null;if(I===null)Y.needReadable=!0,$=0;else Y.length-=$;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(U!==$&&Y.ended)tg(this)}if(I!==null)this.emit("data",I);return I};function yd0($,Y){if(Y.ended)return;if(Y.decoder){var U=Y.decoder.end();if(U&&U.length)Y.buffer.push(U),Y.length+=Y.objectMode?1:U.length}Y.ended=!0,UO($)}function UO($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if($4("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)QQ.nextTick(q80,$);else q80($)}function q80($){$4("emit readable"),$.emit("readable"),$y($)}function O80($,Y){if(!Y.readingMore)Y.readingMore=!0,QQ.nextTick(kd0,$,Y)}function kd0($,Y){var U=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&D80(z.pipes,$)!==-1)&&!H)$4("false write response, pause",z.awaitDrain),z.awaitDrain++,X=!0;U.pause()}}function q(F){if($4("onerror",F),M(),$.removeListener("error",q),V80($,"error")===0)$.emit("error",F)}vd0($,"error",q);function V(){$.removeListener("finish",w),M()}$.once("close",V);function w(){$4("onfinish"),$.removeListener("close",V),M()}$.once("finish",w);function M(){$4("unpipe"),U.unpipe($)}if($.emit("pipe",U),!z.flowing)$4("pipe resume"),U.resume();return $};function xd0($){return function(){var Y=$._readableState;if($4("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&V80($,"data"))Y.flowing=!0,$y($)}}P4.prototype.unpipe=function($){var Y=this._readableState,U={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if($&&$!==Y.pipes)return this;if(!$)$=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,$)$.emit("unpipe",this,U);return this}if(!$){var{pipes:z,pipesCount:I}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Q=0;Q=Y.length){if(Y.decoder)U=Y.buffer.join("");else if(Y.buffer.length===1)U=Y.buffer.head.data;else U=Y.buffer.concat(Y.length);Y.buffer.clear()}else U=id0($,Y.buffer,Y.decoder);return U}function id0($,Y,U){var z;if($Q.length?Q.length:$;if(J===Q.length)I+=Q;else I+=Q.slice(0,$);if($-=J,$===0){if(J===Q.length)if(++z,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=Q.slice(J);break}++z}return Y.length-=z,I}function nd0($,Y){var U=aH.allocUnsafe($),z=Y.head,I=1;z.data.copy(U),$-=z.data.length;while(z=z.next){var Q=z.data,J=$>Q.length?Q.length:$;if(Q.copy(U,U.length-$,0,J),$-=J,$===0){if(J===Q.length)if(++I,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=Q.slice(J);break}++I}return Y.length-=I,U}function tg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,QQ.nextTick(pd0,Y,$)}function pd0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function D80($,Y){for(var U=0,z=$.length;U{T80.exports=G3;var zO=sY(),P80=Object.create(N4());P80.inherits=W1();P80.inherits(G3,zO);function dd0($,Y){var U=this._transformState;U.transforming=!1;var z=U.writecb;if(!z)return this.emit("error",Error("write callback called multiple times"));if(U.writechunk=null,U.writecb=null,Y!=null)this.push(Y);z($);var I=this._readableState;if(I.reading=!1,I.needReadable||I.length{C80.exports=tH;var j80=Yy(),E80=Object.create(N4());E80.inherits=W1();E80.inherits(tH,j80);function tH($){if(!(this instanceof tH))return new tH($);j80.call(this,$)}tH.prototype._transform=function($,Y,U){U(null,$)}});var Uy=E((l6,IO)=>{var Y9=J0("stream");if(process.env.READABLE_STREAM==="disable"&&Y9)IO.exports=Y9,l6=IO.exports=Y9.Readable,l6.Readable=Y9.Readable,l6.Writable=Y9.Writable,l6.Duplex=Y9.Duplex,l6.Transform=Y9.Transform,l6.PassThrough=Y9.PassThrough,l6.Stream=Y9;else l6=IO.exports=dg(),l6.Stream=Y9||l6,l6.Readable=l6,l6.Writable=ng(),l6.Duplex=sY(),l6.Transform=Yy(),l6.PassThrough=R80()});var H3=E((od0)=>{od0.base64=!0;od0.array=!0;od0.string=!0;od0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";od0.nodebuffer=typeof Buffer<"u";od0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")od0.blob=!1;else{QO=new ArrayBuffer(0);try{od0.blob=new Blob([QO],{type:"application/zip"}).size===0}catch($){try{Iy=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,JO=new Iy,JO.append(QO),od0.blob=JO.getBlob("application/zip").size===0}catch(Y){od0.blob=!1}}}var QO,Iy,JO;try{od0.nodestream=!!Uy().Readable}catch($){od0.nodestream=!1}});var Qy=E((zm0)=>{var Ym0=n4(),Um0=H3(),U9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";zm0.encode=function($){var Y=[],U,z,I,Q,J,K,G,H=0,W=$.length,X=W,Z=Ym0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)U=$.charCodeAt(H++),z=H>2,J=(U&3)<<4|z>>4,K=X>1?(z&15)<<2|I>>6:64,G=X>2?I&63:64,Y.push(U9.charAt(Q)+U9.charAt(J)+U9.charAt(K)+U9.charAt(G))}return Y.join("")};zm0.decode=function($){var Y,U,z,I,Q,J,K,G=0,H=0,W="data:";if($.substr(0,W.length)===W)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var X=$.length*3/4;if($.charAt($.length-1)===U9.charAt(64))X--;if($.charAt($.length-2)===U9.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(Um0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(I=U9.indexOf($.charAt(G++)),Q=U9.indexOf($.charAt(G++)),J=U9.indexOf($.charAt(G++)),K=U9.indexOf($.charAt(G++)),Y=I<<2|Q>>4,U=(Q&15)<<4|J>>2,z=(J&3)<<6|K,Z[H++]=Y,J!==64)Z[H++]=U;if(K!==64)Z[H++]=z}return Z}});var eH=E((rd1,_80)=>{_80.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,Y){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,Y);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,Y)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var Y=new Buffer($);return Y.fill(0),Y}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var S80=E((ad1,h80)=>{var sd1=global.MutationObserver||global.WebKitMutationObserver,v80;v80=function(){process.nextTick(Wm0)};var Jm0,Km0,Gm0,Hm0,Jy,$W=[];function Wm0(){Jy=!0;var $,Y,U=$W.length;while(U){Y=$W,$W=[],$=-1;while(++${var g80=S80();function KQ(){}var q8={},y80=["REJECTED"],Ky=["FULFILLED"],k80=["PENDING"];JQ=["UNHANDLED"];var JQ;u80.exports=b7;function b7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=k80,this.queue=[],this.outcome=void 0,this.handled=JQ,$!==KQ)x80(this,$)}b7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(U,z);function U(I){function Q(){return I}return Y.resolve($()).then(Q)}function z(I){function Q(){throw I}return Y.resolve($()).then(Q)}};b7.prototype.catch=function($){return this.then(null,$)};b7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===Ky||typeof Y!=="function"&&this.state===y80)return this;var U=new this.constructor(KQ);if(this.handled===JQ)this.handled=null;if(this.state!==k80){var z=this.state===Ky?$:Y;Gy(U,z,this.outcome)}else this.queue.push(new YW(U,$,Y));return U};function YW($,Y,U){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof U==="function")this.onRejected=U,this.callRejected=this.otherCallRejected}YW.prototype.callFulfilled=function($){q8.resolve(this.promise,$)};YW.prototype.otherCallFulfilled=function($){Gy(this.promise,this.onFulfilled,$)};YW.prototype.callRejected=function($){q8.reject(this.promise,$)};YW.prototype.otherCallRejected=function($){Gy(this.promise,this.onRejected,$)};function Gy($,Y,U){g80(function(){var z;try{z=Y(U)}catch(I){return q8.reject($,I)}if(z===$)q8.reject($,TypeError("Cannot resolve promise with itself"));else q8.resolve($,z)})}q8.resolve=function($,Y){var U=f80(Zm0,Y);if(U.status==="error")return q8.reject($,U.value);var z=U.value;if(z)x80($,z);else{$.state=Ky,$.outcome=Y;var I=-1,Q=$.queue.length;while(++I{var Hy=null;if(typeof Promise<"u")Hy=Promise;else Hy=b80();i80.exports={Promise:Hy}});var Wy=E((c80)=>{(function($,Y){if($.setImmediate)return;var U=1,z={},I=!1,Q=$.document,J;function K(N){if(typeof N!=="function")N=Function(""+N);var O=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?c80:global:self)});var n4=E((Om0)=>{var i7=H3(),wm0=Qy(),HQ=eH(),Xy=GQ();Wy();function Mm0($){var Y=null;if(i7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return GO($,Y)}Om0.newBlob=function($,Y){Om0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(I){try{var U=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,z=new U;return z.append($),z.getBlob(Y)}catch(Q){throw Error("Bug : can't construct the Blob.")}}};function UW($){return $}function GO($,Y){for(var U=0;U<$.length;++U)Y[U]=$.charCodeAt(U)&255;return Y}var KO={stringifyByChunk:function($,Y,U){var z=[],I=0,Q=$.length;if(Q<=U)return String.fromCharCode.apply(null,$);while(I1)try{return KO.stringifyByChunk($,U,Y)}catch(I){Y=Math.floor(Y/2)}return KO.stringifyByChar($)}Om0.applyFromCharCode=zW;function HO($,Y){for(var U=0;U<$.length;U++)Y[U]=$[U];return Y}var c7={};c7.string={string:UW,array:function($){return GO($,Array($.length))},arraybuffer:function($){return c7.string.uint8array($).buffer},uint8array:function($){return GO($,new Uint8Array($.length))},nodebuffer:function($){return GO($,HQ.allocBuffer($.length))}};c7.array={string:zW,array:UW,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return HQ.newBufferFrom($)}};c7.arraybuffer={string:function($){return zW(new Uint8Array($))},array:function($){return HO(new Uint8Array($),Array($.byteLength))},arraybuffer:UW,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return HQ.newBufferFrom(new Uint8Array($))}};c7.uint8array={string:zW,array:function($){return HO($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:UW,nodebuffer:function($){return HQ.newBufferFrom($)}};c7.nodebuffer={string:zW,array:function($){return HO($,Array($.length))},arraybuffer:function($){return c7.nodebuffer.uint8array($).buffer},uint8array:function($){return HO($,new Uint8Array($.length))},nodebuffer:UW};Om0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;Om0.checkSupport($);var U=Om0.getTypeOf(Y),z=c7[U][$](Y);return z};Om0.resolve=function($){var Y=$.split("/"),U=[];for(var z=0;z"u")$[U]=arguments[Y][U];return $};Om0.prepareContent=function($,Y,U,z,I){var Q=Xy.Promise.resolve(Y).then(function(J){var K=i7.blob&&(J instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(J))!==-1);if(K&&typeof FileReader<"u")return new Xy.Promise(function(G,H){var W=new FileReader;W.onload=function(X){G(X.target.result)},W.onerror=function(X){H(X.target.error)},W.readAsArrayBuffer(J)});else return J});return Q.then(function(J){var K=Om0.getTypeOf(J);if(!K)return Xy.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")J=Om0.transformTo("uint8array",J);else if(K==="string"){if(I)J=wm0.decode(J);else if(U){if(z!==!0)J=Mm0(J)}}return J})}});var G$=E((Um1,m80)=>{function d80($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}d80.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,Y){return this._listeners[$].push(Y),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,Y){if(this._listeners[$])for(var U=0;U "+$;else return $}};m80.exports=d80});var XQ=E((gm0)=>{var WQ=n4(),aY=H3(),_m0=eH(),WO=G$(),IW=Array(256);for(z9=0;z9<256;z9++)IW[z9]=z9>=252?6:z9>=248?5:z9>=240?4:z9>=224?3:z9>=192?2:1;var z9;IW[254]=IW[254]=1;var vm0=function($){var Y,U,z,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|U&63;else if(U<65536)Y[Q++]=224|U>>>12,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63;else Y[Q++]=240|U>>>18,Y[Q++]=128|U>>>12&63,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63}return Y},hm0=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+IW[$[U]]>Y?U:Y},Sm0=function($){var Y,U,z,I,Q=$.length,J=Array(Q*2);for(U=0,Y=0;Y4){J[U++]=65533,Y+=I-1;continue}z&=I===2?31:I===3?15:7;while(I>1&&Y1){J[U++]=65533;continue}if(z<65536)J[U++]=z;else z-=65536,J[U++]=55296|z>>10&1023,J[U++]=56320|z&1023}if(J.length!==U)if(J.subarray)J=J.subarray(0,U);else J.length=U;return WQ.applyFromCharCode(J)};gm0.utf8encode=function(Y){if(aY.nodebuffer)return _m0.newBufferFrom(Y,"utf-8");return vm0(Y)};gm0.utf8decode=function(Y){if(aY.nodebuffer)return WQ.transformTo("nodebuffer",Y).toString("utf-8");return Y=WQ.transformTo(aY.uint8array?"uint8array":"array",Y),Sm0(Y)};function XO(){WO.call(this,"utf-8 decode"),this.leftOver=null}WQ.inherits(XO,WO);XO.prototype.processChunk=function($){var Y=WQ.transformTo(aY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(aY.uint8array){var U=Y;Y=new Uint8Array(U.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(U,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var z=hm0(Y),I=Y;if(z!==Y.length)if(aY.uint8array)I=Y.subarray(0,z),this.leftOver=Y.subarray(z,Y.length);else I=Y.slice(0,z),this.leftOver=Y.slice(z,Y.length);this.push({data:gm0.utf8decode(I),meta:$.meta})};XO.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:gm0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};gm0.Utf8DecodeWorker=XO;function qy(){WO.call(this,"utf-8 encode")}WQ.inherits(qy,WO);qy.prototype.processChunk=function($){this.push({data:gm0.utf8encode($.data),meta:$.meta})};gm0.Utf8EncodeWorker=qy});var a80=E((Im1,s80)=>{var o80=G$(),r80=n4();function Ly($){o80.call(this,"ConvertWorker to "+$),this.destType=$}r80.inherits(Ly,o80);Ly.prototype.processChunk=function($){this.push({data:r80.transformTo(this.destType,$.data),meta:$.meta})};s80.exports=Ly});var $$0=E((Qm1,e80)=>{var t80=Uy().Readable,xm0=n4();xm0.inherits(Fy,t80);function Fy($,Y,U){t80.call(this,Y),this._helper=$;var z=this;$.on("data",function(I,Q){if(!z.push(I))z._helper.pause();if(U)U(Q)}).on("error",function(I){z.emit("error",I)}).on("end",function(){z.push(null)})}Fy.prototype._read=function(){this._helper.resume()};e80.exports=Fy});var wy=E((Jm1,z$0)=>{var tY=n4(),fm0=a80(),um0=G$(),bm0=Qy(),im0=H3(),cm0=GQ(),Y$0=null;if(im0.nodestream)try{Y$0=$$0()}catch($){}function nm0($,Y,U){switch($){case"blob":return tY.newBlob(tY.transformTo("arraybuffer",Y),U);case"base64":return bm0.encode(Y);default:return tY.transformTo($,Y)}}function pm0($,Y){var U,z=0,I=null,Q=0;for(U=0;U{mm0.base64=!1;mm0.binary=!1;mm0.dir=!1;mm0.createFolders=!0;mm0.date=null;mm0.compression=null;mm0.compressionOptions=null;mm0.comment=null;mm0.unixPermissions=null;mm0.dosPermissions=null});var Oy=E((Gm1,I$0)=>{var ZO=n4(),qO=G$(),zl0=16384;function ZQ($){qO.call(this,"DataWorker");var Y=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(U){if(Y.dataIsReady=!0,Y.data=U,Y.max=U&&U.length||0,Y.type=ZO.getTypeOf(U),!Y.isPaused)Y._tickAndRepeat()},function(U){Y.error(U)})}ZO.inherits(ZQ,qO);ZQ.prototype.cleanUp=function(){qO.prototype.cleanUp.call(this),this.data=null};ZQ.prototype.resume=function(){if(!qO.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,ZO.delay(this._tickAndRepeat,[],this);return!0};ZQ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)ZO.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};ZQ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=zl0,Y=null,U=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":Y=this.data.substring(this.index,U);break;case"uint8array":Y=this.data.subarray(this.index,U);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,U);break}return this.index=U,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};I$0.exports=ZQ});var VO=E((Hm1,J$0)=>{var Il0=n4();function Ql0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var Q$0=Ql0();function Jl0($,Y,U,z){var I=Q$0,Q=z+U;$=$^-1;for(var J=z;J>>8^I[($^Y[J])&255];return $^-1}function Kl0($,Y,U,z){var I=Q$0,Q=z+U;$=$^-1;for(var J=z;J>>8^I[($^Y.charCodeAt(J))&255];return $^-1}J$0.exports=function(Y,U){if(typeof Y>"u"||!Y.length)return 0;var z=Il0.getTypeOf(Y)!=="string";if(z)return Jl0(U|0,Y,Y.length,0);else return Kl0(U|0,Y,Y.length,0)}});var Dy=E((Wm1,G$0)=>{var K$0=G$(),Gl0=VO(),Hl0=n4();function Ny(){K$0.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Hl0.inherits(Ny,K$0);Ny.prototype.processChunk=function($){this.streamInfo.crc32=Gl0($.data,this.streamInfo.crc32||0),this.push($)};G$0.exports=Ny});var W$0=E((Xm1,H$0)=>{var Wl0=n4(),Ay=G$();function By($){Ay.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}Wl0.inherits(By,Ay);By.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}Ay.prototype.processChunk.call(this,$)};H$0.exports=By});var LO=E((Zm1,q$0)=>{var X$0=GQ(),Z$0=Oy(),Xl0=Dy(),Py=W$0();function Ty($,Y,U,z,I){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=U,this.compression=z,this.compressedContent=I}Ty.prototype={getContentWorker:function(){var $=new Z$0(X$0.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Py("data_length")),Y=this;return $.on("end",function(){if(this.streamInfo.data_length!==Y.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new Z$0(X$0.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};Ty.createWorkerFrom=function($,Y,U){return $.pipe(new Xl0).pipe(new Py("uncompressedSize")).pipe(Y.compressWorker(U)).pipe(new Py("compressedSize")).withStreamInfo("compression",Y)};q$0.exports=Ty});var w$0=E((qm1,F$0)=>{var Zl0=wy(),ql0=Oy(),jy=XQ(),Ey=LO(),V$0=G$(),Cy=function($,Y,U){this.name=$,this.dir=U.dir,this.date=U.date,this.comment=U.comment,this.unixPermissions=U.unixPermissions,this.dosPermissions=U.dosPermissions,this._data=Y,this._dataBinary=U.binary,this.options={compression:U.compression,compressionOptions:U.compressionOptions}};Cy.prototype={internalStream:function($){var Y=null,U="string";try{if(!$)throw Error("No output type specified.");U=$.toLowerCase();var z=U==="string"||U==="text";if(U==="binarystring"||U==="text")U="string";Y=this._decompressWorker();var I=!this._dataBinary;if(I&&!z)Y=Y.pipe(new jy.Utf8EncodeWorker);if(!I&&z)Y=Y.pipe(new jy.Utf8DecodeWorker)}catch(Q){Y=new V$0("error"),Y.error(Q)}return new Zl0(Y,U,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof Ey&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var U=this._decompressWorker();if(!this._dataBinary)U=U.pipe(new jy.Utf8EncodeWorker);return Ey.createWorkerFrom(U,$,Y)}},_decompressWorker:function(){if(this._data instanceof Ey)return this._data.getContentWorker();else if(this._data instanceof V$0)return this._data;else return new ql0(this._data)}};var L$0=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Vl0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(QW=0;QW{var Ml0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Ol0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}Ry.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var U=Y.shift();if(!U)continue;if(typeof U!=="object")throw TypeError(U+"must be non-object");for(var z in U)if(Ol0(U,z))$[z]=U[z]}return $};Ry.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var Nl0={arraySet:function($,Y,U,z,I){if(Y.subarray&&$.subarray){$.set(Y.subarray(U,U+z),I);return}for(var Q=0;Q{var Bl0=W3(),Pl0=4,O$0=0,N$0=1,Tl0=2;function VQ($){var Y=$.length;while(--Y>=0)$[Y]=0}var jl0=0,j$0=1,El0=2,Cl0=3,Rl0=258,xy=29,XW=256,KW=XW+1+xy,qQ=30,fy=19,E$0=2*KW+1,eY=15,vy=16,_l0=7,uy=256,C$0=16,R$0=17,_$0=18,yy=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],FO=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],vl0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v$0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],hl0=512,X3=Array((KW+2)*2);VQ(X3);var JW=Array(qQ*2);VQ(JW);var GW=Array(hl0);VQ(GW);var HW=Array(Rl0-Cl0+1);VQ(HW);var by=Array(xy);VQ(by);var wO=Array(qQ);VQ(wO);function hy($,Y,U,z,I){this.static_tree=$,this.extra_bits=Y,this.extra_base=U,this.elems=z,this.max_length=I,this.has_stree=$&&$.length}var h$0,S$0,g$0;function Sy($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function y$0($){return $<256?GW[$]:GW[256+($>>>7)]}function WW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function d8($,Y,U){if($.bi_valid>vy-U)$.bi_buf|=Y<<$.bi_valid&65535,WW($,$.bi_buf),$.bi_buf=Y>>vy-$.bi_valid,$.bi_valid+=U-vy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=U}function I9($,Y,U){d8($,U[Y*2],U[Y*2+1])}function k$0($,Y){var U=0;do U|=$&1,$>>>=1,U<<=1;while(--Y>0);return U>>>1}function Sl0($){if($.bi_valid===16)WW($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function gl0($,Y){var{dyn_tree:U,max_code:z}=Y,I=Y.stat_desc.static_tree,Q=Y.stat_desc.has_stree,J=Y.stat_desc.extra_bits,K=Y.stat_desc.extra_base,G=Y.stat_desc.max_length,H,W,X,Z,q,V,w=0;for(Z=0;Z<=eY;Z++)$.bl_count[Z]=0;U[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,w++;if(U[W*2+1]=Z,W>z)continue;if($.bl_count[Z]++,q=0,W>=K)q=J[W-K];if(V=U[W*2],$.opt_len+=V*(Z+q),Q)$.static_len+=V*(I[W*2+1]+q)}if(w===0)return;do{Z=G-1;while($.bl_count[Z]===0)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[G]--,w-=2}while(w>0);for(Z=G;Z!==0;Z--){W=$.bl_count[Z];while(W!==0){if(X=$.heap[--H],X>z)continue;if(U[X*2+1]!==Z)$.opt_len+=(Z-U[X*2+1])*U[X*2],U[X*2+1]=Z;W--}}}function x$0($,Y,U){var z=Array(eY+1),I=0,Q,J;for(Q=1;Q<=eY;Q++)z[Q]=I=I+U[Q-1]<<1;for(J=0;J<=Y;J++){var K=$[J*2+1];if(K===0)continue;$[J*2]=k$0(z[K]++,K)}}function yl0(){var $,Y,U,z,I,Q=Array(eY+1);U=0;for(z=0;z>=7;for(;z8)WW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function kl0($,Y,U,z){if(u$0($),z)WW($,U),WW($,~U);Bl0.arraySet($.pending_buf,$.window,Y,U,$.pending),$.pending+=U}function D$0($,Y,U,z){var I=Y*2,Q=U*2;return $[I]<$[Q]||$[I]===$[Q]&&z[Y]<=z[U]}function gy($,Y,U){var z=$.heap[U],I=U<<1;while(I<=$.heap_len){if(I<$.heap_len&&D$0(Y,$.heap[I+1],$.heap[I],$.depth))I++;if(D$0(Y,z,$.heap[I],$.depth))break;$.heap[U]=$.heap[I],U=I,I<<=1}$.heap[U]=z}function A$0($,Y,U){var z,I,Q=0,J,K;if($.last_lit!==0)do if(z=$.pending_buf[$.d_buf+Q*2]<<8|$.pending_buf[$.d_buf+Q*2+1],I=$.pending_buf[$.l_buf+Q],Q++,z===0)I9($,I,Y);else{if(J=HW[I],I9($,J+XW+1,Y),K=yy[J],K!==0)I-=by[J],d8($,I,K);if(z--,J=y$0(z),I9($,J,U),K=FO[J],K!==0)z-=wO[J],d8($,z,K)}while(Q<$.last_lit);I9($,uy,Y)}function ky($,Y){var U=Y.dyn_tree,z=Y.stat_desc.static_tree,I=Y.stat_desc.has_stree,Q=Y.stat_desc.elems,J,K,G=-1,H;$.heap_len=0,$.heap_max=E$0;for(J=0;J>1;J>=1;J--)gy($,U,J);H=Q;do J=$.heap[1],$.heap[1]=$.heap[$.heap_len--],gy($,U,1),K=$.heap[1],$.heap[--$.heap_max]=J,$.heap[--$.heap_max]=K,U[H*2]=U[J*2]+U[K*2],$.depth[H]=($.depth[J]>=$.depth[K]?$.depth[J]:$.depth[K])+1,U[J*2+1]=U[K*2+1]=H,$.heap[1]=H++,gy($,U,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],gl0($,Y),x$0(U,G,$.bl_count)}function B$0($,Y,U){var z,I=-1,Q,J=Y[1],K=0,G=7,H=4;if(J===0)G=138,H=3;Y[(U+1)*2+1]=65535;for(z=0;z<=U;z++){if(Q=J,J=Y[(z+1)*2+1],++K=3;Y--)if($.bl_tree[v$0[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function fl0($,Y,U,z){var I;d8($,Y-257,5),d8($,U-1,5),d8($,z-4,4);for(I=0;I>>=1)if(Y&1&&$.dyn_ltree[U*2]!==0)return O$0;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return N$0;for(U=32;U0){if($.strm.data_type===Tl0)$.strm.data_type=ul0($);if(ky($,$.l_desc),ky($,$.d_desc),J=xl0($),I=$.opt_len+3+7>>>3,Q=$.static_len+3+7>>>3,Q<=I)I=Q}else I=Q=U+5;if(U+4<=I&&Y!==-1)b$0($,Y,U,z);else if($.strategy===Pl0||Q===I)d8($,(j$0<<1)+(z?1:0),3),A$0($,X3,JW);else d8($,(El0<<1)+(z?1:0),3),fl0($,$.l_desc.max_code+1,$.d_desc.max_code+1,J+1),A$0($,$.dyn_ltree,$.dyn_dtree);if(f$0($),z)u$0($)}function nl0($,Y,U){if($.pending_buf[$.d_buf+$.last_lit*2]=Y>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=Y&255,$.pending_buf[$.l_buf+$.last_lit]=U&255,$.last_lit++,Y===0)$.dyn_ltree[U*2]++;else $.matches++,Y--,$.dyn_ltree[(HW[U]+XW+1)*2]++,$.dyn_dtree[y$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}pl0._tr_init=bl0;pl0._tr_stored_block=b$0;pl0._tr_flush_block=cl0;pl0._tr_tally=nl0;pl0._tr_align=il0});var iy=E((Fm1,c$0)=>{function sl0($,Y,U,z){var I=$&65535|0,Q=$>>>16&65535|0,J=0;while(U!==0){J=U>2000?2000:U,U-=J;do I=I+Y[z++]|0,Q=Q+I|0;while(--J);I%=65521,Q%=65521}return I|Q<<16|0}c$0.exports=sl0});var cy=E((wm1,n$0)=>{function al0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var tl0=al0();function el0($,Y,U,z){var I=tl0,Q=z+U;$^=-1;for(var J=z;J>>8^I[($^Y[J])&255];return $^-1}n$0.exports=el0});var MO=E((Mm1,p$0)=>{p$0.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var e$0=E((ho0)=>{var _8=W3(),R$=i$0(),o$0=iy(),n7=cy(),$o0=MO(),zU=0,Yo0=1,Uo0=3,o7=4,d$0=5,J9=0,m$0=1,_$=-2,zo0=-3,ny=-5,Io0=-1,Qo0=1,OO=2,Jo0=3,Ko0=4,Go0=0,Ho0=2,BO=8,Wo0=9,Xo0=15,Zo0=8,qo0=29,Vo0=256,dy=Vo0+1+qo0,Lo0=30,Fo0=19,wo0=2*dy+1,Mo0=15,f1=3,m7=258,V5=m7+f1+1,Oo0=32,PO=42,my=69,NO=73,DO=91,AO=103,$U=113,qW=666,P6=1,VW=2,YU=3,wQ=4,No0=3;function l7($,Y){return $.msg=$o0[Y],Y}function l$0($){return($<<1)-($>4?9:0)}function d7($){var Y=$.length;while(--Y>=0)$[Y]=0}function p7($){var Y=$.state,U=Y.pending;if(U>$.avail_out)U=$.avail_out;if(U===0)return;if(_8.arraySet($.output,Y.pending_buf,Y.pending_out,U,$.next_out),$.next_out+=U,Y.pending_out+=U,$.total_out+=U,$.avail_out-=U,Y.pending-=U,Y.pending===0)Y.pending_out=0}function o6($,Y){R$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,p7($.strm)}function s1($,Y){$.pending_buf[$.pending++]=Y}function ZW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function Do0($,Y,U,z){var I=$.avail_in;if(I>z)I=z;if(I===0)return 0;if($.avail_in-=I,_8.arraySet(Y,$.input,$.next_in,I,U),$.state.wrap===1)$.adler=o$0($.adler,Y,I,U);else if($.state.wrap===2)$.adler=n7($.adler,Y,I,U);return $.next_in+=I,$.total_in+=I,I}function r$0($,Y){var{max_chain_length:U,strstart:z}=$,I,Q,J=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-V5?$.strstart-($.w_size-V5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+m7,q=H[z+J-1],V=H[z+J];if($.prev_length>=$.good_match)U>>=2;if(K>$.lookahead)K=$.lookahead;do{if(I=Y,H[I+J]!==V||H[I+J-1]!==q||H[I]!==H[z]||H[++I]!==H[z+1])continue;z+=2,I++;do;while(H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&H[++z]===H[++I]&&zJ){if($.match_start=Y,J=Q,Q>=K)break;q=H[z+J-1],V=H[z+J]}}while((Y=X[Y&W])>G&&--U!==0);if(J<=$.lookahead)return J;return $.lookahead}function UU($){var Y=$.w_size,U,z,I,Q,J;do{if(Q=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-V5)){_8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,z=$.hash_size,U=z;do I=$.head[--U],$.head[U]=I>=Y?I-Y:0;while(--z);z=Y,U=z;do I=$.prev[--U],$.prev[U]=I>=Y?I-Y:0;while(--z);Q+=Y}if($.strm.avail_in===0)break;if(z=Do0($.strm,$.window,$.strstart+$.lookahead,Q),$.lookahead+=z,$.lookahead+$.insert>=f1){J=$.strstart-$.insert,$.ins_h=$.window[J],$.ins_h=($.ins_h<<$.hash_shift^$.window[J+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[J+f1-1])&$.hash_mask,$.prev[J&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=J,J++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)U=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(UU($),$.lookahead===0&&Y===zU)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var z=$.block_start+U;if($.strstart===0||$.strstart>=z){if($.lookahead=$.strstart-z,$.strstart=z,o6($,!1),$.strm.avail_out===0)return P6}if($.strstart-$.block_start>=$.w_size-V5){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===o7){if(o6($,!0),$.strm.avail_out===0)return YU;return wQ}if($.strstart>$.block_start){if(o6($,!1),$.strm.avail_out===0)return P6}return P6}function py($,Y){var U,z;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(U!==0&&$.strstart-U<=$.w_size-V5)$.match_length=r$0($,U);if($.match_length>=f1)if(z=R$._tr_tally($,$.strstart-$.match_start,$.match_length-f1),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=f1){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else z=R$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,U!==0&&$.prev_length<$.max_lazy_match&&$.strstart-U<=$.w_size-V5){if($.match_length=r$0($,U),$.match_length<=5&&($.strategy===Qo0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){I=$.strstart+$.lookahead-f1,z=R$._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f1),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=I)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,z){if(o6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(z=R$._tr_tally($,0,$.window[$.strstart-1]),z)o6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)z=R$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(I=$.strstart-1,z=J[I],z===J[++I]&&z===J[++I]&&z===J[++I]){Q=$.strstart+m7;do;while(z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&z===J[++I]&&I$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)U=R$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else U=R$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===o7){if(o6($,!0),$.strm.avail_out===0)return YU;return wQ}if($.last_lit){if(o6($,!1),$.strm.avail_out===0)return P6}return VW}function Po0($,Y){var U;for(;;){if($.lookahead===0){if(UU($),$.lookahead===0){if(Y===zU)return P6;break}}if($.match_length=0,U=R$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,U){if(o6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===o7){if(o6($,!0),$.strm.avail_out===0)return YU;return wQ}if($.last_lit){if(o6($,!1),$.strm.avail_out===0)return P6}return VW}function Q9($,Y,U,z,I){this.good_length=$,this.max_lazy=Y,this.nice_length=U,this.max_chain=z,this.func=I}var FQ;FQ=[new Q9(0,0,0,0,Ao0),new Q9(4,4,8,4,py),new Q9(4,5,16,8,py),new Q9(4,6,32,32,py),new Q9(4,4,16,16,LQ),new Q9(8,16,32,32,LQ),new Q9(8,16,128,128,LQ),new Q9(8,32,128,256,LQ),new Q9(32,128,258,1024,LQ),new Q9(32,258,258,4096,LQ)];function To0($){$.window_size=2*$.w_size,d7($.head),$.max_lazy_match=FQ[$.level].max_lazy,$.good_match=FQ[$.level].good_length,$.nice_match=FQ[$.level].nice_length,$.max_chain_length=FQ[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=f1-1,$.match_available=0,$.ins_h=0}function jo0(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=BO,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new _8.Buf16(wo0*2),this.dyn_dtree=new _8.Buf16((2*Lo0+1)*2),this.bl_tree=new _8.Buf16((2*Fo0+1)*2),d7(this.dyn_ltree),d7(this.dyn_dtree),d7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new _8.Buf16(Mo0+1),this.heap=new _8.Buf16(2*dy+1),d7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new _8.Buf16(2*dy+1),d7(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function s$0($){var Y;if(!$||!$.state)return l7($,_$);if($.total_in=$.total_out=0,$.data_type=Ho0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?PO:$U,$.adler=Y.wrap===2?0:1,Y.last_flush=zU,R$._tr_init(Y),J9}function a$0($){var Y=s$0($);if(Y===J9)To0($.state);return Y}function Eo0($,Y){if(!$||!$.state)return _$;if($.state.wrap!==2)return _$;return $.state.gzhead=Y,J9}function t$0($,Y,U,z,I,Q){if(!$)return _$;var J=1;if(Y===Io0)Y=6;if(z<0)J=0,z=-z;else if(z>15)J=2,z-=16;if(I<1||I>Wo0||U!==BO||z<8||z>15||Y<0||Y>9||Q<0||Q>Ko0)return l7($,_$);if(z===8)z=9;var K=new jo0;return $.state=K,K.strm=$,K.wrap=J,K.gzhead=null,K.w_bits=z,K.w_size=1<d$0||Y<0)return $?l7($,_$):_$;if(z=$.state,!$.output||!$.input&&$.avail_in!==0||z.status===qW&&Y!==o7)return l7($,$.avail_out===0?ny:_$);if(z.strm=$,U=z.last_flush,z.last_flush=Y,z.status===PO)if(z.wrap===2)if($.adler=0,s1(z,31),s1(z,139),s1(z,8),!z.gzhead)s1(z,0),s1(z,0),s1(z,0),s1(z,0),s1(z,0),s1(z,z.level===9?2:z.strategy>=OO||z.level<2?4:0),s1(z,No0),z.status=$U;else{if(s1(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(!z.gzhead.extra?0:4)+(!z.gzhead.name?0:8)+(!z.gzhead.comment?0:16)),s1(z,z.gzhead.time&255),s1(z,z.gzhead.time>>8&255),s1(z,z.gzhead.time>>16&255),s1(z,z.gzhead.time>>24&255),s1(z,z.level===9?2:z.strategy>=OO||z.level<2?4:0),s1(z,z.gzhead.os&255),z.gzhead.extra&&z.gzhead.extra.length)s1(z,z.gzhead.extra.length&255),s1(z,z.gzhead.extra.length>>8&255);if(z.gzhead.hcrc)$.adler=n7($.adler,z.pending_buf,z.pending,0);z.gzindex=0,z.status=my}else{var J=BO+(z.w_bits-8<<4)<<8,K=-1;if(z.strategy>=OO||z.level<2)K=0;else if(z.level<6)K=1;else if(z.level===6)K=2;else K=3;if(J|=K<<6,z.strstart!==0)J|=Oo0;if(J+=31-J%31,z.status=$U,ZW(z,J),z.strstart!==0)ZW(z,$.adler>>>16),ZW(z,$.adler&65535);$.adler=1}if(z.status===my)if(z.gzhead.extra){I=z.pending;while(z.gzindex<(z.gzhead.extra.length&65535)){if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(p7($),I=z.pending,z.pending===z.pending_buf_size)break}s1(z,z.gzhead.extra[z.gzindex]&255),z.gzindex++}if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(z.gzindex===z.gzhead.extra.length)z.gzindex=0,z.status=NO}else z.status=NO;if(z.status===NO)if(z.gzhead.name){I=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(p7($),I=z.pending,z.pending===z.pending_buf_size){Q=1;break}}if(z.gzindexI)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(Q===0)z.gzindex=0,z.status=DO}else z.status=DO;if(z.status===DO)if(z.gzhead.comment){I=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>I)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(p7($),I=z.pending,z.pending===z.pending_buf_size){Q=1;break}}if(z.gzindexI)$.adler=n7($.adler,z.pending_buf,z.pending-I,I);if(Q===0)z.status=AO}else z.status=AO;if(z.status===AO)if(z.gzhead.hcrc){if(z.pending+2>z.pending_buf_size)p7($);if(z.pending+2<=z.pending_buf_size)s1(z,$.adler&255),s1(z,$.adler>>8&255),$.adler=0,z.status=$U}else z.status=$U;if(z.pending!==0){if(p7($),$.avail_out===0)return z.last_flush=-1,J9}else if($.avail_in===0&&l$0(Y)<=l$0(U)&&Y!==o7)return l7($,ny);if(z.status===qW&&$.avail_in!==0)return l7($,ny);if($.avail_in!==0||z.lookahead!==0||Y!==zU&&z.status!==qW){var G=z.strategy===OO?Po0(z,Y):z.strategy===Jo0?Bo0(z,Y):FQ[z.level].func(z,Y);if(G===YU||G===wQ)z.status=qW;if(G===P6||G===YU){if($.avail_out===0)z.last_flush=-1;return J9}if(G===VW){if(Y===Yo0)R$._tr_align(z);else if(Y!==d$0){if(R$._tr_stored_block(z,0,0,!1),Y===Uo0){if(d7(z.head),z.lookahead===0)z.strstart=0,z.block_start=0,z.insert=0}}if(p7($),$.avail_out===0)return z.last_flush=-1,J9}}if(Y!==o7)return J9;if(z.wrap<=0)return m$0;if(z.wrap===2)s1(z,$.adler&255),s1(z,$.adler>>8&255),s1(z,$.adler>>16&255),s1(z,$.adler>>24&255),s1(z,$.total_in&255),s1(z,$.total_in>>8&255),s1(z,$.total_in>>16&255),s1(z,$.total_in>>24&255);else ZW(z,$.adler>>>16),ZW(z,$.adler&65535);if(p7($),z.wrap>0)z.wrap=-z.wrap;return z.pending!==0?J9:m$0}function _o0($){var Y;if(!$||!$.state)return _$;if(Y=$.state.status,Y!==PO&&Y!==my&&Y!==NO&&Y!==DO&&Y!==AO&&Y!==$U&&Y!==qW)return l7($,_$);return $.state=null,Y===$U?l7($,zo0):J9}function vo0($,Y){var U=Y.length,z,I,Q,J,K,G,H,W;if(!$||!$.state)return _$;if(z=$.state,J=z.wrap,J===2||J===1&&z.status!==PO||z.lookahead)return _$;if(J===1)$.adler=o$0($.adler,Y,U,0);if(z.wrap=0,U>=z.w_size){if(J===0)d7(z.head),z.strstart=0,z.block_start=0,z.insert=0;W=new _8.Buf8(z.w_size),_8.arraySet(W,Y,U-z.w_size,z.w_size,0),Y=W,U=z.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=U,$.next_in=0,$.input=Y,UU(z);while(z.lookahead>=f1){I=z.strstart,Q=z.lookahead-(f1-1);do z.ins_h=(z.ins_h<{var TO=W3(),$50=!0,Y50=!0;try{String.fromCharCode.apply(null,[0])}catch($){$50=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){Y50=!1}var LW=new TO.Buf8(256);for(K9=0;K9<256;K9++)LW[K9]=K9>=252?6:K9>=248?5:K9>=240?4:K9>=224?3:K9>=192?2:1;var K9;LW[254]=LW[254]=1;co0.string2buf=function($){var Y,U,z,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|U&63;else if(U<65536)Y[Q++]=224|U>>>12,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63;else Y[Q++]=240|U>>>18,Y[Q++]=128|U>>>12&63,Y[Q++]=128|U>>>6&63,Y[Q++]=128|U&63}return Y};function U50($,Y){if(Y<65534){if($.subarray&&Y50||!$.subarray&&$50)return String.fromCharCode.apply(null,TO.shrinkBuf($,Y))}var U="";for(var z=0;z4){K[z++]=65533,U+=Q-1;continue}I&=Q===2?31:Q===3?15:7;while(Q>1&&U1){K[z++]=65533;continue}if(I<65536)K[z++]=I;else I-=65536,K[z++]=55296|I>>10&1023,K[z++]=56320|I&1023}return U50(K,z)};co0.utf8border=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+LW[$[U]]>Y?U:Y}});var oy=E((Dm1,z50)=>{function oo0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}z50.exports=oo0});var K50=E((Ur0)=>{var FW=e$0(),wW=W3(),sy=ly(),ay=MO(),ro0=oy(),J50=Object.prototype.toString,so0=0,ry=4,MQ=0,I50=1,Q50=2,ao0=-1,to0=0,eo0=8;function IU($){if(!(this instanceof IU))return new IU($);this.options=wW.assign({level:ao0,method:eo0,chunkSize:16384,windowBits:15,memLevel:8,strategy:to0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>0)Y.windowBits=-Y.windowBits;else if(Y.gzip&&Y.windowBits>0&&Y.windowBits<16)Y.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ro0,this.strm.avail_out=0;var U=FW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(U!==MQ)throw Error(ay[U]);if(Y.header)FW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var z;if(typeof Y.dictionary==="string")z=sy.string2buf(Y.dictionary);else if(J50.call(Y.dictionary)==="[object ArrayBuffer]")z=new Uint8Array(Y.dictionary);else z=Y.dictionary;if(U=FW.deflateSetDictionary(this.strm,z),U!==MQ)throw Error(ay[U]);this._dict_set=!0}}IU.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,I,Q;if(this.ended)return!1;if(Q=Y===~~Y?Y:Y===!0?ry:so0,typeof $==="string")U.input=sy.string2buf($);else if(J50.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new wW.Buf8(z),U.next_out=0,U.avail_out=z;if(I=FW.deflate(U,Q),I!==I50&&I!==MQ)return this.onEnd(I),this.ended=!0,!1;if(U.avail_out===0||U.avail_in===0&&(Q===ry||Q===Q50))if(this.options.to==="string")this.onData(sy.buf2binstring(wW.shrinkBuf(U.output,U.next_out)));else this.onData(wW.shrinkBuf(U.output,U.next_out))}while((U.avail_in>0||U.avail_out===0)&&I!==I50);if(Q===ry)return I=FW.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===MQ;if(Q===Q50)return this.onEnd(MQ),U.avail_out=0,!0;return!0};IU.prototype.onData=function($){this.chunks.push($)};IU.prototype.onEnd=function($){if($===MQ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=wW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function ty($,Y){var U=new IU(Y);if(U.push($,!0),U.err)throw U.msg||ay[U.err];return U.result}function $r0($,Y){return Y=Y||{},Y.raw=!0,ty($,Y)}function Yr0($,Y){return Y=Y||{},Y.gzip=!0,ty($,Y)}Ur0.Deflate=IU;Ur0.deflate=ty;Ur0.deflateRaw=$r0;Ur0.gzip=Yr0});var H50=E((Bm1,G50)=>{var jO=30,Kr0=12;G50.exports=function(Y,U){var z,I,Q,J,K,G,H,W,X,Z,q,V,w,M,F,N,O,D,P,T,A,j,C,b,x;z=Y.state,I=Y.next_in,b=Y.input,Q=I+(Y.avail_in-5),J=Y.next_out,x=Y.output,K=J-(U-Y.avail_out),G=J+(Y.avail_out-257),H=z.dmax,W=z.wsize,X=z.whave,Z=z.wnext,q=z.window,V=z.hold,w=z.bits,M=z.lencode,F=z.distcode,N=(1<>>24,V>>>=P,w-=P,P=D>>>16&255,P===0)x[J++]=D&65535;else if(P&16){if(T=D&65535,P&=15,P){if(w>>=P,w-=P}if(w<15)V+=b[I++]<>>24,V>>>=P,w-=P,P=D>>>16&255,P&16){if(A=D&65535,P&=15,wH){Y.msg="invalid distance too far back",z.mode=jO;break $}if(V>>>=P,w-=P,P=J-K,A>P){if(P=A-P,P>X){if(z.sane){Y.msg="invalid distance too far back",z.mode=jO;break $}}if(j=0,C=q,Z===0){if(j+=W-P,P2)x[J++]=C[j++],x[J++]=C[j++],x[J++]=C[j++],T-=3;if(T){if(x[J++]=C[j++],T>1)x[J++]=C[j++]}}else{j=J-A;do x[J++]=x[j++],x[J++]=x[j++],x[J++]=x[j++],T-=3;while(T>2);if(T){if(x[J++]=x[j++],T>1)x[J++]=x[j++]}}}else if((P&64)===0){D=F[(D&65535)+(V&(1<>3,I-=T,w-=T<<3,V&=(1<{var W50=W3(),OQ=15,X50=852,Z50=592,q50=0,ey=1,V50=2,Gr0=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Hr0=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Wr0=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Xr0=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];L50.exports=function(Y,U,z,I,Q,J,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,w=0,M=0,F=0,N=0,O=0,D,P,T,A,j,C=null,b=0,x,g=new W50.Buf16(OQ+1),i=new W50.Buf16(OQ+1),c=null,z0=0,k,d,a;for(W=0;W<=OQ;W++)g[W]=0;for(X=0;X=1;q--)if(g[q]!==0)break;if(V>q)V=q;if(q===0)return Q[J++]=20971520,Q[J++]=20971520,G.bits=1,0;for(Z=1;Z0&&(Y===q50||q!==1))return-1;i[1]=0;for(W=1;WX50||Y===V50&&N>Z50)return 1;for(;;){if(k=W-M,K[X]x)d=c[z0+K[X]],a=C[b+K[X]];else d=96,a=0;D=1<>M)+P]=k<<24|d<<16|a|0;while(P!==0);D=1<>=1;if(D!==0)O&=D-1,O+=D;else O=0;if(X++,--g[W]===0){if(W===q)break;W=U[z+K[X]]}if(W>V&&(O&A)!==T){if(M===0)M=V;j+=Z,w=W-M,F=1<X50||Y===V50&&N>Z50)return 1;T=O&A,Q[T]=V<<24|w<<16|j-J|0}}if(O!==0)Q[j+O]=W-M<<24|4194304|0;return G.bits=V,0}});var a50=E((_r0)=>{var H$=W3(),Qk=iy(),G9=cy(),Zr0=H50(),MW=F50(),qr0=0,c50=1,n50=2,w50=4,Vr0=5,EO=6,QU=0,Lr0=1,Fr0=2,v$=-2,p50=-3,Jk=-4,wr0=-5,M50=8,d50=1,O50=2,N50=3,D50=4,A50=5,B50=6,P50=7,T50=8,j50=9,E50=10,_O=11,Z3=12,$k=13,C50=14,Yk=15,R50=16,_50=17,v50=18,h50=19,CO=20,RO=21,S50=22,g50=23,y50=24,k50=25,x50=26,Uk=27,f50=28,u50=29,k4=30,Kk=31,Mr0=32,Or0=852,Nr0=592,Dr0=15,Ar0=Dr0;function b50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function Br0(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new H$.Buf16(320),this.work=new H$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m50($){var Y;if(!$||!$.state)return v$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=d50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new H$.Buf32(Or0),Y.distcode=Y.distdyn=new H$.Buf32(Nr0),Y.sane=1,Y.back=-1,QU}function l50($){var Y;if(!$||!$.state)return v$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,m50($)}function o50($,Y){var U,z;if(!$||!$.state)return v$;if(z=$.state,Y<0)U=0,Y=-Y;else if(U=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return v$;if(z.window!==null&&z.wbits!==Y)z.window=null;return z.wrap=U,z.wbits=Y,l50($)}function r50($,Y){var U,z;if(!$)return v$;if(z=new Br0,$.state=z,z.window=null,U=o50($,Y),U!==QU)$.state=null;return U}function Pr0($){return r50($,Ar0)}var i50=!0,zk,Ik;function Tr0($){if(i50){var Y;zk=new H$.Buf32(512),Ik=new H$.Buf32(32),Y=0;while(Y<144)$.lens[Y++]=8;while(Y<256)$.lens[Y++]=9;while(Y<280)$.lens[Y++]=7;while(Y<288)$.lens[Y++]=8;MW(c50,$.lens,0,288,zk,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;MW(n50,$.lens,0,32,Ik,0,$.work,{bits:5}),i50=!1}$.lencode=zk,$.lenbits=9,$.distcode=Ik,$.distbits=5}function s50($,Y,U,z){var I,Q=$.state;if(Q.window===null)Q.wsize=1<=Q.wsize)H$.arraySet(Q.window,Y,U-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize;else{if(I=Q.wsize-Q.wnext,I>z)I=z;if(H$.arraySet(Q.window,Y,U-z,I,Q.wnext),z-=I,z)H$.arraySet(Q.window,Y,U-z,z,0),Q.wnext=z,Q.whave=Q.wsize;else{if(Q.wnext+=I,Q.wnext===Q.wsize)Q.wnext=0;if(Q.whave>>8&255,U.check=G9(U.check,C,2,0),H=0,W=0,U.mode=O50;break}if(U.flags=0,U.head)U.head.done=!1;if(!(U.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",U.mode=k4;break}if((H&15)!==M50){$.msg="unknown compression method",U.mode=k4;break}if(H>>>=4,W-=4,A=(H&15)+8,U.wbits===0)U.wbits=A;else if(A>U.wbits){$.msg="invalid window size",U.mode=k4;break}U.dmax=1<>8&1;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=G9(U.check,C,2,0);H=0,W=0,U.mode=N50;case N50:while(W<32){if(K===0)break $;K--,H+=z[Q++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,U.check=G9(U.check,C,4,0);H=0,W=0,U.mode=D50;case D50:while(W<16){if(K===0)break $;K--,H+=z[Q++]<>8;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=G9(U.check,C,2,0);H=0,W=0,U.mode=A50;case A50:if(U.flags&1024){while(W<16){if(K===0)break $;K--,H+=z[Q++]<>>8&255,U.check=G9(U.check,C,2,0);H=0,W=0}else if(U.head)U.head.extra=null;U.mode=B50;case B50:if(U.flags&1024){if(q=U.length,q>K)q=K;if(q){if(U.head){if(A=U.head.extra_len-U.length,!U.head.extra)U.head.extra=Array(U.head.extra_len);H$.arraySet(U.head.extra,z,Q,q,A)}if(U.flags&512)U.check=G9(U.check,z,q,Q);K-=q,Q+=q,U.length-=q}if(U.length)break $}U.length=0,U.mode=P50;case P50:if(U.flags&2048){if(K===0)break $;q=0;do if(A=z[Q+q++],U.head&&A&&U.length<65536)U.head.name+=String.fromCharCode(A);while(A&&q>9&1,U.head.done=!0;$.adler=U.check=0,U.mode=Z3;break;case E50:while(W<32){if(K===0)break $;K--,H+=z[Q++]<>>=W&7,W-=W&7,U.mode=Uk;break}while(W<3){if(K===0)break $;K--,H+=z[Q++]<>>=1,W-=1,H&3){case 0:U.mode=C50;break;case 1:if(Tr0(U),U.mode=CO,Y===EO){H>>>=2,W-=2;break $}break;case 2:U.mode=_50;break;case 3:$.msg="invalid block type",U.mode=k4}H>>>=2,W-=2;break;case C50:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=z[Q++]<>>16^65535)){$.msg="invalid stored block lengths",U.mode=k4;break}if(U.length=H&65535,H=0,W=0,U.mode=Yk,Y===EO)break $;case Yk:U.mode=R50;case R50:if(q=U.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;H$.arraySet(I,z,Q,q,J),K-=q,Q+=q,G-=q,J+=q,U.length-=q;break}U.mode=Z3;break;case _50:while(W<14){if(K===0)break $;K--,H+=z[Q++]<>>=5,W-=5,U.ndist=(H&31)+1,H>>>=5,W-=5,U.ncode=(H&15)+4,H>>>=4,W-=4,U.nlen>286||U.ndist>30){$.msg="too many length or distance symbols",U.mode=k4;break}U.have=0,U.mode=v50;case v50:while(U.have>>=3,W-=3}while(U.have<19)U.lens[g[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,b={bits:U.lenbits},j=MW(qr0,U.lens,0,19,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid code lengths set",U.mode=k4;break}U.have=0,U.mode=h50;case h50:while(U.have>>24,N=M>>>16&255,O=M&65535,F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>>=F,W-=F,U.lens[U.have++]=O;else{if(O===16){x=F+2;while(W>>=F,W-=F,U.have===0){$.msg="invalid bit length repeat",U.mode=k4;break}A=U.lens[U.have-1],q=3+(H&3),H>>>=2,W-=2}else if(O===17){x=F+3;while(W>>=F,W-=F,A=0,q=3+(H&7),H>>>=3,W-=3}else{x=F+7;while(W>>=F,W-=F,A=0,q=11+(H&127),H>>>=7,W-=7}if(U.have+q>U.nlen+U.ndist){$.msg="invalid bit length repeat",U.mode=k4;break}while(q--)U.lens[U.have++]=A}}if(U.mode===k4)break;if(U.lens[256]===0){$.msg="invalid code -- missing end-of-block",U.mode=k4;break}if(U.lenbits=9,b={bits:U.lenbits},j=MW(c50,U.lens,0,U.nlen,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid literal/lengths set",U.mode=k4;break}if(U.distbits=6,U.distcode=U.distdyn,b={bits:U.distbits},j=MW(n50,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,b),U.distbits=b.bits,j){$.msg="invalid distances set",U.mode=k4;break}if(U.mode=CO,Y===EO)break $;case CO:U.mode=RO;case RO:if(K>=6&&G>=258){if($.next_out=J,$.avail_out=G,$.next_in=Q,$.avail_in=K,U.hold=H,U.bits=W,Zr0($,Z),J=$.next_out,I=$.output,G=$.avail_out,Q=$.next_in,z=$.input,K=$.avail_in,H=U.hold,W=U.bits,U.mode===Z3)U.back=-1;break}U.back=0;for(;;){if(M=U.lencode[H&(1<>>24,N=M>>>16&255,O=M&65535,F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>D)],F=M>>>24,N=M>>>16&255,O=M&65535,D+F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>>=D,W-=D,U.back+=D}if(H>>>=F,W-=F,U.back+=F,U.length=O,N===0){U.mode=x50;break}if(N&32){U.back=-1,U.mode=Z3;break}if(N&64){$.msg="invalid literal/length code",U.mode=k4;break}U.extra=N&15,U.mode=S50;case S50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=g50;case g50:for(;;){if(M=U.distcode[H&(1<>>24,N=M>>>16&255,O=M&65535,F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>D)],F=M>>>24,N=M>>>16&255,O=M&65535,D+F<=W)break;if(K===0)break $;K--,H+=z[Q++]<>>=D,W-=D,U.back+=D}if(H>>>=F,W-=F,U.back+=F,N&64){$.msg="invalid distance code",U.mode=k4;break}U.offset=O,U.extra=N&15,U.mode=y50;case y50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){$.msg="invalid distance too far back",U.mode=k4;break}U.mode=k50;case k50:if(G===0)break $;if(q=Z-G,U.offset>q){if(q=U.offset-q,q>U.whave){if(U.sane){$.msg="invalid distance too far back",U.mode=k4;break}}if(q>U.wnext)q-=U.wnext,V=U.wsize-q;else V=U.wnext-q;if(q>U.length)q=U.length;w=U.window}else w=I,V=J-U.offset,q=U.length;if(q>G)q=G;G-=q,U.length-=q;do I[J++]=w[V++];while(--q);if(U.length===0)U.mode=RO;break;case x50:if(G===0)break $;I[J++]=U.length,G--,U.mode=RO;break;case Uk:if(U.wrap){while(W<32){if(K===0)break $;K--,H|=z[Q++]<{t50.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var $90=E((Em1,e50)=>{function ir0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e50.exports=ir0});var U90=E((dr0)=>{var NQ=a50(),OW=W3(),vO=ly(),K6=Gk(),Hk=MO(),cr0=oy(),nr0=$90(),Y90=Object.prototype.toString;function JU($){if(!(this instanceof JU))return new JU($);this.options=OW.assign({chunkSize:16384,windowBits:0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>=0&&Y.windowBits<16){if(Y.windowBits=-Y.windowBits,Y.windowBits===0)Y.windowBits=-15}if(Y.windowBits>=0&&Y.windowBits<16&&!($&&$.windowBits))Y.windowBits+=32;if(Y.windowBits>15&&Y.windowBits<48){if((Y.windowBits&15)===0)Y.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new cr0,this.strm.avail_out=0;var U=NQ.inflateInit2(this.strm,Y.windowBits);if(U!==K6.Z_OK)throw Error(Hk[U]);if(this.header=new nr0,NQ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=vO.string2buf(Y.dictionary);else if(Y90.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(U=NQ.inflateSetDictionary(this.strm,Y.dictionary),U!==K6.Z_OK)throw Error(Hk[U])}}}JU.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,I=this.options.dictionary,Q,J,K,G,H,W=!1;if(this.ended)return!1;if(J=Y===~~Y?Y:Y===!0?K6.Z_FINISH:K6.Z_NO_FLUSH,typeof $==="string")U.input=vO.binstring2buf($);else if(Y90.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new OW.Buf8(z),U.next_out=0,U.avail_out=z;if(Q=NQ.inflate(U,K6.Z_NO_FLUSH),Q===K6.Z_NEED_DICT&&I)Q=NQ.inflateSetDictionary(this.strm,I);if(Q===K6.Z_BUF_ERROR&&W===!0)Q=K6.Z_OK,W=!1;if(Q!==K6.Z_STREAM_END&&Q!==K6.Z_OK)return this.onEnd(Q),this.ended=!0,!1;if(U.next_out){if(U.avail_out===0||Q===K6.Z_STREAM_END||U.avail_in===0&&(J===K6.Z_FINISH||J===K6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=vO.utf8border(U.output,U.next_out),G=U.next_out-K,H=vO.buf2string(U.output,K),U.next_out=G,U.avail_out=z-G,G)OW.arraySet(U.output,U.output,K,G,0);this.onData(H)}else this.onData(OW.shrinkBuf(U.output,U.next_out))}if(U.avail_in===0&&U.avail_out===0)W=!0}while((U.avail_in>0||U.avail_out===0)&&Q!==K6.Z_STREAM_END);if(Q===K6.Z_STREAM_END)J=K6.Z_FINISH;if(J===K6.Z_FINISH)return Q=NQ.inflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===K6.Z_OK;if(J===K6.Z_SYNC_FLUSH)return this.onEnd(K6.Z_OK),U.avail_out=0,!0;return!0};JU.prototype.onData=function($){this.chunks.push($)};JU.prototype.onEnd=function($){if($===K6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=OW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function Wk($,Y){var U=new JU(Y);if(U.push($,!0),U.err)throw U.msg||Hk[U.err];return U.result}function pr0($,Y){return Y=Y||{},Y.raw=!0,Wk($,Y)}dr0.Inflate=JU;dr0.inflate=Wk;dr0.inflateRaw=pr0;dr0.ungzip=Wk});var Q90=E((Rm1,I90)=>{var sr0=W3().assign,ar0=K50(),tr0=U90(),er0=Gk(),z90={};sr0(z90,ar0,tr0,er0);I90.exports=z90});var K90=E((zs0)=>{var $s0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",Ys0=Q90(),J90=n4(),hO=G$(),Us0=$s0?"uint8array":"array";zs0.magic="\b\x00";function KU($,Y){hO.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}J90.inherits(KU,hO);KU.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(J90.transformTo(Us0,$.data),!1)};KU.prototype.flush=function(){if(hO.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};KU.prototype.cleanUp=function(){hO.prototype.cleanUp.call(this),this._pako=null};KU.prototype._createPako=function(){this._pako=new Ys0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};zs0.compressWorker=function($){return new KU("Deflate",$)};zs0.uncompressWorker=function(){return new KU("Inflate",{})}});var Xk=E((Ks0)=>{var G90=G$();Ks0.STORE={magic:"\x00\x00",compressWorker:function(){return new G90("STORE compression")},uncompressWorker:function(){return new G90("STORE decompression")}};Ks0.DEFLATE=K90()});var Zk=E((Ws0)=>{Ws0.LOCAL_FILE_HEADER="PK\x03\x04";Ws0.CENTRAL_FILE_HEADER="PK\x01\x02";Ws0.CENTRAL_DIRECTORY_END="PK\x05\x06";Ws0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";Ws0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";Ws0.DATA_DESCRIPTOR="PK\x07\b"});var Z90=E((Sm1,X90)=>{var DQ=n4(),AQ=G$(),qk=XQ(),H90=VO(),SO=Zk(),D4=function($,Y){var U="",z;for(z=0;z>>8;return U},ws0=function($,Y){var U=$;if(!$)U=Y?16893:33204;return(U&65535)<<16},Ms0=function($){return($||0)&63},W90=function($,Y,U,z,I,Q){var{file:J,compression:K}=$,G=Q!==qk.utf8encode,H=DQ.transformTo("string",Q(J.name)),W=DQ.transformTo("string",qk.utf8encode(J.name)),X=J.comment,Z=DQ.transformTo("string",Q(X)),q=DQ.transformTo("string",qk.utf8encode(X)),V=W.length!==J.name.length,w=q.length!==X.length,M,F,N="",O="",D="",P=J.dir,T=J.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||U)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(Y)j|=8;if(!G&&(V||w))j|=2048;var C=0,b=0;if(P)C|=16;if(I==="UNIX")b=798,C|=ws0(J.unixPermissions,P);else b=20,C|=Ms0(J.dosPermissions,P);if(M=T.getUTCHours(),M=M<<6,M=M|T.getUTCMinutes(),M=M<<5,M=M|T.getUTCSeconds()/2,F=T.getUTCFullYear()-1980,F=F<<4,F=F|T.getUTCMonth()+1,F=F<<5,F=F|T.getUTCDate(),V)O=D4(1,1)+D4(H90(H),4)+W,N+="up"+D4(O.length,2)+O;if(w)D=D4(1,1)+D4(H90(Z),4)+q,N+="uc"+D4(D.length,2)+D;var x="";x+=` \x00`,x+=D4(j,2),x+=K.magic,x+=D4(M,2),x+=D4(F,2),x+=D4(A.crc32,4),x+=D4(A.compressedSize,4),x+=D4(A.uncompressedSize,4),x+=D4(H.length,2),x+=D4(N.length,2);var g=SO.LOCAL_FILE_HEADER+x+H+N,i=SO.CENTRAL_FILE_HEADER+D4(b,2)+x+D4(Z.length,2)+"\x00\x00\x00\x00"+D4(C,4)+D4(z,4)+H+N+Z;return{fileRecord:g,dirRecord:i}},Os0=function($,Y,U,z,I){var Q="",J=DQ.transformTo("string",I(z));return Q=SO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+D4($,2)+D4($,2)+D4(Y,4)+D4(U,4)+D4(J.length,2)+J,Q},Ns0=function($){var Y="";return Y=SO.DATA_DESCRIPTOR+D4($.crc32,4)+D4($.compressedSize,4)+D4($.uncompressedSize,4),Y};function L5($,Y,U,z){AQ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=U,this.encodeFileName=z,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}DQ.inherits(L5,AQ);L5.prototype.push=function($){var Y=$.meta.percent||0,U=this.entriesCount,z=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,AQ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:U?(Y+100*(U-z-1))/U:100}})};L5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var U=W90($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:U.fileRecord,meta:{percent:0}})}else this.accumulate=!0};L5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,U=W90($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(U.dirRecord),Y)this.push({data:Ns0($),meta:{percent:100}});else{this.push({data:U.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};L5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y{var Ds0=Xk(),As0=Z90(),Bs0=function($,Y){var U=$||Y,z=Ds0[U];if(!z)throw Error(U+" is not a valid compression method !");return z};Ps0.generateWorker=function($,Y,U){var z=new As0(Y.streamFiles,U,Y.platform,Y.encodeFileName),I=0;try{$.forEach(function(Q,J){I++;var K=Bs0(J.options.compression,Y.compression),G=J.options.compressionOptions||Y.compressionOptions||{},H=J.dir,W=J.date;J._compressWorker(K,G).withStreamInfo("file",{name:Q,dir:H,date:W,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(z)}),z.entriesCount=I}catch(Q){z.error(Q)}return z}});var L90=E((ym1,V90)=>{var js0=n4(),gO=G$();function NW($,Y){gO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}js0.inherits(NW,gO);NW.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(U){Y.push({data:U,meta:{percent:0}})}).on("error",function(U){if(Y.isPaused)this.generatedError=U;else Y.error(U)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};NW.prototype.pause=function(){if(!gO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};NW.prototype.resume=function(){if(!gO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};V90.exports=NW});var T90=E((km1,P90)=>{var Es0=XQ(),DW=n4(),O90=G$(),Cs0=wy(),N90=My(),F90=LO(),Rs0=w$0(),_s0=q90(),w90=eH(),vs0=L90(),D90=function($,Y,U){var z=DW.getTypeOf(Y),I,Q=DW.extend(U||{},N90);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.dir)$=A90($);if(Q.createFolders&&(I=hs0($)))B90.call(this,I,!0);var J=z==="string"&&Q.binary===!1&&Q.base64===!1;if(!U||typeof U.binary>"u")Q.binary=!J;var K=Y instanceof F90&&Y.uncompressedSize===0;if(K||Q.dir||!Y||Y.length===0)Q.base64=!1,Q.binary=!0,Y="",Q.compression="STORE",z="string";var G=null;if(Y instanceof F90||Y instanceof O90)G=Y;else if(w90.isNode&&w90.isStream(Y))G=new vs0($,Y);else G=DW.prepareContent($,Y,Q.binary,Q.optimizedBinaryString,Q.base64);var H=new Rs0($,G,Q);this.files[$]=H},hs0=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var Y=$.lastIndexOf("/");return Y>0?$.substring(0,Y):""},A90=function($){if($.slice(-1)!=="/")$+="/";return $},B90=function($,Y){if(Y=typeof Y<"u"?Y:N90.createFolders,$=A90($),!this.files[$])D90.call(this,$,null,{dir:!0,createFolders:Y});return this.files[$]};function M90($){return Object.prototype.toString.call($)==="[object RegExp]"}var Ss0={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var Y,U,z;for(Y in this.files)if(z=this.files[Y],U=Y.slice(this.root.length,Y.length),U&&Y.slice(0,this.root.length)===this.root)$(U,z)},filter:function($){var Y=[];return this.forEach(function(U,z){if($(U,z))Y.push(z)}),Y},file:function($,Y,U){if(arguments.length===1)if(M90($)){var z=$;return this.filter(function(Q,J){return!J.dir&&z.test(Q)})}else{var I=this.files[this.root+$];if(I&&!I.dir)return I;else return null}else $=this.root+$,D90.call(this,$,Y,U);return this},folder:function($){if(!$)return this;if(M90($))return this.filter(function(I,Q){return Q.dir&&$.test(I)});var Y=this.root+$,U=B90.call(this,Y),z=this.clone();return z.root=U.name,z},remove:function($){$=this.root+$;var Y=this.files[$];if(!Y){if($.slice(-1)!=="/")$+="/";Y=this.files[$]}if(Y&&!Y.dir)delete this.files[$];else{var U=this.filter(function(I,Q){return Q.name.slice(0,$.length)===$});for(var z=0;z{var gs0=n4();function j90($){this.data=$,this.length=$.length,this.index=0,this.zero=0}j90.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length=this.index;U--)Y=(Y<<8)+this.byteAt(U);return this.index+=$,Y},readString:function($){return gs0.transformTo("string",this.readData($))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var $=this.readInt(4);return new Date(Date.UTC(($>>25&127)+1980,($>>21&15)-1,$>>16&31,$>>11&31,$>>5&63,($&31)<<1))}};E90.exports=j90});var Lk=E((fm1,R90)=>{var C90=Vk(),ys0=n4();function BQ($){C90.call(this,$);for(var Y=0;Y=0;--Q)if(this.data[Q]===Y&&this.data[Q+1]===U&&this.data[Q+2]===z&&this.data[Q+3]===I)return Q-this.zero;return-1};BQ.prototype.readAndCheckSignature=function($){var Y=$.charCodeAt(0),U=$.charCodeAt(1),z=$.charCodeAt(2),I=$.charCodeAt(3),Q=this.readData(4);return Y===Q[0]&&U===Q[1]&&z===Q[2]&&I===Q[3]};BQ.prototype.readData=function($){if(this.checkOffset($),$===0)return[];var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};R90.exports=BQ});var h90=E((um1,v90)=>{var _90=Vk(),ks0=n4();function PQ($){_90.call(this,$)}ks0.inherits(PQ,_90);PQ.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};PQ.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};PQ.prototype.readAndCheckSignature=function($){var Y=this.readData(4);return $===Y};PQ.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};v90.exports=PQ});var wk=E((bm1,g90)=>{var S90=Lk(),xs0=n4();function Fk($){S90.call(this,$)}xs0.inherits(Fk,S90);Fk.prototype.readData=function($){if(this.checkOffset($),$===0)return new Uint8Array(0);var Y=this.data.subarray(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};g90.exports=Fk});var x90=E((im1,k90)=>{var y90=wk(),fs0=n4();function Mk($){y90.call(this,$)}fs0.inherits(Mk,y90);Mk.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};k90.exports=Mk});var Ok=E((cm1,u90)=>{var yO=n4(),f90=H3(),us0=Lk(),bs0=h90(),is0=x90(),cs0=wk();u90.exports=function($){var Y=yO.getTypeOf($);if(yO.checkSupport(Y),Y==="string"&&!f90.uint8array)return new bs0($);if(Y==="nodebuffer")return new is0($);if(f90.uint8array)return new cs0(yO.transformTo("uint8array",$));return new us0(yO.transformTo("array",$))}});var n90=E((nm1,c90)=>{var Nk=Ok(),r7=n4(),ns0=LO(),b90=VO(),kO=XQ(),xO=Xk(),ps0=H3(),ds0=0,ms0=3,ls0=function($){for(var Y in xO){if(!Object.prototype.hasOwnProperty.call(xO,Y))continue;if(xO[Y].magic===$)return xO[Y]}return null};function i90($,Y){this.options=$,this.loadOptions=Y}i90.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var Y,U;if($.skip(22),this.fileNameLength=$.readInt(2),U=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(U),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(Y=ls0(this.compressionMethod),Y===null)throw Error("Corrupted zip : compression "+r7.pretty(this.compressionMethod)+" unknown (inner file : "+r7.transformTo("string",this.fileName)+")");this.decompressed=new ns0(this.compressedSize,this.uncompressedSize,this.crc32,Y,$.readData(this.compressedSize))},readCentralPart:function($){this.versionMadeBy=$.readInt(2),$.skip(2),this.bitFlag=$.readInt(2),this.compressionMethod=$.readString(2),this.date=$.readDate(),this.crc32=$.readInt(4),this.compressedSize=$.readInt(4),this.uncompressedSize=$.readInt(4);var Y=$.readInt(2);if(this.extraFieldsLength=$.readInt(2),this.fileCommentLength=$.readInt(2),this.diskNumberStart=$.readInt(2),this.internalFileAttributes=$.readInt(2),this.externalFileAttributes=$.readInt(4),this.localHeaderOffset=$.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");$.skip(Y),this.readExtraFields($),this.parseZIP64ExtraField($),this.fileComment=$.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,$===ds0)this.dosPermissions=this.externalFileAttributes&63;if($===ms0)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=Nk(this.extraFields[1].value);if(this.uncompressedSize===r7.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===r7.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===r7.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===r7.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var Y=$.index+this.extraFieldsLength,U,z,I;if(!this.extraFields)this.extraFields={};while($.index+4{var os0=Ok(),q3=n4(),F5=Zk(),rs0=n90(),ss0=H3();function p90($){this.files=[],this.loadOptions=$}p90.prototype={checkSignature:function($){if(!this.reader.readAndCheckSignature($)){this.reader.index-=4;var Y=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+q3.pretty(Y)+", expected "+q3.pretty($)+")")}},isSignature:function($,Y){var U=this.reader.index;this.reader.setIndex($);var z=this.reader.readString(4),I=z===Y;return this.reader.setIndex(U),I},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var $=this.reader.readData(this.zipCommentLength),Y=ss0.uint8array?"uint8array":"array",U=q3.transformTo(Y,$);this.zipComment=this.loadOptions.decodeFileName(U)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var $=this.zip64EndOfCentralSize-44,Y=0,U,z,I;while(Y<$)U=this.reader.readInt(2),z=this.reader.readInt(4),I=this.reader.readData(z),this.zip64ExtensibleData[U]={id:U,length:z,value:I}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var $,Y;for($=0;$0)if(this.isSignature(U,F5.CENTRAL_FILE_HEADER));else this.reader.zero=I;else if(I<0)throw Error("Corrupted zip: missing "+Math.abs(I)+" bytes.")},prepareReader:function($){this.reader=os0($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};d90.exports=p90});var r90=E((dm1,o90)=>{var Dk=n4(),fO=GQ(),as0=XQ(),ts0=m90(),es0=Dy(),l90=eH();function $a0($){return new fO.Promise(function(Y,U){var z=$.decompressed.getContentWorker().pipe(new es0);z.on("error",function(I){U(I)}).on("end",function(){if(z.streamInfo.crc32!==$.decompressed.crc32)U(Error("Corrupted zip : CRC32 mismatch"));else Y()}).resume()})}o90.exports=function($,Y){var U=this;if(Y=Dk.extend(Y||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:as0.utf8decode}),l90.isNode&&l90.isStream($))return fO.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return Dk.prepareContent("the loaded zip file",$,!0,Y.optimizedBinaryString,Y.base64).then(function(z){var I=new ts0(Y);return I.load(z),I}).then(function(I){var Q=[fO.Promise.resolve(I)],J=I.files;if(Y.checkCRC32)for(var K=0;K{function h$(){if(!(this instanceof h$))return new h$;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var $=new h$;for(var Y in this)if(typeof this[Y]!=="function")$[Y]=this[Y];return $}}h$.prototype=T90();h$.prototype.loadAsync=r90();h$.support=H3();h$.defaults=My();h$.version="3.10.1";h$.loadAsync=function($,Y){return new h$().loadAsync($,Y)};h$.external=GQ();s90.exports=h$});var U30=E((lm1,Y30)=>{function a90($,Y){var U=Object.keys($);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);Y&&(z=z.filter(function(I){return Object.getOwnPropertyDescriptor($,I).enumerable})),U.push.apply(U,z)}return U}function t90($){for(var Y=1;Y0)this.tail.next=z;else this.head=z;this.tail=z,++this.length}},{key:"unshift",value:function(U){var z={data:U,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length}},{key:"shift",value: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}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(U){if(this.length===0)return"";var z=this.head,I=""+z.data;while(z=z.next)I+=U+z.data;return I}},{key:"concat",value:function(U){if(this.length===0)return uO.alloc(0);var z=uO.allocUnsafe(U>>>0),I=this.head,Q=0;while(I)Ga0(I.data,z,Q),Q+=I.data.length,I=I.next;return z}},{key:"consume",value:function(U,z){var I;if(UJ.length?J.length:U;if(K===J.length)Q+=J;else Q+=J.slice(0,U);if(U-=K,U===0){if(K===J.length)if(++I,z.next)this.head=z.next;else this.head=this.tail=null;else this.head=z,z.data=J.slice(K);break}++I}return this.length-=I,Q}},{key:"_getBuffer",value:function(U){var z=uO.allocUnsafe(U),I=this.head,Q=1;I.data.copy(z),U-=I.data.length;while(I=I.next){var J=I.data,K=U>J.length?J.length:U;if(J.copy(z,z.length-U,0,K),U-=K,U===0){if(K===J.length)if(++Q,I.next)this.head=I.next;else this.head=this.tail=null;else this.head=I,I.data=J.slice(K);break}++Q}return this.length-=Q,z}},{key:Ka0,value:function(U,z){return Bk(this,t90(t90({},z),{},{depth:0,customInspect:!1}))}}]),$}()});var Tk=E((om1,I30)=>{function Ha0($,Y){var U=this,z=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(z||I){if(Y)Y($);else if($){if(!this._writableState)process.nextTick(Pk,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(Pk,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Q){if(!Y&&Q)if(!U._writableState)process.nextTick(z30,U,Q);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,process.nextTick(z30,U,Q);else process.nextTick(bO,U);else if(Y)process.nextTick(bO,U),Y(Q);else process.nextTick(bO,U)}),this}function z30($,Y){Pk($,Y),bO($)}function bO($){if($._writableState&&!$._writableState.emitClose)return;if($._readableState&&!$._readableState.emitClose)return;$.emit("close")}function Wa0(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function Pk($,Y){$.emit("error",Y)}function Xa0($,Y){var{_readableState:U,_writableState:z}=$;if(U&&U.autoDestroy||z&&z.autoDestroy)$.destroy(Y);else $.emit("error",Y)}I30.exports={destroy:Ha0,undestroy:Wa0,errorOrDestroy:Xa0}});var s7=E((La0,K30)=>{var J30={};function S$($,Y,U){if(!U)U=Error;function z(Q,J,K){if(typeof Y==="string")return Y;else return Y(Q,J,K)}class I extends U{constructor(Q,J,K){super(z(Q,J,K))}}I.prototype.name=U.name,I.prototype.code=$,J30[$]=I}function Q30($,Y){if(Array.isArray($)){let U=$.length;if($=$.map((z)=>String(z)),U>2)return`one of ${Y} ${$.slice(0,U-1).join(", ")}, or `+$[U-1];else if(U===2)return`one of ${Y} ${$[0]} or ${$[1]}`;else return`of ${Y} ${$[0]}`}else return`of ${Y} ${String($)}`}function Za0($,Y,U){return $.substr(!U||U<0?0:+U,Y.length)===Y}function qa0($,Y,U){if(U===void 0||U>$.length)U=$.length;return $.substring(U-Y.length,U)===Y}function Va0($,Y,U){if(typeof U!=="number")U=0;if(U+Y.length>$.length)return!1;else return $.indexOf(Y,U)!==-1}S$("ERR_INVALID_OPT_VALUE",function($,Y){return'The value "'+Y+'" is invalid for option "'+$+'"'},TypeError);S$("ERR_INVALID_ARG_TYPE",function($,Y,U){let z;if(typeof Y==="string"&&Za0(Y,"not "))z="must not be",Y=Y.replace(/^not /,"");else z="must be";let I;if(qa0($," argument"))I=`The ${$} ${z} ${Q30(Y,"type")}`;else{let Q=Va0($,".")?"property":"argument";I=`The "${$}" ${Q} ${z} ${Q30(Y,"type")}`}return I+=`. Received type ${typeof U}`,I},TypeError);S$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");S$("ERR_METHOD_NOT_IMPLEMENTED",function($){return"The "+$+" method is not implemented"});S$("ERR_STREAM_PREMATURE_CLOSE","Premature close");S$("ERR_STREAM_DESTROYED",function($){return"Cannot call "+$+" after a stream was destroyed"});S$("ERR_MULTIPLE_CALLBACK","Callback called multiple times");S$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");S$("ERR_STREAM_WRITE_AFTER_END","write after end");S$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);S$("ERR_UNKNOWN_ENCODING",function($){return"Unknown encoding: "+$},TypeError);S$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");La0.codes=J30});var jk=E((rm1,G30)=>{var wa0=s7().codes.ERR_INVALID_OPT_VALUE;function Ma0($,Y,U){return $.highWaterMark!=null?$.highWaterMark:Y?$[U]:null}function Oa0($,Y,U,z){var I=Ma0(Y,z,U);if(I!=null){if(!(isFinite(I)&&Math.floor(I)===I)||I<0){var Q=z?U:"highWaterMark";throw new wa0(Q,I)}return Math.floor(I)}return $.objectMode?16:16384}G30.exports={getHighWaterMark:Oa0}});var Rk=E((sm1,V30)=>{V30.exports=Y6;function W30($){var Y=this;this.next=null,this.entry=null,this.finish=function(){ma0(Y,$)}}var TQ;Y6.WritableState=BW;var Na0={deprecate:u7()},X30=J0("stream"),cO=J0("buffer").Buffer,Da0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Aa0($){return cO.from($)}function Ba0($){return cO.isBuffer($)||$ instanceof Da0}var Ck=Tk(),Pa0=jk(),Ta0=Pa0.getHighWaterMark,a7=s7().codes,ja0=a7.ERR_INVALID_ARG_TYPE,Ea0=a7.ERR_METHOD_NOT_IMPLEMENTED,Ca0=a7.ERR_MULTIPLE_CALLBACK,Ra0=a7.ERR_STREAM_CANNOT_PIPE,_a0=a7.ERR_STREAM_DESTROYED,va0=a7.ERR_STREAM_NULL_VALUES,ha0=a7.ERR_STREAM_WRITE_AFTER_END,Sa0=a7.ERR_UNKNOWN_ENCODING,jQ=Ck.errorOrDestroy;W1()(Y6,X30);function ga0(){}function BW($,Y,U){if(TQ=TQ||GU(),$=$||{},typeof U!=="boolean")U=Y instanceof TQ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.writableObjectMode;this.highWaterMark=Ta0(this,$,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=$.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(I){ia0(Y,I)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=$.emitClose!==!1,this.autoDestroy=!!$.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new W30(this)}BW.prototype.getBuffer=function(){var Y=this.bufferedRequest,U=[];while(Y)U.push(Y),Y=Y.next;return U};(function(){try{Object.defineProperty(BW.prototype,"buffer",{get:Na0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var iO;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")iO=Function.prototype[Symbol.hasInstance],Object.defineProperty(Y6,Symbol.hasInstance,{value:function(Y){if(iO.call(this,Y))return!0;if(this!==Y6)return!1;return Y&&Y._writableState instanceof BW}});else iO=function(Y){return Y instanceof this};function Y6($){TQ=TQ||GU();var Y=this instanceof TQ;if(!Y&&!iO.call(Y6,this))return new Y6($);if(this._writableState=new BW($,this,Y),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}X30.call(this)}Y6.prototype.pipe=function(){jQ(this,new Ra0)};function ya0($,Y){var U=new ha0;jQ($,U),process.nextTick(Y,U)}function ka0($,Y,U,z){var I;if(U===null)I=new va0;else if(typeof U!=="string"&&!Y.objectMode)I=new ja0("chunk",["string","Buffer"],U);if(I)return jQ($,I),process.nextTick(z,I),!1;return!0}Y6.prototype.write=function($,Y,U){var z=this._writableState,I=!1,Q=!z.objectMode&&Ba0($);if(Q&&!cO.isBuffer($))$=Aa0($);if(typeof Y==="function")U=Y,Y=null;if(Q)Y="buffer";else if(!Y)Y=z.defaultEncoding;if(typeof U!=="function")U=ga0;if(z.ending)ya0(this,U);else if(Q||ka0(this,z,$,U))z.pendingcb++,I=fa0(this,z,Q,$,Y,U);return I};Y6.prototype.cork=function(){this._writableState.corked++};Y6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)Z30(this,$)}};Y6.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=Y.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw new Sa0(Y);return this._writableState.defaultEncoding=Y,this};Object.defineProperty(Y6.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function xa0($,Y,U){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=cO.from(Y,U);return Y}Object.defineProperty(Y6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function fa0($,Y,U,z,I,Q){if(!U){var J=xa0(Y,z,I);if(z!==J)U=!0,I="buffer",z=J}var K=Y.objectMode?1:z.length;Y.length+=K;var G=Y.length{var la0=Object.keys||function($){var Y=[];for(var U in $)Y.push(U);return Y};F30.exports=H9;var L30=vk(),_k=Rk();W1()(H9,L30);{nO=la0(_k.prototype);for(PW=0;PW{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var pO=J0("buffer"),W9=pO.Buffer;function w30($,Y){for(var U in $)Y[U]=$[U]}if(W9.from&&W9.alloc&&W9.allocUnsafe&&W9.allocUnsafeSlow)M30.exports=pO;else w30(pO,hk),hk.Buffer=HU;function HU($,Y,U){return W9($,Y,U)}HU.prototype=Object.create(W9.prototype);w30(W9,HU);HU.from=function($,Y,U){if(typeof $==="number")throw TypeError("Argument must not be a number");return W9($,Y,U)};HU.alloc=function($,Y,U){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=W9($);if(Y!==void 0)if(typeof U==="string")z.fill(Y,U);else z.fill(Y);else z.fill(0);return z};HU.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return W9($)};HU.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return pO.SlowBuffer($)}});var EQ=E((Ht0)=>{var gk=O30().Buffer,N30=gk.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sa0($){if(!$)return"utf8";var Y;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Y)return;$=(""+$).toLowerCase(),Y=!0}}function aa0($){var Y=sa0($);if(typeof Y!=="string"&&(gk.isEncoding===N30||!N30($)))throw Error("Unknown encoding: "+$);return Y||$}Ht0.StringDecoder=jW;function jW($){this.encoding=aa0($);var Y;switch(this.encoding){case"utf16le":this.text=zt0,this.end=It0,Y=4;break;case"utf8":this.fillLast=$t0,Y=4;break;case"base64":this.text=Qt0,this.end=Jt0,Y=3;break;default:this.write=Kt0,this.end=Gt0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=gk.allocUnsafe(Y)}jW.prototype.write=function($){if($.length===0)return"";var Y,U;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";U=this.lastNeed,this.lastNeed=0}else U=0;if(U<$.length)return Y?Y+this.text($,U):this.text($,U);return Y||""};jW.prototype.end=Ut0;jW.prototype.text=Yt0;jW.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function Sk($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function ta0($,Y,U){var z=Y.length-1;if(z=0){if(I>0)$.lastNeed=I-1;return I}if(--z=0){if(I>0)$.lastNeed=I-2;return I}if(--z=0){if(I>0)if(I===2)I=0;else $.lastNeed=I-3;return I}return 0}function ea0($,Y,U){if((Y[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Y.length>1){if((Y[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Y.length>2){if((Y[2]&192)!==128)return $.lastNeed=2,"�"}}}function $t0($){var Y=this.lastTotal-this.lastNeed,U=ea0(this,$,Y);if(U!==void 0)return U;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Y,0,$.length),this.lastNeed-=$.length}function Yt0($,Y){var U=ta0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=U;var z=$.length-(U-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",Y,z)}function Ut0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function zt0($,Y){if(($.length-Y)%2===0){var U=$.toString("utf16le",Y);if(U){var z=U.charCodeAt(U.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],U.slice(0,-1)}return U}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function It0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var U=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,U)}return Y}function Qt0($,Y){var U=($.length-Y)%3;if(U===0)return $.toString("base64",Y);if(this.lastNeed=3-U,this.lastTotal=3,U===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-U)}function Jt0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Kt0($){return $.toString(this.encoding)}function Gt0($){return $&&$.length?this.write($):""}});var dO=E((em1,B30)=>{var D30=s7().codes.ERR_STREAM_PREMATURE_CLOSE;function Xt0($){var Y=!1;return function(){if(Y)return;Y=!0;for(var U=arguments.length,z=Array(U),I=0;I{var mO;function t7($,Y,U){if(Y=Vt0(Y),Y in $)Object.defineProperty($,Y,{value:U,enumerable:!0,configurable:!0,writable:!0});else $[Y]=U;return $}function Vt0($){var Y=Lt0($,"string");return typeof Y==="symbol"?Y:String(Y)}function Lt0($,Y){if(typeof $!=="object"||$===null)return $;var U=$[Symbol.toPrimitive];if(U!==void 0){var z=U.call($,Y||"default");if(typeof z!=="object")return z;throw TypeError("@@toPrimitive must return a primitive value.")}return(Y==="string"?String:Number)($)}var Ft0=dO(),e7=Symbol("lastResolve"),WU=Symbol("lastReject"),EW=Symbol("error"),lO=Symbol("ended"),XU=Symbol("lastPromise"),yk=Symbol("handlePromise"),ZU=Symbol("stream");function $2($,Y){return{value:$,done:Y}}function wt0($){var Y=$[e7];if(Y!==null){var U=$[ZU].read();if(U!==null)$[XU]=null,$[e7]=null,$[WU]=null,Y($2(U,!1))}}function Mt0($){process.nextTick(wt0,$)}function Ot0($,Y){return function(U,z){$.then(function(){if(Y[lO]){U($2(void 0,!0));return}Y[yk](U,z)},z)}}var Nt0=Object.getPrototypeOf(function(){}),Dt0=Object.setPrototypeOf((mO={get stream(){return this[ZU]},next:function(){var Y=this,U=this[EW];if(U!==null)return Promise.reject(U);if(this[lO])return Promise.resolve($2(void 0,!0));if(this[ZU].destroyed)return new Promise(function(J,K){process.nextTick(function(){if(Y[EW])K(Y[EW]);else J($2(void 0,!0))})});var z=this[XU],I;if(z)I=new Promise(Ot0(z,this));else{var Q=this[ZU].read();if(Q!==null)return Promise.resolve($2(Q,!1));I=new Promise(this[yk])}return this[XU]=I,I}},t7(mO,Symbol.asyncIterator,function(){return this}),t7(mO,"return",function(){var Y=this;return new Promise(function(U,z){Y[ZU].destroy(null,function(I){if(I){z(I);return}U($2(void 0,!0))})})}),mO),Nt0),At0=function(Y){var U,z=Object.create(Dt0,(U={},t7(U,ZU,{value:Y,writable:!0}),t7(U,e7,{value:null,writable:!0}),t7(U,WU,{value:null,writable:!0}),t7(U,EW,{value:null,writable:!0}),t7(U,lO,{value:Y._readableState.endEmitted,writable:!0}),t7(U,yk,{value:function(Q,J){var K=z[ZU].read();if(K)z[XU]=null,z[e7]=null,z[WU]=null,Q($2(K,!1));else z[e7]=Q,z[WU]=J},writable:!0}),U));return z[XU]=null,Ft0(Y,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Q=z[WU];if(Q!==null)z[XU]=null,z[e7]=null,z[WU]=null,Q(I);z[EW]=I;return}var J=z[e7];if(J!==null)z[XU]=null,z[e7]=null,z[WU]=null,J($2(void 0,!0));z[lO]=!0}),Y.on("readable",Mt0.bind(null,z)),z};P30.exports=At0});var R30=E((Yl1,C30)=>{function j30($,Y,U,z,I,Q,J){try{var K=$[Q](J),G=K.value}catch(H){U(H);return}if(K.done)Y(G);else Promise.resolve(G).then(z,I)}function Bt0($){return function(){var Y=this,U=arguments;return new Promise(function(z,I){var Q=$.apply(Y,U);function J(G){j30(Q,z,I,J,K,"next",G)}function K(G){j30(Q,z,I,J,K,"throw",G)}J(void 0)})}}function E30($,Y){var U=Object.keys($);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);Y&&(z=z.filter(function(I){return Object.getOwnPropertyDescriptor($,I).enumerable})),U.push.apply(U,z)}return U}function Pt0($){for(var Y=1;Y{u30.exports=p1;var CQ;p1.ReadableState=S30;var Ul1=J0("events").EventEmitter,h30=function(Y,U){return Y.listeners(U).length},RW=J0("stream"),oO=J0("buffer").Buffer,_t0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function vt0($){return oO.from($)}function ht0($){return oO.isBuffer($)||$ instanceof _t0}var kk=J0("util"),C1;if(kk&&kk.debuglog)C1=kk.debuglog("stream");else C1=function(){};var St0=U30(),nk=Tk(),gt0=jk(),yt0=gt0.getHighWaterMark,rO=s7().codes,kt0=rO.ERR_INVALID_ARG_TYPE,xt0=rO.ERR_STREAM_PUSH_AFTER_EOF,ft0=rO.ERR_METHOD_NOT_IMPLEMENTED,ut0=rO.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,RQ,xk,fk;W1()(p1,RW);var CW=nk.errorOrDestroy,uk=["error","close","destroy","pause","resume"];function bt0($,Y,U){if(typeof $.prependListener==="function")return $.prependListener(Y,U);if(!$._events||!$._events[Y])$.on(Y,U);else if(Array.isArray($._events[Y]))$._events[Y].unshift(U);else $._events[Y]=[U,$._events[Y]]}function S30($,Y,U){if(CQ=CQ||GU(),$=$||{},typeof U!=="boolean")U=Y instanceof CQ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.readableObjectMode;if(this.highWaterMark=yt0(this,$,"readableHighWaterMark",U),this.buffer=new St0,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=$.emitClose!==!1,this.autoDestroy=!!$.autoDestroy,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!RQ)RQ=EQ().StringDecoder;this.decoder=new RQ($.encoding),this.encoding=$.encoding}}function p1($){if(CQ=CQ||GU(),!(this instanceof p1))return new p1($);var Y=this instanceof CQ;if(this._readableState=new S30($,this,Y),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}RW.call(this)}Object.defineProperty(p1.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(Y){if(!this._readableState)return;this._readableState.destroyed=Y}});p1.prototype.destroy=nk.destroy;p1.prototype._undestroy=nk.undestroy;p1.prototype._destroy=function($,Y){Y($)};p1.prototype.push=function($,Y){var U=this._readableState,z;if(!U.objectMode){if(typeof $==="string"){if(Y=Y||U.defaultEncoding,Y!==U.encoding)$=oO.from($,Y),Y="";z=!0}}else z=!0;return g30(this,$,Y,!1,z)};p1.prototype.unshift=function($){return g30(this,$,null,!0,!1)};function g30($,Y,U,z,I){C1("readableAddChunk",Y);var Q=$._readableState;if(Y===null)Q.reading=!1,nt0($,Q);else{var J;if(!I)J=it0(Q,Y);if(J)CW($,J);else if(Q.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!Q.objectMode&&Object.getPrototypeOf(Y)!==oO.prototype)Y=vt0(Y);if(z)if(Q.endEmitted)CW($,new ut0);else bk($,Q,Y,!0);else if(Q.ended)CW($,new xt0);else if(Q.destroyed)return!1;else if(Q.reading=!1,Q.decoder&&!U)if(Y=Q.decoder.write(Y),Q.objectMode||Y.length!==0)bk($,Q,Y,!1);else ck($,Q);else bk($,Q,Y,!1)}else if(!z)Q.reading=!1,ck($,Q)}return!Q.ended&&(Q.length=_30)$=_30;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function v30($,Y){if($<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if($!==$)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if($>Y.highWaterMark)Y.highWaterMark=ct0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}p1.prototype.read=function($){C1("read",$),$=parseInt($,10);var Y=this._readableState,U=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended)){if(C1("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)ik(this);else sO(this);return null}if($=v30($,Y),$===0&&Y.ended){if(Y.length===0)ik(this);return null}var z=Y.needReadable;if(C1("need readable",z),Y.length===0||Y.length-$0)I=x30($,Y);else I=null;if(I===null)Y.needReadable=Y.length<=Y.highWaterMark,$=0;else Y.length-=$,Y.awaitDrain=0;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(U!==$&&Y.ended)ik(this)}if(I!==null)this.emit("data",I);return I};function nt0($,Y){if(C1("onEofChunk"),Y.ended)return;if(Y.decoder){var U=Y.decoder.end();if(U&&U.length)Y.buffer.push(U),Y.length+=Y.objectMode?1:U.length}if(Y.ended=!0,Y.sync)sO($);else if(Y.needReadable=!1,!Y.emittedReadable)Y.emittedReadable=!0,y30($)}function sO($){var Y=$._readableState;if(C1("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,!Y.emittedReadable)C1("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(y30,$)}function y30($){var Y=$._readableState;if(C1("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended))$.emit("readable"),Y.emittedReadable=!1;Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,pk($)}function ck($,Y){if(!Y.readingMore)Y.readingMore=!0,process.nextTick(pt0,$,Y)}function pt0($,Y){while(!Y.reading&&!Y.ended&&(Y.length1&&f30(z.pipes,$)!==-1)&&!H)C1("false write response, pause",z.awaitDrain),z.awaitDrain++;U.pause()}}function Z(M){if(C1("onerror",M),w(),$.removeListener("error",Z),h30($,"error")===0)CW($,M)}bt0($,"error",Z);function q(){$.removeListener("finish",V),w()}$.once("close",q);function V(){C1("onfinish"),$.removeListener("close",q),w()}$.once("finish",V);function w(){C1("unpipe"),U.unpipe($)}if($.emit("pipe",U),!z.flowing)C1("pipe resume"),U.resume();return $};function dt0($){return function(){var U=$._readableState;if(C1("pipeOnDrain",U.awaitDrain),U.awaitDrain)U.awaitDrain--;if(U.awaitDrain===0&&h30($,"data"))U.flowing=!0,pk($)}}p1.prototype.unpipe=function($){var Y=this._readableState,U={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if($&&$!==Y.pipes)return this;if(!$)$=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,$)$.emit("unpipe",this,U);return this}if(!$){var{pipes:z,pipesCount:I}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Q=0;Q0,z.flowing!==!1)this.resume()}else if($==="readable"){if(!z.endEmitted&&!z.readableListening){if(z.readableListening=z.needReadable=!0,z.flowing=!1,z.emittedReadable=!1,C1("on readable",z.length,z.reading),z.length)sO(this);else if(!z.reading)process.nextTick(mt0,this)}}return U};p1.prototype.addListener=p1.prototype.on;p1.prototype.removeListener=function($,Y){var U=RW.prototype.removeListener.call(this,$,Y);if($==="readable")process.nextTick(k30,this);return U};p1.prototype.removeAllListeners=function($){var Y=RW.prototype.removeAllListeners.apply(this,arguments);if($==="readable"||$===void 0)process.nextTick(k30,this);return Y};function k30($){var Y=$._readableState;if(Y.readableListening=$.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused)Y.flowing=!0;else if($.listenerCount("data")>0)$.resume()}function mt0($){C1("readable nexttick read 0"),$.read(0)}p1.prototype.resume=function(){var $=this._readableState;if(!$.flowing)C1("resume"),$.flowing=!$.readableListening,lt0(this,$);return $.paused=!1,this};function lt0($,Y){if(!Y.resumeScheduled)Y.resumeScheduled=!0,process.nextTick(ot0,$,Y)}function ot0($,Y){if(C1("resume",Y.reading),!Y.reading)$.read(0);if(Y.resumeScheduled=!1,$.emit("resume"),pk($),Y.flowing&&!Y.reading)$.read(0)}p1.prototype.pause=function(){if(C1("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)C1("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function pk($){var Y=$._readableState;C1("flow",Y.flowing);while(Y.flowing&&$.read()!==null);}p1.prototype.wrap=function($){var Y=this,U=this._readableState,z=!1;$.on("end",function(){if(C1("wrapped end"),U.decoder&&!U.ended){var J=U.decoder.end();if(J&&J.length)Y.push(J)}Y.push(null)}),$.on("data",function(J){if(C1("wrapped data"),U.decoder)J=U.decoder.write(J);if(U.objectMode&&(J===null||J===void 0))return;else if(!U.objectMode&&(!J||!J.length))return;var K=Y.push(J);if(!K)z=!0,$.pause()});for(var I in $)if(this[I]===void 0&&typeof $[I]==="function")this[I]=function(K){return function(){return $[K].apply($,arguments)}}(I);for(var Q=0;Q=Y.length){if(Y.decoder)U=Y.buffer.join("");else if(Y.buffer.length===1)U=Y.buffer.first();else U=Y.buffer.concat(Y.length);Y.buffer.clear()}else U=Y.buffer.consume($,Y.decoder);return U}function ik($){var Y=$._readableState;if(C1("endReadable",Y.endEmitted),!Y.endEmitted)Y.ended=!0,process.nextTick(rt0,Y,$)}function rt0($,Y){if(C1("endReadableNT",$.endEmitted,$.length),!$.endEmitted&&$.length===0){if($.endEmitted=!0,Y.readable=!1,Y.emit("end"),$.autoDestroy){var U=Y._writableState;if(!U||U.autoDestroy&&U.finished)Y.destroy()}}}if(typeof Symbol==="function")p1.from=function($,Y){if(fk===void 0)fk=R30();return fk(p1,$,Y)};function f30($,Y){for(var U=0,z=$.length;U{i30.exports=V3;var aO=s7().codes,st0=aO.ERR_METHOD_NOT_IMPLEMENTED,at0=aO.ERR_MULTIPLE_CALLBACK,tt0=aO.ERR_TRANSFORM_ALREADY_TRANSFORMING,et0=aO.ERR_TRANSFORM_WITH_LENGTH_0,tO=GU();W1()(V3,tO);function $e0($,Y){var U=this._transformState;U.transforming=!1;var z=U.writecb;if(z===null)return this.emit("error",new at0);if(U.writechunk=null,U.writecb=null,Y!=null)this.push(Y);z($);var I=this._readableState;if(I.reading=!1,I.needReadable||I.length{n30.exports=_W;var c30=dk();W1()(_W,c30);function _W($){if(!(this instanceof _W))return new _W($);c30.call(this,$)}_W.prototype._transform=function($,Y,U){U(null,$)}});var r30=E((Jl1,o30)=>{var mk;function Ue0($){var Y=!1;return function(){if(Y)return;Y=!0,$.apply(void 0,arguments)}}var l30=s7().codes,ze0=l30.ERR_MISSING_ARGS,Ie0=l30.ERR_STREAM_DESTROYED;function d30($){if($)throw $}function Qe0($){return $.setHeader&&typeof $.abort==="function"}function Je0($,Y,U,z){z=Ue0(z);var I=!1;if($.on("close",function(){I=!0}),mk===void 0)mk=dO();mk($,{readable:Y,writable:U},function(J){if(J)return z(J);I=!0,z()});var Q=!1;return function(J){if(I)return;if(Q)return;if(Q=!0,Qe0($))return $.abort();if(typeof $.destroy==="function")return $.destroy();z(J||new Ie0("pipe"))}}function m30($){$()}function Ke0($,Y){return $.pipe(Y)}function Ge0($){if(!$.length)return d30;if(typeof $[$.length-1]!=="function")return d30;return $.pop()}function He0(){for(var $=arguments.length,Y=Array($),U=0;U<$;U++)Y[U]=arguments[U];var z=Ge0(Y);if(Array.isArray(Y[0]))Y=Y[0];if(Y.length<2)throw new ze0("streams");var I,Q=Y.map(function(J,K){var G=K0;return Je0(J,G,H,function(W){if(!I)I=W;if(W)Q.forEach(m30);if(G)return;Q.forEach(m30),z(I)})});return Y.reduce(Ke0)}o30.exports=He0});var v8=E((g$,hW)=>{var vW=J0("stream");if(process.env.READABLE_STREAM==="disable"&&vW)hW.exports=vW.Readable,Object.assign(hW.exports,vW),hW.exports.Stream=vW;else g$=hW.exports=vk(),g$.Stream=vW||g$,g$.Readable=g$,g$.Writable=Rk(),g$.Duplex=GU(),g$.Transform=dk(),g$.PassThrough=p30(),g$.finished=dO(),g$.pipeline=r30()});var V8=E((Kl1,t30)=>{var s30=J0("fs"),We0=function($,Y,U,z){if($.super_=Y,!z)z=U,U=null;if(U)Object.keys(U).forEach((Q)=>{Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(U,Q))});let I={constructor:{value:$,enumerable:!1,writable:!1,configurable:!0}};if(z)Object.keys(z).forEach((Q)=>{I[Q]=Object.getOwnPropertyDescriptor(z,Q)});$.prototype=Object.create(Y.prototype,I)},Xe0=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,a30={nop(){},promiseImmediate($){return new Promise((Y)=>{if(global.setImmediate)setImmediate(()=>{Y($)});else setTimeout(()=>{Y($)},1)})},inherits:We0,dateToExcel($,Y){return 25569+$.getTime()/86400000-(Y?1462:0)},excelToDate($,Y){let U=Math.round(($-25569+(Y?1462:0))*24*3600*1000);return new Date(U)},parsePath($){let Y=$.lastIndexOf("/");return{path:$.substring(0,Y),name:$.substring(Y+1)}},getRelsPath($){let Y=a30.parsePath($);return`${Y.path}/_rels/${Y.name}.rels`},xmlEncode($){let Y=Xe0.exec($);if(!Y)return $;let U="",z="",I=0,Q=Y.index;for(;Q<$.length;Q++){let J=$.charCodeAt(Q);switch(J){case 34:z=""";break;case 38:z="&";break;case 39:z="'";break;case 60:z="<";break;case 62:z=">";break;case 127:z="";break;default:{if(J<=31&&(J<=8||J>=11&&J!==13)){z="";break}continue}}if(I!==Q)U+=$.substring(I,Q);if(I=Q+1,z)U+=z}if(I!==Q)return U+$.substring(I,Q);return U},xmlDecode($){return $.replace(/&([a-z]*);/g,(Y)=>{switch(Y){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return Y}})},validInt($){let Y=parseInt($,10);return!Number.isNaN(Y)?Y:0},isDateFmt($){if(!$)return!1;return $=$.replace(/\[[^\]]*]/g,""),$=$.replace(/"[^"]*"/g,""),$.match(/[ymdhMsb]+/)!==null},fs:{exists($){return new Promise((Y)=>{s30.access($,s30.constants.F_OK,(U)=>{Y(!U)})})}},toIsoDateString($){return $.toIsoString().subsstr(0,10)},parseBoolean($){return $===!0||$==="true"||$===1||$==="1"}};t30.exports=a30});var lk=E((Gl1,$70)=>{class e30{constructor($){this._buf=Buffer.alloc($&&$.size||16384),this._encoding=$&&$.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){if(!this._buffer)this._buffer=Buffer.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length);return this._buffer}reset($){$=$||0,this._buffer=void 0,this._inPos=$}_grow($){let Y=this._buf.length*2;while(Y<$)Y*=2;let U=Buffer.alloc(Y);this._buf.copy(U,0),this._buf=U}addText($){this._buffer=void 0;let Y=this._inPos+this._buf.write($,this._inPos,this._encoding);while(Y>=this._buf.length-4)this._grow(this._inPos+$.length),Y=this._inPos+this._buf.write($,this._inPos,this._encoding);this._inPos=Y}addStringBuf($){if($.length){if(this._buffer=void 0,this.length+$.length>this.capacity)this._grow(this.length+$.length);$._buf.copy(this._buf,this._inPos,0,$.length),this._inPos+=$.length}}}$70.exports=e30});var SW=E((Hl1,K70)=>{var Ze0=v8(),Y70=V8(),qe0=lk();class U70{constructor($,Y){this._data=$,this._encoding=Y}get length(){return this.toBuffer().length}copy($,Y,U,z){return this.toBuffer().copy($,Y,U,z)}toBuffer(){if(!this._buffer)this._buffer=Buffer.from(this._data,this._encoding);return this._buffer}}class z70{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,U,z){return this._data._buf.copy($,Y,U,z)}toBuffer(){return this._data.toBuffer()}}class I70{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,U,z){this._data.copy($,Y,U,z)}toBuffer(){return this._data}}class Q70{constructor($){this.size=$,this.buffer=Buffer.alloc($),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let $=Buffer.alloc(this.iWrite-this.iRead);return this.buffer.copy($,0,this.iRead,this.iWrite),$}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read($){let Y;if($===0)return null;if($===void 0||$>=this.length)return Y=this.toBuffer(),this.iRead=this.iWrite,Y;return Y=Buffer.alloc($),this.buffer.copy(Y,0,this.iRead,$),this.iRead+=$,Y}write($,Y,U){let z=Math.min(U,this.size-this.iWrite);return $.copy(this.buffer,this.iWrite,Y,Y+z),this.iWrite+=z,z}}var J70=function($){$=$||{},this.bufSize=$.bufSize||1048576,this.buffers=[],this.batch=$.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};Y70.inherits(J70,Ze0.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return Buffer.concat(this.buffers.map(($)=>$.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let Y=this.buffers[this.buffers.length-1];if(!Y.full)return Y}let $=new Q70(this.bufSize);return this.buffers.push($),$},async _pipe($){let Y=function(U){return new Promise((z)=>{U.write($.toBuffer(),()=>{z()})})};await Promise.all(this.pipes.map(Y))},_writeToBuffers($){let Y=0,U=$.length;while(Y1)this._pipe(this.buffers.shift())}else if(!this.corked)await this._pipe(z),U();else this._writeToBuffers(z),process.nextTick(U);else{if(!this.paused)this.emit("data",z.toBuffer());this._writeToBuffers(z),this.emit("readable")}return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)while(this.buffers.length)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end($,Y,U){let z=(I)=>{if(I)U(I);else this._flush(),this.pipes.forEach((Q)=>{Q.end()}),this.emit("finish")};if($)this.write($,Y,z);else z()},read($){let Y;if($){Y=[];while($&&this.buffers.length&&!this.buffers[0].eod){let U=this.buffers[0],z=U.read($);if($-=z.length,Y.push(z),U.eod&&U.full)this.buffers.shift()}return Buffer.concat(Y)}return Y=this.buffers.map((U)=>U.toBuffer()).filter(Boolean),this.buffers=[],Buffer.concat(Y)},setEncoding($){this.encoding=$},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe($){if(this.pipes.push($),!this.paused&&this.buffers.length)this.end()},unpipe($){this.pipes=this.pipes.filter((Y)=>Y!==$)},unshift(){throw Error("Not Implemented")},wrap(){throw Error("Not Implemented")}});K70.exports=J70});var W70=E((Le0)=>{var G70=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:H70}=J0("buffer");function Ve0($){if(typeof $!=="string")return $;if(G70)return H70.from(G70.encode($).buffer);return H70.from($)}Le0.stringToBuffer=Ve0});var q70=E((Zl1,Z70)=>{var we0=J0("events"),Me0=Ak(),Oe0=SW(),{stringToBuffer:Xl1}=W70();class X70 extends we0.EventEmitter{constructor($){super();this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},$),this.zip=new Me0,this.stream=new Oe0}append($,Y){if(Y.hasOwnProperty("base64")&&Y.base64)this.zip.file(Y.name,$,{base64:!0});else this.zip.file(Y.name,$)}async finalize(){let $=await this.zip.generateAsync(this.options);this.stream.end($),this.emit("finish")}read($){return this.stream.read($)}setEncoding($){return this.stream.setEncoding($)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe($,Y){return this.stream.pipe($,Y)}unpipe($){return this.stream.unpipe($)}unshift($){return this.stream.unshift($)}wrap($){return this.stream.wrap($)}}Z70.exports={ZipWriter:X70}});var r6=E((ql1,F70)=>{var Ne0=$6(),V70=V8();function L70($,Y,U){$.push(` ${Y}="${V70.xmlEncode(U.toString())}"`)}function ok($,Y){if(Y){let U=[];Ne0.each(Y,(z,I)=>{if(z!==void 0)L70(U,I,z)}),$.push(U.join(""))}}class rk{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml($){let Y=this._xml;Y.push(" `)}openNode($,Y){let U=this.tos,z=this._xml;if(U&&this.open)z.push(">");this._stack.push($),z.push("<"),z.push($),ok(z,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)L70(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");ok(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(V70.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("");this.open=!1,this.leaf=!1}leafNode($,Y,U){if(this.openNode($,Y),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("")}}rk.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};F70.exports=rk});var sk=E((Ae0)=>{var w70=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function De0($){if(typeof $==="string")return $;if(w70)return w70.decode($);return $.toString()}Ae0.bufferToString=De0});var A70=E((O70)=>{Object.defineProperty(O70,"__esModule",{value:!0});O70.CHAR=` \r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;O70.S=` \r @@ -954,7 +954,7 @@ or add '--force' (or use 'seal-use webhook replay --force') if you ex `+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${I.id}`);let q=Z[0];if(q&&Z.length===1&&W){let V=q.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${V})`),await x0("seal_deploy_hosecloud_sync",z,I,{signKey:V},j0(Q.options));return}console.error(`Usage: seal-use deploy hosecloud sync [--corp ${I.id}] `),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of Z){let w=V.outboundName??"SealAI 审批",M=V.signKey,F=V.apiOrigin??"production";console.error(` • "${w}" (signKey: ${M}, 环境: ${F})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${M} --corp ${I.id} `)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${I.id} -`);throw new W4("缺少必需参数 。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${I.id}`:void 0)}await x0("seal_deploy_hosecloud_sync",z,I,{signKey:H},j0(Q.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var TS0=m(()=>{O4();Z4();m1();X6();O8()});var ES0='---\nname: seal-use\ndescription: "v0.10.37: Use for Seal Use enterprise onboarding, Hose/合思 or Seal-native authentication, approval operations, diagnosis, simulation, rules, users, configuration, and search."\nmetadata:\n version: 0.10.37\n short-description: Seal tenant and Hose approval automation (v0.10.37)\n---\n\n# Seal Use\n\nCLI 是主执行通道。机器通道 `stdout` 必须是纯 JSON;诊断日志、进度和下一步建议写入 `stderr`。MCP 默认关闭。\n\n## 时间与输出\n\n- 机器字段保留 ISO 8601 UTC,精确到秒,不要添加毫秒,例如 `2026-09-22T04:56:06Z`。\n- 面向用户解释时间时,换算为 `Asia/Shanghai`,明确标注“北京时间”;审计或消歧时同时保留原始 UTC。\n- 不向用户暴露 Bearer、`accessToken`、`closeToken`、`appSecurity`、原始 cURL 或未脱敏手机号。\n- 不向用户直接暴露底层 UUID、`tenantSlug`、`boundCorpRole` 等内部字段;优先使用企业名称、规则编号 `#xxxx` 和脱敏后的业务信息。\n\n## 企业接入:先识别材料,再选择入口\n\n最终企业来源只有两种:`source.type: "seal"` 和 `source.type: "hose"`。不要把材料格式、认证凭据和最终来源混为一谈。\n\n| 用户材料 | 标准入口 | 最终配置形态 |\n| --- | --- | --- |\n| Hose 开放平台 `appKey + appSecurity` | `corps add-hose-persistent` | Hose 持久化凭据 |\n| Seal URL + Bearer,或 Seal 页面 cURL | `corps add-seal-bearer` | Seal Bearer 会话 |\n| Seal 原生委托链接 | `corps add-link ` | Seal 委托会话 |\n| Hose 协助链接 | `corps add-link ` | Hose Web Session;加 `--elevate-hose` 才提取长期密钥 |\n| Hose 页面 cURL | 先提取密钥;失败时 `corps add-hose-web-session` | Hose 持久化或 Hose Web Session |\n| 已规范化的 Hose `corpId + accessToken + baseUrl` | `corps add-hose-web-session` | Hose Web Session |\n\n### 凭据边界\n\n- Seal Bearer 只能给 `add-seal-bearer`;Hose `accessToken/accesstoken/closeToken` 不能直接当作 Seal Bearer。\n- Hose Web Session 保存 `closeToken + staffId`,需要调用 Seal 时才通过 SSO 换取运行时 Seal Bearer。\n- Hose 持久化配置保存 `appKey + appSecurity`,适合无人值守、部署和长期同步。\n- 会话有有效期时,Hose source 保存 `expiresIn` 和 UTC 秒级 `expiresAt`。\n- `add-link` 是 URL 混合入口,不接收 cURL:自动识别 Seal 委托链接和 Hose 协助链接。\n- `--elevate-hose` 是唯一明确的 Hose 提权动作。\n\n收到 Hose 管理员 cURL 时,按 Hose 协助链接处理:解析主机、`accesstoken`、企业标识和必要会话信息,优先调用密钥提取路径;无法提取长期密钥时才保存 Web Session。收到 Seal cURL 时,提取 Seal 主机和 `Authorization: Bearer`,走 `add-seal-bearer`。不要盲目执行 cURL,也不要把原文写入文件或日志。\n\n详细来源决策、提权边界和 cURL 处理见 `references/enterprise-onboarding.md`;首次找材料时必须使用 `references/first-time-user.md`。\n\n## 首次接入图文规则\n\n当用户首次接入、询问如何取得材料,或需要用户打开后台找凭据时:\n\n1. 先确认用户手上是 Hose 开放平台凭据、协助链接、Seal 委托链接,还是已登录网页 cURL。\n2. 读取 `references/first-time-user.md`,只渲染与当前路径对应的截图;不能只给纯文字步骤。\n3. 接收材料后由 Agent 自动发现企业、域名和管理员。除非自动发现失败,不要要求用户先填写 `corpId`、`staffId` 或域名。\n\n## `corps` 主线\n\n- 接入:`add-link`、`add-seal-bearer`、`add-hose-persistent`、`add-hose-web-session`\n- 发现:`list`、`search`/`find`、`get`/`show`、`current`、`switch`\n- 维护:`mark`、`rename`\n- 测试闭环:`bind-test`、`unbind-test`、`sync-test`、`replay-test`\n- Hose 专属:`probe-hose`、`hose-staffs`、`hose-extract-keys`、`hose-keys`\n\nHose 专属命令应从命令名或选项中明确可见:`auth hose-*`、`approval-runs hose-flow`、`deploy hosecloud`、`simulation --mode hosecloud`。跨来源入口只有在明确使用 `--elevate-hose`、`--with-flow` 或 `--type hose-document` 时才启用对应 Hose 能力。\n\n生产规则变更遵循:生产改草稿 → 同步测试 → 模拟/回归验证 → 用户确认 → 生产发布。`sync-test`、`replay-test`、规则发布和清空等高风险操作优先 `--dry-run`,正式执行必须显式 `--yes` 或 `--confirm`。\n\n## 业务术语契约\n\n对外统一使用以下术语:\n\n| 字段 | 对外术语 |\n| --- | --- |\n| `scope` | 适用场景 |\n| `strictness` | 遵守程度 |\n| `MUST_FOLLOW` / `SHOULD_FOLLOW` / `SUGGESTION` | 必须遵守 / 建议遵守 / 提示参考 |\n| `code` | 规则编号,例如 `#0038` |\n| `status` | 启用状态:已启用 / 已停用 / 草稿 |\n| `description` | 规则内容 / 审核要求 |\n\n不要自创同义词,也不要把内部字段名直接当作用户术语。\n\n## 参考文档路由\n\n先按用户意图选择一个主 reference;不要因为关键词命中就同时加载多个文档。只有“追加条件”明确成立时,才按“主文档 → 辅助文档”的顺序继续读取。\n\n| 用户信号 / 任务 | 主 reference | 追加条件 |\n| --- | --- | --- |\n| 第一次接入、不会找凭据、需要截图 | `references/first-time-user.md` | 用户交付材料后,再读 `enterprise-onboarding.md` 做来源决策 |\n| 判断材料来源、Token 边界、cURL、Hose 提权 | `references/enterprise-onboarding.md` | 需要具体域名/员工探测时,再读 `hose-enterprise-init.md` |\n| Hose 登录检查、认证失败、生成授权链接 | `references/hose-enterprise-auth.md` | 需要重新接入或判断材料类型时,先读 `enterprise-onboarding.md` |\n| Hose 域名探测、角色/员工发现、管理员选择 | `references/hose-enterprise-init.md` | 不要先加载部署或规则文档 |\n| 配置、同步或排查发布到 HoseCloud | `references/hose-enterprise-deploy.md` | 涉及生产/测试配对或模拟时,再读 `staging-simulation-workflow.md` |\n| 生产草稿、测试同步、模拟、回归、发布 | `references/staging-simulation-workflow.md` | 需要客诉证据定界时,再读 `customer-feedback-rule-remediation.md` |\n| 按单号、SN、record ID 查审批、结论、引用规则或直达链接 | `references/approval-run-lightweight.md` | 明确涉及附件/OCR/发票争议时,转读 `approval-attachment-trace.md` |\n| CLI 参数、退出码、Webhook 资源包或命令语法 | `references/cli.md` | 只查业务流程时不要加载本文件 |\n| 规则数量、摘要列表、历史规则或知识搜索 | `references/rule-lightweight.md` | 需要质量评分/模糊表述检查时,改读 `rule-lint.md` |\n| 规则质量评分、lint、发布前质检 | `references/rule-lint.md` | 不要把 lint 问题直接当成客诉根因 |\n| 客诉、截图/通知、预期业务行为,并要求诊断或修改规则 | `references/customer-feedback-rule-remediation.md` | 只有该流程明确要求附件追踪或测试发布时,才追加对应 reference |\n| 附件、发票、收据、OCR 或界面高亮结论争议 | `references/approval-attachment-trace.md` | 先完成追踪和归因后,才读 `approval-bad-cases.md` 做案例对照 |\n| 已完成当前追踪后的相似坏案例对照 | `references/approval-bad-cases.md` | 不能作为首次诊断入口 |\n\n冲突时遵循三条优先级:材料获取先于来源判断;来源判断先于 Hose 具体探测;审批事实追踪先于坏案例类比。跨阶段请求也要按阶段顺序读取,不能用后置 reference 替代前置 reference。\n';var jS0=()=>{};var RS0=`interface: +`);throw new W4("缺少必需参数 。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${I.id}`:void 0)}await x0("seal_deploy_hosecloud_sync",z,I,{signKey:H},j0(Q.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var TS0=m(()=>{O4();Z4();m1();X6();O8()});var ES0='---\nname: seal-use\ndescription: "v0.10.38: Use for Seal Use enterprise onboarding, Hose/合思 or Seal-native authentication, approval operations, diagnosis, simulation, rules, users, configuration, and search."\nmetadata:\n version: 0.10.38\n short-description: Seal tenant and Hose approval automation (v0.10.38)\n---\n\n# Seal Use\n\nCLI 是主执行通道。机器通道 `stdout` 必须是纯 JSON;诊断日志、进度和下一步建议写入 `stderr`。MCP 默认关闭。\n\n## 时间与输出\n\n- 机器字段保留 ISO 8601 UTC,精确到秒,不要添加毫秒,例如 `2026-09-22T04:56:06Z`。\n- 面向用户解释时间时,换算为 `Asia/Shanghai`,明确标注“北京时间”;审计或消歧时同时保留原始 UTC。\n- 不向用户暴露 Bearer、`accessToken`、`closeToken`、`appSecurity`、原始 cURL 或未脱敏手机号。\n- 不向用户直接暴露底层 UUID、`tenantSlug`、`boundCorpRole` 等内部字段;优先使用企业名称、规则编号 `#xxxx` 和脱敏后的业务信息。\n\n## 企业接入:先识别材料,再选择入口\n\n最终企业来源只有两种:`source.type: "seal"` 和 `source.type: "hose"`。不要把材料格式、认证凭据和最终来源混为一谈。\n\n| 用户材料 | 标准入口 | 最终配置形态 |\n| --- | --- | --- |\n| Hose 开放平台 `appKey + appSecurity` | `corps add-hose-persistent` | Hose 持久化凭据 |\n| Seal URL + Bearer,或 Seal 页面 cURL | `corps add-seal-bearer` | Seal Bearer 会话 |\n| Seal 原生委托链接 | `corps add-link ` | Seal 委托会话 |\n| Hose 协助链接 | `corps add-link ` | Hose Web Session;加 `--elevate-hose` 才提取长期密钥 |\n| Hose 页面 cURL | 先提取密钥;失败时 `corps add-hose-web-session` | Hose 持久化或 Hose Web Session |\n| 已规范化的 Hose `corpId + accessToken + baseUrl` | `corps add-hose-web-session` | Hose Web Session |\n\n### 凭据边界\n\n- Seal Bearer 只能给 `add-seal-bearer`;Hose `accessToken/accesstoken/closeToken` 不能直接当作 Seal Bearer。\n- Hose Web Session 保存 `closeToken + staffId`,需要调用 Seal 时才通过 SSO 换取运行时 Seal Bearer。\n- Hose 持久化配置保存 `appKey + appSecurity`,适合无人值守、部署和长期同步。\n- 会话有有效期时,Hose source 保存 `expiresIn` 和 UTC 秒级 `expiresAt`。\n- `add-link` 是 URL 混合入口,不接收 cURL:自动识别 Seal 委托链接和 Hose 协助链接。\n- `--elevate-hose` 是唯一明确的 Hose 提权动作。\n\n收到 Hose 管理员 cURL 时,按 Hose 协助链接处理:解析主机、`accesstoken`、企业标识和必要会话信息,优先调用密钥提取路径;无法提取长期密钥时才保存 Web Session。收到 Seal cURL 时,提取 Seal 主机和 `Authorization: Bearer`,走 `add-seal-bearer`。不要盲目执行 cURL,也不要把原文写入文件或日志。\n\n详细来源决策、提权边界和 cURL 处理见 `references/enterprise-onboarding.md`;首次找材料时必须使用 `references/first-time-user.md`。\n\n## 首次接入图文规则\n\n当用户首次接入、询问如何取得材料,或需要用户打开后台找凭据时:\n\n1. 先确认用户手上是 Hose 开放平台凭据、协助链接、Seal 委托链接,还是已登录网页 cURL。\n2. 读取 `references/first-time-user.md`,只渲染与当前路径对应的截图;不能只给纯文字步骤。\n3. 接收材料后由 Agent 自动发现企业、域名和管理员。除非自动发现失败,不要要求用户先填写 `corpId`、`staffId` 或域名。\n\n## `corps` 主线\n\n- 接入:`add-link`、`add-seal-bearer`、`add-hose-persistent`、`add-hose-web-session`\n- 发现:`list`、`search`/`find`、`get`/`show`、`current`、`switch`\n- 维护:`mark`、`rename`\n- 测试闭环:`bind-test`、`unbind-test`、`sync-test`、`replay-test`\n- Hose 专属:`probe-hose`、`hose-staffs`、`hose-extract-keys`、`hose-keys`\n\nHose 专属命令应从命令名或选项中明确可见:`auth hose-*`、`approval-runs hose-flow`、`deploy hosecloud`、`simulation --mode hosecloud`。跨来源入口只有在明确使用 `--elevate-hose`、`--with-flow` 或 `--type hose-document` 时才启用对应 Hose 能力。\n\n生产规则变更遵循:生产改草稿 → 同步测试 → 模拟/回归验证 → 用户确认 → 生产发布。`sync-test`、`replay-test`、规则发布和清空等高风险操作优先 `--dry-run`,正式执行必须显式 `--yes` 或 `--confirm`。\n\n## 业务术语契约\n\n对外统一使用以下术语:\n\n| 字段 | 对外术语 |\n| --- | --- |\n| `scope` | 适用场景 |\n| `strictness` | 遵守程度 |\n| `MUST_FOLLOW` / `SHOULD_FOLLOW` / `SUGGESTION` | 必须遵守 / 建议遵守 / 提示参考 |\n| `code` | 规则编号,例如 `#0038` |\n| `status` | 启用状态:已启用 / 已停用 / 草稿 |\n| `description` | 规则内容 / 审核要求 |\n\n不要自创同义词,也不要把内部字段名直接当作用户术语。\n\n## 参考文档路由\n\n先按用户意图选择一个主 reference;不要因为关键词命中就同时加载多个文档。只有“追加条件”明确成立时,才按“主文档 → 辅助文档”的顺序继续读取。\n\n| 用户信号 / 任务 | 主 reference | 追加条件 |\n| --- | --- | --- |\n| 第一次接入、不会找凭据、需要截图 | `references/first-time-user.md` | 用户交付材料后,再读 `enterprise-onboarding.md` 做来源决策 |\n| 判断材料来源、Token 边界、cURL、Hose 提权 | `references/enterprise-onboarding.md` | 需要具体域名/员工探测时,再读 `hose-enterprise-init.md` |\n| Hose 登录检查、认证失败、生成授权链接 | `references/hose-enterprise-auth.md` | 需要重新接入或判断材料类型时,先读 `enterprise-onboarding.md` |\n| Hose 域名探测、角色/员工发现、管理员选择 | `references/hose-enterprise-init.md` | 不要先加载部署或规则文档 |\n| 配置、同步或排查发布到 HoseCloud | `references/hose-enterprise-deploy.md` | 涉及生产/测试配对或模拟时,再读 `staging-simulation-workflow.md` |\n| 生产草稿、测试同步、模拟、回归、发布 | `references/staging-simulation-workflow.md` | 需要客诉证据定界时,再读 `customer-feedback-rule-remediation.md` |\n| 按单号、SN、record ID 查审批、结论、引用规则或直达链接 | `references/approval-run-lightweight.md` | 明确涉及附件/OCR/发票争议时,转读 `approval-attachment-trace.md` |\n| CLI 参数、退出码、Webhook 资源包或命令语法 | `references/cli.md` | 只查业务流程时不要加载本文件 |\n| 规则数量、摘要列表、历史规则或知识搜索 | `references/rule-lightweight.md` | 需要质量评分/模糊表述检查时,改读 `rule-lint.md` |\n| 规则质量评分、lint、发布前质检 | `references/rule-lint.md` | 不要把 lint 问题直接当成客诉根因 |\n| 客诉、截图/通知、预期业务行为,并要求诊断或修改规则 | `references/customer-feedback-rule-remediation.md` | 只有该流程明确要求附件追踪或测试发布时,才追加对应 reference |\n| 附件、发票、收据、OCR 或界面高亮结论争议 | `references/approval-attachment-trace.md` | 先完成追踪和归因后,才读 `approval-bad-cases.md` 做案例对照 |\n| 已完成当前追踪后的相似坏案例对照 | `references/approval-bad-cases.md` | 不能作为首次诊断入口 |\n\n冲突时遵循三条优先级:材料获取先于来源判断;来源判断先于 Hose 具体探测;审批事实追踪先于坏案例类比。跨阶段请求也要按阶段顺序读取,不能用后置 reference 替代前置 reference。\n';var jS0=()=>{};var RS0=`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." @@ -2401,7 +2401,7 @@ ${io.map(($)=>`### \`seal-use ${$.domain}\` `}var uo,bo,io;var co=m(()=>{uo=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;旧版 seal-home 命令仅保留解析兼容,不再新建全局别名。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],bo=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],io=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search ","corps get ","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、单据直达链接与免登",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs link"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材料包导入、飞书/泛微三方审批定义演练、批次轮询等待与数据清理",primaryCommands:["simulation create","simulation status","simulation wait","simulation clean"]},{domain:"webhook (通道与重放)",summary:"Webhook 回调通道配置、材料包校验推送、线上单据向 Webhook 通道测试重放",primaryCommands:["webhook list","webhook add","webhook replay","webhook material-pack push"]},{domain:"deploy (费控集成)",summary:"Seal AI 智能审核能力发布到合思费控企业、对接要求检测与配置同步",primaryCommands:["deploy hosecloud requirements","deploy hosecloud status","deploy hosecloud sync"]},{domain:"doctor (系统诊断)",summary:"整机环境健康自检、目录全景体检看板、内置架构与规范白皮书离线查阅",primaryCommands:["doctor","doctor guide","doctor paths"]}]});import{accessSync as Kk1,constants as Gk1,existsSync as n6,readdirSync as Bg0,statSync as Hk1}from"node:fs";import{homedir as Wk1}from"node:os";import{join as v5}from"node:path";function Dg0($){if(!n6($))return 0;try{return Bg0($).filter((Y)=>Y.endsWith(".json")).length}catch{return 0}}function Yj($){try{return Kk1($,Gk1.W_OK),!0}catch{return!1}}function Ag0($){if(!n6($))return[];try{return Bg0($).filter((Y)=>Y.endsWith(".json")&&!Y.startsWith("example.")).map((Y)=>v5($,Y))}catch{return[]}}function Xk1($){return $.filter((Y)=>{try{return(Hk1(Y).mode&63)!==0}catch{return!1}})}function no(){let $=Wk1(),Y=v5($,".config","seal-use"),U=v5(Y,"enterprises"),z=v5(Y,"config.json"),I=v5(Y,"seal_tokens.json"),Q=v5(Y,"mappings"),J=iz(),K=v5($,"Downloads"),H=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",v5($,".local","bin","seal-use"),v5($,"bin","seal-use")].find((A)=>n6(A))??process.execPath,W={configDir:{name:"配置根目录",path:Y,exists:n6(Y),writable:n6(Y)?Yj(Y):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:U,exists:n6(U),writable:n6(U)?Yj(U):!1,fileCount:Dg0(U),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:z,exists:n6(z),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:I,exists:n6(I),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Q,exists:n6(Q),fileCount:Dg0(Q),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:n6(v5(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:K,exists:n6(K),writable:n6(K)?Yj(K):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:n$,exists:n6(n$),writable:n6(n$)?Yj(n$):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:p$,exists:n6(p$),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:H,exists:n6(H),description:"系统全局命令执行入口"}},X=[];try{X=t8()}catch{X=[]}let Z=v4(),q=Z.defaultCorpId??X[0]?.id,V=X.find((A)=>A.id===q),w=X.filter((A)=>(A.environment??"production").toLowerCase()==="test").length,M=X.length-w,F=[];if(F.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),W.configDir?.exists&&W.configDir.writable)F.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${Y} (正常读写)`});else if(W.configDir?.exists)F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${Y} (存在但可能不可写)`});else F.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${Y},首次运行配置命令时将自动创建`});if(X.length>0)F.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${X.length} 家企业 (正式: ${M}, 测试: ${w})`});else F.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose-persistent、add-hose-web-session 或 add-seal-bearer 接入企业"});if(W.agentSkillDir?.exists)F.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else F.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let N=[I,z,gZ(),...Ag0(U),...Ag0(v5(process.cwd(),"enterprises"))].filter((A,j,C)=>C.indexOf(A)===j&&n6(A)),O=Xk1(N);F.push({id:"credential_permissions",title:"凭据文件权限",status:O.length===0?"ok":"warn",message:O.length===0?`已检查 ${N.length} 个凭据文件,均为仅属主可读 (0600)`:`${O.length} 个凭据文件权限宽于 0600(同机其他用户可读,取决于父目录权限),建议 chmod 600:${O.join("、")}`});let D=Z.lint??{enabled:!1,activeLinter:"builtin",minScore:0};if(D.enabled)F.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:`已开启 (校验器: ${D.activeLinter}, 最低门槛分: ${D.minScore})`});else F.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:"未开启 (默认关闭,可运行 seal-use config lint enable 开启)"});let P=F.some((A)=>A.status==="warn"||A.status==="error"),T=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:P?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:X1,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:T},directories:W,enterprises:{total:X.length,productionCount:M,testCount:w,activeCorpId:V?.id,activeCorpName:V?.name},checks:F,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:uo.length,securityPoliciesCount:bo.length,domainCapabilitiesCount:io.length,guideCommand:"seal-use doctor guide"}}}function Pg0($){let Y=[],U=$.doctor==="ok"?"✨":"⚠️";Y.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${U}`),Y.push("─────────────────────────────────────────────────────────────"),Y.push("【运行环境】"),Y.push(` 版本号: ${$.runtime.version}`),Y.push(` 程序路径: ${$.runtime.executablePath}`),Y.push(` 操作系统: ${$.runtime.platform}`),Y.push(` 执行引擎: ${$.runtime.engine}`),Y.push(""),Y.push("【核心路径状态】");for(let[,I]of Object.entries($.directories)){let Q=I.exists?"✓":"○",J=I.exists?I.fileCount!==void 0?`(${I.fileCount} 个文件)`:I.writable?"(就绪/可写)":"(存在)":"(未创建)";Y.push(` ${Q} ${I.name.padEnd(16," ")}: ${I.path} ${J}`)}if(Y.push(""),Y.push("【企业资产概览】"),Y.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)Y.push(` 当前激活企业: ${$.enterprises.activeCorpName} (${$.enterprises.activeCorpId})`);else Y.push(" 当前激活企业: 无默认企业 (无状态模式)");Y.push(""),Y.push("【健康自检】");for(let I of $.checks){let Q=I.status==="ok"?"✓":I.status==="warn"?"⚠️":"✗";Y.push(` ${Q} [${I.title}]: ${I.message}`)}Y.push(""),Y.push("─────────────────────────────────────────────────────────────"),Y.push("\uD83D\uDC49 查阅内嵌白皮书与目录规范: seal-use doctor guide"),Y.push("\uD83D\uDC49 检索企业: seal-use corps search ");let z=$.checks.find((I)=>I.id==="rule_linter");if(z&&z.message.includes("未开启"))Y.push("\uD83D\uDC49 开启规则自动质量校验: seal-use config lint enable");return Y.join(` `)}var Tg0=m(()=>{ip();z3();T5();iq();UP();co()});var jg0={};T8(jg0,{formatTenantDoctorDashboard:()=>qk1,diagnoseTenantContract:()=>Zk1});async function Zk1($,Y){let U=[],z=Y.environment==="test"?"test":"production",I=z==="test"?Y.prodCorpId:Y.testCorpId,Q=z==="test"?"prodParent":"testTarget",J=I?z==="test"?"已绑定生产母企业 (上游配置与样本源)":"已绑定测试靶场 (下游隔离演练环境)":void 0,K=null,G=null;try{let F=await Z8($);if(K=F.user,G=F.tenant,Boolean(K?.isAdmin||K?.permissions?.includes("*")))U.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${K.name??"未知"}」(${K.id??""}),具备完整操作权限`,details:{userId:K.id,userName:K.name,isAdmin:!0,permissionLevel:"超级管理员(具备完整操作权限)",tenantName:G?.name,tenantSlug:G?.tenantSlug,permissions:K.permissions}});else U.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${K.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:K.id,userName:K.name,isAdmin:!1,permissionLevel:"普通用户(部分管理配置受限)",tenantName:G?.name,permissions:K.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(F){U.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${F instanceof Error?F.message:String(F)}`,details:{error:String(F)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let H={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},W={used:0,remaining:0};try{let F=await lY($),N=Array.isArray(F.features)?F.features:[],O=N.find((P)=>P?.code==="ai-approval");if(O){let P=typeof O.balance==="number"?O.balance:0,T=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,A=Math.floor(P/T);if(H.balance=P,H.deductionAmount=T,H.estimatedRuns=A,P<=0)H.status="exhausted",U.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`请前往后台充值补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else if(A<10)H.status="low",U.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${P} 点 (单笔扣除 ${T} 点),仅可支持约 ${A} 笔审核`,details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`建议补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else H.status="sufficient",U.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${P} 点,预估可支持 ${A} 笔审核单据`,details:{balance:P,deductionAmount:T,estimatedRuns:A}})}else U.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:N.map((P)=>P?.code)}});let D=N.find((P)=>P?.code==="approval-rules");if(D)W.used=typeof D.used==="number"?D.used:0,W.remaining=typeof D.remaining==="number"?D.remaining:0}catch(F){U.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${F instanceof Error?F.message:String(F)}`,details:{error:String(F)}})}let X={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let F=await W6($),N=Array.isArray(F.rules)?F.rules:[];if(X.totalCount=N.length,X.activeCount=N.filter((O)=>O.status==="ACTIVE").length,N.length===0)U.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:z==="test"&&I?`可运行 seal-use corps sync-test --corp ${I} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else U.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${X.totalCount} 条规则,其中生效活跃 ${X.activeCount} 条`,details:{totalCount:X.totalCount,activeCount:X.activeCount,quotaUsed:W.used,quotaRemaining:W.remaining}})}catch(F){U.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${F instanceof Error?F.message:String(F)}`,details:{error:String(F)}})}let Z={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let F=await K$($);Z.integrationCount=F.length;let N=F.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(Z.hasReplayChannel=Boolean(N),Z.activeWebhookId=N?.id??F[0]?.id,F.length===0)U.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:"未配置任何 Webhook 集成通道 (日常审批无影响;若需自动化系统推流或单据重放将自动创建)",details:{integrationCount:0}});else U.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${F.length} 个通道${N?` (含专属回放通道「${N.name}」)`:""}`,details:{integrationCount:F.length,hasReplayChannel:Z.hasReplayChannel,activeWebhookId:Z.activeWebhookId}})}catch(F){U.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:`检测 Webhook 通道失败:${F instanceof Error?F.message:String(F)}`,details:{error:String(F)}})}if(z==="test")if(I)U.push({id:"environment_binding",name:"测试环境配对契约",status:"pass",summary:`测试租户已绑定生产母企业「${I}」,具备样本拉取与配置同步能力`,details:{environment:z,boundCorpId:I,boundCorpRole:Q,boundCorpRoleDescription:J}});else U.push({id:"environment_binding",name:"测试环境配对契约",status:"warn",summary:"测试租户尚未绑定对应的生产母企业,无法直接拉取生产样本执行自动化回归",details:{environment:z},recommendation:`可运行 seal-use corps bind-test ${Y.id} 建立 1 对 1 绑定`});else if(I)U.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"pass",summary:`生产企业已绑定沙箱测试靶场「${I}」,回归测试将严格限制在靶场中运行`,details:{environment:z,boundCorpId:I,boundCorpRole:Q,boundCorpRoleDescription:J}});else U.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"warn",summary:"生产企业尚未绑定任何测试企业,所有回归测试功能将触发安全拦截",details:{environment:z},recommendation:`可运行 seal-use corps bind-test ${Y.id} 为该生产租户绑定测试靶场`});let q=U.filter((F)=>F.status==="fail").length,V=U.filter((F)=>F.status==="warn").length,w=U.filter((F)=>F.status==="pass").length,M="HEALTHY";if(q>0)M="BLOCKED";else if(V>0)M="DEGRADED";return{ok:q===0,verdict:M,timestamp:new Date().toISOString(),corp:{id:Y.id,name:Y.name,environment:z,sourceType:Y.source?.type??"native",boundCorpId:I,boundCorpRole:Q,boundCorpRoleDescription:J},summary:{totalChecks:U.length,passedChecks:w,warningChecks:V,failedChecks:q},checks:U,quota:H,rules:X,webhooks:Z}}function qk1($){let{corp:Y,verdict:U,summary:z,checks:I,quota:Q,rules:J,webhooks:K}=$,G=U==="HEALTHY"?"\uD83D\uDFE2 健康良好 (HEALTHY)":U==="DEGRADED"?"\uD83D\uDFE1 亚健康降级 (DEGRADED)":"\uD83D\uDD34 阻断受限 (BLOCKED)",H=["",`\uD83C\uDFE5 [Seal Use Doctor] 租户全链路契约体检: ${Y.name} (${Y.id})`,` 状态: ${G} · 环境: ${Y.environment.toUpperCase()} · 耗时: 实时探针`," "+"─".repeat(60)];if(H.push(` AI 审批余量: ${Q.balance} 点 (可审约 ${Q.estimatedRuns} 笔) | 规则数: ${J.activeCount}/${J.totalCount} | Webhook 通道: ${K.integrationCount}`),Y.boundCorpId)H.push(` 配对关系: ${Y.environment==="test"?"来源生产母企业":"绑定的测试靶场"} -> 「${Y.boundCorpId}」`);H.push(" "+"─".repeat(60));for(let W of I){let X=W.status==="pass"?"✓":W.status==="warn"?"!":"✗";if(H.push(` [${X}] ${W.name}: ${W.summary}`),W.recommendation)H.push(` \uD83D\uDC49 建议: ${W.recommendation}`)}if(H.push(" "+"─".repeat(60)),H.push(` 检查汇总: 通过 ${z.passedChecks} · 告警 ${z.warningChecks} · 失败 ${z.failedChecks}`),Q.status==="exhausted"||Q.status==="low")H.push(` \uD83D\uDC49 Next action: seal-use auth link --corp ${Y.id}`);return H.push(""),H.join(` `)}var Eg0=m(()=>{X6()});async function Cg0($,Y,U){let z=($??Y??"").toLowerCase();if(z==="guide"||z==="doc"||z==="knowledge"||z==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)... -`),console.log(Ng0());return}if(z==="paths"||z==="dirs"||z==="directories"){let J=no();R0(J.directories);return}if(z==="auth"){let{selectCorp:J}=await Promise.resolve().then(() => (O4(),Yo)),{stringOption:K}=await Promise.resolve().then(() => (Z4(),tl)),{handleAuthCommand:G}=await Promise.resolve().then(() => (jo(),qS0)),H=K(U.options.corp)??(Y&&Y!==z?Y:void 0)??(U.command[2]&&U.command[2]!==z?U.command[2]:void 0),W=J(H);await G("check",W,U);return}if(z==="tenant"||z==="corp"||z==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (O4(),Yo)),{createSealClient:K}=await Promise.resolve().then(() => (m6(),H10)),{stringOption:G}=await Promise.resolve().then(() => (Z4(),tl)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (Eg0(),jg0)),X=G(U.options.corp)??(Y&&Y!==z?Y:void 0)??(U.command[2]&&U.command[2]!==z?U.command[2]:void 0),Z=J(X),q=await K(Z),V=await H(q,Z);if(!(G0(U.options.quiet)||G0(U.options.silent)))console.error(W(V));R0(V);return}let I=no();if(!(G0(U.options.quiet)||G0(U.options.silent)))console.error(Pg0(I));R0(I)}var Rg0=m(()=>{Tg0();co();Z4();m1()});var vg0;var _g0=m(()=>{vg0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.37",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local 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","x-implementation-status":"planned",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","x-implementation-status":"implemented",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","x-implementation-status":"implemented",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:{"200":{description:"Current session metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}}}}},"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/approval/context":{get:{tags:["Approval Knowledge"],operationId:"getApprovalContext","x-implementation-status":"planned",summary:"Get rules, documents, and style preferences together",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."},{name:"documentLimit",in:"query",schema:{type:"integer",minimum:1}},{name:"latestRuleVersion",in:"query",schema:{type:"boolean"}},{name:"ruleVersionNumber",in:"query",schema:{type:"integer"}}],responses:{"200":{description:"Approval context.",content:{"application/json":{schema:{type:"object",required:["rules","documents","stylePreferences"],properties:{rules:{},documents:{},stylePreferences:{}}}}}}}}},"/v1/approval/search":{post:{tags:["Approval Knowledge"],operationId:"searchApprovalKnowledge","x-implementation-status":"planned",summary:"Search approval rules, documents, and preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["keywords"],properties:{keywords:{type:"array",minItems:1,items:{type:"string"}},matchMode:{type:"string",enum:["any","all"]},areas:{type:"array",items:{type:"string",enum:["rules","documents","preferences"]}},maxResults:{type:"integer"}}}}}},responses:{"200":{description:"Search results with line context.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rules":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRules","x-implementation-status":"implemented",summary:"List current draft approval rules",responses:{"200":{description:"Draft rules.",content:{"application/json":{schema:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalRule","x-implementation-status":"planned",summary:"Create draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Created rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}}},"/v1/approval/rules/{ruleId}":{parameters:[{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."}],patch:{tags:["Approval Knowledge"],operationId:"updateApprovalRule","x-implementation-status":"planned",summary:"Update draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Updated rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalRule","x-implementation-status":"planned",summary:"Delete draft approval rule",responses:{"200":{description:"Deleted."}}}},"/v1/approval/rule-versions":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRuleVersions","x-implementation-status":"planned",summary:"List published approval rule versions",responses:{"200":{description:"Published rule versions.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}}},"/v1/approval/rule-versions/{versionId}":{parameters:[{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleVersion","x-implementation-status":"planned",summary:"Get published approval rule version",responses:{"200":{description:"Rule version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval/rules/by-version":{get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleByVersion","x-implementation-status":"planned",summary:"Get one wrapped rule from a published version",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."},{name:"versionNumber",in:"query",schema:{type:"integer"}},{name:"versionId",in:"query",schema:{type:"string"}},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"code",in:"query",schema:{type:"string"},description:"Display rule code such as '#0038'."},{name:"runtimeId",in:"query",schema:{type:"string"},description:"Runtime rule ID such as rule-205."},{name:"recordId",in:"query",schema:{type:"string"},description:"Infer versionNumber from an approval run."}],responses:{"200":{description:"One rule from a published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rule-versions/publish":{post:{tags:["Approval Knowledge"],operationId:"publishApprovalRuleVersion","x-implementation-status":"planned",summary:"Publish current draft rules",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}}}}},responses:{"200":{description:"Published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/documents":{get:{tags:["Approval Knowledge"],operationId:"listApprovalDocuments","x-implementation-status":"planned",summary:"List approval knowledge documents",parameters:[{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,default:20}},{name:"scenario",in:"query",schema:{type:"array",items:{type:"string"}},style:"form",explode:!0}],responses:{"200":{description:"Documents.",content:{"application/json":{schema:{type:"object",required:["articles"],properties:{articles:{type:"array",items:{$ref:"#/components/schemas/ApprovalDocument"}},total:{type:"integer"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalDocument","x-implementation-status":"planned",summary:"Create approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["title","purpose","content"],properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Created document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}}},"/v1/approval/documents/{documentId}":{parameters:[{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalDocument","x-implementation-status":"planned",summary:"Get approval knowledge document",responses:{"200":{description:"Document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalDocument","x-implementation-status":"planned",summary:"Update approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Updated document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalDocument","x-implementation-status":"planned",summary:"Delete approval knowledge document",responses:{"200":{description:"Deleted document confirmation."}}}},"/v1/approval/style-preferences":{get:{tags:["Approval Knowledge"],operationId:"getApprovalStylePreferences","x-implementation-status":"planned",summary:"Get approval style preferences",responses:{"200":{description:"Style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalStylePreferences","x-implementation-status":"planned",summary:"Update approval style preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}},responses:{"200":{description:"Updated style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences":{get:{tags:["Approval Knowledge"],operationId:"getPreferences","x-implementation-status":"implemented",summary:"Get current decision, thinking-depth and rule-version preferences",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:"Decision preferences, thinking depth preference and the bound rule set version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences/decision":{post:{tags:["Approval Knowledge"],operationId:"updatePreferenceDecision","x-implementation-status":"implemented",summary:"Update decision preferences (takes effect immediately for the running approval agent)",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."}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{explicitApprove:{type:"string"},explicitReject:{type:"string"},exemptApprove:{type:"string"},review:{type:"string"},dryRun:{type:"boolean",description:"Return the before/after diff without writing."}}}}}},responses:{"200":{description:"Updated preferences, or the previewed diff when dryRun is set.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/approval-runs":{get:{tags:["Approval Runs"],operationId:"searchApprovalRuns","x-implementation-status":"implemented",summary:"Search wrapped approval run history",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."},{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"startDate",in:"query",schema:{type:"string"},description:"Creation-time lower bound in milliseconds."},{name:"endDate",in:"query",schema:{type:"string"},description:"Creation-time upper bound in milliseconds."},{name:"status",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}},{name:"manualApprovalStatus",in:"query",schema:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"},description:"Hose/易快报单号 or other external source document number."},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"},description:"Local human result contains filter, such as 驳回 or 通过."},{name:"query",in:"query",schema:{type:"string"},description:"Search across record ID, source document fields, document ID, and trace fields."},{name:"includeBridge",in:"query",schema:{type:"boolean",default:!1},description:"Include full Langfuse bridge rows."}],responses:{"200":{description:"Compact wrapped approval run list.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["records"],properties:{records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},total:{type:"integer"},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/summary":{get:{tags:["Approval Runs"],operationId:"summarizeApprovalRuns","x-implementation-status":"implemented",summary:"Summarize approval runs by local date",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."},{name:"date",in:"query",schema:{type:"string",format:"date"}},{name:"timezone",in:"query",schema:{type:"string",default:"Asia/Shanghai"}},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"query",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Date summary with counts and compact records.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{date:{type:"string"},timezone:{type:"string"},matched:{type:"integer"},statusCounts:{type:"object",additionalProperties:{type:"integer"}},taskModeCounts:{type:"object",additionalProperties:{type:"integer"}}}}}}}}}},"/v1/approval-runs/stats":{get:{tags:["Approval Runs"],operationId:"statApprovalRuns","x-implementation-status":"implemented",summary:"Aggregate approval run counts by status and source system",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."},{name:"since",in:"query",schema:{type:"string"},description:"Time window such as 3months, 7days or 24hours."},{name:"dedupeBy",in:"query",schema:{type:"string",enum:["sourceDocumentSN","sourceDocumentId","id"],default:"sourceDocumentSN"},description:"Field used to count distinct business documents."},{name:"status",in:"query",schema:{type:"string"}},{name:"sourceSystem",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Counts grouped by status and source system, plus the deduplicated total.",content:{"application/json":{schema:{type:"object"}}}}}}},"/v1/approval-runs/pick":{get:{tags:["Approval Runs"],operationId:"pickApprovalRuns","x-implementation-status":"implemented",summary:"Pick likely approval runs by document number or trace key",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."},{name:"query",in:"query",schema:{type:"string"}},{name:"sn",in:"query",schema:{type:"string"},description:"Source document number for direct lookup."},{name:"batch",in:"query",schema:{type:"string"},description:"Optional simulation batch ID."},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated response fields."},{name:"limit",in:"query",schema:{type:"integer",default:20}},{name:"maxScan",in:"query",schema:{type:"integer",default:1000}}],responses:{"200":{description:"Picked records and suggested next actions.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/bridge":{get:{tags:["Approval Runs"],operationId:"getApprovalRunLangfuseBridge","x-implementation-status":"planned",summary:"Resolve approval runs to Langfuse trace or session hints",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."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"simulationBatchId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Trace/session bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{count:{type:"integer"},records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/url":{get:{tags:["Approval Runs"],operationId:"getApprovalRunUrl","x-implementation-status":"implemented",summary:"Get Seal AI result URL and optional source document URL",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."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Seal AI result URL and source document URL.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{url:{type:"string"},sealResultUrl:{type:"string"},ssoUrl:{type:"string"},documentUrl:{type:"string"},hoseDocumentUrl:{type:"string"},recordId:{type:"string"},sourceDocumentSN:{type:"string"}}}}}}}}},"/v1/approval-runs/{recordId}":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRun","x-implementation-status":"implemented",summary:"Get wrapped approval run detail",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated field paths such as metadata,document.fields,result.summary."}],responses:{"200":{description:"Approval run detail plus stable aliases and human result.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/cited-rules":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunCitedRules","x-implementation-status":"implemented",summary:"Extract rules cited or matched by the AI result",responses:{"200":{description:"Cited rule summaries.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/document-summary":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunDocumentSummary","x-implementation-status":"implemented",summary:"Get key document fields and compact AI/manual result",responses:{"200":{description:"Document summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/attachments":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunAttachments","x-implementation-status":"implemented",summary:"List compact attachment metadata",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"Attachment metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/result":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunResult","x-implementation-status":"implemented",summary:"Get AI result, optionally as a compact summary",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"AI result or summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-batch":{post:{tags:["Simulation"],operationId:"createSimulationBatch","x-implementation-status":"implemented",summary:"Create a simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-material-pack-batch":{post:{tags:["Simulation"],operationId:"createMaterialPackBatch","x-implementation-status":"planned",summary:"Create a material pack simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches":{get:{tags:["Simulation"],operationId:"listSimulationBatches","x-implementation-status":"implemented",summary:"List simulation batches",parameters:[{name:"limit",in:"query",schema:{type:"integer"},description:"Max batches to return."}],responses:{"200":{description:"Simulation batches.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/batch/{batchId}":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatch","x-implementation-status":"implemented",summary:"Get a simulation batch detail including echoed create params",responses:{"200":{description:"Simulation batch detail.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches/{batchId}/records":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatchRecords","x-implementation-status":"planned",summary:"Get wrapped simulation batch records",parameters:[{name:"query",in:"query",schema:{type:"string"},description:"Optional local contains filter for record/document/trace identifiers."}],responses:{"200":{description:"Compact simulation records and bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/templates":{get:{tags:["Simulation"],operationId:"listSimulationTemplates","x-implementation-status":"planned",summary:"List simulation test templates",responses:{"200":{description:"Simulation templates.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/integration-status":{get:{tags:["Simulation"],operationId:"getSimulationIntegrationStatus","x-implementation-status":"planned",summary:"Get available source integration status for simulation",responses:{"200":{description:"Integration status.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/hosecloud-integrations":{get:{tags:["Simulation"],operationId:"listSimulationHosecloudIntegrations","x-implementation-status":"planned",summary:"List hosecloud source integrations available for simulation",responses:{"200":{description:"Hosecloud integrations.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/material-packages/upload":{post:{tags:["Simulation"],operationId:"uploadMaterialPackage","x-implementation-status":"planned",summary:"Upload a material package ZIP for simulation",requestBody:{required:!0,content:{"multipart/form-data":{schema:{type:"object",properties:{file:{type:"string",format:"binary"}}}}}},responses:{"200":{description:"Parsed material package with schema config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}}},components:{securitySchemes:{localSession:{type:"apiKey",in:"header",name:"X-Seal-Home-Session",description:`Reserved header. The local adapter does not currently authenticate requests: it acts with +`),console.log(Ng0());return}if(z==="paths"||z==="dirs"||z==="directories"){let J=no();R0(J.directories);return}if(z==="auth"){let{selectCorp:J}=await Promise.resolve().then(() => (O4(),Yo)),{stringOption:K}=await Promise.resolve().then(() => (Z4(),tl)),{handleAuthCommand:G}=await Promise.resolve().then(() => (jo(),qS0)),H=K(U.options.corp)??(Y&&Y!==z?Y:void 0)??(U.command[2]&&U.command[2]!==z?U.command[2]:void 0),W=J(H);await G("check",W,U);return}if(z==="tenant"||z==="corp"||z==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (O4(),Yo)),{createSealClient:K}=await Promise.resolve().then(() => (m6(),H10)),{stringOption:G}=await Promise.resolve().then(() => (Z4(),tl)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (Eg0(),jg0)),X=G(U.options.corp)??(Y&&Y!==z?Y:void 0)??(U.command[2]&&U.command[2]!==z?U.command[2]:void 0),Z=J(X),q=await K(Z),V=await H(q,Z);if(!(G0(U.options.quiet)||G0(U.options.silent)))console.error(W(V));R0(V);return}let I=no();if(!(G0(U.options.quiet)||G0(U.options.silent)))console.error(Pg0(I));R0(I)}var Rg0=m(()=>{Tg0();co();Z4();m1()});var vg0;var _g0=m(()=>{vg0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.38",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local 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","x-implementation-status":"planned",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","x-implementation-status":"implemented",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","x-implementation-status":"implemented",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:{"200":{description:"Current session metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}}}}},"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/approval/context":{get:{tags:["Approval Knowledge"],operationId:"getApprovalContext","x-implementation-status":"planned",summary:"Get rules, documents, and style preferences together",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."},{name:"documentLimit",in:"query",schema:{type:"integer",minimum:1}},{name:"latestRuleVersion",in:"query",schema:{type:"boolean"}},{name:"ruleVersionNumber",in:"query",schema:{type:"integer"}}],responses:{"200":{description:"Approval context.",content:{"application/json":{schema:{type:"object",required:["rules","documents","stylePreferences"],properties:{rules:{},documents:{},stylePreferences:{}}}}}}}}},"/v1/approval/search":{post:{tags:["Approval Knowledge"],operationId:"searchApprovalKnowledge","x-implementation-status":"planned",summary:"Search approval rules, documents, and preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["keywords"],properties:{keywords:{type:"array",minItems:1,items:{type:"string"}},matchMode:{type:"string",enum:["any","all"]},areas:{type:"array",items:{type:"string",enum:["rules","documents","preferences"]}},maxResults:{type:"integer"}}}}}},responses:{"200":{description:"Search results with line context.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rules":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRules","x-implementation-status":"implemented",summary:"List current draft approval rules",responses:{"200":{description:"Draft rules.",content:{"application/json":{schema:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalRule","x-implementation-status":"planned",summary:"Create draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Created rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}}},"/v1/approval/rules/{ruleId}":{parameters:[{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."}],patch:{tags:["Approval Knowledge"],operationId:"updateApprovalRule","x-implementation-status":"planned",summary:"Update draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Updated rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalRule","x-implementation-status":"planned",summary:"Delete draft approval rule",responses:{"200":{description:"Deleted."}}}},"/v1/approval/rule-versions":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRuleVersions","x-implementation-status":"planned",summary:"List published approval rule versions",responses:{"200":{description:"Published rule versions.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}}},"/v1/approval/rule-versions/{versionId}":{parameters:[{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleVersion","x-implementation-status":"planned",summary:"Get published approval rule version",responses:{"200":{description:"Rule version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval/rules/by-version":{get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleByVersion","x-implementation-status":"planned",summary:"Get one wrapped rule from a published version",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."},{name:"versionNumber",in:"query",schema:{type:"integer"}},{name:"versionId",in:"query",schema:{type:"string"}},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"code",in:"query",schema:{type:"string"},description:"Display rule code such as '#0038'."},{name:"runtimeId",in:"query",schema:{type:"string"},description:"Runtime rule ID such as rule-205."},{name:"recordId",in:"query",schema:{type:"string"},description:"Infer versionNumber from an approval run."}],responses:{"200":{description:"One rule from a published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rule-versions/publish":{post:{tags:["Approval Knowledge"],operationId:"publishApprovalRuleVersion","x-implementation-status":"planned",summary:"Publish current draft rules",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}}}}},responses:{"200":{description:"Published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/documents":{get:{tags:["Approval Knowledge"],operationId:"listApprovalDocuments","x-implementation-status":"planned",summary:"List approval knowledge documents",parameters:[{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,default:20}},{name:"scenario",in:"query",schema:{type:"array",items:{type:"string"}},style:"form",explode:!0}],responses:{"200":{description:"Documents.",content:{"application/json":{schema:{type:"object",required:["articles"],properties:{articles:{type:"array",items:{$ref:"#/components/schemas/ApprovalDocument"}},total:{type:"integer"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalDocument","x-implementation-status":"planned",summary:"Create approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["title","purpose","content"],properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Created document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}}},"/v1/approval/documents/{documentId}":{parameters:[{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalDocument","x-implementation-status":"planned",summary:"Get approval knowledge document",responses:{"200":{description:"Document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalDocument","x-implementation-status":"planned",summary:"Update approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Updated document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalDocument","x-implementation-status":"planned",summary:"Delete approval knowledge document",responses:{"200":{description:"Deleted document confirmation."}}}},"/v1/approval/style-preferences":{get:{tags:["Approval Knowledge"],operationId:"getApprovalStylePreferences","x-implementation-status":"planned",summary:"Get approval style preferences",responses:{"200":{description:"Style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalStylePreferences","x-implementation-status":"planned",summary:"Update approval style preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}},responses:{"200":{description:"Updated style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences":{get:{tags:["Approval Knowledge"],operationId:"getPreferences","x-implementation-status":"implemented",summary:"Get current decision, thinking-depth and rule-version preferences",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:"Decision preferences, thinking depth preference and the bound rule set version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences/decision":{post:{tags:["Approval Knowledge"],operationId:"updatePreferenceDecision","x-implementation-status":"implemented",summary:"Update decision preferences (takes effect immediately for the running approval agent)",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."}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{explicitApprove:{type:"string"},explicitReject:{type:"string"},exemptApprove:{type:"string"},review:{type:"string"},dryRun:{type:"boolean",description:"Return the before/after diff without writing."}}}}}},responses:{"200":{description:"Updated preferences, or the previewed diff when dryRun is set.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/approval-runs":{get:{tags:["Approval Runs"],operationId:"searchApprovalRuns","x-implementation-status":"implemented",summary:"Search wrapped approval run history",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."},{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"startDate",in:"query",schema:{type:"string"},description:"Creation-time lower bound in milliseconds."},{name:"endDate",in:"query",schema:{type:"string"},description:"Creation-time upper bound in milliseconds."},{name:"status",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}},{name:"manualApprovalStatus",in:"query",schema:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"},description:"Hose/易快报单号 or other external source document number."},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"},description:"Local human result contains filter, such as 驳回 or 通过."},{name:"query",in:"query",schema:{type:"string"},description:"Search across record ID, source document fields, document ID, and trace fields."},{name:"includeBridge",in:"query",schema:{type:"boolean",default:!1},description:"Include full Langfuse bridge rows."}],responses:{"200":{description:"Compact wrapped approval run list.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["records"],properties:{records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},total:{type:"integer"},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/summary":{get:{tags:["Approval Runs"],operationId:"summarizeApprovalRuns","x-implementation-status":"implemented",summary:"Summarize approval runs by local date",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."},{name:"date",in:"query",schema:{type:"string",format:"date"}},{name:"timezone",in:"query",schema:{type:"string",default:"Asia/Shanghai"}},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"query",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Date summary with counts and compact records.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{date:{type:"string"},timezone:{type:"string"},matched:{type:"integer"},statusCounts:{type:"object",additionalProperties:{type:"integer"}},taskModeCounts:{type:"object",additionalProperties:{type:"integer"}}}}}}}}}},"/v1/approval-runs/stats":{get:{tags:["Approval Runs"],operationId:"statApprovalRuns","x-implementation-status":"implemented",summary:"Aggregate approval run counts by status and source system",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."},{name:"since",in:"query",schema:{type:"string"},description:"Time window such as 3months, 7days or 24hours."},{name:"dedupeBy",in:"query",schema:{type:"string",enum:["sourceDocumentSN","sourceDocumentId","id"],default:"sourceDocumentSN"},description:"Field used to count distinct business documents."},{name:"status",in:"query",schema:{type:"string"}},{name:"sourceSystem",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Counts grouped by status and source system, plus the deduplicated total.",content:{"application/json":{schema:{type:"object"}}}}}}},"/v1/approval-runs/pick":{get:{tags:["Approval Runs"],operationId:"pickApprovalRuns","x-implementation-status":"implemented",summary:"Pick likely approval runs by document number or trace key",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."},{name:"query",in:"query",schema:{type:"string"}},{name:"sn",in:"query",schema:{type:"string"},description:"Source document number for direct lookup."},{name:"batch",in:"query",schema:{type:"string"},description:"Optional simulation batch ID."},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated response fields."},{name:"limit",in:"query",schema:{type:"integer",default:20}},{name:"maxScan",in:"query",schema:{type:"integer",default:1000}}],responses:{"200":{description:"Picked records and suggested next actions.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/bridge":{get:{tags:["Approval Runs"],operationId:"getApprovalRunLangfuseBridge","x-implementation-status":"planned",summary:"Resolve approval runs to Langfuse trace or session hints",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."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"simulationBatchId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Trace/session bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{count:{type:"integer"},records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/url":{get:{tags:["Approval Runs"],operationId:"getApprovalRunUrl","x-implementation-status":"implemented",summary:"Get Seal AI result URL and optional source document URL",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."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Seal AI result URL and source document URL.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{url:{type:"string"},sealResultUrl:{type:"string"},ssoUrl:{type:"string"},documentUrl:{type:"string"},hoseDocumentUrl:{type:"string"},recordId:{type:"string"},sourceDocumentSN:{type:"string"}}}}}}}}},"/v1/approval-runs/{recordId}":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRun","x-implementation-status":"implemented",summary:"Get wrapped approval run detail",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated field paths such as metadata,document.fields,result.summary."}],responses:{"200":{description:"Approval run detail plus stable aliases and human result.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/cited-rules":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunCitedRules","x-implementation-status":"implemented",summary:"Extract rules cited or matched by the AI result",responses:{"200":{description:"Cited rule summaries.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/document-summary":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunDocumentSummary","x-implementation-status":"implemented",summary:"Get key document fields and compact AI/manual result",responses:{"200":{description:"Document summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/attachments":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunAttachments","x-implementation-status":"implemented",summary:"List compact attachment metadata",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"Attachment metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/result":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunResult","x-implementation-status":"implemented",summary:"Get AI result, optionally as a compact summary",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"AI result or summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-batch":{post:{tags:["Simulation"],operationId:"createSimulationBatch","x-implementation-status":"implemented",summary:"Create a simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-material-pack-batch":{post:{tags:["Simulation"],operationId:"createMaterialPackBatch","x-implementation-status":"planned",summary:"Create a material pack simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches":{get:{tags:["Simulation"],operationId:"listSimulationBatches","x-implementation-status":"implemented",summary:"List simulation batches",parameters:[{name:"limit",in:"query",schema:{type:"integer"},description:"Max batches to return."}],responses:{"200":{description:"Simulation batches.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/batch/{batchId}":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatch","x-implementation-status":"implemented",summary:"Get a simulation batch detail including echoed create params",responses:{"200":{description:"Simulation batch detail.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches/{batchId}/records":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatchRecords","x-implementation-status":"planned",summary:"Get wrapped simulation batch records",parameters:[{name:"query",in:"query",schema:{type:"string"},description:"Optional local contains filter for record/document/trace identifiers."}],responses:{"200":{description:"Compact simulation records and bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/templates":{get:{tags:["Simulation"],operationId:"listSimulationTemplates","x-implementation-status":"planned",summary:"List simulation test templates",responses:{"200":{description:"Simulation templates.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/integration-status":{get:{tags:["Simulation"],operationId:"getSimulationIntegrationStatus","x-implementation-status":"planned",summary:"Get available source integration status for simulation",responses:{"200":{description:"Integration status.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/hosecloud-integrations":{get:{tags:["Simulation"],operationId:"listSimulationHosecloudIntegrations","x-implementation-status":"planned",summary:"List hosecloud source integrations available for simulation",responses:{"200":{description:"Hosecloud integrations.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/material-packages/upload":{post:{tags:["Simulation"],operationId:"uploadMaterialPackage","x-implementation-status":"planned",summary:"Upload a material package ZIP for simulation",requestBody:{required:!0,content:{"multipart/form-data":{schema:{type:"object",properties:{file:{type:"string",format:"binary"}}}}}},responses:{"200":{description:"Parsed material package with schema config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}}},components:{securitySchemes:{localSession:{type:"apiKey",in:"header",name:"X-Seal-Home-Session",description:`Reserved header. The local adapter does not currently authenticate requests: it acts with the credentials already stored on this machine for the selected enterprise. Keep it bound to loopback (\`--host 127.0.0.1\`) and do not expose the port to a network or an origin you do not control. diff --git a/dist/openapi.json b/dist/openapi.json index fa3051a..c34473d 100644 --- a/dist/openapi.json +++ b/dist/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "seal-use Wrapped API", - "version": "0.10.37", + "version": "0.10.38", "description": "HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n" }, "servers": [ diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 7950713..c7b1aec 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: seal-use Wrapped API - version: 0.10.37 + version: 0.10.38 description: | HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787). diff --git a/package.json b/package.json index 89ef304..4ee26b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.37", + "version": "0.10.38", "private": true, "description": "Seal tenant operations toolkit: approval-run diagnosis, rule remediation, Hose/合思 auth, plus a CLI and an optional MCP server.", "license": "MIT", diff --git a/skills/seal-use/SKILL.md b/skills/seal-use/SKILL.md index 4ef91fb..2b81ef5 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -1,9 +1,9 @@ --- name: seal-use -description: "v0.10.37: Use for Seal Use enterprise onboarding, Hose/合思 or Seal-native authentication, approval operations, diagnosis, simulation, rules, users, configuration, and search." +description: "v0.10.38: Use for Seal Use enterprise onboarding, Hose/合思 or Seal-native authentication, approval operations, diagnosis, simulation, rules, users, configuration, and search." metadata: - version: 0.10.37 - short-description: Seal tenant and Hose approval automation (v0.10.37) + version: 0.10.38 + short-description: Seal tenant and Hose approval automation (v0.10.38) --- # Seal Use