From 9b5e668f09c1b588283bd265f1bc9a80b44b351e Mon Sep 17 00:00:00 2001 From: yunyingk Date: Sun, 20 Sep 2026 11:43:26 +0800 Subject: [PATCH] Release v0.10.31: User-centric skill redesign and CLI experience refinement --- .zcode-plugin/plugin.json | 2 +- CHANGELOG.md | 12 ++++++++++++ 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, 26 insertions(+), 14 deletions(-) diff --git a/.zcode-plugin/plugin.json b/.zcode-plugin/plugin.json index ee382bd..a13c758 100644 --- a/.zcode-plugin/plugin.json +++ b/.zcode-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.30", + "version": "0.10.31", "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 57d4408..6dc0c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.31] - 2026-09-20 + +### Added +- **Top-Level Mandatory Business Vocabulary & Output Contract**: Elevated terminology and presentation rules to Chapter 0 of `SKILL.md` as mandatory red lines across all agent output channels (rules list, rule detail, diff review, doctor tenant, feedback remediation, and conversational dialogue). + - Enforced business terms: `scope` ➔ `适用场景` (strictly prohibited: 适用范围, 适用模版), `strictness` ➔ `遵守程度` (`MUST_FOLLOW` ➔ `必须遵守`, `SHOULD_FOLLOW` ➔ `建议遵守`, `SUGGESTION` ➔ `提示参考`), `code` ➔ `规则编号` (e.g. `#0038`), `status` ➔ `启用状态`. + - Machine UUID & Internal Fields Redaction: Strictly prohibited exposing raw persistence UUIDs (`01a00f...`, `cly...`) and internal technical names (`boundCorpRole`, `permissions: ["*"]`, `tenantSlug`) to users. +- **Mandatory Image Presentation Contract for First-Time Onboarding**: Hardcoded rule in `SKILL.md` and `first-time-user.md` requiring agents to proactively render step-by-step visual screenshots using Markdown image syntax during onboarding, forbidding text-only descriptions. +- **Clean Administrator Candidate Directory with Privacy Masking**: When multiple candidate administrators exist, the CLI formats a clean, numbered directory with standard Chinese mobile masking (`138****5678`), strips raw internal IDs and technical noise, provides friendly selection guidance (by name keyword, by last 4 digits of phone, or `--force`), and retains all candidates without omission. +- **Automated Enterprise Name Resolution on Onboarding**: `corps add-hose`, `add-link`, and `extract-keys --save` now automatically query the live Seal tenant during verification and persist the human-readable enterprise name, preventing enterprises from being registered with raw machine IDs (e.g. `ID01LG7ksGroB1`). +- **Doctor Tenant Diagnosis Humanization**: Added `boundCorpRoleDescription` and `permissionLevel` to provide clear, business-friendly status summaries without exposing raw internal arrays and enums. +- **Business-Focused Rule Summary Fields**: Refined `RULE_SUMMARY_FIELDS` to prioritize `["code", "status", "strictness", "scope", "updatedAt"]`, eliminating raw UUIDs from default summaries. + ## [0.10.30] - 2026-09-18 ### Added diff --git a/dist/mcp/server.js b/dist/mcp/server.js index d5dd982..63ecf2a 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,Q._`[${A}]`)}}}function q({gen:N,parentData:D,parentDataProperty:B},T){N.if(Q._`${D} !== undefined`,()=>N.assign(Q._`${D}[${B}]`,T))}function V(N,D,B,T=I.Correct){let A=T===I.Correct?Q.operators.EQ:Q.operators.NEQ,j;switch(N){case"null":return Q._`${D} ${A} null`;case"array":j=Q._`Array.isArray(${D})`;break;case"object":j=Q._`${D} && typeof ${D} == "object" && !Array.isArray(${D})`;break;case"integer":j=C(Q._`!(${D} % 1) && !isNaN(${D})`);break;case"number":j=C();break;default:return Q._`typeof ${D} ${A} ${N}`}return T===I.Correct?j:(0,Q.not)(j);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${D} == "number"`,b,B?Q._`isFinite(${D})`:Q.nil)}}$.checkDataType=V;function F(N,D,B,T){if(N.length===1)return V(N[0],D,B,T);let A,j=(0,J.toHash)(N);if(j.array&&j.object){let C=Q._`typeof ${D} != "object"`;A=j.null?C:Q._`!${D} || ${C}`,delete j.null,delete j.array,delete j.object}else A=Q.nil;if(j.number)delete j.integer;for(let C in j)A=(0,Q.and)(A,V(C,D,B,T));return A}$.checkDataTypes=F;let O={message:({schema:N})=>`must be ${N}`,params:({schema:N,schemaValue:D})=>typeof N=="string"?Q._`{type: ${N}}`:Q._`{type: ${D}}`};function w(N){let D=M(N);(0,z.reportError)(D,O)}$.reportTypeError=w;function M(N){let{gen:D,data:B,schema:T}=N,A=(0,J.schemaRefOrVal)(N,T,"type");return{gen:D,keyword:"type",data:B,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:N}}}),gu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let U=L1(),Y=v1();function z(J,I){let{properties:K,items:G}=J.schema;if(I==="object"&&K)for(let H in K)Q(J,H,K[H].default);else if(I==="array"&&Array.isArray(G))G.forEach((H,W)=>Q(J,W,H.default))}$.assignDefaults=z;function Q(J,I,K){let{gen:G,compositeRule:H,data:W,opts:X}=J;if(K===void 0)return;let Z=U._`${W}${(0,U.getProperty)(I)}`;if(H){(0,Y.checkStrictMode)(J,`default is ignored for: ${Z}`);return}let q=U._`${Z} === undefined`;if(X.useDefaults==="empty")q=U._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,U._`${Z} = ${(0,U.stringify)(K)}`)}}),Q5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let U=L1(),Y=v1(),z=z5(),Q=v1();function J(N,D){let{gen:B,data:T,it:A}=N;B.if(X(B,T,D,A.opts.ownProperties),()=>{N.setParams({missingProperty:U._`${D}`},!0),N.error()})}$.checkReportMissingProp=J;function I({gen:N,data:D,it:{opts:B}},T,A){return(0,U.or)(...T.map((j)=>(0,U.and)(X(N,D,j,B.ownProperties),U._`${A} = ${j}`)))}$.checkMissingProp=I;function K(N,D){N.setParams({missingProperty:D},!0),N.error()}$.reportMissingProp=K;function G(N){return N.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:U._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(N,D,B){return U._`${G(N)}.call(${D}, ${B})`}$.isOwnProperty=H;function W(N,D,B,T){let A=U._`${D}${(0,U.getProperty)(B)} !== undefined`;return T?U._`${A} && ${H(N,D,B)}`:A}$.propertyInData=W;function X(N,D,B,T){let A=U._`${D}${(0,U.getProperty)(B)} === undefined`;return T?(0,U.or)(A,(0,U.not)(H(N,D,B))):A}$.noPropertyInData=X;function Z(N){return N?Object.keys(N).filter((D)=>D!=="__proto__"):[]}$.allSchemaProperties=Z;function q(N,D){return Z(D).filter((B)=>!(0,Y.alwaysValidSchema)(N,D[B]))}$.schemaProperties=q;function V({schemaCode:N,data:D,it:{gen:B,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,x,h){let i=h?U._`${N}, ${D}, ${T}${A}`:D,c=[[z.default.instancePath,(0,U.strConcat)(z.default.instancePath,j)],[z.default.parentData,C.parentData],[z.default.parentDataProperty,C.parentDataProperty],[z.default.rootData,z.default.rootData]];if(C.opts.dynamicRef)c.push([z.default.dynamicAnchors,z.default.dynamicAnchors]);let z0=U._`${i}, ${B.object(...c)}`;return x!==U.nil?U._`${b}.call(${x}, ${z0})`:U._`${b}(${z0})`}$.callValidateCode=V;let F=U._`new RegExp`;function O({gen:N,it:{opts:D}},B){let T=D.unicodeRegExp?"u":"",{regExp:A}=D.code,j=A(B,T);return N.scopeValue("pattern",{key:j.toString(),ref:j,code:U._`${A.code==="new RegExp"?F:(0,Q.useFunc)(N,A)}(${B}, ${T})`})}$.usePattern=O;function w(N){let{gen:D,data:B,keyword:T,it:A}=N,j=D.name("valid");if(A.allErrors){let b=D.let("valid",!0);return C(()=>D.assign(b,!1)),b}return D.var(j,!0),C(()=>D.break()),j;function C(b){let x=D.const("len",U._`${B}.length`);D.forRange("i",0,x,(h)=>{N.subschema({keyword:T,dataProp:h,dataPropType:Y.Type.Num},j),D.if((0,U.not)(j),b)})}}$.validateArray=w;function M(N){let{gen:D,schema:B,keyword:T,it:A}=N;if(!Array.isArray(B))throw Error("ajv implementation error");if(B.some((b)=>(0,Y.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=D.let("valid",!1),C=D.name("_valid");D.block(()=>B.forEach((b,x)=>{let h=N.subschema({keyword:T,schemaProp:x,compositeRule:!0},C);if(D.assign(j,U._`${j} || ${C}`),!N.mergeValidEvaluated(h,C))D.if((0,U.not)(j))})),N.result(j,()=>N.reset(),()=>N.error(!0))}$.validateUnion=M}),yu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateKeywordUsage=$.validSchemaType=$.funcKeywordCode=$.macroKeywordCode=void 0;let U=L1(),Y=z5(),z=Q5(),Q=Sw();function J(q,V){let{gen:F,keyword:O,schema:w,parentSchema:M,it:N}=q,D=V.macro.call(N.self,w,M,N),B=W(F,O,D);if(N.opts.validateSchema!==!1)N.self.validateSchema(D,!0);let T=F.name("valid");q.subschema({schema:D,schemaPath:U.nil,errSchemaPath:`${N.errSchemaPath}/${O}`,topSchemaRef:B,compositeRule:!0},T),q.pass(T,()=>q.error(!0))}$.macroKeywordCode=J;function I(q,V){var F;let{gen:O,keyword:w,schema:M,parentSchema:N,$data:D,it:B}=q;H(B,V);let T=W(O,w,!D&&V.compile?V.compile.call(B.self,M,N,B):V.validate),A=O.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(x(),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=O.let("ruleErrs",null);return O.try(()=>x(U._`await `),(c)=>O.assign(A,!1).if(U._`${c} instanceof ${B.ValidationError}`,()=>O.assign(i,U._`${c}.errors`),()=>O.throw(c))),i}function b(){let i=U._`${T}.errors`;return O.assign(i,null),x(U.nil),i}function x(i=V.async?U._`await `:U.nil){let c=B.opts.passContext?Y.default.this:Y.default.self,z0=!(("compile"in V)&&!D||V.schema===!1);O.assign(A,U._`${i}${(0,z.callValidateCode)(q,T,c,z0)}`,V.modifying)}function h(i){var c;O.if((0,U.not)((c=V.valid)!==null&&c!==void 0?c:A),i)}}$.funcKeywordCode=I;function K(q){let{gen:V,data:F,it:O}=q;V.if(O.parentData,()=>V.assign(F,U._`${O.parentData}[${O.parentDataProperty}]`))}function G(q,V){let{gen:F}=q;F.if(U._`Array.isArray(${V})`,()=>{F.assign(Y.default.vErrors,U._`${Y.default.vErrors} === null ? ${V} : ${Y.default.vErrors}.concat(${V})`).assign(Y.default.errors,U._`${Y.default.vErrors}.length`),(0,Q.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,U.stringify)(F)})}function X(q,V,F=!1){return!V.length||V.some((O)=>O==="array"?Array.isArray(q):O==="object"?q&&typeof q=="object"&&!Array.isArray(q):typeof q==O||F&&typeof q>"u")}$.validSchemaType=X;function Z({schema:q,opts:V,self:F,errSchemaPath:O},w,M){if(Array.isArray(w.keyword)?!w.keyword.includes(M):w.keyword!==M)throw Error("ajv implementation error");let N=w.dependencies;if(N===null||N===void 0?void 0:N.some((D)=>!Object.prototype.hasOwnProperty.call(q,D)))throw Error(`parent schema must have dependencies of ${M}: ${N.join(",")}`);if(w.validateSchema){if(!w.validateSchema(q[M])){let D=`keyword "${M}" value is invalid at path "${O}": `+F.errorsText(w.validateSchema.errors);if(V.validateSchema==="log")F.logger.error(D);else throw Error(D)}}}$.validateKeywordUsage=Z}),ku0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.extendSubschemaMode=$.extendSubschemaData=$.getSubschema=void 0;let U=L1(),Y=v1();function z(I,{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=I.schema[K];return G===void 0?{schema:q,schemaPath:U._`${I.schemaPath}${(0,U.getProperty)(K)}`,errSchemaPath:`${I.errSchemaPath}/${K}`}:{schema:q[G],schemaPath:U._`${I.schemaPath}${(0,U.getProperty)(K)}${(0,U.getProperty)(G)}`,errSchemaPath:`${I.errSchemaPath}/${K}/${(0,Y.escapeFragment)(G)}`}}if(H!==void 0){if(W===void 0||X===void 0||Z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:H,schemaPath:W,topSchemaRef:Z,errSchemaPath:X}}throw Error('either "keyword" or "schema" must be passed')}$.getSubschema=z;function Q(I,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:O,opts:w}=K;V(q.let("data",U._`${K.data}${(0,U.getProperty)(G)}`,!0)),I.errorPath=U.str`${F}${(0,Y.getErrorPath)(G,H,w.jsPropertySyntax)}`,I.parentDataProperty=U._`${G}`,I.dataPathArr=[...O,I.parentDataProperty]}if(W!==void 0){if(V(W instanceof U.Name?W:q.let("data",W,!0)),Z!==void 0)I.propertyName=Z}if(X)I.dataTypes=X;function V(F){I.data=F,I.dataLevel=K.dataLevel+1,I.dataTypes=[],K.definedProperties=new Set,I.parentData=K.data,I.dataNames=[...K.dataNames,F]}}$.extendSubschemaData=Q;function J(I,{jtdDiscriminator:K,jtdMetadata:G,compositeRule:H,createErrors:W,allErrors:X}){if(H!==void 0)I.compositeRule=H;if(W!==void 0)I.createErrors=W;if(X!==void 0)I.allErrors=X;I.jtdDiscriminator=K,I.jtdMetadata=G}$.extendSubschemaMode=J}),dt=R0(($,U)=>{U.exports=function Y(z,Q){if(z===Q)return!0;if(z&&Q&&typeof z=="object"&&typeof Q=="object"){if(z.constructor!==Q.constructor)return!1;var J,I,K;if(Array.isArray(z)){if(J=z.length,J!=Q.length)return!1;for(I=J;I--!==0;)if(!Y(z[I],Q[I]))return!1;return!0}if(z.constructor===RegExp)return z.source===Q.source&&z.flags===Q.flags;if(z.valueOf!==Object.prototype.valueOf)return z.valueOf()===Q.valueOf();if(z.toString!==Object.prototype.toString)return z.toString()===Q.toString();if(K=Object.keys(z),J=K.length,J!==Object.keys(Q).length)return!1;for(I=J;I--!==0;)if(!Object.prototype.hasOwnProperty.call(Q,K[I]))return!1;for(I=J;I--!==0;){var G=K[I];if(!Y(z[G],Q[G]))return!1}return!0}return z!==z&&Q!==Q}}),xu0=R0(($,U)=>{var Y=U.exports=function(J,I,K){if(typeof I=="function")K=I,I={};K=I.cb||K;var G=typeof K=="function"?K:K.pre||function(){},H=K.post||function(){};z(I,G,H,J,"",J)};Y.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},Y.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},Y.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},Y.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function z(J,I,K,G,H,W,X,Z,q,V){if(G&&typeof G=="object"&&!Array.isArray(G)){I(G,H,W,X,Z,q,V);for(var F in G){var O=G[F];if(Array.isArray(O)){if(F in Y.arrayKeywords)for(var w=0;w{Object.defineProperty($,"__esModule",{value:!0}),$.getSchemaRefs=$.resolveUrl=$.normalizeId=$._getFullPath=$.getFullPath=$.inlineRef=void 0;let U=v1(),Y=dt(),z=xu0(),Q=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J(O,w=!0){if(typeof O=="boolean")return!0;if(w===!0)return!K(O);if(!w)return!1;return G(O)<=w}$.inlineRef=J;let I=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function K(O){for(let w in O){if(I.has(w))return!0;let M=O[w];if(Array.isArray(M)&&M.some(K))return!0;if(typeof M=="object"&&K(M))return!0}return!1}function G(O){let w=0;for(let M in O){if(M==="$ref")return 1/0;if(w++,Q.has(M))continue;if(typeof O[M]=="object")(0,U.eachItem)(O[M],(N)=>w+=G(N));if(w===1/0)return 1/0}return w}function H(O,w="",M){if(M!==!1)w=Z(w);return W(O,O.parse(w))}$.getFullPath=H;function W(O,w){return O.serialize(w).split("#")[0]+"#"}$._getFullPath=W;let X=/#\/?$/;function Z(O){return O?O.replace(X,""):""}$.normalizeId=Z;function q(O,w,M){return M=Z(M),O.resolve(w,M)}$.resolveUrl=q;let V=/^[a-z_][-a-z0-9._]*$/i;function F(O,w){if(typeof O=="boolean")return{};let{schemaId:M,uriResolver:N}=this.opts,D=Z(O[M]||w),B={"":D},T=H(N,D,!1),A={},j=new Set;return z(O,{allKeys:!0},(x,h,i,c)=>{if(c===void 0)return;let z0=T+h,k=B[c];if(typeof x[M]=="string")k=d.call(this,x[M]);t.call(this,x.$anchor),t.call(this,x.$dynamicAnchor),B[h]=k;function d($0){let g=this.opts.uriResolver.resolve;if($0=Z(k?g(k,$0):$0),j.has($0))throw b($0);j.add($0);let p=this.refs[$0];if(typeof p=="string")p=this.refs[p];if(typeof p=="object")C(x,p.schema,$0);else if($0!==Z(z0))if($0[0]==="#")C(x,A[$0],$0),A[$0]=x;else this.refs[$0]=z0;return $0}function t($0){if(typeof $0=="string"){if(!V.test($0))throw Error(`invalid anchor "${$0}"`);d.call(this,`#${$0}`)}}}),A;function C(x,h,i){if(h!==void 0&&!Y(x,h))throw b(i)}function b(x){return Error(`reference "${x}" resolves to more than one schema`)}}$.getSchemaRefs=F}),SQ=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.getData=$.KeywordCxt=$.validateFunctionCode=void 0;let U=Su0(),Y=hw(),z=pt(),Q=hw(),J=gu0(),I=yu0(),K=ku0(),G=L1(),H=z5(),W=gw(),X=v1(),Z=Sw();function q(a){if(T(a)){if(j(a),B(a)){w(a);return}}V(a,()=>(0,U.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"; ${N(F0,u0)}`),O(a,u0),a.code(i0)});else a.func(W0,G._`${H.default.data}, ${F(u0)}`,f0.$async,()=>a.code(N(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 O(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(x(a),f0.let(H.default.vErrors,null),f0.let(H.default.errors,0),F0.unevaluated)M(a);C(a),z0(a)})}function M(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 N(a,W0){let F0=typeof a=="object"&&a[W0.schemaId];return F0&&(W0.code.source||W0.code.process)?G._`/*# sourceURL=${F0} */`:G.nil}function D(a,W0){if(T(a)){if(j(a),B(a)){A(a,W0);return}}(0,U.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,Y.getSchemaTypes)(a.schema);d(a,F0,!(0,Y.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 x(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 z0(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)k(a);W0.return(G._`${H.default.errors} === 0`)}}function k({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)Q0(P);Q0(A0.post)});function Q0(P){if(!(0,z.shouldUseGroup)(i0,P))return;if(P.type){if(u0.if((0,Q.checkDataType)(P.type,D1,u1.strictNumbers)),t(a,P),W0.length===1&&W0[0]===P.type&&F0)u0.else(),(0,Q.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,J.assignDefaults)(a,W0.type);F0.block(()=>{for(let i0 of W0.rules)if((0,z.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))O0(a,`type "${F0}" not allowed by context "${a.dataTypes.join(",")}"`)}),U0(a,W0)}function p(a,W0){if(W0.length>1&&!(W0.length===2&&W0.includes("null")))O0(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,z.shouldUseRule)(a.schema,u0)){let{type:i0}=u0.definition;if(i0.length&&!i0.some((D1)=>y(W0,D1)))O0(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 U0(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 O0(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,I.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",U1(this.$data,a));else if(this.schemaCode=this.schemaValue,!(0,I.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,Q.checkDataTypes)(k1,W0,u0.opts.strictNumbers,Q.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 D(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,I.funcKeywordCode)(u0,F0);else if("macro"in F0)(0,I.macroKeywordCode)(u0,F0);else if(F0.compile||F0.validate)(0,I.funcKeywordCode)(u0,F0)}let T0=/^\/(?:[^~]|~0|~1)*$/,b0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function U1(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=U1}),qH=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});var U=class extends Error{constructor(Y){super("validation failed");this.errors=Y,this.ajv=this.validation=!0}};$.default=U}),gQ=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=gw();var Y=class extends Error{constructor(z,Q,J,I){super(I||`can't resolve reference ${J} from id ${Q}`);this.missingRef=(0,U.resolveUrl)(z,Q,J),this.missingSchema=(0,U.normalizeId)((0,U.getFullPath)(z,this.missingRef))}};$.default=Y}),yw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.resolveSchema=$.getCompilingSchema=$.resolveRef=$.compileSchema=$.SchemaEnv=void 0;let U=L1(),Y=qH(),z=z5(),Q=gw(),J=v1(),I=SQ();var K=class{constructor(w){var M;this.refs={},this.dynamicAnchors={};let N;if(typeof w.schema=="object")N=w.schema;this.schema=w.schema,this.schemaId=w.schemaId,this.root=w.root||this,this.baseId=(M=w.baseId)!==null&&M!==void 0?M:(0,Q.normalizeId)(N===null||N===void 0?void 0:N[w.schemaId||"$id"]),this.schemaPath=w.schemaPath,this.localRefs=w.localRefs,this.meta=w.meta,this.$async=N===null||N===void 0?void 0:N.$async,this.refs={}}};$.SchemaEnv=K;function G(w){let M=X.call(this,w);if(M)return M;let N=(0,Q.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:D,lines:B}=this.opts.code,{ownProperties:T}=this.opts,A=new U.CodeGen(this.scope,{es5:D,lines:B,ownProperties:T}),j;if(w.$async)j=A.scopeValue("Error",{ref:Y.default,code:U._`require("ajv/dist/runtime/validation_error").default`});let C=A.scopeName("validate");w.validateName=C;let b={gen:A,allErrors:this.opts.allErrors,data:z.default.data,parentData:z.default.parentData,parentDataProperty:z.default.parentDataProperty,dataNames:[z.default.data],dataPathArr:[U.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,U.stringify)(w.schema)}:{ref:w.schema}),validateName:C,ValidationError:j,schema:w.schema,schemaEnv:w,rootId:N,baseId:w.baseId||N,schemaPath:U.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:U._`""`,opts:this.opts,self:this},x;try{this._compilations.add(w),(0,I.validateFunctionCode)(b),A.optimize(this.opts.code.optimize);let h=A.toString();if(x=`${A.scopeRefs(z.default.scope)}return ${h}`,this.opts.code.process)x=this.opts.code.process(x,w);let i=Function(`${z.default.self}`,`${z.default.scope}`,x)(this,this.scope.get());if(this.scope.value(C,{ref:i}),i.errors=null,i.schema=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:z0}=b;if(i.evaluated={props:c instanceof U.Name?void 0:c,items:z0 instanceof U.Name?void 0:z0,dynamicProps:c instanceof U.Name,dynamicItems:z0 instanceof U.Name},i.source)i.source.evaluated=(0,U.stringify)(i.evaluated)}return w.validate=i,w}catch(h){if(delete w.validate,delete w.validateName,x)this.logger.error("Error compiling schema, function code:",x);throw h}finally{this._compilations.delete(w)}}$.compileSchema=G;function H(w,M,N){var D;N=(0,Q.resolveUrl)(this.opts.uriResolver,M,N);let B=w.refs[N];if(B)return B;let T=q.call(this,w,N);if(T===void 0){let A=(D=w.localRefs)===null||D===void 0?void 0:D[N],{schemaId:j}=this.opts;if(A)T=new K({schema:A,schemaId:j,root:w,baseId:M})}if(T===void 0)return;return w.refs[N]=W.call(this,T)}$.resolveRef=H;function W(w){if((0,Q.inlineRef)(w.schema,this.opts.inlineRefs))return w.schema;return w.validate?w:G.call(this,w)}function X(w){for(let M of this._compilations)if(Z(M,w))return M}$.getCompilingSchema=X;function Z(w,M){return w.schema===M.schema&&w.root===M.root&&w.baseId===M.baseId}function q(w,M){let N;while(typeof(N=this.refs[M])=="string")M=N;return N||this.schemas[M]||V.call(this,w,M)}function V(w,M){let N=this.opts.uriResolver.parse(M),D=(0,Q._getFullPath)(this.opts.uriResolver,N),B=(0,Q.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&D===B)return O.call(this,N,w);let T=(0,Q.normalizeId)(D),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 O.call(this,N,j)}if(typeof(A===null||A===void 0?void 0:A.schema)!=="object")return;if(!A.validate)G.call(this,A);if(T===(0,Q.normalizeId)(M)){let{schema:j}=A,{schemaId:C}=this.opts,b=j[C];if(b)B=(0,Q.resolveUrl)(this.opts.uriResolver,B,b);return new K({schema:j,schemaId:C,root:w,baseId:B})}return O.call(this,N,A)}$.resolveSchema=V;let F=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function O(w,{baseId:M,schema:N,root:D}){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 N==="boolean")return;let C=N[(0,J.unescapeFragment)(j)];if(C===void 0)return;N=C;let b=typeof N==="object"&&N[this.opts.schemaId];if(!F.has(j)&&b)M=(0,Q.resolveUrl)(this.opts.uriResolver,M,b)}let T;if(typeof N!="boolean"&&N.$ref&&!(0,J.schemaHasRulesButRef)(N,this.RULES)){let j=(0,Q.resolveUrl)(this.opts.uriResolver,M,N.$ref);T=V.call(this,D,j)}let{schemaId:A}=this.opts;if(T=T||new K({schema:N,schemaId:A,root:D,baseId:M}),T.schema!==T.root.schema)return T}}),fu0=R0(($,U)=>{U.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(($,U)=>{let Y=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),z=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Q(V){let F="",O=0,w=0;for(w=0;w=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102))return"";F+=V[w];break}for(w+=1;w=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102))return"";F+=V[w]}return F}let J=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function I(V){return V.length=0,!0}function K(V,F,O){if(V.length){let w=Q(V);if(w!=="")F.push(w);else return O.error=!0,!1;V.length=0}return!0}function G(V){let F=0,O={error:!1,address:"",zone:""},w=[],M=[],N=!1,D=!1,B=K;for(let T=0;T7){O.error=!0;break}if(T>0&&V[T-1]===":")N=!0;w.push(":");continue}else if(A==="%"){if(!B(M,w,O))break;B=I}else{M.push(A);continue}}if(M.length)if(B===I)O.zone=M.join("");else if(D)w.push(M.join(""));else w.push(Q(M));return O.address=w.join(""),O}function H(V){if(W(V,":")<2)return{host:V,isIPV6:!1};let F=G(V);if(!F.error){let{address:O,address:w}=F;if(F.zone)O+="%"+F.zone,w+="%25"+F.zone;return{host:O,isIPV6:!0,escapedHost:w}}else return{host:V,isIPV6:!1}}function W(V,F){let O=0;for(let w=0;w{let{isUUID:Y}=mt(),z=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Q=["http","https","ws","wss","urn","urn:uuid"];function J(A){return Q.indexOf(A)!==-1}function I(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=I(A),A.resourceName=(A.path||"/")+(A.query?"?"+A.query:""),A.path=void 0,A.query=void 0,A}function W(A){if(A.port===(I(A)?443:80)||A.port==="")A.port=void 0;if(typeof A.secure==="boolean")A.scheme=A.secure?"wss":"ws",A.secure=void 0;if(A.resourceName){let[j,C]=A.resourceName.split("?");A.path=j&&j!=="/"?j:void 0,A.query=C,A.resourceName=void 0}return A.fragment=void 0,A}function X(A,j){if(!A.path)return A.error="URN can not be parsed",A;let C=A.path.match(z);if(C){let b=j.scheme||A.scheme||"urn";A.nid=C[1].toLowerCase(),A.nss=C[2];let x=T(`${b}:${j.nid||A.nid}`);if(A.path=void 0,x)A=x.parse(A,j)}else A.error=A.error||"URN can not be parsed.";return A}function Z(A,j){if(A.nid===void 0)throw Error("URN without nid cannot be serialized");let C=j.scheme||A.scheme||"urn",b=A.nid.toLowerCase(),x=T(`${C}:${j.nid||b}`);if(x)A=x.serialize(A,j);let 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||!Y(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},O={scheme:"https",domainHost:F.domainHost,parse:K,serialize:G},w={scheme:"ws",domainHost:!0,parse:H,serialize:W},M={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},B={http:F,https:O,ws:w,wss:M,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}U.exports={wsIsSecure:I,SCHEMES:B,isValidSchemeName:J,getSchemeHandler:T}}),bu0=R0(($,U)=>{let{normalizeIPv6:Y,removeDotSegments:z,recomposeAuthority:Q,normalizeComponentEncoding:J,isIPv4:I,nonSimpleDomain:K}=mt(),{SCHEMES:G,getSchemeHandler:H}=uu0();function W(M,N){if(typeof M==="string")M=V(O(M,N),N);else if(typeof M==="object")M=O(V(M,N),N);return M}function X(M,N,D){let B=D?Object.assign({scheme:"null"},D):{scheme:"null"},T=Z(O(M,B),O(N,B),B,!0);return B.skipEscape=!0,V(T,B)}function Z(M,N,D,B){let T={};if(!B)M=O(V(M,D),D),N=O(V(N,D),D);if(D=D||{},!D.tolerant&&N.scheme)T.scheme=N.scheme,T.userinfo=N.userinfo,T.host=N.host,T.port=N.port,T.path=z(N.path||""),T.query=N.query;else{if(N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)T.userinfo=N.userinfo,T.host=N.host,T.port=N.port,T.path=z(N.path||""),T.query=N.query;else{if(!N.path)if(T.path=M.path,N.query!==void 0)T.query=N.query;else T.query=M.query;else{if(N.path[0]==="/")T.path=z(N.path);else{if((M.userinfo!==void 0||M.host!==void 0||M.port!==void 0)&&!M.path)T.path="/"+N.path;else if(!M.path)T.path=N.path;else T.path=M.path.slice(0,M.path.lastIndexOf("/")+1)+N.path;T.path=z(T.path)}T.query=N.query}T.userinfo=M.userinfo,T.host=M.host,T.port=M.port}T.scheme=M.scheme}return T.fragment=N.fragment,T}function q(M,N,D){if(typeof M==="string")M=unescape(M),M=V(J(O(M,D),!0),{...D,skipEscape:!0});else if(typeof M==="object")M=V(J(M,!0),{...D,skipEscape:!0});if(typeof N==="string")N=unescape(N),N=V(J(O(N,D),!0),{...D,skipEscape:!0});else if(typeof N==="object")N=V(J(N,!0),{...D,skipEscape:!0});return M.toLowerCase()===N.toLowerCase()}function V(M,N){let D={host:M.host,scheme:M.scheme,userinfo:M.userinfo,port:M.port,path:M.path,query:M.query,nid:M.nid,nss:M.nss,uuid:M.uuid,fragment:M.fragment,reference:M.reference,resourceName:M.resourceName,secure:M.secure,error:""},B=Object.assign({},N),T=[],A=H(B.scheme||D.scheme);if(A&&A.serialize)A.serialize(D,B);if(D.path!==void 0)if(!B.skipEscape){if(D.path=escape(D.path),D.scheme!==void 0)D.path=D.path.split("%3A").join(":")}else D.path=unescape(D.path);if(B.reference!=="suffix"&&D.scheme)T.push(D.scheme,":");let j=Q(D);if(j!==void 0){if(B.reference!=="suffix")T.push("//");if(T.push(j),D.path&&D.path[0]!=="/")T.push("/")}if(D.path!==void 0){let C=D.path;if(!B.absolutePath&&(!A||!A.absolutePath))C=z(C);if(j===void 0&&C[0]==="/"&&C[1]==="/")C="/%2F"+C.slice(2);T.push(C)}if(D.query!==void 0)T.push("?",D.query);if(D.fragment!==void 0)T.push("#",D.fragment);return T.join("")}let F=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function O(M,N){let D=Object.assign({},N),B={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},T=!1;if(D.reference==="suffix")if(D.scheme)M=D.scheme+":"+M;else M="//"+M;let A=M.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(I(B.host)===!1){let C=Y(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(D.reference&&D.reference!=="suffix"&&D.reference!==B.reference)B.error=B.error||"URI is not a "+D.reference+" reference.";let j=H(D.scheme||B.scheme);if(!D.unicodeSupport&&(!j||!j.unicodeSupport)){if(B.host&&(D.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(M.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,D)}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:O};U.exports=w,U.exports.default=w,U.exports.fastUri=w}),iu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=bu0();U.code='require("ajv/dist/runtime/uri").default',$.default=U}),QS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=void 0;var U=SQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return U.KeywordCxt}});var Y=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return Y._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return Y.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return Y.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return Y.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return Y.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return Y.CodeGen}});let z=qH(),Q=gQ(),J=nt(),I=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"]),O={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.'},M=200;function N(g){var p,e,y,s,U0,O0,E0,G0,T0,b0,U1,a,W0,F0,f0,u0,i0,D1,k1,u1,b1,A0,Q0,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,J0=(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:(O0=(U0=g.strictSchema)!==null&&U0!==void 0?U0:u)!==null&&O0!==void 0?O0:!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=(U1=g.strictTuples)!==null&&U1!==void 0?U1: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:J0}:{optimize:X0,regExp:J0},loopRequired:(f0=g.loopRequired)!==null&&f0!==void 0?f0:M,loopEnum:(u0=g.loopEnum)!==null&&u0!==void 0?u0:M,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:(Q0=g.validateFormats)!==null&&Q0!==void 0?Q0:!0,unicodeRegExp:(P=g.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(v=g.int32range)!==null&&v!==void 0?v:!0,uriResolver:Z0}}var D=class{constructor(g={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,g=this.opts={...g,...N(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,J.getRules)(),B.call(this,O,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 U1=this._addSchema(T0,b0);return U1.validate||U0.call(this,U1)}async function s(T0){if(T0&&!this.getSchema(T0))await y.call(this,{$ref:T0},!0)}async function U0(T0){try{return this._compileSchemaEnv(T0)}catch(b0){if(!(b0 instanceof Q.default))throw b0;return O0.call(this,b0),await E0.call(this,b0.missingSchema),U0.call(this,T0)}}function O0({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 U0 of g)this.addSchema(U0,void 0,e,y);return this}let s;if(typeof g==="object"){let{schemaId:U0}=this.opts;if(s=g[U0],s!==void 0&&typeof s!="string")throw Error(`schema ${U0} 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 I.SchemaEnv({schema:{},schemaId:e});if(p=I.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)=>z0.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)=>z0.call(this,s,y):(s)=>y.type.forEach((U0)=>z0.call(this,s,y,U0))),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),U0=g;for(let O0 of s)U0=U0[O0];for(let O0 in e){let E0=e[O0];if(typeof E0!="object")continue;let{$data:G0}=E0.definition,T0=U0[O0];if(G0&&T0)U0[O0]=$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 U0,{schemaId:O0}=this.opts;if(typeof g=="object")U0=g[O0];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)(U0||e);let G0=G.getSchemaRefs.call(this,g,e);if(E0=new I.SchemaEnv({schema:g,schemaId:O0,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 I.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{I.compileSchema.call(this,g)}finally{this.opts=p}}};D.ValidationError=z.default,D.MissingRefError=Q.default,$.default=D;function B(g,p,e,y="error"){for(let s in g){let U0=s;if(U0 in p)this.logger[y](`${e}: option ${s}. ${g[U0]}`)}}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 x={log(){},warn(){},error(){}};function h(g){if(g===!1)return x;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 z0(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:U0}=this,O0=s?U0.post:U0.rules.find(({type:G0})=>G0===e);if(!O0)O0={type:e,rules:[]},U0.rules.push(O0);if(U0.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)k.call(this,O0,E0,p.before);else O0.rules.push(E0);U0.all[g]=E0,(y=p.implements)===null||y===void 0||y.forEach((G0)=>this.addKeyword(G0))}function k(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 U={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$.default=U}),JS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.callRef=$.getValidate=void 0;let U=gQ(),Y=Q5(),z=L1(),Q=z5(),J=yw(),I=v1(),K={keyword:"$ref",schemaType:"string",code(W){let{gen:X,schema:Z,it:q}=W,{baseId:V,schemaEnv:F,validateName:O,opts:w,self:M}=q,{root:N}=F;if((Z==="#"||Z==="#/")&&V===N.baseId)return B();let D=J.resolveRef.call(M,N,V,Z);if(D===void 0)throw new U.default(q.opts.uriResolver,V,Z);if(D instanceof J.SchemaEnv)return T(D);return A(D);function B(){if(F===N)return H(W,O,F,F.$async);let j=X.scopeValue("root",{ref:N});return H(W,z._`${j}.validate`,N,N.$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,z.stringify)(j)}:{ref:j}),b=X.name("valid"),x=W.subschema({schema:j,dataTypes:[],schemaPath:z.nil,topSchemaRef:C,errSchemaPath:Z},b);W.mergeEvaluated(x),W.ok(b)}}};function G(W,X){let{gen:Z}=W;return X.validate?Z.scopeValue("validate",{ref:X.validate}):z._`${Z.scopeValue("wrapper",{ref:X})}.validate`}$.getValidate=G;function H(W,X,Z,q){let{gen:V,it:F}=W,{allErrors:O,schemaEnv:w,opts:M}=F,N=M.passContext?Q.default.this:z.nil;if(q)D();else B();function D(){if(!w.$async)throw Error("async schema referenced by sync schema");let j=V.let("valid");V.try(()=>{if(V.code(z._`await ${(0,Y.callValidateCode)(W,X,N)}`),A(X),!O)V.assign(j,!0)},(C)=>{if(V.if(z._`!(${C} instanceof ${F.ValidationError})`,()=>V.throw(C)),T(C),!O)V.assign(j,!1)}),W.ok(j)}function B(){W.result((0,Y.callValidateCode)(W,X,N),()=>A(X),()=>T(X))}function T(j){let C=z._`${j}.errors`;V.assign(Q.default.vErrors,z._`${Q.default.vErrors} === null ? ${C} : ${Q.default.vErrors}.concat(${C})`),V.assign(Q.default.errors,z._`${Q.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=I.mergeEvaluated.props(V,b.props,F.props)}else{let x=V.var("props",z._`${j}.evaluated.props`);F.props=I.mergeEvaluated.props(V,x,F.props,z.Name)}if(F.items!==!0)if(b&&!b.dynamicItems){if(b.items!==void 0)F.items=I.mergeEvaluated.items(V,b.items,F.items)}else{let x=V.var("items",z._`${j}.evaluated.items`);F.items=I.mergeEvaluated.items(V,x,F.items,z.Name)}}}$.callRef=H,$.default=K}),lt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=cu0(),Y=JS(),z=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",U.default,Y.default];$.default=z}),nu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=U.operators,z={maximum:{okStr:"<=",ok:Y.LTE,fail:Y.GT},minimum:{okStr:">=",ok:Y.GTE,fail:Y.LT},exclusiveMaximum:{okStr:"<",ok:Y.LT,fail:Y.GTE},exclusiveMinimum:{okStr:">",ok:Y.GT,fail:Y.LTE}},Q={keyword:Object.keys(z),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:J,schemaCode:I})=>U.str`must be ${z[J].okStr} ${I}`,params:({keyword:J,schemaCode:I})=>U._`{comparison: ${z[J].okStr}, limit: ${I}}`},code(J){let{keyword:I,data:K,schemaCode:G}=J;J.fail$data(U._`${K} ${z[I].fail} ${G} || isNaN(${K})`)}};$.default=Q}),pu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:z})=>U.str`must be multiple of ${z}`,params:({schemaCode:z})=>U._`{multipleOf: ${z}}`},code(z){let{gen:Q,data:J,schemaCode:I,it:K}=z,G=K.opts.multipleOfPrecision,H=Q.let("res"),W=G?U._`Math.abs(Math.round(${H}) - ${H}) > 1e-${G}`:U._`${H} !== parseInt(${H})`;z.fail$data(U._`(${I} === 0 || (${H} = ${J}/${I}, ${W}))`)}};$.default=Y}),du0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});function U(Y){let z=Y.length,Q=0,J=0,I;while(J=55296&&I<=56319&&J{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z=du0(),Q={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:J,schemaCode:I}){let K=J==="maxLength"?"more":"fewer";return U.str`must NOT have ${K} than ${I} characters`},params:({schemaCode:J})=>U._`{limit: ${J}}`},code(J){let{keyword:I,data:K,schemaCode:G,it:H}=J,W=I==="maxLength"?U.operators.GT:U.operators.LT,X=H.opts.unicode===!1?U._`${K}.length`:U._`${(0,Y.useFunc)(J.gen,z.default)}(${K})`;J.fail$data(U._`${X} ${W} ${G}`)}};$.default=Q}),lu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=v1(),z=L1(),Q={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:J})=>z.str`must match pattern "${J}"`,params:({schemaCode:J})=>z._`{pattern: ${J}}`},code(J){let{gen:I,data:K,$data:G,schema:H,schemaCode:W,it:X}=J,Z=X.opts.unicodeRegExp?"u":"";if(G){let{regExp:q}=X.opts.code,V=q.code==="new RegExp"?z._`new RegExp`:(0,Y.useFunc)(I,q),F=I.let("valid");I.try(()=>I.assign(F,z._`${V}(${W}, ${Z}).test(${K})`),()=>I.assign(F,!1)),J.fail$data(z._`!${F}`)}else{let q=(0,U.usePattern)(J,H);J.fail$data(z._`!${q}.test(${K})`)}}};$.default=Q}),ou0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:z,schemaCode:Q}){let J=z==="maxProperties"?"more":"fewer";return U.str`must NOT have ${J} than ${Q} properties`},params:({schemaCode:z})=>U._`{limit: ${z}}`},code(z){let{keyword:Q,data:J,schemaCode:I}=z,K=Q==="maxProperties"?U.operators.GT:U.operators.LT;z.fail$data(U._`Object.keys(${J}).length ${K} ${I}`)}};$.default=Y}),ru0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=L1(),z=v1(),Q={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:J}})=>Y.str`must have required property '${J}'`,params:({params:{missingProperty:J}})=>Y._`{missingProperty: ${J}}`},code(J){let{gen:I,schema:K,schemaCode:G,data:H,$data:W,it:X}=J,{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 M=J.parentSchema.properties,{definedProperties:N}=J.it;for(let D of K)if((M===null||M===void 0?void 0:M[D])===void 0&&!N.has(D)){let B=`required property "${D}" is not defined at "${X.schemaEnv.baseId+X.errSchemaPath}" (strictRequired)`;(0,z.checkStrictMode)(X,B,X.opts.strictRequired)}}function V(){if(q||W)J.block$data(Y.nil,O);else for(let M of K)(0,U.checkReportMissingProp)(J,M)}function F(){let M=I.let("missing");if(q||W){let N=I.let("valid",!0);J.block$data(N,()=>w(M,N)),J.ok(N)}else I.if((0,U.checkMissingProp)(J,K,M)),(0,U.reportMissingProp)(J,M),I.else()}function O(){I.forOf("prop",G,(M)=>{J.setParams({missingProperty:M}),I.if((0,U.noPropertyInData)(I,H,M,Z.ownProperties),()=>J.error())})}function w(M,N){J.setParams({missingProperty:M}),I.forOf(M,G,()=>{I.assign(N,(0,U.propertyInData)(I,H,M,Z.ownProperties)),I.if((0,Y.not)(N),()=>{J.error(),I.break()})},Y.nil)}}};$.default=Q}),su0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:z,schemaCode:Q}){let J=z==="maxItems"?"more":"fewer";return U.str`must NOT have ${J} than ${Q} items`},params:({schemaCode:z})=>U._`{limit: ${z}}`},code(z){let{keyword:Q,data:J,schemaCode:I}=z,K=Q==="maxItems"?U.operators.GT:U.operators.LT;z.fail$data(U._`${J}.length ${K} ${I}`)}};$.default=Y}),IS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=dt();U.code='require("ajv/dist/runtime/equal").default',$.default=U}),au0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=hw(),Y=L1(),z=v1(),Q=IS(),J={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:I,j:K}})=>Y.str`must NOT have duplicate items (items ## ${K} and ${I} are identical)`,params:({params:{i:I,j:K}})=>Y._`{i: ${I}, j: ${K}}`},code(I){let{gen:K,data:G,$data:H,schema:W,parentSchema:X,schemaCode:Z,it:q}=I;if(!H&&!W)return;let V=K.let("valid"),F=X.items?(0,U.getSchemaTypes)(X.items):[];I.block$data(V,O,Y._`${Z} === false`),I.ok(V);function O(){let D=K.let("i",Y._`${G}.length`),B=K.let("j");I.setParams({i:D,j:B}),K.assign(V,!0),K.if(Y._`${D} > 1`,()=>(w()?M:N)(D,B))}function w(){return F.length>0&&!F.some((D)=>D==="object"||D==="array")}function M(D,B){let T=K.name("item"),A=(0,U.checkDataTypes)(F,T,q.opts.strictNumbers,U.DataType.Wrong),j=K.const("indices",Y._`{}`);K.for(Y._`;${D}--;`,()=>{if(K.let(T,Y._`${G}[${D}]`),K.if(A,Y._`continue`),F.length>1)K.if(Y._`typeof ${T} == "string"`,Y._`${T} += "_"`);K.if(Y._`typeof ${j}[${T}] == "number"`,()=>{K.assign(B,Y._`${j}[${T}]`),I.error(),K.assign(V,!1).break()}).code(Y._`${j}[${T}] = ${D}`)})}function N(D,B){let T=(0,z.useFunc)(K,Q.default),A=K.name("outer");K.label(A).for(Y._`;${D}--;`,()=>K.for(Y._`${B} = ${D}; ${B}--;`,()=>K.if(Y._`${T}(${G}[${D}], ${G}[${B}])`,()=>{I.error(),K.assign(V,!1).break(A)})))}}};$.default=J}),tu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z=IS(),Q={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:J})=>U._`{allowedValue: ${J}}`},code(J){let{gen:I,data:K,$data:G,schemaCode:H,schema:W}=J;if(G||W&&typeof W=="object")J.fail$data(U._`!${(0,Y.useFunc)(I,z.default)}(${K}, ${H})`);else J.fail(U._`${W} !== ${K}`)}};$.default=Q}),eu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z=IS(),Q={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:J})=>U._`{allowedValues: ${J}}`},code(J){let{gen:I,data:K,$data:G,schema:H,schemaCode:W,it:X}=J;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,Y.useFunc)(I,z.default),F;if(Z||G)F=I.let("valid"),J.block$data(F,O);else{if(!Array.isArray(H))throw Error("ajv implementation error");let M=I.const("vSchema",W);F=(0,U.or)(...H.map((N,D)=>w(M,D)))}J.pass(F);function O(){I.assign(F,!1),I.forOf("v",W,(M)=>I.if(U._`${V()}(${K}, ${M})`,()=>I.assign(F,!0).break()))}function w(M,N){let D=H[N];return typeof D==="object"&&D!==null?U._`${V()}(${K}, ${M}[${N}])`:U._`${K} === ${D}`}}};$.default=Q}),ot=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=nu0(),Y=pu0(),z=mu0(),Q=lu0(),J=ou0(),I=ru0(),K=su0(),G=au0(),H=tu0(),W=eu0(),X=[U.default,Y.default,z.default,Q.default,J.default,I.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 U=L1(),Y=v1(),z={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:J}})=>U.str`must NOT have more than ${J} items`,params:({params:{len:J}})=>U._`{limit: ${J}}`},code(J){let{parentSchema:I,it:K}=J,{items:G}=I;if(!Array.isArray(G)){(0,Y.checkStrictMode)(K,'"additionalItems" is ignored when "items" is not an array of schemas');return}Q(J,G)}};function Q(J,I){let{gen:K,schema:G,data:H,keyword:W,it:X}=J;X.items=!0;let Z=K.const("len",U._`${H}.length`);if(G===!1)J.setParams({len:I.length}),J.pass(U._`${Z} <= ${I.length}`);else if(typeof G=="object"&&!(0,Y.alwaysValidSchema)(X,G)){let V=K.var("valid",U._`${Z} <= ${I.length}`);K.if((0,U.not)(V),()=>q(V)),J.ok(V)}function q(V){K.forRange("i",I.length,Z,(F)=>{if(J.subschema({keyword:W,dataProp:F,dataPropType:Y.Type.Num},V),!X.allErrors)K.if((0,U.not)(V),()=>K.break())})}}$.validateAdditionalItems=Q,$.default=z}),st=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateTuple=void 0;let U=L1(),Y=v1(),z=Q5(),Q={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(I){let{schema:K,it:G}=I;if(Array.isArray(K))return J(I,"additionalItems",K);if(G.items=!0,(0,Y.alwaysValidSchema)(G,K))return;I.ok((0,z.validateArray)(I))}};function J(I,K,G=I.schema){let{gen:H,parentSchema:W,data:X,keyword:Z,it:q}=I;if(O(W),q.opts.unevaluated&&G.length&&q.items!==!0)q.items=Y.mergeEvaluated.items(H,G.length,q.items);let V=H.name("valid"),F=H.const("len",U._`${X}.length`);G.forEach((w,M)=>{if((0,Y.alwaysValidSchema)(q,w))return;H.if(U._`${F} > ${M}`,()=>I.subschema({keyword:Z,schemaProp:M,dataProp:M},V)),I.ok(V)});function O(w){let{opts:M,errSchemaPath:N}=q,D=G.length,B=D===w.minItems&&(D===w.maxItems||w[K]===!1);if(M.strictTuples&&!B){let T=`"${Z}" is ${D}-tuple, but minItems or maxItems/${K} are not specified or different at path "${N}"`;(0,Y.checkStrictMode)(q,T,M.strictTuples)}}}$.validateTuple=J,$.default=Q}),$b0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=st(),Y={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(z)=>(0,U.validateTuple)(z,"items")};$.default=Y}),Ub0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z=Q5(),Q=rt(),J={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:I}})=>U.str`must NOT have more than ${I} items`,params:({params:{len:I}})=>U._`{limit: ${I}}`},code(I){let{schema:K,parentSchema:G,it:H}=I,{prefixItems:W}=G;if(H.items=!0,(0,Y.alwaysValidSchema)(H,K))return;if(W)(0,Q.validateAdditionalItems)(I,W);else I.ok((0,z.validateArray)(I))}};$.default=J}),Yb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:Q,max:J}})=>J===void 0?U.str`must contain at least ${Q} valid item(s)`:U.str`must contain at least ${Q} and no more than ${J} valid item(s)`,params:({params:{min:Q,max:J}})=>J===void 0?U._`{minContains: ${Q}}`:U._`{minContains: ${Q}, maxContains: ${J}}`},code(Q){let{gen:J,schema:I,parentSchema:K,data:G,it:H}=Q,W,X,{minContains:Z,maxContains:q}=K;if(H.opts.next)W=Z===void 0?1:Z,X=q;else W=1;let V=J.const("len",U._`${G}.length`);if(Q.setParams({min:W,max:X}),X===void 0&&W===0){(0,Y.checkStrictMode)(H,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(X!==void 0&&W>X){(0,Y.checkStrictMode)(H,'"minContains" > "maxContains" is always invalid'),Q.fail();return}if((0,Y.alwaysValidSchema)(H,I)){let N=U._`${V} >= ${W}`;if(X!==void 0)N=U._`${N} && ${V} <= ${X}`;Q.pass(N);return}H.items=!0;let F=J.name("valid");if(X===void 0&&W===1)w(F,()=>J.if(F,()=>J.break()));else if(W===0){if(J.let(F,!0),X!==void 0)J.if(U._`${G}.length > 0`,O)}else J.let(F,!1),O();Q.result(F,()=>Q.reset());function O(){let N=J.name("_valid"),D=J.let("count",0);w(N,()=>J.if(N,()=>M(D)))}function w(N,D){J.forRange("i",0,V,(B)=>{Q.subschema({keyword:"contains",dataProp:B,dataPropType:Y.Type.Num,compositeRule:!0},N),D()})}function M(N){if(J.code(U._`${N}++`),X===void 0)J.if(U._`${N} >= ${W}`,()=>J.assign(F,!0).break());else if(J.if(U._`${N} > ${X}`,()=>J.assign(F,!1).break()),W===1)J.assign(F,!0);else J.if(U._`${N} >= ${W}`,()=>J.assign(F,!0))}}};$.default=z}),KS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateSchemaDeps=$.validatePropertyDeps=$.error=void 0;let U=L1(),Y=v1(),z=Q5();$.error={message:({params:{property:G,depsCount:H,deps:W}})=>{let X=H===1?"property":"properties";return U.str`must have ${X} ${W} when property ${G} is present`},params:({params:{property:G,depsCount:H,deps:W,missingProperty:X}})=>U._`{property: ${G}, missingProperty: ${X}, depsCount: ${H}, - deps: ${W}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=J(G);I(G,H),K(G,W)}};function J({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 I(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 O=(0,z.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(O,()=>{for(let w of F)(0,z.checkReportMissingProp)(G,w)});else W.if(U._`${O} && (${(0,z.checkMissingProp)(G,F,q)})`),(0,z.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=I;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,Y.alwaysValidSchema)(q,H[F]))continue;W.if((0,z.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let O=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(O,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>U._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q;if((0,Y.alwaysValidSchema)(G,I))return;let H=J.name("valid");J.forIn("key",K,(W)=>{Q.setParams({propertyName:W}),Q.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),J.if((0,U.not)(H),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(H)}};$.default=z}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=L1(),z=z5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>Y._`{additionalProperty: ${I.additionalProperty}}`},code(I){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=I;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,U.allSchemaProperties)(H.properties),O=(0,U.allSchemaProperties)(H.patternProperties);w(),I.ok(Y._`${X} === ${z.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!O.length)D(T);else K.if(M(T),()=>D(T))})}function M(T){let A;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,H.properties,"properties");A=(0,U.isOwnProperty)(K,j,T)}else if(F.length)A=(0,Y.or)(...F.map((j)=>Y._`${T} === ${j}`));else A=Y.nil;if(O.length)A=(0,Y.or)(A,...O.map((j)=>Y._`${(0,U.usePattern)(I,j)}.test(${T})`));return(0,Y.not)(A)}function N(T){K.code(Y._`delete ${W}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){N(T);return}if(G===!1){if(I.setParams({additionalProperty:T}),I.error(),!q)K.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")B(T,A,!1),K.if((0,Y.not)(A),()=>{I.reset(),N(T)});else if(B(T,A),!q)K.if((0,Y.not)(A),()=>K.break())}}function B(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,A)}}};$.default=J}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=SQ(),Y=Q5(),z=v1(),Q=at(),J={keyword:"properties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=I;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)Q.default.code(new U.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,Y.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=z.mergeEvaluated.props(K,(0,z.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,z.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))O(w);else{if(K.if((0,Y.propertyInData)(K,W,w,X.opts.ownProperties)),O(w),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(w),I.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function O(w){I.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=L1(),z=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=I,{opts:Z}=X,q=(0,U.allSchemaProperties)(G),V=q.filter((B)=>(0,z.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,O=K.name("valid");if(X.props!==!0&&!(X.props instanceof Y.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:w}=X;M();function M(){for(let B of q){if(F)N(B);if(X.allErrors)D(B);else K.var(O,!0),D(B),K.if(O)}}function N(B){for(let T in F)if(new RegExp(B).test(T))(0,z.checkStrictMode)(X,`property ${T} matches pattern ${B} (use allowMatchingProperties)`)}function D(B){K.forIn("key",H,(T)=>{K.if(Y._`${(0,U.usePattern)(I,B)}.test(${T})`,()=>{let A=V.includes(B);if(!A)I.subschema({keyword:"patternProperties",schemaProp:B,dataProp:T,dataPropType:Q.Type.Str},O);if(X.opts.unevaluated&&w!==!0)K.assign(Y._`${w}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,Y.not)(O),()=>K.break())})})}}};$.default=J}),Ib0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(z){let{gen:Q,schema:J,it:I}=z;if((0,U.alwaysValidSchema)(I,J)){z.fail();return}let K=Q.name("valid");z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),z.failResult(K,()=>z.reset(),()=>z.error())},error:{message:"must NOT be valid"}};$.default=Y}),Kb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Q5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=U}),Gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:Q})=>U._`{passingSchemas: ${Q.passing}}`},code(Q){let{gen:J,schema:I,parentSchema:K,it:G}=Q;if(!Array.isArray(I))throw Error("ajv implementation error");if(G.opts.discriminator&&K.discriminator)return;let H=I,W=J.let("valid",!1),X=J.let("passing",null),Z=J.name("_valid");Q.setParams({passing:X}),J.block(q),Q.result(W,()=>Q.reset(),()=>Q.error(!0));function q(){H.forEach((V,F)=>{let O;if((0,Y.alwaysValidSchema)(G,V))J.var(Z,!0);else O=Q.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},Z);if(F>0)J.if(U._`${Z} && ${W}`).assign(W,!1).assign(X,U._`[${X}, ${F}]`).else();J.if(Z,()=>{if(J.assign(W,!0),J.assign(X,F),O)Q.mergeEvaluated(O,U.Name)})})}}};$.default=z}),Hb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:"allOf",schemaType:"array",code(z){let{gen:Q,schema:J,it:I}=z;if(!Array.isArray(J))throw Error("ajv implementation error");let K=Q.name("valid");J.forEach((G,H)=>{if((0,U.alwaysValidSchema)(I,G))return;let W=z.subschema({keyword:"allOf",schemaProp:H},K);z.ok(K),z.mergeEvaluated(W)})}};$.default=Y}),Wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:J})=>U.str`must match "${J.ifClause}" schema`,params:({params:J})=>U._`{failingKeyword: ${J.ifClause}}`},code(J){let{gen:I,parentSchema:K,it:G}=J;if(K.then===void 0&&K.else===void 0)(0,Y.checkStrictMode)(G,'"if" without "then" and "else" is ignored');let H=Q(G,"then"),W=Q(G,"else");if(!H&&!W)return;let X=I.let("valid",!0),Z=I.name("_valid");if(q(),J.reset(),H&&W){let F=I.let("ifClause");J.setParams({ifClause:F}),I.if(Z,V("then",F),V("else",F))}else if(H)I.if(Z,V("then"));else I.if((0,U.not)(Z),V("else"));J.pass(X,()=>J.error(!0));function q(){let F=J.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);J.mergeEvaluated(F)}function V(F,O){return()=>{let w=J.subschema({keyword:F},Z);if(I.assign(X,Z),J.mergeValidEvaluated(w,X),O)I.assign(O,U._`${F}`);else J.setParams({ifClause:F})}}}};function Q(J,I){let K=J.schema[I];return K!==void 0&&!(0,Y.alwaysValidSchema)(J,K)}$.default=z}),Xb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:z,parentSchema:Q,it:J}){if(Q.if===void 0)(0,U.checkStrictMode)(J,`"${z}" without "if" is ignored`)}};$.default=Y}),tt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=rt(),Y=$b0(),z=st(),Q=Ub0(),J=Yb0(),I=KS(),K=zb0(),G=at(),H=Qb0(),W=Jb0(),X=Ib0(),Z=Kb0(),q=Gb0(),V=Hb0(),F=Wb0(),O=Xb0();function w(M=!1){let N=[X.default,Z.default,q.default,V.default,F.default,O.default,K.default,G.default,I.default,H.default,W.default];if(M)N.push(Y.default,Q.default);else N.push(U.default,z.default);return N.push(J.default),N}$.default=w}),Zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:z})=>U.str`must match format "${z}"`,params:({schemaCode:z})=>U._`{format: ${z}}`},code(z,Q){let{gen:J,data:I,$data:K,schema:G,schemaCode:H,it:W}=z,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else O();function F(){let w=J.scopeValue("formats",{ref:V.formats,code:X.code.formats}),M=J.const("fDef",U._`${w}[${H}]`),N=J.let("fType"),D=J.let("format");J.if(U._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>J.assign(N,U._`${M}.type || "string"`).assign(D,U._`${M}.validate`),()=>J.assign(N,U._`"string"`).assign(D,M)),z.fail$data((0,U.or)(B(),T()));function B(){if(X.strictSchema===!1)return U.nil;return U._`${H} && !${D}`}function T(){let A=q.$async?U._`(${M}.async ? await ${D}(${I}) : ${D}(${I}))`:U._`${D}(${I})`,j=U._`(typeof ${D} == "function" ? ${A} : ${D}.test(${I}))`;return U._`${D} && ${D} !== true && ${N} === ${Q} && !${j}`}}function O(){let w=V.formats[G];if(!w){B();return}if(w===!0)return;let[M,N,D]=T(w);if(M===Q)z.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,U.regexpCode)(j):X.code.formats?U._`${X.code.formats}${(0,U.getProperty)(G)}`:void 0,b=J.scopeValue("formats",{key:G,ref:j,code:C});if(typeof j=="object"&&!(j instanceof RegExp))return[j.type||"string",j.validate,U._`${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 U._`await ${D}(${I})`}return typeof N=="function"?U._`${D}(${I})`:U._`${D}.test(${I})`}}}};$.default=Y}),et=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=[Zb0().default];$.default=U}),$e=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Ue=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=lt(),Y=ot(),z=tt(),Q=et(),J=$e(),I=[U.default,Y.default,(0,z.default)(),Q.default,J.metadataVocabulary,J.contentVocabulary];$.default=I}),qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var U;(function(Y){Y.Tag="tag",Y.Mapping="mapping"})(U||($.DiscrError=U={}))}),GS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=qb0(),z=yw(),Q=gQ(),J=v1(),I={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===Y.DiscrError.Tag?`tag "${G}" must be string`:`value of tag "${G}" must be in oneOf`,params:({params:{discrError:K,tag:G,tagName:H}})=>U._`{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),O=G.const("tag",U._`${H}${(0,U.getProperty)(V)}`);G.if(U._`typeof ${O} == "string"`,()=>w(),()=>K.error(!1,{discrError:Y.DiscrError.Tag,tag:O,tagName:V})),K.ok(F);function w(){let D=N();G.if(!1);for(let B in D)G.elseIf(U._`${O} === ${B}`),G.assign(F,M(D[B]));G.else(),K.error(!1,{discrError:Y.DiscrError.Mapping,tag:O,tagName:V}),G.endIf()}function M(D){let B=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:D},B);return K.mergeEvaluated(T,U.Name),B}function N(){var D;let B={},T=j(X),A=!0;for(let x=0;x{U.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}}),Ye=R0(($,U)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let Y=QS(),z=Ue(),Q=GS(),J=Vb0(),I=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends Y.default{_addVocabularies(){if(super._addVocabularies(),z.default.forEach((q)=>this.addVocabulary(q)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let q=this.opts.$data?this.$dataMetaSchema(J,I):J;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,U.exports=$=G,U.exports.Ajv=G,Object.defineProperty($,"__esModule",{value:!0}),$.default=G;var H=SQ();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=gQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),ze=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let U=L1(),Y=z5(),z=yw(),Q=JS(),J={keyword:"$dynamicAnchor",schemaType:"string",code:(G)=>I(G,G.schema)};function I(G,H){let{gen:W,it:X}=G;X.schemaEnv.root.dynamicAnchors[H]=!0;let Z=U._`${Y.default.dynamicAnchors}${(0,U.getProperty)(H)}`,q=X.errSchemaPath==="#"?X.validateName:K(G);W.if(U._`!${Z}`,()=>W.assign(Z,q))}$.dynamicAnchor=I;function K(G){let{schemaEnv:H,schema:W,self:X}=G.it,{root:Z,baseId:q,localRefs:V,meta:F}=H.root,{schemaId:O}=X.opts,w=new z.SchemaEnv({schema:W,schemaId:O,root:Z,baseId:q,localRefs:V,meta:F});return z.compileSchema.call(X,w),(0,Q.getValidate)(G,w)}$.default=J}),Qe=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let U=L1(),Y=z5(),z=JS(),Q={keyword:"$dynamicRef",schemaType:"string",code:(I)=>J(I,I.schema)};function J(I,K){let{gen:G,keyword:H,it:W}=I;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),I.ok(V)}function Z(V){if(W.schemaEnv.root.dynamicAnchors[X]){let F=G.let("_v",U._`${Y.default.dynamicAnchors}${(0,U.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,z.callRef)(I,V),G.let(F,!0)}):()=>(0,z.callRef)(I,V)}}$.dynamicRef=J,$.default=Q}),Lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=ze(),Y=v1(),z={keyword:"$recursiveAnchor",schemaType:"boolean",code(Q){if(Q.schema)(0,U.dynamicAnchor)(Q,"");else(0,Y.checkStrictMode)(Q.it,"$recursiveAnchor: false is ignored")}};$.default=z}),Fb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Qe(),Y={keyword:"$recursiveRef",schemaType:"string",code:(z)=>(0,U.dynamicRef)(z,z.schema)};$.default=Y}),Je=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=ze(),Y=Qe(),z=Lb0(),Q=Fb0(),J=[U.default,Y.default,z.default,Q.default];$.default=J}),wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=KS(),Y={keyword:"dependentRequired",type:"object",schemaType:"object",error:U.error,code:(z)=>(0,U.validatePropertyDeps)(z)};$.default=Y}),Ob0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=KS(),Y={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(z)=>(0,U.validateSchemaDeps)(z)};$.default=Y}),Mb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:z,parentSchema:Q,it:J}){if(Q.contains===void 0)(0,U.checkStrictMode)(J,`"${z}" without "contains" is ignored`)}};$.default=Y}),Ie=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=wb0(),Y=Ob0(),z=Mb0(),Q=[U.default,Y.default,z.default];$.default=Q}),Nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z=z5(),Q={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:J})=>U._`{unevaluatedProperty: ${J.unevaluatedProperty}}`},code(J){let{gen:I,schema:K,data:G,errsCount:H,it:W}=J;if(!H)throw Error("ajv implementation error");let{allErrors:X,props:Z}=W;if(Z instanceof U.Name)I.if(U._`${Z} !== true`,()=>I.forIn("key",G,(O)=>I.if(V(Z,O),()=>q(O))));else if(Z!==!0)I.forIn("key",G,(O)=>Z===void 0?q(O):I.if(F(Z,O),()=>q(O)));W.props=!0,J.ok(U._`${H} === ${z.default.errors}`);function q(O){if(K===!1){if(J.setParams({unevaluatedProperty:O}),J.error(),!X)I.break();return}if(!(0,Y.alwaysValidSchema)(W,K)){let w=I.name("valid");if(J.subschema({keyword:"unevaluatedProperties",dataProp:O,dataPropType:Y.Type.Str},w),!X)I.if((0,U.not)(w),()=>I.break())}}function V(O,w){return U._`!${O} || !${O}[${w}]`}function F(O,w){let M=[];for(let N in O)if(O[N]===!0)M.push(U._`${w} !== ${N}`);return(0,U.and)(...M)}}};$.default=Q}),Db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:Q}})=>U.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>U._`{limit: ${Q}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q,H=G.items||0;if(H===!0)return;let W=J.const("len",U._`${K}.length`);if(I===!1)Q.setParams({len:H}),Q.fail(U._`${W} > ${H}`);else if(typeof I=="object"&&!(0,Y.alwaysValidSchema)(G,I)){let Z=J.var("valid",U._`${W} <= ${H}`);J.if((0,U.not)(Z),()=>X(Z,H)),Q.ok(Z)}G.items=!0;function X(Z,q){J.forRange("i",q,W,(V)=>{if(Q.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:Y.Type.Num},Z),!G.allErrors)J.if((0,U.not)(Z),()=>J.break())})}}};$.default=z}),Ke=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Nb0(),Y=Db0(),z=[U.default,Y.default];$.default=z}),Ab0=R0(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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 U=Ab0(),Y=Pb0(),z=Bb0(),Q=Tb0(),J=jb0(),I=Eb0(),K=Cb0(),G=["/properties"];function H(W){return[U,Y,z,Q,X(this,J),I,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(($,U)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let Y=QS(),z=Ue(),Q=Je(),J=Ie(),I=Ke(),K=GS(),G=Rb0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends Y.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(Q.default),z.default.forEach((F)=>this.addVocabulary(F)),this.addVocabulary(J.default),this.addVocabulary(I.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:F,meta:O}=this.opts;if(!O)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,U.exports=$=W,U.exports.Ajv2019=W,Object.defineProperty($,"__esModule",{value:!0}),$.default=W;var X=SQ();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=gQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),vb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=lt(),Y=ot(),z=tt(),Q=Je(),J=Ie(),I=Ke(),K=et(),G=$e(),H=[Q.default,U.default,Y.default,(0,z.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,J.default,I.default];$.default=H}),hb0=R0(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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 U=hb0(),Y=Sb0(),z=gb0(),Q=yb0(),J=kb0(),I=xb0(),K=fb0(),G=ub0(),H=["/properties"];function W(X){return[U,Y,z,Q,J,Z(this,I),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(($,U)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let Y=QS(),z=vb0(),Q=GS(),J=bb0(),I="https://json-schema.org/draft/2020-12/schema";var K=class extends Y.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),z.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:q}=this.opts;if(!q)return;J.default.call(this,Z),this.refs["http://json-schema.org/schema"]=I}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(I)?I:void 0)}};$.Ajv2020=K,U.exports=$=K,U.exports.Ajv2020=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K;var G=SQ();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=gQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),cb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function U(x,h){return{validate:x,compare:h}}$.fullFormats={date:U(J,I),time:U(G(!0),H),"date-time":U(Z(!0),q),"iso-time":U(G(),W),"iso-date-time":U(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:N,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:U(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,I),time:U(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H),"date-time":U(/^\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":U(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,W),"iso-date-time":U(/^\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 Y(x){return x%4===0&&(x%100!==0||x%400===0)}let z=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Q=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J(x){let h=z.exec(x);if(!h)return!1;let i=+h[1],c=+h[2],z0=+h[3];return c>=1&&c<=12&&z0>=1&&z0<=(c===2&&Y(i)?29:Q[c])}function I(x,h){if(!(x&&h))return;if(x>h)return 1;if(x23||p>59||x&&!t)return!1;if(z0<=23&&k<=59&&d<60)return!0;let e=k-p*$0,y=z0-g*$0-(e<0?1:0);return(y===23||y===-1)&&(e===59||e===-1)&&d<61}}function H(x,h){if(!(x&&h))return;let i=new Date("2020-01-01T"+x).valueOf(),c=new Date("2020-01-01T"+h).valueOf();if(!(i&&c))return;return i-c}function W(x,h){if(!(x&&h))return;let i=K.exec(x),c=K.exec(h);if(!(i&&c))return;if(x=i[1]+i[2]+i[3],h=c[1]+c[2]+c[3],x>h)return 1;if(x=D}function A(x){return Number.isInteger(x)}function j(){return!0}let C=/[^\\]\\Z/;function b(x){if(C.test(x))return!1;try{return new RegExp(x),!0}catch(h){return!1}}}),nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let U=Ye(),Y=L1(),z=Y.operators,Q={formatMaximum:{okStr:"<=",ok:z.LTE,fail:z.GT},formatMinimum:{okStr:">=",ok:z.GTE,fail:z.LT},formatExclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},formatExclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},J={message:({keyword:K,schemaCode:G})=>Y.str`should be ${Q[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>Y._`{comparison: ${Q[K].okStr}, limit: ${G}}`};$.formatLimitDefinition={keyword:Object.keys(Q),type:"string",schemaType:"string",$data:!0,error:J,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 U.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(F.$data)O();else w();function O(){let N=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",Y._`${N}[${F.schemaCode}]`);K.fail$data((0,Y.or)(Y._`typeof ${D} != "object"`,Y._`${D} instanceof RegExp`,Y._`typeof ${D}.compare != "function"`,M(D)))}function w(){let N=F.schema,D=V.formats[N];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${N}" does not define "compare" function`);let B=G.scopeValue("formats",{key:N,ref:D,code:q.code.formats?Y._`${q.code.formats}${(0,Y.getProperty)(N)}`:void 0});K.fail$data(M(B))}function M(N){return Y._`${N}.compare(${H}, ${W}) ${Q[X].fail} 0`}},dependencies:["format"]};let I=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=I}),pb0=R0(($,U)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=cb0(),z=nb0(),Q=L1(),J=new Q.Name("fullFormats"),I=new Q.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,Y.fullFormats,J),H;let[X,Z]=W.mode==="fast"?[Y.fastFormats,I]:[Y.fullFormats,J];if(G(H,W.formats||Y.formatNames,X,Z),W.keywords)(0,z.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?Y.fastFormats:Y.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=Q._`require("ajv-formats/dist/formats").${Z}`);for(let F of W)H.addFormat(F,X[F])}U.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),Ge=Ye(),db0=_b0(),mb0=ib0(),lb0=nq(pb0(),1),ob0=lb0.default;$u1=Ge.Ajv});import HS from"node:process";var xw=o(()=>{He()});function XS($){return!!$&&typeof $==="object"&&Oe in $}function sb0($){return $[Oe]?.complete}function ab0($,U){switch(U.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(U.uri)}}function tb0($,U){let Y={},z=(Q)=>U===void 0||Q===!0;if($.toolsListChanged===!0&&z(U?.tools?.listChanged))Y.toolsListChanged=!0;if($.promptsListChanged===!0&&z(U?.prompts?.listChanged))Y.promptsListChanged=!0;if($.resourcesListChanged===!0&&z(U?.resources?.listChanged))Y.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&z(U?.resources?.subscribe))Y.resourceSubscriptions=[...$.resourceSubscriptions];return Y}function We($,U){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[yU]:U}}}}function eb0($){let U=B7(XH).validateRequest("subscriptions/listen",$);return U.ok?U.value.params?.notifications:void 0}function Ui0($,U){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:U??""}}}function Qi0($){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??Yi0,roundTimeoutMs:$?.roundTimeoutMs??zi0,legacyShim:$?.legacyShim??!0}}function Ne($,U,Y){if(Y===null||typeof Y!=="object"||typeof Y.method!=="string")throw new J1(n0.InternalError,`Handler for ${$} returned an invalid input request '${U}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let z=Y,Q=Xt(z);if(Q===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${U}' of kind '${z.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:z,required:Q}}function Ji0(){let $=globalThis.crypto;if($?.randomUUID!==void 0)return $.randomUUID();let U=new Uint8Array(16);$.getRandomValues(U),U[6]=U[6]&15|64,U[8]=U[8]&63|128;let Y=[...U].map((z)=>z.toString(16).padStart(2,"0")).join("");return`${Y.slice(0,8)}-${Y.slice(8,12)}-${Y.slice(12,16)}-${Y.slice(16,20)}-${Y.slice(20)}`}function WS($,U){if($==="tools/call")return{content:[{type:"text",text:U}],isError:!0};throw new J1(n0.InternalError,U)}function ZS($,U){De($,U)}function qS($){return Ae($)}function Hi0($){return{...$}}function Xe($,U){if($){let z=U;return async(Q,J)=>z(Q,J)}let Y=U;return async(z,Q)=>Y(Q)}function qe($){if($===void 0)return;try{return E7($,"output")}catch{return}}function Ve($,U,Y){if(U){let z=Y;return async(Q,J)=>{let I=await fU(U,Q);if(!I.success)throw new J1(n0.InvalidParams,`Invalid arguments for prompt ${$}: ${I.error}`);return z(I.data,J)}}else{let z=Y;return async(Q,J)=>{return z(J)}}}function Le($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function Fe($){let U=$;if(U.shape&&typeof U.shape==="object")return U.shape}function Wi0($){return $?.type==="optional"}function we($){if(!Wi0($))return $;return $.def?.innerType??$}var Oe,fw=1024,$i0,Me=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=fw,U,Y){this._maxSubscriptions=$,this._serverCapabilities=U,this._serverInfo=Y}setServerCapabilities($,U){if(this._serverCapabilities=$,U!==void 0)this._serverInfo=U}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 U=eb0($);if(U===void 0)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let Y=tb0(U,this._serverCapabilities);return this._subs.set($.id,Y),We({method:"notifications/subscriptions/acknowledged",params:{notifications:Y}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!$i0.has($.method))return"passthrough";let U=$.params?.uri,Y=typeof U==="string"?U:void 0,z=Ui0($.method,Y),Q=[];for(let[J,I]of this._subs)if(ab0(I,z))Q.push(We({method:$.method,params:$.params??{}},J));return Q}teardownAll(){let $=[];for(let U of this._subs.keys())$.push({jsonrpc:"2.0",id:U,result:{resultType:"complete",_meta:{[yU]:U,...this._serverInfo!==void 0&&{[p5]:this._serverInfo}}}});return this._subs.clear(),$}},Yi0=8,zi0=600000,Ii0=class{constructor($){this._host=$}async fulfill($,U,Y,z,Q){let{maxRounds:J,roundTimeoutMs:I}=this._host,K=z.mcpReq.signal,G=Q,H=0;while(!0){if(H+=1,H>J)return WS($,ht($,J));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 J1(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 O=this._host.resolvedClientCapabilities(z),w=[];for(let[N,D]of Object.entries(W)){let{embedded:B,required:T}=Ne($,N,D);if(B.method!=="roots/list"&&B.params===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${N}' of kind '${B.method}' without params`);if(Nw(T,O)!==void 0)return WS($,`Cannot request input '${N}' (${B.method}): the client on this 2025-era connection did not declare the required capability${O===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);w.push([N,B])}let M=gt(K);try{let N={relatedRequestId:z.mcpReq.id,timeout:I,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:M.signal},D=await Promise.all(w.map(async([B,T])=>{try{return[B,await this._dispatchLeg(T,N)]}catch(A){throw M.abort(A),A}}));q=Object.fromEntries(D)}catch(N){if(K.aborted)throw N;return WS($,`Fulfilling input required by '${$}' failed: ${N instanceof Error?N.message:String(N)}`)}finally{M.dispose()}}else await St(vt,K);let V={...z,mcpReq:{...z.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:ZH(Z)}};if(Z!==void 0){let O=await this._host.verifyRequestState(Z,V,$);if(O!==void 0)V=sh(V,O)}let F=await U(Y,V);if(!r9(F))return F;G=F}}async _dispatchLeg($,U){switch($.method){case"elicitation/create":{let Y=$.params;if(Y.mode==="url"&&Y.elicitationId===void 0)Y={...Y,elicitationId:Ji0()};return await this._host.sendElicitation(Y,U)}case"sampling/createMessage":return await this._host.sendSampling($.params,U);case"roots/list":return await this._host.listRoots($.params,U)}}},Ki0,Gi0,De,Ae,Pe,LH=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson($){let U=this._registeredTools[$];if(U===void 0||!U.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,$))return this._toolInputSchemaJson[$];if(U.inputSchema===void 0)return Ze;try{let Y=E7(U.inputSchema,"input");return this._toolInputSchemaJson[$]=Y,Y}catch{return}}constructor($,U){if(this.server=new Pe($,U),U?.capabilities?.tools)this.setToolRequestHandlers();if(U?.capabilities?.resources)this.setResourceRequestHandlers();if(U?.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(([$,U])=>{let Y={name:$,title:U.title,description:U.description,inputSchema:U.inputSchema?E7(U.inputSchema,"input"):Ze,annotations:U.annotations,icons:U.icons,execution:U.execution,_meta:U._meta};if(U.outputSchema)Y.outputSchema=E7(U.outputSchema,"output");return Y})})),this.server.setRequestHandler("tools/call",async($,U)=>{let Y=this._registeredTools[$.params.name];if(!Y)throw new J1(n0.InvalidParams,`Tool ${$.params.name} not found`);if(!Y.enabled)throw new J1(n0.InvalidParams,`Tool ${$.params.name} disabled`);try{let z=await this.validateToolInput(Y,$.params.arguments,$.params.name),Q=await this.executeToolHandler(Y,z,U);if(await this.validateToolOutput(Y,Q,$.params.name),r9(Q))return Q;return this.server.projectCallToolResult(Q,Y.outputSchemaJson)}catch(z){if(z instanceof J1&&z.code===n0.UrlElicitationRequired)throw z;return this.createToolError(z instanceof Error?z.message:String(z))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,U,Y){if(!$.inputSchema)return;let z=await fU($.inputSchema,U??{});if(!z.success)throw new J1(n0.InvalidParams,`Input validation error: Invalid arguments for tool ${Y}: ${z.error}`);return z.data}async validateToolOutput($,U,Y){if(!$.outputSchema)return;if(r9(U))return;if(U.isError)return;if(U.structuredContent===void 0)throw new J1(n0.InvalidParams,`Output validation error: Tool ${Y} has an output schema but no structured content was provided`);let z=await fU($.outputSchema,U.structuredContent);if(!z.success)throw new J1(n0.InvalidParams,`Output validation error: Invalid structured content for tool ${Y}: ${z.error}`)}async executeToolHandler($,U,Y){return $.executor(U,Y)}_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 J1(n0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,U){let Y=this._registeredPrompts[U.name];if(!Y)throw new J1(n0.InvalidParams,`Prompt ${U.name} not found`);if(!Y.enabled)throw new J1(n0.InvalidParams,`Prompt ${U.name} disabled`);if(!Y.argsSchema)return VH;let z=we(Fe(Y.argsSchema)?.[$.params.argument.name]);if(!XS(z))return VH;let Q=sb0(z);if(!Q)return VH;return Le(await Q($.params.argument.value,$.params.context))}async handleResourceCompletion($,U){let Y=Object.values(this._registeredResourceTemplates).find((Q)=>Q.resourceTemplate.uriTemplate.toString()===U.uri);if(!Y){if(this._registeredResources[U.uri])return VH;throw new J1(n0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let z=Y.resourceTemplate.completeCallback($.params.argument.name);if(!z)return VH;return Le(await z($.params.argument.value,$.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async($,U)=>{let Y=Object.entries(this._registeredResources).filter(([Q,J])=>J.enabled).map(([Q,J])=>({uri:Q,name:J.name,...J.metadata})),z=[];for(let Q of Object.values(this._registeredResourceTemplates)){if(!Q.resourceTemplate.listCallback)continue;let J=await Q.resourceTemplate.listCallback(U);for(let I of J.resources)z.push({...Q.metadata,...I})}return{resources:[...Y,...z]}}),this.server.setRequestHandler("resources/templates/list",async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([$,U])=>({name:$,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler("resources/read",async($,U)=>{let Y;try{Y=new URL($.params.uri)}catch{throw new J1(n0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let z=this._registeredResources[Y.toString()];if(z){if(!z.enabled)throw new J1(n0.InvalidParams,`Resource ${Y} disabled`);return Dw(await z.readCallback(Y,U),z.cacheHint)}for(let Q of Object.values(this._registeredResourceTemplates)){let J=Q.resourceTemplate.uriTemplate.match(Y.toString());if(J)return Dw(await Q.readCallback(Y,J,U),Q.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(([$,U])=>{return{name:$,title:U.title,description:U.description,arguments:U.argsSchema?_t(U.argsSchema):void 0,icons:U.icons,_meta:U._meta}})})),this.server.setRequestHandler("prompts/get",async($,U)=>{let Y=this._registeredPrompts[$.params.name];if(!Y)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} not found`);if(!Y.enabled)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} disabled`);return Y.handler($.params.arguments,U)}),this._promptHandlersInitialized=!0}registerResource($,U,Y,z){let Q=Y.cacheHint,J=Y;if(Q!==void 0){ih(Q,`resource ${$}`);let I={...Y};delete I.cacheHint,J=I}if(typeof U==="string"){if(this._registeredResources[U])throw Error(`Resource ${U} is already registered`);let I=this._createRegisteredResource($,Y.title,U,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let I=this._createRegisteredResourceTemplate($,Y.title,U,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}}_createRegisteredResource($,U,Y,z,Q){let J={name:$,title:U,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({uri:null}),update:(I)=>{if(I.uri!==void 0&&I.uri!==Y){if(delete this._registeredResources[Y],I.uri)this._registeredResources[I.uri]=J}if(I.name!==void 0)J.name=I.name;if(I.title!==void 0)J.title=I.title;if(I.metadata!==void 0)J.metadata=I.metadata;if(I.callback!==void 0)J.readCallback=I.callback;if(I.enabled!==void 0)J.enabled=I.enabled;this.sendResourceListChanged()}};return this._registeredResources[Y]=J,J}_createRegisteredResourceTemplate($,U,Y,z,Q){let J={resourceTemplate:Y,title:U,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({name:null}),update:(K)=>{if(K.name!==void 0&&K.name!==$){if(delete this._registeredResourceTemplates[$],K.name)this._registeredResourceTemplates[K.name]=J}if(K.title!==void 0)J.title=K.title;if(K.template!==void 0)J.resourceTemplate=K.template;if(K.metadata!==void 0)J.metadata=K.metadata;if(K.callback!==void 0)J.readCallback=K.callback;if(K.enabled!==void 0)J.enabled=K.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=J;let I=Y.uriTemplate.variableNames;if(Array.isArray(I)&&I.some((K)=>!!Y.completeCallback(K)))this.setCompletionRequestHandler();return J}_createRegisteredPrompt($,U,Y,z,Q,J,I){let K=z,G=Q,H={title:U,description:Y,argsSchema:z,icons:J,_meta:I,handler:Ve($,z,Q),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,z){let W=Fe(z);if(W){if(Object.values(W).some((X)=>{return XS(we(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,U,Y,z,Q,J,I,K,G,H){if(YS($),z!==void 0)try{let Z=E7(z,"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:U,description:Y,inputSchema:z,outputSchema:Q,outputSchemaJson:qe(Q),annotations:J,icons:I,execution:K,_meta:G,handler:H,executor:Xe(z,H),enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Z)=>{if(Z.name!==void 0&&Z.name!==$){if(typeof Z.name==="string")YS(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($,U,Y){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:z,description:Q,inputSchema:J,outputSchema:I,annotations:K,icons:G,_meta:H}=U;return this._createRegisteredTool($,z,Q,Rw(J),Rw(I),K,G,void 0,H,Y)}registerPrompt($,U,Y){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:z,description:Q,argsSchema:J,icons:I,_meta:K}=U,G=this._createRegisteredPrompt($,z,Q,Rw(J),Y,I,K);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),G}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,U){return this.server.sendLoggingMessage($,U)}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();Oe=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=($,U)=>{if(U.clientCapabilities!==void 0)$._clientCapabilities=U.clientCapabilities;if(U.clientInfo!==void 0)$._clientVersion=U.clientInfo},De=($,U)=>{let Y=U.filter((z)=>!$._supportedProtocolVersions.includes(z));if(Y.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...Y];$.setRequestHandler("server/discover",()=>$._ondiscover())},Ae=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Ii0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,U,Y)=>this._verifyRequestState($,U,Y),sendElicitation:($,U)=>this._sendElicitationLeg($,U,{validateAcceptedContent:!1}),sendSampling:($,U)=>this.createMessage($,U),listRoots:($,U)=>this.listRoots($,U)})}oninitialized;constructor($,U){super(U);if(this._serverInfo=$,this._capabilities=U?.capabilities?{...U.capabilities}:{},this._instructions=U?.instructions,this._jsonSchemaValidator=U?.jsonSchemaValidator??new kw,this._requestStateVerify=U?.requestState?.verify,this._inputRequiredServing=Qi0(U?.inputRequired),U?.cacheHints!==void 0){for(let[Y,z]of Object.entries(U.cacheHints))if(z!==void 0)ih(z,`cacheHints['${Y}']`);this._cacheHints=U.cacheHints}if(this.setRequestHandler("initialize",(Y)=>this._oninitialize(Y)),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($,U)=>{let Y=U.sessionId||U.http?.req?.headers.get("mcp-session-id")||void 0,{level:z}=$.params,Q=Cw(A7,z);if(Q.success)this._loggingLevels.set(Y,Q.data);return{}})}buildContext($,U){let Y=$.http||U?.request||U?.closeSSEStream||U?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(z,Q,J)=>{if(!this._capabilities.logging)return Promise.resolve();let I;if(this._servedModernEra()){if(I=$.mcpReq.envelope?.[F7],I===void 0)return Promise.resolve()}else I=this._loggingLevels.get($.sessionId)??this._loggingLevels.get(void 0);if(I!==void 0&&this.LOG_LEVEL_SEVERITY.get(z)this.elicitInput(z,Q),requestSampling:(z,Q)=>this.createMessage(z,Q)},http:Y?{...$.http,req:U?.request,closeSSE:U?.closeSSEStream,closeStandaloneSSE:U?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(A7.options.map(($,U)=>[$,U]));isMessageIgnored=($,U)=>{let Y=this._loggingLevels.get(U);return Y?this.LOG_LEVEL_SEVERITY.get($){let I=await U(Q,J);if(r9(I))throw new J1(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 I};return async(Q,J)=>{let I=z?await this._invokeInputRequiredCapableHandler($,U,Q,J):await U(Q,J);if(r9(I)){if(!z)throw new J1(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 I}return Y===void 0?I:Dw(I,Y)}}return async(Y,z)=>{let Q=B7(this._negotiatedProtocolVersion),J=Q.validateRequest("tools/call",Y);if(!J.ok)throw new J1(J.reason==="not-in-era"?n0.InternalError:n0.InvalidParams,J.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${J.message}`);let I=await this._invokeInputRequiredCapableHandler("tools/call",U,Y,z);if(r9(I))return I;let K=kh(I),G=Q.validateResult("tools/call",K);if(!G.ok)throw new J1(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&&vQ(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,U,Y,z){let Q=this._servedModernEra(),J=z.mcpReq.requestState();if(J!==void 0&&typeof J!=="string")throw new J1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let I=z;if(typeof J==="string"){let X=await this._verifyRequestState(J,z,$);if(X!==void 0)I=sh(z,X)}let K;try{K=await U(Y,I)}catch(X){if(X instanceof J1&&X.code===n0.UrlElicitationRequired){if(!Q)throw X;throw new J1(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(!Q){if(!this._inputRequiredServing.legacyShim)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??gU}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,U,Y,I,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new J1(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(z);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=Ne($,Z,q),O=Nw(F,X);if(O!==void 0)throw new Pw({requiredCapabilities:O},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,U,Y){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,U)}catch(z){throw this.onerror?.(Error(`requestState verification rejected ${Y}: ${z instanceof Error?z.message:String(z)}`)),new J1(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 U=$.params.protocolVersion;this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo;let Y=qt(this._supportedProtocolVersions),z=Y.includes(U)?U:Y[0]??gU;return this._negotiatedProtocolVersion=z,this.transport?.setProtocolVersion?.(z),{protocolVersion:z,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($,U){return this._wireCodec().projectCallToolResult($,U)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage($,U){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 J=$.messages.at(-1),I=Array.isArray(J.content)?J.content:[J.content],K=I.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(I.some((X)=>X.type!=="tool_result"))throw new J1(n0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new J1(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(I.filter((q)=>q.type==="tool_result").map((q)=>q.toolUseId));if(X.size!==Z.size||![...X].every((q)=>Z.has(q)))throw new J1(n0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let Y=Boolean($.tools||$.toolChoice),z=await this.request({method:"sampling/createMessage",params:$},U),Q=this._wireCodec().samplingResultVariant(Y,z);if(!Q.ok)throw new V1(A1.InvalidResult,`Invalid sampling/createMessage result: ${Q.reason==="invalid"?Q.message:Q.reason}`);return Q.value}async elicitInput($,U){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($,U)}async _sendElicitationLeg($,U,Y){let z=$.mode??"form",Q=Y?.validateAcceptedContent??!0;switch(z){case"url":{let J=$;return this.request({method:"elicitation/create",params:J},U)}case"form":{let J=$.mode==="form"?$:{...$,mode:"form"},I=await this.request({method:"elicitation/create",params:J},U);if(Q&&I.action==="accept"&&I.content&&J.requestedSchema)try{let K=this._jsonSchemaValidator.getValidator(J.requestedSchema)(I.content);if(!K.valid)throw new J1(n0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof J1)throw K;throw new J1(n0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return I}}}createElicitationCompletionNotifier($,U){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:$}},U)}async listRoots($,U){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:$},U)}async sendLoggingMessage($,U){if(this._capabilities.logging&&!this.isMessageIgnored($.level,U))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 U=$.params;if($.method==="initialize"&&!lh(U)){let J=U!==null&&typeof U==="object"&&typeof U.protocolVersion==="string"?U.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...J!==void 0&&{requestedVersion:J}}}if(!Bw(U))return{kind:"legacy",reason:"no-claim"};let Y=bU(U),z=(Y===void 0?[]:jw(Y))[0];if(z!==void 0)return{kind:"invalid-envelope",issue:z};let Q=Tw(U);if(Q===void 0||!T7.includes(Q))return{kind:"unsupported-revision",requested:Q??"unknown"};return{kind:"modern",revision:Q,classification:{era:"modern",revision:Q}}}function je($,U={}){let Y=U.legacy??"serve",z=U.transport??new Xi0,Q={phase:"opening"},J,I=!1,K=()=>I||Q.phase==="closed",G=(j)=>{try{U.onerror?.(j)}catch{}},H=(j,C,b,x)=>z.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...x!==void 0&&{data:x}}}).catch((h)=>G(J5(h))),W=new Me(U.maxSubscriptions??fw),X=(j)=>{if(!j7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)z.send({jsonrpc:"2.0",...b}).catch((x)=>G(J5(x)));return"handled"},Z=async(j)=>{if(D$(j)&&j.method==="subscriptions/listen"){let C=bU(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"},x=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(x===void 0||!T7.includes(x)){let i=new hQ({supported:[...T7],requested:x??"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 z.send("error"in h?h:{jsonrpc:"2.0",method:h.method,params:h.params}).catch((i)=>G(J5(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 x=oh({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},T7);if(x===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${x.cell}): ${x.message}`)),H(j.id,x.code,x.message,x.data)},V=(j)=>{if(I||j===J)return;T()},F=async(j,C)=>{let b=await $({era:j}),x=b instanceof LH?b.server:b;if(j==="modern")ah(x,C),ZS(x,T7),W.setServerCapabilities(x.getCapabilities(),qS(x));let h=new Zi0(z,()=>V(h),j==="modern"?X:void 0);return await b.connect(h),{product:b,channel:h}},O=(j)=>j.product.close().catch((C)=>G(J5(C))),w=async(j)=>{J=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(J5(C))}finally{J=void 0}},M=async(j)=>{if(Q.phase==="closed")return;if(Q.phase==="pinned"){if(Q.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(Q.era==="modern"&&await Z(j))return;Q.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 hQ({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(Q.phase==="probe"){Q.instance.channel.deliver(j,{classification:C.classification});return}let b=await F("modern",C.revision);if(K()){await O(b);return}Q={phase:"probe",instance:b},b.channel.deliver(j,{classification:C.classification});return}if(Q.phase==="probe"){if(j7(j)){Q.instance.channel.deliver(j,{classification:C.classification});return}Q={phase:"pinned",era:"modern",instance:Q.instance}}else{let b=await F("modern",C.revision);if(K()){await O(b);return}Q={phase:"pinned",era:"modern",instance:b}}if(await Z(j))return;Q.instance.channel.deliver(j,{classification:C.classification});return;case"legacy":{if(Y==="reject"){if(D$(j))await q(j,C.reason,C.requestedVersion);return}if(Q.phase==="probe"){if(await w(Q.instance),K())return;Q={phase:"opening"}}let b=await F("legacy");if(K()){await O(b);return}Q={phase:"pinned",era:"legacy",instance:b},Q.instance.channel.deliver(j);return}}},N=[],D=!1,B=async()=>{if(D)return;D=!0;try{while(N.length>0){let j=N.shift();try{await M(j)}catch(C){if(D$(j))await H(j.id,n0.InternalError,"Internal server error");G(J5(C))}}}finally{D=!1}},T=async()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;Q={phase:"closed"};for(let C of W.teardownAll())await z.send(C).catch((b)=>G(J5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(J5(C)));await z.close().catch((C)=>G(J5(C)))};z.onmessage=(j)=>{N.push(j),B()},z.onerror=(j)=>{if(G(j),Q.phase==="probe"||Q.phase==="pinned")Q.instance.channel.onerror?.(j)},z.onclose=()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;if(Q={phase:"closed"},j.phase==="probe"||j.phase==="pinned")j.instance.product.close().catch((C)=>G(J5(C)))};let A=z.start().catch((j)=>{throw G(J5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function J5($){return $ instanceof Error?$:Error(String($))}var Xi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=HS.stdin,U=HS.stdout,Y){this._stdin=$,this._stdout=U,this._readBuffer=new $S({maxBufferSize:Y?.maxBufferSize})}onclose;onerror;onmessage;_ondata=($)=>{try{this._readBuffer.append($),this.processReadBuffer()}catch(U){this.onerror?.(U),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((U,Y)=>{let z=US($),Q=!1,J=(K)=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),Y(K)},I=()=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),U()};if(this._stdout.once("error",J),this._stdout.write(z)){if(Q)return;Q=!0,this._stdout.off("error",J),U()}else if(!Q)this._stdout.once("drain",I)})}},Te=3000,Zi0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,U,Y){this._wire=$,this._onInstanceClose=U,this._outboundIntercept=Y}async start(){}async send($,U){if(HH($)||Ew($)){let{id:Y}=$;if(Y!==void 0)this._settle(Y)}if(this._closed)return;if(this._outboundIntercept?.($)==="handled")return;return this._wire.send($,U)}setProtocolVersion=($)=>{this._wire.setProtocolVersion?.($)};deliver($,U){if(this._closed)return;if(D$($))this._pendingRequests.add($.id);else if(j7($)&&$.method==="notifications/cancelled"){let Y=$.params?.requestId;if(Y!==void 0)this._settle(Y)}this.onmessage?.($,U)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((U)=>{let Y=()=>{clearTimeout(z),U(!0)},z=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((Q)=>Q!==Y),U(!1)},$);this._drainWaiters.push(Y)})}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 U of $)U()}};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($,U,Y){let z=$.status||$.status===0?$.status:"",Q=$.statusText??"",J=`${z} ${Q}`.trim(),I=J?`status code ${J}`:"an unknown error";super(`Request failed with ${I}: ${U.method} ${U.url}`);this.response=$,this.request=U,this.options=Y}}});var wH;var LS=o(()=>{FH();wH=class wH extends s9{name="NetworkError";request;constructor($,U){super(`Request failed due to a network error: ${$.method} ${$.url}`,U);this.request=$}}});var OH;var FS=o(()=>{OH=class OH extends Error{name="NonError";value;constructor($){let U="Non-error value was thrown";try{if(typeof $==="string")U=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")U=$.message}catch{}super(U);this.value=$}}});var yQ;var Ce=o(()=>{FH();FS();yQ=class yQ extends s9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let U=$?.cause?$.cause instanceof Error?$.cause:new OH($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",U?{cause:U}: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 I5;var bw=o(()=>{FH();I5=class I5 extends s9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class pw{options;constructor($){this.options=$}}var OS,_e,iw,ve,he,cw,Vi0=()=>{return},Se,kQ=2147483647,ge=40,nw,ye=($)=>new pw($),ke,xe;var iU=o(()=>{OS=(()=>{let $=!1,U=!1,Y=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(Y&&z)try{U=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(Q){if(Q instanceof Error&&Q.message==="unsupported BodyInit type")return!1;throw Q}return $&&!U})(),_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 U=0;for(let[Y,z]of $)U+=ge,U+=dw.encode(`Content-Disposition: form-data; name="${Y}"`).byteLength,U+=typeof z==="string"?dw.encode(z).byteLength:z.size;return U}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=($,U,Y)=>{let z,Q=0;return $.pipeThrough(new TransformStream({transform(J,I){if(I.enqueue(J),z){Q+=z.byteLength;let K=U===0?0:Q/U;if(K>=1)K=1-Number.EPSILON;Y?.({percent:K,totalBytes:Math.max(U,Q),transferredBytes:Q},z)}z=J},flush(){if(z)Q+=z.byteLength,Y?.({percent:1,totalBytes:Math.max(U,Q),transferredBytes:Q},z)}}))},ue=($,U)=>{if(!$.body)return $;let Y={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,Y);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(fe($.body,z,U),Y)},be=($,U,Y)=>{if(!$.body)return $;let z=Li0(Y??$.body);return new Request($,{duplex:"half",body:fe($.body,z,U)})};var ie=o(()=>{iU();dw=new TextEncoder});var d5=($)=>$!==null&&typeof $==="object";function MH($,U,Y){return Object.hasOwn(U,Y)&&U[Y]===void 0?[]:AS($[Y]??[],U[Y]??[])}var Fi0,MS=($)=>d5($)&&$[Fi0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},NH=(...$)=>{for(let U of $)if((!d5(U)||Array.isArray(U))&&U!==void 0)throw TypeError("The `options` argument must be an object");return AS({},...$)},DS=($={},U={})=>{let Y=new globalThis.Headers($),z=U instanceof globalThis.Headers,Q=new globalThis.Headers(U);for(let[J,I]of Q.entries())if(z&&I==="undefined"||I===void 0)Y.delete(J);else Y.set(J,I);return Y},NS=($)=>{if(!d5($)||Array.isArray($))return!1;let U=Object.getPrototypeOf($);return U===Object.prototype||U===null},xQ=($)=>{if($ instanceof URLSearchParams){let U=new URLSearchParams($),Y=$[C7];if(Y)U[C7]=new Set(Y);return U}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(NS($))return{...$};return $},wi0=($)=>Object.fromEntries(Object.entries($).filter((U)=>U[1]!==void 0)),Oi0=($,U)=>{if(NS($)&&NS(U))return wi0({...$,...U});return DS($,U)},mw=($={},U={})=>({init:MH($,U,"init"),beforeRequest:MH($,U,"beforeRequest"),beforeRetry:MH($,U,"beforeRetry"),beforeError:MH($,U,"beforeError"),afterResponse:MH($,U,"afterResponse")}),C7,Mi0=($,U)=>{let Y=new URLSearchParams,z=new Set;for(let Q of[$,U]){if(Q===void 0)continue;if(Q instanceof URLSearchParams){for(let[I,K]of Q.entries())Y.append(I,K),z.delete(I);let J=Q[C7];if(J)for(let I of J)Y.delete(I),z.add(I)}else if(Array.isArray(Q))for(let J of Q){if(!Array.isArray(J)||J.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");Y.append(String(J[0]),String(J[1])),z.delete(String(J[0]))}else if(d5(Q))for(let[J,I]of Object.entries(Q))if(I===void 0)Y.delete(J),z.add(J);else Y.append(J,String(I)),z.delete(J);else{let J=new URLSearchParams(Q);for(let[I,K]of J.entries())Y.append(I,K),z.delete(I)}}if(z.size>0)Y[C7]=z;return Y},AS=(...$)=>{let U={},Y={},z={},Q,J=[];for(let I of $)if(Array.isArray(I)){if(!Array.isArray(U))U=[];U=[...U,...I]}else if(d5(I)){for(let[K,G]of Object.entries(I)){if(K==="signal"&&G instanceof globalThis.AbortSignal){J.push(G);continue}let H=MS(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");U={...U,context:G===void 0||G===null?{}:W?{...G}:{...U.context,...G}};continue}if(K==="searchParams"){if(G===void 0||G===null)Q=void 0;else if(W)Q=G;else Q=Q===void 0?G:Mi0(Q,G);continue}if(d5(G)&&!W&&K in U)G=AS(U[K],G);U={...U,[K]:G}}if(d5(I.hooks)){let{value:K,isReplace:G}=MS(I.hooks);z=G?mw({},K):mw(z,K),U.hooks=z}if(d5(I.headers)){let{value:K,isReplace:G}=MS(I.headers);Y=G?xQ(K):Oi0(Y,K),U.headers=Y}}if(Q!==void 0)U.searchParams=Q;if(J.length>0)if(J.length===1)U.signal=J[0];else if(iw)U.signal=AbortSignal.any(J);else U.signal=J.at(-1);return U};var lw=o(()=>{iU();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 U=Object.fromEntries(Object.entries({...$,methods:$.methods?.map((Y)=>Y.toLowerCase())}).filter(([,Y])=>Y!==void 0));return{...ce,...U}};var de=o(()=>{iU();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($,U,Y,z){return new Promise((Q,J)=>{let I=setTimeout(()=>{if(Y)Y.abort();J(new I5($))},z.timeout);z.fetch($,U).then(Q).catch(J).then(()=>{clearTimeout(I)})})}var me=o(()=>{bw()});async function ow($,{signal:U}){return new Promise((Y,z)=>{if(U)U.throwIfAborted(),U.addEventListener("abort",Q,{once:!0});function Q(){clearTimeout(J),z(U.reason)}let J=setTimeout(()=>{U?.removeEventListener("abort",Q),Y()},$)})}var le=($)=>{let U={};for(let Y in $){if(!Object.hasOwn($,Y))continue;if(!(Y in xe)&&!(Y in ke))U[Y]=$[Y]}return U},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(()=>{iU();lw()});function BS($){if(!($&&Bi0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:Y,stack:z}=$;if(Y==="Load failed")return z===void 0||"__sentry_captured__"in $;if(Y.startsWith("error sending request for url"))return!0;if(Y==="Failed to fetch"||Y.startsWith("Failed to fetch (")&&Y.endsWith(")"))return!0;return Ti0.has(Y)}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($,I5)}var TS=($,U)=>$ instanceof U||$?.name===U.name;var $00=o(()=>{uw();LS();bw()});function vi0($){let U={...$,json:xQ($.json),context:xQ($.context),headers:xQ($.headers),searchParams:_i0($.searchParams)};if($.retry!==void 0)U.retry=Ri0($.retry);return U}class fQ{static create($,U){let Y=U.hooks?.init??[],z=Y.length>0?vi0(U):U;for(let K of Y)K(z);let Q=new fQ($,z),J=async()=>{if(typeof Q.#$.timeout==="number"&&Q.#$.timeout>kQ)throw RangeError(`The \`timeout\` option cannot be greater than ${kQ}`);if(typeof Q.#$.totalTimeout==="number"&&Q.#$.totalTimeout>kQ)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${kQ}`);await Promise.resolve();let K=await Q.#g(),G=K??await Q.#h(async()=>Q.#R()),H=K!==void 0||Q.#C();for(;;){if(G===void 0)return G;if(AH(G))try{G=await Q.#y(G)}catch(X){if(!(X instanceof yQ))throw X;let Z=await Q.#E(X,async()=>Q.#R());if(Z===void 0)return Z;G=Z,H=Q.#C();continue}let W=G;if(!W.ok&&W.type!=="opaque"&&(typeof Q.#$.throwHttpErrors==="function"?Q.#$.throwHttpErrors(W.status):Q.#$.throwHttpErrors)){let X=new D6(W,Q.#M(W),Q.#O()),Z=X;if(X.data=await Q.#L(W),H)throw Z;let q=await Q.#E(X,async()=>Q.#R());if(q===void 0)return q;G=q,H=Q.#C();continue}break}if(!AH(G))return G;if(Q.#V(G),Q.#$.onDownloadProgress){if(typeof Q.#$.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 Q.#K(G),ue(W,Q.#$.onDownloadProgress)}return G},I=(async()=>{try{return await J()}catch(K){if(!(K instanceof Error))throw K;if(Q.#X.has(K))throw K;let G=K;for(let H of Q.#$.hooks.beforeError){let W=await H({request:Q.request,options:Q.#O(),error:G,retryCount:Q.#Q});if(W instanceof Error)G=W}throw G}finally{let K=Q.#W;if(Q.#F(K?.body??void 0),Q.request!==K)Q.#F(Q.request.body??void 0)}})();for(let[K,G]of Object.entries(Se)){if(K==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;I[K]=async(H)=>{Q.request.headers.set("accept",Q.request.headers.get("accept")||G);let W=await I;if(K!=="json")return W[K]();let X=await W.text();if(X===""){if(H!==void 0)return z00(void 0,H);return JSON.parse(X)}let Z=z.parseJson?await z.parseJson(X,{request:Q.#M(W),response:W}):JSON.parse(X);return H===void 0?Z:z00(Z,H)}}return I}static#z($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,U])=>U!==void 0));return $}request;#Y;#Q=0;#U;#$;#W;#H;#X=new WeakSet;#J;#I;#Z=!1;#N=new WeakMap;constructor($,U={}){if(this.#U=$,Object.hasOwn(U,"prefixUrl"))throw Error(Ei0);if(this.#$={...U,headers:DS(this.#U.headers,U.headers),hooks:mw({},U.hooks),method:ne(U.method??this.#U.method??"GET"),prefix:String(U.prefix||""),retry:pe(U.retry),throwHttpErrors:U.throwHttpErrors??!0,timeout:U.timeout??1e4,totalTimeout:U.totalTimeout??!1,fetch:U.fetch??globalThis.fetch.bind(globalThis),context:U.context??{}},typeof this.#U!=="string"&&!(this.#U instanceof URL||this.#U instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#U==="string"){if(this.#$.prefix){let z=this.#$.prefix.replace(/\/+$/,""),Q=this.#U.replace(/^\/+/,"");this.#U=`${z}/${Q}`}if(this.#$.baseUrl){let z;try{z=new URL(this.#U)}catch{}if(!z)this.#U=new URL(this.#U,new Request(this.#$.baseUrl).url)}}if(_e&&iw)this.#H=this.#$.signal??this.#U.signal,this.#Y=new globalThis.AbortController,this.#$.signal=this.#w();if(OS)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 Y=U.headers&&new globalThis.Headers(U.headers).has("content-type");if(this.#U instanceof globalThis.Request&&(he&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!Y)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#U,this.#$),oe(this.#$.searchParams)){let z=new URL(this.request.url),Q=this.#$.searchParams?.[C7];if(Q)for(let J of Q)z.searchParams.delete(J);if(typeof this.#$.searchParams==="string"){let J=this.#$.searchParams.replace(/^\?/,"");if(J!=="")z.search=z.search?`${z.search}&${J}`:`?${J}`}else{let J=new URLSearchParams(fQ.#z(this.#$.searchParams));for(let[I,K]of J.entries())z.searchParams.append(I,K)}if(this.#$.searchParams&&typeof this.#$.searchParams==="object"&&!Array.isArray(this.#$.searchParams)&&!(this.#$.searchParams instanceof URLSearchParams)){for(let[J,I]of Object.entries(this.#$.searchParams))if(I===void 0)z.searchParams.delete(J)}this.request=new globalThis.Request(z,this.#$)}if(this.#$.onUploadProgress&&typeof this.#$.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");this.#I=typeof this.#$.totalTimeout==="number"?this.#S():void 0}#G(){let $=this.#$.retry.delay(this.#Q+1),U=$;if(this.#$.retry.jitter===!0)U=Math.random()*$;else if(typeof this.#$.retry.jitter==="function"){if(U=this.#$.retry.jitter($),!Number.isFinite(U)||U<0)U=$}return Math.min(this.#$.retry.backoffLimit,U)}async#B($){if(this.#Q>=this.#$.retry.limit)throw $;let U=$ instanceof Error?$:new OH($);if(U instanceof yQ)return U.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let Y=await this.#$.retry.shouldRetry({error:U,retryCount:this.#Q+1});if(Y===!1)throw $;if(Y===!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 Y=$.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(Y&&this.#$.retry.afterStatusCodes.includes($.response.status)){let z=Number(Y)*1000;if(Number.isNaN(z))z=Date.parse(Y)-Date.now();else if(z>=Date.parse("2024-01-01"))z-=Date.now();if(!Number.isFinite(z))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return z=Math.max(0,z),Math.min(this.#$.retry.maxRetryAfter,z)}if($.response.status===413)throw $;return this.#G()}if(!te($))throw $;return this.#G()}#V($){let U=this.#M($);if(this.#$.parseJson)$.json=async()=>{let Y=await $.text();if(Y==="")return JSON.parse(Y);return this.#$.parseJson(Y,{request:U,response:$})};return $}async#L($){let U=await this.#T($,this.#D());if(U===DH){this.#q();return}if(!U)return;if(!this.#A($.headers.get("content-type")??""))return U;let Y=await this.#j(U,$,this.#D(),this.#M($));if(Y===DH){this.#q();return}return Y}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,U=this.#P();if(U===void 0)return $;if(U<=0)throw new I5(this.request);return Math.min($,U)}#A($){let U=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(U)}async#T($,U){let{body:Y}=$;if(!Y)try{return await $.text()}catch{return}let z;try{z=Y.getReader()}catch{return}let Q=Ci0($.headers.get("content-type")??""),J=[],I=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await z.read();if(W)break;if(I+=X.byteLength,I>ji0){z.cancel().catch(()=>{return});return}J.push(Q.decode(X,{stream:!0}))}}catch{return}return J.push(Q.decode()),J.join("")})(),G=new Promise((W)=>{let X=setTimeout(()=>{W(DH)},U);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===DH)z.cancel().catch(()=>{return});return H}async#j($,U,Y,z){let Q;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:z,response:U}):JSON.parse($)),new Promise((J)=>{Q=setTimeout(()=>{J(DH)},Y)})])}catch{return}finally{clearTimeout(Q)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#w(){return this.#H?AbortSignal.any([this.#H,this.#Y.signal]):this.#Y.signal}#q(){let $=this.#P();if($!==void 0&&$<=0)throw new I5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let U=await $({request:this.request,options:this.#O(),retryCount:0});if(Y00(U))this.#_(U);else if(AH(U))return U}return}async#y($){let U=this.#M($);for(let Y of this.#$.hooks.afterResponse){let z=this.#v($.clone(),U);this.#V(z);let Q;try{Q=await Y({request:this.request,options:this.#O(),response:z,retryCount:this.#Q})}catch(I){if(z!==$)this.#K(z);throw this.#K($),I}if(Q instanceof pw){if(z!==$)this.#K(z);throw this.#K($),new yQ(Q.options)}let J=AH(Q)?this.#v(Q,U):$;if(z!==$&&z!==J&&z.body!==J.body)this.#K(z);if($!==J&&$.body!==J.body)this.#K($);$=J}return $}async#h($){try{return await $()}catch(U){return this.#E(U,$)}}async#E($,U){this.#Z=!1;let Y=Math.min(await this.#B($),kQ),z={signal:this.#H},Q=this.#P();if(Q!==void 0){if(Q<=0)throw new I5(this.request);if(Y>=Q)throw await ow(Q,z),new I5(this.request)}if(await ow(Y,z),this.#q(),$ instanceof yQ&&$.customRequest){let J=new globalThis.Request($.customRequest,this.#$.signal?{signal:this.#$.signal}:void 0);this.#_(J)}for(let J of this.#$.hooks.beforeRetry){let I;try{I=await J({request:this.request,options:this.#O(),error:$,retryCount:this.#Q+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(Y00(I)){this.#_(I);break}if(AH(I))return this.#Z=!0,this.#Q++,I;if(I===nw)return}return this.#q(),this.#Q++,this.#h(U)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#Y?.signal.aborted)this.#Y=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=le(this.#$),U=this.#$.retry.limit>0?this.request.clone():void 0,Y=this.#k(this.request,this.#$.body??void 0);if(this.#W=Y,U)this.request=U;try{let z=this.#P();if(z!==void 0&&z<=0)throw new I5(this.request);let Q=this.#$.timeout===!1?z:z===void 0?this.#$.timeout:Math.min(this.#$.timeout,z),J=Q===void 0?await this.#$.fetch(Y,$):await PS(Y,$,this.#Y,{timeout:Q,fetch:this.#$.fetch});return this.#v(J,Y)}catch(z){if(BS(z))throw new wH(this.request,{cause:z});throw z}}#P(){if(this.#I===void 0)return;let $=this.#S()-this.#I;return Math.max(0,this.#$.totalTimeout-$)}#S(){return globalThis.performance?.now()??Date.now()}#O(){if(!this.#J){let{hooks:$,json:U,parseJson:Y,stringifyJson:z,searchParams:Q,timeout:J,totalTimeout:I,throwHttpErrors:K,fetch:G,...H}=this.#$;this.#J=Object.freeze(H)}return this.#J}#_($){this.#J=void 0,this.request=$}#M($){return this.#N.get($)??this.request}#v($,U){return this.#N.set($,U),$}#k($,U){if(!this.#$.onUploadProgress||!$.body||!OS)return $;return be($,this.#$.onUploadProgress,U??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 U=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),Y=U?.[1]??U?.[2];if(Y)try{return new TextDecoder(Y)}catch{}return new TextDecoder},U00="The `schema` argument must follow the Standard Schema specification",Ri0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},Q00,Y00=($)=>$ instanceof globalThis.Request||Q00.call($)==="[object Request]",AH=($)=>$ instanceof globalThis.Response||Q00.call($)==="[object Response]",_i0=($)=>{if(Array.isArray($))return $.map((U)=>[...U]);return xQ($)},z00=async($,U)=>{if(typeof U!=="object"&&typeof U!=="function"||U===null)throw TypeError(U00);let Y=U["~standard"];if(typeof Y!=="object"||Y===null||typeof Y.validate!=="function")throw TypeError(U00);let z=await Y.validate($);if(z.issues)throw new wS(z.issues);return z.value};var J00=o(()=>{uw();LS();FS();Ce();Re();bw();ie();lw();de();me();re();se();$00();iU();DH=Symbol("timedOutResponseData"),Q00=Object.prototype.toString});var jS=($)=>{let U=(Y,z)=>fQ.create(Y,NH($,z));for(let Y of cw)U[Y]=(z,Q)=>fQ.create(z,NH($,Q,{method:Y}));return U.create=(Y)=>jS(NH(Y)),U.extend=(Y)=>{if(typeof Y==="function")Y=Y($??{});return jS(NH($,Y))},U.stop=nw,U.retry=ye,U},hi0,K5;var uQ=o(()=>{J00();iU();lw();uw();/*! MIT License © Sindre Sorhus */hi0=jS(),K5=hi0});async function I00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=$.seal.url??$.source.sealUrl,Y=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:Y?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:U,tenantId:Y?.tenantId,tenantSlug:$.seal.tenantSlug??Y?.tenantSlug,tenantName:Y?.tenantName,raw:{sourceType:$.source.type}}}}function Si0($){let U=Object.entries($??{}).map(([Y,z])=>`${Y}=${z}`);return U.length?U.join("; "):void 0}function A6($){let U={...$?.headers??{}},Y=Si0($?.cookies);if(Y)U.Cookie=Y;return U}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 bQ(){let $=ci0();if(!ES($))return{};try{return G00.parse(JSON.parse(ui0($,"utf-8")))}catch{return{}}}function sw($){let U=ni0();fi0(ii0(U),{recursive:!0,mode:448}),bi0(U,JSON.stringify($,null,2),{mode:384})}function q00($){return bQ()[$]?.seal}function V00($,U){let Y=bQ();sw({...Y,[$]:{...Y[$],seal:U}})}function L00($){let U=bQ(),Y=U[$];if(!Y)return;sw({...U,[$]:{...Y,seal:void 0}})}function PH($){return bQ()[$]?.hose??{}}function CS($,U){let Y=bQ();sw({...Y,[$]:{...Y[$],hose:U}})}function aw($){let U=bQ();delete U[$],sw(U)}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 O00($){let U;try{U=new URL($.trim())}catch{throw Error("Invalid Hose assistance link: expected a valid HTTPS URL")}if(U.protocol!=="https:"||U.port||!li0(U.hostname)||U.pathname.replace(/\/+$/,"")!==mi0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let Y=U.searchParams.getAll("accessToken").filter(Boolean),z=U.searchParams.getAll("ekbCorpId").filter(Boolean);if(Y.length!==1||z.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let Q=z[0].trim().toLowerCase();if(!w00.test(Q))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:Q,accessToken:Y[0],baseUrl:U.origin}}async function tw($,U){let Y=typeof $==="string"?O00($):M00($),z=`https://${Y.corpId}.sealai.cc`,J=await T8(z,void 0,U?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:Y.accessToken,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600;return{corpId:Y.corpId,sealUrl:z,token:I,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function ew($,U){let Y=U.hoseCorpConfig&&typeof U.hoseCorpConfig==="object"?U.hoseCorpConfig:void 0,z=[U.tenantSlug,Y?.corporationId].filter((I)=>typeof I==="string"&&Boolean(I)),Q=$.trim().toLowerCase(),J=z.map((I)=>I.trim().toLowerCase()).filter(Boolean);if(J.length===0||J.some((I)=>I!==Q))throw Error("Hose assistance link tenant mismatch: the Seal tenant does not match ekbCorpId")}function li0($){let U=$.toLowerCase();return di0.some((Y)=>U.endsWith(Y))}function M00($){let U=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",Y=typeof $?.accessToken==="string"?$.accessToken.trim():"",z=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!w00.test(U)||!Y)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:U,accessToken:Y,...z?{baseUrl:z}:{}}}function N00($,U=60){return Boolean($&&Date.now()<$.expiresAt-U*1000)}function R7($,U){if($.seal.url)return $.seal.url;if(U.sealUrl)return U.sealUrl;return`https://${U.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:U})=>{let Y=U instanceof D6?await U.response.text().catch(()=>""):"";return U.message=`${U.message}${Y?`: ${Y}`:""}`,U}]}})}async function ri0($){let U=D00($),Y=$.appKey??$.key,z=$.appSecurity??$.password;if(!Y||!z)throw Error("Hose source requires appKey/key and appSecurity/password");let Q=await U.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:Y,appSecurity:z}}).json(),J=Q.value?.accessToken??Q.accessToken??Q.token;if(!J)throw Error("Hose login did not return an access token");return{token:J,expiresAt:Date.now()+3600000}}async function iQ($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=PH($.id);if(N00(U.openapi))return U.openapi.token;let Y=RS.get($.id);if(Y)return Y;let z=ri0($.source).then((Q)=>{return CS($.id,{...PH($.id),openapi:Q}),Q.token}).finally(()=>RS.delete($.id));return RS.set($.id,z),z}async function $O($,U,Y=7200){let z=D00($),Q=oi0($),I=(await z.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:U},json:{uid:Q,pageType:"home",expireDate:Y}}).json()).value?.message;if(!I)throw Error("Hose CloseAPI did not return a provisional auth URL");let K=new URL(I).searchParams.get("accessToken");if(!K)throw Error("Hose provisional auth URL did not include accessToken");return{token:K,url:I,expiresAt:Date.now()+Y*1000}}async function TH($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=$.source,Y=PH($.id);if(N00(Y.closeapi)&&Y.closeapi.url)return Y.closeapi;let z=_S.get($.id);if(z)return z;let Q=iQ($).then((J)=>$O(U,J)).then((J)=>{return CS($.id,{...PH($.id),closeapi:J}),J}).finally(()=>_S.delete($.id));return _S.set($.id,Q),Q}async function A00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=(await TH($)).url;if(!U)throw Error("Hose provisional auth URL was not available");return U}async function P00($,U=7200,Y){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);if(!Number.isFinite(U)||U<=0)throw Error(`Invalid expire seconds: ${U}. Must be a positive integer.`);let z=await iQ($),Q=await $O($.source,z,U);if(!Q.url)throw Error("Hose provisional auth URL was not available");return{corpId:$.source.corpId,staffId:$.source.staffId,url:Q.url,token:Q.token,expiresIn:U}}async function B00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=await TH($),Y=R7($,$.source),z=A6($.seal),J=await T8(Y,void 0,z).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:U.token,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600,G={provider:"hose",corpId:$.source.corpId,staffId:$.source.staffId,sealUrl:P$(Y),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:P$($.source.domain)}};return{token:I,expiresAt:Date.now()+K*1000,enterprise:G}}async function cQ($,U,Y){if(Y){let I=P$(Y),K=await F00(I,$,U);if(!K)throw Error(`Failed to authenticate on specified domain: ${I}. Please verify appKey/appSecurity and domain connectivity.`);return K}let z=pi0.map(async(I)=>{try{return await F00(I,$,U)}catch{return}}),J=(await Promise.all(z)).filter((I)=>Boolean(I));if(J.length>0&&J[0])return J[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($,U,Y){try{let z=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:U,appSecurity:Y}),signal:AbortSignal.timeout(8000)});if(!z.ok)return;let Q=await z.json();if(Q.value?.errorCode)return;let J=Q.value?.accessToken??Q.accessToken,I=Q.value?.corporationId??Q.value?.corporation?.id;if(!J||!I)return;return{domain:$,corpId:I,corpName:Q.value?.corporation?.name,openapiToken:J,expireTime:Q.value?.expireTime}}catch{return}}async function UO($,U){let Y=`${P$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(U)}`,z=await fetch(Y,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!z.ok){let I=await z.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${z.status} ${I}`)}return((await z.json()).items??[]).map((I)=>({id:I.id,name:I.name,enName:I.enName,roleDefs:(I.roleDefs??[]).map((K)=>({id:K.id,name:K.name,enName:K.enName,sourceType:K.sourceType,sourceTypeValue:K.sourceTypeValue,groupId:I.id,groupName:I.name}))}))}async function vS($,U,Y,z="id"){let Q=Y.startsWith("$")?Y.slice(1):Y,J=`${P$($)}/api/openapi/v1/roledefs/$${Q}?accessToken=${encodeURIComponent(U)}&staffBy=${encodeURIComponent(z)}&pathType=name`,I=await fetch(J,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!I.ok){let W=await I.text().catch(()=>"");throw Error(`Failed to fetch Hose role staffs for ${Q}: ${I.status} ${W}`)}let G=(await I.json()).value;if(!G)throw Error(`Hose role staff query returned empty result for ${Q}`);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??Q,name:G.name??"",count:G.count??H.length,staffs:H}}async function hS($,U,Y){if(Y.length===0)return[];let z=`${P$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(U)}`,Q=await fetch(z,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:Y.slice(0,100)}),signal:AbortSignal.timeout(1e4)});if(!Q.ok){let I=await Q.text().catch(()=>"");throw Error(`Failed to fetch Hose staff details: ${Q.status} ${I}`)}return(await Q.json()).items??[]}function SS($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function si0($){let U=typeof $==="string"?O00($):M00($),Y=U.baseUrl||"https://app.ekuaibao.com",z,Q,J,I,K,G={accesstoken:U.accessToken,corpid:U.corpId};try{let H=await K5.get(`${Y}/api/engine/realm/$UNITY/actions/jwt`,{searchParams:{corpId:U.corpId},headers:G,timeout:1e4}).json(),W=H.id||H.value;if(W){let X=W.split(".");if(X.length>=2){let Z=X[1].replace(/-/g,"+").replace(/_/g,"/"),q=JSON.parse(Buffer.from(Z,"base64").toString("utf-8"));if(typeof q.staffId==="string")z=q.staffId;if(typeof q.corporationName==="string")Q=q.corporationName;if(typeof q.staffName==="string")J=q.staffName;if(typeof q.cellphone==="string")K=q.cellphone;if(q.isAdmin!==void 0)I=q.isAdmin===!0||q.isAdmin==="true"}}}catch{}if(!z||!Q)try{let W=(await K5.get(`${Y}/api/account/v2/session`,{headers:{...G,...z?{staffid:z}:{}},timeout:1e4}).json())?.value;if(W){if(!z&&W.loginStaffId)z=W.loginStaffId;if(!Q&&W.corporationName)Q=W.corporationName;if(!J&&W.privilege)J=W.privilege}}catch{}if(!z)z=`${U.corpId}:admin`;return{corpId:U.corpId,baseUrl:Y,accessToken:U.accessToken,staffId:z,corpName:Q,staffName:J,isAdmin:I,cellphone:K}}async function gS($){let U=await si0($),Y={accesstoken:U.accessToken,corpid:U.corpId,staffid:U.staffId},z;try{z=await(await K5.get(`${U.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:U.corpId},headers:Y,timeout:15000})).json()}catch(I){let K=I instanceof Error?I.message:String(I);throw Error(`Failed to query Hose OpenAPI keys from assistance link: ${K}`)}let Q=z.items??[],J=[];for(let I of Q)if(typeof I==="object"&&I!==null){let K=I;if(typeof K.appKey==="string"&&typeof K.appSecurity==="string")J.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:U.corpId,createTime:typeof K.createTime==="number"?K.createTime:void 0,updateTime:typeof K.updateTime==="number"?K.updateTime:void 0})}return{corpId:U.corpId,corpName:U.corpName,baseUrl:U.baseUrl,staffId:U.staffId,keys:J}}var pi0,di0,mi0="/web/thirdparty.html",w00,RS,_S;var a9=o(()=>{uQ();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($,U){return Date.now()>=$.expiresAt-U*1000}async function ai0($){switch($.source.type){case"hose":return B00($);case"direct":case"seal":return I00($)}}async function zO($){let U=$.auth.refreshTtl,Y=YO.get($.id);if(Y&&!T00(Y,U))return Y;let z=q00($.id);if(z&&!T00(z,U))return YO.set($.id,z),z;let Q=await ai0($);return YO.set($.id,Q),V00($.id,Q),Q}async function j00($){return(await zO($)).enterprise}function E00($){YO.delete($),L00($)}var YO;var yS=o(()=>{a9();BH();YO=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 U=ti0($.data);if(U)$.message=`${$.message}: ${U}`;return $}function C00($){return async({error:U})=>{if($&&U instanceof D6&&U.response.status===401)E00($);return ei0(U)}}async function j1($){let U=await zO($);return K5.create({prefix:U.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${U.token}`},hooks:{beforeError:[C00($.id)]}})}async function kS($,U){let Y=await zO($);return T8(Y.enterprise.sealUrl,U,A6($.seal))}function T8($,U,Y={}){let z={...Y};if(U)z.Authorization=`Bearer ${U}`;return K5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:z,hooks:{beforeError:[C00()]}})}var i8=o(()=>{uQ();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 Uc0($,U=jH.version){let Y=$.trim();if(!Y)return null;let z=Y.endsWith("-dirty"),Q=z?Y.slice(0,-6):Y,J=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(J&&J[1]&&J[2]&&J[3])return{baseVersion:J[1],commitsAhead:Number.parseInt(J[2],10),commit:J[3],dirty:z,describe:Y};let I=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(I&&I[1])return{baseVersion:I[1],commitsAhead:0,commit:"",dirty:z,describe:Y};let K=Q.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:U,commitsAhead:0,commit:K[1],dirty:z,describe:Y};return null}function Yc0($,U,Y,z){let J=Y?`+g${Y}${z?".dirty":""}`:z?"+dirty":"";return`${$}-dev.${U}${J}`}function zc0($){let U=$?.env,Y=U?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,z=U?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,Q=U?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,J=U?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,I=U?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,K=U?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,G=U?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,H=U?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,W=U?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,X=$?.cwd;if(Y){let Z=z==="true",V={name:"seal-use",version:Y,channel:Q||(Z?"release":"dev"),isRelease:Z};if(J)V.git={baseVersion:J,commitsAhead:Number.parseInt(I||"0",10),commit:K||"",dirty:G==="true",describe:H||Y};return V}if(z==="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=Uc0(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:Yc0(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,Vc1;var t9=o(()=>{_00();EH=zc0(),P1=EH.version,xS=EH.isRelease,Vc1=EH.channel});function nQ($=void 0){return uS.parse($??{})}function g00($,U){return nQ({...nQ($),...U})}var h00,fS,S00,uS,bS;var pQ=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 U=$.toLowerCase();return U.startsWith(".")?U:`.${U}`}).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(($,U)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)U.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 Qc0,Jc0,Ic0,Kc0,k00,Gc0,Hc0,x00,QO,f00,Wc0,JO,u00,RH,b00,Xc0,Zc0,qc0,y00,_H,i00,Vc0,Lc0,IO,iS,c00,n00,p00,d00,KO,m00,cS,nS,l00,o00,Fc0,r00,wc0,s00,CH,a00,t00,e00,$10,U10,Y10,z10,Q10,J10,I10,K10,Oc0,G10,Mc0,Nc0,Dc0,pS,dS,Ac0,H10,W10,X10,Z10,Pc0,mS,Nc1,Dc1,q10,Ac1;var lS=o(()=>{A$();pQ();Qc0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Jc0=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:Qc0.optional()}),Ic0=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:Ic0.optional()}),k00=L.object({user:Jc0,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}),QO=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(QO),hasPendingDeletes:L.boolean().default(!1)}),Wc0=L.object({code:L.string().optional(),description:L.string(),scope:L.string(),strictness:L.string()}),JO=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:JO,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(),IO=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(IO).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(),KO=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(KO).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(KO).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(),U10=L.record(L.string(),L.unknown()),Y10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),z10=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(),Q10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),J10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),I10=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(),Oc0=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(Oc0).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(),Mc0=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:Mc0.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(),Nc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(mS).default([])}).passthrough(),Dc1=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(),Ac1=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 O1($,U){let Y=await $.json();return U.parse(Y.data??Y)}async function W8($){return O1(await $.get("api/v1/auth/me"),k00)}async function O10($){return O1(await $.get("api/auth/get-session"),x00)}async function p6($){return O1(await $.get("api/v1/rules"),f00)}async function hH($,U){return O1(await $.post("api/v1/rules",{json:U}),QO)}async function oS($,U,Y){return O1(await $.put(`api/v1/rules/${U}`,{json:Y}),QO)}async function mQ($,U){await $.delete(`api/v1/rules/${U}`)}async function XO($){let U=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),Y=await U.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:U.ok,status:U.status,body:Y})}async function B$($){return O1(await $.get("api/v1/rule-set-versions"),L.array(JO))}async function SH($,U){return O1(await $.get(`api/v1/rule-set-versions/${U}`),JO)}async function gH($,U){return O1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:U}}),u00)}async function _7($,U={}){let Y=new URLSearchParams;return Y.set("offset",String(U.offset??0)),Y.set("limit",String(U.limit??20)),Y.set("sortBy",U.sortBy??"createdAt"),Y.set("sortOrder",U.sortOrder??"desc"),U.scenarios?.forEach((z,Q)=>{Y.set(`filter[scenarios][${Q}]`,z)}),O1(await $.get("api/v1/knowledge/articles",{searchParams:Y}),b00)}async function M10($,U){return O1(await $.get(`api/v1/knowledge/articles/${U}`),RH)}async function ZO($,U){return O1(await $.post("api/v1/knowledge/articles",{json:{...U,contentType:U.contentType??"policy",status:U.status??"published",enabled:U.enabled??!0,scenarios:U.scenarios&&U.scenarios.length>0?U.scenarios:["audit"],tags:U.tags??[]}}),RH)}async function qO($,U,Y){let z=Object.fromEntries(Object.entries(Y).filter(([,Q])=>Q!==void 0));return O1(await $.patch(`api/v1/knowledge/articles/${U}`,{json:{attributes:z}}),RH)}async function VO($,U){return await $.delete(`api/v1/knowledge/articles/${U}`),{success:!0,id:U}}async function o1($,U="api/v1/agent/ai-approval/config"){return O1(await $.get(U),i00)}async function m5($,U,Y="api/v1/agent/ai-approval/config"){return await $.post(Y,{json:U}),o1($,Y)}async function rS($,U,Y="api/v1/agent/ai-approval/config"){let z=await $.post(Y,{json:U}),Q=await z.json().catch(()=>({})),J=WO.safeParse(Q.data??Q);return J.success?J.data.success??z.ok:z.ok}async function J$($,U="api/v1/agent/ai-approval/config"){let Y=await o1($,U);return sS(Y.integrations)}async function LO($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=sS(Q.integrations),I=j10(U,J,Y);if(!await rS($,{...Q,integrations:[...Q.integrations,I]},z))throw Error("Seal did not confirm saving the Webhook integration");return I}async function N10($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=sS(Q.integrations),I=j10(U,J,Y);return{before:Q,after:{...Q,integrations:[...Q.integrations,I]},integration:I}}async function D10($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=FO(Q.integrations),I=wO(J,U),K=E10(I.integration,Y);if(!await rS($,{...Q,integrations:Q.integrations.map((H,W)=>W===I.index?K:H)},z))throw Error("Seal did not confirm saving the Webhook integration");return K}async function A10($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=FO(Q.integrations),I=wO(J,U),K=E10(I.integration,Y);return{before:Q,after:{...Q,integrations:Q.integrations.map((G,H)=>H===I.index?K:G)},integration:K}}async function P10($,U,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y),Q=FO(z.integrations),J=wO(Q,U);if(!await rS($,{...z,integrations:z.integrations.filter((K,G)=>G!==J.index)},Y))throw Error("Seal did not confirm deleting the Webhook integration");return J.integration}async function B10($,U,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y),Q=FO(z.integrations),J=wO(Q,U);return{before:z,after:{...z,integrations:z.integrations.filter((I,K)=>K!==J.index)},integration:J.integration}}function v7($,U){let Y=U.trim();if(!Y)throw Error("Webhook selector must not be empty");let z=$.find((J)=>J.id===Y);if(z)return z;let Q=$.filter((J)=>J.name===Y);if(Q.length===1)return Q[0];if(Q.length>1)throw Error(`Multiple Webhook integrations match name: ${Y}. Use the integration ID.`);throw Error(`Webhook integration not found: ${Y}`)}function T10($,U){let Y=U?.trim().toLowerCase();if(!Y)return $;return $.filter((z)=>[z.id,z.name,z.mode,z.outgoingResultWebhook,z.incomingDocumentWebhook.url,z.incomingManualResultWebhook.url].some((Q)=>Q.toLowerCase().includes(Y)))}function sS($){return $.filter((U)=>U.type==="webhook").map((U)=>_H.parse(U))}function FO($){return $.flatMap((U,Y)=>{if(U.type!=="webhook")return[];return[{index:Y,integration:_H.parse(U)}]})}function wO($,U){let Y=v7($.map((z)=>z.integration),U);return $.find((z)=>z.integration.id===Y.id)}function j10($,U,Y){let z=vH(Y.name,"name"),Q=Y.mode??"assisted",J=R10(Y.outgoingResultWebhook,"outgoingResultWebhook"),I=_10(Y.autoApprovalRate??60),K=jc0(U),G=`wh_${K}_${F10(8).toString("hex").slice(0,7)}`,H=P$($);return _H.parse({type:"webhook",id:`integration-${K}`,name:z,mode:Q,incomingDocumentWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/document`},outgoingResultWebhook:J,incomingManualResultWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/manual-result`},secret:Y.secret?vH(Y.secret,"secret"):C10(),autoApprovalRate:I,materialPackFilePolicy:nQ(Y.materialPackFilePolicy)})}function E10($,U){return _H.parse({...$,...U.name===void 0?{}:{name:vH(U.name,"name")},...U.mode===void 0?{}:{mode:U.mode},...U.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:R10(U.outgoingResultWebhook,"outgoingResultWebhook")},...U.autoApprovalRate===void 0?{}:{autoApprovalRate:_10(U.autoApprovalRate)},...U.rotateSecret||U.secret!==void 0?{secret:U.rotateSecret?C10():vH(U.secret??"","secret")}:{},...U.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:g00($.materialPackFilePolicy,U.materialPackFilePolicy)}})}function jc0($){let U=new Set($.map((z)=>z.id)),Y=Date.now();while(U.has(`integration-${Y}`))Y+=1;return Y}function C10(){return F10(16).toString("hex")}function vH($,U){let Y=$.trim();if(!Y)throw Error(`Webhook ${U} must not be empty`);return Y}function R10($,U){let Y=vH($,U);try{return new URL(Y).toString()}catch{throw Error(`Webhook ${U} 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 OO($,U={}){let[Y,z,Q]=await Promise.all([p6($),_7($,{limit:U.documentLimit??50}),o1($,U.stylePreferencesEndpoint).then((J)=>({ok:!0,data:J}),(J)=>({ok:!1,error:J instanceof Error?J.message:String(J)}))]);return{rules:Y,documents:z,stylePreferences:Q}}async function b4($,U={}){let Y=new URLSearchParams;return Y.set("offset",String(U.offset??0)),Y.set("limit",String(U.limit??50)),c8(Y,"fromTimestamp",U.fromTimestamp),c8(Y,"toTimestamp",U.toTimestamp),c8(Y,"startDate",U.startDate),c8(Y,"endDate",U.endDate),V10(Y,"status",U.status),c8(Y,"sourceSystem",U.sourceSystem),c8(Y,"taskMode",U.taskMode),c8(Y,"search",U.search),c8(Y,"sourceDocumentSN",U.sourceDocumentSN),c8(Y,"sourceDocumentId",U.sourceDocumentId),V10(Y,"manualApprovalStatus",U.manualApprovalStatus),O1(await $.get("api/v1/approvals",{searchParams:Y}),iS)}async function H4($,U){return O1(await $.get(`api/v1/approvals/${U}`),IO)}async function aS($,U){let Y=await $.get(`api/v1/simulation/batch/${U}/records`).json(),z=Y.data??Y;if(Array.isArray(z))return L.array(IO).parse(z);return iS.parse(z).records}async function v10($,U){return O1(await $.post("api/v1/simulation/create-batch",{json:U}),dS)}async function h10($,U){return O1(await $.post("api/v1/simulation/create-material-pack-batch",{json:U}),dS)}async function S10($,U={}){let Y=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(U.limit??50)}}).json(),z=Y.data??Y;return L.array(pS).parse(z)}async function MO($,U){return O1(await $.get(`api/v1/simulation/batch/${U}`),pS)}async function g10($){let U=await $.get("api/v1/simulation/templates").json(),Y=U.data??U;return L.array(H10).parse(Y)}async function tS($){return O1(await $.get("api/v1/simulation/integration-status"),W10)}async function eS($){let U=await $.get("api/v1/simulation/hosecloud-integrations").json(),Y=U.data??U;return L.array(X10).parse(Y)}async function y10($,U){let z=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(U)}/data`)).json().catch(()=>({}));return z.data??z}async function k10($,U){let Y=U?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",z=U?new URLSearchParams({signKey:U}):void 0,Q=await $.get(Y,{searchParams:z}).json(),J=Q.data??Q;return L.array(q10).parse(J)}async function x10($,U){let Y=await $.post("api/hosecloud/corporation",{json:U}).json(),z=Y.data??Y;return L.object({corporationId:L.string()}).parse(z)}async function f10($,U){let z=await(await $.post("api/hosecloud/outbound-config/sync",{json:U})).json().catch(()=>({}));return z.data??z}async function u10($,U){let Y=new FormData;return Y.append("file",new Blob([new Uint8Array(U.fileBuffer)]),U.fileName),O1(await $.post("api/v1/material-packages/upload",{body:Y}),Z10)}function c8($,U,Y){if(Y)$.set(U,Y)}function V10($,U,Y){if(!Y)return;(Array.isArray(Y)?Y:[Y]).map((Q)=>Q.trim()).filter(Boolean).forEach((Q,J)=>{$.set(`${U}[${J}]`,Q)})}async function b10($){return O1(await $.get("api/v1/delegation/list"),L.array(c00))}async function dQ($,U){return O1(await $.post("api/v1/delegation/create",{json:U??{}}),n00)}async function i10($,U){let Y=await $.post("api/v1/delegation/revoke",{json:{tokenId:U}}),z=await Y.json(),Q=WO.safeParse(z.data??z);return Q.success?Q.data.success??Y.ok:Y.ok}async function c10($,U){let Y=U.departmentIds&&U.departmentIds.length>0?U.departmentIds:void 0;if(!Y){let z=await $.get("api/v1/contacts/departments/root/children").json(),Q=Bc0.safeParse(z.data??z),J=Q.success?Q.data.items?.[0]?._id:void 0;if(J)Y=[J]}return O1(await $.post("api/v1/contacts/local/users",{json:{name:U.name,phone:U.phone,permissions:U.permissions??[],departmentIds:Y??[]}}),p00)}async function $g($,U){return O1(await $.post(`api/v1/contacts/local/users/${U}/reset-password`,{json:{}}),d00)}async function GO($,U){return O1(await $.get(`api/v1/contacts/users/${U}`),KO)}async function HO($,U=""){return O1(await $.get("api/v1/contacts/search",{searchParams:{query:U}}),m00)}async function n10($){return O1(await $.get("api/v1/contacts/departments/root/children"),nS)}async function p10($,U){return O1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(U)}`),cS)}async function d10($,U){return O1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(U)}/children`),nS)}async function m10($,U){return O1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(U)}/users`),l00)}async function l10($){return O1(await $.get("api/v1/contacts/last-sync-time"),o00)}async function NO($,U={}){let Y=Ug(),z=new URLSearchParams;if(c8(z,"startDate",U.startDate??Y.startDate),c8(z,"endDate",U.endDate??Y.endDate),U.limit!==void 0)z.set("limit",String(U.limit));return O1(await $.get("api/v1/insight/stats",{searchParams:z}),r00)}async function DO($,U){let Y=Ug(),z=new URLSearchParams;return z.set("tagId",U.tagId),z.set("startDate",U.startDate??Y.startDate),z.set("endDate",U.endDate??Y.endDate),O1(await $.get("api/v1/insight/risks-by-tag",{searchParams:z}),s00)}async function AO($,U={}){let Y=Ug(),z=L10(U.startDate??Y.startDate),Q=L10(U.endDate??Y.endDate),J=new URLSearchParams;return J.set("startDate",String(z)),J.set("endDate",String(Q)),O1(await $.get("api/v1/insight/performance",{searchParams:J}),a00)}async function o10($,U){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(U)}`),{success:!0,recordId:U}}function L10($){if(typeof $==="number")return $<100000000000?$*1000:$;let U=Number($);if(!isNaN(U)&&$.trim()!=="")return U<100000000000?U*1000:U;let Y=new Date($);if(isNaN(Y.getTime()))throw Error(`Invalid date format: ${$}`);return Y.getTime()}function Ug(){let $=new Date,U=new Date($.getFullYear(),$.getMonth(),1),Y=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:U.toISOString(),endDate:Y.toISOString()}}function r10($){let U=new URLSearchParams;return c8(U,"filter[startDate]",$.startDate),c8(U,"filter[endDate]",$.endDate),c8(U,"filter[search]",$.search),U.set("offset",String($.offset??0)),U.set("limit",String($.limit??50)),U}async function s10($,U={}){return O1(await $.get("api/v1/expenses/list",{searchParams:r10(U)}),e00)}async function a10($,U={}){return O1(await $.get("api/v1/invoice/list",{searchParams:r10(U)}),$10)}async function t10($){return O1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(U10))}async function e10($,U){let Y=await $.delete(`api/v1/contacts/local/users/${U}`),z=await Y.json(),Q=WO.safeParse(z.data??z);return Q.success?Q.data.success??Y.ok:Y.ok}async function Yg($,U){let Y=await $.post(`api/v1/contacts/local/users/${U}/activate`,{json:{}}),z=await Y.json(),Q=WO.safeParse(z.data??z);return Q.success?Q.data.success??Y.ok:Y.ok}async function Ec0($,U){let Y=await $.post("api/auth/sms-otp/sign-in-password",{json:U}),z=Y.headers.get("set-auth-token"),Q=Tc0.parse(await Y.json()),J=z??Q.session?.token;if(!J)throw Error("Failed to retrieve authentication token from login response");return{token:J,user:Q.user}}async function $40($,U,Y,z){let Q;if(U.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(U.userIdOrPhone)){let q=await HO($,U.userIdOrPhone),V=q.users.find((F)=>F.mobile?.includes(U.userIdOrPhone)||F._id===U.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${U.userIdOrPhone}`);Q=V}else Q=await GO($,U.userIdOrPhone).catch(async()=>{let q=await HO($,U.userIdOrPhone),V=q.users.find((F)=>F.name===U.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${U.userIdOrPhone}`);return V});if(Q.status==="resigned")await Yg($,Q._id),Q=await GO($,Q._id);let J=Q,I=Array.isArray(J.identities)&&J.identities.some((q)=>q.provider&&q.provider!=="local")||!!J.apps?.hosecloud;if(I&&z&&z.source.type==="hose"){let V=(Q.mobile||J.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=J.identities?.find((w)=>w.provider==="hosecloud")?.providerId,O=J.apps?.hosecloud?.boundId||F||(V?`${z.source.corpId}:${V}`:void 0);if(O){let w=await iQ(z),N=(await $O({...z.source,staffId:O},w)).token,D=R7(z,z.source),B=A6(z.seal),T=T8(D,void 0,B),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:N,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${Q.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let j=A.token??A.accessToken??A.data?.token;if(j){let C=await Y(j),b=await dQ(C,{note:U.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:b,temporaryPassword:"N/A (Hose SSO)"}}}}let K;try{K=await $g($,Q._id)}catch(q){if(I)throw Error(`用户 "${Q.name}" (${Q.mobile||Q._id}) 为合思同步账号 (provider: hosecloud),无 Seal 本地密码。`+"Seal 系统暂不支持对同步账号直接重置本地密码。");throw q}let H=(Q.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,"");if(!H)throw Error(`User ${Q.name} has no associated phone number for password login`);let{token:W}=await Ec0($,{phone:H,password:K.password}),X=await Y(W),Z=await dQ(X,{note:U.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:Z,temporaryPassword:K.password}}async function U40($){return O1(await $.get("api/v1/llm/config"),Y10)}async function Y40($){return O1(await $.get("api/v1/llm/providers"),L.array(z10))}async function z40($){return O1(await $.get("api/v1/permissions/available"),Q10)}async function Q40($){return O1(await $.get("api/v1/permissions/configs"),J10)}async function cU($){return O1(await $.get("api/v1/billing/status"),I10)}async function J40($){let Y=await(await $.get("api/v1/billing/plans")).json();return w10.parse(Y.data??Y)}async function I40($){let Y=await(await $.get("api/v1/billing/features")).json();return w10.parse(Y.data??Y)}var WO,Bc0,Tc0,w10;var X6=o(()=>{uQ();A$();pQ();a9();i8();lS();WO=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 U6=E((Pn1,G40)=>{var{toString:K40}=Object.prototype,Cc0=/["&<>]/,e9={each:function(U,Y){if(U)if(Array.isArray(U))U.forEach(Y);else Object.keys(U).forEach((z)=>{Y(U[z],z)})},some:function(U,Y){if(U){if(Array.isArray(U))return U.some(Y);return Object.keys(U).some((z)=>Y(U[z],z))}return!1},every:function(U,Y){if(U){if(Array.isArray(U))return U.every(Y);return Object.keys(U).every((z)=>Y(U[z],z))}return!0},map:function(U,Y){if(U){if(Array.isArray(U))return U.map(Y);return Object.keys(U).map((z)=>Y(U[z],z))}return[]},keyBy($,U){return $.reduce((Y,z)=>{return Y[z[U]]=z,Y},{})},isEqual:function(U,Y){let z=typeof U,Q=typeof Y,J=Array.isArray(U),I=Array.isArray(Y),K;if(z!==Q)return!1;switch(typeof U){case"object":if(J||I){if(J&&I)return U.length===Y.length&&U.every((G,H)=>{let W=Y[H];return e9.isEqual(G,W)});return!1}if(U===null||Y===null)return U===Y;if(K=Object.keys(U),Object.keys(Y).length!==K.length)return!1;for(let G of K)if(!Y.hasOwnProperty(G))return!1;return e9.every(U,(G,H)=>{let W=Y[H];return e9.isEqual(G,W)});default:return U===Y}},escapeHtml($){let U=Cc0.exec($);if(!U)return $;let Y="",z="",Q=0,J=U.index;for(;J<$.length;J++){switch($.charAt(J)){case'"':z=""";break;case"&":z="&";break;case"'":z="'";break;case"<":z="<";break;case">":z=">";break;default:continue}if(Q!==J)Y+=$.substring(Q,J);Q=J+1,Y+=z}if(Q!==J)return Y+$.substring(Q,J);return Y},strcmp($,U){if($U)return 1;return 0},isUndefined($){return K40.call($)==="[object Undefined]"},isObject($){return K40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:U}=arguments,Y,z,Q;function J(I,K){if(Y=$[K],Q=Array.isArray(I),e9.isObject(I)||Q){if(Q)Q=!1,z=Y&&Array.isArray(Y)?Y:[];else z=Y&&e9.isObject(Y)?Y:{};$[K]=e9.deepMerge(z,I)}else if(!e9.isUndefined(I))$[K]=I}for(let I=0;I{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 U,Y,z,Q,J,I=1;if($>=4)throw Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&$>=1){while(I<=26)U=this._dictionary[I-1],this._n2l[I]=U,this._l2n[U]=I,I++;this._l2nFill=1}if(this._l2nFill<2&&$>=2){I=27;while(I<=702)Y=I-27,z=Y%26,Q=Math.floor(Y/26),U=this._dictionary[Q]+this._dictionary[z],this._n2l[I]=U,this._l2n[U]=I,I++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){I=703;while(I<=16384)Y=I-703,z=Y%26,Q=Math.floor(Y/26)%26,J=Math.floor(Y/676),U=this._dictionary[J]+this._dictionary[Q]+this._dictionary[z],this._n2l[I]=U,this._l2n[U]=I,I++;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 U=$.length<5&&this._hash[$];if(U)return U;let Y=!1,z="",Q=0,J=!1,I="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!J&&W>=65&&W<=90)Y=!0,z+=$[H],Q=Q*26+W-64;else if(W>=48&&W<=57)J=!0,I+=$[H],K=K*10+W-48;else if(J&&Y&&W!==36)break;if(!Y)Q=void 0;else if(Q>16384)throw Error(`Out of bounds. Invalid column letter: ${z}`);if(!J)K=void 0;$=z+I;let G={address:$,col:Q,row:K,$col$row:`$${z}$${I}`};if(Q<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,U){if(U){let Y=this.n2l(U)+$;return this.decodeAddress(Y)}return this.decodeAddress($)},decode($){let U=$.split(":");if(U.length===2){let Y=this.decodeAddress(U[0]),z=this.decodeAddress(U[1]),Q={top:Math.min(Y.row,z.row),left:Math.min(Y.col,z.col),bottom:Math.max(Y.row,z.row),right:Math.max(Y.col,z.col)};return Q.tl=this.n2l(Q.left)+Q.top,Q.br=this.n2l(Q.right)+Q.bottom,Q.dimensions=`${Q.tl}:${Q.br}`,Q}return this.decodeAddress($)},decodeEx($){let U=$.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),Y=U[1]||U[2],z=U[3],Q=z.split(":");if(Q.length>1){let I=this.decodeAddress(Q[0]),K=this.decodeAddress(Q[1]),G=Math.min(I.row,K.row),H=Math.min(I.col,K.col),W=Math.max(I.row,K.row),X=Math.max(I.col,K.col);return I=this.n2l(H)+G,K=this.n2l(X)+W,{top:G,left:H,bottom:W,right:X,sheetName:Y,tl:{address:I,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:Y},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:Y},dimensions:`${I}:${K}`}}if(z.startsWith("#"))return Y?{sheetName:Y,error:z}:{error:z};let J=this.decodeAddress(z);return Y?{sheetName:Y,...J}:J},encodeAddress($,U){return yH.n2l(U)+$},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($,U){let[Y,z,,Q,J]=$,[I,K]=U;return I>=Y&&I<=Q&&K>=z&&K<=J}};H40.exports=yH});var $3=E((Tn1,W40)=>{var l5=i4();class zg{constructor(){this.decode(arguments)}setTLBR($,U,Y,z,Q){if(arguments.length<4){let J=l5.decodeAddress($),I=l5.decodeAddress(U);this.model={top:Math.min(J.row,I.row),left:Math.min(J.col,I.col),bottom:Math.max(J.row,I.row),right:Math.max(J.col,I.col),sheetName:Y},this.setTLBR(J.row,J.col,I.row,I.col,Q)}else this.model={top:Math.min($,Y),left:Math.min(U,z),bottom:Math.max($,Y),right:Math.max(U,z),sheetName:Q}}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 U=$[0];if(U instanceof zg)this.model={top:U.model.top,left:U.model.left,bottom:U.model.bottom,right:U.model.right,sheetName:U.sheetName};else if(U instanceof Array)this.decode(U);else if(U.top&&U.left&&U.bottom&&U.right)this.model={top:U.top,left:U.left,bottom:U.bottom,right:U.right,sheetName:U.sheetName};else{let Y=l5.decodeEx(U);if(Y.top)this.model={top:Y.top,left:Y.left,bottom:Y.bottom,right:Y.right,sheetName:Y.sheetName};else this.model={top:Y.row,left:Y.col,bottom:Y.row,right:Y.col,sheetName:Y.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($,U,Y,z){if(!this.model.top||$this.bottom)this.bottom=Y;if(!this.model.right||z>this.right)this.right=z}expandRow($){if($){let{dimensions:U,number:Y}=$;if(U)this.expand(Y,U.min,Y,U.max)}}expandToAddress($){let U=l5.decodeEx($);this.expand(U.row,U.col,U.row,U.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 U=l5.decodeEx($);return this.containsEx(U)}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 U=this.left;U<=this.right;U++)for(let Y=this.top;Y<=this.bottom;Y++)$(l5.encodeAddress(Y,U),Y,U)}}W40.exports=zg});var G5=E((jn1,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((En1,Z40)=>{var PO=i4(),_c0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,vc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function hc0($,U,Y){let z=PO.decode(U),Q=PO.decode(Y);return $.replace(_c0,(J,I,K,G,H)=>{if(H)return J;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 J;let F=PO.l2n(Z),O=parseInt(V,10);if(!X)F+=Q.col-z.col;if(!q)O+=Q.row-z.row;return(I||"")+(X||"")+PO.n2l(F)+(q||"")+O}return J})}Z40.exports={slideFormula:hc0}});var L40=E((Cn1,V40)=>{var Sc0=U6();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:U}=$,{texts:Y}=U;if(Y.length===1&&Object.keys(Y[0]).length===1)this.note=Y[0].text;else this.note=U}static fromModel($){let U=new kH;return U.model=$,U}}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((Rn1,R40)=>{var gc0=i4(),yc0=U6(),H5=G5(),{slideFormula:kc0}=q40(),F40=L40();class d0{constructor($,U,Y){if(!$||!U)throw Error("A Cell needs a Row");this._row=$,this._column=U,gc0.validateAddress(Y),this._address=Y,this._value=h7.create(d0.Types.Null,this),this.style=this._mergeStyle($.style,U.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($,U,Y){let z=$&&$.numFmt||U&&U.numFmt;if(z)Y.numFmt=z;let Q=$&&$.font||U&&U.font;if(Q)Y.font=Q;let J=$&&$.alignment||U&&U.alignment;if(J)Y.alignment=J;let I=$&&$.border||U&&U.border;if(I)Y.border=I;let K=$&&$.fill||U&&U.fill;if(K)Y.fill=K;let G=$&&$.protection||U&&U.protection;if(G)Y.protection=G;return Y}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($,U){if(this._value.release(),this._value=h7.create(d0.Types.Merge,this,$),!U)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:U}=this.workbook;U.removeAllNames(this.fullAddress),$.forEach((Y)=>{U.addEx(this.fullAddress,Y)})}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 O40{constructor($,U){this.model={address:$.address,type:d0.Types.Number,value:U}}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 M40{constructor($,U){this.model={address:$.address,type:d0.Types.String,value:U}}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($,U){this.model={address:$.address,type:d0.Types.String,value:U}}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($,U){this.model={address:$.address,type:d0.Types.Date,value:U}}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($,U){if(this.model={address:$.address,type:d0.Types.Hyperlink,text:U?U.text:void 0,hyperlink:U?U.hyperlink:void 0},U&&U.tooltip)this.model.tooltip=U.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($,U){if(this.model={address:$.address,type:d0.Types.Merge,master:U?U.address:void 0},this._master=U,U)U.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($,U){this.cell=$,this.model={address:$.address,type:d0.Types.Formula,shareType:U?U.shareType:void 0,ref:U?U.ref:void 0,formula:U?U.formula:void 0,sharedFormula:U?U.sharedFormula:void 0,result:U?U.result:void 0}}_copyModel($){let U={},Y=(z)=>{let Q=$[z];if(Q)U[z]=Q};return Y("formula"),Y("result"),Y("ref"),Y("shareType"),Y("sharedFormula"),U}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),U=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:U}}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,U=$.findCell(this.model.sharedFormula);this._translatedFormula=U&&kc0(U.formula,U.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($,U){this.model={address:$.address,type:d0.Types.SharedString,value:U}}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($,U){this.model={address:$.address,type:d0.Types.Boolean,value:U}}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($,U){this.model={address:$.address,type:d0.Types.Error,value:U}}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($,U){this.model={address:$.address,type:d0.Types.String,value:JSON.stringify(U),rawValue:U}}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:O40},{t:d0.Types.String,f:M40},{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(($,U)=>{return $[U.t]=U.f,$},[]),create($,U,Y){let z=this.types[$];if(!z)throw Error(`Could not create Value of type ${$}`);return new z(U,Y)}};R40.exports=d0});var TO=E((_n1,S40)=>{var xc0=U6(),BO=G5(),nU=i4(),v40=_40();class h40{constructor($,U){this._worksheet=$,this._number=U,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 U=this._cells[$.col-1];if(!U){let Y=this._worksheet.getColumn($.col);U=new v40(this,Y,$.address),this._cells[$.col-1]=U}return U}getCell($){if(typeof $==="string"){let U=this._worksheet.getColumnKey($);if(U)$=U.number;else $=nU.l2n($)}return this._cells[$-1]||this.getCellEx({address:nU.encodeAddress(this._number,$),row:this._number,col:$})}splice($,U,...Y){let z=$+U,Q=Y.length-U,J=this._cells.length,I,K,G;if(Q<0){for(I=$+Y.length;I<=J;I++)if(G=this._cells[I-1],K=this._cells[I-Q-1],K)G=this.getCell(I),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(Q>0)for(I=J;I>=z;I--)if(K=this._cells[I-1],K)G=this.getCell(I+Q),G.value=K.value,G.style=K.style,G._comment=K._comment;else this._cells[I+Q-1]=void 0;for(I=0;I{if(Y&&Y.type!==BO.ValueType.Null)U(Y,z+1)})}addPageBreak($,U){let Y=this._worksheet,z=Math.max(0,$-1)||0,Q=Math.max(0,U-1)||16838,J={id:this._number,max:Q,man:1};if(z)J.min=z;Y.rowBreaks.push(J)}get values(){let $=[];return this._cells.forEach((U)=>{if(U&&U.type!==BO.ValueType.Null)$[U.col]=U.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let U=0;if($.hasOwnProperty("0"))U=1;$.forEach((Y,z)=>{if(Y!==void 0)this.getCellEx({address:nU.encodeAddress(this._number,z+U),row:this._number,col:z+U}).value=Y})}else this._worksheet.eachColumnKey((U,Y)=>{if($[Y]!==void 0)this.getCellEx({address:nU.encodeAddress(this._number,U.number),row:this._number,col:U.number}).value=$[Y]})}get hasValues(){return xc0.some(this._cells,($)=>$&&$.type!==BO.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let $=0;return this.eachCell(()=>{$++}),$}get dimensions(){let $=0,U=0;return this._cells.forEach((Y)=>{if(Y&&Y.type!==BO.ValueType.Null){if(!$||$>Y.col)$=Y.col;if(U0?{min:$,max:U}:null}_applyStyle($,U){return this.style[$]=U,this._cells.forEach((Y)=>{if(Y)Y[$]=U}),U}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 $=[],U=0,Y=0;return this._cells.forEach((z)=>{if(z){let Q=z.model;if(Q){if(!U||U>z.col)U=z.col;if(Y{switch(Y.type){case v40.Types.Merge:break;default:{let z;if(Y.address)z=nU.decodeAddress(Y.address);else if(U){let{row:J}=U,I=U.col+1;z={row:J,col:I,address:nU.encodeAddress(J,I),$col$row:`$${nU.n2l(I)}$${J}`}}U=z;let Q=this.getCellEx(z);Q.model=Y;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 EO=E((vn1,g40)=>{var fc0=U6(),uc0=G5(),bc0=i4();class jO{constructor($,U,Y){if(this._worksheet=$,this._number=U,Y!==!1)this.defn=Y}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((U,Y)=>{this._worksheet.getCell(Y+1,this.number).value=U});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($,U){let Y=this.number;if(!U)U=$,$=null;this._worksheet.eachRow($,(z,Q)=>{U(z.getCell(Y),Q)})}get values(){let $=[];return this.eachCell((U,Y)=>{if(U&&U.type!==uc0.ValueType.Null)$[Y]=U.value}),$}set values($){if(!$)return;let U=this.number,Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((z,Q)=>{this._worksheet.getCell(Q+Y,U).value=z})}_applyStyle($,U){return this.style[$]=U,this.eachCell((Y)=>{Y[$]=U}),U}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 U=[],Y=null;if($)$.forEach((z,Q)=>{if(z.isDefault){if(Y)Y=null}else if(!Y||!z.equivalentTo(Y))Y={min:Q+1,max:Q+1,width:z.width!==void 0?z.width:9,style:z.style,isCustomWidth:z.isCustomWidth,hidden:z.hidden,outlineLevel:z.outlineLevel,collapsed:z.collapsed},U.push(Y);else Y.max=Q+1});return U.length?U:void 0}static fromModel($,U){U=U||[];let Y=[],z=1,Q=0;U=U.sort(function(J,I){return J.min-I.min});while(Q{var ic0=i4();class CO{constructor($,U,Y=0){if(this.worksheet=$,!U)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof U==="string"){let z=ic0.decodeAddress(U);this.nativeCol=z.col+Y,this.nativeColOff=0,this.nativeRow=z.row+Y,this.nativeRowOff=0}else if(U.nativeCol!==void 0)this.nativeCol=U.nativeCol||0,this.nativeColOff=U.nativeColOff||0,this.nativeRow=U.nativeRow||0,this.nativeRowOff=U.nativeRowOff||0;else if(U.col!==void 0)this.col=U.col+Y,this.row=U.row+Y;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof CO||$==null?$:new CO($)}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=CO});var u40=E((Sn1,f40)=>{var cc0=i4(),RO=k40();class x40{constructor($,U){this.worksheet=$,this.model=U}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:U,range:Y,hyperlinks:z}){if(this.type=$,this.imageId=U,$==="image")if(typeof Y==="string"){let Q=cc0.decode(Y);this.range={tl:new RO(this.worksheet,{col:Q.left,row:Q.top},-1),br:new RO(this.worksheet,{col:Q.right,row:Q.bottom},0),editAs:"oneCell"}}else this.range={tl:new RO(this.worksheet,Y.tl,0),br:Y.br&&new RO(this.worksheet,Y.br,0),ext:Y.ext,editAs:Y.editAs,hyperlinks:z||Y.hyperlinks}}}f40.exports=x40});var n40=E((gn1,c40)=>{var _O=i4();class b40{constructor($,U,Y){this.table=$,this.column=U,this.index=Y}_set($,U){this.table.cacheState(),this.column[$]=U}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($,U){if(this.worksheet=$,U)this.table=U,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,U=(G,H,W)=>{if(G[H]===void 0)G[H]=W};U($,"headerRow",!0),U($,"totalsRow",!1),U($,"style",{}),U($.style,"theme","TableStyleMedium2"),U($.style,"showFirstColumn",!1),U($.style,"showLastColumn",!1),U($.style,"showRowStripes",!1),U($.style,"showColumnStripes",!1);let Y=(G,H)=>{if(!G)throw Error(H)};Y($.ref,"Table must have ref"),Y($.columns,"Table must have column definitions"),Y($.rows,"Table must have row definitions"),$.tl=_O.decodeAddress($.ref);let{row:z,col:Q}=$.tl;Y(z>0,"Table must be on valid row"),Y(Q>0,"Table must be on valid col");let{width:J,filterHeight:I,tableHeight:K}=this;$.autoFilterRef=_O.encode(z,Q,z+I-1,Q+J-1),$.tableRef=_O.encode(z,Q,z+K-1,Q+J-1),$.columns.forEach((G,H)=>{if(Y(G.name,`Column ${H} must have a name`),H===0)U(G,"totalsRowLabel","Total");else U(G,"totalsRowFunction","none"),G.totalsRowFormula=this.getFormula(G)})}store(){let $=(I,K)=>{if(K)Object.keys(K).forEach((G)=>{I[G]=K[G]})},{worksheet:U,table:Y}=this,{row:z,col:Q}=Y.tl,J=0;if(Y.headerRow){let I=U.getRow(z+J++);Y.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=I.getCell(Q+G);X.value=W,$(X,H)})}if(Y.rows.forEach((I)=>{let K=U.getRow(z+J++);I.forEach((G,H)=>{let W=K.getCell(Q+H);W.value=G,$(W,Y.columns[H].style)})}),Y.totalsRow){let I=U.getRow(z+J++);Y.columns.forEach((K,G)=>{let H=I.getCell(Q+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:U}=this,{row:Y,col:z}=U.tl,Q=0;if(U.headerRow){let J=$.getRow(Y+Q++);U.columns.forEach((I,K)=>{let G=J.getCell(z+K);G.value=I.name})}if(U.rows.forEach((J)=>{let I=$.getRow(Y+Q++);J.forEach((K,G)=>{let H=I.getCell(z+G);H.value=K})}),U.totalsRow){let J=$.getRow(Y+Q++);U.columns.forEach((I,K)=>{let G=J.getCell(z+K);if(K===0)G.value=I.totalsRowLabel;else if(this.getFormula(I))G.value={formula:I.totalsRowFormula,result:I.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 $=_O.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let U=0;U{z.push(U[Q])});else this.table.columns.splice(Y,0,$),this.table.rows.forEach((z,Q)=>{z.splice(Y,0,U[Q])})}removeColumns($,U=1){this.cacheState(),this.table.columns.splice($,U),this.table.rows.forEach((Y)=>{Y.splice($,U)})}_assign($,U,Y){this.cacheState(),$[U]=Y}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 Qg=E((yn1,d40)=>{class p40{constructor($){this.model=$||{}}add($,U){return this.model[$]=U}find($){return this.model[$]}remove($){this.model[$]=void 0}}d40.exports=p40});var Ig=E((kn1,m40)=>{var Jg=I0("crypto"),nc0={hash($,...U){let Y=Jg.createHash($);return Y.update(Buffer.concat(U)),Y.digest()},convertPasswordToHash($,U,Y,z){if(U=U.toLowerCase(),Jg.getHashes().indexOf(U)<0)throw Error(`Hash algorithm '${U}' not supported!`);let J=Buffer.from($,"utf16le"),I=this.hash(U,Buffer.from(Y,"base64"),J);for(let K=0;K{var l40=($,U)=>({...$,...U.reduce((Y,z)=>{if($[z])Y[z]={...$[z]};return Y},{})}),o5=($,U,Y,z=[])=>{if($[Y])U[Y]=l40($[Y],z)},pc0=($)=>Object.keys($).length===0,dc0=($)=>{if(!$)return $;if(pc0($))return{};let U={...$};if(o5($,U,"font",["color"]),o5($,U,"alignment"),o5($,U,"protection"),$.border)o5($,U,"border"),o5($.border,U.border,"top",["color"]),o5($.border,U.border,"left",["color"]),o5($.border,U.border,"bottom",["color"]),o5($.border,U.border,"right",["color"]),o5($.border,U.border,"diagonal",["color"]);if($.fill){if(o5($,U,"fill",["fgColor","bgColor","center"]),$.fill.stops)U.fill.stops=$.fill.stops.map((Y)=>l40(Y,["color"]))}return U};mc0.copyStyle=dc0});var Y60=E((fn1,U60)=>{var xH=U6(),fH=i4(),uH=$3(),r40=TO(),vO=EO(),oc0=G5(),Kg=u40(),s40=n40(),a40=Qg(),t40=Ig(),{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((U)=>U&&U.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((U)=>{if(U){let Y=U.dimensions;if(Y)$.expand(U.number,Y.min,U.number,Y.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((z,Q)=>{let J=Q.header&&1||Q.headers&&Q.headers.length||0;return Math.max(z,J)},0);let U=1,Y=this._columns=[];$.forEach((z)=>{let Q=new vO(this,U++,!1);Y.push(Q),Q.defn=z})}getColumnKey($){return this._keys[$]}setColumnKey($,U){this._keys[$]=U}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){xH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let U=this._keys[$];if(U)return U;$=fH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let U=this._columns.length+1;while(U<=$)this._columns.push(new vO(this,U++))}return this._columns[$-1]}spliceColumns($,U,...Y){let Q=this._rows.length;if(Y.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($,U)});let J=Y.length-U,I=$+U,K=this._columns.length;if(J<0)for(let G=$+Y.length;G<=K;G++)this.getColumn(G).defn=this.getColumn(G-J).defn;else if(J>0)for(let G=K;G>=I;G--)this.getColumn(G+J).defn=this.getColumn(G).defn;for(let G=$;G<$+Y.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,U,Y.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let $=0;return this.eachRow((U)=>{$=Math.max($,U.cellCount)}),$}get actualColumnCount(){let $=[],U=0;return this.eachRow((Y)=>{Y.eachCell(({col:z})=>{if(!$[z])$[z]=!0,U++})}),U}_commitRow(){}get _lastRowNumber(){let $=this._rows,U=$.length;while(U>0&&$[U-1]===void 0)U--;return U}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($,U){return this._rows.slice($-1,$-1+U)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let $=0;return this.eachRow(()=>{$++}),$}getRow($){let U=this._rows[$-1];if(!U)U=this._rows[$-1]=new r40(this,$);return U}getRows($,U){if(U<1)return;let Y=[];for(let z=$;z<$+U;z++)Y.push(this.getRow(z));return Y}addRow($,U="n"){let Y=this._nextRow,z=this.getRow(Y);return z.values=$,this._setStyleOption(Y,U[0]==="i"?U:"n"),z}addRows($,U="n"){let Y=[];return $.forEach((z)=>{Y.push(this.addRow(z,U))}),Y}insertRow($,U,Y="n"){return this.spliceRows($,0,U),this._setStyleOption($,Y),this.getRow($)}insertRows($,U,Y="n"){if(this.spliceRows($,0,...U),Y!=="n"){for(let z=0;z{Q.getCell(I).style=e40(J.style)}),Q.height=z.height}duplicateRow($,U,Y=!1){let z=this._rows[$-1],Q=Array(U).fill(z.values);this.spliceRows($+1,Y?0:U,...Q);for(let J=0;J{I.getCell(G).style=K.style})}}spliceRows($,U,...Y){let z=$+U,Q=Y.length,J=Q-U,I=this._rows.length,K,G;if(J<0){if($===I)this._rows[I-1]=void 0;for(K=z;K<=I;K++)if(G=this._rows[K-1],G){let H=this.getRow(K+J);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+J-1]=void 0}else if(J>0)for(K=I;K>=z;K--)if(G=this._rows[K-1],G){let H=this.getRow(K+J);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+Q).getCell(X),q=W._value._master,V=this.getRow(q._row._number+Q).getCell(q._column._number);Z.merge(V)}})}else this._rows[K+J-1]=void 0;for(K=0;K{if(Y&&Y.hasValues)U(Y,Y.number)})}getSheetValues(){let $=[];return this._rows.forEach((U)=>{if(U)$[U.number]=U.values}),$}findCell($,U){let Y=fH.getAddress($,U),z=this._rows[Y.row-1];return z?z.findCell(Y.col):void 0}getCell($,U){let Y=fH.getAddress($,U);return this.getRow(Y.row).getCellEx(Y)}mergeCells(...$){let U=new uH($);this._mergeCellsInternal(U)}mergeCellsWithoutStyle(...$){let U=new uH($);this._mergeCellsInternal(U,!0)}_mergeCellsInternal($,U){xH.each(this._merges,(z)=>{if(z.intersects($))throw Error("Cannot merge already merged cells")});let Y=this.getCell($.top,$.left);for(let z=$.top;z<=$.bottom;z++)for(let Q=$.left;Q<=$.right;Q++)if(z>$.top||Q>$.left)this.getCell(z,Q).merge(Y,U);this._merges[Y.address]=$}_unMergeMaster($){let U=this._merges[$.address];if(U){for(let Y=U.top;Y<=U.bottom;Y++)for(let z=U.left;z<=U.right;z++)this.getCell(Y,z).unmerge();delete this._merges[$.address]}}get hasMerges(){return xH.some(this._merges,Boolean)}unMergeCells(...$){let U=new uH($);for(let Y=U.top;Y<=U.bottom;Y++)for(let z=U.left;z<=U.right;z++){let Q=this.findCell(Y,z);if(Q){if(Q.type===oc0.ValueType.Merge)this._unMergeMaster(Q.master);else if(this._merges[Q.address])this._unMergeMaster(Q)}}}fillFormula($,U,Y,z="shared"){let Q=fH.decode($),{top:J,left:I,bottom:K,right:G}=Q,H=G-I+1,W=fH.encodeAddress(J,I),X=z==="shared",Z;if(typeof Y==="function")Z=Y;else if(Array.isArray(Y))if(Array.isArray(Y[0]))Z=(V,F)=>Y[V-J][F-I];else Z=(V,F)=>Y[(V-J)*H+(F-I)];else Z=()=>{return};let q=!0;for(let V=J;V<=K;V++)for(let F=I;F<=G;F++)if(q)this.getCell(V,F).value={shareType:z,formula:U,ref:$,result:Z(V,F)},q=!1;else this.getCell(V,F).value=X?{sharedFormula:W,result:Z(V,F)}:Z(V,F)}addImage($,U){let Y={type:"image",imageId:$,range:U};this._media.push(new Kg(this,Y))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let U={type:"background",imageId:$};this._media.push(new Kg(this,U))}getBackgroundImageId(){let $=this._media.find((U)=>U.type==="background");return $&&$.imageId}protect($,U){return new Promise((Y)=>{if(this.sheetProtection={sheet:!0},U&&"spinCount"in U)U.spinCount=Number.isFinite(U.spinCount)?Math.round(Math.max(0,U.spinCount)):1e5;if($)this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=t40.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=U&&"spinCount"in U?U.spinCount:1e5,this.sheetProtection.hashValue=t40.convertPasswordToHash($,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount);if(U){if(this.sheetProtection=Object.assign(this.sheetProtection,U),!$&&"spinCount"in U)delete this.sheetProtection.spinCount}Y()})}unprotect(){this.sheetProtection=null}addTable($){let U=new s40(this,$);return this.tables[$.name]=U,U}getTable($){return this.tables[$]}removeTable($){delete this.tables[$]}getTables(){return Object.values(this.tables)}addConditionalFormatting($){this.conditionalFormattings.push($)}removeConditionalFormatting($){if(typeof $==="number")this.conditionalFormattings.splice($,1);else if($ instanceof Function)this.conditionalFormattings=this.conditionalFormattings.filter($);else this.conditionalFormattings=[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor($){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=$}get model(){let $={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((z)=>z.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((z)=>z.model),conditionalFormattings:this.conditionalFormattings};$.cols=vO.toModel(this.columns);let U=$.rows=[],Y=$.dimensions=new uH;return this._rows.forEach((z)=>{let Q=z&&z.model;if(Q)Y.expand(Q.number,Q.min,Q.number,Q.max),U.push(Q)}),$.merges=[],xH.each(this._merges,(z)=>{$.merges.push(z.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((U)=>{let Y=new r40(this,U.number);this._rows[Y.number-1]=Y,Y.model=U})}_parseMergeCells($){xH.each($.mergeCells,(U)=>{this.mergeCellsWithoutStyle(U)})}set model($){this.name=$.name,this._columns=vO.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((U)=>new Kg(this,U)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((U,Y)=>{let z=new s40;return z.model=Y,U[Y.name]=z,U},{}),this.conditionalFormattings=$.conditionalFormattings}}U60.exports=$60});var I60=E((un1,J60)=>{var z60=U6(),hO=i4();class Q60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(hO.decodeEx($))}getCell($){return this.findCellEx(hO.decodeEx($),!0)}findCell($){return this.findCellEx(hO.decodeEx($),!1)}findCellAt($,U,Y){let z=this.sheets[$],Q=z&&z[U];return Q&&Q[Y]}addCellEx($){if($.top)for(let U=$.top;U<=$.bottom;U++)for(let Y=$.left;Y<=$.right;Y++)this.getCellAt($.sheetName,U,Y);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,U){let Y=this.findSheet($,U),z=this.findSheetRow(Y,$,U);return this.findRowCell(z,$,U)}getCellAt($,U,Y){let z=this.sheets[$]||(this.sheets[$]=[]),Q=z[U]||(z[U]=[]);return Q[Y]||(Q[Y]={sheetName:$,address:hO.n2l(Y)+U,row:U,col:Y})}removeCellEx($){let U=this.findSheet($);if(!U)return;let Y=this.findSheetRow(U,$);if(!Y)return;delete Y[$.col]}forEachInSheet($,U){let Y=this.sheets[$];if(Y)Y.forEach((z,Q)=>{if(z)z.forEach((J,I)=>{if(J)U(J,Q,I)})})}forEach($){z60.each(this.sheets,(U,Y)=>{this.forEachInSheet(Y,$)})}map($){let U=[];return this.forEach((Y)=>{U.push($(Y))}),U}findSheet($,U){let Y=$.sheetName;if(this.sheets[Y])return this.sheets[Y];if(U)return this.sheets[Y]=[];return}findSheetRow($,U,Y){let{row:z}=U;if($&&$[z])return $[z];if(Y)return $[z]=[];return}findRowCell($,U,Y){let{col:z}=U;if($&&$[z])return $[z];if(Y)return $[z]=this.template?Object.assign(U,JSON.parse(JSON.stringify(this.template))):U;return}spliceRows($,U,Y,z){let Q=this.sheets[$];if(Q){let J=[];for(let I=0;I{I.splice(U,Y,...J)})}}}J60.exports=Q60});var Gg=E((bn1,H60)=>{var lQ=U6(),bH=i4(),K60=I60(),rc0=$3(),sc0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class G60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new K60)}add($,U){let Y=bH.decodeEx($);this.addEx(Y,U)}addEx($,U){let Y=this.getMatrix(U);if($.top)for(let z=$.left;z<=$.right;z++)for(let Q=$.top;Q<=$.bottom;Q++){let J={sheetName:$.sheetName,address:bH.n2l(z)+Q,row:Q,col:z};Y.addCellEx(J)}else Y.addCellEx($)}remove($,U){let Y=bH.decodeEx($);this.removeEx(Y,U)}removeEx($,U){this.getMatrix(U).removeCellEx($)}removeAllNames($){lQ.each(this.matrixMap,(U)=>{U.removeCellEx($)})}forEach($){lQ.each(this.matrixMap,(U,Y)=>{U.forEach((z)=>{$(Y,z)})})}getNames($){return this.getNamesEx(bH.decodeEx($))}getNamesEx($){return lQ.map(this.matrixMap,(U,Y)=>U.findCellEx($)&&Y).filter(Boolean)}_explore($,U){U.mark=!1;let{sheetName:Y}=U,z=new rc0(U.row,U.col,U.row,U.col,Y),Q,J;function I(G,H){let W=$.findCellAt(Y,G,U.col);if(!W||!W.mark)return!1;return z[H]=G,W.mark=!1,!0}for(J=U.row-1;I(J,"top");J--);for(J=U.row+1;I(J,"bottom");J++);function K(G,H){let W=[];for(J=z.top;J<=z.bottom;J++){let X=$.findCellAt(Y,J,G);if(X&&X.mark)W.push(X);else return!1}z[H]=G;for(let X=0;X{z.mark=!0});let Y=U.map((z)=>z.mark&&this._explore(U,z)).filter(Boolean).map((z)=>z.$shortRange);return{name:$,ranges:Y}}normaliseMatrix($,U){$.forEachInSheet(U,(Y,z,Q)=>{if(Y){if(Y.row!==z||Y.col!==Q)Y.row=z,Y.col=Q,Y.address=bH.n2l(Q)+z}})}spliceRows($,U,Y,z){lQ.each(this.matrixMap,(Q)=>{Q.spliceRows($,U,Y,z),this.normaliseMatrix(Q,$)})}spliceColumns($,U,Y,z){lQ.each(this.matrixMap,(Q)=>{Q.spliceColumns($,U,Y,z),this.normaliseMatrix(Q,$)})}get model(){return lQ.map(this.matrixMap,($,U)=>this.getRanges(U,$)).filter(($)=>$.ranges.length)}set model($){let U=this.matrixMap={};$.forEach((Y)=>{let z=U[Y.name]=new K60;Y.ranges.forEach((Q)=>{if(sc0.test(Q.split("!").pop()||""))z.addCell(Q)})})}}H60.exports=G60});var I6=E((in1,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($,U,Y,z){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var Q=arguments.length,J,I;switch(Q){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,U)});case 3:return process.nextTick(function(){$.call(null,U,Y)});case 4:return process.nextTick(function(){$.call(null,U,Y,z)});default:J=Array(Q-1),I=0;while(I{var tc0={}.toString;W60.exports=Array.isArray||function($){return tc0.call($)=="[object Array]"}});var K6=E((Wg,Z60)=>{var SO=I0("buffer"),U3=SO.Buffer;function X60($,U){for(var Y in $)U[Y]=$[Y]}if(U3.from&&U3.alloc&&U3.allocUnsafe&&U3.allocUnsafeSlow)Z60.exports=SO;else X60(SO,Wg),Wg.Buffer=rQ;function rQ($,U,Y){return U3($,U,Y)}X60(U3,rQ);rQ.from=function($,U,Y){if(typeof $==="number")throw TypeError("Argument must not be a number");return U3($,U,Y)};rQ.alloc=function($,U,Y){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=U3($);if(U!==void 0)if(typeof Y==="string")z.fill(U,Y);else z.fill(U);else z.fill(0);return z};rQ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return U3($)};rQ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return SO.SlowBuffer($)}});var O4=E((qn0)=>{function ec0($){if(Array.isArray)return Array.isArray($);return gO($)==="[object Array]"}qn0.isArray=ec0;function $n0($){return typeof $==="boolean"}qn0.isBoolean=$n0;function Un0($){return $===null}qn0.isNull=Un0;function Yn0($){return $==null}qn0.isNullOrUndefined=Yn0;function zn0($){return typeof $==="number"}qn0.isNumber=zn0;function Qn0($){return typeof $==="string"}qn0.isString=Qn0;function Jn0($){return typeof $==="symbol"}qn0.isSymbol=Jn0;function In0($){return $===void 0}qn0.isUndefined=In0;function Kn0($){return gO($)==="[object RegExp]"}qn0.isRegExp=Kn0;function Gn0($){return typeof $==="object"&&$!==null}qn0.isObject=Gn0;function Hn0($){return gO($)==="[object Date]"}qn0.isDate=Hn0;function Wn0($){return gO($)==="[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=I0("buffer").Buffer.isBuffer;function gO($){return Object.prototype.toString.call($)}});var q60=E((pn1,Xg)=>{if(typeof Object.create==="function")Xg.exports=function(U,Y){if(Y)U.super_=Y,U.prototype=Object.create(Y.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}})};else Xg.exports=function(U,Y){if(Y){U.super_=Y;var z=function(){};z.prototype=Y.prototype,U.prototype=new z,U.prototype.constructor=U}}});var X1=E((dn1,Zg)=>{try{if(yO=I0("util"),typeof yO.inherits!=="function")throw"";Zg.exports=yO.inherits}catch($){Zg.exports=q60()}var yO});var L60=E((mn1,qg)=>{function Rn0($,U){if(!($ instanceof U))throw TypeError("Cannot call a class as a function")}var V60=K6().Buffer,iH=I0("util");function _n0($,U,Y){$.copy(U,Y)}qg.exports=function(){function $(){Rn0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(Y){var z={data:Y,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(Y){var z={data:Y,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length},$.prototype.shift=function(){if(this.length===0)return;var Y=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,Y},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(Y){if(this.length===0)return"";var z=this.head,Q=""+z.data;while(z=z.next)Q+=Y+z.data;return Q},$.prototype.concat=function(Y){if(this.length===0)return V60.alloc(0);var z=V60.allocUnsafe(Y>>>0),Q=this.head,J=0;while(Q)_n0(Q.data,z,J),J+=Q.data.length,Q=Q.next;return z},$}();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((ln1,F60)=>{var kO=I6();function vn0($,U){var Y=this,z=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(z||Q){if(U)U($);else if($){if(!this._writableState)kO.nextTick(xO,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,kO.nextTick(xO,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!U&&J){if(!Y._writableState)kO.nextTick(xO,Y,J);else if(!Y._writableState.errorEmitted)Y._writableState.errorEmitted=!0,kO.nextTick(xO,Y,J)}else if(U)U(J)}),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 xO($,U){$.emit("error",U)}F60.exports={destroy:vn0,undestroy:hn0}});var S7=E((on1,w60)=>{w60.exports=I0("util").deprecate});var Fg=E((rn1,T60)=>{var pU=I6();T60.exports=Z6;function M60($){var U=this;this.next=null,this.entry=null,this.finish=function(){sn0(U,$)}}var Sn0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pU.nextTick,sQ;Z6.WritableState=nH;var N60=Object.create(O4());N60.inherits=X1();var gn0={deprecate:S7()},D60=I0("stream"),uO=K6().Buffer,yn0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function kn0($){return uO.from($)}function xn0($){return uO.isBuffer($)||$ instanceof yn0}var A60=Vg();N60.inherits(Z6,D60);function fn0(){}function nH($,U){sQ=sQ||dU(),$=$||{};var Y=U instanceof sQ;if(this.objectMode=!!$.objectMode,Y)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:z,writableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(Y&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;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 I=$.decodeStrings===!1;this.decodeStrings=!I,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){dn0(U,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 M60(this)}nH.prototype.getBuffer=function(){var U=this.bufferedRequest,Y=[];while(U)Y.push(U),U=U.next;return Y};(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 fO;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")fO=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(fO.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof nH}});else fO=function($){return $ instanceof this};function Z6($){if(sQ=sQ||dU(),!fO.call(Z6,this)&&!(this instanceof sQ))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($,U){var Y=Error("write after end");$.emit("error",Y),pU.nextTick(U,Y)}function bn0($,U,Y,z){var Q=!0,J=!1;if(Y===null)J=TypeError("May not write null values to stream");else if(typeof Y!=="string"&&Y!==void 0&&!U.objectMode)J=TypeError("Invalid non-string/buffer chunk");if(J)$.emit("error",J),pU.nextTick(z,J),Q=!1;return Q}Z6.prototype.write=function($,U,Y){var z=this._writableState,Q=!1,J=!z.objectMode&&xn0($);if(J&&!uO.isBuffer($))$=kn0($);if(typeof U==="function")Y=U,U=null;if(J)U="buffer";else if(!U)U=z.defaultEncoding;if(typeof Y!=="function")Y=fn0;if(z.ended)un0(this,Y);else if(J||bn0(this,z,$,Y))z.pendingcb++,Q=cn0(this,z,J,$,U,Y);return Q};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(U){if(typeof U==="string")U=U.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((U+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+U);return this._writableState.defaultEncoding=U,this};function in0($,U,Y){if(!$.objectMode&&$.decodeStrings!==!1&&typeof U==="string")U=uO.from(U,Y);return U}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cn0($,U,Y,z,Q,J){if(!Y){var I=in0(U,z,Q);if(z!==I)Y=!0,Q="buffer",z=I}var K=U.objectMode?1:z.length;U.length+=K;var G=U.length{var j60=I6(),an0=Object.keys||function($){var U=[];for(var Y in $)U.push(Y);return U};R60.exports=Y3;var E60=Object.create(O4());E60.inherits=X1();var C60=Og(),wg=Fg();E60.inherits(Y3,C60);{bO=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 U;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(U)return;$=(""+$).toLowerCase(),U=!0}}function Up0($){var U=$p0($);if(typeof U!=="string"&&(Ng.isEncoding===_60||!_60($)))throw Error("Unknown encoding: "+$);return U||$}qp0.StringDecoder=mH;function mH($){this.encoding=Up0($);var U;switch(this.encoding){case"utf16le":this.text=Kp0,this.end=Gp0,U=4;break;case"utf8":this.fillLast=Qp0,U=4;break;case"base64":this.text=Hp0,this.end=Wp0,U=3;break;default:this.write=Xp0,this.end=Zp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ng.allocUnsafe(U)}mH.prototype.write=function($){if($.length===0)return"";var U,Y;if(this.lastNeed){if(U=this.fillLast($),U===void 0)return"";Y=this.lastNeed,this.lastNeed=0}else Y=0;if(Y<$.length)return U?U+this.text($,Y):this.text($,Y);return U||""};mH.prototype.end=Ip0;mH.prototype.text=Jp0;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 Mg($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function Yp0($,U,Y){var z=U.length-1;if(z=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--z=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--z=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function zp0($,U,Y){if((U[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&U.length>1){if((U[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&U.length>2){if((U[2]&192)!==128)return $.lastNeed=2,"�"}}}function Qp0($){var U=this.lastTotal-this.lastNeed,Y=zp0(this,$,U);if(Y!==void 0)return Y;if(this.lastNeed<=$.length)return $.copy(this.lastChar,U,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,U,0,$.length),this.lastNeed-=$.length}function Jp0($,U){var Y=Yp0(this,$,U);if(!this.lastNeed)return $.toString("utf8",U);this.lastTotal=Y;var z=$.length-(Y-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",U,z)}function Ip0($){var U=$&&$.length?this.write($):"";if(this.lastNeed)return U+"�";return U}function Kp0($,U){if(($.length-U)%2===0){var Y=$.toString("utf16le",U);if(Y){var z=Y.charCodeAt(Y.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],Y.slice(0,-1)}return Y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",U,$.length-1)}function Gp0($){var U=$&&$.length?this.write($):"";if(this.lastNeed){var Y=this.lastTotal-this.lastNeed;return U+this.lastChar.toString("utf16le",0,Y)}return U}function Hp0($,U){var Y=($.length-U)%3;if(Y===0)return $.toString("base64",U);if(this.lastNeed=3-Y,this.lastTotal=3,Y===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",U,$.length-Y)}function Wp0($){var U=$&&$.length?this.write($):"";if(this.lastNeed)return U+this.lastChar.toString("base64",0,3-this.lastNeed);return U}function Xp0($){return $.toString(this.encoding)}function Zp0($){return $&&$.length?this.write($):""}});var Og=E((en1,c60)=>{var tQ=I6();c60.exports=P4;var Lp0=oQ(),lH;P4.ReadableState=x60;var tn1=I0("events").EventEmitter,g60=function($,U){return $.listeners(U).length},jg=I0("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 Op0($){return oH.isBuffer($)||$ instanceof Fp0}var y60=Object.create(O4());y60.inherits=X1();var Ag=I0("util"),t1=void 0;if(Ag&&Ag.debuglog)t1=Ag.debuglog("stream");else t1=function(){};var Mp0=L60(),k60=Vg(),aQ;y60.inherits(P4,jg);var Pg=["error","close","destroy","pause","resume"];function Np0($,U,Y){if(typeof $.prependListener==="function")return $.prependListener(U,Y);if(!$._events||!$._events[U])$.on(U,Y);else if(Lp0($._events[U]))$._events[U].unshift(Y);else $._events[U]=[Y,$._events[U]]}function x60($,U){lH=lH||dU(),$=$||{};var Y=U instanceof lH;if(this.objectMode=!!$.objectMode,Y)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:z,readableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(Y&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Mp0,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(!aQ)aQ=Dg().StringDecoder;this.decoder=new aQ($.encoding),this.encoding=$.encoding}}function P4($){if(lH=lH||dU(),!(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($,U){this.push(null),U($)};P4.prototype.push=function($,U){var Y=this._readableState,z;if(!Y.objectMode){if(typeof $==="string"){if(U=U||Y.defaultEncoding,U!==Y.encoding)$=oH.from($,U),U="";z=!0}}else z=!0;return f60(this,$,U,!1,z)};P4.prototype.unshift=function($){return f60(this,$,null,!0,!1)};function f60($,U,Y,z,Q){var J=$._readableState;if(U===null)J.reading=!1,Bp0($,J);else{var I;if(!Q)I=Dp0(J,U);if(I)$.emit("error",I);else if(J.objectMode||U&&U.length>0){if(typeof U!=="string"&&!J.objectMode&&Object.getPrototypeOf(U)!==oH.prototype)U=wp0(U);if(z)if(J.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else Bg($,J,U,!0);else if(J.ended)$.emit("error",Error("stream.push() after EOF"));else if(J.reading=!1,J.decoder&&!Y)if(U=J.decoder.write(U),J.objectMode||U.length!==0)Bg($,J,U,!1);else u60($,J);else Bg($,J,U,!1)}else if(!z)J.reading=!1}return Ap0(J)}function Bg($,U,Y,z){if(U.flowing&&U.length===0&&!U.sync)$.emit("data",Y),$.read(0);else{if(U.length+=U.objectMode?1:Y.length,z)U.buffer.unshift(Y);else U.buffer.push(Y);if(U.needReadable)iO($)}u60($,U)}function Dp0($,U){var Y;if(!Op0(U)&&typeof U!=="string"&&U!==void 0&&!$.objectMode)Y=TypeError("Invalid non-string/buffer chunk");return Y}function Ap0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!aQ)aQ=Dg().StringDecoder;return this._readableState.decoder=new aQ($),this._readableState.encoding=$,this};var v60=8388608;function Pp0($){if($>=v60)$=v60;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function h60($,U){if($<=0||U.length===0&&U.ended)return 0;if(U.objectMode)return 1;if($!==$)if(U.flowing&&U.length)return U.buffer.head.data.length;else return U.length;if($>U.highWaterMark)U.highWaterMark=Pp0($);if($<=U.length)return $;if(!U.ended)return U.needReadable=!0,0;return U.length}P4.prototype.read=function($){t1("read",$),$=parseInt($,10);var U=this._readableState,Y=$;if($!==0)U.emittedReadable=!1;if($===0&&U.needReadable&&(U.length>=U.highWaterMark||U.ended)){if(t1("read: emitReadable",U.length,U.ended),U.length===0&&U.ended)Tg(this);else iO(this);return null}if($=h60($,U),$===0&&U.ended){if(U.length===0)Tg(this);return null}var z=U.needReadable;if(t1("need readable",z),U.length===0||U.length-$0)Q=b60($,U);else Q=null;if(Q===null)U.needReadable=!0,$=0;else U.length-=$;if(U.length===0){if(!U.ended)U.needReadable=!0;if(Y!==$&&U.ended)Tg(this)}if(Q!==null)this.emit("data",Q);return Q};function Bp0($,U){if(U.ended)return;if(U.decoder){var Y=U.decoder.end();if(Y&&Y.length)U.buffer.push(Y),U.length+=U.objectMode?1:Y.length}U.ended=!0,iO($)}function iO($){var U=$._readableState;if(U.needReadable=!1,!U.emittedReadable)if(t1("emitReadable",U.flowing),U.emittedReadable=!0,U.sync)tQ.nextTick(S60,$);else S60($)}function S60($){t1("emit readable"),$.emit("readable"),Eg($)}function u60($,U){if(!U.readingMore)U.readingMore=!0,tQ.nextTick(Tp0,$,U)}function Tp0($,U){var Y=U.length;while(!U.reading&&!U.flowing&&!U.ended&&U.length1&&i60(z.pipes,$)!==-1)&&!H)t1("false write response, pause",z.awaitDrain),z.awaitDrain++,X=!0;Y.pause()}}function q(w){if(t1("onerror",w),O(),$.removeListener("error",q),g60($,"error")===0)$.emit("error",w)}Np0($,"error",q);function V(){$.removeListener("finish",F),O()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),O()}$.once("finish",F);function O(){t1("unpipe"),Y.unpipe($)}if($.emit("pipe",Y),!z.flowing)t1("pipe resume"),Y.resume();return $};function jp0($){return function(){var U=$._readableState;if(t1("pipeOnDrain",U.awaitDrain),U.awaitDrain)U.awaitDrain--;if(U.awaitDrain===0&&g60($,"data"))U.flowing=!0,Eg($)}}P4.prototype.unpipe=function($){var U=this._readableState,Y={hasUnpiped:!1};if(U.pipesCount===0)return this;if(U.pipesCount===1){if($&&$!==U.pipes)return this;if(!$)$=U.pipes;if(U.pipes=null,U.pipesCount=0,U.flowing=!1,$)$.emit("unpipe",this,Y);return this}if(!$){var{pipes:z,pipesCount:Q}=U;U.pipes=null,U.pipesCount=0,U.flowing=!1;for(var J=0;J=U.length){if(U.decoder)Y=U.buffer.join("");else if(U.buffer.length===1)Y=U.buffer.head.data;else Y=U.buffer.concat(U.length);U.buffer.clear()}else Y=_p0($,U.buffer,U.decoder);return Y}function _p0($,U,Y){var z;if($J.length?J.length:$;if(I===J.length)Q+=J;else Q+=J.slice(0,$);if($-=I,$===0){if(I===J.length)if(++z,Y.next)U.head=Y.next;else U.head=U.tail=null;else U.head=Y,Y.data=J.slice(I);break}++z}return U.length-=z,Q}function hp0($,U){var Y=oH.allocUnsafe($),z=U.head,Q=1;z.data.copy(Y),$-=z.data.length;while(z=z.next){var J=z.data,I=$>J.length?J.length:$;if(J.copy(Y,Y.length-$,0,I),$-=I,$===0){if(I===J.length)if(++Q,z.next)U.head=z.next;else U.head=U.tail=null;else U.head=z,z.data=J.slice(I);break}++Q}return U.length-=Q,Y}function Tg($){var U=$._readableState;if(U.length>0)throw Error('"endReadable()" called on non-empty stream');if(!U.endEmitted)U.ended=!0,tQ.nextTick(Sp0,U,$)}function Sp0($,U){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,U.readable=!1,U.emit("end")}function i60($,U){for(var Y=0,z=$.length;Y{d60.exports=z3;var cO=dU(),p60=Object.create(O4());p60.inherits=X1();p60.inherits(z3,cO);function gp0($,U){var Y=this._transformState;Y.transforming=!1;var z=Y.writecb;if(!z)return this.emit("error",Error("write callback called multiple times"));if(Y.writechunk=null,Y.writecb=null,U!=null)this.push(U);z($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{o60.exports=rH;var m60=Cg(),l60=Object.create(O4());l60.inherits=X1();l60.inherits(rH,m60);function rH($){if(!(this instanceof rH))return new rH($);m60.call(this,$)}rH.prototype._transform=function($,U,Y){Y(null,$)}});var Rg=E((d6,nO)=>{var r5=I0("stream");if(process.env.READABLE_STREAM==="disable"&&r5)nO.exports=r5,d6=nO.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=nO.exports=Og(),d6.Stream=r5||d6,d6.Readable=d6,d6.Writable=Fg(),d6.Duplex=dU(),d6.Transform=Cg(),d6.PassThrough=r60()});var Q3=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{pO=new ArrayBuffer(0);try{xp0.blob=new Blob([pO],{type:"application/zip"}).size===0}catch($){try{vg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,dO=new vg,dO.append(pO),xp0.blob=dO.getBlob("application/zip").size===0}catch(U){xp0.blob=!1}}}var pO,vg,dO;try{xp0.nodestream=!!Rg().Readable}catch($){xp0.nodestream=!1}});var hg=E((mp0)=>{var pp0=c4(),dp0=Q3(),s5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";mp0.encode=function($){var U=[],Y,z,Q,J,I,K,G,H=0,W=$.length,X=W,Z=pp0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)Y=$.charCodeAt(H++),z=H>2,I=(Y&3)<<4|z>>4,K=X>1?(z&15)<<2|Q>>6:64,G=X>2?Q&63:64,U.push(s5.charAt(J)+s5.charAt(I)+s5.charAt(K)+s5.charAt(G))}return U.join("")};mp0.decode=function($){var U,Y,z,Q,J,I,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(Q=s5.indexOf($.charAt(G++)),J=s5.indexOf($.charAt(G++)),I=s5.indexOf($.charAt(G++)),K=s5.indexOf($.charAt(G++)),U=Q<<2|J>>4,Y=(J&15)<<4|I>>2,z=(I&3)<<6|K,Z[H++]=U,I!==64)Z[H++]=Y;if(K!==64)Z[H++]=z}return Z}});var sH=E((Qp1,s60)=>{s60.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,U){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,U);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,U)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var U=new Buffer($);return U.fill(0),U}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var e60=E((Ip1,t60)=>{var Jp1=global.MutationObserver||global.WebKitMutationObserver,a60;a60=function(){process.nextTick(ep0)};var rp0,sp0,ap0,tp0,Sg,aH=[];function ep0(){Sg=!0;var $,U,Y=aH.length;while(Y){U=aH,aH=[],$=-1;while(++${var $80=e60();function $J(){}var X8={},U80=["REJECTED"],gg=["FULFILLED"],Y80=["PENDING"];eQ=["UNHANDLED"];var eQ;J80.exports=g7;function g7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=Y80,this.queue=[],this.outcome=void 0,this.handled=eQ,$!==$J)z80(this,$)}g7.prototype.finally=function($){if(typeof $!=="function")return this;var U=this.constructor;return this.then(Y,z);function Y(Q){function J(){return Q}return U.resolve($()).then(J)}function z(Q){function J(){throw Q}return U.resolve($()).then(J)}};g7.prototype.catch=function($){return this.then(null,$)};g7.prototype.then=function($,U){if(typeof $!=="function"&&this.state===gg||typeof U!=="function"&&this.state===U80)return this;var Y=new this.constructor($J);if(this.handled===eQ)this.handled=null;if(this.state!==Y80){var z=this.state===gg?$:U;yg(Y,z,this.outcome)}else this.queue.push(new tH(Y,$,U));return Y};function tH($,U,Y){if(this.promise=$,typeof U==="function")this.onFulfilled=U,this.callFulfilled=this.otherCallFulfilled;if(typeof Y==="function")this.onRejected=Y,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($,U,Y){$80(function(){var z;try{z=U(Y)}catch(Q){return X8.reject($,Q)}if(z===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,z)})}X8.resolve=function($,U){var Y=Q80(Ud0,U);if(Y.status==="error")return X8.reject($,Y.value);var z=Y.value;if(z)z80($,z);else{$.state=gg,$.outcome=U;var Q=-1,J=$.queue.length;while(++Q{var kg=null;if(typeof Promise<"u")kg=Promise;else kg=I80();K80.exports={Promise:kg}});var xg=E((G80)=>{(function($,U){if($.setImmediate)return;var Y=1,z={},Q=!1,J=$.document,I;function K(M){if(typeof M!=="function")M=Function(""+M);var N=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?G80:global:self)});var c4=E((Gd0)=>{var y7=Q3(),Id0=hg(),YJ=sH(),fg=UJ();xg();function Kd0($){var U=null;if(y7.uint8array)U=new Uint8Array($.length);else U=Array($.length);return lO($,U)}Gd0.newBlob=function($,U){Gd0.checkSupport("blob");try{return new Blob([$],{type:U})}catch(Q){try{var Y=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,z=new Y;return z.append($),z.getBlob(U)}catch(J){throw Error("Bug : can't construct the Blob.")}}};function eH($){return $}function lO($,U){for(var Y=0;Y<$.length;++Y)U[Y]=$.charCodeAt(Y)&255;return U}var mO={stringifyByChunk:function($,U,Y){var z=[],Q=0,J=$.length;if(J<=Y)return String.fromCharCode.apply(null,$);while(Q1)try{return mO.stringifyByChunk($,Y,U)}catch(Q){U=Math.floor(U/2)}return mO.stringifyByChar($)}Gd0.applyFromCharCode=$W;function oO($,U){for(var Y=0;Y<$.length;Y++)U[Y]=$[Y];return U}var k7={};k7.string={string:eH,array:function($){return lO($,Array($.length))},arraybuffer:function($){return k7.string.uint8array($).buffer},uint8array:function($){return lO($,new Uint8Array($.length))},nodebuffer:function($){return lO($,YJ.allocBuffer($.length))}};k7.array={string:$W,array:eH,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return YJ.newBufferFrom($)}};k7.arraybuffer={string:function($){return $W(new Uint8Array($))},array:function($){return oO(new Uint8Array($),Array($.byteLength))},arraybuffer:eH,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return YJ.newBufferFrom(new Uint8Array($))}};k7.uint8array={string:$W,array:function($){return oO($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:eH,nodebuffer:function($){return YJ.newBufferFrom($)}};k7.nodebuffer={string:$W,array:function($){return oO($,Array($.length))},arraybuffer:function($){return k7.nodebuffer.uint8array($).buffer},uint8array:function($){return oO($,new Uint8Array($.length))},nodebuffer:eH};Gd0.transformTo=function($,U){if(!U)U="";if(!$)return U;Gd0.checkSupport($);var Y=Gd0.getTypeOf(U),z=k7[Y][$](U);return z};Gd0.resolve=function($){var U=$.split("/"),Y=[];for(var z=0;z"u")$[Y]=arguments[U][Y];return $};Gd0.prepareContent=function($,U,Y,z,Q){var J=fg.Promise.resolve(U).then(function(I){var K=y7.blob&&(I instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(I))!==-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(I)});else return I});return J.then(function(I){var K=Gd0.getTypeOf(I);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")I=Gd0.transformTo("uint8array",I);else if(K==="string"){if(Q)I=Id0.decode(I);else if(Y){if(z!==!0)I=Kd0(I)}}return I})}});var I$=E((Xp1,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($,U){return this._listeners[$].push(U),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,U){if(this._listeners[$])for(var Y=0;Y "+$;else return $}};Z80.exports=X80});var QJ=E((Pd0)=>{var zJ=c4(),mU=Q3(),Md0=sH(),rO=I$(),UW=Array(256);for(a5=0;a5<256;a5++)UW[a5]=a5>=252?6:a5>=248?5:a5>=240?4:a5>=224?3:a5>=192?2:1;var a5;UW[254]=UW[254]=1;var Nd0=function($){var U,Y,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,U[J++]=128|Y&63;else if(Y<65536)U[J++]=224|Y>>>12,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63;else U[J++]=240|Y>>>18,U[J++]=128|Y>>>12&63,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63}return U},Dd0=function($,U){var Y;if(U=U||$.length,U>$.length)U=$.length;Y=U-1;while(Y>=0&&($[Y]&192)===128)Y--;if(Y<0)return U;if(Y===0)return U;return Y+UW[$[Y]]>U?Y:U},Ad0=function($){var U,Y,z,Q,J=$.length,I=Array(J*2);for(Y=0,U=0;U4){I[Y++]=65533,U+=Q-1;continue}z&=Q===2?31:Q===3?15:7;while(Q>1&&U1){I[Y++]=65533;continue}if(z<65536)I[Y++]=z;else z-=65536,I[Y++]=55296|z>>10&1023,I[Y++]=56320|z&1023}if(I.length!==Y)if(I.subarray)I=I.subarray(0,Y);else I.length=Y;return zJ.applyFromCharCode(I)};Pd0.utf8encode=function(U){if(mU.nodebuffer)return Md0.newBufferFrom(U,"utf-8");return Nd0(U)};Pd0.utf8decode=function(U){if(mU.nodebuffer)return zJ.transformTo("nodebuffer",U).toString("utf-8");return U=zJ.transformTo(mU.uint8array?"uint8array":"array",U),Ad0(U)};function sO(){rO.call(this,"utf-8 decode"),this.leftOver=null}zJ.inherits(sO,rO);sO.prototype.processChunk=function($){var U=zJ.transformTo(mU.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(mU.uint8array){var Y=U;U=new Uint8Array(Y.length+this.leftOver.length),U.set(this.leftOver,0),U.set(Y,this.leftOver.length)}else U=this.leftOver.concat(U);this.leftOver=null}var z=Dd0(U),Q=U;if(z!==U.length)if(mU.uint8array)Q=U.subarray(0,z),this.leftOver=U.subarray(z,U.length);else Q=U.slice(0,z),this.leftOver=U.slice(z,U.length);this.push({data:Pd0.utf8decode(Q),meta:$.meta})};sO.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Pd0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Pd0.Utf8DecodeWorker=sO;function bg(){rO.call(this,"utf-8 encode")}zJ.inherits(bg,rO);bg.prototype.processChunk=function($){this.push({data:Pd0.utf8encode($.data),meta:$.meta})};Pd0.Utf8EncodeWorker=bg});var w80=E((qp1,F80)=>{var V80=I$(),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((Vp1,M80)=>{var O80=Rg().Readable,jd0=c4();jd0.inherits(ng,O80);function ng($,U,Y){O80.call(this,U),this._helper=$;var z=this;$.on("data",function(Q,J){if(!z.push(Q))z._helper.pause();if(Y)Y(J)}).on("error",function(Q){z.emit("error",Q)}).on("end",function(){z.push(null)})}ng.prototype._read=function(){this._helper.resume()};M80.exports=ng});var pg=E((Lp1,P80)=>{var lU=c4(),Ed0=w80(),Cd0=I$(),Rd0=hg(),_d0=Q3(),vd0=UJ(),D80=null;if(_d0.nodestream)try{D80=N80()}catch($){}function hd0($,U,Y){switch($){case"blob":return lU.newBlob(lU.transformTo("arraybuffer",U),Y);case"base64":return Rd0.encode(U);default:return lU.transformTo($,U)}}function Sd0($,U){var Y,z=0,Q=null,J=0;for(Y=0;Y{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((wp1,B80)=>{var aO=c4(),tO=I$(),md0=16384;function JJ($){tO.call(this,"DataWorker");var U=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(Y){if(U.dataIsReady=!0,U.data=Y,U.max=Y&&Y.length||0,U.type=aO.getTypeOf(Y),!U.isPaused)U._tickAndRepeat()},function(Y){U.error(Y)})}aO.inherits(JJ,tO);JJ.prototype.cleanUp=function(){tO.prototype.cleanUp.call(this),this.data=null};JJ.prototype.resume=function(){if(!tO.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,aO.delay(this._tickAndRepeat,[],this);return!0};JJ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)aO.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};JJ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=md0,U=null,Y=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":U=this.data.substring(this.index,Y);break;case"uint8array":U=this.data.subarray(this.index,Y);break;case"array":case"nodebuffer":U=this.data.slice(this.index,Y);break}return this.index=Y,this.push({data:U,meta:{percent:this.max?this.index/this.max*100:0}})}};B80.exports=JJ});var eO=E((Op1,j80)=>{var ld0=c4();function od0(){var $,U=[];for(var Y=0;Y<256;Y++){$=Y;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;U[Y]=$}return U}var T80=od0();function rd0($,U,Y,z){var Q=T80,J=z+Y;$=$^-1;for(var I=z;I>>8^Q[($^U[I])&255];return $^-1}function sd0($,U,Y,z){var Q=T80,J=z+Y;$=$^-1;for(var I=z;I>>8^Q[($^U.charCodeAt(I))&255];return $^-1}j80.exports=function(U,Y){if(typeof U>"u"||!U.length)return 0;var z=ld0.getTypeOf(U)!=="string";if(z)return rd0(Y|0,U,U.length,0);else return sd0(Y|0,U,U.length,0)}});var og=E((Mp1,C80)=>{var E80=I$(),ad0=eO(),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((Np1,R80)=>{var ed0=c4(),rg=I$();function sg($){rg.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}ed0.inherits(sg,rg);sg.prototype.processChunk=function($){if($){var U=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=U+$.data.length}rg.prototype.processChunk.call(this,$)};R80.exports=sg});var $M=E((Dp1,S80)=>{var v80=UJ(),h80=mg(),$m0=og(),ag=_80();function tg($,U,Y,z,Q){this.compressedSize=$,this.uncompressedSize=U,this.crc32=Y,this.compression=z,this.compressedContent=Q}tg.prototype={getContentWorker:function(){var $=new h80(v80.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new ag("data_length")),U=this;return $.on("end",function(){if(this.streamInfo.data_length!==U.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($,U,Y){return $.pipe(new $m0).pipe(new ag("uncompressedSize")).pipe(U.compressWorker(Y)).pipe(new ag("compressedSize")).withStreamInfo("compression",U)};S80.exports=tg});var x80=E((Ap1,k80)=>{var Um0=pg(),Ym0=mg(),eg=QJ(),$y=$M(),g80=I$(),Uy=function($,U,Y){this.name=$,this.dir=Y.dir,this.date=Y.date,this.comment=Y.comment,this.unixPermissions=Y.unixPermissions,this.dosPermissions=Y.dosPermissions,this._data=U,this._dataBinary=Y.binary,this.options={compression:Y.compression,compressionOptions:Y.compressionOptions}};Uy.prototype={internalStream:function($){var U=null,Y="string";try{if(!$)throw Error("No output type specified.");Y=$.toLowerCase();var z=Y==="string"||Y==="text";if(Y==="binarystring"||Y==="text")Y="string";U=this._decompressWorker();var Q=!this._dataBinary;if(Q&&!z)U=U.pipe(new eg.Utf8EncodeWorker);if(!Q&&z)U=U.pipe(new eg.Utf8DecodeWorker)}catch(J){U=new g80("error"),U.error(J)}return new Um0(U,Y,"")},async:function($,U){return this.internalStream($).accumulate(U)},nodeStream:function($,U){return this.internalStream($||"nodebuffer").toNodejsStream(U)},_compressWorker:function($,U){if(this._data instanceof $y&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var Y=this._decompressWorker();if(!this._dataBinary)Y=Y.pipe(new eg.Utf8EncodeWorker);return $y.createWorkerFrom(Y,$,U)}},_decompressWorker:function(){if(this._data instanceof $y)return this._data.getContentWorker();else if(this._data instanceof g80)return this._data;else return new Ym0(this._data)}};var y80=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],zm0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(YW=0;YW{var Km0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Gm0($,U){return Object.prototype.hasOwnProperty.call($,U)}Yy.assign=function($){var U=Array.prototype.slice.call(arguments,1);while(U.length){var Y=U.shift();if(!Y)continue;if(typeof Y!=="object")throw TypeError(Y+"must be non-object");for(var z in Y)if(Gm0(Y,z))$[z]=Y[z]}return $};Yy.shrinkBuf=function($,U){if($.length===U)return $;if($.subarray)return $.subarray(0,U);return $.length=U,$};var Hm0={arraySet:function($,U,Y,z,Q){if(U.subarray&&$.subarray){$.set(U.subarray(Y,Y+z),Q);return}for(var J=0;J{var Zm0=J3(),qm0=4,u80=0,b80=1,Vm0=2;function KJ($){var U=$.length;while(--U>=0)$[U]=0}var Lm0=0,m80=1,Fm0=2,wm0=3,Om0=258,Wy=29,GW=256,QW=GW+1+Wy,IJ=30,Xy=19,l80=2*QW+1,oU=15,Qy=16,Mm0=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],UM=[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,I3=Array((QW+2)*2);KJ(I3);var zW=Array(IJ*2);KJ(zW);var JW=Array(Dm0);KJ(JW);var IW=Array(Om0-wm0+1);KJ(IW);var qy=Array(Wy);KJ(qy);var YM=Array(IJ);KJ(YM);function Jy($,U,Y,z,Q){this.static_tree=$,this.extra_bits=U,this.extra_base=Y,this.elems=z,this.max_length=Q,this.has_stree=$&&$.length}var t80,e80,$$0;function Iy($,U){this.dyn_tree=$,this.max_code=0,this.stat_desc=U}function U$0($){return $<256?JW[$]:JW[256+($>>>7)]}function KW($,U){$.pending_buf[$.pending++]=U&255,$.pending_buf[$.pending++]=U>>>8&255}function n8($,U,Y){if($.bi_valid>Qy-Y)$.bi_buf|=U<<$.bi_valid&65535,KW($,$.bi_buf),$.bi_buf=U>>Qy-$.bi_valid,$.bi_valid+=Y-Qy;else $.bi_buf|=U<<$.bi_valid&65535,$.bi_valid+=Y}function t5($,U,Y){n8($,Y[U*2],Y[U*2+1])}function Y$0($,U){var Y=0;do Y|=$&1,$>>>=1,Y<<=1;while(--U>0);return Y>>>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($,U){var{dyn_tree:Y,max_code:z}=U,Q=U.stat_desc.static_tree,J=U.stat_desc.has_stree,I=U.stat_desc.extra_bits,K=U.stat_desc.extra_base,G=U.stat_desc.max_length,H,W,X,Z,q,V,F=0;for(Z=0;Z<=oU;Z++)$.bl_count[Z]=0;Y[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(Y[W*2+1]=Z,W>z)continue;if($.bl_count[Z]++,q=0,W>=K)q=I[W-K];if(V=Y[W*2],$.opt_len+=V*(Z+q),J)$.static_len+=V*(Q[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>z)continue;if(Y[X*2+1]!==Z)$.opt_len+=(Z-Y[X*2+1])*Y[X*2],Y[X*2+1]=Z;W--}}}function z$0($,U,Y){var z=Array(oU+1),Q=0,J,I;for(J=1;J<=oU;J++)z[J]=Q=Q+Y[J-1]<<1;for(I=0;I<=U;I++){var K=$[I*2+1];if(K===0)continue;$[I*2]=Y$0(z[K]++,K)}}function Bm0(){var $,U,Y,z,Q,J=Array(oU+1);Y=0;for(z=0;z>=7;for(;z8)KW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function Tm0($,U,Y,z){if(J$0($),z)KW($,Y),KW($,~Y);Zm0.arraySet($.pending_buf,$.window,U,Y,$.pending),$.pending+=Y}function i80($,U,Y,z){var Q=U*2,J=Y*2;return $[Q]<$[J]||$[Q]===$[J]&&z[U]<=z[Y]}function Ky($,U,Y){var z=$.heap[Y],Q=Y<<1;while(Q<=$.heap_len){if(Q<$.heap_len&&i80(U,$.heap[Q+1],$.heap[Q],$.depth))Q++;if(i80(U,z,$.heap[Q],$.depth))break;$.heap[Y]=$.heap[Q],Y=Q,Q<<=1}$.heap[Y]=z}function c80($,U,Y){var z,Q,J=0,I,K;if($.last_lit!==0)do if(z=$.pending_buf[$.d_buf+J*2]<<8|$.pending_buf[$.d_buf+J*2+1],Q=$.pending_buf[$.l_buf+J],J++,z===0)t5($,Q,U);else{if(I=IW[Q],t5($,I+GW+1,U),K=Gy[I],K!==0)Q-=qy[I],n8($,Q,K);if(z--,I=U$0(z),t5($,I,Y),K=UM[I],K!==0)z-=YM[I],n8($,z,K)}while(J<$.last_lit);t5($,Zy,U)}function Hy($,U){var Y=U.dyn_tree,z=U.stat_desc.static_tree,Q=U.stat_desc.has_stree,J=U.stat_desc.elems,I,K,G=-1,H;$.heap_len=0,$.heap_max=l80;for(I=0;I>1;I>=1;I--)Ky($,Y,I);H=J;do I=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Ky($,Y,1),K=$.heap[1],$.heap[--$.heap_max]=I,$.heap[--$.heap_max]=K,Y[H*2]=Y[I*2]+Y[K*2],$.depth[H]=($.depth[I]>=$.depth[K]?$.depth[I]:$.depth[K])+1,Y[I*2+1]=Y[K*2+1]=H,$.heap[1]=H++,Ky($,Y,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Pm0($,U),z$0(Y,G,$.bl_count)}function n80($,U,Y){var z,Q=-1,J,I=U[1],K=0,G=7,H=4;if(I===0)G=138,H=3;U[(Y+1)*2+1]=65535;for(z=0;z<=Y;z++){if(J=I,I=U[(z+1)*2+1],++K=3;U--)if($.bl_tree[a80[U]*2+1]!==0)break;return $.opt_len+=3*(U+1)+5+5+4,U}function Em0($,U,Y,z){var Q;n8($,U-257,5),n8($,Y-1,5),n8($,z-4,4);for(Q=0;Q>>=1)if(U&1&&$.dyn_ltree[Y*2]!==0)return u80;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return b80;for(Y=32;Y0){if($.strm.data_type===Vm0)$.strm.data_type=Cm0($);if(Hy($,$.l_desc),Hy($,$.d_desc),I=jm0($),Q=$.opt_len+3+7>>>3,J=$.static_len+3+7>>>3,J<=Q)Q=J}else Q=J=Y+5;if(Y+4<=Q&&U!==-1)I$0($,U,Y,z);else if($.strategy===qm0||J===Q)n8($,(m80<<1)+(z?1:0),3),c80($,I3,zW);else n8($,(Fm0<<1)+(z?1:0),3),Em0($,$.l_desc.max_code+1,$.d_desc.max_code+1,I+1),c80($,$.dyn_ltree,$.dyn_dtree);if(Q$0($),z)J$0($)}function hm0($,U,Y){if($.pending_buf[$.d_buf+$.last_lit*2]=U>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=U&255,$.pending_buf[$.l_buf+$.last_lit]=Y&255,$.last_lit++,U===0)$.dyn_ltree[Y*2]++;else $.matches++,U--,$.dyn_ltree[(IW[Y]+GW+1)*2]++,$.dyn_dtree[U$0(U)*2]++;return $.last_lit===$.lit_bufsize-1}Sm0._tr_init=Rm0;Sm0._tr_stored_block=I$0;Sm0._tr_flush_block=vm0;Sm0._tr_tally=hm0;Sm0._tr_align=_m0});var Vy=E((Tp1,G$0)=>{function um0($,U,Y,z){var Q=$&65535|0,J=$>>>16&65535|0,I=0;while(Y!==0){I=Y>2000?2000:Y,Y-=I;do Q=Q+U[z++]|0,J=J+Q|0;while(--I);Q%=65521,J%=65521}return Q|J<<16|0}G$0.exports=um0});var Ly=E((jp1,H$0)=>{function bm0(){var $,U=[];for(var Y=0;Y<256;Y++){$=Y;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;U[Y]=$}return U}var im0=bm0();function cm0($,U,Y,z){var Q=im0,J=z+Y;$^=-1;for(var I=z;I>>8^Q[($^U[I])&255];return $^-1}H$0.exports=cm0});var zM=E((Ep1,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 M$0=E((Dl0)=>{var j8=J3(),j$=K$0(),V$0=Vy(),x7=Ly(),nm0=zM(),tU=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,QM=2,rm0=3,sm0=4,am0=0,tm0=2,GM=8,em0=9,$l0=15,Ul0=8,Yl0=29,zl0=256,Oy=zl0+1+Yl0,Ql0=30,Jl0=19,Il0=2*Oy+1,Kl0=15,f1=3,b7=258,W5=b7+f1+1,Gl0=32,HM=42,My=69,JM=73,IM=91,KM=103,rU=113,WW=666,P6=1,XW=2,sU=3,WJ=4,Hl0=3;function i7($,U){return $.msg=nm0[U],U}function q$0($){return($<<1)-($>4?9:0)}function u7($){var U=$.length;while(--U>=0)$[U]=0}function f7($){var U=$.state,Y=U.pending;if(Y>$.avail_out)Y=$.avail_out;if(Y===0)return;if(j8.arraySet($.output,U.pending_buf,U.pending_out,Y,$.next_out),$.next_out+=Y,U.pending_out+=Y,$.total_out+=Y,$.avail_out-=Y,U.pending-=Y,U.pending===0)U.pending_out=0}function m6($,U){j$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,U),$.block_start=$.strstart,f7($.strm)}function r1($,U){$.pending_buf[$.pending++]=U}function HW($,U){$.pending_buf[$.pending++]=U>>>8&255,$.pending_buf[$.pending++]=U&255}function Wl0($,U,Y,z){var Q=$.avail_in;if(Q>z)Q=z;if(Q===0)return 0;if($.avail_in-=Q,j8.arraySet(U,$.input,$.next_in,Q,Y),$.state.wrap===1)$.adler=V$0($.adler,U,Q,Y);else if($.state.wrap===2)$.adler=x7($.adler,U,Q,Y);return $.next_in+=Q,$.total_in+=Q,Q}function L$0($,U){var{max_chain_length:Y,strstart:z}=$,Q,J,I=$.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[z+I-1],V=H[z+I];if($.prev_length>=$.good_match)Y>>=2;if(K>$.lookahead)K=$.lookahead;do{if(Q=U,H[Q+I]!==V||H[Q+I-1]!==q||H[Q]!==H[z]||H[++Q]!==H[z+1])continue;z+=2,Q++;do;while(H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&zI){if($.match_start=U,I=J,J>=K)break;q=H[z+I-1],V=H[z+I]}}while((U=X[U&W])>G&&--Y!==0);if(I<=$.lookahead)return I;return $.lookahead}function aU($){var U=$.w_size,Y,z,Q,J,I;do{if(J=$.window_size-$.lookahead-$.strstart,$.strstart>=U+(U-W5)){j8.arraySet($.window,$.window,U,U,0),$.match_start-=U,$.strstart-=U,$.block_start-=U,z=$.hash_size,Y=z;do Q=$.head[--Y],$.head[Y]=Q>=U?Q-U:0;while(--z);z=U,Y=z;do Q=$.prev[--Y],$.prev[Y]=Q>=U?Q-U:0;while(--z);J+=U}if($.strm.avail_in===0)break;if(z=Wl0($.strm,$.window,$.strstart+$.lookahead,J),$.lookahead+=z,$.lookahead+$.insert>=f1){I=$.strstart-$.insert,$.ins_h=$.window[I],$.ins_h=($.ins_h<<$.hash_shift^$.window[I+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[I+f1-1])&$.hash_mask,$.prev[I&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=I,I++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)Y=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(aU($),$.lookahead===0&&U===tU)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var z=$.block_start+Y;if($.strstart===0||$.strstart>=z){if($.lookahead=$.strstart-z,$.strstart=z,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,U===c7){if(m6($,!0),$.strm.avail_out===0)return sU;return WJ}if($.strstart>$.block_start){if(m6($,!1),$.strm.avail_out===0)return P6}return P6}function wy($,U){var Y,z;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(Y!==0&&$.strstart-Y<=$.w_size-W5)$.match_length=L$0($,Y);if($.match_length>=f1)if(z=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,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){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,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,Y!==0&&$.prev_length<$.max_lazy_match&&$.strstart-Y<=$.w_size-W5){if($.match_length=L$0($,Y),$.match_length<=5&&($.strategy===om0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){Q=$.strstart+$.lookahead-f1,z=j$._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f1),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=Q)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,z){if(m6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(z=j$._tr_tally($,0,$.window[$.strstart-1]),z)m6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)z=j$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(Q=$.strstart-1,z=I[Q],z===I[++Q]&&z===I[++Q]&&z===I[++Q]){J=$.strstart+b7;do;while(z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&Q$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)Y=j$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else Y=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(Y){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,U===c7){if(m6($,!0),$.strm.avail_out===0)return sU;return WJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function ql0($,U){var Y;for(;;){if($.lookahead===0){if(aU($),$.lookahead===0){if(U===tU)return P6;break}}if($.match_length=0,Y=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,Y){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,U===c7){if(m6($,!0),$.strm.avail_out===0)return sU;return WJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function e5($,U,Y,z,Q){this.good_length=$,this.max_lazy=U,this.nice_length=Y,this.max_chain=z,this.func=Q}var HJ;HJ=[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,GJ),new e5(8,16,32,32,GJ),new e5(8,16,128,128,GJ),new e5(8,32,128,256,GJ),new e5(32,128,258,1024,GJ),new e5(32,258,258,4096,GJ)];function Vl0($){$.window_size=2*$.w_size,u7($.head),$.max_lazy_match=HJ[$.level].max_lazy,$.good_match=HJ[$.level].good_length,$.nice_match=HJ[$.level].nice_length,$.max_chain_length=HJ[$.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=GM,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(Il0*2),this.dyn_dtree=new j8.Buf16((2*Ql0+1)*2),this.bl_tree=new j8.Buf16((2*Jl0+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*Oy+1),u7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new j8.Buf16(2*Oy+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 U;if(!$||!$.state)return i7($,E$);if($.total_in=$.total_out=0,$.data_type=tm0,U=$.state,U.pending=0,U.pending_out=0,U.wrap<0)U.wrap=-U.wrap;return U.status=U.wrap?HM:rU,$.adler=U.wrap===2?0:1,U.last_flush=tU,j$._tr_init(U),$9}function w$0($){var U=F$0($);if(U===$9)Vl0($.state);return U}function Fl0($,U){if(!$||!$.state)return E$;if($.state.wrap!==2)return E$;return $.state.gzhead=U,$9}function O$0($,U,Y,z,Q,J){if(!$)return E$;var I=1;if(U===lm0)U=6;if(z<0)I=0,z=-z;else if(z>15)I=2,z-=16;if(Q<1||Q>em0||Y!==GM||z<8||z>15||U<0||U>9||J<0||J>sm0)return i7($,E$);if(z===8)z=9;var K=new Ll0;return $.state=K,K.strm=$,K.wrap=I,K.gzhead=null,K.w_bits=z,K.w_size=1<X$0||U<0)return $?i7($,E$):E$;if(z=$.state,!$.output||!$.input&&$.avail_in!==0||z.status===WW&&U!==c7)return i7($,$.avail_out===0?Fy:E$);if(z.strm=$,Y=z.last_flush,z.last_flush=U,z.status===HM)if(z.wrap===2)if($.adler=0,r1(z,31),r1(z,139),r1(z,8),!z.gzhead)r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,z.level===9?2:z.strategy>=QM||z.level<2?4:0),r1(z,Hl0),z.status=rU;else{if(r1(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(!z.gzhead.extra?0:4)+(!z.gzhead.name?0:8)+(!z.gzhead.comment?0:16)),r1(z,z.gzhead.time&255),r1(z,z.gzhead.time>>8&255),r1(z,z.gzhead.time>>16&255),r1(z,z.gzhead.time>>24&255),r1(z,z.level===9?2:z.strategy>=QM||z.level<2?4:0),r1(z,z.gzhead.os&255),z.gzhead.extra&&z.gzhead.extra.length)r1(z,z.gzhead.extra.length&255),r1(z,z.gzhead.extra.length>>8&255);if(z.gzhead.hcrc)$.adler=x7($.adler,z.pending_buf,z.pending,0);z.gzindex=0,z.status=My}else{var I=GM+(z.w_bits-8<<4)<<8,K=-1;if(z.strategy>=QM||z.level<2)K=0;else if(z.level<6)K=1;else if(z.level===6)K=2;else K=3;if(I|=K<<6,z.strstart!==0)I|=Gl0;if(I+=31-I%31,z.status=rU,HW(z,I),z.strstart!==0)HW(z,$.adler>>>16),HW(z,$.adler&65535);$.adler=1}if(z.status===My)if(z.gzhead.extra){Q=z.pending;while(z.gzindex<(z.gzhead.extra.length&65535)){if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(f7($),Q=z.pending,z.pending===z.pending_buf_size)break}r1(z,z.gzhead.extra[z.gzindex]&255),z.gzindex++}if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(z.gzindex===z.gzhead.extra.length)z.gzindex=0,z.status=JM}else z.status=JM;if(z.status===JM)if(z.gzhead.name){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(f7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.gzindex=0,z.status=IM}else z.status=IM;if(z.status===IM)if(z.gzhead.comment){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(f7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.status=KM}else z.status=KM;if(z.status===KM)if(z.gzhead.hcrc){if(z.pending+2>z.pending_buf_size)f7($);if(z.pending+2<=z.pending_buf_size)r1(z,$.adler&255),r1(z,$.adler>>8&255),$.adler=0,z.status=rU}else z.status=rU;if(z.pending!==0){if(f7($),$.avail_out===0)return z.last_flush=-1,$9}else if($.avail_in===0&&q$0(U)<=q$0(Y)&&U!==c7)return i7($,Fy);if(z.status===WW&&$.avail_in!==0)return i7($,Fy);if($.avail_in!==0||z.lookahead!==0||U!==tU&&z.status!==WW){var G=z.strategy===QM?ql0(z,U):z.strategy===rm0?Zl0(z,U):HJ[z.level].func(z,U);if(G===sU||G===WJ)z.status=WW;if(G===P6||G===sU){if($.avail_out===0)z.last_flush=-1;return $9}if(G===XW){if(U===pm0)j$._tr_align(z);else if(U!==X$0){if(j$._tr_stored_block(z,0,0,!1),U===dm0){if(u7(z.head),z.lookahead===0)z.strstart=0,z.block_start=0,z.insert=0}}if(f7($),$.avail_out===0)return z.last_flush=-1,$9}}if(U!==c7)return $9;if(z.wrap<=0)return Z$0;if(z.wrap===2)r1(z,$.adler&255),r1(z,$.adler>>8&255),r1(z,$.adler>>16&255),r1(z,$.adler>>24&255),r1(z,$.total_in&255),r1(z,$.total_in>>8&255),r1(z,$.total_in>>16&255),r1(z,$.total_in>>24&255);else HW(z,$.adler>>>16),HW(z,$.adler&65535);if(f7($),z.wrap>0)z.wrap=-z.wrap;return z.pending!==0?$9:Z$0}function Ml0($){var U;if(!$||!$.state)return E$;if(U=$.state.status,U!==HM&&U!==My&&U!==JM&&U!==IM&&U!==KM&&U!==rU&&U!==WW)return i7($,E$);return $.state=null,U===rU?i7($,mm0):$9}function Nl0($,U){var Y=U.length,z,Q,J,I,K,G,H,W;if(!$||!$.state)return E$;if(z=$.state,I=z.wrap,I===2||I===1&&z.status!==HM||z.lookahead)return E$;if(I===1)$.adler=V$0($.adler,U,Y,0);if(z.wrap=0,Y>=z.w_size){if(I===0)u7(z.head),z.strstart=0,z.block_start=0,z.insert=0;W=new j8.Buf8(z.w_size),j8.arraySet(W,U,Y-z.w_size,z.w_size,0),U=W,Y=z.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=Y,$.next_in=0,$.input=U,aU(z);while(z.lookahead>=f1){Q=z.strstart,J=z.lookahead-(f1-1);do z.ins_h=(z.ins_h<{var WM=J3(),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 WM.Buf8(256);for(U9=0;U9<256;U9++)ZW[U9]=U9>=252?6:U9>=248?5:U9>=240?4:U9>=224?3:U9>=192?2:1;var U9;ZW[254]=ZW[254]=1;vl0.string2buf=function($){var U,Y,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,U[J++]=128|Y&63;else if(Y<65536)U[J++]=224|Y>>>12,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63;else U[J++]=240|Y>>>18,U[J++]=128|Y>>>12&63,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63}return U};function A$0($,U){if(U<65534){if($.subarray&&D$0||!$.subarray&&N$0)return String.fromCharCode.apply(null,WM.shrinkBuf($,U))}var Y="";for(var z=0;z4){K[z++]=65533,Y+=J-1;continue}Q&=J===2?31:J===3?15:7;while(J>1&&Y1){K[z++]=65533;continue}if(Q<65536)K[z++]=Q;else Q-=65536,K[z++]=55296|Q>>10&1023,K[z++]=56320|Q&1023}return A$0(K,z)};vl0.utf8border=function($,U){var Y;if(U=U||$.length,U>$.length)U=$.length;Y=U-1;while(Y>=0&&($[Y]&192)===128)Y--;if(Y<0)return U;if(Y===0)return U;return Y+ZW[$[Y]]>U?Y:U}});var Dy=E((_p1,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=M$0(),VW=J3(),Py=Ny(),By=zM(),fl0=Dy(),j$0=Object.prototype.toString,ul0=0,Ay=4,XJ=0,B$0=1,T$0=2,bl0=-1,il0=0,cl0=8;function eU($){if(!(this instanceof eU))return new eU($);this.options=VW.assign({level:bl0,method:cl0,chunkSize:16384,windowBits:15,memLevel:8,strategy:il0,to:""},$||{});var U=this.options;if(U.raw&&U.windowBits>0)U.windowBits=-U.windowBits;else if(U.gzip&&U.windowBits>0&&U.windowBits<16)U.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new fl0,this.strm.avail_out=0;var Y=qW.deflateInit2(this.strm,U.level,U.method,U.windowBits,U.memLevel,U.strategy);if(Y!==XJ)throw Error(By[Y]);if(U.header)qW.deflateSetHeader(this.strm,U.header);if(U.dictionary){var z;if(typeof U.dictionary==="string")z=Py.string2buf(U.dictionary);else if(j$0.call(U.dictionary)==="[object ArrayBuffer]")z=new Uint8Array(U.dictionary);else z=U.dictionary;if(Y=qW.deflateSetDictionary(this.strm,z),Y!==XJ)throw Error(By[Y]);this._dict_set=!0}}eU.prototype.push=function($,U){var Y=this.strm,z=this.options.chunkSize,Q,J;if(this.ended)return!1;if(J=U===~~U?U:U===!0?Ay:ul0,typeof $==="string")Y.input=Py.string2buf($);else if(j$0.call($)==="[object ArrayBuffer]")Y.input=new Uint8Array($);else Y.input=$;Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0)Y.output=new VW.Buf8(z),Y.next_out=0,Y.avail_out=z;if(Q=qW.deflate(Y,J),Q!==B$0&&Q!==XJ)return this.onEnd(Q),this.ended=!0,!1;if(Y.avail_out===0||Y.avail_in===0&&(J===Ay||J===T$0))if(this.options.to==="string")this.onData(Py.buf2binstring(VW.shrinkBuf(Y.output,Y.next_out)));else this.onData(VW.shrinkBuf(Y.output,Y.next_out))}while((Y.avail_in>0||Y.avail_out===0)&&Q!==B$0);if(J===Ay)return Q=qW.deflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===XJ;if(J===T$0)return this.onEnd(XJ),Y.avail_out=0,!0;return!0};eU.prototype.onData=function($){this.chunks.push($)};eU.prototype.onEnd=function($){if($===XJ)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($,U){var Y=new eU(U);if(Y.push($,!0),Y.err)throw Y.msg||By[Y.err];return Y.result}function nl0($,U){return U=U||{},U.raw=!0,Ty($,U)}function pl0($,U){return U=U||{},U.gzip=!0,Ty($,U)}dl0.Deflate=eU;dl0.deflate=Ty;dl0.deflateRaw=nl0;dl0.gzip=pl0});var R$0=E((hp1,C$0)=>{var XM=30,sl0=12;C$0.exports=function(U,Y){var z,Q,J,I,K,G,H,W,X,Z,q,V,F,O,w,M,N,D,B,T,A,j,C,b,x;z=U.state,Q=U.next_in,b=U.input,J=Q+(U.avail_in-5),I=U.next_out,x=U.output,K=I-(Y-U.avail_out),G=I+(U.avail_out-257),H=z.dmax,W=z.wsize,X=z.whave,Z=z.wnext,q=z.window,V=z.hold,F=z.bits,O=z.lencode,w=z.distcode,M=(1<>>24,V>>>=B,F-=B,B=D>>>16&255,B===0)x[I++]=D&65535;else if(B&16){if(T=D&65535,B&=15,B){if(F>>=B,F-=B}if(F<15)V+=b[Q++]<>>24,V>>>=B,F-=B,B=D>>>16&255,B&16){if(A=D&65535,B&=15,FH){U.msg="invalid distance too far back",z.mode=XM;break $}if(V>>>=B,F-=B,B=I-K,A>B){if(B=A-B,B>X){if(z.sane){U.msg="invalid distance too far back",z.mode=XM;break $}}if(j=0,C=q,Z===0){if(j+=W-B,B2)x[I++]=C[j++],x[I++]=C[j++],x[I++]=C[j++],T-=3;if(T){if(x[I++]=C[j++],T>1)x[I++]=C[j++]}}else{j=I-A;do x[I++]=x[j++],x[I++]=x[j++],x[I++]=x[j++],T-=3;while(T>2);if(T){if(x[I++]=x[j++],T>1)x[I++]=x[j++]}}}else if((B&64)===0){D=w[(D&65535)+(V&(1<>3,Q-=T,F-=T<<3,V&=(1<{var _$0=J3(),ZJ=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(U,Y,z,Q,J,I,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,O=0,w=0,M=0,N=0,D,B,T,A,j,C=null,b=0,x,h=new _$0.Buf16(ZJ+1),i=new _$0.Buf16(ZJ+1),c=null,z0=0,k,d,t;for(W=0;W<=ZJ;W++)h[W]=0;for(X=0;X=1;q--)if(h[q]!==0)break;if(V>q)V=q;if(q===0)return J[I++]=20971520,J[I++]=20971520,G.bits=1,0;for(Z=1;Z0&&(U===S$0||q!==1))return-1;i[1]=0;for(W=1;Wv$0||U===g$0&&M>h$0)return 1;for(;;){if(k=W-O,K[X]x)d=c[z0+K[X]],t=C[b+K[X]];else d=96,t=0;D=1<>O)+B]=k<<24|d<<16|t|0;while(B!==0);D=1<>=1;if(D!==0)N&=D-1,N+=D;else N=0;if(X++,--h[W]===0){if(W===q)break;W=Y[z+K[X]]}if(W>V&&(N&A)!==T){if(O===0)O=V;j+=Z,F=W-O,w=1<v$0||U===g$0&&M>h$0)return 1;T=N&A,J[T]=V<<24|F<<16|j-I|0}}if(N!==0)J[j+N]=W-O<<24|4194304|0;return G.bits=V,0}});var w50=E((Mo0)=>{var K$=J3(),hy=Vy(),Y9=Ly(),Uo0=R$0(),LW=k$0(),Yo0=0,G50=1,H50=2,x$0=4,zo0=5,ZM=6,$Y=0,Qo0=1,Jo0=2,C$=-2,W50=-3,Sy=-4,Io0=-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,LM=11,K3=12,Ey=13,o$0=14,Cy=15,r$0=16,s$0=17,a$0=18,t$0=19,qM=20,VM=21,e$0=22,$50=23,U50=24,Y50=25,z50=26,Ry=27,Q50=28,J50=29,y4=30,gy=31,Ko0=32,Go0=852,Ho0=592,Wo0=15,Xo0=Wo0;function I50($){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 U;if(!$||!$.state)return C$;if(U=$.state,$.total_in=$.total_out=U.total=0,$.msg="",U.wrap)$.adler=U.wrap&1;return U.mode=X50,U.last=0,U.havedict=0,U.dmax=32768,U.head=null,U.hold=0,U.bits=0,U.lencode=U.lendyn=new K$.Buf32(Go0),U.distcode=U.distdyn=new K$.Buf32(Ho0),U.sane=1,U.back=-1,$Y}function q50($){var U;if(!$||!$.state)return C$;return U=$.state,U.wsize=0,U.whave=0,U.wnext=0,Z50($)}function V50($,U){var Y,z;if(!$||!$.state)return C$;if(z=$.state,U<0)Y=0,U=-U;else if(Y=(U>>4)+1,U<48)U&=15;if(U&&(U<8||U>15))return C$;if(z.window!==null&&z.wbits!==U)z.window=null;return z.wrap=Y,z.wbits=U,q50($)}function L50($,U){var Y,z;if(!$)return C$;if(z=new Zo0,$.state=z,z.window=null,Y=V50($,U),Y!==$Y)$.state=null;return Y}function qo0($){return L50($,Xo0)}var K50=!0,_y,vy;function Vo0($){if(K50){var U;_y=new K$.Buf32(512),vy=new K$.Buf32(32),U=0;while(U<144)$.lens[U++]=8;while(U<256)$.lens[U++]=9;while(U<280)$.lens[U++]=7;while(U<288)$.lens[U++]=8;LW(G50,$.lens,0,288,_y,0,$.work,{bits:9}),U=0;while(U<32)$.lens[U++]=5;LW(H50,$.lens,0,32,vy,0,$.work,{bits:5}),K50=!1}$.lencode=_y,$.lenbits=9,$.distcode=vy,$.distbits=5}function F50($,U,Y,z){var Q,J=$.state;if(J.window===null)J.wsize=1<=J.wsize)K$.arraySet(J.window,U,Y-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize;else{if(Q=J.wsize-J.wnext,Q>z)Q=z;if(K$.arraySet(J.window,U,Y-z,Q,J.wnext),z-=Q,z)K$.arraySet(J.window,U,Y-z,z,0),J.wnext=z,J.whave=J.wsize;else{if(J.wnext+=Q,J.wnext===J.wsize)J.wnext=0;if(J.whave>>8&255,Y.check=Y9(Y.check,C,2,0),H=0,W=0,Y.mode=u$0;break}if(Y.flags=0,Y.head)Y.head.done=!1;if(!(Y.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",Y.mode=y4;break}if((H&15)!==f$0){$.msg="unknown compression method",Y.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,Y.wbits===0)Y.wbits=A;else if(A>Y.wbits){$.msg="invalid window size",Y.mode=y4;break}Y.dmax=1<>8&1;if(Y.flags&512)C[0]=H&255,C[1]=H>>>8&255,Y.check=Y9(Y.check,C,2,0);H=0,W=0,Y.mode=b$0;case b$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,Y.check=Y9(Y.check,C,4,0);H=0,W=0,Y.mode=i$0;case i$0:while(W<16){if(K===0)break $;K--,H+=z[J++]<>8;if(Y.flags&512)C[0]=H&255,C[1]=H>>>8&255,Y.check=Y9(Y.check,C,2,0);H=0,W=0,Y.mode=c$0;case c$0:if(Y.flags&1024){while(W<16){if(K===0)break $;K--,H+=z[J++]<>>8&255,Y.check=Y9(Y.check,C,2,0);H=0,W=0}else if(Y.head)Y.head.extra=null;Y.mode=n$0;case n$0:if(Y.flags&1024){if(q=Y.length,q>K)q=K;if(q){if(Y.head){if(A=Y.head.extra_len-Y.length,!Y.head.extra)Y.head.extra=Array(Y.head.extra_len);K$.arraySet(Y.head.extra,z,J,q,A)}if(Y.flags&512)Y.check=Y9(Y.check,z,q,J);K-=q,J+=q,Y.length-=q}if(Y.length)break $}Y.length=0,Y.mode=p$0;case p$0:if(Y.flags&2048){if(K===0)break $;q=0;do if(A=z[J+q++],Y.head&&A&&Y.length<65536)Y.head.name+=String.fromCharCode(A);while(A&&q>9&1,Y.head.done=!0;$.adler=Y.check=0,Y.mode=K3;break;case l$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>=W&7,W-=W&7,Y.mode=Ry;break}while(W<3){if(K===0)break $;K--,H+=z[J++]<>>=1,W-=1,H&3){case 0:Y.mode=o$0;break;case 1:if(Vo0(Y),Y.mode=qM,U===ZM){H>>>=2,W-=2;break $}break;case 2:Y.mode=s$0;break;case 3:$.msg="invalid block type",Y.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+=z[J++]<>>16^65535)){$.msg="invalid stored block lengths",Y.mode=y4;break}if(Y.length=H&65535,H=0,W=0,Y.mode=Cy,U===ZM)break $;case Cy:Y.mode=r$0;case r$0:if(q=Y.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;K$.arraySet(Q,z,J,q,I),K-=q,J+=q,G-=q,I+=q,Y.length-=q;break}Y.mode=K3;break;case s$0:while(W<14){if(K===0)break $;K--,H+=z[J++]<>>=5,W-=5,Y.ndist=(H&31)+1,H>>>=5,W-=5,Y.ncode=(H&15)+4,H>>>=4,W-=4,Y.nlen>286||Y.ndist>30){$.msg="too many length or distance symbols",Y.mode=y4;break}Y.have=0,Y.mode=a$0;case a$0:while(Y.have>>=3,W-=3}while(Y.have<19)Y.lens[h[Y.have++]]=0;if(Y.lencode=Y.lendyn,Y.lenbits=7,b={bits:Y.lenbits},j=LW(Yo0,Y.lens,0,19,Y.lencode,0,Y.work,b),Y.lenbits=b.bits,j){$.msg="invalid code lengths set",Y.mode=y4;break}Y.have=0,Y.mode=t$0;case t$0:while(Y.have>>24,M=O>>>16&255,N=O&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=w,W-=w,Y.lens[Y.have++]=N;else{if(N===16){x=w+2;while(W>>=w,W-=w,Y.have===0){$.msg="invalid bit length repeat",Y.mode=y4;break}A=Y.lens[Y.have-1],q=3+(H&3),H>>>=2,W-=2}else if(N===17){x=w+3;while(W>>=w,W-=w,A=0,q=3+(H&7),H>>>=3,W-=3}else{x=w+7;while(W>>=w,W-=w,A=0,q=11+(H&127),H>>>=7,W-=7}if(Y.have+q>Y.nlen+Y.ndist){$.msg="invalid bit length repeat",Y.mode=y4;break}while(q--)Y.lens[Y.have++]=A}}if(Y.mode===y4)break;if(Y.lens[256]===0){$.msg="invalid code -- missing end-of-block",Y.mode=y4;break}if(Y.lenbits=9,b={bits:Y.lenbits},j=LW(G50,Y.lens,0,Y.nlen,Y.lencode,0,Y.work,b),Y.lenbits=b.bits,j){$.msg="invalid literal/lengths set",Y.mode=y4;break}if(Y.distbits=6,Y.distcode=Y.distdyn,b={bits:Y.distbits},j=LW(H50,Y.lens,Y.nlen,Y.ndist,Y.distcode,0,Y.work,b),Y.distbits=b.bits,j){$.msg="invalid distances set",Y.mode=y4;break}if(Y.mode=qM,U===ZM)break $;case qM:Y.mode=VM;case VM:if(K>=6&&G>=258){if($.next_out=I,$.avail_out=G,$.next_in=J,$.avail_in=K,Y.hold=H,Y.bits=W,Uo0($,Z),I=$.next_out,Q=$.output,G=$.avail_out,J=$.next_in,z=$.input,K=$.avail_in,H=Y.hold,W=Y.bits,Y.mode===K3)Y.back=-1;break}Y.back=0;for(;;){if(O=Y.lencode[H&(1<>>24,M=O>>>16&255,N=O&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=O>>>24,M=O>>>16&255,N=O&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,Y.back+=D}if(H>>>=w,W-=w,Y.back+=w,Y.length=N,M===0){Y.mode=z50;break}if(M&32){Y.back=-1,Y.mode=K3;break}if(M&64){$.msg="invalid literal/length code",Y.mode=y4;break}Y.extra=M&15,Y.mode=e$0;case e$0:if(Y.extra){x=Y.extra;while(W>>=Y.extra,W-=Y.extra,Y.back+=Y.extra}Y.was=Y.length,Y.mode=$50;case $50:for(;;){if(O=Y.distcode[H&(1<>>24,M=O>>>16&255,N=O&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=O>>>24,M=O>>>16&255,N=O&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,Y.back+=D}if(H>>>=w,W-=w,Y.back+=w,M&64){$.msg="invalid distance code",Y.mode=y4;break}Y.offset=N,Y.extra=M&15,Y.mode=U50;case U50:if(Y.extra){x=Y.extra;while(W>>=Y.extra,W-=Y.extra,Y.back+=Y.extra}if(Y.offset>Y.dmax){$.msg="invalid distance too far back",Y.mode=y4;break}Y.mode=Y50;case Y50:if(G===0)break $;if(q=Z-G,Y.offset>q){if(q=Y.offset-q,q>Y.whave){if(Y.sane){$.msg="invalid distance too far back",Y.mode=y4;break}}if(q>Y.wnext)q-=Y.wnext,V=Y.wsize-q;else V=Y.wnext-q;if(q>Y.length)q=Y.length;F=Y.window}else F=Q,V=I-Y.offset,q=Y.length;if(q>G)q=G;G-=q,Y.length-=q;do Q[I++]=F[V++];while(--q);if(Y.length===0)Y.mode=VM;break;case z50:if(G===0)break $;Q[I++]=Y.length,G--,Y.mode=VM;break;case Ry:if(Y.wrap){while(W<32){if(K===0)break $;K--,H|=z[J++]<{O50.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((kp1,M50)=>{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}M50.exports=_o0});var A50=E((go0)=>{var qJ=w50(),FW=J3(),FM=Ny(),G6=yy(),ky=zM(),vo0=Dy(),ho0=N50(),D50=Object.prototype.toString;function UY($){if(!(this instanceof UY))return new UY($);this.options=FW.assign({chunkSize:16384,windowBits:0,to:""},$||{});var U=this.options;if(U.raw&&U.windowBits>=0&&U.windowBits<16){if(U.windowBits=-U.windowBits,U.windowBits===0)U.windowBits=-15}if(U.windowBits>=0&&U.windowBits<16&&!($&&$.windowBits))U.windowBits+=32;if(U.windowBits>15&&U.windowBits<48){if((U.windowBits&15)===0)U.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vo0,this.strm.avail_out=0;var Y=qJ.inflateInit2(this.strm,U.windowBits);if(Y!==G6.Z_OK)throw Error(ky[Y]);if(this.header=new ho0,qJ.inflateGetHeader(this.strm,this.header),U.dictionary){if(typeof U.dictionary==="string")U.dictionary=FM.string2buf(U.dictionary);else if(D50.call(U.dictionary)==="[object ArrayBuffer]")U.dictionary=new Uint8Array(U.dictionary);if(U.raw){if(Y=qJ.inflateSetDictionary(this.strm,U.dictionary),Y!==G6.Z_OK)throw Error(ky[Y])}}}UY.prototype.push=function($,U){var Y=this.strm,z=this.options.chunkSize,Q=this.options.dictionary,J,I,K,G,H,W=!1;if(this.ended)return!1;if(I=U===~~U?U:U===!0?G6.Z_FINISH:G6.Z_NO_FLUSH,typeof $==="string")Y.input=FM.binstring2buf($);else if(D50.call($)==="[object ArrayBuffer]")Y.input=new Uint8Array($);else Y.input=$;Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0)Y.output=new FW.Buf8(z),Y.next_out=0,Y.avail_out=z;if(J=qJ.inflate(Y,G6.Z_NO_FLUSH),J===G6.Z_NEED_DICT&&Q)J=qJ.inflateSetDictionary(this.strm,Q);if(J===G6.Z_BUF_ERROR&&W===!0)J=G6.Z_OK,W=!1;if(J!==G6.Z_STREAM_END&&J!==G6.Z_OK)return this.onEnd(J),this.ended=!0,!1;if(Y.next_out){if(Y.avail_out===0||J===G6.Z_STREAM_END||Y.avail_in===0&&(I===G6.Z_FINISH||I===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=FM.utf8border(Y.output,Y.next_out),G=Y.next_out-K,H=FM.buf2string(Y.output,K),Y.next_out=G,Y.avail_out=z-G,G)FW.arraySet(Y.output,Y.output,K,G,0);this.onData(H)}else this.onData(FW.shrinkBuf(Y.output,Y.next_out))}if(Y.avail_in===0&&Y.avail_out===0)W=!0}while((Y.avail_in>0||Y.avail_out===0)&&J!==G6.Z_STREAM_END);if(J===G6.Z_STREAM_END)I=G6.Z_FINISH;if(I===G6.Z_FINISH)return J=qJ.inflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===G6.Z_OK;if(I===G6.Z_SYNC_FLUSH)return this.onEnd(G6.Z_OK),Y.avail_out=0,!0;return!0};UY.prototype.onData=function($){this.chunks.push($)};UY.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($,U){var Y=new UY(U);if(Y.push($,!0),Y.err)throw Y.msg||ky[Y.err];return Y.result}function So0($,U){return U=U||{},U.raw=!0,xy($,U)}go0.Inflate=UY;go0.inflate=xy;go0.inflateRaw=So0;go0.ungzip=xy});var T50=E((fp1,B50)=>{var uo0=J3().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(),wM=I$(),do0=no0?"uint8array":"array";mo0.magic="\b\x00";function YY($,U){wM.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=U,this.meta={}}j50.inherits(YY,wM);YY.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(j50.transformTo(do0,$.data),!1)};YY.prototype.flush=function(){if(wM.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};YY.prototype.cleanUp=function(){wM.prototype.cleanUp.call(this),this._pako=null};YY.prototype._createPako=function(){this._pako=new po0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(U){$.push({data:U,meta:$.meta})}};mo0.compressWorker=function($){return new YY("Deflate",$)};mo0.uncompressWorker=function(){return new YY("Inflate",{})}});var fy=E((so0)=>{var C50=I$();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((cp1,v50)=>{var VJ=c4(),LJ=I$(),by=QJ(),R50=eO(),OM=uy(),M4=function($,U){var Y="",z;for(z=0;z>>8;return Y},Ir0=function($,U){var Y=$;if(!$)Y=U?16893:33204;return(Y&65535)<<16},Kr0=function($){return($||0)&63},_50=function($,U,Y,z,Q,J){var{file:I,compression:K}=$,G=J!==by.utf8encode,H=VJ.transformTo("string",J(I.name)),W=VJ.transformTo("string",by.utf8encode(I.name)),X=I.comment,Z=VJ.transformTo("string",J(X)),q=VJ.transformTo("string",by.utf8encode(X)),V=W.length!==I.name.length,F=q.length!==X.length,O,w,M="",N="",D="",B=I.dir,T=I.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!U||Y)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(U)j|=8;if(!G&&(V||F))j|=2048;var C=0,b=0;if(B)C|=16;if(Q==="UNIX")b=798,C|=Ir0(I.unixPermissions,B);else b=20,C|=Kr0(I.dosPermissions,B);if(O=T.getUTCHours(),O=O<<6,O=O|T.getUTCMinutes(),O=O<<5,O=O|T.getUTCSeconds()/2,w=T.getUTCFullYear()-1980,w=w<<4,w=w|T.getUTCMonth()+1,w=w<<5,w=w|T.getUTCDate(),V)N=M4(1,1)+M4(R50(H),4)+W,M+="up"+M4(N.length,2)+N;if(F)D=M4(1,1)+M4(R50(Z),4)+q,M+="uc"+M4(D.length,2)+D;var x="";x+=` + deps: ${W}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=J(G);I(G,H),K(G,W)}};function J({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 I(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 O=(0,z.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(O,()=>{for(let w of F)(0,z.checkReportMissingProp)(G,w)});else W.if(U._`${O} && (${(0,z.checkMissingProp)(G,F,q)})`),(0,z.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=I;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,Y.alwaysValidSchema)(q,H[F]))continue;W.if((0,z.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let O=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(O,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>U._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q;if((0,Y.alwaysValidSchema)(G,I))return;let H=J.name("valid");J.forIn("key",K,(W)=>{Q.setParams({propertyName:W}),Q.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),J.if((0,U.not)(H),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(H)}};$.default=z}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=L1(),z=z5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>Y._`{additionalProperty: ${I.additionalProperty}}`},code(I){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=I;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,U.allSchemaProperties)(H.properties),O=(0,U.allSchemaProperties)(H.patternProperties);w(),I.ok(Y._`${X} === ${z.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!O.length)D(T);else K.if(M(T),()=>D(T))})}function M(T){let A;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,H.properties,"properties");A=(0,U.isOwnProperty)(K,j,T)}else if(F.length)A=(0,Y.or)(...F.map((j)=>Y._`${T} === ${j}`));else A=Y.nil;if(O.length)A=(0,Y.or)(A,...O.map((j)=>Y._`${(0,U.usePattern)(I,j)}.test(${T})`));return(0,Y.not)(A)}function N(T){K.code(Y._`delete ${W}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){N(T);return}if(G===!1){if(I.setParams({additionalProperty:T}),I.error(),!q)K.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")B(T,A,!1),K.if((0,Y.not)(A),()=>{I.reset(),N(T)});else if(B(T,A),!q)K.if((0,Y.not)(A),()=>K.break())}}function B(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,A)}}};$.default=J}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=SQ(),Y=Q5(),z=v1(),Q=at(),J={keyword:"properties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=I;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)Q.default.code(new U.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,Y.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=z.mergeEvaluated.props(K,(0,z.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,z.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))O(w);else{if(K.if((0,Y.propertyInData)(K,W,w,X.opts.ownProperties)),O(w),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(w),I.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function O(w){I.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=L1(),z=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=I,{opts:Z}=X,q=(0,U.allSchemaProperties)(G),V=q.filter((B)=>(0,z.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,O=K.name("valid");if(X.props!==!0&&!(X.props instanceof Y.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:w}=X;M();function M(){for(let B of q){if(F)N(B);if(X.allErrors)D(B);else K.var(O,!0),D(B),K.if(O)}}function N(B){for(let T in F)if(new RegExp(B).test(T))(0,z.checkStrictMode)(X,`property ${T} matches pattern ${B} (use allowMatchingProperties)`)}function D(B){K.forIn("key",H,(T)=>{K.if(Y._`${(0,U.usePattern)(I,B)}.test(${T})`,()=>{let A=V.includes(B);if(!A)I.subschema({keyword:"patternProperties",schemaProp:B,dataProp:T,dataPropType:Q.Type.Str},O);if(X.opts.unevaluated&&w!==!0)K.assign(Y._`${w}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,Y.not)(O),()=>K.break())})})}}};$.default=J}),Ib0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(z){let{gen:Q,schema:J,it:I}=z;if((0,U.alwaysValidSchema)(I,J)){z.fail();return}let K=Q.name("valid");z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),z.failResult(K,()=>z.reset(),()=>z.error())},error:{message:"must NOT be valid"}};$.default=Y}),Kb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Q5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=U}),Gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:Q})=>U._`{passingSchemas: ${Q.passing}}`},code(Q){let{gen:J,schema:I,parentSchema:K,it:G}=Q;if(!Array.isArray(I))throw Error("ajv implementation error");if(G.opts.discriminator&&K.discriminator)return;let H=I,W=J.let("valid",!1),X=J.let("passing",null),Z=J.name("_valid");Q.setParams({passing:X}),J.block(q),Q.result(W,()=>Q.reset(),()=>Q.error(!0));function q(){H.forEach((V,F)=>{let O;if((0,Y.alwaysValidSchema)(G,V))J.var(Z,!0);else O=Q.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},Z);if(F>0)J.if(U._`${Z} && ${W}`).assign(W,!1).assign(X,U._`[${X}, ${F}]`).else();J.if(Z,()=>{if(J.assign(W,!0),J.assign(X,F),O)Q.mergeEvaluated(O,U.Name)})})}}};$.default=z}),Hb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:"allOf",schemaType:"array",code(z){let{gen:Q,schema:J,it:I}=z;if(!Array.isArray(J))throw Error("ajv implementation error");let K=Q.name("valid");J.forEach((G,H)=>{if((0,U.alwaysValidSchema)(I,G))return;let W=z.subschema({keyword:"allOf",schemaProp:H},K);z.ok(K),z.mergeEvaluated(W)})}};$.default=Y}),Wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:J})=>U.str`must match "${J.ifClause}" schema`,params:({params:J})=>U._`{failingKeyword: ${J.ifClause}}`},code(J){let{gen:I,parentSchema:K,it:G}=J;if(K.then===void 0&&K.else===void 0)(0,Y.checkStrictMode)(G,'"if" without "then" and "else" is ignored');let H=Q(G,"then"),W=Q(G,"else");if(!H&&!W)return;let X=I.let("valid",!0),Z=I.name("_valid");if(q(),J.reset(),H&&W){let F=I.let("ifClause");J.setParams({ifClause:F}),I.if(Z,V("then",F),V("else",F))}else if(H)I.if(Z,V("then"));else I.if((0,U.not)(Z),V("else"));J.pass(X,()=>J.error(!0));function q(){let F=J.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);J.mergeEvaluated(F)}function V(F,O){return()=>{let w=J.subschema({keyword:F},Z);if(I.assign(X,Z),J.mergeValidEvaluated(w,X),O)I.assign(O,U._`${F}`);else J.setParams({ifClause:F})}}}};function Q(J,I){let K=J.schema[I];return K!==void 0&&!(0,Y.alwaysValidSchema)(J,K)}$.default=z}),Xb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:z,parentSchema:Q,it:J}){if(Q.if===void 0)(0,U.checkStrictMode)(J,`"${z}" without "if" is ignored`)}};$.default=Y}),tt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=rt(),Y=$b0(),z=st(),Q=Ub0(),J=Yb0(),I=KS(),K=zb0(),G=at(),H=Qb0(),W=Jb0(),X=Ib0(),Z=Kb0(),q=Gb0(),V=Hb0(),F=Wb0(),O=Xb0();function w(M=!1){let N=[X.default,Z.default,q.default,V.default,F.default,O.default,K.default,G.default,I.default,H.default,W.default];if(M)N.push(Y.default,Q.default);else N.push(U.default,z.default);return N.push(J.default),N}$.default=w}),Zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:z})=>U.str`must match format "${z}"`,params:({schemaCode:z})=>U._`{format: ${z}}`},code(z,Q){let{gen:J,data:I,$data:K,schema:G,schemaCode:H,it:W}=z,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else O();function F(){let w=J.scopeValue("formats",{ref:V.formats,code:X.code.formats}),M=J.const("fDef",U._`${w}[${H}]`),N=J.let("fType"),D=J.let("format");J.if(U._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>J.assign(N,U._`${M}.type || "string"`).assign(D,U._`${M}.validate`),()=>J.assign(N,U._`"string"`).assign(D,M)),z.fail$data((0,U.or)(B(),T()));function B(){if(X.strictSchema===!1)return U.nil;return U._`${H} && !${D}`}function T(){let A=q.$async?U._`(${M}.async ? await ${D}(${I}) : ${D}(${I}))`:U._`${D}(${I})`,j=U._`(typeof ${D} == "function" ? ${A} : ${D}.test(${I}))`;return U._`${D} && ${D} !== true && ${N} === ${Q} && !${j}`}}function O(){let w=V.formats[G];if(!w){B();return}if(w===!0)return;let[M,N,D]=T(w);if(M===Q)z.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,U.regexpCode)(j):X.code.formats?U._`${X.code.formats}${(0,U.getProperty)(G)}`:void 0,b=J.scopeValue("formats",{key:G,ref:j,code:C});if(typeof j=="object"&&!(j instanceof RegExp))return[j.type||"string",j.validate,U._`${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 U._`await ${D}(${I})`}return typeof N=="function"?U._`${D}(${I})`:U._`${D}.test(${I})`}}}};$.default=Y}),et=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=[Zb0().default];$.default=U}),$e=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Ue=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=lt(),Y=ot(),z=tt(),Q=et(),J=$e(),I=[U.default,Y.default,(0,z.default)(),Q.default,J.metadataVocabulary,J.contentVocabulary];$.default=I}),qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var U;(function(Y){Y.Tag="tag",Y.Mapping="mapping"})(U||($.DiscrError=U={}))}),GS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=qb0(),z=yw(),Q=gQ(),J=v1(),I={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===Y.DiscrError.Tag?`tag "${G}" must be string`:`value of tag "${G}" must be in oneOf`,params:({params:{discrError:K,tag:G,tagName:H}})=>U._`{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),O=G.const("tag",U._`${H}${(0,U.getProperty)(V)}`);G.if(U._`typeof ${O} == "string"`,()=>w(),()=>K.error(!1,{discrError:Y.DiscrError.Tag,tag:O,tagName:V})),K.ok(F);function w(){let D=N();G.if(!1);for(let B in D)G.elseIf(U._`${O} === ${B}`),G.assign(F,M(D[B]));G.else(),K.error(!1,{discrError:Y.DiscrError.Mapping,tag:O,tagName:V}),G.endIf()}function M(D){let B=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:D},B);return K.mergeEvaluated(T,U.Name),B}function N(){var D;let B={},T=j(X),A=!0;for(let x=0;x{U.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}}),Ye=R0(($,U)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let Y=QS(),z=Ue(),Q=GS(),J=Vb0(),I=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends Y.default{_addVocabularies(){if(super._addVocabularies(),z.default.forEach((q)=>this.addVocabulary(q)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let q=this.opts.$data?this.$dataMetaSchema(J,I):J;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,U.exports=$=G,U.exports.Ajv=G,Object.defineProperty($,"__esModule",{value:!0}),$.default=G;var H=SQ();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=gQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),ze=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let U=L1(),Y=z5(),z=yw(),Q=JS(),J={keyword:"$dynamicAnchor",schemaType:"string",code:(G)=>I(G,G.schema)};function I(G,H){let{gen:W,it:X}=G;X.schemaEnv.root.dynamicAnchors[H]=!0;let Z=U._`${Y.default.dynamicAnchors}${(0,U.getProperty)(H)}`,q=X.errSchemaPath==="#"?X.validateName:K(G);W.if(U._`!${Z}`,()=>W.assign(Z,q))}$.dynamicAnchor=I;function K(G){let{schemaEnv:H,schema:W,self:X}=G.it,{root:Z,baseId:q,localRefs:V,meta:F}=H.root,{schemaId:O}=X.opts,w=new z.SchemaEnv({schema:W,schemaId:O,root:Z,baseId:q,localRefs:V,meta:F});return z.compileSchema.call(X,w),(0,Q.getValidate)(G,w)}$.default=J}),Qe=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let U=L1(),Y=z5(),z=JS(),Q={keyword:"$dynamicRef",schemaType:"string",code:(I)=>J(I,I.schema)};function J(I,K){let{gen:G,keyword:H,it:W}=I;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),I.ok(V)}function Z(V){if(W.schemaEnv.root.dynamicAnchors[X]){let F=G.let("_v",U._`${Y.default.dynamicAnchors}${(0,U.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,z.callRef)(I,V),G.let(F,!0)}):()=>(0,z.callRef)(I,V)}}$.dynamicRef=J,$.default=Q}),Lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=ze(),Y=v1(),z={keyword:"$recursiveAnchor",schemaType:"boolean",code(Q){if(Q.schema)(0,U.dynamicAnchor)(Q,"");else(0,Y.checkStrictMode)(Q.it,"$recursiveAnchor: false is ignored")}};$.default=z}),Fb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Qe(),Y={keyword:"$recursiveRef",schemaType:"string",code:(z)=>(0,U.dynamicRef)(z,z.schema)};$.default=Y}),Je=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=ze(),Y=Qe(),z=Lb0(),Q=Fb0(),J=[U.default,Y.default,z.default,Q.default];$.default=J}),wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=KS(),Y={keyword:"dependentRequired",type:"object",schemaType:"object",error:U.error,code:(z)=>(0,U.validatePropertyDeps)(z)};$.default=Y}),Ob0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=KS(),Y={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(z)=>(0,U.validateSchemaDeps)(z)};$.default=Y}),Mb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=v1(),Y={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:z,parentSchema:Q,it:J}){if(Q.contains===void 0)(0,U.checkStrictMode)(J,`"${z}" without "contains" is ignored`)}};$.default=Y}),Ie=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=wb0(),Y=Ob0(),z=Mb0(),Q=[U.default,Y.default,z.default];$.default=Q}),Nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z=z5(),Q={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:J})=>U._`{unevaluatedProperty: ${J.unevaluatedProperty}}`},code(J){let{gen:I,schema:K,data:G,errsCount:H,it:W}=J;if(!H)throw Error("ajv implementation error");let{allErrors:X,props:Z}=W;if(Z instanceof U.Name)I.if(U._`${Z} !== true`,()=>I.forIn("key",G,(O)=>I.if(V(Z,O),()=>q(O))));else if(Z!==!0)I.forIn("key",G,(O)=>Z===void 0?q(O):I.if(F(Z,O),()=>q(O)));W.props=!0,J.ok(U._`${H} === ${z.default.errors}`);function q(O){if(K===!1){if(J.setParams({unevaluatedProperty:O}),J.error(),!X)I.break();return}if(!(0,Y.alwaysValidSchema)(W,K)){let w=I.name("valid");if(J.subschema({keyword:"unevaluatedProperties",dataProp:O,dataPropType:Y.Type.Str},w),!X)I.if((0,U.not)(w),()=>I.break())}}function V(O,w){return U._`!${O} || !${O}[${w}]`}function F(O,w){let M=[];for(let N in O)if(O[N]===!0)M.push(U._`${w} !== ${N}`);return(0,U.and)(...M)}}};$.default=Q}),Db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:Q}})=>U.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>U._`{limit: ${Q}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q,H=G.items||0;if(H===!0)return;let W=J.const("len",U._`${K}.length`);if(I===!1)Q.setParams({len:H}),Q.fail(U._`${W} > ${H}`);else if(typeof I=="object"&&!(0,Y.alwaysValidSchema)(G,I)){let Z=J.var("valid",U._`${W} <= ${H}`);J.if((0,U.not)(Z),()=>X(Z,H)),Q.ok(Z)}G.items=!0;function X(Z,q){J.forRange("i",q,W,(V)=>{if(Q.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:Y.Type.Num},Z),!G.allErrors)J.if((0,U.not)(Z),()=>J.break())})}}};$.default=z}),Ke=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Nb0(),Y=Db0(),z=[U.default,Y.default];$.default=z}),Ab0=R0(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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 U=Ab0(),Y=Pb0(),z=Bb0(),Q=Tb0(),J=jb0(),I=Eb0(),K=Cb0(),G=["/properties"];function H(W){return[U,Y,z,Q,X(this,J),I,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(($,U)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let Y=QS(),z=Ue(),Q=Je(),J=Ie(),I=Ke(),K=GS(),G=Rb0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends Y.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(Q.default),z.default.forEach((F)=>this.addVocabulary(F)),this.addVocabulary(J.default),this.addVocabulary(I.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:F,meta:O}=this.opts;if(!O)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,U.exports=$=W,U.exports.Ajv2019=W,Object.defineProperty($,"__esModule",{value:!0}),$.default=W;var X=SQ();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=gQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),vb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=lt(),Y=ot(),z=tt(),Q=Je(),J=Ie(),I=Ke(),K=et(),G=$e(),H=[Q.default,U.default,Y.default,(0,z.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,J.default,I.default];$.default=H}),hb0=R0(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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(($,U)=>{U.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 U=hb0(),Y=Sb0(),z=gb0(),Q=yb0(),J=kb0(),I=xb0(),K=fb0(),G=ub0(),H=["/properties"];function W(X){return[U,Y,z,Q,J,Z(this,I),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(($,U)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let Y=QS(),z=vb0(),Q=GS(),J=bb0(),I="https://json-schema.org/draft/2020-12/schema";var K=class extends Y.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),z.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:q}=this.opts;if(!q)return;J.default.call(this,Z),this.refs["http://json-schema.org/schema"]=I}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(I)?I:void 0)}};$.Ajv2020=K,U.exports=$=K,U.exports.Ajv2020=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K;var G=SQ();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=gQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),cb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function U(x,h){return{validate:x,compare:h}}$.fullFormats={date:U(J,I),time:U(G(!0),H),"date-time":U(Z(!0),q),"iso-time":U(G(),W),"iso-date-time":U(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:N,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:U(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,I),time:U(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H),"date-time":U(/^\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":U(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,W),"iso-date-time":U(/^\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 Y(x){return x%4===0&&(x%100!==0||x%400===0)}let z=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Q=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J(x){let h=z.exec(x);if(!h)return!1;let i=+h[1],c=+h[2],z0=+h[3];return c>=1&&c<=12&&z0>=1&&z0<=(c===2&&Y(i)?29:Q[c])}function I(x,h){if(!(x&&h))return;if(x>h)return 1;if(x23||p>59||x&&!t)return!1;if(z0<=23&&k<=59&&d<60)return!0;let e=k-p*$0,y=z0-g*$0-(e<0?1:0);return(y===23||y===-1)&&(e===59||e===-1)&&d<61}}function H(x,h){if(!(x&&h))return;let i=new Date("2020-01-01T"+x).valueOf(),c=new Date("2020-01-01T"+h).valueOf();if(!(i&&c))return;return i-c}function W(x,h){if(!(x&&h))return;let i=K.exec(x),c=K.exec(h);if(!(i&&c))return;if(x=i[1]+i[2]+i[3],h=c[1]+c[2]+c[3],x>h)return 1;if(x=D}function A(x){return Number.isInteger(x)}function j(){return!0}let C=/[^\\]\\Z/;function b(x){if(C.test(x))return!1;try{return new RegExp(x),!0}catch(h){return!1}}}),nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let U=Ye(),Y=L1(),z=Y.operators,Q={formatMaximum:{okStr:"<=",ok:z.LTE,fail:z.GT},formatMinimum:{okStr:">=",ok:z.GTE,fail:z.LT},formatExclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},formatExclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},J={message:({keyword:K,schemaCode:G})=>Y.str`should be ${Q[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>Y._`{comparison: ${Q[K].okStr}, limit: ${G}}`};$.formatLimitDefinition={keyword:Object.keys(Q),type:"string",schemaType:"string",$data:!0,error:J,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 U.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(F.$data)O();else w();function O(){let N=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",Y._`${N}[${F.schemaCode}]`);K.fail$data((0,Y.or)(Y._`typeof ${D} != "object"`,Y._`${D} instanceof RegExp`,Y._`typeof ${D}.compare != "function"`,M(D)))}function w(){let N=F.schema,D=V.formats[N];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${N}" does not define "compare" function`);let B=G.scopeValue("formats",{key:N,ref:D,code:q.code.formats?Y._`${q.code.formats}${(0,Y.getProperty)(N)}`:void 0});K.fail$data(M(B))}function M(N){return Y._`${N}.compare(${H}, ${W}) ${Q[X].fail} 0`}},dependencies:["format"]};let I=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=I}),pb0=R0(($,U)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=cb0(),z=nb0(),Q=L1(),J=new Q.Name("fullFormats"),I=new Q.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,Y.fullFormats,J),H;let[X,Z]=W.mode==="fast"?[Y.fastFormats,I]:[Y.fullFormats,J];if(G(H,W.formats||Y.formatNames,X,Z),W.keywords)(0,z.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?Y.fastFormats:Y.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=Q._`require("ajv-formats/dist/formats").${Z}`);for(let F of W)H.addFormat(F,X[F])}U.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),Ge=Ye(),db0=_b0(),mb0=ib0(),lb0=nq(pb0(),1),ob0=lb0.default;$u1=Ge.Ajv});import HS from"node:process";var xw=o(()=>{He()});function XS($){return!!$&&typeof $==="object"&&Oe in $}function sb0($){return $[Oe]?.complete}function ab0($,U){switch(U.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(U.uri)}}function tb0($,U){let Y={},z=(Q)=>U===void 0||Q===!0;if($.toolsListChanged===!0&&z(U?.tools?.listChanged))Y.toolsListChanged=!0;if($.promptsListChanged===!0&&z(U?.prompts?.listChanged))Y.promptsListChanged=!0;if($.resourcesListChanged===!0&&z(U?.resources?.listChanged))Y.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&z(U?.resources?.subscribe))Y.resourceSubscriptions=[...$.resourceSubscriptions];return Y}function We($,U){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[yU]:U}}}}function eb0($){let U=B7(XH).validateRequest("subscriptions/listen",$);return U.ok?U.value.params?.notifications:void 0}function Ui0($,U){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:U??""}}}function Qi0($){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??Yi0,roundTimeoutMs:$?.roundTimeoutMs??zi0,legacyShim:$?.legacyShim??!0}}function Ne($,U,Y){if(Y===null||typeof Y!=="object"||typeof Y.method!=="string")throw new J1(n0.InternalError,`Handler for ${$} returned an invalid input request '${U}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let z=Y,Q=Xt(z);if(Q===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${U}' of kind '${z.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:z,required:Q}}function Ji0(){let $=globalThis.crypto;if($?.randomUUID!==void 0)return $.randomUUID();let U=new Uint8Array(16);$.getRandomValues(U),U[6]=U[6]&15|64,U[8]=U[8]&63|128;let Y=[...U].map((z)=>z.toString(16).padStart(2,"0")).join("");return`${Y.slice(0,8)}-${Y.slice(8,12)}-${Y.slice(12,16)}-${Y.slice(16,20)}-${Y.slice(20)}`}function WS($,U){if($==="tools/call")return{content:[{type:"text",text:U}],isError:!0};throw new J1(n0.InternalError,U)}function ZS($,U){De($,U)}function qS($){return Ae($)}function Hi0($){return{...$}}function Xe($,U){if($){let z=U;return async(Q,J)=>z(Q,J)}let Y=U;return async(z,Q)=>Y(Q)}function qe($){if($===void 0)return;try{return E7($,"output")}catch{return}}function Ve($,U,Y){if(U){let z=Y;return async(Q,J)=>{let I=await fU(U,Q);if(!I.success)throw new J1(n0.InvalidParams,`Invalid arguments for prompt ${$}: ${I.error}`);return z(I.data,J)}}else{let z=Y;return async(Q,J)=>{return z(J)}}}function Le($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function Fe($){let U=$;if(U.shape&&typeof U.shape==="object")return U.shape}function Wi0($){return $?.type==="optional"}function we($){if(!Wi0($))return $;return $.def?.innerType??$}var Oe,fw=1024,$i0,Me=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=fw,U,Y){this._maxSubscriptions=$,this._serverCapabilities=U,this._serverInfo=Y}setServerCapabilities($,U){if(this._serverCapabilities=$,U!==void 0)this._serverInfo=U}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 U=eb0($);if(U===void 0)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let Y=tb0(U,this._serverCapabilities);return this._subs.set($.id,Y),We({method:"notifications/subscriptions/acknowledged",params:{notifications:Y}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!$i0.has($.method))return"passthrough";let U=$.params?.uri,Y=typeof U==="string"?U:void 0,z=Ui0($.method,Y),Q=[];for(let[J,I]of this._subs)if(ab0(I,z))Q.push(We({method:$.method,params:$.params??{}},J));return Q}teardownAll(){let $=[];for(let U of this._subs.keys())$.push({jsonrpc:"2.0",id:U,result:{resultType:"complete",_meta:{[yU]:U,...this._serverInfo!==void 0&&{[p5]:this._serverInfo}}}});return this._subs.clear(),$}},Yi0=8,zi0=600000,Ii0=class{constructor($){this._host=$}async fulfill($,U,Y,z,Q){let{maxRounds:J,roundTimeoutMs:I}=this._host,K=z.mcpReq.signal,G=Q,H=0;while(!0){if(H+=1,H>J)return WS($,ht($,J));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 J1(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 O=this._host.resolvedClientCapabilities(z),w=[];for(let[N,D]of Object.entries(W)){let{embedded:B,required:T}=Ne($,N,D);if(B.method!=="roots/list"&&B.params===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${N}' of kind '${B.method}' without params`);if(Nw(T,O)!==void 0)return WS($,`Cannot request input '${N}' (${B.method}): the client on this 2025-era connection did not declare the required capability${O===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);w.push([N,B])}let M=gt(K);try{let N={relatedRequestId:z.mcpReq.id,timeout:I,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:M.signal},D=await Promise.all(w.map(async([B,T])=>{try{return[B,await this._dispatchLeg(T,N)]}catch(A){throw M.abort(A),A}}));q=Object.fromEntries(D)}catch(N){if(K.aborted)throw N;return WS($,`Fulfilling input required by '${$}' failed: ${N instanceof Error?N.message:String(N)}`)}finally{M.dispose()}}else await St(vt,K);let V={...z,mcpReq:{...z.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:ZH(Z)}};if(Z!==void 0){let O=await this._host.verifyRequestState(Z,V,$);if(O!==void 0)V=sh(V,O)}let F=await U(Y,V);if(!r9(F))return F;G=F}}async _dispatchLeg($,U){switch($.method){case"elicitation/create":{let Y=$.params;if(Y.mode==="url"&&Y.elicitationId===void 0)Y={...Y,elicitationId:Ji0()};return await this._host.sendElicitation(Y,U)}case"sampling/createMessage":return await this._host.sendSampling($.params,U);case"roots/list":return await this._host.listRoots($.params,U)}}},Ki0,Gi0,De,Ae,Pe,LH=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson($){let U=this._registeredTools[$];if(U===void 0||!U.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,$))return this._toolInputSchemaJson[$];if(U.inputSchema===void 0)return Ze;try{let Y=E7(U.inputSchema,"input");return this._toolInputSchemaJson[$]=Y,Y}catch{return}}constructor($,U){if(this.server=new Pe($,U),U?.capabilities?.tools)this.setToolRequestHandlers();if(U?.capabilities?.resources)this.setResourceRequestHandlers();if(U?.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(([$,U])=>{let Y={name:$,title:U.title,description:U.description,inputSchema:U.inputSchema?E7(U.inputSchema,"input"):Ze,annotations:U.annotations,icons:U.icons,execution:U.execution,_meta:U._meta};if(U.outputSchema)Y.outputSchema=E7(U.outputSchema,"output");return Y})})),this.server.setRequestHandler("tools/call",async($,U)=>{let Y=this._registeredTools[$.params.name];if(!Y)throw new J1(n0.InvalidParams,`Tool ${$.params.name} not found`);if(!Y.enabled)throw new J1(n0.InvalidParams,`Tool ${$.params.name} disabled`);try{let z=await this.validateToolInput(Y,$.params.arguments,$.params.name),Q=await this.executeToolHandler(Y,z,U);if(await this.validateToolOutput(Y,Q,$.params.name),r9(Q))return Q;return this.server.projectCallToolResult(Q,Y.outputSchemaJson)}catch(z){if(z instanceof J1&&z.code===n0.UrlElicitationRequired)throw z;return this.createToolError(z instanceof Error?z.message:String(z))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,U,Y){if(!$.inputSchema)return;let z=await fU($.inputSchema,U??{});if(!z.success)throw new J1(n0.InvalidParams,`Input validation error: Invalid arguments for tool ${Y}: ${z.error}`);return z.data}async validateToolOutput($,U,Y){if(!$.outputSchema)return;if(r9(U))return;if(U.isError)return;if(U.structuredContent===void 0)throw new J1(n0.InvalidParams,`Output validation error: Tool ${Y} has an output schema but no structured content was provided`);let z=await fU($.outputSchema,U.structuredContent);if(!z.success)throw new J1(n0.InvalidParams,`Output validation error: Invalid structured content for tool ${Y}: ${z.error}`)}async executeToolHandler($,U,Y){return $.executor(U,Y)}_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 J1(n0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,U){let Y=this._registeredPrompts[U.name];if(!Y)throw new J1(n0.InvalidParams,`Prompt ${U.name} not found`);if(!Y.enabled)throw new J1(n0.InvalidParams,`Prompt ${U.name} disabled`);if(!Y.argsSchema)return VH;let z=we(Fe(Y.argsSchema)?.[$.params.argument.name]);if(!XS(z))return VH;let Q=sb0(z);if(!Q)return VH;return Le(await Q($.params.argument.value,$.params.context))}async handleResourceCompletion($,U){let Y=Object.values(this._registeredResourceTemplates).find((Q)=>Q.resourceTemplate.uriTemplate.toString()===U.uri);if(!Y){if(this._registeredResources[U.uri])return VH;throw new J1(n0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let z=Y.resourceTemplate.completeCallback($.params.argument.name);if(!z)return VH;return Le(await z($.params.argument.value,$.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async($,U)=>{let Y=Object.entries(this._registeredResources).filter(([Q,J])=>J.enabled).map(([Q,J])=>({uri:Q,name:J.name,...J.metadata})),z=[];for(let Q of Object.values(this._registeredResourceTemplates)){if(!Q.resourceTemplate.listCallback)continue;let J=await Q.resourceTemplate.listCallback(U);for(let I of J.resources)z.push({...Q.metadata,...I})}return{resources:[...Y,...z]}}),this.server.setRequestHandler("resources/templates/list",async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([$,U])=>({name:$,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler("resources/read",async($,U)=>{let Y;try{Y=new URL($.params.uri)}catch{throw new J1(n0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let z=this._registeredResources[Y.toString()];if(z){if(!z.enabled)throw new J1(n0.InvalidParams,`Resource ${Y} disabled`);return Dw(await z.readCallback(Y,U),z.cacheHint)}for(let Q of Object.values(this._registeredResourceTemplates)){let J=Q.resourceTemplate.uriTemplate.match(Y.toString());if(J)return Dw(await Q.readCallback(Y,J,U),Q.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(([$,U])=>{return{name:$,title:U.title,description:U.description,arguments:U.argsSchema?_t(U.argsSchema):void 0,icons:U.icons,_meta:U._meta}})})),this.server.setRequestHandler("prompts/get",async($,U)=>{let Y=this._registeredPrompts[$.params.name];if(!Y)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} not found`);if(!Y.enabled)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} disabled`);return Y.handler($.params.arguments,U)}),this._promptHandlersInitialized=!0}registerResource($,U,Y,z){let Q=Y.cacheHint,J=Y;if(Q!==void 0){ih(Q,`resource ${$}`);let I={...Y};delete I.cacheHint,J=I}if(typeof U==="string"){if(this._registeredResources[U])throw Error(`Resource ${U} is already registered`);let I=this._createRegisteredResource($,Y.title,U,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let I=this._createRegisteredResourceTemplate($,Y.title,U,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}}_createRegisteredResource($,U,Y,z,Q){let J={name:$,title:U,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({uri:null}),update:(I)=>{if(I.uri!==void 0&&I.uri!==Y){if(delete this._registeredResources[Y],I.uri)this._registeredResources[I.uri]=J}if(I.name!==void 0)J.name=I.name;if(I.title!==void 0)J.title=I.title;if(I.metadata!==void 0)J.metadata=I.metadata;if(I.callback!==void 0)J.readCallback=I.callback;if(I.enabled!==void 0)J.enabled=I.enabled;this.sendResourceListChanged()}};return this._registeredResources[Y]=J,J}_createRegisteredResourceTemplate($,U,Y,z,Q){let J={resourceTemplate:Y,title:U,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({name:null}),update:(K)=>{if(K.name!==void 0&&K.name!==$){if(delete this._registeredResourceTemplates[$],K.name)this._registeredResourceTemplates[K.name]=J}if(K.title!==void 0)J.title=K.title;if(K.template!==void 0)J.resourceTemplate=K.template;if(K.metadata!==void 0)J.metadata=K.metadata;if(K.callback!==void 0)J.readCallback=K.callback;if(K.enabled!==void 0)J.enabled=K.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=J;let I=Y.uriTemplate.variableNames;if(Array.isArray(I)&&I.some((K)=>!!Y.completeCallback(K)))this.setCompletionRequestHandler();return J}_createRegisteredPrompt($,U,Y,z,Q,J,I){let K=z,G=Q,H={title:U,description:Y,argsSchema:z,icons:J,_meta:I,handler:Ve($,z,Q),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,z){let W=Fe(z);if(W){if(Object.values(W).some((X)=>{return XS(we(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,U,Y,z,Q,J,I,K,G,H){if(YS($),z!==void 0)try{let Z=E7(z,"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:U,description:Y,inputSchema:z,outputSchema:Q,outputSchemaJson:qe(Q),annotations:J,icons:I,execution:K,_meta:G,handler:H,executor:Xe(z,H),enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Z)=>{if(Z.name!==void 0&&Z.name!==$){if(typeof Z.name==="string")YS(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($,U,Y){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:z,description:Q,inputSchema:J,outputSchema:I,annotations:K,icons:G,_meta:H}=U;return this._createRegisteredTool($,z,Q,Rw(J),Rw(I),K,G,void 0,H,Y)}registerPrompt($,U,Y){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:z,description:Q,argsSchema:J,icons:I,_meta:K}=U,G=this._createRegisteredPrompt($,z,Q,Rw(J),Y,I,K);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),G}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,U){return this.server.sendLoggingMessage($,U)}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();Oe=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=($,U)=>{if(U.clientCapabilities!==void 0)$._clientCapabilities=U.clientCapabilities;if(U.clientInfo!==void 0)$._clientVersion=U.clientInfo},De=($,U)=>{let Y=U.filter((z)=>!$._supportedProtocolVersions.includes(z));if(Y.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...Y];$.setRequestHandler("server/discover",()=>$._ondiscover())},Ae=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Ii0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,U,Y)=>this._verifyRequestState($,U,Y),sendElicitation:($,U)=>this._sendElicitationLeg($,U,{validateAcceptedContent:!1}),sendSampling:($,U)=>this.createMessage($,U),listRoots:($,U)=>this.listRoots($,U)})}oninitialized;constructor($,U){super(U);if(this._serverInfo=$,this._capabilities=U?.capabilities?{...U.capabilities}:{},this._instructions=U?.instructions,this._jsonSchemaValidator=U?.jsonSchemaValidator??new kw,this._requestStateVerify=U?.requestState?.verify,this._inputRequiredServing=Qi0(U?.inputRequired),U?.cacheHints!==void 0){for(let[Y,z]of Object.entries(U.cacheHints))if(z!==void 0)ih(z,`cacheHints['${Y}']`);this._cacheHints=U.cacheHints}if(this.setRequestHandler("initialize",(Y)=>this._oninitialize(Y)),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($,U)=>{let Y=U.sessionId||U.http?.req?.headers.get("mcp-session-id")||void 0,{level:z}=$.params,Q=Cw(A7,z);if(Q.success)this._loggingLevels.set(Y,Q.data);return{}})}buildContext($,U){let Y=$.http||U?.request||U?.closeSSEStream||U?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(z,Q,J)=>{if(!this._capabilities.logging)return Promise.resolve();let I;if(this._servedModernEra()){if(I=$.mcpReq.envelope?.[F7],I===void 0)return Promise.resolve()}else I=this._loggingLevels.get($.sessionId)??this._loggingLevels.get(void 0);if(I!==void 0&&this.LOG_LEVEL_SEVERITY.get(z)this.elicitInput(z,Q),requestSampling:(z,Q)=>this.createMessage(z,Q)},http:Y?{...$.http,req:U?.request,closeSSE:U?.closeSSEStream,closeStandaloneSSE:U?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(A7.options.map(($,U)=>[$,U]));isMessageIgnored=($,U)=>{let Y=this._loggingLevels.get(U);return Y?this.LOG_LEVEL_SEVERITY.get($){let I=await U(Q,J);if(r9(I))throw new J1(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 I};return async(Q,J)=>{let I=z?await this._invokeInputRequiredCapableHandler($,U,Q,J):await U(Q,J);if(r9(I)){if(!z)throw new J1(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 I}return Y===void 0?I:Dw(I,Y)}}return async(Y,z)=>{let Q=B7(this._negotiatedProtocolVersion),J=Q.validateRequest("tools/call",Y);if(!J.ok)throw new J1(J.reason==="not-in-era"?n0.InternalError:n0.InvalidParams,J.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${J.message}`);let I=await this._invokeInputRequiredCapableHandler("tools/call",U,Y,z);if(r9(I))return I;let K=kh(I),G=Q.validateResult("tools/call",K);if(!G.ok)throw new J1(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&&vQ(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,U,Y,z){let Q=this._servedModernEra(),J=z.mcpReq.requestState();if(J!==void 0&&typeof J!=="string")throw new J1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let I=z;if(typeof J==="string"){let X=await this._verifyRequestState(J,z,$);if(X!==void 0)I=sh(z,X)}let K;try{K=await U(Y,I)}catch(X){if(X instanceof J1&&X.code===n0.UrlElicitationRequired){if(!Q)throw X;throw new J1(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(!Q){if(!this._inputRequiredServing.legacyShim)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??gU}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,U,Y,I,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new J1(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(z);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=Ne($,Z,q),O=Nw(F,X);if(O!==void 0)throw new Pw({requiredCapabilities:O},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,U,Y){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,U)}catch(z){throw this.onerror?.(Error(`requestState verification rejected ${Y}: ${z instanceof Error?z.message:String(z)}`)),new J1(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 U=$.params.protocolVersion;this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo;let Y=qt(this._supportedProtocolVersions),z=Y.includes(U)?U:Y[0]??gU;return this._negotiatedProtocolVersion=z,this.transport?.setProtocolVersion?.(z),{protocolVersion:z,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($,U){return this._wireCodec().projectCallToolResult($,U)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage($,U){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 J=$.messages.at(-1),I=Array.isArray(J.content)?J.content:[J.content],K=I.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(I.some((X)=>X.type!=="tool_result"))throw new J1(n0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new J1(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(I.filter((q)=>q.type==="tool_result").map((q)=>q.toolUseId));if(X.size!==Z.size||![...X].every((q)=>Z.has(q)))throw new J1(n0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let Y=Boolean($.tools||$.toolChoice),z=await this.request({method:"sampling/createMessage",params:$},U),Q=this._wireCodec().samplingResultVariant(Y,z);if(!Q.ok)throw new V1(A1.InvalidResult,`Invalid sampling/createMessage result: ${Q.reason==="invalid"?Q.message:Q.reason}`);return Q.value}async elicitInput($,U){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($,U)}async _sendElicitationLeg($,U,Y){let z=$.mode??"form",Q=Y?.validateAcceptedContent??!0;switch(z){case"url":{let J=$;return this.request({method:"elicitation/create",params:J},U)}case"form":{let J=$.mode==="form"?$:{...$,mode:"form"},I=await this.request({method:"elicitation/create",params:J},U);if(Q&&I.action==="accept"&&I.content&&J.requestedSchema)try{let K=this._jsonSchemaValidator.getValidator(J.requestedSchema)(I.content);if(!K.valid)throw new J1(n0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof J1)throw K;throw new J1(n0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return I}}}createElicitationCompletionNotifier($,U){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:$}},U)}async listRoots($,U){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:$},U)}async sendLoggingMessage($,U){if(this._capabilities.logging&&!this.isMessageIgnored($.level,U))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 U=$.params;if($.method==="initialize"&&!lh(U)){let J=U!==null&&typeof U==="object"&&typeof U.protocolVersion==="string"?U.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...J!==void 0&&{requestedVersion:J}}}if(!Bw(U))return{kind:"legacy",reason:"no-claim"};let Y=bU(U),z=(Y===void 0?[]:jw(Y))[0];if(z!==void 0)return{kind:"invalid-envelope",issue:z};let Q=Tw(U);if(Q===void 0||!T7.includes(Q))return{kind:"unsupported-revision",requested:Q??"unknown"};return{kind:"modern",revision:Q,classification:{era:"modern",revision:Q}}}function je($,U={}){let Y=U.legacy??"serve",z=U.transport??new Xi0,Q={phase:"opening"},J,I=!1,K=()=>I||Q.phase==="closed",G=(j)=>{try{U.onerror?.(j)}catch{}},H=(j,C,b,x)=>z.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...x!==void 0&&{data:x}}}).catch((h)=>G(J5(h))),W=new Me(U.maxSubscriptions??fw),X=(j)=>{if(!j7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)z.send({jsonrpc:"2.0",...b}).catch((x)=>G(J5(x)));return"handled"},Z=async(j)=>{if(D$(j)&&j.method==="subscriptions/listen"){let C=bU(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"},x=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(x===void 0||!T7.includes(x)){let i=new hQ({supported:[...T7],requested:x??"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 z.send("error"in h?h:{jsonrpc:"2.0",method:h.method,params:h.params}).catch((i)=>G(J5(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 x=oh({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},T7);if(x===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${x.cell}): ${x.message}`)),H(j.id,x.code,x.message,x.data)},V=(j)=>{if(I||j===J)return;T()},F=async(j,C)=>{let b=await $({era:j}),x=b instanceof LH?b.server:b;if(j==="modern")ah(x,C),ZS(x,T7),W.setServerCapabilities(x.getCapabilities(),qS(x));let h=new Zi0(z,()=>V(h),j==="modern"?X:void 0);return await b.connect(h),{product:b,channel:h}},O=(j)=>j.product.close().catch((C)=>G(J5(C))),w=async(j)=>{J=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(J5(C))}finally{J=void 0}},M=async(j)=>{if(Q.phase==="closed")return;if(Q.phase==="pinned"){if(Q.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(Q.era==="modern"&&await Z(j))return;Q.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 hQ({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(Q.phase==="probe"){Q.instance.channel.deliver(j,{classification:C.classification});return}let b=await F("modern",C.revision);if(K()){await O(b);return}Q={phase:"probe",instance:b},b.channel.deliver(j,{classification:C.classification});return}if(Q.phase==="probe"){if(j7(j)){Q.instance.channel.deliver(j,{classification:C.classification});return}Q={phase:"pinned",era:"modern",instance:Q.instance}}else{let b=await F("modern",C.revision);if(K()){await O(b);return}Q={phase:"pinned",era:"modern",instance:b}}if(await Z(j))return;Q.instance.channel.deliver(j,{classification:C.classification});return;case"legacy":{if(Y==="reject"){if(D$(j))await q(j,C.reason,C.requestedVersion);return}if(Q.phase==="probe"){if(await w(Q.instance),K())return;Q={phase:"opening"}}let b=await F("legacy");if(K()){await O(b);return}Q={phase:"pinned",era:"legacy",instance:b},Q.instance.channel.deliver(j);return}}},N=[],D=!1,B=async()=>{if(D)return;D=!0;try{while(N.length>0){let j=N.shift();try{await M(j)}catch(C){if(D$(j))await H(j.id,n0.InternalError,"Internal server error");G(J5(C))}}}finally{D=!1}},T=async()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;Q={phase:"closed"};for(let C of W.teardownAll())await z.send(C).catch((b)=>G(J5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(J5(C)));await z.close().catch((C)=>G(J5(C)))};z.onmessage=(j)=>{N.push(j),B()},z.onerror=(j)=>{if(G(j),Q.phase==="probe"||Q.phase==="pinned")Q.instance.channel.onerror?.(j)},z.onclose=()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;if(Q={phase:"closed"},j.phase==="probe"||j.phase==="pinned")j.instance.product.close().catch((C)=>G(J5(C)))};let A=z.start().catch((j)=>{throw G(J5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function J5($){return $ instanceof Error?$:Error(String($))}var Xi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=HS.stdin,U=HS.stdout,Y){this._stdin=$,this._stdout=U,this._readBuffer=new $S({maxBufferSize:Y?.maxBufferSize})}onclose;onerror;onmessage;_ondata=($)=>{try{this._readBuffer.append($),this.processReadBuffer()}catch(U){this.onerror?.(U),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((U,Y)=>{let z=US($),Q=!1,J=(K)=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),Y(K)},I=()=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),U()};if(this._stdout.once("error",J),this._stdout.write(z)){if(Q)return;Q=!0,this._stdout.off("error",J),U()}else if(!Q)this._stdout.once("drain",I)})}},Te=3000,Zi0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,U,Y){this._wire=$,this._onInstanceClose=U,this._outboundIntercept=Y}async start(){}async send($,U){if(HH($)||Ew($)){let{id:Y}=$;if(Y!==void 0)this._settle(Y)}if(this._closed)return;if(this._outboundIntercept?.($)==="handled")return;return this._wire.send($,U)}setProtocolVersion=($)=>{this._wire.setProtocolVersion?.($)};deliver($,U){if(this._closed)return;if(D$($))this._pendingRequests.add($.id);else if(j7($)&&$.method==="notifications/cancelled"){let Y=$.params?.requestId;if(Y!==void 0)this._settle(Y)}this.onmessage?.($,U)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((U)=>{let Y=()=>{clearTimeout(z),U(!0)},z=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((Q)=>Q!==Y),U(!1)},$);this._drainWaiters.push(Y)})}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 U of $)U()}};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($,U,Y){let z=$.status||$.status===0?$.status:"",Q=$.statusText??"",J=`${z} ${Q}`.trim(),I=J?`status code ${J}`:"an unknown error";super(`Request failed with ${I}: ${U.method} ${U.url}`);this.response=$,this.request=U,this.options=Y}}});var wH;var LS=o(()=>{FH();wH=class wH extends s9{name="NetworkError";request;constructor($,U){super(`Request failed due to a network error: ${$.method} ${$.url}`,U);this.request=$}}});var OH;var FS=o(()=>{OH=class OH extends Error{name="NonError";value;constructor($){let U="Non-error value was thrown";try{if(typeof $==="string")U=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")U=$.message}catch{}super(U);this.value=$}}});var yQ;var Ce=o(()=>{FH();FS();yQ=class yQ extends s9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let U=$?.cause?$.cause instanceof Error?$.cause:new OH($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",U?{cause:U}: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 I5;var bw=o(()=>{FH();I5=class I5 extends s9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class pw{options;constructor($){this.options=$}}var OS,_e,iw,ve,he,cw,Vi0=()=>{return},Se,kQ=2147483647,ge=40,nw,ye=($)=>new pw($),ke,xe;var iU=o(()=>{OS=(()=>{let $=!1,U=!1,Y=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(Y&&z)try{U=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(Q){if(Q instanceof Error&&Q.message==="unsupported BodyInit type")return!1;throw Q}return $&&!U})(),_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 U=0;for(let[Y,z]of $)U+=ge,U+=dw.encode(`Content-Disposition: form-data; name="${Y}"`).byteLength,U+=typeof z==="string"?dw.encode(z).byteLength:z.size;return U}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=($,U,Y)=>{let z,Q=0;return $.pipeThrough(new TransformStream({transform(J,I){if(I.enqueue(J),z){Q+=z.byteLength;let K=U===0?0:Q/U;if(K>=1)K=1-Number.EPSILON;Y?.({percent:K,totalBytes:Math.max(U,Q),transferredBytes:Q},z)}z=J},flush(){if(z)Q+=z.byteLength,Y?.({percent:1,totalBytes:Math.max(U,Q),transferredBytes:Q},z)}}))},ue=($,U)=>{if(!$.body)return $;let Y={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,Y);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(fe($.body,z,U),Y)},be=($,U,Y)=>{if(!$.body)return $;let z=Li0(Y??$.body);return new Request($,{duplex:"half",body:fe($.body,z,U)})};var ie=o(()=>{iU();dw=new TextEncoder});var d5=($)=>$!==null&&typeof $==="object";function MH($,U,Y){return Object.hasOwn(U,Y)&&U[Y]===void 0?[]:AS($[Y]??[],U[Y]??[])}var Fi0,MS=($)=>d5($)&&$[Fi0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},NH=(...$)=>{for(let U of $)if((!d5(U)||Array.isArray(U))&&U!==void 0)throw TypeError("The `options` argument must be an object");return AS({},...$)},DS=($={},U={})=>{let Y=new globalThis.Headers($),z=U instanceof globalThis.Headers,Q=new globalThis.Headers(U);for(let[J,I]of Q.entries())if(z&&I==="undefined"||I===void 0)Y.delete(J);else Y.set(J,I);return Y},NS=($)=>{if(!d5($)||Array.isArray($))return!1;let U=Object.getPrototypeOf($);return U===Object.prototype||U===null},xQ=($)=>{if($ instanceof URLSearchParams){let U=new URLSearchParams($),Y=$[C7];if(Y)U[C7]=new Set(Y);return U}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(NS($))return{...$};return $},wi0=($)=>Object.fromEntries(Object.entries($).filter((U)=>U[1]!==void 0)),Oi0=($,U)=>{if(NS($)&&NS(U))return wi0({...$,...U});return DS($,U)},mw=($={},U={})=>({init:MH($,U,"init"),beforeRequest:MH($,U,"beforeRequest"),beforeRetry:MH($,U,"beforeRetry"),beforeError:MH($,U,"beforeError"),afterResponse:MH($,U,"afterResponse")}),C7,Mi0=($,U)=>{let Y=new URLSearchParams,z=new Set;for(let Q of[$,U]){if(Q===void 0)continue;if(Q instanceof URLSearchParams){for(let[I,K]of Q.entries())Y.append(I,K),z.delete(I);let J=Q[C7];if(J)for(let I of J)Y.delete(I),z.add(I)}else if(Array.isArray(Q))for(let J of Q){if(!Array.isArray(J)||J.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");Y.append(String(J[0]),String(J[1])),z.delete(String(J[0]))}else if(d5(Q))for(let[J,I]of Object.entries(Q))if(I===void 0)Y.delete(J),z.add(J);else Y.append(J,String(I)),z.delete(J);else{let J=new URLSearchParams(Q);for(let[I,K]of J.entries())Y.append(I,K),z.delete(I)}}if(z.size>0)Y[C7]=z;return Y},AS=(...$)=>{let U={},Y={},z={},Q,J=[];for(let I of $)if(Array.isArray(I)){if(!Array.isArray(U))U=[];U=[...U,...I]}else if(d5(I)){for(let[K,G]of Object.entries(I)){if(K==="signal"&&G instanceof globalThis.AbortSignal){J.push(G);continue}let H=MS(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");U={...U,context:G===void 0||G===null?{}:W?{...G}:{...U.context,...G}};continue}if(K==="searchParams"){if(G===void 0||G===null)Q=void 0;else if(W)Q=G;else Q=Q===void 0?G:Mi0(Q,G);continue}if(d5(G)&&!W&&K in U)G=AS(U[K],G);U={...U,[K]:G}}if(d5(I.hooks)){let{value:K,isReplace:G}=MS(I.hooks);z=G?mw({},K):mw(z,K),U.hooks=z}if(d5(I.headers)){let{value:K,isReplace:G}=MS(I.headers);Y=G?xQ(K):Oi0(Y,K),U.headers=Y}}if(Q!==void 0)U.searchParams=Q;if(J.length>0)if(J.length===1)U.signal=J[0];else if(iw)U.signal=AbortSignal.any(J);else U.signal=J.at(-1);return U};var lw=o(()=>{iU();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 U=Object.fromEntries(Object.entries({...$,methods:$.methods?.map((Y)=>Y.toLowerCase())}).filter(([,Y])=>Y!==void 0));return{...ce,...U}};var de=o(()=>{iU();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($,U,Y,z){return new Promise((Q,J)=>{let I=setTimeout(()=>{if(Y)Y.abort();J(new I5($))},z.timeout);z.fetch($,U).then(Q).catch(J).then(()=>{clearTimeout(I)})})}var me=o(()=>{bw()});async function ow($,{signal:U}){return new Promise((Y,z)=>{if(U)U.throwIfAborted(),U.addEventListener("abort",Q,{once:!0});function Q(){clearTimeout(J),z(U.reason)}let J=setTimeout(()=>{U?.removeEventListener("abort",Q),Y()},$)})}var le=($)=>{let U={};for(let Y in $){if(!Object.hasOwn($,Y))continue;if(!(Y in xe)&&!(Y in ke))U[Y]=$[Y]}return U},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(()=>{iU();lw()});function BS($){if(!($&&Bi0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:Y,stack:z}=$;if(Y==="Load failed")return z===void 0||"__sentry_captured__"in $;if(Y.startsWith("error sending request for url"))return!0;if(Y==="Failed to fetch"||Y.startsWith("Failed to fetch (")&&Y.endsWith(")"))return!0;return Ti0.has(Y)}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($,I5)}var TS=($,U)=>$ instanceof U||$?.name===U.name;var $00=o(()=>{uw();LS();bw()});function vi0($){let U={...$,json:xQ($.json),context:xQ($.context),headers:xQ($.headers),searchParams:_i0($.searchParams)};if($.retry!==void 0)U.retry=Ri0($.retry);return U}class fQ{static create($,U){let Y=U.hooks?.init??[],z=Y.length>0?vi0(U):U;for(let K of Y)K(z);let Q=new fQ($,z),J=async()=>{if(typeof Q.#$.timeout==="number"&&Q.#$.timeout>kQ)throw RangeError(`The \`timeout\` option cannot be greater than ${kQ}`);if(typeof Q.#$.totalTimeout==="number"&&Q.#$.totalTimeout>kQ)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${kQ}`);await Promise.resolve();let K=await Q.#g(),G=K??await Q.#h(async()=>Q.#R()),H=K!==void 0||Q.#C();for(;;){if(G===void 0)return G;if(AH(G))try{G=await Q.#y(G)}catch(X){if(!(X instanceof yQ))throw X;let Z=await Q.#E(X,async()=>Q.#R());if(Z===void 0)return Z;G=Z,H=Q.#C();continue}let W=G;if(!W.ok&&W.type!=="opaque"&&(typeof Q.#$.throwHttpErrors==="function"?Q.#$.throwHttpErrors(W.status):Q.#$.throwHttpErrors)){let X=new D6(W,Q.#M(W),Q.#O()),Z=X;if(X.data=await Q.#L(W),H)throw Z;let q=await Q.#E(X,async()=>Q.#R());if(q===void 0)return q;G=q,H=Q.#C();continue}break}if(!AH(G))return G;if(Q.#V(G),Q.#$.onDownloadProgress){if(typeof Q.#$.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 Q.#K(G),ue(W,Q.#$.onDownloadProgress)}return G},I=(async()=>{try{return await J()}catch(K){if(!(K instanceof Error))throw K;if(Q.#X.has(K))throw K;let G=K;for(let H of Q.#$.hooks.beforeError){let W=await H({request:Q.request,options:Q.#O(),error:G,retryCount:Q.#Q});if(W instanceof Error)G=W}throw G}finally{let K=Q.#W;if(Q.#F(K?.body??void 0),Q.request!==K)Q.#F(Q.request.body??void 0)}})();for(let[K,G]of Object.entries(Se)){if(K==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;I[K]=async(H)=>{Q.request.headers.set("accept",Q.request.headers.get("accept")||G);let W=await I;if(K!=="json")return W[K]();let X=await W.text();if(X===""){if(H!==void 0)return z00(void 0,H);return JSON.parse(X)}let Z=z.parseJson?await z.parseJson(X,{request:Q.#M(W),response:W}):JSON.parse(X);return H===void 0?Z:z00(Z,H)}}return I}static#z($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,U])=>U!==void 0));return $}request;#Y;#Q=0;#U;#$;#W;#H;#X=new WeakSet;#J;#I;#Z=!1;#N=new WeakMap;constructor($,U={}){if(this.#U=$,Object.hasOwn(U,"prefixUrl"))throw Error(Ei0);if(this.#$={...U,headers:DS(this.#U.headers,U.headers),hooks:mw({},U.hooks),method:ne(U.method??this.#U.method??"GET"),prefix:String(U.prefix||""),retry:pe(U.retry),throwHttpErrors:U.throwHttpErrors??!0,timeout:U.timeout??1e4,totalTimeout:U.totalTimeout??!1,fetch:U.fetch??globalThis.fetch.bind(globalThis),context:U.context??{}},typeof this.#U!=="string"&&!(this.#U instanceof URL||this.#U instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#U==="string"){if(this.#$.prefix){let z=this.#$.prefix.replace(/\/+$/,""),Q=this.#U.replace(/^\/+/,"");this.#U=`${z}/${Q}`}if(this.#$.baseUrl){let z;try{z=new URL(this.#U)}catch{}if(!z)this.#U=new URL(this.#U,new Request(this.#$.baseUrl).url)}}if(_e&&iw)this.#H=this.#$.signal??this.#U.signal,this.#Y=new globalThis.AbortController,this.#$.signal=this.#w();if(OS)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 Y=U.headers&&new globalThis.Headers(U.headers).has("content-type");if(this.#U instanceof globalThis.Request&&(he&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!Y)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#U,this.#$),oe(this.#$.searchParams)){let z=new URL(this.request.url),Q=this.#$.searchParams?.[C7];if(Q)for(let J of Q)z.searchParams.delete(J);if(typeof this.#$.searchParams==="string"){let J=this.#$.searchParams.replace(/^\?/,"");if(J!=="")z.search=z.search?`${z.search}&${J}`:`?${J}`}else{let J=new URLSearchParams(fQ.#z(this.#$.searchParams));for(let[I,K]of J.entries())z.searchParams.append(I,K)}if(this.#$.searchParams&&typeof this.#$.searchParams==="object"&&!Array.isArray(this.#$.searchParams)&&!(this.#$.searchParams instanceof URLSearchParams)){for(let[J,I]of Object.entries(this.#$.searchParams))if(I===void 0)z.searchParams.delete(J)}this.request=new globalThis.Request(z,this.#$)}if(this.#$.onUploadProgress&&typeof this.#$.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");this.#I=typeof this.#$.totalTimeout==="number"?this.#S():void 0}#G(){let $=this.#$.retry.delay(this.#Q+1),U=$;if(this.#$.retry.jitter===!0)U=Math.random()*$;else if(typeof this.#$.retry.jitter==="function"){if(U=this.#$.retry.jitter($),!Number.isFinite(U)||U<0)U=$}return Math.min(this.#$.retry.backoffLimit,U)}async#B($){if(this.#Q>=this.#$.retry.limit)throw $;let U=$ instanceof Error?$:new OH($);if(U instanceof yQ)return U.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let Y=await this.#$.retry.shouldRetry({error:U,retryCount:this.#Q+1});if(Y===!1)throw $;if(Y===!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 Y=$.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(Y&&this.#$.retry.afterStatusCodes.includes($.response.status)){let z=Number(Y)*1000;if(Number.isNaN(z))z=Date.parse(Y)-Date.now();else if(z>=Date.parse("2024-01-01"))z-=Date.now();if(!Number.isFinite(z))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return z=Math.max(0,z),Math.min(this.#$.retry.maxRetryAfter,z)}if($.response.status===413)throw $;return this.#G()}if(!te($))throw $;return this.#G()}#V($){let U=this.#M($);if(this.#$.parseJson)$.json=async()=>{let Y=await $.text();if(Y==="")return JSON.parse(Y);return this.#$.parseJson(Y,{request:U,response:$})};return $}async#L($){let U=await this.#T($,this.#D());if(U===DH){this.#q();return}if(!U)return;if(!this.#A($.headers.get("content-type")??""))return U;let Y=await this.#j(U,$,this.#D(),this.#M($));if(Y===DH){this.#q();return}return Y}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,U=this.#P();if(U===void 0)return $;if(U<=0)throw new I5(this.request);return Math.min($,U)}#A($){let U=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(U)}async#T($,U){let{body:Y}=$;if(!Y)try{return await $.text()}catch{return}let z;try{z=Y.getReader()}catch{return}let Q=Ci0($.headers.get("content-type")??""),J=[],I=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await z.read();if(W)break;if(I+=X.byteLength,I>ji0){z.cancel().catch(()=>{return});return}J.push(Q.decode(X,{stream:!0}))}}catch{return}return J.push(Q.decode()),J.join("")})(),G=new Promise((W)=>{let X=setTimeout(()=>{W(DH)},U);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===DH)z.cancel().catch(()=>{return});return H}async#j($,U,Y,z){let Q;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:z,response:U}):JSON.parse($)),new Promise((J)=>{Q=setTimeout(()=>{J(DH)},Y)})])}catch{return}finally{clearTimeout(Q)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#w(){return this.#H?AbortSignal.any([this.#H,this.#Y.signal]):this.#Y.signal}#q(){let $=this.#P();if($!==void 0&&$<=0)throw new I5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let U=await $({request:this.request,options:this.#O(),retryCount:0});if(Y00(U))this.#_(U);else if(AH(U))return U}return}async#y($){let U=this.#M($);for(let Y of this.#$.hooks.afterResponse){let z=this.#v($.clone(),U);this.#V(z);let Q;try{Q=await Y({request:this.request,options:this.#O(),response:z,retryCount:this.#Q})}catch(I){if(z!==$)this.#K(z);throw this.#K($),I}if(Q instanceof pw){if(z!==$)this.#K(z);throw this.#K($),new yQ(Q.options)}let J=AH(Q)?this.#v(Q,U):$;if(z!==$&&z!==J&&z.body!==J.body)this.#K(z);if($!==J&&$.body!==J.body)this.#K($);$=J}return $}async#h($){try{return await $()}catch(U){return this.#E(U,$)}}async#E($,U){this.#Z=!1;let Y=Math.min(await this.#B($),kQ),z={signal:this.#H},Q=this.#P();if(Q!==void 0){if(Q<=0)throw new I5(this.request);if(Y>=Q)throw await ow(Q,z),new I5(this.request)}if(await ow(Y,z),this.#q(),$ instanceof yQ&&$.customRequest){let J=new globalThis.Request($.customRequest,this.#$.signal?{signal:this.#$.signal}:void 0);this.#_(J)}for(let J of this.#$.hooks.beforeRetry){let I;try{I=await J({request:this.request,options:this.#O(),error:$,retryCount:this.#Q+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(Y00(I)){this.#_(I);break}if(AH(I))return this.#Z=!0,this.#Q++,I;if(I===nw)return}return this.#q(),this.#Q++,this.#h(U)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#Y?.signal.aborted)this.#Y=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=le(this.#$),U=this.#$.retry.limit>0?this.request.clone():void 0,Y=this.#k(this.request,this.#$.body??void 0);if(this.#W=Y,U)this.request=U;try{let z=this.#P();if(z!==void 0&&z<=0)throw new I5(this.request);let Q=this.#$.timeout===!1?z:z===void 0?this.#$.timeout:Math.min(this.#$.timeout,z),J=Q===void 0?await this.#$.fetch(Y,$):await PS(Y,$,this.#Y,{timeout:Q,fetch:this.#$.fetch});return this.#v(J,Y)}catch(z){if(BS(z))throw new wH(this.request,{cause:z});throw z}}#P(){if(this.#I===void 0)return;let $=this.#S()-this.#I;return Math.max(0,this.#$.totalTimeout-$)}#S(){return globalThis.performance?.now()??Date.now()}#O(){if(!this.#J){let{hooks:$,json:U,parseJson:Y,stringifyJson:z,searchParams:Q,timeout:J,totalTimeout:I,throwHttpErrors:K,fetch:G,...H}=this.#$;this.#J=Object.freeze(H)}return this.#J}#_($){this.#J=void 0,this.request=$}#M($){return this.#N.get($)??this.request}#v($,U){return this.#N.set($,U),$}#k($,U){if(!this.#$.onUploadProgress||!$.body||!OS)return $;return be($,this.#$.onUploadProgress,U??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 U=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),Y=U?.[1]??U?.[2];if(Y)try{return new TextDecoder(Y)}catch{}return new TextDecoder},U00="The `schema` argument must follow the Standard Schema specification",Ri0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},Q00,Y00=($)=>$ instanceof globalThis.Request||Q00.call($)==="[object Request]",AH=($)=>$ instanceof globalThis.Response||Q00.call($)==="[object Response]",_i0=($)=>{if(Array.isArray($))return $.map((U)=>[...U]);return xQ($)},z00=async($,U)=>{if(typeof U!=="object"&&typeof U!=="function"||U===null)throw TypeError(U00);let Y=U["~standard"];if(typeof Y!=="object"||Y===null||typeof Y.validate!=="function")throw TypeError(U00);let z=await Y.validate($);if(z.issues)throw new wS(z.issues);return z.value};var J00=o(()=>{uw();LS();FS();Ce();Re();bw();ie();lw();de();me();re();se();$00();iU();DH=Symbol("timedOutResponseData"),Q00=Object.prototype.toString});var jS=($)=>{let U=(Y,z)=>fQ.create(Y,NH($,z));for(let Y of cw)U[Y]=(z,Q)=>fQ.create(z,NH($,Q,{method:Y}));return U.create=(Y)=>jS(NH(Y)),U.extend=(Y)=>{if(typeof Y==="function")Y=Y($??{});return jS(NH($,Y))},U.stop=nw,U.retry=ye,U},hi0,K5;var uQ=o(()=>{J00();iU();lw();uw();/*! MIT License © Sindre Sorhus */hi0=jS(),K5=hi0});async function I00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=$.seal.url??$.source.sealUrl,Y=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:Y?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:U,tenantId:Y?.tenantId,tenantSlug:$.seal.tenantSlug??Y?.tenantSlug,tenantName:Y?.tenantName,raw:{sourceType:$.source.type}}}}function Si0($){let U=Object.entries($??{}).map(([Y,z])=>`${Y}=${z}`);return U.length?U.join("; "):void 0}function A6($){let U={...$?.headers??{}},Y=Si0($?.cookies);if(Y)U.Cookie=Y;return U}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 bQ(){let $=ci0();if(!ES($))return{};try{return G00.parse(JSON.parse(ui0($,"utf-8")))}catch{return{}}}function sw($){let U=ni0();fi0(ii0(U),{recursive:!0,mode:448}),bi0(U,JSON.stringify($,null,2),{mode:384})}function q00($){return bQ()[$]?.seal}function V00($,U){let Y=bQ();sw({...Y,[$]:{...Y[$],seal:U}})}function L00($){let U=bQ(),Y=U[$];if(!Y)return;sw({...U,[$]:{...Y,seal:void 0}})}function PH($){return bQ()[$]?.hose??{}}function CS($,U){let Y=bQ();sw({...Y,[$]:{...Y[$],hose:U}})}function aw($){let U=bQ();delete U[$],sw(U)}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 O00($){let U;try{U=new URL($.trim())}catch{throw Error("Invalid Hose assistance link: expected a valid HTTPS URL")}if(U.protocol!=="https:"||U.port||!li0(U.hostname)||U.pathname.replace(/\/+$/,"")!==mi0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let Y=U.searchParams.getAll("accessToken").filter(Boolean),z=U.searchParams.getAll("ekbCorpId").filter(Boolean);if(Y.length!==1||z.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let Q=z[0].trim().toLowerCase();if(!w00.test(Q))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:Q,accessToken:Y[0],baseUrl:U.origin}}async function tw($,U){let Y=typeof $==="string"?O00($):M00($),z=`https://${Y.corpId}.sealai.cc`,J=await T8(z,void 0,U?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:Y.accessToken,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600;return{corpId:Y.corpId,sealUrl:z,token:I,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function ew($,U){let Y=U.hoseCorpConfig&&typeof U.hoseCorpConfig==="object"?U.hoseCorpConfig:void 0,z=[U.tenantSlug,Y?.corporationId].filter((I)=>typeof I==="string"&&Boolean(I)),Q=$.trim().toLowerCase(),J=z.map((I)=>I.trim().toLowerCase()).filter(Boolean);if(J.length===0||J.some((I)=>I!==Q))throw Error("Hose assistance link tenant mismatch: the Seal tenant does not match ekbCorpId")}function li0($){let U=$.toLowerCase();return di0.some((Y)=>U.endsWith(Y))}function M00($){let U=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",Y=typeof $?.accessToken==="string"?$.accessToken.trim():"",z=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!w00.test(U)||!Y)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:U,accessToken:Y,...z?{baseUrl:z}:{}}}function N00($,U=60){return Boolean($&&Date.now()<$.expiresAt-U*1000)}function R7($,U){if($.seal.url)return $.seal.url;if(U.sealUrl)return U.sealUrl;return`https://${U.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:U})=>{let Y=U instanceof D6?await U.response.text().catch(()=>""):"";return U.message=`${U.message}${Y?`: ${Y}`:""}`,U}]}})}async function ri0($){let U=D00($),Y=$.appKey??$.key,z=$.appSecurity??$.password;if(!Y||!z)throw Error("Hose source requires appKey/key and appSecurity/password");let Q=await U.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:Y,appSecurity:z}}).json(),J=Q.value?.accessToken??Q.accessToken??Q.token;if(!J)throw Error("Hose login did not return an access token");return{token:J,expiresAt:Date.now()+3600000}}async function iQ($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=PH($.id);if(N00(U.openapi))return U.openapi.token;let Y=RS.get($.id);if(Y)return Y;let z=ri0($.source).then((Q)=>{return CS($.id,{...PH($.id),openapi:Q}),Q.token}).finally(()=>RS.delete($.id));return RS.set($.id,z),z}async function $O($,U,Y=7200){let z=D00($),Q=oi0($),I=(await z.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:U},json:{uid:Q,pageType:"home",expireDate:Y}}).json()).value?.message;if(!I)throw Error("Hose CloseAPI did not return a provisional auth URL");let K=new URL(I).searchParams.get("accessToken");if(!K)throw Error("Hose provisional auth URL did not include accessToken");return{token:K,url:I,expiresAt:Date.now()+Y*1000}}async function TH($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=$.source,Y=PH($.id);if(N00(Y.closeapi)&&Y.closeapi.url)return Y.closeapi;let z=_S.get($.id);if(z)return z;let Q=iQ($).then((J)=>$O(U,J)).then((J)=>{return CS($.id,{...PH($.id),closeapi:J}),J}).finally(()=>_S.delete($.id));return _S.set($.id,Q),Q}async function A00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=(await TH($)).url;if(!U)throw Error("Hose provisional auth URL was not available");return U}async function P00($,U=7200,Y){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);if(!Number.isFinite(U)||U<=0)throw Error(`Invalid expire seconds: ${U}. Must be a positive integer.`);let z=await iQ($),Q=await $O($.source,z,U);if(!Q.url)throw Error("Hose provisional auth URL was not available");return{corpId:$.source.corpId,staffId:$.source.staffId,url:Q.url,token:Q.token,expiresIn:U}}async function B00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let U=await TH($),Y=R7($,$.source),z=A6($.seal),J=await T8(Y,void 0,z).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:U.token,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600,G={provider:"hose",corpId:$.source.corpId,staffId:$.source.staffId,sealUrl:P$(Y),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:P$($.source.domain)}};return{token:I,expiresAt:Date.now()+K*1000,enterprise:G}}async function cQ($,U,Y){if(Y){let I=P$(Y),K=await F00(I,$,U);if(!K)throw Error(`Failed to authenticate on specified domain: ${I}. Please verify appKey/appSecurity and domain connectivity.`);return K}let z=pi0.map(async(I)=>{try{return await F00(I,$,U)}catch{return}}),J=(await Promise.all(z)).filter((I)=>Boolean(I));if(J.length>0&&J[0])return J[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($,U,Y){try{let z=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:U,appSecurity:Y}),signal:AbortSignal.timeout(8000)});if(!z.ok)return;let Q=await z.json();if(Q.value?.errorCode)return;let J=Q.value?.accessToken??Q.accessToken,I=Q.value?.corporationId??Q.value?.corporation?.id;if(!J||!I)return;return{domain:$,corpId:I,corpName:Q.value?.corporation?.name,openapiToken:J,expireTime:Q.value?.expireTime}}catch{return}}async function UO($,U){let Y=`${P$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(U)}`,z=await fetch(Y,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!z.ok){let I=await z.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${z.status} ${I}`)}return((await z.json()).items??[]).map((I)=>({id:I.id,name:I.name,enName:I.enName,roleDefs:(I.roleDefs??[]).map((K)=>({id:K.id,name:K.name,enName:K.enName,sourceType:K.sourceType,sourceTypeValue:K.sourceTypeValue,groupId:I.id,groupName:I.name}))}))}async function vS($,U,Y,z="id"){let Q=Y.startsWith("$")?Y.slice(1):Y,J=`${P$($)}/api/openapi/v1/roledefs/$${Q}?accessToken=${encodeURIComponent(U)}&staffBy=${encodeURIComponent(z)}&pathType=name`,I=await fetch(J,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!I.ok){let W=await I.text().catch(()=>"");throw Error(`Failed to fetch Hose role staffs for ${Q}: ${I.status} ${W}`)}let G=(await I.json()).value;if(!G)throw Error(`Hose role staff query returned empty result for ${Q}`);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??Q,name:G.name??"",count:G.count??H.length,staffs:H}}async function hS($,U,Y){if(Y.length===0)return[];let z=`${P$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(U)}`,Q=await fetch(z,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:Y.slice(0,100)}),signal:AbortSignal.timeout(1e4)});if(!Q.ok){let I=await Q.text().catch(()=>"");throw Error(`Failed to fetch Hose staff details: ${Q.status} ${I}`)}return(await Q.json()).items??[]}function SS($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function si0($){let U=typeof $==="string"?O00($):M00($),Y=U.baseUrl||"https://app.ekuaibao.com",z,Q,J,I,K,G={accesstoken:U.accessToken,corpid:U.corpId};try{let H=await K5.get(`${Y}/api/engine/realm/$UNITY/actions/jwt`,{searchParams:{corpId:U.corpId},headers:G,timeout:1e4}).json(),W=H.id||H.value;if(W){let X=W.split(".");if(X.length>=2){let Z=X[1].replace(/-/g,"+").replace(/_/g,"/"),q=JSON.parse(Buffer.from(Z,"base64").toString("utf-8"));if(typeof q.staffId==="string")z=q.staffId;if(typeof q.corporationName==="string")Q=q.corporationName;if(typeof q.staffName==="string")J=q.staffName;if(typeof q.cellphone==="string")K=q.cellphone;if(q.isAdmin!==void 0)I=q.isAdmin===!0||q.isAdmin==="true"}}}catch{}if(!z||!Q)try{let W=(await K5.get(`${Y}/api/account/v2/session`,{headers:{...G,...z?{staffid:z}:{}},timeout:1e4}).json())?.value;if(W){if(!z&&W.loginStaffId)z=W.loginStaffId;if(!Q&&W.corporationName)Q=W.corporationName;if(!J&&W.privilege)J=W.privilege}}catch{}if(!z)z=`${U.corpId}:admin`;return{corpId:U.corpId,baseUrl:Y,accessToken:U.accessToken,staffId:z,corpName:Q,staffName:J,isAdmin:I,cellphone:K}}async function gS($){let U=await si0($),Y={accesstoken:U.accessToken,corpid:U.corpId,staffid:U.staffId},z;try{z=await(await K5.get(`${U.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:U.corpId},headers:Y,timeout:15000})).json()}catch(I){let K=I instanceof Error?I.message:String(I);throw Error(`Failed to query Hose OpenAPI keys from assistance link: ${K}`)}let Q=z.items??[],J=[];for(let I of Q)if(typeof I==="object"&&I!==null){let K=I;if(typeof K.appKey==="string"&&typeof K.appSecurity==="string")J.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:U.corpId,createTime:typeof K.createTime==="number"?K.createTime:void 0,updateTime:typeof K.updateTime==="number"?K.updateTime:void 0})}return{corpId:U.corpId,corpName:U.corpName,baseUrl:U.baseUrl,staffId:U.staffId,keys:J}}var pi0,di0,mi0="/web/thirdparty.html",w00,RS,_S;var a9=o(()=>{uQ();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($,U){return Date.now()>=$.expiresAt-U*1000}async function ai0($){switch($.source.type){case"hose":return B00($);case"direct":case"seal":return I00($)}}async function zO($){let U=$.auth.refreshTtl,Y=YO.get($.id);if(Y&&!T00(Y,U))return Y;let z=q00($.id);if(z&&!T00(z,U))return YO.set($.id,z),z;let Q=await ai0($);return YO.set($.id,Q),V00($.id,Q),Q}async function j00($){return(await zO($)).enterprise}function E00($){YO.delete($),L00($)}var YO;var yS=o(()=>{a9();BH();YO=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 U=ti0($.data);if(U)$.message=`${$.message}: ${U}`;return $}function C00($){return async({error:U})=>{if($&&U instanceof D6&&U.response.status===401)E00($);return ei0(U)}}async function j1($){let U=await zO($);return K5.create({prefix:U.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${U.token}`},hooks:{beforeError:[C00($.id)]}})}async function kS($,U){let Y=await zO($);return T8(Y.enterprise.sealUrl,U,A6($.seal))}function T8($,U,Y={}){let z={...Y};if(U)z.Authorization=`Bearer ${U}`;return K5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:z,hooks:{beforeError:[C00()]}})}var i8=o(()=>{uQ();yS()});var jH;var _00=o(()=>{jH={name:"seal-use",version:"0.10.31",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 Uc0($,U=jH.version){let Y=$.trim();if(!Y)return null;let z=Y.endsWith("-dirty"),Q=z?Y.slice(0,-6):Y,J=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(J&&J[1]&&J[2]&&J[3])return{baseVersion:J[1],commitsAhead:Number.parseInt(J[2],10),commit:J[3],dirty:z,describe:Y};let I=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(I&&I[1])return{baseVersion:I[1],commitsAhead:0,commit:"",dirty:z,describe:Y};let K=Q.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:U,commitsAhead:0,commit:K[1],dirty:z,describe:Y};return null}function Yc0($,U,Y,z){let J=Y?`+g${Y}${z?".dirty":""}`:z?"+dirty":"";return`${$}-dev.${U}${J}`}function zc0($){let U=$?.env,Y=U?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,z=U?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,Q=U?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,J=U?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,I=U?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,K=U?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,G=U?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,H=U?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,W=U?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,X=$?.cwd;if(Y){let Z=z==="true",V={name:"seal-use",version:Y,channel:Q||(Z?"release":"dev"),isRelease:Z};if(J)V.git={baseVersion:J,commitsAhead:Number.parseInt(I||"0",10),commit:K||"",dirty:G==="true",describe:H||Y};return V}if(z==="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=Uc0(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:Yc0(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,Vc1;var t9=o(()=>{_00();EH=zc0(),P1=EH.version,xS=EH.isRelease,Vc1=EH.channel});function nQ($=void 0){return uS.parse($??{})}function g00($,U){return nQ({...nQ($),...U})}var h00,fS,S00,uS,bS;var pQ=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 U=$.toLowerCase();return U.startsWith(".")?U:`.${U}`}).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(($,U)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)U.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 Qc0,Jc0,Ic0,Kc0,k00,Gc0,Hc0,x00,QO,f00,Wc0,JO,u00,RH,b00,Xc0,Zc0,qc0,y00,_H,i00,Vc0,Lc0,IO,iS,c00,n00,p00,d00,KO,m00,cS,nS,l00,o00,Fc0,r00,wc0,s00,CH,a00,t00,e00,$10,U10,Y10,z10,Q10,J10,I10,K10,Oc0,G10,Mc0,Nc0,Dc0,pS,dS,Ac0,H10,W10,X10,Z10,Pc0,mS,Nc1,Dc1,q10,Ac1;var lS=o(()=>{A$();pQ();Qc0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Jc0=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:Qc0.optional()}),Ic0=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:Ic0.optional()}),k00=L.object({user:Jc0,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}),QO=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(QO),hasPendingDeletes:L.boolean().default(!1)}),Wc0=L.object({code:L.string().optional(),description:L.string(),scope:L.string(),strictness:L.string()}),JO=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:JO,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(),IO=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(IO).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(),KO=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(KO).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(KO).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(),U10=L.record(L.string(),L.unknown()),Y10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),z10=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(),Q10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),J10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),I10=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(),Oc0=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(Oc0).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(),Mc0=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:Mc0.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(),Nc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(mS).default([])}).passthrough(),Dc1=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(),Ac1=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 O1($,U){let Y=await $.json();return U.parse(Y.data??Y)}async function W8($){return O1(await $.get("api/v1/auth/me"),k00)}async function O10($){return O1(await $.get("api/auth/get-session"),x00)}async function p6($){return O1(await $.get("api/v1/rules"),f00)}async function hH($,U){return O1(await $.post("api/v1/rules",{json:U}),QO)}async function oS($,U,Y){return O1(await $.put(`api/v1/rules/${U}`,{json:Y}),QO)}async function mQ($,U){await $.delete(`api/v1/rules/${U}`)}async function XO($){let U=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),Y=await U.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:U.ok,status:U.status,body:Y})}async function B$($){return O1(await $.get("api/v1/rule-set-versions"),L.array(JO))}async function SH($,U){return O1(await $.get(`api/v1/rule-set-versions/${U}`),JO)}async function gH($,U){return O1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:U}}),u00)}async function _7($,U={}){let Y=new URLSearchParams;return Y.set("offset",String(U.offset??0)),Y.set("limit",String(U.limit??20)),Y.set("sortBy",U.sortBy??"createdAt"),Y.set("sortOrder",U.sortOrder??"desc"),U.scenarios?.forEach((z,Q)=>{Y.set(`filter[scenarios][${Q}]`,z)}),O1(await $.get("api/v1/knowledge/articles",{searchParams:Y}),b00)}async function M10($,U){return O1(await $.get(`api/v1/knowledge/articles/${U}`),RH)}async function ZO($,U){return O1(await $.post("api/v1/knowledge/articles",{json:{...U,contentType:U.contentType??"policy",status:U.status??"published",enabled:U.enabled??!0,scenarios:U.scenarios&&U.scenarios.length>0?U.scenarios:["audit"],tags:U.tags??[]}}),RH)}async function qO($,U,Y){let z=Object.fromEntries(Object.entries(Y).filter(([,Q])=>Q!==void 0));return O1(await $.patch(`api/v1/knowledge/articles/${U}`,{json:{attributes:z}}),RH)}async function VO($,U){return await $.delete(`api/v1/knowledge/articles/${U}`),{success:!0,id:U}}async function o1($,U="api/v1/agent/ai-approval/config"){return O1(await $.get(U),i00)}async function m5($,U,Y="api/v1/agent/ai-approval/config"){return await $.post(Y,{json:U}),o1($,Y)}async function rS($,U,Y="api/v1/agent/ai-approval/config"){let z=await $.post(Y,{json:U}),Q=await z.json().catch(()=>({})),J=WO.safeParse(Q.data??Q);return J.success?J.data.success??z.ok:z.ok}async function J$($,U="api/v1/agent/ai-approval/config"){let Y=await o1($,U);return sS(Y.integrations)}async function LO($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=sS(Q.integrations),I=j10(U,J,Y);if(!await rS($,{...Q,integrations:[...Q.integrations,I]},z))throw Error("Seal did not confirm saving the Webhook integration");return I}async function N10($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=sS(Q.integrations),I=j10(U,J,Y);return{before:Q,after:{...Q,integrations:[...Q.integrations,I]},integration:I}}async function D10($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=FO(Q.integrations),I=wO(J,U),K=E10(I.integration,Y);if(!await rS($,{...Q,integrations:Q.integrations.map((H,W)=>W===I.index?K:H)},z))throw Error("Seal did not confirm saving the Webhook integration");return K}async function A10($,U,Y,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=FO(Q.integrations),I=wO(J,U),K=E10(I.integration,Y);return{before:Q,after:{...Q,integrations:Q.integrations.map((G,H)=>H===I.index?K:G)},integration:K}}async function P10($,U,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y),Q=FO(z.integrations),J=wO(Q,U);if(!await rS($,{...z,integrations:z.integrations.filter((K,G)=>G!==J.index)},Y))throw Error("Seal did not confirm deleting the Webhook integration");return J.integration}async function B10($,U,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y),Q=FO(z.integrations),J=wO(Q,U);return{before:z,after:{...z,integrations:z.integrations.filter((I,K)=>K!==J.index)},integration:J.integration}}function v7($,U){let Y=U.trim();if(!Y)throw Error("Webhook selector must not be empty");let z=$.find((J)=>J.id===Y);if(z)return z;let Q=$.filter((J)=>J.name===Y);if(Q.length===1)return Q[0];if(Q.length>1)throw Error(`Multiple Webhook integrations match name: ${Y}. Use the integration ID.`);throw Error(`Webhook integration not found: ${Y}`)}function T10($,U){let Y=U?.trim().toLowerCase();if(!Y)return $;return $.filter((z)=>[z.id,z.name,z.mode,z.outgoingResultWebhook,z.incomingDocumentWebhook.url,z.incomingManualResultWebhook.url].some((Q)=>Q.toLowerCase().includes(Y)))}function sS($){return $.filter((U)=>U.type==="webhook").map((U)=>_H.parse(U))}function FO($){return $.flatMap((U,Y)=>{if(U.type!=="webhook")return[];return[{index:Y,integration:_H.parse(U)}]})}function wO($,U){let Y=v7($.map((z)=>z.integration),U);return $.find((z)=>z.integration.id===Y.id)}function j10($,U,Y){let z=vH(Y.name,"name"),Q=Y.mode??"assisted",J=R10(Y.outgoingResultWebhook,"outgoingResultWebhook"),I=_10(Y.autoApprovalRate??60),K=jc0(U),G=`wh_${K}_${F10(8).toString("hex").slice(0,7)}`,H=P$($);return _H.parse({type:"webhook",id:`integration-${K}`,name:z,mode:Q,incomingDocumentWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/document`},outgoingResultWebhook:J,incomingManualResultWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/manual-result`},secret:Y.secret?vH(Y.secret,"secret"):C10(),autoApprovalRate:I,materialPackFilePolicy:nQ(Y.materialPackFilePolicy)})}function E10($,U){return _H.parse({...$,...U.name===void 0?{}:{name:vH(U.name,"name")},...U.mode===void 0?{}:{mode:U.mode},...U.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:R10(U.outgoingResultWebhook,"outgoingResultWebhook")},...U.autoApprovalRate===void 0?{}:{autoApprovalRate:_10(U.autoApprovalRate)},...U.rotateSecret||U.secret!==void 0?{secret:U.rotateSecret?C10():vH(U.secret??"","secret")}:{},...U.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:g00($.materialPackFilePolicy,U.materialPackFilePolicy)}})}function jc0($){let U=new Set($.map((z)=>z.id)),Y=Date.now();while(U.has(`integration-${Y}`))Y+=1;return Y}function C10(){return F10(16).toString("hex")}function vH($,U){let Y=$.trim();if(!Y)throw Error(`Webhook ${U} must not be empty`);return Y}function R10($,U){let Y=vH($,U);try{return new URL(Y).toString()}catch{throw Error(`Webhook ${U} 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 OO($,U={}){let[Y,z,Q]=await Promise.all([p6($),_7($,{limit:U.documentLimit??50}),o1($,U.stylePreferencesEndpoint).then((J)=>({ok:!0,data:J}),(J)=>({ok:!1,error:J instanceof Error?J.message:String(J)}))]);return{rules:Y,documents:z,stylePreferences:Q}}async function b4($,U={}){let Y=new URLSearchParams;return Y.set("offset",String(U.offset??0)),Y.set("limit",String(U.limit??50)),c8(Y,"fromTimestamp",U.fromTimestamp),c8(Y,"toTimestamp",U.toTimestamp),c8(Y,"startDate",U.startDate),c8(Y,"endDate",U.endDate),V10(Y,"status",U.status),c8(Y,"sourceSystem",U.sourceSystem),c8(Y,"taskMode",U.taskMode),c8(Y,"search",U.search),c8(Y,"sourceDocumentSN",U.sourceDocumentSN),c8(Y,"sourceDocumentId",U.sourceDocumentId),V10(Y,"manualApprovalStatus",U.manualApprovalStatus),O1(await $.get("api/v1/approvals",{searchParams:Y}),iS)}async function H4($,U){return O1(await $.get(`api/v1/approvals/${U}`),IO)}async function aS($,U){let Y=await $.get(`api/v1/simulation/batch/${U}/records`).json(),z=Y.data??Y;if(Array.isArray(z))return L.array(IO).parse(z);return iS.parse(z).records}async function v10($,U){return O1(await $.post("api/v1/simulation/create-batch",{json:U}),dS)}async function h10($,U){return O1(await $.post("api/v1/simulation/create-material-pack-batch",{json:U}),dS)}async function S10($,U={}){let Y=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(U.limit??50)}}).json(),z=Y.data??Y;return L.array(pS).parse(z)}async function MO($,U){return O1(await $.get(`api/v1/simulation/batch/${U}`),pS)}async function g10($){let U=await $.get("api/v1/simulation/templates").json(),Y=U.data??U;return L.array(H10).parse(Y)}async function tS($){return O1(await $.get("api/v1/simulation/integration-status"),W10)}async function eS($){let U=await $.get("api/v1/simulation/hosecloud-integrations").json(),Y=U.data??U;return L.array(X10).parse(Y)}async function y10($,U){let z=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(U)}/data`)).json().catch(()=>({}));return z.data??z}async function k10($,U){let Y=U?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",z=U?new URLSearchParams({signKey:U}):void 0,Q=await $.get(Y,{searchParams:z}).json(),J=Q.data??Q;return L.array(q10).parse(J)}async function x10($,U){let Y=await $.post("api/hosecloud/corporation",{json:U}).json(),z=Y.data??Y;return L.object({corporationId:L.string()}).parse(z)}async function f10($,U){let z=await(await $.post("api/hosecloud/outbound-config/sync",{json:U})).json().catch(()=>({}));return z.data??z}async function u10($,U){let Y=new FormData;return Y.append("file",new Blob([new Uint8Array(U.fileBuffer)]),U.fileName),O1(await $.post("api/v1/material-packages/upload",{body:Y}),Z10)}function c8($,U,Y){if(Y)$.set(U,Y)}function V10($,U,Y){if(!Y)return;(Array.isArray(Y)?Y:[Y]).map((Q)=>Q.trim()).filter(Boolean).forEach((Q,J)=>{$.set(`${U}[${J}]`,Q)})}async function b10($){return O1(await $.get("api/v1/delegation/list"),L.array(c00))}async function dQ($,U){return O1(await $.post("api/v1/delegation/create",{json:U??{}}),n00)}async function i10($,U){let Y=await $.post("api/v1/delegation/revoke",{json:{tokenId:U}}),z=await Y.json(),Q=WO.safeParse(z.data??z);return Q.success?Q.data.success??Y.ok:Y.ok}async function c10($,U){let Y=U.departmentIds&&U.departmentIds.length>0?U.departmentIds:void 0;if(!Y){let z=await $.get("api/v1/contacts/departments/root/children").json(),Q=Bc0.safeParse(z.data??z),J=Q.success?Q.data.items?.[0]?._id:void 0;if(J)Y=[J]}return O1(await $.post("api/v1/contacts/local/users",{json:{name:U.name,phone:U.phone,permissions:U.permissions??[],departmentIds:Y??[]}}),p00)}async function $g($,U){return O1(await $.post(`api/v1/contacts/local/users/${U}/reset-password`,{json:{}}),d00)}async function GO($,U){return O1(await $.get(`api/v1/contacts/users/${U}`),KO)}async function HO($,U=""){return O1(await $.get("api/v1/contacts/search",{searchParams:{query:U}}),m00)}async function n10($){return O1(await $.get("api/v1/contacts/departments/root/children"),nS)}async function p10($,U){return O1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(U)}`),cS)}async function d10($,U){return O1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(U)}/children`),nS)}async function m10($,U){return O1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(U)}/users`),l00)}async function l10($){return O1(await $.get("api/v1/contacts/last-sync-time"),o00)}async function NO($,U={}){let Y=Ug(),z=new URLSearchParams;if(c8(z,"startDate",U.startDate??Y.startDate),c8(z,"endDate",U.endDate??Y.endDate),U.limit!==void 0)z.set("limit",String(U.limit));return O1(await $.get("api/v1/insight/stats",{searchParams:z}),r00)}async function DO($,U){let Y=Ug(),z=new URLSearchParams;return z.set("tagId",U.tagId),z.set("startDate",U.startDate??Y.startDate),z.set("endDate",U.endDate??Y.endDate),O1(await $.get("api/v1/insight/risks-by-tag",{searchParams:z}),s00)}async function AO($,U={}){let Y=Ug(),z=L10(U.startDate??Y.startDate),Q=L10(U.endDate??Y.endDate),J=new URLSearchParams;return J.set("startDate",String(z)),J.set("endDate",String(Q)),O1(await $.get("api/v1/insight/performance",{searchParams:J}),a00)}async function o10($,U){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(U)}`),{success:!0,recordId:U}}function L10($){if(typeof $==="number")return $<100000000000?$*1000:$;let U=Number($);if(!isNaN(U)&&$.trim()!=="")return U<100000000000?U*1000:U;let Y=new Date($);if(isNaN(Y.getTime()))throw Error(`Invalid date format: ${$}`);return Y.getTime()}function Ug(){let $=new Date,U=new Date($.getFullYear(),$.getMonth(),1),Y=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:U.toISOString(),endDate:Y.toISOString()}}function r10($){let U=new URLSearchParams;return c8(U,"filter[startDate]",$.startDate),c8(U,"filter[endDate]",$.endDate),c8(U,"filter[search]",$.search),U.set("offset",String($.offset??0)),U.set("limit",String($.limit??50)),U}async function s10($,U={}){return O1(await $.get("api/v1/expenses/list",{searchParams:r10(U)}),e00)}async function a10($,U={}){return O1(await $.get("api/v1/invoice/list",{searchParams:r10(U)}),$10)}async function t10($){return O1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(U10))}async function e10($,U){let Y=await $.delete(`api/v1/contacts/local/users/${U}`),z=await Y.json(),Q=WO.safeParse(z.data??z);return Q.success?Q.data.success??Y.ok:Y.ok}async function Yg($,U){let Y=await $.post(`api/v1/contacts/local/users/${U}/activate`,{json:{}}),z=await Y.json(),Q=WO.safeParse(z.data??z);return Q.success?Q.data.success??Y.ok:Y.ok}async function Ec0($,U){let Y=await $.post("api/auth/sms-otp/sign-in-password",{json:U}),z=Y.headers.get("set-auth-token"),Q=Tc0.parse(await Y.json()),J=z??Q.session?.token;if(!J)throw Error("Failed to retrieve authentication token from login response");return{token:J,user:Q.user}}async function $40($,U,Y,z){let Q;if(U.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(U.userIdOrPhone)){let q=await HO($,U.userIdOrPhone),V=q.users.find((F)=>F.mobile?.includes(U.userIdOrPhone)||F._id===U.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${U.userIdOrPhone}`);Q=V}else Q=await GO($,U.userIdOrPhone).catch(async()=>{let q=await HO($,U.userIdOrPhone),V=q.users.find((F)=>F.name===U.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${U.userIdOrPhone}`);return V});if(Q.status==="resigned")await Yg($,Q._id),Q=await GO($,Q._id);let J=Q,I=Array.isArray(J.identities)&&J.identities.some((q)=>q.provider&&q.provider!=="local")||!!J.apps?.hosecloud;if(I&&z&&z.source.type==="hose"){let V=(Q.mobile||J.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=J.identities?.find((w)=>w.provider==="hosecloud")?.providerId,O=J.apps?.hosecloud?.boundId||F||(V?`${z.source.corpId}:${V}`:void 0);if(O){let w=await iQ(z),N=(await $O({...z.source,staffId:O},w)).token,D=R7(z,z.source),B=A6(z.seal),T=T8(D,void 0,B),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:N,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${Q.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let j=A.token??A.accessToken??A.data?.token;if(j){let C=await Y(j),b=await dQ(C,{note:U.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:b,temporaryPassword:"N/A (Hose SSO)"}}}}let K;try{K=await $g($,Q._id)}catch(q){if(I)throw Error(`用户 "${Q.name}" (${Q.mobile||Q._id}) 为合思同步账号 (provider: hosecloud),无 Seal 本地密码。`+"Seal 系统暂不支持对同步账号直接重置本地密码。");throw q}let H=(Q.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,"");if(!H)throw Error(`User ${Q.name} has no associated phone number for password login`);let{token:W}=await Ec0($,{phone:H,password:K.password}),X=await Y(W),Z=await dQ(X,{note:U.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:Z,temporaryPassword:K.password}}async function U40($){return O1(await $.get("api/v1/llm/config"),Y10)}async function Y40($){return O1(await $.get("api/v1/llm/providers"),L.array(z10))}async function z40($){return O1(await $.get("api/v1/permissions/available"),Q10)}async function Q40($){return O1(await $.get("api/v1/permissions/configs"),J10)}async function cU($){return O1(await $.get("api/v1/billing/status"),I10)}async function J40($){let Y=await(await $.get("api/v1/billing/plans")).json();return w10.parse(Y.data??Y)}async function I40($){let Y=await(await $.get("api/v1/billing/features")).json();return w10.parse(Y.data??Y)}var WO,Bc0,Tc0,w10;var X6=o(()=>{uQ();A$();pQ();a9();i8();lS();WO=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 U6=E((Pn1,G40)=>{var{toString:K40}=Object.prototype,Cc0=/["&<>]/,e9={each:function(U,Y){if(U)if(Array.isArray(U))U.forEach(Y);else Object.keys(U).forEach((z)=>{Y(U[z],z)})},some:function(U,Y){if(U){if(Array.isArray(U))return U.some(Y);return Object.keys(U).some((z)=>Y(U[z],z))}return!1},every:function(U,Y){if(U){if(Array.isArray(U))return U.every(Y);return Object.keys(U).every((z)=>Y(U[z],z))}return!0},map:function(U,Y){if(U){if(Array.isArray(U))return U.map(Y);return Object.keys(U).map((z)=>Y(U[z],z))}return[]},keyBy($,U){return $.reduce((Y,z)=>{return Y[z[U]]=z,Y},{})},isEqual:function(U,Y){let z=typeof U,Q=typeof Y,J=Array.isArray(U),I=Array.isArray(Y),K;if(z!==Q)return!1;switch(typeof U){case"object":if(J||I){if(J&&I)return U.length===Y.length&&U.every((G,H)=>{let W=Y[H];return e9.isEqual(G,W)});return!1}if(U===null||Y===null)return U===Y;if(K=Object.keys(U),Object.keys(Y).length!==K.length)return!1;for(let G of K)if(!Y.hasOwnProperty(G))return!1;return e9.every(U,(G,H)=>{let W=Y[H];return e9.isEqual(G,W)});default:return U===Y}},escapeHtml($){let U=Cc0.exec($);if(!U)return $;let Y="",z="",Q=0,J=U.index;for(;J<$.length;J++){switch($.charAt(J)){case'"':z=""";break;case"&":z="&";break;case"'":z="'";break;case"<":z="<";break;case">":z=">";break;default:continue}if(Q!==J)Y+=$.substring(Q,J);Q=J+1,Y+=z}if(Q!==J)return Y+$.substring(Q,J);return Y},strcmp($,U){if($U)return 1;return 0},isUndefined($){return K40.call($)==="[object Undefined]"},isObject($){return K40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:U}=arguments,Y,z,Q;function J(I,K){if(Y=$[K],Q=Array.isArray(I),e9.isObject(I)||Q){if(Q)Q=!1,z=Y&&Array.isArray(Y)?Y:[];else z=Y&&e9.isObject(Y)?Y:{};$[K]=e9.deepMerge(z,I)}else if(!e9.isUndefined(I))$[K]=I}for(let I=0;I{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 U,Y,z,Q,J,I=1;if($>=4)throw Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&$>=1){while(I<=26)U=this._dictionary[I-1],this._n2l[I]=U,this._l2n[U]=I,I++;this._l2nFill=1}if(this._l2nFill<2&&$>=2){I=27;while(I<=702)Y=I-27,z=Y%26,Q=Math.floor(Y/26),U=this._dictionary[Q]+this._dictionary[z],this._n2l[I]=U,this._l2n[U]=I,I++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){I=703;while(I<=16384)Y=I-703,z=Y%26,Q=Math.floor(Y/26)%26,J=Math.floor(Y/676),U=this._dictionary[J]+this._dictionary[Q]+this._dictionary[z],this._n2l[I]=U,this._l2n[U]=I,I++;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 U=$.length<5&&this._hash[$];if(U)return U;let Y=!1,z="",Q=0,J=!1,I="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!J&&W>=65&&W<=90)Y=!0,z+=$[H],Q=Q*26+W-64;else if(W>=48&&W<=57)J=!0,I+=$[H],K=K*10+W-48;else if(J&&Y&&W!==36)break;if(!Y)Q=void 0;else if(Q>16384)throw Error(`Out of bounds. Invalid column letter: ${z}`);if(!J)K=void 0;$=z+I;let G={address:$,col:Q,row:K,$col$row:`$${z}$${I}`};if(Q<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,U){if(U){let Y=this.n2l(U)+$;return this.decodeAddress(Y)}return this.decodeAddress($)},decode($){let U=$.split(":");if(U.length===2){let Y=this.decodeAddress(U[0]),z=this.decodeAddress(U[1]),Q={top:Math.min(Y.row,z.row),left:Math.min(Y.col,z.col),bottom:Math.max(Y.row,z.row),right:Math.max(Y.col,z.col)};return Q.tl=this.n2l(Q.left)+Q.top,Q.br=this.n2l(Q.right)+Q.bottom,Q.dimensions=`${Q.tl}:${Q.br}`,Q}return this.decodeAddress($)},decodeEx($){let U=$.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),Y=U[1]||U[2],z=U[3],Q=z.split(":");if(Q.length>1){let I=this.decodeAddress(Q[0]),K=this.decodeAddress(Q[1]),G=Math.min(I.row,K.row),H=Math.min(I.col,K.col),W=Math.max(I.row,K.row),X=Math.max(I.col,K.col);return I=this.n2l(H)+G,K=this.n2l(X)+W,{top:G,left:H,bottom:W,right:X,sheetName:Y,tl:{address:I,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:Y},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:Y},dimensions:`${I}:${K}`}}if(z.startsWith("#"))return Y?{sheetName:Y,error:z}:{error:z};let J=this.decodeAddress(z);return Y?{sheetName:Y,...J}:J},encodeAddress($,U){return yH.n2l(U)+$},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($,U){let[Y,z,,Q,J]=$,[I,K]=U;return I>=Y&&I<=Q&&K>=z&&K<=J}};H40.exports=yH});var $3=E((Tn1,W40)=>{var l5=i4();class zg{constructor(){this.decode(arguments)}setTLBR($,U,Y,z,Q){if(arguments.length<4){let J=l5.decodeAddress($),I=l5.decodeAddress(U);this.model={top:Math.min(J.row,I.row),left:Math.min(J.col,I.col),bottom:Math.max(J.row,I.row),right:Math.max(J.col,I.col),sheetName:Y},this.setTLBR(J.row,J.col,I.row,I.col,Q)}else this.model={top:Math.min($,Y),left:Math.min(U,z),bottom:Math.max($,Y),right:Math.max(U,z),sheetName:Q}}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 U=$[0];if(U instanceof zg)this.model={top:U.model.top,left:U.model.left,bottom:U.model.bottom,right:U.model.right,sheetName:U.sheetName};else if(U instanceof Array)this.decode(U);else if(U.top&&U.left&&U.bottom&&U.right)this.model={top:U.top,left:U.left,bottom:U.bottom,right:U.right,sheetName:U.sheetName};else{let Y=l5.decodeEx(U);if(Y.top)this.model={top:Y.top,left:Y.left,bottom:Y.bottom,right:Y.right,sheetName:Y.sheetName};else this.model={top:Y.row,left:Y.col,bottom:Y.row,right:Y.col,sheetName:Y.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($,U,Y,z){if(!this.model.top||$this.bottom)this.bottom=Y;if(!this.model.right||z>this.right)this.right=z}expandRow($){if($){let{dimensions:U,number:Y}=$;if(U)this.expand(Y,U.min,Y,U.max)}}expandToAddress($){let U=l5.decodeEx($);this.expand(U.row,U.col,U.row,U.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 U=l5.decodeEx($);return this.containsEx(U)}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 U=this.left;U<=this.right;U++)for(let Y=this.top;Y<=this.bottom;Y++)$(l5.encodeAddress(Y,U),Y,U)}}W40.exports=zg});var G5=E((jn1,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((En1,Z40)=>{var PO=i4(),_c0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,vc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function hc0($,U,Y){let z=PO.decode(U),Q=PO.decode(Y);return $.replace(_c0,(J,I,K,G,H)=>{if(H)return J;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 J;let F=PO.l2n(Z),O=parseInt(V,10);if(!X)F+=Q.col-z.col;if(!q)O+=Q.row-z.row;return(I||"")+(X||"")+PO.n2l(F)+(q||"")+O}return J})}Z40.exports={slideFormula:hc0}});var L40=E((Cn1,V40)=>{var Sc0=U6();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:U}=$,{texts:Y}=U;if(Y.length===1&&Object.keys(Y[0]).length===1)this.note=Y[0].text;else this.note=U}static fromModel($){let U=new kH;return U.model=$,U}}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((Rn1,R40)=>{var gc0=i4(),yc0=U6(),H5=G5(),{slideFormula:kc0}=q40(),F40=L40();class d0{constructor($,U,Y){if(!$||!U)throw Error("A Cell needs a Row");this._row=$,this._column=U,gc0.validateAddress(Y),this._address=Y,this._value=h7.create(d0.Types.Null,this),this.style=this._mergeStyle($.style,U.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($,U,Y){let z=$&&$.numFmt||U&&U.numFmt;if(z)Y.numFmt=z;let Q=$&&$.font||U&&U.font;if(Q)Y.font=Q;let J=$&&$.alignment||U&&U.alignment;if(J)Y.alignment=J;let I=$&&$.border||U&&U.border;if(I)Y.border=I;let K=$&&$.fill||U&&U.fill;if(K)Y.fill=K;let G=$&&$.protection||U&&U.protection;if(G)Y.protection=G;return Y}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($,U){if(this._value.release(),this._value=h7.create(d0.Types.Merge,this,$),!U)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:U}=this.workbook;U.removeAllNames(this.fullAddress),$.forEach((Y)=>{U.addEx(this.fullAddress,Y)})}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 O40{constructor($,U){this.model={address:$.address,type:d0.Types.Number,value:U}}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 M40{constructor($,U){this.model={address:$.address,type:d0.Types.String,value:U}}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($,U){this.model={address:$.address,type:d0.Types.String,value:U}}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($,U){this.model={address:$.address,type:d0.Types.Date,value:U}}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($,U){if(this.model={address:$.address,type:d0.Types.Hyperlink,text:U?U.text:void 0,hyperlink:U?U.hyperlink:void 0},U&&U.tooltip)this.model.tooltip=U.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($,U){if(this.model={address:$.address,type:d0.Types.Merge,master:U?U.address:void 0},this._master=U,U)U.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($,U){this.cell=$,this.model={address:$.address,type:d0.Types.Formula,shareType:U?U.shareType:void 0,ref:U?U.ref:void 0,formula:U?U.formula:void 0,sharedFormula:U?U.sharedFormula:void 0,result:U?U.result:void 0}}_copyModel($){let U={},Y=(z)=>{let Q=$[z];if(Q)U[z]=Q};return Y("formula"),Y("result"),Y("ref"),Y("shareType"),Y("sharedFormula"),U}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),U=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:U}}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,U=$.findCell(this.model.sharedFormula);this._translatedFormula=U&&kc0(U.formula,U.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($,U){this.model={address:$.address,type:d0.Types.SharedString,value:U}}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($,U){this.model={address:$.address,type:d0.Types.Boolean,value:U}}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($,U){this.model={address:$.address,type:d0.Types.Error,value:U}}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($,U){this.model={address:$.address,type:d0.Types.String,value:JSON.stringify(U),rawValue:U}}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:O40},{t:d0.Types.String,f:M40},{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(($,U)=>{return $[U.t]=U.f,$},[]),create($,U,Y){let z=this.types[$];if(!z)throw Error(`Could not create Value of type ${$}`);return new z(U,Y)}};R40.exports=d0});var TO=E((_n1,S40)=>{var xc0=U6(),BO=G5(),nU=i4(),v40=_40();class h40{constructor($,U){this._worksheet=$,this._number=U,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 U=this._cells[$.col-1];if(!U){let Y=this._worksheet.getColumn($.col);U=new v40(this,Y,$.address),this._cells[$.col-1]=U}return U}getCell($){if(typeof $==="string"){let U=this._worksheet.getColumnKey($);if(U)$=U.number;else $=nU.l2n($)}return this._cells[$-1]||this.getCellEx({address:nU.encodeAddress(this._number,$),row:this._number,col:$})}splice($,U,...Y){let z=$+U,Q=Y.length-U,J=this._cells.length,I,K,G;if(Q<0){for(I=$+Y.length;I<=J;I++)if(G=this._cells[I-1],K=this._cells[I-Q-1],K)G=this.getCell(I),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(Q>0)for(I=J;I>=z;I--)if(K=this._cells[I-1],K)G=this.getCell(I+Q),G.value=K.value,G.style=K.style,G._comment=K._comment;else this._cells[I+Q-1]=void 0;for(I=0;I{if(Y&&Y.type!==BO.ValueType.Null)U(Y,z+1)})}addPageBreak($,U){let Y=this._worksheet,z=Math.max(0,$-1)||0,Q=Math.max(0,U-1)||16838,J={id:this._number,max:Q,man:1};if(z)J.min=z;Y.rowBreaks.push(J)}get values(){let $=[];return this._cells.forEach((U)=>{if(U&&U.type!==BO.ValueType.Null)$[U.col]=U.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let U=0;if($.hasOwnProperty("0"))U=1;$.forEach((Y,z)=>{if(Y!==void 0)this.getCellEx({address:nU.encodeAddress(this._number,z+U),row:this._number,col:z+U}).value=Y})}else this._worksheet.eachColumnKey((U,Y)=>{if($[Y]!==void 0)this.getCellEx({address:nU.encodeAddress(this._number,U.number),row:this._number,col:U.number}).value=$[Y]})}get hasValues(){return xc0.some(this._cells,($)=>$&&$.type!==BO.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let $=0;return this.eachCell(()=>{$++}),$}get dimensions(){let $=0,U=0;return this._cells.forEach((Y)=>{if(Y&&Y.type!==BO.ValueType.Null){if(!$||$>Y.col)$=Y.col;if(U0?{min:$,max:U}:null}_applyStyle($,U){return this.style[$]=U,this._cells.forEach((Y)=>{if(Y)Y[$]=U}),U}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 $=[],U=0,Y=0;return this._cells.forEach((z)=>{if(z){let Q=z.model;if(Q){if(!U||U>z.col)U=z.col;if(Y{switch(Y.type){case v40.Types.Merge:break;default:{let z;if(Y.address)z=nU.decodeAddress(Y.address);else if(U){let{row:J}=U,I=U.col+1;z={row:J,col:I,address:nU.encodeAddress(J,I),$col$row:`$${nU.n2l(I)}$${J}`}}U=z;let Q=this.getCellEx(z);Q.model=Y;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 EO=E((vn1,g40)=>{var fc0=U6(),uc0=G5(),bc0=i4();class jO{constructor($,U,Y){if(this._worksheet=$,this._number=U,Y!==!1)this.defn=Y}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((U,Y)=>{this._worksheet.getCell(Y+1,this.number).value=U});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($,U){let Y=this.number;if(!U)U=$,$=null;this._worksheet.eachRow($,(z,Q)=>{U(z.getCell(Y),Q)})}get values(){let $=[];return this.eachCell((U,Y)=>{if(U&&U.type!==uc0.ValueType.Null)$[Y]=U.value}),$}set values($){if(!$)return;let U=this.number,Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((z,Q)=>{this._worksheet.getCell(Q+Y,U).value=z})}_applyStyle($,U){return this.style[$]=U,this.eachCell((Y)=>{Y[$]=U}),U}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 U=[],Y=null;if($)$.forEach((z,Q)=>{if(z.isDefault){if(Y)Y=null}else if(!Y||!z.equivalentTo(Y))Y={min:Q+1,max:Q+1,width:z.width!==void 0?z.width:9,style:z.style,isCustomWidth:z.isCustomWidth,hidden:z.hidden,outlineLevel:z.outlineLevel,collapsed:z.collapsed},U.push(Y);else Y.max=Q+1});return U.length?U:void 0}static fromModel($,U){U=U||[];let Y=[],z=1,Q=0;U=U.sort(function(J,I){return J.min-I.min});while(Q{var ic0=i4();class CO{constructor($,U,Y=0){if(this.worksheet=$,!U)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof U==="string"){let z=ic0.decodeAddress(U);this.nativeCol=z.col+Y,this.nativeColOff=0,this.nativeRow=z.row+Y,this.nativeRowOff=0}else if(U.nativeCol!==void 0)this.nativeCol=U.nativeCol||0,this.nativeColOff=U.nativeColOff||0,this.nativeRow=U.nativeRow||0,this.nativeRowOff=U.nativeRowOff||0;else if(U.col!==void 0)this.col=U.col+Y,this.row=U.row+Y;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof CO||$==null?$:new CO($)}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=CO});var u40=E((Sn1,f40)=>{var cc0=i4(),RO=k40();class x40{constructor($,U){this.worksheet=$,this.model=U}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:U,range:Y,hyperlinks:z}){if(this.type=$,this.imageId=U,$==="image")if(typeof Y==="string"){let Q=cc0.decode(Y);this.range={tl:new RO(this.worksheet,{col:Q.left,row:Q.top},-1),br:new RO(this.worksheet,{col:Q.right,row:Q.bottom},0),editAs:"oneCell"}}else this.range={tl:new RO(this.worksheet,Y.tl,0),br:Y.br&&new RO(this.worksheet,Y.br,0),ext:Y.ext,editAs:Y.editAs,hyperlinks:z||Y.hyperlinks}}}f40.exports=x40});var n40=E((gn1,c40)=>{var _O=i4();class b40{constructor($,U,Y){this.table=$,this.column=U,this.index=Y}_set($,U){this.table.cacheState(),this.column[$]=U}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($,U){if(this.worksheet=$,U)this.table=U,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,U=(G,H,W)=>{if(G[H]===void 0)G[H]=W};U($,"headerRow",!0),U($,"totalsRow",!1),U($,"style",{}),U($.style,"theme","TableStyleMedium2"),U($.style,"showFirstColumn",!1),U($.style,"showLastColumn",!1),U($.style,"showRowStripes",!1),U($.style,"showColumnStripes",!1);let Y=(G,H)=>{if(!G)throw Error(H)};Y($.ref,"Table must have ref"),Y($.columns,"Table must have column definitions"),Y($.rows,"Table must have row definitions"),$.tl=_O.decodeAddress($.ref);let{row:z,col:Q}=$.tl;Y(z>0,"Table must be on valid row"),Y(Q>0,"Table must be on valid col");let{width:J,filterHeight:I,tableHeight:K}=this;$.autoFilterRef=_O.encode(z,Q,z+I-1,Q+J-1),$.tableRef=_O.encode(z,Q,z+K-1,Q+J-1),$.columns.forEach((G,H)=>{if(Y(G.name,`Column ${H} must have a name`),H===0)U(G,"totalsRowLabel","Total");else U(G,"totalsRowFunction","none"),G.totalsRowFormula=this.getFormula(G)})}store(){let $=(I,K)=>{if(K)Object.keys(K).forEach((G)=>{I[G]=K[G]})},{worksheet:U,table:Y}=this,{row:z,col:Q}=Y.tl,J=0;if(Y.headerRow){let I=U.getRow(z+J++);Y.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=I.getCell(Q+G);X.value=W,$(X,H)})}if(Y.rows.forEach((I)=>{let K=U.getRow(z+J++);I.forEach((G,H)=>{let W=K.getCell(Q+H);W.value=G,$(W,Y.columns[H].style)})}),Y.totalsRow){let I=U.getRow(z+J++);Y.columns.forEach((K,G)=>{let H=I.getCell(Q+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:U}=this,{row:Y,col:z}=U.tl,Q=0;if(U.headerRow){let J=$.getRow(Y+Q++);U.columns.forEach((I,K)=>{let G=J.getCell(z+K);G.value=I.name})}if(U.rows.forEach((J)=>{let I=$.getRow(Y+Q++);J.forEach((K,G)=>{let H=I.getCell(z+G);H.value=K})}),U.totalsRow){let J=$.getRow(Y+Q++);U.columns.forEach((I,K)=>{let G=J.getCell(z+K);if(K===0)G.value=I.totalsRowLabel;else if(this.getFormula(I))G.value={formula:I.totalsRowFormula,result:I.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 $=_O.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let U=0;U{z.push(U[Q])});else this.table.columns.splice(Y,0,$),this.table.rows.forEach((z,Q)=>{z.splice(Y,0,U[Q])})}removeColumns($,U=1){this.cacheState(),this.table.columns.splice($,U),this.table.rows.forEach((Y)=>{Y.splice($,U)})}_assign($,U,Y){this.cacheState(),$[U]=Y}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 Qg=E((yn1,d40)=>{class p40{constructor($){this.model=$||{}}add($,U){return this.model[$]=U}find($){return this.model[$]}remove($){this.model[$]=void 0}}d40.exports=p40});var Ig=E((kn1,m40)=>{var Jg=I0("crypto"),nc0={hash($,...U){let Y=Jg.createHash($);return Y.update(Buffer.concat(U)),Y.digest()},convertPasswordToHash($,U,Y,z){if(U=U.toLowerCase(),Jg.getHashes().indexOf(U)<0)throw Error(`Hash algorithm '${U}' not supported!`);let J=Buffer.from($,"utf16le"),I=this.hash(U,Buffer.from(Y,"base64"),J);for(let K=0;K{var l40=($,U)=>({...$,...U.reduce((Y,z)=>{if($[z])Y[z]={...$[z]};return Y},{})}),o5=($,U,Y,z=[])=>{if($[Y])U[Y]=l40($[Y],z)},pc0=($)=>Object.keys($).length===0,dc0=($)=>{if(!$)return $;if(pc0($))return{};let U={...$};if(o5($,U,"font",["color"]),o5($,U,"alignment"),o5($,U,"protection"),$.border)o5($,U,"border"),o5($.border,U.border,"top",["color"]),o5($.border,U.border,"left",["color"]),o5($.border,U.border,"bottom",["color"]),o5($.border,U.border,"right",["color"]),o5($.border,U.border,"diagonal",["color"]);if($.fill){if(o5($,U,"fill",["fgColor","bgColor","center"]),$.fill.stops)U.fill.stops=$.fill.stops.map((Y)=>l40(Y,["color"]))}return U};mc0.copyStyle=dc0});var Y60=E((fn1,U60)=>{var xH=U6(),fH=i4(),uH=$3(),r40=TO(),vO=EO(),oc0=G5(),Kg=u40(),s40=n40(),a40=Qg(),t40=Ig(),{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((U)=>U&&U.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((U)=>{if(U){let Y=U.dimensions;if(Y)$.expand(U.number,Y.min,U.number,Y.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((z,Q)=>{let J=Q.header&&1||Q.headers&&Q.headers.length||0;return Math.max(z,J)},0);let U=1,Y=this._columns=[];$.forEach((z)=>{let Q=new vO(this,U++,!1);Y.push(Q),Q.defn=z})}getColumnKey($){return this._keys[$]}setColumnKey($,U){this._keys[$]=U}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){xH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let U=this._keys[$];if(U)return U;$=fH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let U=this._columns.length+1;while(U<=$)this._columns.push(new vO(this,U++))}return this._columns[$-1]}spliceColumns($,U,...Y){let Q=this._rows.length;if(Y.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($,U)});let J=Y.length-U,I=$+U,K=this._columns.length;if(J<0)for(let G=$+Y.length;G<=K;G++)this.getColumn(G).defn=this.getColumn(G-J).defn;else if(J>0)for(let G=K;G>=I;G--)this.getColumn(G+J).defn=this.getColumn(G).defn;for(let G=$;G<$+Y.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,U,Y.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let $=0;return this.eachRow((U)=>{$=Math.max($,U.cellCount)}),$}get actualColumnCount(){let $=[],U=0;return this.eachRow((Y)=>{Y.eachCell(({col:z})=>{if(!$[z])$[z]=!0,U++})}),U}_commitRow(){}get _lastRowNumber(){let $=this._rows,U=$.length;while(U>0&&$[U-1]===void 0)U--;return U}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($,U){return this._rows.slice($-1,$-1+U)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let $=0;return this.eachRow(()=>{$++}),$}getRow($){let U=this._rows[$-1];if(!U)U=this._rows[$-1]=new r40(this,$);return U}getRows($,U){if(U<1)return;let Y=[];for(let z=$;z<$+U;z++)Y.push(this.getRow(z));return Y}addRow($,U="n"){let Y=this._nextRow,z=this.getRow(Y);return z.values=$,this._setStyleOption(Y,U[0]==="i"?U:"n"),z}addRows($,U="n"){let Y=[];return $.forEach((z)=>{Y.push(this.addRow(z,U))}),Y}insertRow($,U,Y="n"){return this.spliceRows($,0,U),this._setStyleOption($,Y),this.getRow($)}insertRows($,U,Y="n"){if(this.spliceRows($,0,...U),Y!=="n"){for(let z=0;z{Q.getCell(I).style=e40(J.style)}),Q.height=z.height}duplicateRow($,U,Y=!1){let z=this._rows[$-1],Q=Array(U).fill(z.values);this.spliceRows($+1,Y?0:U,...Q);for(let J=0;J{I.getCell(G).style=K.style})}}spliceRows($,U,...Y){let z=$+U,Q=Y.length,J=Q-U,I=this._rows.length,K,G;if(J<0){if($===I)this._rows[I-1]=void 0;for(K=z;K<=I;K++)if(G=this._rows[K-1],G){let H=this.getRow(K+J);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+J-1]=void 0}else if(J>0)for(K=I;K>=z;K--)if(G=this._rows[K-1],G){let H=this.getRow(K+J);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+Q).getCell(X),q=W._value._master,V=this.getRow(q._row._number+Q).getCell(q._column._number);Z.merge(V)}})}else this._rows[K+J-1]=void 0;for(K=0;K{if(Y&&Y.hasValues)U(Y,Y.number)})}getSheetValues(){let $=[];return this._rows.forEach((U)=>{if(U)$[U.number]=U.values}),$}findCell($,U){let Y=fH.getAddress($,U),z=this._rows[Y.row-1];return z?z.findCell(Y.col):void 0}getCell($,U){let Y=fH.getAddress($,U);return this.getRow(Y.row).getCellEx(Y)}mergeCells(...$){let U=new uH($);this._mergeCellsInternal(U)}mergeCellsWithoutStyle(...$){let U=new uH($);this._mergeCellsInternal(U,!0)}_mergeCellsInternal($,U){xH.each(this._merges,(z)=>{if(z.intersects($))throw Error("Cannot merge already merged cells")});let Y=this.getCell($.top,$.left);for(let z=$.top;z<=$.bottom;z++)for(let Q=$.left;Q<=$.right;Q++)if(z>$.top||Q>$.left)this.getCell(z,Q).merge(Y,U);this._merges[Y.address]=$}_unMergeMaster($){let U=this._merges[$.address];if(U){for(let Y=U.top;Y<=U.bottom;Y++)for(let z=U.left;z<=U.right;z++)this.getCell(Y,z).unmerge();delete this._merges[$.address]}}get hasMerges(){return xH.some(this._merges,Boolean)}unMergeCells(...$){let U=new uH($);for(let Y=U.top;Y<=U.bottom;Y++)for(let z=U.left;z<=U.right;z++){let Q=this.findCell(Y,z);if(Q){if(Q.type===oc0.ValueType.Merge)this._unMergeMaster(Q.master);else if(this._merges[Q.address])this._unMergeMaster(Q)}}}fillFormula($,U,Y,z="shared"){let Q=fH.decode($),{top:J,left:I,bottom:K,right:G}=Q,H=G-I+1,W=fH.encodeAddress(J,I),X=z==="shared",Z;if(typeof Y==="function")Z=Y;else if(Array.isArray(Y))if(Array.isArray(Y[0]))Z=(V,F)=>Y[V-J][F-I];else Z=(V,F)=>Y[(V-J)*H+(F-I)];else Z=()=>{return};let q=!0;for(let V=J;V<=K;V++)for(let F=I;F<=G;F++)if(q)this.getCell(V,F).value={shareType:z,formula:U,ref:$,result:Z(V,F)},q=!1;else this.getCell(V,F).value=X?{sharedFormula:W,result:Z(V,F)}:Z(V,F)}addImage($,U){let Y={type:"image",imageId:$,range:U};this._media.push(new Kg(this,Y))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let U={type:"background",imageId:$};this._media.push(new Kg(this,U))}getBackgroundImageId(){let $=this._media.find((U)=>U.type==="background");return $&&$.imageId}protect($,U){return new Promise((Y)=>{if(this.sheetProtection={sheet:!0},U&&"spinCount"in U)U.spinCount=Number.isFinite(U.spinCount)?Math.round(Math.max(0,U.spinCount)):1e5;if($)this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=t40.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=U&&"spinCount"in U?U.spinCount:1e5,this.sheetProtection.hashValue=t40.convertPasswordToHash($,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount);if(U){if(this.sheetProtection=Object.assign(this.sheetProtection,U),!$&&"spinCount"in U)delete this.sheetProtection.spinCount}Y()})}unprotect(){this.sheetProtection=null}addTable($){let U=new s40(this,$);return this.tables[$.name]=U,U}getTable($){return this.tables[$]}removeTable($){delete this.tables[$]}getTables(){return Object.values(this.tables)}addConditionalFormatting($){this.conditionalFormattings.push($)}removeConditionalFormatting($){if(typeof $==="number")this.conditionalFormattings.splice($,1);else if($ instanceof Function)this.conditionalFormattings=this.conditionalFormattings.filter($);else this.conditionalFormattings=[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor($){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=$}get model(){let $={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((z)=>z.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((z)=>z.model),conditionalFormattings:this.conditionalFormattings};$.cols=vO.toModel(this.columns);let U=$.rows=[],Y=$.dimensions=new uH;return this._rows.forEach((z)=>{let Q=z&&z.model;if(Q)Y.expand(Q.number,Q.min,Q.number,Q.max),U.push(Q)}),$.merges=[],xH.each(this._merges,(z)=>{$.merges.push(z.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((U)=>{let Y=new r40(this,U.number);this._rows[Y.number-1]=Y,Y.model=U})}_parseMergeCells($){xH.each($.mergeCells,(U)=>{this.mergeCellsWithoutStyle(U)})}set model($){this.name=$.name,this._columns=vO.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((U)=>new Kg(this,U)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((U,Y)=>{let z=new s40;return z.model=Y,U[Y.name]=z,U},{}),this.conditionalFormattings=$.conditionalFormattings}}U60.exports=$60});var I60=E((un1,J60)=>{var z60=U6(),hO=i4();class Q60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(hO.decodeEx($))}getCell($){return this.findCellEx(hO.decodeEx($),!0)}findCell($){return this.findCellEx(hO.decodeEx($),!1)}findCellAt($,U,Y){let z=this.sheets[$],Q=z&&z[U];return Q&&Q[Y]}addCellEx($){if($.top)for(let U=$.top;U<=$.bottom;U++)for(let Y=$.left;Y<=$.right;Y++)this.getCellAt($.sheetName,U,Y);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,U){let Y=this.findSheet($,U),z=this.findSheetRow(Y,$,U);return this.findRowCell(z,$,U)}getCellAt($,U,Y){let z=this.sheets[$]||(this.sheets[$]=[]),Q=z[U]||(z[U]=[]);return Q[Y]||(Q[Y]={sheetName:$,address:hO.n2l(Y)+U,row:U,col:Y})}removeCellEx($){let U=this.findSheet($);if(!U)return;let Y=this.findSheetRow(U,$);if(!Y)return;delete Y[$.col]}forEachInSheet($,U){let Y=this.sheets[$];if(Y)Y.forEach((z,Q)=>{if(z)z.forEach((J,I)=>{if(J)U(J,Q,I)})})}forEach($){z60.each(this.sheets,(U,Y)=>{this.forEachInSheet(Y,$)})}map($){let U=[];return this.forEach((Y)=>{U.push($(Y))}),U}findSheet($,U){let Y=$.sheetName;if(this.sheets[Y])return this.sheets[Y];if(U)return this.sheets[Y]=[];return}findSheetRow($,U,Y){let{row:z}=U;if($&&$[z])return $[z];if(Y)return $[z]=[];return}findRowCell($,U,Y){let{col:z}=U;if($&&$[z])return $[z];if(Y)return $[z]=this.template?Object.assign(U,JSON.parse(JSON.stringify(this.template))):U;return}spliceRows($,U,Y,z){let Q=this.sheets[$];if(Q){let J=[];for(let I=0;I{I.splice(U,Y,...J)})}}}J60.exports=Q60});var Gg=E((bn1,H60)=>{var lQ=U6(),bH=i4(),K60=I60(),rc0=$3(),sc0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class G60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new K60)}add($,U){let Y=bH.decodeEx($);this.addEx(Y,U)}addEx($,U){let Y=this.getMatrix(U);if($.top)for(let z=$.left;z<=$.right;z++)for(let Q=$.top;Q<=$.bottom;Q++){let J={sheetName:$.sheetName,address:bH.n2l(z)+Q,row:Q,col:z};Y.addCellEx(J)}else Y.addCellEx($)}remove($,U){let Y=bH.decodeEx($);this.removeEx(Y,U)}removeEx($,U){this.getMatrix(U).removeCellEx($)}removeAllNames($){lQ.each(this.matrixMap,(U)=>{U.removeCellEx($)})}forEach($){lQ.each(this.matrixMap,(U,Y)=>{U.forEach((z)=>{$(Y,z)})})}getNames($){return this.getNamesEx(bH.decodeEx($))}getNamesEx($){return lQ.map(this.matrixMap,(U,Y)=>U.findCellEx($)&&Y).filter(Boolean)}_explore($,U){U.mark=!1;let{sheetName:Y}=U,z=new rc0(U.row,U.col,U.row,U.col,Y),Q,J;function I(G,H){let W=$.findCellAt(Y,G,U.col);if(!W||!W.mark)return!1;return z[H]=G,W.mark=!1,!0}for(J=U.row-1;I(J,"top");J--);for(J=U.row+1;I(J,"bottom");J++);function K(G,H){let W=[];for(J=z.top;J<=z.bottom;J++){let X=$.findCellAt(Y,J,G);if(X&&X.mark)W.push(X);else return!1}z[H]=G;for(let X=0;X{z.mark=!0});let Y=U.map((z)=>z.mark&&this._explore(U,z)).filter(Boolean).map((z)=>z.$shortRange);return{name:$,ranges:Y}}normaliseMatrix($,U){$.forEachInSheet(U,(Y,z,Q)=>{if(Y){if(Y.row!==z||Y.col!==Q)Y.row=z,Y.col=Q,Y.address=bH.n2l(Q)+z}})}spliceRows($,U,Y,z){lQ.each(this.matrixMap,(Q)=>{Q.spliceRows($,U,Y,z),this.normaliseMatrix(Q,$)})}spliceColumns($,U,Y,z){lQ.each(this.matrixMap,(Q)=>{Q.spliceColumns($,U,Y,z),this.normaliseMatrix(Q,$)})}get model(){return lQ.map(this.matrixMap,($,U)=>this.getRanges(U,$)).filter(($)=>$.ranges.length)}set model($){let U=this.matrixMap={};$.forEach((Y)=>{let z=U[Y.name]=new K60;Y.ranges.forEach((Q)=>{if(sc0.test(Q.split("!").pop()||""))z.addCell(Q)})})}}H60.exports=G60});var I6=E((in1,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($,U,Y,z){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var Q=arguments.length,J,I;switch(Q){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,U)});case 3:return process.nextTick(function(){$.call(null,U,Y)});case 4:return process.nextTick(function(){$.call(null,U,Y,z)});default:J=Array(Q-1),I=0;while(I{var tc0={}.toString;W60.exports=Array.isArray||function($){return tc0.call($)=="[object Array]"}});var K6=E((Wg,Z60)=>{var SO=I0("buffer"),U3=SO.Buffer;function X60($,U){for(var Y in $)U[Y]=$[Y]}if(U3.from&&U3.alloc&&U3.allocUnsafe&&U3.allocUnsafeSlow)Z60.exports=SO;else X60(SO,Wg),Wg.Buffer=rQ;function rQ($,U,Y){return U3($,U,Y)}X60(U3,rQ);rQ.from=function($,U,Y){if(typeof $==="number")throw TypeError("Argument must not be a number");return U3($,U,Y)};rQ.alloc=function($,U,Y){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=U3($);if(U!==void 0)if(typeof Y==="string")z.fill(U,Y);else z.fill(U);else z.fill(0);return z};rQ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return U3($)};rQ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return SO.SlowBuffer($)}});var O4=E((qn0)=>{function ec0($){if(Array.isArray)return Array.isArray($);return gO($)==="[object Array]"}qn0.isArray=ec0;function $n0($){return typeof $==="boolean"}qn0.isBoolean=$n0;function Un0($){return $===null}qn0.isNull=Un0;function Yn0($){return $==null}qn0.isNullOrUndefined=Yn0;function zn0($){return typeof $==="number"}qn0.isNumber=zn0;function Qn0($){return typeof $==="string"}qn0.isString=Qn0;function Jn0($){return typeof $==="symbol"}qn0.isSymbol=Jn0;function In0($){return $===void 0}qn0.isUndefined=In0;function Kn0($){return gO($)==="[object RegExp]"}qn0.isRegExp=Kn0;function Gn0($){return typeof $==="object"&&$!==null}qn0.isObject=Gn0;function Hn0($){return gO($)==="[object Date]"}qn0.isDate=Hn0;function Wn0($){return gO($)==="[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=I0("buffer").Buffer.isBuffer;function gO($){return Object.prototype.toString.call($)}});var q60=E((pn1,Xg)=>{if(typeof Object.create==="function")Xg.exports=function(U,Y){if(Y)U.super_=Y,U.prototype=Object.create(Y.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}})};else Xg.exports=function(U,Y){if(Y){U.super_=Y;var z=function(){};z.prototype=Y.prototype,U.prototype=new z,U.prototype.constructor=U}}});var X1=E((dn1,Zg)=>{try{if(yO=I0("util"),typeof yO.inherits!=="function")throw"";Zg.exports=yO.inherits}catch($){Zg.exports=q60()}var yO});var L60=E((mn1,qg)=>{function Rn0($,U){if(!($ instanceof U))throw TypeError("Cannot call a class as a function")}var V60=K6().Buffer,iH=I0("util");function _n0($,U,Y){$.copy(U,Y)}qg.exports=function(){function $(){Rn0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(Y){var z={data:Y,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(Y){var z={data:Y,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length},$.prototype.shift=function(){if(this.length===0)return;var Y=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,Y},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(Y){if(this.length===0)return"";var z=this.head,Q=""+z.data;while(z=z.next)Q+=Y+z.data;return Q},$.prototype.concat=function(Y){if(this.length===0)return V60.alloc(0);var z=V60.allocUnsafe(Y>>>0),Q=this.head,J=0;while(Q)_n0(Q.data,z,J),J+=Q.data.length,Q=Q.next;return z},$}();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((ln1,F60)=>{var kO=I6();function vn0($,U){var Y=this,z=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(z||Q){if(U)U($);else if($){if(!this._writableState)kO.nextTick(xO,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,kO.nextTick(xO,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!U&&J){if(!Y._writableState)kO.nextTick(xO,Y,J);else if(!Y._writableState.errorEmitted)Y._writableState.errorEmitted=!0,kO.nextTick(xO,Y,J)}else if(U)U(J)}),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 xO($,U){$.emit("error",U)}F60.exports={destroy:vn0,undestroy:hn0}});var S7=E((on1,w60)=>{w60.exports=I0("util").deprecate});var Fg=E((rn1,T60)=>{var pU=I6();T60.exports=Z6;function M60($){var U=this;this.next=null,this.entry=null,this.finish=function(){sn0(U,$)}}var Sn0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pU.nextTick,sQ;Z6.WritableState=nH;var N60=Object.create(O4());N60.inherits=X1();var gn0={deprecate:S7()},D60=I0("stream"),uO=K6().Buffer,yn0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function kn0($){return uO.from($)}function xn0($){return uO.isBuffer($)||$ instanceof yn0}var A60=Vg();N60.inherits(Z6,D60);function fn0(){}function nH($,U){sQ=sQ||dU(),$=$||{};var Y=U instanceof sQ;if(this.objectMode=!!$.objectMode,Y)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:z,writableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(Y&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;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 I=$.decodeStrings===!1;this.decodeStrings=!I,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){dn0(U,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 M60(this)}nH.prototype.getBuffer=function(){var U=this.bufferedRequest,Y=[];while(U)Y.push(U),U=U.next;return Y};(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 fO;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")fO=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(fO.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof nH}});else fO=function($){return $ instanceof this};function Z6($){if(sQ=sQ||dU(),!fO.call(Z6,this)&&!(this instanceof sQ))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($,U){var Y=Error("write after end");$.emit("error",Y),pU.nextTick(U,Y)}function bn0($,U,Y,z){var Q=!0,J=!1;if(Y===null)J=TypeError("May not write null values to stream");else if(typeof Y!=="string"&&Y!==void 0&&!U.objectMode)J=TypeError("Invalid non-string/buffer chunk");if(J)$.emit("error",J),pU.nextTick(z,J),Q=!1;return Q}Z6.prototype.write=function($,U,Y){var z=this._writableState,Q=!1,J=!z.objectMode&&xn0($);if(J&&!uO.isBuffer($))$=kn0($);if(typeof U==="function")Y=U,U=null;if(J)U="buffer";else if(!U)U=z.defaultEncoding;if(typeof Y!=="function")Y=fn0;if(z.ended)un0(this,Y);else if(J||bn0(this,z,$,Y))z.pendingcb++,Q=cn0(this,z,J,$,U,Y);return Q};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(U){if(typeof U==="string")U=U.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((U+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+U);return this._writableState.defaultEncoding=U,this};function in0($,U,Y){if(!$.objectMode&&$.decodeStrings!==!1&&typeof U==="string")U=uO.from(U,Y);return U}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cn0($,U,Y,z,Q,J){if(!Y){var I=in0(U,z,Q);if(z!==I)Y=!0,Q="buffer",z=I}var K=U.objectMode?1:z.length;U.length+=K;var G=U.length{var j60=I6(),an0=Object.keys||function($){var U=[];for(var Y in $)U.push(Y);return U};R60.exports=Y3;var E60=Object.create(O4());E60.inherits=X1();var C60=Og(),wg=Fg();E60.inherits(Y3,C60);{bO=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 U;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(U)return;$=(""+$).toLowerCase(),U=!0}}function Up0($){var U=$p0($);if(typeof U!=="string"&&(Ng.isEncoding===_60||!_60($)))throw Error("Unknown encoding: "+$);return U||$}qp0.StringDecoder=mH;function mH($){this.encoding=Up0($);var U;switch(this.encoding){case"utf16le":this.text=Kp0,this.end=Gp0,U=4;break;case"utf8":this.fillLast=Qp0,U=4;break;case"base64":this.text=Hp0,this.end=Wp0,U=3;break;default:this.write=Xp0,this.end=Zp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ng.allocUnsafe(U)}mH.prototype.write=function($){if($.length===0)return"";var U,Y;if(this.lastNeed){if(U=this.fillLast($),U===void 0)return"";Y=this.lastNeed,this.lastNeed=0}else Y=0;if(Y<$.length)return U?U+this.text($,Y):this.text($,Y);return U||""};mH.prototype.end=Ip0;mH.prototype.text=Jp0;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 Mg($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function Yp0($,U,Y){var z=U.length-1;if(z=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--z=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--z=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function zp0($,U,Y){if((U[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&U.length>1){if((U[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&U.length>2){if((U[2]&192)!==128)return $.lastNeed=2,"�"}}}function Qp0($){var U=this.lastTotal-this.lastNeed,Y=zp0(this,$,U);if(Y!==void 0)return Y;if(this.lastNeed<=$.length)return $.copy(this.lastChar,U,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,U,0,$.length),this.lastNeed-=$.length}function Jp0($,U){var Y=Yp0(this,$,U);if(!this.lastNeed)return $.toString("utf8",U);this.lastTotal=Y;var z=$.length-(Y-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",U,z)}function Ip0($){var U=$&&$.length?this.write($):"";if(this.lastNeed)return U+"�";return U}function Kp0($,U){if(($.length-U)%2===0){var Y=$.toString("utf16le",U);if(Y){var z=Y.charCodeAt(Y.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],Y.slice(0,-1)}return Y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",U,$.length-1)}function Gp0($){var U=$&&$.length?this.write($):"";if(this.lastNeed){var Y=this.lastTotal-this.lastNeed;return U+this.lastChar.toString("utf16le",0,Y)}return U}function Hp0($,U){var Y=($.length-U)%3;if(Y===0)return $.toString("base64",U);if(this.lastNeed=3-Y,this.lastTotal=3,Y===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",U,$.length-Y)}function Wp0($){var U=$&&$.length?this.write($):"";if(this.lastNeed)return U+this.lastChar.toString("base64",0,3-this.lastNeed);return U}function Xp0($){return $.toString(this.encoding)}function Zp0($){return $&&$.length?this.write($):""}});var Og=E((en1,c60)=>{var tQ=I6();c60.exports=P4;var Lp0=oQ(),lH;P4.ReadableState=x60;var tn1=I0("events").EventEmitter,g60=function($,U){return $.listeners(U).length},jg=I0("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 Op0($){return oH.isBuffer($)||$ instanceof Fp0}var y60=Object.create(O4());y60.inherits=X1();var Ag=I0("util"),t1=void 0;if(Ag&&Ag.debuglog)t1=Ag.debuglog("stream");else t1=function(){};var Mp0=L60(),k60=Vg(),aQ;y60.inherits(P4,jg);var Pg=["error","close","destroy","pause","resume"];function Np0($,U,Y){if(typeof $.prependListener==="function")return $.prependListener(U,Y);if(!$._events||!$._events[U])$.on(U,Y);else if(Lp0($._events[U]))$._events[U].unshift(Y);else $._events[U]=[Y,$._events[U]]}function x60($,U){lH=lH||dU(),$=$||{};var Y=U instanceof lH;if(this.objectMode=!!$.objectMode,Y)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:z,readableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(Y&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Mp0,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(!aQ)aQ=Dg().StringDecoder;this.decoder=new aQ($.encoding),this.encoding=$.encoding}}function P4($){if(lH=lH||dU(),!(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($,U){this.push(null),U($)};P4.prototype.push=function($,U){var Y=this._readableState,z;if(!Y.objectMode){if(typeof $==="string"){if(U=U||Y.defaultEncoding,U!==Y.encoding)$=oH.from($,U),U="";z=!0}}else z=!0;return f60(this,$,U,!1,z)};P4.prototype.unshift=function($){return f60(this,$,null,!0,!1)};function f60($,U,Y,z,Q){var J=$._readableState;if(U===null)J.reading=!1,Bp0($,J);else{var I;if(!Q)I=Dp0(J,U);if(I)$.emit("error",I);else if(J.objectMode||U&&U.length>0){if(typeof U!=="string"&&!J.objectMode&&Object.getPrototypeOf(U)!==oH.prototype)U=wp0(U);if(z)if(J.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else Bg($,J,U,!0);else if(J.ended)$.emit("error",Error("stream.push() after EOF"));else if(J.reading=!1,J.decoder&&!Y)if(U=J.decoder.write(U),J.objectMode||U.length!==0)Bg($,J,U,!1);else u60($,J);else Bg($,J,U,!1)}else if(!z)J.reading=!1}return Ap0(J)}function Bg($,U,Y,z){if(U.flowing&&U.length===0&&!U.sync)$.emit("data",Y),$.read(0);else{if(U.length+=U.objectMode?1:Y.length,z)U.buffer.unshift(Y);else U.buffer.push(Y);if(U.needReadable)iO($)}u60($,U)}function Dp0($,U){var Y;if(!Op0(U)&&typeof U!=="string"&&U!==void 0&&!$.objectMode)Y=TypeError("Invalid non-string/buffer chunk");return Y}function Ap0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!aQ)aQ=Dg().StringDecoder;return this._readableState.decoder=new aQ($),this._readableState.encoding=$,this};var v60=8388608;function Pp0($){if($>=v60)$=v60;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function h60($,U){if($<=0||U.length===0&&U.ended)return 0;if(U.objectMode)return 1;if($!==$)if(U.flowing&&U.length)return U.buffer.head.data.length;else return U.length;if($>U.highWaterMark)U.highWaterMark=Pp0($);if($<=U.length)return $;if(!U.ended)return U.needReadable=!0,0;return U.length}P4.prototype.read=function($){t1("read",$),$=parseInt($,10);var U=this._readableState,Y=$;if($!==0)U.emittedReadable=!1;if($===0&&U.needReadable&&(U.length>=U.highWaterMark||U.ended)){if(t1("read: emitReadable",U.length,U.ended),U.length===0&&U.ended)Tg(this);else iO(this);return null}if($=h60($,U),$===0&&U.ended){if(U.length===0)Tg(this);return null}var z=U.needReadable;if(t1("need readable",z),U.length===0||U.length-$0)Q=b60($,U);else Q=null;if(Q===null)U.needReadable=!0,$=0;else U.length-=$;if(U.length===0){if(!U.ended)U.needReadable=!0;if(Y!==$&&U.ended)Tg(this)}if(Q!==null)this.emit("data",Q);return Q};function Bp0($,U){if(U.ended)return;if(U.decoder){var Y=U.decoder.end();if(Y&&Y.length)U.buffer.push(Y),U.length+=U.objectMode?1:Y.length}U.ended=!0,iO($)}function iO($){var U=$._readableState;if(U.needReadable=!1,!U.emittedReadable)if(t1("emitReadable",U.flowing),U.emittedReadable=!0,U.sync)tQ.nextTick(S60,$);else S60($)}function S60($){t1("emit readable"),$.emit("readable"),Eg($)}function u60($,U){if(!U.readingMore)U.readingMore=!0,tQ.nextTick(Tp0,$,U)}function Tp0($,U){var Y=U.length;while(!U.reading&&!U.flowing&&!U.ended&&U.length1&&i60(z.pipes,$)!==-1)&&!H)t1("false write response, pause",z.awaitDrain),z.awaitDrain++,X=!0;Y.pause()}}function q(w){if(t1("onerror",w),O(),$.removeListener("error",q),g60($,"error")===0)$.emit("error",w)}Np0($,"error",q);function V(){$.removeListener("finish",F),O()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),O()}$.once("finish",F);function O(){t1("unpipe"),Y.unpipe($)}if($.emit("pipe",Y),!z.flowing)t1("pipe resume"),Y.resume();return $};function jp0($){return function(){var U=$._readableState;if(t1("pipeOnDrain",U.awaitDrain),U.awaitDrain)U.awaitDrain--;if(U.awaitDrain===0&&g60($,"data"))U.flowing=!0,Eg($)}}P4.prototype.unpipe=function($){var U=this._readableState,Y={hasUnpiped:!1};if(U.pipesCount===0)return this;if(U.pipesCount===1){if($&&$!==U.pipes)return this;if(!$)$=U.pipes;if(U.pipes=null,U.pipesCount=0,U.flowing=!1,$)$.emit("unpipe",this,Y);return this}if(!$){var{pipes:z,pipesCount:Q}=U;U.pipes=null,U.pipesCount=0,U.flowing=!1;for(var J=0;J=U.length){if(U.decoder)Y=U.buffer.join("");else if(U.buffer.length===1)Y=U.buffer.head.data;else Y=U.buffer.concat(U.length);U.buffer.clear()}else Y=_p0($,U.buffer,U.decoder);return Y}function _p0($,U,Y){var z;if($J.length?J.length:$;if(I===J.length)Q+=J;else Q+=J.slice(0,$);if($-=I,$===0){if(I===J.length)if(++z,Y.next)U.head=Y.next;else U.head=U.tail=null;else U.head=Y,Y.data=J.slice(I);break}++z}return U.length-=z,Q}function hp0($,U){var Y=oH.allocUnsafe($),z=U.head,Q=1;z.data.copy(Y),$-=z.data.length;while(z=z.next){var J=z.data,I=$>J.length?J.length:$;if(J.copy(Y,Y.length-$,0,I),$-=I,$===0){if(I===J.length)if(++Q,z.next)U.head=z.next;else U.head=U.tail=null;else U.head=z,z.data=J.slice(I);break}++Q}return U.length-=Q,Y}function Tg($){var U=$._readableState;if(U.length>0)throw Error('"endReadable()" called on non-empty stream');if(!U.endEmitted)U.ended=!0,tQ.nextTick(Sp0,U,$)}function Sp0($,U){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,U.readable=!1,U.emit("end")}function i60($,U){for(var Y=0,z=$.length;Y{d60.exports=z3;var cO=dU(),p60=Object.create(O4());p60.inherits=X1();p60.inherits(z3,cO);function gp0($,U){var Y=this._transformState;Y.transforming=!1;var z=Y.writecb;if(!z)return this.emit("error",Error("write callback called multiple times"));if(Y.writechunk=null,Y.writecb=null,U!=null)this.push(U);z($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{o60.exports=rH;var m60=Cg(),l60=Object.create(O4());l60.inherits=X1();l60.inherits(rH,m60);function rH($){if(!(this instanceof rH))return new rH($);m60.call(this,$)}rH.prototype._transform=function($,U,Y){Y(null,$)}});var Rg=E((d6,nO)=>{var r5=I0("stream");if(process.env.READABLE_STREAM==="disable"&&r5)nO.exports=r5,d6=nO.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=nO.exports=Og(),d6.Stream=r5||d6,d6.Readable=d6,d6.Writable=Fg(),d6.Duplex=dU(),d6.Transform=Cg(),d6.PassThrough=r60()});var Q3=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{pO=new ArrayBuffer(0);try{xp0.blob=new Blob([pO],{type:"application/zip"}).size===0}catch($){try{vg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,dO=new vg,dO.append(pO),xp0.blob=dO.getBlob("application/zip").size===0}catch(U){xp0.blob=!1}}}var pO,vg,dO;try{xp0.nodestream=!!Rg().Readable}catch($){xp0.nodestream=!1}});var hg=E((mp0)=>{var pp0=c4(),dp0=Q3(),s5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";mp0.encode=function($){var U=[],Y,z,Q,J,I,K,G,H=0,W=$.length,X=W,Z=pp0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)Y=$.charCodeAt(H++),z=H>2,I=(Y&3)<<4|z>>4,K=X>1?(z&15)<<2|Q>>6:64,G=X>2?Q&63:64,U.push(s5.charAt(J)+s5.charAt(I)+s5.charAt(K)+s5.charAt(G))}return U.join("")};mp0.decode=function($){var U,Y,z,Q,J,I,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(Q=s5.indexOf($.charAt(G++)),J=s5.indexOf($.charAt(G++)),I=s5.indexOf($.charAt(G++)),K=s5.indexOf($.charAt(G++)),U=Q<<2|J>>4,Y=(J&15)<<4|I>>2,z=(I&3)<<6|K,Z[H++]=U,I!==64)Z[H++]=Y;if(K!==64)Z[H++]=z}return Z}});var sH=E((Qp1,s60)=>{s60.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,U){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,U);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,U)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var U=new Buffer($);return U.fill(0),U}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var e60=E((Ip1,t60)=>{var Jp1=global.MutationObserver||global.WebKitMutationObserver,a60;a60=function(){process.nextTick(ep0)};var rp0,sp0,ap0,tp0,Sg,aH=[];function ep0(){Sg=!0;var $,U,Y=aH.length;while(Y){U=aH,aH=[],$=-1;while(++${var $80=e60();function $J(){}var X8={},U80=["REJECTED"],gg=["FULFILLED"],Y80=["PENDING"];eQ=["UNHANDLED"];var eQ;J80.exports=g7;function g7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=Y80,this.queue=[],this.outcome=void 0,this.handled=eQ,$!==$J)z80(this,$)}g7.prototype.finally=function($){if(typeof $!=="function")return this;var U=this.constructor;return this.then(Y,z);function Y(Q){function J(){return Q}return U.resolve($()).then(J)}function z(Q){function J(){throw Q}return U.resolve($()).then(J)}};g7.prototype.catch=function($){return this.then(null,$)};g7.prototype.then=function($,U){if(typeof $!=="function"&&this.state===gg||typeof U!=="function"&&this.state===U80)return this;var Y=new this.constructor($J);if(this.handled===eQ)this.handled=null;if(this.state!==Y80){var z=this.state===gg?$:U;yg(Y,z,this.outcome)}else this.queue.push(new tH(Y,$,U));return Y};function tH($,U,Y){if(this.promise=$,typeof U==="function")this.onFulfilled=U,this.callFulfilled=this.otherCallFulfilled;if(typeof Y==="function")this.onRejected=Y,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($,U,Y){$80(function(){var z;try{z=U(Y)}catch(Q){return X8.reject($,Q)}if(z===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,z)})}X8.resolve=function($,U){var Y=Q80(Ud0,U);if(Y.status==="error")return X8.reject($,Y.value);var z=Y.value;if(z)z80($,z);else{$.state=gg,$.outcome=U;var Q=-1,J=$.queue.length;while(++Q{var kg=null;if(typeof Promise<"u")kg=Promise;else kg=I80();K80.exports={Promise:kg}});var xg=E((G80)=>{(function($,U){if($.setImmediate)return;var Y=1,z={},Q=!1,J=$.document,I;function K(M){if(typeof M!=="function")M=Function(""+M);var N=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?G80:global:self)});var c4=E((Gd0)=>{var y7=Q3(),Id0=hg(),YJ=sH(),fg=UJ();xg();function Kd0($){var U=null;if(y7.uint8array)U=new Uint8Array($.length);else U=Array($.length);return lO($,U)}Gd0.newBlob=function($,U){Gd0.checkSupport("blob");try{return new Blob([$],{type:U})}catch(Q){try{var Y=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,z=new Y;return z.append($),z.getBlob(U)}catch(J){throw Error("Bug : can't construct the Blob.")}}};function eH($){return $}function lO($,U){for(var Y=0;Y<$.length;++Y)U[Y]=$.charCodeAt(Y)&255;return U}var mO={stringifyByChunk:function($,U,Y){var z=[],Q=0,J=$.length;if(J<=Y)return String.fromCharCode.apply(null,$);while(Q1)try{return mO.stringifyByChunk($,Y,U)}catch(Q){U=Math.floor(U/2)}return mO.stringifyByChar($)}Gd0.applyFromCharCode=$W;function oO($,U){for(var Y=0;Y<$.length;Y++)U[Y]=$[Y];return U}var k7={};k7.string={string:eH,array:function($){return lO($,Array($.length))},arraybuffer:function($){return k7.string.uint8array($).buffer},uint8array:function($){return lO($,new Uint8Array($.length))},nodebuffer:function($){return lO($,YJ.allocBuffer($.length))}};k7.array={string:$W,array:eH,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return YJ.newBufferFrom($)}};k7.arraybuffer={string:function($){return $W(new Uint8Array($))},array:function($){return oO(new Uint8Array($),Array($.byteLength))},arraybuffer:eH,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return YJ.newBufferFrom(new Uint8Array($))}};k7.uint8array={string:$W,array:function($){return oO($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:eH,nodebuffer:function($){return YJ.newBufferFrom($)}};k7.nodebuffer={string:$W,array:function($){return oO($,Array($.length))},arraybuffer:function($){return k7.nodebuffer.uint8array($).buffer},uint8array:function($){return oO($,new Uint8Array($.length))},nodebuffer:eH};Gd0.transformTo=function($,U){if(!U)U="";if(!$)return U;Gd0.checkSupport($);var Y=Gd0.getTypeOf(U),z=k7[Y][$](U);return z};Gd0.resolve=function($){var U=$.split("/"),Y=[];for(var z=0;z"u")$[Y]=arguments[U][Y];return $};Gd0.prepareContent=function($,U,Y,z,Q){var J=fg.Promise.resolve(U).then(function(I){var K=y7.blob&&(I instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(I))!==-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(I)});else return I});return J.then(function(I){var K=Gd0.getTypeOf(I);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")I=Gd0.transformTo("uint8array",I);else if(K==="string"){if(Q)I=Id0.decode(I);else if(Y){if(z!==!0)I=Kd0(I)}}return I})}});var I$=E((Xp1,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($,U){return this._listeners[$].push(U),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,U){if(this._listeners[$])for(var Y=0;Y "+$;else return $}};Z80.exports=X80});var QJ=E((Pd0)=>{var zJ=c4(),mU=Q3(),Md0=sH(),rO=I$(),UW=Array(256);for(a5=0;a5<256;a5++)UW[a5]=a5>=252?6:a5>=248?5:a5>=240?4:a5>=224?3:a5>=192?2:1;var a5;UW[254]=UW[254]=1;var Nd0=function($){var U,Y,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,U[J++]=128|Y&63;else if(Y<65536)U[J++]=224|Y>>>12,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63;else U[J++]=240|Y>>>18,U[J++]=128|Y>>>12&63,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63}return U},Dd0=function($,U){var Y;if(U=U||$.length,U>$.length)U=$.length;Y=U-1;while(Y>=0&&($[Y]&192)===128)Y--;if(Y<0)return U;if(Y===0)return U;return Y+UW[$[Y]]>U?Y:U},Ad0=function($){var U,Y,z,Q,J=$.length,I=Array(J*2);for(Y=0,U=0;U4){I[Y++]=65533,U+=Q-1;continue}z&=Q===2?31:Q===3?15:7;while(Q>1&&U1){I[Y++]=65533;continue}if(z<65536)I[Y++]=z;else z-=65536,I[Y++]=55296|z>>10&1023,I[Y++]=56320|z&1023}if(I.length!==Y)if(I.subarray)I=I.subarray(0,Y);else I.length=Y;return zJ.applyFromCharCode(I)};Pd0.utf8encode=function(U){if(mU.nodebuffer)return Md0.newBufferFrom(U,"utf-8");return Nd0(U)};Pd0.utf8decode=function(U){if(mU.nodebuffer)return zJ.transformTo("nodebuffer",U).toString("utf-8");return U=zJ.transformTo(mU.uint8array?"uint8array":"array",U),Ad0(U)};function sO(){rO.call(this,"utf-8 decode"),this.leftOver=null}zJ.inherits(sO,rO);sO.prototype.processChunk=function($){var U=zJ.transformTo(mU.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(mU.uint8array){var Y=U;U=new Uint8Array(Y.length+this.leftOver.length),U.set(this.leftOver,0),U.set(Y,this.leftOver.length)}else U=this.leftOver.concat(U);this.leftOver=null}var z=Dd0(U),Q=U;if(z!==U.length)if(mU.uint8array)Q=U.subarray(0,z),this.leftOver=U.subarray(z,U.length);else Q=U.slice(0,z),this.leftOver=U.slice(z,U.length);this.push({data:Pd0.utf8decode(Q),meta:$.meta})};sO.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Pd0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Pd0.Utf8DecodeWorker=sO;function bg(){rO.call(this,"utf-8 encode")}zJ.inherits(bg,rO);bg.prototype.processChunk=function($){this.push({data:Pd0.utf8encode($.data),meta:$.meta})};Pd0.Utf8EncodeWorker=bg});var w80=E((qp1,F80)=>{var V80=I$(),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((Vp1,M80)=>{var O80=Rg().Readable,jd0=c4();jd0.inherits(ng,O80);function ng($,U,Y){O80.call(this,U),this._helper=$;var z=this;$.on("data",function(Q,J){if(!z.push(Q))z._helper.pause();if(Y)Y(J)}).on("error",function(Q){z.emit("error",Q)}).on("end",function(){z.push(null)})}ng.prototype._read=function(){this._helper.resume()};M80.exports=ng});var pg=E((Lp1,P80)=>{var lU=c4(),Ed0=w80(),Cd0=I$(),Rd0=hg(),_d0=Q3(),vd0=UJ(),D80=null;if(_d0.nodestream)try{D80=N80()}catch($){}function hd0($,U,Y){switch($){case"blob":return lU.newBlob(lU.transformTo("arraybuffer",U),Y);case"base64":return Rd0.encode(U);default:return lU.transformTo($,U)}}function Sd0($,U){var Y,z=0,Q=null,J=0;for(Y=0;Y{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((wp1,B80)=>{var aO=c4(),tO=I$(),md0=16384;function JJ($){tO.call(this,"DataWorker");var U=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(Y){if(U.dataIsReady=!0,U.data=Y,U.max=Y&&Y.length||0,U.type=aO.getTypeOf(Y),!U.isPaused)U._tickAndRepeat()},function(Y){U.error(Y)})}aO.inherits(JJ,tO);JJ.prototype.cleanUp=function(){tO.prototype.cleanUp.call(this),this.data=null};JJ.prototype.resume=function(){if(!tO.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,aO.delay(this._tickAndRepeat,[],this);return!0};JJ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)aO.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};JJ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=md0,U=null,Y=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":U=this.data.substring(this.index,Y);break;case"uint8array":U=this.data.subarray(this.index,Y);break;case"array":case"nodebuffer":U=this.data.slice(this.index,Y);break}return this.index=Y,this.push({data:U,meta:{percent:this.max?this.index/this.max*100:0}})}};B80.exports=JJ});var eO=E((Op1,j80)=>{var ld0=c4();function od0(){var $,U=[];for(var Y=0;Y<256;Y++){$=Y;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;U[Y]=$}return U}var T80=od0();function rd0($,U,Y,z){var Q=T80,J=z+Y;$=$^-1;for(var I=z;I>>8^Q[($^U[I])&255];return $^-1}function sd0($,U,Y,z){var Q=T80,J=z+Y;$=$^-1;for(var I=z;I>>8^Q[($^U.charCodeAt(I))&255];return $^-1}j80.exports=function(U,Y){if(typeof U>"u"||!U.length)return 0;var z=ld0.getTypeOf(U)!=="string";if(z)return rd0(Y|0,U,U.length,0);else return sd0(Y|0,U,U.length,0)}});var og=E((Mp1,C80)=>{var E80=I$(),ad0=eO(),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((Np1,R80)=>{var ed0=c4(),rg=I$();function sg($){rg.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}ed0.inherits(sg,rg);sg.prototype.processChunk=function($){if($){var U=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=U+$.data.length}rg.prototype.processChunk.call(this,$)};R80.exports=sg});var $M=E((Dp1,S80)=>{var v80=UJ(),h80=mg(),$m0=og(),ag=_80();function tg($,U,Y,z,Q){this.compressedSize=$,this.uncompressedSize=U,this.crc32=Y,this.compression=z,this.compressedContent=Q}tg.prototype={getContentWorker:function(){var $=new h80(v80.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new ag("data_length")),U=this;return $.on("end",function(){if(this.streamInfo.data_length!==U.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($,U,Y){return $.pipe(new $m0).pipe(new ag("uncompressedSize")).pipe(U.compressWorker(Y)).pipe(new ag("compressedSize")).withStreamInfo("compression",U)};S80.exports=tg});var x80=E((Ap1,k80)=>{var Um0=pg(),Ym0=mg(),eg=QJ(),$y=$M(),g80=I$(),Uy=function($,U,Y){this.name=$,this.dir=Y.dir,this.date=Y.date,this.comment=Y.comment,this.unixPermissions=Y.unixPermissions,this.dosPermissions=Y.dosPermissions,this._data=U,this._dataBinary=Y.binary,this.options={compression:Y.compression,compressionOptions:Y.compressionOptions}};Uy.prototype={internalStream:function($){var U=null,Y="string";try{if(!$)throw Error("No output type specified.");Y=$.toLowerCase();var z=Y==="string"||Y==="text";if(Y==="binarystring"||Y==="text")Y="string";U=this._decompressWorker();var Q=!this._dataBinary;if(Q&&!z)U=U.pipe(new eg.Utf8EncodeWorker);if(!Q&&z)U=U.pipe(new eg.Utf8DecodeWorker)}catch(J){U=new g80("error"),U.error(J)}return new Um0(U,Y,"")},async:function($,U){return this.internalStream($).accumulate(U)},nodeStream:function($,U){return this.internalStream($||"nodebuffer").toNodejsStream(U)},_compressWorker:function($,U){if(this._data instanceof $y&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var Y=this._decompressWorker();if(!this._dataBinary)Y=Y.pipe(new eg.Utf8EncodeWorker);return $y.createWorkerFrom(Y,$,U)}},_decompressWorker:function(){if(this._data instanceof $y)return this._data.getContentWorker();else if(this._data instanceof g80)return this._data;else return new Ym0(this._data)}};var y80=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],zm0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(YW=0;YW{var Km0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Gm0($,U){return Object.prototype.hasOwnProperty.call($,U)}Yy.assign=function($){var U=Array.prototype.slice.call(arguments,1);while(U.length){var Y=U.shift();if(!Y)continue;if(typeof Y!=="object")throw TypeError(Y+"must be non-object");for(var z in Y)if(Gm0(Y,z))$[z]=Y[z]}return $};Yy.shrinkBuf=function($,U){if($.length===U)return $;if($.subarray)return $.subarray(0,U);return $.length=U,$};var Hm0={arraySet:function($,U,Y,z,Q){if(U.subarray&&$.subarray){$.set(U.subarray(Y,Y+z),Q);return}for(var J=0;J{var Zm0=J3(),qm0=4,u80=0,b80=1,Vm0=2;function KJ($){var U=$.length;while(--U>=0)$[U]=0}var Lm0=0,m80=1,Fm0=2,wm0=3,Om0=258,Wy=29,GW=256,QW=GW+1+Wy,IJ=30,Xy=19,l80=2*QW+1,oU=15,Qy=16,Mm0=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],UM=[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,I3=Array((QW+2)*2);KJ(I3);var zW=Array(IJ*2);KJ(zW);var JW=Array(Dm0);KJ(JW);var IW=Array(Om0-wm0+1);KJ(IW);var qy=Array(Wy);KJ(qy);var YM=Array(IJ);KJ(YM);function Jy($,U,Y,z,Q){this.static_tree=$,this.extra_bits=U,this.extra_base=Y,this.elems=z,this.max_length=Q,this.has_stree=$&&$.length}var t80,e80,$$0;function Iy($,U){this.dyn_tree=$,this.max_code=0,this.stat_desc=U}function U$0($){return $<256?JW[$]:JW[256+($>>>7)]}function KW($,U){$.pending_buf[$.pending++]=U&255,$.pending_buf[$.pending++]=U>>>8&255}function n8($,U,Y){if($.bi_valid>Qy-Y)$.bi_buf|=U<<$.bi_valid&65535,KW($,$.bi_buf),$.bi_buf=U>>Qy-$.bi_valid,$.bi_valid+=Y-Qy;else $.bi_buf|=U<<$.bi_valid&65535,$.bi_valid+=Y}function t5($,U,Y){n8($,Y[U*2],Y[U*2+1])}function Y$0($,U){var Y=0;do Y|=$&1,$>>>=1,Y<<=1;while(--U>0);return Y>>>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($,U){var{dyn_tree:Y,max_code:z}=U,Q=U.stat_desc.static_tree,J=U.stat_desc.has_stree,I=U.stat_desc.extra_bits,K=U.stat_desc.extra_base,G=U.stat_desc.max_length,H,W,X,Z,q,V,F=0;for(Z=0;Z<=oU;Z++)$.bl_count[Z]=0;Y[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(Y[W*2+1]=Z,W>z)continue;if($.bl_count[Z]++,q=0,W>=K)q=I[W-K];if(V=Y[W*2],$.opt_len+=V*(Z+q),J)$.static_len+=V*(Q[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>z)continue;if(Y[X*2+1]!==Z)$.opt_len+=(Z-Y[X*2+1])*Y[X*2],Y[X*2+1]=Z;W--}}}function z$0($,U,Y){var z=Array(oU+1),Q=0,J,I;for(J=1;J<=oU;J++)z[J]=Q=Q+Y[J-1]<<1;for(I=0;I<=U;I++){var K=$[I*2+1];if(K===0)continue;$[I*2]=Y$0(z[K]++,K)}}function Bm0(){var $,U,Y,z,Q,J=Array(oU+1);Y=0;for(z=0;z>=7;for(;z8)KW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function Tm0($,U,Y,z){if(J$0($),z)KW($,Y),KW($,~Y);Zm0.arraySet($.pending_buf,$.window,U,Y,$.pending),$.pending+=Y}function i80($,U,Y,z){var Q=U*2,J=Y*2;return $[Q]<$[J]||$[Q]===$[J]&&z[U]<=z[Y]}function Ky($,U,Y){var z=$.heap[Y],Q=Y<<1;while(Q<=$.heap_len){if(Q<$.heap_len&&i80(U,$.heap[Q+1],$.heap[Q],$.depth))Q++;if(i80(U,z,$.heap[Q],$.depth))break;$.heap[Y]=$.heap[Q],Y=Q,Q<<=1}$.heap[Y]=z}function c80($,U,Y){var z,Q,J=0,I,K;if($.last_lit!==0)do if(z=$.pending_buf[$.d_buf+J*2]<<8|$.pending_buf[$.d_buf+J*2+1],Q=$.pending_buf[$.l_buf+J],J++,z===0)t5($,Q,U);else{if(I=IW[Q],t5($,I+GW+1,U),K=Gy[I],K!==0)Q-=qy[I],n8($,Q,K);if(z--,I=U$0(z),t5($,I,Y),K=UM[I],K!==0)z-=YM[I],n8($,z,K)}while(J<$.last_lit);t5($,Zy,U)}function Hy($,U){var Y=U.dyn_tree,z=U.stat_desc.static_tree,Q=U.stat_desc.has_stree,J=U.stat_desc.elems,I,K,G=-1,H;$.heap_len=0,$.heap_max=l80;for(I=0;I>1;I>=1;I--)Ky($,Y,I);H=J;do I=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Ky($,Y,1),K=$.heap[1],$.heap[--$.heap_max]=I,$.heap[--$.heap_max]=K,Y[H*2]=Y[I*2]+Y[K*2],$.depth[H]=($.depth[I]>=$.depth[K]?$.depth[I]:$.depth[K])+1,Y[I*2+1]=Y[K*2+1]=H,$.heap[1]=H++,Ky($,Y,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Pm0($,U),z$0(Y,G,$.bl_count)}function n80($,U,Y){var z,Q=-1,J,I=U[1],K=0,G=7,H=4;if(I===0)G=138,H=3;U[(Y+1)*2+1]=65535;for(z=0;z<=Y;z++){if(J=I,I=U[(z+1)*2+1],++K=3;U--)if($.bl_tree[a80[U]*2+1]!==0)break;return $.opt_len+=3*(U+1)+5+5+4,U}function Em0($,U,Y,z){var Q;n8($,U-257,5),n8($,Y-1,5),n8($,z-4,4);for(Q=0;Q>>=1)if(U&1&&$.dyn_ltree[Y*2]!==0)return u80;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return b80;for(Y=32;Y0){if($.strm.data_type===Vm0)$.strm.data_type=Cm0($);if(Hy($,$.l_desc),Hy($,$.d_desc),I=jm0($),Q=$.opt_len+3+7>>>3,J=$.static_len+3+7>>>3,J<=Q)Q=J}else Q=J=Y+5;if(Y+4<=Q&&U!==-1)I$0($,U,Y,z);else if($.strategy===qm0||J===Q)n8($,(m80<<1)+(z?1:0),3),c80($,I3,zW);else n8($,(Fm0<<1)+(z?1:0),3),Em0($,$.l_desc.max_code+1,$.d_desc.max_code+1,I+1),c80($,$.dyn_ltree,$.dyn_dtree);if(Q$0($),z)J$0($)}function hm0($,U,Y){if($.pending_buf[$.d_buf+$.last_lit*2]=U>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=U&255,$.pending_buf[$.l_buf+$.last_lit]=Y&255,$.last_lit++,U===0)$.dyn_ltree[Y*2]++;else $.matches++,U--,$.dyn_ltree[(IW[Y]+GW+1)*2]++,$.dyn_dtree[U$0(U)*2]++;return $.last_lit===$.lit_bufsize-1}Sm0._tr_init=Rm0;Sm0._tr_stored_block=I$0;Sm0._tr_flush_block=vm0;Sm0._tr_tally=hm0;Sm0._tr_align=_m0});var Vy=E((Tp1,G$0)=>{function um0($,U,Y,z){var Q=$&65535|0,J=$>>>16&65535|0,I=0;while(Y!==0){I=Y>2000?2000:Y,Y-=I;do Q=Q+U[z++]|0,J=J+Q|0;while(--I);Q%=65521,J%=65521}return Q|J<<16|0}G$0.exports=um0});var Ly=E((jp1,H$0)=>{function bm0(){var $,U=[];for(var Y=0;Y<256;Y++){$=Y;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;U[Y]=$}return U}var im0=bm0();function cm0($,U,Y,z){var Q=im0,J=z+Y;$^=-1;for(var I=z;I>>8^Q[($^U[I])&255];return $^-1}H$0.exports=cm0});var zM=E((Ep1,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 M$0=E((Dl0)=>{var j8=J3(),j$=K$0(),V$0=Vy(),x7=Ly(),nm0=zM(),tU=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,QM=2,rm0=3,sm0=4,am0=0,tm0=2,GM=8,em0=9,$l0=15,Ul0=8,Yl0=29,zl0=256,Oy=zl0+1+Yl0,Ql0=30,Jl0=19,Il0=2*Oy+1,Kl0=15,f1=3,b7=258,W5=b7+f1+1,Gl0=32,HM=42,My=69,JM=73,IM=91,KM=103,rU=113,WW=666,P6=1,XW=2,sU=3,WJ=4,Hl0=3;function i7($,U){return $.msg=nm0[U],U}function q$0($){return($<<1)-($>4?9:0)}function u7($){var U=$.length;while(--U>=0)$[U]=0}function f7($){var U=$.state,Y=U.pending;if(Y>$.avail_out)Y=$.avail_out;if(Y===0)return;if(j8.arraySet($.output,U.pending_buf,U.pending_out,Y,$.next_out),$.next_out+=Y,U.pending_out+=Y,$.total_out+=Y,$.avail_out-=Y,U.pending-=Y,U.pending===0)U.pending_out=0}function m6($,U){j$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,U),$.block_start=$.strstart,f7($.strm)}function r1($,U){$.pending_buf[$.pending++]=U}function HW($,U){$.pending_buf[$.pending++]=U>>>8&255,$.pending_buf[$.pending++]=U&255}function Wl0($,U,Y,z){var Q=$.avail_in;if(Q>z)Q=z;if(Q===0)return 0;if($.avail_in-=Q,j8.arraySet(U,$.input,$.next_in,Q,Y),$.state.wrap===1)$.adler=V$0($.adler,U,Q,Y);else if($.state.wrap===2)$.adler=x7($.adler,U,Q,Y);return $.next_in+=Q,$.total_in+=Q,Q}function L$0($,U){var{max_chain_length:Y,strstart:z}=$,Q,J,I=$.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[z+I-1],V=H[z+I];if($.prev_length>=$.good_match)Y>>=2;if(K>$.lookahead)K=$.lookahead;do{if(Q=U,H[Q+I]!==V||H[Q+I-1]!==q||H[Q]!==H[z]||H[++Q]!==H[z+1])continue;z+=2,Q++;do;while(H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&zI){if($.match_start=U,I=J,J>=K)break;q=H[z+I-1],V=H[z+I]}}while((U=X[U&W])>G&&--Y!==0);if(I<=$.lookahead)return I;return $.lookahead}function aU($){var U=$.w_size,Y,z,Q,J,I;do{if(J=$.window_size-$.lookahead-$.strstart,$.strstart>=U+(U-W5)){j8.arraySet($.window,$.window,U,U,0),$.match_start-=U,$.strstart-=U,$.block_start-=U,z=$.hash_size,Y=z;do Q=$.head[--Y],$.head[Y]=Q>=U?Q-U:0;while(--z);z=U,Y=z;do Q=$.prev[--Y],$.prev[Y]=Q>=U?Q-U:0;while(--z);J+=U}if($.strm.avail_in===0)break;if(z=Wl0($.strm,$.window,$.strstart+$.lookahead,J),$.lookahead+=z,$.lookahead+$.insert>=f1){I=$.strstart-$.insert,$.ins_h=$.window[I],$.ins_h=($.ins_h<<$.hash_shift^$.window[I+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[I+f1-1])&$.hash_mask,$.prev[I&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=I,I++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)Y=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(aU($),$.lookahead===0&&U===tU)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var z=$.block_start+Y;if($.strstart===0||$.strstart>=z){if($.lookahead=$.strstart-z,$.strstart=z,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,U===c7){if(m6($,!0),$.strm.avail_out===0)return sU;return WJ}if($.strstart>$.block_start){if(m6($,!1),$.strm.avail_out===0)return P6}return P6}function wy($,U){var Y,z;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(Y!==0&&$.strstart-Y<=$.w_size-W5)$.match_length=L$0($,Y);if($.match_length>=f1)if(z=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,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){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,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,Y!==0&&$.prev_length<$.max_lazy_match&&$.strstart-Y<=$.w_size-W5){if($.match_length=L$0($,Y),$.match_length<=5&&($.strategy===om0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){Q=$.strstart+$.lookahead-f1,z=j$._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f1),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=Q)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,Y=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,z){if(m6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(z=j$._tr_tally($,0,$.window[$.strstart-1]),z)m6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)z=j$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(Q=$.strstart-1,z=I[Q],z===I[++Q]&&z===I[++Q]&&z===I[++Q]){J=$.strstart+b7;do;while(z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&Q$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)Y=j$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else Y=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(Y){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,U===c7){if(m6($,!0),$.strm.avail_out===0)return sU;return WJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function ql0($,U){var Y;for(;;){if($.lookahead===0){if(aU($),$.lookahead===0){if(U===tU)return P6;break}}if($.match_length=0,Y=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,Y){if(m6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,U===c7){if(m6($,!0),$.strm.avail_out===0)return sU;return WJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return P6}return XW}function e5($,U,Y,z,Q){this.good_length=$,this.max_lazy=U,this.nice_length=Y,this.max_chain=z,this.func=Q}var HJ;HJ=[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,GJ),new e5(8,16,32,32,GJ),new e5(8,16,128,128,GJ),new e5(8,32,128,256,GJ),new e5(32,128,258,1024,GJ),new e5(32,258,258,4096,GJ)];function Vl0($){$.window_size=2*$.w_size,u7($.head),$.max_lazy_match=HJ[$.level].max_lazy,$.good_match=HJ[$.level].good_length,$.nice_match=HJ[$.level].nice_length,$.max_chain_length=HJ[$.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=GM,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(Il0*2),this.dyn_dtree=new j8.Buf16((2*Ql0+1)*2),this.bl_tree=new j8.Buf16((2*Jl0+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*Oy+1),u7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new j8.Buf16(2*Oy+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 U;if(!$||!$.state)return i7($,E$);if($.total_in=$.total_out=0,$.data_type=tm0,U=$.state,U.pending=0,U.pending_out=0,U.wrap<0)U.wrap=-U.wrap;return U.status=U.wrap?HM:rU,$.adler=U.wrap===2?0:1,U.last_flush=tU,j$._tr_init(U),$9}function w$0($){var U=F$0($);if(U===$9)Vl0($.state);return U}function Fl0($,U){if(!$||!$.state)return E$;if($.state.wrap!==2)return E$;return $.state.gzhead=U,$9}function O$0($,U,Y,z,Q,J){if(!$)return E$;var I=1;if(U===lm0)U=6;if(z<0)I=0,z=-z;else if(z>15)I=2,z-=16;if(Q<1||Q>em0||Y!==GM||z<8||z>15||U<0||U>9||J<0||J>sm0)return i7($,E$);if(z===8)z=9;var K=new Ll0;return $.state=K,K.strm=$,K.wrap=I,K.gzhead=null,K.w_bits=z,K.w_size=1<X$0||U<0)return $?i7($,E$):E$;if(z=$.state,!$.output||!$.input&&$.avail_in!==0||z.status===WW&&U!==c7)return i7($,$.avail_out===0?Fy:E$);if(z.strm=$,Y=z.last_flush,z.last_flush=U,z.status===HM)if(z.wrap===2)if($.adler=0,r1(z,31),r1(z,139),r1(z,8),!z.gzhead)r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,z.level===9?2:z.strategy>=QM||z.level<2?4:0),r1(z,Hl0),z.status=rU;else{if(r1(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(!z.gzhead.extra?0:4)+(!z.gzhead.name?0:8)+(!z.gzhead.comment?0:16)),r1(z,z.gzhead.time&255),r1(z,z.gzhead.time>>8&255),r1(z,z.gzhead.time>>16&255),r1(z,z.gzhead.time>>24&255),r1(z,z.level===9?2:z.strategy>=QM||z.level<2?4:0),r1(z,z.gzhead.os&255),z.gzhead.extra&&z.gzhead.extra.length)r1(z,z.gzhead.extra.length&255),r1(z,z.gzhead.extra.length>>8&255);if(z.gzhead.hcrc)$.adler=x7($.adler,z.pending_buf,z.pending,0);z.gzindex=0,z.status=My}else{var I=GM+(z.w_bits-8<<4)<<8,K=-1;if(z.strategy>=QM||z.level<2)K=0;else if(z.level<6)K=1;else if(z.level===6)K=2;else K=3;if(I|=K<<6,z.strstart!==0)I|=Gl0;if(I+=31-I%31,z.status=rU,HW(z,I),z.strstart!==0)HW(z,$.adler>>>16),HW(z,$.adler&65535);$.adler=1}if(z.status===My)if(z.gzhead.extra){Q=z.pending;while(z.gzindex<(z.gzhead.extra.length&65535)){if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(f7($),Q=z.pending,z.pending===z.pending_buf_size)break}r1(z,z.gzhead.extra[z.gzindex]&255),z.gzindex++}if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(z.gzindex===z.gzhead.extra.length)z.gzindex=0,z.status=JM}else z.status=JM;if(z.status===JM)if(z.gzhead.name){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(f7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.gzindex=0,z.status=IM}else z.status=IM;if(z.status===IM)if(z.gzhead.comment){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(f7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=x7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.status=KM}else z.status=KM;if(z.status===KM)if(z.gzhead.hcrc){if(z.pending+2>z.pending_buf_size)f7($);if(z.pending+2<=z.pending_buf_size)r1(z,$.adler&255),r1(z,$.adler>>8&255),$.adler=0,z.status=rU}else z.status=rU;if(z.pending!==0){if(f7($),$.avail_out===0)return z.last_flush=-1,$9}else if($.avail_in===0&&q$0(U)<=q$0(Y)&&U!==c7)return i7($,Fy);if(z.status===WW&&$.avail_in!==0)return i7($,Fy);if($.avail_in!==0||z.lookahead!==0||U!==tU&&z.status!==WW){var G=z.strategy===QM?ql0(z,U):z.strategy===rm0?Zl0(z,U):HJ[z.level].func(z,U);if(G===sU||G===WJ)z.status=WW;if(G===P6||G===sU){if($.avail_out===0)z.last_flush=-1;return $9}if(G===XW){if(U===pm0)j$._tr_align(z);else if(U!==X$0){if(j$._tr_stored_block(z,0,0,!1),U===dm0){if(u7(z.head),z.lookahead===0)z.strstart=0,z.block_start=0,z.insert=0}}if(f7($),$.avail_out===0)return z.last_flush=-1,$9}}if(U!==c7)return $9;if(z.wrap<=0)return Z$0;if(z.wrap===2)r1(z,$.adler&255),r1(z,$.adler>>8&255),r1(z,$.adler>>16&255),r1(z,$.adler>>24&255),r1(z,$.total_in&255),r1(z,$.total_in>>8&255),r1(z,$.total_in>>16&255),r1(z,$.total_in>>24&255);else HW(z,$.adler>>>16),HW(z,$.adler&65535);if(f7($),z.wrap>0)z.wrap=-z.wrap;return z.pending!==0?$9:Z$0}function Ml0($){var U;if(!$||!$.state)return E$;if(U=$.state.status,U!==HM&&U!==My&&U!==JM&&U!==IM&&U!==KM&&U!==rU&&U!==WW)return i7($,E$);return $.state=null,U===rU?i7($,mm0):$9}function Nl0($,U){var Y=U.length,z,Q,J,I,K,G,H,W;if(!$||!$.state)return E$;if(z=$.state,I=z.wrap,I===2||I===1&&z.status!==HM||z.lookahead)return E$;if(I===1)$.adler=V$0($.adler,U,Y,0);if(z.wrap=0,Y>=z.w_size){if(I===0)u7(z.head),z.strstart=0,z.block_start=0,z.insert=0;W=new j8.Buf8(z.w_size),j8.arraySet(W,U,Y-z.w_size,z.w_size,0),U=W,Y=z.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=Y,$.next_in=0,$.input=U,aU(z);while(z.lookahead>=f1){Q=z.strstart,J=z.lookahead-(f1-1);do z.ins_h=(z.ins_h<{var WM=J3(),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 WM.Buf8(256);for(U9=0;U9<256;U9++)ZW[U9]=U9>=252?6:U9>=248?5:U9>=240?4:U9>=224?3:U9>=192?2:1;var U9;ZW[254]=ZW[254]=1;vl0.string2buf=function($){var U,Y,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,U[J++]=128|Y&63;else if(Y<65536)U[J++]=224|Y>>>12,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63;else U[J++]=240|Y>>>18,U[J++]=128|Y>>>12&63,U[J++]=128|Y>>>6&63,U[J++]=128|Y&63}return U};function A$0($,U){if(U<65534){if($.subarray&&D$0||!$.subarray&&N$0)return String.fromCharCode.apply(null,WM.shrinkBuf($,U))}var Y="";for(var z=0;z4){K[z++]=65533,Y+=J-1;continue}Q&=J===2?31:J===3?15:7;while(J>1&&Y1){K[z++]=65533;continue}if(Q<65536)K[z++]=Q;else Q-=65536,K[z++]=55296|Q>>10&1023,K[z++]=56320|Q&1023}return A$0(K,z)};vl0.utf8border=function($,U){var Y;if(U=U||$.length,U>$.length)U=$.length;Y=U-1;while(Y>=0&&($[Y]&192)===128)Y--;if(Y<0)return U;if(Y===0)return U;return Y+ZW[$[Y]]>U?Y:U}});var Dy=E((_p1,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=M$0(),VW=J3(),Py=Ny(),By=zM(),fl0=Dy(),j$0=Object.prototype.toString,ul0=0,Ay=4,XJ=0,B$0=1,T$0=2,bl0=-1,il0=0,cl0=8;function eU($){if(!(this instanceof eU))return new eU($);this.options=VW.assign({level:bl0,method:cl0,chunkSize:16384,windowBits:15,memLevel:8,strategy:il0,to:""},$||{});var U=this.options;if(U.raw&&U.windowBits>0)U.windowBits=-U.windowBits;else if(U.gzip&&U.windowBits>0&&U.windowBits<16)U.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new fl0,this.strm.avail_out=0;var Y=qW.deflateInit2(this.strm,U.level,U.method,U.windowBits,U.memLevel,U.strategy);if(Y!==XJ)throw Error(By[Y]);if(U.header)qW.deflateSetHeader(this.strm,U.header);if(U.dictionary){var z;if(typeof U.dictionary==="string")z=Py.string2buf(U.dictionary);else if(j$0.call(U.dictionary)==="[object ArrayBuffer]")z=new Uint8Array(U.dictionary);else z=U.dictionary;if(Y=qW.deflateSetDictionary(this.strm,z),Y!==XJ)throw Error(By[Y]);this._dict_set=!0}}eU.prototype.push=function($,U){var Y=this.strm,z=this.options.chunkSize,Q,J;if(this.ended)return!1;if(J=U===~~U?U:U===!0?Ay:ul0,typeof $==="string")Y.input=Py.string2buf($);else if(j$0.call($)==="[object ArrayBuffer]")Y.input=new Uint8Array($);else Y.input=$;Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0)Y.output=new VW.Buf8(z),Y.next_out=0,Y.avail_out=z;if(Q=qW.deflate(Y,J),Q!==B$0&&Q!==XJ)return this.onEnd(Q),this.ended=!0,!1;if(Y.avail_out===0||Y.avail_in===0&&(J===Ay||J===T$0))if(this.options.to==="string")this.onData(Py.buf2binstring(VW.shrinkBuf(Y.output,Y.next_out)));else this.onData(VW.shrinkBuf(Y.output,Y.next_out))}while((Y.avail_in>0||Y.avail_out===0)&&Q!==B$0);if(J===Ay)return Q=qW.deflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===XJ;if(J===T$0)return this.onEnd(XJ),Y.avail_out=0,!0;return!0};eU.prototype.onData=function($){this.chunks.push($)};eU.prototype.onEnd=function($){if($===XJ)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($,U){var Y=new eU(U);if(Y.push($,!0),Y.err)throw Y.msg||By[Y.err];return Y.result}function nl0($,U){return U=U||{},U.raw=!0,Ty($,U)}function pl0($,U){return U=U||{},U.gzip=!0,Ty($,U)}dl0.Deflate=eU;dl0.deflate=Ty;dl0.deflateRaw=nl0;dl0.gzip=pl0});var R$0=E((hp1,C$0)=>{var XM=30,sl0=12;C$0.exports=function(U,Y){var z,Q,J,I,K,G,H,W,X,Z,q,V,F,O,w,M,N,D,B,T,A,j,C,b,x;z=U.state,Q=U.next_in,b=U.input,J=Q+(U.avail_in-5),I=U.next_out,x=U.output,K=I-(Y-U.avail_out),G=I+(U.avail_out-257),H=z.dmax,W=z.wsize,X=z.whave,Z=z.wnext,q=z.window,V=z.hold,F=z.bits,O=z.lencode,w=z.distcode,M=(1<>>24,V>>>=B,F-=B,B=D>>>16&255,B===0)x[I++]=D&65535;else if(B&16){if(T=D&65535,B&=15,B){if(F>>=B,F-=B}if(F<15)V+=b[Q++]<>>24,V>>>=B,F-=B,B=D>>>16&255,B&16){if(A=D&65535,B&=15,FH){U.msg="invalid distance too far back",z.mode=XM;break $}if(V>>>=B,F-=B,B=I-K,A>B){if(B=A-B,B>X){if(z.sane){U.msg="invalid distance too far back",z.mode=XM;break $}}if(j=0,C=q,Z===0){if(j+=W-B,B2)x[I++]=C[j++],x[I++]=C[j++],x[I++]=C[j++],T-=3;if(T){if(x[I++]=C[j++],T>1)x[I++]=C[j++]}}else{j=I-A;do x[I++]=x[j++],x[I++]=x[j++],x[I++]=x[j++],T-=3;while(T>2);if(T){if(x[I++]=x[j++],T>1)x[I++]=x[j++]}}}else if((B&64)===0){D=w[(D&65535)+(V&(1<>3,Q-=T,F-=T<<3,V&=(1<{var _$0=J3(),ZJ=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(U,Y,z,Q,J,I,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,O=0,w=0,M=0,N=0,D,B,T,A,j,C=null,b=0,x,h=new _$0.Buf16(ZJ+1),i=new _$0.Buf16(ZJ+1),c=null,z0=0,k,d,t;for(W=0;W<=ZJ;W++)h[W]=0;for(X=0;X=1;q--)if(h[q]!==0)break;if(V>q)V=q;if(q===0)return J[I++]=20971520,J[I++]=20971520,G.bits=1,0;for(Z=1;Z0&&(U===S$0||q!==1))return-1;i[1]=0;for(W=1;Wv$0||U===g$0&&M>h$0)return 1;for(;;){if(k=W-O,K[X]x)d=c[z0+K[X]],t=C[b+K[X]];else d=96,t=0;D=1<>O)+B]=k<<24|d<<16|t|0;while(B!==0);D=1<>=1;if(D!==0)N&=D-1,N+=D;else N=0;if(X++,--h[W]===0){if(W===q)break;W=Y[z+K[X]]}if(W>V&&(N&A)!==T){if(O===0)O=V;j+=Z,F=W-O,w=1<v$0||U===g$0&&M>h$0)return 1;T=N&A,J[T]=V<<24|F<<16|j-I|0}}if(N!==0)J[j+N]=W-O<<24|4194304|0;return G.bits=V,0}});var w50=E((Mo0)=>{var K$=J3(),hy=Vy(),Y9=Ly(),Uo0=R$0(),LW=k$0(),Yo0=0,G50=1,H50=2,x$0=4,zo0=5,ZM=6,$Y=0,Qo0=1,Jo0=2,C$=-2,W50=-3,Sy=-4,Io0=-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,LM=11,K3=12,Ey=13,o$0=14,Cy=15,r$0=16,s$0=17,a$0=18,t$0=19,qM=20,VM=21,e$0=22,$50=23,U50=24,Y50=25,z50=26,Ry=27,Q50=28,J50=29,y4=30,gy=31,Ko0=32,Go0=852,Ho0=592,Wo0=15,Xo0=Wo0;function I50($){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 U;if(!$||!$.state)return C$;if(U=$.state,$.total_in=$.total_out=U.total=0,$.msg="",U.wrap)$.adler=U.wrap&1;return U.mode=X50,U.last=0,U.havedict=0,U.dmax=32768,U.head=null,U.hold=0,U.bits=0,U.lencode=U.lendyn=new K$.Buf32(Go0),U.distcode=U.distdyn=new K$.Buf32(Ho0),U.sane=1,U.back=-1,$Y}function q50($){var U;if(!$||!$.state)return C$;return U=$.state,U.wsize=0,U.whave=0,U.wnext=0,Z50($)}function V50($,U){var Y,z;if(!$||!$.state)return C$;if(z=$.state,U<0)Y=0,U=-U;else if(Y=(U>>4)+1,U<48)U&=15;if(U&&(U<8||U>15))return C$;if(z.window!==null&&z.wbits!==U)z.window=null;return z.wrap=Y,z.wbits=U,q50($)}function L50($,U){var Y,z;if(!$)return C$;if(z=new Zo0,$.state=z,z.window=null,Y=V50($,U),Y!==$Y)$.state=null;return Y}function qo0($){return L50($,Xo0)}var K50=!0,_y,vy;function Vo0($){if(K50){var U;_y=new K$.Buf32(512),vy=new K$.Buf32(32),U=0;while(U<144)$.lens[U++]=8;while(U<256)$.lens[U++]=9;while(U<280)$.lens[U++]=7;while(U<288)$.lens[U++]=8;LW(G50,$.lens,0,288,_y,0,$.work,{bits:9}),U=0;while(U<32)$.lens[U++]=5;LW(H50,$.lens,0,32,vy,0,$.work,{bits:5}),K50=!1}$.lencode=_y,$.lenbits=9,$.distcode=vy,$.distbits=5}function F50($,U,Y,z){var Q,J=$.state;if(J.window===null)J.wsize=1<=J.wsize)K$.arraySet(J.window,U,Y-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize;else{if(Q=J.wsize-J.wnext,Q>z)Q=z;if(K$.arraySet(J.window,U,Y-z,Q,J.wnext),z-=Q,z)K$.arraySet(J.window,U,Y-z,z,0),J.wnext=z,J.whave=J.wsize;else{if(J.wnext+=Q,J.wnext===J.wsize)J.wnext=0;if(J.whave>>8&255,Y.check=Y9(Y.check,C,2,0),H=0,W=0,Y.mode=u$0;break}if(Y.flags=0,Y.head)Y.head.done=!1;if(!(Y.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",Y.mode=y4;break}if((H&15)!==f$0){$.msg="unknown compression method",Y.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,Y.wbits===0)Y.wbits=A;else if(A>Y.wbits){$.msg="invalid window size",Y.mode=y4;break}Y.dmax=1<>8&1;if(Y.flags&512)C[0]=H&255,C[1]=H>>>8&255,Y.check=Y9(Y.check,C,2,0);H=0,W=0,Y.mode=b$0;case b$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,Y.check=Y9(Y.check,C,4,0);H=0,W=0,Y.mode=i$0;case i$0:while(W<16){if(K===0)break $;K--,H+=z[J++]<>8;if(Y.flags&512)C[0]=H&255,C[1]=H>>>8&255,Y.check=Y9(Y.check,C,2,0);H=0,W=0,Y.mode=c$0;case c$0:if(Y.flags&1024){while(W<16){if(K===0)break $;K--,H+=z[J++]<>>8&255,Y.check=Y9(Y.check,C,2,0);H=0,W=0}else if(Y.head)Y.head.extra=null;Y.mode=n$0;case n$0:if(Y.flags&1024){if(q=Y.length,q>K)q=K;if(q){if(Y.head){if(A=Y.head.extra_len-Y.length,!Y.head.extra)Y.head.extra=Array(Y.head.extra_len);K$.arraySet(Y.head.extra,z,J,q,A)}if(Y.flags&512)Y.check=Y9(Y.check,z,q,J);K-=q,J+=q,Y.length-=q}if(Y.length)break $}Y.length=0,Y.mode=p$0;case p$0:if(Y.flags&2048){if(K===0)break $;q=0;do if(A=z[J+q++],Y.head&&A&&Y.length<65536)Y.head.name+=String.fromCharCode(A);while(A&&q>9&1,Y.head.done=!0;$.adler=Y.check=0,Y.mode=K3;break;case l$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>=W&7,W-=W&7,Y.mode=Ry;break}while(W<3){if(K===0)break $;K--,H+=z[J++]<>>=1,W-=1,H&3){case 0:Y.mode=o$0;break;case 1:if(Vo0(Y),Y.mode=qM,U===ZM){H>>>=2,W-=2;break $}break;case 2:Y.mode=s$0;break;case 3:$.msg="invalid block type",Y.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+=z[J++]<>>16^65535)){$.msg="invalid stored block lengths",Y.mode=y4;break}if(Y.length=H&65535,H=0,W=0,Y.mode=Cy,U===ZM)break $;case Cy:Y.mode=r$0;case r$0:if(q=Y.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;K$.arraySet(Q,z,J,q,I),K-=q,J+=q,G-=q,I+=q,Y.length-=q;break}Y.mode=K3;break;case s$0:while(W<14){if(K===0)break $;K--,H+=z[J++]<>>=5,W-=5,Y.ndist=(H&31)+1,H>>>=5,W-=5,Y.ncode=(H&15)+4,H>>>=4,W-=4,Y.nlen>286||Y.ndist>30){$.msg="too many length or distance symbols",Y.mode=y4;break}Y.have=0,Y.mode=a$0;case a$0:while(Y.have>>=3,W-=3}while(Y.have<19)Y.lens[h[Y.have++]]=0;if(Y.lencode=Y.lendyn,Y.lenbits=7,b={bits:Y.lenbits},j=LW(Yo0,Y.lens,0,19,Y.lencode,0,Y.work,b),Y.lenbits=b.bits,j){$.msg="invalid code lengths set",Y.mode=y4;break}Y.have=0,Y.mode=t$0;case t$0:while(Y.have>>24,M=O>>>16&255,N=O&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=w,W-=w,Y.lens[Y.have++]=N;else{if(N===16){x=w+2;while(W>>=w,W-=w,Y.have===0){$.msg="invalid bit length repeat",Y.mode=y4;break}A=Y.lens[Y.have-1],q=3+(H&3),H>>>=2,W-=2}else if(N===17){x=w+3;while(W>>=w,W-=w,A=0,q=3+(H&7),H>>>=3,W-=3}else{x=w+7;while(W>>=w,W-=w,A=0,q=11+(H&127),H>>>=7,W-=7}if(Y.have+q>Y.nlen+Y.ndist){$.msg="invalid bit length repeat",Y.mode=y4;break}while(q--)Y.lens[Y.have++]=A}}if(Y.mode===y4)break;if(Y.lens[256]===0){$.msg="invalid code -- missing end-of-block",Y.mode=y4;break}if(Y.lenbits=9,b={bits:Y.lenbits},j=LW(G50,Y.lens,0,Y.nlen,Y.lencode,0,Y.work,b),Y.lenbits=b.bits,j){$.msg="invalid literal/lengths set",Y.mode=y4;break}if(Y.distbits=6,Y.distcode=Y.distdyn,b={bits:Y.distbits},j=LW(H50,Y.lens,Y.nlen,Y.ndist,Y.distcode,0,Y.work,b),Y.distbits=b.bits,j){$.msg="invalid distances set",Y.mode=y4;break}if(Y.mode=qM,U===ZM)break $;case qM:Y.mode=VM;case VM:if(K>=6&&G>=258){if($.next_out=I,$.avail_out=G,$.next_in=J,$.avail_in=K,Y.hold=H,Y.bits=W,Uo0($,Z),I=$.next_out,Q=$.output,G=$.avail_out,J=$.next_in,z=$.input,K=$.avail_in,H=Y.hold,W=Y.bits,Y.mode===K3)Y.back=-1;break}Y.back=0;for(;;){if(O=Y.lencode[H&(1<>>24,M=O>>>16&255,N=O&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=O>>>24,M=O>>>16&255,N=O&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,Y.back+=D}if(H>>>=w,W-=w,Y.back+=w,Y.length=N,M===0){Y.mode=z50;break}if(M&32){Y.back=-1,Y.mode=K3;break}if(M&64){$.msg="invalid literal/length code",Y.mode=y4;break}Y.extra=M&15,Y.mode=e$0;case e$0:if(Y.extra){x=Y.extra;while(W>>=Y.extra,W-=Y.extra,Y.back+=Y.extra}Y.was=Y.length,Y.mode=$50;case $50:for(;;){if(O=Y.distcode[H&(1<>>24,M=O>>>16&255,N=O&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=O>>>24,M=O>>>16&255,N=O&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,Y.back+=D}if(H>>>=w,W-=w,Y.back+=w,M&64){$.msg="invalid distance code",Y.mode=y4;break}Y.offset=N,Y.extra=M&15,Y.mode=U50;case U50:if(Y.extra){x=Y.extra;while(W>>=Y.extra,W-=Y.extra,Y.back+=Y.extra}if(Y.offset>Y.dmax){$.msg="invalid distance too far back",Y.mode=y4;break}Y.mode=Y50;case Y50:if(G===0)break $;if(q=Z-G,Y.offset>q){if(q=Y.offset-q,q>Y.whave){if(Y.sane){$.msg="invalid distance too far back",Y.mode=y4;break}}if(q>Y.wnext)q-=Y.wnext,V=Y.wsize-q;else V=Y.wnext-q;if(q>Y.length)q=Y.length;F=Y.window}else F=Q,V=I-Y.offset,q=Y.length;if(q>G)q=G;G-=q,Y.length-=q;do Q[I++]=F[V++];while(--q);if(Y.length===0)Y.mode=VM;break;case z50:if(G===0)break $;Q[I++]=Y.length,G--,Y.mode=VM;break;case Ry:if(Y.wrap){while(W<32){if(K===0)break $;K--,H|=z[J++]<{O50.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((kp1,M50)=>{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}M50.exports=_o0});var A50=E((go0)=>{var qJ=w50(),FW=J3(),FM=Ny(),G6=yy(),ky=zM(),vo0=Dy(),ho0=N50(),D50=Object.prototype.toString;function UY($){if(!(this instanceof UY))return new UY($);this.options=FW.assign({chunkSize:16384,windowBits:0,to:""},$||{});var U=this.options;if(U.raw&&U.windowBits>=0&&U.windowBits<16){if(U.windowBits=-U.windowBits,U.windowBits===0)U.windowBits=-15}if(U.windowBits>=0&&U.windowBits<16&&!($&&$.windowBits))U.windowBits+=32;if(U.windowBits>15&&U.windowBits<48){if((U.windowBits&15)===0)U.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vo0,this.strm.avail_out=0;var Y=qJ.inflateInit2(this.strm,U.windowBits);if(Y!==G6.Z_OK)throw Error(ky[Y]);if(this.header=new ho0,qJ.inflateGetHeader(this.strm,this.header),U.dictionary){if(typeof U.dictionary==="string")U.dictionary=FM.string2buf(U.dictionary);else if(D50.call(U.dictionary)==="[object ArrayBuffer]")U.dictionary=new Uint8Array(U.dictionary);if(U.raw){if(Y=qJ.inflateSetDictionary(this.strm,U.dictionary),Y!==G6.Z_OK)throw Error(ky[Y])}}}UY.prototype.push=function($,U){var Y=this.strm,z=this.options.chunkSize,Q=this.options.dictionary,J,I,K,G,H,W=!1;if(this.ended)return!1;if(I=U===~~U?U:U===!0?G6.Z_FINISH:G6.Z_NO_FLUSH,typeof $==="string")Y.input=FM.binstring2buf($);else if(D50.call($)==="[object ArrayBuffer]")Y.input=new Uint8Array($);else Y.input=$;Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0)Y.output=new FW.Buf8(z),Y.next_out=0,Y.avail_out=z;if(J=qJ.inflate(Y,G6.Z_NO_FLUSH),J===G6.Z_NEED_DICT&&Q)J=qJ.inflateSetDictionary(this.strm,Q);if(J===G6.Z_BUF_ERROR&&W===!0)J=G6.Z_OK,W=!1;if(J!==G6.Z_STREAM_END&&J!==G6.Z_OK)return this.onEnd(J),this.ended=!0,!1;if(Y.next_out){if(Y.avail_out===0||J===G6.Z_STREAM_END||Y.avail_in===0&&(I===G6.Z_FINISH||I===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=FM.utf8border(Y.output,Y.next_out),G=Y.next_out-K,H=FM.buf2string(Y.output,K),Y.next_out=G,Y.avail_out=z-G,G)FW.arraySet(Y.output,Y.output,K,G,0);this.onData(H)}else this.onData(FW.shrinkBuf(Y.output,Y.next_out))}if(Y.avail_in===0&&Y.avail_out===0)W=!0}while((Y.avail_in>0||Y.avail_out===0)&&J!==G6.Z_STREAM_END);if(J===G6.Z_STREAM_END)I=G6.Z_FINISH;if(I===G6.Z_FINISH)return J=qJ.inflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===G6.Z_OK;if(I===G6.Z_SYNC_FLUSH)return this.onEnd(G6.Z_OK),Y.avail_out=0,!0;return!0};UY.prototype.onData=function($){this.chunks.push($)};UY.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($,U){var Y=new UY(U);if(Y.push($,!0),Y.err)throw Y.msg||ky[Y.err];return Y.result}function So0($,U){return U=U||{},U.raw=!0,xy($,U)}go0.Inflate=UY;go0.inflate=xy;go0.inflateRaw=So0;go0.ungzip=xy});var T50=E((fp1,B50)=>{var uo0=J3().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(),wM=I$(),do0=no0?"uint8array":"array";mo0.magic="\b\x00";function YY($,U){wM.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=U,this.meta={}}j50.inherits(YY,wM);YY.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(j50.transformTo(do0,$.data),!1)};YY.prototype.flush=function(){if(wM.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};YY.prototype.cleanUp=function(){wM.prototype.cleanUp.call(this),this._pako=null};YY.prototype._createPako=function(){this._pako=new po0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(U){$.push({data:U,meta:$.meta})}};mo0.compressWorker=function($){return new YY("Deflate",$)};mo0.uncompressWorker=function(){return new YY("Inflate",{})}});var fy=E((so0)=>{var C50=I$();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((cp1,v50)=>{var VJ=c4(),LJ=I$(),by=QJ(),R50=eO(),OM=uy(),M4=function($,U){var Y="",z;for(z=0;z>>8;return Y},Ir0=function($,U){var Y=$;if(!$)Y=U?16893:33204;return(Y&65535)<<16},Kr0=function($){return($||0)&63},_50=function($,U,Y,z,Q,J){var{file:I,compression:K}=$,G=J!==by.utf8encode,H=VJ.transformTo("string",J(I.name)),W=VJ.transformTo("string",by.utf8encode(I.name)),X=I.comment,Z=VJ.transformTo("string",J(X)),q=VJ.transformTo("string",by.utf8encode(X)),V=W.length!==I.name.length,F=q.length!==X.length,O,w,M="",N="",D="",B=I.dir,T=I.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!U||Y)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(U)j|=8;if(!G&&(V||F))j|=2048;var C=0,b=0;if(B)C|=16;if(Q==="UNIX")b=798,C|=Ir0(I.unixPermissions,B);else b=20,C|=Kr0(I.dosPermissions,B);if(O=T.getUTCHours(),O=O<<6,O=O|T.getUTCMinutes(),O=O<<5,O=O|T.getUTCSeconds()/2,w=T.getUTCFullYear()-1980,w=w<<4,w=w|T.getUTCMonth()+1,w=w<<5,w=w|T.getUTCDate(),V)N=M4(1,1)+M4(R50(H),4)+W,M+="up"+M4(N.length,2)+N;if(F)D=M4(1,1)+M4(R50(Z),4)+q,M+="uc"+M4(D.length,2)+D;var x="";x+=` \x00`,x+=M4(j,2),x+=K.magic,x+=M4(O,2),x+=M4(w,2),x+=M4(A.crc32,4),x+=M4(A.compressedSize,4),x+=M4(A.uncompressedSize,4),x+=M4(H.length,2),x+=M4(M.length,2);var h=OM.LOCAL_FILE_HEADER+x+H+M,i=OM.CENTRAL_FILE_HEADER+M4(b,2)+x+M4(Z.length,2)+"\x00\x00\x00\x00"+M4(C,4)+M4(z,4)+H+M+Z;return{fileRecord:h,dirRecord:i}},Gr0=function($,U,Y,z,Q){var J="",I=VJ.transformTo("string",Q(z));return J=OM.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+M4($,2)+M4($,2)+M4(U,4)+M4(Y,4)+M4(I.length,2)+I,J},Hr0=function($){var U="";return U=OM.DATA_DESCRIPTOR+M4($.crc32,4)+M4($.compressedSize,4)+M4($.uncompressedSize,4),U};function X5($,U,Y,z){LJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=U,this.zipPlatform=Y,this.encodeFileName=z,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}VJ.inherits(X5,LJ);X5.prototype.push=function($){var U=$.meta.percent||0,Y=this.entriesCount,z=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,LJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:Y?(U+100*(Y-z-1))/Y:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var U=this.streamFiles&&!$.file.dir;if(U){var Y=_50($,U,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Y.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var U=this.streamFiles&&!$.file.dir,Y=_50($,U,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(Y.dirRecord),U)this.push({data:Hr0($),meta:{percent:100}});else{this.push({data:Y.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 U=0;U{var Wr0=fy(),Xr0=h50(),Zr0=function($,U){var Y=$||U,z=Wr0[Y];if(!z)throw Error(Y+" is not a valid compression method !");return z};qr0.generateWorker=function($,U,Y){var z=new Xr0(U.streamFiles,Y,U.platform,U.encodeFileName),Q=0;try{$.forEach(function(J,I){Q++;var K=Zr0(I.options.compression,U.compression),G=I.options.compressionOptions||U.compressionOptions||{},H=I.dir,W=I.date;I._compressWorker(K,G).withStreamInfo("file",{name:J,dir:H,date:W,comment:I.comment||"",unixPermissions:I.unixPermissions,dosPermissions:I.dosPermissions}).pipe(z)}),z.entriesCount=Q}catch(J){z.error(J)}return z}});var y50=E((pp1,g50)=>{var Lr0=c4(),MM=I$();function wW($,U){MM.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(U)}Lr0.inherits(wW,MM);wW.prototype._bindStream=function($){var U=this;this._stream=$,$.pause(),$.on("data",function(Y){U.push({data:Y,meta:{percent:0}})}).on("error",function(Y){if(U.isPaused)this.generatedError=Y;else U.error(Y)}).on("end",function(){if(U.isPaused)U._upstreamEnded=!0;else U.end()})};wW.prototype.pause=function(){if(!MM.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wW.prototype.resume=function(){if(!MM.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};g50.exports=wW});var d50=E((dp1,p50)=>{var Fr0=QJ(),OW=c4(),u50=I$(),wr0=pg(),b50=dg(),k50=$M(),Or0=x80(),Mr0=S50(),x50=sH(),Nr0=y50(),i50=function($,U,Y){var z=OW.getTypeOf(U),Q,J=OW.extend(Y||{},b50);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermissions&16)J.dir=!0;if(J.dir)$=c50($);if(J.createFolders&&(Q=Dr0($)))n50.call(this,Q,!0);var I=z==="string"&&J.binary===!1&&J.base64===!1;if(!Y||typeof Y.binary>"u")J.binary=!I;var K=U instanceof k50&&U.uncompressedSize===0;if(K||J.dir||!U||U.length===0)J.base64=!1,J.binary=!0,U="",J.compression="STORE",z="string";var G=null;if(U instanceof k50||U instanceof u50)G=U;else if(x50.isNode&&x50.isStream(U))G=new Nr0($,U);else G=OW.prepareContent($,U,J.binary,J.optimizedBinaryString,J.base64);var H=new Or0($,G,J);this.files[$]=H},Dr0=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var U=$.lastIndexOf("/");return U>0?$.substring(0,U):""},c50=function($){if($.slice(-1)!=="/")$+="/";return $},n50=function($,U){if(U=typeof U<"u"?U:b50.createFolders,$=c50($),!this.files[$])i50.call(this,$,null,{dir:!0,createFolders:U});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 U,Y,z;for(U in this.files)if(z=this.files[U],Y=U.slice(this.root.length,U.length),Y&&U.slice(0,this.root.length)===this.root)$(Y,z)},filter:function($){var U=[];return this.forEach(function(Y,z){if($(Y,z))U.push(z)}),U},file:function($,U,Y){if(arguments.length===1)if(f50($)){var z=$;return this.filter(function(J,I){return!I.dir&&z.test(J)})}else{var Q=this.files[this.root+$];if(Q&&!Q.dir)return Q;else return null}else $=this.root+$,i50.call(this,$,U,Y);return this},folder:function($){if(!$)return this;if(f50($))return this.filter(function(Q,J){return J.dir&&$.test(Q)});var U=this.root+$,Y=n50.call(this,U),z=this.clone();return z.root=Y.name,z},remove:function($){$=this.root+$;var U=this.files[$];if(!U){if($.slice(-1)!=="/")$+="/";U=this.files[$]}if(U&&!U.dir)delete this.files[$];else{var Y=this.filter(function(Q,J){return J.name.slice(0,$.length)===$});for(var z=0;z{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;Y--)U=(U<<8)+this.byteAt(Y);return this.index+=$,U},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((lp1,r50)=>{var o50=iy(),Br0=c4();function FJ($){o50.call(this,$);for(var U=0;U=0;--J)if(this.data[J]===U&&this.data[J+1]===Y&&this.data[J+2]===z&&this.data[J+3]===Q)return J-this.zero;return-1};FJ.prototype.readAndCheckSignature=function($){var U=$.charCodeAt(0),Y=$.charCodeAt(1),z=$.charCodeAt(2),Q=$.charCodeAt(3),J=this.readData(4);return U===J[0]&&Y===J[1]&&z===J[2]&&Q===J[3]};FJ.prototype.readData=function($){if(this.checkOffset($),$===0)return[];var U=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,U};r50.exports=FJ});var t50=E((op1,a50)=>{var s50=iy(),Tr0=c4();function wJ($){s50.call(this,$)}Tr0.inherits(wJ,s50);wJ.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};wJ.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};wJ.prototype.readAndCheckSignature=function($){var U=this.readData(4);return $===U};wJ.prototype.readData=function($){this.checkOffset($);var U=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,U};a50.exports=wJ});var py=E((rp1,$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 U=this.data.subarray(this.zero+this.index,this.zero+this.index+$);return this.index+=$,U};$90.exports=ny});var z90=E((sp1,Y90)=>{var U90=py(),Er0=c4();function dy($){U90.call(this,$)}Er0.inherits(dy,U90);dy.prototype.readData=function($){this.checkOffset($);var U=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,U};Y90.exports=dy});var my=E((ap1,J90)=>{var NM=c4(),Q90=Q3(),Cr0=cy(),Rr0=t50(),_r0=z90(),vr0=py();J90.exports=function($){var U=NM.getTypeOf($);if(NM.checkSupport(U),U==="string"&&!Q90.uint8array)return new Rr0($);if(U==="nodebuffer")return new _r0($);if(Q90.uint8array)return new vr0(NM.transformTo("uint8array",$));return new Cr0(NM.transformTo("array",$))}});var H90=E((tp1,G90)=>{var ly=my(),n7=c4(),hr0=$M(),I90=eO(),DM=QJ(),AM=fy(),Sr0=Q3(),gr0=0,yr0=3,kr0=function($){for(var U in AM){if(!Object.prototype.hasOwnProperty.call(AM,U))continue;if(AM[U].magic===$)return AM[U]}return null};function K90($,U){this.options=$,this.loadOptions=U}K90.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var U,Y;if($.skip(22),this.fileNameLength=$.readInt(2),Y=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(Y),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(U=kr0(this.compressionMethod),U===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,U,$.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 U=$.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(U),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 U=$.index+this.extraFieldsLength,Y,z,Q;if(!this.extraFields)this.extraFields={};while($.index+4{var xr0=my(),G3=c4(),Z5=uy(),fr0=H90(),ur0=Q3();function W90($){this.files=[],this.loadOptions=$}W90.prototype={checkSignature:function($){if(!this.reader.readAndCheckSignature($)){this.reader.index-=4;var U=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+G3.pretty(U)+", expected "+G3.pretty($)+")")}},isSignature:function($,U){var Y=this.reader.index;this.reader.setIndex($);var z=this.reader.readString(4),Q=z===U;return this.reader.setIndex(Y),Q},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),U=ur0.uint8array?"uint8array":"array",Y=G3.transformTo(U,$);this.zipComment=this.loadOptions.decodeFileName(Y)},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,U=0,Y,z,Q;while(U<$)Y=this.reader.readInt(2),z=this.reader.readInt(4),Q=this.reader.readData(z),this.zip64ExtensibleData[Y]={id:Y,length:z,value:Q}},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 $,U;for($=0;$0)if(this.isSignature(Y,Z5.CENTRAL_FILE_HEADER));else this.reader.zero=Q;else if(Q<0)throw Error("Corrupted zip: missing "+Math.abs(Q)+" bytes.")},prepareReader:function($){this.reader=xr0($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};X90.exports=W90});var L90=E(($d1,V90)=>{var oy=c4(),PM=UJ(),br0=QJ(),ir0=Z90(),cr0=og(),q90=sH();function nr0($){return new PM.Promise(function(U,Y){var z=$.decompressed.getContentWorker().pipe(new cr0);z.on("error",function(Q){Y(Q)}).on("end",function(){if(z.streamInfo.crc32!==$.decompressed.crc32)Y(Error("Corrupted zip : CRC32 mismatch"));else U()}).resume()})}V90.exports=function($,U){var Y=this;if(U=oy.extend(U||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:br0.utf8decode}),q90.isNode&&q90.isStream($))return PM.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return oy.prepareContent("the loaded zip file",$,!0,U.optimizedBinaryString,U.base64).then(function(z){var Q=new ir0(U);return Q.load(z),Q}).then(function(Q){var J=[PM.Promise.resolve(Q)],I=Q.files;if(U.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 U in this)if(typeof this[U]!=="function")$[U]=this[U];return $}}R$.prototype=d50();R$.prototype.loadAsync=L90();R$.support=Q3();R$.defaults=dg();R$.version="3.10.1";R$.loadAsync=function($,U){return new R$().loadAsync($,U)};R$.external=UJ();F90.exports=R$});var A90=E((Yd1,D90)=>{function w90($,U){var Y=Object.keys($);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);U&&(z=z.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),Y.push.apply(Y,z)}return Y}function O90($){for(var U=1;U0)this.tail.next=z;else this.head=z;this.tail=z,++this.length}},{key:"unshift",value:function(Y){var z={data:Y,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var Y=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,Y}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(Y){if(this.length===0)return"";var z=this.head,Q=""+z.data;while(z=z.next)Q+=Y+z.data;return Q}},{key:"concat",value:function(Y){if(this.length===0)return BM.alloc(0);var z=BM.allocUnsafe(Y>>>0),Q=this.head,J=0;while(Q)ar0(Q.data,z,J),J+=Q.data.length,Q=Q.next;return z}},{key:"consume",value:function(Y,z){var Q;if(YI.length?I.length:Y;if(K===I.length)J+=I;else J+=I.slice(0,Y);if(Y-=K,Y===0){if(K===I.length)if(++Q,z.next)this.head=z.next;else this.head=this.tail=null;else this.head=z,z.data=I.slice(K);break}++Q}return this.length-=Q,J}},{key:"_getBuffer",value:function(Y){var z=BM.allocUnsafe(Y),Q=this.head,J=1;Q.data.copy(z),Y-=Q.data.length;while(Q=Q.next){var I=Q.data,K=Y>I.length?I.length:Y;if(I.copy(z,z.length-Y,0,K),Y-=K,Y===0){if(K===I.length)if(++J,Q.next)this.head=Q.next;else this.head=this.tail=null;else this.head=Q,Q.data=I.slice(K);break}++J}return this.length-=J,z}},{key:sr0,value:function(Y,z){return sy(this,O90(O90({},z),{},{depth:0,customInspect:!1}))}}]),$}()});var ty=E((zd1,B90)=>{function tr0($,U){var Y=this,z=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(z||Q){if(U)U($);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(J){if(!U&&J)if(!Y._writableState)process.nextTick(P90,Y,J);else if(!Y._writableState.errorEmitted)Y._writableState.errorEmitted=!0,process.nextTick(P90,Y,J);else process.nextTick(TM,Y);else if(U)process.nextTick(TM,Y),U(J);else process.nextTick(TM,Y)}),this}function P90($,U){ay($,U),TM($)}function TM($){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($,U){$.emit("error",U)}function $s0($,U){var{_readableState:Y,_writableState:z}=$;if(Y&&Y.autoDestroy||z&&z.autoDestroy)$.destroy(U);else $.emit("error",U)}B90.exports={destroy:tr0,undestroy:er0,errorOrDestroy:$s0}});var p7=E((Qs0,E90)=>{var j90={};function _$($,U,Y){if(!Y)Y=Error;function z(J,I,K){if(typeof U==="string")return U;else return U(J,I,K)}class Q extends Y{constructor(J,I,K){super(z(J,I,K))}}Q.prototype.name=Y.name,Q.prototype.code=$,j90[$]=Q}function T90($,U){if(Array.isArray($)){let Y=$.length;if($=$.map((z)=>String(z)),Y>2)return`one of ${U} ${$.slice(0,Y-1).join(", ")}, or `+$[Y-1];else if(Y===2)return`one of ${U} ${$[0]} or ${$[1]}`;else return`of ${U} ${$[0]}`}else return`of ${U} ${String($)}`}function Us0($,U,Y){return $.substr(!Y||Y<0?0:+Y,U.length)===U}function Ys0($,U,Y){if(Y===void 0||Y>$.length)Y=$.length;return $.substring(Y-U.length,Y)===U}function zs0($,U,Y){if(typeof Y!=="number")Y=0;if(Y+U.length>$.length)return!1;else return $.indexOf(U,Y)!==-1}_$("ERR_INVALID_OPT_VALUE",function($,U){return'The value "'+U+'" is invalid for option "'+$+'"'},TypeError);_$("ERR_INVALID_ARG_TYPE",function($,U,Y){let z;if(typeof U==="string"&&Us0(U,"not "))z="must not be",U=U.replace(/^not /,"");else z="must be";let Q;if(Ys0($," argument"))Q=`The ${$} ${z} ${T90(U,"type")}`;else{let J=zs0($,".")?"property":"argument";Q=`The "${$}" ${J} ${z} ${T90(U,"type")}`}return Q+=`. Received type ${typeof Y}`,Q},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");Qs0.codes=j90});var ey=E((Qd1,C90)=>{var Is0=p7().codes.ERR_INVALID_OPT_VALUE;function Ks0($,U,Y){return $.highWaterMark!=null?$.highWaterMark:U?$[Y]:null}function Gs0($,U,Y,z){var Q=Ks0(U,z,Y);if(Q!=null){if(!(isFinite(Q)&&Math.floor(Q)===Q)||Q<0){var J=z?Y:"highWaterMark";throw new Is0(J,Q)}return Math.floor(Q)}return $.objectMode?16:16384}C90.exports={getHighWaterMark:Gs0}});var Yk=E((Jd1,g90)=>{g90.exports=Y6;function _90($){var U=this;this.next=null,this.entry=null,this.finish=function(){ys0(U,$)}}var OJ;Y6.WritableState=NW;var Hs0={deprecate:S7()},v90=I0("stream"),EM=I0("buffer").Buffer,Ws0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Xs0($){return EM.from($)}function Zs0($){return EM.isBuffer($)||$ instanceof Ws0}var Uk=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,Os0=d7.ERR_STREAM_CANNOT_PIPE,Ms0=d7.ERR_STREAM_DESTROYED,Ns0=d7.ERR_STREAM_NULL_VALUES,Ds0=d7.ERR_STREAM_WRITE_AFTER_END,As0=d7.ERR_UNKNOWN_ENCODING,MJ=Uk.errorOrDestroy;X1()(Y6,v90);function Ps0(){}function NW($,U,Y){if(OJ=OJ||zY(),$=$||{},typeof Y!=="boolean")Y=U instanceof OJ;if(this.objectMode=!!$.objectMode,Y)this.objectMode=this.objectMode||!!$.writableObjectMode;this.highWaterMark=Vs0(this,$,"writableHighWaterMark",Y),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=$.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){_s0(U,Q)},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 U=this.bufferedRequest,Y=[];while(U)Y.push(U),U=U.next;return Y};(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 jM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")jM=Function.prototype[Symbol.hasInstance],Object.defineProperty(Y6,Symbol.hasInstance,{value:function(U){if(jM.call(this,U))return!0;if(this!==Y6)return!1;return U&&U._writableState instanceof NW}});else jM=function(U){return U instanceof this};function Y6($){OJ=OJ||zY();var U=this instanceof OJ;if(!U&&!jM.call(Y6,this))return new Y6($);if(this._writableState=new NW($,this,U),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)}Y6.prototype.pipe=function(){MJ(this,new Os0)};function Bs0($,U){var Y=new Ds0;MJ($,Y),process.nextTick(U,Y)}function Ts0($,U,Y,z){var Q;if(Y===null)Q=new Ns0;else if(typeof Y!=="string"&&!U.objectMode)Q=new Ls0("chunk",["string","Buffer"],Y);if(Q)return MJ($,Q),process.nextTick(z,Q),!1;return!0}Y6.prototype.write=function($,U,Y){var z=this._writableState,Q=!1,J=!z.objectMode&&Zs0($);if(J&&!EM.isBuffer($))$=Xs0($);if(typeof U==="function")Y=U,U=null;if(J)U="buffer";else if(!U)U=z.defaultEncoding;if(typeof Y!=="function")Y=Ps0;if(z.ending)Bs0(this,Y);else if(J||Ts0(this,z,$,Y))z.pendingcb++,Q=Es0(this,z,J,$,U,Y);return Q};Y6.prototype.cork=function(){this._writableState.corked++};Y6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)h90(this,$)}};Y6.prototype.setDefaultEncoding=function(U){if(typeof U==="string")U=U.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((U+"").toLowerCase())>-1))throw new As0(U);return this._writableState.defaultEncoding=U,this};Object.defineProperty(Y6.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function js0($,U,Y){if(!$.objectMode&&$.decodeStrings!==!1&&typeof U==="string")U=EM.from(U,Y);return U}Object.defineProperty(Y6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Es0($,U,Y,z,Q,J){if(!Y){var I=js0(U,z,Q);if(z!==I)Y=!0,Q="buffer",z=I}var K=U.objectMode?1:z.length;U.length+=K;var G=U.length{var ks0=Object.keys||function($){var U=[];for(var Y in $)U.push(Y);return U};k90.exports=z9;var y90=Qk(),zk=Yk();X1()(z9,y90);{CM=ks0(zk.prototype);for(DW=0;DW{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var RM=I0("buffer"),Q9=RM.Buffer;function x90($,U){for(var Y in $)U[Y]=$[Y]}if(Q9.from&&Q9.alloc&&Q9.allocUnsafe&&Q9.allocUnsafeSlow)f90.exports=RM;else x90(RM,Jk),Jk.Buffer=QY;function QY($,U,Y){return Q9($,U,Y)}QY.prototype=Object.create(Q9.prototype);x90(Q9,QY);QY.from=function($,U,Y){if(typeof $==="number")throw TypeError("Argument must not be a number");return Q9($,U,Y)};QY.alloc=function($,U,Y){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=Q9($);if(U!==void 0)if(typeof Y==="string")z.fill(U,Y);else z.fill(U);else z.fill(0);return z};QY.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return Q9($)};QY.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return RM.SlowBuffer($)}});var NJ=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 U;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(U)return;$=(""+$).toLowerCase(),U=!0}}function bs0($){var U=us0($);if(typeof U!=="string"&&(Kk.isEncoding===b90||!b90($)))throw Error("Unknown encoding: "+$);return U||$}ts0.StringDecoder=PW;function PW($){this.encoding=bs0($);var U;switch(this.encoding){case"utf16le":this.text=ms0,this.end=ls0,U=4;break;case"utf8":this.fillLast=ns0,U=4;break;case"base64":this.text=os0,this.end=rs0,U=3;break;default:this.write=ss0,this.end=as0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Kk.allocUnsafe(U)}PW.prototype.write=function($){if($.length===0)return"";var U,Y;if(this.lastNeed){if(U=this.fillLast($),U===void 0)return"";Y=this.lastNeed,this.lastNeed=0}else Y=0;if(Y<$.length)return U?U+this.text($,Y):this.text($,Y);return U||""};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 Ik($){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($,U,Y){var z=U.length-1;if(z=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--z=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--z=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function cs0($,U,Y){if((U[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&U.length>1){if((U[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&U.length>2){if((U[2]&192)!==128)return $.lastNeed=2,"�"}}}function ns0($){var U=this.lastTotal-this.lastNeed,Y=cs0(this,$,U);if(Y!==void 0)return Y;if(this.lastNeed<=$.length)return $.copy(this.lastChar,U,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,U,0,$.length),this.lastNeed-=$.length}function ps0($,U){var Y=is0(this,$,U);if(!this.lastNeed)return $.toString("utf8",U);this.lastTotal=Y;var z=$.length-(Y-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",U,z)}function ds0($){var U=$&&$.length?this.write($):"";if(this.lastNeed)return U+"�";return U}function ms0($,U){if(($.length-U)%2===0){var Y=$.toString("utf16le",U);if(Y){var z=Y.charCodeAt(Y.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],Y.slice(0,-1)}return Y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",U,$.length-1)}function ls0($){var U=$&&$.length?this.write($):"";if(this.lastNeed){var Y=this.lastTotal-this.lastNeed;return U+this.lastChar.toString("utf16le",0,Y)}return U}function os0($,U){var Y=($.length-U)%3;if(Y===0)return $.toString("base64",U);if(this.lastNeed=3-Y,this.lastTotal=3,Y===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",U,$.length-Y)}function rs0($){var U=$&&$.length?this.write($):"";if(this.lastNeed)return U+this.lastChar.toString("base64",0,3-this.lastNeed);return U}function ss0($){return $.toString(this.encoding)}function as0($){return $&&$.length?this.write($):""}});var _M=E((Gd1,n90)=>{var i90=p7().codes.ERR_STREAM_PREMATURE_CLOSE;function $a0($){var U=!1;return function(){if(U)return;U=!0;for(var Y=arguments.length,z=Array(Y),Q=0;Q{var vM;function m7($,U,Y){if(U=za0(U),U in $)Object.defineProperty($,U,{value:Y,enumerable:!0,configurable:!0,writable:!0});else $[U]=Y;return $}function za0($){var U=Qa0($,"string");return typeof U==="symbol"?U:String(U)}function Qa0($,U){if(typeof $!=="object"||$===null)return $;var Y=$[Symbol.toPrimitive];if(Y!==void 0){var z=Y.call($,U||"default");if(typeof z!=="object")return z;throw TypeError("@@toPrimitive must return a primitive value.")}return(U==="string"?String:Number)($)}var Ja0=_M(),l7=Symbol("lastResolve"),JY=Symbol("lastReject"),BW=Symbol("error"),hM=Symbol("ended"),IY=Symbol("lastPromise"),Gk=Symbol("handlePromise"),KY=Symbol("stream");function o7($,U){return{value:$,done:U}}function Ia0($){var U=$[l7];if(U!==null){var Y=$[KY].read();if(Y!==null)$[IY]=null,$[l7]=null,$[JY]=null,U(o7(Y,!1))}}function Ka0($){process.nextTick(Ia0,$)}function Ga0($,U){return function(Y,z){$.then(function(){if(U[hM]){Y(o7(void 0,!0));return}U[Gk](Y,z)},z)}}var Ha0=Object.getPrototypeOf(function(){}),Wa0=Object.setPrototypeOf((vM={get stream(){return this[KY]},next:function(){var U=this,Y=this[BW];if(Y!==null)return Promise.reject(Y);if(this[hM])return Promise.resolve(o7(void 0,!0));if(this[KY].destroyed)return new Promise(function(I,K){process.nextTick(function(){if(U[BW])K(U[BW]);else I(o7(void 0,!0))})});var z=this[IY],Q;if(z)Q=new Promise(Ga0(z,this));else{var J=this[KY].read();if(J!==null)return Promise.resolve(o7(J,!1));Q=new Promise(this[Gk])}return this[IY]=Q,Q}},m7(vM,Symbol.asyncIterator,function(){return this}),m7(vM,"return",function(){var U=this;return new Promise(function(Y,z){U[KY].destroy(null,function(Q){if(Q){z(Q);return}Y(o7(void 0,!0))})})}),vM),Ha0),Xa0=function(U){var Y,z=Object.create(Wa0,(Y={},m7(Y,KY,{value:U,writable:!0}),m7(Y,l7,{value:null,writable:!0}),m7(Y,JY,{value:null,writable:!0}),m7(Y,BW,{value:null,writable:!0}),m7(Y,hM,{value:U._readableState.endEmitted,writable:!0}),m7(Y,Gk,{value:function(J,I){var K=z[KY].read();if(K)z[IY]=null,z[l7]=null,z[JY]=null,J(o7(K,!1));else z[l7]=J,z[JY]=I},writable:!0}),Y));return z[IY]=null,Ja0(U,function(Q){if(Q&&Q.code!=="ERR_STREAM_PREMATURE_CLOSE"){var J=z[JY];if(J!==null)z[IY]=null,z[l7]=null,z[JY]=null,J(Q);z[BW]=Q;return}var I=z[l7];if(I!==null)z[IY]=null,z[l7]=null,z[JY]=null,I(o7(void 0,!0));z[hM]=!0}),U.on("readable",Ka0.bind(null,z)),z};p90.exports=Xa0});var r90=E((Wd1,o90)=>{function m90($,U,Y,z,Q,J,I){try{var K=$[J](I),G=K.value}catch(H){Y(H);return}if(K.done)U(G);else Promise.resolve(G).then(z,Q)}function Za0($){return function(){var U=this,Y=arguments;return new Promise(function(z,Q){var J=$.apply(U,Y);function I(G){m90(J,z,Q,I,K,"next",G)}function K(G){m90(J,z,Q,I,K,"throw",G)}I(void 0)})}}function l90($,U){var Y=Object.keys($);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);U&&(z=z.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),Y.push.apply(Y,z)}return Y}function qa0($){for(var U=1;U{J30.exports=p1;var DJ;p1.ReadableState=e90;var Xd1=I0("events").EventEmitter,t90=function(U,Y){return U.listeners(Y).length},jW=I0("stream"),SM=I0("buffer").Buffer,Ma0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Na0($){return SM.from($)}function Da0($){return SM.isBuffer($)||$ instanceof Ma0}var Hk=I0("util"),C1;if(Hk&&Hk.debuglog)C1=Hk.debuglog("stream");else C1=function(){};var Aa0=A90(),Fk=ty(),Pa0=ey(),Ba0=Pa0.getHighWaterMark,gM=p7().codes,Ta0=gM.ERR_INVALID_ARG_TYPE,ja0=gM.ERR_STREAM_PUSH_AFTER_EOF,Ea0=gM.ERR_METHOD_NOT_IMPLEMENTED,Ca0=gM.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,AJ,Wk,Xk;X1()(p1,jW);var TW=Fk.errorOrDestroy,Zk=["error","close","destroy","pause","resume"];function Ra0($,U,Y){if(typeof $.prependListener==="function")return $.prependListener(U,Y);if(!$._events||!$._events[U])$.on(U,Y);else if(Array.isArray($._events[U]))$._events[U].unshift(Y);else $._events[U]=[Y,$._events[U]]}function e90($,U,Y){if(DJ=DJ||zY(),$=$||{},typeof Y!=="boolean")Y=U instanceof DJ;if(this.objectMode=!!$.objectMode,Y)this.objectMode=this.objectMode||!!$.readableObjectMode;if(this.highWaterMark=Ba0(this,$,"readableHighWaterMark",Y),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(!AJ)AJ=NJ().StringDecoder;this.decoder=new AJ($.encoding),this.encoding=$.encoding}}function p1($){if(DJ=DJ||zY(),!(this instanceof p1))return new p1($);var U=this instanceof DJ;if(this._readableState=new e90($,this,U),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(U){if(!this._readableState)return;this._readableState.destroyed=U}});p1.prototype.destroy=Fk.destroy;p1.prototype._undestroy=Fk.undestroy;p1.prototype._destroy=function($,U){U($)};p1.prototype.push=function($,U){var Y=this._readableState,z;if(!Y.objectMode){if(typeof $==="string"){if(U=U||Y.defaultEncoding,U!==Y.encoding)$=SM.from($,U),U="";z=!0}}else z=!0;return $30(this,$,U,!1,z)};p1.prototype.unshift=function($){return $30(this,$,null,!0,!1)};function $30($,U,Y,z,Q){C1("readableAddChunk",U);var J=$._readableState;if(U===null)J.reading=!1,ha0($,J);else{var I;if(!Q)I=_a0(J,U);if(I)TW($,I);else if(J.objectMode||U&&U.length>0){if(typeof U!=="string"&&!J.objectMode&&Object.getPrototypeOf(U)!==SM.prototype)U=Na0(U);if(z)if(J.endEmitted)TW($,new Ca0);else qk($,J,U,!0);else if(J.ended)TW($,new ja0);else if(J.destroyed)return!1;else if(J.reading=!1,J.decoder&&!Y)if(U=J.decoder.write(U),J.objectMode||U.length!==0)qk($,J,U,!1);else Lk($,J);else qk($,J,U,!1)}else if(!z)J.reading=!1,Lk($,J)}return!J.ended&&(J.length=s90)$=s90;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function a90($,U){if($<=0||U.length===0&&U.ended)return 0;if(U.objectMode)return 1;if($!==$)if(U.flowing&&U.length)return U.buffer.head.data.length;else return U.length;if($>U.highWaterMark)U.highWaterMark=va0($);if($<=U.length)return $;if(!U.ended)return U.needReadable=!0,0;return U.length}p1.prototype.read=function($){C1("read",$),$=parseInt($,10);var U=this._readableState,Y=$;if($!==0)U.emittedReadable=!1;if($===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended)){if(C1("read: emitReadable",U.length,U.ended),U.length===0&&U.ended)Vk(this);else yM(this);return null}if($=a90($,U),$===0&&U.ended){if(U.length===0)Vk(this);return null}var z=U.needReadable;if(C1("need readable",z),U.length===0||U.length-$0)Q=z30($,U);else Q=null;if(Q===null)U.needReadable=U.length<=U.highWaterMark,$=0;else U.length-=$,U.awaitDrain=0;if(U.length===0){if(!U.ended)U.needReadable=!0;if(Y!==$&&U.ended)Vk(this)}if(Q!==null)this.emit("data",Q);return Q};function ha0($,U){if(C1("onEofChunk"),U.ended)return;if(U.decoder){var Y=U.decoder.end();if(Y&&Y.length)U.buffer.push(Y),U.length+=U.objectMode?1:Y.length}if(U.ended=!0,U.sync)yM($);else if(U.needReadable=!1,!U.emittedReadable)U.emittedReadable=!0,U30($)}function yM($){var U=$._readableState;if(C1("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,!U.emittedReadable)C1("emitReadable",U.flowing),U.emittedReadable=!0,process.nextTick(U30,$)}function U30($){var U=$._readableState;if(C1("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&(U.length||U.ended))$.emit("readable"),U.emittedReadable=!1;U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,wk($)}function Lk($,U){if(!U.readingMore)U.readingMore=!0,process.nextTick(Sa0,$,U)}function Sa0($,U){while(!U.reading&&!U.ended&&(U.length1&&Q30(z.pipes,$)!==-1)&&!H)C1("false write response, pause",z.awaitDrain),z.awaitDrain++;Y.pause()}}function Z(O){if(C1("onerror",O),F(),$.removeListener("error",Z),t90($,"error")===0)TW($,O)}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"),Y.unpipe($)}if($.emit("pipe",Y),!z.flowing)C1("pipe resume"),Y.resume();return $};function ga0($){return function(){var Y=$._readableState;if(C1("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&t90($,"data"))Y.flowing=!0,wk($)}}p1.prototype.unpipe=function($){var U=this._readableState,Y={hasUnpiped:!1};if(U.pipesCount===0)return this;if(U.pipesCount===1){if($&&$!==U.pipes)return this;if(!$)$=U.pipes;if(U.pipes=null,U.pipesCount=0,U.flowing=!1,$)$.emit("unpipe",this,Y);return this}if(!$){var{pipes:z,pipesCount:Q}=U;U.pipes=null,U.pipesCount=0,U.flowing=!1;for(var J=0;J0,z.flowing!==!1)this.resume()}else if($==="readable"){if(!z.endEmitted&&!z.readableListening){if(z.readableListening=z.needReadable=!0,z.flowing=!1,z.emittedReadable=!1,C1("on readable",z.length,z.reading),z.length)yM(this);else if(!z.reading)process.nextTick(ya0,this)}}return Y};p1.prototype.addListener=p1.prototype.on;p1.prototype.removeListener=function($,U){var Y=jW.prototype.removeListener.call(this,$,U);if($==="readable")process.nextTick(Y30,this);return Y};p1.prototype.removeAllListeners=function($){var U=jW.prototype.removeAllListeners.apply(this,arguments);if($==="readable"||$===void 0)process.nextTick(Y30,this);return U};function Y30($){var U=$._readableState;if(U.readableListening=$.listenerCount("readable")>0,U.resumeScheduled&&!U.paused)U.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($,U){if(!U.resumeScheduled)U.resumeScheduled=!0,process.nextTick(xa0,$,U)}function xa0($,U){if(C1("resume",U.reading),!U.reading)$.read(0);if(U.resumeScheduled=!1,$.emit("resume"),wk($),U.flowing&&!U.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 U=$._readableState;C1("flow",U.flowing);while(U.flowing&&$.read()!==null);}p1.prototype.wrap=function($){var U=this,Y=this._readableState,z=!1;$.on("end",function(){if(C1("wrapped end"),Y.decoder&&!Y.ended){var I=Y.decoder.end();if(I&&I.length)U.push(I)}U.push(null)}),$.on("data",function(I){if(C1("wrapped data"),Y.decoder)I=Y.decoder.write(I);if(Y.objectMode&&(I===null||I===void 0))return;else if(!Y.objectMode&&(!I||!I.length))return;var K=U.push(I);if(!K)z=!0,$.pause()});for(var Q in $)if(this[Q]===void 0&&typeof $[Q]==="function")this[Q]=function(K){return function(){return $[K].apply($,arguments)}}(Q);for(var J=0;J=U.length){if(U.decoder)Y=U.buffer.join("");else if(U.buffer.length===1)Y=U.buffer.first();else Y=U.buffer.concat(U.length);U.buffer.clear()}else Y=U.buffer.consume($,U.decoder);return Y}function Vk($){var U=$._readableState;if(C1("endReadable",U.endEmitted),!U.endEmitted)U.ended=!0,process.nextTick(fa0,U,$)}function fa0($,U){if(C1("endReadableNT",$.endEmitted,$.length),!$.endEmitted&&$.length===0){if($.endEmitted=!0,U.readable=!1,U.emit("end"),$.autoDestroy){var Y=U._writableState;if(!Y||Y.autoDestroy&&Y.finished)U.destroy()}}}if(typeof Symbol==="function")p1.from=function($,U){if(Xk===void 0)Xk=r90();return Xk(p1,$,U)};function Q30($,U){for(var Y=0,z=$.length;Y{K30.exports=H3;var kM=p7().codes,ua0=kM.ERR_METHOD_NOT_IMPLEMENTED,ba0=kM.ERR_MULTIPLE_CALLBACK,ia0=kM.ERR_TRANSFORM_ALREADY_TRANSFORMING,ca0=kM.ERR_TRANSFORM_WITH_LENGTH_0,xM=zY();X1()(H3,xM);function na0($,U){var Y=this._transformState;Y.transforming=!1;var z=Y.writecb;if(z===null)return this.emit("error",new ba0);if(Y.writechunk=null,Y.writecb=null,U!=null)this.push(U);z($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{H30.exports=EW;var G30=Ok();X1()(EW,G30);function EW($){if(!(this instanceof EW))return new EW($);G30.call(this,$)}EW.prototype._transform=function($,U,Y){Y(null,$)}});var L30=E((Ld1,V30)=>{var Mk;function da0($){var U=!1;return function(){if(U)return;U=!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($,U,Y,z){z=da0(z);var Q=!1;if($.on("close",function(){Q=!0}),Mk===void 0)Mk=_M();Mk($,{readable:U,writable:Y},function(I){if(I)return z(I);Q=!0,z()});var J=!1;return function(I){if(Q)return;if(J)return;if(J=!0,oa0($))return $.abort();if(typeof $.destroy==="function")return $.destroy();z(I||new la0("pipe"))}}function Z30($){$()}function sa0($,U){return $.pipe(U)}function aa0($){if(!$.length)return X30;if(typeof $[$.length-1]!=="function")return X30;return $.pop()}function ta0(){for(var $=arguments.length,U=Array($),Y=0;Y<$;Y++)U[Y]=arguments[Y];var z=aa0(U);if(Array.isArray(U[0]))U=U[0];if(U.length<2)throw new ma0("streams");var Q,J=U.map(function(I,K){var G=K0;return ra0(I,G,H,function(W){if(!Q)Q=W;if(W)J.forEach(Z30);if(G)return;J.forEach(Z30),z(Q)})});return U.reduce(sa0)}V30.exports=ta0});var E8=E((v$,RW)=>{var CW=I0("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=Qk(),v$.Stream=CW||v$,v$.Readable=v$,v$.Writable=Yk(),v$.Duplex=zY(),v$.Transform=Ok(),v$.PassThrough=W30(),v$.finished=_M(),v$.pipeline=L30()});var Z8=E((Fd1,O30)=>{var F30=I0("fs"),ea0=function($,U,Y,z){if($.super_=U,!z)z=Y,Y=null;if(Y)Object.keys(Y).forEach((J)=>{Object.defineProperty($,J,Object.getOwnPropertyDescriptor(Y,J))});let Q={constructor:{value:$,enumerable:!1,writable:!1,configurable:!0}};if(z)Object.keys(z).forEach((J)=>{Q[J]=Object.getOwnPropertyDescriptor(z,J)});$.prototype=Object.create(U.prototype,Q)},$t0=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,w30={nop(){},promiseImmediate($){return new Promise((U)=>{if(global.setImmediate)setImmediate(()=>{U($)});else setTimeout(()=>{U($)},1)})},inherits:ea0,dateToExcel($,U){return 25569+$.getTime()/86400000-(U?1462:0)},excelToDate($,U){let Y=Math.round(($-25569+(U?1462:0))*24*3600*1000);return new Date(Y)},parsePath($){let U=$.lastIndexOf("/");return{path:$.substring(0,U),name:$.substring(U+1)}},getRelsPath($){let U=w30.parsePath($);return`${U.path}/_rels/${U.name}.rels`},xmlEncode($){let U=$t0.exec($);if(!U)return $;let Y="",z="",Q=0,J=U.index;for(;J<$.length;J++){let I=$.charCodeAt(J);switch(I){case 34:z=""";break;case 38:z="&";break;case 39:z="'";break;case 60:z="<";break;case 62:z=">";break;case 127:z="";break;default:{if(I<=31&&(I<=8||I>=11&&I!==13)){z="";break}continue}}if(Q!==J)Y+=$.substring(Q,J);if(Q=J+1,z)Y+=z}if(Q!==J)return Y+$.substring(Q,J);return Y},xmlDecode($){return $.replace(/&([a-z]*);/g,(U)=>{switch(U){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return U}})},validInt($){let U=parseInt($,10);return!Number.isNaN(U)?U:0},isDateFmt($){if(!$)return!1;return $=$.replace(/\[[^\]]*]/g,""),$=$.replace(/"[^"]*"/g,""),$.match(/[ymdhMsb]+/)!==null},fs:{exists($){return new Promise((U)=>{F30.access($,F30.constants.F_OK,(Y)=>{U(!Y)})})}},toIsoDateString($){return $.toIsoString().subsstr(0,10)},parseBoolean($){return $===!0||$==="true"||$===1||$==="1"}};O30.exports=w30});var Nk=E((wd1,N30)=>{class M30{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 U=this._buf.length*2;while(U<$)U*=2;let Y=Buffer.alloc(U);this._buf.copy(Y,0),this._buf=Y}addText($){this._buffer=void 0;let U=this._inPos+this._buf.write($,this._inPos,this._encoding);while(U>=this._buf.length-4)this._grow(this._inPos+$.length),U=this._inPos+this._buf.write($,this._inPos,this._encoding);this._inPos=U}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=M30});var _W=E((Od1,E30)=>{var Ut0=E8(),D30=Z8(),Yt0=Nk();class A30{constructor($,U){this._data=$,this._encoding=U}get length(){return this.toBuffer().length}copy($,U,Y,z){return this.toBuffer().copy($,U,Y,z)}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($,U,Y,z){return this._data._buf.copy($,U,Y,z)}toBuffer(){return this._data.toBuffer()}}class B30{constructor($){this._data=$}get length(){return this._data.length}copy($,U,Y,z){this._data.copy($,U,Y,z)}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 U;if($===0)return null;if($===void 0||$>=this.length)return U=this.toBuffer(),this.iRead=this.iWrite,U;return U=Buffer.alloc($),this.buffer.copy(U,0,this.iRead,$),this.iRead+=$,U}write($,U,Y){let z=Math.min(Y,this.size-this.iWrite);return $.copy(this.buffer,this.iWrite,U,U+z),this.iWrite+=z,z}}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,Ut0.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 U=this.buffers[this.buffers.length-1];if(!U.full)return U}let $=new T30(this.bufSize);return this.buffers.push($),$},async _pipe($){let U=function(Y){return new Promise((z)=>{Y.write($.toBuffer(),()=>{z()})})};await Promise.all(this.pipes.map(U))},_writeToBuffers($){let U=0,Y=$.length;while(U1)this._pipe(this.buffers.shift())}else if(!this.corked)await this._pipe(z),Y();else this._writeToBuffers(z),process.nextTick(Y);else{if(!this.paused)this.emit("data",z.toBuffer());this._writeToBuffers(z),this.emit("readable")}return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)while(this.buffers.length)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end($,U,Y){let z=(Q)=>{if(Q)Y(Q);else this._flush(),this.pipes.forEach((J)=>{J.end()}),this.emit("finish")};if($)this.write($,U,z);else z()},read($){let U;if($){U=[];while($&&this.buffers.length&&!this.buffers[0].eod){let Y=this.buffers[0],z=Y.read($);if($-=z.length,U.push(z),Y.eod&&Y.full)this.buffers.shift()}return Buffer.concat(U)}return U=this.buffers.map((Y)=>Y.toBuffer()).filter(Boolean),this.buffers=[],Buffer.concat(U)},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((U)=>U!==$)},unshift(){throw Error("Not Implemented")},wrap(){throw Error("Not Implemented")}});E30.exports=j30});var _30=E((Qt0)=>{var C30=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:R30}=I0("buffer");function zt0($){if(typeof $!=="string")return $;if(C30)return R30.from(C30.encode($).buffer);return R30.from($)}Qt0.stringToBuffer=zt0});var S30=E((Dd1,h30)=>{var It0=I0("events"),Kt0=ry(),Gt0=_W(),{stringToBuffer:Nd1}=_30();class v30 extends It0.EventEmitter{constructor($){super();this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},$),this.zip=new Kt0,this.stream=new Gt0}append($,U){if(U.hasOwnProperty("base64")&&U.base64)this.zip.file(U.name,$,{base64:!0});else this.zip.file(U.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($,U){return this.stream.pipe($,U)}unpipe($){return this.stream.unpipe($)}unshift($){return this.stream.unshift($)}wrap($){return this.stream.wrap($)}}h30.exports={ZipWriter:v30}});var l6=E((Ad1,k30)=>{var Ht0=U6(),g30=Z8();function y30($,U,Y){$.push(` ${U}="${g30.xmlEncode(Y.toString())}"`)}function Dk($,U){if(U){let Y=[];Ht0.each(U,(z,Q)=>{if(z!==void 0)y30(Y,Q,z)}),$.push(Y.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 U=this._xml;U.push(" `)}openNode($,U){let Y=this.tos,z=this._xml;if(Y&&this.open)z.push(">");this._stack.push($),z.push("<"),z.push($),Dk(z,U),this.leaf=!0,this.open=!0}addAttribute($,U){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(U!==void 0)y30(this._xml,$,U)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Dk(this._xml,$)}writeText($){let U=this._xml;if(this.open)U.push(">"),this.open=!1;this.leaf=!1,U.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(),U=this._xml;if(this.leaf)U.push("/>");else U.push("");this.open=!1,this.leaf=!1}leafNode($,U,Y){if(this.openNode($,U),Y!==void 0)this.writeText(Y);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 @@ -2362,13 +2362,13 @@ flowchart TD 发布后核实版本状态,完成业务安全闭环。 `;var lh0=()=>{};var sh0=`--- name: seal-use -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." +description: "v0.10.31: 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.30 - short-description: Seal tenant and Hose approval automation (v0.10.30) + version: 0.10.31 + short-description: Seal tenant and Hose approval automation (v0.10.31) --- -# Seal Use (v0.10.30) +# Seal Use (v0.10.31) > CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (\`stdout\`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 \`stderr\`。 @@ -2549,7 +2549,7 @@ ${Jo.map(($)=>`### \`seal-use ${$.domain}\` `}var zo,Qo,Jo;var Io=o(()=>{zo=[{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"}],Qo=[{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 路径杜绝写文件与环境篡改。"}],Jo=[{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 gg1,constants as yg1,existsSync as i6,readdirSync as OS0,statSync as kg1}from"node:fs";import{homedir as xg1}from"node:os";import{join as j5}from"node:path";function FS0($){if(!i6($))return 0;try{return OS0($).filter((U)=>U.endsWith(".json")).length}catch{return 0}}function _T($){try{return gg1($,yg1.W_OK),!0}catch{return!1}}function wS0($){if(!i6($))return[];try{return OS0($).filter((U)=>U.endsWith(".json")&&!U.startsWith("example.")).map((U)=>j5($,U))}catch{return[]}}function fg1($){return $.filter((U)=>{try{return(kg1(U).mode&63)!==0}catch{return!1}})}function Ko(){let $=xg1(),U=j5($,".config","seal-use"),Y=j5(U,"enterprises"),z=j5(U,"config.json"),Q=j5(U,"seal_tokens.json"),J=j5(U,"mappings"),I=gz(),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:U,exists:i6(U),writable:i6(U)?_T(U):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:Y,exists:i6(Y),writable:i6(Y)?_T(Y):!1,fileCount:FS0(Y),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:z,exists:i6(z),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:Q,exists:i6(Q),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:J,exists:i6(J),fileCount:FS0(J),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:I,exists:i6(j5(I,"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,O=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:`${U} (正常读写)`});else if(W.configDir?.exists)w.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${U} (存在但可能不可写)`});else w.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${U},首次运行配置命令时将自动创建`});if(X.length>0)w.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${X.length} 家企业 (正式: ${O}, 测试: ${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:`已就绪于 ${I}`});else w.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${I} 检测到技能,可运行 'seal-use skill sync' 安装`});let M=[Q,z,_Z(),...wS0(Y),...wS0(j5(process.cwd(),"enterprises"))].filter((A,j,C)=>C.indexOf(A)===j&&i6(A)),N=fg1(M);w.push({id:"credential_permissions",title:"凭据文件权限",status:N.length===0?"ok":"warn",message:N.length===0?`已检查 ${M.length} 个凭据文件,均为仅属主可读 (0600)`:`${N.length} 个凭据文件权限宽于 0600(同机其他用户可读,取决于父目录权限),建议 chmod 600:${N.join("、")}`});let D=Z.lint??{enabled:!1,activeLinter:"builtin",minScore:0};if(D.enabled)w.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:`已开启 (校验器: ${D.activeLinter}, 最低门槛分: ${D.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:O,testCount:F,activeCorpId:V?.id,activeCorpName:V?.name},checks:w,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:zo.length,securityPoliciesCount:Qo.length,domainCapabilitiesCount:Jo.length,guideCommand:"seal-use doctor guide"}}}function MS0($){let U=[],Y=$.doctor==="ok"?"✨":"⚠️";U.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${Y}`),U.push("─────────────────────────────────────────────────────────────"),U.push("【运行环境】"),U.push(` 版本号: ${$.runtime.version}`),U.push(` 程序路径: ${$.runtime.executablePath}`),U.push(` 操作系统: ${$.runtime.platform}`),U.push(` 执行引擎: ${$.runtime.engine}`),U.push(""),U.push("【核心路径状态】");for(let[,Q]of Object.entries($.directories)){let J=Q.exists?"✓":"○",I=Q.exists?Q.fileCount!==void 0?`(${Q.fileCount} 个文件)`:Q.writable?"(就绪/可写)":"(存在)":"(未创建)";U.push(` ${J} ${Q.name.padEnd(16," ")}: ${Q.path} ${I}`)}if(U.push(""),U.push("【企业资产概览】"),U.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)U.push(` 当前激活企业: ${$.enterprises.activeCorpName} (${$.enterprises.activeCorpId})`);else U.push(" 当前激活企业: 无默认企业 (无状态模式)");U.push(""),U.push("【健康自检】");for(let Q of $.checks){let J=Q.status==="ok"?"✓":Q.status==="warn"?"⚠️":"✗";U.push(` ${J} [${Q.title}]: ${Q.message}`)}U.push(""),U.push("─────────────────────────────────────────────────────────────"),U.push("\uD83D\uDC49 查阅内嵌白皮书与目录规范: seal-use doctor guide"),U.push("\uD83D\uDC49 检索企业: seal-use corps search ");let z=$.checks.find((Q)=>Q.id==="rule_linter");if(z&&z.message.includes("未开启"))U.push("\uD83D\uDC49 开启规则自动质量校验: seal-use config lint enable");return U.join(` `)}var NS0=o(()=>{qp();t9();S3();Cq();bP();Io()});var DS0={};x8(DS0,{formatTenantDoctorDashboard:()=>bg1,diagnoseTenantContract:()=>ug1});async function ug1($,U){let Y=[],z=U.environment==="test"?"test":"production",Q=z==="test"?U.prodCorpId:U.testCorpId,J=z==="test"?"prodParent":"testTarget",I=Q?z==="test"?"已绑定生产母企业 (上游配置与样本源)":"已绑定测试靶场 (下游隔离演练环境)":void 0,K=null,G=null;try{let w=await W8($);if(K=w.user,G=w.tenant,Boolean(K?.isAdmin||K?.permissions?.includes("*")))Y.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${K.name??"未知"}」(${K.id??""}),具备完整操作权限`,details:{userId:K.id,userName:K.name,isAdmin:!0,permissionLevel:"超级管理员(具备完整操作权限)",tenantName:G?.name,tenantSlug:G?.tenantSlug,permissions:K.permissions}});else Y.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${K.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:K.id,userName:K.name,isAdmin:!1,permissionLevel:"普通用户(部分管理配置受限)",tenantName:G?.name,permissions:K.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(w){Y.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)},recommendation:`请执行 seal-use auth login --corp ${U.id} 重新登录或更新 Token`})}let H={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},W={used:0,remaining:0};try{let w=await cU($),M=Array.isArray(w.features)?w.features:[],N=M.find((B)=>B?.code==="ai-approval");if(N){let B=typeof N.balance==="number"?N.balance:0,T=typeof N.deductionAmount==="number"&&N.deductionAmount>0?N.deductionAmount:120,A=Math.floor(B/T);if(H.balance=B,H.deductionAmount=T,H.estimatedRuns=A,B<=0)H.status="exhausted",Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:B,deductionAmount:T,estimatedRuns:A},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(A<10)H.status="low",Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${B} 点 (单笔扣除 ${T} 点),仅可支持约 ${A} 笔审核`,details:{balance:B,deductionAmount:T,estimatedRuns:A},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else H.status="sufficient",Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${B} 点,预估可支持 ${A} 笔审核单据`,details:{balance:B,deductionAmount:T,estimatedRuns:A}})}else Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:M.map((B)=>B?.code)}});let D=M.find((B)=>B?.code==="approval-rules");if(D)W.used=typeof D.used==="number"?D.used:0,W.remaining=typeof D.remaining==="number"?D.remaining:0}catch(w){Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let X={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let w=await p6($),M=Array.isArray(w.rules)?w.rules:[];if(X.totalCount=M.length,X.activeCount=M.filter((N)=>N.status==="ACTIVE").length,M.length===0)Y.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:z==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else Y.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${X.totalCount} 条规则,其中生效活跃 ${X.activeCount} 条`,details:{totalCount:X.totalCount,activeCount:X.activeCount,quotaUsed:W.used,quotaRemaining:W.remaining}})}catch(w){Y.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let Z={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let w=await J$($);Z.integrationCount=w.length;let M=w.find((N)=>N.name.includes("回放")||N.name.toLowerCase().includes("replay"));if(Z.hasReplayChannel=Boolean(M),Z.activeWebhookId=M?.id??w[0]?.id,w.length===0)Y.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook add --name (回放通道) 手动注册专属通道"});else Y.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${w.length} 个通道${M?` (含专属回放通道「${M.name}」)`:""}`,details:{integrationCount:w.length,hasReplayChannel:Z.hasReplayChannel,activeWebhookId:Z.activeWebhookId}})}catch(w){Y.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:`检测 Webhook 通道失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}if(z==="test")if(Q)Y.push({id:"environment_binding",name:"测试环境配对契约",status:"pass",summary:`测试租户已绑定生产母企业「${Q}」,具备样本拉取与配置同步能力`,details:{environment:z,boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I}});else Y.push({id:"environment_binding",name:"测试环境配对契约",status:"warn",summary:"测试租户尚未绑定对应的生产母企业,无法直接拉取生产样本执行自动化回归",details:{environment:z},recommendation:`可运行 seal-use corps bind-test ${U.id} 建立 1 对 1 绑定`});else if(Q)Y.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"pass",summary:`生产企业已绑定沙箱测试靶场「${Q}」,回归测试将严格限制在靶场中运行`,details:{environment:z,boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I}});else Y.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"warn",summary:"生产企业尚未绑定任何测试企业,所有回归测试功能将触发安全拦截",details:{environment:z},recommendation:`可运行 seal-use corps bind-test ${U.id} 为该生产租户绑定测试靶场`});let q=Y.filter((w)=>w.status==="fail").length,V=Y.filter((w)=>w.status==="warn").length,F=Y.filter((w)=>w.status==="pass").length,O="HEALTHY";if(q>0)O="BLOCKED";else if(V>0)O="DEGRADED";return{ok:q===0,verdict:O,timestamp:new Date().toISOString(),corp:{id:U.id,name:U.name,environment:z,sourceType:U.source?.type??"native",boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I},summary:{totalChecks:Y.length,passedChecks:F,warningChecks:V,failedChecks:q},checks:Y,quota:H,rules:X,webhooks:Z}}function bg1($){let{corp:U,verdict:Y,summary:z,checks:Q,quota:J,rules:I,webhooks:K}=$,G=Y==="HEALTHY"?"\uD83D\uDFE2 健康良好 (HEALTHY)":Y==="DEGRADED"?"\uD83D\uDFE1 亚健康降级 (DEGRADED)":"\uD83D\uDD34 阻断受限 (BLOCKED)",H=["",`\uD83C\uDFE5 [Seal Use Doctor] 租户全链路契约体检: ${U.name} (${U.id})`,` 状态: ${G} · 环境: ${U.environment.toUpperCase()} · 耗时: 实时探针`," "+"─".repeat(60)];if(H.push(` AI 审批余量: ${J.balance} 点 (可审约 ${J.estimatedRuns} 笔) | 规则数: ${I.activeCount}/${I.totalCount} | Webhook 通道: ${K.integrationCount}`),U.boundCorpId)H.push(` 配对关系: ${U.environment==="test"?"来源生产母企业":"绑定的测试靶场"} -> 「${U.boundCorpId}」`);H.push(" "+"─".repeat(60));for(let W of Q){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(` 检查汇总: 通过 ${z.passedChecks} · 告警 ${z.warningChecks} · 失败 ${z.failedChecks}`),H.push(""),H.join(` `)}var AS0=o(()=>{X6()});async function PS0($,U,Y){let z=($??U??"").toLowerCase();if(z==="guide"||z==="doc"||z==="knowledge"||z==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)... -`),console.log(LS0());return}if(z==="paths"||z==="dirs"||z==="directories"){let I=Ko();c0(I.directories);return}if(z==="tenant"||z==="corp"||z==="enterprise"){let{selectCorp:I}=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(Y.options.corp)??(U&&U!==z?U:void 0)??(Y.command[2]&&Y.command[2]!==z?Y.command[2]:void 0),Z=I(X),q=await K(Z),V=await H(q,Z);if(!(V0(Y.options.quiet)||V0(Y.options.silent)))console.error(W(V));c0(V);return}let Q=Ko();if(!(V0(Y.options.quiet)||V0(Y.options.silent)))console.error(MS0(Q));c0(Q)}var BS0=o(()=>{NS0();Io();D4();J4()});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 +`),console.log(LS0());return}if(z==="paths"||z==="dirs"||z==="directories"){let I=Ko();c0(I.directories);return}if(z==="tenant"||z==="corp"||z==="enterprise"){let{selectCorp:I}=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(Y.options.corp)??(U&&U!==z?U:void 0)??(Y.command[2]&&Y.command[2]!==z?Y.command[2]:void 0),Z=I(X),q=await K(Z),V=await H(q,Z);if(!(V0(Y.options.quiet)||V0(Y.options.silent)))console.error(W(V));c0(V);return}let Q=Ko();if(!(V0(Y.options.quiet)||V0(Y.options.silent)))console.error(MS0(Q));c0(Q)}var BS0=o(()=>{NS0();Io();D4();J4()});var jS0;var TS0=o(()=>{jS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.31",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 3c69027..208595c 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.30", + "version": "0.10.31", "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 e83b0a4..35cc4e5 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.30 + version: 0.10.31 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 37af511..1620fd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.30", + "version": "0.10.31", "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 e538e5b..07b025d 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -1,12 +1,12 @@ --- name: seal-use -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." +description: "v0.10.31: 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.30 - short-description: Seal tenant and Hose approval automation (v0.10.30) + version: 0.10.31 + short-description: Seal tenant and Hose approval automation (v0.10.31) --- -# Seal Use (v0.10.30) +# Seal Use (v0.10.31) > CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (`stdout`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 `stderr`。