@povio/openapi-codegen-cli 0.13.8 → 0.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
`:""},this._extScope=t,this._scope=new nt.Scope({parent:t}),this._nodes=[new Dc]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Nc(t,s,n)),s}const(t,r,n){return this._def(nt.varKinds.const,t,r,n)}let(t,r,n){return this._def(nt.varKinds.let,t,r,n)}var(t,r,n){return this._def(nt.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new as(t,r,n))}add(t,r){return this._leafNode(new Cc(t,R.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==j.nil&&this._leafNode(new Mc(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,j.addCodeArg)(r,i));return r.push("}"),new j._Code(r)}if(t,r,n){if(this._blockNode(new Cr(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Cr(t))}else(){return this._elseNode(new En)}endIf(){return this._endBlockNode(Cr,En)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Lc(t),r)}forRange(t,r,n,i,s=this.opts.es5?nt.varKinds.var:nt.varKinds.let){let a=this._scope.toName(t);return this._for(new Fc(s,a,r,n),()=>i(a))}forOf(t,r,n,i=nt.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let a=r instanceof j.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,j._)`${a}.length`,c=>{this.var(s,(0,j._)`${a}[${c}]`),n(s)})}return this._for(new cs("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?nt.varKinds.var:nt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,j._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new cs("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(kr)}label(t){return this._leafNode(new kc(t))}break(t){return this._leafNode(new jc(t))}return(t){let r=new Ii;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ii)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Hc;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new Ti(s),r(s)}return n&&(this._currNode=i.finally=new Ri,this.code(n)),this._endBlockNode(Ti,Ri)}throw(t){return this._leafNode(new qc(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=j.nil,n,i){return this._blockNode(new wi(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(wi)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Cr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};o(pu,"CodeGen");var Vc=pu;R.CodeGen=Vc;function jr(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(jr,"addNames");function us(e,t){return t instanceof j._CodeOrName?jr(e,t.names):e}o(us,"addExprNames");function $n(e,t,r){if(e instanceof j.Name)return n(e);if(!i(e))return e;return new j._Code(e._items.reduce((s,a)=>(a instanceof j.Name&&(a=n(a)),a instanceof j._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||t[s.str]!==1?s:(delete t[s.str],a)}function i(s){return s instanceof j._Code&&s._items.some(a=>a instanceof j.Name&&t[a.str]===1&&r[a.str]!==void 0)}}o($n,"optimizeExpr");function JE(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(JE,"subtractNames");function Gd(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,j._)`!${Bc(e)}`}o(Gd,"not");R.not=Gd;var XE=Ud(R.operators.AND);function e2(...e){return e.reduce(XE)}o(e2,"and");R.and=e2;var t2=Ud(R.operators.OR);function r2(...e){return e.reduce(t2)}o(r2,"or");R.or=r2;function Ud(e){return(t,r)=>t===j.nil?r:r===j.nil?t:(0,j._)`${Bc(t)} ${e} ${Bc(r)}`}o(Ud,"mappend");function Bc(e){return e instanceof j.Name?e:(0,j._)`(${e})`}o(Bc,"par")});var k=h(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.checkStrictMode=C.getErrorPath=C.Type=C.useFunc=C.setEvaluated=C.evaluatedPropsToName=C.mergeEvaluated=C.eachItem=C.unescapeJsonPointer=C.escapeJsonPointer=C.escapeFragment=C.unescapeFragment=C.schemaRefOrVal=C.schemaHasRulesButRef=C.schemaHasRules=C.checkUnknownRules=C.alwaysValidSchema=C.toHash=void 0;var V=w(),n2=xi();function i2(e){let t={};for(let r of e)t[r]=!0;return t}o(i2,"toHash");C.toHash=i2;function o2(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Kd(e,t),!Qd(t,e.self.RULES.all))}o(o2,"alwaysValidSchema");C.alwaysValidSchema=o2;function Kd(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let s in t)i[s]||Jd(e,`unknown keyword: "${s}"`)}o(Kd,"checkUnknownRules");C.checkUnknownRules=Kd;function Qd(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(Qd,"schemaHasRules");C.schemaHasRules=Qd;function s2(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(s2,"schemaHasRulesButRef");C.schemaHasRulesButRef=s2;function a2({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,V._)`${r}`}return(0,V._)`${e}${t}${(0,V.getProperty)(n)}`}o(a2,"schemaRefOrVal");C.schemaRefOrVal=a2;function c2(e){return Wd(decodeURIComponent(e))}o(c2,"unescapeFragment");C.unescapeFragment=c2;function u2(e){return encodeURIComponent(du(e))}o(u2,"escapeFragment");C.escapeFragment=u2;function du(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}o(du,"escapeJsonPointer");C.escapeJsonPointer=du;function Wd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(Wd,"unescapeJsonPointer");C.unescapeJsonPointer=Wd;function l2(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(l2,"eachItem");C.eachItem=l2;function Zd({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,a,c)=>{let u=a===void 0?s:a instanceof V.Name?(s instanceof V.Name?e(i,s,a):t(i,s,a),a):s instanceof V.Name?(t(i,a,s),s):r(s,a);return c===V.Name&&!(u instanceof V.Name)?n(i,u):u}}o(Zd,"makeMergeEvaluated");C.mergeEvaluated={props:Zd({mergeNames:o((e,t,r)=>e.if((0,V._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,V._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,V._)`${r} || {}`).code((0,V._)`Object.assign(${r}, ${t})`))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,V._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,V._)`${r} || {}`),mu(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:{...e,...t},"mergeValues"),resultToName:Yd}),items:Zd({mergeNames:o((e,t,r)=>e.if((0,V._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,V._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,V._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,V._)`${r} > ${t} ? ${r} : ${t}`)),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};function Yd(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,V._)`{}`);return t!==void 0&&mu(e,r,t),r}o(Yd,"evaluatedPropsToName");C.evaluatedPropsToName=Yd;function mu(e,t,r){Object.keys(r).forEach(n=>e.assign((0,V._)`${t}${(0,V.getProperty)(n)}`,!0))}o(mu,"setEvaluated");C.setEvaluated=mu;var zd={};function p2(e,t){return e.scopeValue("func",{ref:t,code:zd[t.code]||(zd[t.code]=new n2._Code(t.code))})}o(p2,"useFunc");C.useFunc=p2;var fu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(fu||(C.Type=fu={}));function f2(e,t,r){if(e instanceof V.Name){let n=t===fu.Num;return r?n?(0,V._)`"[" + ${e} + "]"`:(0,V._)`"['" + ${e} + "']"`:n?(0,V._)`"/" + ${e}`:(0,V._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,V.getProperty)(e).toString():"/"+du(e)}o(f2,"getErrorPath");C.getErrorPath=f2;function Jd(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}o(Jd,"checkStrictMode");C.checkStrictMode=Jd});var Ue=h(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var me=w(),d2={data:new me.Name("data"),valCxt:new me.Name("valCxt"),instancePath:new me.Name("instancePath"),parentData:new me.Name("parentData"),parentDataProperty:new me.Name("parentDataProperty"),rootData:new me.Name("rootData"),dynamicAnchors:new me.Name("dynamicAnchors"),vErrors:new me.Name("vErrors"),errors:new me.Name("errors"),this:new me.Name("this"),self:new me.Name("self"),scope:new me.Name("scope"),json:new me.Name("json"),jsonPos:new me.Name("jsonPos"),jsonLen:new me.Name("jsonLen"),jsonPart:new me.Name("jsonPart")};hu.default=d2});var Ni=h(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.extendErrors=he.resetErrorsCount=he.reportExtraError=he.reportError=he.keyword$DataError=he.keywordError=void 0;var q=w(),ps=k(),Pe=Ue();he.keywordError={message:o(({keyword:e})=>(0,q.str)`must pass "${e}" keyword validation`,"message")};he.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,q.str)`"${e}" keyword must be ${t} ($data)`:(0,q.str)`"${e}" keyword is invalid ($data)`,"message")};function m2(e,t=he.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:a,allErrors:c}=i,u=tm(e,t,r);n??(a||c)?Xd(s,u):em(i,(0,q._)`[${u}]`)}o(m2,"reportError");he.reportError=m2;function h2(e,t=he.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:a}=n,c=tm(e,t,r);Xd(i,c),s||a||em(n,Pe.default.vErrors)}o(h2,"reportExtraError");he.reportExtraError=h2;function g2(e,t){e.assign(Pe.default.errors,t),e.if((0,q._)`${Pe.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,q._)`${Pe.default.vErrors}.length`,t),()=>e.assign(Pe.default.vErrors,null)))}o(g2,"resetErrorsCount");he.resetErrorsCount=g2;function y2({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",i,Pe.default.errors,c=>{e.const(a,(0,q._)`${Pe.default.vErrors}[${c}]`),e.if((0,q._)`${a}.instancePath === undefined`,()=>e.assign((0,q._)`${a}.instancePath`,(0,q.strConcat)(Pe.default.instancePath,s.errorPath))),e.assign((0,q._)`${a}.schemaPath`,(0,q.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,q._)`${a}.schema`,r),e.assign((0,q._)`${a}.data`,n))})}o(y2,"extendErrors");he.extendErrors=y2;function Xd(e,t){let r=e.const("err",t);e.if((0,q._)`${Pe.default.vErrors} === null`,()=>e.assign(Pe.default.vErrors,(0,q._)`[${r}]`),(0,q._)`${Pe.default.vErrors}.push(${r})`),e.code((0,q._)`${Pe.default.errors}++`)}o(Xd,"addError");function em(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,q._)`new ${e.ValidationError}(${t})`):(r.assign((0,q._)`${n}.errors`,t),r.return(!1))}o(em,"returnErrors");var qr={keyword:new q.Name("keyword"),schemaPath:new q.Name("schemaPath"),params:new q.Name("params"),propertyName:new q.Name("propertyName"),message:new q.Name("message"),schema:new q.Name("schema"),parentSchema:new q.Name("parentSchema")};function tm(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,q._)`{}`:v2(e,t,r)}o(tm,"errorObjectCode");function v2(e,t,r={}){let{gen:n,it:i}=e,s=[S2(i,r),b2(e,r)];return _2(e,t,s),n.object(...s)}o(v2,"errorObject");function S2({errorPath:e},{instancePath:t}){let r=t?(0,q.str)`${e}${(0,ps.getErrorPath)(t,ps.Type.Str)}`:e;return[Pe.default.instancePath,(0,q.strConcat)(Pe.default.instancePath,r)]}o(S2,"errorInstancePath");function b2({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,q.str)`${t}/${e}`;return r&&(i=(0,q.str)`${i}${(0,ps.getErrorPath)(r,ps.Type.Str)}`),[qr.schemaPath,i]}o(b2,"errorSchemaPath");function _2(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:a,it:c}=e,{opts:u,propertyName:l,topSchemaRef:f,schemaPath:p}=c;n.push([qr.keyword,i],[qr.params,typeof t=="function"?t(e):t||(0,q._)`{}`]),u.messages&&n.push([qr.message,typeof r=="function"?r(e):r]),u.verbose&&n.push([qr.schema,a],[qr.parentSchema,(0,q._)`${f}${p}`],[Pe.default.data,s]),l&&n.push([qr.propertyName,l])}o(_2,"extraErrorProps")});var nm=h(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.boolOrEmptySchema=On.topBoolOrEmptySchema=void 0;var P2=Ni(),E2=w(),$2=Ue(),O2={message:"boolean schema is false"};function x2(e){let{gen:t,schema:r,validateName:n}=e;r===!1?rm(e,!1):typeof r=="object"&&r.$async===!0?t.return($2.default.data):(t.assign((0,E2._)`${n}.errors`,null),t.return(!0))}o(x2,"topBoolOrEmptySchema");On.topBoolOrEmptySchema=x2;function A2(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),rm(e)):r.var(t,!0)}o(A2,"boolOrEmptySchema");On.boolOrEmptySchema=A2;function rm(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,P2.reportError)(i,O2,void 0,t)}o(rm,"falseSchemaError")});var gu=h(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.getRules=xn.isJSONType=void 0;var w2=["string","number","integer","boolean","null","object","array"],I2=new Set(w2);function T2(e){return typeof e=="string"&&I2.has(e)}o(T2,"isJSONType");xn.isJSONType=T2;function R2(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(R2,"getRules");xn.getRules=R2});var yu=h(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.shouldUseRule=Xt.shouldUseGroup=Xt.schemaHasRulesForType=void 0;function N2({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&im(e,n)}o(N2,"schemaHasRulesForType");Xt.schemaHasRulesForType=N2;function im(e,t){return t.rules.some(r=>om(e,r))}o(im,"shouldUseGroup");Xt.shouldUseGroup=im;function om(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(om,"shouldUseRule");Xt.shouldUseRule=om});var Ci=h(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.reportTypeError=ge.checkDataTypes=ge.checkDataType=ge.coerceAndCheckDataType=ge.getJSONTypes=ge.getSchemaTypes=ge.DataType=void 0;var C2=gu(),k2=yu(),j2=Ni(),I=w(),sm=k(),An;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(An||(ge.DataType=An={}));function q2(e){let t=am(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(q2,"getSchemaTypes");ge.getSchemaTypes=q2;function am(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(C2.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(am,"getJSONTypes");ge.getJSONTypes=am;function M2(e,t){let{gen:r,data:n,opts:i}=e,s=D2(t,i.coerceTypes),a=t.length>0&&!(s.length===0&&t.length===1&&(0,k2.schemaHasRulesForType)(e,t[0]));if(a){let c=Su(t,n,i.strictNumbers,An.Wrong);r.if(c,()=>{s.length?L2(e,t,s):bu(e)})}return a}o(M2,"coerceAndCheckDataType");ge.coerceAndCheckDataType=M2;var cm=new Set(["string","number","integer","boolean","null"]);function D2(e,t){return t?e.filter(r=>cm.has(r)||t==="array"&&r==="array"):[]}o(D2,"coerceToTypes");function L2(e,t,r){let{gen:n,data:i,opts:s}=e,a=n.let("dataType",(0,I._)`typeof ${i}`),c=n.let("coerced",(0,I._)`undefined`);s.coerceTypes==="array"&&n.if((0,I._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,I._)`${i}[0]`).assign(a,(0,I._)`typeof ${i}`).if(Su(t,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,I._)`${c} !== undefined`);for(let l of r)(cm.has(l)||l==="array"&&s.coerceTypes==="array")&&u(l);n.else(),bu(e),n.endIf(),n.if((0,I._)`${c} !== undefined`,()=>{n.assign(i,c),F2(e,c)});function u(l){switch(l){case"string":n.elseIf((0,I._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,I._)`"" + ${i}`).elseIf((0,I._)`${i} === null`).assign(c,(0,I._)`""`);return;case"number":n.elseIf((0,I._)`${a} == "boolean" || ${i} === null
|
|
7
7
|
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,I._)`+${i}`);return;case"integer":n.elseIf((0,I._)`${a} === "boolean" || ${i} === null
|
|
8
8
|
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,I._)`+${i}`);return;case"boolean":n.elseIf((0,I._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,I._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":n.elseIf((0,I._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(c,null);return;case"array":n.elseIf((0,I._)`${a} === "string" || ${a} === "number"
|
|
9
|
-
|| ${a} === "boolean" || ${i} === null`).assign(c,(0,I._)`[${i}]`)}}o(u,"coerceSpecificType")}o(L2,"coerceData");function F2({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,I._)`${t} !== undefined`,()=>e.assign((0,I._)`${t}[${r}]`,n))}o(F2,"assignParentData");function vu(e,t,r,n=An.Correct){let i=n===An.Correct?I.operators.EQ:I.operators.NEQ,s;switch(e){case"null":return(0,I._)`${t} ${i} null`;case"array":s=(0,I._)`Array.isArray(${t})`;break;case"object":s=(0,I._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a((0,I._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return(0,I._)`typeof ${t} ${i} ${e}`}return n===An.Correct?s:(0,I.not)(s);function a(c=I.nil){return(0,I.and)((0,I._)`typeof ${t} == "number"`,c,r?(0,I._)`isFinite(${t})`:I.nil)}}o(vu,"checkDataType");ge.checkDataType=vu;function Su(e,t,r,n){if(e.length===1)return vu(e[0],t,r,n);let i,s=(0,sm.toHash)(e);if(s.array&&s.object){let a=(0,I._)`typeof ${t} != "object"`;i=s.null?a:(0,I._)`!${t} || ${a}`,delete s.null,delete s.array,delete s.object}else i=I.nil;s.number&&delete s.integer;for(let a in s)i=(0,I.and)(i,vu(a,t,r,n));return i}o(Su,"checkDataTypes");ge.checkDataTypes=Su;var H2={message:o(({schema:e})=>`must be ${e}`,"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,I._)`{type: ${e}}`:(0,I._)`{type: ${t}}`,"params")};function bu(e){let t=V2(e);(0,j2.reportError)(t,H2)}o(bu,"reportTypeError");ge.reportTypeError=bu;function V2(e){let{gen:t,data:r,schema:n}=e,i=(0,sm.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(V2,"getTypeErrorContext")});var lm=h(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.assignDefaults=void 0;var wn=w(),B2=k();function G2(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)um(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>um(e,s,i.default))}o(G2,"assignDefaults");fs.assignDefaults=G2;function um(e,t,r){let{gen:n,compositeRule:i,data:s,opts:a}=e;if(r===void 0)return;let c=(0,wn._)`${s}${(0,wn.getProperty)(t)}`;if(i){(0,B2.checkStrictMode)(e,`default is ignored for: ${c}`);return}let u=(0,wn._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,wn._)`${u} || ${c} === null || ${c} === ""`),n.if(u,(0,wn._)`${c} = ${(0,wn.stringify)(r)}`)}o(um,"assignDefault")});var Ze=h(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.validateUnion=H.validateArray=H.usePattern=H.callValidateCode=H.schemaProperties=H.allSchemaProperties=H.noPropertyInData=H.propertyInData=H.isOwnProperty=H.hasPropFunc=H.reportMissingProp=H.checkMissingProp=H.checkReportMissingProp=void 0;var G=w(),_u=k(),er=Ue(),U2=k();function Z2(e,t){let{gen:r,data:n,it:i}=e;r.if(Eu(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,G._)`${t}`},!0),e.error()})}o(Z2,"checkReportMissingProp");H.checkReportMissingProp=Z2;function z2({gen:e,data:t,it:{opts:r}},n,i){return(0,G.or)(...n.map(s=>(0,G.and)(Eu(e,t,s,r.ownProperties),(0,G._)`${i} = ${s}`)))}o(z2,"checkMissingProp");H.checkMissingProp=z2;function K2(e,t){e.setParams({missingProperty:t},!0),e.error()}o(K2,"reportMissingProp");H.reportMissingProp=K2;function pm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,G._)`Object.prototype.hasOwnProperty`})}o(pm,"hasPropFunc");H.hasPropFunc=pm;function Pu(e,t,r){return(0,G._)`${pm(e)}.call(${t}, ${r})`}o(Pu,"isOwnProperty");H.isOwnProperty=Pu;function Q2(e,t,r,n){let i=(0,G._)`${t}${(0,G.getProperty)(r)} !== undefined`;return n?(0,G._)`${i} && ${Pu(e,t,r)}`:i}o(Q2,"propertyInData");H.propertyInData=Q2;function Eu(e,t,r,n){let i=(0,G._)`${t}${(0,G.getProperty)(r)} === undefined`;return n?(0,G.or)(i,(0,G.not)(Pu(e,t,r))):i}o(Eu,"noPropertyInData");H.noPropertyInData=Eu;function fm(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(fm,"allSchemaProperties");H.allSchemaProperties=fm;function W2(e,t){return fm(t).filter(r=>!(0,_u.alwaysValidSchema)(e,t[r]))}o(W2,"schemaProperties");H.schemaProperties=W2;function Y2({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},c,u,l){let f=l?(0,G._)`${e}, ${t}, ${n}${i}`:t,p=[[er.default.instancePath,(0,G.strConcat)(er.default.instancePath,s)],[er.default.parentData,a.parentData],[er.default.parentDataProperty,a.parentDataProperty],[er.default.rootData,er.default.rootData]];a.opts.dynamicRef&&p.push([er.default.dynamicAnchors,er.default.dynamicAnchors]);let d=(0,G._)`${f}, ${r.object(...p)}`;return u!==G.nil?(0,G._)`${c}.call(${u}, ${d})`:(0,G._)`${c}(${d})`}o(Y2,"callValidateCode");H.callValidateCode=Y2;var J2=(0,G._)`new RegExp`;function X2({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,G._)`${i.code==="new RegExp"?J2:(0,U2.useFunc)(e,i)}(${r}, ${n})`})}o(X2,"usePattern");H.usePattern=X2;function e$(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return a(()=>t.assign(c,!1)),c}return t.var(s,!0),a(()=>t.break()),s;function a(c){let u=t.const("len",(0,G._)`${r}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:_u.Type.Num},s),t.if((0,G.not)(s),c)})}o(a,"validateItems")}o(e$,"validateArray");H.validateArray=e$;function t$(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,_u.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((u,l)=>{let f=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},c);t.assign(a,(0,G._)`${a} || ${c}`),e.mergeValidEvaluated(f,c)||t.if((0,G.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}o(t$,"validateUnion");H.validateUnion=t$});var hm=h(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.validateKeywordUsage=yt.validSchemaType=yt.funcKeywordCode=yt.macroKeywordCode=void 0;var Ee=w(),Mr=Ue(),r$=Ze(),n$=Ni();function i$(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=mm(r,n,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let l=r.name("valid");e.subschema({schema:c,schemaPath:Ee.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}o(i$,"macroKeywordCode");yt.macroKeywordCode=i$;function o$(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:c,it:u}=e;a$(u,t);let l=!c&&t.compile?t.compile.call(u.self,s,a,u):t.validate,f=mm(n,i,l),p=n.let("valid");e.block$data(p,d),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function d(){if(t.errors===!1)y(),t.modifying&&dm(e),v(()=>e.error());else{let S=t.async?m():g();t.modifying&&dm(e),v(()=>s$(e,S))}}o(d,"validateKeyword");function m(){let S=n.let("ruleErrs",null);return n.try(()=>y((0,Ee._)`await `),b=>n.assign(p,!1).if((0,Ee._)`${b} instanceof ${u.ValidationError}`,()=>n.assign(S,(0,Ee._)`${b}.errors`),()=>n.throw(b))),S}o(m,"validateAsync");function g(){let S=(0,Ee._)`${f}.errors`;return n.assign(S,null),y(Ee.nil),S}o(g,"validateSync");function y(S=t.async?(0,Ee._)`await `:Ee.nil){let b=u.opts.passContext?Mr.default.this:Mr.default.self,P=!("compile"in t&&!c||t.schema===!1);n.assign(p,(0,Ee._)`${S}${(0,r$.callValidateCode)(e,f,b,P)}`,t.modifying)}o(y,"assignValid");function v(S){var b;n.if((0,Ee.not)((b=t.valid)!==null&&b!==void 0?b:p),S)}o(v,"reportErrs")}o(o$,"funcKeywordCode");yt.funcKeywordCode=o$;function dm(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ee._)`${n.parentData}[${n.parentDataProperty}]`))}o(dm,"modifyData");function s$(e,t){let{gen:r}=e;r.if((0,Ee._)`Array.isArray(${t})`,()=>{r.assign(Mr.default.vErrors,(0,Ee._)`${Mr.default.vErrors} === null ? ${t} : ${Mr.default.vErrors}.concat(${t})`).assign(Mr.default.errors,(0,Ee._)`${Mr.default.vErrors}.length`),(0,n$.extendErrors)(e)},()=>e.error())}o(s$,"addErrs");function a$({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(a$,"checkAsyncKeyword");function mm(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ee.stringify)(r)})}o(mm,"useKeyword");function c$(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(c$,"validSchemaType");yt.validSchemaType=c$;function u$({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a!=null&&a.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}o(u$,"validateKeywordUsage");yt.validateKeywordUsage=u$});var ym=h(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.extendSubschemaMode=tr.extendSubschemaData=tr.getSubschema=void 0;var vt=w(),gm=k();function l$(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,vt._)`${e.schemaPath}${(0,vt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:c[r],schemaPath:(0,vt._)`${e.schemaPath}${(0,vt.getProperty)(t)}${(0,vt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,gm.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(l$,"getSubschema");tr.getSubschema=l$;function p$(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:l,dataPathArr:f,opts:p}=t,d=c.let("data",(0,vt._)`${t.data}${(0,vt.getProperty)(r)}`,!0);u(d),e.errorPath=(0,vt.str)`${l}${(0,gm.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,vt._)`${r}`,e.dataPathArr=[...f,e.parentDataProperty]}if(i!==void 0){let l=i instanceof vt.Name?i:c.let("data",i,!0);u(l),a!==void 0&&(e.propertyName=a)}s&&(e.dataTypes=s);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}o(u,"dataContextProps")}o(p$,"extendSubschemaData");tr.extendSubschemaData=p$;function f$(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(f$,"extendSubschemaMode");tr.extendSubschemaMode=f$});var $u=h((bM,vm)=>{"use strict";vm.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},"equal")});var bm=h((PM,Sm)=>{"use strict";var rr=Sm.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};ds(t,n,i,e,"",e)};rr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};rr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};rr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};rr.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 ds(e,t,r,n,i,s,a,c,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,a,c,u,l);for(var f in n){var p=n[f];if(Array.isArray(p)){if(f in rr.arrayKeywords)for(var d=0;d<p.length;d++)ds(e,t,r,p[d],i+"/"+f+"/"+d,s,i,f,n,d)}else if(f in rr.propsKeywords){if(p&&typeof p=="object")for(var m in p)ds(e,t,r,p[m],i+"/"+f+"/"+d$(m),s,i,f,n,m)}else(f in rr.keywords||e.allKeys&&!(f in rr.skipKeywords))&&ds(e,t,r,p,i+"/"+f,s,i,f,n)}r(n,i,s,a,c,u,l)}}o(ds,"_traverse");function d$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(d$,"escapeJsonPtr")});var ki=h(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.getSchemaRefs=ke.resolveUrl=ke.normalizeId=ke._getFullPath=ke.getFullPath=ke.inlineRef=void 0;var m$=k(),h$=$u(),g$=bm(),y$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function v$(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Ou(e):t?_m(e)<=t:!1}o(v$,"inlineRef");ke.inlineRef=v$;var S$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ou(e){for(let t in e){if(S$.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Ou)||typeof r=="object"&&Ou(r))return!0}return!1}o(Ou,"hasRef");function _m(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!y$.has(r)&&(typeof e[r]=="object"&&(0,m$.eachItem)(e[r],n=>t+=_m(n)),t===1/0))return 1/0}return t}o(_m,"countKeys");function Pm(e,t="",r){r!==!1&&(t=In(t));let n=e.parse(t);return Em(e,n)}o(Pm,"getFullPath");ke.getFullPath=Pm;function Em(e,t){return e.serialize(t).split("#")[0]+"#"}o(Em,"_getFullPath");ke._getFullPath=Em;var b$=/#\/?$/;function In(e){return e?e.replace(b$,""):""}o(In,"normalizeId");ke.normalizeId=In;function _$(e,t,r){return r=In(r),e.resolve(t,r)}o(_$,"resolveUrl");ke.resolveUrl=_$;var P$=/^[a-z_][-a-z0-9._]*$/i;function E$(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=In(e[r]||t),s={"":i},a=Pm(n,i,!1),c={},u=new Set;return g$(e,{allKeys:!0},(p,d,m,g)=>{if(g===void 0)return;let y=a+d,v=s[g];typeof p[r]=="string"&&(v=S.call(this,p[r])),b.call(this,p.$anchor),b.call(this,p.$dynamicAnchor),s[d]=v;function S(P){let E=this.opts.uriResolver.resolve;if(P=In(v?E(v,P):P),u.has(P))throw f(P);u.add(P);let _=this.refs[P];return typeof _=="string"&&(_=this.refs[_]),typeof _=="object"?l(p,_.schema,P):P!==In(y)&&(P[0]==="#"?(l(p,c[P],P),c[P]=p):this.refs[P]=y),P}o(S,"addRef");function b(P){if(typeof P=="string"){if(!P$.test(P))throw new Error(`invalid anchor "${P}"`);S.call(this,`#${P}`)}}o(b,"addAnchor")}),c;function l(p,d,m){if(d!==void 0&&!h$(p,d))throw f(m)}o(l,"checkAmbiguosRef");function f(p){return new Error(`reference "${p}" resolves to more than one schema`)}o(f,"ambiguos")}o(E$,"getSchemaRefs");ke.getSchemaRefs=E$});var Mi=h(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.getData=nr.KeywordCxt=nr.validateFunctionCode=void 0;var wm=nm(),$m=Ci(),Au=yu(),ms=Ci(),$$=lm(),qi=hm(),xu=ym(),O=w(),A=Ue(),O$=ki(),Ht=k(),ji=Ni();function x$(e){if(Rm(e)&&(Nm(e),Tm(e))){I$(e);return}Im(e,()=>(0,wm.topBoolOrEmptySchema)(e))}o(x$,"validateFunctionCode");nr.validateFunctionCode=x$;function Im({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,O._)`${A.default.data}, ${A.default.valCxt}`,n.$async,()=>{e.code((0,O._)`"use strict"; ${Om(r,i)}`),w$(e,i),e.code(s)}):e.func(t,(0,O._)`${A.default.data}, ${A$(i)}`,n.$async,()=>e.code(Om(r,i)).code(s))}o(Im,"validateFunction");function A$(e){return(0,O._)`{${A.default.instancePath}="", ${A.default.parentData}, ${A.default.parentDataProperty}, ${A.default.rootData}=${A.default.data}${e.dynamicRef?(0,O._)`, ${A.default.dynamicAnchors}={}`:O.nil}}={}`}o(A$,"destructureValCxt");function w$(e,t){e.if(A.default.valCxt,()=>{e.var(A.default.instancePath,(0,O._)`${A.default.valCxt}.${A.default.instancePath}`),e.var(A.default.parentData,(0,O._)`${A.default.valCxt}.${A.default.parentData}`),e.var(A.default.parentDataProperty,(0,O._)`${A.default.valCxt}.${A.default.parentDataProperty}`),e.var(A.default.rootData,(0,O._)`${A.default.valCxt}.${A.default.rootData}`),t.dynamicRef&&e.var(A.default.dynamicAnchors,(0,O._)`${A.default.valCxt}.${A.default.dynamicAnchors}`)},()=>{e.var(A.default.instancePath,(0,O._)`""`),e.var(A.default.parentData,(0,O._)`undefined`),e.var(A.default.parentDataProperty,(0,O._)`undefined`),e.var(A.default.rootData,A.default.data),t.dynamicRef&&e.var(A.default.dynamicAnchors,(0,O._)`{}`)})}o(w$,"destructureValCxtES5");function I$(e){let{schema:t,opts:r,gen:n}=e;Im(e,()=>{r.$comment&&t.$comment&&km(e),k$(e),n.let(A.default.vErrors,null),n.let(A.default.errors,0),r.unevaluated&&T$(e),Cm(e),M$(e)})}o(I$,"topSchemaObjCode");function T$(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,O._)`${r}.evaluated`),t.if((0,O._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,O._)`${e.evaluated}.props`,(0,O._)`undefined`)),t.if((0,O._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,O._)`${e.evaluated}.items`,(0,O._)`undefined`))}o(T$,"resetEvaluated");function Om(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}o(Om,"funcSourceUrl");function R$(e,t){if(Rm(e)&&(Nm(e),Tm(e))){N$(e,t);return}(0,wm.boolOrEmptySchema)(e,t)}o(R$,"subschemaCode");function Tm({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(Tm,"schemaCxtHasRules");function Rm(e){return typeof e.schema!="boolean"}o(Rm,"isSchemaObj");function N$(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&km(e),j$(e),q$(e);let s=n.const("_errs",A.default.errors);Cm(e,s),n.var(t,(0,O._)`${s} === ${A.default.errors}`)}o(N$,"subSchemaObjCode");function Nm(e){(0,Ht.checkUnknownRules)(e),C$(e)}o(Nm,"checkKeywords");function Cm(e,t){if(e.opts.jtd)return xm(e,[],!1,t);let r=(0,$m.getSchemaTypes)(e.schema),n=(0,$m.coerceAndCheckDataType)(e,r);xm(e,r,!n,t)}o(Cm,"typeAndKeywords");function C$(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ht.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}o(C$,"checkRefsAndKeywords");function k$(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ht.checkStrictMode)(e,"default is ignored in the schema root")}o(k$,"checkNoDefault");function j$(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,O$.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(j$,"updateContext");function q$(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(q$,"checkAsyncSchema");function km({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,O._)`${A.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,O.str)`${n}/$comment`,c=e.scopeValue("root",{ref:t.root});e.code((0,O._)`${A.default.self}.opts.$comment(${s}, ${a}, ${c}.schema)`)}}o(km,"commentKeyword");function M$(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,O._)`${A.default.errors} === 0`,()=>t.return(A.default.data),()=>t.throw((0,O._)`new ${i}(${A.default.vErrors})`)):(t.assign((0,O._)`${n}.errors`,A.default.vErrors),s.unevaluated&&D$(e),t.return((0,O._)`${A.default.errors} === 0`))}o(M$,"returnResults");function D$({gen:e,evaluated:t,props:r,items:n}){r instanceof O.Name&&e.assign((0,O._)`${t}.props`,r),n instanceof O.Name&&e.assign((0,O._)`${t}.items`,n)}o(D$,"assignEvaluated");function xm(e,t,r,n){let{gen:i,schema:s,data:a,allErrors:c,opts:u,self:l}=e,{RULES:f}=l;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,Ht.schemaHasRulesButRef)(s,f))){i.block(()=>qm(e,"$ref",f.all.$ref.definition));return}u.jtd||L$(e,t),i.block(()=>{for(let d of f.rules)p(d);p(f.post)});function p(d){(0,Au.shouldUseGroup)(s,d)&&(d.type?(i.if((0,ms.checkDataType)(d.type,a,u.strictNumbers)),Am(e,d),t.length===1&&t[0]===d.type&&r&&(i.else(),(0,ms.reportTypeError)(e)),i.endIf()):Am(e,d),c||i.if((0,O._)`${A.default.errors} === ${n||0}`))}o(p,"groupKeywords")}o(xm,"schemaKeywords");function Am(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,$$.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,Au.shouldUseRule)(n,s)&&qm(e,s.keyword,s.definition,t.type)})}o(Am,"iterateKeywords");function L$(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(F$(e,t),e.opts.allowUnionTypes||H$(e,t),V$(e,e.dataTypes))}o(L$,"checkStrictTypes");function F$(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{jm(e.dataTypes,r)||wu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),G$(e,t)}}o(F$,"checkContextTypes");function H$(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&wu(e,"use allowUnionTypes to allow union type keyword")}o(H$,"checkMultipleTypes");function V$(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Au.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>B$(t,a))&&wu(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}o(V$,"checkKeywordTypes");function B$(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(B$,"hasApplicableType");function jm(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(jm,"includesType");function G$(e,t){let r=[];for(let n of e.dataTypes)jm(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(G$,"narrowSchemaTypes");function wu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ht.checkStrictMode)(e,t,e.opts.strictTypes)}o(wu,"strictTypesError");var Iu=class Iu{constructor(t,r,n){if((0,qi.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ht.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Mm(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,qi.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",A.default.errors))}result(t,r,n){this.failResult((0,O.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,O.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ji.reportExtraError:ji.reportError)(this,this.def.error,r)}$dataError(){(0,ji.reportError)(this,this.def.$dataError||ji.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ji.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=O.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,O.or)((0,O._)`${i} === undefined`,r)),t!==O.nil&&n.assign(t,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==O.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,O.or)(a(),c());function a(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,O._)`${(0,ms.checkDataTypes)(u,r,s.opts.strictNumbers,ms.DataType.Wrong)}`}return O.nil}function c(){if(i.validateSchema){let u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,O._)`!${u}(${r})`}return O.nil}}subschema(t,r){let n=(0,xu.getSubschema)(this.it,t);(0,xu.extendSubschemaData)(n,this.it,t),(0,xu.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return R$(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ht.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ht.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,O.Name)),!0}};o(Iu,"KeywordCxt");var hs=Iu;nr.KeywordCxt=hs;function qm(e,t,r,n){let i=new hs(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,qi.funcKeywordCode)(i,r):"macro"in r?(0,qi.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,qi.funcKeywordCode)(i,r)}o(qm,"keywordCode");var U$=/^\/(?:[^~]|~0|~1)*$/,Z$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Mm(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return A.default.rootData;if(e[0]==="/"){if(!U$.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=A.default.rootData}else{let l=Z$.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let f=+l[1];if(i=l[2],i==="#"){if(f>=t)throw new Error(u("property/index",f));return n[t-f]}if(f>t)throw new Error(u("data",f));if(s=r[t-f],!i)return s}let a=s,c=i.split("/");for(let l of c)l&&(s=(0,O._)`${s}${(0,O.getProperty)((0,Ht.unescapeJsonPointer)(l))}`,a=(0,O._)`${a} && ${s}`);return a;function u(l,f){return`Cannot access ${l} ${f} levels up, current level is ${t}`}}o(Mm,"getData");nr.getData=Mm});var gs=h(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});var Nu=class Nu extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(Nu,"ValidationError");var Tu=Nu;Ru.default=Tu});var Di=h(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});var Cu=ki(),qu=class qu extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Cu.resolveUrl)(t,r,n),this.missingSchema=(0,Cu.normalizeId)((0,Cu.getFullPath)(t,this.missingRef))}};o(qu,"MissingRefError");var ku=qu;ju.default=ku});var Li=h(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.resolveSchema=ze.getCompilingSchema=ze.resolveRef=ze.compileSchema=ze.SchemaEnv=void 0;var it=w(),z$=gs(),Dr=Ue(),ot=ki(),Dm=k(),K$=Mi(),Lu=class Lu{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ot.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(Lu,"SchemaEnv");var Tn=Lu;ze.SchemaEnv=Tn;function Du(e){let t=Lm.call(this,e);if(t)return t;let r=(0,ot.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new it.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;e.$async&&(c=a.scopeValue("Error",{ref:z$.default,code:(0,it._)`require("ajv/dist/runtime/validation_error").default`}));let u=a.scopeName("validate");e.validateName=u;let l={gen:a,allErrors:this.opts.allErrors,data:Dr.default.data,parentData:Dr.default.parentData,parentDataProperty:Dr.default.parentDataProperty,dataNames:[Dr.default.data],dataPathArr:[it.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,it.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:it.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,it._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(e),(0,K$.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let p=a.toString();f=`${a.scopeRefs(Dr.default.scope)}return ${p}`,this.opts.code.process&&(f=this.opts.code.process(f,e));let m=new Function(`${Dr.default.self}`,`${Dr.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:u,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:g,items:y}=l;m.evaluated={props:g instanceof it.Name?void 0:g,items:y instanceof it.Name?void 0:y,dynamicProps:g instanceof it.Name,dynamicItems:y instanceof it.Name},m.source&&(m.source.evaluated=(0,it.stringify)(m.evaluated))}return e.validate=m,e}catch(p){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),p}finally{this._compilations.delete(e)}}o(Du,"compileSchema");ze.compileSchema=Du;function Q$(e,t,r){var n;r=(0,ot.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=J$.call(this,e,r);if(s===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;a&&(s=new Tn({schema:a,schemaId:c,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=W$.call(this,s)}o(Q$,"resolveRef");ze.resolveRef=Q$;function W$(e){return(0,ot.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Du.call(this,e)}o(W$,"inlineOrCompile");function Lm(e){for(let t of this._compilations)if(Y$(t,e))return t}o(Lm,"getCompilingSchema");ze.getCompilingSchema=Lm;function Y$(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(Y$,"sameSchemaEnv");function J$(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||ys.call(this,e,t)}o(J$,"resolve");function ys(e,t){let r=this.opts.uriResolver.parse(t),n=(0,ot._getFullPath)(this.opts.uriResolver,r),i=(0,ot.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Mu.call(this,r,e);let s=(0,ot.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let c=ys.call(this,e,a);return typeof(c==null?void 0:c.schema)!="object"?void 0:Mu.call(this,r,c)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Du.call(this,a),s===(0,ot.normalizeId)(t)){let{schema:c}=a,{schemaId:u}=this.opts,l=c[u];return l&&(i=(0,ot.resolveUrl)(this.opts.uriResolver,i,l)),new Tn({schema:c,schemaId:u,root:e,baseId:i})}return Mu.call(this,r,a)}}o(ys,"resolveSchema");ze.resolveSchema=ys;var X$=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Mu(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,Dm.unescapeFragment)(c)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];!X$.has(c)&&l&&(t=(0,ot.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Dm.schemaHasRulesButRef)(r,this.RULES)){let c=(0,ot.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=ys.call(this,n,c)}let{schemaId:a}=this.opts;if(s=s||new Tn({schema:r,schemaId:a,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(Mu,"getJsonPointer")});var Fm=h((kM,e1)=>{e1.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}});var Vm=h((jM,Hm)=>{"use strict";var t1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Hm.exports={HEX:t1}});var Wm=h((qM,Qm)=>{"use strict";var{HEX:r1}=Vm();function Zm(e){if(Km(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[r]=t;return r?{host:i1(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(Zm,"normalizeIPv4");function Fu(e,t=!1){let r="",n=!0;for(let i of e){if(r1[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(Fu,"stringArrayToHexStripped");function n1(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,c=!1;function u(){if(i.length){if(s===!1){let l=Fu(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}o(u,"consume");for(let l=0;l<e.length;l++){let f=e[l];if(!(f==="["||f==="]"))if(f===":"){if(a===!0&&(c=!0),!u())break;if(t++,n.push(":"),t>7){r.error=!0;break}l-1>=0&&e[l-1]===":"&&(a=!0);continue}else if(f==="%"){if(!u())break;s=!0}else{i.push(f);continue}}return i.length&&(s?r.zone=i.join(""):c?n.push(i.join("")):n.push(Fu(i))),r.address=n.join(""),r}o(n1,"getIPV6");function zm(e,t={}){if(Km(e,":")<2)return{host:e,isIPV6:!1};let r=n1(e);if(r.error)return{host:e,isIPV6:!1};{let n=r.address,i=r.address;return r.zone&&(n+="%"+r.zone,i+="%25"+r.zone),{host:n,escapedHost:i,isIPV6:!0}}}o(zm,"normalizeIPv6");function i1(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let a=e[s];a==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=a,n=!1):(a===t?n=!0:n=!1,r+=a)}return r}o(i1,"stripLeadingZeros");function Km(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o(Km,"findToken");var Bm=/^\.\.?\//u,Gm=/^\/\.(?:\/|$)/u,Um=/^\/\.\.(?:\/|$)/u,o1=/^\/?(?:.|\n)*?(?=\/|$)/u;function s1(e){let t=[];for(;e.length;)if(e.match(Bm))e=e.replace(Bm,"");else if(e.match(Gm))e=e.replace(Gm,"/");else if(e.match(Um))e=e.replace(Um,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(o1);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(s1,"removeDotSegments");function a1(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(a1,"normalizeComponentEncoding");function c1(e,t){let r=[];if(e.userinfo!==void 0&&(r.push(e.userinfo),r.push("@")),e.host!==void 0){let n=unescape(e.host),i=Zm(n);if(i.isIPV4)n=i.host;else{let s=zm(i.host,{isIPV4:!1});s.isIPV6===!0?n=`[${s.escapedHost}]`:n=e.host}r.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}o(c1,"recomposeAuthority");Qm.exports={recomposeAuthority:c1,normalizeComponentEncoding:a1,removeDotSegments:s1,normalizeIPv4:Zm,normalizeIPv6:zm,stringArrayToHexStripped:Fu}});var rh=h((DM,th)=>{"use strict";var u1=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,l1=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function Ym(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o(Ym,"isSecure");function Jm(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(Jm,"httpParse");function Xm(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(Xm,"httpSerialize");function p1(e){return e.secure=Ym(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(p1,"wsParse");function f1(e){if((e.port===(Ym(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(f1,"wsSerialize");function d1(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(l1);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=Hu[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(d1,"urnParse");function m1(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=Hu[i];s&&(e=s.serialize(e,t));let a=e,c=e.nss;return a.path=`${n||t.nid}:${c}`,t.skipEscape=!0,a}o(m1,"urnSerialize");function h1(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!u1.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(h1,"urnuuidParse");function g1(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(g1,"urnuuidSerialize");var eh={scheme:"http",domainHost:!0,parse:Jm,serialize:Xm},y1={scheme:"https",domainHost:eh.domainHost,parse:Jm,serialize:Xm},vs={scheme:"ws",domainHost:!0,parse:p1,serialize:f1},v1={scheme:"wss",domainHost:vs.domainHost,parse:vs.parse,serialize:vs.serialize},S1={scheme:"urn",parse:d1,serialize:m1,skipNormalize:!0},b1={scheme:"urn:uuid",parse:h1,serialize:g1,skipNormalize:!0},Hu={http:eh,https:y1,ws:vs,wss:v1,urn:S1,"urn:uuid":b1};th.exports=Hu});var ih=h((FM,bs)=>{"use strict";var{normalizeIPv6:_1,normalizeIPv4:P1,removeDotSegments:Fi,recomposeAuthority:E1,normalizeComponentEncoding:Ss}=Wm(),Vu=rh();function $1(e,t){return typeof e=="string"?e=St(Vt(e,t),t):typeof e=="object"&&(e=Vt(St(e,t),t)),e}o($1,"normalize");function O1(e,t,r){let n=Object.assign({scheme:"null"},r),i=nh(Vt(e,n),Vt(t,n),n,!0);return St(i,{...n,skipEscape:!0})}o(O1,"resolve");function nh(e,t,r,n){let i={};return n||(e=Vt(St(e,r),r),t=Vt(St(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fi(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fi(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=Fi(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Fi(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(nh,"resolveComponents");function x1(e,t,r){return typeof e=="string"?(e=unescape(e),e=St(Ss(Vt(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=St(Ss(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=St(Ss(Vt(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=St(Ss(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}o(x1,"equal");function St(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=Vu[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&(i.push(r.scheme),i.push(":"));let a=E1(r,n);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=Fi(c)),a===void 0&&(c=c.replace(/^\/\//u,"/%2F")),i.push(c)}return r.query!==void 0&&(i.push("?"),i.push(r.query)),r.fragment!==void 0&&(i.push("#"),i.push(r.fragment)),i.join("")}o(St,"serialize");var A1=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function w1(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||A1[t])return!0;return!1}o(w1,"nonSimpleDomain");var I1=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Vt(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let a=e.match(I1);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host){let u=P1(n.host);if(u.isIPV4===!1){let l=_1(u.host,{isIPV4:!1});n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=u.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&!n.path&&n.query===void 0?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Vu[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&w1(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!c||c&&!c.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.userinfo!==void 0&&(n.userinfo=unescape(n.userinfo)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path!==void 0&&n.path.length&&(n.path=escape(unescape(n.path))),n.fragment!==void 0&&n.fragment.length&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(Vt,"parse");var Bu={SCHEMES:Vu,normalize:$1,resolve:O1,resolveComponents:nh,equal:x1,serialize:St,parse:Vt};bs.exports=Bu;bs.exports.default=Bu;bs.exports.fastUri=Bu});var sh=h(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});var oh=ih();oh.code='require("ajv/dist/runtime/uri").default';Gu.default=oh});var Nn=h(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.CodeGen=ce.Name=ce.nil=ce.stringify=ce.str=ce._=ce.KeywordCxt=void 0;var T1=Mi();Object.defineProperty(ce,"KeywordCxt",{enumerable:!0,get:o(function(){return T1.KeywordCxt},"get")});var Rn=w();Object.defineProperty(ce,"_",{enumerable:!0,get:o(function(){return Rn._},"get")});Object.defineProperty(ce,"str",{enumerable:!0,get:o(function(){return Rn.str},"get")});Object.defineProperty(ce,"stringify",{enumerable:!0,get:o(function(){return Rn.stringify},"get")});Object.defineProperty(ce,"nil",{enumerable:!0,get:o(function(){return Rn.nil},"get")});Object.defineProperty(ce,"Name",{enumerable:!0,get:o(function(){return Rn.Name},"get")});Object.defineProperty(ce,"CodeGen",{enumerable:!0,get:o(function(){return Rn.CodeGen},"get")});var R1=gs(),ph=Di(),N1=gu(),Hi=Li(),C1=w(),Vi=ki(),_s=Ci(),Zu=k(),ah=Fm(),k1=sh(),fh=o((e,t)=>new RegExp(e,t),"defaultRegExp");fh.code="new RegExp";var j1=["removeAdditional","useDefaults","coerceTypes"],q1=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),M1={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."},D1={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ch=200;function L1(e){var t,r,n,i,s,a,c,u,l,f,p,d,m,g,y,v,S,b,P,E,_,T,N,Re,re;let F=e.strict,J=(t=e.code)===null||t===void 0?void 0:t.optimize,_e=J===!0||J===void 0?1:J||0,gn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:fh,yn=(i=e.uriResolver)!==null&&i!==void 0?i:k1.default;return{strictSchema:(a=(s=e.strictSchema)!==null&&s!==void 0?s:F)!==null&&a!==void 0?a:!0,strictNumbers:(u=(c=e.strictNumbers)!==null&&c!==void 0?c:F)!==null&&u!==void 0?u:!0,strictTypes:(f=(l=e.strictTypes)!==null&&l!==void 0?l:F)!==null&&f!==void 0?f:"log",strictTuples:(d=(p=e.strictTuples)!==null&&p!==void 0?p:F)!==null&&d!==void 0?d:"log",strictRequired:(g=(m=e.strictRequired)!==null&&m!==void 0?m:F)!==null&&g!==void 0?g:!1,code:e.code?{...e.code,optimize:_e,regExp:gn}:{optimize:_e,regExp:gn},loopRequired:(y=e.loopRequired)!==null&&y!==void 0?y:ch,loopEnum:(v=e.loopEnum)!==null&&v!==void 0?v:ch,meta:(S=e.meta)!==null&&S!==void 0?S:!0,messages:(b=e.messages)!==null&&b!==void 0?b:!0,inlineRefs:(P=e.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(_=e.addUsedSchema)!==null&&_!==void 0?_:!0,validateSchema:(T=e.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(N=e.validateFormats)!==null&&N!==void 0?N:!0,unicodeRegExp:(Re=e.unicodeRegExp)!==null&&Re!==void 0?Re:!0,int32range:(re=e.int32range)!==null&&re!==void 0?re:!0,uriResolver:yn}}o(L1,"requiredOptions");var zu=class zu{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...L1(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new C1.ValueScope({scope:{},prefixes:q1,es5:r,lines:n}),this.logger=U1(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,N1.getRules)(),uh.call(this,M1,t,"NOT SUPPORTED"),uh.call(this,D1,t,"DEPRECATED","warn"),this._metaOpts=B1.call(this),t.formats&&H1.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&V1.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),F1.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=ah;n==="id"&&(i={...ah},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(f,p){await s.call(this,f.$schema);let d=this._addSchema(f,p);return d.validate||a.call(this,d)}async function s(f){f&&!this.getSchema(f)&&await i.call(this,{$ref:f},!0)}async function a(f){try{return this._compileSchemaEnv(f)}catch(p){if(!(p instanceof ph.default))throw p;return c.call(this,p),await u.call(this,p.missingSchema),a.call(this,f)}}function c({missingSchema:f,missingRef:p}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${p} cannot be resolved`)}async function u(f){let p=await l.call(this,f);this.refs[f]||await s.call(this,p.$schema),this.refs[f]||this.addSchema(p,f,r)}async function l(f){let p=this._loading[f];if(p)return p;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:a}=this.opts;if(s=t[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Vi.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=lh.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Hi.SchemaEnv({schema:{},schemaId:n});if(r=Hi.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=lh.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Vi.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(z1.call(this,n,r),!r)return(0,Zu.eachItem)(n,s=>Uu.call(this,s)),this;Q1.call(this,r);let i={...r,type:(0,_s.getJSONTypes)(r.type),schemaType:(0,_s.getJSONTypes)(r.schemaType)};return(0,Zu.eachItem)(n,i.type.length===0?s=>Uu.call(this,s,i):s=>i.type.forEach(a=>Uu.call(this,s,i,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),a=t;for(let c of s)a=a[c];for(let c in n){let u=n[c];if(typeof u!="object")continue;let{$data:l}=u.definition,f=a[c];l&&f&&(a[c]=dh(f))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof t=="object")a=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,Vi.normalizeId)(a||n);let l=Vi.getSchemaRefs.call(this,t,n);return u=new Hi.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),i&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Hi.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Hi.compileSchema.call(this,t)}finally{this.opts=r}}};o(zu,"Ajv");var Bi=zu;Bi.ValidationError=R1.default;Bi.MissingRefError=ph.default;ce.default=Bi;function uh(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n](`${r}: option ${i}. ${e[s]}`)}}o(uh,"checkOptions");function lh(e){return e=(0,Vi.normalizeId)(e),this.schemas[e]||this.refs[e]}o(lh,"getSchEnv");function F1(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(F1,"addInitialSchemas");function H1(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(H1,"addInitialFormats");function V1(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(V1,"addInitialKeywords");function B1(){let e={...this.opts};for(let t of j1)delete e[t];return e}o(B1,"getMetaSchemaOptions");var G1={log(){},warn(){},error(){}};function U1(e){if(e===!1)return G1;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(U1,"getLogger");var Z1=/^[a-z_$][a-z0-9_$:-]*$/i;function z1(e,t){let{RULES:r}=this;if((0,Zu.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Z1.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(z1,"checkKeyword");function Uu(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:u})=>u===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[e]=!0,!t)return;let c={keyword:e,definition:{...t,type:(0,_s.getJSONTypes)(t.type),schemaType:(0,_s.getJSONTypes)(t.schemaType)}};t.before?K1.call(this,a,c,t.before):a.rules.push(c),s.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}o(Uu,"addRule");function K1(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}o(K1,"addBeforeRule");function Q1(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=dh(t)),e.validateSchema=this.compile(t,!0))}o(Q1,"keywordMetaschema");var W1={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dh(e){return{anyOf:[e,W1]}}o(dh,"schemaOrData")});var Gi=h(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.callRef=Lr.getValidate=void 0;var Y1=Di(),mh=Ze(),je=w(),Cn=Ue(),hh=Li(),Ps=k(),J1={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:a,opts:c,self:u}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return p();let f=hh.resolveRef.call(u,l,i,r);if(f===void 0)throw new Y1.default(n.opts.uriResolver,i,r);if(f instanceof hh.SchemaEnv)return d(f);return m(f);function p(){if(s===l)return Es(e,a,s,s.$async);let g=t.scopeValue("root",{ref:l});return Es(e,(0,je._)`${g}.validate`,l,l.$async)}function d(g){let y=gh(e,g);Es(e,y,g,g.$async)}function m(g){let y=t.scopeValue("schema",c.code.source===!0?{ref:g,code:(0,je.stringify)(g)}:{ref:g}),v=t.name("valid"),S=e.subschema({schema:g,dataTypes:[],schemaPath:je.nil,topSchemaRef:y,errSchemaPath:r},v);e.mergeEvaluated(S),e.ok(v)}}};function gh(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,je._)`${r.scopeValue("wrapper",{ref:t})}.validate`}o(gh,"getValidate");Lr.getValidate=gh;function Es(e,t,r,n){let{gen:i,it:s}=e,{allErrors:a,schemaEnv:c,opts:u}=s,l=u.passContext?Cn.default.this:je.nil;n?f():p();function f(){if(!c.$async)throw new Error("async schema referenced by sync schema");let g=i.let("valid");i.try(()=>{i.code((0,je._)`await ${(0,mh.callValidateCode)(e,t,l)}`),m(t),a||i.assign(g,!0)},y=>{i.if((0,je._)`!(${y} instanceof ${s.ValidationError})`,()=>i.throw(y)),d(y),a||i.assign(g,!1)}),e.ok(g)}o(f,"callAsyncRef");function p(){e.result((0,mh.callValidateCode)(e,t,l),()=>m(t),()=>d(t))}o(p,"callSyncRef");function d(g){let y=(0,je._)`${g}.errors`;i.assign(Cn.default.vErrors,(0,je._)`${Cn.default.vErrors} === null ? ${y} : ${Cn.default.vErrors}.concat(${y})`),i.assign(Cn.default.errors,(0,je._)`${Cn.default.vErrors}.length`)}o(d,"addErrorsFrom");function m(g){var y;if(!s.opts.unevaluated)return;let v=(y=r==null?void 0:r.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=Ps.mergeEvaluated.props(i,v.props,s.props));else{let S=i.var("props",(0,je._)`${g}.evaluated.props`);s.props=Ps.mergeEvaluated.props(i,S,s.props,je.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=Ps.mergeEvaluated.items(i,v.items,s.items));else{let S=i.var("items",(0,je._)`${g}.evaluated.items`);s.items=Ps.mergeEvaluated.items(i,S,s.items,je.Name)}}o(m,"addEvaluatedFrom")}o(Es,"callRef");Lr.callRef=Es;Lr.default=J1});var yh=h(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});var X1=Gi(),eO=["$schema","id","$defs",{keyword:"$comment"},"definitions",X1.default];Ku.default=eO});var vh=h(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});var Qu=Nn(),tO=w(),ir=tO.operators,Wu={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:ir.LTE,fail:ir.GT},{okStr:"<",ok:ir.LT,fail:ir.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:ir.GTE,fail:ir.LT},{okStr:">",ok:ir.GT,fail:ir.LTE}]}},rO={message:o(e=>Qu.str`must be ${Yu(e).okStr} ${e.schemaCode}`,"message"),params:o(e=>Qu._`{comparison: ${Yu(e).okStr}, limit: ${e.schemaCode}}`,"params")},nO={keyword:Object.keys(Wu),type:"number",schemaType:"number",$data:!0,error:rO,code(e){let{data:t,schemaCode:r}=e;e.fail$data(Qu._`${t} ${Yu(e).fail} ${r} || isNaN(${t})`)}};function Yu(e){var t;let r=e.keyword,n=!((t=e.parentSchema)===null||t===void 0)&&t[Wu[r].exclusive]?1:0;return Wu[r].ops[n]}o(Yu,"kwdOp");Ju.default=nO});var bh=h(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});var Sh={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},iO={keyword:Object.keys(Sh),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){let r=Sh[e];if(t[r]===void 0)throw new Error(`${e} can only be used with ${r}`)}};Xu.default=iO});var tl=h(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});var Ui=w(),oO={message:o(({schemaCode:e})=>(0,Ui.str)`must be multiple of ${e}`,"message"),params:o(({schemaCode:e})=>(0,Ui._)`{multipleOf: ${e}}`,"params")},sO={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:oO,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?(0,Ui._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Ui._)`${a} !== parseInt(${a})`;e.fail$data((0,Ui._)`(${n} === 0 || (${a} = ${r}/${n}, ${c}))`)}};el.default=sO});var Ph=h(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});function _h(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(_h,"ucs2length");rl.default=_h;_h.code='require("ajv/dist/runtime/ucs2length").default'});var il=h(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});var Fr=w(),aO=k(),cO=Ph(),uO={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Fr.str)`must NOT have ${r} than ${t} characters`},params:o(({schemaCode:e})=>(0,Fr._)`{limit: ${e}}`,"params")},lO={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:uO,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?Fr.operators.GT:Fr.operators.LT,a=i.opts.unicode===!1?(0,Fr._)`${r}.length`:(0,Fr._)`${(0,aO.useFunc)(e.gen,cO.default)}(${r})`;e.fail$data((0,Fr._)`${a} ${s} ${n}`)}};nl.default=lO});var sl=h(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});var pO=Ze(),$s=w(),fO={message:o(({schemaCode:e})=>(0,$s.str)`must match pattern "${e}"`,"message"),params:o(({schemaCode:e})=>(0,$s._)`{pattern: ${e}}`,"params")},dO={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:fO,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"",c=r?(0,$s._)`(new RegExp(${i}, ${a}))`:(0,pO.usePattern)(e,n);e.fail$data((0,$s._)`!${c}.test(${t})`)}};ol.default=dO});var cl=h(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});var Zi=w(),mO={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Zi.str)`must NOT have ${r} than ${t} properties`},params:o(({schemaCode:e})=>(0,Zi._)`{limit: ${e}}`,"params")},hO={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:mO,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Zi.operators.GT:Zi.operators.LT;e.fail$data((0,Zi._)`Object.keys(${r}).length ${i} ${n}`)}};al.default=hO});var ll=h(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var zi=Ze(),Ki=w(),gO=k(),yO={message:o(({params:{missingProperty:e}})=>(0,Ki.str)`must have required property '${e}'`,"message"),params:o(({params:{missingProperty:e}})=>(0,Ki._)`{missingProperty: ${e}}`,"params")},vO={keyword:"required",type:"object",schemaType:"array",$data:!0,error:yO,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:a}=e,{opts:c}=a;if(!s&&r.length===0)return;let u=r.length>=c.loopRequired;if(a.allErrors?l():f(),c.strictRequired){let m=e.parentSchema.properties,{definedProperties:g}=e.it;for(let y of r)if((m==null?void 0:m[y])===void 0&&!g.has(y)){let v=a.schemaEnv.baseId+a.errSchemaPath,S=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,gO.checkStrictMode)(a,S,a.opts.strictRequired)}}function l(){if(u||s)e.block$data(Ki.nil,p);else for(let m of r)(0,zi.checkReportMissingProp)(e,m)}o(l,"allErrorsMode");function f(){let m=t.let("missing");if(u||s){let g=t.let("valid",!0);e.block$data(g,()=>d(m,g)),e.ok(g)}else t.if((0,zi.checkMissingProp)(e,r,m)),(0,zi.reportMissingProp)(e,m),t.else()}o(f,"exitOnErrorMode");function p(){t.forOf("prop",n,m=>{e.setParams({missingProperty:m}),t.if((0,zi.noPropertyInData)(t,i,m,c.ownProperties),()=>e.error())})}o(p,"loopAllRequired");function d(m,g){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(g,(0,zi.propertyInData)(t,i,m,c.ownProperties)),t.if((0,Ki.not)(g),()=>{e.error(),t.break()})},Ki.nil)}o(d,"loopUntilMissing")}};ul.default=vO});var fl=h(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});var Qi=w(),SO={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Qi.str)`must NOT have ${r} than ${t} items`},params:o(({schemaCode:e})=>(0,Qi._)`{limit: ${e}}`,"params")},bO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:SO,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Qi.operators.GT:Qi.operators.LT;e.fail$data((0,Qi._)`${r}.length ${i} ${n}`)}};pl.default=bO});var Os=h(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});var Eh=$u();Eh.code='require("ajv/dist/runtime/equal").default';dl.default=Eh});var gl=h(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});var ml=Ci(),ue=w(),_O=k(),PO=Os(),EO={message:o(({params:{i:e,j:t}})=>(0,ue.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,"message"),params:o(({params:{i:e,j:t}})=>(0,ue._)`{i: ${e}, j: ${t}}`,"params")},$O={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:EO,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:c}=e;if(!n&&!i)return;let u=t.let("valid"),l=s.items?(0,ml.getSchemaTypes)(s.items):[];e.block$data(u,f,(0,ue._)`${a} === false`),e.ok(u);function f(){let g=t.let("i",(0,ue._)`${r}.length`),y=t.let("j");e.setParams({i:g,j:y}),t.assign(u,!0),t.if((0,ue._)`${g} > 1`,()=>(p()?d:m)(g,y))}o(f,"validateUniqueItems");function p(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}o(p,"canOptimize");function d(g,y){let v=t.name("item"),S=(0,ml.checkDataTypes)(l,v,c.opts.strictNumbers,ml.DataType.Wrong),b=t.const("indices",(0,ue._)`{}`);t.for((0,ue._)`;${g}--;`,()=>{t.let(v,(0,ue._)`${r}[${g}]`),t.if(S,(0,ue._)`continue`),l.length>1&&t.if((0,ue._)`typeof ${v} == "string"`,(0,ue._)`${v} += "_"`),t.if((0,ue._)`typeof ${b}[${v}] == "number"`,()=>{t.assign(y,(0,ue._)`${b}[${v}]`),e.error(),t.assign(u,!1).break()}).code((0,ue._)`${b}[${v}] = ${g}`)})}o(d,"loopN");function m(g,y){let v=(0,_O.useFunc)(t,PO.default),S=t.name("outer");t.label(S).for((0,ue._)`;${g}--;`,()=>t.for((0,ue._)`${y} = ${g}; ${y}--;`,()=>t.if((0,ue._)`${v}(${r}[${g}], ${r}[${y}])`,()=>{e.error(),t.assign(u,!1).break(S)})))}o(m,"loopN2")}};hl.default=$O});var Sl=h(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});var yl=w(),OO=k(),xO=Os(),AO={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,yl._)`{allowedValue: ${e}}`,"params")},wO={keyword:"const",$data:!0,error:AO,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,yl._)`!${(0,OO.useFunc)(t,xO.default)}(${r}, ${i})`):e.fail((0,yl._)`${s} !== ${r}`)}};vl.default=wO});var _l=h(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});var Wi=w(),IO=k(),TO=Os(),RO={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,Wi._)`{allowedValues: ${e}}`,"params")},NO={keyword:"enum",schemaType:"array",$data:!0,error:RO,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:a}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=a.opts.loopEnum,u,l=o(()=>u??(u=(0,IO.useFunc)(t,TO.default)),"getEql"),f;if(c||n)f=t.let("valid"),e.block$data(f,p);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let m=t.const("vSchema",s);f=(0,Wi.or)(...i.map((g,y)=>d(m,y)))}e.pass(f);function p(){t.assign(f,!1),t.forOf("v",s,m=>t.if((0,Wi._)`${l()}(${r}, ${m})`,()=>t.assign(f,!0).break()))}o(p,"loopEnum");function d(m,g){let y=i[g];return typeof y=="object"&&y!==null?(0,Wi._)`${l()}(${r}, ${m}[${g}])`:(0,Wi._)`${r} === ${y}`}o(d,"equalCode")}};bl.default=NO});var $h=h(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var CO=vh(),kO=bh(),jO=tl(),qO=il(),MO=sl(),DO=cl(),LO=ll(),FO=fl(),HO=gl(),VO=Sl(),BO=_l(),GO=[CO.default,kO.default,jO.default,qO.default,MO.default,DO.default,LO.default,FO.default,HO.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},VO.default,BO.default];Pl.default=GO});var $l=h(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.validateAdditionalItems=void 0;var Hr=w(),El=k(),UO={message:o(({params:{len:e}})=>(0,Hr.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,Hr._)`{limit: ${e}}`,"params")},ZO={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:UO,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,El.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Oh(e,n)}};function Oh(e,t){let{gen:r,schema:n,data:i,keyword:s,it:a}=e;a.items=!0;let c=r.const("len",(0,Hr._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Hr._)`${c} <= ${t.length}`);else if(typeof n=="object"&&!(0,El.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,Hr._)`${c} <= ${t.length}`);r.if((0,Hr.not)(l),()=>u(l)),e.ok(l)}function u(l){r.forRange("i",t.length,c,f=>{e.subschema({keyword:s,dataProp:f,dataPropType:El.Type.Num},l),a.allErrors||r.if((0,Hr.not)(l),()=>r.break())})}o(u,"validateItems")}o(Oh,"validateAdditionalItems");Yi.validateAdditionalItems=Oh;Yi.default=ZO});var Ol=h(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.validateTuple=void 0;var xh=w(),xs=k(),zO=Ze(),KO={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Ah(e,"additionalItems",t);r.items=!0,!(0,xs.alwaysValidSchema)(r,t)&&e.ok((0,zO.validateArray)(e))}};function Ah(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:c}=e;f(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=xs.mergeEvaluated.items(n,r.length,c.items));let u=n.name("valid"),l=n.const("len",(0,xh._)`${s}.length`);r.forEach((p,d)=>{(0,xs.alwaysValidSchema)(c,p)||(n.if((0,xh._)`${l} > ${d}`,()=>e.subschema({keyword:a,schemaProp:d,dataProp:d},u)),e.ok(u))});function f(p){let{opts:d,errSchemaPath:m}=c,g=r.length,y=g===p.minItems&&(g===p.maxItems||p[t]===!1);if(d.strictTuples&&!y){let v=`"${a}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,xs.checkStrictMode)(c,v,d.strictTuples)}}o(f,"checkStrictTuple")}o(Ah,"validateTuple");Ji.validateTuple=Ah;Ji.default=KO});var wh=h(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});var QO=Ol(),WO={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,QO.validateTuple)(e,"items"),"code")};xl.default=WO});var Th=h(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});var Ih=w(),YO=k(),JO=Ze(),XO=$l(),ex={message:o(({params:{len:e}})=>(0,Ih.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,Ih._)`{limit: ${e}}`,"params")},tx={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ex,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,YO.alwaysValidSchema)(n,t)&&(i?(0,XO.validateAdditionalItems)(e,i):e.ok((0,JO.validateArray)(e)))}};Al.default=tx});var Rh=h(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var Ke=w(),As=k(),rx={message:o(({params:{min:e,max:t}})=>t===void 0?(0,Ke.str)`must contain at least ${e} valid item(s)`:(0,Ke.str)`must contain at least ${e} and no more than ${t} valid item(s)`,"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,Ke._)`{minContains: ${e}}`:(0,Ke._)`{minContains: ${e}, maxContains: ${t}}`,"params")},nx={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:rx,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,a,c,{minContains:u,maxContains:l}=n;s.opts.next?(a=u===void 0?1:u,c=l):a=1;let f=t.const("len",(0,Ke._)`${i}.length`);if(e.setParams({min:a,max:c}),c===void 0&&a===0){(0,As.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,As.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,As.alwaysValidSchema)(s,r)){let y=(0,Ke._)`${f} >= ${a}`;c!==void 0&&(y=(0,Ke._)`${y} && ${f} <= ${c}`),e.pass(y);return}s.items=!0;let p=t.name("valid");c===void 0&&a===1?m(p,()=>t.if(p,()=>t.break())):a===0?(t.let(p,!0),c!==void 0&&t.if((0,Ke._)`${i}.length > 0`,d)):(t.let(p,!1),d()),e.result(p,()=>e.reset());function d(){let y=t.name("_valid"),v=t.let("count",0);m(y,()=>t.if(y,()=>g(v)))}o(d,"validateItemsWithCount");function m(y,v){t.forRange("i",0,f,S=>{e.subschema({keyword:"contains",dataProp:S,dataPropType:As.Type.Num,compositeRule:!0},y),v()})}o(m,"validateItems");function g(y){t.code((0,Ke._)`${y}++`),c===void 0?t.if((0,Ke._)`${y} >= ${a}`,()=>t.assign(p,!0).break()):(t.if((0,Ke._)`${y} > ${c}`,()=>t.assign(p,!1).break()),a===1?t.assign(p,!0):t.if((0,Ke._)`${y} >= ${a}`,()=>t.assign(p,!0)))}o(g,"checkLimits")}};wl.default=nx});var ws=h(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.validateSchemaDeps=bt.validatePropertyDeps=bt.error=void 0;var Il=w(),ix=k(),Xi=Ze();bt.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Il.str)`must have ${n} ${r} when property ${e} is present`},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Il._)`{property: ${e},
|
|
9
|
+
|| ${a} === "boolean" || ${i} === null`).assign(c,(0,I._)`[${i}]`)}}o(u,"coerceSpecificType")}o(L2,"coerceData");function F2({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,I._)`${t} !== undefined`,()=>e.assign((0,I._)`${t}[${r}]`,n))}o(F2,"assignParentData");function vu(e,t,r,n=An.Correct){let i=n===An.Correct?I.operators.EQ:I.operators.NEQ,s;switch(e){case"null":return(0,I._)`${t} ${i} null`;case"array":s=(0,I._)`Array.isArray(${t})`;break;case"object":s=(0,I._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a((0,I._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return(0,I._)`typeof ${t} ${i} ${e}`}return n===An.Correct?s:(0,I.not)(s);function a(c=I.nil){return(0,I.and)((0,I._)`typeof ${t} == "number"`,c,r?(0,I._)`isFinite(${t})`:I.nil)}}o(vu,"checkDataType");ge.checkDataType=vu;function Su(e,t,r,n){if(e.length===1)return vu(e[0],t,r,n);let i,s=(0,sm.toHash)(e);if(s.array&&s.object){let a=(0,I._)`typeof ${t} != "object"`;i=s.null?a:(0,I._)`!${t} || ${a}`,delete s.null,delete s.array,delete s.object}else i=I.nil;s.number&&delete s.integer;for(let a in s)i=(0,I.and)(i,vu(a,t,r,n));return i}o(Su,"checkDataTypes");ge.checkDataTypes=Su;var H2={message:o(({schema:e})=>`must be ${e}`,"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,I._)`{type: ${e}}`:(0,I._)`{type: ${t}}`,"params")};function bu(e){let t=V2(e);(0,j2.reportError)(t,H2)}o(bu,"reportTypeError");ge.reportTypeError=bu;function V2(e){let{gen:t,data:r,schema:n}=e,i=(0,sm.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(V2,"getTypeErrorContext")});var lm=h(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.assignDefaults=void 0;var wn=w(),B2=k();function G2(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)um(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>um(e,s,i.default))}o(G2,"assignDefaults");fs.assignDefaults=G2;function um(e,t,r){let{gen:n,compositeRule:i,data:s,opts:a}=e;if(r===void 0)return;let c=(0,wn._)`${s}${(0,wn.getProperty)(t)}`;if(i){(0,B2.checkStrictMode)(e,`default is ignored for: ${c}`);return}let u=(0,wn._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,wn._)`${u} || ${c} === null || ${c} === ""`),n.if(u,(0,wn._)`${c} = ${(0,wn.stringify)(r)}`)}o(um,"assignDefault")});var Ze=h(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.validateUnion=H.validateArray=H.usePattern=H.callValidateCode=H.schemaProperties=H.allSchemaProperties=H.noPropertyInData=H.propertyInData=H.isOwnProperty=H.hasPropFunc=H.reportMissingProp=H.checkMissingProp=H.checkReportMissingProp=void 0;var G=w(),_u=k(),er=Ue(),U2=k();function Z2(e,t){let{gen:r,data:n,it:i}=e;r.if(Eu(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,G._)`${t}`},!0),e.error()})}o(Z2,"checkReportMissingProp");H.checkReportMissingProp=Z2;function z2({gen:e,data:t,it:{opts:r}},n,i){return(0,G.or)(...n.map(s=>(0,G.and)(Eu(e,t,s,r.ownProperties),(0,G._)`${i} = ${s}`)))}o(z2,"checkMissingProp");H.checkMissingProp=z2;function K2(e,t){e.setParams({missingProperty:t},!0),e.error()}o(K2,"reportMissingProp");H.reportMissingProp=K2;function pm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,G._)`Object.prototype.hasOwnProperty`})}o(pm,"hasPropFunc");H.hasPropFunc=pm;function Pu(e,t,r){return(0,G._)`${pm(e)}.call(${t}, ${r})`}o(Pu,"isOwnProperty");H.isOwnProperty=Pu;function Q2(e,t,r,n){let i=(0,G._)`${t}${(0,G.getProperty)(r)} !== undefined`;return n?(0,G._)`${i} && ${Pu(e,t,r)}`:i}o(Q2,"propertyInData");H.propertyInData=Q2;function Eu(e,t,r,n){let i=(0,G._)`${t}${(0,G.getProperty)(r)} === undefined`;return n?(0,G.or)(i,(0,G.not)(Pu(e,t,r))):i}o(Eu,"noPropertyInData");H.noPropertyInData=Eu;function fm(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(fm,"allSchemaProperties");H.allSchemaProperties=fm;function W2(e,t){return fm(t).filter(r=>!(0,_u.alwaysValidSchema)(e,t[r]))}o(W2,"schemaProperties");H.schemaProperties=W2;function Y2({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},c,u,l){let f=l?(0,G._)`${e}, ${t}, ${n}${i}`:t,p=[[er.default.instancePath,(0,G.strConcat)(er.default.instancePath,s)],[er.default.parentData,a.parentData],[er.default.parentDataProperty,a.parentDataProperty],[er.default.rootData,er.default.rootData]];a.opts.dynamicRef&&p.push([er.default.dynamicAnchors,er.default.dynamicAnchors]);let d=(0,G._)`${f}, ${r.object(...p)}`;return u!==G.nil?(0,G._)`${c}.call(${u}, ${d})`:(0,G._)`${c}(${d})`}o(Y2,"callValidateCode");H.callValidateCode=Y2;var J2=(0,G._)`new RegExp`;function X2({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,G._)`${i.code==="new RegExp"?J2:(0,U2.useFunc)(e,i)}(${r}, ${n})`})}o(X2,"usePattern");H.usePattern=X2;function e$(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return a(()=>t.assign(c,!1)),c}return t.var(s,!0),a(()=>t.break()),s;function a(c){let u=t.const("len",(0,G._)`${r}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:_u.Type.Num},s),t.if((0,G.not)(s),c)})}o(a,"validateItems")}o(e$,"validateArray");H.validateArray=e$;function t$(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,_u.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((u,l)=>{let f=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},c);t.assign(a,(0,G._)`${a} || ${c}`),e.mergeValidEvaluated(f,c)||t.if((0,G.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}o(t$,"validateUnion");H.validateUnion=t$});var hm=h(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.validateKeywordUsage=yt.validSchemaType=yt.funcKeywordCode=yt.macroKeywordCode=void 0;var Ee=w(),Mr=Ue(),r$=Ze(),n$=Ni();function i$(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=mm(r,n,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let l=r.name("valid");e.subschema({schema:c,schemaPath:Ee.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}o(i$,"macroKeywordCode");yt.macroKeywordCode=i$;function o$(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:c,it:u}=e;a$(u,t);let l=!c&&t.compile?t.compile.call(u.self,s,a,u):t.validate,f=mm(n,i,l),p=n.let("valid");e.block$data(p,d),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function d(){if(t.errors===!1)y(),t.modifying&&dm(e),v(()=>e.error());else{let S=t.async?m():g();t.modifying&&dm(e),v(()=>s$(e,S))}}o(d,"validateKeyword");function m(){let S=n.let("ruleErrs",null);return n.try(()=>y((0,Ee._)`await `),b=>n.assign(p,!1).if((0,Ee._)`${b} instanceof ${u.ValidationError}`,()=>n.assign(S,(0,Ee._)`${b}.errors`),()=>n.throw(b))),S}o(m,"validateAsync");function g(){let S=(0,Ee._)`${f}.errors`;return n.assign(S,null),y(Ee.nil),S}o(g,"validateSync");function y(S=t.async?(0,Ee._)`await `:Ee.nil){let b=u.opts.passContext?Mr.default.this:Mr.default.self,P=!("compile"in t&&!c||t.schema===!1);n.assign(p,(0,Ee._)`${S}${(0,r$.callValidateCode)(e,f,b,P)}`,t.modifying)}o(y,"assignValid");function v(S){var b;n.if((0,Ee.not)((b=t.valid)!==null&&b!==void 0?b:p),S)}o(v,"reportErrs")}o(o$,"funcKeywordCode");yt.funcKeywordCode=o$;function dm(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ee._)`${n.parentData}[${n.parentDataProperty}]`))}o(dm,"modifyData");function s$(e,t){let{gen:r}=e;r.if((0,Ee._)`Array.isArray(${t})`,()=>{r.assign(Mr.default.vErrors,(0,Ee._)`${Mr.default.vErrors} === null ? ${t} : ${Mr.default.vErrors}.concat(${t})`).assign(Mr.default.errors,(0,Ee._)`${Mr.default.vErrors}.length`),(0,n$.extendErrors)(e)},()=>e.error())}o(s$,"addErrs");function a$({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(a$,"checkAsyncKeyword");function mm(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ee.stringify)(r)})}o(mm,"useKeyword");function c$(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(c$,"validSchemaType");yt.validSchemaType=c$;function u$({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a!=null&&a.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}o(u$,"validateKeywordUsage");yt.validateKeywordUsage=u$});var ym=h(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.extendSubschemaMode=tr.extendSubschemaData=tr.getSubschema=void 0;var vt=w(),gm=k();function l$(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,vt._)`${e.schemaPath}${(0,vt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:c[r],schemaPath:(0,vt._)`${e.schemaPath}${(0,vt.getProperty)(t)}${(0,vt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,gm.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(l$,"getSubschema");tr.getSubschema=l$;function p$(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:l,dataPathArr:f,opts:p}=t,d=c.let("data",(0,vt._)`${t.data}${(0,vt.getProperty)(r)}`,!0);u(d),e.errorPath=(0,vt.str)`${l}${(0,gm.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,vt._)`${r}`,e.dataPathArr=[...f,e.parentDataProperty]}if(i!==void 0){let l=i instanceof vt.Name?i:c.let("data",i,!0);u(l),a!==void 0&&(e.propertyName=a)}s&&(e.dataTypes=s);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}o(u,"dataContextProps")}o(p$,"extendSubschemaData");tr.extendSubschemaData=p$;function f$(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(f$,"extendSubschemaMode");tr.extendSubschemaMode=f$});var $u=h((bM,vm)=>{"use strict";vm.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},"equal")});var bm=h((PM,Sm)=>{"use strict";var rr=Sm.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};ds(t,n,i,e,"",e)};rr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};rr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};rr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};rr.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 ds(e,t,r,n,i,s,a,c,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,a,c,u,l);for(var f in n){var p=n[f];if(Array.isArray(p)){if(f in rr.arrayKeywords)for(var d=0;d<p.length;d++)ds(e,t,r,p[d],i+"/"+f+"/"+d,s,i,f,n,d)}else if(f in rr.propsKeywords){if(p&&typeof p=="object")for(var m in p)ds(e,t,r,p[m],i+"/"+f+"/"+d$(m),s,i,f,n,m)}else(f in rr.keywords||e.allKeys&&!(f in rr.skipKeywords))&&ds(e,t,r,p,i+"/"+f,s,i,f,n)}r(n,i,s,a,c,u,l)}}o(ds,"_traverse");function d$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(d$,"escapeJsonPtr")});var ki=h(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.getSchemaRefs=ke.resolveUrl=ke.normalizeId=ke._getFullPath=ke.getFullPath=ke.inlineRef=void 0;var m$=k(),h$=$u(),g$=bm(),y$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function v$(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Ou(e):t?_m(e)<=t:!1}o(v$,"inlineRef");ke.inlineRef=v$;var S$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ou(e){for(let t in e){if(S$.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Ou)||typeof r=="object"&&Ou(r))return!0}return!1}o(Ou,"hasRef");function _m(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!y$.has(r)&&(typeof e[r]=="object"&&(0,m$.eachItem)(e[r],n=>t+=_m(n)),t===1/0))return 1/0}return t}o(_m,"countKeys");function Pm(e,t="",r){r!==!1&&(t=In(t));let n=e.parse(t);return Em(e,n)}o(Pm,"getFullPath");ke.getFullPath=Pm;function Em(e,t){return e.serialize(t).split("#")[0]+"#"}o(Em,"_getFullPath");ke._getFullPath=Em;var b$=/#\/?$/;function In(e){return e?e.replace(b$,""):""}o(In,"normalizeId");ke.normalizeId=In;function _$(e,t,r){return r=In(r),e.resolve(t,r)}o(_$,"resolveUrl");ke.resolveUrl=_$;var P$=/^[a-z_][-a-z0-9._]*$/i;function E$(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=In(e[r]||t),s={"":i},a=Pm(n,i,!1),c={},u=new Set;return g$(e,{allKeys:!0},(p,d,m,g)=>{if(g===void 0)return;let y=a+d,v=s[g];typeof p[r]=="string"&&(v=S.call(this,p[r])),b.call(this,p.$anchor),b.call(this,p.$dynamicAnchor),s[d]=v;function S(P){let E=this.opts.uriResolver.resolve;if(P=In(v?E(v,P):P),u.has(P))throw f(P);u.add(P);let _=this.refs[P];return typeof _=="string"&&(_=this.refs[_]),typeof _=="object"?l(p,_.schema,P):P!==In(y)&&(P[0]==="#"?(l(p,c[P],P),c[P]=p):this.refs[P]=y),P}o(S,"addRef");function b(P){if(typeof P=="string"){if(!P$.test(P))throw new Error(`invalid anchor "${P}"`);S.call(this,`#${P}`)}}o(b,"addAnchor")}),c;function l(p,d,m){if(d!==void 0&&!h$(p,d))throw f(m)}o(l,"checkAmbiguosRef");function f(p){return new Error(`reference "${p}" resolves to more than one schema`)}o(f,"ambiguos")}o(E$,"getSchemaRefs");ke.getSchemaRefs=E$});var Mi=h(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.getData=nr.KeywordCxt=nr.validateFunctionCode=void 0;var wm=nm(),$m=Ci(),Au=yu(),ms=Ci(),$$=lm(),qi=hm(),xu=ym(),O=w(),A=Ue(),O$=ki(),Ht=k(),ji=Ni();function x$(e){if(Rm(e)&&(Nm(e),Tm(e))){I$(e);return}Im(e,()=>(0,wm.topBoolOrEmptySchema)(e))}o(x$,"validateFunctionCode");nr.validateFunctionCode=x$;function Im({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,O._)`${A.default.data}, ${A.default.valCxt}`,n.$async,()=>{e.code((0,O._)`"use strict"; ${Om(r,i)}`),w$(e,i),e.code(s)}):e.func(t,(0,O._)`${A.default.data}, ${A$(i)}`,n.$async,()=>e.code(Om(r,i)).code(s))}o(Im,"validateFunction");function A$(e){return(0,O._)`{${A.default.instancePath}="", ${A.default.parentData}, ${A.default.parentDataProperty}, ${A.default.rootData}=${A.default.data}${e.dynamicRef?(0,O._)`, ${A.default.dynamicAnchors}={}`:O.nil}}={}`}o(A$,"destructureValCxt");function w$(e,t){e.if(A.default.valCxt,()=>{e.var(A.default.instancePath,(0,O._)`${A.default.valCxt}.${A.default.instancePath}`),e.var(A.default.parentData,(0,O._)`${A.default.valCxt}.${A.default.parentData}`),e.var(A.default.parentDataProperty,(0,O._)`${A.default.valCxt}.${A.default.parentDataProperty}`),e.var(A.default.rootData,(0,O._)`${A.default.valCxt}.${A.default.rootData}`),t.dynamicRef&&e.var(A.default.dynamicAnchors,(0,O._)`${A.default.valCxt}.${A.default.dynamicAnchors}`)},()=>{e.var(A.default.instancePath,(0,O._)`""`),e.var(A.default.parentData,(0,O._)`undefined`),e.var(A.default.parentDataProperty,(0,O._)`undefined`),e.var(A.default.rootData,A.default.data),t.dynamicRef&&e.var(A.default.dynamicAnchors,(0,O._)`{}`)})}o(w$,"destructureValCxtES5");function I$(e){let{schema:t,opts:r,gen:n}=e;Im(e,()=>{r.$comment&&t.$comment&&km(e),k$(e),n.let(A.default.vErrors,null),n.let(A.default.errors,0),r.unevaluated&&T$(e),Cm(e),M$(e)})}o(I$,"topSchemaObjCode");function T$(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,O._)`${r}.evaluated`),t.if((0,O._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,O._)`${e.evaluated}.props`,(0,O._)`undefined`)),t.if((0,O._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,O._)`${e.evaluated}.items`,(0,O._)`undefined`))}o(T$,"resetEvaluated");function Om(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}o(Om,"funcSourceUrl");function R$(e,t){if(Rm(e)&&(Nm(e),Tm(e))){N$(e,t);return}(0,wm.boolOrEmptySchema)(e,t)}o(R$,"subschemaCode");function Tm({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(Tm,"schemaCxtHasRules");function Rm(e){return typeof e.schema!="boolean"}o(Rm,"isSchemaObj");function N$(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&km(e),j$(e),q$(e);let s=n.const("_errs",A.default.errors);Cm(e,s),n.var(t,(0,O._)`${s} === ${A.default.errors}`)}o(N$,"subSchemaObjCode");function Nm(e){(0,Ht.checkUnknownRules)(e),C$(e)}o(Nm,"checkKeywords");function Cm(e,t){if(e.opts.jtd)return xm(e,[],!1,t);let r=(0,$m.getSchemaTypes)(e.schema),n=(0,$m.coerceAndCheckDataType)(e,r);xm(e,r,!n,t)}o(Cm,"typeAndKeywords");function C$(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ht.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}o(C$,"checkRefsAndKeywords");function k$(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ht.checkStrictMode)(e,"default is ignored in the schema root")}o(k$,"checkNoDefault");function j$(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,O$.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(j$,"updateContext");function q$(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(q$,"checkAsyncSchema");function km({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,O._)`${A.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,O.str)`${n}/$comment`,c=e.scopeValue("root",{ref:t.root});e.code((0,O._)`${A.default.self}.opts.$comment(${s}, ${a}, ${c}.schema)`)}}o(km,"commentKeyword");function M$(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,O._)`${A.default.errors} === 0`,()=>t.return(A.default.data),()=>t.throw((0,O._)`new ${i}(${A.default.vErrors})`)):(t.assign((0,O._)`${n}.errors`,A.default.vErrors),s.unevaluated&&D$(e),t.return((0,O._)`${A.default.errors} === 0`))}o(M$,"returnResults");function D$({gen:e,evaluated:t,props:r,items:n}){r instanceof O.Name&&e.assign((0,O._)`${t}.props`,r),n instanceof O.Name&&e.assign((0,O._)`${t}.items`,n)}o(D$,"assignEvaluated");function xm(e,t,r,n){let{gen:i,schema:s,data:a,allErrors:c,opts:u,self:l}=e,{RULES:f}=l;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,Ht.schemaHasRulesButRef)(s,f))){i.block(()=>qm(e,"$ref",f.all.$ref.definition));return}u.jtd||L$(e,t),i.block(()=>{for(let d of f.rules)p(d);p(f.post)});function p(d){(0,Au.shouldUseGroup)(s,d)&&(d.type?(i.if((0,ms.checkDataType)(d.type,a,u.strictNumbers)),Am(e,d),t.length===1&&t[0]===d.type&&r&&(i.else(),(0,ms.reportTypeError)(e)),i.endIf()):Am(e,d),c||i.if((0,O._)`${A.default.errors} === ${n||0}`))}o(p,"groupKeywords")}o(xm,"schemaKeywords");function Am(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,$$.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,Au.shouldUseRule)(n,s)&&qm(e,s.keyword,s.definition,t.type)})}o(Am,"iterateKeywords");function L$(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(F$(e,t),e.opts.allowUnionTypes||H$(e,t),V$(e,e.dataTypes))}o(L$,"checkStrictTypes");function F$(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{jm(e.dataTypes,r)||wu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),G$(e,t)}}o(F$,"checkContextTypes");function H$(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&wu(e,"use allowUnionTypes to allow union type keyword")}o(H$,"checkMultipleTypes");function V$(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Au.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>B$(t,a))&&wu(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}o(V$,"checkKeywordTypes");function B$(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(B$,"hasApplicableType");function jm(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(jm,"includesType");function G$(e,t){let r=[];for(let n of e.dataTypes)jm(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(G$,"narrowSchemaTypes");function wu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ht.checkStrictMode)(e,t,e.opts.strictTypes)}o(wu,"strictTypesError");var Iu=class Iu{constructor(t,r,n){if((0,qi.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ht.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Mm(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,qi.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",A.default.errors))}result(t,r,n){this.failResult((0,O.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,O.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ji.reportExtraError:ji.reportError)(this,this.def.error,r)}$dataError(){(0,ji.reportError)(this,this.def.$dataError||ji.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ji.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=O.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,O.or)((0,O._)`${i} === undefined`,r)),t!==O.nil&&n.assign(t,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==O.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,O.or)(a(),c());function a(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,O._)`${(0,ms.checkDataTypes)(u,r,s.opts.strictNumbers,ms.DataType.Wrong)}`}return O.nil}function c(){if(i.validateSchema){let u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,O._)`!${u}(${r})`}return O.nil}}subschema(t,r){let n=(0,xu.getSubschema)(this.it,t);(0,xu.extendSubschemaData)(n,this.it,t),(0,xu.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return R$(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ht.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ht.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,O.Name)),!0}};o(Iu,"KeywordCxt");var hs=Iu;nr.KeywordCxt=hs;function qm(e,t,r,n){let i=new hs(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,qi.funcKeywordCode)(i,r):"macro"in r?(0,qi.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,qi.funcKeywordCode)(i,r)}o(qm,"keywordCode");var U$=/^\/(?:[^~]|~0|~1)*$/,Z$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Mm(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return A.default.rootData;if(e[0]==="/"){if(!U$.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=A.default.rootData}else{let l=Z$.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let f=+l[1];if(i=l[2],i==="#"){if(f>=t)throw new Error(u("property/index",f));return n[t-f]}if(f>t)throw new Error(u("data",f));if(s=r[t-f],!i)return s}let a=s,c=i.split("/");for(let l of c)l&&(s=(0,O._)`${s}${(0,O.getProperty)((0,Ht.unescapeJsonPointer)(l))}`,a=(0,O._)`${a} && ${s}`);return a;function u(l,f){return`Cannot access ${l} ${f} levels up, current level is ${t}`}}o(Mm,"getData");nr.getData=Mm});var gs=h(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});var Nu=class Nu extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(Nu,"ValidationError");var Tu=Nu;Ru.default=Tu});var Di=h(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});var Cu=ki(),qu=class qu extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Cu.resolveUrl)(t,r,n),this.missingSchema=(0,Cu.normalizeId)((0,Cu.getFullPath)(t,this.missingRef))}};o(qu,"MissingRefError");var ku=qu;ju.default=ku});var Li=h(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.resolveSchema=ze.getCompilingSchema=ze.resolveRef=ze.compileSchema=ze.SchemaEnv=void 0;var it=w(),z$=gs(),Dr=Ue(),ot=ki(),Dm=k(),K$=Mi(),Lu=class Lu{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ot.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(Lu,"SchemaEnv");var Tn=Lu;ze.SchemaEnv=Tn;function Du(e){let t=Lm.call(this,e);if(t)return t;let r=(0,ot.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new it.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;e.$async&&(c=a.scopeValue("Error",{ref:z$.default,code:(0,it._)`require("ajv/dist/runtime/validation_error").default`}));let u=a.scopeName("validate");e.validateName=u;let l={gen:a,allErrors:this.opts.allErrors,data:Dr.default.data,parentData:Dr.default.parentData,parentDataProperty:Dr.default.parentDataProperty,dataNames:[Dr.default.data],dataPathArr:[it.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,it.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:it.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,it._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(e),(0,K$.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let p=a.toString();f=`${a.scopeRefs(Dr.default.scope)}return ${p}`,this.opts.code.process&&(f=this.opts.code.process(f,e));let m=new Function(`${Dr.default.self}`,`${Dr.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:u,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:g,items:y}=l;m.evaluated={props:g instanceof it.Name?void 0:g,items:y instanceof it.Name?void 0:y,dynamicProps:g instanceof it.Name,dynamicItems:y instanceof it.Name},m.source&&(m.source.evaluated=(0,it.stringify)(m.evaluated))}return e.validate=m,e}catch(p){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),p}finally{this._compilations.delete(e)}}o(Du,"compileSchema");ze.compileSchema=Du;function Q$(e,t,r){var n;r=(0,ot.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=J$.call(this,e,r);if(s===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;a&&(s=new Tn({schema:a,schemaId:c,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=W$.call(this,s)}o(Q$,"resolveRef");ze.resolveRef=Q$;function W$(e){return(0,ot.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Du.call(this,e)}o(W$,"inlineOrCompile");function Lm(e){for(let t of this._compilations)if(Y$(t,e))return t}o(Lm,"getCompilingSchema");ze.getCompilingSchema=Lm;function Y$(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(Y$,"sameSchemaEnv");function J$(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||ys.call(this,e,t)}o(J$,"resolve");function ys(e,t){let r=this.opts.uriResolver.parse(t),n=(0,ot._getFullPath)(this.opts.uriResolver,r),i=(0,ot.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Mu.call(this,r,e);let s=(0,ot.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let c=ys.call(this,e,a);return typeof(c==null?void 0:c.schema)!="object"?void 0:Mu.call(this,r,c)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Du.call(this,a),s===(0,ot.normalizeId)(t)){let{schema:c}=a,{schemaId:u}=this.opts,l=c[u];return l&&(i=(0,ot.resolveUrl)(this.opts.uriResolver,i,l)),new Tn({schema:c,schemaId:u,root:e,baseId:i})}return Mu.call(this,r,a)}}o(ys,"resolveSchema");ze.resolveSchema=ys;var X$=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Mu(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,Dm.unescapeFragment)(c)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];!X$.has(c)&&l&&(t=(0,ot.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Dm.schemaHasRulesButRef)(r,this.RULES)){let c=(0,ot.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=ys.call(this,n,c)}let{schemaId:a}=this.opts;if(s=s||new Tn({schema:r,schemaId:a,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(Mu,"getJsonPointer")});var Fm=h((kM,e1)=>{e1.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}});var Vm=h((jM,Hm)=>{"use strict";var t1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Hm.exports={HEX:t1}});var Wm=h((qM,Qm)=>{"use strict";var{HEX:r1}=Vm();function Zm(e){if(Km(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[r]=t;return r?{host:i1(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(Zm,"normalizeIPv4");function Fu(e,t=!1){let r="",n=!0;for(let i of e){if(r1[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(Fu,"stringArrayToHexStripped");function n1(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,c=!1;function u(){if(i.length){if(s===!1){let l=Fu(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}o(u,"consume");for(let l=0;l<e.length;l++){let f=e[l];if(!(f==="["||f==="]"))if(f===":"){if(a===!0&&(c=!0),!u())break;if(t++,n.push(":"),t>7){r.error=!0;break}l-1>=0&&e[l-1]===":"&&(a=!0);continue}else if(f==="%"){if(!u())break;s=!0}else{i.push(f);continue}}return i.length&&(s?r.zone=i.join(""):c?n.push(i.join("")):n.push(Fu(i))),r.address=n.join(""),r}o(n1,"getIPV6");function zm(e,t={}){if(Km(e,":")<2)return{host:e,isIPV6:!1};let r=n1(e);if(r.error)return{host:e,isIPV6:!1};{let n=r.address,i=r.address;return r.zone&&(n+="%"+r.zone,i+="%25"+r.zone),{host:n,escapedHost:i,isIPV6:!0}}}o(zm,"normalizeIPv6");function i1(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let a=e[s];a==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=a,n=!1):(a===t?n=!0:n=!1,r+=a)}return r}o(i1,"stripLeadingZeros");function Km(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o(Km,"findToken");var Bm=/^\.\.?\//u,Gm=/^\/\.(?:\/|$)/u,Um=/^\/\.\.(?:\/|$)/u,o1=/^\/?(?:.|\n)*?(?=\/|$)/u;function s1(e){let t=[];for(;e.length;)if(e.match(Bm))e=e.replace(Bm,"");else if(e.match(Gm))e=e.replace(Gm,"/");else if(e.match(Um))e=e.replace(Um,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(o1);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(s1,"removeDotSegments");function a1(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(a1,"normalizeComponentEncoding");function c1(e,t){let r=[];if(e.userinfo!==void 0&&(r.push(e.userinfo),r.push("@")),e.host!==void 0){let n=unescape(e.host),i=Zm(n);if(i.isIPV4)n=i.host;else{let s=zm(i.host,{isIPV4:!1});s.isIPV6===!0?n=`[${s.escapedHost}]`:n=e.host}r.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}o(c1,"recomposeAuthority");Qm.exports={recomposeAuthority:c1,normalizeComponentEncoding:a1,removeDotSegments:s1,normalizeIPv4:Zm,normalizeIPv6:zm,stringArrayToHexStripped:Fu}});var rh=h((DM,th)=>{"use strict";var u1=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,l1=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function Ym(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o(Ym,"isSecure");function Jm(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(Jm,"httpParse");function Xm(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(Xm,"httpSerialize");function p1(e){return e.secure=Ym(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(p1,"wsParse");function f1(e){if((e.port===(Ym(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(f1,"wsSerialize");function d1(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(l1);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=Hu[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(d1,"urnParse");function m1(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=Hu[i];s&&(e=s.serialize(e,t));let a=e,c=e.nss;return a.path=`${n||t.nid}:${c}`,t.skipEscape=!0,a}o(m1,"urnSerialize");function h1(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!u1.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(h1,"urnuuidParse");function g1(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(g1,"urnuuidSerialize");var eh={scheme:"http",domainHost:!0,parse:Jm,serialize:Xm},y1={scheme:"https",domainHost:eh.domainHost,parse:Jm,serialize:Xm},vs={scheme:"ws",domainHost:!0,parse:p1,serialize:f1},v1={scheme:"wss",domainHost:vs.domainHost,parse:vs.parse,serialize:vs.serialize},S1={scheme:"urn",parse:d1,serialize:m1,skipNormalize:!0},b1={scheme:"urn:uuid",parse:h1,serialize:g1,skipNormalize:!0},Hu={http:eh,https:y1,ws:vs,wss:v1,urn:S1,"urn:uuid":b1};th.exports=Hu});var ih=h((FM,bs)=>{"use strict";var{normalizeIPv6:_1,normalizeIPv4:P1,removeDotSegments:Fi,recomposeAuthority:E1,normalizeComponentEncoding:Ss}=Wm(),Vu=rh();function $1(e,t){return typeof e=="string"?e=St(Vt(e,t),t):typeof e=="object"&&(e=Vt(St(e,t),t)),e}o($1,"normalize");function O1(e,t,r){let n=Object.assign({scheme:"null"},r),i=nh(Vt(e,n),Vt(t,n),n,!0);return St(i,{...n,skipEscape:!0})}o(O1,"resolve");function nh(e,t,r,n){let i={};return n||(e=Vt(St(e,r),r),t=Vt(St(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fi(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Fi(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=Fi(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Fi(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(nh,"resolveComponents");function x1(e,t,r){return typeof e=="string"?(e=unescape(e),e=St(Ss(Vt(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=St(Ss(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=St(Ss(Vt(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=St(Ss(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}o(x1,"equal");function St(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=Vu[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&(i.push(r.scheme),i.push(":"));let a=E1(r,n);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=Fi(c)),a===void 0&&(c=c.replace(/^\/\//u,"/%2F")),i.push(c)}return r.query!==void 0&&(i.push("?"),i.push(r.query)),r.fragment!==void 0&&(i.push("#"),i.push(r.fragment)),i.join("")}o(St,"serialize");var A1=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function w1(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||A1[t])return!0;return!1}o(w1,"nonSimpleDomain");var I1=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Vt(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let a=e.match(I1);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host){let u=P1(n.host);if(u.isIPV4===!1){let l=_1(u.host,{isIPV4:!1});n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=u.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&!n.path&&n.query===void 0?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Vu[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&w1(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!c||c&&!c.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.userinfo!==void 0&&(n.userinfo=unescape(n.userinfo)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path!==void 0&&n.path.length&&(n.path=escape(unescape(n.path))),n.fragment!==void 0&&n.fragment.length&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(Vt,"parse");var Bu={SCHEMES:Vu,normalize:$1,resolve:O1,resolveComponents:nh,equal:x1,serialize:St,parse:Vt};bs.exports=Bu;bs.exports.default=Bu;bs.exports.fastUri=Bu});var sh=h(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});var oh=ih();oh.code='require("ajv/dist/runtime/uri").default';Gu.default=oh});var Nn=h(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.CodeGen=ue.Name=ue.nil=ue.stringify=ue.str=ue._=ue.KeywordCxt=void 0;var T1=Mi();Object.defineProperty(ue,"KeywordCxt",{enumerable:!0,get:o(function(){return T1.KeywordCxt},"get")});var Rn=w();Object.defineProperty(ue,"_",{enumerable:!0,get:o(function(){return Rn._},"get")});Object.defineProperty(ue,"str",{enumerable:!0,get:o(function(){return Rn.str},"get")});Object.defineProperty(ue,"stringify",{enumerable:!0,get:o(function(){return Rn.stringify},"get")});Object.defineProperty(ue,"nil",{enumerable:!0,get:o(function(){return Rn.nil},"get")});Object.defineProperty(ue,"Name",{enumerable:!0,get:o(function(){return Rn.Name},"get")});Object.defineProperty(ue,"CodeGen",{enumerable:!0,get:o(function(){return Rn.CodeGen},"get")});var R1=gs(),ph=Di(),N1=gu(),Hi=Li(),C1=w(),Vi=ki(),_s=Ci(),Zu=k(),ah=Fm(),k1=sh(),fh=o((e,t)=>new RegExp(e,t),"defaultRegExp");fh.code="new RegExp";var j1=["removeAdditional","useDefaults","coerceTypes"],q1=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),M1={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."},D1={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ch=200;function L1(e){var t,r,n,i,s,a,c,u,l,f,p,d,m,g,y,v,S,b,P,E,_,T,N,Re,re;let F=e.strict,J=(t=e.code)===null||t===void 0?void 0:t.optimize,_e=J===!0||J===void 0?1:J||0,gn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:fh,yn=(i=e.uriResolver)!==null&&i!==void 0?i:k1.default;return{strictSchema:(a=(s=e.strictSchema)!==null&&s!==void 0?s:F)!==null&&a!==void 0?a:!0,strictNumbers:(u=(c=e.strictNumbers)!==null&&c!==void 0?c:F)!==null&&u!==void 0?u:!0,strictTypes:(f=(l=e.strictTypes)!==null&&l!==void 0?l:F)!==null&&f!==void 0?f:"log",strictTuples:(d=(p=e.strictTuples)!==null&&p!==void 0?p:F)!==null&&d!==void 0?d:"log",strictRequired:(g=(m=e.strictRequired)!==null&&m!==void 0?m:F)!==null&&g!==void 0?g:!1,code:e.code?{...e.code,optimize:_e,regExp:gn}:{optimize:_e,regExp:gn},loopRequired:(y=e.loopRequired)!==null&&y!==void 0?y:ch,loopEnum:(v=e.loopEnum)!==null&&v!==void 0?v:ch,meta:(S=e.meta)!==null&&S!==void 0?S:!0,messages:(b=e.messages)!==null&&b!==void 0?b:!0,inlineRefs:(P=e.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(_=e.addUsedSchema)!==null&&_!==void 0?_:!0,validateSchema:(T=e.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(N=e.validateFormats)!==null&&N!==void 0?N:!0,unicodeRegExp:(Re=e.unicodeRegExp)!==null&&Re!==void 0?Re:!0,int32range:(re=e.int32range)!==null&&re!==void 0?re:!0,uriResolver:yn}}o(L1,"requiredOptions");var zu=class zu{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...L1(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new C1.ValueScope({scope:{},prefixes:q1,es5:r,lines:n}),this.logger=U1(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,N1.getRules)(),uh.call(this,M1,t,"NOT SUPPORTED"),uh.call(this,D1,t,"DEPRECATED","warn"),this._metaOpts=B1.call(this),t.formats&&H1.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&V1.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),F1.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=ah;n==="id"&&(i={...ah},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(f,p){await s.call(this,f.$schema);let d=this._addSchema(f,p);return d.validate||a.call(this,d)}async function s(f){f&&!this.getSchema(f)&&await i.call(this,{$ref:f},!0)}async function a(f){try{return this._compileSchemaEnv(f)}catch(p){if(!(p instanceof ph.default))throw p;return c.call(this,p),await u.call(this,p.missingSchema),a.call(this,f)}}function c({missingSchema:f,missingRef:p}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${p} cannot be resolved`)}async function u(f){let p=await l.call(this,f);this.refs[f]||await s.call(this,p.$schema),this.refs[f]||this.addSchema(p,f,r)}async function l(f){let p=this._loading[f];if(p)return p;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:a}=this.opts;if(s=t[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Vi.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=lh.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Hi.SchemaEnv({schema:{},schemaId:n});if(r=Hi.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=lh.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Vi.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(z1.call(this,n,r),!r)return(0,Zu.eachItem)(n,s=>Uu.call(this,s)),this;Q1.call(this,r);let i={...r,type:(0,_s.getJSONTypes)(r.type),schemaType:(0,_s.getJSONTypes)(r.schemaType)};return(0,Zu.eachItem)(n,i.type.length===0?s=>Uu.call(this,s,i):s=>i.type.forEach(a=>Uu.call(this,s,i,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),a=t;for(let c of s)a=a[c];for(let c in n){let u=n[c];if(typeof u!="object")continue;let{$data:l}=u.definition,f=a[c];l&&f&&(a[c]=dh(f))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof t=="object")a=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,Vi.normalizeId)(a||n);let l=Vi.getSchemaRefs.call(this,t,n);return u=new Hi.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),i&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Hi.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Hi.compileSchema.call(this,t)}finally{this.opts=r}}};o(zu,"Ajv");var Bi=zu;Bi.ValidationError=R1.default;Bi.MissingRefError=ph.default;ue.default=Bi;function uh(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n](`${r}: option ${i}. ${e[s]}`)}}o(uh,"checkOptions");function lh(e){return e=(0,Vi.normalizeId)(e),this.schemas[e]||this.refs[e]}o(lh,"getSchEnv");function F1(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(F1,"addInitialSchemas");function H1(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(H1,"addInitialFormats");function V1(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(V1,"addInitialKeywords");function B1(){let e={...this.opts};for(let t of j1)delete e[t];return e}o(B1,"getMetaSchemaOptions");var G1={log(){},warn(){},error(){}};function U1(e){if(e===!1)return G1;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(U1,"getLogger");var Z1=/^[a-z_$][a-z0-9_$:-]*$/i;function z1(e,t){let{RULES:r}=this;if((0,Zu.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Z1.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(z1,"checkKeyword");function Uu(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:u})=>u===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[e]=!0,!t)return;let c={keyword:e,definition:{...t,type:(0,_s.getJSONTypes)(t.type),schemaType:(0,_s.getJSONTypes)(t.schemaType)}};t.before?K1.call(this,a,c,t.before):a.rules.push(c),s.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}o(Uu,"addRule");function K1(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}o(K1,"addBeforeRule");function Q1(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=dh(t)),e.validateSchema=this.compile(t,!0))}o(Q1,"keywordMetaschema");var W1={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dh(e){return{anyOf:[e,W1]}}o(dh,"schemaOrData")});var Gi=h(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.callRef=Lr.getValidate=void 0;var Y1=Di(),mh=Ze(),je=w(),Cn=Ue(),hh=Li(),Ps=k(),J1={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:a,opts:c,self:u}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return p();let f=hh.resolveRef.call(u,l,i,r);if(f===void 0)throw new Y1.default(n.opts.uriResolver,i,r);if(f instanceof hh.SchemaEnv)return d(f);return m(f);function p(){if(s===l)return Es(e,a,s,s.$async);let g=t.scopeValue("root",{ref:l});return Es(e,(0,je._)`${g}.validate`,l,l.$async)}function d(g){let y=gh(e,g);Es(e,y,g,g.$async)}function m(g){let y=t.scopeValue("schema",c.code.source===!0?{ref:g,code:(0,je.stringify)(g)}:{ref:g}),v=t.name("valid"),S=e.subschema({schema:g,dataTypes:[],schemaPath:je.nil,topSchemaRef:y,errSchemaPath:r},v);e.mergeEvaluated(S),e.ok(v)}}};function gh(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,je._)`${r.scopeValue("wrapper",{ref:t})}.validate`}o(gh,"getValidate");Lr.getValidate=gh;function Es(e,t,r,n){let{gen:i,it:s}=e,{allErrors:a,schemaEnv:c,opts:u}=s,l=u.passContext?Cn.default.this:je.nil;n?f():p();function f(){if(!c.$async)throw new Error("async schema referenced by sync schema");let g=i.let("valid");i.try(()=>{i.code((0,je._)`await ${(0,mh.callValidateCode)(e,t,l)}`),m(t),a||i.assign(g,!0)},y=>{i.if((0,je._)`!(${y} instanceof ${s.ValidationError})`,()=>i.throw(y)),d(y),a||i.assign(g,!1)}),e.ok(g)}o(f,"callAsyncRef");function p(){e.result((0,mh.callValidateCode)(e,t,l),()=>m(t),()=>d(t))}o(p,"callSyncRef");function d(g){let y=(0,je._)`${g}.errors`;i.assign(Cn.default.vErrors,(0,je._)`${Cn.default.vErrors} === null ? ${y} : ${Cn.default.vErrors}.concat(${y})`),i.assign(Cn.default.errors,(0,je._)`${Cn.default.vErrors}.length`)}o(d,"addErrorsFrom");function m(g){var y;if(!s.opts.unevaluated)return;let v=(y=r==null?void 0:r.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=Ps.mergeEvaluated.props(i,v.props,s.props));else{let S=i.var("props",(0,je._)`${g}.evaluated.props`);s.props=Ps.mergeEvaluated.props(i,S,s.props,je.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=Ps.mergeEvaluated.items(i,v.items,s.items));else{let S=i.var("items",(0,je._)`${g}.evaluated.items`);s.items=Ps.mergeEvaluated.items(i,S,s.items,je.Name)}}o(m,"addEvaluatedFrom")}o(Es,"callRef");Lr.callRef=Es;Lr.default=J1});var yh=h(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});var X1=Gi(),eO=["$schema","id","$defs",{keyword:"$comment"},"definitions",X1.default];Ku.default=eO});var vh=h(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});var Qu=Nn(),tO=w(),ir=tO.operators,Wu={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:ir.LTE,fail:ir.GT},{okStr:"<",ok:ir.LT,fail:ir.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:ir.GTE,fail:ir.LT},{okStr:">",ok:ir.GT,fail:ir.LTE}]}},rO={message:o(e=>Qu.str`must be ${Yu(e).okStr} ${e.schemaCode}`,"message"),params:o(e=>Qu._`{comparison: ${Yu(e).okStr}, limit: ${e.schemaCode}}`,"params")},nO={keyword:Object.keys(Wu),type:"number",schemaType:"number",$data:!0,error:rO,code(e){let{data:t,schemaCode:r}=e;e.fail$data(Qu._`${t} ${Yu(e).fail} ${r} || isNaN(${t})`)}};function Yu(e){var t;let r=e.keyword,n=!((t=e.parentSchema)===null||t===void 0)&&t[Wu[r].exclusive]?1:0;return Wu[r].ops[n]}o(Yu,"kwdOp");Ju.default=nO});var bh=h(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});var Sh={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},iO={keyword:Object.keys(Sh),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){let r=Sh[e];if(t[r]===void 0)throw new Error(`${e} can only be used with ${r}`)}};Xu.default=iO});var tl=h(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});var Ui=w(),oO={message:o(({schemaCode:e})=>(0,Ui.str)`must be multiple of ${e}`,"message"),params:o(({schemaCode:e})=>(0,Ui._)`{multipleOf: ${e}}`,"params")},sO={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:oO,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?(0,Ui._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Ui._)`${a} !== parseInt(${a})`;e.fail$data((0,Ui._)`(${n} === 0 || (${a} = ${r}/${n}, ${c}))`)}};el.default=sO});var Ph=h(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});function _h(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(_h,"ucs2length");rl.default=_h;_h.code='require("ajv/dist/runtime/ucs2length").default'});var il=h(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});var Fr=w(),aO=k(),cO=Ph(),uO={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Fr.str)`must NOT have ${r} than ${t} characters`},params:o(({schemaCode:e})=>(0,Fr._)`{limit: ${e}}`,"params")},lO={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:uO,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?Fr.operators.GT:Fr.operators.LT,a=i.opts.unicode===!1?(0,Fr._)`${r}.length`:(0,Fr._)`${(0,aO.useFunc)(e.gen,cO.default)}(${r})`;e.fail$data((0,Fr._)`${a} ${s} ${n}`)}};nl.default=lO});var sl=h(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});var pO=Ze(),$s=w(),fO={message:o(({schemaCode:e})=>(0,$s.str)`must match pattern "${e}"`,"message"),params:o(({schemaCode:e})=>(0,$s._)`{pattern: ${e}}`,"params")},dO={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:fO,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"",c=r?(0,$s._)`(new RegExp(${i}, ${a}))`:(0,pO.usePattern)(e,n);e.fail$data((0,$s._)`!${c}.test(${t})`)}};ol.default=dO});var cl=h(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});var Zi=w(),mO={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Zi.str)`must NOT have ${r} than ${t} properties`},params:o(({schemaCode:e})=>(0,Zi._)`{limit: ${e}}`,"params")},hO={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:mO,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Zi.operators.GT:Zi.operators.LT;e.fail$data((0,Zi._)`Object.keys(${r}).length ${i} ${n}`)}};al.default=hO});var ll=h(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var zi=Ze(),Ki=w(),gO=k(),yO={message:o(({params:{missingProperty:e}})=>(0,Ki.str)`must have required property '${e}'`,"message"),params:o(({params:{missingProperty:e}})=>(0,Ki._)`{missingProperty: ${e}}`,"params")},vO={keyword:"required",type:"object",schemaType:"array",$data:!0,error:yO,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:a}=e,{opts:c}=a;if(!s&&r.length===0)return;let u=r.length>=c.loopRequired;if(a.allErrors?l():f(),c.strictRequired){let m=e.parentSchema.properties,{definedProperties:g}=e.it;for(let y of r)if((m==null?void 0:m[y])===void 0&&!g.has(y)){let v=a.schemaEnv.baseId+a.errSchemaPath,S=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,gO.checkStrictMode)(a,S,a.opts.strictRequired)}}function l(){if(u||s)e.block$data(Ki.nil,p);else for(let m of r)(0,zi.checkReportMissingProp)(e,m)}o(l,"allErrorsMode");function f(){let m=t.let("missing");if(u||s){let g=t.let("valid",!0);e.block$data(g,()=>d(m,g)),e.ok(g)}else t.if((0,zi.checkMissingProp)(e,r,m)),(0,zi.reportMissingProp)(e,m),t.else()}o(f,"exitOnErrorMode");function p(){t.forOf("prop",n,m=>{e.setParams({missingProperty:m}),t.if((0,zi.noPropertyInData)(t,i,m,c.ownProperties),()=>e.error())})}o(p,"loopAllRequired");function d(m,g){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(g,(0,zi.propertyInData)(t,i,m,c.ownProperties)),t.if((0,Ki.not)(g),()=>{e.error(),t.break()})},Ki.nil)}o(d,"loopUntilMissing")}};ul.default=vO});var fl=h(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});var Qi=w(),SO={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Qi.str)`must NOT have ${r} than ${t} items`},params:o(({schemaCode:e})=>(0,Qi._)`{limit: ${e}}`,"params")},bO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:SO,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Qi.operators.GT:Qi.operators.LT;e.fail$data((0,Qi._)`${r}.length ${i} ${n}`)}};pl.default=bO});var Os=h(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});var Eh=$u();Eh.code='require("ajv/dist/runtime/equal").default';dl.default=Eh});var gl=h(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});var ml=Ci(),le=w(),_O=k(),PO=Os(),EO={message:o(({params:{i:e,j:t}})=>(0,le.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,"message"),params:o(({params:{i:e,j:t}})=>(0,le._)`{i: ${e}, j: ${t}}`,"params")},$O={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:EO,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:c}=e;if(!n&&!i)return;let u=t.let("valid"),l=s.items?(0,ml.getSchemaTypes)(s.items):[];e.block$data(u,f,(0,le._)`${a} === false`),e.ok(u);function f(){let g=t.let("i",(0,le._)`${r}.length`),y=t.let("j");e.setParams({i:g,j:y}),t.assign(u,!0),t.if((0,le._)`${g} > 1`,()=>(p()?d:m)(g,y))}o(f,"validateUniqueItems");function p(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}o(p,"canOptimize");function d(g,y){let v=t.name("item"),S=(0,ml.checkDataTypes)(l,v,c.opts.strictNumbers,ml.DataType.Wrong),b=t.const("indices",(0,le._)`{}`);t.for((0,le._)`;${g}--;`,()=>{t.let(v,(0,le._)`${r}[${g}]`),t.if(S,(0,le._)`continue`),l.length>1&&t.if((0,le._)`typeof ${v} == "string"`,(0,le._)`${v} += "_"`),t.if((0,le._)`typeof ${b}[${v}] == "number"`,()=>{t.assign(y,(0,le._)`${b}[${v}]`),e.error(),t.assign(u,!1).break()}).code((0,le._)`${b}[${v}] = ${g}`)})}o(d,"loopN");function m(g,y){let v=(0,_O.useFunc)(t,PO.default),S=t.name("outer");t.label(S).for((0,le._)`;${g}--;`,()=>t.for((0,le._)`${y} = ${g}; ${y}--;`,()=>t.if((0,le._)`${v}(${r}[${g}], ${r}[${y}])`,()=>{e.error(),t.assign(u,!1).break(S)})))}o(m,"loopN2")}};hl.default=$O});var Sl=h(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});var yl=w(),OO=k(),xO=Os(),AO={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,yl._)`{allowedValue: ${e}}`,"params")},wO={keyword:"const",$data:!0,error:AO,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,yl._)`!${(0,OO.useFunc)(t,xO.default)}(${r}, ${i})`):e.fail((0,yl._)`${s} !== ${r}`)}};vl.default=wO});var _l=h(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});var Wi=w(),IO=k(),TO=Os(),RO={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,Wi._)`{allowedValues: ${e}}`,"params")},NO={keyword:"enum",schemaType:"array",$data:!0,error:RO,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:a}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=a.opts.loopEnum,u,l=o(()=>u??(u=(0,IO.useFunc)(t,TO.default)),"getEql"),f;if(c||n)f=t.let("valid"),e.block$data(f,p);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let m=t.const("vSchema",s);f=(0,Wi.or)(...i.map((g,y)=>d(m,y)))}e.pass(f);function p(){t.assign(f,!1),t.forOf("v",s,m=>t.if((0,Wi._)`${l()}(${r}, ${m})`,()=>t.assign(f,!0).break()))}o(p,"loopEnum");function d(m,g){let y=i[g];return typeof y=="object"&&y!==null?(0,Wi._)`${l()}(${r}, ${m}[${g}])`:(0,Wi._)`${r} === ${y}`}o(d,"equalCode")}};bl.default=NO});var $h=h(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var CO=vh(),kO=bh(),jO=tl(),qO=il(),MO=sl(),DO=cl(),LO=ll(),FO=fl(),HO=gl(),VO=Sl(),BO=_l(),GO=[CO.default,kO.default,jO.default,qO.default,MO.default,DO.default,LO.default,FO.default,HO.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},VO.default,BO.default];Pl.default=GO});var $l=h(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.validateAdditionalItems=void 0;var Hr=w(),El=k(),UO={message:o(({params:{len:e}})=>(0,Hr.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,Hr._)`{limit: ${e}}`,"params")},ZO={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:UO,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,El.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Oh(e,n)}};function Oh(e,t){let{gen:r,schema:n,data:i,keyword:s,it:a}=e;a.items=!0;let c=r.const("len",(0,Hr._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Hr._)`${c} <= ${t.length}`);else if(typeof n=="object"&&!(0,El.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,Hr._)`${c} <= ${t.length}`);r.if((0,Hr.not)(l),()=>u(l)),e.ok(l)}function u(l){r.forRange("i",t.length,c,f=>{e.subschema({keyword:s,dataProp:f,dataPropType:El.Type.Num},l),a.allErrors||r.if((0,Hr.not)(l),()=>r.break())})}o(u,"validateItems")}o(Oh,"validateAdditionalItems");Yi.validateAdditionalItems=Oh;Yi.default=ZO});var Ol=h(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.validateTuple=void 0;var xh=w(),xs=k(),zO=Ze(),KO={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Ah(e,"additionalItems",t);r.items=!0,!(0,xs.alwaysValidSchema)(r,t)&&e.ok((0,zO.validateArray)(e))}};function Ah(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:c}=e;f(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=xs.mergeEvaluated.items(n,r.length,c.items));let u=n.name("valid"),l=n.const("len",(0,xh._)`${s}.length`);r.forEach((p,d)=>{(0,xs.alwaysValidSchema)(c,p)||(n.if((0,xh._)`${l} > ${d}`,()=>e.subschema({keyword:a,schemaProp:d,dataProp:d},u)),e.ok(u))});function f(p){let{opts:d,errSchemaPath:m}=c,g=r.length,y=g===p.minItems&&(g===p.maxItems||p[t]===!1);if(d.strictTuples&&!y){let v=`"${a}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,xs.checkStrictMode)(c,v,d.strictTuples)}}o(f,"checkStrictTuple")}o(Ah,"validateTuple");Ji.validateTuple=Ah;Ji.default=KO});var wh=h(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});var QO=Ol(),WO={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,QO.validateTuple)(e,"items"),"code")};xl.default=WO});var Th=h(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});var Ih=w(),YO=k(),JO=Ze(),XO=$l(),ex={message:o(({params:{len:e}})=>(0,Ih.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,Ih._)`{limit: ${e}}`,"params")},tx={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ex,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,YO.alwaysValidSchema)(n,t)&&(i?(0,XO.validateAdditionalItems)(e,i):e.ok((0,JO.validateArray)(e)))}};Al.default=tx});var Rh=h(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var Ke=w(),As=k(),rx={message:o(({params:{min:e,max:t}})=>t===void 0?(0,Ke.str)`must contain at least ${e} valid item(s)`:(0,Ke.str)`must contain at least ${e} and no more than ${t} valid item(s)`,"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,Ke._)`{minContains: ${e}}`:(0,Ke._)`{minContains: ${e}, maxContains: ${t}}`,"params")},nx={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:rx,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,a,c,{minContains:u,maxContains:l}=n;s.opts.next?(a=u===void 0?1:u,c=l):a=1;let f=t.const("len",(0,Ke._)`${i}.length`);if(e.setParams({min:a,max:c}),c===void 0&&a===0){(0,As.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,As.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,As.alwaysValidSchema)(s,r)){let y=(0,Ke._)`${f} >= ${a}`;c!==void 0&&(y=(0,Ke._)`${y} && ${f} <= ${c}`),e.pass(y);return}s.items=!0;let p=t.name("valid");c===void 0&&a===1?m(p,()=>t.if(p,()=>t.break())):a===0?(t.let(p,!0),c!==void 0&&t.if((0,Ke._)`${i}.length > 0`,d)):(t.let(p,!1),d()),e.result(p,()=>e.reset());function d(){let y=t.name("_valid"),v=t.let("count",0);m(y,()=>t.if(y,()=>g(v)))}o(d,"validateItemsWithCount");function m(y,v){t.forRange("i",0,f,S=>{e.subschema({keyword:"contains",dataProp:S,dataPropType:As.Type.Num,compositeRule:!0},y),v()})}o(m,"validateItems");function g(y){t.code((0,Ke._)`${y}++`),c===void 0?t.if((0,Ke._)`${y} >= ${a}`,()=>t.assign(p,!0).break()):(t.if((0,Ke._)`${y} > ${c}`,()=>t.assign(p,!1).break()),a===1?t.assign(p,!0):t.if((0,Ke._)`${y} >= ${a}`,()=>t.assign(p,!0)))}o(g,"checkLimits")}};wl.default=nx});var ws=h(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.validateSchemaDeps=bt.validatePropertyDeps=bt.error=void 0;var Il=w(),ix=k(),Xi=Ze();bt.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Il.str)`must have ${n} ${r} when property ${e} is present`},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Il._)`{property: ${e},
|
|
10
10
|
missingProperty: ${n},
|
|
11
11
|
depsCount: ${t},
|
|
12
12
|
deps: ${r}}`,"params")};var ox={keyword:"dependencies",type:"object",schemaType:"object",error:bt.error,code(e){let[t,r]=sx(e);Nh(e,t),Ch(e,r)}};function sx({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}o(sx,"splitDependencies");function Nh(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let a in t){let c=t[a];if(c.length===0)continue;let u=(0,Xi.propertyInData)(r,n,a,i.opts.ownProperties);e.setParams({property:a,depsCount:c.length,deps:c.join(", ")}),i.allErrors?r.if(u,()=>{for(let l of c)(0,Xi.checkReportMissingProp)(e,l)}):(r.if((0,Il._)`${u} && (${(0,Xi.checkMissingProp)(e,c,s)})`),(0,Xi.reportMissingProp)(e,s),r.else())}}o(Nh,"validatePropertyDeps");bt.validatePropertyDeps=Nh;function Ch(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,a=r.name("valid");for(let c in t)(0,ix.alwaysValidSchema)(s,t[c])||(r.if((0,Xi.propertyInData)(r,n,c,s.opts.ownProperties),()=>{let u=e.subschema({keyword:i,schemaProp:c},a);e.mergeValidEvaluated(u,a)},()=>r.var(a,!0)),e.ok(a))}o(Ch,"validateSchemaDeps");bt.validateSchemaDeps=Ch;bt.default=ox});var jh=h(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});var kh=w(),ax=k(),cx={message:"property name must be valid",params:o(({params:e})=>(0,kh._)`{propertyName: ${e.propertyName}}`,"params")},ux={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:cx,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,ax.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),t.if((0,kh.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};Tl.default=ux});var Nl=h(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var Is=Ze(),st=w(),lx=Ue(),Ts=k(),px={message:"must NOT have additional properties",params:o(({params:e})=>(0,st._)`{additionalProperty: ${e.additionalProperty}}`,"params")},fx={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:px,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,Ts.alwaysValidSchema)(a,r))return;let l=(0,Is.allSchemaProperties)(n.properties),f=(0,Is.allSchemaProperties)(n.patternProperties);p(),e.ok((0,st._)`${s} === ${lx.default.errors}`);function p(){t.forIn("key",i,v=>{!l.length&&!f.length?g(v):t.if(d(v),()=>g(v))})}o(p,"checkAdditionalProperties");function d(v){let S;if(l.length>8){let b=(0,Ts.schemaRefOrVal)(a,n.properties,"properties");S=(0,Is.isOwnProperty)(t,b,v)}else l.length?S=(0,st.or)(...l.map(b=>(0,st._)`${v} === ${b}`)):S=st.nil;return f.length&&(S=(0,st.or)(S,...f.map(b=>(0,st._)`${(0,Is.usePattern)(e,b)}.test(${v})`))),(0,st.not)(S)}o(d,"isAdditional");function m(v){t.code((0,st._)`delete ${i}[${v}]`)}o(m,"deleteAdditional");function g(v){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){m(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),c||t.break();return}if(typeof r=="object"&&!(0,Ts.alwaysValidSchema)(a,r)){let S=t.name("valid");u.removeAdditional==="failing"?(y(v,S,!1),t.if((0,st.not)(S),()=>{e.reset(),m(v)})):(y(v,S),c||t.if((0,st.not)(S),()=>t.break()))}}o(g,"additionalPropertyCode");function y(v,S,b){let P={keyword:"additionalProperties",dataProp:v,dataPropType:Ts.Type.Str};b===!1&&Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(P,S)}o(y,"applyAdditionalSchema")}};Rl.default=fx});var Dh=h(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});var dx=Mi(),qh=Ze(),Cl=k(),Mh=Nl(),mx={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Mh.default.code(new dx.KeywordCxt(s,Mh.default,"additionalProperties"));let a=(0,qh.allSchemaProperties)(r);for(let p of a)s.definedProperties.add(p);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=Cl.mergeEvaluated.props(t,(0,Cl.toHash)(a),s.props));let c=a.filter(p=>!(0,Cl.alwaysValidSchema)(s,r[p]));if(c.length===0)return;let u=t.name("valid");for(let p of c)l(p)?f(p):(t.if((0,qh.propertyInData)(t,i,p,s.opts.ownProperties)),f(p),s.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(u);function l(p){return s.opts.useDefaults&&!s.compositeRule&&r[p].default!==void 0}o(l,"hasDefault");function f(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},u)}o(f,"applyPropertySchema")}};kl.default=mx});var Vh=h(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var Lh=Ze(),Rs=w(),Fh=k(),Hh=k(),hx={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:a}=s,c=(0,Lh.allSchemaProperties)(r),u=c.filter(y=>(0,Fh.alwaysValidSchema)(s,r[y]));if(c.length===0||u.length===c.length&&(!s.opts.unevaluated||s.props===!0))return;let l=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=t.name("valid");s.props!==!0&&!(s.props instanceof Rs.Name)&&(s.props=(0,Hh.evaluatedPropsToName)(t,s.props));let{props:p}=s;d();function d(){for(let y of c)l&&m(y),s.allErrors?g(y):(t.var(f,!0),g(y),t.if(f))}o(d,"validatePatternProperties");function m(y){for(let v in l)new RegExp(y).test(v)&&(0,Fh.checkStrictMode)(s,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}o(m,"checkMatchingProperties");function g(y){t.forIn("key",n,v=>{t.if((0,Rs._)`${(0,Lh.usePattern)(e,y)}.test(${v})`,()=>{let S=u.includes(y);S||e.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:Hh.Type.Str},f),s.opts.unevaluated&&p!==!0?t.assign((0,Rs._)`${p}[${v}]`,!0):!S&&!s.allErrors&&t.if((0,Rs.not)(f),()=>t.break())})})}o(g,"validateProperties")}};jl.default=hx});var Bh=h(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});var gx=k(),yx={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,gx.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};ql.default=yx});var Gh=h(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var vx=Ze(),Sx={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:vx.validateUnion,error:{message:"must match a schema in anyOf"}};Ml.default=Sx});var Uh=h(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var Ns=w(),bx=k(),_x={message:"must match exactly one schema in oneOf",params:o(({params:e})=>(0,Ns._)`{passingSchemas: ${e.passing}}`,"params")},Px={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:_x,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=t.let("valid",!1),c=t.let("passing",null),u=t.name("_valid");e.setParams({passing:c}),t.block(l),e.result(a,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((f,p)=>{let d;(0,bx.alwaysValidSchema)(i,f)?t.var(u,!0):d=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},u),p>0&&t.if((0,Ns._)`${u} && ${a}`).assign(a,!1).assign(c,(0,Ns._)`[${c}, ${p}]`).else(),t.if(u,()=>{t.assign(a,!0),t.assign(c,p),d&&e.mergeEvaluated(d,Ns.Name)})})}o(l,"validateOneOf")}};Dl.default=Px});var Zh=h(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var Ex=k(),$x={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,a)=>{if((0,Ex.alwaysValidSchema)(n,s))return;let c=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(c)})}};Ll.default=$x});var Qh=h(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var Cs=w(),Kh=k(),Ox={message:o(({params:e})=>(0,Cs.str)`must match "${e.ifClause}" schema`,"message"),params:o(({params:e})=>(0,Cs._)`{failingKeyword: ${e.ifClause}}`,"params")},xx={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Ox,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Kh.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=zh(n,"then"),s=zh(n,"else");if(!i&&!s)return;let a=t.let("valid",!0),c=t.name("_valid");if(u(),e.reset(),i&&s){let f=t.let("ifClause");e.setParams({ifClause:f}),t.if(c,l("then",f),l("else",f))}else i?t.if(c,l("then")):t.if((0,Cs.not)(c),l("else"));e.pass(a,()=>e.error(!0));function u(){let f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(f)}o(u,"validateIf");function l(f,p){return()=>{let d=e.subschema({keyword:f},c);t.assign(a,c),e.mergeValidEvaluated(d,a),p?t.assign(p,(0,Cs._)`${f}`):e.setParams({ifClause:f})}}o(l,"validateClause")}};function zh(e,t){let r=e.schema[t];return r!==void 0&&!(0,Kh.alwaysValidSchema)(e,r)}o(zh,"hasSchema");Fl.default=xx});var Wh=h(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var Ax=k(),wx={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Ax.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Hl.default=wx});var Bl=h(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var Ix=$l(),Tx=wh(),Rx=Ol(),Nx=Th(),Cx=Rh(),kx=ws(),jx=jh(),qx=Nl(),Mx=Dh(),Dx=Vh(),Lx=Bh(),Fx=Gh(),Hx=Uh(),Vx=Zh(),Bx=Qh(),Gx=Wh();function Ux(e=!1){let t=[Lx.default,Fx.default,Hx.default,Vx.default,Bx.default,Gx.default,jx.default,qx.default,kx.default,Mx.default,Dx.default];return e?t.push(Tx.default,Nx.default):t.push(Ix.default,Rx.default),t.push(Cx.default),t}o(Ux,"getApplicator");Vl.default=Ux});var Yh=h(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var X=w(),Zx={message:o(({schemaCode:e})=>(0,X.str)`must match format "${e}"`,"message"),params:o(({schemaCode:e})=>(0,X._)`{format: ${e}}`,"params")},zx={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Zx,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:f,self:p}=c;if(!u.validateFormats)return;i?d():m();function d(){let g=r.scopeValue("formats",{ref:p.formats,code:u.code.formats}),y=r.const("fDef",(0,X._)`${g}[${a}]`),v=r.let("fType"),S=r.let("format");r.if((0,X._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(v,(0,X._)`${y}.type || "string"`).assign(S,(0,X._)`${y}.validate`),()=>r.assign(v,(0,X._)`"string"`).assign(S,y)),e.fail$data((0,X.or)(b(),P()));function b(){return u.strictSchema===!1?X.nil:(0,X._)`${a} && !${S}`}o(b,"unknownFmt");function P(){let E=f.$async?(0,X._)`(${y}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,X._)`${S}(${n})`,_=(0,X._)`(typeof ${S} == "function" ? ${E} : ${S}.test(${n}))`;return(0,X._)`${S} && ${S} !== true && ${v} === ${t} && !${_}`}o(P,"invalidFmt")}o(d,"validate$DataFormat");function m(){let g=p.formats[s];if(!g){b();return}if(g===!0)return;let[y,v,S]=P(g);y===t&&e.pass(E());function b(){if(u.strictSchema===!1){p.logger.warn(_());return}throw new Error(_());function _(){return`unknown format "${s}" ignored in schema at path "${l}"`}}o(b,"unknownFormat");function P(_){let T=_ instanceof RegExp?(0,X.regexpCode)(_):u.code.formats?(0,X._)`${u.code.formats}${(0,X.getProperty)(s)}`:void 0,N=r.scopeValue("formats",{key:s,ref:_,code:T});return typeof _=="object"&&!(_ instanceof RegExp)?[_.type||"string",_.validate,(0,X._)`${N}.validate`]:["string",_,N]}o(P,"getFormat");function E(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!f.$async)throw new Error("async format in sync schema");return(0,X._)`await ${S}(${n})`}return typeof v=="function"?(0,X._)`${S}(${n})`:(0,X._)`${S}.test(${n})`}o(E,"validCondition")}o(m,"validateFormat")}};Gl.default=zx});var Zl=h(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var Kx=Yh(),Qx=[Kx.default];Ul.default=Qx});var Jh=h(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var Wx=yh(),Yx=$h(),Jx=Bl(),Xx=Zl(),eA=["title","description","default"],tA=[Wx.default,Yx.default,Jx.default(),Xx.default,eA];zl.default=tA});var eg=h(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.DiscrError=void 0;var Xh;(function(e){e.Tag="tag",e.Mapping="mapping"})(Xh||(ks.DiscrError=Xh={}))});var Wl=h(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});var kn=w(),Kl=eg(),tg=Li(),rA=Di(),nA=k(),iA={message:o(({params:{discrError:e,tagName:t}})=>e===Kl.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,"message"),params:o(({params:{discrError:e,tag:t,tagName:r}})=>(0,kn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`,"params")},oA={keyword:"discriminator",type:"object",schemaType:"object",error:iA,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let u=t.let("valid",!1),l=t.const("tag",(0,kn._)`${r}${(0,kn.getProperty)(c)}`);t.if((0,kn._)`typeof ${l} == "string"`,()=>f(),()=>e.error(!1,{discrError:Kl.DiscrError.Tag,tag:l,tagName:c})),e.ok(u);function f(){let m=d();t.if(!1);for(let g in m)t.elseIf((0,kn._)`${l} === ${g}`),t.assign(u,p(m[g]));t.else(),e.error(!1,{discrError:Kl.DiscrError.Mapping,tag:l,tagName:c}),t.endIf()}o(f,"validateMapping");function p(m){let g=t.name("valid"),y=e.subschema({keyword:"oneOf",schemaProp:m},g);return e.mergeEvaluated(y,kn.Name),g}o(p,"applyTagSchema");function d(){var m;let g={},y=S(i),v=!0;for(let E=0;E<a.length;E++){let _=a[E];if(_!=null&&_.$ref&&!(0,nA.schemaHasRulesButRef)(_,s.self.RULES)){let N=_.$ref;if(_=tg.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,N),_ instanceof tg.SchemaEnv&&(_=_.schema),_===void 0)throw new rA.default(s.opts.uriResolver,s.baseId,N)}let T=(m=_==null?void 0:_.properties)===null||m===void 0?void 0:m[c];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);v=v&&(y||S(_)),b(T,E)}if(!v)throw new Error(`discriminator: "${c}" must be required`);return g;function S({required:E}){return Array.isArray(E)&&E.includes(c)}function b(E,_){if(E.const)P(E.const,_);else if(E.enum)for(let T of E.enum)P(T,_);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function P(E,_){if(typeof E!="string"||E in g)throw new Error(`discriminator: "${c}" values must be unique strings`);g[E]=_}}o(d,"getMapping")}};Ql.default=oA});var rg=h((rD,sA)=>{sA.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}});var og=h((ne,ig)=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.CodeGen=ne.Name=ne.nil=ne.stringify=ne.str=ne._=ne.KeywordCxt=void 0;var aA=Nn(),cA=Jh(),uA=Wl(),ng=rg(),lA=["/properties"],js="http://json-schema.org/draft-04/schema",Yl=class Yl extends aA.default{constructor(t={}){super({...t,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),cA.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(uA.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(ng,lA):ng;this.addMetaSchema(t,js,!1),this.refs["http://json-schema.org/schema"]=js}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(js)?js:void 0)}};o(Yl,"Ajv");var qs=Yl;ig.exports=ne=qs;Object.defineProperty(ne,"__esModule",{value:!0});ne.default=qs;var pA=Nn();Object.defineProperty(ne,"KeywordCxt",{enumerable:!0,get:o(function(){return pA.KeywordCxt},"get")});var jn=Nn();Object.defineProperty(ne,"_",{enumerable:!0,get:o(function(){return jn._},"get")});Object.defineProperty(ne,"str",{enumerable:!0,get:o(function(){return jn.str},"get")});Object.defineProperty(ne,"stringify",{enumerable:!0,get:o(function(){return jn.stringify},"get")});Object.defineProperty(ne,"nil",{enumerable:!0,get:o(function(){return jn.nil},"get")});Object.defineProperty(ne,"Name",{enumerable:!0,get:o(function(){return jn.Name},"get")});Object.defineProperty(ne,"CodeGen",{enumerable:!0,get:o(function(){return jn.CodeGen},"get")})});var sg=h(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var fA={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Jl.default=fA});var ag=h(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var dA=sg(),mA=Gi(),hA=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",dA.default,mA.default];Xl.default=hA});var cg=h(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});var Ms=w(),or=Ms.operators,Ds={maximum:{okStr:"<=",ok:or.LTE,fail:or.GT},minimum:{okStr:">=",ok:or.GTE,fail:or.LT},exclusiveMaximum:{okStr:"<",ok:or.LT,fail:or.GTE},exclusiveMinimum:{okStr:">",ok:or.GT,fail:or.LTE}},gA={message:o(({keyword:e,schemaCode:t})=>(0,Ms.str)`must be ${Ds[e].okStr} ${t}`,"message"),params:o(({keyword:e,schemaCode:t})=>(0,Ms._)`{comparison: ${Ds[e].okStr}, limit: ${t}}`,"params")},yA={keyword:Object.keys(Ds),type:"number",schemaType:"number",$data:!0,error:gA,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Ms._)`${r} ${Ds[t].fail} ${n} || isNaN(${r})`)}};ep.default=yA});var ug=h(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var vA=cg(),SA=tl(),bA=il(),_A=sl(),PA=cl(),EA=ll(),$A=fl(),OA=gl(),xA=Sl(),AA=_l(),wA=[vA.default,SA.default,bA.default,_A.default,PA.default,EA.default,$A.default,OA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},xA.default,AA.default];tp.default=wA});var np=h(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.dynamicAnchor=void 0;var rp=w(),IA=Ue(),lg=Li(),TA=Gi(),RA={keyword:"$dynamicAnchor",schemaType:"string",code:o(e=>pg(e,e.schema),"code")};function pg(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let i=(0,rp._)`${IA.default.dynamicAnchors}${(0,rp.getProperty)(t)}`,s=n.errSchemaPath==="#"?n.validateName:NA(e);r.if((0,rp._)`!${i}`,()=>r.assign(i,s))}o(pg,"dynamicAnchor");eo.dynamicAnchor=pg;function NA(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:i,baseId:s,localRefs:a,meta:c}=t.root,{schemaId:u}=n.opts,l=new lg.SchemaEnv({schema:r,schemaId:u,root:i,baseId:s,localRefs:a,meta:c});return lg.compileSchema.call(n,l),(0,TA.getValidate)(e,l)}o(NA,"_getValidate");eo.default=RA});var ip=h(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.dynamicRef=void 0;var fg=w(),CA=Ue(),dg=Gi(),kA={keyword:"$dynamicRef",schemaType:"string",code:o(e=>mg(e,e.schema),"code")};function mg(e,t){let{gen:r,keyword:n,it:i}=e;if(t[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let s=t.slice(1);if(i.allErrors)a();else{let u=r.let("valid",!1);a(u),e.ok(u)}function a(u){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",(0,fg._)`${CA.default.dynamicAnchors}${(0,fg.getProperty)(s)}`);r.if(l,c(l,u),c(i.validateName,u))}else c(i.validateName,u)()}o(a,"_dynamicRef");function c(u,l){return l?()=>r.block(()=>{(0,dg.callRef)(e,u),r.let(l,!0)}):()=>(0,dg.callRef)(e,u)}o(c,"_callRef")}o(mg,"dynamicRef");to.dynamicRef=mg;to.default=kA});var hg=h(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var jA=np(),qA=k(),MA={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,jA.dynamicAnchor)(e,""):(0,qA.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};op.default=MA});var gg=h(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});var DA=ip(),LA={keyword:"$recursiveRef",schemaType:"string",code:o(e=>(0,DA.dynamicRef)(e,e.schema),"code")};sp.default=LA});var yg=h(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var FA=np(),HA=ip(),VA=hg(),BA=gg(),GA=[FA.default,HA.default,VA.default,BA.default];ap.default=GA});var Sg=h(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});var vg=ws(),UA={keyword:"dependentRequired",type:"object",schemaType:"object",error:vg.error,code:o(e=>(0,vg.validatePropertyDeps)(e),"code")};cp.default=UA});var bg=h(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var ZA=ws(),zA={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o(e=>(0,ZA.validateSchemaDeps)(e),"code")};up.default=zA});var _g=h(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});var KA=k(),QA={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){t.contains===void 0&&(0,KA.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}};lp.default=QA});var Pg=h(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var WA=Sg(),YA=bg(),JA=_g(),XA=[WA.default,YA.default,JA.default];pp.default=XA});var $g=h(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var sr=w(),Eg=k(),ew=Ue(),tw={message:"must NOT have unevaluated properties",params:o(({params:e})=>(0,sr._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`,"params")},rw={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:tw,code(e){let{gen:t,schema:r,data:n,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,props:c}=s;c instanceof sr.Name?t.if((0,sr._)`${c} !== true`,()=>t.forIn("key",n,p=>t.if(l(c,p),()=>u(p)))):c!==!0&&t.forIn("key",n,p=>c===void 0?u(p):t.if(f(c,p),()=>u(p))),s.props=!0,e.ok((0,sr._)`${i} === ${ew.default.errors}`);function u(p){if(r===!1){e.setParams({unevaluatedProperty:p}),e.error(),a||t.break();return}if(!(0,Eg.alwaysValidSchema)(s,r)){let d=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:Eg.Type.Str},d),a||t.if((0,sr.not)(d),()=>t.break())}}o(u,"unevaluatedPropCode");function l(p,d){return(0,sr._)`!${p} || !${p}[${d}]`}o(l,"unevaluatedDynamic");function f(p,d){let m=[];for(let g in p)p[g]===!0&&m.push((0,sr._)`${d} !== ${g}`);return(0,sr.and)(...m)}o(f,"unevaluatedStatic")}};fp.default=rw});var xg=h(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var Vr=w(),Og=k(),nw={message:o(({params:{len:e}})=>(0,Vr.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,Vr._)`{limit: ${e}}`,"params")},iw={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:nw,code(e){let{gen:t,schema:r,data:n,it:i}=e,s=i.items||0;if(s===!0)return;let a=t.const("len",(0,Vr._)`${n}.length`);if(r===!1)e.setParams({len:s}),e.fail((0,Vr._)`${a} > ${s}`);else if(typeof r=="object"&&!(0,Og.alwaysValidSchema)(i,r)){let u=t.var("valid",(0,Vr._)`${a} <= ${s}`);t.if((0,Vr.not)(u),()=>c(u,s)),e.ok(u)}i.items=!0;function c(u,l){t.forRange("i",l,a,f=>{e.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:Og.Type.Num},u),i.allErrors||t.if((0,Vr.not)(u),()=>t.break())})}o(c,"validateItems")}};dp.default=iw});var Ag=h(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var ow=$g(),sw=xg(),aw=[ow.default,sw.default];mp.default=aw});var wg=h(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.contentVocabulary=qn.metadataVocabulary=void 0;qn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];qn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Tg=h(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});var cw=ag(),uw=ug(),lw=Bl(),pw=yg(),fw=Pg(),dw=Ag(),mw=Zl(),Ig=wg(),hw=[pw.default,cw.default,uw.default,(0,lw.default)(!0),mw.default,Ig.metadataVocabulary,Ig.contentVocabulary,fw.default,dw.default];hp.default=hw});var Rg=h((TD,gw)=>{gw.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}}}});var Ng=h((RD,yw)=>{yw.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"}}}}});var Cg=h((ND,vw)=>{vw.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"}}}});var kg=h((CD,Sw)=>{Sw.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"}}}});var jg=h((kD,bw)=>{bw.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"}}}});var qg=h((jD,_w)=>{_w.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"}}}});var Mg=h((qD,Pw)=>{Pw.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}}}});var Dg=h((MD,Ew)=>{Ew.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:[]}}}});var Lg=h(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var $w=Rg(),Ow=Ng(),xw=Cg(),Aw=kg(),ww=jg(),Iw=qg(),Tw=Mg(),Rw=Dg(),Nw=["/properties"];function Cw(e){return[$w,Ow,xw,Aw,ww,t(this,Iw),Tw,t(this,Rw)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,Nw):n}o(t,"with$data")}o(Cw,"addMetaSchema2020");gp.default=Cw});var Fg=h((U,vp)=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.MissingRefError=U.ValidationError=U.CodeGen=U.Name=U.nil=U.stringify=U.str=U._=U.KeywordCxt=U.Ajv2020=void 0;var kw=Nn(),jw=Tg(),qw=Wl(),Mw=Lg(),yp="https://json-schema.org/draft/2020-12/schema",Sp=class Sp extends kw.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),jw.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(qw.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(Mw.default.call(this,t),this.refs["http://json-schema.org/schema"]=yp)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(yp)?yp:void 0)}};o(Sp,"Ajv2020");var Mn=Sp;U.Ajv2020=Mn;vp.exports=U=Mn;vp.exports.Ajv2020=Mn;Object.defineProperty(U,"__esModule",{value:!0});U.default=Mn;var Dw=Mi();Object.defineProperty(U,"KeywordCxt",{enumerable:!0,get:o(function(){return Dw.KeywordCxt},"get")});var Dn=w();Object.defineProperty(U,"_",{enumerable:!0,get:o(function(){return Dn._},"get")});Object.defineProperty(U,"str",{enumerable:!0,get:o(function(){return Dn.str},"get")});Object.defineProperty(U,"stringify",{enumerable:!0,get:o(function(){return Dn.stringify},"get")});Object.defineProperty(U,"nil",{enumerable:!0,get:o(function(){return Dn.nil},"get")});Object.defineProperty(U,"Name",{enumerable:!0,get:o(function(){return Dn.Name},"get")});Object.defineProperty(U,"CodeGen",{enumerable:!0,get:o(function(){return Dn.CodeGen},"get")});var Lw=gs();Object.defineProperty(U,"ValidationError",{enumerable:!0,get:o(function(){return Lw.default},"get")});var Fw=Di();Object.defineProperty(U,"MissingRefError",{enumerable:!0,get:o(function(){return Fw.default},"get")})});var Hg=h((HD,Hw)=>{Hw.exports={id:"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/apiDeclaration.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swaggerVersion","basePath","apis"],properties:{swaggerVersion:{enum:["1.2"]},apiVersion:{type:"string"},basePath:{type:"string",format:"uri",pattern:"^https?://"},resourcePath:{type:"string",format:"uri",pattern:"^/"},apis:{type:"array",items:{$ref:"#/definitions/apiObject"}},models:{type:"object",additionalProperties:{$ref:"modelsObject.json#"}},produces:{$ref:"#/definitions/mimeTypeArray"},consumes:{$ref:"#/definitions/mimeTypeArray"},authorizations:{$ref:"authorizationObject.json#"}},additionalProperties:!1,definitions:{apiObject:{type:"object",required:["path","operations"],properties:{path:{type:"string",format:"uri-template",pattern:"^/"},description:{type:"string"},operations:{type:"array",items:{$ref:"operationObject.json#"}}},additionalProperties:!1},mimeTypeArray:{type:"array",items:{type:"string",format:"mime-type"},uniqueItems:!0}}}});var Vg=h((VD,Vw)=>{Vw.exports={title:"A JSON Schema for Swagger 2.0 API.",id:"http://swagger.io/v2/schema.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swagger","info","paths"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{swagger:{type:"string",enum:["2.0"],description:"The Swagger version of this document."},info:{$ref:"#/definitions/info"},host:{type:"string",pattern:"^[^{}/ :\\\\]+(?::\\d+)?$",description:"The host (name or ip) of the API. Example: 'swagger.io'"},basePath:{type:"string",pattern:"^/",description:"The base path to the API. Example: '/api'."},schemes:{$ref:"#/definitions/schemesList"},consumes:{description:"A list of MIME types accepted by the API.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},produces:{description:"A list of MIME types the API can produce.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},paths:{$ref:"#/definitions/paths"},definitions:{$ref:"#/definitions/definitions"},parameters:{$ref:"#/definitions/parameterDefinitions"},responses:{$ref:"#/definitions/responseDefinitions"},security:{$ref:"#/definitions/security"},securityDefinitions:{$ref:"#/definitions/securityDefinitions"},tags:{type:"array",items:{$ref:"#/definitions/tag"},uniqueItems:!0},externalDocs:{$ref:"#/definitions/externalDocs"}},definitions:{info:{type:"object",description:"General information about the API.",required:["version","title"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{title:{type:"string",description:"A unique and precise title of the API."},version:{type:"string",description:"A semantic version number of the API."},description:{type:"string",description:"A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."},termsOfService:{type:"string",description:"The terms of service for the API."},contact:{$ref:"#/definitions/contact"},license:{$ref:"#/definitions/license"}}},contact:{type:"object",description:"Contact information for the owners of the API.",additionalProperties:!1,properties:{name:{type:"string",description:"The identifying name of the contact person/organization."},url:{type:"string",description:"The URL pointing to the contact information.",format:"uri"},email:{type:"string",description:"The email address of the contact person/organization.",format:"email"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},license:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"The name of the license type. It's encouraged to use an OSI compatible license."},url:{type:"string",description:"The URL pointing to the license.",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},paths:{type:"object",description:"Relative paths to the individual endpoints. They must be relative to the 'basePath'.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"},"^/":{$ref:"#/definitions/pathItem"}},additionalProperties:!1},definitions:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},description:"One or more JSON objects describing the schemas being consumed and produced by the API."},parameterDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/parameter"},description:"One or more JSON representations for parameters"},responseDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/response"},description:"One or more JSON representations for responses"},externalDocs:{type:"object",additionalProperties:!1,description:"information about external documentation",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},examples:{type:"object",additionalProperties:!0},mimeType:{type:"string",description:"The MIME type of the HTTP message."},operation:{type:"object",required:["responses"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{tags:{type:"array",items:{type:"string"},uniqueItems:!0},summary:{type:"string",description:"A brief summary of the operation."},description:{type:"string",description:"A longer description of the operation, GitHub Flavored Markdown is allowed."},externalDocs:{$ref:"#/definitions/externalDocs"},operationId:{type:"string",description:"A unique identifier of the operation."},produces:{description:"A list of MIME types the API can produce.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},consumes:{description:"A list of MIME types the API can consume.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},parameters:{$ref:"#/definitions/parametersList"},responses:{$ref:"#/definitions/responses"},schemes:{$ref:"#/definitions/schemesList"},deprecated:{type:"boolean",default:!1},security:{$ref:"#/definitions/security"}}},pathItem:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},get:{$ref:"#/definitions/operation"},put:{$ref:"#/definitions/operation"},post:{$ref:"#/definitions/operation"},delete:{$ref:"#/definitions/operation"},options:{$ref:"#/definitions/operation"},head:{$ref:"#/definitions/operation"},patch:{$ref:"#/definitions/operation"},parameters:{$ref:"#/definitions/parametersList"}}},responses:{type:"object",description:"Response objects names can either be any valid HTTP status code or 'default'.",minProperties:1,additionalProperties:!1,patternProperties:{"^([0-9]{3})$|^(default)$":{$ref:"#/definitions/responseValue"},"^x-":{$ref:"#/definitions/vendorExtension"}},not:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}}},responseValue:{oneOf:[{$ref:"#/definitions/response"},{$ref:"#/definitions/jsonReference"}]},response:{type:"object",required:["description"],properties:{description:{type:"string"},schema:{oneOf:[{$ref:"#/definitions/schema"},{$ref:"#/definitions/fileSchema"}]},headers:{$ref:"#/definitions/headers"},examples:{$ref:"#/definitions/examples"}},additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},headers:{type:"object",additionalProperties:{$ref:"#/definitions/header"}},header:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},vendorExtension:{description:"Any property starting with x- is valid.",additionalProperties:!0,additionalItems:!0},bodyParameter:{type:"object",required:["name","in","schema"],patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},in:{type:"string",description:"Determines the location of the parameter.",enum:["body"]},required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},schema:{$ref:"#/definitions/schema"}},additionalProperties:!1},headerParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["header"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},queryParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["query"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean",default:!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},formDataParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["formData"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean",default:!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string",enum:["string","number","boolean","integer","array","file"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},pathParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["required"],properties:{required:{type:"boolean",enum:[!0],description:"Determines whether or not this parameter is required or optional."},in:{type:"string",description:"Determines the location of the parameter.",enum:["path"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},nonBodyParameter:{type:"object",required:["name","in","type"],oneOf:[{$ref:"#/definitions/headerParameterSubSchema"},{$ref:"#/definitions/formDataParameterSubSchema"},{$ref:"#/definitions/queryParameterSubSchema"},{$ref:"#/definitions/pathParameterSubSchema"}]},parameter:{oneOf:[{$ref:"#/definitions/bodyParameter"},{$ref:"#/definitions/nonBodyParameter"}]},schema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},maxProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},enum:{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},additionalProperties:{anyOf:[{$ref:"#/definitions/schema"},{type:"boolean"}],default:{}},type:{$ref:"http://json-schema.org/draft-04/schema#/properties/type"},items:{anyOf:[{$ref:"#/definitions/schema"},{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}}],default:{}},allOf:{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}},properties:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},default:{}},discriminator:{type:"string"},readOnly:{type:"boolean",default:!1},xml:{$ref:"#/definitions/xml"},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},fileSchema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["type"],properties:{format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},type:{type:"string",enum:["file"]},readOnly:{type:"boolean",default:!1},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},primitivesItems:{type:"object",additionalProperties:!1,properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},security:{type:"array",items:{$ref:"#/definitions/securityRequirement"},uniqueItems:!0},securityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"},uniqueItems:!0}},xml:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},tag:{type:"object",additionalProperties:!1,required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/externalDocs"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},securityDefinitions:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/basicAuthenticationSecurity"},{$ref:"#/definitions/apiKeySecurity"},{$ref:"#/definitions/oauth2ImplicitSecurity"},{$ref:"#/definitions/oauth2PasswordSecurity"},{$ref:"#/definitions/oauth2ApplicationSecurity"},{$ref:"#/definitions/oauth2AccessCodeSecurity"}]}},basicAuthenticationSecurity:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string",enum:["basic"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},apiKeySecurity:{type:"object",additionalProperties:!1,required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ImplicitSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["implicit"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2PasswordSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["password"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ApplicationSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["application"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2AccessCodeSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["accessCode"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2Scopes:{type:"object",additionalProperties:{type:"string"}},mediaTypeList:{type:"array",items:{$ref:"#/definitions/mimeType"},uniqueItems:!0},parametersList:{type:"array",description:"The parameters needed to send a valid API call.",additionalItems:!1,items:{oneOf:[{$ref:"#/definitions/parameter"},{$ref:"#/definitions/jsonReference"}]},uniqueItems:!0},schemesList:{type:"array",description:"The transfer protocol of the API.",items:{type:"string",enum:["http","https","ws","wss"]},uniqueItems:!0},collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes"],default:"csv"},collectionFormatWithMulti:{type:"string",enum:["csv","ssv","tsv","pipes","multi"],default:"csv"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},enum:{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},jsonReference:{type:"object",required:["$ref"],additionalProperties:!1,properties:{$ref:{type:"string"}}}}}});var Bg=h((BD,Bw)=>{Bw.exports={id:"https://spec.openapis.org/oas/3.0/schema/2019-04-02",$schema:"http://json-schema.org/draft-04/schema#",description:"Validation schema for OpenAPI Specification 3.0.X.",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{enum:["bearer"]}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{enum:["bearer"]}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{$ref:"#/definitions/Header"}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}}});var Gg=h((GD,Gw)=>{Gw.exports={$id:"https://spec.openapis.org/oas/3.1/schema/2021-04-15",$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{openapi:{type:"string",pattern:"^3\\.1\\.\\d+(-.+)?$"},info:{$ref:"#/$defs/info"},jsonSchemaDialect:{$ref:"#/$defs/uri",default:"https://spec.openapis.org/oas/3.1/dialect/base"},servers:{type:"array",items:{$ref:"#/$defs/server"}},paths:{$ref:"#/$defs/paths"},webhooks:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},components:{$ref:"#/$defs/components"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},tags:{type:"array",items:{$ref:"#/$defs/tag"}},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["openapi","info"],anyOf:[{required:["paths"]},{required:["components"]},{required:["webhooks"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{info:{type:"object",properties:{title:{type:"string"},summary:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:{$ref:"#/$defs/contact"},license:{$ref:"#/$defs/license"},version:{type:"string"}},required:["title","version"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},contact:{type:"object",properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},license:{type:"object",properties:{name:{type:"string"},identifier:{type:"string"},url:{$ref:"#/$defs/uri"}},required:["name"],oneOf:[{required:["identifier"]},{required:["url"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},server:{type:"object",properties:{url:{$ref:"#/$defs/uri"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/$defs/server-variable"}}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"server-variable":{type:"object",properties:{enum:{type:"array",items:{type:"string"},minItems:1},default:{type:"string"},descriptions:{type:"string"}},required:["default"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},components:{type:"object",properties:{schemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"}},responses:{type:"object",additionalProperties:{$ref:"#/$defs/response-or-reference"}},parameters:{type:"object",additionalProperties:{$ref:"#/$defs/parameter-or-reference"}},examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}},requestBodies:{type:"object",additionalProperties:{$ref:"#/$defs/request-body-or-reference"}},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},securitySchemes:{type:"object",additionalProperties:{$ref:"#/$defs/security-scheme-or-reference"}},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},pathItems:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}}},patternProperties:{"^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$":{$comment:"Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",propertyNames:{pattern:"^[a-zA-Z0-9._-]+$"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},paths:{type:"object",patternProperties:{"^/":{$ref:"#/$defs/path-item"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item":{type:"object",properties:{summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/$defs/server"}},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/$defs/operation"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/path-item"}},operation:{type:"object",properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"},operationId:{type:"string"},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}},requestBody:{$ref:"#/$defs/request-body-or-reference"},responses:{$ref:"#/$defs/responses"},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},deprecated:{default:!1,type:"boolean"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},servers:{type:"array",items:{$ref:"#/$defs/server"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"external-documentation":{type:"object",properties:{description:{type:"string"},url:{$ref:"#/$defs/uri"}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},parameter:{type:"object",properties:{name:{type:"string"},in:{enum:["query","header","path","cookie"]},description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},allowEmptyValue:{default:!1,type:"boolean"},schema:{$dynamicRef:"#meta"},content:{$ref:"#/$defs/content"}},required:["in"],oneOf:[{required:["schema"]},{required:["content"]}],dependentSchemas:{schema:{properties:{style:{type:"string"},explode:{type:"boolean"},allowReserved:{default:!1,type:"boolean"}},allOf:[{$ref:"#/$defs/examples"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-form"}],$defs:{"styles-for-path":{if:{properties:{in:{const:"path"}},required:["in"]},then:{properties:{style:{default:"simple",enum:["matrix","label","simple"]},required:{const:!0}},required:["required"]}},"styles-for-header":{if:{properties:{in:{const:"header"}},required:["in"]},then:{properties:{style:{default:"simple",enum:["simple"]}}}},"styles-for-query":{if:{properties:{in:{const:"query"}},required:["in"]},then:{properties:{style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]}}}},"styles-for-cookie":{if:{properties:{in:{const:"cookie"}},required:["in"]},then:{properties:{style:{default:"form",enum:["form"]}}}},"styles-for-form":{if:{properties:{style:{const:"form"}},required:["style"]},then:{properties:{explode:{default:!0}}},else:{properties:{explode:{default:!1}}}}}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"parameter-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/parameter"}},"request-body":{type:"object",properties:{description:{type:"string"},content:{$ref:"#/$defs/content"},required:{default:!1,type:"boolean"}},required:["content"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"request-body-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/request-body"}},content:{type:"object",additionalProperties:{$ref:"#/$defs/media-type"},propertyNames:{format:"media-range"}},"media-type":{type:"object",properties:{schema:{$dynamicRef:"#meta"},encoding:{type:"object",additionalProperties:{$ref:"#/$defs/encoding"}}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/examples"}],unevaluatedProperties:!1},encoding:{type:"object",properties:{contentType:{type:"string",format:"media-range"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{default:!1,type:"boolean"}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/encoding/$defs/explode-default"}],unevaluatedProperties:!1,$defs:{"explode-default":{if:{properties:{style:{const:"form"}},required:["style"]},then:{properties:{explode:{default:!0}}},else:{properties:{explode:{default:!1}}}}}},responses:{type:"object",properties:{default:{$ref:"#/$defs/response-or-reference"}},patternProperties:{"^[1-5][0-9X]{2}$":{$ref:"#/$defs/response-or-reference"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},response:{type:"object",properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},content:{$ref:"#/$defs/content"},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}}},required:["description"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"response-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/response"}},callbacks:{type:"object",$ref:"#/$defs/specification-extensions",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},"callbacks-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/callbacks"}},example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:!0,externalValue:{$ref:"#/$defs/uri"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"example-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/example"}},link:{type:"object",properties:{operationRef:{$ref:"#/$defs/uri"},operationId:!0,parameters:{$ref:"#/$defs/map-of-strings"},requestBody:!0,description:{type:"string"},body:{$ref:"#/$defs/server"}},oneOf:[{required:["operationRef"]},{required:["operationId"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"link-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/link"}},header:{type:"object",properties:{description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},allowEmptyValue:{default:!1,type:"boolean"}},dependentSchemas:{schema:{properties:{style:{default:"simple",enum:["simple"]},explode:{default:!1,type:"boolean"},allowReserved:{default:!1,type:"boolean"},schema:{$dynamicRef:"#meta"}},$ref:"#/$defs/examples"},content:{properties:{content:{$ref:"#/$defs/content"}}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"header-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/header"}},tag:{type:"object",properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["name"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},reference:{type:"object",properties:{$ref:{$ref:"#/$defs/uri"},summary:{type:"string"},description:{type:"string"}},unevaluatedProperties:!1},schema:{$dynamicAnchor:"meta",type:["object","boolean"]},"security-scheme":{type:"object",properties:{type:{enum:["apiKey","http","mutualTLS","oauth2","openIdConnect"]},description:{type:"string"}},required:["type"],allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/security-scheme/$defs/type-apikey"},{$ref:"#/$defs/security-scheme/$defs/type-http"},{$ref:"#/$defs/security-scheme/$defs/type-http-bearer"},{$ref:"#/$defs/security-scheme/$defs/type-oauth2"},{$ref:"#/$defs/security-scheme/$defs/type-oidc"}],unevaluatedProperties:!1,$defs:{"type-apikey":{if:{properties:{type:{const:"apiKey"}},required:["type"]},then:{properties:{name:{type:"string"},in:{enum:["query","header","cookie"]}},required:["name","in"]}},"type-http":{if:{properties:{type:{const:"http"}},required:["type"]},then:{properties:{scheme:{type:"string"}},required:["scheme"]}},"type-http-bearer":{if:{properties:{type:{const:"http"},scheme:{const:"bearer"}},required:["type","scheme"]},then:{properties:{bearerFormat:{type:"string"}},required:["scheme"]}},"type-oauth2":{if:{properties:{type:{const:"oauth2"}},required:["type"]},then:{properties:{flows:{$ref:"#/$defs/oauth-flows"}},required:["flows"]}},"type-oidc":{if:{properties:{type:{const:"openIdConnect"}},required:["type"]},then:{properties:{openIdConnectUrl:{$ref:"#/$defs/uri"}},required:["openIdConnectUrl"]}}}},"security-scheme-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/security-scheme"}},"oauth-flows":{type:"object",properties:{implicit:{$ref:"#/$defs/oauth-flows/$defs/implicit"},password:{$ref:"#/$defs/oauth-flows/$defs/password"},clientCredentials:{$ref:"#/$defs/oauth-flows/$defs/client-credentials"},authorizationCode:{$ref:"#/$defs/oauth-flows/$defs/authorization-code"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{implicit:{type:"object",properties:{authorizationUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},password:{type:"object",properties:{tokenUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"client-credentials":{type:"object",properties:{tokenUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"authorization-code":{type:"object",properties:{authorizationUrl:{type:"string"},tokenUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1}}},"security-requirement":{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},"specification-extensions":{patternProperties:{"^x-":!0}},examples:{properties:{example:!0,examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}}}},uri:{type:"string",format:"uri"},"map-of-strings":{type:"object",additionalProperties:{type:"string"}}}}});var Ug=h((oe,Ln)=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.openapi=oe.openapiV31=oe.openapiV3=oe.openapiV2=oe.openapiV1=void 0;oe.openapiV1=Hg();oe.openapiV2=Vg();oe.openapiV3=Bg();oe.openapiV31=Gg();oe.openapi={v1:oe.openapiV1,v2:oe.openapiV2,v3:oe.openapiV3,v31:oe.openapiV31};oe.default=oe.openapi;typeof Ln=="object"&&typeof Ln.exports=="object"&&(Ln.exports=Object.assign(Ln.exports.default,Ln.exports))});var Pp=h((UD,Zg)=>{"use strict";var Uw=Yo(),{ono:Zw}=rt(),zw=og(),Kw=Fg(),{openapi:bp}=Ug();Zg.exports=Qw;function Qw(e){let t,r;if(e.swagger)r=bp.v2,t=_p();else if(e.openapi.startsWith("3.1")){r=bp.v31;let i=r.$defs.schema;delete i.$dynamicAnchor,r.$defs.components.properties.schemas.additionalProperties=i,r.$defs.header.dependentSchemas.schema.properties.schema=i,r.$defs["media-type"].properties.schema=i,r.$defs.parameter.properties.schema=i,t=_p(!1)}else r=bp.v3,t=_p();if(!t.validate(r,e)){let i=t.errors,s=`Swagger schema validation failed.
|
|
@@ -69,9 +69,9 @@ Expecting `+yn.join(", ")+", got '"+(this.terminals_[E]||E)+"'":dc="Parse error
|
|
|
69
69
|
return undefined
|
|
70
70
|
}
|
|
71
71
|
`.trim()},"lookupPropertyFunctionVarDeclaration"),blockValue:o(function(t){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var i=this.popStack();n.splice(1,0,i),this.push(this.source.functionCall(r,"call",n))},"blockValue"),ambiguousBlockValue:o(function(){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",r),"}"])},"ambiguousBlockValue"),appendContent:o(function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},"appendContent"),append:o(function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},"append"),appendEscaped:o(function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},"appendEscaped"),getContext:o(function(t){this.lastContext=t},"getContext"),pushContext:o(function(){this.pushStackLiteral(this.contextName(this.lastContext))},"pushContext"),lookupOnContext:o(function(t,r,n,i){var s=0;!i&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(t[s++])):this.pushContext(),this.resolvePath("context",t,s,r,n)},"lookupOnContext"),lookupBlockParam:o(function(t,r){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",r,1)},"lookupBlockParam"),lookupData:o(function(t,r,n){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},"lookupData"),resolvePath:o(function(t,r,n,i,s){var a=this;if(this.options.strict||this.options.assumeObjects){this.push(mq(this.options.strict&&s,this,r,n,t));return}for(var c=r.length;n<c;n++)this.replaceStack(function(u){var l=a.nameLookup(u,r[n],t);return i?[" && ",l]:[" != null ? ",l," : ",u]})},"resolvePath"),resolvePossibleLambda:o(function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},"resolvePossibleLambda"),pushStringParam:o(function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},"pushStringParam"),emptyHash:o(function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},"emptyHash"),pushHash:o(function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},"pushHash"),popHash:o(function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},"popHash"),pushString:o(function(t){this.pushStackLiteral(this.quotedString(t))},"pushString"),pushLiteral:o(function(t){this.pushStackLiteral(t)},"pushLiteral"),pushProgram:o(function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},"pushProgram"),registerDecorator:o(function(t,r){var n=this.nameLookup("decorators",r,"decorator"),i=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",i])," || fn;"])},"registerDecorator"),invokeHelper:o(function(t,r,n){var i=this.popStack(),s=this.setupHelper(t,r),a=[];n&&a.push(s.name),a.push(i),this.options.strict||a.push(this.aliasable("container.hooks.helperMissing"));var c=["(",this.itemsSeparatedBy(a,"||"),")"],u=this.source.functionCall(c,"call",s.callParams);this.push(u)},"invokeHelper"),itemsSeparatedBy:o(function(t,r){var n=[];n.push(t[0]);for(var i=1;i<t.length;i++)n.push(r,t[i]);return n},"itemsSeparatedBy"),invokeKnownHelper:o(function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},"invokeKnownHelper"),invokeAmbiguous:o(function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,t,r),s=this.lastHelper=this.nameLookup("helpers",t,"helper"),a=["(","(helper = ",s," || ",n,")"];this.options.strict||(a[0]="(helper = ",a.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",a,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},"invokeAmbiguous"),invokePartial:o(function(t,r,n){var i=[],s=this.setupParams(r,1,i);t&&(r=this.popStack(),delete s.name),n&&(s.indent=JSON.stringify(n)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",t?i.unshift(r):i.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},"invokePartial"),assignToHash:o(function(t){var r=this.popStack(),n=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var a=this.hash;n&&(a.contexts[t]=n),i&&(a.types[t]=i),s&&(a.ids[t]=s),a.values[t]=r},"assignToHash"),pushId:o(function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},"pushId"),compiler:Si,compileChildren:o(function(t,r){for(var n=t.children,i=void 0,s=void 0,a=0,c=n.length;a<c;a++){i=n[a],s=new this.compiler;var u=this.matchExistingProgram(i);if(u==null){this.context.programs.push("");var l=this.context.programs.length;i.index=l,i.name="program"+l,this.context.programs[l]=s.compile(i,r,this.context,!this.precompile),this.context.decorators[l]=s.decorators,this.context.environments[l]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=u.index,i.name="program"+u.index,this.useDepths=this.useDepths||u.useDepths,this.useBlockParams=this.useBlockParams||u.useBlockParams}},"compileChildren"),matchExistingProgram:o(function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var i=this.context.environments[r];if(i&&i.equals(t))return i}},"matchExistingProgram"),programExpression:o(function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},"programExpression"),useRegister:o(function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},"useRegister"),push:o(function(t){return t instanceof vi||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new vi(t))},"pushStackLiteral"),pushSource:o(function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},"pushSource"),replaceStack:o(function(t){var r=["("],n=void 0,i=void 0,s=void 0;if(!this.isInline())throw new gd.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof vi)n=[a.value],r=["(",n],s=!0;else{i=!0;var c=this.incrStack();r=["((",this.push(c)," = ",a,")"],n=this.topStack()}var u=t.call(this,n);s||this.popStack(),i&&this.stackSlot--,this.push(r.concat(u,")"))},"replaceStack"),incrStack:o(function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},"incrStack"),topStackName:o(function(){return"stack"+this.stackSlot},"topStackName"),flushInline:o(function(){var t=this.inlineStack;this.inlineStack=[];for(var r=0,n=t.length;r<n;r++){var i=t[r];if(i instanceof vi)this.compileStack.push(i);else{var s=this.incrStack();this.pushSource([s," = ",i,";"]),this.compileStack.push(s)}}},"flushInline"),isInline:o(function(){return this.inlineStack.length},"isInline"),popStack:o(function(t){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof vi)return n.value;if(!r){if(!this.stackSlot)throw new gd.default("Invalid stack pop");this.stackSlot--}return n},"popStack"),topStack:o(function(){var t=this.isInline()?this.inlineStack:this.compileStack,r=t[t.length-1];return r instanceof vi?r.value:r},"topStack"),contextName:o(function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},"contextName"),quotedString:o(function(t){return this.source.quotedString(t)},"quotedString"),objectLiteral:o(function(t){return this.source.objectLiteral(t)},"objectLiteral"),aliasable:o(function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},"aliasable"),setupHelper:o(function(t,r,n){var i=[],s=this.setupHelperArgs(r,t,i,n),a=this.nameLookup("helpers",r,"helper"),c=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:a,callParams:[c].concat(i)}},"setupHelper"),setupParams:o(function(t,r,n){var i={},s=[],a=[],c=[],u=!n,l=void 0;u&&(n=[]),i.name=this.quotedString(t),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var f=this.popStack(),p=this.popStack();(p||f)&&(i.fn=p||"container.noop",i.inverse=f||"container.noop");for(var d=r;d--;)l=this.popStack(),n[d]=l,this.trackIds&&(c[d]=this.popStack()),this.stringParams&&(a[d]=this.popStack(),s[d]=this.popStack());return u&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(c)),this.stringParams&&(i.types=this.source.generateArray(a),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},"setupParams"),setupHelperArgs:o(function(t,r,n,i){var s=this.setupParams(t,r,n);return s.loc=JSON.stringify(this.source.currentLocation),s=this.objectLiteral(s),i?(this.useRegister("options"),n.push("options"),["options=",s]):n?(n.push(s),""):s},"setupHelperArgs")};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=Si.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();Si.isValidJavaScriptVariableName=function(e){return!Si.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function mq(e,t,r,n,i){var s=t.popStack(),a=r.length;for(e&&a--;n<a;n++)s=t.nameLookup(s,r[n],i);return e?[t.aliasable("container.strict"),"(",s,", ",t.quotedString(r[n]),", ",JSON.stringify(t.source.currentLocation)," )"]:s}o(mq,"strictLookup");uc.default=Si;SP.exports=uc.default});var EP=h((lc,PP)=>{"use strict";lc.__esModule=!0;function Ko(e){return e&&e.__esModule?e:{default:e}}o(Ko,"_interopRequireDefault");var hq=$_(),gq=Ko(hq),yq=zf(),vq=Ko(yq),yd=M_(),vd=H_(),Sq=bP(),bq=Ko(Sq),_q=ec(),Pq=Ko(_q),Eq=Bf(),$q=Ko(Eq),Oq=gq.default.create;function _P(){var e=Oq();return e.compile=function(t,r){return vd.compile(t,r,e)},e.precompile=function(t,r){return vd.precompile(t,r,e)},e.AST=vq.default,e.Compiler=vd.Compiler,e.JavaScriptCompiler=bq.default,e.Parser=yd.parser,e.parse=yd.parse,e.parseWithoutProcessing=yd.parseWithoutProcessing,e}o(_P,"create");var bi=_P();bi.create=_P;$q.default(bi);bi.Visitor=Pq.default;bi.default=bi;lc.default=bi;PP.exports=lc.default});var $P=h(pc=>{"use strict";pc.__esModule=!0;pc.print=Iq;pc.PrintVisitor=Y;function xq(e){return e&&e.__esModule?e:{default:e}}o(xq,"_interopRequireDefault");var Aq=ec(),wq=xq(Aq);function Iq(e){return new Y().accept(e)}o(Iq,"print");function Y(){this.padding=0}o(Y,"PrintVisitor");Y.prototype=new wq.default;Y.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
72
|
-
`,t};Y.prototype.Program=function(e){var t="",r=e.body,n=void 0,i=void 0;if(e.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=e.blockParams.length;n<i;n++)s+=" "+e.blockParams[n];s+=" ]",t+=this.pad(s)}for(n=0,i=r.length;n<i;n++)t+=this.accept(r[n]);return this.padding--,t};Y.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Y.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Y.prototype.BlockStatement=Y.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Y.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Y.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Y.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Y.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Y.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,i=0,s=t.length;i<s;i++)r.push(this.accept(t[i]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Y.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Y.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Y.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Y.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Y.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Y.prototype.NullLiteral=function(){return"NULL"};Y.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,i=t.length;n<i;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Y.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Wt=h((cB,AP)=>{var fc=EP().default,xP=$P();fc.PrintVisitor=xP.PrintVisitor;fc.print=xP.print;AP.exports=fc;function OP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=fc.compile(n)}o(OP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=OP,require.extensions[".hbs"]=OP)});var O3={};aE(O3,{getGenerateFilesData:()=>$3,getGenerateMetadata:()=>E3});module.exports=cE(O3);var Pd=et(Jv());var mo="AppRestClient",ta={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},nf="src/data",of="@/data",Jr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},mr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ra={bindings:[mr.ErrorHandler,mr.SharedErrorHandler],from:Jr.errorHandling.template},sf="AbilityContext",Xv={bindings:[sf],from:Jr.abilityContext.template};var na={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},ia={fileName:"app-rest-client",extension:"ts"},af="QueryModule",oa={fileName:"queryModules",extension:"ts"},eS={fileName:"queryConfig.context",extension:"tsx"},ri={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},sa={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},aa={fileName:"zod",extension:"ts"};var tS="Schema",rS="Enum",nS="Body",iS="Param",oS="Response",sS="ErrorResponse",ho="z.void()",ca="z.instanceof(Blob)",go="z.enum",ua="z.string()",ni={bindings:["z"],from:"zod"};var yo={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!0,standalone:!1,baseUrl:"",abilityContextImportPath:Jr.abilityContext.template,schemaSuffix:tS,enumSuffix:rS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:Jr.appRestClient.template,errorHandlingImportPath:Jr.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:Jr.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var ft={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},aS={bindings:[ft.query,ft.infiniteQuery,ft.mutation],from:"@tanstack/react-query"},vo={pageParamName:"page"},la={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},So="moduleName";var cf={"Content-Type":"application/json",Accept:"application/json"},pa="data",uf="axios",hr="config",xt="AxiosRequestConfig",fa={defaultImport:uf,bindings:[xt],from:"axios"};var cS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function Oe(e){return!D(e)}o(Oe,"isSchemaObject");function da(e){return e.type==="array"}o(da,"isArraySchemaObject");function uS(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(nC(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(uS,"inferRequiredSchema");var nC=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Gt=Symbol.for("@ts-pattern/matcher"),iC=Symbol.for("@ts-pattern/isVariadic"),ha="@ts-pattern/anonymous-select-key",lf=o(e=>!!(e&&typeof e=="object"),"r"),ma=o(e=>e&&!!e[Gt],"i"),Tt=o((e,t,r)=>{if(ma(e)){let n=e[Gt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(lf(e)){if(!lf(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];ma(c)&&c[iC]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,f)=>Tt(l,a[f],r))&&i.every((l,f)=>Tt(l,c[f],r))&&(s.length===0||Tt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Tt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||ma(s=i)&&s[Gt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),br=o(e=>{var t,r,n;return lf(e)?ma(e)?(t=(r=(n=e[Gt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?_o(e,br):_o(Object.values(e),br):[]},"o"),_o=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>oC(e),"optional"),and:o(t=>K(e,t),"and"),or:o(t=>sC(e,t),"or"),select:o(t=>t===void 0?lS(e):lS(t,e),"select")})}o(Qe,"u");function oC(e){return Qe({[Gt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(br(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>br(e),"getSelectionKeys"),matcherType:"optional"})})}o(oC,"h");function K(...e){return Qe({[Gt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>_o(e,br),"getSelectionKeys"),matcherType:"and"})})}o(K,"m");function sC(...e){return Qe({[Gt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return _o(e,br).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>_o(e,br),"getSelectionKeys"),matcherType:"or"})})}o(sC,"d");function L(e){return{[Gt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function lS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Gt]:()=>({match:o(n=>{let i={[t??ha]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??ha].concat(r===void 0?[]:br(r)),"getSelectionKeys")})})}o(lS,"y");function wt(e){return typeof e=="number"}o(wt,"v");function gr(e){return typeof e=="string"}o(gr,"b");function yr(e){return typeof e=="bigint"}o(yr,"w");var K8=Qe(L(function(e){return!0}));var vr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>vr(K(e,(r=>L(n=>gr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>vr(K(e,(r=>L(n=>gr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>vr(K(e,(r=>L(n=>gr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&!!n.match(r)))));var r},"regex")}),"j"),Q8=vr(L(gr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(K(e,((n,i)=>L(s=>wt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(K(e,(r=>L(n=>wt(n)&&n<r))(t))),"lt"),gt:o(t=>It(K(e,(r=>L(n=>wt(n)&&n>r))(t))),"gt"),lte:o(t=>It(K(e,(r=>L(n=>wt(n)&&n<=r))(t))),"lte"),gte:o(t=>It(K(e,(r=>L(n=>wt(n)&&n>=r))(t))),"gte"),int:o(()=>It(K(e,L(t=>wt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(K(e,L(t=>wt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(K(e,L(t=>wt(t)&&t>0))),"positive"),negative:o(()=>It(K(e,L(t=>wt(t)&&t<0))),"negative")}),"x"),W8=It(L(wt)),Sr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>Sr(K(e,((n,i)=>L(s=>yr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n<r))(t))),"lt"),gt:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n>r))(t))),"gt"),lte:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n<=r))(t))),"lte"),gte:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n>=r))(t))),"gte"),positive:o(()=>Sr(K(e,L(t=>yr(t)&&t>0))),"positive"),negative:o(()=>Sr(K(e,L(t=>yr(t)&&t<0))),"negative")}),"A"),Y8=Sr(L(yr)),J8=Qe(L(function(e){return typeof e=="boolean"})),X8=Qe(L(function(e){return typeof e=="symbol"})),e5=Qe(L(function(e){return e==null})),t5=Qe(L(function(e){return e!=null}));var mf=class mf extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(mf,"W");var pf=mf,ff={matched:!1,value:void 0};function Se(e){return new df(e,ff)}o(Se,"z");var bo=class bo{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,f)=>{s=!0,a[l]=f},"a"),u=!n.some(l=>Tt(l,this.input,c))||i&&!i(this.input)?ff:{matched:!0,value:r(s?ha in a?a[ha]:a:this.input,this.input)};return new bo(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new bo(this.input,n?{matched:!0,value:r(this.input,this.input)}:ff)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new pf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(bo,"I");var df=bo;var hf=2,pS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],fS=["query","header","path"],Xr=["get","put","post","delete","options","head","patch","trace"],dS=["string","number","integer","boolean"],ii=["allOf","anyOf","oneOf"];var Z=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),_r=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),mS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),se=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),hS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),gf=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),gS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),aC=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),yf=o(e=>{let t=e.map(Z).map(yS).map(r=>cC(r)).flat();return aC(t)},"getMostCommonAdjacentCombinationSplit"),yS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),vS=o(e=>yS(e).join(" "),"camelToSpaceSeparated"),cC=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),SS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${_r(r)}|${Z(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var _S=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),en=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),oi=o(e=>en(e).split("/").at(-1),"getSchemaNameByRef");function Sf(e){let t=uC(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return se(t)}o(Sf,"normalizeString");function PS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(PS,"wrapWithQuotesIfNeeded");function ES(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(ES,"unwrapQuotesIfNeeded");function uC(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(uC,"prefixStringStartingWithNumberIfNeeded");function bf(e){let t=e.replaceAll("_","#");return se(t.replaceAll("-","_")).replaceAll("#","_")}o(bf,"pathParamToVariableName");var Ut=o(e=>dS.includes(e),"isPrimitiveType");function $S(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o($S,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||pS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function Po(e){return e>=200&&e<300}o(Po,"isMainResponseStatus");function ga(e){return!(e>=200&&e<300)}o(ga,"isErrorStatus");function si(e){return e.startsWith("application/")}o(si,"isMediaTypeAllowed");var bS=/({\w+})/g,lC=/[^\w\-]+/g;function OS(e){e=Z(mS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(bS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(bS,"")}By${Z(r.slice(1,-1))}`}return e.replace(lC,"_")}o(OS,"pathToVariableName");var vf=/{(\b\w+(?:-\w+)*\b)}/g;function xS(e){let t=e.match(vf);return t===null?e.replaceAll(vf,":$1"):(t.forEach(r=>{let n=bf(r.replaceAll(vf,":$1"));e=e.replaceAll(r,n)}),e)}o(xS,"replaceHyphenatedPath");var AS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Oe(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),tn=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Rt(e){return hS(e)}o(Rt,"formatTag");function Pr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Rt(r??t.defaultTag)}o(Pr,"getOperationTag");function wS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(wS,"isTagExcluded");var ya={fileName:"acl/app.ability",extension:"ts"},Eo="AllAbilities",$o="AppAbilities",va={fileName:"acl/useAclCheck",extension:"ts"},Er="useAclCheck",le={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},Oo={bindings:[le.abilityTuple,le.pureAbility,le.forcedSubject,le.subject],from:"@casl/ability"};var Fe=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var IS=o(e=>`Use${Z(se(e.operationName))}Ability`,"getAbilityTypeName"),xo=o(e=>`canUse${Z(se(e.operationName))}`,"getAbilityFunctionName"),TS=o((e,t)=>`${t.tsNamespaces?`${B({type:"acl",tag:$r(e,t),options:t})}.`:""}${xo(e)}`,"getImportedAbilityFunctionName"),RS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),NS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),Sa=o(e=>{var t;return!!((t=Ao(e))!=null&&t.length)},"hasAbilityConditions"),Ao=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),CS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ba=o(e=>`${Z(e)}${Eo}`,"getTagAllAbilitiesName");function xe(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(ii.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&xe(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&xe(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;xe(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;xe(s,t)}}o(xe,"iterateSchema");var Nt=o((e,t)=>gf(Z(Sf(e)),t),"getZodSchemaName"),wo=o((e,t,r)=>gf(Z(Sf(e)),`${t}${r}`),"getEnumZodSchemaName"),pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),kS=o(e=>e.startsWith(go),"isEnumZodSchema"),rn=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),_a=o(e=>se(`${e}_${nS}`),"getBodyZodSchemaName"),jS=o((e,t)=>se(`${e}_${t}${iS}`),"getParamZodSchemaName"),pC=o(e=>se(`${e}${oS}`),"getMainResponseZodSchemaName"),fC=o((e,t)=>se(`${e}_${t}_${sS}`),"getErrorResponseZodSchemaName");function Pa({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=rn(t,r,n);return!Po(i)&&e!=="default"&&ga(i)?fC(s,e):pC(s)}o(Pa,"getResponseZodSchemaName");function Io(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Z(vS(i))}: \`${e[i]}\``],[])}o(Io,"getSchemaDescriptions");var To=o((e,t)=>gS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),qS=o((e,t)=>pe(t)?`${e.options.tsNamespaces?`${B({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Or=o((e,t,r)=>{if(!pe(t))return t===ho?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${B({type:"models",tag:n,options:e.options})}.`:""}${To(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function MS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(MS,"getZodSchemaType");function DS(e){if(e.schemaObj)return[e.schemaObj.description,...Io(e.schemaObj).join(". ")].filter(Boolean)}o(DS,"getZodSchemaDescription");function LS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Or(e,i,r):void 0}if(da(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Or(e,i,r)}[]`:void 0}if(ii.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return LS(e,i[0],r)}return t.type}o(LS,"getType");function FS(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let f=e.resolveObject(c.schema),p=[f.description,...Io(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:LS(e,c.schema,r)??"unknown",description:p.join(". ")})}return xe(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);xe(u,{data:{pathSegments:[]},onSchema:a})}}),xe(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(FS,"getZodSchemaPropertyDescriptions");function xr({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Ea({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Ea({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>To(u,e.options),"getEntityName"),options:e.options});return dC(e.options,a,c)}o(xr,"getModelsImports");function HS({tag:e,endpoints:t,options:r}){return Ea({type:"endpoints",tag:e,entities:t,getTag:o(n=>$r(n,r),"getTag"),getEntityName:Ro,options:r})}o(HS,"getEndpointsImports");function VS({tag:e,endpoints:t,options:r}){return Ea({type:"acl",tag:e,entities:t,getTag:o(n=>$r(n,r),"getTag"),getEntityName:xo,options:r})}o(VS,"getAclImports");function BS({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?B({type:n,tag:a,options:i}):c],from:`${Ct(i)}${nn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(BS,"getEntityImports");function Ct(e){let t=of;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${nf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${nf}`,"g"),of)),`${t}/`.replace(/\/\//g,"/")}o(Ct,"getImportPath");function Ea({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?B({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Ct(s)}${nn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Ea,"getImports");function dC(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Fe(n.bindings)}))}o(dC,"mergeImports");function on({fileName:e,extension:t}){return`${e}.${t}`}o(on,"getFileNameWithExtension");function GS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${_r(t)}/`:""}${_r(t)}.${i}`:i}o(GS,"getTagFileNameWithoutExtension");function nn(...e){return GS(...e)}o(nn,"getTagImportPath");function US(...e){return`${GS(...e)}.ts`}o(US,"getTagFileName");var B=o(({type:e,tag:t,options:r})=>`${Z(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function ZS(e){return e.standalone?`${Ct(e)}${ia.fileName}`:e.restClientImportPath}o(ZS,"getAppRestClientImportPath");function zS(e){return e.standalone?`${Ct(e)}${na.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(zS,"getQueryTypesImportPath");function KS(e){return`${Ct(e)}${oa.fileName}`}o(KS,"getQueryModulesImportPath");function QS(e){return`${Ct(e)}${sa.fileName}`}o(QS,"getMutationEffectsImportPath");function WS(e){return`${Ct(e)}${va.fileName}`}o(WS,"getAclCheckImportPath");function YS(e){return`${Ct(e)}${aa.fileName}`}o(YS,"getZodExtendedImportPath");function JS(e){return`${Ct(e)}${ya.fileName}`}o(JS,"getAppAbilitiesImportPath");function $a(e){return Se(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o($a,"primitiveTypeToTsType");function ai({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&pe(e)?(n=Or(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Ut(t==null?void 0:t.type)&&(n=$a(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:nn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(ai,"getTsTypeBase");function sn({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of ii){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return sn({schema:u,parentTypes:r,resolver:n})});return a.every(({metaType:c})=>c==="object")?{metaType:"object",objectProperties:a.reduce((c,{objectProperties:u})=>{let l=u.map(({name:f})=>f);return[...c.filter(({name:f})=>!l.includes(f)),...u]},[])}:{metaType:"composite",[i]:a}}else e=n.resolveObject(s[0])}return e.type==="array"?{metaType:"array",arrayType:XS({arraySchema:e,resolver:n,parentTypes:r})}:(e.type==="object"||e.properties)&&t?{metaType:"object",objectProperties:[],isCircular:!0}:e.type==="object"||e.properties?{metaType:"object",objectProperties:mC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(sn,"getSchemaTsMetaType");function XS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=ai({zodSchemaName:n,schema:i,resolver:r}),a=eb(s,t),c=sn({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(XS,"getArraySchemaTsType");function mC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=ai({zodSchemaName:c,schema:u,resolver:r}),f=eb(l,t),p=sn({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=XS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Ut(i.type))return{name:n,isRequired:s,type:$a(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(mC,"getSchemaTsProperties");function eb(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(eb,"getIsCircular");var Ro=o(e=>_r(se(e.operationName)),"getEndpointName");function tb(e,t){return`${t.tsNamespaces?`${B({type:"endpoints",tag:$r(e,t),options:t})}.`:""}${Ro(e)}`}o(tb,"getImportedEndpointName");var rb=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function $r(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Rt(r??t.defaultTag)}o($r,"getEndpointTag");function Ar(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(pe(i.zodSchema))s=Or(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Oe(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Ut(f)&&(s=$a(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==pa)&&(!(r!=null&&r.excludePageParam)||i.name!==vo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===vo.pageParamName?"pageParam":i.name}))}o(Ar,"mapEndpointParamsToFunctionParams");function nb(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=cS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==cf["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==cf.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(nb,"getEndpointConfig");function ib(e,t){return t.filter(r=>Ae(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(ib,"getUpdateQueryEndpoints");var Ae=o(e=>e.method==="get","isQuery"),kt=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ci=o((e,t)=>Ae(e)&&(t??Object.values(vo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),ob=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...Ar(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return Ar(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var Oa=o((e,t)=>{let r=Ae(e)&&kt(e)&&t;return`use${Z(se(e.operationName))}${r?"Mutation":""}`},"getQueryName"),sb=o(e=>`use${Z(se(e.operationName))}Infinite`,"getInfiniteQueryName");var _f=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function an(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(an,"pick");function ui(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Pr(e,t),i=wS(n,t);return r||i}o(ui,"isOperationExcluded");function Pf({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${OS(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:Z(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=SS(u,i);l===""?u=t.toLowerCase():_f.includes(l)||(u=l)}return _f.includes(u)?c:u}o(Pf,"getOperationName");function No({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Pr(r,n):n.defaultTag,s=o(a=>{let c=Pf({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Pf({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Pf({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(No,"getUniqueOperationName");function ab(e,t,r){let n=[];for(let i in e.paths){if(tn(i,r))continue;let s=e.paths[i],a=an(s,Xr);for(let c in a){let u=a[c];if(!u||ui(u,r))continue;let l=No({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(ab,"getUniqueOperationNamesWithoutSplitByTags");function cb(e,t){let r={};for(let n in e.paths){if(tn(n,t))continue;let i=e.paths[n],s=an(i,Xr);for(let a in s){let c=s[a];if(!c||ui(c,t))continue;let u=t.splitByTags?Pr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(cb,"getOperationsByTag");var ub={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};function Co(e){return{type:"invalid-schema",message:e}}o(Co,"getInvalidSchemaError");function lb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(lb,"getInvalidOperationIdError");function pb(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(pb,"getMissingPathParameterError");function fb(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(fb,"getNotAllowedInlineEnumError");function db(e){return{type:"not-allowed-circular-schema",message:e}}o(db,"getNotAllowedCircularSchemaError");function mb(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Aa(t,r)}`}}o(mb,"getMissingAclConditionPropertyError");function Ef(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${xa(e)} in operation ${Aa(t,r)}`}}o(Ef,"getMissingStatusCodeError");function hb(e,t,r){return{type:"invalid-status-code",message:`Operation ${Aa(t,r)} expected HTTP status code ${xa(e.expected)} but received ${xa(e.received)}`}}o(hb,"getInvalidStatusCodeError");function gb(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Aa(t,r)} has multiple success HTTP status codes: ${e.map(xa).join(", ")}`}}o(gb,"getMultipleSuccessStatusCodesError");function Aa(e,t){return e.operationId??`${t.method} ${t.path}`}o(Aa,"getOperationDescriptor");function xa(e){return`${e} (${ub[e]})`}o(xa,"getStatusCodeDescription");function jt({schema:e,meta:t,options:r}){let n=[];Se(e.type).with("string",()=>n.push(yC(e,r))).with("number","integer",()=>n.push(SC(e))).with("array",()=>n.push(bC(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
|
|
72
|
+
`,t};Y.prototype.Program=function(e){var t="",r=e.body,n=void 0,i=void 0;if(e.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=e.blockParams.length;n<i;n++)s+=" "+e.blockParams[n];s+=" ]",t+=this.pad(s)}for(n=0,i=r.length;n<i;n++)t+=this.accept(r[n]);return this.padding--,t};Y.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Y.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Y.prototype.BlockStatement=Y.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Y.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Y.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Y.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Y.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Y.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,i=0,s=t.length;i<s;i++)r.push(this.accept(t[i]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Y.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Y.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Y.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Y.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Y.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Y.prototype.NullLiteral=function(){return"NULL"};Y.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,i=t.length;n<i;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Y.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Wt=h((cB,AP)=>{var fc=EP().default,xP=$P();fc.PrintVisitor=xP.PrintVisitor;fc.print=xP.print;AP.exports=fc;function OP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=fc.compile(n)}o(OP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=OP,require.extensions[".hbs"]=OP)});var O3={};aE(O3,{getGenerateFilesData:()=>$3,getGenerateMetadata:()=>E3});module.exports=cE(O3);var Pd=et(Jv());var mo="AppRestClient",ta={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},nf="src/data",of="@/data",Jr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},mr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ra={bindings:[mr.ErrorHandler,mr.SharedErrorHandler],from:Jr.errorHandling.template},sf="AbilityContext",Xv={bindings:[sf],from:Jr.abilityContext.template};var na={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},ia={fileName:"app-rest-client",extension:"ts"},af="QueryModule",oa={fileName:"queryModules",extension:"ts"},eS={fileName:"queryConfig.context",extension:"tsx"},ri={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},sa={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},aa={fileName:"zod",extension:"ts"};var tS="Schema",rS="Enum",nS="Body",iS="Param",oS="Response",sS="ErrorResponse",ho="z.void()",ca="z.instanceof(Blob)",go="z.enum",ua="z.string()",ni={bindings:["z"],from:"zod"};var yo={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!0,standalone:!1,baseUrl:"",abilityContextImportPath:Jr.abilityContext.template,schemaSuffix:tS,enumSuffix:rS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:Jr.appRestClient.template,errorHandlingImportPath:Jr.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:Jr.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var ft={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},aS={bindings:[ft.query,ft.infiniteQuery,ft.mutation],from:"@tanstack/react-query"},vo={pageParamName:"page"},la={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},So="moduleName";var cf={"Content-Type":"application/json",Accept:"application/json"},pa="data",uf="axios",hr="config",xt="AxiosRequestConfig",fa={defaultImport:uf,bindings:[xt],from:"axios"};var cS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function Oe(e){return!D(e)}o(Oe,"isSchemaObject");function da(e){return e.type==="array"}o(da,"isArraySchemaObject");function uS(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(nC(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(uS,"inferRequiredSchema");var nC=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Gt=Symbol.for("@ts-pattern/matcher"),iC=Symbol.for("@ts-pattern/isVariadic"),ha="@ts-pattern/anonymous-select-key",lf=o(e=>!!(e&&typeof e=="object"),"r"),ma=o(e=>e&&!!e[Gt],"i"),Tt=o((e,t,r)=>{if(ma(e)){let n=e[Gt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(lf(e)){if(!lf(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];ma(c)&&c[iC]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,f)=>Tt(l,a[f],r))&&i.every((l,f)=>Tt(l,c[f],r))&&(s.length===0||Tt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Tt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||ma(s=i)&&s[Gt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),br=o(e=>{var t,r,n;return lf(e)?ma(e)?(t=(r=(n=e[Gt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?_o(e,br):_o(Object.values(e),br):[]},"o"),_o=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>oC(e),"optional"),and:o(t=>K(e,t),"and"),or:o(t=>sC(e,t),"or"),select:o(t=>t===void 0?lS(e):lS(t,e),"select")})}o(Qe,"u");function oC(e){return Qe({[Gt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(br(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>br(e),"getSelectionKeys"),matcherType:"optional"})})}o(oC,"h");function K(...e){return Qe({[Gt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>_o(e,br),"getSelectionKeys"),matcherType:"and"})})}o(K,"m");function sC(...e){return Qe({[Gt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return _o(e,br).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>_o(e,br),"getSelectionKeys"),matcherType:"or"})})}o(sC,"d");function L(e){return{[Gt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function lS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Gt]:()=>({match:o(n=>{let i={[t??ha]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??ha].concat(r===void 0?[]:br(r)),"getSelectionKeys")})})}o(lS,"y");function wt(e){return typeof e=="number"}o(wt,"v");function gr(e){return typeof e=="string"}o(gr,"b");function yr(e){return typeof e=="bigint"}o(yr,"w");var K8=Qe(L(function(e){return!0}));var vr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>vr(K(e,(r=>L(n=>gr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>vr(K(e,(r=>L(n=>gr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>vr(K(e,(r=>L(n=>gr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return vr(K(e,(r=t,L(n=>gr(n)&&!!n.match(r)))));var r},"regex")}),"j"),Q8=vr(L(gr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(K(e,((n,i)=>L(s=>wt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(K(e,(r=>L(n=>wt(n)&&n<r))(t))),"lt"),gt:o(t=>It(K(e,(r=>L(n=>wt(n)&&n>r))(t))),"gt"),lte:o(t=>It(K(e,(r=>L(n=>wt(n)&&n<=r))(t))),"lte"),gte:o(t=>It(K(e,(r=>L(n=>wt(n)&&n>=r))(t))),"gte"),int:o(()=>It(K(e,L(t=>wt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(K(e,L(t=>wt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(K(e,L(t=>wt(t)&&t>0))),"positive"),negative:o(()=>It(K(e,L(t=>wt(t)&&t<0))),"negative")}),"x"),W8=It(L(wt)),Sr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>Sr(K(e,((n,i)=>L(s=>yr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n<r))(t))),"lt"),gt:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n>r))(t))),"gt"),lte:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n<=r))(t))),"lte"),gte:o(t=>Sr(K(e,(r=>L(n=>yr(n)&&n>=r))(t))),"gte"),positive:o(()=>Sr(K(e,L(t=>yr(t)&&t>0))),"positive"),negative:o(()=>Sr(K(e,L(t=>yr(t)&&t<0))),"negative")}),"A"),Y8=Sr(L(yr)),J8=Qe(L(function(e){return typeof e=="boolean"})),X8=Qe(L(function(e){return typeof e=="symbol"})),e5=Qe(L(function(e){return e==null})),t5=Qe(L(function(e){return e!=null}));var mf=class mf extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(mf,"W");var pf=mf,ff={matched:!1,value:void 0};function Se(e){return new df(e,ff)}o(Se,"z");var bo=class bo{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,f)=>{s=!0,a[l]=f},"a"),u=!n.some(l=>Tt(l,this.input,c))||i&&!i(this.input)?ff:{matched:!0,value:r(s?ha in a?a[ha]:a:this.input,this.input)};return new bo(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new bo(this.input,n?{matched:!0,value:r(this.input,this.input)}:ff)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new pf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(bo,"I");var df=bo;var hf=2,pS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],fS=["query","header","path"],Xr=["get","put","post","delete","options","head","patch","trace"],dS=["string","number","integer","boolean"],ii=["allOf","anyOf","oneOf"];var Z=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),_r=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),mS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),se=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),hS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),gf=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),gS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),aC=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),yf=o(e=>{let t=e.map(Z).map(yS).map(r=>cC(r)).flat();return aC(t)},"getMostCommonAdjacentCombinationSplit"),yS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),vS=o(e=>yS(e).join(" "),"camelToSpaceSeparated"),cC=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),SS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${_r(r)}|${Z(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var _S=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),en=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),oi=o(e=>en(e).split("/").at(-1),"getSchemaNameByRef");function Sf(e){let t=uC(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return se(t)}o(Sf,"normalizeString");function PS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(PS,"wrapWithQuotesIfNeeded");function ES(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(ES,"unwrapQuotesIfNeeded");function uC(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(uC,"prefixStringStartingWithNumberIfNeeded");function bf(e){let t=e.replaceAll("_","#");return se(t.replaceAll("-","_")).replaceAll("#","_")}o(bf,"pathParamToVariableName");var Ut=o(e=>dS.includes(e),"isPrimitiveType");function $S(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o($S,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||pS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function Po(e){return e>=200&&e<300}o(Po,"isMainResponseStatus");function ga(e){return!(e>=200&&e<300)}o(ga,"isErrorStatus");function si(e){return e.startsWith("application/")}o(si,"isMediaTypeAllowed");var bS=/({\w+})/g,lC=/[^\w\-]+/g;function OS(e){e=Z(mS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(bS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(bS,"")}By${Z(r.slice(1,-1))}`}return e.replace(lC,"_")}o(OS,"pathToVariableName");var vf=/{(\b\w+(?:-\w+)*\b)}/g;function xS(e){let t=e.match(vf);return t===null?e.replaceAll(vf,":$1"):(t.forEach(r=>{let n=bf(r.replaceAll(vf,":$1"));e=e.replaceAll(r,n)}),e)}o(xS,"replaceHyphenatedPath");var AS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Oe(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),tn=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Rt(e){return hS(e)}o(Rt,"formatTag");function Pr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Rt(r??t.defaultTag)}o(Pr,"getOperationTag");function wS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(wS,"isTagExcluded");var ya={fileName:"acl/app.ability",extension:"ts"},Eo="AllAbilities",$o="AppAbilities",va={fileName:"acl/useAclCheck",extension:"ts"},Er="useAclCheck",ae={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},Oo={bindings:[ae.abilityTuple,ae.pureAbility,ae.forcedSubject,ae.subjectType,ae.subject],from:"@casl/ability"};var Fe=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var IS=o(e=>`Use${Z(se(e.operationName))}Ability`,"getAbilityTypeName"),xo=o(e=>`canUse${Z(se(e.operationName))}`,"getAbilityFunctionName"),TS=o((e,t)=>`${t.tsNamespaces?`${B({type:"acl",tag:$r(e,t),options:t})}.`:""}${xo(e)}`,"getImportedAbilityFunctionName"),RS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),NS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),Sa=o(e=>{var t;return!!((t=Ao(e))!=null&&t.length)},"hasAbilityConditions"),Ao=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),CS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ba=o(e=>`${Z(e)}${Eo}`,"getTagAllAbilitiesName");function xe(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(ii.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&xe(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&xe(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;xe(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;xe(s,t)}}o(xe,"iterateSchema");var Nt=o((e,t)=>gf(Z(Sf(e)),t),"getZodSchemaName"),wo=o((e,t,r)=>gf(Z(Sf(e)),`${t}${r}`),"getEnumZodSchemaName"),pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),kS=o(e=>e.startsWith(go),"isEnumZodSchema"),rn=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),_a=o(e=>se(`${e}_${nS}`),"getBodyZodSchemaName"),jS=o((e,t)=>se(`${e}_${t}${iS}`),"getParamZodSchemaName"),pC=o(e=>se(`${e}${oS}`),"getMainResponseZodSchemaName"),fC=o((e,t)=>se(`${e}_${t}_${sS}`),"getErrorResponseZodSchemaName");function Pa({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=rn(t,r,n);return!Po(i)&&e!=="default"&&ga(i)?fC(s,e):pC(s)}o(Pa,"getResponseZodSchemaName");function Io(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Z(vS(i))}: \`${e[i]}\``],[])}o(Io,"getSchemaDescriptions");var To=o((e,t)=>gS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),qS=o((e,t)=>pe(t)?`${e.options.tsNamespaces?`${B({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Or=o((e,t,r)=>{if(!pe(t))return t===ho?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${B({type:"models",tag:n,options:e.options})}.`:""}${To(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function MS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(MS,"getZodSchemaType");function DS(e){if(e.schemaObj)return[e.schemaObj.description,...Io(e.schemaObj).join(". ")].filter(Boolean)}o(DS,"getZodSchemaDescription");function LS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Or(e,i,r):void 0}if(da(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Or(e,i,r)}[]`:void 0}if(ii.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return LS(e,i[0],r)}return t.type}o(LS,"getType");function FS(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let f=e.resolveObject(c.schema),p=[f.description,...Io(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:LS(e,c.schema,r)??"unknown",description:p.join(". ")})}return xe(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);xe(u,{data:{pathSegments:[]},onSchema:a})}}),xe(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(FS,"getZodSchemaPropertyDescriptions");function xr({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Ea({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Ea({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>To(u,e.options),"getEntityName"),options:e.options});return dC(e.options,a,c)}o(xr,"getModelsImports");function HS({tag:e,endpoints:t,options:r}){return Ea({type:"endpoints",tag:e,entities:t,getTag:o(n=>$r(n,r),"getTag"),getEntityName:Ro,options:r})}o(HS,"getEndpointsImports");function VS({tag:e,endpoints:t,options:r}){return Ea({type:"acl",tag:e,entities:t,getTag:o(n=>$r(n,r),"getTag"),getEntityName:xo,options:r})}o(VS,"getAclImports");function BS({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?B({type:n,tag:a,options:i}):c],from:`${Ct(i)}${nn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(BS,"getEntityImports");function Ct(e){let t=of;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${nf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${nf}`,"g"),of)),`${t}/`.replace(/\/\//g,"/")}o(Ct,"getImportPath");function Ea({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?B({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Ct(s)}${nn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Ea,"getImports");function dC(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Fe(n.bindings)}))}o(dC,"mergeImports");function on({fileName:e,extension:t}){return`${e}.${t}`}o(on,"getFileNameWithExtension");function GS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${_r(t)}/`:""}${_r(t)}.${i}`:i}o(GS,"getTagFileNameWithoutExtension");function nn(...e){return GS(...e)}o(nn,"getTagImportPath");function US(...e){return`${GS(...e)}.ts`}o(US,"getTagFileName");var B=o(({type:e,tag:t,options:r})=>`${Z(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function ZS(e){return e.standalone?`${Ct(e)}${ia.fileName}`:e.restClientImportPath}o(ZS,"getAppRestClientImportPath");function zS(e){return e.standalone?`${Ct(e)}${na.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(zS,"getQueryTypesImportPath");function KS(e){return`${Ct(e)}${oa.fileName}`}o(KS,"getQueryModulesImportPath");function QS(e){return`${Ct(e)}${sa.fileName}`}o(QS,"getMutationEffectsImportPath");function WS(e){return`${Ct(e)}${va.fileName}`}o(WS,"getAclCheckImportPath");function YS(e){return`${Ct(e)}${aa.fileName}`}o(YS,"getZodExtendedImportPath");function JS(e){return`${Ct(e)}${ya.fileName}`}o(JS,"getAppAbilitiesImportPath");function $a(e){return Se(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o($a,"primitiveTypeToTsType");function ai({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&pe(e)?(n=Or(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Ut(t==null?void 0:t.type)&&(n=$a(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:nn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(ai,"getTsTypeBase");function sn({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of ii){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return sn({schema:u,parentTypes:r,resolver:n})});return a.every(({metaType:c})=>c==="object")?{metaType:"object",objectProperties:a.reduce((c,{objectProperties:u})=>{let l=u.map(({name:f})=>f);return[...c.filter(({name:f})=>!l.includes(f)),...u]},[])}:{metaType:"composite",[i]:a}}else e=n.resolveObject(s[0])}return e.type==="array"?{metaType:"array",arrayType:XS({arraySchema:e,resolver:n,parentTypes:r})}:(e.type==="object"||e.properties)&&t?{metaType:"object",objectProperties:[],isCircular:!0}:e.type==="object"||e.properties?{metaType:"object",objectProperties:mC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(sn,"getSchemaTsMetaType");function XS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=ai({zodSchemaName:n,schema:i,resolver:r}),a=eb(s,t),c=sn({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(XS,"getArraySchemaTsType");function mC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=ai({zodSchemaName:c,schema:u,resolver:r}),f=eb(l,t),p=sn({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=XS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Ut(i.type))return{name:n,isRequired:s,type:$a(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(mC,"getSchemaTsProperties");function eb(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(eb,"getIsCircular");var Ro=o(e=>_r(se(e.operationName)),"getEndpointName");function tb(e,t){return`${t.tsNamespaces?`${B({type:"endpoints",tag:$r(e,t),options:t})}.`:""}${Ro(e)}`}o(tb,"getImportedEndpointName");var rb=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function $r(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Rt(r??t.defaultTag)}o($r,"getEndpointTag");function Ar(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(pe(i.zodSchema))s=Or(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Oe(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Ut(f)&&(s=$a(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==pa)&&(!(r!=null&&r.excludePageParam)||i.name!==vo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===vo.pageParamName?"pageParam":i.name}))}o(Ar,"mapEndpointParamsToFunctionParams");function nb(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=cS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==cf["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==cf.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(nb,"getEndpointConfig");function ib(e,t){return t.filter(r=>Ae(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(ib,"getUpdateQueryEndpoints");var Ae=o(e=>e.method==="get","isQuery"),kt=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ci=o((e,t)=>Ae(e)&&(t??Object.values(vo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),ob=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...Ar(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return Ar(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var Oa=o((e,t)=>{let r=Ae(e)&&kt(e)&&t;return`use${Z(se(e.operationName))}${r?"Mutation":""}`},"getQueryName"),sb=o(e=>`use${Z(se(e.operationName))}Infinite`,"getInfiniteQueryName");var _f=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function an(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(an,"pick");function ui(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Pr(e,t),i=wS(n,t);return r||i}o(ui,"isOperationExcluded");function Pf({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${OS(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:Z(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=SS(u,i);l===""?u=t.toLowerCase():_f.includes(l)||(u=l)}return _f.includes(u)?c:u}o(Pf,"getOperationName");function No({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Pr(r,n):n.defaultTag,s=o(a=>{let c=Pf({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Pf({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Pf({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(No,"getUniqueOperationName");function ab(e,t,r){let n=[];for(let i in e.paths){if(tn(i,r))continue;let s=e.paths[i],a=an(s,Xr);for(let c in a){let u=a[c];if(!u||ui(u,r))continue;let l=No({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(ab,"getUniqueOperationNamesWithoutSplitByTags");function cb(e,t){let r={};for(let n in e.paths){if(tn(n,t))continue;let i=e.paths[n],s=an(i,Xr);for(let a in s){let c=s[a];if(!c||ui(c,t))continue;let u=t.splitByTags?Pr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(cb,"getOperationsByTag");var ub={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};function Co(e){return{type:"invalid-schema",message:e}}o(Co,"getInvalidSchemaError");function lb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(lb,"getInvalidOperationIdError");function pb(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(pb,"getMissingPathParameterError");function fb(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(fb,"getNotAllowedInlineEnumError");function db(e){return{type:"not-allowed-circular-schema",message:e}}o(db,"getNotAllowedCircularSchemaError");function mb(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Aa(t,r)}`}}o(mb,"getMissingAclConditionPropertyError");function Ef(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${xa(e)} in operation ${Aa(t,r)}`}}o(Ef,"getMissingStatusCodeError");function hb(e,t,r){return{type:"invalid-status-code",message:`Operation ${Aa(t,r)} expected HTTP status code ${xa(e.expected)} but received ${xa(e.received)}`}}o(hb,"getInvalidStatusCodeError");function gb(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Aa(t,r)} has multiple success HTTP status codes: ${e.map(xa).join(", ")}`}}o(gb,"getMultipleSuccessStatusCodesError");function Aa(e,t){return e.operationId??`${t.method} ${t.path}`}o(Aa,"getOperationDescriptor");function xa(e){return`${e} (${ub[e]})`}o(xa,"getStatusCodeDescription");function jt({schema:e,meta:t,options:r}){let n=[];Se(e.type).with("string",()=>n.push(yC(e,r))).with("number","integer",()=>n.push(SC(e))).with("array",()=>n.push(bC(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
|
|
73
73
|
`,"\r",`\r
|
|
74
|
-
`].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(hC({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?gC(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(jt,"getZodChain");function hC({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable||r.replaceOptionalWithNullish&&(t!=null&&t.isParentPartial)?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(hC,"getZodChainablePresence");function gC(e){return e.default!==void 0?`default(${Se(e.type).with("number","integer",()=>ES(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(gC,"getZodChainableDefault");function yC(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${vC(e.pattern)})`),e.format){let n=Se(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(yC,"getZodChainableStringValidations");function vC(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=$S(e),`/${e}/`}o(vC,"formatPatternIfNeeded");function SC(e){let t=[];return e.enum?"":(e.type==="integer"&&t.push("int()"),e.minimum!==void 0?e.exclusiveMinimum===!0?t.push(`gt(${e.minimum})`):t.push(`gte(${e.minimum})`):typeof e.exclusiveMinimum=="number"&&t.push(`gt(${e.exclusiveMinimum})`),e.maximum!==void 0?e.exclusiveMaximum===!0?t.push(`lt(${e.maximum})`):t.push(`lte(${e.maximum})`):typeof e.exclusiveMaximum=="number"&&t.push(`lt(${e.exclusiveMaximum})`),e.multipleOf&&t.push(`multipleOf(${e.multipleOf})`),t.join("."))}o(SC,"getZodChainableNumberValidations");function bC(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(bC,"getZodChainableArrayValidations");var cn=o(e=>e.reduce((t,r)=>t+r,0),"sum");function
|
|
74
|
+
`].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(hC({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?gC(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(jt,"getZodChain");function hC({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable||r.replaceOptionalWithNullish&&(t!=null&&t.isParentPartial)?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(hC,"getZodChainablePresence");function gC(e){return e.default!==void 0?`default(${Se(e.type).with("number","integer",()=>ES(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(gC,"getZodChainableDefault");function yC(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${vC(e.pattern)})`),e.format){let n=Se(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(yC,"getZodChainableStringValidations");function vC(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=$S(e),`/${e}/`}o(vC,"formatPatternIfNeeded");function SC(e){let t=[];return e.enum?"":(e.type==="integer"&&t.push("int()"),e.minimum!==void 0?e.exclusiveMinimum===!0?t.push(`gt(${e.minimum})`):t.push(`gte(${e.minimum})`):typeof e.exclusiveMinimum=="number"&&t.push(`gt(${e.exclusiveMinimum})`),e.maximum!==void 0?e.exclusiveMaximum===!0?t.push(`lt(${e.maximum})`):t.push(`lte(${e.maximum})`):typeof e.exclusiveMaximum=="number"&&t.push(`lt(${e.exclusiveMaximum})`),e.multipleOf&&t.push(`multipleOf(${e.multipleOf})`),t.join("."))}o(SC,"getZodChainableNumberValidations");function bC(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(bC,"getZodChainableArrayValidations");var cn=o(e=>e.reduce((t,r)=>t+r,0),"sum");function ce(e,t){if(!t)return e;if(D(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?He("oneOf")+ce(e,{...t,type:t.type[0]}):e+He("oneOf")+cn(t.type.map(r=>ce(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?He("oneOf")+ce(e,t.oneOf[0]):e+He("oneOf")+cn(t.oneOf.map(r=>ce(0,r)));if(t.anyOf)return t.anyOf.length===1?He("anyOf")+ce(e,t.anyOf[0]):e+He("anyOf")+cn(t.anyOf.map(r=>ce(0,r)));if(t.allOf)return t.allOf.length===1?He("allOf")+ce(e,t.allOf[0]):e+He("allOf")+cn(t.allOf.map(r=>ce(0,r)));if(!t.type)return e;if(Ut(t.type))return t.enum?e+yb(t)+He("enum")+cn(t.enum.map(r=>ce(0,r))):e+yb(t);if(t.type==="array")return t.items?He("array")+ce(e,t.items):He("array")+ce(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=He("object")+cn(r.map(n=>ce(0,n)))}else e+=He("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=ce(0,t.additionalProperties):e+=ce(1))}return e}o(ce,"getOpenAPISchemaComplexity");function yb(e){return Se(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(yb,"complexityByType");function He(e){return Se(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(He,"complexityByComposite");var $f=class $f{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;D(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${B({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return ce(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o($f,"ZodSchema");var ko=$f;function W({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new ko(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(D(e))return _C({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=EC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=PC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=$C({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=OC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=xC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(da(e))return e.items?i.assign(`z.array(${W({...a,schema:e.items}).getCodeString(n,t.options)}${jt({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let m=e.type?e.type.toLowerCase():void 0;if(m==="object"||e.properties||e.additionalProperties){let y=e.required&&e.required.length>0,v=t.options.withImplicitRequiredProps?!1:e.properties&&!((g=e.required)!=null&&g.length),S="{}";e.properties&&(S="{ "+Object.entries(e.properties).map(([T,N])=>{var J;let Re={...s,isRequired:v?!0:y?(J=e.required)==null?void 0:J.includes(T):t.options.withImplicitRequiredProps,name:T,isParentPartial:v},re=N;if(D(N)&&t&&(re=t.getSchemaByRef(N.$ref),!re))throw new Error(`Schema ${N.$ref} not found`);let F=W({...a,schema:N,meta:Re}).getCodeString(n,t.options)+jt({schema:re,meta:Re,options:t.options});return[T,F]}).map(([T,N])=>`${PS(T)}: ${N}`).join(", ")+" }");let b="";e.additionalProperties&&(b=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?W({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+jt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let P=v?".partial()":"",E=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${S})${P}${E}${b}${d}`)}if(m==="any")return i.assign("z.any()");if(!m)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${m}`)}o(W,"getZodSchema");function _C({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!D(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=W({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(_C,"getReferenceZodSchema");function PC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Oe(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=W({schema:e.oneOf[0],resolver:r,meta:n,tag:i});return t.assign(c.getCodeString(i,r.options))}let s=(a=e.oneOf)==null?void 0:a.some(c=>Oe(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
|
|
75
75
|
z.discriminatedUnion("${c}", [${e.oneOf.map(u=>W({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
|
|
76
|
-
`)}return t.assign(`z.union([${e.oneOf.map(c=>W({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(PC,"getOneOfZodSchema");function EC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!Oe(e)||!Array.isArray(e.type)))return e.type.length===1?W({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>W({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(EC,"getArrayZodSchema");function $C({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=W({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>W({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o($C,"getAnyOfZodSchema");function OC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e)||!e.allOf)return;if(e.allOf.length===1){let p=W({schema:e.allOf[0],resolver:r,meta:n,tag:i});return t.assign(p.getCodeString(i,r.options))}let{patchRequiredSchemaInLoop:s,noRequiredOnlyAllof:a,composedRequiredSchema:c}=uS(e),u=a.map(p=>{let d=W({schema:p,resolver:r,meta:n,tag:i});return r&&s(p,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(W({schema:c,resolver:r,meta:n,tag:i}));let l=u.at(0),f=u.slice(1).map(p=>`merge(${p.getCodeString(i,r.options)})`).join(".");return t.assign(`${l.getCodeString(i,r.options)}.${f}`)}o(OC,"getAllOfZodSchema");function xC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Ut(s)){if(e.enum){if(s==="string")return AC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i});if(e.enum.some(a=>typeof a=="string"))return t.assign("z.never()");if(e.enum.length===1){let a=e.enum[0];return t.assign(`z.literal(${a===null?"null":a})`)}return t.assign(`z.union([${e.enum.map(a=>`z.literal(${a===null?"null":a})`).join(", ")}])`)}return t.assign(Se(s).with("integer",()=>"z.number()").with("string",()=>Se(e.format).with("binary",()=>ca).otherwise(()=>ua)).otherwise(a=>`z.${a}()`))}}o(xC,"getPrimitiveZodSchema");function AC({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){var l;if(!Oe(t))return;let s=li(t);if(!e.options.extractEnums)return r.assign(s);let a=e.getEnumZodSchemaDataByCode(s);if(a)return((l=r.meta.parent)==null?void 0:l.ref)===e.getRefByZodSchemaName(a.zodSchemaName)?r.assign(a.code):new ko({$ref:e.getRefByZodSchemaName(a.zodSchemaName)},e,n).inherit(r).assign(s);let c=e.getExtractedEnumZodSchemaDataByCode(s);if(!c)return r.assign(s);if(!c.zodSchemaName||!c.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let u=e.options.tsNamespaces&&c.tag!==i?`${B({type:"models",tag:c.tag,options:e.options})}.`:"";return r.assign(`${u}${c.zodSchemaName}`)}o(AC,"getEnumZodSchema");function li(e){var t;return`${go}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(li,"getEnumZodSchemaCode");function vb(e){return`${go}([${e.map(t=>`"${t}"`).join(", ")}])`}o(vb,"getEnumZodSchemaCodeFromEnumNames");function pi({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!pe(s)||t.ref===void 0)&&r){if(t.complexity<hf)return s;let u=Nt(r,n.options.schemaSuffix);for(;n.getCodeByZodSchemaName(u);){if((c=n.getZodSchemaNamesByCompositeCode(s))!=null&&c.includes(u))return u;if(n.getCodeByZodSchemaName(u)===u)return u;throw new Error(`Can't uniquely resolve zod schema name: ${u}`)}return n.setZodSchema(u,s,i),n.addZodSchemaForCompositeCode(s,t,u,e),u}let a=n.getCodeByZodSchemaName(s);if(!a&&t.ref&&(a=n.getCodeByZodSchemaName(n.getZodSchemaNameByRef(t.ref))),t.ref&&a)return ae(0,n.getSchemaByRef(t.ref))<hf?n.getCodeByZodSchemaName(s):s;if(t.ref)return n.getZodSchemaNameByRef(t.ref);throw new Error(`Invalid ref: ${t.ref}`)}o(pi,"resolveZodSchemaName");function Sb({resolver:e,endpoint:t,operation:r}){let n=r["x-acl"];return n==null?void 0:n.map(i=>{let s=Object.keys(i.conditions??{}).reduce((a,c)=>{let u=wC({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(mb(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(Sb,"getEndpointAcl");function wC({resolver:e,endpoint:t,acl:r,name:n}){var p,d,m,g,y,v,S,b,P,E;let i=(d=(p=r[0])==null?void 0:p.conditions)==null?void 0:d[n];if(!i)return;let s=i.replace(/^\$[^.]*\./,"").split("."),a,c,u,l=0,f=t.parameters.find(({name:_})=>_===s[l]);if(f)c=(m=f.parameterObject)==null?void 0:m.required,a=(g=f.parameterObject)==null?void 0:g.schema,u=`${f.name} ${_r(f.type)} parameter`,l++;else{let _=t.parameters.find(({bodyObject:Re})=>!!Re),N=Object.keys(((y=_==null?void 0:_.bodyObject)==null?void 0:y.content)??{}).find(We);N&&(a=(b=(S=(v=_==null?void 0:_.bodyObject)==null?void 0:v.content)==null?void 0:S[N])==null?void 0:b.schema,u=`${Ae(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let _=e.resolveObject(a);a=(P=Object.entries(_.properties??{}).find(([N])=>N===s[l]))==null?void 0:P[1],c=((E=_.required)==null?void 0:E.includes(s[l]))??!1,l++}if(a)return{name:n,type:D(a)?void 0:a.type,zodSchemaName:D(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(wC,"getEndpointAclConditionPropertyType");function bb({resolver:e,operation:t,operationName:r,isUniqueOperationName:n,tag:i}){var m,g;let s=e.resolveObject(t.requestBody);if(!s)return;let c=Object.keys(s.content??{}).find(We);if(!c)return;let u=(g=(m=s.content)==null?void 0:m[c])==null?void 0:g.schema;if(!u)return;let l=W({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),f=e.resolveObject(u),p=pi({schema:f,zodSchema:l,fallbackName:_a(rn(r,n,i)),resolver:e,tag:i}),d=jt({schema:f,meta:l.meta,options:e.options});return{endpointParameter:{name:pa,type:"Body",description:s.description,zodSchema:p+d,bodyObject:s},requestFormat:c}}o(bb,"getEndpointBody");function _b({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!fS.includes(s.in))return;let a={};if(s.content){let m=Object.keys(s.content??{}),g=m.find(We);if(!g)throw new Error(`Unsupported media type for param ${s.name}: ${m.join(", ")}`);let y=s.content[g];if(!y)throw new Error(`No content with media type for param ${s.name}: ${g}`);a=(y==null?void 0:y.schema)??y}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=jS(rn(r,n,i),s.name),u;if(AS(s)){let m=wo(c,e.options.enumSuffix,e.options.schemaSuffix),g=vb(s["x-enumNames"]);e.setZodSchema(m,g,i),u=m}let l=W({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),f=e.resolveObject(a),p=jt({schema:f,meta:l.meta,options:e.options}),d=pi({schema:f,zodSchema:l.assign(l.getCodeString(i)+p),fallbackName:c,resolver:e,tag:i});return{name:Se(s.in).with("path",()=>bf(s.name)).otherwise(()=>s.name),type:Se(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:d,parameterObject:s,parameterSortingEnumSchemaName:u}}o(_b,"getEndpointParameter");function Eb(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){if(tn(c,e.options))continue;let u=e.openApiDoc.paths[c],l=an(u,Xr),f=Pb(u.parameters??[]);for(let p in l){let d=l[p];if(!d||ui(d,e.options))continue;let m=d.operationId&&d.operationId!==At(d.operationId);d.operationId&&m&&e.validationErrors.push(lb(d.operationId));let g=Object.entries({...f,...Pb(d.parameters??[])}).map(([,_])=>_),y=No({path:c,method:p,operation:d,operationsByTag:e.operationsByTag,options:e.options}),v=e.operationNames.filter(_=>_===y).length<=1,S=Pr(d,e.options),b={method:p,path:xS(c),operationName:y,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(Rt),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[],mediaUpload:!!d["x-media-upload"],mediaDownload:!!d["x-media-download"]};if(d.requestBody){let _=bb({resolver:e,operation:d,operationName:y,isUniqueOperationName:v,tag:S});_&&(b.parameters.push(_.endpointParameter),b.requestFormat=_.requestFormat)}for(let _ of g){let T=_b({resolver:e,param:_,operationName:y,isUniqueOperationName:v,tag:S});T&&b.parameters.push(T)}let P=IC(b);P.forEach(_=>{b.parameters.push(_)}),P.length>0&&e.validationErrors.push(pb(P,c));for(let _ in d.responses){b.responseStatusCodes.push(_);let T=e.resolveObject(d.responses[_]),Re=Object.keys(T.content??{}).find(si),re,F;if(Re?(b.responseFormat=Re,re=(i=(n=T.content)==null?void 0:n[Re])==null?void 0:i.schema):(F=ho,_==="200"&&e.validationErrors.push(hb({received:"200",expected:"204"},d,b))),re){let J=W({schema:re,resolver:e,meta:{isRequired:!0},tag:S}),_e=e.resolveObject(re);F=pi({schema:_e,zodSchema:J,fallbackName:J.ref?void 0:Pa({statusCode:_,operationName:y,isUniqueOperationName:v,tag:S}),resolver:e,tag:S})+jt({schema:_e,meta:J.meta,options:e.options})}if(F){let J=Number(_);Po(J)&&!b.response?(b.response=F,b.responseObject=T,b.responseDescription=T.description):_!=="default"&&ga(J)&&b.errors.push({zodSchema:F,status:J,description:T.description})}}b.response||(b.response=ho);let E=Object.keys(d.responses).map(Number).filter(Po);E.length>1&&e.validationErrors.push(gb(E.map(String),d,b)),b.acl=Sb({resolver:e,endpoint:b,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!b.responseStatusCodes.includes("401")&&e.validationErrors.push(Ef("401",d,b)),(a=b.acl)!=null&&a[0]&&!b.responseStatusCodes.includes("403")&&e.validationErrors.push(Ef("403",d,b)),t.push(b)}}return t}o(Eb,"getEndpointsFromOpenAPIDoc");function Pb(e){return Object.fromEntries((e??[]).map(t=>[D(t)?t.$ref:t.name,t]))}o(Pb,"getParameters");function IC(e){return[...e.path.matchAll(/:([a-zA-Z0-9_]+)/g)].map(r=>r[1]).filter(r=>e.parameters.findIndex(({name:n})=>n===r)===-1).map(r=>TC(r))}o(IC,"getMissingPathParameters");function TC(e){return{name:e,type:"Path",zodSchema:ua,parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(TC,"getPathParameterFromName");function $b(e,t){let r=RC(e,t),n=NC(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o($b,"getOpenAPISchemaDependencyGraph");function RC(e,t){let r={},n={};return e.forEach(i=>CC({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o(RC,"getRefsDependencyGraph");function NC(e,t){let r={},n={},i=o((s,a)=>{n[a].add(s),t[s]&&a!==s&&t[s].forEach(c=>{let u=`${a}__${c}`;r[u]||(r[u]=!0,i(c,a))})},"visit");return e.forEach(s=>{let a=t[s];a&&(n[s]||(n[s]=new Set),a.forEach(c=>i(c,s)))}),n}o(NC,"getDeepRefsDependencyGraph");function CC({schema:e,fromRef:t,getSchemaByRef:r,visitedRefs:n={},refsDependencyGraph:i={}}){let s=o(a=>{if(a.type!=="reference"||!a.data)return;let{schema:c,data:u}=a;if(i[u.fromRef]||(i[u.fromRef]=new Set),i[u.fromRef].add(c.$ref),n[c.$ref])return!0;n[u.fromRef]=!0,xe(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return xe(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(CC,"getSchemaRefsDependencyGraph");function wa(e,t,r){let n=[];return xe(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):D(s.parentSchema)&&(s.type==="property"?e.validationErrors.push(Co(`${r} has both reference and properties`)):s.type==="additionalProperties"?e.validationErrors.push(Co(`${r} has both reference and additionalProperties`)):s.type==="array"?e.validationErrors.push(Co(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(Co(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(wa,"getSchemaRefObjs");function Ob(e,t){return t.map(i=>en(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(Ob,"getDeepSchemaRefObjs");function xb(e){e.extractedEnumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=yf(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=wo(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!Of(e);)kC(e,t+2),t++;if(Of(e)||e.extractedEnumZodSchemaData.filter(n=>!Ab(e,n)).forEach(n=>{n.zodSchemaName=wo(n.meta.zodSchemaNameSegments[0].map(i=>xf(Z(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!Of(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(xb,"resolveExtractedEnumZodSchemaNames");function Of(e){return e.extractedEnumZodSchemaData.every(t=>Ab(e,t))}o(Of,"allExtractedEnumZodSchemaNamesAreUnique");function kC(e,t){e.extractedEnumZodSchemaData.forEach(r=>{let n=e.extractedEnumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&jC(n,t)})}o(kC,"additionalResolveExtractedEnumZodSchemaName");function jC(e,t=2){e.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(i=>i[i.length-t]).filter(Boolean);if(n.length===1){let i=[xf(Z(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=yf(n),s=[i?xf(Z(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(jC,"suffixWithPreviousSegmentName");function Ab(e,t){return e.extractedEnumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(Ab,"isUnique");function xf(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(xf,"sanitizeName");function wb(e){e.extractedEnumZodSchemaData.forEach(t=>{let r=Fe(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(wb,"resolveExtractedEnumZodSchemaTags");function jo({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&Ib({schema:e,nameSegments:t,...n}),xe(e,{data:{nameSegments:t},onSchema:o(s=>{var c;if(s.type==="reference")return!0;let a=[...((c=s.data)==null?void 0:c.nameSegments)??[]];s.type==="property"&&a.push(s.propertyName),Ib({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(jo,"updateExtractedEnumZodSchemaData");function Ib({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||D(t)||!t.enum)return;let a=li(t),c=e.extractedEnumZodSchemaData.find(u=>u.code===a);c?(c.meta.zodSchemaNameSegments.push(s),c.meta.tags.push(...i),c.meta.schemaRefs.push(...r?[r]:[]),c.meta.schemas.push(...t?[t]:[])):e.extractedEnumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(fb(r?`${oi(r)}.${s[s.length-1]}`:n??s.join(".")))}o(Ib,"handleExtractedEnumZodSchemaDataUpdate");function Tb(e){var n;let t={},r={};return Object.entries(((n=e.openApiDoc.components)==null?void 0:n.schemas)??{}).forEach(([i,s])=>{let a=e.getSchemaDataByName(i);if(e.options.excludeRedundantZodSchemas&&(!a||a.deepRefOperations.length===0&&a.tags.length===0))return;let c=Nt(i,e.options.schemaSuffix);if(t[c])return;let u=e.getTagByZodSchemaName(c),l=e.resolveObject(s);l.enum?r[c]=li(l):t[c]=W({schema:s,resolver:e,tag:u}).getCodeString(u)}),{zodSchemas:t,enumZodSchemas:r}}o(Tb,"getZodSchemasFromOpenAPIDoc");function Rb(e){var r;let t=[];return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=Nt(n,e.options.schemaSuffix),a=e.resolveObject(i);!t.find(c=>c.zodSchemaName===s)&&a.enum&&t.push({zodSchemaName:s,code:li(a)})}),t}o(Rb,"getEnumZodSchemasFromOpenAPIDoc");var Af=class Af{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=$b(this.schemaRefs,this.getSchemaByRef.bind(this)),this.enumZodSchemas=Rb(this),this.operationsByTag=cb(t,r),this.operationNames=ab(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];dependencyGraph;enumZodSchemas=[];extractedEnumZodSchemaData=[];operationsByTag={};operationNames=[];validationErrors=[];get docSchemas(){var t;return((t=this.openApiDoc.components)==null?void 0:t.schemas)??{}}get schemaRefs(){return Object.keys(this.docSchemas).map(_S)}getSchemaByRef(t){return this.docSchemas[oi(t)]}getSchemaDataByName(t){return this.schemaData.find(r=>r.name===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(en(t)))==null?void 0:n.zodSchemaName)??((i=this.extractedEnumZodSchemaData.find(s=>s.zodSchemaName===t))==null?void 0:i.zodSchemaName);if(!r)throw new Error(`Zod schema not found for ref: ${t}`);return r}getRefByZodSchemaName(t){var r;return(r=this.schemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.ref}getTagByZodSchemaName(t){var u,l;if(!this.options.splitByTags)return this.options.defaultTag;let r=this.extractedEnumZodSchemaData.find(f=>f.zodSchemaName===t);if(r)return Rt(r.tag??this.options.defaultTag);let n=this.getRefByZodSchemaName(t),i=n?((u=this.getSchemaDataByRef(n))==null?void 0:u.tags)??[]:[],s=((l=this.zodSchemaData.find(f=>f.zodSchemaName===t))==null?void 0:l.tags)??[],a=Fe(i,s),c=a.length===1?a[0]:this.options.defaultTag;return Rt(c??this.options.defaultTag)}getCodeByZodSchemaName(t){var r;return(r=this.zodSchemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.code}getZodSchemaNamesByCompositeCode(t){var r;return(r=this.compositeZodSchemaData.find(n=>n.code===t))==null?void 0:r.zodSchemas.map(n=>n.zodSchemaName)}setZodSchema(t,r,n){let i=this.zodSchemaData.find(s=>s.zodSchemaName===t);i?(i.code=r,i.tags=(i.tags??[]).concat(n)):this.zodSchemaData.push({zodSchemaName:t,code:r,tags:[n]})}addZodSchemaForCompositeCode(t,r,n,i){let s={zodSchemaName:n,zodSchema:r,schema:i},a=this.compositeZodSchemaData.find(c=>c.code===t);a?a.zodSchemas.push(s):this.compositeZodSchemaData.push({code:t,zodSchemas:[s]})}getCompositeZodSchemaByZodSchemaName(t){var n;let r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t));return(n=r==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.zodSchema}getSchemaByCompositeZodSchemaName(t){var r,n;return(n=(r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t)))==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.schema}getEnumZodSchemaDataByCode(t){return this.enumZodSchemas.find(r=>r.code===t)}getExtractedEnumZodSchemaDataByCode(t){return this.extractedEnumZodSchemaData.find(r=>r.code===t)}getExtractedEnumZodSchemaNamesReferencedBySchemaRef(t){return this.extractedEnumZodSchemaData.reduce((r,{zodSchemaName:n,meta:i})=>(n&&i.schemaRefs.includes(t)&&r.push(n),r),[])}getZodSchemas(){return this.zodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>({...t,[r]:n}),{})}getExtractedEnumZodSchemas(){return this.extractedEnumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return D(t)?this.getSchemaByRef(t.$ref):t}isSchemaCircular(t){var r;return(r=this.dependencyGraph.deepDependencyGraph[t])==null?void 0:r.has(t)}getCircularSchemaChain(t,r=t,n=[],i=[]){var s,a;return i.includes(r)?[]:(i.push(r),(s=this.dependencyGraph.refsDependencyGraph[r])!=null&&s.has(t)?[...n,r,t]:Array.from(((a=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:a.values())??[]).map(c=>{let u=this.getCircularSchemaChain(t,c,n,i);return u.length>0?[r,...u]:u}).flat())}getBaseUrl(){var r,n;let t=(n=(r=this.openApiDoc.servers)==null?void 0:r[0])==null?void 0:n.url;return this.options.baseUrl===""&&t?t:this.options.baseUrl}getZodSchemaObj(t){let r=this.getRefByZodSchemaName(t);if(r)return this.getSchemaByRef(r);let n=this.getSchemaByCompositeZodSchemaName(t);if(n)return n;let i=this.getExtractedEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getExtractedEnumZodSchemaDataByName(t){return this.extractedEnumZodSchemaData.find(({zodSchemaName:r})=>r===t)}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=en(a),u=oi(c),l=Nt(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[],deepRefOperations:[]})});for(let a in this.openApiDoc.paths){if(tn(a,this.options))continue;let c=this.openApiDoc.paths[a],u=an(c,Xr);for(let l in u){let f=u[l];if(!f||ui(f,this.options))continue;let p=Pr(f,this.options),d=No({path:a,method:l,operation:f,operationsByTag:this.operationsByTag,options:this.options}),m=this.operationNames.filter(S=>S===d).length<=1,g=se(rn(d,m,p)),y=[];if((t=f.parameters)==null||t.map(S=>{let b=S,P=b.schema,E=`Operation ${f.operationId??a} parameter ${b.name}`;y.push(...wa(this,P,E)),this.options.extractEnums&&jo({resolver:this,schema:P,schemaInfo:E,tags:[p],nameSegments:[g,b.name],includeSelf:!0})}),f.requestBody){let S=this.resolveObject(f.requestBody),P=Object.keys(S.content??{}).find(We);if(P){let E=(n=(r=S.content)==null?void 0:r[P])==null?void 0:n.schema,_=`Operation ${f.operationId} request body`;y.push(...wa(this,E,_)),this.options.extractEnums&&jo({resolver:this,schema:E,schemaInfo:_,tags:[p],nameSegments:[_a(g)]})}}for(let S in f.responses){let b=this.resolveObject(f.responses[S]),E=Object.keys(b.content??{}).find(si);if(E){let _=(s=(i=b.content)==null?void 0:i[E])==null?void 0:s.schema,T=`Operation ${f.operationId} response body`;y.push(...wa(this,_,T)),this.options.extractEnums&&jo({resolver:this,schema:_,schemaInfo:T,tags:[p],nameSegments:[Pa({statusCode:S,operationName:d,isUniqueOperationName:m,tag:p})]})}}Ob(this,y).forEach(S=>{let b=this.getSchemaDataByRef(S);b&&(b.tags.push(p),b.deepRefOperations.push(f))})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=en(a);jo({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[oi(c)]})}),wb(this),this.handleDuplicateEnumZodSchemas(),xb(this))}handleDuplicateEnumZodSchemas(){let t=this.enumZodSchemas.map(({code:n})=>n),r=this.enumZodSchemas.filter(({code:n})=>t.includes(n));this.schemaData.forEach(n=>{var a,c;let i=(a=r.find(({zodSchemaName:u})=>u===n.zodSchemaName))==null?void 0:a.code;if(!i)return;let s=this.extractedEnumZodSchemaData.find(({code:u})=>u===i);!s||((c=this.getEnumZodSchemaDataByCode(s.code))==null?void 0:c.zodSchemaName)!==n.zodSchemaName||(n.tags.push(...s.meta.tags??[]),s.meta.schemaRefs.forEach(u=>{this.dependencyGraph.refsDependencyGraph[u]||(this.dependencyGraph.refsDependencyGraph[u]=new Set),this.dependencyGraph.refsDependencyGraph[u].add(n.ref),this.dependencyGraph.deepDependencyGraph[u]||(this.dependencyGraph.deepDependencyGraph[u]=new Set),this.dependencyGraph.deepDependencyGraph[u].add(n.ref)}))}),this.extractedEnumZodSchemaData.splice(0,this.extractedEnumZodSchemaData.length,...this.extractedEnumZodSchemaData.filter(({code:n})=>!t.includes(n)))}};o(Af,"SchemaResolver");var Ia=Af;function Nb(e){let t=[],r={};function n(i,s){Array.isArray(s)||(s=[]),s.push(i),r[i]=!0,e[i]&&e[i].forEach(a=>{s.includes(a)||r[a]||n(a,s.slice(0))}),t.includes(i)||t.push(i)}return o(n,"visit"),Object.keys(e).forEach(i=>n(i,[])),t}o(Nb,"topologicalSort");function Cb(e,t){let r=Object.entries(e),n=r.filter(([i])=>t.includes(i)).sort(([i],[s])=>t.indexOf(i)-t.indexOf(s)).concat(r.filter(([i])=>!t.includes(i)));return Object.fromEntries(n)}o(Cb,"sortObjKeysFromArray");function kb(e,t){let r=Nb(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return Cb(t,r)}o(kb,"sortZodSchemasByTopology");function jb(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(db(e.getCircularSchemaChain(s).join(" -> "))),r[Nt(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[Nt(n,e.options.schemaSuffix)]=i}),r}o(jb,"wrapCircularZodSchemas");function Ta(e,t){let r=new Ia(e,t),n=Eb(r),i=Tb(r),s={...i.zodSchemas,...r.getZodSchemas(),...i.enumZodSchemas};return s=jb(r,s),s=kb(r,s),s={...r.getExtractedEnumZodSchemas(),...s},{resolver:r,data:qC({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(Ta,"getDataFromOpenAPIDoc");function qC({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=$r(s,n);qb(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(qb(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(qC,"splitDataByTags");function qb(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(qb,"getTagElement");async function Mb(e,t){let{resolver:r,data:n}=await Ta(e,t),i=[],s=[];return n.forEach(({endpoints:c,zodSchemas:u},l)=>{Object.keys(u).forEach(f=>{let p=r.getRefByZodSchemaName(f),d=p?r.getSchemaByRef(p):r.getSchemaByCompositeZodSchemaName(f),m=ai({zodSchemaName:f,schema:d,resolver:r}),g;d&&(g=sn({schema:d,parentTypes:[m],resolver:r})),i.push({...m,metaType:"primitive",...g})}),c.forEach(f=>{let p="queries",d=Rt(l);s.push({name:Oa(f),importPath:nn({type:p,tag:d,includeTagDir:!0,options:t}),namespace:t.tsNamespaces?B({type:p,tag:d,options:t}):void 0,isQuery:Ae(f),isMutation:kt(f),params:MC({resolver:r,endpoint:f}),response:DC({resolver:r,endpoint:f})})})}),{openApiDoc:e,models:i,queries:s}}o(Mb,"getMetadataFromOpenAPIDoc");function MC({resolver:e,endpoint:t}){return t.parameters.map(r=>{var a,c,u,l;let n;if((a=r.parameterObject)!=null&&a.schema)n=e.resolveObject(r.parameterObject.schema);else if(r.bodyObject){let p=Object.keys(r.bodyObject.content??{}).find(We);p&&(n=e.resolveObject((u=(c=r.bodyObject.content)==null?void 0:c[p])==null?void 0:u.schema))}let i=ai({zodSchemaName:r.zodSchema,schema:n,resolver:e}),s;return n&&(s=sn({schema:n,parentTypes:[i],resolver:e})),{name:At(r.name),isRequired:((l=r.parameterObject)==null?void 0:l.required)??!0,...i,...s,paramType:r.type}}).sort((r,n)=>{if(r.isRequired===n.isRequired){let i=["Path","Body","Query","Header"];return i.indexOf(r.paramType)-i.indexOf(n.paramType)}return r.isRequired?-1:1}).map(({paramType:r,...n})=>n)}o(MC,"getQueryMetadataParams");function DC({resolver:e,endpoint:t}){var a,c,u,l;let r,n=Object.keys(((a=t.responseObject)==null?void 0:a.content)??{}).find(si);n&&(r=e.resolveObject((l=(u=(c=t.responseObject)==null?void 0:c.content)==null?void 0:u[n])==null?void 0:l.schema));let i=ai({zodSchemaName:t.response,schema:r,resolver:e}),s;return r&&(s=sn({schema:r,parentTypes:[i],resolver:e})),{...i,metaType:"primitive",...s}}o(DC,"getQueryMetadataResponse");var _d=et(Wt());var Sd=et(require("fs")),wP=et(require("path"));function IP(e){return Sd.default.readFileSync(wP.default.join(__dirname,`../${e}`),"utf-8")}o(IP,"readFileSync");function bd(e){let t=`src/generators/templates/${e}.hbs`;return IP(t)}o(bd,"readHbsTemplateSync");function TP(e){let t=`src/assets/${e}`;return IP(t)}o(TP,"readAssetSync");function Yt({output:e,fileName:t}){return`${e}/${t}`}o(Yt,"getOutputFileName");var Dt=et(Wt());function RP(e){Tq(),Rq(),Nq(e.options),Cq(),kq(),jq(),qq(),Mq(),Dq()}o(RP,"registerAclHbsHelpers");function Tq(){Dt.default.registerHelper("abilityTypeName",IS)}o(Tq,"registerAbilityTypeNameHelper");function Rq(){Dt.default.registerHelper("abilityFunctionName",xo)}o(Rq,"registerAbilityFunctionNameHelper");function Nq(e){Dt.default.registerHelper("importedAbilityFunctionName",t=>TS(t,e))}o(Nq,"registerImportedAbilityFunctionNameHelper");function Cq(){Dt.default.registerHelper("ablityAction",RS)}o(Cq,"registerAbilityActionHelper");function kq(){Dt.default.registerHelper("ablitySubject",NS)}o(kq,"registerAbilitySubjectHelper");function jq(){Dt.default.registerHelper("hasAbilityConditions",Sa)}o(jq,"registerHasAbilityConditionsHelper");function qq(){Dt.default.registerHelper("abilityConditionsTypes",Ao)}o(qq,"registerAbilityConditionsTypesHelper");function Mq(){Dt.default.registerHelper("abilityDescription",CS)}o(Mq,"registerAbilityDescriptionHelper");function Dq(){Dt.default.registerHelper("tagAllAbilitiesName",ba)}o(Dq,"registerTagAllAbilitiesNameHelper");var Qo=et(Wt());function NP(){Lq(),Fq(),Hq(),Vq()}o(NP,"registerCommonHbsHelpers");function Lq(){Qo.default.registerHelper("isEqual",(e,t)=>e===t)}o(Lq,"registerIsEqualHelper");function Fq(){Qo.default.registerHelper("commaSeparated",e=>e.join(", "))}o(Fq,"registerCommaSeparatedListHelper");function Hq(){Qo.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
|
|
77
|
-
*`))}o(Hq,"registerAddAsteriskAfterNewLineHelper");function Vq(){Qo.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(Vq,"registerJsonStringifyHelper");var Tr=et(Wt());function CP(e){Bq(),Gq(e.options),zq(e),Uq(),Zq(),Kq(e),Qq()}o(CP,"registerEndpointsHbsHelpers");function Bq(){Tr.default.registerHelper("endpointName",Ro)}o(Bq,"registerEndpointNameHelper");function Gq(e){Tr.default.registerHelper("importedEndpointName",t=>tb(t,e))}o(Gq,"registerImportedEndpointNameHelper");function Uq(){Tr.default.registerHelper("endpointPath",rb)}o(Uq,"registerEndpointPathHelper");function Zq(){Tr.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(Zq,"registerEndpointBodyHelper");function zq(e){Tr.default.registerHelper("endpointParams",(t,r)=>Ar(e,t,r.hash))}o(zq,"registerEndpointParamsHelper");function Kq(e){Tr.default.registerHelper("endpointArgs",(t,r)=>Ar(e,t,r.hash).map(n=>n.name).join(", "))}o(Kq,"registerEndpointArgsHelper");function Qq(){Tr.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&Oe(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let p=Object.keys(e.bodyObject.content??{}).find(We);p&&(i=e.bodyObject.content[p],i.schema&&Oe(i.schema)&&(n=i.schema))}if(n){let f=Io(n);t.push(...f)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(Qq,"registerEndpointParamDescriptionHelper");var kP=et(Wt());function jP(){Wq()}o(jP,"registerImportsHbsHelpers");function Wq(){kP.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(Wq,"registerBindingsHelper");var Ie=et(Wt());function qP(e){Yq(),Jq(),Xq(),e3(e),t3(),r3(e),n3(e),i3(e),o3(e),s3(e),a3(),c3(),u3(),l3()}o(qP,"registerPartialsHbsHelpers");function Yq(){Ie.default.registerHelper("genModelJsDocs",(e,t,r)=>Te("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(Yq,"registerGenerateModelJsDocsHelper");function Jq(){Ie.default.registerHelper("genImport",e=>Te("import")({import:e}))}o(Jq,"registerImportHelper");function Xq(){Ie.default.registerHelper("genEndpointParams",(e,t)=>Te("endpoint-params")({endpoint:e,options:t}))}o(Xq,"registerGenerateEndpointParamsHelper");function e3(e){Ie.default.registerHelper("genEndpointConfig",t=>{let r=nb(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?hr:"":Te("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===ca,hasFileDownload:t.mediaDownload,axiosRequestConfigName:hr,generateParse:e.options.parseRequestParams})})}o(e3,"registerGenerateEndpointConfigHelper");function t3(){Ie.default.registerHelper("genEndpointParamParse",(e,t)=>{var r;return Te("endpoint-param-parse")({param:e,paramName:t,isQuery:e.type==="Query",zodExtended:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,addOptional:!((r=e.parameterObject??e.bodyObject)!=null&&r.required)&&(e.parameterSortingEnumSchemaName||pe(e.zodSchema))})})}o(t3,"registerGenerateEndpointParamParseHelper");function r3(e){Ie.default.registerHelper("genQueryKeys",t=>t.length===0?"":Te("query-keys")({queryEndpoints:t,queriesModuleName:So,generateInfiniteQueries:e.options.infiniteQueries}))}o(r3,"registerGenerateQueryKeysHelper");function n3(e){Ie.default.registerHelper("genQuery",t=>{if(!Ae(t))return;let r=e.options.axiosRequestConfig,n=e.options.checkAcl&&t.acl;return Te("query-use-query")({endpoint:t,queryHook:ft.query,hasQueryFn:Ar(e,t).length>0||r||n,hasQueryFnBody:n,hasAxiosRequestConfig:r,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:n,aclCheckHook:Er})})}o(n3,"registerGenerateQueryHelper");function i3(e){Ie.default.registerHelper("genMutation",(t,r)=>{if(!kt(t))return;let n=ib(t,r),i=ob(e,t,n),s=e.options.checkAcl&&t.acl;return Te("query-use-mutation")({endpoint:t,queryHook:ft.mutation,queriesModuleName:So,hasAxiosRequestConfig:e.options.axiosRequestConfig,hasMutationFnBody:t.mediaUpload||s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ri.optionsType,updateQueryEndpoints:n,destructuredVariables:i,hasAclCheck:s,aclCheckHook:Er})})}o(i3,"registerGenerateMutationHelper");function o3(e){Ie.default.registerHelper("genInfiniteQuery",t=>{if(!e.options.infiniteQueries||!ci(t))return;let r=e.options.checkAcl&&t.acl;return Te("query-use-infinite-query")({endpoint:t,infiniteQueryHook:ft.infiniteQuery,hasQueryFnBody:r,pageParamName:la.pageParamName,totalItemsName:la.totalItemsName,limitParamName:la.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:r,aclCheckHook:Er})})}o(o3,"registerGenerateInfiniteQueryHelper");function s3(e){Ie.default.registerHelper("genQueryJsDocs",(t,r)=>Te("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ri.optionsType}))}o(s3,"registerGenerateQueryJsDocsHelper");function a3(){Ie.default.registerHelper("genCaslAbilityType",e=>Te("casl-ability-type")({endpoint:e,abilityTupleType:le.abilityTuple}))}o(a3,"registerGenerateCaslAbilityTypeHelper");function c3(){Ie.default.registerHelper("genCaslAbilityFunction",e=>Te("casl-ability-function")({endpoint:e}))}o(c3,"registerGenerateCaslAbilityFunctionHelper");function u3(){Ie.default.registerHelper("genCaslAbilityQuery",e=>Te("casl-ability-query")({endpoint:e}))}o(u3,"registerGenerateCaslAbilityQueryHelper");function l3(){Ie.default.registerHelper("genAclCheckCall",e=>{var i;let t=(i=Ao(e))==null?void 0:i.map(s=>s.name),r=e.parameters.map(s=>s.name),n=t==null?void 0:t.every(s=>r.includes(s));return Te("acl-check-call")({endpoint:e,generateAclCheckParams:Sa(e)&&n})})}o(l3,"registerGenerateAclCheckCallHelper");var _i=et(Wt());function MP(){p3(),d3(),m3(),f3(),h3()}o(MP,"registerQueryHbsHelpers");function p3(){_i.default.registerHelper("queryName",(e,t)=>Oa(e,t.hash.mutation))}o(p3,"registerQueryNameHelper");function f3(){_i.default.registerHelper("infiniteQueryName",sb)}o(f3,"registerInfiniteQueryNameHelper");function d3(){_i.default.registerHelper("isQuery",Ae)}o(d3,"registerIsQueryHelper");function m3(){_i.default.registerHelper("isMutation",kt)}o(m3,"registerIsMutationHelper");function h3(){_i.default.registerHelper("isInfiniteQuery",e=>ci(e))}o(h3,"registerIsInfiniteQueryHelper");var hn=et(Wt());function DP(e){g3(e.options),y3(e),v3(e),S3(),b3(),_3(e)}o(DP,"registerZodHbsHelpers");function g3(e){hn.default.registerHelper("zodInferedType",t=>To(t,e))}o(g3,"registerInferedTypeHelper");function y3(e){hn.default.registerHelper("importedZodSchemaName",t=>qS(e,t))}o(y3,"registerImportedZodSchemaNameHelper");function v3(e){hn.default.registerHelper("importedZodSchemaInferedType",t=>Or(e,t))}o(v3,"registerImportedZodSchemaInferedTypeHelper");function S3(){hn.default.registerHelper("zodSchemaType",e=>MS(e))}o(S3,"registerZodSchemaTypeHelper");function b3(){hn.default.registerHelper("zodSchemaDescription",e=>DS(e))}o(b3,"registerZodSchemaDescriptionHelper");function _3(e){hn.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>FS(e,t,r))}o(_3,"registerZodSchemaPropertyDescriptionsHelper");function de(e,t){let r=bd(t);return NP(),jP(),DP(e),CP(e),MP(),RP(e),qP(e),_d.default.compile(r)}o(de,"getHbsTemplateDelegate");function Te(e){let t=bd(`partials/${e}`);return _d.default.compile(t)}o(Te,"getHbsPartialTemplateDelegate");function LP({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:f})=>f&&f.length>0);if(!n||n.length===0)return;let i=n.some(({acl:f})=>(f==null?void 0:f[0].conditions)&&Object.keys(f[0].conditions).length>0),s={bindings:[le.abilityTuple,...i?[le.forcedSubject,le.subject]:[]],from:Oo.from},a=n.reduce((f,p)=>{var m,g;let d=(g=(m=p.acl)==null?void 0:m[0].conditionsTypes)==null?void 0:g.reduce((y,v)=>[...y,...v!=null&&v.zodSchemaName?[v.zodSchemaName]:[]],[]);return[...f,...d??[]]},[]),c=xr({resolver:e,tag:r,zodSchemasAsTypes:Fe(a)});return de(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:B({type:"acl",tag:r,options:e.options}),endpoints:n})}o(LP,"generateAcl");function FP(e,t){let r={bindings:[le.pureAbility,...t.length===0?[le.subject,le.abilityTuple]:[]],from:Oo.from},n=BS({tags:t,entityName:Eo,getAliasEntityName:ba,type:"acl",options:e.options}),i=t.map(a=>B({type:"acl",tag:a,options:e.options}));return de(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:Eo,appAbilities:$o,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i,abilityTuple:le.abilityTuple,subject:le.subject})}o(FP,"generateAppAcl");function HP({resolver:e,data:t,tag:r=""}){var b;let n=(b=t.get(r))==null?void 0:b.endpoints;if(!n||n.length===0)return;let i={bindings:[mo],from:ZS(e.options)},s=e.options.axiosRequestConfig,a=s,c={bindings:s?[xt]:[],from:fa.from},u=e.options.parseRequestParams,l=n.reduce((P,E)=>[...P,...E.parameters],[]),f=l.filter(P=>!["Path","Header"].includes(P.type)).map(P=>P.parameterSortingEnumSchemaName??P.zodSchema),p=n.map(P=>P.response),d=Fe([...p,...u?f:[]]),m=d.some(P=>!pe(P)),g=e.options.parseRequestParams&&f.length>0,y={bindings:[Ot.name],from:YS(e.options)},v=xr({resolver:e,tag:r,zodSchemas:d.filter(pe),zodSchemasAsTypes:Fe(l.map(P=>P.zodSchema).filter(pe))});return de(e,"endpoints")({appRestClientImport:i,hasAxiosImport:a,axiosImport:c,hasZodImport:m,zodImport:ni,hasZodExtendedImport:g,zodExtendedImport:y,modelsImports:v,includeNamespace:e.options.tsNamespaces,namespace:B({type:"endpoints",tag:r,options:e.options}),restClientName:mo,hasAxiosRequestConfig:s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,endpoints:n,generateParse:u})}o(HP,"generateEndpoints");function VP(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(BP(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(VP,"getZodSchemaRefs");function BP(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&BP(n).forEach(s=>r.add(s)),r},new Set)}o(BP,"getSchemaRefs");function GP({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,f)=>[...l,...VP(e,f)],[]).filter(l=>!n[l]),s=xr({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[f,p])=>{let d=e.getRefByZodSchemaName(f);return{...l,[f]:{code:p,isCircular:!!d&&e.isSchemaCircular(d),isEnum:kS(p),schemaObj:e.getZodSchemaObj(f)}}},{});return de(e,"models")({zodImport:ni,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:B({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(GP,"generateModels");function UP({resolver:e,data:t,tag:r=""}){var re;let n=(re=t.get(r))==null?void 0:re.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:F})=>F),a=i||s,c={defaultImport:s?uf:void 0,bindings:i?[xt]:[],from:fa.from},u=n.filter(Ae),l=u.filter(F=>ci(F)),f=n.filter(kt),p={bindings:[...u.length>0?[ft.query]:[],...e.options.infiniteQueries&&l.length>0?[ft.infiniteQuery]:[],...f.length>0?[ft.mutation]:[]],from:aS.from},d=e.options.mutationEffects,m={bindings:[af],from:KS(e.options)},g=d&&f.length>0,y={bindings:[...f.length>0?[ri.optionsType,ri.hookName]:[]],from:QS(e.options)},v=n.filter(F=>F.acl),S=e.options.checkAcl&&v.length>0,b={bindings:[Er],from:WS(e.options)},P={bindings:[...u.length>0?[ta.query]:[],...e.options.infiniteQueries&&l.length>0?[ta.infiniteQuery]:[],...f.length>0?[ta.mutation]:[]],from:zS(e.options)},E=n.reduce((F,J)=>[...F,...J.parameters],[]),_=xr({resolver:e,tag:r,zodSchemasAsTypes:Fe(E.map(F=>F.zodSchema).filter(pe))}),T=HS({tag:r,endpoints:n,options:e.options}),N=VS({tag:r,endpoints:v,options:e.options});return de(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:p,hasMutationEffects:d,queryModulesImport:m,hasMutationEffectsImport:g,mutationEffectsImport:y,hasAclCheck:S,aclCheckImport:b,queryTypesImport:P,modelsImports:_,endpointsImports:T,aclImports:N,includeNamespace:e.options.tsNamespaces,tag:r,namespace:B({type:"queries",tag:r,options:e.options}),queriesModuleName:So,queryModuleEnum:af,endpoints:n,queryEndpoints:u})}o(UP,"generateQueries");function ZP(e){return de(e,"acl-check")({abilityContextImport:{...Xv,from:e.options.abilityContextImportPath},caslAbilityTupleImport:{...Oo,bindings:[le.abilityTuple]},appAbilitiesImport:{bindings:[$o],from:JS(e.options)},errorHandlingImport:{...ra,from:e.options.errorHandlingImportPath},abilityContext:sf,appAbilities:$o,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,aclCheckHook:Er})}o(ZP,"generateAclCheck");function zP(e){return de(e,"app-rest-client")({appRestClientName:mo,baseUrl:e.getBaseUrl()})}o(zP,"generateAppRestClient");function KP({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:B({type:"queries",tag:s,options:e.options})})}),de(e,"query-modules")({modules:r})}o(KP,"generateQueryModules");function QP(e){return de(e,"zod")({zodImport:ni,zodExtension:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,errorHandlingImport:{...ra,from:e.options.errorHandlingImportPath}})}o(QP,"generateZod");function WP(e,t){return t.options.acl?[{fileName:Yt({output:t.options.output,fileName:on(ya)}),content:FP(t,e)},...t.options.checkAcl?[{fileName:Yt({output:t.options.output,fileName:on(va)}),content:ZP(t)}]:[]]:[]}o(WP,"getAclFiles");function YP(e,t){return t.options.mutationEffects?[...eE([eS,sa],t),{fileName:Yt({output:t.options.output,fileName:on(oa)}),content:KP({resolver:t,data:e})}]:[]}o(YP,"getMutationEffectsFiles");function JP(e){return e.options.standalone?[...eE(Object.values(na),e),{fileName:Yt({output:e.options.output,fileName:on(ia)}),content:zP(e)}]:[]}o(JP,"getStandaloneFiles");function XP(e,t){return t.options.parseRequestParams?[{fileName:Yt({output:t.options.output,fileName:on(aa)}),content:QP(t)}]:[]}o(XP,"getZodExtendedFiles");function eE(e,t){return e.reduce((r,n)=>[...r,P3(n,t)],[])}o(eE,"getAssetFiles");function P3(e,t){let r=on(e);return{fileName:Yt({output:t.options.output,fileName:r}),content:TP(r)}}o(P3,"getAssetFile");function tE(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...yo,...t,importPath:r},{resolver:i,data:s}=Ta(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:GP,endpoints:HP,queries:UP,acl:LP};return s.forEach((f,p)=>{u.forEach(d=>{let m=l[d]({resolver:i,data:s,tag:p});if(m){let g=Yt({output:n.output,fileName:US({tag:p,type:d,options:n})});a.push({fileName:g,content:m}),d==="acl"&&c.push(p)}})}),a.push(...WP(c,i),...YP(s,i),...XP(s,i),...JP(i)),a}o(tE,"generateCodeFromOpenAPIDoc");async function E3({input:e,options:t}){let r={...yo,...t},n=await Pd.default.bundle(e);return await Mb(n,r)}o(E3,"getGenerateMetadata");async function $3({input:e,options:t}){let r={...yo,...t},n=await Pd.default.bundle(e);return tE(n,r)}o($3,"getGenerateFilesData");0&&(module.exports={getGenerateFilesData,getGenerateMetadata});
|
|
76
|
+
`)}return t.assign(`z.union([${e.oneOf.map(c=>W({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(PC,"getOneOfZodSchema");function EC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!Oe(e)||!Array.isArray(e.type)))return e.type.length===1?W({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>W({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(EC,"getArrayZodSchema");function $C({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=W({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>W({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o($C,"getAnyOfZodSchema");function OC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e)||!e.allOf)return;if(e.allOf.length===1){let p=W({schema:e.allOf[0],resolver:r,meta:n,tag:i});return t.assign(p.getCodeString(i,r.options))}let{patchRequiredSchemaInLoop:s,noRequiredOnlyAllof:a,composedRequiredSchema:c}=uS(e),u=a.map(p=>{let d=W({schema:p,resolver:r,meta:n,tag:i});return r&&s(p,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(W({schema:c,resolver:r,meta:n,tag:i}));let l=u.at(0),f=u.slice(1).map(p=>`merge(${p.getCodeString(i,r.options)})`).join(".");return t.assign(`${l.getCodeString(i,r.options)}.${f}`)}o(OC,"getAllOfZodSchema");function xC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Ut(s)){if(e.enum){if(s==="string")return AC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i});if(e.enum.some(a=>typeof a=="string"))return t.assign("z.never()");if(e.enum.length===1){let a=e.enum[0];return t.assign(`z.literal(${a===null?"null":a})`)}return t.assign(`z.union([${e.enum.map(a=>`z.literal(${a===null?"null":a})`).join(", ")}])`)}return t.assign(Se(s).with("integer",()=>"z.number()").with("string",()=>Se(e.format).with("binary",()=>ca).otherwise(()=>ua)).otherwise(a=>`z.${a}()`))}}o(xC,"getPrimitiveZodSchema");function AC({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){var l;if(!Oe(t))return;let s=li(t);if(!e.options.extractEnums)return r.assign(s);let a=e.getEnumZodSchemaDataByCode(s);if(a)return((l=r.meta.parent)==null?void 0:l.ref)===e.getRefByZodSchemaName(a.zodSchemaName)?r.assign(a.code):new ko({$ref:e.getRefByZodSchemaName(a.zodSchemaName)},e,n).inherit(r).assign(s);let c=e.getExtractedEnumZodSchemaDataByCode(s);if(!c)return r.assign(s);if(!c.zodSchemaName||!c.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let u=e.options.tsNamespaces&&c.tag!==i?`${B({type:"models",tag:c.tag,options:e.options})}.`:"";return r.assign(`${u}${c.zodSchemaName}`)}o(AC,"getEnumZodSchema");function li(e){var t;return`${go}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(li,"getEnumZodSchemaCode");function vb(e){return`${go}([${e.map(t=>`"${t}"`).join(", ")}])`}o(vb,"getEnumZodSchemaCodeFromEnumNames");function pi({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!pe(s)||t.ref===void 0)&&r){if(t.complexity<hf)return s;let u=Nt(r,n.options.schemaSuffix);for(;n.getCodeByZodSchemaName(u);){if((c=n.getZodSchemaNamesByCompositeCode(s))!=null&&c.includes(u))return u;if(n.getCodeByZodSchemaName(u)===u)return u;throw new Error(`Can't uniquely resolve zod schema name: ${u}`)}return n.setZodSchema(u,s,i),n.addZodSchemaForCompositeCode(s,t,u,e),u}let a=n.getCodeByZodSchemaName(s);if(!a&&t.ref&&(a=n.getCodeByZodSchemaName(n.getZodSchemaNameByRef(t.ref))),t.ref&&a)return ce(0,n.getSchemaByRef(t.ref))<hf?n.getCodeByZodSchemaName(s):s;if(t.ref)return n.getZodSchemaNameByRef(t.ref);throw new Error(`Invalid ref: ${t.ref}`)}o(pi,"resolveZodSchemaName");function Sb({resolver:e,endpoint:t,operation:r}){let n=r["x-acl"];return n==null?void 0:n.map(i=>{let s=Object.keys(i.conditions??{}).reduce((a,c)=>{let u=wC({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(mb(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(Sb,"getEndpointAcl");function wC({resolver:e,endpoint:t,acl:r,name:n}){var p,d,m,g,y,v,S,b,P,E;let i=(d=(p=r[0])==null?void 0:p.conditions)==null?void 0:d[n];if(!i)return;let s=i.replace(/^\$[^.]*\./,"").split("."),a,c,u,l=0,f=t.parameters.find(({name:_})=>_===s[l]);if(f)c=(m=f.parameterObject)==null?void 0:m.required,a=(g=f.parameterObject)==null?void 0:g.schema,u=`${f.name} ${_r(f.type)} parameter`,l++;else{let _=t.parameters.find(({bodyObject:Re})=>!!Re),N=Object.keys(((y=_==null?void 0:_.bodyObject)==null?void 0:y.content)??{}).find(We);N&&(a=(b=(S=(v=_==null?void 0:_.bodyObject)==null?void 0:v.content)==null?void 0:S[N])==null?void 0:b.schema,u=`${Ae(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let _=e.resolveObject(a);a=(P=Object.entries(_.properties??{}).find(([N])=>N===s[l]))==null?void 0:P[1],c=((E=_.required)==null?void 0:E.includes(s[l]))??!1,l++}if(a)return{name:n,type:D(a)?void 0:a.type,zodSchemaName:D(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(wC,"getEndpointAclConditionPropertyType");function bb({resolver:e,operation:t,operationName:r,isUniqueOperationName:n,tag:i}){var m,g;let s=e.resolveObject(t.requestBody);if(!s)return;let c=Object.keys(s.content??{}).find(We);if(!c)return;let u=(g=(m=s.content)==null?void 0:m[c])==null?void 0:g.schema;if(!u)return;let l=W({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),f=e.resolveObject(u),p=pi({schema:f,zodSchema:l,fallbackName:_a(rn(r,n,i)),resolver:e,tag:i}),d=jt({schema:f,meta:l.meta,options:e.options});return{endpointParameter:{name:pa,type:"Body",description:s.description,zodSchema:p+d,bodyObject:s},requestFormat:c}}o(bb,"getEndpointBody");function _b({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!fS.includes(s.in))return;let a={};if(s.content){let m=Object.keys(s.content??{}),g=m.find(We);if(!g)throw new Error(`Unsupported media type for param ${s.name}: ${m.join(", ")}`);let y=s.content[g];if(!y)throw new Error(`No content with media type for param ${s.name}: ${g}`);a=(y==null?void 0:y.schema)??y}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=jS(rn(r,n,i),s.name),u;if(AS(s)){let m=wo(c,e.options.enumSuffix,e.options.schemaSuffix),g=vb(s["x-enumNames"]);e.setZodSchema(m,g,i),u=m}let l=W({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),f=e.resolveObject(a),p=jt({schema:f,meta:l.meta,options:e.options}),d=pi({schema:f,zodSchema:l.assign(l.getCodeString(i)+p),fallbackName:c,resolver:e,tag:i});return{name:Se(s.in).with("path",()=>bf(s.name)).otherwise(()=>s.name),type:Se(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:d,parameterObject:s,parameterSortingEnumSchemaName:u}}o(_b,"getEndpointParameter");function Eb(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){if(tn(c,e.options))continue;let u=e.openApiDoc.paths[c],l=an(u,Xr),f=Pb(u.parameters??[]);for(let p in l){let d=l[p];if(!d||ui(d,e.options))continue;let m=d.operationId&&d.operationId!==At(d.operationId);d.operationId&&m&&e.validationErrors.push(lb(d.operationId));let g=Object.entries({...f,...Pb(d.parameters??[])}).map(([,_])=>_),y=No({path:c,method:p,operation:d,operationsByTag:e.operationsByTag,options:e.options}),v=e.operationNames.filter(_=>_===y).length<=1,S=Pr(d,e.options),b={method:p,path:xS(c),operationName:y,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(Rt),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[],mediaUpload:!!d["x-media-upload"],mediaDownload:!!d["x-media-download"]};if(d.requestBody){let _=bb({resolver:e,operation:d,operationName:y,isUniqueOperationName:v,tag:S});_&&(b.parameters.push(_.endpointParameter),b.requestFormat=_.requestFormat)}for(let _ of g){let T=_b({resolver:e,param:_,operationName:y,isUniqueOperationName:v,tag:S});T&&b.parameters.push(T)}let P=IC(b);P.forEach(_=>{b.parameters.push(_)}),P.length>0&&e.validationErrors.push(pb(P,c));for(let _ in d.responses){b.responseStatusCodes.push(_);let T=e.resolveObject(d.responses[_]),Re=Object.keys(T.content??{}).find(si),re,F;if(Re?(b.responseFormat=Re,re=(i=(n=T.content)==null?void 0:n[Re])==null?void 0:i.schema):(F=ho,_==="200"&&e.validationErrors.push(hb({received:"200",expected:"204"},d,b))),re){let J=W({schema:re,resolver:e,meta:{isRequired:!0},tag:S}),_e=e.resolveObject(re);F=pi({schema:_e,zodSchema:J,fallbackName:J.ref?void 0:Pa({statusCode:_,operationName:y,isUniqueOperationName:v,tag:S}),resolver:e,tag:S})+jt({schema:_e,meta:J.meta,options:e.options})}if(F){let J=Number(_);Po(J)&&!b.response?(b.response=F,b.responseObject=T,b.responseDescription=T.description):_!=="default"&&ga(J)&&b.errors.push({zodSchema:F,status:J,description:T.description})}}b.response||(b.response=ho);let E=Object.keys(d.responses).map(Number).filter(Po);E.length>1&&e.validationErrors.push(gb(E.map(String),d,b)),b.acl=Sb({resolver:e,endpoint:b,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!b.responseStatusCodes.includes("401")&&e.validationErrors.push(Ef("401",d,b)),(a=b.acl)!=null&&a[0]&&!b.responseStatusCodes.includes("403")&&e.validationErrors.push(Ef("403",d,b)),t.push(b)}}return t}o(Eb,"getEndpointsFromOpenAPIDoc");function Pb(e){return Object.fromEntries((e??[]).map(t=>[D(t)?t.$ref:t.name,t]))}o(Pb,"getParameters");function IC(e){return[...e.path.matchAll(/:([a-zA-Z0-9_]+)/g)].map(r=>r[1]).filter(r=>e.parameters.findIndex(({name:n})=>n===r)===-1).map(r=>TC(r))}o(IC,"getMissingPathParameters");function TC(e){return{name:e,type:"Path",zodSchema:ua,parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(TC,"getPathParameterFromName");function $b(e,t){let r=RC(e,t),n=NC(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o($b,"getOpenAPISchemaDependencyGraph");function RC(e,t){let r={},n={};return e.forEach(i=>CC({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o(RC,"getRefsDependencyGraph");function NC(e,t){let r={},n={},i=o((s,a)=>{n[a].add(s),t[s]&&a!==s&&t[s].forEach(c=>{let u=`${a}__${c}`;r[u]||(r[u]=!0,i(c,a))})},"visit");return e.forEach(s=>{let a=t[s];a&&(n[s]||(n[s]=new Set),a.forEach(c=>i(c,s)))}),n}o(NC,"getDeepRefsDependencyGraph");function CC({schema:e,fromRef:t,getSchemaByRef:r,visitedRefs:n={},refsDependencyGraph:i={}}){let s=o(a=>{if(a.type!=="reference"||!a.data)return;let{schema:c,data:u}=a;if(i[u.fromRef]||(i[u.fromRef]=new Set),i[u.fromRef].add(c.$ref),n[c.$ref])return!0;n[u.fromRef]=!0,xe(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return xe(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(CC,"getSchemaRefsDependencyGraph");function wa(e,t,r){let n=[];return xe(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):D(s.parentSchema)&&(s.type==="property"?e.validationErrors.push(Co(`${r} has both reference and properties`)):s.type==="additionalProperties"?e.validationErrors.push(Co(`${r} has both reference and additionalProperties`)):s.type==="array"?e.validationErrors.push(Co(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(Co(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(wa,"getSchemaRefObjs");function Ob(e,t){return t.map(i=>en(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(Ob,"getDeepSchemaRefObjs");function xb(e){e.extractedEnumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=yf(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=wo(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!Of(e);)kC(e,t+2),t++;if(Of(e)||e.extractedEnumZodSchemaData.filter(n=>!Ab(e,n)).forEach(n=>{n.zodSchemaName=wo(n.meta.zodSchemaNameSegments[0].map(i=>xf(Z(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!Of(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(xb,"resolveExtractedEnumZodSchemaNames");function Of(e){return e.extractedEnumZodSchemaData.every(t=>Ab(e,t))}o(Of,"allExtractedEnumZodSchemaNamesAreUnique");function kC(e,t){e.extractedEnumZodSchemaData.forEach(r=>{let n=e.extractedEnumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&jC(n,t)})}o(kC,"additionalResolveExtractedEnumZodSchemaName");function jC(e,t=2){e.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(i=>i[i.length-t]).filter(Boolean);if(n.length===1){let i=[xf(Z(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=yf(n),s=[i?xf(Z(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(jC,"suffixWithPreviousSegmentName");function Ab(e,t){return e.extractedEnumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(Ab,"isUnique");function xf(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(xf,"sanitizeName");function wb(e){e.extractedEnumZodSchemaData.forEach(t=>{let r=Fe(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(wb,"resolveExtractedEnumZodSchemaTags");function jo({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&Ib({schema:e,nameSegments:t,...n}),xe(e,{data:{nameSegments:t},onSchema:o(s=>{var c;if(s.type==="reference")return!0;let a=[...((c=s.data)==null?void 0:c.nameSegments)??[]];s.type==="property"&&a.push(s.propertyName),Ib({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(jo,"updateExtractedEnumZodSchemaData");function Ib({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||D(t)||!t.enum)return;let a=li(t),c=e.extractedEnumZodSchemaData.find(u=>u.code===a);c?(c.meta.zodSchemaNameSegments.push(s),c.meta.tags.push(...i),c.meta.schemaRefs.push(...r?[r]:[]),c.meta.schemas.push(...t?[t]:[])):e.extractedEnumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(fb(r?`${oi(r)}.${s[s.length-1]}`:n??s.join(".")))}o(Ib,"handleExtractedEnumZodSchemaDataUpdate");function Tb(e){var n;let t={},r={};return Object.entries(((n=e.openApiDoc.components)==null?void 0:n.schemas)??{}).forEach(([i,s])=>{let a=e.getSchemaDataByName(i);if(e.options.excludeRedundantZodSchemas&&(!a||a.deepRefOperations.length===0&&a.tags.length===0))return;let c=Nt(i,e.options.schemaSuffix);if(t[c])return;let u=e.getTagByZodSchemaName(c),l=e.resolveObject(s);l.enum?r[c]=li(l):t[c]=W({schema:s,resolver:e,tag:u}).getCodeString(u)}),{zodSchemas:t,enumZodSchemas:r}}o(Tb,"getZodSchemasFromOpenAPIDoc");function Rb(e){var r;let t=[];return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=Nt(n,e.options.schemaSuffix),a=e.resolveObject(i);!t.find(c=>c.zodSchemaName===s)&&a.enum&&t.push({zodSchemaName:s,code:li(a)})}),t}o(Rb,"getEnumZodSchemasFromOpenAPIDoc");var Af=class Af{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=$b(this.schemaRefs,this.getSchemaByRef.bind(this)),this.enumZodSchemas=Rb(this),this.operationsByTag=cb(t,r),this.operationNames=ab(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];dependencyGraph;enumZodSchemas=[];extractedEnumZodSchemaData=[];operationsByTag={};operationNames=[];validationErrors=[];get docSchemas(){var t;return((t=this.openApiDoc.components)==null?void 0:t.schemas)??{}}get schemaRefs(){return Object.keys(this.docSchemas).map(_S)}getSchemaByRef(t){return this.docSchemas[oi(t)]}getSchemaDataByName(t){return this.schemaData.find(r=>r.name===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(en(t)))==null?void 0:n.zodSchemaName)??((i=this.extractedEnumZodSchemaData.find(s=>s.zodSchemaName===t))==null?void 0:i.zodSchemaName);if(!r)throw new Error(`Zod schema not found for ref: ${t}`);return r}getRefByZodSchemaName(t){var r;return(r=this.schemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.ref}getTagByZodSchemaName(t){var u,l;if(!this.options.splitByTags)return this.options.defaultTag;let r=this.extractedEnumZodSchemaData.find(f=>f.zodSchemaName===t);if(r)return Rt(r.tag??this.options.defaultTag);let n=this.getRefByZodSchemaName(t),i=n?((u=this.getSchemaDataByRef(n))==null?void 0:u.tags)??[]:[],s=((l=this.zodSchemaData.find(f=>f.zodSchemaName===t))==null?void 0:l.tags)??[],a=Fe(i,s),c=a.length===1?a[0]:this.options.defaultTag;return Rt(c??this.options.defaultTag)}getCodeByZodSchemaName(t){var r;return(r=this.zodSchemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.code}getZodSchemaNamesByCompositeCode(t){var r;return(r=this.compositeZodSchemaData.find(n=>n.code===t))==null?void 0:r.zodSchemas.map(n=>n.zodSchemaName)}setZodSchema(t,r,n){let i=this.zodSchemaData.find(s=>s.zodSchemaName===t);i?(i.code=r,i.tags=(i.tags??[]).concat(n)):this.zodSchemaData.push({zodSchemaName:t,code:r,tags:[n]})}addZodSchemaForCompositeCode(t,r,n,i){let s={zodSchemaName:n,zodSchema:r,schema:i},a=this.compositeZodSchemaData.find(c=>c.code===t);a?a.zodSchemas.push(s):this.compositeZodSchemaData.push({code:t,zodSchemas:[s]})}getCompositeZodSchemaByZodSchemaName(t){var n;let r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t));return(n=r==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.zodSchema}getSchemaByCompositeZodSchemaName(t){var r,n;return(n=(r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t)))==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.schema}getEnumZodSchemaDataByCode(t){return this.enumZodSchemas.find(r=>r.code===t)}getExtractedEnumZodSchemaDataByCode(t){return this.extractedEnumZodSchemaData.find(r=>r.code===t)}getExtractedEnumZodSchemaNamesReferencedBySchemaRef(t){return this.extractedEnumZodSchemaData.reduce((r,{zodSchemaName:n,meta:i})=>(n&&i.schemaRefs.includes(t)&&r.push(n),r),[])}getZodSchemas(){return this.zodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>({...t,[r]:n}),{})}getExtractedEnumZodSchemas(){return this.extractedEnumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return D(t)?this.getSchemaByRef(t.$ref):t}isSchemaCircular(t){var r;return(r=this.dependencyGraph.deepDependencyGraph[t])==null?void 0:r.has(t)}getCircularSchemaChain(t,r=t,n=[],i=[]){var s,a;return i.includes(r)?[]:(i.push(r),(s=this.dependencyGraph.refsDependencyGraph[r])!=null&&s.has(t)?[...n,r,t]:Array.from(((a=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:a.values())??[]).map(c=>{let u=this.getCircularSchemaChain(t,c,n,i);return u.length>0?[r,...u]:u}).flat())}getBaseUrl(){var r,n;let t=(n=(r=this.openApiDoc.servers)==null?void 0:r[0])==null?void 0:n.url;return this.options.baseUrl===""&&t?t:this.options.baseUrl}getZodSchemaObj(t){let r=this.getRefByZodSchemaName(t);if(r)return this.getSchemaByRef(r);let n=this.getSchemaByCompositeZodSchemaName(t);if(n)return n;let i=this.getExtractedEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getExtractedEnumZodSchemaDataByName(t){return this.extractedEnumZodSchemaData.find(({zodSchemaName:r})=>r===t)}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=en(a),u=oi(c),l=Nt(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[],deepRefOperations:[]})});for(let a in this.openApiDoc.paths){if(tn(a,this.options))continue;let c=this.openApiDoc.paths[a],u=an(c,Xr);for(let l in u){let f=u[l];if(!f||ui(f,this.options))continue;let p=Pr(f,this.options),d=No({path:a,method:l,operation:f,operationsByTag:this.operationsByTag,options:this.options}),m=this.operationNames.filter(S=>S===d).length<=1,g=se(rn(d,m,p)),y=[];if((t=f.parameters)==null||t.map(S=>{let b=S,P=b.schema,E=`Operation ${f.operationId??a} parameter ${b.name}`;y.push(...wa(this,P,E)),this.options.extractEnums&&jo({resolver:this,schema:P,schemaInfo:E,tags:[p],nameSegments:[g,b.name],includeSelf:!0})}),f.requestBody){let S=this.resolveObject(f.requestBody),P=Object.keys(S.content??{}).find(We);if(P){let E=(n=(r=S.content)==null?void 0:r[P])==null?void 0:n.schema,_=`Operation ${f.operationId} request body`;y.push(...wa(this,E,_)),this.options.extractEnums&&jo({resolver:this,schema:E,schemaInfo:_,tags:[p],nameSegments:[_a(g)]})}}for(let S in f.responses){let b=this.resolveObject(f.responses[S]),E=Object.keys(b.content??{}).find(si);if(E){let _=(s=(i=b.content)==null?void 0:i[E])==null?void 0:s.schema,T=`Operation ${f.operationId} response body`;y.push(...wa(this,_,T)),this.options.extractEnums&&jo({resolver:this,schema:_,schemaInfo:T,tags:[p],nameSegments:[Pa({statusCode:S,operationName:d,isUniqueOperationName:m,tag:p})]})}}Ob(this,y).forEach(S=>{let b=this.getSchemaDataByRef(S);b&&(b.tags.push(p),b.deepRefOperations.push(f))})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=en(a);jo({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[oi(c)]})}),wb(this),this.handleDuplicateEnumZodSchemas(),xb(this))}handleDuplicateEnumZodSchemas(){let t=this.enumZodSchemas.map(({code:n})=>n),r=this.enumZodSchemas.filter(({code:n})=>t.includes(n));this.schemaData.forEach(n=>{var a,c;let i=(a=r.find(({zodSchemaName:u})=>u===n.zodSchemaName))==null?void 0:a.code;if(!i)return;let s=this.extractedEnumZodSchemaData.find(({code:u})=>u===i);!s||((c=this.getEnumZodSchemaDataByCode(s.code))==null?void 0:c.zodSchemaName)!==n.zodSchemaName||(n.tags.push(...s.meta.tags??[]),s.meta.schemaRefs.forEach(u=>{this.dependencyGraph.refsDependencyGraph[u]||(this.dependencyGraph.refsDependencyGraph[u]=new Set),this.dependencyGraph.refsDependencyGraph[u].add(n.ref),this.dependencyGraph.deepDependencyGraph[u]||(this.dependencyGraph.deepDependencyGraph[u]=new Set),this.dependencyGraph.deepDependencyGraph[u].add(n.ref)}))}),this.extractedEnumZodSchemaData.splice(0,this.extractedEnumZodSchemaData.length,...this.extractedEnumZodSchemaData.filter(({code:n})=>!t.includes(n)))}};o(Af,"SchemaResolver");var Ia=Af;function Nb(e){let t=[],r={};function n(i,s){Array.isArray(s)||(s=[]),s.push(i),r[i]=!0,e[i]&&e[i].forEach(a=>{s.includes(a)||r[a]||n(a,s.slice(0))}),t.includes(i)||t.push(i)}return o(n,"visit"),Object.keys(e).forEach(i=>n(i,[])),t}o(Nb,"topologicalSort");function Cb(e,t){let r=Object.entries(e),n=r.filter(([i])=>t.includes(i)).sort(([i],[s])=>t.indexOf(i)-t.indexOf(s)).concat(r.filter(([i])=>!t.includes(i)));return Object.fromEntries(n)}o(Cb,"sortObjKeysFromArray");function kb(e,t){let r=Nb(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return Cb(t,r)}o(kb,"sortZodSchemasByTopology");function jb(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(db(e.getCircularSchemaChain(s).join(" -> "))),r[Nt(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[Nt(n,e.options.schemaSuffix)]=i}),r}o(jb,"wrapCircularZodSchemas");function Ta(e,t){let r=new Ia(e,t),n=Eb(r),i=Tb(r),s={...i.zodSchemas,...r.getZodSchemas(),...i.enumZodSchemas};return s=jb(r,s),s=kb(r,s),s={...r.getExtractedEnumZodSchemas(),...s},{resolver:r,data:qC({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(Ta,"getDataFromOpenAPIDoc");function qC({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=$r(s,n);qb(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(qb(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(qC,"splitDataByTags");function qb(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(qb,"getTagElement");async function Mb(e,t){let{resolver:r,data:n}=await Ta(e,t),i=[],s=[];return n.forEach(({endpoints:c,zodSchemas:u},l)=>{Object.keys(u).forEach(f=>{let p=r.getRefByZodSchemaName(f),d=p?r.getSchemaByRef(p):r.getSchemaByCompositeZodSchemaName(f),m=ai({zodSchemaName:f,schema:d,resolver:r}),g;d&&(g=sn({schema:d,parentTypes:[m],resolver:r})),i.push({...m,metaType:"primitive",...g})}),c.forEach(f=>{let p="queries",d=Rt(l);s.push({name:Oa(f),importPath:nn({type:p,tag:d,includeTagDir:!0,options:t}),namespace:t.tsNamespaces?B({type:p,tag:d,options:t}):void 0,isQuery:Ae(f),isMutation:kt(f),params:MC({resolver:r,endpoint:f}),response:DC({resolver:r,endpoint:f})})})}),{openApiDoc:e,models:i,queries:s}}o(Mb,"getMetadataFromOpenAPIDoc");function MC({resolver:e,endpoint:t}){return t.parameters.map(r=>{var a,c,u,l;let n;if((a=r.parameterObject)!=null&&a.schema)n=e.resolveObject(r.parameterObject.schema);else if(r.bodyObject){let p=Object.keys(r.bodyObject.content??{}).find(We);p&&(n=e.resolveObject((u=(c=r.bodyObject.content)==null?void 0:c[p])==null?void 0:u.schema))}let i=ai({zodSchemaName:r.zodSchema,schema:n,resolver:e}),s;return n&&(s=sn({schema:n,parentTypes:[i],resolver:e})),{name:At(r.name),isRequired:((l=r.parameterObject)==null?void 0:l.required)??!0,...i,...s,paramType:r.type}}).sort((r,n)=>{if(r.isRequired===n.isRequired){let i=["Path","Body","Query","Header"];return i.indexOf(r.paramType)-i.indexOf(n.paramType)}return r.isRequired?-1:1}).map(({paramType:r,...n})=>n)}o(MC,"getQueryMetadataParams");function DC({resolver:e,endpoint:t}){var a,c,u,l;let r,n=Object.keys(((a=t.responseObject)==null?void 0:a.content)??{}).find(si);n&&(r=e.resolveObject((l=(u=(c=t.responseObject)==null?void 0:c.content)==null?void 0:u[n])==null?void 0:l.schema));let i=ai({zodSchemaName:t.response,schema:r,resolver:e}),s;return r&&(s=sn({schema:r,parentTypes:[i],resolver:e})),{...i,metaType:"primitive",...s}}o(DC,"getQueryMetadataResponse");var _d=et(Wt());var Sd=et(require("fs")),wP=et(require("path"));function IP(e){return Sd.default.readFileSync(wP.default.join(__dirname,`../${e}`),"utf-8")}o(IP,"readFileSync");function bd(e){let t=`src/generators/templates/${e}.hbs`;return IP(t)}o(bd,"readHbsTemplateSync");function TP(e){let t=`src/assets/${e}`;return IP(t)}o(TP,"readAssetSync");function Yt({output:e,fileName:t}){return`${e}/${t}`}o(Yt,"getOutputFileName");var Dt=et(Wt());function RP(e){Tq(),Rq(),Nq(e.options),Cq(),kq(),jq(),qq(),Mq(),Dq()}o(RP,"registerAclHbsHelpers");function Tq(){Dt.default.registerHelper("abilityTypeName",IS)}o(Tq,"registerAbilityTypeNameHelper");function Rq(){Dt.default.registerHelper("abilityFunctionName",xo)}o(Rq,"registerAbilityFunctionNameHelper");function Nq(e){Dt.default.registerHelper("importedAbilityFunctionName",t=>TS(t,e))}o(Nq,"registerImportedAbilityFunctionNameHelper");function Cq(){Dt.default.registerHelper("ablityAction",RS)}o(Cq,"registerAbilityActionHelper");function kq(){Dt.default.registerHelper("ablitySubject",NS)}o(kq,"registerAbilitySubjectHelper");function jq(){Dt.default.registerHelper("hasAbilityConditions",Sa)}o(jq,"registerHasAbilityConditionsHelper");function qq(){Dt.default.registerHelper("abilityConditionsTypes",Ao)}o(qq,"registerAbilityConditionsTypesHelper");function Mq(){Dt.default.registerHelper("abilityDescription",CS)}o(Mq,"registerAbilityDescriptionHelper");function Dq(){Dt.default.registerHelper("tagAllAbilitiesName",ba)}o(Dq,"registerTagAllAbilitiesNameHelper");var Qo=et(Wt());function NP(){Lq(),Fq(),Hq(),Vq()}o(NP,"registerCommonHbsHelpers");function Lq(){Qo.default.registerHelper("isEqual",(e,t)=>e===t)}o(Lq,"registerIsEqualHelper");function Fq(){Qo.default.registerHelper("commaSeparated",e=>e.join(", "))}o(Fq,"registerCommaSeparatedListHelper");function Hq(){Qo.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
|
|
77
|
+
*`))}o(Hq,"registerAddAsteriskAfterNewLineHelper");function Vq(){Qo.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(Vq,"registerJsonStringifyHelper");var Tr=et(Wt());function CP(e){Bq(),Gq(e.options),zq(e),Uq(),Zq(),Kq(e),Qq()}o(CP,"registerEndpointsHbsHelpers");function Bq(){Tr.default.registerHelper("endpointName",Ro)}o(Bq,"registerEndpointNameHelper");function Gq(e){Tr.default.registerHelper("importedEndpointName",t=>tb(t,e))}o(Gq,"registerImportedEndpointNameHelper");function Uq(){Tr.default.registerHelper("endpointPath",rb)}o(Uq,"registerEndpointPathHelper");function Zq(){Tr.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(Zq,"registerEndpointBodyHelper");function zq(e){Tr.default.registerHelper("endpointParams",(t,r)=>Ar(e,t,r.hash))}o(zq,"registerEndpointParamsHelper");function Kq(e){Tr.default.registerHelper("endpointArgs",(t,r)=>Ar(e,t,r.hash).map(n=>n.name).join(", "))}o(Kq,"registerEndpointArgsHelper");function Qq(){Tr.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&Oe(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let p=Object.keys(e.bodyObject.content??{}).find(We);p&&(i=e.bodyObject.content[p],i.schema&&Oe(i.schema)&&(n=i.schema))}if(n){let f=Io(n);t.push(...f)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(Qq,"registerEndpointParamDescriptionHelper");var kP=et(Wt());function jP(){Wq()}o(jP,"registerImportsHbsHelpers");function Wq(){kP.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(Wq,"registerBindingsHelper");var Ie=et(Wt());function qP(e){Yq(),Jq(),Xq(),e3(e),t3(),r3(e),n3(e),i3(e),o3(e),s3(e),a3(),c3(),u3(),l3()}o(qP,"registerPartialsHbsHelpers");function Yq(){Ie.default.registerHelper("genModelJsDocs",(e,t,r)=>Te("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(Yq,"registerGenerateModelJsDocsHelper");function Jq(){Ie.default.registerHelper("genImport",e=>Te("import")({import:e}))}o(Jq,"registerImportHelper");function Xq(){Ie.default.registerHelper("genEndpointParams",(e,t)=>Te("endpoint-params")({endpoint:e,options:t}))}o(Xq,"registerGenerateEndpointParamsHelper");function e3(e){Ie.default.registerHelper("genEndpointConfig",t=>{let r=nb(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?hr:"":Te("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===ca,hasFileDownload:t.mediaDownload,axiosRequestConfigName:hr,generateParse:e.options.parseRequestParams})})}o(e3,"registerGenerateEndpointConfigHelper");function t3(){Ie.default.registerHelper("genEndpointParamParse",(e,t)=>{var r;return Te("endpoint-param-parse")({param:e,paramName:t,isQuery:e.type==="Query",zodExtended:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,addOptional:!((r=e.parameterObject??e.bodyObject)!=null&&r.required)&&(e.parameterSortingEnumSchemaName||pe(e.zodSchema))})})}o(t3,"registerGenerateEndpointParamParseHelper");function r3(e){Ie.default.registerHelper("genQueryKeys",t=>t.length===0?"":Te("query-keys")({queryEndpoints:t,queriesModuleName:So,generateInfiniteQueries:e.options.infiniteQueries}))}o(r3,"registerGenerateQueryKeysHelper");function n3(e){Ie.default.registerHelper("genQuery",t=>{if(!Ae(t))return;let r=e.options.axiosRequestConfig,n=e.options.checkAcl&&t.acl;return Te("query-use-query")({endpoint:t,queryHook:ft.query,hasQueryFn:Ar(e,t).length>0||r||n,hasQueryFnBody:n,hasAxiosRequestConfig:r,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:n,aclCheckHook:Er})})}o(n3,"registerGenerateQueryHelper");function i3(e){Ie.default.registerHelper("genMutation",(t,r)=>{if(!kt(t))return;let n=ib(t,r),i=ob(e,t,n),s=e.options.checkAcl&&t.acl;return Te("query-use-mutation")({endpoint:t,queryHook:ft.mutation,queriesModuleName:So,hasAxiosRequestConfig:e.options.axiosRequestConfig,hasMutationFnBody:t.mediaUpload||s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ri.optionsType,updateQueryEndpoints:n,destructuredVariables:i,hasAclCheck:s,aclCheckHook:Er})})}o(i3,"registerGenerateMutationHelper");function o3(e){Ie.default.registerHelper("genInfiniteQuery",t=>{if(!e.options.infiniteQueries||!ci(t))return;let r=e.options.checkAcl&&t.acl;return Te("query-use-infinite-query")({endpoint:t,infiniteQueryHook:ft.infiniteQuery,hasQueryFnBody:r,pageParamName:la.pageParamName,totalItemsName:la.totalItemsName,limitParamName:la.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:r,aclCheckHook:Er})})}o(o3,"registerGenerateInfiniteQueryHelper");function s3(e){Ie.default.registerHelper("genQueryJsDocs",(t,r)=>Te("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ri.optionsType}))}o(s3,"registerGenerateQueryJsDocsHelper");function a3(){Ie.default.registerHelper("genCaslAbilityType",e=>Te("casl-ability-type")({endpoint:e,abilityTupleType:ae.abilityTuple}))}o(a3,"registerGenerateCaslAbilityTypeHelper");function c3(){Ie.default.registerHelper("genCaslAbilityFunction",e=>Te("casl-ability-function")({endpoint:e}))}o(c3,"registerGenerateCaslAbilityFunctionHelper");function u3(){Ie.default.registerHelper("genCaslAbilityQuery",e=>Te("casl-ability-query")({endpoint:e}))}o(u3,"registerGenerateCaslAbilityQueryHelper");function l3(){Ie.default.registerHelper("genAclCheckCall",e=>{var i;let t=(i=Ao(e))==null?void 0:i.map(s=>s.name),r=e.parameters.map(s=>s.name),n=t==null?void 0:t.every(s=>r.includes(s));return Te("acl-check-call")({endpoint:e,generateAclCheckParams:Sa(e)&&n})})}o(l3,"registerGenerateAclCheckCallHelper");var _i=et(Wt());function MP(){p3(),d3(),m3(),f3(),h3()}o(MP,"registerQueryHbsHelpers");function p3(){_i.default.registerHelper("queryName",(e,t)=>Oa(e,t.hash.mutation))}o(p3,"registerQueryNameHelper");function f3(){_i.default.registerHelper("infiniteQueryName",sb)}o(f3,"registerInfiniteQueryNameHelper");function d3(){_i.default.registerHelper("isQuery",Ae)}o(d3,"registerIsQueryHelper");function m3(){_i.default.registerHelper("isMutation",kt)}o(m3,"registerIsMutationHelper");function h3(){_i.default.registerHelper("isInfiniteQuery",e=>ci(e))}o(h3,"registerIsInfiniteQueryHelper");var hn=et(Wt());function DP(e){g3(e.options),y3(e),v3(e),S3(),b3(),_3(e)}o(DP,"registerZodHbsHelpers");function g3(e){hn.default.registerHelper("zodInferedType",t=>To(t,e))}o(g3,"registerInferedTypeHelper");function y3(e){hn.default.registerHelper("importedZodSchemaName",t=>qS(e,t))}o(y3,"registerImportedZodSchemaNameHelper");function v3(e){hn.default.registerHelper("importedZodSchemaInferedType",t=>Or(e,t))}o(v3,"registerImportedZodSchemaInferedTypeHelper");function S3(){hn.default.registerHelper("zodSchemaType",e=>MS(e))}o(S3,"registerZodSchemaTypeHelper");function b3(){hn.default.registerHelper("zodSchemaDescription",e=>DS(e))}o(b3,"registerZodSchemaDescriptionHelper");function _3(e){hn.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>FS(e,t,r))}o(_3,"registerZodSchemaPropertyDescriptionsHelper");function de(e,t){let r=bd(t);return NP(),jP(),DP(e),CP(e),MP(),RP(e),qP(e),_d.default.compile(r)}o(de,"getHbsTemplateDelegate");function Te(e){let t=bd(`partials/${e}`);return _d.default.compile(t)}o(Te,"getHbsPartialTemplateDelegate");function LP({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:f})=>f&&f.length>0);if(!n||n.length===0)return;let i=n.some(({acl:f})=>(f==null?void 0:f[0].conditions)&&Object.keys(f[0].conditions).length>0),s={bindings:[ae.abilityTuple,...i?[ae.forcedSubject,ae.subject]:[]],from:Oo.from},a=n.reduce((f,p)=>{var m,g;let d=(g=(m=p.acl)==null?void 0:m[0].conditionsTypes)==null?void 0:g.reduce((y,v)=>[...y,...v!=null&&v.zodSchemaName?[v.zodSchemaName]:[]],[]);return[...f,...d??[]]},[]),c=xr({resolver:e,tag:r,zodSchemasAsTypes:Fe(a)});return de(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:B({type:"acl",tag:r,options:e.options}),endpoints:n})}o(LP,"generateAcl");function FP(e,t){let r={bindings:[ae.pureAbility,...t.length===0?[ae.subjectType,ae.abilityTuple]:[]],from:Oo.from},n=BS({tags:t,entityName:Eo,getAliasEntityName:ba,type:"acl",options:e.options}),i=t.map(a=>B({type:"acl",tag:a,options:e.options}));return de(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:Eo,appAbilities:$o,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i,abilityTuple:ae.abilityTuple,subjectType:ae.subjectType})}o(FP,"generateAppAcl");function HP({resolver:e,data:t,tag:r=""}){var b;let n=(b=t.get(r))==null?void 0:b.endpoints;if(!n||n.length===0)return;let i={bindings:[mo],from:ZS(e.options)},s=e.options.axiosRequestConfig,a=s,c={bindings:s?[xt]:[],from:fa.from},u=e.options.parseRequestParams,l=n.reduce((P,E)=>[...P,...E.parameters],[]),f=l.filter(P=>!["Path","Header"].includes(P.type)).map(P=>P.parameterSortingEnumSchemaName??P.zodSchema),p=n.map(P=>P.response),d=Fe([...p,...u?f:[]]),m=d.some(P=>!pe(P)),g=e.options.parseRequestParams&&f.length>0,y={bindings:[Ot.name],from:YS(e.options)},v=xr({resolver:e,tag:r,zodSchemas:d.filter(pe),zodSchemasAsTypes:Fe(l.map(P=>P.zodSchema).filter(pe))});return de(e,"endpoints")({appRestClientImport:i,hasAxiosImport:a,axiosImport:c,hasZodImport:m,zodImport:ni,hasZodExtendedImport:g,zodExtendedImport:y,modelsImports:v,includeNamespace:e.options.tsNamespaces,namespace:B({type:"endpoints",tag:r,options:e.options}),restClientName:mo,hasAxiosRequestConfig:s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,endpoints:n,generateParse:u})}o(HP,"generateEndpoints");function VP(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(BP(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(VP,"getZodSchemaRefs");function BP(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&BP(n).forEach(s=>r.add(s)),r},new Set)}o(BP,"getSchemaRefs");function GP({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,f)=>[...l,...VP(e,f)],[]).filter(l=>!n[l]),s=xr({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[f,p])=>{let d=e.getRefByZodSchemaName(f);return{...l,[f]:{code:p,isCircular:!!d&&e.isSchemaCircular(d),isEnum:kS(p),schemaObj:e.getZodSchemaObj(f)}}},{});return de(e,"models")({zodImport:ni,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:B({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(GP,"generateModels");function UP({resolver:e,data:t,tag:r=""}){var re;let n=(re=t.get(r))==null?void 0:re.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:F})=>F),a=i||s,c={defaultImport:s?uf:void 0,bindings:i?[xt]:[],from:fa.from},u=n.filter(Ae),l=u.filter(F=>ci(F)),f=n.filter(kt),p={bindings:[...u.length>0?[ft.query]:[],...e.options.infiniteQueries&&l.length>0?[ft.infiniteQuery]:[],...f.length>0?[ft.mutation]:[]],from:aS.from},d=e.options.mutationEffects,m={bindings:[af],from:KS(e.options)},g=d&&f.length>0,y={bindings:[...f.length>0?[ri.optionsType,ri.hookName]:[]],from:QS(e.options)},v=n.filter(F=>F.acl),S=e.options.checkAcl&&v.length>0,b={bindings:[Er],from:WS(e.options)},P={bindings:[...u.length>0?[ta.query]:[],...e.options.infiniteQueries&&l.length>0?[ta.infiniteQuery]:[],...f.length>0?[ta.mutation]:[]],from:zS(e.options)},E=n.reduce((F,J)=>[...F,...J.parameters],[]),_=xr({resolver:e,tag:r,zodSchemasAsTypes:Fe(E.map(F=>F.zodSchema).filter(pe))}),T=HS({tag:r,endpoints:n,options:e.options}),N=VS({tag:r,endpoints:v,options:e.options});return de(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:p,hasMutationEffects:d,queryModulesImport:m,hasMutationEffectsImport:g,mutationEffectsImport:y,hasAclCheck:S,aclCheckImport:b,queryTypesImport:P,modelsImports:_,endpointsImports:T,aclImports:N,includeNamespace:e.options.tsNamespaces,tag:r,namespace:B({type:"queries",tag:r,options:e.options}),queriesModuleName:So,queryModuleEnum:af,endpoints:n,queryEndpoints:u})}o(UP,"generateQueries");function ZP(e){return de(e,"acl-check")({abilityContextImport:{...Xv,from:e.options.abilityContextImportPath},caslAbilityTupleImport:{...Oo,bindings:[ae.abilityTuple]},appAbilitiesImport:{bindings:[$o],from:JS(e.options)},errorHandlingImport:{...ra,from:e.options.errorHandlingImportPath},abilityContext:sf,appAbilities:$o,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,aclCheckHook:Er})}o(ZP,"generateAclCheck");function zP(e){return de(e,"app-rest-client")({appRestClientName:mo,baseUrl:e.getBaseUrl()})}o(zP,"generateAppRestClient");function KP({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:B({type:"queries",tag:s,options:e.options})})}),de(e,"query-modules")({modules:r})}o(KP,"generateQueryModules");function QP(e){return de(e,"zod")({zodImport:ni,zodExtension:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,errorHandlingImport:{...ra,from:e.options.errorHandlingImportPath}})}o(QP,"generateZod");function WP(e,t){return t.options.acl?[{fileName:Yt({output:t.options.output,fileName:on(ya)}),content:FP(t,e)},...t.options.checkAcl?[{fileName:Yt({output:t.options.output,fileName:on(va)}),content:ZP(t)}]:[]]:[]}o(WP,"getAclFiles");function YP(e,t){return t.options.mutationEffects?[...eE([eS,sa],t),{fileName:Yt({output:t.options.output,fileName:on(oa)}),content:KP({resolver:t,data:e})}]:[]}o(YP,"getMutationEffectsFiles");function JP(e){return e.options.standalone?[...eE(Object.values(na),e),{fileName:Yt({output:e.options.output,fileName:on(ia)}),content:zP(e)}]:[]}o(JP,"getStandaloneFiles");function XP(e,t){return t.options.parseRequestParams?[{fileName:Yt({output:t.options.output,fileName:on(aa)}),content:QP(t)}]:[]}o(XP,"getZodExtendedFiles");function eE(e,t){return e.reduce((r,n)=>[...r,P3(n,t)],[])}o(eE,"getAssetFiles");function P3(e,t){let r=on(e);return{fileName:Yt({output:t.options.output,fileName:r}),content:TP(r)}}o(P3,"getAssetFile");function tE(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...yo,...t,importPath:r},{resolver:i,data:s}=Ta(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:GP,endpoints:HP,queries:UP,acl:LP};return s.forEach((f,p)=>{u.forEach(d=>{let m=l[d]({resolver:i,data:s,tag:p});if(m){let g=Yt({output:n.output,fileName:US({tag:p,type:d,options:n})});a.push({fileName:g,content:m}),d==="acl"&&c.push(p)}})}),a.push(...WP(c,i),...YP(s,i),...XP(s,i),...JP(i)),a}o(tE,"generateCodeFromOpenAPIDoc");async function E3({input:e,options:t}){let r={...yo,...t},n=await Pd.default.bundle(e);return await Mb(n,r)}o(E3,"getGenerateMetadata");async function $3({input:e,options:t}){let r={...yo,...t},n=await Pd.default.bundle(e);return tE(n,r)}o($3,"getGenerateFilesData");0&&(module.exports={getGenerateFilesData,getGenerateMetadata});
|