From 00566c043e43c4b3eefd8ea482a59867d49ac156 Mon Sep 17 00:00:00 2001 From: yunyingk Date: Fri, 18 Sep 2026 22:37:12 +0800 Subject: [PATCH] Release v0.10.30: Multi-host AI agent skill bridging and proactive rule quality checks --- .zcode-plugin/plugin.json | 2 +- CHANGELOG.md | 10 ++++++++++ dist/mcp/server.js | 12 ++++++------ dist/openapi.json | 2 +- openapi/openapi.yaml | 2 +- package.json | 2 +- skills/seal-use/SKILL.md | 8 ++++---- 7 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.zcode-plugin/plugin.json b/.zcode-plugin/plugin.json index b01e495..ee382bd 100644 --- a/.zcode-plugin/plugin.json +++ b/.zcode-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.29", + "version": "0.10.30", "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 8c3d741..57d4408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.30] - 2026-09-18 + +### Added +- **Multi-Host AI Agent Skill Bridging**: Decoupled multi-host agent bridge (`src/core/agent-hosts/`) supporting Google Antigravity 2.0, WorkBuddy, Claude, and Qoder: + - **Antigravity 2.0**: Automatically configures `~/.gemini/config/skills.json` using the client's concrete absolute home directory path. Prepends target path if absent, auto-upgrades legacy `~` tilde paths to absolute paths, and safely avoids touching valid existing entries. + - **WorkBuddy, Claude, Qoder**: Automatically detects host installations and creates/manages `skills/seal-use` symlinks under `~/.workbuddy`, `~/.claude`, and `~/.qoder`. Detects parent directory symlinks (`skills -> ~/.agents/skills`) without mutating, heals broken symlinks, safely upgrades stale legacy directories containing `SKILL.md` to prevent version drift, and uses Windows Directory Junctions for non-admin permission compatibility. + - **Zero-Pollution Guard**: Skips bridge creation if the host application root directory does not exist on the client machine. + - **CLI Diagnostics**: Exposes host discovery and configuration state in both `seal-use skill install` and `seal-use skill status`. +- **Doctor Rule Linter Health Check & Proactive Guidance**: Added `rule_linter` audit item in `seal-use doctor` to display current linter status, providing actionable hints (`seal-use config lint enable`), and updated skill documentation to instruct agents to proactively inquire before writing rule drafts. + ## [0.10.29] - 2026-09-18 ### Added diff --git a/dist/mcp/server.js b/dist/mcp/server.js index b1be716..5d9ba70 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:D,parentData:N,parentDataProperty:B},T){D.if(I._`${N} !== undefined`,()=>D.assign(I._`${N}[${B}]`,T))}function V(D,N,B,T=J.Correct){let A=T===J.Correct?I.operators.EQ:I.operators.NEQ,j;switch(D){case"null":return I._`${N} ${A} null`;case"array":j=I._`Array.isArray(${N})`;break;case"object":j=I._`${N} && typeof ${N} == "object" && !Array.isArray(${N})`;break;case"integer":j=C(I._`!(${N} % 1) && !isNaN(${N})`);break;case"number":j=C();break;default:return I._`typeof ${N} ${A} ${D}`}return T===J.Correct?j:(0,I.not)(j);function C(b=I.nil){return(0,I.and)(I._`typeof ${N} == "number"`,b,B?I._`isFinite(${N})`:I.nil)}}$.checkDataType=V;function F(D,N,B,T){if(D.length===1)return V(D[0],N,B,T);let A,j=(0,Q.toHash)(D);if(j.array&&j.object){let C=I._`typeof ${N} != "object"`;A=j.null?C:I._`!${N} || ${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,N,B,T));return A}$.checkDataTypes=F;let M={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:N})=>typeof D=="string"?I._`{type: ${D}}`:I._`{type: ${N}}`};function w(D){let N=O(D);(0,U.reportError)(N,M)}$.reportTypeError=w;function O(D){let{gen:N,data:B,schema:T}=D,A=(0,Q.schemaRefOrVal)(D,T,"type");return{gen:N,keyword:"type",data:B,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:D}}}),gu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=L1(),z=v1();function U(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=U;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,z.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)}`)}}),I5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=L1(),z=v1(),U=U5(),I=v1();function Q(D,N){let{gen:B,data:T,it:A}=D;B.if(X(B,T,N,A.opts.ownProperties),()=>{D.setParams({missingProperty:Y._`${N}`},!0),D.error()})}$.checkReportMissingProp=Q;function J({gen:D,data:N,it:{opts:B}},T,A){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(D,N,j,B.ownProperties),Y._`${A} = ${j}`)))}$.checkMissingProp=J;function K(D,N){D.setParams({missingProperty:N},!0),D.error()}$.reportMissingProp=K;function G(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(D,N,B){return Y._`${G(D)}.call(${N}, ${B})`}$.isOwnProperty=H;function W(D,N,B,T){let A=Y._`${N}${(0,Y.getProperty)(B)} !== undefined`;return T?Y._`${A} && ${H(D,N,B)}`:A}$.propertyInData=W;function X(D,N,B,T){let A=Y._`${N}${(0,Y.getProperty)(B)} === undefined`;return T?(0,Y.or)(A,(0,Y.not)(H(D,N,B))):A}$.noPropertyInData=X;function Z(D){return D?Object.keys(D).filter((N)=>N!=="__proto__"):[]}$.allSchemaProperties=Z;function q(D,N){return Z(N).filter((B)=>!(0,z.alwaysValidSchema)(D,N[B]))}$.schemaProperties=q;function V({schemaCode:D,data:N,it:{gen:B,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,k,h){let i=h?Y._`${D}, ${N}, ${T}${A}`:N,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${B.object(...c)}`;return k!==Y.nil?Y._`${b}.call(${k}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:D,it:{opts:N}},B){let T=N.unicodeRegExp?"u":"",{regExp:A}=N.code,j=A(B,T);return D.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${A.code==="new RegExp"?F:(0,I.useFunc)(D,A)}(${B}, ${T})`})}$.usePattern=M;function w(D){let{gen:N,data:B,keyword:T,it:A}=D,j=N.name("valid");if(A.allErrors){let b=N.let("valid",!0);return C(()=>N.assign(b,!1)),b}return N.var(j,!0),C(()=>N.break()),j;function C(b){let k=N.const("len",Y._`${B}.length`);N.forRange("i",0,k,(h)=>{D.subschema({keyword:T,dataProp:h,dataPropType:z.Type.Num},j),N.if((0,Y.not)(j),b)})}}$.validateArray=w;function O(D){let{gen:N,schema:B,keyword:T,it:A}=D;if(!Array.isArray(B))throw Error("ajv implementation error");if(B.some((b)=>(0,z.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=N.let("valid",!1),C=N.name("_valid");N.block(()=>B.forEach((b,k)=>{let h=D.subschema({keyword:T,schemaProp:k,compositeRule:!0},C);if(N.assign(j,Y._`${j} || ${C}`),!D.mergeValidEvaluated(h,C))N.if((0,Y.not)(j))})),D.result(j,()=>D.reset(),()=>D.error(!0))}$.validateUnion=O}),yu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateKeywordUsage=$.validSchemaType=$.funcKeywordCode=$.macroKeywordCode=void 0;let Y=L1(),z=U5(),U=I5(),I=Sw();function Q(q,V){let{gen:F,keyword:M,schema:w,parentSchema:O,it:D}=q,N=V.macro.call(D.self,w,O,D),B=W(F,M,N);if(D.opts.validateSchema!==!1)D.self.validateSchema(N,!0);let T=F.name("valid");q.subschema({schema:N,schemaPath:Y.nil,errSchemaPath:`${D.errSchemaPath}/${M}`,topSchemaRef:B,compositeRule:!0},T),q.pass(T,()=>q.error(!0))}$.macroKeywordCode=Q;function J(q,V){var F;let{gen:M,keyword:w,schema:O,parentSchema:D,$data:N,it:B}=q;H(B,V);let T=W(M,w,!N&&V.compile?V.compile.call(B.self,O,D,B):V.validate),A=M.let("valid");q.block$data(A,j),q.ok((F=V.valid)!==null&&F!==void 0?F:A);function j(){if(V.errors===!1){if(k(),V.modifying)K(q);h(()=>q.error())}else{let i=V.async?C():b();if(V.modifying)K(q);h(()=>G(q,i))}}function C(){let i=M.let("ruleErrs",null);return M.try(()=>k(Y._`await `),(c)=>M.assign(A,!1).if(Y._`${c} instanceof ${B.ValidationError}`,()=>M.assign(i,Y._`${c}.errors`),()=>M.throw(c))),i}function b(){let i=Y._`${T}.errors`;return M.assign(i,null),k(Y.nil),i}function k(i=V.async?Y._`await `:Y.nil){let c=B.opts.passContext?z.default.this:z.default.self,U0=!(("compile"in V)&&!N||V.schema===!1);M.assign(A,Y._`${i}${(0,U.callValidateCode)(q,T,c,U0)}`,V.modifying)}function h(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:F,it:M}=q;V.if(M.parentData,()=>V.assign(F,Y._`${M.parentData}[${M.parentDataProperty}]`))}function G(q,V){let{gen:F}=q;F.if(Y._`Array.isArray(${V})`,()=>{F.assign(z.default.vErrors,Y._`${z.default.vErrors} === null ? ${V} : ${z.default.vErrors}.concat(${V})`).assign(z.default.errors,Y._`${z.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,F){if(F===void 0)throw Error(`keyword "${V}" failed to compile`);return q.scopeValue("keyword",typeof F=="function"?{ref:F}:{ref:F,code:(0,Y.stringify)(F)})}function X(q,V,F=!1){return!V.length||V.some((M)=>M==="array"?Array.isArray(q):M==="object"?q&&typeof q=="object"&&!Array.isArray(q):typeof q==M||F&&typeof q>"u")}$.validSchemaType=X;function Z({schema:q,opts:V,self:F,errSchemaPath:M},w,O){if(Array.isArray(w.keyword)?!w.keyword.includes(O):w.keyword!==O)throw Error("ajv implementation error");let D=w.dependencies;if(D===null||D===void 0?void 0:D.some((N)=>!Object.prototype.hasOwnProperty.call(q,N)))throw Error(`parent schema must have dependencies of ${O}: ${D.join(",")}`);if(w.validateSchema){if(!w.validateSchema(q[O])){let N=`keyword "${O}" value is invalid at path "${M}": `+F.errorsText(w.validateSchema.errors);if(V.validateSchema==="log")F.logger.error(N);else throw Error(N)}}}$.validateKeywordUsage=Z}),ku0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.extendSubschemaMode=$.extendSubschemaData=$.getSubschema=void 0;let Y=L1(),z=v1();function U(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,z.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=U;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:F,dataPathArr:M,opts:w}=K;V(q.let("data",Y._`${K.data}${(0,Y.getProperty)(G)}`,!0)),J.errorPath=Y.str`${F}${(0,z.getErrorPath)(G,H,w.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(F){J.data=F,J.dataLevel=K.dataLevel+1,J.dataTypes=[],K.definedProperties=new Set,J.parentData=K.data,J.dataNames=[...K.dataNames,F]}}$.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}),dt=R0(($,Y)=>{Y.exports=function z(U,I){if(U===I)return!0;if(U&&I&&typeof U=="object"&&typeof I=="object"){if(U.constructor!==I.constructor)return!1;var Q,J,K;if(Array.isArray(U)){if(Q=U.length,Q!=I.length)return!1;for(J=Q;J--!==0;)if(!z(U[J],I[J]))return!1;return!0}if(U.constructor===RegExp)return U.source===I.source&&U.flags===I.flags;if(U.valueOf!==Object.prototype.valueOf)return U.valueOf()===I.valueOf();if(U.toString!==Object.prototype.toString)return U.toString()===I.toString();if(K=Object.keys(U),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(!z(U[G],I[G]))return!1}return!0}return U!==U&&I!==I}}),xu0=R0(($,Y)=>{var z=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(){};U(J,G,H,Q,"",Q)};z.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},z.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},z.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},z.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 U(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 F in G){var M=G[F];if(Array.isArray(M)){if(F in z.arrayKeywords)for(var w=0;w{Object.defineProperty($,"__esModule",{value:!0}),$.getSchemaRefs=$.resolveUrl=$.normalizeId=$._getFullPath=$.getFullPath=$.inlineRef=void 0;let Y=v1(),z=dt(),U=xu0(),I=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Q(M,w=!0){if(typeof M=="boolean")return!0;if(w===!0)return!K(M);if(!w)return!1;return G(M)<=w}$.inlineRef=Q;let J=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function K(M){for(let w in M){if(J.has(w))return!0;let O=M[w];if(Array.isArray(O)&&O.some(K))return!0;if(typeof O=="object"&&K(O))return!0}return!1}function G(M){let w=0;for(let O in M){if(O==="$ref")return 1/0;if(w++,I.has(O))continue;if(typeof M[O]=="object")(0,Y.eachItem)(M[O],(D)=>w+=G(D));if(w===1/0)return 1/0}return w}function H(M,w="",O){if(O!==!1)w=Z(w);return W(M,M.parse(w))}$.getFullPath=H;function W(M,w){return M.serialize(w).split("#")[0]+"#"}$._getFullPath=W;let X=/#\/?$/;function Z(M){return M?M.replace(X,""):""}$.normalizeId=Z;function q(M,w,O){return O=Z(O),M.resolve(w,O)}$.resolveUrl=q;let V=/^[a-z_][-a-z0-9._]*$/i;function F(M,w){if(typeof M=="boolean")return{};let{schemaId:O,uriResolver:D}=this.opts,N=Z(M[O]||w),B={"":N},T=H(D,N,!1),A={},j=new Set;return U(M,{allKeys:!0},(k,h,i,c)=>{if(c===void 0)return;let U0=T+h,x=B[c];if(typeof k[O]=="string")x=d.call(this,k[O]);t.call(this,k.$anchor),t.call(this,k.$dynamicAnchor),B[h]=x;function d($0){let g=this.opts.uriResolver.resolve;if($0=Z(x?g(x,$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(k,p.schema,$0);else if($0!==Z(U0))if($0[0]==="#")C(k,A[$0],$0),A[$0]=k;else this.refs[$0]=U0;return $0}function t($0){if(typeof $0=="string"){if(!V.test($0))throw Error(`invalid anchor "${$0}"`);d.call(this,`#${$0}`)}}}),A;function C(k,h,i){if(h!==void 0&&!z(k,h))throw b(i)}function b(k){return Error(`reference "${k}" resolves to more than one schema`)}}$.getSchemaRefs=F}),SI=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.getData=$.KeywordCxt=$.validateFunctionCode=void 0;let Y=Su0(),z=hw(),U=pt(),I=hw(),Q=gu0(),J=yu0(),K=ku0(),G=L1(),H=U5(),W=gw(),X=v1(),Z=Sw();function q(a){if(T(a)){if(j(a),B(a)){w(a);return}}V(a,()=>(0,Y.topBoolOrEmptySchema)(a))}$.validateFunctionCode=q;function V({gen:a,validateName:W0,schema:F0,schemaEnv:f0,opts:u0},i0){if(u0.code.es5)a.func(W0,G._`${H.default.data}, ${H.default.valCxt}`,f0.$async,()=>{a.code(G._`"use strict"; ${D(F0,u0)}`),M(a,u0),a.code(i0)});else a.func(W0,G._`${H.default.data}, ${F(u0)}`,f0.$async,()=>a.code(D(F0,u0)).code(i0))}function F(a){return G._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${a.dynamicRef?G._`, ${H.default.dynamicAnchors}={}`:G.nil}}={}`}function M(a,W0){a.if(H.default.valCxt,()=>{if(a.var(H.default.instancePath,G._`${H.default.valCxt}.${H.default.instancePath}`),a.var(H.default.parentData,G._`${H.default.valCxt}.${H.default.parentData}`),a.var(H.default.parentDataProperty,G._`${H.default.valCxt}.${H.default.parentDataProperty}`),a.var(H.default.rootData,G._`${H.default.valCxt}.${H.default.rootData}`),W0.dynamicRef)a.var(H.default.dynamicAnchors,G._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(a.var(H.default.instancePath,G._`""`),a.var(H.default.parentData,G._`undefined`),a.var(H.default.parentDataProperty,G._`undefined`),a.var(H.default.rootData,H.default.data),W0.dynamicRef)a.var(H.default.dynamicAnchors,G._`{}`)})}function w(a){let{schema:W0,opts:F0,gen:f0}=a;V(a,()=>{if(F0.$comment&&W0.$comment)c(a);if(k(a),f0.let(H.default.vErrors,null),f0.let(H.default.errors,0),F0.unevaluated)O(a);C(a),U0(a)})}function O(a){let{gen:W0,validateName:F0}=a;a.evaluated=W0.const("evaluated",G._`${F0}.evaluated`),W0.if(G._`${a.evaluated}.dynamicProps`,()=>W0.assign(G._`${a.evaluated}.props`,G._`undefined`)),W0.if(G._`${a.evaluated}.dynamicItems`,()=>W0.assign(G._`${a.evaluated}.items`,G._`undefined`))}function D(a,W0){let F0=typeof a=="object"&&a[W0.schemaId];return F0&&(W0.code.source||W0.code.process)?G._`/*# sourceURL=${F0} */`:G.nil}function N(a,W0){if(T(a)){if(j(a),B(a)){A(a,W0);return}}(0,Y.boolOrEmptySchema)(a,W0)}function B({schema:a,self:W0}){if(typeof a=="boolean")return!a;for(let F0 in a)if(W0.RULES.all[F0])return!0;return!1}function T(a){return typeof a.schema!="boolean"}function A(a,W0){let{schema:F0,gen:f0,opts:u0}=a;if(u0.$comment&&F0.$comment)c(a);h(a),i(a);let i0=f0.const("_errs",H.default.errors);C(a,i0),f0.var(W0,G._`${i0} === ${H.default.errors}`)}function j(a){(0,X.checkUnknownRules)(a),b(a)}function C(a,W0){if(a.opts.jtd)return d(a,[],!1,W0);let F0=(0,z.getSchemaTypes)(a.schema);d(a,F0,!(0,z.coerceAndCheckDataType)(a,F0),W0)}function b(a){let{schema:W0,errSchemaPath:F0,opts:f0,self:u0}=a;if(W0.$ref&&f0.ignoreKeywordsWithRef&&(0,X.schemaHasRulesButRef)(W0,u0.RULES))u0.logger.warn(`$ref: keywords ignored in schema at path "${F0}"`)}function k(a){let{schema:W0,opts:F0}=a;if(W0.default!==void 0&&F0.useDefaults&&F0.strictSchema)(0,X.checkStrictMode)(a,"default is ignored in the schema root")}function h(a){let W0=a.schema[a.opts.schemaId];if(W0)a.baseId=(0,W.resolveUrl)(a.opts.uriResolver,a.baseId,W0)}function i(a){if(a.schema.$async&&!a.schemaEnv.$async)throw Error("async schema in sync schema")}function c({gen:a,schemaEnv:W0,schema:F0,errSchemaPath:f0,opts:u0}){let i0=F0.$comment;if(u0.$comment===!0)a.code(G._`${H.default.self}.logger.log(${i0})`);else if(typeof u0.$comment=="function"){let D1=G.str`${f0}/$comment`,k1=a.scopeValue("root",{ref:W0.root});a.code(G._`${H.default.self}.opts.$comment(${i0}, ${D1}, ${k1}.schema)`)}}function U0(a){let{gen:W0,schemaEnv:F0,validateName:f0,ValidationError:u0,opts:i0}=a;if(F0.$async)W0.if(G._`${H.default.errors} === 0`,()=>W0.return(H.default.data),()=>W0.throw(G._`new ${u0}(${H.default.vErrors})`));else{if(W0.assign(G._`${f0}.errors`,H.default.vErrors),i0.unevaluated)x(a);W0.return(G._`${H.default.errors} === 0`)}}function x({gen:a,evaluated:W0,props:F0,items:f0}){if(F0 instanceof G.Name)a.assign(G._`${W0}.props`,F0);if(f0 instanceof G.Name)a.assign(G._`${W0}.items`,f0)}function d(a,W0,F0,f0){let{gen:u0,schema:i0,data:D1,allErrors:k1,opts:u1,self:b1}=a,{RULES:A0}=b1;if(i0.$ref&&(u1.ignoreKeywordsWithRef||!(0,X.schemaHasRulesButRef)(i0,A0))){u0.block(()=>G0(a,"$ref",A0.all.$ref.definition));return}if(!u1.jtd)$0(a,W0);u0.block(()=>{for(let P of A0.rules)I0(P);I0(A0.post)});function I0(P){if(!(0,U.shouldUseGroup)(i0,P))return;if(P.type){if(u0.if((0,I.checkDataType)(P.type,D1,u1.strictNumbers)),t(a,P),W0.length===1&&W0[0]===P.type&&F0)u0.else(),(0,I.reportTypeError)(a);u0.endIf()}else t(a,P);if(!k1)u0.if(G._`${H.default.errors} === ${f0||0}`)}}function t(a,W0){let{gen:F0,schema:f0,opts:{useDefaults:u0}}=a;if(u0)(0,Q.assignDefaults)(a,W0.type);F0.block(()=>{for(let i0 of W0.rules)if((0,U.shouldUseRule)(f0,i0))G0(a,i0.keyword,i0.definition,W0.type)})}function $0(a,W0){if(a.schemaEnv.meta||!a.opts.strictTypes)return;if(g(a,W0),!a.opts.allowUnionTypes)p(a,W0);e(a,a.dataTypes)}function g(a,W0){if(!W0.length)return;if(!a.dataTypes.length){a.dataTypes=W0;return}W0.forEach((F0)=>{if(!s(a.dataTypes,F0))M0(a,`type "${F0}" not allowed by context "${a.dataTypes.join(",")}"`)}),Y0(a,W0)}function p(a,W0){if(W0.length>1&&!(W0.length===2&&W0.includes("null")))M0(a,"use allowUnionTypes to allow union type keyword")}function e(a,W0){let F0=a.self.RULES.all;for(let f0 in F0){let u0=F0[f0];if(typeof u0=="object"&&(0,U.shouldUseRule)(a.schema,u0)){let{type:i0}=u0.definition;if(i0.length&&!i0.some((D1)=>y(W0,D1)))M0(a,`missing type "${i0.join(",")}" for keyword "${f0}"`)}}}function y(a,W0){return a.includes(W0)||W0==="number"&&a.includes("integer")}function s(a,W0){return a.includes(W0)||W0==="integer"&&a.includes("number")}function Y0(a,W0){let F0=[];for(let f0 of a.dataTypes)if(s(W0,f0))F0.push(f0);else if(W0.includes("integer")&&f0==="number")F0.push("integer");a.dataTypes=F0}function M0(a,W0){let F0=a.schemaEnv.baseId+a.errSchemaPath;W0+=` at "${F0}" (strictTypes)`,(0,X.checkStrictMode)(a,W0,a.opts.strictTypes)}var E0=class{constructor(a,W0,F0){if((0,J.validateKeywordUsage)(a,W0,F0),this.gen=a.gen,this.allErrors=a.allErrors,this.keyword=F0,this.data=a.data,this.schema=a.schema[F0],this.$data=W0.$data&&a.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,X.schemaRefOrVal)(a,this.schema,F0,this.$data),this.schemaType=W0.schemaType,this.parentSchema=a.schema,this.params={},this.it=a,this.def=W0,this.$data)this.schemaCode=a.gen.const("vSchema",Y1(this.$data,a));else if(this.schemaCode=this.schemaValue,!(0,J.validSchemaType)(this.schema,W0.schemaType,W0.allowUndefined))throw Error(`${F0} value must be ${JSON.stringify(W0.schemaType)}`);if("code"in W0?W0.trackErrors:W0.errors!==!1)this.errsCount=a.gen.const("_errs",H.default.errors)}result(a,W0,F0){this.failResult((0,G.not)(a),W0,F0)}failResult(a,W0,F0){if(this.gen.if(a),F0)F0();else this.error();if(W0){if(this.gen.else(),W0(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(a,W0){this.failResult((0,G.not)(a),void 0,W0)}fail(a){if(a===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(a),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(a){if(!this.$data)return this.fail(a);let{schemaCode:W0}=this;this.fail(G._`${W0} !== undefined && (${(0,G.or)(this.invalid$data(),a)})`)}error(a,W0,F0){if(W0){this.setParams(W0),this._error(a,F0),this.setParams({});return}this._error(a,F0)}_error(a,W0){(a?Z.reportExtraError:Z.reportError)(this,this.def.error,W0)}$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(a){if(!this.allErrors)this.gen.if(a)}setParams(a,W0){if(W0)Object.assign(this.params,a);else this.params=a}block$data(a,W0,F0=G.nil){this.gen.block(()=>{this.check$data(a,F0),W0()})}check$data(a=G.nil,W0=G.nil){if(!this.$data)return;let{gen:F0,schemaCode:f0,schemaType:u0,def:i0}=this;if(F0.if((0,G.or)(G._`${f0} === undefined`,W0)),a!==G.nil)F0.assign(a,!0);if(u0.length||i0.validateSchema){if(F0.elseIf(this.invalid$data()),this.$dataError(),a!==G.nil)F0.assign(a,!1)}F0.else()}invalid$data(){let{gen:a,schemaCode:W0,schemaType:F0,def:f0,it:u0}=this;return(0,G.or)(i0(),D1());function i0(){if(F0.length){if(!(W0 instanceof G.Name))throw Error("ajv implementation error");let k1=Array.isArray(F0)?F0:[F0];return G._`${(0,I.checkDataTypes)(k1,W0,u0.opts.strictNumbers,I.DataType.Wrong)}`}return G.nil}function D1(){if(f0.validateSchema){let k1=a.scopeValue("validate$data",{ref:f0.validateSchema});return G._`!${k1}(${W0})`}return G.nil}}subschema(a,W0){let F0=(0,K.getSubschema)(this.it,a);(0,K.extendSubschemaData)(F0,this.it,a),(0,K.extendSubschemaMode)(F0,a);let f0={...this.it,...F0,items:void 0,props:void 0};return N(f0,W0),f0}mergeEvaluated(a,W0){let{it:F0,gen:f0}=this;if(!F0.opts.unevaluated)return;if(F0.props!==!0&&a.props!==void 0)F0.props=X.mergeEvaluated.props(f0,a.props,F0.props,W0);if(F0.items!==!0&&a.items!==void 0)F0.items=X.mergeEvaluated.items(f0,a.items,F0.items,W0)}mergeValidEvaluated(a,W0){let{it:F0,gen:f0}=this;if(F0.opts.unevaluated&&(F0.props!==!0||F0.items!==!0))return f0.if(W0,()=>this.mergeEvaluated(a,G.Name)),!0}};$.KeywordCxt=E0;function G0(a,W0,F0,f0){let u0=new E0(a,F0,W0);if("code"in F0)F0.code(u0,f0);else if(u0.$data&&F0.validate)(0,J.funcKeywordCode)(u0,F0);else if("macro"in F0)(0,J.macroKeywordCode)(u0,F0);else if(F0.compile||F0.validate)(0,J.funcKeywordCode)(u0,F0)}let T0=/^\/(?:[^~]|~0|~1)*$/,b0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y1(a,{dataLevel:W0,dataNames:F0,dataPathArr:f0}){let u0,i0;if(a==="")return H.default.rootData;if(a[0]==="/"){if(!T0.test(a))throw Error(`Invalid JSON-pointer: ${a}`);u0=a,i0=H.default.rootData}else{let b1=b0.exec(a);if(!b1)throw Error(`Invalid JSON-pointer: ${a}`);let A0=+b1[1];if(u0=b1[2],u0==="#"){if(A0>=W0)throw Error(u1("property/index",A0));return f0[W0-A0]}if(A0>W0)throw Error(u1("data",A0));if(i0=F0[W0-A0],!u0)return i0}let D1=i0,k1=u0.split("/");for(let b1 of k1)if(b1)i0=G._`${i0}${(0,G.getProperty)((0,X.unescapeJsonPointer)(b1))}`,D1=G._`${D1} && ${i0}`;return D1;function u1(b1,A0){return`Cannot access ${b1} ${A0} levels up, current level is ${W0}`}}$.getData=Y1}),qH=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});var Y=class extends Error{constructor(z){super("validation failed");this.errors=z,this.ajv=this.validation=!0}};$.default=Y}),gI=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gw();var z=class extends Error{constructor(U,I,Q,J){super(J||`can't resolve reference ${Q} from id ${I}`);this.missingRef=(0,Y.resolveUrl)(U,I,Q),this.missingSchema=(0,Y.normalizeId)((0,Y.getFullPath)(U,this.missingRef))}};$.default=z}),yw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.resolveSchema=$.getCompilingSchema=$.resolveRef=$.compileSchema=$.SchemaEnv=void 0;let Y=L1(),z=qH(),U=U5(),I=gw(),Q=v1(),J=SI();var K=class{constructor(w){var O;this.refs={},this.dynamicAnchors={};let D;if(typeof w.schema=="object")D=w.schema;this.schema=w.schema,this.schemaId=w.schemaId,this.root=w.root||this,this.baseId=(O=w.baseId)!==null&&O!==void 0?O:(0,I.normalizeId)(D===null||D===void 0?void 0:D[w.schemaId||"$id"]),this.schemaPath=w.schemaPath,this.localRefs=w.localRefs,this.meta=w.meta,this.$async=D===null||D===void 0?void 0:D.$async,this.refs={}}};$.SchemaEnv=K;function G(w){let O=X.call(this,w);if(O)return O;let D=(0,I.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:N,lines:B}=this.opts.code,{ownProperties:T}=this.opts,A=new Y.CodeGen(this.scope,{es5:N,lines:B,ownProperties:T}),j;if(w.$async)j=A.scopeValue("Error",{ref:z.default,code:Y._`require("ajv/dist/runtime/validation_error").default`});let C=A.scopeName("validate");w.validateName=C;let b={gen:A,allErrors:this.opts.allErrors,data:U.default.data,parentData:U.default.parentData,parentDataProperty:U.default.parentDataProperty,dataNames:[U.default.data],dataPathArr:[Y.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,Y.stringify)(w.schema)}:{ref:w.schema}),validateName:C,ValidationError:j,schema:w.schema,schemaEnv:w,rootId:D,baseId:w.baseId||D,schemaPath:Y.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:Y._`""`,opts:this.opts,self:this},k;try{this._compilations.add(w),(0,J.validateFunctionCode)(b),A.optimize(this.opts.code.optimize);let h=A.toString();if(k=`${A.scopeRefs(U.default.scope)}return ${h}`,this.opts.code.process)k=this.opts.code.process(k,w);let i=Function(`${U.default.self}`,`${U.default.scope}`,k)(this,this.scope.get());if(this.scope.value(C,{ref:i}),i.errors=null,i.schema=w.schema,i.schemaEnv=w,w.$async)i.$async=!0;if(this.opts.code.source===!0)i.source={validateName:C,validateCode:h,scopeValues:A._values};if(this.opts.unevaluated){let{props:c,items:U0}=b;if(i.evaluated={props:c instanceof Y.Name?void 0:c,items:U0 instanceof Y.Name?void 0:U0,dynamicProps:c instanceof Y.Name,dynamicItems:U0 instanceof Y.Name},i.source)i.source.evaluated=(0,Y.stringify)(i.evaluated)}return w.validate=i,w}catch(h){if(delete w.validate,delete w.validateName,k)this.logger.error("Error compiling schema, function code:",k);throw h}finally{this._compilations.delete(w)}}$.compileSchema=G;function H(w,O,D){var N;D=(0,I.resolveUrl)(this.opts.uriResolver,O,D);let B=w.refs[D];if(B)return B;let T=q.call(this,w,D);if(T===void 0){let A=(N=w.localRefs)===null||N===void 0?void 0:N[D],{schemaId:j}=this.opts;if(A)T=new K({schema:A,schemaId:j,root:w,baseId:O})}if(T===void 0)return;return w.refs[D]=W.call(this,T)}$.resolveRef=H;function W(w){if((0,I.inlineRef)(w.schema,this.opts.inlineRefs))return w.schema;return w.validate?w:G.call(this,w)}function X(w){for(let O of this._compilations)if(Z(O,w))return O}$.getCompilingSchema=X;function Z(w,O){return w.schema===O.schema&&w.root===O.root&&w.baseId===O.baseId}function q(w,O){let D;while(typeof(D=this.refs[O])=="string")O=D;return D||this.schemas[O]||V.call(this,w,O)}function V(w,O){let D=this.opts.uriResolver.parse(O),N=(0,I._getFullPath)(this.opts.uriResolver,D),B=(0,I.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&N===B)return M.call(this,D,w);let T=(0,I.normalizeId)(N),A=this.refs[T]||this.schemas[T];if(typeof A=="string"){let j=V.call(this,w,A);if(typeof(j===null||j===void 0?void 0:j.schema)!=="object")return;return M.call(this,D,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)(O)){let{schema:j}=A,{schemaId:C}=this.opts,b=j[C];if(b)B=(0,I.resolveUrl)(this.opts.uriResolver,B,b);return new K({schema:j,schemaId:C,root:w,baseId:B})}return M.call(this,D,A)}$.resolveSchema=V;let F=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function M(w,{baseId:O,schema:D,root:N}){var B;if(((B=w.fragment)===null||B===void 0?void 0:B[0])!=="/")return;for(let j of w.fragment.slice(1).split("/")){if(typeof D==="boolean")return;let C=D[(0,Q.unescapeFragment)(j)];if(C===void 0)return;D=C;let b=typeof D==="object"&&D[this.opts.schemaId];if(!F.has(j)&&b)O=(0,I.resolveUrl)(this.opts.uriResolver,O,b)}let T;if(typeof D!="boolean"&&D.$ref&&!(0,Q.schemaHasRulesButRef)(D,this.RULES)){let j=(0,I.resolveUrl)(this.opts.uriResolver,O,D.$ref);T=V.call(this,N,j)}let{schemaId:A}=this.opts;if(T=T||new K({schema:D,schemaId:A,root:N,baseId:O}),T.schema!==T.root.schema)return T}}),fu0=R0(($,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}}),mt=R0(($,Y)=>{let z=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),U=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 F="",M=0,w=0;for(w=0;w=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";F+=V[w];break}for(w+=1;w=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";F+=V[w]}return F}let Q=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function J(V){return V.length=0,!0}function K(V,F,M){if(V.length){let w=I(V);if(w!=="")F.push(w);else return M.error=!0,!1;V.length=0}return!0}function G(V){let F=0,M={error:!1,address:"",zone:""},w=[],O=[],D=!1,N=!1,B=K;for(let T=0;T7){M.error=!0;break}if(T>0&&V[T-1]===":")D=!0;w.push(":");continue}else if(A==="%"){if(!B(O,w,M))break;B=J}else{O.push(A);continue}}if(O.length)if(B===J)M.zone=O.join("");else if(N)w.push(O.join(""));else w.push(I(O));return M.address=w.join(""),M}function H(V){if(W(V,":")<2)return{host:V,isIPV6:!1};let F=G(V);if(!F.error){let{address:M,address:w}=F;if(F.zone)M+="%"+F.zone,w+="%25"+F.zone;return{host:M,isIPV6:!0,escapedHost:w}}else return{host:V,isIPV6:!1}}function W(V,F){let M=0;for(let w=0;w{let{isUUID:z}=mt(),U=/([\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(U);if(C){let b=j.scheme||A.scheme||"urn";A.nid=C[1].toLowerCase(),A.nss=C[2];let k=T(`${b}:${j.nid||A.nid}`);if(A.path=void 0,k)A=k.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(),k=T(`${C}:${j.nid||b}`);if(k)A=k.serialize(A,j);let h=A,i=A.nss;return h.path=`${b||j.nid}:${i}`,j.skipEscape=!0,h}function q(A,j){let C=A;if(C.uuid=C.nss,C.nss=void 0,!j.tolerant&&(!C.uuid||!z(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 F={scheme:"http",domainHost:!0,parse:K,serialize:G},M={scheme:"https",domainHost:F.domainHost,parse:K,serialize:G},w={scheme:"ws",domainHost:!0,parse:H,serialize:W},O={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},B={http:F,https:M,ws:w,wss:O,urn:{scheme:"urn",parse:X,serialize:Z,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:q,serialize:V,skipNormalize:!0}};Object.setPrototypeOf(B,null);function T(A){return A&&(B[A]||B[A.toLowerCase()])||void 0}Y.exports={wsIsSecure:J,SCHEMES:B,isValidSchemeName:Q,getSchemeHandler:T}}),bu0=R0(($,Y)=>{let{normalizeIPv6:z,removeDotSegments:U,recomposeAuthority:I,normalizeComponentEncoding:Q,isIPv4:J,nonSimpleDomain:K}=mt(),{SCHEMES:G,getSchemeHandler:H}=uu0();function W(O,D){if(typeof O==="string")O=V(M(O,D),D);else if(typeof O==="object")O=M(V(O,D),D);return O}function X(O,D,N){let B=N?Object.assign({scheme:"null"},N):{scheme:"null"},T=Z(M(O,B),M(D,B),B,!0);return B.skipEscape=!0,V(T,B)}function Z(O,D,N,B){let T={};if(!B)O=M(V(O,N),N),D=M(V(D,N),N);if(N=N||{},!N.tolerant&&D.scheme)T.scheme=D.scheme,T.userinfo=D.userinfo,T.host=D.host,T.port=D.port,T.path=U(D.path||""),T.query=D.query;else{if(D.userinfo!==void 0||D.host!==void 0||D.port!==void 0)T.userinfo=D.userinfo,T.host=D.host,T.port=D.port,T.path=U(D.path||""),T.query=D.query;else{if(!D.path)if(T.path=O.path,D.query!==void 0)T.query=D.query;else T.query=O.query;else{if(D.path[0]==="/")T.path=U(D.path);else{if((O.userinfo!==void 0||O.host!==void 0||O.port!==void 0)&&!O.path)T.path="/"+D.path;else if(!O.path)T.path=D.path;else T.path=O.path.slice(0,O.path.lastIndexOf("/")+1)+D.path;T.path=U(T.path)}T.query=D.query}T.userinfo=O.userinfo,T.host=O.host,T.port=O.port}T.scheme=O.scheme}return T.fragment=D.fragment,T}function q(O,D,N){if(typeof O==="string")O=unescape(O),O=V(Q(M(O,N),!0),{...N,skipEscape:!0});else if(typeof O==="object")O=V(Q(O,!0),{...N,skipEscape:!0});if(typeof D==="string")D=unescape(D),D=V(Q(M(D,N),!0),{...N,skipEscape:!0});else if(typeof D==="object")D=V(Q(D,!0),{...N,skipEscape:!0});return O.toLowerCase()===D.toLowerCase()}function V(O,D){let N={host:O.host,scheme:O.scheme,userinfo:O.userinfo,port:O.port,path:O.path,query:O.query,nid:O.nid,nss:O.nss,uuid:O.uuid,fragment:O.fragment,reference:O.reference,resourceName:O.resourceName,secure:O.secure,error:""},B=Object.assign({},D),T=[],A=H(B.scheme||N.scheme);if(A&&A.serialize)A.serialize(N,B);if(N.path!==void 0)if(!B.skipEscape){if(N.path=escape(N.path),N.scheme!==void 0)N.path=N.path.split("%3A").join(":")}else N.path=unescape(N.path);if(B.reference!=="suffix"&&N.scheme)T.push(N.scheme,":");let j=I(N);if(j!==void 0){if(B.reference!=="suffix")T.push("//");if(T.push(j),N.path&&N.path[0]!=="/")T.push("/")}if(N.path!==void 0){let C=N.path;if(!B.absolutePath&&(!A||!A.absolutePath))C=U(C);if(j===void 0&&C[0]==="/"&&C[1]==="/")C="/%2F"+C.slice(2);T.push(C)}if(N.query!==void 0)T.push("?",N.query);if(N.fragment!==void 0)T.push("#",N.fragment);return T.join("")}let F=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function M(O,D){let N=Object.assign({},D),B={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},T=!1;if(N.reference==="suffix")if(N.scheme)O=N.scheme+":"+O;else O="//"+O;let A=O.match(F);if(A){if(B.scheme=A[1],B.userinfo=A[3],B.host=A[4],B.port=parseInt(A[5],10),B.path=A[6]||"",B.query=A[7],B.fragment=A[8],isNaN(B.port))B.port=A[5];if(B.host)if(J(B.host)===!1){let C=z(B.host);B.host=C.host.toLowerCase(),T=C.isIPV6}else T=!0;if(B.scheme===void 0&&B.userinfo===void 0&&B.host===void 0&&B.port===void 0&&B.query===void 0&&!B.path)B.reference="same-document";else if(B.scheme===void 0)B.reference="relative";else if(B.fragment===void 0)B.reference="absolute";else B.reference="uri";if(N.reference&&N.reference!=="suffix"&&N.reference!==B.reference)B.error=B.error||"URI is not a "+N.reference+" reference.";let j=H(N.scheme||B.scheme);if(!N.unicodeSupport&&(!j||!j.unicodeSupport)){if(B.host&&(N.domainHost||j&&j.domainHost)&&T===!1&&K(B.host))try{B.host=URL.domainToASCII(B.host.toLowerCase())}catch(C){B.error=B.error||"Host's domain name can not be converted to ASCII: "+C}}if(!j||j&&!j.skipNormalize){if(O.indexOf("%")!==-1){if(B.scheme!==void 0)B.scheme=unescape(B.scheme);if(B.host!==void 0)B.host=unescape(B.host)}if(B.path)B.path=escape(unescape(B.path));if(B.fragment)B.fragment=encodeURI(decodeURIComponent(B.fragment))}if(j&&j.parse)j.parse(B,N)}else B.error=B.error||"URI can not be parsed.";return B}let w={SCHEMES:G,normalize:W,resolve:X,resolveComponent:Z,equal:q,serialize:V,parse:M};Y.exports=w,Y.exports.default=w,Y.exports.fastUri=w}),iu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=bu0();Y.code='require("ajv/dist/runtime/uri").default',$.default=Y}),IS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=void 0;var Y=SI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return Y.KeywordCxt}});var z=L1();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}});let U=qH(),I=gI(),Q=nt(),J=yw(),K=L1(),G=gw(),H=hw(),W=v1(),X=fu0(),Z=iu0(),q=(g,p)=>new RegExp(g,p);q.code="new RegExp";let V=["removeAdditional","useDefaults","coerceTypes"],F=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."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},O=200;function D(g){var p,e,y,s,Y0,M0,E0,G0,T0,b0,Y1,a,W0,F0,f0,u0,i0,D1,k1,u1,b1,A0,I0,P,v;let u=g.strict,r=(p=g.code)===null||p===void 0?void 0:p.optimize,X0=r===!0||r===void 0?1:r||0,Q0=(y=(e=g.code)===null||e===void 0?void 0:e.regExp)!==null&&y!==void 0?y:q,Z0=(s=g.uriResolver)!==null&&s!==void 0?s:Z.default;return{strictSchema:(M0=(Y0=g.strictSchema)!==null&&Y0!==void 0?Y0:u)!==null&&M0!==void 0?M0:!0,strictNumbers:(G0=(E0=g.strictNumbers)!==null&&E0!==void 0?E0:u)!==null&&G0!==void 0?G0:!0,strictTypes:(b0=(T0=g.strictTypes)!==null&&T0!==void 0?T0:u)!==null&&b0!==void 0?b0:"log",strictTuples:(a=(Y1=g.strictTuples)!==null&&Y1!==void 0?Y1:u)!==null&&a!==void 0?a:"log",strictRequired:(F0=(W0=g.strictRequired)!==null&&W0!==void 0?W0:u)!==null&&F0!==void 0?F0:!1,code:g.code?{...g.code,optimize:X0,regExp:Q0}:{optimize:X0,regExp:Q0},loopRequired:(f0=g.loopRequired)!==null&&f0!==void 0?f0:O,loopEnum:(u0=g.loopEnum)!==null&&u0!==void 0?u0:O,meta:(i0=g.meta)!==null&&i0!==void 0?i0:!0,messages:(D1=g.messages)!==null&&D1!==void 0?D1:!0,inlineRefs:(k1=g.inlineRefs)!==null&&k1!==void 0?k1:!0,schemaId:(u1=g.schemaId)!==null&&u1!==void 0?u1:"$id",addUsedSchema:(b1=g.addUsedSchema)!==null&&b1!==void 0?b1:!0,validateSchema:(A0=g.validateSchema)!==null&&A0!==void 0?A0:!0,validateFormats:(I0=g.validateFormats)!==null&&I0!==void 0?I0:!0,unicodeRegExp:(P=g.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(v=g.int32range)!==null&&v!==void 0?v:!0,uriResolver:Z0}}var N=class{constructor(g={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,g=this.opts={...g,...D(g)};let{es5:p,lines:e}=this.opts.code;this.scope=new K.ValueScope({scope:{},prefixes:F,es5:p,lines:e}),this.logger=h(g.logger);let y=g.validateFormats;if(g.validateFormats=!1,this.RULES=(0,Q.getRules)(),B.call(this,M,g,"NOT SUPPORTED"),B.call(this,w,g,"DEPRECATED","warn"),this._metaOpts=b.call(this),g.formats)j.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),g.keywords)C.call(this,g.keywords);if(typeof g.meta=="object")this.addMetaSchema(g.meta);A.call(this),g.validateFormats=y}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:g,meta:p,schemaId:e}=this.opts,y=X;if(e==="id")y={...X},y.id=y.$id,delete y.$id;if(p&&g)this.addMetaSchema(y,y[e],!1)}defaultMeta(){let{meta:g,schemaId:p}=this.opts;return this.opts.defaultMeta=typeof g=="object"?g[p]||g:void 0}validate(g,p){let e;if(typeof g=="string"){if(e=this.getSchema(g),!e)throw Error(`no schema with key or ref "${g}"`)}else e=this.compile(g);let y=e(p);if(!("$async"in e))this.errors=e.errors;return y}compile(g,p){let e=this._addSchema(g,p);return e.validate||this._compileSchemaEnv(e)}compileAsync(g,p){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:e}=this.opts;return y.call(this,g,p);async function y(T0,b0){await s.call(this,T0.$schema);let Y1=this._addSchema(T0,b0);return Y1.validate||Y0.call(this,Y1)}async function s(T0){if(T0&&!this.getSchema(T0))await y.call(this,{$ref:T0},!0)}async function Y0(T0){try{return this._compileSchemaEnv(T0)}catch(b0){if(!(b0 instanceof I.default))throw b0;return M0.call(this,b0),await E0.call(this,b0.missingSchema),Y0.call(this,T0)}}function M0({missingSchema:T0,missingRef:b0}){if(this.refs[T0])throw Error(`AnySchema ${T0} is loaded but ${b0} cannot be resolved`)}async function E0(T0){let b0=await G0.call(this,T0);if(!this.refs[T0])await s.call(this,b0.$schema);if(!this.refs[T0])this.addSchema(b0,T0,p)}async function G0(T0){let b0=this._loading[T0];if(b0)return b0;try{return await(this._loading[T0]=e(T0))}finally{delete this._loading[T0]}}}addSchema(g,p,e,y=this.opts.validateSchema){if(Array.isArray(g)){for(let Y0 of g)this.addSchema(Y0,void 0,e,y);return this}let s;if(typeof g==="object"){let{schemaId:Y0}=this.opts;if(s=g[Y0],s!==void 0&&typeof s!="string")throw Error(`schema ${Y0} must be string`)}return p=(0,G.normalizeId)(p||s),this._checkUnique(p),this.schemas[p]=this._addSchema(g,e,p,y,!0),this}addMetaSchema(g,p,e=this.opts.validateSchema){return this.addSchema(g,p,!0,e),this}validateSchema(g,p){if(typeof g=="boolean")return!0;let e;if(e=g.$schema,e!==void 0&&typeof e!="string")throw Error("$schema must be a string");if(e=e||this.opts.defaultMeta||this.defaultMeta(),!e)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let y=this.validate(e,g);if(!y&&p){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return y}getSchema(g){let p;while(typeof(p=T.call(this,g))=="string")g=p;if(p===void 0){let{schemaId:e}=this.opts,y=new J.SchemaEnv({schema:{},schemaId:e});if(p=J.resolveSchema.call(this,y,g),!p)return;this.refs[g]=p}return p.validate||this._compileSchemaEnv(p)}removeSchema(g){if(g instanceof RegExp)return this._removeAllSchemas(this.schemas,g),this._removeAllSchemas(this.refs,g),this;switch(typeof g){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let p=T.call(this,g);if(typeof p=="object")this._cache.delete(p.schema);return delete this.schemas[g],delete this.refs[g],this}case"object":{let p=g;this._cache.delete(p);let e=g[this.opts.schemaId];if(e)e=(0,G.normalizeId)(e),delete this.schemas[e],delete this.refs[e];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(g){for(let p of g)this.addKeyword(p);return this}addKeyword(g,p){let e;if(typeof g=="string"){if(e=g,typeof p=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),p.keyword=e}else if(typeof g=="object"&&p===void 0){if(p=g,e=p.keyword,Array.isArray(e)&&!e.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(c.call(this,e,p),!p)return(0,W.eachItem)(e,(s)=>U0.call(this,s)),this;d.call(this,p);let y={...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)};return(0,W.eachItem)(e,y.type.length===0?(s)=>U0.call(this,s,y):(s)=>y.type.forEach((Y0)=>U0.call(this,s,y,Y0))),this}getKeyword(g){let p=this.RULES.all[g];return typeof p=="object"?p.definition:!!p}removeKeyword(g){let{RULES:p}=this;delete p.keywords[g],delete p.all[g];for(let e of p.rules){let y=e.rules.findIndex((s)=>s.keyword===g);if(y>=0)e.rules.splice(y,1)}return this}addFormat(g,p){if(typeof p=="string")p=new RegExp(p);return this.formats[g]=p,this}errorsText(g=this.errors,{separator:p=", ",dataVar:e="data"}={}){if(!g||g.length===0)return"No errors";return g.map((y)=>`${e}${y.instancePath} ${y.message}`).reduce((y,s)=>y+p+s)}$dataMetaSchema(g,p){let e=this.RULES.all;g=JSON.parse(JSON.stringify(g));for(let y of p){let s=y.split("/").slice(1),Y0=g;for(let M0 of s)Y0=Y0[M0];for(let M0 in e){let E0=e[M0];if(typeof E0!="object")continue;let{$data:G0}=E0.definition,T0=Y0[M0];if(G0&&T0)Y0[M0]=$0(T0)}}return g}_removeAllSchemas(g,p){for(let e in g){let y=g[e];if(!p||p.test(e)){if(typeof y=="string")delete g[e];else if(y&&!y.meta)this._cache.delete(y.schema),delete g[e]}}}_addSchema(g,p,e,y=this.opts.validateSchema,s=this.opts.addUsedSchema){let Y0,{schemaId:M0}=this.opts;if(typeof g=="object")Y0=g[M0];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof g!="boolean")throw Error("schema must be object or boolean");let E0=this._cache.get(g);if(E0!==void 0)return E0;e=(0,G.normalizeId)(Y0||e);let G0=G.getSchemaRefs.call(this,g,e);if(E0=new J.SchemaEnv({schema:g,schemaId:M0,meta:p,baseId:e,localRefs:G0}),this._cache.set(E0.schema,E0),s&&!e.startsWith("#")){if(e)this._checkUnique(e);this.refs[e]=E0}if(y)this.validateSchema(g,!0);return E0}_checkUnique(g){if(this.schemas[g]||this.refs[g])throw Error(`schema with key or id "${g}" already exists`)}_compileSchemaEnv(g){if(g.meta)this._compileMetaSchema(g);else J.compileSchema.call(this,g);if(!g.validate)throw Error("ajv implementation error");return g.validate}_compileMetaSchema(g){let p=this.opts;this.opts=this._metaOpts;try{J.compileSchema.call(this,g)}finally{this.opts=p}}};N.ValidationError=U.default,N.MissingRefError=I.default,$.default=N;function B(g,p,e,y="error"){for(let s in g){let Y0=s;if(Y0 in p)this.logger[y](`${e}: option ${s}. ${g[Y0]}`)}}function T(g){return g=(0,G.normalizeId)(g),this.schemas[g]||this.refs[g]}function A(){let g=this.opts.schemas;if(!g)return;if(Array.isArray(g))this.addSchema(g);else for(let p in g)this.addSchema(g[p],p)}function j(){for(let g in this.opts.formats){let p=this.opts.formats[g];if(p)this.addFormat(g,p)}}function C(g){if(Array.isArray(g)){this.addVocabulary(g);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let p in g){let e=g[p];if(!e.keyword)e.keyword=p;this.addKeyword(e)}}function b(){let g={...this.opts};for(let p of V)delete g[p];return g}let k={log(){},warn(){},error(){}};function h(g){if(g===!1)return k;if(g===void 0)return console;if(g.log&&g.warn&&g.error)return g;throw Error("logger must implement log, warn and error methods")}let i=/^[a-z_$][a-z0-9_$:-]*$/i;function c(g,p){let{RULES:e}=this;if((0,W.eachItem)(g,(y)=>{if(e.keywords[y])throw Error(`Keyword ${y} is already defined`);if(!i.test(y))throw Error(`Keyword ${y} 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 U0(g,p,e){var y;let s=p===null||p===void 0?void 0:p.post;if(e&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:Y0}=this,M0=s?Y0.post:Y0.rules.find(({type:G0})=>G0===e);if(!M0)M0={type:e,rules:[]},Y0.rules.push(M0);if(Y0.keywords[g]=!0,!p)return;let E0={keyword:g,definition:{...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)}};if(p.before)x.call(this,M0,E0,p.before);else M0.rules.push(E0);Y0.all[g]=E0,(y=p.implements)===null||y===void 0||y.forEach((G0)=>this.addKeyword(G0))}function x(g,p,e){let y=g.rules.findIndex((s)=>s.keyword===e);if(y>=0)g.rules.splice(y,0,p);else g.rules.push(p),this.logger.warn(`rule ${e} is not defined`)}function d(g){let{metaSchema:p}=g;if(p===void 0)return;if(g.$data&&this.opts.$data)p=$0(p);g.validateSchema=this.compile(p,!0)}let t={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $0(g){return{anyOf:[g,t]}}}),cu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$.default=Y}),QS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.callRef=$.getValidate=void 0;let Y=gI(),z=I5(),U=L1(),I=U5(),Q=yw(),J=v1(),K={keyword:"$ref",schemaType:"string",code(W){let{gen:X,schema:Z,it:q}=W,{baseId:V,schemaEnv:F,validateName:M,opts:w,self:O}=q,{root:D}=F;if((Z==="#"||Z==="#/")&&V===D.baseId)return B();let N=Q.resolveRef.call(O,D,V,Z);if(N===void 0)throw new Y.default(q.opts.uriResolver,V,Z);if(N instanceof Q.SchemaEnv)return T(N);return A(N);function B(){if(F===D)return H(W,M,F,F.$async);let j=X.scopeValue("root",{ref:D});return H(W,U._`${j}.validate`,D,D.$async)}function T(j){H(W,G(W,j),j,j.$async)}function A(j){let C=X.scopeValue("schema",w.code.source===!0?{ref:j,code:(0,U.stringify)(j)}:{ref:j}),b=X.name("valid"),k=W.subschema({schema:j,dataTypes:[],schemaPath:U.nil,topSchemaRef:C,errSchemaPath:Z},b);W.mergeEvaluated(k),W.ok(b)}}};function G(W,X){let{gen:Z}=W;return X.validate?Z.scopeValue("validate",{ref:X.validate}):U._`${Z.scopeValue("wrapper",{ref:X})}.validate`}$.getValidate=G;function H(W,X,Z,q){let{gen:V,it:F}=W,{allErrors:M,schemaEnv:w,opts:O}=F,D=O.passContext?I.default.this:U.nil;if(q)N();else B();function N(){if(!w.$async)throw Error("async schema referenced by sync schema");let j=V.let("valid");V.try(()=>{if(V.code(U._`await ${(0,z.callValidateCode)(W,X,D)}`),A(X),!M)V.assign(j,!0)},(C)=>{if(V.if(U._`!(${C} instanceof ${F.ValidationError})`,()=>V.throw(C)),T(C),!M)V.assign(j,!1)}),W.ok(j)}function B(){W.result((0,z.callValidateCode)(W,X,D),()=>A(X),()=>T(X))}function T(j){let C=U._`${j}.errors`;V.assign(I.default.vErrors,U._`${I.default.vErrors} === null ? ${C} : ${I.default.vErrors}.concat(${C})`),V.assign(I.default.errors,U._`${I.default.vErrors}.length`)}function A(j){var C;if(!F.opts.unevaluated)return;let b=(C=Z===null||Z===void 0?void 0:Z.validate)===null||C===void 0?void 0:C.evaluated;if(F.props!==!0)if(b&&!b.dynamicProps){if(b.props!==void 0)F.props=J.mergeEvaluated.props(V,b.props,F.props)}else{let k=V.var("props",U._`${j}.evaluated.props`);F.props=J.mergeEvaluated.props(V,k,F.props,U.Name)}if(F.items!==!0)if(b&&!b.dynamicItems){if(b.items!==void 0)F.items=J.mergeEvaluated.items(V,b.items,F.items)}else{let k=V.var("items",U._`${j}.evaluated.items`);F.items=J.mergeEvaluated.items(V,k,F.items,U.Name)}}}$.callRef=H,$.default=K}),lt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=cu0(),z=QS(),U=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Y.default,z.default];$.default=U}),nu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=Y.operators,U={maximum:{okStr:"<=",ok:z.LTE,fail:z.GT},minimum:{okStr:">=",ok:z.GTE,fail:z.LT},exclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},exclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},I={keyword:Object.keys(U),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:Q,schemaCode:J})=>Y.str`must be ${U[Q].okStr} ${J}`,params:({keyword:Q,schemaCode:J})=>Y._`{comparison: ${U[Q].okStr}, limit: ${J}}`},code(Q){let{keyword:J,data:K,schemaCode:G}=Q;Q.fail$data(Y._`${K} ${U[J].fail} ${G} || isNaN(${K})`)}};$.default=I}),pu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:U})=>Y.str`must be multiple of ${U}`,params:({schemaCode:U})=>Y._`{multipleOf: ${U}}`},code(U){let{gen:I,data:Q,schemaCode:J,it:K}=U,G=K.opts.multipleOfPrecision,H=I.let("res"),W=G?Y._`Math.abs(Math.round(${H}) - ${H}) > 1e-${G}`:Y._`${H} !== parseInt(${H})`;U.fail$data(Y._`(${J} === 0 || (${H} = ${Q}/${J}, ${W}))`)}};$.default=z}),du0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});function Y(z){let U=z.length,I=0,Q=0,J;while(Q=55296&&J<=56319&&Q{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U=du0(),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,z.useFunc)(Q.gen,U.default)}(${K})`;Q.fail$data(Y._`${X} ${W} ${G}`)}};$.default=I}),lu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=v1(),U=L1(),I={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:Q})=>U.str`must match pattern "${Q}"`,params:({schemaCode:Q})=>U._`{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"?U._`new RegExp`:(0,z.useFunc)(J,q),F=J.let("valid");J.try(()=>J.assign(F,U._`${V}(${W}, ${Z}).test(${K})`),()=>J.assign(F,!1)),Q.fail$data(U._`!${F}`)}else{let q=(0,Y.usePattern)(Q,H);Q.fail$data(U._`!${q}.test(${K})`)}}};$.default=I}),ou0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:U,schemaCode:I}){let Q=U==="maxProperties"?"more":"fewer";return Y.str`must NOT have ${Q} than ${I} properties`},params:({schemaCode:U})=>Y._`{limit: ${U}}`},code(U){let{keyword:I,data:Q,schemaCode:J}=U,K=I==="maxProperties"?Y.operators.GT:Y.operators.LT;U.fail$data(Y._`Object.keys(${Q}).length ${K} ${J}`)}};$.default=z}),ru0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=v1(),I={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:Q}})=>z.str`must have required property '${Q}'`,params:({params:{missingProperty:Q}})=>z._`{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 F();if(Z.strictRequired){let O=Q.parentSchema.properties,{definedProperties:D}=Q.it;for(let N of K)if((O===null||O===void 0?void 0:O[N])===void 0&&!D.has(N)){let B=`required property "${N}" is not defined at "${X.schemaEnv.baseId+X.errSchemaPath}" (strictRequired)`;(0,U.checkStrictMode)(X,B,X.opts.strictRequired)}}function V(){if(q||W)Q.block$data(z.nil,M);else for(let O of K)(0,Y.checkReportMissingProp)(Q,O)}function F(){let O=J.let("missing");if(q||W){let D=J.let("valid",!0);Q.block$data(D,()=>w(O,D)),Q.ok(D)}else J.if((0,Y.checkMissingProp)(Q,K,O)),(0,Y.reportMissingProp)(Q,O),J.else()}function M(){J.forOf("prop",G,(O)=>{Q.setParams({missingProperty:O}),J.if((0,Y.noPropertyInData)(J,H,O,Z.ownProperties),()=>Q.error())})}function w(O,D){Q.setParams({missingProperty:O}),J.forOf(O,G,()=>{J.assign(D,(0,Y.propertyInData)(J,H,O,Z.ownProperties)),J.if((0,z.not)(D),()=>{Q.error(),J.break()})},z.nil)}}};$.default=I}),su0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:U,schemaCode:I}){let Q=U==="maxItems"?"more":"fewer";return Y.str`must NOT have ${Q} than ${I} items`},params:({schemaCode:U})=>Y._`{limit: ${U}}`},code(U){let{keyword:I,data:Q,schemaCode:J}=U,K=I==="maxItems"?Y.operators.GT:Y.operators.LT;U.fail$data(Y._`${Q}.length ${K} ${J}`)}};$.default=z}),JS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=dt();Y.code='require("ajv/dist/runtime/equal").default',$.default=Y}),au0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hw(),z=L1(),U=v1(),I=JS(),Q={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:J,j:K}})=>z.str`must NOT have duplicate items (items ## ${K} and ${J} are identical)`,params:({params:{i:J,j:K}})=>z._`{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"),F=X.items?(0,Y.getSchemaTypes)(X.items):[];J.block$data(V,M,z._`${Z} === false`),J.ok(V);function M(){let N=K.let("i",z._`${G}.length`),B=K.let("j");J.setParams({i:N,j:B}),K.assign(V,!0),K.if(z._`${N} > 1`,()=>(w()?O:D)(N,B))}function w(){return F.length>0&&!F.some((N)=>N==="object"||N==="array")}function O(N,B){let T=K.name("item"),A=(0,Y.checkDataTypes)(F,T,q.opts.strictNumbers,Y.DataType.Wrong),j=K.const("indices",z._`{}`);K.for(z._`;${N}--;`,()=>{if(K.let(T,z._`${G}[${N}]`),K.if(A,z._`continue`),F.length>1)K.if(z._`typeof ${T} == "string"`,z._`${T} += "_"`);K.if(z._`typeof ${j}[${T}] == "number"`,()=>{K.assign(B,z._`${j}[${T}]`),J.error(),K.assign(V,!1).break()}).code(z._`${j}[${T}] = ${N}`)})}function D(N,B){let T=(0,U.useFunc)(K,I.default),A=K.name("outer");K.label(A).for(z._`;${N}--;`,()=>K.for(z._`${B} = ${N}; ${B}--;`,()=>K.if(z._`${T}(${G}[${N}], ${G}[${B}])`,()=>{J.error(),K.assign(V,!1).break(A)})))}}};$.default=Q}),tu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U=JS(),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,z.useFunc)(J,U.default)}(${K}, ${H})`);else Q.fail(Y._`${W} !== ${K}`)}};$.default=I}),eu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U=JS(),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,z.useFunc)(J,U.default),F;if(Z||G)F=J.let("valid"),Q.block$data(F,M);else{if(!Array.isArray(H))throw Error("ajv implementation error");let O=J.const("vSchema",W);F=(0,Y.or)(...H.map((D,N)=>w(O,N)))}Q.pass(F);function M(){J.assign(F,!1),J.forOf("v",W,(O)=>J.if(Y._`${V()}(${K}, ${O})`,()=>J.assign(F,!0).break()))}function w(O,D){let N=H[D];return typeof N==="object"&&N!==null?Y._`${V()}(${K}, ${O}[${D}])`:Y._`${K} === ${N}`}}};$.default=I}),ot=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=nu0(),z=pu0(),U=mu0(),I=lu0(),Q=ou0(),J=ru0(),K=su0(),G=au0(),H=tu0(),W=eu0(),X=[Y.default,z.default,U.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}),rt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateAdditionalItems=void 0;let Y=L1(),z=v1(),U={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,z.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,z.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,(F)=>{if(Q.subschema({keyword:W,dataProp:F,dataPropType:z.Type.Num},V),!X.allErrors)K.if((0,Y.not)(V),()=>K.break())})}}$.validateAdditionalItems=I,$.default=U}),st=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateTuple=void 0;let Y=L1(),z=v1(),U=I5(),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,z.alwaysValidSchema)(G,K))return;J.ok((0,U.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=z.mergeEvaluated.items(H,G.length,q.items);let V=H.name("valid"),F=H.const("len",Y._`${X}.length`);G.forEach((w,O)=>{if((0,z.alwaysValidSchema)(q,w))return;H.if(Y._`${F} > ${O}`,()=>J.subschema({keyword:Z,schemaProp:O,dataProp:O},V)),J.ok(V)});function M(w){let{opts:O,errSchemaPath:D}=q,N=G.length,B=N===w.minItems&&(N===w.maxItems||w[K]===!1);if(O.strictTuples&&!B){let T=`"${Z}" is ${N}-tuple, but minItems or maxItems/${K} are not specified or different at path "${D}"`;(0,z.checkStrictMode)(q,T,O.strictTuples)}}}$.validateTuple=Q,$.default=I}),$b0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=st(),z={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(U)=>(0,Y.validateTuple)(U,"items")};$.default=z}),Yb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U=I5(),I=rt(),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,z.alwaysValidSchema)(H,K))return;if(W)(0,I.validateAdditionalItems)(J,W);else J.ok((0,U.validateArray)(J))}};$.default=Q}),zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,z.checkStrictMode)(H,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(X!==void 0&&W>X){(0,z.checkStrictMode)(H,'"minContains" > "maxContains" is always invalid'),I.fail();return}if((0,z.alwaysValidSchema)(H,J)){let D=Y._`${V} >= ${W}`;if(X!==void 0)D=Y._`${D} && ${V} <= ${X}`;I.pass(D);return}H.items=!0;let F=Q.name("valid");if(X===void 0&&W===1)w(F,()=>Q.if(F,()=>Q.break()));else if(W===0){if(Q.let(F,!0),X!==void 0)Q.if(Y._`${G}.length > 0`,M)}else Q.let(F,!1),M();I.result(F,()=>I.reset());function M(){let D=Q.name("_valid"),N=Q.let("count",0);w(D,()=>Q.if(D,()=>O(N)))}function w(D,N){Q.forRange("i",0,V,(B)=>{I.subschema({keyword:"contains",dataProp:B,dataPropType:z.Type.Num,compositeRule:!0},D),N()})}function O(D){if(Q.code(Y._`${D}++`),X===void 0)Q.if(Y._`${D} >= ${W}`,()=>Q.assign(F,!0).break());else if(Q.if(Y._`${D} > ${X}`,()=>Q.assign(F,!1).break()),W===1)Q.assign(F,!0);else Q.if(Y._`${D} >= ${W}`,()=>Q.assign(F,!0))}}};$.default=U}),KS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateSchemaDeps=$.validatePropertyDeps=$.error=void 0;let Y=L1(),z=v1(),U=I5();$.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 F=H[V];if(F.length===0)continue;let M=(0,U.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else W.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.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 F in H){if((0,z.alwaysValidSchema)(q,H[F]))continue;W.if((0,U.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=I}),Ub0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,z.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=U}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=U5(),I=v1(),Q={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:J})=>z._`{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 F=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);w(),J.ok(z._`${X} === ${U.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!M.length)N(T);else K.if(O(T),()=>N(T))})}function O(T){let A;if(F.length>8){let j=(0,I.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)A=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else A=z.nil;if(M.length)A=(0,z.or)(A,...M.map((j)=>z._`${(0,Y.usePattern)(J,j)}.test(${T})`));return(0,z.not)(A)}function D(T){K.code(z._`delete ${W}[${T}]`)}function N(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){D(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")B(T,A,!1),K.if((0,z.not)(A),()=>{J.reset(),D(T)});else if(B(T,A),!q)K.if((0,z.not)(A),()=>K.break())}}function B(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}),Ib0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=SI(),z=I5(),U=v1(),I=at(),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,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,z.propertyInData)(K,W,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}J.it.definedProperties.add(w),J.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){J.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=Q}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=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((B)=>(0,U.alwaysValidSchema)(X,G[B]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,I.evaluatedPropsToName)(K,X.props);let{props:w}=X;O();function O(){for(let B of q){if(F)D(B);if(X.allErrors)N(B);else K.var(M,!0),N(B),K.if(M)}}function D(B){for(let T in F)if(new RegExp(B).test(T))(0,U.checkStrictMode)(X,`property ${T} matches pattern ${B} (use allowMatchingProperties)`)}function N(B){K.forIn("key",H,(T)=>{K.if(z._`${(0,Y.usePattern)(J,B)}.test(${T})`,()=>{let A=V.includes(B);if(!A)J.subschema({keyword:"patternProperties",schemaProp:B,dataProp:T,dataPropType:I.Type.Str},M);if(X.opts.unevaluated&&w!==!0)K.assign(z._`${w}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,z.not)(M),()=>K.break())})})}}};$.default=Q}),Jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(U){let{gen:I,schema:Q,it:J}=U;if((0,Y.alwaysValidSchema)(J,Q)){U.fail();return}let K=I.name("valid");U.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),U.failResult(K,()=>U.reset(),()=>U.error())},error:{message:"must NOT be valid"}};$.default=z}),Kb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:I5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),Gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,F)=>{let M;if((0,z.alwaysValidSchema)(G,V))Q.var(Z,!0);else M=I.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},Z);if(F>0)Q.if(Y._`${Z} && ${W}`).assign(W,!1).assign(X,Y._`[${X}, ${F}]`).else();Q.if(Z,()=>{if(Q.assign(W,!0),Q.assign(X,F),M)I.mergeEvaluated(M,Y.Name)})})}}};$.default=U}),Hb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"allOf",schemaType:"array",code(U){let{gen:I,schema:Q,it:J}=U;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=U.subschema({keyword:"allOf",schemaProp:H},K);U.ok(K),U.mergeEvaluated(W)})}};$.default=z}),Wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,z.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 F=J.let("ifClause");Q.setParams({ifClause:F}),J.if(Z,V("then",F),V("else",F))}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 F=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);Q.mergeEvaluated(F)}function V(F,M){return()=>{let w=Q.subschema({keyword:F},Z);if(J.assign(X,Z),Q.mergeValidEvaluated(w,X),M)J.assign(M,Y._`${F}`);else Q.setParams({ifClause:F})}}}};function I(Q,J){let K=Q.schema[J];return K!==void 0&&!(0,z.alwaysValidSchema)(Q,K)}$.default=U}),Xb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:U,parentSchema:I,it:Q}){if(I.if===void 0)(0,Y.checkStrictMode)(Q,`"${U}" without "if" is ignored`)}};$.default=z}),tt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=rt(),z=$b0(),U=st(),I=Yb0(),Q=zb0(),J=KS(),K=Ub0(),G=at(),H=Ib0(),W=Qb0(),X=Jb0(),Z=Kb0(),q=Gb0(),V=Hb0(),F=Wb0(),M=Xb0();function w(O=!1){let D=[X.default,Z.default,q.default,V.default,F.default,M.default,K.default,G.default,J.default,H.default,W.default];if(O)D.push(z.default,I.default);else D.push(Y.default,U.default);return D.push(Q.default),D}$.default=w}),Zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:U})=>Y.str`must match format "${U}"`,params:({schemaCode:U})=>Y._`{format: ${U}}`},code(U,I){let{gen:Q,data:J,$data:K,schema:G,schemaCode:H,it:W}=U,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else M();function F(){let w=Q.scopeValue("formats",{ref:V.formats,code:X.code.formats}),O=Q.const("fDef",Y._`${w}[${H}]`),D=Q.let("fType"),N=Q.let("format");Q.if(Y._`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>Q.assign(D,Y._`${O}.type || "string"`).assign(N,Y._`${O}.validate`),()=>Q.assign(D,Y._`"string"`).assign(N,O)),U.fail$data((0,Y.or)(B(),T()));function B(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${N}`}function T(){let A=q.$async?Y._`(${O}.async ? await ${N}(${J}) : ${N}(${J}))`:Y._`${N}(${J})`,j=Y._`(typeof ${N} == "function" ? ${A} : ${N}.test(${J}))`;return Y._`${N} && ${N} !== true && ${D} === ${I} && !${j}`}}function M(){let w=V.formats[G];if(!w){B();return}if(w===!0)return;let[O,D,N]=T(w);if(O===I)U.pass(A());function B(){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 w=="object"&&!(w instanceof RegExp)&&w.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${N}(${J})`}return typeof D=="function"?Y._`${N}(${J})`:Y._`${N}.test(${J})`}}}};$.default=z}),et=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[Zb0().default];$.default=Y}),$e=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Ye=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=lt(),z=ot(),U=tt(),I=et(),Q=$e(),J=[Y.default,z.default,(0,U.default)(),I.default,Q.metadataVocabulary,Q.contentVocabulary];$.default=J}),qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(z){z.Tag="tag",z.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),GS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=qb0(),U=yw(),I=gI(),Q=v1(),J={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===z.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 F=G.let("valid",!1),M=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${M} == "string"`,()=>w(),()=>K.error(!1,{discrError:z.DiscrError.Tag,tag:M,tagName:V})),K.ok(F);function w(){let N=D();G.if(!1);for(let B in N)G.elseIf(Y._`${M} === ${B}`),G.assign(F,O(N[B]));G.else(),K.error(!1,{discrError:z.DiscrError.Mapping,tag:M,tagName:V}),G.endIf()}function O(N){let B=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:N},B);return K.mergeEvaluated(T,Y.Name),B}function D(){var N;let B={},T=j(X),A=!0;for(let k=0;k{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}}),ze=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let z=IS(),U=Ye(),I=GS(),Q=Vb0(),J=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends z.default{_addVocabularies(){if(super._addVocabularies(),U.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=SI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=L1();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=qH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=gI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),Ue=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=L1(),z=U5(),U=yw(),I=QS(),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._`${z.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:F}=H.root,{schemaId:M}=X.opts,w=new U.SchemaEnv({schema:W,schemaId:M,root:Z,baseId:q,localRefs:V,meta:F});return U.compileSchema.call(X,w),(0,I.getValidate)(G,w)}$.default=Q}),Ie=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=L1(),z=U5(),U=QS(),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 F=G.let("_v",Y._`${z.default.dynamicAnchors}${(0,Y.getProperty)(X)}`);G.if(F,q(F,V),q(W.validateName,V))}else q(W.validateName,V)()}function q(V,F){return F?()=>G.block(()=>{(0,U.callRef)(J,V),G.let(F,!0)}):()=>(0,U.callRef)(J,V)}}$.dynamicRef=Q,$.default=I}),Lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ue(),z=v1(),U={keyword:"$recursiveAnchor",schemaType:"boolean",code(I){if(I.schema)(0,Y.dynamicAnchor)(I,"");else(0,z.checkStrictMode)(I.it,"$recursiveAnchor: false is ignored")}};$.default=U}),Fb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ie(),z={keyword:"$recursiveRef",schemaType:"string",code:(U)=>(0,Y.dynamicRef)(U,U.schema)};$.default=z}),Qe=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ue(),z=Ie(),U=Lb0(),I=Fb0(),Q=[Y.default,z.default,U.default,I.default];$.default=Q}),wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=KS(),z={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(U)=>(0,Y.validatePropertyDeps)(U)};$.default=z}),Mb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=KS(),z={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(U)=>(0,Y.validateSchemaDeps)(U)};$.default=z}),Ob0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:U,parentSchema:I,it:Q}){if(I.contains===void 0)(0,Y.checkStrictMode)(Q,`"${U}" without "contains" is ignored`)}};$.default=z}),Je=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=wb0(),z=Mb0(),U=Ob0(),I=[Y.default,z.default,U.default];$.default=I}),Nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U=U5(),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(F(Z,M),()=>q(M)));W.props=!0,Q.ok(Y._`${H} === ${U.default.errors}`);function q(M){if(K===!1){if(Q.setParams({unevaluatedProperty:M}),Q.error(),!X)J.break();return}if(!(0,z.alwaysValidSchema)(W,K)){let w=J.name("valid");if(Q.subschema({keyword:"unevaluatedProperties",dataProp:M,dataPropType:z.Type.Str},w),!X)J.if((0,Y.not)(w),()=>J.break())}}function V(M,w){return Y._`!${M} || !${M}[${w}]`}function F(M,w){let O=[];for(let D in M)if(M[D]===!0)O.push(Y._`${w} !== ${D}`);return(0,Y.and)(...O)}}};$.default=I}),Db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,z.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:z.Type.Num},Z),!G.allErrors)Q.if((0,Y.not)(Z),()=>Q.break())})}}};$.default=U}),Ke=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Nb0(),z=Db0(),U=[Y.default,z.default];$.default=U}),Ab0=R0(($,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"}]}}}}}),Pb0=R0(($,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:"#"}}}}}),Bb0=R0(($,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:"#"}}}}),Tb0=R0(($,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:{}}}}}),jb0=R0(($,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"}}}}),Eb0=R0(($,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}}}}),Cb0=R0(($,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:[]}}}}),Rb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ab0(),z=Pb0(),U=Bb0(),I=Tb0(),Q=jb0(),J=Eb0(),K=Cb0(),G=["/properties"];function H(W){return[Y,z,U,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}),_b0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let z=IS(),U=Ye(),I=Qe(),Q=Je(),J=Ke(),K=GS(),G=Rb0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends z.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(I.default),U.default.forEach((F)=>this.addVocabulary(F)),this.addVocabulary(Q.default),this.addVocabulary(J.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:F,meta:M}=this.opts;if(!M)return;G.default.call(this,F),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=SI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=L1();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=qH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=gI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),vb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=lt(),z=ot(),U=tt(),I=Qe(),Q=Je(),J=Ke(),K=et(),G=$e(),H=[I.default,Y.default,z.default,(0,U.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,Q.default,J.default];$.default=H}),hb0=R0(($,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}}}}),Sb0=R0(($,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"}}}}}),gb0=R0(($,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"}}}}),yb0=R0(($,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"}}}}),kb0=R0(($,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"}}}}),xb0=R0(($,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"}}}}),fb0=R0(($,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}}}}),ub0=R0(($,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:[]}}}}),bb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hb0(),z=Sb0(),U=gb0(),I=yb0(),Q=kb0(),J=xb0(),K=fb0(),G=ub0(),H=["/properties"];function W(X){return[Y,z,U,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}),ib0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let z=IS(),U=vb0(),I=GS(),Q=bb0(),J="https://json-schema.org/draft/2020-12/schema";var K=class extends z.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),U.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=SI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=L1();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=qH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=gI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),cb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(k,h){return{validate:k,compare:h}}$.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:w,"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:D,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 z(k){return k%4===0&&(k%100!==0||k%400===0)}let U=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,I=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Q(k){let h=U.exec(k);if(!h)return!1;let i=+h[1],c=+h[2],U0=+h[3];return c>=1&&c<=12&&U0>=1&&U0<=(c===2&&z(i)?29:I[c])}function J(k,h){if(!(k&&h))return;if(k>h)return 1;if(k23||p>59||k&&!t)return!1;if(U0<=23&&x<=59&&d<60)return!0;let e=x-p*$0,y=U0-g*$0-(e<0?1:0);return(y===23||y===-1)&&(e===59||e===-1)&&d<61}}function H(k,h){if(!(k&&h))return;let i=new Date("2020-01-01T"+k).valueOf(),c=new Date("2020-01-01T"+h).valueOf();if(!(i&&c))return;return i-c}function W(k,h){if(!(k&&h))return;let i=K.exec(k),c=K.exec(h);if(!(i&&c))return;if(k=i[1]+i[2]+i[3],h=c[1]+c[2]+c[3],k>h)return 1;if(k=N}function A(k){return Number.isInteger(k)}function j(){return!0}let C=/[^\\]\\Z/;function b(k){if(C.test(k))return!1;try{return new RegExp(k),!0}catch(h){return!1}}}),nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=ze(),z=L1(),U=z.operators,I={formatMaximum:{okStr:"<=",ok:U.LTE,fail:U.GT},formatMinimum:{okStr:">=",ok:U.GTE,fail:U.LT},formatExclusiveMaximum:{okStr:"<",ok:U.LT,fail:U.GTE},formatExclusiveMinimum:{okStr:">",ok:U.GT,fail:U.LTE}},Q={message:({keyword:K,schemaCode:G})=>z.str`should be ${I[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>z._`{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 F=new Y.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(F.$data)M();else w();function M(){let D=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),N=G.const("fmt",z._`${D}[${F.schemaCode}]`);K.fail$data((0,z.or)(z._`typeof ${N} != "object"`,z._`${N} instanceof RegExp`,z._`typeof ${N}.compare != "function"`,O(N)))}function w(){let D=F.schema,N=V.formats[D];if(!N||N===!0)return;if(typeof N!="object"||N instanceof RegExp||typeof N.compare!="function")throw Error(`"${X}": format "${D}" does not define "compare" function`);let B=G.scopeValue("formats",{key:D,ref:N,code:q.code.formats?z._`${q.code.formats}${(0,z.getProperty)(D)}`:void 0});K.fail$data(O(B))}function O(D){return z._`${D}.compare(${H}, ${W}) ${I[X].fail} 0`}},dependencies:["format"]};let J=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=J}),pb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let z=cb0(),U=nb0(),I=L1(),Q=new I.Name("fullFormats"),J=new I.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,z.fullFormats,Q),H;let[X,Z]=W.mode==="fast"?[z.fastFormats,J]:[z.fullFormats,Q];if(G(H,W.formats||z.formatNames,X,Z),W.keywords)(0,U.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?z.fastFormats:z.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 F of W)H.addFormat(F,X[F])}Y.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),Ge=ze(),db0=_b0(),mb0=ib0(),lb0=nq(pb0(),1),ob0=lb0.default;ef1=Ge.Ajv});import HS from"node:process";var xw=o(()=>{He()});function XS($){return!!$&&typeof $==="object"&&Me in $}function sb0($){return $[Me]?.complete}function ab0($,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 tb0($,Y){let z={},U=(I)=>Y===void 0||I===!0;if($.toolsListChanged===!0&&U(Y?.tools?.listChanged))z.toolsListChanged=!0;if($.promptsListChanged===!0&&U(Y?.prompts?.listChanged))z.promptsListChanged=!0;if($.resourcesListChanged===!0&&U(Y?.resources?.listChanged))z.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&U(Y?.resources?.subscribe))z.resourceSubscriptions=[...$.resourceSubscriptions];return z}function We($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[yY]:Y}}}}function eb0($){let Y=B7(XH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function Yi0($,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 Ii0($){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??zi0,roundTimeoutMs:$?.roundTimeoutMs??Ui0,legacyShim:$?.legacyShim??!0}}function Ne($,Y,z){if(z===null||typeof z!=="object"||typeof z.method!=="string")throw new Q1(n0.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 U=z,I=Xt(U);if(I===void 0)throw new Q1(n0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${U.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:U,required:I}}function Qi0(){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 z=[...Y].map((U)=>U.toString(16).padStart(2,"0")).join("");return`${z.slice(0,8)}-${z.slice(8,12)}-${z.slice(12,16)}-${z.slice(16,20)}-${z.slice(20)}`}function WS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new Q1(n0.InternalError,Y)}function ZS($,Y){De($,Y)}function qS($){return Ae($)}function Hi0($){return{...$}}function Xe($,Y){if($){let U=Y;return async(I,Q)=>U(I,Q)}let z=Y;return async(U,I)=>z(I)}function qe($){if($===void 0)return;try{return E7($,"output")}catch{return}}function Ve($,Y,z){if(Y){let U=z;return async(I,Q)=>{let J=await fY(Y,I);if(!J.success)throw new Q1(n0.InvalidParams,`Invalid arguments for prompt ${$}: ${J.error}`);return U(J.data,Q)}}else{let U=z;return async(I,Q)=>{return U(Q)}}}function Le($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function Fe($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function Wi0($){return $?.type==="optional"}function we($){if(!Wi0($))return $;return $.def?.innerType??$}var Me,fw=1024,$i0,Oe=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=fw,Y,z){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=z}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=eb0($);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 z=tb0(Y,this._serverCapabilities);return this._subs.set($.id,z),We({method:"notifications/subscriptions/acknowledged",params:{notifications:z}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!$i0.has($.method))return"passthrough";let Y=$.params?.uri,z=typeof Y==="string"?Y:void 0,U=Yi0($.method,z),I=[];for(let[Q,J]of this._subs)if(ab0(J,U))I.push(We({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:{[yY]:Y,...this._serverInfo!==void 0&&{[p5]:this._serverInfo}}}});return this._subs.clear(),$}},zi0=8,Ui0=600000,Ji0=class{constructor($){this._host=$}async fulfill($,Y,z,U,I){let{maxRounds:Q,roundTimeoutMs:J}=this._host,K=U.mcpReq.signal,G=I,H=0;while(!0){if(H+=1,H>Q)return WS($,ht($,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 Q1(n0.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(U),w=[];for(let[D,N]of Object.entries(W)){let{embedded:B,required:T}=Ne($,D,N);if(B.method!=="roots/list"&&B.params===void 0)throw new Q1(n0.InternalError,`Handler for ${$} returned an input request '${D}' of kind '${B.method}' without params`);if(Nw(T,M)!==void 0)return WS($,`Cannot request input '${D}' (${B.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)":""}`);w.push([D,B])}let O=gt(K);try{let D={relatedRequestId:U.mcpReq.id,timeout:J,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:O.signal},N=await Promise.all(w.map(async([B,T])=>{try{return[B,await this._dispatchLeg(T,D)]}catch(A){throw O.abort(A),A}}));q=Object.fromEntries(N)}catch(D){if(K.aborted)throw D;return WS($,`Fulfilling input required by '${$}' failed: ${D instanceof Error?D.message:String(D)}`)}finally{O.dispose()}}else await St(vt,K);let V={...U,mcpReq:{...U.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:ZH(Z)}};if(Z!==void 0){let M=await this._host.verifyRequestState(Z,V,$);if(M!==void 0)V=sh(V,M)}let F=await Y(z,V);if(!r9(F))return F;G=F}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let z=$.params;if(z.mode==="url"&&z.elicitationId===void 0)z={...z,elicitationId:Qi0()};return await this._host.sendElicitation(z,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},Ki0,Gi0,De,Ae,Pe,LH=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 Ze;try{let z=E7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=z,z}catch{return}}constructor($,Y){if(this.server=new Pe($,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 z={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?E7(Y.inputSchema,"input"):Ze,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)z.outputSchema=E7(Y.outputSchema,"output");return z})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let z=this._registeredTools[$.params.name];if(!z)throw new Q1(n0.InvalidParams,`Tool ${$.params.name} not found`);if(!z.enabled)throw new Q1(n0.InvalidParams,`Tool ${$.params.name} disabled`);try{let U=await this.validateToolInput(z,$.params.arguments,$.params.name),I=await this.executeToolHandler(z,U,Y);if(await this.validateToolOutput(z,I,$.params.name),r9(I))return I;return this.server.projectCallToolResult(I,z.outputSchemaJson)}catch(U){if(U instanceof Q1&&U.code===n0.UrlElicitationRequired)throw U;return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,z){if(!$.inputSchema)return;let U=await fY($.inputSchema,Y??{});if(!U.success)throw new Q1(n0.InvalidParams,`Input validation error: Invalid arguments for tool ${z}: ${U.error}`);return U.data}async validateToolOutput($,Y,z){if(!$.outputSchema)return;if(r9(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new Q1(n0.InvalidParams,`Output validation error: Tool ${z} has an output schema but no structured content was provided`);let U=await fY($.outputSchema,Y.structuredContent);if(!U.success)throw new Q1(n0.InvalidParams,`Output validation error: Invalid structured content for tool ${z}: ${U.error}`)}async executeToolHandler($,Y,z){return $.executor(Y,z)}_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 ph($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return dh($),this.handleResourceCompletion($,$.params.ref);default:throw new Q1(n0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let z=this._registeredPrompts[Y.name];if(!z)throw new Q1(n0.InvalidParams,`Prompt ${Y.name} not found`);if(!z.enabled)throw new Q1(n0.InvalidParams,`Prompt ${Y.name} disabled`);if(!z.argsSchema)return VH;let U=we(Fe(z.argsSchema)?.[$.params.argument.name]);if(!XS(U))return VH;let I=sb0(U);if(!I)return VH;return Le(await I($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let z=Object.values(this._registeredResourceTemplates).find((I)=>I.resourceTemplate.uriTemplate.toString()===Y.uri);if(!z){if(this._registeredResources[Y.uri])return VH;throw new Q1(n0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let U=z.resourceTemplate.completeCallback($.params.argument.name);if(!U)return VH;return Le(await U($.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 z=Object.entries(this._registeredResources).filter(([I,Q])=>Q.enabled).map(([I,Q])=>({uri:I,name:Q.name,...Q.metadata})),U=[];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)U.push({...I.metadata,...J})}return{resources:[...z,...U]}}),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 z;try{z=new URL($.params.uri)}catch{throw new Q1(n0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let U=this._registeredResources[z.toString()];if(U){if(!U.enabled)throw new Q1(n0.InvalidParams,`Resource ${z} disabled`);return Dw(await U.readCallback(z,Y),U.cacheHint)}for(let I of Object.values(this._registeredResourceTemplates)){let Q=I.resourceTemplate.uriTemplate.match(z.toString());if(Q)return Dw(await I.readCallback(z,Q,Y),I.cacheHint)}throw new Aw($.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?_t(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let z=this._registeredPrompts[$.params.name];if(!z)throw new Q1(n0.InvalidParams,`Prompt ${$.params.name} not found`);if(!z.enabled)throw new Q1(n0.InvalidParams,`Prompt ${$.params.name} disabled`);return z.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,z,U){let I=z.cacheHint,Q=z;if(I!==void 0){ih(I,`resource ${$}`);let J={...z};delete J.cacheHint,Q=J}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let J=this._createRegisteredResource($,z.title,Y,Q,U);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($,z.title,Y,Q,U);if(I!==void 0)J.cacheHint=I;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}}_createRegisteredResource($,Y,z,U,I){let Q={name:$,title:Y,metadata:U,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!==z){if(delete this._registeredResources[z],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[z]=Q,Q}_createRegisteredResourceTemplate($,Y,z,U,I){let Q={resourceTemplate:z,title:Y,metadata:U,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=z.uriTemplate.variableNames;if(Array.isArray(J)&&J.some((K)=>!!z.completeCallback(K)))this.setCompletionRequestHandler();return Q}_createRegisteredPrompt($,Y,z,U,I,Q,J){let K=U,G=I,H={title:Y,description:z,argsSchema:U,icons:Q,_meta:J,handler:Ve($,U,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=Ve($,K,G);if(W.enabled!==void 0)H.enabled=W.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=H,U){let W=Fe(U);if(W){if(Object.values(W).some((X)=>{return XS(we(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,z,U,I,Q,J,K,G,H){if(zS($),U!==void 0)try{let Z=E7(U,"input");this._toolInputSchemaJson[$]=Z;let q=mh(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:z,inputSchema:U,outputSchema:I,outputSchemaJson:qe(I),annotations:Q,icons:J,execution:K,_meta:G,handler:H,executor:Xe(U,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")zS(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=Xe(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=qe(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,z){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:U,description:I,inputSchema:Q,outputSchema:J,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,U,I,Rw(Q),Rw(J),K,G,void 0,H,z)}registerPrompt($,Y,z){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:U,description:I,argsSchema:Q,icons:J,_meta:K}=Y,G=this._createRegisteredPrompt($,U,I,Rw(Q),z,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()}},Ze,VH;var VS=o(()=>{_w();xw();Me=Symbol.for("mcp.completable");$i0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);Ki0=new Set(["tools/call","prompts/get","resources/read"]);Pe=class extends th{_clientCapabilities;_clientVersion;static{Gi0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},De=($,Y)=>{let z=Y.filter((U)=>!$._supportedProtocolVersions.includes(U));if(z.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...z];$.setRequestHandler("server/discover",()=>$._ondiscover())},Ae=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Ji0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,z)=>this._verifyRequestState($,Y,z),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 kw,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=Ii0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[z,U]of Object.entries(Y.cacheHints))if(U!==void 0)ih(U,`cacheHints['${z}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(z)=>this._oninitialize(z)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),yh(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let z=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:U}=$.params,I=Cw(A7,U);if(I.success)this._loggingLevels.set(z,I.data);return{}})}buildContext($,Y){let z=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(U,I,Q)=>{if(!this._capabilities.logging)return Promise.resolve();let J;if(this._servedModernEra()){if(J=$.mcpReq.envelope?.[F7],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(U)this.elicitInput(U,I),requestSampling:(U,I)=>this.createMessage(U,I)},http:z?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(A7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let z=this._loggingLevels.get(Y);return z?this.LOG_LEVEL_SEVERITY.get($){let J=await Y(I,Q);if(r9(J))throw new Q1(n0.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=U?await this._invokeInputRequiredCapableHandler($,Y,I,Q):await Y(I,Q);if(r9(J)){if(!U)throw new Q1(n0.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 z===void 0?J:Dw(J,z)}}return async(z,U)=>{let I=B7(this._negotiatedProtocolVersion),Q=I.validateRequest("tools/call",z);if(!Q.ok)throw new Q1(Q.reason==="not-in-era"?n0.InternalError:n0.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,z,U);if(r9(J))return J;let K=kh(J),G=I.validateResult("tools/call",K);if(!G.ok)throw new Q1(G.reason==="not-in-era"?n0.InternalError:n0.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&&vI(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,z,U){let I=this._servedModernEra(),Q=U.mcpReq.requestState();if(Q!==void 0&&typeof Q!=="string")throw new Q1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let J=U;if(typeof Q==="string"){let X=await this._verifyRequestState(Q,U,$);if(X!==void 0)J=sh(U,X)}let K;try{K=await Y(z,J)}catch(X){if(X instanceof Q1&&X.code===n0.UrlElicitationRequired){if(!I)throw X;throw new Q1(n0.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(!r9(K))return K;if(!I){if(!this._inputRequiredServing.legacyShim)throw new Q1(n0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??gY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,z,J,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new Q1(n0.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(U);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=Ne($,Z,q),M=Nw(F,X);if(M!==void 0)throw new Pw({requiredCapabilities:M},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,z){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(U){throw this.onerror?.(Error(`requestState verification rejected ${z}: ${U instanceof Error?U.message:String(U)}`)),new Q1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[l9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new V1(A1.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 V1(A1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new V1(A1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new V1(A1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.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 V1(A1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new V1(A1.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 V1(A1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new V1(A1.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 z=qt(this._supportedProtocolVersions),U=z.includes(Y)?Y:z[0]??gY;return this._negotiatedProtocolVersion=U,this.transport?.setProtocolVersion?.(U),{protocolVersion:U,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:yh(this._supportedProtocolVersions),capabilities:Hi0(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 V1(A1.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 Q1(n0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new Q1(n0.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 Q1(n0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let z=Boolean($.tools||$.toolChoice),U=await this.request({method:"sampling/createMessage",params:$},Y),I=this._wireCodec().samplingResultVariant(z,U);if(!I.ok)throw new V1(A1.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 V1(A1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new V1(A1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,z){let U=$.mode??"form",I=z?.validateAcceptedContent??!0;switch(U){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 Q1(n0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof Q1)throw K;throw new Q1(n0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return J}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.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"})}};Ze={type:"object",properties:{}};VH={completion:{values:[],hasMore:!1}}});var Be=o(()=>{VS();_w();xw()});function qi0($){let Y=$.params;if($.method==="initialize"&&!lh(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(!Bw(Y))return{kind:"legacy",reason:"no-claim"};let z=bY(Y),U=(z===void 0?[]:jw(z))[0];if(U!==void 0)return{kind:"invalid-envelope",issue:U};let I=Tw(Y);if(I===void 0||!T7.includes(I))return{kind:"unsupported-revision",requested:I??"unknown"};return{kind:"modern",revision:I,classification:{era:"modern",revision:I}}}function je($,Y={}){let z=Y.legacy??"serve",U=Y.transport??new Xi0,I={phase:"opening"},Q,J=!1,K=()=>J||I.phase==="closed",G=(j)=>{try{Y.onerror?.(j)}catch{}},H=(j,C,b,k)=>U.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...k!==void 0&&{data:k}}}).catch((h)=>G(Q5(h))),W=new Oe(Y.maxSubscriptions??fw),X=(j)=>{if(!j7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)U.send({jsonrpc:"2.0",...b}).catch((k)=>G(Q5(k)));return"handled"},Z=async(j)=>{if(D$(j)&&j.method==="subscriptions/listen"){let C=bY(j.params),b=Bw(j.params)?(C===void 0?[]:jw(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},k=Tw(j.params),h;if(b!==void 0)h={jsonrpc:"2.0",id:j.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(k===void 0||!T7.includes(k)){let i=new hI({supported:[...T7],requested:k??"unknown"});h={jsonrpc:"2.0",id:j.id,error:{code:i.code,message:i.message,data:i.data}}}else h=W.serve(j);return await U.send("error"in h?h:{jsonrpc:"2.0",method:h.method,params:h.params}).catch((i)=>G(Q5(i))),!0}if(j7(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 k=oh({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},T7);if(k===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${k.cell}): ${k.message}`)),H(j.id,k.code,k.message,k.data)},V=(j)=>{if(J||j===Q)return;T()},F=async(j,C)=>{let b=await $({era:j}),k=b instanceof LH?b.server:b;if(j==="modern")ah(k,C),ZS(k,T7),W.setServerCapabilities(k.getCapabilities(),qS(k));let h=new Zi0(U,()=>V(h),j==="modern"?X:void 0);return await b.connect(h),{product:b,channel:h}},M=(j)=>j.product.close().catch((C)=>G(Q5(C))),w=async(j)=>{Q=j.channel;try{if(!await j.channel.whenRequestsAnswered(Te))G(Error(`Discarded the probe instance with requests still unanswered after ${Te}ms; continuing with the fallback`));await j.product.close()}catch(C){G(Q5(C))}finally{Q=void 0}},O=async(j)=>{if(I.phase==="closed")return;if(I.phase==="pinned"){if(I.era==="modern"&&D$(j)&&j.method==="initialize"&&!lh(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(!D$(j)&&!j7(j)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=qi0(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(D$(j))await H(j.id,n0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(D$(j)){let b=new hI({supported:[...T7],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(D$(j)&&j.method==="server/discover"){if(I.phase==="probe"){I.instance.channel.deliver(j,{classification:C.classification});return}let b=await F("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(j7(j)){I.instance.channel.deliver(j,{classification:C.classification});return}I={phase:"pinned",era:"modern",instance:I.instance}}else{let b=await F("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(z==="reject"){if(D$(j))await q(j,C.reason,C.requestedVersion);return}if(I.phase==="probe"){if(await w(I.instance),K())return;I={phase:"opening"}}let b=await F("legacy");if(K()){await M(b);return}I={phase:"pinned",era:"legacy",instance:b},I.instance.channel.deliver(j);return}}},D=[],N=!1,B=async()=>{if(N)return;N=!0;try{while(D.length>0){let j=D.shift();try{await O(j)}catch(C){if(D$(j))await H(j.id,n0.InternalError,"Internal server error");G(Q5(C))}}}finally{N=!1}},T=async()=>{if(J||I.phase==="closed")return;J=!0;let j=I;I={phase:"closed"};for(let C of W.teardownAll())await U.send(C).catch((b)=>G(Q5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(Q5(C)));await U.close().catch((C)=>G(Q5(C)))};U.onmessage=(j)=>{D.push(j),B()},U.onerror=(j)=>{if(G(j),I.phase==="probe"||I.phase==="pinned")I.instance.channel.onerror?.(j)},U.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(Q5(C)))};let A=U.start().catch((j)=>{throw G(Q5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function Q5($){return $ instanceof Error?$:Error(String($))}var Xi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=HS.stdin,Y=HS.stdout,z){this._stdin=$,this._stdout=Y,this._readBuffer=new $S({maxBufferSize:z?.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,z)=>{let U=YS($),I=!1,Q=(K)=>{if(I)return;I=!0,this._stdout.off("error",Q),this._stdout.off("drain",J),z(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(U)){if(I)return;I=!0,this._stdout.off("error",Q),Y()}else if(!I)this._stdout.once("drain",J)})}},Te=3000,Zi0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,z){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=z}async start(){}async send($,Y){if(HH($)||Ew($)){let{id:z}=$;if(z!==void 0)this._settle(z)}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(D$($))this._pendingRequests.add($.id);else if(j7($)&&$.method==="notifications/cancelled"){let z=$.params?.requestId;if(z!==void 0)this._settle(z)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let z=()=>{clearTimeout(U),Y(!0)},U=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((I)=>I!==z),Y(!1)},$);this._drainWaiters.push(z)})}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 Ee=o(()=>{VS();_w();xw()});var A$=o(()=>{BL();BL()});var s9;var FH=o(()=>{s9=class s9 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var uw=o(()=>{FH();D6=class D6 extends s9{name="HTTPError";response;request;options;data;constructor($,Y,z){let U=$.status||$.status===0?$.status:"",I=$.statusText??"",Q=`${U} ${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=z}}});var wH;var LS=o(()=>{FH();wH=class wH extends s9{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var MH;var FS=o(()=>{MH=class MH 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 yI;var Ce=o(()=>{FH();FS();yI=class yI extends s9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new MH($.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 wS;var Re=o(()=>{wS=class wS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var J5;var bw=o(()=>{FH();J5=class J5 extends s9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class pw{options;constructor($){this.options=$}}var MS,_e,iw,ve,he,cw,Vi0=()=>{return},Se,kI=2147483647,ge=40,nw,ye=($)=>new pw($),ke,xe;var iY=o(()=>{MS=(()=>{let $=!1,Y=!1,z=typeof globalThis.ReadableStream==="function",U=typeof globalThis.Request==="function";if(z&&U)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})(),_e=typeof globalThis.AbortController==="function",iw=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",ve=typeof globalThis.ReadableStream==="function",he=typeof globalThis.FormData==="function",cw=["get","post","put","patch","head","delete"];Vi0();Se={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},nw=Symbol("stop");ke={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},xe={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 dw,Li0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[z,U]of $)Y+=ge,Y+=dw.encode(`Content-Disposition: form-data; name="${z}"`).byteLength,Y+=typeof U==="string"?dw.encode(U).byteLength:U.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return dw.encode($).byteLength;if($ instanceof URLSearchParams)return dw.encode($.toString()).byteLength;return 0},fe=($,Y,z)=>{let U,I=0;return $.pipeThrough(new TransformStream({transform(Q,J){if(J.enqueue(Q),U){I+=U.byteLength;let K=Y===0?0:I/Y;if(K>=1)K=1-Number.EPSILON;z?.({percent:K,totalBytes:Math.max(Y,I),transferredBytes:I},U)}U=Q},flush(){if(U)I+=U.byteLength,z?.({percent:1,totalBytes:Math.max(Y,I),transferredBytes:I},U)}}))},ue=($,Y)=>{if(!$.body)return $;let z={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,z);let U=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(fe($.body,U,Y),z)},be=($,Y,z)=>{if(!$.body)return $;let U=Li0(z??$.body);return new Request($,{duplex:"half",body:fe($.body,U,Y)})};var ie=o(()=>{iY();dw=new TextEncoder});var d5=($)=>$!==null&&typeof $==="object";function OH($,Y,z){return Object.hasOwn(Y,z)&&Y[z]===void 0?[]:AS($[z]??[],Y[z]??[])}var Fi0,OS=($)=>d5($)&&$[Fi0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},NH=(...$)=>{for(let Y of $)if((!d5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return AS({},...$)},DS=($={},Y={})=>{let z=new globalThis.Headers($),U=Y instanceof globalThis.Headers,I=new globalThis.Headers(Y);for(let[Q,J]of I.entries())if(U&&J==="undefined"||J===void 0)z.delete(Q);else z.set(Q,J);return z},NS=($)=>{if(!d5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},xI=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),z=$[C7];if(z)Y[C7]=new Set(z);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(NS($))return{...$};return $},wi0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),Mi0=($,Y)=>{if(NS($)&&NS(Y))return wi0({...$,...Y});return DS($,Y)},mw=($={},Y={})=>({init:OH($,Y,"init"),beforeRequest:OH($,Y,"beforeRequest"),beforeRetry:OH($,Y,"beforeRetry"),beforeError:OH($,Y,"beforeError"),afterResponse:OH($,Y,"afterResponse")}),C7,Oi0=($,Y)=>{let z=new URLSearchParams,U=new Set;for(let I of[$,Y]){if(I===void 0)continue;if(I instanceof URLSearchParams){for(let[J,K]of I.entries())z.append(J,K),U.delete(J);let Q=I[C7];if(Q)for(let J of Q)z.delete(J),U.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");z.append(String(Q[0]),String(Q[1])),U.delete(String(Q[0]))}else if(d5(I))for(let[Q,J]of Object.entries(I))if(J===void 0)z.delete(Q),U.add(Q);else z.append(Q,String(J)),U.delete(Q);else{let Q=new URLSearchParams(I);for(let[J,K]of Q.entries())z.append(J,K),U.delete(J)}}if(U.size>0)z[C7]=U;return z},AS=(...$)=>{let Y={},z={},U={},I,Q=[];for(let J of $)if(Array.isArray(J)){if(!Array.isArray(Y))Y=[];Y=[...Y,...J]}else if(d5(J)){for(let[K,G]of Object.entries(J)){if(K==="signal"&&G instanceof globalThis.AbortSignal){Q.push(G);continue}let H=OS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!d5(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:Oi0(I,G);continue}if(d5(G)&&!W&&K in Y)G=AS(Y[K],G);Y={...Y,[K]:G}}if(d5(J.hooks)){let{value:K,isReplace:G}=OS(J.hooks);U=G?mw({},K):mw(U,K),Y.hooks=U}if(d5(J.headers)){let{value:K,isReplace:G}=OS(J.headers);z=G?xI(K):Mi0(z,K),Y.headers=z}}if(I!==void 0)Y.searchParams=I;if(Q.length>0)if(Q.length===1)Y.signal=Q[0];else if(iw)Y.signal=AbortSignal.any(Q);else Y.signal=Q.at(-1);return Y};var lw=o(()=>{iY();Fi0=Symbol("replaceOption");C7=Symbol("deletedParameters")});var ne=($)=>cw.includes($)?$.toUpperCase():$,Ni0,Di0,Ai0,ce,pe=($={})=>{if(typeof $==="number")return{...ce,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((z)=>z.toLowerCase())}).filter(([,z])=>z!==void 0));return{...ce,...Y}};var de=o(()=>{iY();Ni0=["get","put","head","delete","options","trace"],Di0=[408,413,429,500,502,503,504],Ai0=[413,429,503],ce={limit:2,methods:Ni0,statusCodes:Di0,afterStatusCodes:Ai0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function PS($,Y,z,U){return new Promise((I,Q)=>{let J=setTimeout(()=>{if(z)z.abort();Q(new J5($))},U.timeout);U.fetch($,Y).then(I).catch(Q).then(()=>{clearTimeout(J)})})}var me=o(()=>{bw()});async function ow($,{signal:Y}){return new Promise((z,U)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",I,{once:!0});function I(){clearTimeout(Q),U(Y.reason)}let Q=setTimeout(()=>{Y?.removeEventListener("abort",I),z()},$)})}var le=($)=>{let Y={};for(let z in $){if(!Object.hasOwn($,z))continue;if(!(z in xe)&&!(z in ke))Y[z]=$[z]}return Y},oe=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[C7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var re=o(()=>{iY();lw()});function BS($){if(!($&&Bi0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:z,stack:U}=$;if(z==="Load failed")return U===void 0||"__sentry_captured__"in $;if(z.startsWith("error sending request for url"))return!0;if(z==="Failed to fetch"||z.startsWith("Failed to fetch (")&&z.endsWith(")"))return!0;return Ti0.has(z)}var Pi0,Bi0=($)=>Pi0.call($)==="[object Error]",Ti0;var se=o(()=>{Pi0=Object.prototype.toString,Ti0=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 ae($){return TS($,D6)}function te($){return TS($,wH)}function ee($){return TS($,J5)}var TS=($,Y)=>$ instanceof Y||$?.name===Y.name;var $00=o(()=>{uw();LS();bw()});function vi0($){let Y={...$,json:xI($.json),context:xI($.context),headers:xI($.headers),searchParams:_i0($.searchParams)};if($.retry!==void 0)Y.retry=Ri0($.retry);return Y}class fI{static create($,Y){let z=Y.hooks?.init??[],U=z.length>0?vi0(Y):Y;for(let K of z)K(U);let I=new fI($,U),Q=async()=>{if(typeof I.#$.timeout==="number"&&I.#$.timeout>kI)throw RangeError(`The \`timeout\` option cannot be greater than ${kI}`);if(typeof I.#$.totalTimeout==="number"&&I.#$.totalTimeout>kI)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${kI}`);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(AH(G))try{G=await I.#y(G)}catch(X){if(!(X instanceof yI))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(!AH(G))return G;if(I.#V(G),I.#$.onDownloadProgress){if(typeof I.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!ve)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return I.#K(G),ue(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(Se)){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=U.parseJson?await U.parseJson(X,{request:I.#O(W),response:W}):JSON.parse(X);return H===void 0?Z:U00(Z,H)}}return J}static#U($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#z;#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(Ei0);if(this.#$={...Y,headers:DS(this.#Y.headers,Y.headers),hooks:mw({},Y.hooks),method:ne(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:pe(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 U=this.#$.prefix.replace(/\/+$/,""),I=this.#Y.replace(/^\/+/,"");this.#Y=`${U}/${I}`}if(this.#$.baseUrl){let U;try{U=new URL(this.#Y)}catch{}if(!U)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if(_e&&iw)this.#H=this.#$.signal??this.#Y.signal,this.#z=new globalThis.AbortController,this.#$.signal=this.#w();if(MS)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 z=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(he&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!z)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),oe(this.#$.searchParams)){let U=new URL(this.request.url),I=this.#$.searchParams?.[C7];if(I)for(let Q of I)U.searchParams.delete(Q);if(typeof this.#$.searchParams==="string"){let Q=this.#$.searchParams.replace(/^\?/,"");if(Q!=="")U.search=U.search?`${U.search}&${Q}`:`?${Q}`}else{let Q=new URLSearchParams(fI.#U(this.#$.searchParams));for(let[J,K]of Q.entries())U.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)U.searchParams.delete(Q)}this.request=new globalThis.Request(U,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#B($){if(this.#I>=this.#$.retry.limit)throw $;let Y=$ instanceof Error?$:new MH($);if(Y instanceof yI)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let z=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#I+1});if(z===!1)throw $;if(z===!0)return this.#G()}if(ee($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(ae($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let z=$.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(z&&this.#$.retry.afterStatusCodes.includes($.response.status)){let U=Number(z)*1000;if(Number.isNaN(U))U=Date.parse(z)-Date.now();else if(U>=Date.parse("2024-01-01"))U-=Date.now();if(!Number.isFinite(U))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return U=Math.max(0,U),Math.min(this.#$.retry.maxRetryAfter,U)}if($.response.status===413)throw $;return this.#G()}if(!te($))throw $;return this.#G()}#V($){let Y=this.#O($);if(this.#$.parseJson)$.json=async()=>{let z=await $.text();if(z==="")return JSON.parse(z);return this.#$.parseJson(z,{request:Y,response:$})};return $}async#L($){let Y=await this.#T($,this.#D());if(Y===DH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let z=await this.#j(Y,$,this.#D(),this.#O($));if(z===DH){this.#q();return}return z}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#P();if(Y===void 0)return $;if(Y<=0)throw new J5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#T($,Y){let{body:z}=$;if(!z)try{return await $.text()}catch{return}let U;try{U=z.getReader()}catch{return}let I=Ci0($.headers.get("content-type")??""),Q=[],J=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await U.read();if(W)break;if(J+=X.byteLength,J>ji0){U.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(DH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===DH)U.cancel().catch(()=>{return});return H}async#j($,Y,z,U){let I;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:U,response:Y}):JSON.parse($)),new Promise((Q)=>{I=setTimeout(()=>{Q(DH)},z)})])}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.#z.signal]):this.#z.signal}#q(){let $=this.#P();if($!==void 0&&$<=0)throw new J5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#M(),retryCount:0});if(z00(Y))this.#_(Y);else if(AH(Y))return Y}return}async#y($){let Y=this.#O($);for(let z of this.#$.hooks.afterResponse){let U=this.#v($.clone(),Y);this.#V(U);let I;try{I=await z({request:this.request,options:this.#M(),response:U,retryCount:this.#I})}catch(J){if(U!==$)this.#K(U);throw this.#K($),J}if(I instanceof pw){if(U!==$)this.#K(U);throw this.#K($),new yI(I.options)}let Q=AH(I)?this.#v(I,Y):$;if(U!==$&&U!==Q&&U.body!==Q.body)this.#K(U);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 z=Math.min(await this.#B($),kI),U={signal:this.#H},I=this.#P();if(I!==void 0){if(I<=0)throw new J5(this.request);if(z>=I)throw await ow(I,U),new J5(this.request)}if(await ow(z,U),this.#q(),$ instanceof yI&&$.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(z00(J)){this.#_(J);break}if(AH(J))return this.#Z=!0,this.#I++,J;if(J===nw)return}return this.#q(),this.#I++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#z?.signal.aborted)this.#z=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=le(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,z=this.#k(this.request,this.#$.body??void 0);if(this.#W=z,Y)this.request=Y;try{let U=this.#P();if(U!==void 0&&U<=0)throw new J5(this.request);let I=this.#$.timeout===!1?U:U===void 0?this.#$.timeout:Math.min(this.#$.timeout,U),Q=I===void 0?await this.#$.fetch(z,$):await PS(z,$,this.#z,{timeout:I,fetch:this.#$.fetch});return this.#v(Q,z)}catch(U){if(BS(U))throw new wH(this.request,{cause:U});throw U}}#P(){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:z,stringifyJson:U,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||!MS)return $;return be($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var ji0=10485760,Ei0="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",DH,Ci0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),z=Y?.[1]??Y?.[2];if(z)try{return new TextDecoder(z)}catch{}return new TextDecoder},Y00="The `schema` argument must follow the Standard Schema specification",Ri0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},I00,z00=($)=>$ instanceof globalThis.Request||I00.call($)==="[object Request]",AH=($)=>$ instanceof globalThis.Response||I00.call($)==="[object Response]",_i0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return xI($)},U00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(Y00);let z=Y["~standard"];if(typeof z!=="object"||z===null||typeof z.validate!=="function")throw TypeError(Y00);let U=await z.validate($);if(U.issues)throw new wS(U.issues);return U.value};var Q00=o(()=>{uw();LS();FS();Ce();Re();bw();ie();lw();de();me();re();se();$00();iY();DH=Symbol("timedOutResponseData"),I00=Object.prototype.toString});var jS=($)=>{let Y=(z,U)=>fI.create(z,NH($,U));for(let z of cw)Y[z]=(U,I)=>fI.create(U,NH($,I,{method:z}));return Y.create=(z)=>jS(NH(z)),Y.extend=(z)=>{if(typeof z==="function")z=z($??{});return jS(NH($,z))},Y.stop=nw,Y.retry=ye,Y},hi0,K5;var uI=o(()=>{Q00();iY();lw();uw();/*! MIT License © Sindre Sorhus */hi0=jS(),K5=hi0});async function J00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,z=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:z?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:z?.tenantId,tenantSlug:$.seal.tenantSlug??z?.tenantSlug,tenantName:z?.tenantName,raw:{sourceType:$.source.type}}}}function Si0($){let Y=Object.entries($??{}).map(([z,U])=>`${z}=${U}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},z=Si0($?.cookies);if(z)Y.Cookie=z;return Y}var K00,gi0,yi0,ki0,xi0,G00;var H00=o(()=>{A$();K00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),gi0=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()}),yi0=L.object({token:L.string(),expiresAt:L.number(),enterprise:gi0}),ki0=L.object({openapi:K00.optional(),closeapi:K00.optional()}),xi0=L.object({seal:yi0.optional(),hose:ki0.optional()}),G00=L.record(L.string(),xi0)});import{existsSync as ES,mkdirSync as fi0,readFileSync as ui0,writeFileSync as bi0}from"node:fs";import{dirname as ii0,join as X00}from"node:path";import{homedir as Z00}from"node:os";function ci0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if(ES(rw))return rw;if(ES(W00))return W00;return rw}function ni0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return rw}function bI(){let $=ci0();if(!ES($))return{};try{return G00.parse(JSON.parse(ui0($,"utf-8")))}catch{return{}}}function sw($){let Y=ni0();fi0(ii0(Y),{recursive:!0,mode:448}),bi0(Y,JSON.stringify($,null,2),{mode:384})}function q00($){return bI()[$]?.seal}function V00($,Y){let z=bI();sw({...z,[$]:{...z[$],seal:Y}})}function L00($){let Y=bI(),z=Y[$];if(!z)return;sw({...Y,[$]:{...z,seal:void 0}})}function PH($){return bI()[$]?.hose??{}}function CS($,Y){let z=bI();sw({...z,[$]:{...z[$],hose:Y}})}function aw($){let Y=bI();delete Y[$],sw(Y)}var rw,W00;var BH=o(()=>{H00();rw=X00(Z00(),".config","seal-use","seal_tokens.json"),W00=X00(Z00(),".config","seal-home","seal_tokens.json")});function P$($){return $.replace(/\/+$/,"")}function M00($){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||!li0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==mi0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let z=Y.searchParams.getAll("accessToken").filter(Boolean),U=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(z.length!==1||U.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let I=U[0].trim().toLowerCase();if(!w00.test(I))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:I,accessToken:z[0],baseUrl:Y.origin}}async function tw($,Y){let z=typeof $==="string"?M00($):O00($),U=`https://${z.corpId}.sealai.cc`,Q=await T8(U,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:z.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:z.corpId,sealUrl:U,token:J,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function ew($,Y){let z=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,U=[Y.tenantSlug,z?.corporationId].filter((J)=>typeof J==="string"&&Boolean(J)),I=$.trim().toLowerCase(),Q=U.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 li0($){let Y=$.toLowerCase();return di0.some((z)=>Y.endsWith(z))}function O00($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",z=typeof $?.accessToken==="string"?$.accessToken.trim():"",U=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!w00.test(Y)||!z)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:z,...U?{baseUrl:U}:{}}}function N00($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function R7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function oi0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function D00($){return K5.create({prefix:P$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let z=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${z?`: ${z}`:""}`,Y}]}})}async function ri0($){let Y=D00($),z=$.appKey??$.key,U=$.appSecurity??$.password;if(!z||!U)throw Error("Hose source requires appKey/key and appSecurity/password");let I=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:z,appSecurity:U}}).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 iI($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=PH($.id);if(N00(Y.openapi))return Y.openapi.token;let z=RS.get($.id);if(z)return z;let U=ri0($.source).then((I)=>{return CS($.id,{...PH($.id),openapi:I}),I.token}).finally(()=>RS.delete($.id));return RS.set($.id,U),U}async function $M($,Y,z=7200){let U=D00($),I=oi0($),J=(await U.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:I,pageType:"home",expireDate:z}}).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()+z*1000}}async function TH($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source,z=PH($.id);if(N00(z.closeapi)&&z.closeapi.url)return z.closeapi;let U=_S.get($.id);if(U)return U;let I=iI($).then((Q)=>$M(Y,Q)).then((Q)=>{return CS($.id,{...PH($.id),closeapi:Q}),Q}).finally(()=>_S.delete($.id));return _S.set($.id,I),I}async function A00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=(await TH($)).url;if(!Y)throw Error("Hose provisional auth URL was not available");return Y}async function P00($,Y=7200,z){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 U=await iI($),I=await $M($.source,U,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 B00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await TH($),z=R7($,$.source),U=A6($.seal),Q=await T8(z,void 0,U).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:P$(z),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:P$($.source.domain)}};return{token:J,expiresAt:Date.now()+K*1000,enterprise:G}}async function cI($,Y,z){if(z){let J=P$(z),K=await F00(J,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${J}. Please verify appKey/appSecurity and domain connectivity.`);return K}let U=pi0.map(async(J)=>{try{return await F00(J,$,Y)}catch{return}}),Q=(await Promise.all(U)).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 F00($,Y,z){try{let U=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:z}),signal:AbortSignal.timeout(8000)});if(!U.ok)return;let I=await U.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 YM($,Y){let z=`${P$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,U=await fetch(z,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!U.ok){let J=await U.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${U.status} ${J}`)}return((await U.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 vS($,Y,z,U="id"){let I=z.startsWith("$")?z.slice(1):z,Q=`${P$($)}/api/openapi/v1/roledefs/$${I}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(U)}&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 hS($,Y,z){if(z.length===0)return[];let U=`${P$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,I=await fetch(U,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:z.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 SS($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function si0($){let Y=typeof $==="string"?M00($):O00($),z=Y.baseUrl||"https://app.ekuaibao.com",U,I,Q,J,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await K5.get(`${z}/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")U=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(!U||!I)try{let W=(await K5.get(`${z}/api/account/v2/session`,{headers:{...G,...U?{staffid:U}:{}},timeout:1e4}).json())?.value;if(W){if(!U&&W.loginStaffId)U=W.loginStaffId;if(!I&&W.corporationName)I=W.corporationName;if(!Q&&W.privilege)Q=W.privilege}}catch{}if(!U)U=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:z,accessToken:Y.accessToken,staffId:U,corpName:I,staffName:Q,isAdmin:J,cellphone:K}}async function gS($){let Y=await si0($),z={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},U;try{U=await(await K5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:z,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=U.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 pi0,di0,mi0="/web/thirdparty.html",w00,RS,_S;var a9=o(()=>{uI();i8();BH();pi0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],di0=[".ekuaibao.com",".hosecloud.com"],w00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,RS=new Map,_S=new Map});function T00($,Y){return Date.now()>=$.expiresAt-Y*1000}async function ai0($){switch($.source.type){case"hose":return B00($);case"direct":case"seal":return J00($)}}async function UM($){let Y=$.auth.refreshTtl,z=zM.get($.id);if(z&&!T00(z,Y))return z;let U=q00($.id);if(U&&!T00(U,Y))return zM.set($.id,U),U;let I=await ai0($);return zM.set($.id,I),V00($.id,I),I}async function j00($){return(await UM($)).enterprise}function E00($){zM.delete($),L00($)}var zM;var yS=o(()=>{a9();BH();zM=new Map});var R00={};x8(R00,{createSealClientForUrl:()=>T8,createSealClientForToken:()=>kS,createSealClient:()=>j1});function ti0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function ei0($){if(!($ instanceof D6))return $;let Y=ti0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function C00($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)E00($);return ei0(Y)}}async function j1($){let Y=await UM($);return K5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[C00($.id)]}})}async function kS($,Y){let z=await UM($);return T8(z.enterprise.sealUrl,Y,A6($.seal))}function T8($,Y,z={}){let U={...z};if(Y)U.Authorization=`Bearer ${Y}`;return K5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:U,hooks:{beforeError:[C00()]}})}var i8=o(()=>{uI();yS()});var jH;var _00=o(()=>{jH={name:"seal-use",version:"0.10.29",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","seal-home":"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","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 v00}from"node:child_process";function Yc0($,Y=jH.version){let z=$.trim();if(!z)return null;let U=z.endsWith("-dirty"),I=U?z.slice(0,-6):z,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:U,describe:z};let J=I.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(J&&J[1])return{baseVersion:J[1],commitsAhead:0,commit:"",dirty:U,describe:z};let K=I.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:U,describe:z};return null}function zc0($,Y,z,U){let Q=z?`+g${z}${U?".dirty":""}`:U?"+dirty":"";return`${$}-dev.${Y}${Q}`}function Uc0($){let Y=$?.env,z=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,U=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(z){let Z=U==="true",V={name:"seal-use",version:z,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||z};return V}if(U==="true"||W==="1")return{name:"seal-use",version:jH.version,channel:"release",isRelease:!0};try{let Z=v00("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=Yc0(Z.stdout.trim(),jH.version);if(q){if(!q.commit){let F=v00("git",["rev-parse","--short","HEAD"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(F.status===0&&F.stdout)q.commit=F.stdout.trim()}return{name:"seal-use",version:zc0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${jH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var EH,P1,xS,qc1;var t9=o(()=>{_00();EH=Uc0(),P1=EH.version,xS=EH.isRelease,qc1=EH.channel});function nI($=void 0){return uS.parse($??{})}function g00($,Y){return nI({...nI($),...Y})}var h00,fS,S00,uS,bS;var pI=o(()=>{A$();h00=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],fS={minFileSizeBytes:500,allowedExtensions:[...h00]},S00=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"}),uS=L.object({minFileSizeBytes:L.number().int().min(0).default(fS.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(S00).min(1).default([...h00]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),bS=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(S00).min(1).transform(($)=>[...new Set($)])}).optional()});var Ic0,Qc0,Jc0,Kc0,k00,Gc0,Hc0,x00,IM,f00,Wc0,QM,u00,RH,b00,Xc0,Zc0,qc0,y00,_H,i00,Vc0,Lc0,JM,iS,c00,n00,p00,d00,KM,m00,cS,nS,l00,o00,Fc0,r00,wc0,s00,CH,a00,t00,e00,$10,Y10,z10,U10,I10,Q10,J10,K10,Mc0,G10,Oc0,Nc0,Dc0,pS,dS,Ac0,H10,W10,X10,Z10,Pc0,mS,Oc1,Nc1,q10,Dc1;var lS=o(()=>{A$();pI();Ic0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Qc0=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:Ic0.optional()}),Jc0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),Kc0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:Jc0.optional()}),k00=L.object({user:Qc0,tenant:Kc0}),Gc0=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(),Hc0=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(),x00=L.object({user:Gc0,session:Hc0}),IM=L.object({id:L.string(),tenantId:L.string().optional(),code:L.number().optional(),description:L.string(),scope:L.string(),strictness:L.string(),status:L.string().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional()}),f00=L.object({rules:L.array(IM),hasPendingDeletes:L.boolean().default(!1)}),Wc0=L.object({code:L.string().optional(),description:L.string(),scope:L.string(),strictness:L.string()}),QM=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(Wc0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}),u00=L.object({version:QM,rulesCount:L.number()}),RH=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)}),b00=L.object({articles:L.array(RH),total:L.number().optional()}),Xc0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),Zc0=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(),qc0=L.enum(["assisted","semi_automatic","fully_automatic"]),y00=L.object({id:L.string(),url:L.string().url()}).passthrough(),_H=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:qc0,incomingDocumentWebhook:y00,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:y00,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:uS.default(fS)}).passthrough(),i00=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:Xc0.optional(),integrationSystem:L.string().optional(),integrations:L.array(Zc0).default([])}).passthrough(),Vc0=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(),Lc0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),JM=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:Vc0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:Lc0.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(),iS=L.object({records:L.array(JM).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),c00=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(),n00=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),p00=L.object({userId:L.string(),password:L.string()}).passthrough(),d00=L.object({password:L.string()}).passthrough(),KM=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(),m00=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(KM).default([])}).passthrough(),cS=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(),nS=L.object({items:L.array(cS).default([])}).passthrough(),l00=L.object({items:L.array(KM).default([])}).passthrough(),o00=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),Fc0=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(),r00=L.object({tagStats:L.array(Fc0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),wc0=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(),s00=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array(wc0).default([]),total:L.number().default(0)}).passthrough(),CH=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),a00=L.object({metrics:L.object({approvalCount:CH.optional(),accuracy:CH.optional(),automationRate:CH.optional(),riskCount:CH.optional(),avgDuration:CH.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(),t00=L.record(L.string(),L.unknown()),e00=L.object({expenses:L.array(t00).default([]),total:L.number().optional()}).passthrough(),$10=L.object({invoices:L.array(t00).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),Y10=L.record(L.string(),L.unknown()),z10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),U10=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(),I10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),Q10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),J10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),K10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Mc0=L.object({columns:L.array(K10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),G10=L.object({id:L.string().optional(),listSheets:L.array(Mc0).default([]),mainColumns:L.array(K10).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(),Oc0=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:G10.optional()}).passthrough(),Nc0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),Dc0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),pS=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:Oc0.optional(),requestSummary:Nc0.nullable().optional(),resultSummary:Dc0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),dS=L.object({batchId:L.string()}).passthrough(),Ac0=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(),H10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Ac0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),W10=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(),X10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),Z10=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:G10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Pc0=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(),mS=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:Pc0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),Oc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(mS).default([])}).passthrough(),Nc1=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(),q10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),Dc1=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 F10}from"node:crypto";async function M1($,Y){let z=await $.json();return Y.parse(z.data??z)}async function W8($){return M1(await $.get("api/v1/auth/me"),k00)}async function M10($){return M1(await $.get("api/auth/get-session"),x00)}async function p6($){return M1(await $.get("api/v1/rules"),f00)}async function hH($,Y){return M1(await $.post("api/v1/rules",{json:Y}),IM)}async function oS($,Y,z){return M1(await $.put(`api/v1/rules/${Y}`,{json:z}),IM)}async function mI($,Y){await $.delete(`api/v1/rules/${Y}`)}async function XM($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),z=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:z})}async function B$($){return M1(await $.get("api/v1/rule-set-versions"),L.array(QM))}async function SH($,Y){return M1(await $.get(`api/v1/rule-set-versions/${Y}`),QM)}async function gH($,Y){return M1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),u00)}async function _7($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??20)),z.set("sortBy",Y.sortBy??"createdAt"),z.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((U,I)=>{z.set(`filter[scenarios][${I}]`,U)}),M1(await $.get("api/v1/knowledge/articles",{searchParams:z}),b00)}async function O10($,Y){return M1(await $.get(`api/v1/knowledge/articles/${Y}`),RH)}async function ZM($,Y){return M1(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??[]}}),RH)}async function qM($,Y,z){let U=Object.fromEntries(Object.entries(z).filter(([,I])=>I!==void 0));return M1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:U}}),RH)}async function VM($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function o1($,Y="api/v1/agent/ai-approval/config"){return M1(await $.get(Y),i00)}async function m5($,Y,z="api/v1/agent/ai-approval/config"){return await $.post(z,{json:Y}),o1($,z)}async function rS($,Y,z="api/v1/agent/ai-approval/config"){let U=await $.post(z,{json:Y}),I=await U.json().catch(()=>({})),Q=WM.safeParse(I.data??I);return Q.success?Q.data.success??U.ok:U.ok}async function Q$($,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y);return sS(z.integrations)}async function LM($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=sS(I.integrations),J=j10(Y,Q,z);if(!await rS($,{...I,integrations:[...I.integrations,J]},U))throw Error("Seal did not confirm saving the Webhook integration");return J}async function N10($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=sS(I.integrations),J=j10(Y,Q,z);return{before:I,after:{...I,integrations:[...I.integrations,J]},integration:J}}async function D10($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=FM(I.integrations),J=wM(Q,Y),K=E10(J.integration,z);if(!await rS($,{...I,integrations:I.integrations.map((H,W)=>W===J.index?K:H)},U))throw Error("Seal did not confirm saving the Webhook integration");return K}async function A10($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=FM(I.integrations),J=wM(Q,Y),K=E10(J.integration,z);return{before:I,after:{...I,integrations:I.integrations.map((G,H)=>H===J.index?K:G)},integration:K}}async function P10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),I=FM(U.integrations),Q=wM(I,Y);if(!await rS($,{...U,integrations:U.integrations.filter((K,G)=>G!==Q.index)},z))throw Error("Seal did not confirm deleting the Webhook integration");return Q.integration}async function B10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),I=FM(U.integrations),Q=wM(I,Y);return{before:U,after:{...U,integrations:U.integrations.filter((J,K)=>K!==Q.index)},integration:Q.integration}}function v7($,Y){let z=Y.trim();if(!z)throw Error("Webhook selector must not be empty");let U=$.find((Q)=>Q.id===z);if(U)return U;let I=$.filter((Q)=>Q.name===z);if(I.length===1)return I[0];if(I.length>1)throw Error(`Multiple Webhook integrations match name: ${z}. Use the integration ID.`);throw Error(`Webhook integration not found: ${z}`)}function T10($,Y){let z=Y?.trim().toLowerCase();if(!z)return $;return $.filter((U)=>[U.id,U.name,U.mode,U.outgoingResultWebhook,U.incomingDocumentWebhook.url,U.incomingManualResultWebhook.url].some((I)=>I.toLowerCase().includes(z)))}function sS($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>_H.parse(Y))}function FM($){return $.flatMap((Y,z)=>{if(Y.type!=="webhook")return[];return[{index:z,integration:_H.parse(Y)}]})}function wM($,Y){let z=v7($.map((U)=>U.integration),Y);return $.find((U)=>U.integration.id===z.id)}function j10($,Y,z){let U=vH(z.name,"name"),I=z.mode??"assisted",Q=R10(z.outgoingResultWebhook,"outgoingResultWebhook"),J=_10(z.autoApprovalRate??60),K=jc0(Y),G=`wh_${K}_${F10(8).toString("hex").slice(0,7)}`,H=P$($);return _H.parse({type:"webhook",id:`integration-${K}`,name:U,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:z.secret?vH(z.secret,"secret"):C10(),autoApprovalRate:J,materialPackFilePolicy:nI(z.materialPackFilePolicy)})}function E10($,Y){return _H.parse({...$,...Y.name===void 0?{}:{name:vH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:R10(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:_10(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?C10():vH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:g00($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function jc0($){let Y=new Set($.map((U)=>U.id)),z=Date.now();while(Y.has(`integration-${z}`))z+=1;return z}function C10(){return F10(16).toString("hex")}function vH($,Y){let z=$.trim();if(!z)throw Error(`Webhook ${Y} must not be empty`);return z}function R10($,Y){let z=vH($,Y);try{return new URL(z).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function _10($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function MM($,Y={}){let[z,U,I]=await Promise.all([p6($),_7($,{limit:Y.documentLimit??50}),o1($,Y.stylePreferencesEndpoint).then((Q)=>({ok:!0,data:Q}),(Q)=>({ok:!1,error:Q instanceof Error?Q.message:String(Q)}))]);return{rules:z,documents:U,stylePreferences:I}}async function b4($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??50)),c8(z,"fromTimestamp",Y.fromTimestamp),c8(z,"toTimestamp",Y.toTimestamp),c8(z,"startDate",Y.startDate),c8(z,"endDate",Y.endDate),V10(z,"status",Y.status),c8(z,"sourceSystem",Y.sourceSystem),c8(z,"taskMode",Y.taskMode),c8(z,"search",Y.search),c8(z,"sourceDocumentSN",Y.sourceDocumentSN),c8(z,"sourceDocumentId",Y.sourceDocumentId),V10(z,"manualApprovalStatus",Y.manualApprovalStatus),M1(await $.get("api/v1/approvals",{searchParams:z}),iS)}async function H4($,Y){return M1(await $.get(`api/v1/approvals/${Y}`),JM)}async function aS($,Y){let z=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),U=z.data??z;if(Array.isArray(U))return L.array(JM).parse(U);return iS.parse(U).records}async function v10($,Y){return M1(await $.post("api/v1/simulation/create-batch",{json:Y}),dS)}async function h10($,Y){return M1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),dS)}async function S10($,Y={}){let z=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),U=z.data??z;return L.array(pS).parse(U)}async function OM($,Y){return M1(await $.get(`api/v1/simulation/batch/${Y}`),pS)}async function g10($){let Y=await $.get("api/v1/simulation/templates").json(),z=Y.data??Y;return L.array(H10).parse(z)}async function tS($){return M1(await $.get("api/v1/simulation/integration-status"),W10)}async function eS($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),z=Y.data??Y;return L.array(X10).parse(z)}async function y10($,Y){let U=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return U.data??U}async function k10($,Y){let z=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",U=Y?new URLSearchParams({signKey:Y}):void 0,I=await $.get(z,{searchParams:U}).json(),Q=I.data??I;return L.array(q10).parse(Q)}async function x10($,Y){let z=await $.post("api/hosecloud/corporation",{json:Y}).json(),U=z.data??z;return L.object({corporationId:L.string()}).parse(U)}async function f10($,Y){let U=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return U.data??U}async function u10($,Y){let z=new FormData;return z.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),M1(await $.post("api/v1/material-packages/upload",{body:z}),Z10)}function c8($,Y,z){if(z)$.set(Y,z)}function V10($,Y,z){if(!z)return;(Array.isArray(z)?z:[z]).map((I)=>I.trim()).filter(Boolean).forEach((I,Q)=>{$.set(`${Y}[${Q}]`,I)})}async function b10($){return M1(await $.get("api/v1/delegation/list"),L.array(c00))}async function dI($,Y){return M1(await $.post("api/v1/delegation/create",{json:Y??{}}),n00)}async function i10($,Y){let z=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),U=await z.json(),I=WM.safeParse(U.data??U);return I.success?I.data.success??z.ok:z.ok}async function c10($,Y){let z=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!z){let U=await $.get("api/v1/contacts/departments/root/children").json(),I=Bc0.safeParse(U.data??U),Q=I.success?I.data.items?.[0]?._id:void 0;if(Q)z=[Q]}return M1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:z??[]}}),p00)}async function $g($,Y){return M1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),d00)}async function GM($,Y){return M1(await $.get(`api/v1/contacts/users/${Y}`),KM)}async function HM($,Y=""){return M1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),m00)}async function n10($){return M1(await $.get("api/v1/contacts/departments/root/children"),nS)}async function p10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),cS)}async function d10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),nS)}async function m10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),l00)}async function l10($){return M1(await $.get("api/v1/contacts/last-sync-time"),o00)}async function NM($,Y={}){let z=Yg(),U=new URLSearchParams;if(c8(U,"startDate",Y.startDate??z.startDate),c8(U,"endDate",Y.endDate??z.endDate),Y.limit!==void 0)U.set("limit",String(Y.limit));return M1(await $.get("api/v1/insight/stats",{searchParams:U}),r00)}async function DM($,Y){let z=Yg(),U=new URLSearchParams;return U.set("tagId",Y.tagId),U.set("startDate",Y.startDate??z.startDate),U.set("endDate",Y.endDate??z.endDate),M1(await $.get("api/v1/insight/risks-by-tag",{searchParams:U}),s00)}async function AM($,Y={}){let z=Yg(),U=L10(Y.startDate??z.startDate),I=L10(Y.endDate??z.endDate),Q=new URLSearchParams;return Q.set("startDate",String(U)),Q.set("endDate",String(I)),M1(await $.get("api/v1/insight/performance",{searchParams:Q}),a00)}async function o10($,Y){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(Y)}`),{success:!0,recordId:Y}}function L10($){if(typeof $==="number")return $<100000000000?$*1000:$;let Y=Number($);if(!isNaN(Y)&&$.trim()!=="")return Y<100000000000?Y*1000:Y;let z=new Date($);if(isNaN(z.getTime()))throw Error(`Invalid date format: ${$}`);return z.getTime()}function Yg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),z=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:z.toISOString()}}function r10($){let Y=new URLSearchParams;return c8(Y,"filter[startDate]",$.startDate),c8(Y,"filter[endDate]",$.endDate),c8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function s10($,Y={}){return M1(await $.get("api/v1/expenses/list",{searchParams:r10(Y)}),e00)}async function a10($,Y={}){return M1(await $.get("api/v1/invoice/list",{searchParams:r10(Y)}),$10)}async function t10($){return M1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(Y10))}async function e10($,Y){let z=await $.delete(`api/v1/contacts/local/users/${Y}`),U=await z.json(),I=WM.safeParse(U.data??U);return I.success?I.data.success??z.ok:z.ok}async function zg($,Y){let z=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),U=await z.json(),I=WM.safeParse(U.data??U);return I.success?I.data.success??z.ok:z.ok}async function Ec0($,Y){let z=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),U=z.headers.get("set-auth-token"),I=Tc0.parse(await z.json()),Q=U??I.session?.token;if(!Q)throw Error("Failed to retrieve authentication token from login response");return{token:Q,user:I.user}}async function $40($,Y,z,U){let I;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await HM($,Y.userIdOrPhone),V=q.users.find((F)=>F.mobile?.includes(Y.userIdOrPhone)||F._id===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${Y.userIdOrPhone}`);I=V}else I=await GM($,Y.userIdOrPhone).catch(async()=>{let q=await HM($,Y.userIdOrPhone),V=q.users.find((F)=>F.name===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${Y.userIdOrPhone}`);return V});if(I.status==="resigned")await zg($,I._id),I=await GM($,I._id);let Q=I,J=Array.isArray(Q.identities)&&Q.identities.some((q)=>q.provider&&q.provider!=="local")||!!Q.apps?.hosecloud;if(J&&U&&U.source.type==="hose"){let V=(I.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=Q.identities?.find((w)=>w.provider==="hosecloud")?.providerId,M=Q.apps?.hosecloud?.boundId||F||(V?`${U.source.corpId}:${V}`:void 0);if(M){let w=await iI(U),D=(await $M({...U.source,staffId:M},w)).token,N=R7(U,U.source),B=A6(U.seal),T=T8(N,void 0,B),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:D,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 z(j),b=await dI(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 $g($,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 Ec0($,{phone:H,password:K.password}),X=await z(W),Z=await dI(X,{note:Y.note??`Delegation generated by admin for ${I.name}`});return{targetUser:I,delegation:Z,temporaryPassword:K.password}}async function Y40($){return M1(await $.get("api/v1/llm/config"),z10)}async function z40($){return M1(await $.get("api/v1/llm/providers"),L.array(U10))}async function U40($){return M1(await $.get("api/v1/permissions/available"),I10)}async function I40($){return M1(await $.get("api/v1/permissions/configs"),Q10)}async function cY($){return M1(await $.get("api/v1/billing/status"),J10)}async function Q40($){let z=await(await $.get("api/v1/billing/plans")).json();return w10.parse(z.data??z)}async function J40($){let z=await(await $.get("api/v1/billing/features")).json();return w10.parse(z.data??z)}var WM,Bc0,Tc0,w10;var X6=o(()=>{uI();A$();pI();a9();i8();lS();WM=L.object({success:L.boolean().optional()}).passthrough(),Bc0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),Tc0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),w10=L.json()});var Y6=E((An1,G40)=>{var{toString:K40}=Object.prototype,Cc0=/["&<>]/,e9={each:function(Y,z){if(Y)if(Array.isArray(Y))Y.forEach(z);else Object.keys(Y).forEach((U)=>{z(Y[U],U)})},some:function(Y,z){if(Y){if(Array.isArray(Y))return Y.some(z);return Object.keys(Y).some((U)=>z(Y[U],U))}return!1},every:function(Y,z){if(Y){if(Array.isArray(Y))return Y.every(z);return Object.keys(Y).every((U)=>z(Y[U],U))}return!0},map:function(Y,z){if(Y){if(Array.isArray(Y))return Y.map(z);return Object.keys(Y).map((U)=>z(Y[U],U))}return[]},keyBy($,Y){return $.reduce((z,U)=>{return z[U[Y]]=U,z},{})},isEqual:function(Y,z){let U=typeof Y,I=typeof z,Q=Array.isArray(Y),J=Array.isArray(z),K;if(U!==I)return!1;switch(typeof Y){case"object":if(Q||J){if(Q&&J)return Y.length===z.length&&Y.every((G,H)=>{let W=z[H];return e9.isEqual(G,W)});return!1}if(Y===null||z===null)return Y===z;if(K=Object.keys(Y),Object.keys(z).length!==K.length)return!1;for(let G of K)if(!z.hasOwnProperty(G))return!1;return e9.every(Y,(G,H)=>{let W=z[H];return e9.isEqual(G,W)});default:return Y===z}},escapeHtml($){let Y=Cc0.exec($);if(!Y)return $;let z="",U="",I=0,Q=Y.index;for(;Q<$.length;Q++){switch($.charAt(Q)){case'"':U=""";break;case"&":U="&";break;case"'":U="'";break;case"<":U="<";break;case">":U=">";break;default:continue}if(I!==Q)z+=$.substring(I,Q);I=Q+1,z+=U}if(I!==Q)return z+$.substring(I,Q);return z},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return K40.call($)==="[object Undefined]"},isObject($){return K40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,z,U,I;function Q(J,K){if(z=$[K],I=Array.isArray(J),e9.isObject(J)||I){if(I)I=!1,U=z&&Array.isArray(z)?z:[];else U=z&&e9.isObject(z)?z:{};$[K]=e9.deepMerge(U,J)}else if(!e9.isUndefined(J))$[K]=J}for(let J=0;J{var Rc0=/^[A-Z]+\d+$/,yH={_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,z,U,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)z=J-27,U=z%26,I=Math.floor(z/26),Y=this._dictionary[I]+this._dictionary[U],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){J=703;while(J<=16384)z=J-703,U=z%26,I=Math.floor(z/26)%26,Q=Math.floor(z/676),Y=this._dictionary[Q]+this._dictionary[I]+this._dictionary[U],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(!Rc0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let z=!1,U="",I=0,Q=!1,J="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!Q&&W>=65&&W<=90)z=!0,U+=$[H],I=I*26+W-64;else if(W>=48&&W<=57)Q=!0,J+=$[H],K=K*10+W-48;else if(Q&&z&&W!==36)break;if(!z)I=void 0;else if(I>16384)throw Error(`Out of bounds. Invalid column letter: ${U}`);if(!Q)K=void 0;$=U+J;let G={address:$,col:I,row:K,$col$row:`$${U}$${J}`};if(I<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let z=this.n2l(Y)+$;return this.decodeAddress(z)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let z=this.decodeAddress(Y[0]),U=this.decodeAddress(Y[1]),I={top:Math.min(z.row,U.row),left:Math.min(z.col,U.col),bottom:Math.max(z.row,U.row),right:Math.max(z.col,U.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(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),z=Y[1]||Y[2],U=Y[3],I=U.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:z,tl:{address:J,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:z},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:z},dimensions:`${J}:${K}`}}if(U.startsWith("#"))return z?{sheetName:z,error:U}:{error:U};let Q=this.decodeAddress(U);return z?{sheetName:z,...Q}:Q},encodeAddress($,Y){return yH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return yH.encodeAddress(arguments[0],arguments[1]);case 4:return`${yH.encodeAddress(arguments[0],arguments[1])}:${yH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[z,U,,I,Q]=$,[J,K]=Y;return J>=z&&J<=I&&K>=U&&K<=Q}};H40.exports=yH});var $3=E((Bn1,W40)=>{var l5=i4();class Ug{constructor(){this.decode(arguments)}setTLBR($,Y,z,U,I){if(arguments.length<4){let Q=l5.decodeAddress($),J=l5.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:z},this.setTLBR(Q.row,Q.col,J.row,J.col,I)}else this.model={top:Math.min($,z),left:Math.min(Y,U),bottom:Math.max($,z),right:Math.max(Y,U),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 Ug)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 z=l5.decodeEx(Y);if(z.top)this.model={top:z.top,left:z.left,bottom:z.bottom,right:z.right,sheetName:z.sheetName};else this.model={top:z.row,left:z.col,bottom:z.row,right:z.col,sheetName:z.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,z,U){if(!this.model.top||$this.bottom)this.bottom=z;if(!this.model.right||U>this.right)this.right=U}expandRow($){if($){let{dimensions:Y,number:z}=$;if(Y)this.expand(z,Y.min,z,Y.max)}}expandToAddress($){let Y=l5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return l5.n2l(this.left)+this.top}get $t$l(){return`$${l5.n2l(this.left)}$${this.top}`}get br(){return l5.n2l(this.right)+this.bottom}get $b$r(){return`$${l5.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=l5.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 z=this.top;z<=this.bottom;z++)$(l5.encodeAddress(z,Y),z,Y)}}W40.exports=Ug});var G5=E((Tn1,X40)=>{X40.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 q40=E((jn1,Z40)=>{var PM=i4(),_c0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,vc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function hc0($,Y,z){let U=PM.decode(Y),I=PM.decode(z);return $.replace(_c0,(Q,J,K,G,H)=>{if(H)return Q;let W=vc0.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 F=PM.l2n(Z),M=parseInt(V,10);if(!X)F+=I.col-U.col;if(!q)M+=I.row-U.row;return(J||"")+(X||"")+PM.n2l(F)+(q||"")+M}return Q})}Z40.exports={slideFormula:hc0}});var L40=E((En1,V40)=>{var Sc0=Y6();class kH{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 Sc0.deepMerge({},kH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:z}=Y;if(z.length===1&&Object.keys(z[0]).length===1)this.note=z[0].text;else this.note=Y}static fromModel($){let Y=new kH;return Y.model=$,Y}}kH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};V40.exports=kH});var _40=E((Cn1,R40)=>{var gc0=i4(),yc0=Y6(),H5=G5(),{slideFormula:kc0}=q40(),F40=L40();class d0{constructor($,Y,z){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,gc0.validateAddress(z),this._address=z,this._value=h7.create(d0.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,z){let U=$&&$.numFmt||Y&&Y.numFmt;if(U)z.numFmt=U;let I=$&&$.font||Y&&Y.font;if(I)z.font=I;let Q=$&&$.alignment||Y&&Y.alignment;if(Q)z.alignment=Q;let J=$&&$.border||Y&&Y.border;if(J)z.border=J;let K=$&&$.fill||Y&&Y.fill;if(K)z.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)z.protection=G;return z}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===d0.Types.Merge}merge($,Y){if(this._value.release(),this._value=h7.create(d0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===d0.Types.Merge)this._value.release(),this._value=h7.create(d0.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{})}isMergedTo($){if(this._value.type!==d0.Types.Merge)return!1;return this._value.isMergedTo($)}get master(){if(this.type===d0.Types.Merge)return this._value.master;return this}get isHyperlink(){return this._value.type===d0.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value($){if(this.type===d0.Types.Merge){this._value.master.value=$;return}this._value.release(),this._value=h7.create(h7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new F40($)}get text(){return this._value.toString()}get html(){return yc0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===d0.Types.String)this._value=h7.create(d0.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((z)=>{Y.addEx(this.fullAddress,z)})}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=h7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=F40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}d0.Types=H5.ValueType;class w40{constructor($){this.model={address:$.address,type:d0.Types.Null}}get value(){return null}set value($){}get type(){return d0.Types.Null}get effectiveType(){return d0.Types.Null}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){}toString(){return""}}class M40{constructor($,Y){this.model={address:$.address,type:d0.Types.Number,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Number}get effectiveType(){return d0.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 O40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.String}get effectiveType(){return d0.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 N40{constructor($,Y){this.model={address:$.address,type:d0.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 d0.Types.RichText}get effectiveType(){return d0.Types.RichText}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}class D40{constructor($,Y){this.model={address:$.address,type:d0.Types.Date,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Date}get effectiveType(){return d0.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 A40{constructor($,Y){if(this.model={address:$.address,type:d0.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 d0.Types.Hyperlink}get effectiveType(){return d0.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 P40{constructor($,Y){if(this.model={address:$.address,type:d0.Types.Merge,master:Y?Y.address:void 0},this._master=Y,Y)Y.addMergeRef()}get value(){return this._master.value}set value($){if($ instanceof d0){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 d0.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 B40{constructor($,Y){this.cell=$,this.model={address:$.address,type:d0.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={},z=(U)=>{let I=$[U];if(I)Y[U]=I};return z("formula"),z("result"),z("ref"),z("shareType"),z("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(h7.getType($)){case d0.Types.Null:case d0.Types.String:case d0.Types.Number:case d0.Types.Date:break;case d0.Types.Hyperlink:case d0.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 H5.FormulaType.Master;if(this.model.sharedFormula)return H5.FormulaType.Shared;return H5.FormulaType.None}get result(){return this.model.result}set result($){this.model.result=$}get type(){return d0.Types.Formula}get effectiveType(){let $=this.model.result;if($===null||$===void 0)return H5.ValueType.Null;if($ instanceof String||typeof $==="string")return H5.ValueType.String;if(typeof $==="number")return H5.ValueType.Number;if($ instanceof Date)return H5.ValueType.Date;if($.text&&$.hyperlink)return H5.ValueType.Hyperlink;if($.formula)return H5.ValueType.Formula;return H5.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&&kc0(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 T40{constructor($,Y){this.model={address:$.address,type:d0.Types.SharedString,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.SharedString}get effectiveType(){return d0.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 j40{constructor($,Y){this.model={address:$.address,type:d0.Types.Boolean,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Boolean}get effectiveType(){return d0.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 E40{constructor($,Y){this.model={address:$.address,type:d0.Types.Error,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Error}get effectiveType(){return d0.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 C40{constructor($,Y){this.model={address:$.address,type:d0.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 d0.Types.String}get effectiveType(){return d0.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 h7={getType($){if($===null||$===void 0)return d0.Types.Null;if($ instanceof String||typeof $==="string")return d0.Types.String;if(typeof $==="number")return d0.Types.Number;if(typeof $==="boolean")return d0.Types.Boolean;if($ instanceof Date)return d0.Types.Date;if($.text&&$.hyperlink)return d0.Types.Hyperlink;if($.formula||$.sharedFormula)return d0.Types.Formula;if($.richText)return d0.Types.RichText;if($.sharedString)return d0.Types.SharedString;if($.error)return d0.Types.Error;return d0.Types.JSON},types:[{t:d0.Types.Null,f:w40},{t:d0.Types.Number,f:M40},{t:d0.Types.String,f:O40},{t:d0.Types.Date,f:D40},{t:d0.Types.Hyperlink,f:A40},{t:d0.Types.Formula,f:B40},{t:d0.Types.Merge,f:P40},{t:d0.Types.JSON,f:C40},{t:d0.Types.SharedString,f:T40},{t:d0.Types.RichText,f:N40},{t:d0.Types.Boolean,f:j40},{t:d0.Types.Error,f:E40}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,z){let U=this.types[$];if(!U)throw Error(`Could not create Value of type ${$}`);return new U(Y,z)}};R40.exports=d0});var TM=E((Rn1,S40)=>{var xc0=Y6(),BM=G5(),nY=i4(),v40=_40();class h40{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 z=this._worksheet.getColumn($.col);Y=new v40(this,z,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=nY.l2n($)}return this._cells[$-1]||this.getCellEx({address:nY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...z){let U=$+Y,I=z.length-Y,Q=this._cells.length,J,K,G;if(I<0){for(J=$+z.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>=U;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(z&&z.type!==BM.ValueType.Null)Y(z,U+1)})}addPageBreak($,Y){let z=this._worksheet,U=Math.max(0,$-1)||0,I=Math.max(0,Y-1)||16838,Q={id:this._number,max:I,man:1};if(U)Q.min=U;z.rowBreaks.push(Q)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==BM.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((z,U)=>{if(z!==void 0)this.getCellEx({address:nY.encodeAddress(this._number,U+Y),row:this._number,col:U+Y}).value=z})}else this._worksheet.eachColumnKey((Y,z)=>{if($[z]!==void 0)this.getCellEx({address:nY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[z]})}get hasValues(){return xc0.some(this._cells,($)=>$&&$.type!==BM.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((z)=>{if(z&&z.type!==BM.ValueType.Null){if(!$||$>z.col)$=z.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((z)=>{if(z)z[$]=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,z=0;return this._cells.forEach((U)=>{if(U){let I=U.model;if(I){if(!Y||Y>U.col)Y=U.col;if(z{switch(z.type){case v40.Types.Merge:break;default:{let U;if(z.address)U=nY.decodeAddress(z.address);else if(Y){let{row:Q}=Y,J=Y.col+1;U={row:Q,col:J,address:nY.encodeAddress(Q,J),$col$row:`$${nY.n2l(J)}$${Q}`}}Y=U;let I=this.getCellEx(U);I.model=z;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}S40.exports=h40});var EM=E((_n1,g40)=>{var fc0=Y6(),uc0=G5(),bc0=i4();class jM{constructor($,Y,z){if(this._worksheet=$,this._number=Y,z!==!1)this.defn=z}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return bc0.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,z)=>{this._worksheet.getCell(z+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&&fc0.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 z=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(U,I)=>{Y(U.getCell(z),I)})}get values(){let $=[];return this.eachCell((Y,z)=>{if(Y&&Y.type!==uc0.ValueType.Null)$[z]=Y.value}),$}set values($){if(!$)return;let Y=this.number,z=0;if($.hasOwnProperty("0"))z=1;$.forEach((U,I)=>{this._worksheet.getCell(I+z,Y).value=U})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((z)=>{z[$]=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=[],z=null;if($)$.forEach((U,I)=>{if(U.isDefault){if(z)z=null}else if(!z||!U.equivalentTo(z))z={min:I+1,max:I+1,width:U.width!==void 0?U.width:9,style:U.style,isCustomWidth:U.isCustomWidth,hidden:U.hidden,outlineLevel:U.outlineLevel,collapsed:U.collapsed},Y.push(z);else z.max=I+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let z=[],U=1,I=0;Y=Y.sort(function(Q,J){return Q.min-J.min});while(I{var ic0=i4();class CM{constructor($,Y,z=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let U=ic0.decodeAddress(Y);this.nativeCol=U.col+z,this.nativeColOff=0,this.nativeRow=U.row+z,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+z,this.row=Y.row+z;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof CM||$==null?$:new CM($)}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}}y40.exports=CM});var u40=E((hn1,f40)=>{var cc0=i4(),RM=k40();class x40{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:z,hyperlinks:U}){if(this.type=$,this.imageId=Y,$==="image")if(typeof z==="string"){let I=cc0.decode(z);this.range={tl:new RM(this.worksheet,{col:I.left,row:I.top},-1),br:new RM(this.worksheet,{col:I.right,row:I.bottom},0),editAs:"oneCell"}}else this.range={tl:new RM(this.worksheet,z.tl,0),br:z.br&&new RM(this.worksheet,z.br,0),ext:z.ext,editAs:z.editAs,hyperlinks:U||z.hyperlinks}}}f40.exports=x40});var n40=E((Sn1,c40)=>{var _M=i4();class b40{constructor($,Y,z){this.table=$,this.column=Y,this.index=z}_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 i40{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 z=(G,H)=>{if(!G)throw Error(H)};z($.ref,"Table must have ref"),z($.columns,"Table must have column definitions"),z($.rows,"Table must have row definitions"),$.tl=_M.decodeAddress($.ref);let{row:U,col:I}=$.tl;z(U>0,"Table must be on valid row"),z(I>0,"Table must be on valid col");let{width:Q,filterHeight:J,tableHeight:K}=this;$.autoFilterRef=_M.encode(U,I,U+J-1,I+Q-1),$.tableRef=_M.encode(U,I,U+K-1,I+Q-1),$.columns.forEach((G,H)=>{if(z(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:z}=this,{row:U,col:I}=z.tl,Q=0;if(z.headerRow){let J=Y.getRow(U+Q++);z.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=J.getCell(I+G);X.value=W,$(X,H)})}if(z.rows.forEach((J)=>{let K=Y.getRow(U+Q++);J.forEach((G,H)=>{let W=K.getCell(I+H);W.value=G,$(W,z.columns[H].style)})}),z.totalsRow){let J=Y.getRow(U+Q++);z.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:z,col:U}=Y.tl,I=0;if(Y.headerRow){let Q=$.getRow(z+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(U+K);G.value=J.name})}if(Y.rows.forEach((Q)=>{let J=$.getRow(z+I++);Q.forEach((K,G)=>{let H=J.getCell(U+G);H.value=K})}),Y.totalsRow){let Q=$.getRow(z+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(U+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 $=_M.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{U.push(Y[I])});else this.table.columns.splice(z,0,$),this.table.rows.forEach((U,I)=>{U.splice(z,0,Y[I])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((z)=>{z.splice($,Y)})}_assign($,Y,z){this.cacheState(),$[Y]=z}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=$}}c40.exports=i40});var Ig=E((gn1,d40)=>{class p40{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}d40.exports=p40});var Jg=E((yn1,m40)=>{var Qg=J0("crypto"),nc0={hash($,...Y){let z=Qg.createHash($);return z.update(Buffer.concat(Y)),z.digest()},convertPasswordToHash($,Y,z,U){if(Y=Y.toLowerCase(),Qg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let Q=Buffer.from($,"utf16le"),J=this.hash(Y,Buffer.from(z,"base64"),Q);for(let K=0;K{var l40=($,Y)=>({...$,...Y.reduce((z,U)=>{if($[U])z[U]={...$[U]};return z},{})}),o5=($,Y,z,U=[])=>{if($[z])Y[z]=l40($[z],U)},pc0=($)=>Object.keys($).length===0,dc0=($)=>{if(!$)return $;if(pc0($))return{};let Y={...$};if(o5($,Y,"font",["color"]),o5($,Y,"alignment"),o5($,Y,"protection"),$.border)o5($,Y,"border"),o5($.border,Y.border,"top",["color"]),o5($.border,Y.border,"left",["color"]),o5($.border,Y.border,"bottom",["color"]),o5($.border,Y.border,"right",["color"]),o5($.border,Y.border,"diagonal",["color"]);if($.fill){if(o5($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((z)=>l40(z,["color"]))}return Y};mc0.copyStyle=dc0});var z60=E((xn1,Y60)=>{var xH=Y6(),fH=i4(),uH=$3(),r40=TM(),vM=EM(),oc0=G5(),Kg=u40(),s40=n40(),a40=Ig(),t40=Jg(),{copyStyle:e40}=o40();class $60{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 a40,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 uH;return this._rows.forEach((Y)=>{if(Y){let z=Y.dimensions;if(z)$.expand(Y.number,z.min,Y.number,z.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((U,I)=>{let Q=I.header&&1||I.headers&&I.headers.length||0;return Math.max(U,Q)},0);let Y=1,z=this._columns=[];$.forEach((U)=>{let I=new vM(this,Y++,!1);z.push(I),I.defn=U})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){xH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=fH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new vM(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...z){let I=this._rows.length;if(z.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=z.length-Y,J=$+Y,K=this._columns.length;if(Q<0)for(let G=$+z.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<$+z.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,z.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((z)=>{z.eachCell(({col:U})=>{if(!$[U])$[U]=!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 r40(this,$);return Y}getRows($,Y){if(Y<1)return;let z=[];for(let U=$;U<$+Y;U++)z.push(this.getRow(U));return z}addRow($,Y="n"){let z=this._nextRow,U=this.getRow(z);return U.values=$,this._setStyleOption(z,Y[0]==="i"?Y:"n"),U}addRows($,Y="n"){let z=[];return $.forEach((U)=>{z.push(this.addRow(U,Y))}),z}insertRow($,Y,z="n"){return this.spliceRows($,0,Y),this._setStyleOption($,z),this.getRow($)}insertRows($,Y,z="n"){if(this.spliceRows($,0,...Y),z!=="n"){for(let U=0;U{I.getCell(J).style=e40(Q.style)}),I.height=U.height}duplicateRow($,Y,z=!1){let U=this._rows[$-1],I=Array(Y).fill(U.values);this.spliceRows($+1,z?0:Y,...I);for(let Q=0;Q{J.getCell(G).style=K.style})}}spliceRows($,Y,...z){let U=$+Y,I=z.length,Q=I-Y,J=this._rows.length,K,G;if(Q<0){if($===J)this._rows[J-1]=void 0;for(K=U;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>=U;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(z&&z.hasValues)Y(z,z.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let z=fH.getAddress($,Y),U=this._rows[z.row-1];return U?U.findCell(z.col):void 0}getCell($,Y){let z=fH.getAddress($,Y);return this.getRow(z.row).getCellEx(z)}mergeCells(...$){let Y=new uH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new uH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){xH.each(this._merges,(U)=>{if(U.intersects($))throw Error("Cannot merge already merged cells")});let z=this.getCell($.top,$.left);for(let U=$.top;U<=$.bottom;U++)for(let I=$.left;I<=$.right;I++)if(U>$.top||I>$.left)this.getCell(U,I).merge(z,Y);this._merges[z.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++)this.getCell(z,U).unmerge();delete this._merges[$.address]}}get hasMerges(){return xH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new uH($);for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++){let I=this.findCell(z,U);if(I){if(I.type===oc0.ValueType.Merge)this._unMergeMaster(I.master);else if(this._merges[I.address])this._unMergeMaster(I)}}}fillFormula($,Y,z,U="shared"){let I=fH.decode($),{top:Q,left:J,bottom:K,right:G}=I,H=G-J+1,W=fH.encodeAddress(Q,J),X=U==="shared",Z;if(typeof z==="function")Z=z;else if(Array.isArray(z))if(Array.isArray(z[0]))Z=(V,F)=>z[V-Q][F-J];else Z=(V,F)=>z[(V-Q)*H+(F-J)];else Z=()=>{return};let q=!0;for(let V=Q;V<=K;V++)for(let F=J;F<=G;F++)if(q)this.getCell(V,F).value={shareType:U,formula:Y,ref:$,result:Z(V,F)},q=!1;else this.getCell(V,F).value=X?{sharedFormula:W,result:Z(V,F)}:Z(V,F)}addImage($,Y){let z={type:"image",imageId:$,range:Y};this._media.push(new Kg(this,z))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new Kg(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((z)=>{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=t40.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=t40.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}z()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new s40(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((U)=>U.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((U)=>U.model),conditionalFormattings:this.conditionalFormattings};$.cols=vM.toModel(this.columns);let Y=$.rows=[],z=$.dimensions=new uH;return this._rows.forEach((U)=>{let I=U&&U.model;if(I)z.expand(I.number,I.min,I.number,I.max),Y.push(I)}),$.merges=[],xH.each(this._merges,(U)=>{$.merges.push(U.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let z=new r40(this,Y.number);this._rows[z.number-1]=z,z.model=Y})}_parseMergeCells($){xH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=vM.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new a40($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new Kg(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,z)=>{let U=new s40;return U.model=z,Y[z.name]=U,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}Y60.exports=$60});var J60=E((fn1,Q60)=>{var U60=Y6(),hM=i4();class I60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(hM.decodeEx($))}getCell($){return this.findCellEx(hM.decodeEx($),!0)}findCell($){return this.findCellEx(hM.decodeEx($),!1)}findCellAt($,Y,z){let U=this.sheets[$],I=U&&U[Y];return I&&I[z]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let z=$.left;z<=$.right;z++)this.getCellAt($.sheetName,Y,z);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let z=this.findSheet($,Y),U=this.findSheetRow(z,$,Y);return this.findRowCell(U,$,Y)}getCellAt($,Y,z){let U=this.sheets[$]||(this.sheets[$]=[]),I=U[Y]||(U[Y]=[]);return I[z]||(I[z]={sheetName:$,address:hM.n2l(z)+Y,row:Y,col:z})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let z=this.findSheetRow(Y,$);if(!z)return;delete z[$.col]}forEachInSheet($,Y){let z=this.sheets[$];if(z)z.forEach((U,I)=>{if(U)U.forEach((Q,J)=>{if(Q)Y(Q,I,J)})})}forEach($){U60.each(this.sheets,(Y,z)=>{this.forEachInSheet(z,$)})}map($){let Y=[];return this.forEach((z)=>{Y.push($(z))}),Y}findSheet($,Y){let z=$.sheetName;if(this.sheets[z])return this.sheets[z];if(Y)return this.sheets[z]=[];return}findSheetRow($,Y,z){let{row:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=[];return}findRowCell($,Y,z){let{col:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,z,U){let I=this.sheets[$];if(I){let Q=[];for(let J=0;J{J.splice(Y,z,...Q)})}}}Q60.exports=I60});var Gg=E((un1,H60)=>{var lI=Y6(),bH=i4(),K60=J60(),rc0=$3(),sc0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class G60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new K60)}add($,Y){let z=bH.decodeEx($);this.addEx(z,Y)}addEx($,Y){let z=this.getMatrix(Y);if($.top)for(let U=$.left;U<=$.right;U++)for(let I=$.top;I<=$.bottom;I++){let Q={sheetName:$.sheetName,address:bH.n2l(U)+I,row:I,col:U};z.addCellEx(Q)}else z.addCellEx($)}remove($,Y){let z=bH.decodeEx($);this.removeEx(z,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){lI.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){lI.each(this.matrixMap,(Y,z)=>{Y.forEach((U)=>{$(z,U)})})}getNames($){return this.getNamesEx(bH.decodeEx($))}getNamesEx($){return lI.map(this.matrixMap,(Y,z)=>Y.findCellEx($)&&z).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:z}=Y,U=new rc0(Y.row,Y.col,Y.row,Y.col,z),I,Q;function J(G,H){let W=$.findCellAt(z,G,Y.col);if(!W||!W.mark)return!1;return U[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=U.top;Q<=U.bottom;Q++){let X=$.findCellAt(z,Q,G);if(X&&X.mark)W.push(X);else return!1}U[H]=G;for(let X=0;X{U.mark=!0});let z=Y.map((U)=>U.mark&&this._explore(Y,U)).filter(Boolean).map((U)=>U.$shortRange);return{name:$,ranges:z}}normaliseMatrix($,Y){$.forEachInSheet(Y,(z,U,I)=>{if(z){if(z.row!==U||z.col!==I)z.row=U,z.col=I,z.address=bH.n2l(I)+U}})}spliceRows($,Y,z,U){lI.each(this.matrixMap,(I)=>{I.spliceRows($,Y,z,U),this.normaliseMatrix(I,$)})}spliceColumns($,Y,z,U){lI.each(this.matrixMap,(I)=>{I.spliceColumns($,Y,z,U),this.normaliseMatrix(I,$)})}get model(){return lI.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((z)=>{let U=Y[z.name]=new K60;z.ranges.forEach((I)=>{if(sc0.test(I.split("!").pop()||""))U.addCell(I)})})}}H60.exports=G60});var J6=E((bn1,Hg)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)Hg.exports={nextTick:ac0};else Hg.exports=process;function ac0($,Y,z,U){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,z)});case 4:return process.nextTick(function(){$.call(null,Y,z,U)});default:Q=Array(I-1),J=0;while(J{var tc0={}.toString;W60.exports=Array.isArray||function($){return tc0.call($)=="[object Array]"}});var K6=E((Wg,Z60)=>{var SM=J0("buffer"),Y3=SM.Buffer;function X60($,Y){for(var z in $)Y[z]=$[z]}if(Y3.from&&Y3.alloc&&Y3.allocUnsafe&&Y3.allocUnsafeSlow)Z60.exports=SM;else X60(SM,Wg),Wg.Buffer=rI;function rI($,Y,z){return Y3($,Y,z)}X60(Y3,rI);rI.from=function($,Y,z){if(typeof $==="number")throw TypeError("Argument must not be a number");return Y3($,Y,z)};rI.alloc=function($,Y,z){if(typeof $!=="number")throw TypeError("Argument must be a number");var U=Y3($);if(Y!==void 0)if(typeof z==="string")U.fill(Y,z);else U.fill(Y);else U.fill(0);return U};rI.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return Y3($)};rI.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return SM.SlowBuffer($)}});var M4=E((qn0)=>{function ec0($){if(Array.isArray)return Array.isArray($);return gM($)==="[object Array]"}qn0.isArray=ec0;function $n0($){return typeof $==="boolean"}qn0.isBoolean=$n0;function Yn0($){return $===null}qn0.isNull=Yn0;function zn0($){return $==null}qn0.isNullOrUndefined=zn0;function Un0($){return typeof $==="number"}qn0.isNumber=Un0;function In0($){return typeof $==="string"}qn0.isString=In0;function Qn0($){return typeof $==="symbol"}qn0.isSymbol=Qn0;function Jn0($){return $===void 0}qn0.isUndefined=Jn0;function Kn0($){return gM($)==="[object RegExp]"}qn0.isRegExp=Kn0;function Gn0($){return typeof $==="object"&&$!==null}qn0.isObject=Gn0;function Hn0($){return gM($)==="[object Date]"}qn0.isDate=Hn0;function Wn0($){return gM($)==="[object Error]"||$ instanceof Error}qn0.isError=Wn0;function Xn0($){return typeof $==="function"}qn0.isFunction=Xn0;function Zn0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}qn0.isPrimitive=Zn0;qn0.isBuffer=J0("buffer").Buffer.isBuffer;function gM($){return Object.prototype.toString.call($)}});var q60=E((nn1,Xg)=>{if(typeof Object.create==="function")Xg.exports=function(Y,z){if(z)Y.super_=z,Y.prototype=Object.create(z.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else Xg.exports=function(Y,z){if(z){Y.super_=z;var U=function(){};U.prototype=z.prototype,Y.prototype=new U,Y.prototype.constructor=Y}}});var X1=E((pn1,Zg)=>{try{if(yM=J0("util"),typeof yM.inherits!=="function")throw"";Zg.exports=yM.inherits}catch($){Zg.exports=q60()}var yM});var L60=E((dn1,qg)=>{function Rn0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var V60=K6().Buffer,iH=J0("util");function _n0($,Y,z){$.copy(Y,z)}qg.exports=function(){function $(){Rn0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,I=""+U.data;while(U=U.next)I+=z+U.data;return I},$.prototype.concat=function(z){if(this.length===0)return V60.alloc(0);var U=V60.allocUnsafe(z>>>0),I=this.head,Q=0;while(I)_n0(I.data,U,Q),Q+=I.data.length,I=I.next;return U},$}();if(iH&&iH.inspect&&iH.inspect.custom)qg.exports.prototype[iH.inspect.custom]=function(){var $=iH.inspect({length:this.length});return this.constructor.name+" "+$}});var Vg=E((mn1,F60)=>{var kM=J6();function vn0($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(U||I){if(Y)Y($);else if($){if(!this._writableState)kM.nextTick(xM,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,kM.nextTick(xM,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(!z._writableState)kM.nextTick(xM,z,Q);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,kM.nextTick(xM,z,Q)}else if(Y)Y(Q)}),this}function hn0(){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 xM($,Y){$.emit("error",Y)}F60.exports={destroy:vn0,undestroy:hn0}});var S7=E((ln1,w60)=>{w60.exports=J0("util").deprecate});var Fg=E((on1,T60)=>{var pY=J6();T60.exports=Z6;function O60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){sn0(Y,$)}}var Sn0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pY.nextTick,sI;Z6.WritableState=nH;var N60=Object.create(M4());N60.inherits=X1();var gn0={deprecate:S7()},D60=J0("stream"),uM=K6().Buffer,yn0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function kn0($){return uM.from($)}function xn0($){return uM.isBuffer($)||$ instanceof yn0}var A60=Vg();N60.inherits(Z6,D60);function fn0(){}function nH($,Y){sI=sI||dY(),$=$||{};var z=Y instanceof sI;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:U,writableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(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){dn0(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 O60(this)}nH.prototype.getBuffer=function(){var Y=this.bufferedRequest,z=[];while(Y)z.push(Y),Y=Y.next;return z};(function(){try{Object.defineProperty(nH.prototype,"buffer",{get:gn0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var fM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")fM=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(fM.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof nH}});else fM=function($){return $ instanceof this};function Z6($){if(sI=sI||dY(),!fM.call(Z6,this)&&!(this instanceof sI))return new Z6($);if(this._writableState=new nH($,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}D60.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function un0($,Y){var z=Error("write after end");$.emit("error",z),pY.nextTick(Y,z)}function bn0($,Y,z,U){var I=!0,Q=!1;if(z===null)Q=TypeError("May not write null values to stream");else if(typeof z!=="string"&&z!==void 0&&!Y.objectMode)Q=TypeError("Invalid non-string/buffer chunk");if(Q)$.emit("error",Q),pY.nextTick(U,Q),I=!1;return I}Z6.prototype.write=function($,Y,z){var U=this._writableState,I=!1,Q=!U.objectMode&&xn0($);if(Q&&!uM.isBuffer($))$=kn0($);if(typeof Y==="function")z=Y,Y=null;if(Q)Y="buffer";else if(!Y)Y=U.defaultEncoding;if(typeof z!=="function")z=fn0;if(U.ended)un0(this,z);else if(Q||bn0(this,U,$,z))U.pendingcb++,I=cn0(this,U,Q,$,Y,z);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)P60(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 in0($,Y,z){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=uM.from(Y,z);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cn0($,Y,z,U,I,Q){if(!z){var J=in0(Y,U,I);if(U!==J)z=!0,I="buffer",U=J}var K=Y.objectMode?1:U.length;Y.length+=K;var G=Y.length{var j60=J6(),an0=Object.keys||function($){var Y=[];for(var z in $)Y.push(z);return Y};R60.exports=z3;var E60=Object.create(M4());E60.inherits=X1();var C60=Mg(),wg=Fg();E60.inherits(z3,C60);{bM=an0(wg.prototype);for(pH=0;pH{var Ng=K6().Buffer,_60=Ng.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 $p0($){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 Yp0($){var Y=$p0($);if(typeof Y!=="string"&&(Ng.isEncoding===_60||!_60($)))throw Error("Unknown encoding: "+$);return Y||$}qp0.StringDecoder=mH;function mH($){this.encoding=Yp0($);var Y;switch(this.encoding){case"utf16le":this.text=Kp0,this.end=Gp0,Y=4;break;case"utf8":this.fillLast=Ip0,Y=4;break;case"base64":this.text=Hp0,this.end=Wp0,Y=3;break;default:this.write=Xp0,this.end=Zp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ng.allocUnsafe(Y)}mH.prototype.write=function($){if($.length===0)return"";var Y,z;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";z=this.lastNeed,this.lastNeed=0}else z=0;if(z<$.length)return Y?Y+this.text($,z):this.text($,z);return Y||""};mH.prototype.end=Jp0;mH.prototype.text=Qp0;mH.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 Og($){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 zp0($,Y,z){var U=Y.length-1;if(U=0){if(I>0)$.lastNeed=I-1;return I}if(--U=0){if(I>0)$.lastNeed=I-2;return I}if(--U=0){if(I>0)if(I===2)I=0;else $.lastNeed=I-3;return I}return 0}function Up0($,Y,z){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 Ip0($){var Y=this.lastTotal-this.lastNeed,z=Up0(this,$,Y);if(z!==void 0)return z;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 Qp0($,Y){var z=zp0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=z;var U=$.length-(z-this.lastNeed);return $.copy(this.lastChar,0,U),$.toString("utf8",Y,U)}function Jp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function Kp0($,Y){if(($.length-Y)%2===0){var z=$.toString("utf16le",Y);if(z){var U=z.charCodeAt(z.length-1);if(U>=55296&&U<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],z.slice(0,-1)}return z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function Gp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var z=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,z)}return Y}function Hp0($,Y){var z=($.length-Y)%3;if(z===0)return $.toString("base64",Y);if(this.lastNeed=3-z,this.lastTotal=3,z===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-z)}function Wp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Xp0($){return $.toString(this.encoding)}function Zp0($){return $&&$.length?this.write($):""}});var Mg=E((tn1,c60)=>{var tI=J6();c60.exports=P4;var Lp0=oI(),lH;P4.ReadableState=x60;var an1=J0("events").EventEmitter,g60=function($,Y){return $.listeners(Y).length},jg=J0("stream"),oH=K6().Buffer,Fp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function wp0($){return oH.from($)}function Mp0($){return oH.isBuffer($)||$ instanceof Fp0}var y60=Object.create(M4());y60.inherits=X1();var Ag=J0("util"),t1=void 0;if(Ag&&Ag.debuglog)t1=Ag.debuglog("stream");else t1=function(){};var Op0=L60(),k60=Vg(),aI;y60.inherits(P4,jg);var Pg=["error","close","destroy","pause","resume"];function Np0($,Y,z){if(typeof $.prependListener==="function")return $.prependListener(Y,z);if(!$._events||!$._events[Y])$.on(Y,z);else if(Lp0($._events[Y]))$._events[Y].unshift(z);else $._events[Y]=[z,$._events[Y]]}function x60($,Y){lH=lH||dY(),$=$||{};var z=Y instanceof lH;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:U,readableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(I||I===0))this.highWaterMark=I;else this.highWaterMark=Q;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Op0,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(!aI)aI=Dg().StringDecoder;this.decoder=new aI($.encoding),this.encoding=$.encoding}}function P4($){if(lH=lH||dY(),!(this instanceof P4))return new P4($);if(this._readableState=new x60($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}jg.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=k60.destroy;P4.prototype._undestroy=k60.undestroy;P4.prototype._destroy=function($,Y){this.push(null),Y($)};P4.prototype.push=function($,Y){var z=this._readableState,U;if(!z.objectMode){if(typeof $==="string"){if(Y=Y||z.defaultEncoding,Y!==z.encoding)$=oH.from($,Y),Y="";U=!0}}else U=!0;return f60(this,$,Y,!1,U)};P4.prototype.unshift=function($){return f60(this,$,null,!0,!1)};function f60($,Y,z,U,I){var Q=$._readableState;if(Y===null)Q.reading=!1,Bp0($,Q);else{var J;if(!I)J=Dp0(Q,Y);if(J)$.emit("error",J);else if(Q.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!Q.objectMode&&Object.getPrototypeOf(Y)!==oH.prototype)Y=wp0(Y);if(U)if(Q.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else Bg($,Q,Y,!0);else if(Q.ended)$.emit("error",Error("stream.push() after EOF"));else if(Q.reading=!1,Q.decoder&&!z)if(Y=Q.decoder.write(Y),Q.objectMode||Y.length!==0)Bg($,Q,Y,!1);else u60($,Q);else Bg($,Q,Y,!1)}else if(!U)Q.reading=!1}return Ap0(Q)}function Bg($,Y,z,U){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",z),$.read(0);else{if(Y.length+=Y.objectMode?1:z.length,U)Y.buffer.unshift(z);else Y.buffer.push(z);if(Y.needReadable)iM($)}u60($,Y)}function Dp0($,Y){var z;if(!Mp0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)z=TypeError("Invalid non-string/buffer chunk");return z}function Ap0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!aI)aI=Dg().StringDecoder;return this._readableState.decoder=new aI($),this._readableState.encoding=$,this};var v60=8388608;function Pp0($){if($>=v60)$=v60;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function h60($,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=Pp0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}P4.prototype.read=function($){t1("read",$),$=parseInt($,10);var Y=this._readableState,z=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&(Y.length>=Y.highWaterMark||Y.ended)){if(t1("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)Tg(this);else iM(this);return null}if($=h60($,Y),$===0&&Y.ended){if(Y.length===0)Tg(this);return null}var U=Y.needReadable;if(t1("need readable",U),Y.length===0||Y.length-$0)I=b60($,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(z!==$&&Y.ended)Tg(this)}if(I!==null)this.emit("data",I);return I};function Bp0($,Y){if(Y.ended)return;if(Y.decoder){var z=Y.decoder.end();if(z&&z.length)Y.buffer.push(z),Y.length+=Y.objectMode?1:z.length}Y.ended=!0,iM($)}function iM($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if(t1("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)tI.nextTick(S60,$);else S60($)}function S60($){t1("emit readable"),$.emit("readable"),Eg($)}function u60($,Y){if(!Y.readingMore)Y.readingMore=!0,tI.nextTick(Tp0,$,Y)}function Tp0($,Y){var z=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&i60(U.pipes,$)!==-1)&&!H)t1("false write response, pause",U.awaitDrain),U.awaitDrain++,X=!0;z.pause()}}function q(w){if(t1("onerror",w),M(),$.removeListener("error",q),g60($,"error")===0)$.emit("error",w)}Np0($,"error",q);function V(){$.removeListener("finish",F),M()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),M()}$.once("finish",F);function M(){t1("unpipe"),z.unpipe($)}if($.emit("pipe",z),!U.flowing)t1("pipe resume"),z.resume();return $};function jp0($){return function(){var Y=$._readableState;if(t1("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&g60($,"data"))Y.flowing=!0,Eg($)}}P4.prototype.unpipe=function($){var Y=this._readableState,z={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,z);return this}if(!$){var{pipes:U,pipesCount:I}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Q=0;Q=Y.length){if(Y.decoder)z=Y.buffer.join("");else if(Y.buffer.length===1)z=Y.buffer.head.data;else z=Y.buffer.concat(Y.length);Y.buffer.clear()}else z=_p0($,Y.buffer,Y.decoder);return z}function _p0($,Y,z){var U;if($Q.length?Q.length:$;if(J===Q.length)I+=Q;else I+=Q.slice(0,$);if($-=J,$===0){if(J===Q.length)if(++U,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=Q.slice(J);break}++U}return Y.length-=U,I}function hp0($,Y){var z=oH.allocUnsafe($),U=Y.head,I=1;U.data.copy(z),$-=U.data.length;while(U=U.next){var Q=U.data,J=$>Q.length?Q.length:$;if(Q.copy(z,z.length-$,0,J),$-=J,$===0){if(J===Q.length)if(++I,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=Q.slice(J);break}++I}return Y.length-=I,z}function Tg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,tI.nextTick(Sp0,Y,$)}function Sp0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function i60($,Y){for(var z=0,U=$.length;z{d60.exports=U3;var cM=dY(),p60=Object.create(M4());p60.inherits=X1();p60.inherits(U3,cM);function gp0($,Y){var z=this._transformState;z.transforming=!1;var U=z.writecb;if(!U)return this.emit("error",Error("write callback called multiple times"));if(z.writechunk=null,z.writecb=null,Y!=null)this.push(Y);U($);var I=this._readableState;if(I.reading=!1,I.needReadable||I.length{o60.exports=rH;var m60=Cg(),l60=Object.create(M4());l60.inherits=X1();l60.inherits(rH,m60);function rH($){if(!(this instanceof rH))return new rH($);m60.call(this,$)}rH.prototype._transform=function($,Y,z){z(null,$)}});var Rg=E((d6,nM)=>{var r5=J0("stream");if(process.env.READABLE_STREAM==="disable"&&r5)nM.exports=r5,d6=nM.exports=r5.Readable,d6.Readable=r5.Readable,d6.Writable=r5.Writable,d6.Duplex=r5.Duplex,d6.Transform=r5.Transform,d6.PassThrough=r5.PassThrough,d6.Stream=r5;else d6=nM.exports=Mg(),d6.Stream=r5||d6,d6.Readable=d6,d6.Writable=Fg(),d6.Duplex=dY(),d6.Transform=Cg(),d6.PassThrough=r60()});var I3=E((xp0)=>{xp0.base64=!0;xp0.array=!0;xp0.string=!0;xp0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";xp0.nodebuffer=typeof Buffer<"u";xp0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")xp0.blob=!1;else{pM=new ArrayBuffer(0);try{xp0.blob=new Blob([pM],{type:"application/zip"}).size===0}catch($){try{vg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,dM=new vg,dM.append(pM),xp0.blob=dM.getBlob("application/zip").size===0}catch(Y){xp0.blob=!1}}}var pM,vg,dM;try{xp0.nodestream=!!Rg().Readable}catch($){xp0.nodestream=!1}});var hg=E((mp0)=>{var pp0=c4(),dp0=I3(),s5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";mp0.encode=function($){var Y=[],z,U,I,Q,J,K,G,H=0,W=$.length,X=W,Z=pp0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)z=$.charCodeAt(H++),U=H>2,J=(z&3)<<4|U>>4,K=X>1?(U&15)<<2|I>>6:64,G=X>2?I&63:64,Y.push(s5.charAt(Q)+s5.charAt(J)+s5.charAt(K)+s5.charAt(G))}return Y.join("")};mp0.decode=function($){var Y,z,U,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)===s5.charAt(64))X--;if($.charAt($.length-2)===s5.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(dp0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(I=s5.indexOf($.charAt(G++)),Q=s5.indexOf($.charAt(G++)),J=s5.indexOf($.charAt(G++)),K=s5.indexOf($.charAt(G++)),Y=I<<2|Q>>4,z=(Q&15)<<4|J>>2,U=(J&3)<<6|K,Z[H++]=Y,J!==64)Z[H++]=z;if(K!==64)Z[H++]=U}return Z}});var sH=E((Up1,s60)=>{s60.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 e60=E((Qp1,t60)=>{var Ip1=global.MutationObserver||global.WebKitMutationObserver,a60;a60=function(){process.nextTick(ep0)};var rp0,sp0,ap0,tp0,Sg,aH=[];function ep0(){Sg=!0;var $,Y,z=aH.length;while(z){Y=aH,aH=[],$=-1;while(++${var $80=e60();function $Q(){}var X8={},Y80=["REJECTED"],gg=["FULFILLED"],z80=["PENDING"];eI=["UNHANDLED"];var eI;Q80.exports=g7;function g7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=z80,this.queue=[],this.outcome=void 0,this.handled=eI,$!==$Q)U80(this,$)}g7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(z,U);function z(I){function Q(){return I}return Y.resolve($()).then(Q)}function U(I){function Q(){throw I}return Y.resolve($()).then(Q)}};g7.prototype.catch=function($){return this.then(null,$)};g7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===gg||typeof Y!=="function"&&this.state===Y80)return this;var z=new this.constructor($Q);if(this.handled===eI)this.handled=null;if(this.state!==z80){var U=this.state===gg?$:Y;yg(z,U,this.outcome)}else this.queue.push(new tH(z,$,Y));return z};function tH($,Y,z){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof z==="function")this.onRejected=z,this.callRejected=this.otherCallRejected}tH.prototype.callFulfilled=function($){X8.resolve(this.promise,$)};tH.prototype.otherCallFulfilled=function($){yg(this.promise,this.onFulfilled,$)};tH.prototype.callRejected=function($){X8.reject(this.promise,$)};tH.prototype.otherCallRejected=function($){yg(this.promise,this.onRejected,$)};function yg($,Y,z){$80(function(){var U;try{U=Y(z)}catch(I){return X8.reject($,I)}if(U===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,U)})}X8.resolve=function($,Y){var z=I80(Yd0,Y);if(z.status==="error")return X8.reject($,z.value);var U=z.value;if(U)U80($,U);else{$.state=gg,$.outcome=Y;var I=-1,Q=$.queue.length;while(++I{var kg=null;if(typeof Promise<"u")kg=Promise;else kg=J80();K80.exports={Promise:kg}});var xg=E((G80)=>{(function($,Y){if($.setImmediate)return;var z=1,U={},I=!1,Q=$.document,J;function K(O){if(typeof O!=="function")O=Function(""+O);var D=Array(arguments.length-1);for(var N=0;N"u"?typeof global>"u"?G80:global:self)});var c4=E((Gd0)=>{var y7=I3(),Jd0=hg(),zQ=sH(),fg=YQ();xg();function Kd0($){var Y=null;if(y7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return lM($,Y)}Gd0.newBlob=function($,Y){Gd0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(I){try{var z=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,U=new z;return U.append($),U.getBlob(Y)}catch(Q){throw Error("Bug : can't construct the Blob.")}}};function eH($){return $}function lM($,Y){for(var z=0;z<$.length;++z)Y[z]=$.charCodeAt(z)&255;return Y}var mM={stringifyByChunk:function($,Y,z){var U=[],I=0,Q=$.length;if(Q<=z)return String.fromCharCode.apply(null,$);while(I1)try{return mM.stringifyByChunk($,z,Y)}catch(I){Y=Math.floor(Y/2)}return mM.stringifyByChar($)}Gd0.applyFromCharCode=$W;function oM($,Y){for(var z=0;z<$.length;z++)Y[z]=$[z];return Y}var k7={};k7.string={string:eH,array:function($){return lM($,Array($.length))},arraybuffer:function($){return k7.string.uint8array($).buffer},uint8array:function($){return lM($,new Uint8Array($.length))},nodebuffer:function($){return lM($,zQ.allocBuffer($.length))}};k7.array={string:$W,array:eH,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return zQ.newBufferFrom($)}};k7.arraybuffer={string:function($){return $W(new Uint8Array($))},array:function($){return oM(new Uint8Array($),Array($.byteLength))},arraybuffer:eH,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return zQ.newBufferFrom(new Uint8Array($))}};k7.uint8array={string:$W,array:function($){return oM($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:eH,nodebuffer:function($){return zQ.newBufferFrom($)}};k7.nodebuffer={string:$W,array:function($){return oM($,Array($.length))},arraybuffer:function($){return k7.nodebuffer.uint8array($).buffer},uint8array:function($){return oM($,new Uint8Array($.length))},nodebuffer:eH};Gd0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;Gd0.checkSupport($);var z=Gd0.getTypeOf(Y),U=k7[z][$](Y);return U};Gd0.resolve=function($){var Y=$.split("/"),z=[];for(var U=0;U"u")$[z]=arguments[Y][z];return $};Gd0.prepareContent=function($,Y,z,U,I){var Q=fg.Promise.resolve(Y).then(function(J){var K=y7.blob&&(J instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(J))!==-1);if(K&&typeof FileReader<"u")return new fg.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=Gd0.getTypeOf(J);if(!K)return fg.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")J=Gd0.transformTo("uint8array",J);else if(K==="string"){if(I)J=Jd0.decode(J);else if(z){if(U!==!0)J=Kd0(J)}}return J})}});var J$=E((Wp1,Z80)=>{function X80($){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}X80.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 z=0;z "+$;else return $}};Z80.exports=X80});var IQ=E((Pd0)=>{var UQ=c4(),mY=I3(),Od0=sH(),rM=J$(),YW=Array(256);for(a5=0;a5<256;a5++)YW[a5]=a5>=252?6:a5>=248?5:a5>=240?4:a5>=224?3:a5>=192?2:1;var a5;YW[254]=YW[254]=1;var Nd0=function($){var Y,z,U,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|z&63;else if(z<65536)Y[Q++]=224|z>>>12,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63;else Y[Q++]=240|z>>>18,Y[Q++]=128|z>>>12&63,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63}return Y},Dd0=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+YW[$[z]]>Y?z:Y},Ad0=function($){var Y,z,U,I,Q=$.length,J=Array(Q*2);for(z=0,Y=0;Y4){J[z++]=65533,Y+=I-1;continue}U&=I===2?31:I===3?15:7;while(I>1&&Y1){J[z++]=65533;continue}if(U<65536)J[z++]=U;else U-=65536,J[z++]=55296|U>>10&1023,J[z++]=56320|U&1023}if(J.length!==z)if(J.subarray)J=J.subarray(0,z);else J.length=z;return UQ.applyFromCharCode(J)};Pd0.utf8encode=function(Y){if(mY.nodebuffer)return Od0.newBufferFrom(Y,"utf-8");return Nd0(Y)};Pd0.utf8decode=function(Y){if(mY.nodebuffer)return UQ.transformTo("nodebuffer",Y).toString("utf-8");return Y=UQ.transformTo(mY.uint8array?"uint8array":"array",Y),Ad0(Y)};function sM(){rM.call(this,"utf-8 decode"),this.leftOver=null}UQ.inherits(sM,rM);sM.prototype.processChunk=function($){var Y=UQ.transformTo(mY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(mY.uint8array){var z=Y;Y=new Uint8Array(z.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(z,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var U=Dd0(Y),I=Y;if(U!==Y.length)if(mY.uint8array)I=Y.subarray(0,U),this.leftOver=Y.subarray(U,Y.length);else I=Y.slice(0,U),this.leftOver=Y.slice(U,Y.length);this.push({data:Pd0.utf8decode(I),meta:$.meta})};sM.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Pd0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Pd0.Utf8DecodeWorker=sM;function bg(){rM.call(this,"utf-8 encode")}UQ.inherits(bg,rM);bg.prototype.processChunk=function($){this.push({data:Pd0.utf8encode($.data),meta:$.meta})};Pd0.Utf8EncodeWorker=bg});var w80=E((Zp1,F80)=>{var V80=J$(),L80=c4();function cg($){V80.call(this,"ConvertWorker to "+$),this.destType=$}L80.inherits(cg,V80);cg.prototype.processChunk=function($){this.push({data:L80.transformTo(this.destType,$.data),meta:$.meta})};F80.exports=cg});var N80=E((qp1,O80)=>{var M80=Rg().Readable,jd0=c4();jd0.inherits(ng,M80);function ng($,Y,z){M80.call(this,Y),this._helper=$;var U=this;$.on("data",function(I,Q){if(!U.push(I))U._helper.pause();if(z)z(Q)}).on("error",function(I){U.emit("error",I)}).on("end",function(){U.push(null)})}ng.prototype._read=function(){this._helper.resume()};O80.exports=ng});var pg=E((Vp1,P80)=>{var lY=c4(),Ed0=w80(),Cd0=J$(),Rd0=hg(),_d0=I3(),vd0=YQ(),D80=null;if(_d0.nodestream)try{D80=N80()}catch($){}function hd0($,Y,z){switch($){case"blob":return lY.newBlob(lY.transformTo("arraybuffer",Y),z);case"base64":return Rd0.encode(Y);default:return lY.transformTo($,Y)}}function Sd0($,Y){var z,U=0,I=null,Q=0;for(z=0;z{yd0.base64=!1;yd0.binary=!1;yd0.dir=!1;yd0.createFolders=!0;yd0.date=null;yd0.compression=null;yd0.compressionOptions=null;yd0.comment=null;yd0.unixPermissions=null;yd0.dosPermissions=null});var mg=E((Fp1,B80)=>{var aM=c4(),tM=J$(),md0=16384;function QQ($){tM.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(z){if(Y.dataIsReady=!0,Y.data=z,Y.max=z&&z.length||0,Y.type=aM.getTypeOf(z),!Y.isPaused)Y._tickAndRepeat()},function(z){Y.error(z)})}aM.inherits(QQ,tM);QQ.prototype.cleanUp=function(){tM.prototype.cleanUp.call(this),this.data=null};QQ.prototype.resume=function(){if(!tM.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,aM.delay(this._tickAndRepeat,[],this);return!0};QQ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)aM.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};QQ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=md0,Y=null,z=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,z);break;case"uint8array":Y=this.data.subarray(this.index,z);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,z);break}return this.index=z,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};B80.exports=QQ});var eM=E((wp1,j80)=>{var ld0=c4();function od0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var T80=od0();function rd0($,Y,z,U){var I=T80,Q=U+z;$=$^-1;for(var J=U;J>>8^I[($^Y[J])&255];return $^-1}function sd0($,Y,z,U){var I=T80,Q=U+z;$=$^-1;for(var J=U;J>>8^I[($^Y.charCodeAt(J))&255];return $^-1}j80.exports=function(Y,z){if(typeof Y>"u"||!Y.length)return 0;var U=ld0.getTypeOf(Y)!=="string";if(U)return rd0(z|0,Y,Y.length,0);else return sd0(z|0,Y,Y.length,0)}});var og=E((Mp1,C80)=>{var E80=J$(),ad0=eM(),td0=c4();function lg(){E80.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}td0.inherits(lg,E80);lg.prototype.processChunk=function($){this.streamInfo.crc32=ad0($.data,this.streamInfo.crc32||0),this.push($)};C80.exports=lg});var _80=E((Op1,R80)=>{var ed0=c4(),rg=J$();function sg($){rg.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}ed0.inherits(sg,rg);sg.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}rg.prototype.processChunk.call(this,$)};R80.exports=sg});var $O=E((Np1,S80)=>{var v80=YQ(),h80=mg(),$m0=og(),ag=_80();function tg($,Y,z,U,I){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=z,this.compression=U,this.compressedContent=I}tg.prototype={getContentWorker:function(){var $=new h80(v80.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new ag("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 h80(v80.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};tg.createWorkerFrom=function($,Y,z){return $.pipe(new $m0).pipe(new ag("uncompressedSize")).pipe(Y.compressWorker(z)).pipe(new ag("compressedSize")).withStreamInfo("compression",Y)};S80.exports=tg});var x80=E((Dp1,k80)=>{var Ym0=pg(),zm0=mg(),eg=IQ(),$y=$O(),g80=J$(),Yy=function($,Y,z){this.name=$,this.dir=z.dir,this.date=z.date,this.comment=z.comment,this.unixPermissions=z.unixPermissions,this.dosPermissions=z.dosPermissions,this._data=Y,this._dataBinary=z.binary,this.options={compression:z.compression,compressionOptions:z.compressionOptions}};Yy.prototype={internalStream:function($){var Y=null,z="string";try{if(!$)throw Error("No output type specified.");z=$.toLowerCase();var U=z==="string"||z==="text";if(z==="binarystring"||z==="text")z="string";Y=this._decompressWorker();var I=!this._dataBinary;if(I&&!U)Y=Y.pipe(new eg.Utf8EncodeWorker);if(!I&&U)Y=Y.pipe(new eg.Utf8DecodeWorker)}catch(Q){Y=new g80("error"),Y.error(Q)}return new Ym0(Y,z,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof $y&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var z=this._decompressWorker();if(!this._dataBinary)z=z.pipe(new eg.Utf8EncodeWorker);return $y.createWorkerFrom(z,$,Y)}},_decompressWorker:function(){if(this._data instanceof $y)return this._data.getContentWorker();else if(this._data instanceof g80)return this._data;else return new zm0(this._data)}};var y80=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Um0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(zW=0;zW{var Km0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Gm0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}zy.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var z=Y.shift();if(!z)continue;if(typeof z!=="object")throw TypeError(z+"must be non-object");for(var U in z)if(Gm0(z,U))$[U]=z[U]}return $};zy.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var Hm0={arraySet:function($,Y,z,U,I){if(Y.subarray&&$.subarray){$.set(Y.subarray(z,z+U),I);return}for(var Q=0;Q{var Zm0=Q3(),qm0=4,u80=0,b80=1,Vm0=2;function KQ($){var Y=$.length;while(--Y>=0)$[Y]=0}var Lm0=0,m80=1,Fm0=2,wm0=3,Mm0=258,Wy=29,GW=256,IW=GW+1+Wy,JQ=30,Xy=19,l80=2*IW+1,oY=15,Iy=16,Om0=7,Zy=256,o80=16,r80=17,s80=18,Gy=[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],YO=[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],Nm0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],a80=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Dm0=512,J3=Array((IW+2)*2);KQ(J3);var UW=Array(JQ*2);KQ(UW);var QW=Array(Dm0);KQ(QW);var JW=Array(Mm0-wm0+1);KQ(JW);var qy=Array(Wy);KQ(qy);var zO=Array(JQ);KQ(zO);function Qy($,Y,z,U,I){this.static_tree=$,this.extra_bits=Y,this.extra_base=z,this.elems=U,this.max_length=I,this.has_stree=$&&$.length}var t80,e80,$$0;function Jy($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function Y$0($){return $<256?QW[$]:QW[256+($>>>7)]}function KW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function n8($,Y,z){if($.bi_valid>Iy-z)$.bi_buf|=Y<<$.bi_valid&65535,KW($,$.bi_buf),$.bi_buf=Y>>Iy-$.bi_valid,$.bi_valid+=z-Iy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=z}function t5($,Y,z){n8($,z[Y*2],z[Y*2+1])}function z$0($,Y){var z=0;do z|=$&1,$>>>=1,z<<=1;while(--Y>0);return z>>>1}function Am0($){if($.bi_valid===16)KW($,$.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 Pm0($,Y){var{dyn_tree:z,max_code:U}=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,F=0;for(Z=0;Z<=oY;Z++)$.bl_count[Z]=0;z[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(z[W*2+1]=Z,W>U)continue;if($.bl_count[Z]++,q=0,W>=K)q=J[W-K];if(V=z[W*2],$.opt_len+=V*(Z+q),Q)$.static_len+=V*(I[W*2+1]+q)}if(F===0)return;do{Z=G-1;while($.bl_count[Z]===0)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[G]--,F-=2}while(F>0);for(Z=G;Z!==0;Z--){W=$.bl_count[Z];while(W!==0){if(X=$.heap[--H],X>U)continue;if(z[X*2+1]!==Z)$.opt_len+=(Z-z[X*2+1])*z[X*2],z[X*2+1]=Z;W--}}}function U$0($,Y,z){var U=Array(oY+1),I=0,Q,J;for(Q=1;Q<=oY;Q++)U[Q]=I=I+z[Q-1]<<1;for(J=0;J<=Y;J++){var K=$[J*2+1];if(K===0)continue;$[J*2]=z$0(U[K]++,K)}}function Bm0(){var $,Y,z,U,I,Q=Array(oY+1);z=0;for(U=0;U>=7;for(;U8)KW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function Tm0($,Y,z,U){if(Q$0($),U)KW($,z),KW($,~z);Zm0.arraySet($.pending_buf,$.window,Y,z,$.pending),$.pending+=z}function i80($,Y,z,U){var I=Y*2,Q=z*2;return $[I]<$[Q]||$[I]===$[Q]&&U[Y]<=U[z]}function Ky($,Y,z){var U=$.heap[z],I=z<<1;while(I<=$.heap_len){if(I<$.heap_len&&i80(Y,$.heap[I+1],$.heap[I],$.depth))I++;if(i80(Y,U,$.heap[I],$.depth))break;$.heap[z]=$.heap[I],z=I,I<<=1}$.heap[z]=U}function c80($,Y,z){var U,I,Q=0,J,K;if($.last_lit!==0)do if(U=$.pending_buf[$.d_buf+Q*2]<<8|$.pending_buf[$.d_buf+Q*2+1],I=$.pending_buf[$.l_buf+Q],Q++,U===0)t5($,I,Y);else{if(J=JW[I],t5($,J+GW+1,Y),K=Gy[J],K!==0)I-=qy[J],n8($,I,K);if(U--,J=Y$0(U),t5($,J,z),K=YO[J],K!==0)U-=zO[J],n8($,U,K)}while(Q<$.last_lit);t5($,Zy,Y)}function Hy($,Y){var z=Y.dyn_tree,U=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=l80;for(J=0;J>1;J>=1;J--)Ky($,z,J);H=Q;do J=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Ky($,z,1),K=$.heap[1],$.heap[--$.heap_max]=J,$.heap[--$.heap_max]=K,z[H*2]=z[J*2]+z[K*2],$.depth[H]=($.depth[J]>=$.depth[K]?$.depth[J]:$.depth[K])+1,z[J*2+1]=z[K*2+1]=H,$.heap[1]=H++,Ky($,z,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Pm0($,Y),U$0(z,G,$.bl_count)}function n80($,Y,z){var U,I=-1,Q,J=Y[1],K=0,G=7,H=4;if(J===0)G=138,H=3;Y[(z+1)*2+1]=65535;for(U=0;U<=z;U++){if(Q=J,J=Y[(U+1)*2+1],++K=3;Y--)if($.bl_tree[a80[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function Em0($,Y,z,U){var I;n8($,Y-257,5),n8($,z-1,5),n8($,U-4,4);for(I=0;I>>=1)if(Y&1&&$.dyn_ltree[z*2]!==0)return u80;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return b80;for(z=32;z0){if($.strm.data_type===Vm0)$.strm.data_type=Cm0($);if(Hy($,$.l_desc),Hy($,$.d_desc),J=jm0($),I=$.opt_len+3+7>>>3,Q=$.static_len+3+7>>>3,Q<=I)I=Q}else I=Q=z+5;if(z+4<=I&&Y!==-1)J$0($,Y,z,U);else if($.strategy===qm0||Q===I)n8($,(m80<<1)+(U?1:0),3),c80($,J3,UW);else n8($,(Fm0<<1)+(U?1:0),3),Em0($,$.l_desc.max_code+1,$.d_desc.max_code+1,J+1),c80($,$.dyn_ltree,$.dyn_dtree);if(I$0($),U)Q$0($)}function hm0($,Y,z){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]=z&255,$.last_lit++,Y===0)$.dyn_ltree[z*2]++;else $.matches++,Y--,$.dyn_ltree[(JW[z]+GW+1)*2]++,$.dyn_dtree[Y$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}Sm0._tr_init=Rm0;Sm0._tr_stored_block=J$0;Sm0._tr_flush_block=vm0;Sm0._tr_tally=hm0;Sm0._tr_align=_m0});var Vy=E((Bp1,G$0)=>{function um0($,Y,z,U){var I=$&65535|0,Q=$>>>16&65535|0,J=0;while(z!==0){J=z>2000?2000:z,z-=J;do I=I+Y[U++]|0,Q=Q+I|0;while(--J);I%=65521,Q%=65521}return I|Q<<16|0}G$0.exports=um0});var Ly=E((Tp1,H$0)=>{function bm0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var im0=bm0();function cm0($,Y,z,U){var I=im0,Q=U+z;$^=-1;for(var J=U;J>>8^I[($^Y[J])&255];return $^-1}H$0.exports=cm0});var UO=E((jp1,W$0)=>{W$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 O$0=E((Dl0)=>{var j8=Q3(),j$=K$0(),V$0=Vy(),x7=Ly(),nm0=UO(),tY=0,pm0=1,dm0=3,c7=4,X$0=5,$9=0,Z$0=1,E$=-2,mm0=-3,Fy=-5,lm0=-1,om0=1,IO=2,rm0=3,sm0=4,am0=0,tm0=2,GO=8,em0=9,$l0=15,Yl0=8,zl0=29,Ul0=256,My=Ul0+1+zl0,Il0=30,Ql0=19,Jl0=2*My+1,Kl0=15,f1=3,b7=258,W5=b7+f1+1,Gl0=32,HO=42,Oy=69,QO=73,JO=91,KO=103,rY=113,WW=666,P6=1,XW=2,sY=3,WQ=4,Hl0=3;function i7($,Y){return $.msg=nm0[Y],Y}function q$0($){return($<<1)-($>4?9:0)}function u7($){var Y=$.length;while(--Y>=0)$[Y]=0}function f7($){var Y=$.state,z=Y.pending;if(z>$.avail_out)z=$.avail_out;if(z===0)return;if(j8.arraySet($.output,Y.pending_buf,Y.pending_out,z,$.next_out),$.next_out+=z,Y.pending_out+=z,$.total_out+=z,$.avail_out-=z,Y.pending-=z,Y.pending===0)Y.pending_out=0}function m6($,Y){j$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,f7($.strm)}function r1($,Y){$.pending_buf[$.pending++]=Y}function HW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function Wl0($,Y,z,U){var I=$.avail_in;if(I>U)I=U;if(I===0)return 0;if($.avail_in-=I,j8.arraySet(Y,$.input,$.next_in,I,z),$.state.wrap===1)$.adler=V$0($.adler,Y,I,z);else if($.state.wrap===2)$.adler=x7($.adler,Y,I,z);return $.next_in+=I,$.total_in+=I,I}function L$0($,Y){var{max_chain_length:z,strstart:U}=$,I,Q,J=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-W5?$.strstart-($.w_size-W5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+b7,q=H[U+J-1],V=H[U+J];if($.prev_length>=$.good_match)z>>=2;if(K>$.lookahead)K=$.lookahead;do{if(I=Y,H[I+J]!==V||H[I+J-1]!==q||H[I]!==H[U]||H[++I]!==H[U+1])continue;U+=2,I++;do;while(H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&UJ){if($.match_start=Y,J=Q,Q>=K)break;q=H[U+J-1],V=H[U+J]}}while((Y=X[Y&W])>G&&--z!==0);if(J<=$.lookahead)return J;return $.lookahead}function aY($){var Y=$.w_size,z,U,I,Q,J;do{if(Q=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-W5)){j8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,U=$.hash_size,z=U;do I=$.head[--z],$.head[z]=I>=Y?I-Y:0;while(--U);U=Y,z=U;do I=$.prev[--z],$.prev[z]=I>=Y?I-Y:0;while(--U);Q+=Y}if($.strm.avail_in===0)break;if(U=Wl0($.strm,$.window,$.strstart+$.lookahead,Q),$.lookahead+=U,$.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)z=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(aY($),$.lookahead===0&&Y===tY)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var U=$.block_start+z;if($.strstart===0||$.strstart>=U){if($.lookahead=$.strstart-U,$.strstart=U,m6($,!1),$.strm.avail_out===0)return P6}if($.strstart-$.block_start>=$.w_size-W5){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===c7){if(m6($,!0),$.strm.avail_out===0)return sY;return WQ}if($.strstart>$.block_start){if(m6($,!1),$.strm.avail_out===0)return P6}return P6}function wy($,Y){var z,U;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(z!==0&&$.strstart-z<=$.w_size-W5)$.match_length=L$0($,z);if($.match_length>=f1)if(U=j$._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,z=$.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 U=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,z!==0&&$.prev_length<$.max_lazy_match&&$.strstart-z<=$.w_size-W5){if($.match_length=L$0($,z),$.match_length<=5&&($.strategy===om0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){I=$.strstart+$.lookahead-f1,U=j$._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,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,U){if(m6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(U=j$._tr_tally($,0,$.window[$.strstart-1]),U)m6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)U=j$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(I=$.strstart-1,U=J[I],U===J[++I]&&U===J[++I]&&U===J[++I]){Q=$.strstart+b7;do;while(U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&I$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)z=j$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===c7){if(m6($,!0),$.strm.avail_out===0)return sY;return WQ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function ql0($,Y){var z;for(;;){if($.lookahead===0){if(aY($),$.lookahead===0){if(Y===tY)return P6;break}}if($.match_length=0,z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,z){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===c7){if(m6($,!0),$.strm.avail_out===0)return sY;return WQ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function e5($,Y,z,U,I){this.good_length=$,this.max_lazy=Y,this.nice_length=z,this.max_chain=U,this.func=I}var HQ;HQ=[new e5(0,0,0,0,Xl0),new e5(4,4,8,4,wy),new e5(4,5,16,8,wy),new e5(4,6,32,32,wy),new e5(4,4,16,16,GQ),new e5(8,16,32,32,GQ),new e5(8,16,128,128,GQ),new e5(8,32,128,256,GQ),new e5(32,128,258,1024,GQ),new e5(32,258,258,4096,GQ)];function Vl0($){$.window_size=2*$.w_size,u7($.head),$.max_lazy_match=HQ[$.level].max_lazy,$.good_match=HQ[$.level].good_length,$.nice_match=HQ[$.level].nice_length,$.max_chain_length=HQ[$.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 Ll0(){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=GO,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 j8.Buf16(Jl0*2),this.dyn_dtree=new j8.Buf16((2*Il0+1)*2),this.bl_tree=new j8.Buf16((2*Ql0+1)*2),u7(this.dyn_ltree),u7(this.dyn_dtree),u7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new j8.Buf16(Kl0+1),this.heap=new j8.Buf16(2*My+1),u7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new j8.Buf16(2*My+1),u7(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 F$0($){var Y;if(!$||!$.state)return i7($,E$);if($.total_in=$.total_out=0,$.data_type=tm0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?HO:rY,$.adler=Y.wrap===2?0:1,Y.last_flush=tY,j$._tr_init(Y),$9}function w$0($){var Y=F$0($);if(Y===$9)Vl0($.state);return Y}function Fl0($,Y){if(!$||!$.state)return E$;if($.state.wrap!==2)return E$;return $.state.gzhead=Y,$9}function M$0($,Y,z,U,I,Q){if(!$)return E$;var J=1;if(Y===lm0)Y=6;if(U<0)J=0,U=-U;else if(U>15)J=2,U-=16;if(I<1||I>em0||z!==GO||U<8||U>15||Y<0||Y>9||Q<0||Q>sm0)return i7($,E$);if(U===8)U=9;var K=new Ll0;return $.state=K,K.strm=$,K.wrap=J,K.gzhead=null,K.w_bits=U,K.w_size=1<X$0||Y<0)return $?i7($,E$):E$;if(U=$.state,!$.output||!$.input&&$.avail_in!==0||U.status===WW&&Y!==c7)return i7($,$.avail_out===0?Fy:E$);if(U.strm=$,z=U.last_flush,U.last_flush=Y,U.status===HO)if(U.wrap===2)if($.adler=0,r1(U,31),r1(U,139),r1(U,8),!U.gzhead)r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,U.level===9?2:U.strategy>=IO||U.level<2?4:0),r1(U,Hl0),U.status=rY;else{if(r1(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(!U.gzhead.extra?0:4)+(!U.gzhead.name?0:8)+(!U.gzhead.comment?0:16)),r1(U,U.gzhead.time&255),r1(U,U.gzhead.time>>8&255),r1(U,U.gzhead.time>>16&255),r1(U,U.gzhead.time>>24&255),r1(U,U.level===9?2:U.strategy>=IO||U.level<2?4:0),r1(U,U.gzhead.os&255),U.gzhead.extra&&U.gzhead.extra.length)r1(U,U.gzhead.extra.length&255),r1(U,U.gzhead.extra.length>>8&255);if(U.gzhead.hcrc)$.adler=x7($.adler,U.pending_buf,U.pending,0);U.gzindex=0,U.status=Oy}else{var J=GO+(U.w_bits-8<<4)<<8,K=-1;if(U.strategy>=IO||U.level<2)K=0;else if(U.level<6)K=1;else if(U.level===6)K=2;else K=3;if(J|=K<<6,U.strstart!==0)J|=Gl0;if(J+=31-J%31,U.status=rY,HW(U,J),U.strstart!==0)HW(U,$.adler>>>16),HW(U,$.adler&65535);$.adler=1}if(U.status===Oy)if(U.gzhead.extra){I=U.pending;while(U.gzindex<(U.gzhead.extra.length&65535)){if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(f7($),I=U.pending,U.pending===U.pending_buf_size)break}r1(U,U.gzhead.extra[U.gzindex]&255),U.gzindex++}if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(U.gzindex===U.gzhead.extra.length)U.gzindex=0,U.status=QO}else U.status=QO;if(U.status===QO)if(U.gzhead.name){I=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(f7($),I=U.pending,U.pending===U.pending_buf_size){Q=1;break}}if(U.gzindexI)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(Q===0)U.gzindex=0,U.status=JO}else U.status=JO;if(U.status===JO)if(U.gzhead.comment){I=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(f7($),I=U.pending,U.pending===U.pending_buf_size){Q=1;break}}if(U.gzindexI)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(Q===0)U.status=KO}else U.status=KO;if(U.status===KO)if(U.gzhead.hcrc){if(U.pending+2>U.pending_buf_size)f7($);if(U.pending+2<=U.pending_buf_size)r1(U,$.adler&255),r1(U,$.adler>>8&255),$.adler=0,U.status=rY}else U.status=rY;if(U.pending!==0){if(f7($),$.avail_out===0)return U.last_flush=-1,$9}else if($.avail_in===0&&q$0(Y)<=q$0(z)&&Y!==c7)return i7($,Fy);if(U.status===WW&&$.avail_in!==0)return i7($,Fy);if($.avail_in!==0||U.lookahead!==0||Y!==tY&&U.status!==WW){var G=U.strategy===IO?ql0(U,Y):U.strategy===rm0?Zl0(U,Y):HQ[U.level].func(U,Y);if(G===sY||G===WQ)U.status=WW;if(G===P6||G===sY){if($.avail_out===0)U.last_flush=-1;return $9}if(G===XW){if(Y===pm0)j$._tr_align(U);else if(Y!==X$0){if(j$._tr_stored_block(U,0,0,!1),Y===dm0){if(u7(U.head),U.lookahead===0)U.strstart=0,U.block_start=0,U.insert=0}}if(f7($),$.avail_out===0)return U.last_flush=-1,$9}}if(Y!==c7)return $9;if(U.wrap<=0)return Z$0;if(U.wrap===2)r1(U,$.adler&255),r1(U,$.adler>>8&255),r1(U,$.adler>>16&255),r1(U,$.adler>>24&255),r1(U,$.total_in&255),r1(U,$.total_in>>8&255),r1(U,$.total_in>>16&255),r1(U,$.total_in>>24&255);else HW(U,$.adler>>>16),HW(U,$.adler&65535);if(f7($),U.wrap>0)U.wrap=-U.wrap;return U.pending!==0?$9:Z$0}function Ol0($){var Y;if(!$||!$.state)return E$;if(Y=$.state.status,Y!==HO&&Y!==Oy&&Y!==QO&&Y!==JO&&Y!==KO&&Y!==rY&&Y!==WW)return i7($,E$);return $.state=null,Y===rY?i7($,mm0):$9}function Nl0($,Y){var z=Y.length,U,I,Q,J,K,G,H,W;if(!$||!$.state)return E$;if(U=$.state,J=U.wrap,J===2||J===1&&U.status!==HO||U.lookahead)return E$;if(J===1)$.adler=V$0($.adler,Y,z,0);if(U.wrap=0,z>=U.w_size){if(J===0)u7(U.head),U.strstart=0,U.block_start=0,U.insert=0;W=new j8.Buf8(U.w_size),j8.arraySet(W,Y,z-U.w_size,U.w_size,0),Y=W,z=U.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=z,$.next_in=0,$.input=Y,aY(U);while(U.lookahead>=f1){I=U.strstart,Q=U.lookahead-(f1-1);do U.ins_h=(U.ins_h<{var WO=Q3(),N$0=!0,D$0=!0;try{String.fromCharCode.apply(null,[0])}catch($){N$0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){D$0=!1}var ZW=new WO.Buf8(256);for(Y9=0;Y9<256;Y9++)ZW[Y9]=Y9>=252?6:Y9>=248?5:Y9>=240?4:Y9>=224?3:Y9>=192?2:1;var Y9;ZW[254]=ZW[254]=1;vl0.string2buf=function($){var Y,z,U,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|z&63;else if(z<65536)Y[Q++]=224|z>>>12,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63;else Y[Q++]=240|z>>>18,Y[Q++]=128|z>>>12&63,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63}return Y};function A$0($,Y){if(Y<65534){if($.subarray&&D$0||!$.subarray&&N$0)return String.fromCharCode.apply(null,WO.shrinkBuf($,Y))}var z="";for(var U=0;U4){K[U++]=65533,z+=Q-1;continue}I&=Q===2?31:Q===3?15:7;while(Q>1&&z1){K[U++]=65533;continue}if(I<65536)K[U++]=I;else I-=65536,K[U++]=55296|I>>10&1023,K[U++]=56320|I&1023}return A$0(K,U)};vl0.utf8border=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+ZW[$[z]]>Y?z:Y}});var Dy=E((Rp1,P$0)=>{function xl0(){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}P$0.exports=xl0});var E$0=E((dl0)=>{var qW=O$0(),VW=Q3(),Py=Ny(),By=UO(),fl0=Dy(),j$0=Object.prototype.toString,ul0=0,Ay=4,XQ=0,B$0=1,T$0=2,bl0=-1,il0=0,cl0=8;function eY($){if(!(this instanceof eY))return new eY($);this.options=VW.assign({level:bl0,method:cl0,chunkSize:16384,windowBits:15,memLevel:8,strategy:il0,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 fl0,this.strm.avail_out=0;var z=qW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(z!==XQ)throw Error(By[z]);if(Y.header)qW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var U;if(typeof Y.dictionary==="string")U=Py.string2buf(Y.dictionary);else if(j$0.call(Y.dictionary)==="[object ArrayBuffer]")U=new Uint8Array(Y.dictionary);else U=Y.dictionary;if(z=qW.deflateSetDictionary(this.strm,U),z!==XQ)throw Error(By[z]);this._dict_set=!0}}eY.prototype.push=function($,Y){var z=this.strm,U=this.options.chunkSize,I,Q;if(this.ended)return!1;if(Q=Y===~~Y?Y:Y===!0?Ay:ul0,typeof $==="string")z.input=Py.string2buf($);else if(j$0.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new VW.Buf8(U),z.next_out=0,z.avail_out=U;if(I=qW.deflate(z,Q),I!==B$0&&I!==XQ)return this.onEnd(I),this.ended=!0,!1;if(z.avail_out===0||z.avail_in===0&&(Q===Ay||Q===T$0))if(this.options.to==="string")this.onData(Py.buf2binstring(VW.shrinkBuf(z.output,z.next_out)));else this.onData(VW.shrinkBuf(z.output,z.next_out))}while((z.avail_in>0||z.avail_out===0)&&I!==B$0);if(Q===Ay)return I=qW.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===XQ;if(Q===T$0)return this.onEnd(XQ),z.avail_out=0,!0;return!0};eY.prototype.onData=function($){this.chunks.push($)};eY.prototype.onEnd=function($){if($===XQ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=VW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function Ty($,Y){var z=new eY(Y);if(z.push($,!0),z.err)throw z.msg||By[z.err];return z.result}function nl0($,Y){return Y=Y||{},Y.raw=!0,Ty($,Y)}function pl0($,Y){return Y=Y||{},Y.gzip=!0,Ty($,Y)}dl0.Deflate=eY;dl0.deflate=Ty;dl0.deflateRaw=nl0;dl0.gzip=pl0});var R$0=E((vp1,C$0)=>{var XO=30,sl0=12;C$0.exports=function(Y,z){var U,I,Q,J,K,G,H,W,X,Z,q,V,F,M,w,O,D,N,B,T,A,j,C,b,k;U=Y.state,I=Y.next_in,b=Y.input,Q=I+(Y.avail_in-5),J=Y.next_out,k=Y.output,K=J-(z-Y.avail_out),G=J+(Y.avail_out-257),H=U.dmax,W=U.wsize,X=U.whave,Z=U.wnext,q=U.window,V=U.hold,F=U.bits,M=U.lencode,w=U.distcode,O=(1<>>24,V>>>=B,F-=B,B=N>>>16&255,B===0)k[J++]=N&65535;else if(B&16){if(T=N&65535,B&=15,B){if(F>>=B,F-=B}if(F<15)V+=b[I++]<>>24,V>>>=B,F-=B,B=N>>>16&255,B&16){if(A=N&65535,B&=15,FH){Y.msg="invalid distance too far back",U.mode=XO;break $}if(V>>>=B,F-=B,B=J-K,A>B){if(B=A-B,B>X){if(U.sane){Y.msg="invalid distance too far back",U.mode=XO;break $}}if(j=0,C=q,Z===0){if(j+=W-B,B2)k[J++]=C[j++],k[J++]=C[j++],k[J++]=C[j++],T-=3;if(T){if(k[J++]=C[j++],T>1)k[J++]=C[j++]}}else{j=J-A;do k[J++]=k[j++],k[J++]=k[j++],k[J++]=k[j++],T-=3;while(T>2);if(T){if(k[J++]=k[j++],T>1)k[J++]=k[j++]}}}else if((B&64)===0){N=w[(N&65535)+(V&(1<>3,I-=T,F-=T<<3,V&=(1<{var _$0=Q3(),ZQ=15,v$0=852,h$0=592,S$0=0,jy=1,g$0=2,al0=[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],tl0=[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],el0=[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],$o0=[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];y$0.exports=function(Y,z,U,I,Q,J,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,M=0,w=0,O=0,D=0,N,B,T,A,j,C=null,b=0,k,h=new _$0.Buf16(ZQ+1),i=new _$0.Buf16(ZQ+1),c=null,U0=0,x,d,t;for(W=0;W<=ZQ;W++)h[W]=0;for(X=0;X=1;q--)if(h[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===S$0||q!==1))return-1;i[1]=0;for(W=1;Wv$0||Y===g$0&&O>h$0)return 1;for(;;){if(x=W-M,K[X]k)d=c[U0+K[X]],t=C[b+K[X]];else d=96,t=0;N=1<>M)+B]=x<<24|d<<16|t|0;while(B!==0);N=1<>=1;if(N!==0)D&=N-1,D+=N;else D=0;if(X++,--h[W]===0){if(W===q)break;W=z[U+K[X]]}if(W>V&&(D&A)!==T){if(M===0)M=V;j+=Z,F=W-M,w=1<v$0||Y===g$0&&O>h$0)return 1;T=D&A,Q[T]=V<<24|F<<16|j-J|0}}if(D!==0)Q[j+D]=W-M<<24|4194304|0;return G.bits=V,0}});var w50=E((Oo0)=>{var K$=Q3(),hy=Vy(),z9=Ly(),Yo0=R$0(),LW=k$0(),zo0=0,G50=1,H50=2,x$0=4,Uo0=5,ZO=6,$z=0,Io0=1,Qo0=2,C$=-2,W50=-3,Sy=-4,Jo0=-5,f$0=8,X50=1,u$0=2,b$0=3,i$0=4,c$0=5,n$0=6,p$0=7,d$0=8,m$0=9,l$0=10,LO=11,K3=12,Ey=13,o$0=14,Cy=15,r$0=16,s$0=17,a$0=18,t$0=19,qO=20,VO=21,e$0=22,$50=23,Y50=24,z50=25,U50=26,Ry=27,I50=28,Q50=29,y4=30,gy=31,Ko0=32,Go0=852,Ho0=592,Wo0=15,Xo0=Wo0;function J50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function Zo0(){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 K$.Buf16(320),this.work=new K$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Z50($){var Y;if(!$||!$.state)return C$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=X50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new K$.Buf32(Go0),Y.distcode=Y.distdyn=new K$.Buf32(Ho0),Y.sane=1,Y.back=-1,$z}function q50($){var Y;if(!$||!$.state)return C$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,Z50($)}function V50($,Y){var z,U;if(!$||!$.state)return C$;if(U=$.state,Y<0)z=0,Y=-Y;else if(z=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return C$;if(U.window!==null&&U.wbits!==Y)U.window=null;return U.wrap=z,U.wbits=Y,q50($)}function L50($,Y){var z,U;if(!$)return C$;if(U=new Zo0,$.state=U,U.window=null,z=V50($,Y),z!==$z)$.state=null;return z}function qo0($){return L50($,Xo0)}var K50=!0,_y,vy;function Vo0($){if(K50){var Y;_y=new K$.Buf32(512),vy=new K$.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;LW(G50,$.lens,0,288,_y,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;LW(H50,$.lens,0,32,vy,0,$.work,{bits:5}),K50=!1}$.lencode=_y,$.lenbits=9,$.distcode=vy,$.distbits=5}function F50($,Y,z,U){var I,Q=$.state;if(Q.window===null)Q.wsize=1<=Q.wsize)K$.arraySet(Q.window,Y,z-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize;else{if(I=Q.wsize-Q.wnext,I>U)I=U;if(K$.arraySet(Q.window,Y,z-U,I,Q.wnext),U-=I,U)K$.arraySet(Q.window,Y,z-U,U,0),Q.wnext=U,Q.whave=Q.wsize;else{if(Q.wnext+=I,Q.wnext===Q.wsize)Q.wnext=0;if(Q.whave>>8&255,z.check=z9(z.check,C,2,0),H=0,W=0,z.mode=u$0;break}if(z.flags=0,z.head)z.head.done=!1;if(!(z.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",z.mode=y4;break}if((H&15)!==f$0){$.msg="unknown compression method",z.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,z.wbits===0)z.wbits=A;else if(A>z.wbits){$.msg="invalid window size",z.mode=y4;break}z.dmax=1<>8&1;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=z9(z.check,C,2,0);H=0,W=0,z.mode=b$0;case b$0:while(W<32){if(K===0)break $;K--,H+=U[Q++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,z.check=z9(z.check,C,4,0);H=0,W=0,z.mode=i$0;case i$0:while(W<16){if(K===0)break $;K--,H+=U[Q++]<>8;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=z9(z.check,C,2,0);H=0,W=0,z.mode=c$0;case c$0:if(z.flags&1024){while(W<16){if(K===0)break $;K--,H+=U[Q++]<>>8&255,z.check=z9(z.check,C,2,0);H=0,W=0}else if(z.head)z.head.extra=null;z.mode=n$0;case n$0:if(z.flags&1024){if(q=z.length,q>K)q=K;if(q){if(z.head){if(A=z.head.extra_len-z.length,!z.head.extra)z.head.extra=Array(z.head.extra_len);K$.arraySet(z.head.extra,U,Q,q,A)}if(z.flags&512)z.check=z9(z.check,U,q,Q);K-=q,Q+=q,z.length-=q}if(z.length)break $}z.length=0,z.mode=p$0;case p$0:if(z.flags&2048){if(K===0)break $;q=0;do if(A=U[Q+q++],z.head&&A&&z.length<65536)z.head.name+=String.fromCharCode(A);while(A&&q>9&1,z.head.done=!0;$.adler=z.check=0,z.mode=K3;break;case l$0:while(W<32){if(K===0)break $;K--,H+=U[Q++]<>>=W&7,W-=W&7,z.mode=Ry;break}while(W<3){if(K===0)break $;K--,H+=U[Q++]<>>=1,W-=1,H&3){case 0:z.mode=o$0;break;case 1:if(Vo0(z),z.mode=qO,Y===ZO){H>>>=2,W-=2;break $}break;case 2:z.mode=s$0;break;case 3:$.msg="invalid block type",z.mode=y4}H>>>=2,W-=2;break;case o$0:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=U[Q++]<>>16^65535)){$.msg="invalid stored block lengths",z.mode=y4;break}if(z.length=H&65535,H=0,W=0,z.mode=Cy,Y===ZO)break $;case Cy:z.mode=r$0;case r$0:if(q=z.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;K$.arraySet(I,U,Q,q,J),K-=q,Q+=q,G-=q,J+=q,z.length-=q;break}z.mode=K3;break;case s$0:while(W<14){if(K===0)break $;K--,H+=U[Q++]<>>=5,W-=5,z.ndist=(H&31)+1,H>>>=5,W-=5,z.ncode=(H&15)+4,H>>>=4,W-=4,z.nlen>286||z.ndist>30){$.msg="too many length or distance symbols",z.mode=y4;break}z.have=0,z.mode=a$0;case a$0:while(z.have>>=3,W-=3}while(z.have<19)z.lens[h[z.have++]]=0;if(z.lencode=z.lendyn,z.lenbits=7,b={bits:z.lenbits},j=LW(zo0,z.lens,0,19,z.lencode,0,z.work,b),z.lenbits=b.bits,j){$.msg="invalid code lengths set",z.mode=y4;break}z.have=0,z.mode=t$0;case t$0:while(z.have>>24,O=M>>>16&255,D=M&65535,w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>>=w,W-=w,z.lens[z.have++]=D;else{if(D===16){k=w+2;while(W>>=w,W-=w,z.have===0){$.msg="invalid bit length repeat",z.mode=y4;break}A=z.lens[z.have-1],q=3+(H&3),H>>>=2,W-=2}else if(D===17){k=w+3;while(W>>=w,W-=w,A=0,q=3+(H&7),H>>>=3,W-=3}else{k=w+7;while(W>>=w,W-=w,A=0,q=11+(H&127),H>>>=7,W-=7}if(z.have+q>z.nlen+z.ndist){$.msg="invalid bit length repeat",z.mode=y4;break}while(q--)z.lens[z.have++]=A}}if(z.mode===y4)break;if(z.lens[256]===0){$.msg="invalid code -- missing end-of-block",z.mode=y4;break}if(z.lenbits=9,b={bits:z.lenbits},j=LW(G50,z.lens,0,z.nlen,z.lencode,0,z.work,b),z.lenbits=b.bits,j){$.msg="invalid literal/lengths set",z.mode=y4;break}if(z.distbits=6,z.distcode=z.distdyn,b={bits:z.distbits},j=LW(H50,z.lens,z.nlen,z.ndist,z.distcode,0,z.work,b),z.distbits=b.bits,j){$.msg="invalid distances set",z.mode=y4;break}if(z.mode=qO,Y===ZO)break $;case qO:z.mode=VO;case VO:if(K>=6&&G>=258){if($.next_out=J,$.avail_out=G,$.next_in=Q,$.avail_in=K,z.hold=H,z.bits=W,Yo0($,Z),J=$.next_out,I=$.output,G=$.avail_out,Q=$.next_in,U=$.input,K=$.avail_in,H=z.hold,W=z.bits,z.mode===K3)z.back=-1;break}z.back=0;for(;;){if(M=z.lencode[H&(1<>>24,O=M>>>16&255,D=M&65535,w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>N)],w=M>>>24,O=M>>>16&255,D=M&65535,N+w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>>=N,W-=N,z.back+=N}if(H>>>=w,W-=w,z.back+=w,z.length=D,O===0){z.mode=U50;break}if(O&32){z.back=-1,z.mode=K3;break}if(O&64){$.msg="invalid literal/length code",z.mode=y4;break}z.extra=O&15,z.mode=e$0;case e$0:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}z.was=z.length,z.mode=$50;case $50:for(;;){if(M=z.distcode[H&(1<>>24,O=M>>>16&255,D=M&65535,w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>N)],w=M>>>24,O=M>>>16&255,D=M&65535,N+w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>>=N,W-=N,z.back+=N}if(H>>>=w,W-=w,z.back+=w,O&64){$.msg="invalid distance code",z.mode=y4;break}z.offset=D,z.extra=O&15,z.mode=Y50;case Y50:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}if(z.offset>z.dmax){$.msg="invalid distance too far back",z.mode=y4;break}z.mode=z50;case z50:if(G===0)break $;if(q=Z-G,z.offset>q){if(q=z.offset-q,q>z.whave){if(z.sane){$.msg="invalid distance too far back",z.mode=y4;break}}if(q>z.wnext)q-=z.wnext,V=z.wsize-q;else V=z.wnext-q;if(q>z.length)q=z.length;F=z.window}else F=I,V=J-z.offset,q=z.length;if(q>G)q=G;G-=q,z.length-=q;do I[J++]=F[V++];while(--q);if(z.length===0)z.mode=VO;break;case U50:if(G===0)break $;I[J++]=z.length,G--,z.mode=VO;break;case Ry:if(z.wrap){while(W<32){if(K===0)break $;K--,H|=U[Q++]<{M50.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 N50=E((yp1,O50)=>{function _o0(){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}O50.exports=_o0});var A50=E((go0)=>{var qQ=w50(),FW=Q3(),FO=Ny(),G6=yy(),ky=UO(),vo0=Dy(),ho0=N50(),D50=Object.prototype.toString;function Yz($){if(!(this instanceof Yz))return new Yz($);this.options=FW.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 vo0,this.strm.avail_out=0;var z=qQ.inflateInit2(this.strm,Y.windowBits);if(z!==G6.Z_OK)throw Error(ky[z]);if(this.header=new ho0,qQ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=FO.string2buf(Y.dictionary);else if(D50.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(z=qQ.inflateSetDictionary(this.strm,Y.dictionary),z!==G6.Z_OK)throw Error(ky[z])}}}Yz.prototype.push=function($,Y){var z=this.strm,U=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?G6.Z_FINISH:G6.Z_NO_FLUSH,typeof $==="string")z.input=FO.binstring2buf($);else if(D50.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new FW.Buf8(U),z.next_out=0,z.avail_out=U;if(Q=qQ.inflate(z,G6.Z_NO_FLUSH),Q===G6.Z_NEED_DICT&&I)Q=qQ.inflateSetDictionary(this.strm,I);if(Q===G6.Z_BUF_ERROR&&W===!0)Q=G6.Z_OK,W=!1;if(Q!==G6.Z_STREAM_END&&Q!==G6.Z_OK)return this.onEnd(Q),this.ended=!0,!1;if(z.next_out){if(z.avail_out===0||Q===G6.Z_STREAM_END||z.avail_in===0&&(J===G6.Z_FINISH||J===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=FO.utf8border(z.output,z.next_out),G=z.next_out-K,H=FO.buf2string(z.output,K),z.next_out=G,z.avail_out=U-G,G)FW.arraySet(z.output,z.output,K,G,0);this.onData(H)}else this.onData(FW.shrinkBuf(z.output,z.next_out))}if(z.avail_in===0&&z.avail_out===0)W=!0}while((z.avail_in>0||z.avail_out===0)&&Q!==G6.Z_STREAM_END);if(Q===G6.Z_STREAM_END)J=G6.Z_FINISH;if(J===G6.Z_FINISH)return Q=qQ.inflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===G6.Z_OK;if(J===G6.Z_SYNC_FLUSH)return this.onEnd(G6.Z_OK),z.avail_out=0,!0;return!0};Yz.prototype.onData=function($){this.chunks.push($)};Yz.prototype.onEnd=function($){if($===G6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=FW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function xy($,Y){var z=new Yz(Y);if(z.push($,!0),z.err)throw z.msg||ky[z.err];return z.result}function So0($,Y){return Y=Y||{},Y.raw=!0,xy($,Y)}go0.Inflate=Yz;go0.inflate=xy;go0.inflateRaw=So0;go0.ungzip=xy});var T50=E((xp1,B50)=>{var uo0=Q3().assign,bo0=E$0(),io0=A50(),co0=yy(),P50={};uo0(P50,bo0,io0,co0);B50.exports=P50});var E50=E((mo0)=>{var no0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",po0=T50(),j50=c4(),wO=J$(),do0=no0?"uint8array":"array";mo0.magic="\b\x00";function zz($,Y){wO.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}j50.inherits(zz,wO);zz.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(j50.transformTo(do0,$.data),!1)};zz.prototype.flush=function(){if(wO.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};zz.prototype.cleanUp=function(){wO.prototype.cleanUp.call(this),this._pako=null};zz.prototype._createPako=function(){this._pako=new po0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};mo0.compressWorker=function($){return new zz("Deflate",$)};mo0.uncompressWorker=function(){return new zz("Inflate",{})}});var fy=E((so0)=>{var C50=J$();so0.STORE={magic:"\x00\x00",compressWorker:function(){return new C50("STORE compression")},uncompressWorker:function(){return new C50("STORE decompression")}};so0.DEFLATE=E50()});var uy=E((eo0)=>{eo0.LOCAL_FILE_HEADER="PK\x03\x04";eo0.CENTRAL_FILE_HEADER="PK\x01\x02";eo0.CENTRAL_DIRECTORY_END="PK\x05\x06";eo0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";eo0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";eo0.DATA_DESCRIPTOR="PK\x07\b"});var h50=E((ip1,v50)=>{var VQ=c4(),LQ=J$(),by=IQ(),R50=eM(),MO=uy(),O4=function($,Y){var z="",U;for(U=0;U>>8;return z},Jr0=function($,Y){var z=$;if(!$)z=Y?16893:33204;return(z&65535)<<16},Kr0=function($){return($||0)&63},_50=function($,Y,z,U,I,Q){var{file:J,compression:K}=$,G=Q!==by.utf8encode,H=VQ.transformTo("string",Q(J.name)),W=VQ.transformTo("string",by.utf8encode(J.name)),X=J.comment,Z=VQ.transformTo("string",Q(X)),q=VQ.transformTo("string",by.utf8encode(X)),V=W.length!==J.name.length,F=q.length!==X.length,M,w,O="",D="",N="",B=J.dir,T=J.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||z)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(Y)j|=8;if(!G&&(V||F))j|=2048;var C=0,b=0;if(B)C|=16;if(I==="UNIX")b=798,C|=Jr0(J.unixPermissions,B);else b=20,C|=Kr0(J.dosPermissions,B);if(M=T.getUTCHours(),M=M<<6,M=M|T.getUTCMinutes(),M=M<<5,M=M|T.getUTCSeconds()/2,w=T.getUTCFullYear()-1980,w=w<<4,w=w|T.getUTCMonth()+1,w=w<<5,w=w|T.getUTCDate(),V)D=O4(1,1)+O4(R50(H),4)+W,O+="up"+O4(D.length,2)+D;if(F)N=O4(1,1)+O4(R50(Z),4)+q,O+="uc"+O4(N.length,2)+N;var k="";k+=` + 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 F=H[V];if(F.length===0)continue;let M=(0,U.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else W.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.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 F in H){if((0,z.alwaysValidSchema)(q,H[F]))continue;W.if((0,U.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=I}),Ub0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,z.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=U}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=U5(),I=v1(),Q={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:J})=>z._`{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 F=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);w(),J.ok(z._`${X} === ${U.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!M.length)N(T);else K.if(O(T),()=>N(T))})}function O(T){let A;if(F.length>8){let j=(0,I.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)A=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else A=z.nil;if(M.length)A=(0,z.or)(A,...M.map((j)=>z._`${(0,Y.usePattern)(J,j)}.test(${T})`));return(0,z.not)(A)}function D(T){K.code(z._`delete ${W}[${T}]`)}function N(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){D(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")B(T,A,!1),K.if((0,z.not)(A),()=>{J.reset(),D(T)});else if(B(T,A),!q)K.if((0,z.not)(A),()=>K.break())}}function B(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}),Ib0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=SI(),z=I5(),U=v1(),I=at(),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,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,z.propertyInData)(K,W,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}J.it.definedProperties.add(w),J.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){J.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=Q}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=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((B)=>(0,U.alwaysValidSchema)(X,G[B]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,I.evaluatedPropsToName)(K,X.props);let{props:w}=X;O();function O(){for(let B of q){if(F)D(B);if(X.allErrors)N(B);else K.var(M,!0),N(B),K.if(M)}}function D(B){for(let T in F)if(new RegExp(B).test(T))(0,U.checkStrictMode)(X,`property ${T} matches pattern ${B} (use allowMatchingProperties)`)}function N(B){K.forIn("key",H,(T)=>{K.if(z._`${(0,Y.usePattern)(J,B)}.test(${T})`,()=>{let A=V.includes(B);if(!A)J.subschema({keyword:"patternProperties",schemaProp:B,dataProp:T,dataPropType:I.Type.Str},M);if(X.opts.unevaluated&&w!==!0)K.assign(z._`${w}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,z.not)(M),()=>K.break())})})}}};$.default=Q}),Jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(U){let{gen:I,schema:Q,it:J}=U;if((0,Y.alwaysValidSchema)(J,Q)){U.fail();return}let K=I.name("valid");U.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),U.failResult(K,()=>U.reset(),()=>U.error())},error:{message:"must NOT be valid"}};$.default=z}),Kb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:I5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),Gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,F)=>{let M;if((0,z.alwaysValidSchema)(G,V))Q.var(Z,!0);else M=I.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},Z);if(F>0)Q.if(Y._`${Z} && ${W}`).assign(W,!1).assign(X,Y._`[${X}, ${F}]`).else();Q.if(Z,()=>{if(Q.assign(W,!0),Q.assign(X,F),M)I.mergeEvaluated(M,Y.Name)})})}}};$.default=U}),Hb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"allOf",schemaType:"array",code(U){let{gen:I,schema:Q,it:J}=U;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=U.subschema({keyword:"allOf",schemaProp:H},K);U.ok(K),U.mergeEvaluated(W)})}};$.default=z}),Wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,z.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 F=J.let("ifClause");Q.setParams({ifClause:F}),J.if(Z,V("then",F),V("else",F))}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 F=Q.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);Q.mergeEvaluated(F)}function V(F,M){return()=>{let w=Q.subschema({keyword:F},Z);if(J.assign(X,Z),Q.mergeValidEvaluated(w,X),M)J.assign(M,Y._`${F}`);else Q.setParams({ifClause:F})}}}};function I(Q,J){let K=Q.schema[J];return K!==void 0&&!(0,z.alwaysValidSchema)(Q,K)}$.default=U}),Xb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:U,parentSchema:I,it:Q}){if(I.if===void 0)(0,Y.checkStrictMode)(Q,`"${U}" without "if" is ignored`)}};$.default=z}),tt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=rt(),z=$b0(),U=st(),I=Yb0(),Q=zb0(),J=KS(),K=Ub0(),G=at(),H=Ib0(),W=Qb0(),X=Jb0(),Z=Kb0(),q=Gb0(),V=Hb0(),F=Wb0(),M=Xb0();function w(O=!1){let D=[X.default,Z.default,q.default,V.default,F.default,M.default,K.default,G.default,J.default,H.default,W.default];if(O)D.push(z.default,I.default);else D.push(Y.default,U.default);return D.push(Q.default),D}$.default=w}),Zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:U})=>Y.str`must match format "${U}"`,params:({schemaCode:U})=>Y._`{format: ${U}}`},code(U,I){let{gen:Q,data:J,$data:K,schema:G,schemaCode:H,it:W}=U,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else M();function F(){let w=Q.scopeValue("formats",{ref:V.formats,code:X.code.formats}),O=Q.const("fDef",Y._`${w}[${H}]`),D=Q.let("fType"),N=Q.let("format");Q.if(Y._`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>Q.assign(D,Y._`${O}.type || "string"`).assign(N,Y._`${O}.validate`),()=>Q.assign(D,Y._`"string"`).assign(N,O)),U.fail$data((0,Y.or)(B(),T()));function B(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${N}`}function T(){let A=q.$async?Y._`(${O}.async ? await ${N}(${J}) : ${N}(${J}))`:Y._`${N}(${J})`,j=Y._`(typeof ${N} == "function" ? ${A} : ${N}.test(${J}))`;return Y._`${N} && ${N} !== true && ${D} === ${I} && !${j}`}}function M(){let w=V.formats[G];if(!w){B();return}if(w===!0)return;let[O,D,N]=T(w);if(O===I)U.pass(A());function B(){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 w=="object"&&!(w instanceof RegExp)&&w.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${N}(${J})`}return typeof D=="function"?Y._`${N}(${J})`:Y._`${N}.test(${J})`}}}};$.default=z}),et=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[Zb0().default];$.default=Y}),$e=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Ye=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=lt(),z=ot(),U=tt(),I=et(),Q=$e(),J=[Y.default,z.default,(0,U.default)(),I.default,Q.metadataVocabulary,Q.contentVocabulary];$.default=J}),qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(z){z.Tag="tag",z.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),GS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=qb0(),U=yw(),I=gI(),Q=v1(),J={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===z.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 F=G.let("valid",!1),M=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${M} == "string"`,()=>w(),()=>K.error(!1,{discrError:z.DiscrError.Tag,tag:M,tagName:V})),K.ok(F);function w(){let N=D();G.if(!1);for(let B in N)G.elseIf(Y._`${M} === ${B}`),G.assign(F,O(N[B]));G.else(),K.error(!1,{discrError:z.DiscrError.Mapping,tag:M,tagName:V}),G.endIf()}function O(N){let B=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:N},B);return K.mergeEvaluated(T,Y.Name),B}function D(){var N;let B={},T=j(X),A=!0;for(let k=0;k{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}}),ze=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let z=IS(),U=Ye(),I=GS(),Q=Vb0(),J=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends z.default{_addVocabularies(){if(super._addVocabularies(),U.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=SI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=L1();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=qH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=gI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),Ue=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=L1(),z=U5(),U=yw(),I=QS(),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._`${z.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:F}=H.root,{schemaId:M}=X.opts,w=new U.SchemaEnv({schema:W,schemaId:M,root:Z,baseId:q,localRefs:V,meta:F});return U.compileSchema.call(X,w),(0,I.getValidate)(G,w)}$.default=Q}),Ie=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=L1(),z=U5(),U=QS(),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 F=G.let("_v",Y._`${z.default.dynamicAnchors}${(0,Y.getProperty)(X)}`);G.if(F,q(F,V),q(W.validateName,V))}else q(W.validateName,V)()}function q(V,F){return F?()=>G.block(()=>{(0,U.callRef)(J,V),G.let(F,!0)}):()=>(0,U.callRef)(J,V)}}$.dynamicRef=Q,$.default=I}),Lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ue(),z=v1(),U={keyword:"$recursiveAnchor",schemaType:"boolean",code(I){if(I.schema)(0,Y.dynamicAnchor)(I,"");else(0,z.checkStrictMode)(I.it,"$recursiveAnchor: false is ignored")}};$.default=U}),Fb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ie(),z={keyword:"$recursiveRef",schemaType:"string",code:(U)=>(0,Y.dynamicRef)(U,U.schema)};$.default=z}),Qe=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ue(),z=Ie(),U=Lb0(),I=Fb0(),Q=[Y.default,z.default,U.default,I.default];$.default=Q}),wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=KS(),z={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(U)=>(0,Y.validatePropertyDeps)(U)};$.default=z}),Mb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=KS(),z={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(U)=>(0,Y.validateSchemaDeps)(U)};$.default=z}),Ob0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:U,parentSchema:I,it:Q}){if(I.contains===void 0)(0,Y.checkStrictMode)(Q,`"${U}" without "contains" is ignored`)}};$.default=z}),Je=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=wb0(),z=Mb0(),U=Ob0(),I=[Y.default,z.default,U.default];$.default=I}),Nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U=U5(),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(F(Z,M),()=>q(M)));W.props=!0,Q.ok(Y._`${H} === ${U.default.errors}`);function q(M){if(K===!1){if(Q.setParams({unevaluatedProperty:M}),Q.error(),!X)J.break();return}if(!(0,z.alwaysValidSchema)(W,K)){let w=J.name("valid");if(Q.subschema({keyword:"unevaluatedProperties",dataProp:M,dataPropType:z.Type.Str},w),!X)J.if((0,Y.not)(w),()=>J.break())}}function V(M,w){return Y._`!${M} || !${M}[${w}]`}function F(M,w){let O=[];for(let D in M)if(M[D]===!0)O.push(Y._`${w} !== ${D}`);return(0,Y.and)(...O)}}};$.default=I}),Db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={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,z.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:z.Type.Num},Z),!G.allErrors)Q.if((0,Y.not)(Z),()=>Q.break())})}}};$.default=U}),Ke=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Nb0(),z=Db0(),U=[Y.default,z.default];$.default=U}),Ab0=R0(($,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"}]}}}}}),Pb0=R0(($,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:"#"}}}}}),Bb0=R0(($,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:"#"}}}}),Tb0=R0(($,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:{}}}}}),jb0=R0(($,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"}}}}),Eb0=R0(($,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}}}}),Cb0=R0(($,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:[]}}}}),Rb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ab0(),z=Pb0(),U=Bb0(),I=Tb0(),Q=jb0(),J=Eb0(),K=Cb0(),G=["/properties"];function H(W){return[Y,z,U,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}),_b0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let z=IS(),U=Ye(),I=Qe(),Q=Je(),J=Ke(),K=GS(),G=Rb0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends z.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(I.default),U.default.forEach((F)=>this.addVocabulary(F)),this.addVocabulary(Q.default),this.addVocabulary(J.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:F,meta:M}=this.opts;if(!M)return;G.default.call(this,F),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=SI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=L1();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=qH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=gI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),vb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=lt(),z=ot(),U=tt(),I=Qe(),Q=Je(),J=Ke(),K=et(),G=$e(),H=[I.default,Y.default,z.default,(0,U.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,Q.default,J.default];$.default=H}),hb0=R0(($,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}}}}),Sb0=R0(($,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"}}}}}),gb0=R0(($,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"}}}}),yb0=R0(($,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"}}}}),kb0=R0(($,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"}}}}),xb0=R0(($,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"}}}}),fb0=R0(($,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}}}}),ub0=R0(($,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:[]}}}}),bb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hb0(),z=Sb0(),U=gb0(),I=yb0(),Q=kb0(),J=xb0(),K=fb0(),G=ub0(),H=["/properties"];function W(X){return[Y,z,U,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}),ib0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let z=IS(),U=vb0(),I=GS(),Q=bb0(),J="https://json-schema.org/draft/2020-12/schema";var K=class extends z.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),U.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=SI();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=L1();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=qH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=gI();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),cb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(k,h){return{validate:k,compare:h}}$.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:w,"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:D,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 z(k){return k%4===0&&(k%100!==0||k%400===0)}let U=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,I=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Q(k){let h=U.exec(k);if(!h)return!1;let i=+h[1],c=+h[2],U0=+h[3];return c>=1&&c<=12&&U0>=1&&U0<=(c===2&&z(i)?29:I[c])}function J(k,h){if(!(k&&h))return;if(k>h)return 1;if(k23||p>59||k&&!t)return!1;if(U0<=23&&x<=59&&d<60)return!0;let e=x-p*$0,y=U0-g*$0-(e<0?1:0);return(y===23||y===-1)&&(e===59||e===-1)&&d<61}}function H(k,h){if(!(k&&h))return;let i=new Date("2020-01-01T"+k).valueOf(),c=new Date("2020-01-01T"+h).valueOf();if(!(i&&c))return;return i-c}function W(k,h){if(!(k&&h))return;let i=K.exec(k),c=K.exec(h);if(!(i&&c))return;if(k=i[1]+i[2]+i[3],h=c[1]+c[2]+c[3],k>h)return 1;if(k=N}function A(k){return Number.isInteger(k)}function j(){return!0}let C=/[^\\]\\Z/;function b(k){if(C.test(k))return!1;try{return new RegExp(k),!0}catch(h){return!1}}}),nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=ze(),z=L1(),U=z.operators,I={formatMaximum:{okStr:"<=",ok:U.LTE,fail:U.GT},formatMinimum:{okStr:">=",ok:U.GTE,fail:U.LT},formatExclusiveMaximum:{okStr:"<",ok:U.LT,fail:U.GTE},formatExclusiveMinimum:{okStr:">",ok:U.GT,fail:U.LTE}},Q={message:({keyword:K,schemaCode:G})=>z.str`should be ${I[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>z._`{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 F=new Y.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(F.$data)M();else w();function M(){let D=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),N=G.const("fmt",z._`${D}[${F.schemaCode}]`);K.fail$data((0,z.or)(z._`typeof ${N} != "object"`,z._`${N} instanceof RegExp`,z._`typeof ${N}.compare != "function"`,O(N)))}function w(){let D=F.schema,N=V.formats[D];if(!N||N===!0)return;if(typeof N!="object"||N instanceof RegExp||typeof N.compare!="function")throw Error(`"${X}": format "${D}" does not define "compare" function`);let B=G.scopeValue("formats",{key:D,ref:N,code:q.code.formats?z._`${q.code.formats}${(0,z.getProperty)(D)}`:void 0});K.fail$data(O(B))}function O(D){return z._`${D}.compare(${H}, ${W}) ${I[X].fail} 0`}},dependencies:["format"]};let J=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=J}),pb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let z=cb0(),U=nb0(),I=L1(),Q=new I.Name("fullFormats"),J=new I.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,z.fullFormats,Q),H;let[X,Z]=W.mode==="fast"?[z.fastFormats,J]:[z.fullFormats,Q];if(G(H,W.formats||z.formatNames,X,Z),W.keywords)(0,U.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?z.fastFormats:z.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 F of W)H.addFormat(F,X[F])}Y.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),Ge=ze(),db0=_b0(),mb0=ib0(),lb0=nq(pb0(),1),ob0=lb0.default;ef1=Ge.Ajv});import HS from"node:process";var xw=o(()=>{He()});function XS($){return!!$&&typeof $==="object"&&Me in $}function sb0($){return $[Me]?.complete}function ab0($,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 tb0($,Y){let z={},U=(I)=>Y===void 0||I===!0;if($.toolsListChanged===!0&&U(Y?.tools?.listChanged))z.toolsListChanged=!0;if($.promptsListChanged===!0&&U(Y?.prompts?.listChanged))z.promptsListChanged=!0;if($.resourcesListChanged===!0&&U(Y?.resources?.listChanged))z.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&U(Y?.resources?.subscribe))z.resourceSubscriptions=[...$.resourceSubscriptions];return z}function We($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[yY]:Y}}}}function eb0($){let Y=B7(XH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function Yi0($,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 Ii0($){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??zi0,roundTimeoutMs:$?.roundTimeoutMs??Ui0,legacyShim:$?.legacyShim??!0}}function Ne($,Y,z){if(z===null||typeof z!=="object"||typeof z.method!=="string")throw new Q1(n0.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 U=z,I=Xt(U);if(I===void 0)throw new Q1(n0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${U.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:U,required:I}}function Qi0(){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 z=[...Y].map((U)=>U.toString(16).padStart(2,"0")).join("");return`${z.slice(0,8)}-${z.slice(8,12)}-${z.slice(12,16)}-${z.slice(16,20)}-${z.slice(20)}`}function WS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new Q1(n0.InternalError,Y)}function ZS($,Y){De($,Y)}function qS($){return Ae($)}function Hi0($){return{...$}}function Xe($,Y){if($){let U=Y;return async(I,Q)=>U(I,Q)}let z=Y;return async(U,I)=>z(I)}function qe($){if($===void 0)return;try{return E7($,"output")}catch{return}}function Ve($,Y,z){if(Y){let U=z;return async(I,Q)=>{let J=await fY(Y,I);if(!J.success)throw new Q1(n0.InvalidParams,`Invalid arguments for prompt ${$}: ${J.error}`);return U(J.data,Q)}}else{let U=z;return async(I,Q)=>{return U(Q)}}}function Le($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function Fe($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function Wi0($){return $?.type==="optional"}function we($){if(!Wi0($))return $;return $.def?.innerType??$}var Me,fw=1024,$i0,Oe=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=fw,Y,z){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=z}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=eb0($);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 z=tb0(Y,this._serverCapabilities);return this._subs.set($.id,z),We({method:"notifications/subscriptions/acknowledged",params:{notifications:z}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!$i0.has($.method))return"passthrough";let Y=$.params?.uri,z=typeof Y==="string"?Y:void 0,U=Yi0($.method,z),I=[];for(let[Q,J]of this._subs)if(ab0(J,U))I.push(We({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:{[yY]:Y,...this._serverInfo!==void 0&&{[p5]:this._serverInfo}}}});return this._subs.clear(),$}},zi0=8,Ui0=600000,Ji0=class{constructor($){this._host=$}async fulfill($,Y,z,U,I){let{maxRounds:Q,roundTimeoutMs:J}=this._host,K=U.mcpReq.signal,G=I,H=0;while(!0){if(H+=1,H>Q)return WS($,ht($,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 Q1(n0.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(U),w=[];for(let[D,N]of Object.entries(W)){let{embedded:B,required:T}=Ne($,D,N);if(B.method!=="roots/list"&&B.params===void 0)throw new Q1(n0.InternalError,`Handler for ${$} returned an input request '${D}' of kind '${B.method}' without params`);if(Nw(T,M)!==void 0)return WS($,`Cannot request input '${D}' (${B.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)":""}`);w.push([D,B])}let O=gt(K);try{let D={relatedRequestId:U.mcpReq.id,timeout:J,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:O.signal},N=await Promise.all(w.map(async([B,T])=>{try{return[B,await this._dispatchLeg(T,D)]}catch(A){throw O.abort(A),A}}));q=Object.fromEntries(N)}catch(D){if(K.aborted)throw D;return WS($,`Fulfilling input required by '${$}' failed: ${D instanceof Error?D.message:String(D)}`)}finally{O.dispose()}}else await St(vt,K);let V={...U,mcpReq:{...U.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:ZH(Z)}};if(Z!==void 0){let M=await this._host.verifyRequestState(Z,V,$);if(M!==void 0)V=sh(V,M)}let F=await Y(z,V);if(!r9(F))return F;G=F}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let z=$.params;if(z.mode==="url"&&z.elicitationId===void 0)z={...z,elicitationId:Qi0()};return await this._host.sendElicitation(z,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},Ki0,Gi0,De,Ae,Pe,LH=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 Ze;try{let z=E7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=z,z}catch{return}}constructor($,Y){if(this.server=new Pe($,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 z={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?E7(Y.inputSchema,"input"):Ze,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)z.outputSchema=E7(Y.outputSchema,"output");return z})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let z=this._registeredTools[$.params.name];if(!z)throw new Q1(n0.InvalidParams,`Tool ${$.params.name} not found`);if(!z.enabled)throw new Q1(n0.InvalidParams,`Tool ${$.params.name} disabled`);try{let U=await this.validateToolInput(z,$.params.arguments,$.params.name),I=await this.executeToolHandler(z,U,Y);if(await this.validateToolOutput(z,I,$.params.name),r9(I))return I;return this.server.projectCallToolResult(I,z.outputSchemaJson)}catch(U){if(U instanceof Q1&&U.code===n0.UrlElicitationRequired)throw U;return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,z){if(!$.inputSchema)return;let U=await fY($.inputSchema,Y??{});if(!U.success)throw new Q1(n0.InvalidParams,`Input validation error: Invalid arguments for tool ${z}: ${U.error}`);return U.data}async validateToolOutput($,Y,z){if(!$.outputSchema)return;if(r9(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new Q1(n0.InvalidParams,`Output validation error: Tool ${z} has an output schema but no structured content was provided`);let U=await fY($.outputSchema,Y.structuredContent);if(!U.success)throw new Q1(n0.InvalidParams,`Output validation error: Invalid structured content for tool ${z}: ${U.error}`)}async executeToolHandler($,Y,z){return $.executor(Y,z)}_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 ph($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return dh($),this.handleResourceCompletion($,$.params.ref);default:throw new Q1(n0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let z=this._registeredPrompts[Y.name];if(!z)throw new Q1(n0.InvalidParams,`Prompt ${Y.name} not found`);if(!z.enabled)throw new Q1(n0.InvalidParams,`Prompt ${Y.name} disabled`);if(!z.argsSchema)return VH;let U=we(Fe(z.argsSchema)?.[$.params.argument.name]);if(!XS(U))return VH;let I=sb0(U);if(!I)return VH;return Le(await I($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let z=Object.values(this._registeredResourceTemplates).find((I)=>I.resourceTemplate.uriTemplate.toString()===Y.uri);if(!z){if(this._registeredResources[Y.uri])return VH;throw new Q1(n0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let U=z.resourceTemplate.completeCallback($.params.argument.name);if(!U)return VH;return Le(await U($.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 z=Object.entries(this._registeredResources).filter(([I,Q])=>Q.enabled).map(([I,Q])=>({uri:I,name:Q.name,...Q.metadata})),U=[];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)U.push({...I.metadata,...J})}return{resources:[...z,...U]}}),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 z;try{z=new URL($.params.uri)}catch{throw new Q1(n0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let U=this._registeredResources[z.toString()];if(U){if(!U.enabled)throw new Q1(n0.InvalidParams,`Resource ${z} disabled`);return Dw(await U.readCallback(z,Y),U.cacheHint)}for(let I of Object.values(this._registeredResourceTemplates)){let Q=I.resourceTemplate.uriTemplate.match(z.toString());if(Q)return Dw(await I.readCallback(z,Q,Y),I.cacheHint)}throw new Aw($.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?_t(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let z=this._registeredPrompts[$.params.name];if(!z)throw new Q1(n0.InvalidParams,`Prompt ${$.params.name} not found`);if(!z.enabled)throw new Q1(n0.InvalidParams,`Prompt ${$.params.name} disabled`);return z.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,z,U){let I=z.cacheHint,Q=z;if(I!==void 0){ih(I,`resource ${$}`);let J={...z};delete J.cacheHint,Q=J}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let J=this._createRegisteredResource($,z.title,Y,Q,U);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($,z.title,Y,Q,U);if(I!==void 0)J.cacheHint=I;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}}_createRegisteredResource($,Y,z,U,I){let Q={name:$,title:Y,metadata:U,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!==z){if(delete this._registeredResources[z],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[z]=Q,Q}_createRegisteredResourceTemplate($,Y,z,U,I){let Q={resourceTemplate:z,title:Y,metadata:U,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=z.uriTemplate.variableNames;if(Array.isArray(J)&&J.some((K)=>!!z.completeCallback(K)))this.setCompletionRequestHandler();return Q}_createRegisteredPrompt($,Y,z,U,I,Q,J){let K=U,G=I,H={title:Y,description:z,argsSchema:U,icons:Q,_meta:J,handler:Ve($,U,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=Ve($,K,G);if(W.enabled!==void 0)H.enabled=W.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=H,U){let W=Fe(U);if(W){if(Object.values(W).some((X)=>{return XS(we(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,z,U,I,Q,J,K,G,H){if(zS($),U!==void 0)try{let Z=E7(U,"input");this._toolInputSchemaJson[$]=Z;let q=mh(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:z,inputSchema:U,outputSchema:I,outputSchemaJson:qe(I),annotations:Q,icons:J,execution:K,_meta:G,handler:H,executor:Xe(U,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")zS(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=Xe(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=qe(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,z){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:U,description:I,inputSchema:Q,outputSchema:J,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,U,I,Rw(Q),Rw(J),K,G,void 0,H,z)}registerPrompt($,Y,z){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:U,description:I,argsSchema:Q,icons:J,_meta:K}=Y,G=this._createRegisteredPrompt($,U,I,Rw(Q),z,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()}},Ze,VH;var VS=o(()=>{_w();xw();Me=Symbol.for("mcp.completable");$i0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);Ki0=new Set(["tools/call","prompts/get","resources/read"]);Pe=class extends th{_clientCapabilities;_clientVersion;static{Gi0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},De=($,Y)=>{let z=Y.filter((U)=>!$._supportedProtocolVersions.includes(U));if(z.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...z];$.setRequestHandler("server/discover",()=>$._ondiscover())},Ae=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Ji0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,z)=>this._verifyRequestState($,Y,z),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 kw,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=Ii0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[z,U]of Object.entries(Y.cacheHints))if(U!==void 0)ih(U,`cacheHints['${z}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(z)=>this._oninitialize(z)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),yh(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let z=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:U}=$.params,I=Cw(A7,U);if(I.success)this._loggingLevels.set(z,I.data);return{}})}buildContext($,Y){let z=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(U,I,Q)=>{if(!this._capabilities.logging)return Promise.resolve();let J;if(this._servedModernEra()){if(J=$.mcpReq.envelope?.[F7],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(U)this.elicitInput(U,I),requestSampling:(U,I)=>this.createMessage(U,I)},http:z?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(A7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let z=this._loggingLevels.get(Y);return z?this.LOG_LEVEL_SEVERITY.get($){let J=await Y(I,Q);if(r9(J))throw new Q1(n0.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=U?await this._invokeInputRequiredCapableHandler($,Y,I,Q):await Y(I,Q);if(r9(J)){if(!U)throw new Q1(n0.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 z===void 0?J:Dw(J,z)}}return async(z,U)=>{let I=B7(this._negotiatedProtocolVersion),Q=I.validateRequest("tools/call",z);if(!Q.ok)throw new Q1(Q.reason==="not-in-era"?n0.InternalError:n0.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,z,U);if(r9(J))return J;let K=kh(J),G=I.validateResult("tools/call",K);if(!G.ok)throw new Q1(G.reason==="not-in-era"?n0.InternalError:n0.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&&vI(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,z,U){let I=this._servedModernEra(),Q=U.mcpReq.requestState();if(Q!==void 0&&typeof Q!=="string")throw new Q1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let J=U;if(typeof Q==="string"){let X=await this._verifyRequestState(Q,U,$);if(X!==void 0)J=sh(U,X)}let K;try{K=await Y(z,J)}catch(X){if(X instanceof Q1&&X.code===n0.UrlElicitationRequired){if(!I)throw X;throw new Q1(n0.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(!r9(K))return K;if(!I){if(!this._inputRequiredServing.legacyShim)throw new Q1(n0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??gY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,z,J,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new Q1(n0.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(U);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=Ne($,Z,q),M=Nw(F,X);if(M!==void 0)throw new Pw({requiredCapabilities:M},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,z){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(U){throw this.onerror?.(Error(`requestState verification rejected ${z}: ${U instanceof Error?U.message:String(U)}`)),new Q1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[l9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new V1(A1.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 V1(A1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new V1(A1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new V1(A1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.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 V1(A1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new V1(A1.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 V1(A1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new V1(A1.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 z=qt(this._supportedProtocolVersions),U=z.includes(Y)?Y:z[0]??gY;return this._negotiatedProtocolVersion=U,this.transport?.setProtocolVersion?.(U),{protocolVersion:U,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:yh(this._supportedProtocolVersions),capabilities:Hi0(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 V1(A1.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 Q1(n0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new Q1(n0.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 Q1(n0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let z=Boolean($.tools||$.toolChoice),U=await this.request({method:"sampling/createMessage",params:$},Y),I=this._wireCodec().samplingResultVariant(z,U);if(!I.ok)throw new V1(A1.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 V1(A1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new V1(A1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,z){let U=$.mode??"form",I=z?.validateAcceptedContent??!0;switch(U){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 Q1(n0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof Q1)throw K;throw new Q1(n0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return J}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.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"})}};Ze={type:"object",properties:{}};VH={completion:{values:[],hasMore:!1}}});var Be=o(()=>{VS();_w();xw()});function qi0($){let Y=$.params;if($.method==="initialize"&&!lh(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(!Bw(Y))return{kind:"legacy",reason:"no-claim"};let z=bY(Y),U=(z===void 0?[]:jw(z))[0];if(U!==void 0)return{kind:"invalid-envelope",issue:U};let I=Tw(Y);if(I===void 0||!T7.includes(I))return{kind:"unsupported-revision",requested:I??"unknown"};return{kind:"modern",revision:I,classification:{era:"modern",revision:I}}}function je($,Y={}){let z=Y.legacy??"serve",U=Y.transport??new Xi0,I={phase:"opening"},Q,J=!1,K=()=>J||I.phase==="closed",G=(j)=>{try{Y.onerror?.(j)}catch{}},H=(j,C,b,k)=>U.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...k!==void 0&&{data:k}}}).catch((h)=>G(Q5(h))),W=new Oe(Y.maxSubscriptions??fw),X=(j)=>{if(!j7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)U.send({jsonrpc:"2.0",...b}).catch((k)=>G(Q5(k)));return"handled"},Z=async(j)=>{if(D$(j)&&j.method==="subscriptions/listen"){let C=bY(j.params),b=Bw(j.params)?(C===void 0?[]:jw(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},k=Tw(j.params),h;if(b!==void 0)h={jsonrpc:"2.0",id:j.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(k===void 0||!T7.includes(k)){let i=new hI({supported:[...T7],requested:k??"unknown"});h={jsonrpc:"2.0",id:j.id,error:{code:i.code,message:i.message,data:i.data}}}else h=W.serve(j);return await U.send("error"in h?h:{jsonrpc:"2.0",method:h.method,params:h.params}).catch((i)=>G(Q5(i))),!0}if(j7(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 k=oh({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},T7);if(k===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${k.cell}): ${k.message}`)),H(j.id,k.code,k.message,k.data)},V=(j)=>{if(J||j===Q)return;T()},F=async(j,C)=>{let b=await $({era:j}),k=b instanceof LH?b.server:b;if(j==="modern")ah(k,C),ZS(k,T7),W.setServerCapabilities(k.getCapabilities(),qS(k));let h=new Zi0(U,()=>V(h),j==="modern"?X:void 0);return await b.connect(h),{product:b,channel:h}},M=(j)=>j.product.close().catch((C)=>G(Q5(C))),w=async(j)=>{Q=j.channel;try{if(!await j.channel.whenRequestsAnswered(Te))G(Error(`Discarded the probe instance with requests still unanswered after ${Te}ms; continuing with the fallback`));await j.product.close()}catch(C){G(Q5(C))}finally{Q=void 0}},O=async(j)=>{if(I.phase==="closed")return;if(I.phase==="pinned"){if(I.era==="modern"&&D$(j)&&j.method==="initialize"&&!lh(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(!D$(j)&&!j7(j)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=qi0(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(D$(j))await H(j.id,n0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(D$(j)){let b=new hI({supported:[...T7],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(D$(j)&&j.method==="server/discover"){if(I.phase==="probe"){I.instance.channel.deliver(j,{classification:C.classification});return}let b=await F("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(j7(j)){I.instance.channel.deliver(j,{classification:C.classification});return}I={phase:"pinned",era:"modern",instance:I.instance}}else{let b=await F("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(z==="reject"){if(D$(j))await q(j,C.reason,C.requestedVersion);return}if(I.phase==="probe"){if(await w(I.instance),K())return;I={phase:"opening"}}let b=await F("legacy");if(K()){await M(b);return}I={phase:"pinned",era:"legacy",instance:b},I.instance.channel.deliver(j);return}}},D=[],N=!1,B=async()=>{if(N)return;N=!0;try{while(D.length>0){let j=D.shift();try{await O(j)}catch(C){if(D$(j))await H(j.id,n0.InternalError,"Internal server error");G(Q5(C))}}}finally{N=!1}},T=async()=>{if(J||I.phase==="closed")return;J=!0;let j=I;I={phase:"closed"};for(let C of W.teardownAll())await U.send(C).catch((b)=>G(Q5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(Q5(C)));await U.close().catch((C)=>G(Q5(C)))};U.onmessage=(j)=>{D.push(j),B()},U.onerror=(j)=>{if(G(j),I.phase==="probe"||I.phase==="pinned")I.instance.channel.onerror?.(j)},U.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(Q5(C)))};let A=U.start().catch((j)=>{throw G(Q5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function Q5($){return $ instanceof Error?$:Error(String($))}var Xi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=HS.stdin,Y=HS.stdout,z){this._stdin=$,this._stdout=Y,this._readBuffer=new $S({maxBufferSize:z?.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,z)=>{let U=YS($),I=!1,Q=(K)=>{if(I)return;I=!0,this._stdout.off("error",Q),this._stdout.off("drain",J),z(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(U)){if(I)return;I=!0,this._stdout.off("error",Q),Y()}else if(!I)this._stdout.once("drain",J)})}},Te=3000,Zi0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,z){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=z}async start(){}async send($,Y){if(HH($)||Ew($)){let{id:z}=$;if(z!==void 0)this._settle(z)}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(D$($))this._pendingRequests.add($.id);else if(j7($)&&$.method==="notifications/cancelled"){let z=$.params?.requestId;if(z!==void 0)this._settle(z)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let z=()=>{clearTimeout(U),Y(!0)},U=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((I)=>I!==z),Y(!1)},$);this._drainWaiters.push(z)})}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 Ee=o(()=>{VS();_w();xw()});var A$=o(()=>{BL();BL()});var s9;var FH=o(()=>{s9=class s9 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var uw=o(()=>{FH();D6=class D6 extends s9{name="HTTPError";response;request;options;data;constructor($,Y,z){let U=$.status||$.status===0?$.status:"",I=$.statusText??"",Q=`${U} ${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=z}}});var wH;var LS=o(()=>{FH();wH=class wH extends s9{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var MH;var FS=o(()=>{MH=class MH 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 yI;var Ce=o(()=>{FH();FS();yI=class yI extends s9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new MH($.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 wS;var Re=o(()=>{wS=class wS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var J5;var bw=o(()=>{FH();J5=class J5 extends s9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class pw{options;constructor($){this.options=$}}var MS,_e,iw,ve,he,cw,Vi0=()=>{return},Se,kI=2147483647,ge=40,nw,ye=($)=>new pw($),ke,xe;var iY=o(()=>{MS=(()=>{let $=!1,Y=!1,z=typeof globalThis.ReadableStream==="function",U=typeof globalThis.Request==="function";if(z&&U)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})(),_e=typeof globalThis.AbortController==="function",iw=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",ve=typeof globalThis.ReadableStream==="function",he=typeof globalThis.FormData==="function",cw=["get","post","put","patch","head","delete"];Vi0();Se={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},nw=Symbol("stop");ke={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},xe={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 dw,Li0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[z,U]of $)Y+=ge,Y+=dw.encode(`Content-Disposition: form-data; name="${z}"`).byteLength,Y+=typeof U==="string"?dw.encode(U).byteLength:U.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return dw.encode($).byteLength;if($ instanceof URLSearchParams)return dw.encode($.toString()).byteLength;return 0},fe=($,Y,z)=>{let U,I=0;return $.pipeThrough(new TransformStream({transform(Q,J){if(J.enqueue(Q),U){I+=U.byteLength;let K=Y===0?0:I/Y;if(K>=1)K=1-Number.EPSILON;z?.({percent:K,totalBytes:Math.max(Y,I),transferredBytes:I},U)}U=Q},flush(){if(U)I+=U.byteLength,z?.({percent:1,totalBytes:Math.max(Y,I),transferredBytes:I},U)}}))},ue=($,Y)=>{if(!$.body)return $;let z={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,z);let U=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(fe($.body,U,Y),z)},be=($,Y,z)=>{if(!$.body)return $;let U=Li0(z??$.body);return new Request($,{duplex:"half",body:fe($.body,U,Y)})};var ie=o(()=>{iY();dw=new TextEncoder});var d5=($)=>$!==null&&typeof $==="object";function OH($,Y,z){return Object.hasOwn(Y,z)&&Y[z]===void 0?[]:AS($[z]??[],Y[z]??[])}var Fi0,OS=($)=>d5($)&&$[Fi0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},NH=(...$)=>{for(let Y of $)if((!d5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return AS({},...$)},DS=($={},Y={})=>{let z=new globalThis.Headers($),U=Y instanceof globalThis.Headers,I=new globalThis.Headers(Y);for(let[Q,J]of I.entries())if(U&&J==="undefined"||J===void 0)z.delete(Q);else z.set(Q,J);return z},NS=($)=>{if(!d5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},xI=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),z=$[C7];if(z)Y[C7]=new Set(z);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(NS($))return{...$};return $},wi0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),Mi0=($,Y)=>{if(NS($)&&NS(Y))return wi0({...$,...Y});return DS($,Y)},mw=($={},Y={})=>({init:OH($,Y,"init"),beforeRequest:OH($,Y,"beforeRequest"),beforeRetry:OH($,Y,"beforeRetry"),beforeError:OH($,Y,"beforeError"),afterResponse:OH($,Y,"afterResponse")}),C7,Oi0=($,Y)=>{let z=new URLSearchParams,U=new Set;for(let I of[$,Y]){if(I===void 0)continue;if(I instanceof URLSearchParams){for(let[J,K]of I.entries())z.append(J,K),U.delete(J);let Q=I[C7];if(Q)for(let J of Q)z.delete(J),U.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");z.append(String(Q[0]),String(Q[1])),U.delete(String(Q[0]))}else if(d5(I))for(let[Q,J]of Object.entries(I))if(J===void 0)z.delete(Q),U.add(Q);else z.append(Q,String(J)),U.delete(Q);else{let Q=new URLSearchParams(I);for(let[J,K]of Q.entries())z.append(J,K),U.delete(J)}}if(U.size>0)z[C7]=U;return z},AS=(...$)=>{let Y={},z={},U={},I,Q=[];for(let J of $)if(Array.isArray(J)){if(!Array.isArray(Y))Y=[];Y=[...Y,...J]}else if(d5(J)){for(let[K,G]of Object.entries(J)){if(K==="signal"&&G instanceof globalThis.AbortSignal){Q.push(G);continue}let H=OS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!d5(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:Oi0(I,G);continue}if(d5(G)&&!W&&K in Y)G=AS(Y[K],G);Y={...Y,[K]:G}}if(d5(J.hooks)){let{value:K,isReplace:G}=OS(J.hooks);U=G?mw({},K):mw(U,K),Y.hooks=U}if(d5(J.headers)){let{value:K,isReplace:G}=OS(J.headers);z=G?xI(K):Mi0(z,K),Y.headers=z}}if(I!==void 0)Y.searchParams=I;if(Q.length>0)if(Q.length===1)Y.signal=Q[0];else if(iw)Y.signal=AbortSignal.any(Q);else Y.signal=Q.at(-1);return Y};var lw=o(()=>{iY();Fi0=Symbol("replaceOption");C7=Symbol("deletedParameters")});var ne=($)=>cw.includes($)?$.toUpperCase():$,Ni0,Di0,Ai0,ce,pe=($={})=>{if(typeof $==="number")return{...ce,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((z)=>z.toLowerCase())}).filter(([,z])=>z!==void 0));return{...ce,...Y}};var de=o(()=>{iY();Ni0=["get","put","head","delete","options","trace"],Di0=[408,413,429,500,502,503,504],Ai0=[413,429,503],ce={limit:2,methods:Ni0,statusCodes:Di0,afterStatusCodes:Ai0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function PS($,Y,z,U){return new Promise((I,Q)=>{let J=setTimeout(()=>{if(z)z.abort();Q(new J5($))},U.timeout);U.fetch($,Y).then(I).catch(Q).then(()=>{clearTimeout(J)})})}var me=o(()=>{bw()});async function ow($,{signal:Y}){return new Promise((z,U)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",I,{once:!0});function I(){clearTimeout(Q),U(Y.reason)}let Q=setTimeout(()=>{Y?.removeEventListener("abort",I),z()},$)})}var le=($)=>{let Y={};for(let z in $){if(!Object.hasOwn($,z))continue;if(!(z in xe)&&!(z in ke))Y[z]=$[z]}return Y},oe=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[C7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var re=o(()=>{iY();lw()});function BS($){if(!($&&Bi0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:z,stack:U}=$;if(z==="Load failed")return U===void 0||"__sentry_captured__"in $;if(z.startsWith("error sending request for url"))return!0;if(z==="Failed to fetch"||z.startsWith("Failed to fetch (")&&z.endsWith(")"))return!0;return Ti0.has(z)}var Pi0,Bi0=($)=>Pi0.call($)==="[object Error]",Ti0;var se=o(()=>{Pi0=Object.prototype.toString,Ti0=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 ae($){return TS($,D6)}function te($){return TS($,wH)}function ee($){return TS($,J5)}var TS=($,Y)=>$ instanceof Y||$?.name===Y.name;var $00=o(()=>{uw();LS();bw()});function vi0($){let Y={...$,json:xI($.json),context:xI($.context),headers:xI($.headers),searchParams:_i0($.searchParams)};if($.retry!==void 0)Y.retry=Ri0($.retry);return Y}class fI{static create($,Y){let z=Y.hooks?.init??[],U=z.length>0?vi0(Y):Y;for(let K of z)K(U);let I=new fI($,U),Q=async()=>{if(typeof I.#$.timeout==="number"&&I.#$.timeout>kI)throw RangeError(`The \`timeout\` option cannot be greater than ${kI}`);if(typeof I.#$.totalTimeout==="number"&&I.#$.totalTimeout>kI)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${kI}`);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(AH(G))try{G=await I.#y(G)}catch(X){if(!(X instanceof yI))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(!AH(G))return G;if(I.#V(G),I.#$.onDownloadProgress){if(typeof I.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!ve)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return I.#K(G),ue(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(Se)){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=U.parseJson?await U.parseJson(X,{request:I.#O(W),response:W}):JSON.parse(X);return H===void 0?Z:U00(Z,H)}}return J}static#U($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#z;#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(Ei0);if(this.#$={...Y,headers:DS(this.#Y.headers,Y.headers),hooks:mw({},Y.hooks),method:ne(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:pe(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 U=this.#$.prefix.replace(/\/+$/,""),I=this.#Y.replace(/^\/+/,"");this.#Y=`${U}/${I}`}if(this.#$.baseUrl){let U;try{U=new URL(this.#Y)}catch{}if(!U)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if(_e&&iw)this.#H=this.#$.signal??this.#Y.signal,this.#z=new globalThis.AbortController,this.#$.signal=this.#w();if(MS)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 z=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(he&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!z)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),oe(this.#$.searchParams)){let U=new URL(this.request.url),I=this.#$.searchParams?.[C7];if(I)for(let Q of I)U.searchParams.delete(Q);if(typeof this.#$.searchParams==="string"){let Q=this.#$.searchParams.replace(/^\?/,"");if(Q!=="")U.search=U.search?`${U.search}&${Q}`:`?${Q}`}else{let Q=new URLSearchParams(fI.#U(this.#$.searchParams));for(let[J,K]of Q.entries())U.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)U.searchParams.delete(Q)}this.request=new globalThis.Request(U,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#B($){if(this.#I>=this.#$.retry.limit)throw $;let Y=$ instanceof Error?$:new MH($);if(Y instanceof yI)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let z=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#I+1});if(z===!1)throw $;if(z===!0)return this.#G()}if(ee($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(ae($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let z=$.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(z&&this.#$.retry.afterStatusCodes.includes($.response.status)){let U=Number(z)*1000;if(Number.isNaN(U))U=Date.parse(z)-Date.now();else if(U>=Date.parse("2024-01-01"))U-=Date.now();if(!Number.isFinite(U))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return U=Math.max(0,U),Math.min(this.#$.retry.maxRetryAfter,U)}if($.response.status===413)throw $;return this.#G()}if(!te($))throw $;return this.#G()}#V($){let Y=this.#O($);if(this.#$.parseJson)$.json=async()=>{let z=await $.text();if(z==="")return JSON.parse(z);return this.#$.parseJson(z,{request:Y,response:$})};return $}async#L($){let Y=await this.#T($,this.#D());if(Y===DH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let z=await this.#j(Y,$,this.#D(),this.#O($));if(z===DH){this.#q();return}return z}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#P();if(Y===void 0)return $;if(Y<=0)throw new J5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#T($,Y){let{body:z}=$;if(!z)try{return await $.text()}catch{return}let U;try{U=z.getReader()}catch{return}let I=Ci0($.headers.get("content-type")??""),Q=[],J=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await U.read();if(W)break;if(J+=X.byteLength,J>ji0){U.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(DH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===DH)U.cancel().catch(()=>{return});return H}async#j($,Y,z,U){let I;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:U,response:Y}):JSON.parse($)),new Promise((Q)=>{I=setTimeout(()=>{Q(DH)},z)})])}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.#z.signal]):this.#z.signal}#q(){let $=this.#P();if($!==void 0&&$<=0)throw new J5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#M(),retryCount:0});if(z00(Y))this.#_(Y);else if(AH(Y))return Y}return}async#y($){let Y=this.#O($);for(let z of this.#$.hooks.afterResponse){let U=this.#v($.clone(),Y);this.#V(U);let I;try{I=await z({request:this.request,options:this.#M(),response:U,retryCount:this.#I})}catch(J){if(U!==$)this.#K(U);throw this.#K($),J}if(I instanceof pw){if(U!==$)this.#K(U);throw this.#K($),new yI(I.options)}let Q=AH(I)?this.#v(I,Y):$;if(U!==$&&U!==Q&&U.body!==Q.body)this.#K(U);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 z=Math.min(await this.#B($),kI),U={signal:this.#H},I=this.#P();if(I!==void 0){if(I<=0)throw new J5(this.request);if(z>=I)throw await ow(I,U),new J5(this.request)}if(await ow(z,U),this.#q(),$ instanceof yI&&$.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(z00(J)){this.#_(J);break}if(AH(J))return this.#Z=!0,this.#I++,J;if(J===nw)return}return this.#q(),this.#I++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#z?.signal.aborted)this.#z=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=le(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,z=this.#k(this.request,this.#$.body??void 0);if(this.#W=z,Y)this.request=Y;try{let U=this.#P();if(U!==void 0&&U<=0)throw new J5(this.request);let I=this.#$.timeout===!1?U:U===void 0?this.#$.timeout:Math.min(this.#$.timeout,U),Q=I===void 0?await this.#$.fetch(z,$):await PS(z,$,this.#z,{timeout:I,fetch:this.#$.fetch});return this.#v(Q,z)}catch(U){if(BS(U))throw new wH(this.request,{cause:U});throw U}}#P(){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:z,stringifyJson:U,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||!MS)return $;return be($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var ji0=10485760,Ei0="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",DH,Ci0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),z=Y?.[1]??Y?.[2];if(z)try{return new TextDecoder(z)}catch{}return new TextDecoder},Y00="The `schema` argument must follow the Standard Schema specification",Ri0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},I00,z00=($)=>$ instanceof globalThis.Request||I00.call($)==="[object Request]",AH=($)=>$ instanceof globalThis.Response||I00.call($)==="[object Response]",_i0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return xI($)},U00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(Y00);let z=Y["~standard"];if(typeof z!=="object"||z===null||typeof z.validate!=="function")throw TypeError(Y00);let U=await z.validate($);if(U.issues)throw new wS(U.issues);return U.value};var Q00=o(()=>{uw();LS();FS();Ce();Re();bw();ie();lw();de();me();re();se();$00();iY();DH=Symbol("timedOutResponseData"),I00=Object.prototype.toString});var jS=($)=>{let Y=(z,U)=>fI.create(z,NH($,U));for(let z of cw)Y[z]=(U,I)=>fI.create(U,NH($,I,{method:z}));return Y.create=(z)=>jS(NH(z)),Y.extend=(z)=>{if(typeof z==="function")z=z($??{});return jS(NH($,z))},Y.stop=nw,Y.retry=ye,Y},hi0,K5;var uI=o(()=>{Q00();iY();lw();uw();/*! MIT License © Sindre Sorhus */hi0=jS(),K5=hi0});async function J00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,z=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:z?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:z?.tenantId,tenantSlug:$.seal.tenantSlug??z?.tenantSlug,tenantName:z?.tenantName,raw:{sourceType:$.source.type}}}}function Si0($){let Y=Object.entries($??{}).map(([z,U])=>`${z}=${U}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},z=Si0($?.cookies);if(z)Y.Cookie=z;return Y}var K00,gi0,yi0,ki0,xi0,G00;var H00=o(()=>{A$();K00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),gi0=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()}),yi0=L.object({token:L.string(),expiresAt:L.number(),enterprise:gi0}),ki0=L.object({openapi:K00.optional(),closeapi:K00.optional()}),xi0=L.object({seal:yi0.optional(),hose:ki0.optional()}),G00=L.record(L.string(),xi0)});import{existsSync as ES,mkdirSync as fi0,readFileSync as ui0,writeFileSync as bi0}from"node:fs";import{dirname as ii0,join as X00}from"node:path";import{homedir as Z00}from"node:os";function ci0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if(ES(rw))return rw;if(ES(W00))return W00;return rw}function ni0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return rw}function bI(){let $=ci0();if(!ES($))return{};try{return G00.parse(JSON.parse(ui0($,"utf-8")))}catch{return{}}}function sw($){let Y=ni0();fi0(ii0(Y),{recursive:!0,mode:448}),bi0(Y,JSON.stringify($,null,2),{mode:384})}function q00($){return bI()[$]?.seal}function V00($,Y){let z=bI();sw({...z,[$]:{...z[$],seal:Y}})}function L00($){let Y=bI(),z=Y[$];if(!z)return;sw({...Y,[$]:{...z,seal:void 0}})}function PH($){return bI()[$]?.hose??{}}function CS($,Y){let z=bI();sw({...z,[$]:{...z[$],hose:Y}})}function aw($){let Y=bI();delete Y[$],sw(Y)}var rw,W00;var BH=o(()=>{H00();rw=X00(Z00(),".config","seal-use","seal_tokens.json"),W00=X00(Z00(),".config","seal-home","seal_tokens.json")});function P$($){return $.replace(/\/+$/,"")}function M00($){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||!li0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==mi0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let z=Y.searchParams.getAll("accessToken").filter(Boolean),U=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(z.length!==1||U.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let I=U[0].trim().toLowerCase();if(!w00.test(I))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:I,accessToken:z[0],baseUrl:Y.origin}}async function tw($,Y){let z=typeof $==="string"?M00($):O00($),U=`https://${z.corpId}.sealai.cc`,Q=await T8(U,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:z.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:z.corpId,sealUrl:U,token:J,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function ew($,Y){let z=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,U=[Y.tenantSlug,z?.corporationId].filter((J)=>typeof J==="string"&&Boolean(J)),I=$.trim().toLowerCase(),Q=U.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 li0($){let Y=$.toLowerCase();return di0.some((z)=>Y.endsWith(z))}function O00($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",z=typeof $?.accessToken==="string"?$.accessToken.trim():"",U=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!w00.test(Y)||!z)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:z,...U?{baseUrl:U}:{}}}function N00($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function R7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function oi0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function D00($){return K5.create({prefix:P$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let z=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${z?`: ${z}`:""}`,Y}]}})}async function ri0($){let Y=D00($),z=$.appKey??$.key,U=$.appSecurity??$.password;if(!z||!U)throw Error("Hose source requires appKey/key and appSecurity/password");let I=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:z,appSecurity:U}}).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 iI($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=PH($.id);if(N00(Y.openapi))return Y.openapi.token;let z=RS.get($.id);if(z)return z;let U=ri0($.source).then((I)=>{return CS($.id,{...PH($.id),openapi:I}),I.token}).finally(()=>RS.delete($.id));return RS.set($.id,U),U}async function $M($,Y,z=7200){let U=D00($),I=oi0($),J=(await U.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:I,pageType:"home",expireDate:z}}).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()+z*1000}}async function TH($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source,z=PH($.id);if(N00(z.closeapi)&&z.closeapi.url)return z.closeapi;let U=_S.get($.id);if(U)return U;let I=iI($).then((Q)=>$M(Y,Q)).then((Q)=>{return CS($.id,{...PH($.id),closeapi:Q}),Q}).finally(()=>_S.delete($.id));return _S.set($.id,I),I}async function A00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=(await TH($)).url;if(!Y)throw Error("Hose provisional auth URL was not available");return Y}async function P00($,Y=7200,z){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 U=await iI($),I=await $M($.source,U,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 B00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await TH($),z=R7($,$.source),U=A6($.seal),Q=await T8(z,void 0,U).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:P$(z),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:P$($.source.domain)}};return{token:J,expiresAt:Date.now()+K*1000,enterprise:G}}async function cI($,Y,z){if(z){let J=P$(z),K=await F00(J,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${J}. Please verify appKey/appSecurity and domain connectivity.`);return K}let U=pi0.map(async(J)=>{try{return await F00(J,$,Y)}catch{return}}),Q=(await Promise.all(U)).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 F00($,Y,z){try{let U=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:z}),signal:AbortSignal.timeout(8000)});if(!U.ok)return;let I=await U.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 YM($,Y){let z=`${P$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,U=await fetch(z,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!U.ok){let J=await U.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${U.status} ${J}`)}return((await U.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 vS($,Y,z,U="id"){let I=z.startsWith("$")?z.slice(1):z,Q=`${P$($)}/api/openapi/v1/roledefs/$${I}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(U)}&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 hS($,Y,z){if(z.length===0)return[];let U=`${P$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,I=await fetch(U,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:z.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 SS($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function si0($){let Y=typeof $==="string"?M00($):O00($),z=Y.baseUrl||"https://app.ekuaibao.com",U,I,Q,J,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await K5.get(`${z}/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")U=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(!U||!I)try{let W=(await K5.get(`${z}/api/account/v2/session`,{headers:{...G,...U?{staffid:U}:{}},timeout:1e4}).json())?.value;if(W){if(!U&&W.loginStaffId)U=W.loginStaffId;if(!I&&W.corporationName)I=W.corporationName;if(!Q&&W.privilege)Q=W.privilege}}catch{}if(!U)U=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:z,accessToken:Y.accessToken,staffId:U,corpName:I,staffName:Q,isAdmin:J,cellphone:K}}async function gS($){let Y=await si0($),z={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},U;try{U=await(await K5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:z,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=U.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 pi0,di0,mi0="/web/thirdparty.html",w00,RS,_S;var a9=o(()=>{uI();i8();BH();pi0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],di0=[".ekuaibao.com",".hosecloud.com"],w00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,RS=new Map,_S=new Map});function T00($,Y){return Date.now()>=$.expiresAt-Y*1000}async function ai0($){switch($.source.type){case"hose":return B00($);case"direct":case"seal":return J00($)}}async function UM($){let Y=$.auth.refreshTtl,z=zM.get($.id);if(z&&!T00(z,Y))return z;let U=q00($.id);if(U&&!T00(U,Y))return zM.set($.id,U),U;let I=await ai0($);return zM.set($.id,I),V00($.id,I),I}async function j00($){return(await UM($)).enterprise}function E00($){zM.delete($),L00($)}var zM;var yS=o(()=>{a9();BH();zM=new Map});var R00={};x8(R00,{createSealClientForUrl:()=>T8,createSealClientForToken:()=>kS,createSealClient:()=>j1});function ti0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function ei0($){if(!($ instanceof D6))return $;let Y=ti0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function C00($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)E00($);return ei0(Y)}}async function j1($){let Y=await UM($);return K5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[C00($.id)]}})}async function kS($,Y){let z=await UM($);return T8(z.enterprise.sealUrl,Y,A6($.seal))}function T8($,Y,z={}){let U={...z};if(Y)U.Authorization=`Bearer ${Y}`;return K5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:U,hooks:{beforeError:[C00()]}})}var i8=o(()=>{uI();yS()});var jH;var _00=o(()=>{jH={name:"seal-use",version:"0.10.30",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","seal-home":"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","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 v00}from"node:child_process";function Yc0($,Y=jH.version){let z=$.trim();if(!z)return null;let U=z.endsWith("-dirty"),I=U?z.slice(0,-6):z,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:U,describe:z};let J=I.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(J&&J[1])return{baseVersion:J[1],commitsAhead:0,commit:"",dirty:U,describe:z};let K=I.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:U,describe:z};return null}function zc0($,Y,z,U){let Q=z?`+g${z}${U?".dirty":""}`:U?"+dirty":"";return`${$}-dev.${Y}${Q}`}function Uc0($){let Y=$?.env,z=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,U=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(z){let Z=U==="true",V={name:"seal-use",version:z,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||z};return V}if(U==="true"||W==="1")return{name:"seal-use",version:jH.version,channel:"release",isRelease:!0};try{let Z=v00("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=Yc0(Z.stdout.trim(),jH.version);if(q){if(!q.commit){let F=v00("git",["rev-parse","--short","HEAD"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(F.status===0&&F.stdout)q.commit=F.stdout.trim()}return{name:"seal-use",version:zc0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${jH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var EH,P1,xS,qc1;var t9=o(()=>{_00();EH=Uc0(),P1=EH.version,xS=EH.isRelease,qc1=EH.channel});function nI($=void 0){return uS.parse($??{})}function g00($,Y){return nI({...nI($),...Y})}var h00,fS,S00,uS,bS;var pI=o(()=>{A$();h00=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],fS={minFileSizeBytes:500,allowedExtensions:[...h00]},S00=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"}),uS=L.object({minFileSizeBytes:L.number().int().min(0).default(fS.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(S00).min(1).default([...h00]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),bS=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(S00).min(1).transform(($)=>[...new Set($)])}).optional()});var Ic0,Qc0,Jc0,Kc0,k00,Gc0,Hc0,x00,IM,f00,Wc0,QM,u00,RH,b00,Xc0,Zc0,qc0,y00,_H,i00,Vc0,Lc0,JM,iS,c00,n00,p00,d00,KM,m00,cS,nS,l00,o00,Fc0,r00,wc0,s00,CH,a00,t00,e00,$10,Y10,z10,U10,I10,Q10,J10,K10,Mc0,G10,Oc0,Nc0,Dc0,pS,dS,Ac0,H10,W10,X10,Z10,Pc0,mS,Oc1,Nc1,q10,Dc1;var lS=o(()=>{A$();pI();Ic0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Qc0=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:Ic0.optional()}),Jc0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),Kc0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:Jc0.optional()}),k00=L.object({user:Qc0,tenant:Kc0}),Gc0=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(),Hc0=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(),x00=L.object({user:Gc0,session:Hc0}),IM=L.object({id:L.string(),tenantId:L.string().optional(),code:L.number().optional(),description:L.string(),scope:L.string(),strictness:L.string(),status:L.string().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional()}),f00=L.object({rules:L.array(IM),hasPendingDeletes:L.boolean().default(!1)}),Wc0=L.object({code:L.string().optional(),description:L.string(),scope:L.string(),strictness:L.string()}),QM=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(Wc0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}),u00=L.object({version:QM,rulesCount:L.number()}),RH=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)}),b00=L.object({articles:L.array(RH),total:L.number().optional()}),Xc0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),Zc0=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(),qc0=L.enum(["assisted","semi_automatic","fully_automatic"]),y00=L.object({id:L.string(),url:L.string().url()}).passthrough(),_H=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:qc0,incomingDocumentWebhook:y00,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:y00,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:uS.default(fS)}).passthrough(),i00=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:Xc0.optional(),integrationSystem:L.string().optional(),integrations:L.array(Zc0).default([])}).passthrough(),Vc0=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(),Lc0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),JM=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:Vc0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:Lc0.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(),iS=L.object({records:L.array(JM).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),c00=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(),n00=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),p00=L.object({userId:L.string(),password:L.string()}).passthrough(),d00=L.object({password:L.string()}).passthrough(),KM=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(),m00=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(KM).default([])}).passthrough(),cS=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(),nS=L.object({items:L.array(cS).default([])}).passthrough(),l00=L.object({items:L.array(KM).default([])}).passthrough(),o00=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),Fc0=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(),r00=L.object({tagStats:L.array(Fc0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),wc0=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(),s00=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array(wc0).default([]),total:L.number().default(0)}).passthrough(),CH=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),a00=L.object({metrics:L.object({approvalCount:CH.optional(),accuracy:CH.optional(),automationRate:CH.optional(),riskCount:CH.optional(),avgDuration:CH.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(),t00=L.record(L.string(),L.unknown()),e00=L.object({expenses:L.array(t00).default([]),total:L.number().optional()}).passthrough(),$10=L.object({invoices:L.array(t00).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),Y10=L.record(L.string(),L.unknown()),z10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),U10=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(),I10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),Q10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),J10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),K10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Mc0=L.object({columns:L.array(K10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),G10=L.object({id:L.string().optional(),listSheets:L.array(Mc0).default([]),mainColumns:L.array(K10).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(),Oc0=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:G10.optional()}).passthrough(),Nc0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),Dc0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),pS=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:Oc0.optional(),requestSummary:Nc0.nullable().optional(),resultSummary:Dc0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),dS=L.object({batchId:L.string()}).passthrough(),Ac0=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(),H10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Ac0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),W10=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(),X10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),Z10=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:G10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Pc0=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(),mS=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:Pc0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),Oc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(mS).default([])}).passthrough(),Nc1=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(),q10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),Dc1=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 F10}from"node:crypto";async function M1($,Y){let z=await $.json();return Y.parse(z.data??z)}async function W8($){return M1(await $.get("api/v1/auth/me"),k00)}async function M10($){return M1(await $.get("api/auth/get-session"),x00)}async function p6($){return M1(await $.get("api/v1/rules"),f00)}async function hH($,Y){return M1(await $.post("api/v1/rules",{json:Y}),IM)}async function oS($,Y,z){return M1(await $.put(`api/v1/rules/${Y}`,{json:z}),IM)}async function mI($,Y){await $.delete(`api/v1/rules/${Y}`)}async function XM($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),z=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:z})}async function B$($){return M1(await $.get("api/v1/rule-set-versions"),L.array(QM))}async function SH($,Y){return M1(await $.get(`api/v1/rule-set-versions/${Y}`),QM)}async function gH($,Y){return M1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),u00)}async function _7($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??20)),z.set("sortBy",Y.sortBy??"createdAt"),z.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((U,I)=>{z.set(`filter[scenarios][${I}]`,U)}),M1(await $.get("api/v1/knowledge/articles",{searchParams:z}),b00)}async function O10($,Y){return M1(await $.get(`api/v1/knowledge/articles/${Y}`),RH)}async function ZM($,Y){return M1(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??[]}}),RH)}async function qM($,Y,z){let U=Object.fromEntries(Object.entries(z).filter(([,I])=>I!==void 0));return M1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:U}}),RH)}async function VM($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function o1($,Y="api/v1/agent/ai-approval/config"){return M1(await $.get(Y),i00)}async function m5($,Y,z="api/v1/agent/ai-approval/config"){return await $.post(z,{json:Y}),o1($,z)}async function rS($,Y,z="api/v1/agent/ai-approval/config"){let U=await $.post(z,{json:Y}),I=await U.json().catch(()=>({})),Q=WM.safeParse(I.data??I);return Q.success?Q.data.success??U.ok:U.ok}async function Q$($,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y);return sS(z.integrations)}async function LM($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=sS(I.integrations),J=j10(Y,Q,z);if(!await rS($,{...I,integrations:[...I.integrations,J]},U))throw Error("Seal did not confirm saving the Webhook integration");return J}async function N10($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=sS(I.integrations),J=j10(Y,Q,z);return{before:I,after:{...I,integrations:[...I.integrations,J]},integration:J}}async function D10($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=FM(I.integrations),J=wM(Q,Y),K=E10(J.integration,z);if(!await rS($,{...I,integrations:I.integrations.map((H,W)=>W===J.index?K:H)},U))throw Error("Seal did not confirm saving the Webhook integration");return K}async function A10($,Y,z,U="api/v1/agent/ai-approval/config"){let I=await o1($,U),Q=FM(I.integrations),J=wM(Q,Y),K=E10(J.integration,z);return{before:I,after:{...I,integrations:I.integrations.map((G,H)=>H===J.index?K:G)},integration:K}}async function P10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),I=FM(U.integrations),Q=wM(I,Y);if(!await rS($,{...U,integrations:U.integrations.filter((K,G)=>G!==Q.index)},z))throw Error("Seal did not confirm deleting the Webhook integration");return Q.integration}async function B10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),I=FM(U.integrations),Q=wM(I,Y);return{before:U,after:{...U,integrations:U.integrations.filter((J,K)=>K!==Q.index)},integration:Q.integration}}function v7($,Y){let z=Y.trim();if(!z)throw Error("Webhook selector must not be empty");let U=$.find((Q)=>Q.id===z);if(U)return U;let I=$.filter((Q)=>Q.name===z);if(I.length===1)return I[0];if(I.length>1)throw Error(`Multiple Webhook integrations match name: ${z}. Use the integration ID.`);throw Error(`Webhook integration not found: ${z}`)}function T10($,Y){let z=Y?.trim().toLowerCase();if(!z)return $;return $.filter((U)=>[U.id,U.name,U.mode,U.outgoingResultWebhook,U.incomingDocumentWebhook.url,U.incomingManualResultWebhook.url].some((I)=>I.toLowerCase().includes(z)))}function sS($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>_H.parse(Y))}function FM($){return $.flatMap((Y,z)=>{if(Y.type!=="webhook")return[];return[{index:z,integration:_H.parse(Y)}]})}function wM($,Y){let z=v7($.map((U)=>U.integration),Y);return $.find((U)=>U.integration.id===z.id)}function j10($,Y,z){let U=vH(z.name,"name"),I=z.mode??"assisted",Q=R10(z.outgoingResultWebhook,"outgoingResultWebhook"),J=_10(z.autoApprovalRate??60),K=jc0(Y),G=`wh_${K}_${F10(8).toString("hex").slice(0,7)}`,H=P$($);return _H.parse({type:"webhook",id:`integration-${K}`,name:U,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:z.secret?vH(z.secret,"secret"):C10(),autoApprovalRate:J,materialPackFilePolicy:nI(z.materialPackFilePolicy)})}function E10($,Y){return _H.parse({...$,...Y.name===void 0?{}:{name:vH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:R10(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:_10(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?C10():vH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:g00($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function jc0($){let Y=new Set($.map((U)=>U.id)),z=Date.now();while(Y.has(`integration-${z}`))z+=1;return z}function C10(){return F10(16).toString("hex")}function vH($,Y){let z=$.trim();if(!z)throw Error(`Webhook ${Y} must not be empty`);return z}function R10($,Y){let z=vH($,Y);try{return new URL(z).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function _10($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function MM($,Y={}){let[z,U,I]=await Promise.all([p6($),_7($,{limit:Y.documentLimit??50}),o1($,Y.stylePreferencesEndpoint).then((Q)=>({ok:!0,data:Q}),(Q)=>({ok:!1,error:Q instanceof Error?Q.message:String(Q)}))]);return{rules:z,documents:U,stylePreferences:I}}async function b4($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??50)),c8(z,"fromTimestamp",Y.fromTimestamp),c8(z,"toTimestamp",Y.toTimestamp),c8(z,"startDate",Y.startDate),c8(z,"endDate",Y.endDate),V10(z,"status",Y.status),c8(z,"sourceSystem",Y.sourceSystem),c8(z,"taskMode",Y.taskMode),c8(z,"search",Y.search),c8(z,"sourceDocumentSN",Y.sourceDocumentSN),c8(z,"sourceDocumentId",Y.sourceDocumentId),V10(z,"manualApprovalStatus",Y.manualApprovalStatus),M1(await $.get("api/v1/approvals",{searchParams:z}),iS)}async function H4($,Y){return M1(await $.get(`api/v1/approvals/${Y}`),JM)}async function aS($,Y){let z=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),U=z.data??z;if(Array.isArray(U))return L.array(JM).parse(U);return iS.parse(U).records}async function v10($,Y){return M1(await $.post("api/v1/simulation/create-batch",{json:Y}),dS)}async function h10($,Y){return M1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),dS)}async function S10($,Y={}){let z=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),U=z.data??z;return L.array(pS).parse(U)}async function OM($,Y){return M1(await $.get(`api/v1/simulation/batch/${Y}`),pS)}async function g10($){let Y=await $.get("api/v1/simulation/templates").json(),z=Y.data??Y;return L.array(H10).parse(z)}async function tS($){return M1(await $.get("api/v1/simulation/integration-status"),W10)}async function eS($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),z=Y.data??Y;return L.array(X10).parse(z)}async function y10($,Y){let U=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return U.data??U}async function k10($,Y){let z=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",U=Y?new URLSearchParams({signKey:Y}):void 0,I=await $.get(z,{searchParams:U}).json(),Q=I.data??I;return L.array(q10).parse(Q)}async function x10($,Y){let z=await $.post("api/hosecloud/corporation",{json:Y}).json(),U=z.data??z;return L.object({corporationId:L.string()}).parse(U)}async function f10($,Y){let U=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return U.data??U}async function u10($,Y){let z=new FormData;return z.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),M1(await $.post("api/v1/material-packages/upload",{body:z}),Z10)}function c8($,Y,z){if(z)$.set(Y,z)}function V10($,Y,z){if(!z)return;(Array.isArray(z)?z:[z]).map((I)=>I.trim()).filter(Boolean).forEach((I,Q)=>{$.set(`${Y}[${Q}]`,I)})}async function b10($){return M1(await $.get("api/v1/delegation/list"),L.array(c00))}async function dI($,Y){return M1(await $.post("api/v1/delegation/create",{json:Y??{}}),n00)}async function i10($,Y){let z=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),U=await z.json(),I=WM.safeParse(U.data??U);return I.success?I.data.success??z.ok:z.ok}async function c10($,Y){let z=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!z){let U=await $.get("api/v1/contacts/departments/root/children").json(),I=Bc0.safeParse(U.data??U),Q=I.success?I.data.items?.[0]?._id:void 0;if(Q)z=[Q]}return M1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:z??[]}}),p00)}async function $g($,Y){return M1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),d00)}async function GM($,Y){return M1(await $.get(`api/v1/contacts/users/${Y}`),KM)}async function HM($,Y=""){return M1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),m00)}async function n10($){return M1(await $.get("api/v1/contacts/departments/root/children"),nS)}async function p10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),cS)}async function d10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),nS)}async function m10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),l00)}async function l10($){return M1(await $.get("api/v1/contacts/last-sync-time"),o00)}async function NM($,Y={}){let z=Yg(),U=new URLSearchParams;if(c8(U,"startDate",Y.startDate??z.startDate),c8(U,"endDate",Y.endDate??z.endDate),Y.limit!==void 0)U.set("limit",String(Y.limit));return M1(await $.get("api/v1/insight/stats",{searchParams:U}),r00)}async function DM($,Y){let z=Yg(),U=new URLSearchParams;return U.set("tagId",Y.tagId),U.set("startDate",Y.startDate??z.startDate),U.set("endDate",Y.endDate??z.endDate),M1(await $.get("api/v1/insight/risks-by-tag",{searchParams:U}),s00)}async function AM($,Y={}){let z=Yg(),U=L10(Y.startDate??z.startDate),I=L10(Y.endDate??z.endDate),Q=new URLSearchParams;return Q.set("startDate",String(U)),Q.set("endDate",String(I)),M1(await $.get("api/v1/insight/performance",{searchParams:Q}),a00)}async function o10($,Y){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(Y)}`),{success:!0,recordId:Y}}function L10($){if(typeof $==="number")return $<100000000000?$*1000:$;let Y=Number($);if(!isNaN(Y)&&$.trim()!=="")return Y<100000000000?Y*1000:Y;let z=new Date($);if(isNaN(z.getTime()))throw Error(`Invalid date format: ${$}`);return z.getTime()}function Yg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),z=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:z.toISOString()}}function r10($){let Y=new URLSearchParams;return c8(Y,"filter[startDate]",$.startDate),c8(Y,"filter[endDate]",$.endDate),c8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function s10($,Y={}){return M1(await $.get("api/v1/expenses/list",{searchParams:r10(Y)}),e00)}async function a10($,Y={}){return M1(await $.get("api/v1/invoice/list",{searchParams:r10(Y)}),$10)}async function t10($){return M1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(Y10))}async function e10($,Y){let z=await $.delete(`api/v1/contacts/local/users/${Y}`),U=await z.json(),I=WM.safeParse(U.data??U);return I.success?I.data.success??z.ok:z.ok}async function zg($,Y){let z=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),U=await z.json(),I=WM.safeParse(U.data??U);return I.success?I.data.success??z.ok:z.ok}async function Ec0($,Y){let z=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),U=z.headers.get("set-auth-token"),I=Tc0.parse(await z.json()),Q=U??I.session?.token;if(!Q)throw Error("Failed to retrieve authentication token from login response");return{token:Q,user:I.user}}async function $40($,Y,z,U){let I;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await HM($,Y.userIdOrPhone),V=q.users.find((F)=>F.mobile?.includes(Y.userIdOrPhone)||F._id===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${Y.userIdOrPhone}`);I=V}else I=await GM($,Y.userIdOrPhone).catch(async()=>{let q=await HM($,Y.userIdOrPhone),V=q.users.find((F)=>F.name===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${Y.userIdOrPhone}`);return V});if(I.status==="resigned")await zg($,I._id),I=await GM($,I._id);let Q=I,J=Array.isArray(Q.identities)&&Q.identities.some((q)=>q.provider&&q.provider!=="local")||!!Q.apps?.hosecloud;if(J&&U&&U.source.type==="hose"){let V=(I.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=Q.identities?.find((w)=>w.provider==="hosecloud")?.providerId,M=Q.apps?.hosecloud?.boundId||F||(V?`${U.source.corpId}:${V}`:void 0);if(M){let w=await iI(U),D=(await $M({...U.source,staffId:M},w)).token,N=R7(U,U.source),B=A6(U.seal),T=T8(N,void 0,B),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:D,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 z(j),b=await dI(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 $g($,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 Ec0($,{phone:H,password:K.password}),X=await z(W),Z=await dI(X,{note:Y.note??`Delegation generated by admin for ${I.name}`});return{targetUser:I,delegation:Z,temporaryPassword:K.password}}async function Y40($){return M1(await $.get("api/v1/llm/config"),z10)}async function z40($){return M1(await $.get("api/v1/llm/providers"),L.array(U10))}async function U40($){return M1(await $.get("api/v1/permissions/available"),I10)}async function I40($){return M1(await $.get("api/v1/permissions/configs"),Q10)}async function cY($){return M1(await $.get("api/v1/billing/status"),J10)}async function Q40($){let z=await(await $.get("api/v1/billing/plans")).json();return w10.parse(z.data??z)}async function J40($){let z=await(await $.get("api/v1/billing/features")).json();return w10.parse(z.data??z)}var WM,Bc0,Tc0,w10;var X6=o(()=>{uI();A$();pI();a9();i8();lS();WM=L.object({success:L.boolean().optional()}).passthrough(),Bc0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),Tc0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),w10=L.json()});var Y6=E((An1,G40)=>{var{toString:K40}=Object.prototype,Cc0=/["&<>]/,e9={each:function(Y,z){if(Y)if(Array.isArray(Y))Y.forEach(z);else Object.keys(Y).forEach((U)=>{z(Y[U],U)})},some:function(Y,z){if(Y){if(Array.isArray(Y))return Y.some(z);return Object.keys(Y).some((U)=>z(Y[U],U))}return!1},every:function(Y,z){if(Y){if(Array.isArray(Y))return Y.every(z);return Object.keys(Y).every((U)=>z(Y[U],U))}return!0},map:function(Y,z){if(Y){if(Array.isArray(Y))return Y.map(z);return Object.keys(Y).map((U)=>z(Y[U],U))}return[]},keyBy($,Y){return $.reduce((z,U)=>{return z[U[Y]]=U,z},{})},isEqual:function(Y,z){let U=typeof Y,I=typeof z,Q=Array.isArray(Y),J=Array.isArray(z),K;if(U!==I)return!1;switch(typeof Y){case"object":if(Q||J){if(Q&&J)return Y.length===z.length&&Y.every((G,H)=>{let W=z[H];return e9.isEqual(G,W)});return!1}if(Y===null||z===null)return Y===z;if(K=Object.keys(Y),Object.keys(z).length!==K.length)return!1;for(let G of K)if(!z.hasOwnProperty(G))return!1;return e9.every(Y,(G,H)=>{let W=z[H];return e9.isEqual(G,W)});default:return Y===z}},escapeHtml($){let Y=Cc0.exec($);if(!Y)return $;let z="",U="",I=0,Q=Y.index;for(;Q<$.length;Q++){switch($.charAt(Q)){case'"':U=""";break;case"&":U="&";break;case"'":U="'";break;case"<":U="<";break;case">":U=">";break;default:continue}if(I!==Q)z+=$.substring(I,Q);I=Q+1,z+=U}if(I!==Q)return z+$.substring(I,Q);return z},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return K40.call($)==="[object Undefined]"},isObject($){return K40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,z,U,I;function Q(J,K){if(z=$[K],I=Array.isArray(J),e9.isObject(J)||I){if(I)I=!1,U=z&&Array.isArray(z)?z:[];else U=z&&e9.isObject(z)?z:{};$[K]=e9.deepMerge(U,J)}else if(!e9.isUndefined(J))$[K]=J}for(let J=0;J{var Rc0=/^[A-Z]+\d+$/,yH={_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,z,U,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)z=J-27,U=z%26,I=Math.floor(z/26),Y=this._dictionary[I]+this._dictionary[U],this._n2l[J]=Y,this._l2n[Y]=J,J++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){J=703;while(J<=16384)z=J-703,U=z%26,I=Math.floor(z/26)%26,Q=Math.floor(z/676),Y=this._dictionary[Q]+this._dictionary[I]+this._dictionary[U],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(!Rc0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let z=!1,U="",I=0,Q=!1,J="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!Q&&W>=65&&W<=90)z=!0,U+=$[H],I=I*26+W-64;else if(W>=48&&W<=57)Q=!0,J+=$[H],K=K*10+W-48;else if(Q&&z&&W!==36)break;if(!z)I=void 0;else if(I>16384)throw Error(`Out of bounds. Invalid column letter: ${U}`);if(!Q)K=void 0;$=U+J;let G={address:$,col:I,row:K,$col$row:`$${U}$${J}`};if(I<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let z=this.n2l(Y)+$;return this.decodeAddress(z)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let z=this.decodeAddress(Y[0]),U=this.decodeAddress(Y[1]),I={top:Math.min(z.row,U.row),left:Math.min(z.col,U.col),bottom:Math.max(z.row,U.row),right:Math.max(z.col,U.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(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),z=Y[1]||Y[2],U=Y[3],I=U.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:z,tl:{address:J,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:z},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:z},dimensions:`${J}:${K}`}}if(U.startsWith("#"))return z?{sheetName:z,error:U}:{error:U};let Q=this.decodeAddress(U);return z?{sheetName:z,...Q}:Q},encodeAddress($,Y){return yH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return yH.encodeAddress(arguments[0],arguments[1]);case 4:return`${yH.encodeAddress(arguments[0],arguments[1])}:${yH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[z,U,,I,Q]=$,[J,K]=Y;return J>=z&&J<=I&&K>=U&&K<=Q}};H40.exports=yH});var $3=E((Bn1,W40)=>{var l5=i4();class Ug{constructor(){this.decode(arguments)}setTLBR($,Y,z,U,I){if(arguments.length<4){let Q=l5.decodeAddress($),J=l5.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:z},this.setTLBR(Q.row,Q.col,J.row,J.col,I)}else this.model={top:Math.min($,z),left:Math.min(Y,U),bottom:Math.max($,z),right:Math.max(Y,U),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 Ug)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 z=l5.decodeEx(Y);if(z.top)this.model={top:z.top,left:z.left,bottom:z.bottom,right:z.right,sheetName:z.sheetName};else this.model={top:z.row,left:z.col,bottom:z.row,right:z.col,sheetName:z.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,z,U){if(!this.model.top||$this.bottom)this.bottom=z;if(!this.model.right||U>this.right)this.right=U}expandRow($){if($){let{dimensions:Y,number:z}=$;if(Y)this.expand(z,Y.min,z,Y.max)}}expandToAddress($){let Y=l5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return l5.n2l(this.left)+this.top}get $t$l(){return`$${l5.n2l(this.left)}$${this.top}`}get br(){return l5.n2l(this.right)+this.bottom}get $b$r(){return`$${l5.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=l5.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 z=this.top;z<=this.bottom;z++)$(l5.encodeAddress(z,Y),z,Y)}}W40.exports=Ug});var G5=E((Tn1,X40)=>{X40.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 q40=E((jn1,Z40)=>{var PM=i4(),_c0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,vc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function hc0($,Y,z){let U=PM.decode(Y),I=PM.decode(z);return $.replace(_c0,(Q,J,K,G,H)=>{if(H)return Q;let W=vc0.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 F=PM.l2n(Z),M=parseInt(V,10);if(!X)F+=I.col-U.col;if(!q)M+=I.row-U.row;return(J||"")+(X||"")+PM.n2l(F)+(q||"")+M}return Q})}Z40.exports={slideFormula:hc0}});var L40=E((En1,V40)=>{var Sc0=Y6();class kH{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 Sc0.deepMerge({},kH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:z}=Y;if(z.length===1&&Object.keys(z[0]).length===1)this.note=z[0].text;else this.note=Y}static fromModel($){let Y=new kH;return Y.model=$,Y}}kH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};V40.exports=kH});var _40=E((Cn1,R40)=>{var gc0=i4(),yc0=Y6(),H5=G5(),{slideFormula:kc0}=q40(),F40=L40();class d0{constructor($,Y,z){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,gc0.validateAddress(z),this._address=z,this._value=h7.create(d0.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,z){let U=$&&$.numFmt||Y&&Y.numFmt;if(U)z.numFmt=U;let I=$&&$.font||Y&&Y.font;if(I)z.font=I;let Q=$&&$.alignment||Y&&Y.alignment;if(Q)z.alignment=Q;let J=$&&$.border||Y&&Y.border;if(J)z.border=J;let K=$&&$.fill||Y&&Y.fill;if(K)z.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)z.protection=G;return z}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===d0.Types.Merge}merge($,Y){if(this._value.release(),this._value=h7.create(d0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===d0.Types.Merge)this._value.release(),this._value=h7.create(d0.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{})}isMergedTo($){if(this._value.type!==d0.Types.Merge)return!1;return this._value.isMergedTo($)}get master(){if(this.type===d0.Types.Merge)return this._value.master;return this}get isHyperlink(){return this._value.type===d0.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value($){if(this.type===d0.Types.Merge){this._value.master.value=$;return}this._value.release(),this._value=h7.create(h7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new F40($)}get text(){return this._value.toString()}get html(){return yc0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===d0.Types.String)this._value=h7.create(d0.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((z)=>{Y.addEx(this.fullAddress,z)})}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=h7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=F40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}d0.Types=H5.ValueType;class w40{constructor($){this.model={address:$.address,type:d0.Types.Null}}get value(){return null}set value($){}get type(){return d0.Types.Null}get effectiveType(){return d0.Types.Null}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){}toString(){return""}}class M40{constructor($,Y){this.model={address:$.address,type:d0.Types.Number,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Number}get effectiveType(){return d0.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 O40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.String}get effectiveType(){return d0.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 N40{constructor($,Y){this.model={address:$.address,type:d0.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 d0.Types.RichText}get effectiveType(){return d0.Types.RichText}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}class D40{constructor($,Y){this.model={address:$.address,type:d0.Types.Date,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Date}get effectiveType(){return d0.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 A40{constructor($,Y){if(this.model={address:$.address,type:d0.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 d0.Types.Hyperlink}get effectiveType(){return d0.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 P40{constructor($,Y){if(this.model={address:$.address,type:d0.Types.Merge,master:Y?Y.address:void 0},this._master=Y,Y)Y.addMergeRef()}get value(){return this._master.value}set value($){if($ instanceof d0){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 d0.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 B40{constructor($,Y){this.cell=$,this.model={address:$.address,type:d0.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={},z=(U)=>{let I=$[U];if(I)Y[U]=I};return z("formula"),z("result"),z("ref"),z("shareType"),z("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(h7.getType($)){case d0.Types.Null:case d0.Types.String:case d0.Types.Number:case d0.Types.Date:break;case d0.Types.Hyperlink:case d0.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 H5.FormulaType.Master;if(this.model.sharedFormula)return H5.FormulaType.Shared;return H5.FormulaType.None}get result(){return this.model.result}set result($){this.model.result=$}get type(){return d0.Types.Formula}get effectiveType(){let $=this.model.result;if($===null||$===void 0)return H5.ValueType.Null;if($ instanceof String||typeof $==="string")return H5.ValueType.String;if(typeof $==="number")return H5.ValueType.Number;if($ instanceof Date)return H5.ValueType.Date;if($.text&&$.hyperlink)return H5.ValueType.Hyperlink;if($.formula)return H5.ValueType.Formula;return H5.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&&kc0(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 T40{constructor($,Y){this.model={address:$.address,type:d0.Types.SharedString,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.SharedString}get effectiveType(){return d0.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 j40{constructor($,Y){this.model={address:$.address,type:d0.Types.Boolean,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Boolean}get effectiveType(){return d0.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 E40{constructor($,Y){this.model={address:$.address,type:d0.Types.Error,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Error}get effectiveType(){return d0.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 C40{constructor($,Y){this.model={address:$.address,type:d0.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 d0.Types.String}get effectiveType(){return d0.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 h7={getType($){if($===null||$===void 0)return d0.Types.Null;if($ instanceof String||typeof $==="string")return d0.Types.String;if(typeof $==="number")return d0.Types.Number;if(typeof $==="boolean")return d0.Types.Boolean;if($ instanceof Date)return d0.Types.Date;if($.text&&$.hyperlink)return d0.Types.Hyperlink;if($.formula||$.sharedFormula)return d0.Types.Formula;if($.richText)return d0.Types.RichText;if($.sharedString)return d0.Types.SharedString;if($.error)return d0.Types.Error;return d0.Types.JSON},types:[{t:d0.Types.Null,f:w40},{t:d0.Types.Number,f:M40},{t:d0.Types.String,f:O40},{t:d0.Types.Date,f:D40},{t:d0.Types.Hyperlink,f:A40},{t:d0.Types.Formula,f:B40},{t:d0.Types.Merge,f:P40},{t:d0.Types.JSON,f:C40},{t:d0.Types.SharedString,f:T40},{t:d0.Types.RichText,f:N40},{t:d0.Types.Boolean,f:j40},{t:d0.Types.Error,f:E40}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,z){let U=this.types[$];if(!U)throw Error(`Could not create Value of type ${$}`);return new U(Y,z)}};R40.exports=d0});var TM=E((Rn1,S40)=>{var xc0=Y6(),BM=G5(),nY=i4(),v40=_40();class h40{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 z=this._worksheet.getColumn($.col);Y=new v40(this,z,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=nY.l2n($)}return this._cells[$-1]||this.getCellEx({address:nY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...z){let U=$+Y,I=z.length-Y,Q=this._cells.length,J,K,G;if(I<0){for(J=$+z.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>=U;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(z&&z.type!==BM.ValueType.Null)Y(z,U+1)})}addPageBreak($,Y){let z=this._worksheet,U=Math.max(0,$-1)||0,I=Math.max(0,Y-1)||16838,Q={id:this._number,max:I,man:1};if(U)Q.min=U;z.rowBreaks.push(Q)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==BM.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((z,U)=>{if(z!==void 0)this.getCellEx({address:nY.encodeAddress(this._number,U+Y),row:this._number,col:U+Y}).value=z})}else this._worksheet.eachColumnKey((Y,z)=>{if($[z]!==void 0)this.getCellEx({address:nY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[z]})}get hasValues(){return xc0.some(this._cells,($)=>$&&$.type!==BM.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((z)=>{if(z&&z.type!==BM.ValueType.Null){if(!$||$>z.col)$=z.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((z)=>{if(z)z[$]=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,z=0;return this._cells.forEach((U)=>{if(U){let I=U.model;if(I){if(!Y||Y>U.col)Y=U.col;if(z{switch(z.type){case v40.Types.Merge:break;default:{let U;if(z.address)U=nY.decodeAddress(z.address);else if(Y){let{row:Q}=Y,J=Y.col+1;U={row:Q,col:J,address:nY.encodeAddress(Q,J),$col$row:`$${nY.n2l(J)}$${Q}`}}Y=U;let I=this.getCellEx(U);I.model=z;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}S40.exports=h40});var EM=E((_n1,g40)=>{var fc0=Y6(),uc0=G5(),bc0=i4();class jM{constructor($,Y,z){if(this._worksheet=$,this._number=Y,z!==!1)this.defn=z}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return bc0.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,z)=>{this._worksheet.getCell(z+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&&fc0.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 z=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(U,I)=>{Y(U.getCell(z),I)})}get values(){let $=[];return this.eachCell((Y,z)=>{if(Y&&Y.type!==uc0.ValueType.Null)$[z]=Y.value}),$}set values($){if(!$)return;let Y=this.number,z=0;if($.hasOwnProperty("0"))z=1;$.forEach((U,I)=>{this._worksheet.getCell(I+z,Y).value=U})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((z)=>{z[$]=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=[],z=null;if($)$.forEach((U,I)=>{if(U.isDefault){if(z)z=null}else if(!z||!U.equivalentTo(z))z={min:I+1,max:I+1,width:U.width!==void 0?U.width:9,style:U.style,isCustomWidth:U.isCustomWidth,hidden:U.hidden,outlineLevel:U.outlineLevel,collapsed:U.collapsed},Y.push(z);else z.max=I+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let z=[],U=1,I=0;Y=Y.sort(function(Q,J){return Q.min-J.min});while(I{var ic0=i4();class CM{constructor($,Y,z=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let U=ic0.decodeAddress(Y);this.nativeCol=U.col+z,this.nativeColOff=0,this.nativeRow=U.row+z,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+z,this.row=Y.row+z;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof CM||$==null?$:new CM($)}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}}y40.exports=CM});var u40=E((hn1,f40)=>{var cc0=i4(),RM=k40();class x40{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:z,hyperlinks:U}){if(this.type=$,this.imageId=Y,$==="image")if(typeof z==="string"){let I=cc0.decode(z);this.range={tl:new RM(this.worksheet,{col:I.left,row:I.top},-1),br:new RM(this.worksheet,{col:I.right,row:I.bottom},0),editAs:"oneCell"}}else this.range={tl:new RM(this.worksheet,z.tl,0),br:z.br&&new RM(this.worksheet,z.br,0),ext:z.ext,editAs:z.editAs,hyperlinks:U||z.hyperlinks}}}f40.exports=x40});var n40=E((Sn1,c40)=>{var _M=i4();class b40{constructor($,Y,z){this.table=$,this.column=Y,this.index=z}_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 i40{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 z=(G,H)=>{if(!G)throw Error(H)};z($.ref,"Table must have ref"),z($.columns,"Table must have column definitions"),z($.rows,"Table must have row definitions"),$.tl=_M.decodeAddress($.ref);let{row:U,col:I}=$.tl;z(U>0,"Table must be on valid row"),z(I>0,"Table must be on valid col");let{width:Q,filterHeight:J,tableHeight:K}=this;$.autoFilterRef=_M.encode(U,I,U+J-1,I+Q-1),$.tableRef=_M.encode(U,I,U+K-1,I+Q-1),$.columns.forEach((G,H)=>{if(z(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:z}=this,{row:U,col:I}=z.tl,Q=0;if(z.headerRow){let J=Y.getRow(U+Q++);z.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=J.getCell(I+G);X.value=W,$(X,H)})}if(z.rows.forEach((J)=>{let K=Y.getRow(U+Q++);J.forEach((G,H)=>{let W=K.getCell(I+H);W.value=G,$(W,z.columns[H].style)})}),z.totalsRow){let J=Y.getRow(U+Q++);z.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:z,col:U}=Y.tl,I=0;if(Y.headerRow){let Q=$.getRow(z+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(U+K);G.value=J.name})}if(Y.rows.forEach((Q)=>{let J=$.getRow(z+I++);Q.forEach((K,G)=>{let H=J.getCell(U+G);H.value=K})}),Y.totalsRow){let Q=$.getRow(z+I++);Y.columns.forEach((J,K)=>{let G=Q.getCell(U+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 $=_M.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{U.push(Y[I])});else this.table.columns.splice(z,0,$),this.table.rows.forEach((U,I)=>{U.splice(z,0,Y[I])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((z)=>{z.splice($,Y)})}_assign($,Y,z){this.cacheState(),$[Y]=z}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=$}}c40.exports=i40});var Ig=E((gn1,d40)=>{class p40{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}d40.exports=p40});var Jg=E((yn1,m40)=>{var Qg=J0("crypto"),nc0={hash($,...Y){let z=Qg.createHash($);return z.update(Buffer.concat(Y)),z.digest()},convertPasswordToHash($,Y,z,U){if(Y=Y.toLowerCase(),Qg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let Q=Buffer.from($,"utf16le"),J=this.hash(Y,Buffer.from(z,"base64"),Q);for(let K=0;K{var l40=($,Y)=>({...$,...Y.reduce((z,U)=>{if($[U])z[U]={...$[U]};return z},{})}),o5=($,Y,z,U=[])=>{if($[z])Y[z]=l40($[z],U)},pc0=($)=>Object.keys($).length===0,dc0=($)=>{if(!$)return $;if(pc0($))return{};let Y={...$};if(o5($,Y,"font",["color"]),o5($,Y,"alignment"),o5($,Y,"protection"),$.border)o5($,Y,"border"),o5($.border,Y.border,"top",["color"]),o5($.border,Y.border,"left",["color"]),o5($.border,Y.border,"bottom",["color"]),o5($.border,Y.border,"right",["color"]),o5($.border,Y.border,"diagonal",["color"]);if($.fill){if(o5($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((z)=>l40(z,["color"]))}return Y};mc0.copyStyle=dc0});var z60=E((xn1,Y60)=>{var xH=Y6(),fH=i4(),uH=$3(),r40=TM(),vM=EM(),oc0=G5(),Kg=u40(),s40=n40(),a40=Ig(),t40=Jg(),{copyStyle:e40}=o40();class $60{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 a40,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 uH;return this._rows.forEach((Y)=>{if(Y){let z=Y.dimensions;if(z)$.expand(Y.number,z.min,Y.number,z.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((U,I)=>{let Q=I.header&&1||I.headers&&I.headers.length||0;return Math.max(U,Q)},0);let Y=1,z=this._columns=[];$.forEach((U)=>{let I=new vM(this,Y++,!1);z.push(I),I.defn=U})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){xH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=fH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new vM(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...z){let I=this._rows.length;if(z.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=z.length-Y,J=$+Y,K=this._columns.length;if(Q<0)for(let G=$+z.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<$+z.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,z.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((z)=>{z.eachCell(({col:U})=>{if(!$[U])$[U]=!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 r40(this,$);return Y}getRows($,Y){if(Y<1)return;let z=[];for(let U=$;U<$+Y;U++)z.push(this.getRow(U));return z}addRow($,Y="n"){let z=this._nextRow,U=this.getRow(z);return U.values=$,this._setStyleOption(z,Y[0]==="i"?Y:"n"),U}addRows($,Y="n"){let z=[];return $.forEach((U)=>{z.push(this.addRow(U,Y))}),z}insertRow($,Y,z="n"){return this.spliceRows($,0,Y),this._setStyleOption($,z),this.getRow($)}insertRows($,Y,z="n"){if(this.spliceRows($,0,...Y),z!=="n"){for(let U=0;U{I.getCell(J).style=e40(Q.style)}),I.height=U.height}duplicateRow($,Y,z=!1){let U=this._rows[$-1],I=Array(Y).fill(U.values);this.spliceRows($+1,z?0:Y,...I);for(let Q=0;Q{J.getCell(G).style=K.style})}}spliceRows($,Y,...z){let U=$+Y,I=z.length,Q=I-Y,J=this._rows.length,K,G;if(Q<0){if($===J)this._rows[J-1]=void 0;for(K=U;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>=U;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(z&&z.hasValues)Y(z,z.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let z=fH.getAddress($,Y),U=this._rows[z.row-1];return U?U.findCell(z.col):void 0}getCell($,Y){let z=fH.getAddress($,Y);return this.getRow(z.row).getCellEx(z)}mergeCells(...$){let Y=new uH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new uH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){xH.each(this._merges,(U)=>{if(U.intersects($))throw Error("Cannot merge already merged cells")});let z=this.getCell($.top,$.left);for(let U=$.top;U<=$.bottom;U++)for(let I=$.left;I<=$.right;I++)if(U>$.top||I>$.left)this.getCell(U,I).merge(z,Y);this._merges[z.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++)this.getCell(z,U).unmerge();delete this._merges[$.address]}}get hasMerges(){return xH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new uH($);for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++){let I=this.findCell(z,U);if(I){if(I.type===oc0.ValueType.Merge)this._unMergeMaster(I.master);else if(this._merges[I.address])this._unMergeMaster(I)}}}fillFormula($,Y,z,U="shared"){let I=fH.decode($),{top:Q,left:J,bottom:K,right:G}=I,H=G-J+1,W=fH.encodeAddress(Q,J),X=U==="shared",Z;if(typeof z==="function")Z=z;else if(Array.isArray(z))if(Array.isArray(z[0]))Z=(V,F)=>z[V-Q][F-J];else Z=(V,F)=>z[(V-Q)*H+(F-J)];else Z=()=>{return};let q=!0;for(let V=Q;V<=K;V++)for(let F=J;F<=G;F++)if(q)this.getCell(V,F).value={shareType:U,formula:Y,ref:$,result:Z(V,F)},q=!1;else this.getCell(V,F).value=X?{sharedFormula:W,result:Z(V,F)}:Z(V,F)}addImage($,Y){let z={type:"image",imageId:$,range:Y};this._media.push(new Kg(this,z))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new Kg(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((z)=>{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=t40.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=t40.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}z()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new s40(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((U)=>U.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((U)=>U.model),conditionalFormattings:this.conditionalFormattings};$.cols=vM.toModel(this.columns);let Y=$.rows=[],z=$.dimensions=new uH;return this._rows.forEach((U)=>{let I=U&&U.model;if(I)z.expand(I.number,I.min,I.number,I.max),Y.push(I)}),$.merges=[],xH.each(this._merges,(U)=>{$.merges.push(U.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let z=new r40(this,Y.number);this._rows[z.number-1]=z,z.model=Y})}_parseMergeCells($){xH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=vM.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new a40($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new Kg(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,z)=>{let U=new s40;return U.model=z,Y[z.name]=U,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}Y60.exports=$60});var J60=E((fn1,Q60)=>{var U60=Y6(),hM=i4();class I60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(hM.decodeEx($))}getCell($){return this.findCellEx(hM.decodeEx($),!0)}findCell($){return this.findCellEx(hM.decodeEx($),!1)}findCellAt($,Y,z){let U=this.sheets[$],I=U&&U[Y];return I&&I[z]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let z=$.left;z<=$.right;z++)this.getCellAt($.sheetName,Y,z);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let z=this.findSheet($,Y),U=this.findSheetRow(z,$,Y);return this.findRowCell(U,$,Y)}getCellAt($,Y,z){let U=this.sheets[$]||(this.sheets[$]=[]),I=U[Y]||(U[Y]=[]);return I[z]||(I[z]={sheetName:$,address:hM.n2l(z)+Y,row:Y,col:z})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let z=this.findSheetRow(Y,$);if(!z)return;delete z[$.col]}forEachInSheet($,Y){let z=this.sheets[$];if(z)z.forEach((U,I)=>{if(U)U.forEach((Q,J)=>{if(Q)Y(Q,I,J)})})}forEach($){U60.each(this.sheets,(Y,z)=>{this.forEachInSheet(z,$)})}map($){let Y=[];return this.forEach((z)=>{Y.push($(z))}),Y}findSheet($,Y){let z=$.sheetName;if(this.sheets[z])return this.sheets[z];if(Y)return this.sheets[z]=[];return}findSheetRow($,Y,z){let{row:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=[];return}findRowCell($,Y,z){let{col:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,z,U){let I=this.sheets[$];if(I){let Q=[];for(let J=0;J{J.splice(Y,z,...Q)})}}}Q60.exports=I60});var Gg=E((un1,H60)=>{var lI=Y6(),bH=i4(),K60=J60(),rc0=$3(),sc0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class G60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new K60)}add($,Y){let z=bH.decodeEx($);this.addEx(z,Y)}addEx($,Y){let z=this.getMatrix(Y);if($.top)for(let U=$.left;U<=$.right;U++)for(let I=$.top;I<=$.bottom;I++){let Q={sheetName:$.sheetName,address:bH.n2l(U)+I,row:I,col:U};z.addCellEx(Q)}else z.addCellEx($)}remove($,Y){let z=bH.decodeEx($);this.removeEx(z,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){lI.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){lI.each(this.matrixMap,(Y,z)=>{Y.forEach((U)=>{$(z,U)})})}getNames($){return this.getNamesEx(bH.decodeEx($))}getNamesEx($){return lI.map(this.matrixMap,(Y,z)=>Y.findCellEx($)&&z).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:z}=Y,U=new rc0(Y.row,Y.col,Y.row,Y.col,z),I,Q;function J(G,H){let W=$.findCellAt(z,G,Y.col);if(!W||!W.mark)return!1;return U[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=U.top;Q<=U.bottom;Q++){let X=$.findCellAt(z,Q,G);if(X&&X.mark)W.push(X);else return!1}U[H]=G;for(let X=0;X{U.mark=!0});let z=Y.map((U)=>U.mark&&this._explore(Y,U)).filter(Boolean).map((U)=>U.$shortRange);return{name:$,ranges:z}}normaliseMatrix($,Y){$.forEachInSheet(Y,(z,U,I)=>{if(z){if(z.row!==U||z.col!==I)z.row=U,z.col=I,z.address=bH.n2l(I)+U}})}spliceRows($,Y,z,U){lI.each(this.matrixMap,(I)=>{I.spliceRows($,Y,z,U),this.normaliseMatrix(I,$)})}spliceColumns($,Y,z,U){lI.each(this.matrixMap,(I)=>{I.spliceColumns($,Y,z,U),this.normaliseMatrix(I,$)})}get model(){return lI.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((z)=>{let U=Y[z.name]=new K60;z.ranges.forEach((I)=>{if(sc0.test(I.split("!").pop()||""))U.addCell(I)})})}}H60.exports=G60});var J6=E((bn1,Hg)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)Hg.exports={nextTick:ac0};else Hg.exports=process;function ac0($,Y,z,U){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,z)});case 4:return process.nextTick(function(){$.call(null,Y,z,U)});default:Q=Array(I-1),J=0;while(J{var tc0={}.toString;W60.exports=Array.isArray||function($){return tc0.call($)=="[object Array]"}});var K6=E((Wg,Z60)=>{var SM=J0("buffer"),Y3=SM.Buffer;function X60($,Y){for(var z in $)Y[z]=$[z]}if(Y3.from&&Y3.alloc&&Y3.allocUnsafe&&Y3.allocUnsafeSlow)Z60.exports=SM;else X60(SM,Wg),Wg.Buffer=rI;function rI($,Y,z){return Y3($,Y,z)}X60(Y3,rI);rI.from=function($,Y,z){if(typeof $==="number")throw TypeError("Argument must not be a number");return Y3($,Y,z)};rI.alloc=function($,Y,z){if(typeof $!=="number")throw TypeError("Argument must be a number");var U=Y3($);if(Y!==void 0)if(typeof z==="string")U.fill(Y,z);else U.fill(Y);else U.fill(0);return U};rI.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return Y3($)};rI.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return SM.SlowBuffer($)}});var M4=E((qn0)=>{function ec0($){if(Array.isArray)return Array.isArray($);return gM($)==="[object Array]"}qn0.isArray=ec0;function $n0($){return typeof $==="boolean"}qn0.isBoolean=$n0;function Yn0($){return $===null}qn0.isNull=Yn0;function zn0($){return $==null}qn0.isNullOrUndefined=zn0;function Un0($){return typeof $==="number"}qn0.isNumber=Un0;function In0($){return typeof $==="string"}qn0.isString=In0;function Qn0($){return typeof $==="symbol"}qn0.isSymbol=Qn0;function Jn0($){return $===void 0}qn0.isUndefined=Jn0;function Kn0($){return gM($)==="[object RegExp]"}qn0.isRegExp=Kn0;function Gn0($){return typeof $==="object"&&$!==null}qn0.isObject=Gn0;function Hn0($){return gM($)==="[object Date]"}qn0.isDate=Hn0;function Wn0($){return gM($)==="[object Error]"||$ instanceof Error}qn0.isError=Wn0;function Xn0($){return typeof $==="function"}qn0.isFunction=Xn0;function Zn0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}qn0.isPrimitive=Zn0;qn0.isBuffer=J0("buffer").Buffer.isBuffer;function gM($){return Object.prototype.toString.call($)}});var q60=E((nn1,Xg)=>{if(typeof Object.create==="function")Xg.exports=function(Y,z){if(z)Y.super_=z,Y.prototype=Object.create(z.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else Xg.exports=function(Y,z){if(z){Y.super_=z;var U=function(){};U.prototype=z.prototype,Y.prototype=new U,Y.prototype.constructor=Y}}});var X1=E((pn1,Zg)=>{try{if(yM=J0("util"),typeof yM.inherits!=="function")throw"";Zg.exports=yM.inherits}catch($){Zg.exports=q60()}var yM});var L60=E((dn1,qg)=>{function Rn0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var V60=K6().Buffer,iH=J0("util");function _n0($,Y,z){$.copy(Y,z)}qg.exports=function(){function $(){Rn0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,I=""+U.data;while(U=U.next)I+=z+U.data;return I},$.prototype.concat=function(z){if(this.length===0)return V60.alloc(0);var U=V60.allocUnsafe(z>>>0),I=this.head,Q=0;while(I)_n0(I.data,U,Q),Q+=I.data.length,I=I.next;return U},$}();if(iH&&iH.inspect&&iH.inspect.custom)qg.exports.prototype[iH.inspect.custom]=function(){var $=iH.inspect({length:this.length});return this.constructor.name+" "+$}});var Vg=E((mn1,F60)=>{var kM=J6();function vn0($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(U||I){if(Y)Y($);else if($){if(!this._writableState)kM.nextTick(xM,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,kM.nextTick(xM,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(!z._writableState)kM.nextTick(xM,z,Q);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,kM.nextTick(xM,z,Q)}else if(Y)Y(Q)}),this}function hn0(){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 xM($,Y){$.emit("error",Y)}F60.exports={destroy:vn0,undestroy:hn0}});var S7=E((ln1,w60)=>{w60.exports=J0("util").deprecate});var Fg=E((on1,T60)=>{var pY=J6();T60.exports=Z6;function O60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){sn0(Y,$)}}var Sn0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pY.nextTick,sI;Z6.WritableState=nH;var N60=Object.create(M4());N60.inherits=X1();var gn0={deprecate:S7()},D60=J0("stream"),uM=K6().Buffer,yn0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function kn0($){return uM.from($)}function xn0($){return uM.isBuffer($)||$ instanceof yn0}var A60=Vg();N60.inherits(Z6,D60);function fn0(){}function nH($,Y){sI=sI||dY(),$=$||{};var z=Y instanceof sI;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:U,writableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(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){dn0(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 O60(this)}nH.prototype.getBuffer=function(){var Y=this.bufferedRequest,z=[];while(Y)z.push(Y),Y=Y.next;return z};(function(){try{Object.defineProperty(nH.prototype,"buffer",{get:gn0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var fM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")fM=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(fM.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof nH}});else fM=function($){return $ instanceof this};function Z6($){if(sI=sI||dY(),!fM.call(Z6,this)&&!(this instanceof sI))return new Z6($);if(this._writableState=new nH($,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}D60.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function un0($,Y){var z=Error("write after end");$.emit("error",z),pY.nextTick(Y,z)}function bn0($,Y,z,U){var I=!0,Q=!1;if(z===null)Q=TypeError("May not write null values to stream");else if(typeof z!=="string"&&z!==void 0&&!Y.objectMode)Q=TypeError("Invalid non-string/buffer chunk");if(Q)$.emit("error",Q),pY.nextTick(U,Q),I=!1;return I}Z6.prototype.write=function($,Y,z){var U=this._writableState,I=!1,Q=!U.objectMode&&xn0($);if(Q&&!uM.isBuffer($))$=kn0($);if(typeof Y==="function")z=Y,Y=null;if(Q)Y="buffer";else if(!Y)Y=U.defaultEncoding;if(typeof z!=="function")z=fn0;if(U.ended)un0(this,z);else if(Q||bn0(this,U,$,z))U.pendingcb++,I=cn0(this,U,Q,$,Y,z);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)P60(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 in0($,Y,z){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=uM.from(Y,z);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cn0($,Y,z,U,I,Q){if(!z){var J=in0(Y,U,I);if(U!==J)z=!0,I="buffer",U=J}var K=Y.objectMode?1:U.length;Y.length+=K;var G=Y.length{var j60=J6(),an0=Object.keys||function($){var Y=[];for(var z in $)Y.push(z);return Y};R60.exports=z3;var E60=Object.create(M4());E60.inherits=X1();var C60=Mg(),wg=Fg();E60.inherits(z3,C60);{bM=an0(wg.prototype);for(pH=0;pH{var Ng=K6().Buffer,_60=Ng.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 $p0($){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 Yp0($){var Y=$p0($);if(typeof Y!=="string"&&(Ng.isEncoding===_60||!_60($)))throw Error("Unknown encoding: "+$);return Y||$}qp0.StringDecoder=mH;function mH($){this.encoding=Yp0($);var Y;switch(this.encoding){case"utf16le":this.text=Kp0,this.end=Gp0,Y=4;break;case"utf8":this.fillLast=Ip0,Y=4;break;case"base64":this.text=Hp0,this.end=Wp0,Y=3;break;default:this.write=Xp0,this.end=Zp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ng.allocUnsafe(Y)}mH.prototype.write=function($){if($.length===0)return"";var Y,z;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";z=this.lastNeed,this.lastNeed=0}else z=0;if(z<$.length)return Y?Y+this.text($,z):this.text($,z);return Y||""};mH.prototype.end=Jp0;mH.prototype.text=Qp0;mH.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 Og($){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 zp0($,Y,z){var U=Y.length-1;if(U=0){if(I>0)$.lastNeed=I-1;return I}if(--U=0){if(I>0)$.lastNeed=I-2;return I}if(--U=0){if(I>0)if(I===2)I=0;else $.lastNeed=I-3;return I}return 0}function Up0($,Y,z){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 Ip0($){var Y=this.lastTotal-this.lastNeed,z=Up0(this,$,Y);if(z!==void 0)return z;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 Qp0($,Y){var z=zp0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=z;var U=$.length-(z-this.lastNeed);return $.copy(this.lastChar,0,U),$.toString("utf8",Y,U)}function Jp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function Kp0($,Y){if(($.length-Y)%2===0){var z=$.toString("utf16le",Y);if(z){var U=z.charCodeAt(z.length-1);if(U>=55296&&U<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],z.slice(0,-1)}return z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function Gp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var z=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,z)}return Y}function Hp0($,Y){var z=($.length-Y)%3;if(z===0)return $.toString("base64",Y);if(this.lastNeed=3-z,this.lastTotal=3,z===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-z)}function Wp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Xp0($){return $.toString(this.encoding)}function Zp0($){return $&&$.length?this.write($):""}});var Mg=E((tn1,c60)=>{var tI=J6();c60.exports=P4;var Lp0=oI(),lH;P4.ReadableState=x60;var an1=J0("events").EventEmitter,g60=function($,Y){return $.listeners(Y).length},jg=J0("stream"),oH=K6().Buffer,Fp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function wp0($){return oH.from($)}function Mp0($){return oH.isBuffer($)||$ instanceof Fp0}var y60=Object.create(M4());y60.inherits=X1();var Ag=J0("util"),t1=void 0;if(Ag&&Ag.debuglog)t1=Ag.debuglog("stream");else t1=function(){};var Op0=L60(),k60=Vg(),aI;y60.inherits(P4,jg);var Pg=["error","close","destroy","pause","resume"];function Np0($,Y,z){if(typeof $.prependListener==="function")return $.prependListener(Y,z);if(!$._events||!$._events[Y])$.on(Y,z);else if(Lp0($._events[Y]))$._events[Y].unshift(z);else $._events[Y]=[z,$._events[Y]]}function x60($,Y){lH=lH||dY(),$=$||{};var z=Y instanceof lH;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:U,readableHighWaterMark:I}=$,Q=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(I||I===0))this.highWaterMark=I;else this.highWaterMark=Q;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Op0,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(!aI)aI=Dg().StringDecoder;this.decoder=new aI($.encoding),this.encoding=$.encoding}}function P4($){if(lH=lH||dY(),!(this instanceof P4))return new P4($);if(this._readableState=new x60($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}jg.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=k60.destroy;P4.prototype._undestroy=k60.undestroy;P4.prototype._destroy=function($,Y){this.push(null),Y($)};P4.prototype.push=function($,Y){var z=this._readableState,U;if(!z.objectMode){if(typeof $==="string"){if(Y=Y||z.defaultEncoding,Y!==z.encoding)$=oH.from($,Y),Y="";U=!0}}else U=!0;return f60(this,$,Y,!1,U)};P4.prototype.unshift=function($){return f60(this,$,null,!0,!1)};function f60($,Y,z,U,I){var Q=$._readableState;if(Y===null)Q.reading=!1,Bp0($,Q);else{var J;if(!I)J=Dp0(Q,Y);if(J)$.emit("error",J);else if(Q.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!Q.objectMode&&Object.getPrototypeOf(Y)!==oH.prototype)Y=wp0(Y);if(U)if(Q.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else Bg($,Q,Y,!0);else if(Q.ended)$.emit("error",Error("stream.push() after EOF"));else if(Q.reading=!1,Q.decoder&&!z)if(Y=Q.decoder.write(Y),Q.objectMode||Y.length!==0)Bg($,Q,Y,!1);else u60($,Q);else Bg($,Q,Y,!1)}else if(!U)Q.reading=!1}return Ap0(Q)}function Bg($,Y,z,U){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",z),$.read(0);else{if(Y.length+=Y.objectMode?1:z.length,U)Y.buffer.unshift(z);else Y.buffer.push(z);if(Y.needReadable)iM($)}u60($,Y)}function Dp0($,Y){var z;if(!Mp0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)z=TypeError("Invalid non-string/buffer chunk");return z}function Ap0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!aI)aI=Dg().StringDecoder;return this._readableState.decoder=new aI($),this._readableState.encoding=$,this};var v60=8388608;function Pp0($){if($>=v60)$=v60;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function h60($,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=Pp0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}P4.prototype.read=function($){t1("read",$),$=parseInt($,10);var Y=this._readableState,z=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&(Y.length>=Y.highWaterMark||Y.ended)){if(t1("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)Tg(this);else iM(this);return null}if($=h60($,Y),$===0&&Y.ended){if(Y.length===0)Tg(this);return null}var U=Y.needReadable;if(t1("need readable",U),Y.length===0||Y.length-$0)I=b60($,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(z!==$&&Y.ended)Tg(this)}if(I!==null)this.emit("data",I);return I};function Bp0($,Y){if(Y.ended)return;if(Y.decoder){var z=Y.decoder.end();if(z&&z.length)Y.buffer.push(z),Y.length+=Y.objectMode?1:z.length}Y.ended=!0,iM($)}function iM($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if(t1("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)tI.nextTick(S60,$);else S60($)}function S60($){t1("emit readable"),$.emit("readable"),Eg($)}function u60($,Y){if(!Y.readingMore)Y.readingMore=!0,tI.nextTick(Tp0,$,Y)}function Tp0($,Y){var z=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&i60(U.pipes,$)!==-1)&&!H)t1("false write response, pause",U.awaitDrain),U.awaitDrain++,X=!0;z.pause()}}function q(w){if(t1("onerror",w),M(),$.removeListener("error",q),g60($,"error")===0)$.emit("error",w)}Np0($,"error",q);function V(){$.removeListener("finish",F),M()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),M()}$.once("finish",F);function M(){t1("unpipe"),z.unpipe($)}if($.emit("pipe",z),!U.flowing)t1("pipe resume"),z.resume();return $};function jp0($){return function(){var Y=$._readableState;if(t1("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&g60($,"data"))Y.flowing=!0,Eg($)}}P4.prototype.unpipe=function($){var Y=this._readableState,z={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,z);return this}if(!$){var{pipes:U,pipesCount:I}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Q=0;Q=Y.length){if(Y.decoder)z=Y.buffer.join("");else if(Y.buffer.length===1)z=Y.buffer.head.data;else z=Y.buffer.concat(Y.length);Y.buffer.clear()}else z=_p0($,Y.buffer,Y.decoder);return z}function _p0($,Y,z){var U;if($Q.length?Q.length:$;if(J===Q.length)I+=Q;else I+=Q.slice(0,$);if($-=J,$===0){if(J===Q.length)if(++U,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=Q.slice(J);break}++U}return Y.length-=U,I}function hp0($,Y){var z=oH.allocUnsafe($),U=Y.head,I=1;U.data.copy(z),$-=U.data.length;while(U=U.next){var Q=U.data,J=$>Q.length?Q.length:$;if(Q.copy(z,z.length-$,0,J),$-=J,$===0){if(J===Q.length)if(++I,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=Q.slice(J);break}++I}return Y.length-=I,z}function Tg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,tI.nextTick(Sp0,Y,$)}function Sp0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function i60($,Y){for(var z=0,U=$.length;z{d60.exports=U3;var cM=dY(),p60=Object.create(M4());p60.inherits=X1();p60.inherits(U3,cM);function gp0($,Y){var z=this._transformState;z.transforming=!1;var U=z.writecb;if(!U)return this.emit("error",Error("write callback called multiple times"));if(z.writechunk=null,z.writecb=null,Y!=null)this.push(Y);U($);var I=this._readableState;if(I.reading=!1,I.needReadable||I.length{o60.exports=rH;var m60=Cg(),l60=Object.create(M4());l60.inherits=X1();l60.inherits(rH,m60);function rH($){if(!(this instanceof rH))return new rH($);m60.call(this,$)}rH.prototype._transform=function($,Y,z){z(null,$)}});var Rg=E((d6,nM)=>{var r5=J0("stream");if(process.env.READABLE_STREAM==="disable"&&r5)nM.exports=r5,d6=nM.exports=r5.Readable,d6.Readable=r5.Readable,d6.Writable=r5.Writable,d6.Duplex=r5.Duplex,d6.Transform=r5.Transform,d6.PassThrough=r5.PassThrough,d6.Stream=r5;else d6=nM.exports=Mg(),d6.Stream=r5||d6,d6.Readable=d6,d6.Writable=Fg(),d6.Duplex=dY(),d6.Transform=Cg(),d6.PassThrough=r60()});var I3=E((xp0)=>{xp0.base64=!0;xp0.array=!0;xp0.string=!0;xp0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";xp0.nodebuffer=typeof Buffer<"u";xp0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")xp0.blob=!1;else{pM=new ArrayBuffer(0);try{xp0.blob=new Blob([pM],{type:"application/zip"}).size===0}catch($){try{vg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,dM=new vg,dM.append(pM),xp0.blob=dM.getBlob("application/zip").size===0}catch(Y){xp0.blob=!1}}}var pM,vg,dM;try{xp0.nodestream=!!Rg().Readable}catch($){xp0.nodestream=!1}});var hg=E((mp0)=>{var pp0=c4(),dp0=I3(),s5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";mp0.encode=function($){var Y=[],z,U,I,Q,J,K,G,H=0,W=$.length,X=W,Z=pp0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)z=$.charCodeAt(H++),U=H>2,J=(z&3)<<4|U>>4,K=X>1?(U&15)<<2|I>>6:64,G=X>2?I&63:64,Y.push(s5.charAt(Q)+s5.charAt(J)+s5.charAt(K)+s5.charAt(G))}return Y.join("")};mp0.decode=function($){var Y,z,U,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)===s5.charAt(64))X--;if($.charAt($.length-2)===s5.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(dp0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(I=s5.indexOf($.charAt(G++)),Q=s5.indexOf($.charAt(G++)),J=s5.indexOf($.charAt(G++)),K=s5.indexOf($.charAt(G++)),Y=I<<2|Q>>4,z=(Q&15)<<4|J>>2,U=(J&3)<<6|K,Z[H++]=Y,J!==64)Z[H++]=z;if(K!==64)Z[H++]=U}return Z}});var sH=E((Up1,s60)=>{s60.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 e60=E((Qp1,t60)=>{var Ip1=global.MutationObserver||global.WebKitMutationObserver,a60;a60=function(){process.nextTick(ep0)};var rp0,sp0,ap0,tp0,Sg,aH=[];function ep0(){Sg=!0;var $,Y,z=aH.length;while(z){Y=aH,aH=[],$=-1;while(++${var $80=e60();function $Q(){}var X8={},Y80=["REJECTED"],gg=["FULFILLED"],z80=["PENDING"];eI=["UNHANDLED"];var eI;Q80.exports=g7;function g7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=z80,this.queue=[],this.outcome=void 0,this.handled=eI,$!==$Q)U80(this,$)}g7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(z,U);function z(I){function Q(){return I}return Y.resolve($()).then(Q)}function U(I){function Q(){throw I}return Y.resolve($()).then(Q)}};g7.prototype.catch=function($){return this.then(null,$)};g7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===gg||typeof Y!=="function"&&this.state===Y80)return this;var z=new this.constructor($Q);if(this.handled===eI)this.handled=null;if(this.state!==z80){var U=this.state===gg?$:Y;yg(z,U,this.outcome)}else this.queue.push(new tH(z,$,Y));return z};function tH($,Y,z){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof z==="function")this.onRejected=z,this.callRejected=this.otherCallRejected}tH.prototype.callFulfilled=function($){X8.resolve(this.promise,$)};tH.prototype.otherCallFulfilled=function($){yg(this.promise,this.onFulfilled,$)};tH.prototype.callRejected=function($){X8.reject(this.promise,$)};tH.prototype.otherCallRejected=function($){yg(this.promise,this.onRejected,$)};function yg($,Y,z){$80(function(){var U;try{U=Y(z)}catch(I){return X8.reject($,I)}if(U===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,U)})}X8.resolve=function($,Y){var z=I80(Yd0,Y);if(z.status==="error")return X8.reject($,z.value);var U=z.value;if(U)U80($,U);else{$.state=gg,$.outcome=Y;var I=-1,Q=$.queue.length;while(++I{var kg=null;if(typeof Promise<"u")kg=Promise;else kg=J80();K80.exports={Promise:kg}});var xg=E((G80)=>{(function($,Y){if($.setImmediate)return;var z=1,U={},I=!1,Q=$.document,J;function K(O){if(typeof O!=="function")O=Function(""+O);var D=Array(arguments.length-1);for(var N=0;N"u"?typeof global>"u"?G80:global:self)});var c4=E((Gd0)=>{var y7=I3(),Jd0=hg(),zQ=sH(),fg=YQ();xg();function Kd0($){var Y=null;if(y7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return lM($,Y)}Gd0.newBlob=function($,Y){Gd0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(I){try{var z=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,U=new z;return U.append($),U.getBlob(Y)}catch(Q){throw Error("Bug : can't construct the Blob.")}}};function eH($){return $}function lM($,Y){for(var z=0;z<$.length;++z)Y[z]=$.charCodeAt(z)&255;return Y}var mM={stringifyByChunk:function($,Y,z){var U=[],I=0,Q=$.length;if(Q<=z)return String.fromCharCode.apply(null,$);while(I1)try{return mM.stringifyByChunk($,z,Y)}catch(I){Y=Math.floor(Y/2)}return mM.stringifyByChar($)}Gd0.applyFromCharCode=$W;function oM($,Y){for(var z=0;z<$.length;z++)Y[z]=$[z];return Y}var k7={};k7.string={string:eH,array:function($){return lM($,Array($.length))},arraybuffer:function($){return k7.string.uint8array($).buffer},uint8array:function($){return lM($,new Uint8Array($.length))},nodebuffer:function($){return lM($,zQ.allocBuffer($.length))}};k7.array={string:$W,array:eH,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return zQ.newBufferFrom($)}};k7.arraybuffer={string:function($){return $W(new Uint8Array($))},array:function($){return oM(new Uint8Array($),Array($.byteLength))},arraybuffer:eH,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return zQ.newBufferFrom(new Uint8Array($))}};k7.uint8array={string:$W,array:function($){return oM($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:eH,nodebuffer:function($){return zQ.newBufferFrom($)}};k7.nodebuffer={string:$W,array:function($){return oM($,Array($.length))},arraybuffer:function($){return k7.nodebuffer.uint8array($).buffer},uint8array:function($){return oM($,new Uint8Array($.length))},nodebuffer:eH};Gd0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;Gd0.checkSupport($);var z=Gd0.getTypeOf(Y),U=k7[z][$](Y);return U};Gd0.resolve=function($){var Y=$.split("/"),z=[];for(var U=0;U"u")$[z]=arguments[Y][z];return $};Gd0.prepareContent=function($,Y,z,U,I){var Q=fg.Promise.resolve(Y).then(function(J){var K=y7.blob&&(J instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(J))!==-1);if(K&&typeof FileReader<"u")return new fg.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=Gd0.getTypeOf(J);if(!K)return fg.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")J=Gd0.transformTo("uint8array",J);else if(K==="string"){if(I)J=Jd0.decode(J);else if(z){if(U!==!0)J=Kd0(J)}}return J})}});var J$=E((Wp1,Z80)=>{function X80($){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}X80.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 z=0;z "+$;else return $}};Z80.exports=X80});var IQ=E((Pd0)=>{var UQ=c4(),mY=I3(),Od0=sH(),rM=J$(),YW=Array(256);for(a5=0;a5<256;a5++)YW[a5]=a5>=252?6:a5>=248?5:a5>=240?4:a5>=224?3:a5>=192?2:1;var a5;YW[254]=YW[254]=1;var Nd0=function($){var Y,z,U,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|z&63;else if(z<65536)Y[Q++]=224|z>>>12,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63;else Y[Q++]=240|z>>>18,Y[Q++]=128|z>>>12&63,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63}return Y},Dd0=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+YW[$[z]]>Y?z:Y},Ad0=function($){var Y,z,U,I,Q=$.length,J=Array(Q*2);for(z=0,Y=0;Y4){J[z++]=65533,Y+=I-1;continue}U&=I===2?31:I===3?15:7;while(I>1&&Y1){J[z++]=65533;continue}if(U<65536)J[z++]=U;else U-=65536,J[z++]=55296|U>>10&1023,J[z++]=56320|U&1023}if(J.length!==z)if(J.subarray)J=J.subarray(0,z);else J.length=z;return UQ.applyFromCharCode(J)};Pd0.utf8encode=function(Y){if(mY.nodebuffer)return Od0.newBufferFrom(Y,"utf-8");return Nd0(Y)};Pd0.utf8decode=function(Y){if(mY.nodebuffer)return UQ.transformTo("nodebuffer",Y).toString("utf-8");return Y=UQ.transformTo(mY.uint8array?"uint8array":"array",Y),Ad0(Y)};function sM(){rM.call(this,"utf-8 decode"),this.leftOver=null}UQ.inherits(sM,rM);sM.prototype.processChunk=function($){var Y=UQ.transformTo(mY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(mY.uint8array){var z=Y;Y=new Uint8Array(z.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(z,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var U=Dd0(Y),I=Y;if(U!==Y.length)if(mY.uint8array)I=Y.subarray(0,U),this.leftOver=Y.subarray(U,Y.length);else I=Y.slice(0,U),this.leftOver=Y.slice(U,Y.length);this.push({data:Pd0.utf8decode(I),meta:$.meta})};sM.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Pd0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Pd0.Utf8DecodeWorker=sM;function bg(){rM.call(this,"utf-8 encode")}UQ.inherits(bg,rM);bg.prototype.processChunk=function($){this.push({data:Pd0.utf8encode($.data),meta:$.meta})};Pd0.Utf8EncodeWorker=bg});var w80=E((Zp1,F80)=>{var V80=J$(),L80=c4();function cg($){V80.call(this,"ConvertWorker to "+$),this.destType=$}L80.inherits(cg,V80);cg.prototype.processChunk=function($){this.push({data:L80.transformTo(this.destType,$.data),meta:$.meta})};F80.exports=cg});var N80=E((qp1,O80)=>{var M80=Rg().Readable,jd0=c4();jd0.inherits(ng,M80);function ng($,Y,z){M80.call(this,Y),this._helper=$;var U=this;$.on("data",function(I,Q){if(!U.push(I))U._helper.pause();if(z)z(Q)}).on("error",function(I){U.emit("error",I)}).on("end",function(){U.push(null)})}ng.prototype._read=function(){this._helper.resume()};O80.exports=ng});var pg=E((Vp1,P80)=>{var lY=c4(),Ed0=w80(),Cd0=J$(),Rd0=hg(),_d0=I3(),vd0=YQ(),D80=null;if(_d0.nodestream)try{D80=N80()}catch($){}function hd0($,Y,z){switch($){case"blob":return lY.newBlob(lY.transformTo("arraybuffer",Y),z);case"base64":return Rd0.encode(Y);default:return lY.transformTo($,Y)}}function Sd0($,Y){var z,U=0,I=null,Q=0;for(z=0;z{yd0.base64=!1;yd0.binary=!1;yd0.dir=!1;yd0.createFolders=!0;yd0.date=null;yd0.compression=null;yd0.compressionOptions=null;yd0.comment=null;yd0.unixPermissions=null;yd0.dosPermissions=null});var mg=E((Fp1,B80)=>{var aM=c4(),tM=J$(),md0=16384;function QQ($){tM.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(z){if(Y.dataIsReady=!0,Y.data=z,Y.max=z&&z.length||0,Y.type=aM.getTypeOf(z),!Y.isPaused)Y._tickAndRepeat()},function(z){Y.error(z)})}aM.inherits(QQ,tM);QQ.prototype.cleanUp=function(){tM.prototype.cleanUp.call(this),this.data=null};QQ.prototype.resume=function(){if(!tM.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,aM.delay(this._tickAndRepeat,[],this);return!0};QQ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)aM.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};QQ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=md0,Y=null,z=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,z);break;case"uint8array":Y=this.data.subarray(this.index,z);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,z);break}return this.index=z,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};B80.exports=QQ});var eM=E((wp1,j80)=>{var ld0=c4();function od0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var T80=od0();function rd0($,Y,z,U){var I=T80,Q=U+z;$=$^-1;for(var J=U;J>>8^I[($^Y[J])&255];return $^-1}function sd0($,Y,z,U){var I=T80,Q=U+z;$=$^-1;for(var J=U;J>>8^I[($^Y.charCodeAt(J))&255];return $^-1}j80.exports=function(Y,z){if(typeof Y>"u"||!Y.length)return 0;var U=ld0.getTypeOf(Y)!=="string";if(U)return rd0(z|0,Y,Y.length,0);else return sd0(z|0,Y,Y.length,0)}});var og=E((Mp1,C80)=>{var E80=J$(),ad0=eM(),td0=c4();function lg(){E80.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}td0.inherits(lg,E80);lg.prototype.processChunk=function($){this.streamInfo.crc32=ad0($.data,this.streamInfo.crc32||0),this.push($)};C80.exports=lg});var _80=E((Op1,R80)=>{var ed0=c4(),rg=J$();function sg($){rg.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}ed0.inherits(sg,rg);sg.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}rg.prototype.processChunk.call(this,$)};R80.exports=sg});var $O=E((Np1,S80)=>{var v80=YQ(),h80=mg(),$m0=og(),ag=_80();function tg($,Y,z,U,I){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=z,this.compression=U,this.compressedContent=I}tg.prototype={getContentWorker:function(){var $=new h80(v80.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new ag("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 h80(v80.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};tg.createWorkerFrom=function($,Y,z){return $.pipe(new $m0).pipe(new ag("uncompressedSize")).pipe(Y.compressWorker(z)).pipe(new ag("compressedSize")).withStreamInfo("compression",Y)};S80.exports=tg});var x80=E((Dp1,k80)=>{var Ym0=pg(),zm0=mg(),eg=IQ(),$y=$O(),g80=J$(),Yy=function($,Y,z){this.name=$,this.dir=z.dir,this.date=z.date,this.comment=z.comment,this.unixPermissions=z.unixPermissions,this.dosPermissions=z.dosPermissions,this._data=Y,this._dataBinary=z.binary,this.options={compression:z.compression,compressionOptions:z.compressionOptions}};Yy.prototype={internalStream:function($){var Y=null,z="string";try{if(!$)throw Error("No output type specified.");z=$.toLowerCase();var U=z==="string"||z==="text";if(z==="binarystring"||z==="text")z="string";Y=this._decompressWorker();var I=!this._dataBinary;if(I&&!U)Y=Y.pipe(new eg.Utf8EncodeWorker);if(!I&&U)Y=Y.pipe(new eg.Utf8DecodeWorker)}catch(Q){Y=new g80("error"),Y.error(Q)}return new Ym0(Y,z,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof $y&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var z=this._decompressWorker();if(!this._dataBinary)z=z.pipe(new eg.Utf8EncodeWorker);return $y.createWorkerFrom(z,$,Y)}},_decompressWorker:function(){if(this._data instanceof $y)return this._data.getContentWorker();else if(this._data instanceof g80)return this._data;else return new zm0(this._data)}};var y80=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Um0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(zW=0;zW{var Km0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Gm0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}zy.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var z=Y.shift();if(!z)continue;if(typeof z!=="object")throw TypeError(z+"must be non-object");for(var U in z)if(Gm0(z,U))$[U]=z[U]}return $};zy.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var Hm0={arraySet:function($,Y,z,U,I){if(Y.subarray&&$.subarray){$.set(Y.subarray(z,z+U),I);return}for(var Q=0;Q{var Zm0=Q3(),qm0=4,u80=0,b80=1,Vm0=2;function KQ($){var Y=$.length;while(--Y>=0)$[Y]=0}var Lm0=0,m80=1,Fm0=2,wm0=3,Mm0=258,Wy=29,GW=256,IW=GW+1+Wy,JQ=30,Xy=19,l80=2*IW+1,oY=15,Iy=16,Om0=7,Zy=256,o80=16,r80=17,s80=18,Gy=[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],YO=[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],Nm0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],a80=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Dm0=512,J3=Array((IW+2)*2);KQ(J3);var UW=Array(JQ*2);KQ(UW);var QW=Array(Dm0);KQ(QW);var JW=Array(Mm0-wm0+1);KQ(JW);var qy=Array(Wy);KQ(qy);var zO=Array(JQ);KQ(zO);function Qy($,Y,z,U,I){this.static_tree=$,this.extra_bits=Y,this.extra_base=z,this.elems=U,this.max_length=I,this.has_stree=$&&$.length}var t80,e80,$$0;function Jy($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function Y$0($){return $<256?QW[$]:QW[256+($>>>7)]}function KW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function n8($,Y,z){if($.bi_valid>Iy-z)$.bi_buf|=Y<<$.bi_valid&65535,KW($,$.bi_buf),$.bi_buf=Y>>Iy-$.bi_valid,$.bi_valid+=z-Iy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=z}function t5($,Y,z){n8($,z[Y*2],z[Y*2+1])}function z$0($,Y){var z=0;do z|=$&1,$>>>=1,z<<=1;while(--Y>0);return z>>>1}function Am0($){if($.bi_valid===16)KW($,$.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 Pm0($,Y){var{dyn_tree:z,max_code:U}=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,F=0;for(Z=0;Z<=oY;Z++)$.bl_count[Z]=0;z[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(z[W*2+1]=Z,W>U)continue;if($.bl_count[Z]++,q=0,W>=K)q=J[W-K];if(V=z[W*2],$.opt_len+=V*(Z+q),Q)$.static_len+=V*(I[W*2+1]+q)}if(F===0)return;do{Z=G-1;while($.bl_count[Z]===0)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[G]--,F-=2}while(F>0);for(Z=G;Z!==0;Z--){W=$.bl_count[Z];while(W!==0){if(X=$.heap[--H],X>U)continue;if(z[X*2+1]!==Z)$.opt_len+=(Z-z[X*2+1])*z[X*2],z[X*2+1]=Z;W--}}}function U$0($,Y,z){var U=Array(oY+1),I=0,Q,J;for(Q=1;Q<=oY;Q++)U[Q]=I=I+z[Q-1]<<1;for(J=0;J<=Y;J++){var K=$[J*2+1];if(K===0)continue;$[J*2]=z$0(U[K]++,K)}}function Bm0(){var $,Y,z,U,I,Q=Array(oY+1);z=0;for(U=0;U>=7;for(;U8)KW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function Tm0($,Y,z,U){if(Q$0($),U)KW($,z),KW($,~z);Zm0.arraySet($.pending_buf,$.window,Y,z,$.pending),$.pending+=z}function i80($,Y,z,U){var I=Y*2,Q=z*2;return $[I]<$[Q]||$[I]===$[Q]&&U[Y]<=U[z]}function Ky($,Y,z){var U=$.heap[z],I=z<<1;while(I<=$.heap_len){if(I<$.heap_len&&i80(Y,$.heap[I+1],$.heap[I],$.depth))I++;if(i80(Y,U,$.heap[I],$.depth))break;$.heap[z]=$.heap[I],z=I,I<<=1}$.heap[z]=U}function c80($,Y,z){var U,I,Q=0,J,K;if($.last_lit!==0)do if(U=$.pending_buf[$.d_buf+Q*2]<<8|$.pending_buf[$.d_buf+Q*2+1],I=$.pending_buf[$.l_buf+Q],Q++,U===0)t5($,I,Y);else{if(J=JW[I],t5($,J+GW+1,Y),K=Gy[J],K!==0)I-=qy[J],n8($,I,K);if(U--,J=Y$0(U),t5($,J,z),K=YO[J],K!==0)U-=zO[J],n8($,U,K)}while(Q<$.last_lit);t5($,Zy,Y)}function Hy($,Y){var z=Y.dyn_tree,U=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=l80;for(J=0;J>1;J>=1;J--)Ky($,z,J);H=Q;do J=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Ky($,z,1),K=$.heap[1],$.heap[--$.heap_max]=J,$.heap[--$.heap_max]=K,z[H*2]=z[J*2]+z[K*2],$.depth[H]=($.depth[J]>=$.depth[K]?$.depth[J]:$.depth[K])+1,z[J*2+1]=z[K*2+1]=H,$.heap[1]=H++,Ky($,z,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Pm0($,Y),U$0(z,G,$.bl_count)}function n80($,Y,z){var U,I=-1,Q,J=Y[1],K=0,G=7,H=4;if(J===0)G=138,H=3;Y[(z+1)*2+1]=65535;for(U=0;U<=z;U++){if(Q=J,J=Y[(U+1)*2+1],++K=3;Y--)if($.bl_tree[a80[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function Em0($,Y,z,U){var I;n8($,Y-257,5),n8($,z-1,5),n8($,U-4,4);for(I=0;I>>=1)if(Y&1&&$.dyn_ltree[z*2]!==0)return u80;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return b80;for(z=32;z0){if($.strm.data_type===Vm0)$.strm.data_type=Cm0($);if(Hy($,$.l_desc),Hy($,$.d_desc),J=jm0($),I=$.opt_len+3+7>>>3,Q=$.static_len+3+7>>>3,Q<=I)I=Q}else I=Q=z+5;if(z+4<=I&&Y!==-1)J$0($,Y,z,U);else if($.strategy===qm0||Q===I)n8($,(m80<<1)+(U?1:0),3),c80($,J3,UW);else n8($,(Fm0<<1)+(U?1:0),3),Em0($,$.l_desc.max_code+1,$.d_desc.max_code+1,J+1),c80($,$.dyn_ltree,$.dyn_dtree);if(I$0($),U)Q$0($)}function hm0($,Y,z){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]=z&255,$.last_lit++,Y===0)$.dyn_ltree[z*2]++;else $.matches++,Y--,$.dyn_ltree[(JW[z]+GW+1)*2]++,$.dyn_dtree[Y$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}Sm0._tr_init=Rm0;Sm0._tr_stored_block=J$0;Sm0._tr_flush_block=vm0;Sm0._tr_tally=hm0;Sm0._tr_align=_m0});var Vy=E((Bp1,G$0)=>{function um0($,Y,z,U){var I=$&65535|0,Q=$>>>16&65535|0,J=0;while(z!==0){J=z>2000?2000:z,z-=J;do I=I+Y[U++]|0,Q=Q+I|0;while(--J);I%=65521,Q%=65521}return I|Q<<16|0}G$0.exports=um0});var Ly=E((Tp1,H$0)=>{function bm0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var im0=bm0();function cm0($,Y,z,U){var I=im0,Q=U+z;$^=-1;for(var J=U;J>>8^I[($^Y[J])&255];return $^-1}H$0.exports=cm0});var UO=E((jp1,W$0)=>{W$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 O$0=E((Dl0)=>{var j8=Q3(),j$=K$0(),V$0=Vy(),x7=Ly(),nm0=UO(),tY=0,pm0=1,dm0=3,c7=4,X$0=5,$9=0,Z$0=1,E$=-2,mm0=-3,Fy=-5,lm0=-1,om0=1,IO=2,rm0=3,sm0=4,am0=0,tm0=2,GO=8,em0=9,$l0=15,Yl0=8,zl0=29,Ul0=256,My=Ul0+1+zl0,Il0=30,Ql0=19,Jl0=2*My+1,Kl0=15,f1=3,b7=258,W5=b7+f1+1,Gl0=32,HO=42,Oy=69,QO=73,JO=91,KO=103,rY=113,WW=666,P6=1,XW=2,sY=3,WQ=4,Hl0=3;function i7($,Y){return $.msg=nm0[Y],Y}function q$0($){return($<<1)-($>4?9:0)}function u7($){var Y=$.length;while(--Y>=0)$[Y]=0}function f7($){var Y=$.state,z=Y.pending;if(z>$.avail_out)z=$.avail_out;if(z===0)return;if(j8.arraySet($.output,Y.pending_buf,Y.pending_out,z,$.next_out),$.next_out+=z,Y.pending_out+=z,$.total_out+=z,$.avail_out-=z,Y.pending-=z,Y.pending===0)Y.pending_out=0}function m6($,Y){j$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,f7($.strm)}function r1($,Y){$.pending_buf[$.pending++]=Y}function HW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function Wl0($,Y,z,U){var I=$.avail_in;if(I>U)I=U;if(I===0)return 0;if($.avail_in-=I,j8.arraySet(Y,$.input,$.next_in,I,z),$.state.wrap===1)$.adler=V$0($.adler,Y,I,z);else if($.state.wrap===2)$.adler=x7($.adler,Y,I,z);return $.next_in+=I,$.total_in+=I,I}function L$0($,Y){var{max_chain_length:z,strstart:U}=$,I,Q,J=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-W5?$.strstart-($.w_size-W5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+b7,q=H[U+J-1],V=H[U+J];if($.prev_length>=$.good_match)z>>=2;if(K>$.lookahead)K=$.lookahead;do{if(I=Y,H[I+J]!==V||H[I+J-1]!==q||H[I]!==H[U]||H[++I]!==H[U+1])continue;U+=2,I++;do;while(H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&H[++U]===H[++I]&&UJ){if($.match_start=Y,J=Q,Q>=K)break;q=H[U+J-1],V=H[U+J]}}while((Y=X[Y&W])>G&&--z!==0);if(J<=$.lookahead)return J;return $.lookahead}function aY($){var Y=$.w_size,z,U,I,Q,J;do{if(Q=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-W5)){j8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,U=$.hash_size,z=U;do I=$.head[--z],$.head[z]=I>=Y?I-Y:0;while(--U);U=Y,z=U;do I=$.prev[--z],$.prev[z]=I>=Y?I-Y:0;while(--U);Q+=Y}if($.strm.avail_in===0)break;if(U=Wl0($.strm,$.window,$.strstart+$.lookahead,Q),$.lookahead+=U,$.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)z=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(aY($),$.lookahead===0&&Y===tY)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var U=$.block_start+z;if($.strstart===0||$.strstart>=U){if($.lookahead=$.strstart-U,$.strstart=U,m6($,!1),$.strm.avail_out===0)return P6}if($.strstart-$.block_start>=$.w_size-W5){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===c7){if(m6($,!0),$.strm.avail_out===0)return sY;return WQ}if($.strstart>$.block_start){if(m6($,!1),$.strm.avail_out===0)return P6}return P6}function wy($,Y){var z,U;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(z!==0&&$.strstart-z<=$.w_size-W5)$.match_length=L$0($,z);if($.match_length>=f1)if(U=j$._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,z=$.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 U=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,z!==0&&$.prev_length<$.max_lazy_match&&$.strstart-z<=$.w_size-W5){if($.match_length=L$0($,z),$.match_length<=5&&($.strategy===om0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){I=$.strstart+$.lookahead-f1,U=j$._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,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,U){if(m6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(U=j$._tr_tally($,0,$.window[$.strstart-1]),U)m6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)U=j$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(I=$.strstart-1,U=J[I],U===J[++I]&&U===J[++I]&&U===J[++I]){Q=$.strstart+b7;do;while(U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&U===J[++I]&&I$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)z=j$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===c7){if(m6($,!0),$.strm.avail_out===0)return sY;return WQ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function ql0($,Y){var z;for(;;){if($.lookahead===0){if(aY($),$.lookahead===0){if(Y===tY)return P6;break}}if($.match_length=0,z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,z){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===c7){if(m6($,!0),$.strm.avail_out===0)return sY;return WQ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function e5($,Y,z,U,I){this.good_length=$,this.max_lazy=Y,this.nice_length=z,this.max_chain=U,this.func=I}var HQ;HQ=[new e5(0,0,0,0,Xl0),new e5(4,4,8,4,wy),new e5(4,5,16,8,wy),new e5(4,6,32,32,wy),new e5(4,4,16,16,GQ),new e5(8,16,32,32,GQ),new e5(8,16,128,128,GQ),new e5(8,32,128,256,GQ),new e5(32,128,258,1024,GQ),new e5(32,258,258,4096,GQ)];function Vl0($){$.window_size=2*$.w_size,u7($.head),$.max_lazy_match=HQ[$.level].max_lazy,$.good_match=HQ[$.level].good_length,$.nice_match=HQ[$.level].nice_length,$.max_chain_length=HQ[$.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 Ll0(){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=GO,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 j8.Buf16(Jl0*2),this.dyn_dtree=new j8.Buf16((2*Il0+1)*2),this.bl_tree=new j8.Buf16((2*Ql0+1)*2),u7(this.dyn_ltree),u7(this.dyn_dtree),u7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new j8.Buf16(Kl0+1),this.heap=new j8.Buf16(2*My+1),u7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new j8.Buf16(2*My+1),u7(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 F$0($){var Y;if(!$||!$.state)return i7($,E$);if($.total_in=$.total_out=0,$.data_type=tm0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?HO:rY,$.adler=Y.wrap===2?0:1,Y.last_flush=tY,j$._tr_init(Y),$9}function w$0($){var Y=F$0($);if(Y===$9)Vl0($.state);return Y}function Fl0($,Y){if(!$||!$.state)return E$;if($.state.wrap!==2)return E$;return $.state.gzhead=Y,$9}function M$0($,Y,z,U,I,Q){if(!$)return E$;var J=1;if(Y===lm0)Y=6;if(U<0)J=0,U=-U;else if(U>15)J=2,U-=16;if(I<1||I>em0||z!==GO||U<8||U>15||Y<0||Y>9||Q<0||Q>sm0)return i7($,E$);if(U===8)U=9;var K=new Ll0;return $.state=K,K.strm=$,K.wrap=J,K.gzhead=null,K.w_bits=U,K.w_size=1<X$0||Y<0)return $?i7($,E$):E$;if(U=$.state,!$.output||!$.input&&$.avail_in!==0||U.status===WW&&Y!==c7)return i7($,$.avail_out===0?Fy:E$);if(U.strm=$,z=U.last_flush,U.last_flush=Y,U.status===HO)if(U.wrap===2)if($.adler=0,r1(U,31),r1(U,139),r1(U,8),!U.gzhead)r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,U.level===9?2:U.strategy>=IO||U.level<2?4:0),r1(U,Hl0),U.status=rY;else{if(r1(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(!U.gzhead.extra?0:4)+(!U.gzhead.name?0:8)+(!U.gzhead.comment?0:16)),r1(U,U.gzhead.time&255),r1(U,U.gzhead.time>>8&255),r1(U,U.gzhead.time>>16&255),r1(U,U.gzhead.time>>24&255),r1(U,U.level===9?2:U.strategy>=IO||U.level<2?4:0),r1(U,U.gzhead.os&255),U.gzhead.extra&&U.gzhead.extra.length)r1(U,U.gzhead.extra.length&255),r1(U,U.gzhead.extra.length>>8&255);if(U.gzhead.hcrc)$.adler=x7($.adler,U.pending_buf,U.pending,0);U.gzindex=0,U.status=Oy}else{var J=GO+(U.w_bits-8<<4)<<8,K=-1;if(U.strategy>=IO||U.level<2)K=0;else if(U.level<6)K=1;else if(U.level===6)K=2;else K=3;if(J|=K<<6,U.strstart!==0)J|=Gl0;if(J+=31-J%31,U.status=rY,HW(U,J),U.strstart!==0)HW(U,$.adler>>>16),HW(U,$.adler&65535);$.adler=1}if(U.status===Oy)if(U.gzhead.extra){I=U.pending;while(U.gzindex<(U.gzhead.extra.length&65535)){if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(f7($),I=U.pending,U.pending===U.pending_buf_size)break}r1(U,U.gzhead.extra[U.gzindex]&255),U.gzindex++}if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(U.gzindex===U.gzhead.extra.length)U.gzindex=0,U.status=QO}else U.status=QO;if(U.status===QO)if(U.gzhead.name){I=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(f7($),I=U.pending,U.pending===U.pending_buf_size){Q=1;break}}if(U.gzindexI)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(Q===0)U.gzindex=0,U.status=JO}else U.status=JO;if(U.status===JO)if(U.gzhead.comment){I=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>I)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(f7($),I=U.pending,U.pending===U.pending_buf_size){Q=1;break}}if(U.gzindexI)$.adler=x7($.adler,U.pending_buf,U.pending-I,I);if(Q===0)U.status=KO}else U.status=KO;if(U.status===KO)if(U.gzhead.hcrc){if(U.pending+2>U.pending_buf_size)f7($);if(U.pending+2<=U.pending_buf_size)r1(U,$.adler&255),r1(U,$.adler>>8&255),$.adler=0,U.status=rY}else U.status=rY;if(U.pending!==0){if(f7($),$.avail_out===0)return U.last_flush=-1,$9}else if($.avail_in===0&&q$0(Y)<=q$0(z)&&Y!==c7)return i7($,Fy);if(U.status===WW&&$.avail_in!==0)return i7($,Fy);if($.avail_in!==0||U.lookahead!==0||Y!==tY&&U.status!==WW){var G=U.strategy===IO?ql0(U,Y):U.strategy===rm0?Zl0(U,Y):HQ[U.level].func(U,Y);if(G===sY||G===WQ)U.status=WW;if(G===P6||G===sY){if($.avail_out===0)U.last_flush=-1;return $9}if(G===XW){if(Y===pm0)j$._tr_align(U);else if(Y!==X$0){if(j$._tr_stored_block(U,0,0,!1),Y===dm0){if(u7(U.head),U.lookahead===0)U.strstart=0,U.block_start=0,U.insert=0}}if(f7($),$.avail_out===0)return U.last_flush=-1,$9}}if(Y!==c7)return $9;if(U.wrap<=0)return Z$0;if(U.wrap===2)r1(U,$.adler&255),r1(U,$.adler>>8&255),r1(U,$.adler>>16&255),r1(U,$.adler>>24&255),r1(U,$.total_in&255),r1(U,$.total_in>>8&255),r1(U,$.total_in>>16&255),r1(U,$.total_in>>24&255);else HW(U,$.adler>>>16),HW(U,$.adler&65535);if(f7($),U.wrap>0)U.wrap=-U.wrap;return U.pending!==0?$9:Z$0}function Ol0($){var Y;if(!$||!$.state)return E$;if(Y=$.state.status,Y!==HO&&Y!==Oy&&Y!==QO&&Y!==JO&&Y!==KO&&Y!==rY&&Y!==WW)return i7($,E$);return $.state=null,Y===rY?i7($,mm0):$9}function Nl0($,Y){var z=Y.length,U,I,Q,J,K,G,H,W;if(!$||!$.state)return E$;if(U=$.state,J=U.wrap,J===2||J===1&&U.status!==HO||U.lookahead)return E$;if(J===1)$.adler=V$0($.adler,Y,z,0);if(U.wrap=0,z>=U.w_size){if(J===0)u7(U.head),U.strstart=0,U.block_start=0,U.insert=0;W=new j8.Buf8(U.w_size),j8.arraySet(W,Y,z-U.w_size,U.w_size,0),Y=W,z=U.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=z,$.next_in=0,$.input=Y,aY(U);while(U.lookahead>=f1){I=U.strstart,Q=U.lookahead-(f1-1);do U.ins_h=(U.ins_h<{var WO=Q3(),N$0=!0,D$0=!0;try{String.fromCharCode.apply(null,[0])}catch($){N$0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){D$0=!1}var ZW=new WO.Buf8(256);for(Y9=0;Y9<256;Y9++)ZW[Y9]=Y9>=252?6:Y9>=248?5:Y9>=240?4:Y9>=224?3:Y9>=192?2:1;var Y9;ZW[254]=ZW[254]=1;vl0.string2buf=function($){var Y,z,U,I,Q,J=$.length,K=0;for(I=0;I>>6,Y[Q++]=128|z&63;else if(z<65536)Y[Q++]=224|z>>>12,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63;else Y[Q++]=240|z>>>18,Y[Q++]=128|z>>>12&63,Y[Q++]=128|z>>>6&63,Y[Q++]=128|z&63}return Y};function A$0($,Y){if(Y<65534){if($.subarray&&D$0||!$.subarray&&N$0)return String.fromCharCode.apply(null,WO.shrinkBuf($,Y))}var z="";for(var U=0;U4){K[U++]=65533,z+=Q-1;continue}I&=Q===2?31:Q===3?15:7;while(Q>1&&z1){K[U++]=65533;continue}if(I<65536)K[U++]=I;else I-=65536,K[U++]=55296|I>>10&1023,K[U++]=56320|I&1023}return A$0(K,U)};vl0.utf8border=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+ZW[$[z]]>Y?z:Y}});var Dy=E((Rp1,P$0)=>{function xl0(){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}P$0.exports=xl0});var E$0=E((dl0)=>{var qW=O$0(),VW=Q3(),Py=Ny(),By=UO(),fl0=Dy(),j$0=Object.prototype.toString,ul0=0,Ay=4,XQ=0,B$0=1,T$0=2,bl0=-1,il0=0,cl0=8;function eY($){if(!(this instanceof eY))return new eY($);this.options=VW.assign({level:bl0,method:cl0,chunkSize:16384,windowBits:15,memLevel:8,strategy:il0,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 fl0,this.strm.avail_out=0;var z=qW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(z!==XQ)throw Error(By[z]);if(Y.header)qW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var U;if(typeof Y.dictionary==="string")U=Py.string2buf(Y.dictionary);else if(j$0.call(Y.dictionary)==="[object ArrayBuffer]")U=new Uint8Array(Y.dictionary);else U=Y.dictionary;if(z=qW.deflateSetDictionary(this.strm,U),z!==XQ)throw Error(By[z]);this._dict_set=!0}}eY.prototype.push=function($,Y){var z=this.strm,U=this.options.chunkSize,I,Q;if(this.ended)return!1;if(Q=Y===~~Y?Y:Y===!0?Ay:ul0,typeof $==="string")z.input=Py.string2buf($);else if(j$0.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new VW.Buf8(U),z.next_out=0,z.avail_out=U;if(I=qW.deflate(z,Q),I!==B$0&&I!==XQ)return this.onEnd(I),this.ended=!0,!1;if(z.avail_out===0||z.avail_in===0&&(Q===Ay||Q===T$0))if(this.options.to==="string")this.onData(Py.buf2binstring(VW.shrinkBuf(z.output,z.next_out)));else this.onData(VW.shrinkBuf(z.output,z.next_out))}while((z.avail_in>0||z.avail_out===0)&&I!==B$0);if(Q===Ay)return I=qW.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===XQ;if(Q===T$0)return this.onEnd(XQ),z.avail_out=0,!0;return!0};eY.prototype.onData=function($){this.chunks.push($)};eY.prototype.onEnd=function($){if($===XQ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=VW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function Ty($,Y){var z=new eY(Y);if(z.push($,!0),z.err)throw z.msg||By[z.err];return z.result}function nl0($,Y){return Y=Y||{},Y.raw=!0,Ty($,Y)}function pl0($,Y){return Y=Y||{},Y.gzip=!0,Ty($,Y)}dl0.Deflate=eY;dl0.deflate=Ty;dl0.deflateRaw=nl0;dl0.gzip=pl0});var R$0=E((vp1,C$0)=>{var XO=30,sl0=12;C$0.exports=function(Y,z){var U,I,Q,J,K,G,H,W,X,Z,q,V,F,M,w,O,D,N,B,T,A,j,C,b,k;U=Y.state,I=Y.next_in,b=Y.input,Q=I+(Y.avail_in-5),J=Y.next_out,k=Y.output,K=J-(z-Y.avail_out),G=J+(Y.avail_out-257),H=U.dmax,W=U.wsize,X=U.whave,Z=U.wnext,q=U.window,V=U.hold,F=U.bits,M=U.lencode,w=U.distcode,O=(1<>>24,V>>>=B,F-=B,B=N>>>16&255,B===0)k[J++]=N&65535;else if(B&16){if(T=N&65535,B&=15,B){if(F>>=B,F-=B}if(F<15)V+=b[I++]<>>24,V>>>=B,F-=B,B=N>>>16&255,B&16){if(A=N&65535,B&=15,FH){Y.msg="invalid distance too far back",U.mode=XO;break $}if(V>>>=B,F-=B,B=J-K,A>B){if(B=A-B,B>X){if(U.sane){Y.msg="invalid distance too far back",U.mode=XO;break $}}if(j=0,C=q,Z===0){if(j+=W-B,B2)k[J++]=C[j++],k[J++]=C[j++],k[J++]=C[j++],T-=3;if(T){if(k[J++]=C[j++],T>1)k[J++]=C[j++]}}else{j=J-A;do k[J++]=k[j++],k[J++]=k[j++],k[J++]=k[j++],T-=3;while(T>2);if(T){if(k[J++]=k[j++],T>1)k[J++]=k[j++]}}}else if((B&64)===0){N=w[(N&65535)+(V&(1<>3,I-=T,F-=T<<3,V&=(1<{var _$0=Q3(),ZQ=15,v$0=852,h$0=592,S$0=0,jy=1,g$0=2,al0=[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],tl0=[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],el0=[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],$o0=[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];y$0.exports=function(Y,z,U,I,Q,J,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,M=0,w=0,O=0,D=0,N,B,T,A,j,C=null,b=0,k,h=new _$0.Buf16(ZQ+1),i=new _$0.Buf16(ZQ+1),c=null,U0=0,x,d,t;for(W=0;W<=ZQ;W++)h[W]=0;for(X=0;X=1;q--)if(h[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===S$0||q!==1))return-1;i[1]=0;for(W=1;Wv$0||Y===g$0&&O>h$0)return 1;for(;;){if(x=W-M,K[X]k)d=c[U0+K[X]],t=C[b+K[X]];else d=96,t=0;N=1<>M)+B]=x<<24|d<<16|t|0;while(B!==0);N=1<>=1;if(N!==0)D&=N-1,D+=N;else D=0;if(X++,--h[W]===0){if(W===q)break;W=z[U+K[X]]}if(W>V&&(D&A)!==T){if(M===0)M=V;j+=Z,F=W-M,w=1<v$0||Y===g$0&&O>h$0)return 1;T=D&A,Q[T]=V<<24|F<<16|j-J|0}}if(D!==0)Q[j+D]=W-M<<24|4194304|0;return G.bits=V,0}});var w50=E((Oo0)=>{var K$=Q3(),hy=Vy(),z9=Ly(),Yo0=R$0(),LW=k$0(),zo0=0,G50=1,H50=2,x$0=4,Uo0=5,ZO=6,$z=0,Io0=1,Qo0=2,C$=-2,W50=-3,Sy=-4,Jo0=-5,f$0=8,X50=1,u$0=2,b$0=3,i$0=4,c$0=5,n$0=6,p$0=7,d$0=8,m$0=9,l$0=10,LO=11,K3=12,Ey=13,o$0=14,Cy=15,r$0=16,s$0=17,a$0=18,t$0=19,qO=20,VO=21,e$0=22,$50=23,Y50=24,z50=25,U50=26,Ry=27,I50=28,Q50=29,y4=30,gy=31,Ko0=32,Go0=852,Ho0=592,Wo0=15,Xo0=Wo0;function J50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function Zo0(){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 K$.Buf16(320),this.work=new K$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Z50($){var Y;if(!$||!$.state)return C$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=X50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new K$.Buf32(Go0),Y.distcode=Y.distdyn=new K$.Buf32(Ho0),Y.sane=1,Y.back=-1,$z}function q50($){var Y;if(!$||!$.state)return C$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,Z50($)}function V50($,Y){var z,U;if(!$||!$.state)return C$;if(U=$.state,Y<0)z=0,Y=-Y;else if(z=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return C$;if(U.window!==null&&U.wbits!==Y)U.window=null;return U.wrap=z,U.wbits=Y,q50($)}function L50($,Y){var z,U;if(!$)return C$;if(U=new Zo0,$.state=U,U.window=null,z=V50($,Y),z!==$z)$.state=null;return z}function qo0($){return L50($,Xo0)}var K50=!0,_y,vy;function Vo0($){if(K50){var Y;_y=new K$.Buf32(512),vy=new K$.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;LW(G50,$.lens,0,288,_y,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;LW(H50,$.lens,0,32,vy,0,$.work,{bits:5}),K50=!1}$.lencode=_y,$.lenbits=9,$.distcode=vy,$.distbits=5}function F50($,Y,z,U){var I,Q=$.state;if(Q.window===null)Q.wsize=1<=Q.wsize)K$.arraySet(Q.window,Y,z-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize;else{if(I=Q.wsize-Q.wnext,I>U)I=U;if(K$.arraySet(Q.window,Y,z-U,I,Q.wnext),U-=I,U)K$.arraySet(Q.window,Y,z-U,U,0),Q.wnext=U,Q.whave=Q.wsize;else{if(Q.wnext+=I,Q.wnext===Q.wsize)Q.wnext=0;if(Q.whave>>8&255,z.check=z9(z.check,C,2,0),H=0,W=0,z.mode=u$0;break}if(z.flags=0,z.head)z.head.done=!1;if(!(z.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",z.mode=y4;break}if((H&15)!==f$0){$.msg="unknown compression method",z.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,z.wbits===0)z.wbits=A;else if(A>z.wbits){$.msg="invalid window size",z.mode=y4;break}z.dmax=1<>8&1;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=z9(z.check,C,2,0);H=0,W=0,z.mode=b$0;case b$0:while(W<32){if(K===0)break $;K--,H+=U[Q++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,z.check=z9(z.check,C,4,0);H=0,W=0,z.mode=i$0;case i$0:while(W<16){if(K===0)break $;K--,H+=U[Q++]<>8;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=z9(z.check,C,2,0);H=0,W=0,z.mode=c$0;case c$0:if(z.flags&1024){while(W<16){if(K===0)break $;K--,H+=U[Q++]<>>8&255,z.check=z9(z.check,C,2,0);H=0,W=0}else if(z.head)z.head.extra=null;z.mode=n$0;case n$0:if(z.flags&1024){if(q=z.length,q>K)q=K;if(q){if(z.head){if(A=z.head.extra_len-z.length,!z.head.extra)z.head.extra=Array(z.head.extra_len);K$.arraySet(z.head.extra,U,Q,q,A)}if(z.flags&512)z.check=z9(z.check,U,q,Q);K-=q,Q+=q,z.length-=q}if(z.length)break $}z.length=0,z.mode=p$0;case p$0:if(z.flags&2048){if(K===0)break $;q=0;do if(A=U[Q+q++],z.head&&A&&z.length<65536)z.head.name+=String.fromCharCode(A);while(A&&q>9&1,z.head.done=!0;$.adler=z.check=0,z.mode=K3;break;case l$0:while(W<32){if(K===0)break $;K--,H+=U[Q++]<>>=W&7,W-=W&7,z.mode=Ry;break}while(W<3){if(K===0)break $;K--,H+=U[Q++]<>>=1,W-=1,H&3){case 0:z.mode=o$0;break;case 1:if(Vo0(z),z.mode=qO,Y===ZO){H>>>=2,W-=2;break $}break;case 2:z.mode=s$0;break;case 3:$.msg="invalid block type",z.mode=y4}H>>>=2,W-=2;break;case o$0:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=U[Q++]<>>16^65535)){$.msg="invalid stored block lengths",z.mode=y4;break}if(z.length=H&65535,H=0,W=0,z.mode=Cy,Y===ZO)break $;case Cy:z.mode=r$0;case r$0:if(q=z.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;K$.arraySet(I,U,Q,q,J),K-=q,Q+=q,G-=q,J+=q,z.length-=q;break}z.mode=K3;break;case s$0:while(W<14){if(K===0)break $;K--,H+=U[Q++]<>>=5,W-=5,z.ndist=(H&31)+1,H>>>=5,W-=5,z.ncode=(H&15)+4,H>>>=4,W-=4,z.nlen>286||z.ndist>30){$.msg="too many length or distance symbols",z.mode=y4;break}z.have=0,z.mode=a$0;case a$0:while(z.have>>=3,W-=3}while(z.have<19)z.lens[h[z.have++]]=0;if(z.lencode=z.lendyn,z.lenbits=7,b={bits:z.lenbits},j=LW(zo0,z.lens,0,19,z.lencode,0,z.work,b),z.lenbits=b.bits,j){$.msg="invalid code lengths set",z.mode=y4;break}z.have=0,z.mode=t$0;case t$0:while(z.have>>24,O=M>>>16&255,D=M&65535,w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>>=w,W-=w,z.lens[z.have++]=D;else{if(D===16){k=w+2;while(W>>=w,W-=w,z.have===0){$.msg="invalid bit length repeat",z.mode=y4;break}A=z.lens[z.have-1],q=3+(H&3),H>>>=2,W-=2}else if(D===17){k=w+3;while(W>>=w,W-=w,A=0,q=3+(H&7),H>>>=3,W-=3}else{k=w+7;while(W>>=w,W-=w,A=0,q=11+(H&127),H>>>=7,W-=7}if(z.have+q>z.nlen+z.ndist){$.msg="invalid bit length repeat",z.mode=y4;break}while(q--)z.lens[z.have++]=A}}if(z.mode===y4)break;if(z.lens[256]===0){$.msg="invalid code -- missing end-of-block",z.mode=y4;break}if(z.lenbits=9,b={bits:z.lenbits},j=LW(G50,z.lens,0,z.nlen,z.lencode,0,z.work,b),z.lenbits=b.bits,j){$.msg="invalid literal/lengths set",z.mode=y4;break}if(z.distbits=6,z.distcode=z.distdyn,b={bits:z.distbits},j=LW(H50,z.lens,z.nlen,z.ndist,z.distcode,0,z.work,b),z.distbits=b.bits,j){$.msg="invalid distances set",z.mode=y4;break}if(z.mode=qO,Y===ZO)break $;case qO:z.mode=VO;case VO:if(K>=6&&G>=258){if($.next_out=J,$.avail_out=G,$.next_in=Q,$.avail_in=K,z.hold=H,z.bits=W,Yo0($,Z),J=$.next_out,I=$.output,G=$.avail_out,Q=$.next_in,U=$.input,K=$.avail_in,H=z.hold,W=z.bits,z.mode===K3)z.back=-1;break}z.back=0;for(;;){if(M=z.lencode[H&(1<>>24,O=M>>>16&255,D=M&65535,w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>N)],w=M>>>24,O=M>>>16&255,D=M&65535,N+w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>>=N,W-=N,z.back+=N}if(H>>>=w,W-=w,z.back+=w,z.length=D,O===0){z.mode=U50;break}if(O&32){z.back=-1,z.mode=K3;break}if(O&64){$.msg="invalid literal/length code",z.mode=y4;break}z.extra=O&15,z.mode=e$0;case e$0:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}z.was=z.length,z.mode=$50;case $50:for(;;){if(M=z.distcode[H&(1<>>24,O=M>>>16&255,D=M&65535,w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>N)],w=M>>>24,O=M>>>16&255,D=M&65535,N+w<=W)break;if(K===0)break $;K--,H+=U[Q++]<>>=N,W-=N,z.back+=N}if(H>>>=w,W-=w,z.back+=w,O&64){$.msg="invalid distance code",z.mode=y4;break}z.offset=D,z.extra=O&15,z.mode=Y50;case Y50:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}if(z.offset>z.dmax){$.msg="invalid distance too far back",z.mode=y4;break}z.mode=z50;case z50:if(G===0)break $;if(q=Z-G,z.offset>q){if(q=z.offset-q,q>z.whave){if(z.sane){$.msg="invalid distance too far back",z.mode=y4;break}}if(q>z.wnext)q-=z.wnext,V=z.wsize-q;else V=z.wnext-q;if(q>z.length)q=z.length;F=z.window}else F=I,V=J-z.offset,q=z.length;if(q>G)q=G;G-=q,z.length-=q;do I[J++]=F[V++];while(--q);if(z.length===0)z.mode=VO;break;case U50:if(G===0)break $;I[J++]=z.length,G--,z.mode=VO;break;case Ry:if(z.wrap){while(W<32){if(K===0)break $;K--,H|=U[Q++]<{M50.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 N50=E((yp1,O50)=>{function _o0(){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}O50.exports=_o0});var A50=E((go0)=>{var qQ=w50(),FW=Q3(),FO=Ny(),G6=yy(),ky=UO(),vo0=Dy(),ho0=N50(),D50=Object.prototype.toString;function Yz($){if(!(this instanceof Yz))return new Yz($);this.options=FW.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 vo0,this.strm.avail_out=0;var z=qQ.inflateInit2(this.strm,Y.windowBits);if(z!==G6.Z_OK)throw Error(ky[z]);if(this.header=new ho0,qQ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=FO.string2buf(Y.dictionary);else if(D50.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(z=qQ.inflateSetDictionary(this.strm,Y.dictionary),z!==G6.Z_OK)throw Error(ky[z])}}}Yz.prototype.push=function($,Y){var z=this.strm,U=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?G6.Z_FINISH:G6.Z_NO_FLUSH,typeof $==="string")z.input=FO.binstring2buf($);else if(D50.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new FW.Buf8(U),z.next_out=0,z.avail_out=U;if(Q=qQ.inflate(z,G6.Z_NO_FLUSH),Q===G6.Z_NEED_DICT&&I)Q=qQ.inflateSetDictionary(this.strm,I);if(Q===G6.Z_BUF_ERROR&&W===!0)Q=G6.Z_OK,W=!1;if(Q!==G6.Z_STREAM_END&&Q!==G6.Z_OK)return this.onEnd(Q),this.ended=!0,!1;if(z.next_out){if(z.avail_out===0||Q===G6.Z_STREAM_END||z.avail_in===0&&(J===G6.Z_FINISH||J===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=FO.utf8border(z.output,z.next_out),G=z.next_out-K,H=FO.buf2string(z.output,K),z.next_out=G,z.avail_out=U-G,G)FW.arraySet(z.output,z.output,K,G,0);this.onData(H)}else this.onData(FW.shrinkBuf(z.output,z.next_out))}if(z.avail_in===0&&z.avail_out===0)W=!0}while((z.avail_in>0||z.avail_out===0)&&Q!==G6.Z_STREAM_END);if(Q===G6.Z_STREAM_END)J=G6.Z_FINISH;if(J===G6.Z_FINISH)return Q=qQ.inflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===G6.Z_OK;if(J===G6.Z_SYNC_FLUSH)return this.onEnd(G6.Z_OK),z.avail_out=0,!0;return!0};Yz.prototype.onData=function($){this.chunks.push($)};Yz.prototype.onEnd=function($){if($===G6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=FW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function xy($,Y){var z=new Yz(Y);if(z.push($,!0),z.err)throw z.msg||ky[z.err];return z.result}function So0($,Y){return Y=Y||{},Y.raw=!0,xy($,Y)}go0.Inflate=Yz;go0.inflate=xy;go0.inflateRaw=So0;go0.ungzip=xy});var T50=E((xp1,B50)=>{var uo0=Q3().assign,bo0=E$0(),io0=A50(),co0=yy(),P50={};uo0(P50,bo0,io0,co0);B50.exports=P50});var E50=E((mo0)=>{var no0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",po0=T50(),j50=c4(),wO=J$(),do0=no0?"uint8array":"array";mo0.magic="\b\x00";function zz($,Y){wO.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}j50.inherits(zz,wO);zz.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(j50.transformTo(do0,$.data),!1)};zz.prototype.flush=function(){if(wO.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};zz.prototype.cleanUp=function(){wO.prototype.cleanUp.call(this),this._pako=null};zz.prototype._createPako=function(){this._pako=new po0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};mo0.compressWorker=function($){return new zz("Deflate",$)};mo0.uncompressWorker=function(){return new zz("Inflate",{})}});var fy=E((so0)=>{var C50=J$();so0.STORE={magic:"\x00\x00",compressWorker:function(){return new C50("STORE compression")},uncompressWorker:function(){return new C50("STORE decompression")}};so0.DEFLATE=E50()});var uy=E((eo0)=>{eo0.LOCAL_FILE_HEADER="PK\x03\x04";eo0.CENTRAL_FILE_HEADER="PK\x01\x02";eo0.CENTRAL_DIRECTORY_END="PK\x05\x06";eo0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";eo0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";eo0.DATA_DESCRIPTOR="PK\x07\b"});var h50=E((ip1,v50)=>{var VQ=c4(),LQ=J$(),by=IQ(),R50=eM(),MO=uy(),O4=function($,Y){var z="",U;for(U=0;U>>8;return z},Jr0=function($,Y){var z=$;if(!$)z=Y?16893:33204;return(z&65535)<<16},Kr0=function($){return($||0)&63},_50=function($,Y,z,U,I,Q){var{file:J,compression:K}=$,G=Q!==by.utf8encode,H=VQ.transformTo("string",Q(J.name)),W=VQ.transformTo("string",by.utf8encode(J.name)),X=J.comment,Z=VQ.transformTo("string",Q(X)),q=VQ.transformTo("string",by.utf8encode(X)),V=W.length!==J.name.length,F=q.length!==X.length,M,w,O="",D="",N="",B=J.dir,T=J.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||z)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(Y)j|=8;if(!G&&(V||F))j|=2048;var C=0,b=0;if(B)C|=16;if(I==="UNIX")b=798,C|=Jr0(J.unixPermissions,B);else b=20,C|=Kr0(J.dosPermissions,B);if(M=T.getUTCHours(),M=M<<6,M=M|T.getUTCMinutes(),M=M<<5,M=M|T.getUTCSeconds()/2,w=T.getUTCFullYear()-1980,w=w<<4,w=w|T.getUTCMonth()+1,w=w<<5,w=w|T.getUTCDate(),V)D=O4(1,1)+O4(R50(H),4)+W,O+="up"+O4(D.length,2)+D;if(F)N=O4(1,1)+O4(R50(Z),4)+q,O+="uc"+O4(N.length,2)+N;var k="";k+=` \x00`,k+=O4(j,2),k+=K.magic,k+=O4(M,2),k+=O4(w,2),k+=O4(A.crc32,4),k+=O4(A.compressedSize,4),k+=O4(A.uncompressedSize,4),k+=O4(H.length,2),k+=O4(O.length,2);var h=MO.LOCAL_FILE_HEADER+k+H+O,i=MO.CENTRAL_FILE_HEADER+O4(b,2)+k+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+H+O+Z;return{fileRecord:h,dirRecord:i}},Gr0=function($,Y,z,U,I){var Q="",J=VQ.transformTo("string",I(U));return Q=MO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(J.length,2)+J,Q},Hr0=function($){var Y="";return Y=MO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){LQ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}VQ.inherits(X5,LQ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,LQ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=_50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=_50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:Hr0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y{var Wr0=fy(),Xr0=h50(),Zr0=function($,Y){var z=$||Y,U=Wr0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};qr0.generateWorker=function($,Y,z){var U=new Xr0(Y.streamFiles,z,Y.platform,Y.encodeFileName),I=0;try{$.forEach(function(Q,J){I++;var K=Zr0(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(U)}),U.entriesCount=I}catch(Q){U.error(Q)}return U}});var y50=E((np1,g50)=>{var Lr0=c4(),OO=J$();function wW($,Y){OO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}Lr0.inherits(wW,OO);wW.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};wW.prototype.pause=function(){if(!OO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wW.prototype.resume=function(){if(!OO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};g50.exports=wW});var d50=E((pp1,p50)=>{var Fr0=IQ(),MW=c4(),u50=J$(),wr0=pg(),b50=dg(),k50=$O(),Mr0=x80(),Or0=S50(),x50=sH(),Nr0=y50(),i50=function($,Y,z){var U=MW.getTypeOf(Y),I,Q=MW.extend(z||{},b50);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)$=c50($);if(Q.createFolders&&(I=Dr0($)))n50.call(this,I,!0);var J=U==="string"&&Q.binary===!1&&Q.base64===!1;if(!z||typeof z.binary>"u")Q.binary=!J;var K=Y instanceof k50&&Y.uncompressedSize===0;if(K||Q.dir||!Y||Y.length===0)Q.base64=!1,Q.binary=!0,Y="",Q.compression="STORE",U="string";var G=null;if(Y instanceof k50||Y instanceof u50)G=Y;else if(x50.isNode&&x50.isStream(Y))G=new Nr0($,Y);else G=MW.prepareContent($,Y,Q.binary,Q.optimizedBinaryString,Q.base64);var H=new Mr0($,G,Q);this.files[$]=H},Dr0=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var Y=$.lastIndexOf("/");return Y>0?$.substring(0,Y):""},c50=function($){if($.slice(-1)!=="/")$+="/";return $},n50=function($,Y){if(Y=typeof Y<"u"?Y:b50.createFolders,$=c50($),!this.files[$])i50.call(this,$,null,{dir:!0,createFolders:Y});return this.files[$]};function f50($){return Object.prototype.toString.call($)==="[object RegExp]"}var Ar0={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var Y,z,U;for(Y in this.files)if(U=this.files[Y],z=Y.slice(this.root.length,Y.length),z&&Y.slice(0,this.root.length)===this.root)$(z,U)},filter:function($){var Y=[];return this.forEach(function(z,U){if($(z,U))Y.push(U)}),Y},file:function($,Y,z){if(arguments.length===1)if(f50($)){var U=$;return this.filter(function(Q,J){return!J.dir&&U.test(Q)})}else{var I=this.files[this.root+$];if(I&&!I.dir)return I;else return null}else $=this.root+$,i50.call(this,$,Y,z);return this},folder:function($){if(!$)return this;if(f50($))return this.filter(function(I,Q){return Q.dir&&$.test(I)});var Y=this.root+$,z=n50.call(this,Y),U=this.clone();return U.root=z.name,U},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 z=this.filter(function(I,Q){return Q.name.slice(0,$.length)===$});for(var U=0;U{var Pr0=c4();function m50($){this.data=$,this.length=$.length,this.index=0,this.zero=0}m50.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length=this.index;z--)Y=(Y<<8)+this.byteAt(z);return this.index+=$,Y},readString:function($){return Pr0.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))}};l50.exports=m50});var cy=E((mp1,r50)=>{var o50=iy(),Br0=c4();function FQ($){o50.call(this,$);for(var Y=0;Y=0;--Q)if(this.data[Q]===Y&&this.data[Q+1]===z&&this.data[Q+2]===U&&this.data[Q+3]===I)return Q-this.zero;return-1};FQ.prototype.readAndCheckSignature=function($){var Y=$.charCodeAt(0),z=$.charCodeAt(1),U=$.charCodeAt(2),I=$.charCodeAt(3),Q=this.readData(4);return Y===Q[0]&&z===Q[1]&&U===Q[2]&&I===Q[3]};FQ.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};r50.exports=FQ});var t50=E((lp1,a50)=>{var s50=iy(),Tr0=c4();function wQ($){s50.call(this,$)}Tr0.inherits(wQ,s50);wQ.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};wQ.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};wQ.prototype.readAndCheckSignature=function($){var Y=this.readData(4);return $===Y};wQ.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};a50.exports=wQ});var py=E((op1,$90)=>{var e50=cy(),jr0=c4();function ny($){e50.call(this,$)}jr0.inherits(ny,e50);ny.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};$90.exports=ny});var U90=E((rp1,z90)=>{var Y90=py(),Er0=c4();function dy($){Y90.call(this,$)}Er0.inherits(dy,Y90);dy.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};z90.exports=dy});var my=E((sp1,Q90)=>{var NO=c4(),I90=I3(),Cr0=cy(),Rr0=t50(),_r0=U90(),vr0=py();Q90.exports=function($){var Y=NO.getTypeOf($);if(NO.checkSupport(Y),Y==="string"&&!I90.uint8array)return new Rr0($);if(Y==="nodebuffer")return new _r0($);if(I90.uint8array)return new vr0(NO.transformTo("uint8array",$));return new Cr0(NO.transformTo("array",$))}});var H90=E((ap1,G90)=>{var ly=my(),n7=c4(),hr0=$O(),J90=eM(),DO=IQ(),AO=fy(),Sr0=I3(),gr0=0,yr0=3,kr0=function($){for(var Y in AO){if(!Object.prototype.hasOwnProperty.call(AO,Y))continue;if(AO[Y].magic===$)return AO[Y]}return null};function K90($,Y){this.options=$,this.loadOptions=Y}K90.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var Y,z;if($.skip(22),this.fileNameLength=$.readInt(2),z=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(z),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=kr0(this.compressionMethod),Y===null)throw Error("Corrupted zip : compression "+n7.pretty(this.compressionMethod)+" unknown (inner file : "+n7.transformTo("string",this.fileName)+")");this.decompressed=new hr0(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,$===gr0)this.dosPermissions=this.externalFileAttributes&63;if($===yr0)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=ly(this.extraFields[1].value);if(this.uncompressedSize===n7.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===n7.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===n7.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===n7.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var Y=$.index+this.extraFieldsLength,z,U,I;if(!this.extraFields)this.extraFields={};while($.index+4{var xr0=my(),G3=c4(),Z5=uy(),fr0=H90(),ur0=I3();function W90($){this.files=[],this.loadOptions=$}W90.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 ("+G3.pretty(Y)+", expected "+G3.pretty($)+")")}},isSignature:function($,Y){var z=this.reader.index;this.reader.setIndex($);var U=this.reader.readString(4),I=U===Y;return this.reader.setIndex(z),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=ur0.uint8array?"uint8array":"array",z=G3.transformTo(Y,$);this.zipComment=this.loadOptions.decodeFileName(z)},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,z,U,I;while(Y<$)z=this.reader.readInt(2),U=this.reader.readInt(4),I=this.reader.readData(U),this.zip64ExtensibleData[z]={id:z,length:U,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(z,Z5.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=xr0($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};X90.exports=W90});var L90=E((ep1,V90)=>{var oy=c4(),PO=YQ(),br0=IQ(),ir0=Z90(),cr0=og(),q90=sH();function nr0($){return new PO.Promise(function(Y,z){var U=$.decompressed.getContentWorker().pipe(new cr0);U.on("error",function(I){z(I)}).on("end",function(){if(U.streamInfo.crc32!==$.decompressed.crc32)z(Error("Corrupted zip : CRC32 mismatch"));else Y()}).resume()})}V90.exports=function($,Y){var z=this;if(Y=oy.extend(Y||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:br0.utf8decode}),q90.isNode&&q90.isStream($))return PO.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return oy.prepareContent("the loaded zip file",$,!0,Y.optimizedBinaryString,Y.base64).then(function(U){var I=new ir0(Y);return I.load(U),I}).then(function(I){var Q=[PO.Promise.resolve(I)],J=I.files;if(Y.checkCRC32)for(var K=0;K{function R$(){if(!(this instanceof R$))return new R$;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 R$;for(var Y in this)if(typeof this[Y]!=="function")$[Y]=this[Y];return $}}R$.prototype=d50();R$.prototype.loadAsync=L90();R$.support=I3();R$.defaults=dg();R$.version="3.10.1";R$.loadAsync=function($,Y){return new R$().loadAsync($,Y)};R$.external=YQ();F90.exports=R$});var A90=E((Yd1,D90)=>{function w90($,Y){var z=Object.keys($);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols($);Y&&(U=U.filter(function(I){return Object.getOwnPropertyDescriptor($,I).enumerable})),z.push.apply(z,U)}return z}function M90($){for(var Y=1;Y0)this.tail.next=U;else this.head=U;this.tail=U,++this.length}},{key:"unshift",value:function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(z){if(this.length===0)return"";var U=this.head,I=""+U.data;while(U=U.next)I+=z+U.data;return I}},{key:"concat",value:function(z){if(this.length===0)return BO.alloc(0);var U=BO.allocUnsafe(z>>>0),I=this.head,Q=0;while(I)ar0(I.data,U,Q),Q+=I.data.length,I=I.next;return U}},{key:"consume",value:function(z,U){var I;if(zJ.length?J.length:z;if(K===J.length)Q+=J;else Q+=J.slice(0,z);if(z-=K,z===0){if(K===J.length)if(++I,U.next)this.head=U.next;else this.head=this.tail=null;else this.head=U,U.data=J.slice(K);break}++I}return this.length-=I,Q}},{key:"_getBuffer",value:function(z){var U=BO.allocUnsafe(z),I=this.head,Q=1;I.data.copy(U),z-=I.data.length;while(I=I.next){var J=I.data,K=z>J.length?J.length:z;if(J.copy(U,U.length-z,0,K),z-=K,z===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,U}},{key:sr0,value:function(z,U){return sy(this,M90(M90({},U),{},{depth:0,customInspect:!1}))}}]),$}()});var ty=E((zd1,B90)=>{function tr0($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(U||I){if(Y)Y($);else if($){if(!this._writableState)process.nextTick(ay,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(ay,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(!z._writableState)process.nextTick(P90,z,Q);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,process.nextTick(P90,z,Q);else process.nextTick(TO,z);else if(Y)process.nextTick(TO,z),Y(Q);else process.nextTick(TO,z)}),this}function P90($,Y){ay($,Y),TO($)}function TO($){if($._writableState&&!$._writableState.emitClose)return;if($._readableState&&!$._readableState.emitClose)return;$.emit("close")}function er0(){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 ay($,Y){$.emit("error",Y)}function $s0($,Y){var{_readableState:z,_writableState:U}=$;if(z&&z.autoDestroy||U&&U.autoDestroy)$.destroy(Y);else $.emit("error",Y)}B90.exports={destroy:tr0,undestroy:er0,errorOrDestroy:$s0}});var p7=E((Is0,E90)=>{var j90={};function _$($,Y,z){if(!z)z=Error;function U(Q,J,K){if(typeof Y==="string")return Y;else return Y(Q,J,K)}class I extends z{constructor(Q,J,K){super(U(Q,J,K))}}I.prototype.name=z.name,I.prototype.code=$,j90[$]=I}function T90($,Y){if(Array.isArray($)){let z=$.length;if($=$.map((U)=>String(U)),z>2)return`one of ${Y} ${$.slice(0,z-1).join(", ")}, or `+$[z-1];else if(z===2)return`one of ${Y} ${$[0]} or ${$[1]}`;else return`of ${Y} ${$[0]}`}else return`of ${Y} ${String($)}`}function Ys0($,Y,z){return $.substr(!z||z<0?0:+z,Y.length)===Y}function zs0($,Y,z){if(z===void 0||z>$.length)z=$.length;return $.substring(z-Y.length,z)===Y}function Us0($,Y,z){if(typeof z!=="number")z=0;if(z+Y.length>$.length)return!1;else return $.indexOf(Y,z)!==-1}_$("ERR_INVALID_OPT_VALUE",function($,Y){return'The value "'+Y+'" is invalid for option "'+$+'"'},TypeError);_$("ERR_INVALID_ARG_TYPE",function($,Y,z){let U;if(typeof Y==="string"&&Ys0(Y,"not "))U="must not be",Y=Y.replace(/^not /,"");else U="must be";let I;if(zs0($," argument"))I=`The ${$} ${U} ${T90(Y,"type")}`;else{let Q=Us0($,".")?"property":"argument";I=`The "${$}" ${Q} ${U} ${T90(Y,"type")}`}return I+=`. Received type ${typeof z}`,I},TypeError);_$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");_$("ERR_METHOD_NOT_IMPLEMENTED",function($){return"The "+$+" method is not implemented"});_$("ERR_STREAM_PREMATURE_CLOSE","Premature close");_$("ERR_STREAM_DESTROYED",function($){return"Cannot call "+$+" after a stream was destroyed"});_$("ERR_MULTIPLE_CALLBACK","Callback called multiple times");_$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");_$("ERR_STREAM_WRITE_AFTER_END","write after end");_$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);_$("ERR_UNKNOWN_ENCODING",function($){return"Unknown encoding: "+$},TypeError);_$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Is0.codes=j90});var ey=E((Ud1,C90)=>{var Js0=p7().codes.ERR_INVALID_OPT_VALUE;function Ks0($,Y,z){return $.highWaterMark!=null?$.highWaterMark:Y?$[z]:null}function Gs0($,Y,z,U){var I=Ks0(Y,U,z);if(I!=null){if(!(isFinite(I)&&Math.floor(I)===I)||I<0){var Q=U?z:"highWaterMark";throw new Js0(Q,I)}return Math.floor(I)}return $.objectMode?16:16384}C90.exports={getHighWaterMark:Gs0}});var zk=E((Id1,g90)=>{g90.exports=z6;function _90($){var Y=this;this.next=null,this.entry=null,this.finish=function(){ys0(Y,$)}}var MQ;z6.WritableState=NW;var Hs0={deprecate:S7()},v90=J0("stream"),EO=J0("buffer").Buffer,Ws0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Xs0($){return EO.from($)}function Zs0($){return EO.isBuffer($)||$ instanceof Ws0}var Yk=ty(),qs0=ey(),Vs0=qs0.getHighWaterMark,d7=p7().codes,Ls0=d7.ERR_INVALID_ARG_TYPE,Fs0=d7.ERR_METHOD_NOT_IMPLEMENTED,ws0=d7.ERR_MULTIPLE_CALLBACK,Ms0=d7.ERR_STREAM_CANNOT_PIPE,Os0=d7.ERR_STREAM_DESTROYED,Ns0=d7.ERR_STREAM_NULL_VALUES,Ds0=d7.ERR_STREAM_WRITE_AFTER_END,As0=d7.ERR_UNKNOWN_ENCODING,OQ=Yk.errorOrDestroy;X1()(z6,v90);function Ps0(){}function NW($,Y,z){if(MQ=MQ||Uz(),$=$||{},typeof z!=="boolean")z=Y instanceof MQ;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.writableObjectMode;this.highWaterMark=Vs0(this,$,"writableHighWaterMark",z),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=$.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(I){_s0(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 _90(this)}NW.prototype.getBuffer=function(){var Y=this.bufferedRequest,z=[];while(Y)z.push(Y),Y=Y.next;return z};(function(){try{Object.defineProperty(NW.prototype,"buffer",{get:Hs0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var jO;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")jO=Function.prototype[Symbol.hasInstance],Object.defineProperty(z6,Symbol.hasInstance,{value:function(Y){if(jO.call(this,Y))return!0;if(this!==z6)return!1;return Y&&Y._writableState instanceof NW}});else jO=function(Y){return Y instanceof this};function z6($){MQ=MQ||Uz();var Y=this instanceof MQ;if(!Y&&!jO.call(z6,this))return new z6($);if(this._writableState=new NW($,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}v90.call(this)}z6.prototype.pipe=function(){OQ(this,new Ms0)};function Bs0($,Y){var z=new Ds0;OQ($,z),process.nextTick(Y,z)}function Ts0($,Y,z,U){var I;if(z===null)I=new Ns0;else if(typeof z!=="string"&&!Y.objectMode)I=new Ls0("chunk",["string","Buffer"],z);if(I)return OQ($,I),process.nextTick(U,I),!1;return!0}z6.prototype.write=function($,Y,z){var U=this._writableState,I=!1,Q=!U.objectMode&&Zs0($);if(Q&&!EO.isBuffer($))$=Xs0($);if(typeof Y==="function")z=Y,Y=null;if(Q)Y="buffer";else if(!Y)Y=U.defaultEncoding;if(typeof z!=="function")z=Ps0;if(U.ending)Bs0(this,z);else if(Q||Ts0(this,U,$,z))U.pendingcb++,I=Es0(this,U,Q,$,Y,z);return I};z6.prototype.cork=function(){this._writableState.corked++};z6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)h90(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 new As0(Y);return this._writableState.defaultEncoding=Y,this};Object.defineProperty(z6.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function js0($,Y,z){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=EO.from(Y,z);return Y}Object.defineProperty(z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Es0($,Y,z,U,I,Q){if(!z){var J=js0(Y,U,I);if(U!==J)z=!0,I="buffer",U=J}var K=Y.objectMode?1:U.length;Y.length+=K;var G=Y.length{var ks0=Object.keys||function($){var Y=[];for(var z in $)Y.push(z);return Y};k90.exports=U9;var y90=Ik(),Uk=zk();X1()(U9,y90);{CO=ks0(Uk.prototype);for(DW=0;DW{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var RO=J0("buffer"),I9=RO.Buffer;function x90($,Y){for(var z in $)Y[z]=$[z]}if(I9.from&&I9.alloc&&I9.allocUnsafe&&I9.allocUnsafeSlow)f90.exports=RO;else x90(RO,Qk),Qk.Buffer=Iz;function Iz($,Y,z){return I9($,Y,z)}Iz.prototype=Object.create(I9.prototype);x90(I9,Iz);Iz.from=function($,Y,z){if(typeof $==="number")throw TypeError("Argument must not be a number");return I9($,Y,z)};Iz.alloc=function($,Y,z){if(typeof $!=="number")throw TypeError("Argument must be a number");var U=I9($);if(Y!==void 0)if(typeof z==="string")U.fill(Y,z);else U.fill(Y);else U.fill(0);return U};Iz.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return I9($)};Iz.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return RO.SlowBuffer($)}});var NQ=E((ts0)=>{var Kk=u90().Buffer,b90=Kk.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 us0($){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 bs0($){var Y=us0($);if(typeof Y!=="string"&&(Kk.isEncoding===b90||!b90($)))throw Error("Unknown encoding: "+$);return Y||$}ts0.StringDecoder=PW;function PW($){this.encoding=bs0($);var Y;switch(this.encoding){case"utf16le":this.text=ms0,this.end=ls0,Y=4;break;case"utf8":this.fillLast=ns0,Y=4;break;case"base64":this.text=os0,this.end=rs0,Y=3;break;default:this.write=ss0,this.end=as0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Kk.allocUnsafe(Y)}PW.prototype.write=function($){if($.length===0)return"";var Y,z;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";z=this.lastNeed,this.lastNeed=0}else z=0;if(z<$.length)return Y?Y+this.text($,z):this.text($,z);return Y||""};PW.prototype.end=ds0;PW.prototype.text=ps0;PW.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 Jk($){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 is0($,Y,z){var U=Y.length-1;if(U=0){if(I>0)$.lastNeed=I-1;return I}if(--U=0){if(I>0)$.lastNeed=I-2;return I}if(--U=0){if(I>0)if(I===2)I=0;else $.lastNeed=I-3;return I}return 0}function cs0($,Y,z){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 ns0($){var Y=this.lastTotal-this.lastNeed,z=cs0(this,$,Y);if(z!==void 0)return z;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 ps0($,Y){var z=is0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=z;var U=$.length-(z-this.lastNeed);return $.copy(this.lastChar,0,U),$.toString("utf8",Y,U)}function ds0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function ms0($,Y){if(($.length-Y)%2===0){var z=$.toString("utf16le",Y);if(z){var U=z.charCodeAt(z.length-1);if(U>=55296&&U<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],z.slice(0,-1)}return z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function ls0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var z=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,z)}return Y}function os0($,Y){var z=($.length-Y)%3;if(z===0)return $.toString("base64",Y);if(this.lastNeed=3-z,this.lastTotal=3,z===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-z)}function rs0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function ss0($){return $.toString(this.encoding)}function as0($){return $&&$.length?this.write($):""}});var _O=E((Kd1,n90)=>{var i90=p7().codes.ERR_STREAM_PREMATURE_CLOSE;function $a0($){var Y=!1;return function(){if(Y)return;Y=!0;for(var z=arguments.length,U=Array(z),I=0;I{var vO;function m7($,Y,z){if(Y=Ua0(Y),Y in $)Object.defineProperty($,Y,{value:z,enumerable:!0,configurable:!0,writable:!0});else $[Y]=z;return $}function Ua0($){var Y=Ia0($,"string");return typeof Y==="symbol"?Y:String(Y)}function Ia0($,Y){if(typeof $!=="object"||$===null)return $;var z=$[Symbol.toPrimitive];if(z!==void 0){var U=z.call($,Y||"default");if(typeof U!=="object")return U;throw TypeError("@@toPrimitive must return a primitive value.")}return(Y==="string"?String:Number)($)}var Qa0=_O(),l7=Symbol("lastResolve"),Qz=Symbol("lastReject"),BW=Symbol("error"),hO=Symbol("ended"),Jz=Symbol("lastPromise"),Gk=Symbol("handlePromise"),Kz=Symbol("stream");function o7($,Y){return{value:$,done:Y}}function Ja0($){var Y=$[l7];if(Y!==null){var z=$[Kz].read();if(z!==null)$[Jz]=null,$[l7]=null,$[Qz]=null,Y(o7(z,!1))}}function Ka0($){process.nextTick(Ja0,$)}function Ga0($,Y){return function(z,U){$.then(function(){if(Y[hO]){z(o7(void 0,!0));return}Y[Gk](z,U)},U)}}var Ha0=Object.getPrototypeOf(function(){}),Wa0=Object.setPrototypeOf((vO={get stream(){return this[Kz]},next:function(){var Y=this,z=this[BW];if(z!==null)return Promise.reject(z);if(this[hO])return Promise.resolve(o7(void 0,!0));if(this[Kz].destroyed)return new Promise(function(J,K){process.nextTick(function(){if(Y[BW])K(Y[BW]);else J(o7(void 0,!0))})});var U=this[Jz],I;if(U)I=new Promise(Ga0(U,this));else{var Q=this[Kz].read();if(Q!==null)return Promise.resolve(o7(Q,!1));I=new Promise(this[Gk])}return this[Jz]=I,I}},m7(vO,Symbol.asyncIterator,function(){return this}),m7(vO,"return",function(){var Y=this;return new Promise(function(z,U){Y[Kz].destroy(null,function(I){if(I){U(I);return}z(o7(void 0,!0))})})}),vO),Ha0),Xa0=function(Y){var z,U=Object.create(Wa0,(z={},m7(z,Kz,{value:Y,writable:!0}),m7(z,l7,{value:null,writable:!0}),m7(z,Qz,{value:null,writable:!0}),m7(z,BW,{value:null,writable:!0}),m7(z,hO,{value:Y._readableState.endEmitted,writable:!0}),m7(z,Gk,{value:function(Q,J){var K=U[Kz].read();if(K)U[Jz]=null,U[l7]=null,U[Qz]=null,Q(o7(K,!1));else U[l7]=Q,U[Qz]=J},writable:!0}),z));return U[Jz]=null,Qa0(Y,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Q=U[Qz];if(Q!==null)U[Jz]=null,U[l7]=null,U[Qz]=null,Q(I);U[BW]=I;return}var J=U[l7];if(J!==null)U[Jz]=null,U[l7]=null,U[Qz]=null,J(o7(void 0,!0));U[hO]=!0}),Y.on("readable",Ka0.bind(null,U)),U};p90.exports=Xa0});var r90=E((Hd1,o90)=>{function m90($,Y,z,U,I,Q,J){try{var K=$[Q](J),G=K.value}catch(H){z(H);return}if(K.done)Y(G);else Promise.resolve(G).then(U,I)}function Za0($){return function(){var Y=this,z=arguments;return new Promise(function(U,I){var Q=$.apply(Y,z);function J(G){m90(Q,U,I,J,K,"next",G)}function K(G){m90(Q,U,I,J,K,"throw",G)}J(void 0)})}}function l90($,Y){var z=Object.keys($);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols($);Y&&(U=U.filter(function(I){return Object.getOwnPropertyDescriptor($,I).enumerable})),z.push.apply(z,U)}return z}function qa0($){for(var Y=1;Y{Q30.exports=p1;var DQ;p1.ReadableState=e90;var Wd1=J0("events").EventEmitter,t90=function(Y,z){return Y.listeners(z).length},jW=J0("stream"),SO=J0("buffer").Buffer,Oa0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Na0($){return SO.from($)}function Da0($){return SO.isBuffer($)||$ instanceof Oa0}var Hk=J0("util"),C1;if(Hk&&Hk.debuglog)C1=Hk.debuglog("stream");else C1=function(){};var Aa0=A90(),Fk=ty(),Pa0=ey(),Ba0=Pa0.getHighWaterMark,gO=p7().codes,Ta0=gO.ERR_INVALID_ARG_TYPE,ja0=gO.ERR_STREAM_PUSH_AFTER_EOF,Ea0=gO.ERR_METHOD_NOT_IMPLEMENTED,Ca0=gO.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,AQ,Wk,Xk;X1()(p1,jW);var TW=Fk.errorOrDestroy,Zk=["error","close","destroy","pause","resume"];function Ra0($,Y,z){if(typeof $.prependListener==="function")return $.prependListener(Y,z);if(!$._events||!$._events[Y])$.on(Y,z);else if(Array.isArray($._events[Y]))$._events[Y].unshift(z);else $._events[Y]=[z,$._events[Y]]}function e90($,Y,z){if(DQ=DQ||Uz(),$=$||{},typeof z!=="boolean")z=Y instanceof DQ;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.readableObjectMode;if(this.highWaterMark=Ba0(this,$,"readableHighWaterMark",z),this.buffer=new Aa0,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(!AQ)AQ=NQ().StringDecoder;this.decoder=new AQ($.encoding),this.encoding=$.encoding}}function p1($){if(DQ=DQ||Uz(),!(this instanceof p1))return new p1($);var Y=this instanceof DQ;if(this._readableState=new e90($,this,Y),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}jW.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=Fk.destroy;p1.prototype._undestroy=Fk.undestroy;p1.prototype._destroy=function($,Y){Y($)};p1.prototype.push=function($,Y){var z=this._readableState,U;if(!z.objectMode){if(typeof $==="string"){if(Y=Y||z.defaultEncoding,Y!==z.encoding)$=SO.from($,Y),Y="";U=!0}}else U=!0;return $30(this,$,Y,!1,U)};p1.prototype.unshift=function($){return $30(this,$,null,!0,!1)};function $30($,Y,z,U,I){C1("readableAddChunk",Y);var Q=$._readableState;if(Y===null)Q.reading=!1,ha0($,Q);else{var J;if(!I)J=_a0(Q,Y);if(J)TW($,J);else if(Q.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!Q.objectMode&&Object.getPrototypeOf(Y)!==SO.prototype)Y=Na0(Y);if(U)if(Q.endEmitted)TW($,new Ca0);else qk($,Q,Y,!0);else if(Q.ended)TW($,new ja0);else if(Q.destroyed)return!1;else if(Q.reading=!1,Q.decoder&&!z)if(Y=Q.decoder.write(Y),Q.objectMode||Y.length!==0)qk($,Q,Y,!1);else Lk($,Q);else qk($,Q,Y,!1)}else if(!U)Q.reading=!1,Lk($,Q)}return!Q.ended&&(Q.length=s90)$=s90;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function a90($,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=va0($);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,z=$;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)Vk(this);else yO(this);return null}if($=a90($,Y),$===0&&Y.ended){if(Y.length===0)Vk(this);return null}var U=Y.needReadable;if(C1("need readable",U),Y.length===0||Y.length-$0)I=U30($,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(z!==$&&Y.ended)Vk(this)}if(I!==null)this.emit("data",I);return I};function ha0($,Y){if(C1("onEofChunk"),Y.ended)return;if(Y.decoder){var z=Y.decoder.end();if(z&&z.length)Y.buffer.push(z),Y.length+=Y.objectMode?1:z.length}if(Y.ended=!0,Y.sync)yO($);else if(Y.needReadable=!1,!Y.emittedReadable)Y.emittedReadable=!0,Y30($)}function yO($){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,wk($)}function Lk($,Y){if(!Y.readingMore)Y.readingMore=!0,process.nextTick(Sa0,$,Y)}function Sa0($,Y){while(!Y.reading&&!Y.ended&&(Y.length1&&I30(U.pipes,$)!==-1)&&!H)C1("false write response, pause",U.awaitDrain),U.awaitDrain++;z.pause()}}function Z(M){if(C1("onerror",M),F(),$.removeListener("error",Z),t90($,"error")===0)TW($,M)}Ra0($,"error",Z);function q(){$.removeListener("finish",V),F()}$.once("close",q);function V(){C1("onfinish"),$.removeListener("close",q),F()}$.once("finish",V);function F(){C1("unpipe"),z.unpipe($)}if($.emit("pipe",z),!U.flowing)C1("pipe resume"),z.resume();return $};function ga0($){return function(){var z=$._readableState;if(C1("pipeOnDrain",z.awaitDrain),z.awaitDrain)z.awaitDrain--;if(z.awaitDrain===0&&t90($,"data"))z.flowing=!0,wk($)}}p1.prototype.unpipe=function($){var Y=this._readableState,z={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,z);return this}if(!$){var{pipes:U,pipesCount:I}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Q=0;Q0,U.flowing!==!1)this.resume()}else if($==="readable"){if(!U.endEmitted&&!U.readableListening){if(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,C1("on readable",U.length,U.reading),U.length)yO(this);else if(!U.reading)process.nextTick(ya0,this)}}return z};p1.prototype.addListener=p1.prototype.on;p1.prototype.removeListener=function($,Y){var z=jW.prototype.removeListener.call(this,$,Y);if($==="readable")process.nextTick(z30,this);return z};p1.prototype.removeAllListeners=function($){var Y=jW.prototype.removeAllListeners.apply(this,arguments);if($==="readable"||$===void 0)process.nextTick(z30,this);return Y};function z30($){var Y=$._readableState;if(Y.readableListening=$.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused)Y.flowing=!0;else if($.listenerCount("data")>0)$.resume()}function ya0($){C1("readable nexttick read 0"),$.read(0)}p1.prototype.resume=function(){var $=this._readableState;if(!$.flowing)C1("resume"),$.flowing=!$.readableListening,ka0(this,$);return $.paused=!1,this};function ka0($,Y){if(!Y.resumeScheduled)Y.resumeScheduled=!0,process.nextTick(xa0,$,Y)}function xa0($,Y){if(C1("resume",Y.reading),!Y.reading)$.read(0);if(Y.resumeScheduled=!1,$.emit("resume"),wk($),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 wk($){var Y=$._readableState;C1("flow",Y.flowing);while(Y.flowing&&$.read()!==null);}p1.prototype.wrap=function($){var Y=this,z=this._readableState,U=!1;$.on("end",function(){if(C1("wrapped end"),z.decoder&&!z.ended){var J=z.decoder.end();if(J&&J.length)Y.push(J)}Y.push(null)}),$.on("data",function(J){if(C1("wrapped data"),z.decoder)J=z.decoder.write(J);if(z.objectMode&&(J===null||J===void 0))return;else if(!z.objectMode&&(!J||!J.length))return;var K=Y.push(J);if(!K)U=!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)z=Y.buffer.join("");else if(Y.buffer.length===1)z=Y.buffer.first();else z=Y.buffer.concat(Y.length);Y.buffer.clear()}else z=Y.buffer.consume($,Y.decoder);return z}function Vk($){var Y=$._readableState;if(C1("endReadable",Y.endEmitted),!Y.endEmitted)Y.ended=!0,process.nextTick(fa0,Y,$)}function fa0($,Y){if(C1("endReadableNT",$.endEmitted,$.length),!$.endEmitted&&$.length===0){if($.endEmitted=!0,Y.readable=!1,Y.emit("end"),$.autoDestroy){var z=Y._writableState;if(!z||z.autoDestroy&&z.finished)Y.destroy()}}}if(typeof Symbol==="function")p1.from=function($,Y){if(Xk===void 0)Xk=r90();return Xk(p1,$,Y)};function I30($,Y){for(var z=0,U=$.length;z{K30.exports=H3;var kO=p7().codes,ua0=kO.ERR_METHOD_NOT_IMPLEMENTED,ba0=kO.ERR_MULTIPLE_CALLBACK,ia0=kO.ERR_TRANSFORM_ALREADY_TRANSFORMING,ca0=kO.ERR_TRANSFORM_WITH_LENGTH_0,xO=Uz();X1()(H3,xO);function na0($,Y){var z=this._transformState;z.transforming=!1;var U=z.writecb;if(U===null)return this.emit("error",new ba0);if(z.writechunk=null,z.writecb=null,Y!=null)this.push(Y);U($);var I=this._readableState;if(I.reading=!1,I.needReadable||I.length{H30.exports=EW;var G30=Mk();X1()(EW,G30);function EW($){if(!(this instanceof EW))return new EW($);G30.call(this,$)}EW.prototype._transform=function($,Y,z){z(null,$)}});var L30=E((Vd1,V30)=>{var Ok;function da0($){var Y=!1;return function(){if(Y)return;Y=!0,$.apply(void 0,arguments)}}var q30=p7().codes,ma0=q30.ERR_MISSING_ARGS,la0=q30.ERR_STREAM_DESTROYED;function X30($){if($)throw $}function oa0($){return $.setHeader&&typeof $.abort==="function"}function ra0($,Y,z,U){U=da0(U);var I=!1;if($.on("close",function(){I=!0}),Ok===void 0)Ok=_O();Ok($,{readable:Y,writable:z},function(J){if(J)return U(J);I=!0,U()});var Q=!1;return function(J){if(I)return;if(Q)return;if(Q=!0,oa0($))return $.abort();if(typeof $.destroy==="function")return $.destroy();U(J||new la0("pipe"))}}function Z30($){$()}function sa0($,Y){return $.pipe(Y)}function aa0($){if(!$.length)return X30;if(typeof $[$.length-1]!=="function")return X30;return $.pop()}function ta0(){for(var $=arguments.length,Y=Array($),z=0;z<$;z++)Y[z]=arguments[z];var U=aa0(Y);if(Array.isArray(Y[0]))Y=Y[0];if(Y.length<2)throw new ma0("streams");var I,Q=Y.map(function(J,K){var G=K0;return ra0(J,G,H,function(W){if(!I)I=W;if(W)Q.forEach(Z30);if(G)return;Q.forEach(Z30),U(I)})});return Y.reduce(sa0)}V30.exports=ta0});var E8=E((v$,RW)=>{var CW=J0("stream");if(process.env.READABLE_STREAM==="disable"&&CW)RW.exports=CW.Readable,Object.assign(RW.exports,CW),RW.exports.Stream=CW;else v$=RW.exports=Ik(),v$.Stream=CW||v$,v$.Readable=v$,v$.Writable=zk(),v$.Duplex=Uz(),v$.Transform=Mk(),v$.PassThrough=W30(),v$.finished=_O(),v$.pipeline=L30()});var Z8=E((Ld1,M30)=>{var F30=J0("fs"),ea0=function($,Y,z,U){if($.super_=Y,!U)U=z,z=null;if(z)Object.keys(z).forEach((Q)=>{Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(z,Q))});let I={constructor:{value:$,enumerable:!1,writable:!1,configurable:!0}};if(U)Object.keys(U).forEach((Q)=>{I[Q]=Object.getOwnPropertyDescriptor(U,Q)});$.prototype=Object.create(Y.prototype,I)},$t0=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,w30={nop(){},promiseImmediate($){return new Promise((Y)=>{if(global.setImmediate)setImmediate(()=>{Y($)});else setTimeout(()=>{Y($)},1)})},inherits:ea0,dateToExcel($,Y){return 25569+$.getTime()/86400000-(Y?1462:0)},excelToDate($,Y){let z=Math.round(($-25569+(Y?1462:0))*24*3600*1000);return new Date(z)},parsePath($){let Y=$.lastIndexOf("/");return{path:$.substring(0,Y),name:$.substring(Y+1)}},getRelsPath($){let Y=w30.parsePath($);return`${Y.path}/_rels/${Y.name}.rels`},xmlEncode($){let Y=$t0.exec($);if(!Y)return $;let z="",U="",I=0,Q=Y.index;for(;Q<$.length;Q++){let J=$.charCodeAt(Q);switch(J){case 34:U=""";break;case 38:U="&";break;case 39:U="'";break;case 60:U="<";break;case 62:U=">";break;case 127:U="";break;default:{if(J<=31&&(J<=8||J>=11&&J!==13)){U="";break}continue}}if(I!==Q)z+=$.substring(I,Q);if(I=Q+1,U)z+=U}if(I!==Q)return z+$.substring(I,Q);return z},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)=>{F30.access($,F30.constants.F_OK,(z)=>{Y(!z)})})}},toIsoDateString($){return $.toIsoString().subsstr(0,10)},parseBoolean($){return $===!0||$==="true"||$===1||$==="1"}};M30.exports=w30});var Nk=E((Fd1,N30)=>{class O30{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 z=Buffer.alloc(Y);this._buf.copy(z,0),this._buf=z}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}}}N30.exports=O30});var _W=E((wd1,E30)=>{var Yt0=E8(),D30=Z8(),zt0=Nk();class A30{constructor($,Y){this._data=$,this._encoding=Y}get length(){return this.toBuffer().length}copy($,Y,z,U){return this.toBuffer().copy($,Y,z,U)}toBuffer(){if(!this._buffer)this._buffer=Buffer.from(this._data,this._encoding);return this._buffer}}class P30{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,z,U){return this._data._buf.copy($,Y,z,U)}toBuffer(){return this._data.toBuffer()}}class B30{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,z,U){this._data.copy($,Y,z,U)}toBuffer(){return this._data}}class T30{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,z){let U=Math.min(z,this.size-this.iWrite);return $.copy(this.buffer,this.iWrite,Y,Y+U),this.iWrite+=U,U}}var j30=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};D30.inherits(j30,Yt0.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 T30(this.bufSize);return this.buffers.push($),$},async _pipe($){let Y=function(z){return new Promise((U)=>{z.write($.toBuffer(),()=>{U()})})};await Promise.all(this.pipes.map(Y))},_writeToBuffers($){let Y=0,z=$.length;while(Y1)this._pipe(this.buffers.shift())}else if(!this.corked)await this._pipe(U),z();else this._writeToBuffers(U),process.nextTick(z);else{if(!this.paused)this.emit("data",U.toBuffer());this._writeToBuffers(U),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,z){let U=(I)=>{if(I)z(I);else this._flush(),this.pipes.forEach((Q)=>{Q.end()}),this.emit("finish")};if($)this.write($,Y,U);else U()},read($){let Y;if($){Y=[];while($&&this.buffers.length&&!this.buffers[0].eod){let z=this.buffers[0],U=z.read($);if($-=U.length,Y.push(U),z.eod&&z.full)this.buffers.shift()}return Buffer.concat(Y)}return Y=this.buffers.map((z)=>z.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")}});E30.exports=j30});var _30=E((It0)=>{var C30=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:R30}=J0("buffer");function Ut0($){if(typeof $!=="string")return $;if(C30)return R30.from(C30.encode($).buffer);return R30.from($)}It0.stringToBuffer=Ut0});var S30=E((Nd1,h30)=>{var Jt0=J0("events"),Kt0=ry(),Gt0=_W(),{stringToBuffer:Od1}=_30();class v30 extends Jt0.EventEmitter{constructor($){super();this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},$),this.zip=new Kt0,this.stream=new Gt0}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($)}}h30.exports={ZipWriter:v30}});var l6=E((Dd1,k30)=>{var Ht0=Y6(),g30=Z8();function y30($,Y,z){$.push(` ${Y}="${g30.xmlEncode(z.toString())}"`)}function Dk($,Y){if(Y){let z=[];Ht0.each(Y,(U,I)=>{if(U!==void 0)y30(z,I,U)}),$.push(z.join(""))}}class Ak{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 z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),Dk(U,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)y30(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Dk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(g30.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,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}Ak.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};k30.exports=Ak});var Pk=E((Xt0)=>{var x30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Wt0($){if(typeof $==="string")return $;if(x30)return x30.decode($);return $.toString()}Xt0.bufferToString=Wt0});var c30=E((u30)=>{Object.defineProperty(u30,"__esModule",{value:!0});u30.CHAR=` \r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;u30.S=` \r @@ -2354,13 +2354,13 @@ flowchart TD 发布后核实版本状态,完成业务安全闭环。 `;var lh0=()=>{};var sh0=`--- name: seal-use -description: "v0.10.29: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." +description: "v0.10.30: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." metadata: - version: 0.10.29 - short-description: Seal tenant and Hose approval automation (v0.10.29) + version: 0.10.30 + short-description: Seal tenant and Hose approval automation (v0.10.30) --- -# Seal Use (v0.10.29) +# Seal Use (v0.10.30) **The CLI is the primary path; the MCP server is an optional extra that is off by default.** Prefer the global \`seal-use\` CLI, and only use MCP when it is actually available in the current session. If no \`seal_cli*\` tool is present, that is the normal default — do not try to enable it or treat it as a fault; just use the CLI. Enabling it is the user's choice in the plugin settings (插件配置中的「启用 MCP 服务」,默认关闭,打开后需重连该插件的 MCP 服务). @@ -2622,7 +2622,7 @@ ${Qo.map(($)=>`### \`seal-use ${$.domain}\` `}var Uo,Io,Qo;var Jo=o(()=>{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 -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Io=[{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 路径杜绝写文件与环境篡改。"}],Qo=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search ","corps get ","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs url"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材料包导入、飞书/泛微三方审批定义演练、批次轮询等待与数据清理",primaryCommands:["simulation create","simulation status","simulation wait","simulation clean"]},{domain:"webhook (通道与重放)",summary:"Webhook 回调通道配置、材料包校验推送、线上单据向 Webhook 通道测试重放",primaryCommands:["webhook list","webhook add","webhook replay","webhook material-pack push"]},{domain:"deploy (费控集成)",summary:"Seal AI 智能审核能力发布到合思费控企业、对接要求检测与配置同步",primaryCommands:["deploy hosecloud requirements","deploy hosecloud status","deploy hosecloud sync"]},{domain:"doctor (系统诊断)",summary:"整机环境健康自检、目录全景体检看板、内置架构与规范白皮书离线查阅",primaryCommands:["doctor","doctor guide","doctor paths"]}]});import{accessSync as Sg1,constants as gg1,existsSync as i6,readdirSync as MS0,statSync as yg1}from"node:fs";import{homedir as kg1}from"node:os";import{join as j5}from"node:path";function FS0($){if(!i6($))return 0;try{return MS0($).filter((Y)=>Y.endsWith(".json")).length}catch{return 0}}function _T($){try{return Sg1($,gg1.W_OK),!0}catch{return!1}}function wS0($){if(!i6($))return[];try{return MS0($).filter((Y)=>Y.endsWith(".json")&&!Y.startsWith("example.")).map((Y)=>j5($,Y))}catch{return[]}}function xg1($){return $.filter((Y)=>{try{return(yg1(Y).mode&63)!==0}catch{return!1}})}function Ko(){let $=kg1(),Y=j5($,".config","seal-use"),z=j5(Y,"enterprises"),U=j5(Y,"config.json"),I=j5(Y,"seal_tokens.json"),Q=j5(Y,"mappings"),J=gU(),K=j5($,"Downloads"),H=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",j5($,".local","bin","seal-use"),j5($,"bin","seal-use")].find((A)=>i6(A))??process.execPath,W={configDir:{name:"配置根目录",path:Y,exists:i6(Y),writable:i6(Y)?_T(Y):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:i6(z),writable:i6(z)?_T(z):!1,fileCount:FS0(z),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:U,exists:i6(U),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:I,exists:i6(I),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:Q,exists:i6(Q),fileCount:FS0(Q),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:J,exists:i6(j5(J,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:K,exists:i6(K),writable:i6(K)?_T(K):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:b$,exists:i6(b$),writable:i6(b$)?_T(b$):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:i$,exists:i6(i$),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:H,exists:i6(H),description:"系统全局命令执行入口"}},X=[];try{X=s8()}catch{X=[]}let Z=_4(),q=Z.defaultCorpId??X[0]?.id,V=X.find((A)=>A.id===q),F=X.filter((A)=>(A.environment??"production").toLowerCase()==="test").length,M=X.length-F,w=[];if(w.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),W.configDir?.exists&&W.configDir.writable)w.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${Y} (正常读写)`});else if(W.configDir?.exists)w.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${Y} (存在但可能不可写)`});else w.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${Y},首次运行配置命令时将自动创建`});if(X.length>0)w.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${X.length} 家企业 (正式: ${M}, 测试: ${F})`});else w.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(W.agentSkillDir?.exists)w.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${J}`});else w.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${J} 检测到技能,可运行 'seal-use skill sync' 安装`});let O=[I,U,_Z(),...wS0(z),...wS0(j5(process.cwd(),"enterprises"))].filter((A,j,C)=>C.indexOf(A)===j&&i6(A)),D=xg1(O);w.push({id:"credential_permissions",title:"凭据文件权限",status:D.length===0?"ok":"warn",message:D.length===0?`已检查 ${O.length} 个凭据文件,均为仅属主可读 (0600)`:`${D.length} 个凭据文件权限宽于 0600(同机其他用户可读,取决于父目录权限),建议 chmod 600:${D.join("、")}`});let N=Z.lint??{enabled:!1,activeLinter:"builtin",minScore:0};if(N.enabled)w.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:`已开启 (校验器: ${N.activeLinter}, 最低门槛分: ${N.minScore})`});else w.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:"未开启 (默认关闭,可运行 seal-use config lint enable 开启)"});let B=w.some((A)=>A.status==="warn"||A.status==="error"),T=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:B?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:P1,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:T},directories:W,enterprises:{total:X.length,productionCount:M,testCount:F,activeCorpId:V?.id,activeCorpName:V?.name},checks:w,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:Uo.length,securityPoliciesCount:Io.length,domainCapabilitiesCount:Qo.length,guideCommand:"seal-use doctor guide"}}}function OS0($){let Y=[],z=$.doctor==="ok"?"✨":"⚠️";Y.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${z}`),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 U=$.checks.find((I)=>I.id==="rule_linter");if(U&&U.message.includes("未开启"))Y.push("\uD83D\uDC49 开启规则自动质量校验: seal-use config lint enable");return Y.join(` `)}var NS0=o(()=>{qp();t9();S3();Cq();bP();Jo()});var DS0={};x8(DS0,{formatTenantDoctorDashboard:()=>ug1,diagnoseTenantContract:()=>fg1});async function fg1($,Y){let z=[],U=Y.environment==="test"?"test":"production",I=U==="test"?Y.prodCorpId:Y.testCorpId,Q=U==="test"?"prodParent":"testTarget",J=null,K=null;try{let M=await W8($);if(J=M.user,K=M.tenant,Boolean(J?.isAdmin||J?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${J.name??"未知"}」(${J.id??""}),具备完整操作权限`,details:{userId:J.id,userName:J.name,isAdmin:!0,tenantSlug:K?.tenantSlug,permissions:J.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${J.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:J.id,userName:J.name,isAdmin:!1,permissions:J.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(M){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let G={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},H={used:0,remaining:0};try{let M=await cY($),w=Array.isArray(M.features)?M.features:[],O=w.find((N)=>N?.code==="ai-approval");if(O){let N=typeof O.balance==="number"?O.balance:0,B=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,T=Math.floor(N/B);if(G.balance=N,G.deductionAmount=B,G.estimatedRuns=T,N<=0)G.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:N,deductionAmount:B,estimatedRuns:T},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(T<10)G.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${N} 点 (单笔扣除 ${B} 点),仅可支持约 ${T} 笔审核`,details:{balance:N,deductionAmount:B,estimatedRuns:T},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else G.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${N} 点,预估可支持 ${T} 笔审核单据`,details:{balance:N,deductionAmount:B,estimatedRuns:T}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:w.map((N)=>N?.code)}});let D=w.find((N)=>N?.code==="approval-rules");if(D)H.used=typeof D.used==="number"?D.used:0,H.remaining=typeof D.remaining==="number"?D.remaining:0}catch(M){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let W={totalCount:0,activeCount:0,quotaUsed:H.used,quotaRemaining:H.remaining};try{let M=await p6($),w=Array.isArray(M.rules)?M.rules:[];if(W.totalCount=w.length,W.activeCount=w.filter((O)=>O.status==="ACTIVE").length,w.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&I?`可运行 seal-use corps sync-test --corp ${I} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${W.totalCount} 条规则,其中生效活跃 ${W.activeCount} 条`,details:{totalCount:W.totalCount,activeCount:W.activeCount,quotaUsed:H.used,quotaRemaining:H.remaining}})}catch(M){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let X={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let M=await Q$($);X.integrationCount=M.length;let w=M.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(X.hasReplayChannel=Boolean(w),X.activeWebhookId=w?.id??M[0]?.id,M.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook add --name (回放通道) 手动注册专属通道"});else z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${M.length} 个通道${w?` (含专属回放通道「${w.name}」)`:""}`,details:{integrationCount:M.length,hasReplayChannel:X.hasReplayChannel,activeWebhookId:X.activeWebhookId}})}catch(M){z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:`检测 Webhook 通道失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}if(U==="test")if(I)z.push({id:"environment_binding",name:"测试环境配对契约",status:"pass",summary:`测试租户已绑定生产母企业「${I}」,具备样本拉取与配置同步能力`,details:{environment:U,boundCorpId:I,boundCorpRole:Q}});else z.push({id:"environment_binding",name:"测试环境配对契约",status:"warn",summary:"测试租户尚未绑定对应的生产母企业,无法直接拉取生产样本执行自动化回归",details:{environment:U},recommendation:`可运行 seal-use corps bind-test ${Y.id} 建立 1 对 1 绑定`});else if(I)z.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"pass",summary:`生产企业已绑定沙箱测试靶场「${I}」,回归测试将严格限制在靶场中运行`,details:{environment:U,boundCorpId:I,boundCorpRole:Q}});else z.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"warn",summary:"生产企业尚未绑定任何测试企业,所有回归测试功能将触发安全拦截",details:{environment:U},recommendation:`可运行 seal-use corps bind-test ${Y.id} 为该生产租户绑定测试靶场`});let Z=z.filter((M)=>M.status==="fail").length,q=z.filter((M)=>M.status==="warn").length,V=z.filter((M)=>M.status==="pass").length,F="HEALTHY";if(Z>0)F="BLOCKED";else if(q>0)F="DEGRADED";return{ok:Z===0,verdict:F,timestamp:new Date().toISOString(),corp:{id:Y.id,name:Y.name,environment:U,sourceType:Y.source?.type??"native",boundCorpId:I,boundCorpRole:Q},summary:{totalChecks:z.length,passedChecks:V,warningChecks:q,failedChecks:Z},checks:z,quota:G,rules:W,webhooks:X}}function ug1($){let{corp:Y,verdict:z,summary:U,checks:I,quota:Q,rules:J,webhooks:K}=$,G=z==="HEALTHY"?"\uD83D\uDFE2 健康良好 (HEALTHY)":z==="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}`)}return H.push(" "+"─".repeat(60)),H.push(` 检查汇总: 通过 ${U.passedChecks} · 告警 ${U.warningChecks} · 失败 ${U.failedChecks}`),H.push(""),H.join(` `)}var AS0=o(()=>{X6()});async function PS0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)... -`),console.log(LS0());return}if(U==="paths"||U==="dirs"||U==="directories"){let J=Ko();c0(J.directories);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (o4(),F_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),R00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),G_0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (AS0(),DS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=J(X),q=await K(Z),V=await H(q,Z);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(W(V));c0(V);return}let I=Ko();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(OS0(I));c0(I)}var BS0=o(()=>{NS0();Jo();D4();Q4()});var jS0;var TS0=o(()=>{jS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.29",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","direct","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","direct","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 enterprise assist 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:"Enterprise and document URLs.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{enterpriseAssistUrl:{type:"string"},enterpriseUrl:{type:"string"},documentUrl:{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(LS0());return}if(U==="paths"||U==="dirs"||U==="directories"){let J=Ko();c0(J.directories);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (o4(),F_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),R00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),G_0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (AS0(),DS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=J(X),q=await K(Z),V=await H(q,Z);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(W(V));c0(V);return}let I=Ko();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(OS0(I));c0(I)}var BS0=o(()=>{NS0();Jo();D4();Q4()});var jS0;var TS0=o(()=>{jS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.30",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","direct","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","direct","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 enterprise assist 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:"Enterprise and document URLs.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{enterpriseAssistUrl:{type:"string"},enterpriseUrl:{type:"string"},documentUrl:{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 edb334a..3c69027 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.29", + "version": "0.10.30", "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 34e7936..e83b0a4 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.29 + version: 0.10.30 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 36ad830..37af511 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.29", + "version": "0.10.30", "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 2b65f87..6ec0f2c 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -1,12 +1,12 @@ --- name: seal-use -description: "v0.10.29: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." +description: "v0.10.30: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." metadata: - version: 0.10.29 - short-description: Seal tenant and Hose approval automation (v0.10.29) + version: 0.10.30 + short-description: Seal tenant and Hose approval automation (v0.10.30) --- -# Seal Use (v0.10.29) +# Seal Use (v0.10.30) **The CLI is the primary path; the MCP server is an optional extra that is off by default.** Prefer the global `seal-use` CLI, and only use MCP when it is actually available in the current session. If no `seal_cli*` tool is present, that is the normal default — do not try to enable it or treat it as a fault; just use the CLI. Enabling it is the user's choice in the plugin settings (插件配置中的「启用 MCP 服务」,默认关闭,打开后需重连该插件的 MCP 服务).