@povio/openapi-codegen-cli 0.15.4 → 0.15.5

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
@@ -69,7 +69,7 @@ Expecting `+vn.join(", ")+", got '"+(this.terminals_[E]||E)+"'":yc="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(C3(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:Pi,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 _i||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new _i(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 Od.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof _i)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 _i)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 _i)return n.value;if(!r){if(!this.stackSlot)throw new Od.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 _i?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=Pi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();Pi.isValidJavaScriptVariableName=function(e){return!Pi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function C3(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(C3,"strictLookup");dc.default=Pi;RP.exports=dc.default});var jP=h((mc,kP)=>{"use strict";mc.__esModule=!0;function Wo(e){return e&&e.__esModule?e:{default:e}}o(Wo,"_interopRequireDefault");var N3=q_(),k3=Wo(N3),j3=td(),q3=Wo(j3),$d=Q_(),xd=X_(),M3=CP(),D3=Wo(M3),L3=ic(),F3=Wo(L3),H3=Yf(),V3=Wo(H3),B3=k3.default.create;function NP(){var e=B3();return e.compile=function(t,r){return xd.compile(t,r,e)},e.precompile=function(t,r){return xd.precompile(t,r,e)},e.AST=q3.default,e.Compiler=xd.Compiler,e.JavaScriptCompiler=D3.default,e.Parser=$d.parser,e.parse=$d.parse,e.parseWithoutProcessing=$d.parseWithoutProcessing,e}o(NP,"create");var Ei=NP();Ei.create=NP;V3.default(Ei);Ei.Visitor=F3.default;Ei.default=Ei;mc.default=Ei;kP.exports=mc.default});var qP=h(hc=>{"use strict";hc.__esModule=!0;hc.print=z3;hc.PrintVisitor=J;function U3(e){return e&&e.__esModule?e:{default:e}}o(U3,"_interopRequireDefault");var G3=ic(),Z3=U3(G3);function z3(e){return new J().accept(e)}o(z3,"print");function J(){this.padding=0}o(J,"PrintVisitor");J.prototype=new Z3.default;J.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
72
- `,t};J.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};J.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};J.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};J.prototype.BlockStatement=J.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};J.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+" }}")};J.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+" }}")};J.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};J.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};J.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};J.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};J.prototype.StringLiteral=function(e){return'"'+e.value+'"'};J.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};J.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};J.prototype.UndefinedLiteral=function(){return"UNDEFINED"};J.prototype.NullLiteral=function(){return"NULL"};J.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(", ")+"}"};J.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Yt=h((MB,LP)=>{var gc=jP().default,DP=qP();gc.PrintVisitor=DP.PrintVisitor;gc.print=DP.print;LP.exports=gc;function MP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=gc.compile(n)}o(MP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=MP,require.extensions[".hbs"]=MP)});var Gq={};SE(Gq,{getGenerateFilesData:()=>Uq,getGenerateMetadata:()=>Bq});module.exports=bE(Gq);var Td=Ge(sS());var vo="AppRestClient",ra={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},cf="src/data",uf="@/data",en={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/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},hr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},na={bindings:[hr.ErrorHandler,hr.SharedErrorHandler],from:en.errorHandling.template},lf="AbilityContext",aS={bindings:[lf],from:en.abilityContext.template};var ia={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},oa={fileName:"app-rest-client",extension:"ts"},pf="QueryModule",sa={fileName:"queryModules",extension:"ts"},cS={fileName:"queryConfig.context",extension:"tsx"},ni={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},aa={fileName:"useMutationEffects",extension:"ts"},ue={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},ca={fileName:"zod.utils",extension:"ts"};var uS="Schema",lS="Enum",pS="Body",fS="Param",dS="Response",mS="ErrorResponse",So="z.void()",ua="z.instanceof(Blob)",bo="z.enum",la="z.string()",ii={bindings:["z"],from:"zod"};var ff={input:"http://localhost:4000/docs-json/",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:en.abilityContext.template,abilityContextGenericAppAbilities:!1,schemaSuffix:uS,enumSuffix:lS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:en.appRestClient.template,errorHandlingImportPath:en.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:en.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var mt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},hS={bindings:[mt.query,mt.infiniteQuery,mt.mutation],from:"@tanstack/react-query"},_o={pageParamName:"page"},pa={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Po="moduleName";var ub=Ge(gS());var df={"Content-Type":"application/json",Accept:"application/json"},fa="data",mf="axios",yr="config",At="AxiosRequestConfig",da={defaultImport:mf,bindings:[At],from:"axios"};var yS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),wt=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 L(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(L,"isReferenceObject");function re(e){return!L(e)}o(re,"isSchemaObject");function ma(e){return e.type==="array"}o(ma,"isArraySchemaObject");function vS(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(yN(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(L(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(vS,"inferRequiredSchema");var yN=o(e=>!L(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Zt=Symbol.for("@ts-pattern/matcher"),vN=Symbol.for("@ts-pattern/isVariadic"),ga="@ts-pattern/anonymous-select-key",hf=o(e=>!!(e&&typeof e=="object"),"r"),ha=o(e=>e&&!!e[Zt],"i"),Rt=o((e,t,r)=>{if(ha(e)){let n=e[Zt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(hf(e)){if(!hf(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];ha(c)&&c[vN]?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)=>Rt(l,a[f],r))&&i.every((l,f)=>Rt(l,c[f],r))&&(s.length===0||Rt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Rt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||ha(s=i)&&s[Zt]().matcherType==="optional")&&Rt(i,t[n],r);var s})}return Object.is(t,e)},"s"),Pr=o(e=>{var t,r,n;return hf(e)?ha(e)?(t=(r=(n=e[Zt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Oo(e,Pr):Oo(Object.values(e),Pr):[]},"o"),Oo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Ye(e){return Object.assign(e,{optional:o(()=>SN(e),"optional"),and:o(t=>K(e,t),"and"),or:o(t=>bN(e,t),"or"),select:o(t=>t===void 0?SS(e):SS(t,e),"select")})}o(Ye,"u");function SN(e){return Ye({[Zt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Pr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Rt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Pr(e),"getSelectionKeys"),matcherType:"optional"})})}o(SN,"h");function K(...e){return Ye({[Zt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Oo(e,Pr),"getSelectionKeys"),matcherType:"and"})})}o(K,"m");function bN(...e){return Ye({[Zt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Oo(e,Pr).forEach(i=>n(i,void 0)),{matched:e.some(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Oo(e,Pr),"getSelectionKeys"),matcherType:"or"})})}o(bN,"d");function F(e){return{[Zt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(F,"p");function SS(...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 Ye({[Zt]:()=>({match:o(n=>{let i={[t??ga]:n};return{matched:r===void 0||Rt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??ga].concat(r===void 0?[]:Pr(r)),"getSelectionKeys")})})}o(SS,"y");function It(e){return typeof e=="number"}o(It,"v");function vr(e){return typeof e=="string"}o(vr,"b");function Sr(e){return typeof e=="bigint"}o(Sr,"w");var h5=Ye(F(function(e){return!0}));var br=o(e=>Object.assign(Ye(e),{startsWith:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>br(K(e,(r=>F(n=>vr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>br(K(e,(r=>F(n=>vr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>br(K(e,(r=>F(n=>vr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&!!n.match(r)))));var r},"regex")}),"j"),g5=br(F(vr)),Tt=o(e=>Object.assign(Ye(e),{between:o((t,r)=>Tt(K(e,((n,i)=>F(s=>It(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n<r))(t))),"lt"),gt:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n>r))(t))),"gt"),lte:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n<=r))(t))),"lte"),gte:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n>=r))(t))),"gte"),int:o(()=>Tt(K(e,F(t=>It(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Tt(K(e,F(t=>It(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Tt(K(e,F(t=>It(t)&&t>0))),"positive"),negative:o(()=>Tt(K(e,F(t=>It(t)&&t<0))),"negative")}),"x"),y5=Tt(F(It)),_r=o(e=>Object.assign(Ye(e),{between:o((t,r)=>_r(K(e,((n,i)=>F(s=>Sr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n<r))(t))),"lt"),gt:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n>r))(t))),"gt"),lte:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n<=r))(t))),"lte"),gte:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n>=r))(t))),"gte"),positive:o(()=>_r(K(e,F(t=>Sr(t)&&t>0))),"positive"),negative:o(()=>_r(K(e,F(t=>Sr(t)&&t<0))),"negative")}),"A"),v5=_r(F(Sr)),S5=Ye(F(function(e){return typeof e=="boolean"})),b5=Ye(F(function(e){return typeof e=="symbol"})),_5=Ye(F(function(e){return e==null})),P5=Ye(F(function(e){return e!=null}));var Sf=class Sf 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(Sf,"W");var gf=Sf,yf={matched:!1,value:void 0};function Ee(e){return new vf(e,yf)}o(Ee,"z");var Eo=class Eo{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=>Rt(l,this.input,c))||i&&!i(this.input)?yf:{matched:!0,value:r(s?ga in a?a[ga]:a:this.input,this.input)};return new Eo(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Eo(this.input,n?{matched:!0,value:r(this.input,this.input)}:yf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new gf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Eo,"I");var vf=Eo;var bf=2,bS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],_S=["query","header","path"],tn=["get","put","post","delete","options","head","patch","trace"],PS=["string","number","integer","boolean"],oi=["allOf","anyOf","oneOf"];var B=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),Er=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),ES=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),le=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),OS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),_f=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),$S=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),_N=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"),Pf=o(e=>{let t=e.map(B).map(xS).map(r=>PN(r)).flat();return _N(t)},"getMostCommonAdjacentCombinationSplit"),xS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),AS=o(e=>xS(e).join(" "),"camelToSpaceSeparated"),PN=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"),wS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${Er(r)}|${B(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var TS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),rn=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),si=o(e=>rn(e).split("/").at(-1),"getSchemaNameByRef");function Of(e){let t=EN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return le(t)}o(Of,"normalizeString");function RS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(RS,"wrapWithQuotesIfNeeded");function CS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(CS,"unwrapQuotesIfNeeded");function EN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(EN,"prefixStringStartingWithNumberIfNeeded");function $f(e){let t=e.replaceAll("_","#");return le(t.replaceAll("-","_")).replaceAll("#","_")}o($f,"pathParamToVariableName");var Je=o(e=>PS.includes(e),"isPrimitiveType");function NS(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(NS,"escapeControlCharacters");function Xe(e){return e.includes("application/")&&e.includes("json")||bS.includes(e)||e.includes("text/")}o(Xe,"isParamMediaTypeAllowed");function $o(e){return e>=200&&e<300}o($o,"isMainResponseStatus");function ya(e){return!(e>=200&&e<300)}o(ya,"isErrorStatus");function ai(e){return e.startsWith("application/")}o(ai,"isMediaTypeAllowed");var IS=/({\w+})/g,ON=/[^\w\-]+/g;function kS(e){e=B(ES(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(IS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(IS,"")}By${B(r.slice(1,-1))}`}return e.replace(ON,"_")}o(kS,"pathToVariableName");var Ef=/{(\b\w+(?:-\w+)*\b)}/g;function jS(e){let t=e.match(Ef);return t===null?e.replaceAll(Ef,":$1"):(t.forEach(r=>{let n=$f(r.replaceAll(Ef,":$1"));e=e.replaceAll(r,n)}),e)}o(jS,"replaceHyphenatedPath");var qS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&re(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),nn=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Ct(e){return OS(e)}o(Ct,"formatTag");function Or(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Ct(r??t.defaultTag)}o(Or,"getOperationTag");function MS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(MS,"isTagExcluded");var va={fileName:"acl/app.ability",extension:"ts"},xo="AllAbilities",Ao="AppAbilities",Sa={fileName:"acl/useAclCheck",extension:"ts"},$r="useAclCheck",Oe={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},xf={bindings:[Oe.abilityTuple,Oe.pureAbility,Oe.forcedSubject,Oe.subjectType,Oe.subject],from:"@casl/ability"};var He=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var DS=o(e=>`Use${B(le(e.operationName))}Ability`,"getAbilityTypeName"),wo=o(e=>`canUse${B(le(e.operationName))}`,"getAbilityFunctionName"),LS=o((e,t)=>`${t.tsNamespaces?`${U({type:"acl",tag:xr(e,t),options:t})}.`:""}${wo(e)}`,"getImportedAbilityFunctionName"),FS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),HS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),ba=o(e=>{var t;return!!((t=Io(e))!=null&&t.length)},"hasAbilityConditions"),Io=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),VS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),_a=o(e=>`${B(e)}${xo}`,"getTagAllAbilitiesName");function me(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(L(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(oi.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&&me(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&&me(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;me(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;me(s,t)}}o(me,"iterateSchema");var Nt=o((e,t)=>_f(B(Of(e)),t),"getZodSchemaName"),To=o((e,t,r)=>_f(B(Of(e)),`${t}${r}`),"getEnumZodSchemaName"),he=o(e=>["z.",`${ue.namespace}.`].every(t=>!e.startsWith(t)),"isNamedZodSchema"),BS=o(e=>e.startsWith(bo),"isEnumZodSchema"),on=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Pa=o(e=>le(`${e}_${pS}`),"getBodyZodSchemaName"),US=o((e,t)=>le(`${e}_${t}${fS}`),"getParamZodSchemaName"),$N=o(e=>le(`${e}${dS}`),"getMainResponseZodSchemaName"),xN=o((e,t)=>le(`${e}_${t}_${mS}`),"getErrorResponseZodSchemaName");function Ea({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=on(t,r,n);return!$o(i)&&e!=="default"&&ya(i)?xN(s,e):$N(s)}o(Ea,"getResponseZodSchemaName");function Ro(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${B(AS(i))}: \`${e[i]}\``],[])}o(Ro,"getSchemaDescriptions");var Co=o((e,t)=>$S(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),GS=o((e,t)=>he(t)?`${e.options.tsNamespaces?`${U({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Ar=o((e,t,r)=>{if(!he(t))return t===So?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${U({type:"models",tag:n,options:e.options})}.`:""}${Co(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function ZS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(ZS,"getZodSchemaType");function zS(e){if(e.schemaObj)return[e.schemaObj.description,...Ro(e.schemaObj)].filter(Boolean).join(". ")}o(zS,"getZodSchemaDescription");function KS(e,t,r){var n;if(L(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Ar(e,i,r):void 0}if(ma(t)){if(!L(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Ar(e,i,r)}[]`:void 0}if(oi.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return KS(e,i[0],r)}return t.type}o(KS,"getType");function QS(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,...Ro(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:KS(e,c.schema,r)??"unknown",description:p.join(". ")})}return me(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(L(c)){let u=e.resolveObject(c);me(u,{data:{pathSegments:[]},onSchema:a})}}),me(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(QS,"getZodSchemaPropertyDescriptions");function wr({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Oa({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Oa({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Co(u,e.options),"getEntityName"),options:e.options});return AN(e.options,a,c)}o(wr,"getModelsImports");function WS({tag:e,endpoints:t,options:r}){return Oa({type:"endpoints",tag:e,entities:t,getTag:o(n=>xr(n,r),"getTag"),getEntityName:No,options:r})}o(WS,"getEndpointsImports");function YS({tag:e,endpoints:t,options:r}){return Oa({type:"acl",tag:e,entities:t,getTag:o(n=>xr(n,r),"getTag"),getEntityName:wo,options:r})}o(YS,"getAclImports");function JS({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?U({type:n,tag:a,options:i}):c],from:`${kt(i)}${sn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(JS,"getEntityImports");function kt(e){let t=uf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${cf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${cf}`,"g"),uf)),`${t}/`.replace(/\/\//g,"/")}o(kt,"getImportPath");function Oa({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?U({type:e,tag:u,options:s}):i(c)],from:`${l?"./":kt(s)}${sn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Oa,"getImports");function AN(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:He(n.bindings)}))}o(AN,"mergeImports");function an({fileName:e,extension:t}){return`${e}.${t}`}o(an,"getFileNameWithExtension");function XS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${Er(t)}/`:""}${Er(t)}.${i}`:i}o(XS,"getTagFileNameWithoutExtension");function sn(...e){return XS(...e)}o(sn,"getTagImportPath");function eb(...e){return`${XS(...e)}.ts`}o(eb,"getTagFileName");var U=o(({type:e,tag:t,options:r})=>`${B(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function tb(e){return e.standalone?`${kt(e)}${oa.fileName}`:e.restClientImportPath}o(tb,"getAppRestClientImportPath");function rb(e){return e.standalone?`${kt(e)}${ia.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(rb,"getQueryTypesImportPath");function nb(e){return`${kt(e)}${sa.fileName}`}o(nb,"getQueryModulesImportPath");function ib(e){return`${kt(e)}${aa.fileName}`}o(ib,"getMutationEffectsImportPath");function ob(e){return`${kt(e)}${Sa.fileName}`}o(ob,"getAclCheckImportPath");function $a(e){return`${kt(e)}${ca.fileName}`}o($a,"getZodUtilsImportPath");function sb(e){return`${kt(e)}${va.fileName}`}o(sb,"getAppAbilitiesImportPath");function xa(e){return Ee(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(xa,"primitiveTypeToTsType");function ci({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&he(e)?(n=Ar(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Je(t==null?void 0:t.type)&&(n=xa(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:sn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(ci,"getTsTypeBase");function cn({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of oi){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return cn({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:ab({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:wN({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(cn,"getSchemaTsMetaType");function ab({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(L(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=ci({zodSchemaName:n,schema:i,resolver:r}),a=cb(s,t),c=cn({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(ab,"getArraySchemaTsType");function wN({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(L(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=ci({zodSchemaName:c,schema:u,resolver:r}),f=cb(l,t),p=cn({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=ab({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Je(i.type))return{name:n,isRequired:s,type:xa(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(wN,"getSchemaTsProperties");function cb(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(cb,"getIsCircular");var No=o(e=>Er(le(e.operationName)),"getEndpointName");function lb(e,t){return`${t.tsNamespaces?`${U({type:"endpoints",tag:xr(e,t),options:t})}.`:""}${No(e)}`}o(lb,"getImportedEndpointName");var pb=o(e=>e.method!==ub.OpenAPIV3.HttpMethods.GET,"requiresBody"),Aa=o(e=>e.parameters.find(t=>t.type==="Body"),"getEndpointBody"),fb=o((e,t)=>{let r=Af(e),n=t.options.axiosRequestConfig;return Object.keys(r).length>0||n},"hasEndpointConfig"),db=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function xr(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Ct(r??t.defaultTag)}o(xr,"getEndpointTag");function Ir(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(he(i.zodSchema))s=Ar(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&re(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Je(f)&&(s=xa(f))}return{name:wt(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!==fa)&&(!(r!=null&&r.excludePageParam)||i.name!==_o.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===_o.pageParamName?"pageParam":i.name,required:i.required&&(i.paramType==="Path"||!(r!=null&&r.pathParamsRequiredOnly))}))}o(Ir,"mapEndpointParamsToFunctionParams");function Af(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=yS(i.name)?i.name:`"${i.name}"`,a=wt(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==df["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==df.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=wt(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(Af,"getEndpointConfig");function mb(e,t){return t.filter(r=>Te(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(mb,"getUpdateQueryEndpoints");var Te=o(e=>e.method==="get","isQuery"),jt=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ui=o((e,t)=>Te(e)&&(t??Object.values(_o)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),hb=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...Ir(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return Ir(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var wa=o((e,t)=>{let r=Te(e)&&jt(e)&&t;return`use${B(le(e.operationName))}${r?"Mutation":""}`},"getQueryName"),gb=o(e=>`use${B(le(e.operationName))}Infinite`,"getInfiniteQueryName");var wf=["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 un(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(un,"pick");function li(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Or(e,t),i=MS(n,t);return r||i}o(li,"isOperationExcluded");function If({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${kS(e)}`,u=r.operationId?wt(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:B(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=wS(u,i);l===""?u=t.toLowerCase():wf.includes(l)||(u=l)}return wf.includes(u)?c:u}o(If,"getOperationName");function ko({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Or(r,n):n.defaultTag,s=o(a=>{let c=If({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>If({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??If({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(ko,"getUniqueOperationName");function yb(e,t,r){let n=[];for(let i in e.paths){if(nn(i,r))continue;let s=e.paths[i],a=un(s,tn);for(let c in a){let u=a[c];if(!u||li(u,r))continue;let l=ko({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(yb,"getUniqueOperationNamesWithoutSplitByTags");function vb(e,t){let r={};for(let n in e.paths){if(nn(n,t))continue;let i=e.paths[n],s=un(i,tn);for(let a in s){let c=s[a];if(!c||li(c,t))continue;let u=t.splitByTags?Or(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(vb,"getOperationsByTag");var Sb={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 jo(e){return{type:"invalid-schema",message:e}}o(jo,"getInvalidSchemaError");function bb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(bb,"getInvalidOperationIdError");function _b(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(_b,"getMissingPathParameterError");function Pb(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(Pb,"getNotAllowedInlineEnumError");function Eb(e){return{type:"not-allowed-circular-schema",message:e}}o(Eb,"getNotAllowedCircularSchemaError");function Ob(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Ta(t,r)}`}}o(Ob,"getMissingAclConditionPropertyError");function Tf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${Ia(e)} in operation ${Ta(t,r)}`}}o(Tf,"getMissingStatusCodeError");function $b(e,t,r){return{type:"invalid-status-code",message:`Operation ${Ta(t,r)} expected HTTP status code ${Ia(e.expected)} but received ${Ia(e.received)}`}}o($b,"getInvalidStatusCodeError");function xb(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Ta(t,r)} has multiple success HTTP status codes: ${e.map(Ia).join(", ")}`}}o(xb,"getMultipleSuccessStatusCodesError");function Ta(e,t){return e.operationId??`${t.method} ${t.path}`}o(Ta,"getOperationDescriptor");function Ia(e){return`${e} (${Sb[e]})`}o(Ia,"getStatusCodeDescription");function qt({schema:e,meta:t,options:r}){let n=[];Ee(e.type).with("string",()=>n.push(RN(e))).with("number","integer",()=>n.push(NN(e))).with("array",()=>n.push(kN(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
72
+ `,t};J.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};J.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};J.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};J.prototype.BlockStatement=J.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};J.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+" }}")};J.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+" }}")};J.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};J.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};J.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};J.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};J.prototype.StringLiteral=function(e){return'"'+e.value+'"'};J.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};J.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};J.prototype.UndefinedLiteral=function(){return"UNDEFINED"};J.prototype.NullLiteral=function(){return"NULL"};J.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(", ")+"}"};J.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Yt=h((MB,LP)=>{var gc=jP().default,DP=qP();gc.PrintVisitor=DP.PrintVisitor;gc.print=DP.print;LP.exports=gc;function MP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=gc.compile(n)}o(MP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=MP,require.extensions[".hbs"]=MP)});var Gq={};SE(Gq,{getGenerateFilesData:()=>Uq,getGenerateMetadata:()=>Bq});module.exports=bE(Gq);var Td=Ge(sS());var vo="AppRestClient",ra={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},cf="src/data",uf="@/data",en={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"}},hr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},na={bindings:[hr.ErrorHandler,hr.SharedErrorHandler],from:en.errorHandling.template},lf="AbilityContext",aS={bindings:[lf],from:en.abilityContext.template};var ia={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},oa={fileName:"app-rest-client",extension:"ts"},pf="QueryModule",sa={fileName:"queryModules",extension:"ts"},cS={fileName:"queryConfig.context",extension:"tsx"},ni={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},aa={fileName:"useMutationEffects",extension:"ts"},ue={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},ca={fileName:"zod.utils",extension:"ts"};var uS="Schema",lS="Enum",pS="Body",fS="Param",dS="Response",mS="ErrorResponse",So="z.void()",ua="z.instanceof(Blob)",bo="z.enum",la="z.string()",ii={bindings:["z"],from:"zod"};var ff={input:"http://localhost:4000/docs-json/",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:en.abilityContext.template,abilityContextGenericAppAbilities:!1,schemaSuffix:uS,enumSuffix:lS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:en.appRestClient.template,errorHandlingImportPath:en.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:en.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var mt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},hS={bindings:[mt.query,mt.infiniteQuery,mt.mutation],from:"@tanstack/react-query"},_o={pageParamName:"page"},pa={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Po="moduleName";var ub=Ge(gS());var df={"Content-Type":"application/json",Accept:"application/json"},fa="data",mf="axios",yr="config",At="AxiosRequestConfig",da={defaultImport:mf,bindings:[At],from:"axios"};var yS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),wt=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 L(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(L,"isReferenceObject");function re(e){return!L(e)}o(re,"isSchemaObject");function ma(e){return e.type==="array"}o(ma,"isArraySchemaObject");function vS(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(yN(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(L(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(vS,"inferRequiredSchema");var yN=o(e=>!L(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Zt=Symbol.for("@ts-pattern/matcher"),vN=Symbol.for("@ts-pattern/isVariadic"),ga="@ts-pattern/anonymous-select-key",hf=o(e=>!!(e&&typeof e=="object"),"r"),ha=o(e=>e&&!!e[Zt],"i"),Rt=o((e,t,r)=>{if(ha(e)){let n=e[Zt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(hf(e)){if(!hf(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];ha(c)&&c[vN]?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)=>Rt(l,a[f],r))&&i.every((l,f)=>Rt(l,c[f],r))&&(s.length===0||Rt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Rt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||ha(s=i)&&s[Zt]().matcherType==="optional")&&Rt(i,t[n],r);var s})}return Object.is(t,e)},"s"),Pr=o(e=>{var t,r,n;return hf(e)?ha(e)?(t=(r=(n=e[Zt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Oo(e,Pr):Oo(Object.values(e),Pr):[]},"o"),Oo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Ye(e){return Object.assign(e,{optional:o(()=>SN(e),"optional"),and:o(t=>K(e,t),"and"),or:o(t=>bN(e,t),"or"),select:o(t=>t===void 0?SS(e):SS(t,e),"select")})}o(Ye,"u");function SN(e){return Ye({[Zt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Pr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Rt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Pr(e),"getSelectionKeys"),matcherType:"optional"})})}o(SN,"h");function K(...e){return Ye({[Zt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Oo(e,Pr),"getSelectionKeys"),matcherType:"and"})})}o(K,"m");function bN(...e){return Ye({[Zt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Oo(e,Pr).forEach(i=>n(i,void 0)),{matched:e.some(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Oo(e,Pr),"getSelectionKeys"),matcherType:"or"})})}o(bN,"d");function F(e){return{[Zt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(F,"p");function SS(...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 Ye({[Zt]:()=>({match:o(n=>{let i={[t??ga]:n};return{matched:r===void 0||Rt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??ga].concat(r===void 0?[]:Pr(r)),"getSelectionKeys")})})}o(SS,"y");function It(e){return typeof e=="number"}o(It,"v");function vr(e){return typeof e=="string"}o(vr,"b");function Sr(e){return typeof e=="bigint"}o(Sr,"w");var h5=Ye(F(function(e){return!0}));var br=o(e=>Object.assign(Ye(e),{startsWith:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>br(K(e,(r=>F(n=>vr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>br(K(e,(r=>F(n=>vr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>br(K(e,(r=>F(n=>vr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return br(K(e,(r=t,F(n=>vr(n)&&!!n.match(r)))));var r},"regex")}),"j"),g5=br(F(vr)),Tt=o(e=>Object.assign(Ye(e),{between:o((t,r)=>Tt(K(e,((n,i)=>F(s=>It(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n<r))(t))),"lt"),gt:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n>r))(t))),"gt"),lte:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n<=r))(t))),"lte"),gte:o(t=>Tt(K(e,(r=>F(n=>It(n)&&n>=r))(t))),"gte"),int:o(()=>Tt(K(e,F(t=>It(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Tt(K(e,F(t=>It(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Tt(K(e,F(t=>It(t)&&t>0))),"positive"),negative:o(()=>Tt(K(e,F(t=>It(t)&&t<0))),"negative")}),"x"),y5=Tt(F(It)),_r=o(e=>Object.assign(Ye(e),{between:o((t,r)=>_r(K(e,((n,i)=>F(s=>Sr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n<r))(t))),"lt"),gt:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n>r))(t))),"gt"),lte:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n<=r))(t))),"lte"),gte:o(t=>_r(K(e,(r=>F(n=>Sr(n)&&n>=r))(t))),"gte"),positive:o(()=>_r(K(e,F(t=>Sr(t)&&t>0))),"positive"),negative:o(()=>_r(K(e,F(t=>Sr(t)&&t<0))),"negative")}),"A"),v5=_r(F(Sr)),S5=Ye(F(function(e){return typeof e=="boolean"})),b5=Ye(F(function(e){return typeof e=="symbol"})),_5=Ye(F(function(e){return e==null})),P5=Ye(F(function(e){return e!=null}));var Sf=class Sf 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(Sf,"W");var gf=Sf,yf={matched:!1,value:void 0};function Ee(e){return new vf(e,yf)}o(Ee,"z");var Eo=class Eo{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=>Rt(l,this.input,c))||i&&!i(this.input)?yf:{matched:!0,value:r(s?ga in a?a[ga]:a:this.input,this.input)};return new Eo(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Eo(this.input,n?{matched:!0,value:r(this.input,this.input)}:yf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new gf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Eo,"I");var vf=Eo;var bf=2,bS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],_S=["query","header","path"],tn=["get","put","post","delete","options","head","patch","trace"],PS=["string","number","integer","boolean"],oi=["allOf","anyOf","oneOf"];var B=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),Er=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),ES=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),le=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),OS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),_f=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),$S=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),_N=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"),Pf=o(e=>{let t=e.map(B).map(xS).map(r=>PN(r)).flat();return _N(t)},"getMostCommonAdjacentCombinationSplit"),xS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),AS=o(e=>xS(e).join(" "),"camelToSpaceSeparated"),PN=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"),wS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${Er(r)}|${B(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var TS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),rn=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),si=o(e=>rn(e).split("/").at(-1),"getSchemaNameByRef");function Of(e){let t=EN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return le(t)}o(Of,"normalizeString");function RS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(RS,"wrapWithQuotesIfNeeded");function CS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(CS,"unwrapQuotesIfNeeded");function EN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(EN,"prefixStringStartingWithNumberIfNeeded");function $f(e){let t=e.replaceAll("_","#");return le(t.replaceAll("-","_")).replaceAll("#","_")}o($f,"pathParamToVariableName");var Je=o(e=>PS.includes(e),"isPrimitiveType");function NS(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(NS,"escapeControlCharacters");function Xe(e){return e.includes("application/")&&e.includes("json")||bS.includes(e)||e.includes("text/")}o(Xe,"isParamMediaTypeAllowed");function $o(e){return e>=200&&e<300}o($o,"isMainResponseStatus");function ya(e){return!(e>=200&&e<300)}o(ya,"isErrorStatus");function ai(e){return e.startsWith("application/")}o(ai,"isMediaTypeAllowed");var IS=/({\w+})/g,ON=/[^\w\-]+/g;function kS(e){e=B(ES(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(IS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(IS,"")}By${B(r.slice(1,-1))}`}return e.replace(ON,"_")}o(kS,"pathToVariableName");var Ef=/{(\b\w+(?:-\w+)*\b)}/g;function jS(e){let t=e.match(Ef);return t===null?e.replaceAll(Ef,":$1"):(t.forEach(r=>{let n=$f(r.replaceAll(Ef,":$1"));e=e.replaceAll(r,n)}),e)}o(jS,"replaceHyphenatedPath");var qS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&re(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),nn=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Ct(e){return OS(e)}o(Ct,"formatTag");function Or(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Ct(r??t.defaultTag)}o(Or,"getOperationTag");function MS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(MS,"isTagExcluded");var va={fileName:"acl/app.ability",extension:"ts"},xo="AllAbilities",Ao="AppAbilities",Sa={fileName:"acl/useAclCheck",extension:"ts"},$r="useAclCheck",Oe={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},xf={bindings:[Oe.abilityTuple,Oe.pureAbility,Oe.forcedSubject,Oe.subjectType,Oe.subject],from:"@casl/ability"};var He=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var DS=o(e=>`Use${B(le(e.operationName))}Ability`,"getAbilityTypeName"),wo=o(e=>`canUse${B(le(e.operationName))}`,"getAbilityFunctionName"),LS=o((e,t)=>`${t.tsNamespaces?`${U({type:"acl",tag:xr(e,t),options:t})}.`:""}${wo(e)}`,"getImportedAbilityFunctionName"),FS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),HS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),ba=o(e=>{var t;return!!((t=Io(e))!=null&&t.length)},"hasAbilityConditions"),Io=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),VS=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),_a=o(e=>`${B(e)}${xo}`,"getTagAllAbilitiesName");function me(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(L(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(oi.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&&me(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&&me(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;me(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;me(s,t)}}o(me,"iterateSchema");var Nt=o((e,t)=>_f(B(Of(e)),t),"getZodSchemaName"),To=o((e,t,r)=>_f(B(Of(e)),`${t}${r}`),"getEnumZodSchemaName"),he=o(e=>["z.",`${ue.namespace}.`].every(t=>!e.startsWith(t)),"isNamedZodSchema"),BS=o(e=>e.startsWith(bo),"isEnumZodSchema"),on=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Pa=o(e=>le(`${e}_${pS}`),"getBodyZodSchemaName"),US=o((e,t)=>le(`${e}_${t}${fS}`),"getParamZodSchemaName"),$N=o(e=>le(`${e}${dS}`),"getMainResponseZodSchemaName"),xN=o((e,t)=>le(`${e}_${t}_${mS}`),"getErrorResponseZodSchemaName");function Ea({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=on(t,r,n);return!$o(i)&&e!=="default"&&ya(i)?xN(s,e):$N(s)}o(Ea,"getResponseZodSchemaName");function Ro(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${B(AS(i))}: \`${e[i]}\``],[])}o(Ro,"getSchemaDescriptions");var Co=o((e,t)=>$S(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),GS=o((e,t)=>he(t)?`${e.options.tsNamespaces?`${U({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Ar=o((e,t,r)=>{if(!he(t))return t===So?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${U({type:"models",tag:n,options:e.options})}.`:""}${Co(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function ZS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(ZS,"getZodSchemaType");function zS(e){if(e.schemaObj)return[e.schemaObj.description,...Ro(e.schemaObj)].filter(Boolean).join(". ")}o(zS,"getZodSchemaDescription");function KS(e,t,r){var n;if(L(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Ar(e,i,r):void 0}if(ma(t)){if(!L(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Ar(e,i,r)}[]`:void 0}if(oi.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return KS(e,i[0],r)}return t.type}o(KS,"getType");function QS(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,...Ro(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:KS(e,c.schema,r)??"unknown",description:p.join(". ")})}return me(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(L(c)){let u=e.resolveObject(c);me(u,{data:{pathSegments:[]},onSchema:a})}}),me(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(QS,"getZodSchemaPropertyDescriptions");function wr({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Oa({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Oa({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Co(u,e.options),"getEntityName"),options:e.options});return AN(e.options,a,c)}o(wr,"getModelsImports");function WS({tag:e,endpoints:t,options:r}){return Oa({type:"endpoints",tag:e,entities:t,getTag:o(n=>xr(n,r),"getTag"),getEntityName:No,options:r})}o(WS,"getEndpointsImports");function YS({tag:e,endpoints:t,options:r}){return Oa({type:"acl",tag:e,entities:t,getTag:o(n=>xr(n,r),"getTag"),getEntityName:wo,options:r})}o(YS,"getAclImports");function JS({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?U({type:n,tag:a,options:i}):c],from:`${kt(i)}${sn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(JS,"getEntityImports");function kt(e){let t=uf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${cf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${cf}`,"g"),uf)),`${t}/`.replace(/\/\//g,"/")}o(kt,"getImportPath");function Oa({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?U({type:e,tag:u,options:s}):i(c)],from:`${l?"./":kt(s)}${sn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Oa,"getImports");function AN(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:He(n.bindings)}))}o(AN,"mergeImports");function an({fileName:e,extension:t}){return`${e}.${t}`}o(an,"getFileNameWithExtension");function XS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${Er(t)}/`:""}${Er(t)}.${i}`:i}o(XS,"getTagFileNameWithoutExtension");function sn(...e){return XS(...e)}o(sn,"getTagImportPath");function eb(...e){return`${XS(...e)}.ts`}o(eb,"getTagFileName");var U=o(({type:e,tag:t,options:r})=>`${B(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function tb(e){return e.standalone?`${kt(e)}${oa.fileName}`:e.restClientImportPath}o(tb,"getAppRestClientImportPath");function rb(e){return e.standalone?`${kt(e)}${ia.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(rb,"getQueryTypesImportPath");function nb(e){return`${kt(e)}${sa.fileName}`}o(nb,"getQueryModulesImportPath");function ib(e){return`${kt(e)}${aa.fileName}`}o(ib,"getMutationEffectsImportPath");function ob(e){return`${kt(e)}${Sa.fileName}`}o(ob,"getAclCheckImportPath");function $a(e){return`${kt(e)}${ca.fileName}`}o($a,"getZodUtilsImportPath");function sb(e){return`${kt(e)}${va.fileName}`}o(sb,"getAppAbilitiesImportPath");function xa(e){return Ee(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(xa,"primitiveTypeToTsType");function ci({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&he(e)?(n=Ar(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Je(t==null?void 0:t.type)&&(n=xa(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:sn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(ci,"getTsTypeBase");function cn({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of oi){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return cn({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:ab({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:wN({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(cn,"getSchemaTsMetaType");function ab({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(L(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=ci({zodSchemaName:n,schema:i,resolver:r}),a=cb(s,t),c=cn({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(ab,"getArraySchemaTsType");function wN({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(L(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=ci({zodSchemaName:c,schema:u,resolver:r}),f=cb(l,t),p=cn({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=ab({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Je(i.type))return{name:n,isRequired:s,type:xa(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(wN,"getSchemaTsProperties");function cb(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(cb,"getIsCircular");var No=o(e=>Er(le(e.operationName)),"getEndpointName");function lb(e,t){return`${t.tsNamespaces?`${U({type:"endpoints",tag:xr(e,t),options:t})}.`:""}${No(e)}`}o(lb,"getImportedEndpointName");var pb=o(e=>e.method!==ub.OpenAPIV3.HttpMethods.GET,"requiresBody"),Aa=o(e=>e.parameters.find(t=>t.type==="Body"),"getEndpointBody"),fb=o((e,t)=>{let r=Af(e),n=t.options.axiosRequestConfig;return Object.keys(r).length>0||n},"hasEndpointConfig"),db=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function xr(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Ct(r??t.defaultTag)}o(xr,"getEndpointTag");function Ir(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(he(i.zodSchema))s=Ar(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&re(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Je(f)&&(s=xa(f))}return{name:wt(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!==fa)&&(!(r!=null&&r.excludePageParam)||i.name!==_o.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===_o.pageParamName?"pageParam":i.name,required:i.required&&(i.paramType==="Path"||!(r!=null&&r.pathParamsRequiredOnly))}))}o(Ir,"mapEndpointParamsToFunctionParams");function Af(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=yS(i.name)?i.name:`"${i.name}"`,a=wt(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==df["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==df.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=wt(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(Af,"getEndpointConfig");function mb(e,t){return t.filter(r=>Te(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(mb,"getUpdateQueryEndpoints");var Te=o(e=>e.method==="get","isQuery"),jt=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ui=o((e,t)=>Te(e)&&(t??Object.values(_o)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),hb=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...Ir(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return Ir(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var wa=o((e,t)=>{let r=Te(e)&&jt(e)&&t;return`use${B(le(e.operationName))}${r?"Mutation":""}`},"getQueryName"),gb=o(e=>`use${B(le(e.operationName))}Infinite`,"getInfiniteQueryName");var wf=["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 un(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(un,"pick");function li(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Or(e,t),i=MS(n,t);return r||i}o(li,"isOperationExcluded");function If({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${kS(e)}`,u=r.operationId?wt(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:B(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=wS(u,i);l===""?u=t.toLowerCase():wf.includes(l)||(u=l)}return wf.includes(u)?c:u}o(If,"getOperationName");function ko({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Or(r,n):n.defaultTag,s=o(a=>{let c=If({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>If({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??If({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(ko,"getUniqueOperationName");function yb(e,t,r){let n=[];for(let i in e.paths){if(nn(i,r))continue;let s=e.paths[i],a=un(s,tn);for(let c in a){let u=a[c];if(!u||li(u,r))continue;let l=ko({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(yb,"getUniqueOperationNamesWithoutSplitByTags");function vb(e,t){let r={};for(let n in e.paths){if(nn(n,t))continue;let i=e.paths[n],s=un(i,tn);for(let a in s){let c=s[a];if(!c||li(c,t))continue;let u=t.splitByTags?Or(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(vb,"getOperationsByTag");var Sb={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 jo(e){return{type:"invalid-schema",message:e}}o(jo,"getInvalidSchemaError");function bb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(bb,"getInvalidOperationIdError");function _b(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(_b,"getMissingPathParameterError");function Pb(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(Pb,"getNotAllowedInlineEnumError");function Eb(e){return{type:"not-allowed-circular-schema",message:e}}o(Eb,"getNotAllowedCircularSchemaError");function Ob(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Ta(t,r)}`}}o(Ob,"getMissingAclConditionPropertyError");function Tf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${Ia(e)} in operation ${Ta(t,r)}`}}o(Tf,"getMissingStatusCodeError");function $b(e,t,r){return{type:"invalid-status-code",message:`Operation ${Ta(t,r)} expected HTTP status code ${Ia(e.expected)} but received ${Ia(e.received)}`}}o($b,"getInvalidStatusCodeError");function xb(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Ta(t,r)} has multiple success HTTP status codes: ${e.map(Ia).join(", ")}`}}o(xb,"getMultipleSuccessStatusCodesError");function Ta(e,t){return e.operationId??`${t.method} ${t.path}`}o(Ta,"getOperationDescriptor");function Ia(e){return`${e} (${Sb[e]})`}o(Ia,"getStatusCodeDescription");function qt({schema:e,meta:t,options:r}){let n=[];Ee(e.type).with("string",()=>n.push(RN(e))).with("number","integer",()=>n.push(NN(e))).with("array",()=>n.push(kN(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
73
73
  `,"\r",`\r
74
74
  `].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(IN({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?TN(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(qt,"getZodChain");function IN({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(IN,"getZodChainablePresence");function TN(e){return e.default!==void 0?`default(${Ee(e.type).with("number","integer",()=>CS(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(TN,"getZodChainableDefault");function RN(e){let t=[];if(e.enum||(e.minLength!==void 0&&t.push(`min(${e.minLength})`),e.maxLength!==void 0&&t.push(`max(${e.maxLength})`)),e.pattern&&t.push(`regex(${CN(e.pattern)})`),e.format){let r=Ee(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(RN,"getZodChainableStringValidations");function CN(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=NS(e),`/${e}/`}o(CN,"formatPatternIfNeeded");function NN(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(NN,"getZodChainableNumberValidations");function kN(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(kN,"getZodChainableArrayValidations");var jN={type:"string",format:"date-time"},qN={type:"string",format:"email"},MN={type:"object",properties:{start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"}}},DN={type:"object",properties:{html:{type:"string"},json:{type:"object"}}},pi=(i=>(i.datetime="datetime",i.email="email",i.dateRange="dateRange",i.textEditor="textEditor",i))(pi||{}),Ra={datetime:jN,email:qN,dateRange:MN,textEditor:DN};function Ab(){return Object.values(pi).filter(e=>Je(Ra[e].type))}o(Ab,"getPrimitiveBrands");function wb(){return Object.values(pi).filter(e=>!Je(Ra[e].type))}o(wb,"getOtherBrands");function fi(e,t){let r=Ra[t];return!(e.type!==r.type||r.format&&e.format!==r.format||!Object.entries(r.properties??{}).every(([i,s])=>{var c;let a=(c=e.properties)==null?void 0:c[i];return a&&a.type===s.type&&a.format===s.format}))}o(fi,"matchesBrand");function Rf(e,t,r){return r.branded?`${ue.namespace}.${ue.exports.brand}(${e}, "${t}")`:e}o(Rf,"wrapWithBrand");var ln=o(e=>e.reduce((t,r)=>t+r,0),"sum");function pe(e,t){if(!t)return e;if(L(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Ve("oneOf")+pe(e,{...t,type:t.type[0]}):e+Ve("oneOf")+ln(t.type.map(r=>pe(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Ve("oneOf")+pe(e,t.oneOf[0]):e+Ve("oneOf")+ln(t.oneOf.map(r=>pe(0,r)));if(t.anyOf)return t.anyOf.length===1?Ve("anyOf")+pe(e,t.anyOf[0]):e+Ve("anyOf")+ln(t.anyOf.map(r=>pe(0,r)));if(t.allOf)return t.allOf.length===1?Ve("allOf")+pe(e,t.allOf[0]):e+Ve("allOf")+ln(t.allOf.map(r=>pe(0,r)));if(!t.type)return e;if(Je(t.type))return t.enum?e+Ib(t)+Ve("enum")+ln(t.enum.map(r=>pe(0,r))):e+Ib(t);if(t.type==="array")return t.items?Ve("array")+pe(e,t.items):Ve("array")+pe(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Ve("object")+ln(r.map(n=>pe(0,n)))}else e+=Ve("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=pe(0,t.additionalProperties):e+=pe(1))}return e}o(pe,"getOpenAPISchemaComplexity");function Ib(e){return Ee(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(Ib,"complexityByType");function Ve(e){return Ee(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Ve,"complexityByComposite");var Cf=class Cf{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;L(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?`${U({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return pe(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Cf,"ZodSchema");var qo=Cf;function Y({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new qo(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(L(e))return LN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=HN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=FN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=VN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=BN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=UN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(ma(e))return e.items?i.assign(`z.array(${Y({...a,schema:e.items}).getCodeString(n,t.options)}${qt({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(([k,X])=>{var ae;let se={...s,isRequired:v?!0:y?(ae=e.required)==null?void 0:ae.includes(k):t.options.withImplicitRequiredProps,name:k,isParentPartial:v},D=X;if(L(X)&&t&&(D=t.getSchemaByRef(X.$ref),!D))throw new Error(`Schema ${X.$ref} not found`);let Q=Y({...a,schema:X,meta:se}).getCodeString(n,t.options)+qt({schema:D,meta:se,options:t.options});return re(X)&&Ab().forEach(Ft=>{fi(X,Ft)&&(Q=Rf(Q,Ft,t.options))}),[k,Q]}).map(([k,X])=>`${RS(k)}: ${X}`).join(", ")+" }");let b="";e.additionalProperties&&(b=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Y({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+qt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let P=v?".partial()":"",E=t.options.strictObjects?".strict()":"",_=`z.object(${S})${P}${E}${b}${d}`;return wb().forEach(T=>{fi(e,T)&&(_=Rf(_,T,t.options))}),i.assign(_)}if(m==="any")return i.assign("z.any()");if(!m)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${m}`)}o(Y,"getZodSchema");function LN({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!L(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=Y({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(LN,"getReferenceZodSchema");function FN({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!re(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Y({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=>re(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=>Y({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
package/dist/sh.js CHANGED
@@ -522,7 +522,7 @@ ${cr.join(`
522
522
  `:`
523
523
  `)+m,k=b+1,b=l.indexOf(`
524
524
  `,k)}while(b!==-1);return I+=l.slice(k),I}t(oZe,"stringEncaseCRLFWithFirstIndex");var{stdout:cZe,stderr:lZe}=sZe,vEe=Symbol("GENERATOR"),fM=Symbol("STYLER"),CU=Symbol("IS_EMPTY"),uZe=["ansi","ansi","ansi256","ansi16m"],_M=Object.create(null),m5t=t((l,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let m=cZe?cZe.level:0;l.level=u.level===void 0?m:u.level},"applyOptions"),xEe=class xEe{constructor(u){return fZe(u)}};t(xEe,"Chalk");var Voe=xEe,fZe=t(l=>{let u=t((...m)=>m.join(" "),"chalk");return m5t(u,l),Object.setPrototypeOf(u,EU.prototype),u},"chalkFactory");function EU(l){return fZe(l)}t(EU,"createChalk");Object.setPrototypeOf(EU.prototype,Function.prototype);for(let[l,u]of Object.entries(Xx))_M[l]={get(){let m=Uoe(this,SEe(u.open,u.close,this[fM]),this[CU]);return Object.defineProperty(this,l,{value:m}),m}};_M.visible={get(){let l=Uoe(this,this[fM],!0);return Object.defineProperty(this,"visible",{value:l}),l}};var bEe=t((l,u,m,...b)=>l==="rgb"?u==="ansi16m"?Xx[m].ansi16m(...b):u==="ansi256"?Xx[m].ansi256(Xx.rgbToAnsi256(...b)):Xx[m].ansi(Xx.rgbToAnsi(...b)):l==="hex"?bEe("rgb",u,m,...Xx.hexToRgb(...b)):Xx[m][l](...b),"getModelAnsi"),h5t=["rgb","hex","ansi256"];for(let l of h5t){_M[l]={get(){let{level:m}=this;return function(...b){let k=SEe(bEe(l,uZe[m],"color",...b),Xx.color.close,this[fM]);return Uoe(this,k,this[CU])}}};let u="bg"+l[0].toUpperCase()+l.slice(1);_M[u]={get(){let{level:m}=this;return function(...b){let k=SEe(bEe(l,uZe[m],"bgColor",...b),Xx.bgColor.close,this[fM]);return Uoe(this,k,this[CU])}}}}var g5t=Object.defineProperties(()=>{},{..._M,level:{enumerable:!0,get(){return this[vEe].level},set(l){this[vEe].level=l}}}),SEe=t((l,u,m)=>{let b,k;return m===void 0?(b=l,k=u):(b=m.openAll+l,k=u+m.closeAll),{open:l,close:u,openAll:b,closeAll:k,parent:m}},"createStyler"),Uoe=t((l,u,m)=>{let b=t((...k)=>y5t(b,k.length===1?""+k[0]:k.join(" ")),"builder");return Object.setPrototypeOf(b,g5t),b[vEe]=l,b[fM]=u,b[CU]=m,b},"createBuilder"),y5t=t((l,u)=>{if(l.level<=0||!u)return l[CU]?"":u;let m=l[fM];if(m===void 0)return u;let{openAll:b,closeAll:k}=m;if(u.includes("\x1B"))for(;m!==void 0;)u=aZe(u,m.close,m.open),m=m.parent;let I=u.indexOf(`
525
- `);return I!==-1&&(u=oZe(u,k,b,I)),b+u+k},"applyStyle");Object.defineProperties(EU.prototype,_M);var TYt=EU(),kYt=EU({level:lZe?lZe.level:0});var CA=new Voe;function TEe(l){console.log(l)}t(TEe,"log");function cS(l){console.log(`[INFO] ${l}`)}t(cS,"logInfo");function PU(l){console.log(CA.green(`[SUCCESS] ${l}`))}t(PU,"logSuccess");function HN(l,u){l instanceof Error?console.log(CA.red(`[ERROR] ${u||l.message}`)):console.log(CA.red(`[ERROR] ${l}`))}t(HN,"logError");function Woe(l){console.log(CA.bgYellow(`==== ${l} ====`))}t(Woe,"logBanner");var _Ze=Zm(require("fs"));function pM(){return"0.15.4"}t(pM,"getVersion");var RYt=Zm(dZe());var kEe=Symbol("options_key");function Au(l){return(u,m)=>{var b,k;if(l!=null){let I={...Reflect.getMetadata(kEe,u)||{},[m]:{...l,describe:l.envAlias?`${l.describe||""} [${l.envAlias}]`:l.describe,type:l.type||((k=(b=Reflect.getMetadata("design:type",u,m))==null?void 0:b.name)==null?void 0:k.toLowerCase())}};Reflect.defineMetadata(kEe,I,u)}}}t(Au,"YargOption");function mZe(l){let u=Reflect.getMetadata(kEe,l.prototype);if(!u)throw new Error(`Options for ${l.name} were not defined`);return u}t(mZe,"getYargsOption");function Hoe(l){return async u=>u.options(v5t(l)).middleware(async m=>await b5t(l,m),!0)}t(Hoe,"getBuilder");function v5t(l){return Object.entries(mZe(l)).reduce((u,[m,b])=>(u[m]=Object.fromEntries(Object.entries(b).filter(([k])=>!["envAlias","default"].includes(k))),u),{})}t(v5t,"getYargsOptions");async function b5t(l,u){let m=new l;for(let[b,k]of Object.entries(mZe(l)))m[b]=u[b]??k.default;return m}t(b5t,"loadYargsConfig");var $nt=Zm(dwe());var Wtt={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"},Htt={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var Zrt=Zm(Gtt());var uT={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},Ztt={bindings:[uT.query,uT.infiniteQuery,uT.mutation],from:"@tanstack/react-query"},yW={pageParamName:"page"},Kce={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vW="moduleName";var mwe={"Content-Type":"application/json",Accept:"application/json"},ele="data",hwe="axios",zA="config",DC="AxiosRequestConfig",tle={defaultImport:hwe,bindings:[DC],from:"axios"};var Qtt=t(l=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(l),"isValidPropertyName"),VA=t(l=>l.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function l_(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(l_,"isReferenceObject");function Ym(l){return!l_(l)}t(Ym,"isSchemaObject");function rle(l){return l.type==="array"}t(rle,"isArraySchemaObject");function Ytt(l){if(!l.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[u,m]=l.allOf.reduce((k,I)=>{if(gVt(I)){let R=I.required;k[0].push(...R??[])}else k[1].push(I);return k},[[],[]]),b={properties:u.reduce((k,I)=>(k[I]={},k),{}),type:"object",required:u};return{noRequiredOnlyAllof:m,composedRequiredSchema:b,patchRequiredSchemaInLoop:t((k,I)=>{if(l_(k)){let R=I(k.$ref);R&&b.required.forEach(Z=>{var ce;b.properties[Z]=((ce=R==null?void 0:R.properties)==null?void 0:ce[Z])??{}})}else{let R=k.properties??{};b.required.forEach(Z=>{R[Z]&&(b.properties[Z]=R[Z]??{})})}},"patchRequiredSchemaInLoop")}}t(Ytt,"inferRequiredSchema");var gVt=t(l=>!l_(l)&&!!l.required&&!l.type&&!l.properties&&!(l!=null&&l.allOf)&&!(l!=null&&l.anyOf)&&!l.oneOf,"isBrokenAllOfItem");var s6=Symbol.for("@ts-pattern/matcher"),yVt=Symbol.for("@ts-pattern/isVariadic"),ile="@ts-pattern/anonymous-select-key",gwe=t(l=>!!(l&&typeof l=="object"),"r"),nle=t(l=>l&&!!l[s6],"i"),OC=t((l,u,m)=>{if(nle(l)){let b=l[s6](),{matched:k,selections:I}=b.match(u);return k&&I&&Object.keys(I).forEach(R=>m(R,I[R])),k}if(gwe(l)){if(!gwe(u))return!1;if(Array.isArray(l)){if(!Array.isArray(u))return!1;let b=[],k=[],I=[];for(let R of l.keys()){let Z=l[R];nle(Z)&&Z[yVt]?I.push(Z):I.length?k.push(Z):b.push(Z)}if(I.length){if(I.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(u.length<b.length+k.length)return!1;let R=u.slice(0,b.length),Z=k.length===0?[]:u.slice(-k.length),ce=u.slice(b.length,k.length===0?1/0:-k.length);return b.every((re,pe)=>OC(re,R[pe],m))&&k.every((re,pe)=>OC(re,Z[pe],m))&&(I.length===0||OC(I[0],ce,m))}return l.length===u.length&&l.every((R,Z)=>OC(R,u[Z],m))}return Reflect.ownKeys(l).every(b=>{let k=l[b];return(b in u||nle(I=k)&&I[s6]().matcherType==="optional")&&OC(k,u[b],m);var I})}return Object.is(u,l)},"s"),ZA=t(l=>{var u,m,b;return gwe(l)?nle(l)?(u=(m=(b=l[s6]()).getSelectionKeys)==null?void 0:m.call(b))!=null?u:[]:Array.isArray(l)?SW(l,ZA):SW(Object.values(l),ZA):[]},"o"),SW=t((l,u)=>l.reduce((m,b)=>m.concat(u(b)),[]),"c");function dS(l){return Object.assign(l,{optional:t(()=>vVt(l),"optional"),and:t(u=>Qp(l,u),"and"),or:t(u=>bVt(l,u),"or"),select:t(u=>u===void 0?Xtt(l):Xtt(u,l),"select")})}t(dS,"u");function vVt(l){return dS({[s6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return u===void 0?(ZA(l).forEach(k=>b(k,void 0)),{matched:!0,selections:m}):{matched:OC(l,u,b),selections:m}},"match"),getSelectionKeys:t(()=>ZA(l),"getSelectionKeys"),matcherType:"optional"})})}t(vVt,"h");function Qp(...l){return dS({[s6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return{matched:l.every(k=>OC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,ZA),"getSelectionKeys"),matcherType:"and"})})}t(Qp,"m");function bVt(...l){return dS({[s6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return SW(l,ZA).forEach(k=>b(k,void 0)),{matched:l.some(k=>OC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,ZA),"getSelectionKeys"),matcherType:"or"})})}t(bVt,"d");function Af(l){return{[s6]:()=>({match:t(u=>({matched:!!l(u)}),"match")})}}t(Af,"p");function Xtt(...l){let u=typeof l[0]=="string"?l[0]:void 0,m=l.length===2?l[1]:typeof l[0]=="string"?void 0:l[0];return dS({[s6]:()=>({match:t(b=>{let k={[u??ile]:b};return{matched:m===void 0||OC(m,b,(I,R)=>{k[I]=R}),selections:k}},"match"),getSelectionKeys:t(()=>[u??ile].concat(m===void 0?[]:ZA(m)),"getSelectionKeys")})})}t(Xtt,"y");function IC(l){return typeof l=="number"}t(IC,"v");function UA(l){return typeof l=="string"}t(UA,"b");function WA(l){return typeof l=="bigint"}t(WA,"w");var nnr=dS(Af(function(l){return!0}));var HA=t(l=>Object.assign(dS(l),{startsWith:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&b.startsWith(m)))));var m},"startsWith"),endsWith:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&b.endsWith(m)))));var m},"endsWith"),minLength:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b.length>=m))(u))),"minLength"),length:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b.length===m))(u))),"length"),maxLength:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b.length<=m))(u))),"maxLength"),includes:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&b.includes(m)))));var m},"includes"),regex:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&!!b.match(m)))));var m},"regex")}),"j"),inr=HA(Af(UA)),NC=t(l=>Object.assign(dS(l),{between:t((u,m)=>NC(Qp(l,((b,k)=>Af(I=>IC(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b<m))(u))),"lt"),gt:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b>m))(u))),"gt"),lte:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b<=m))(u))),"lte"),gte:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b>=m))(u))),"gte"),int:t(()=>NC(Qp(l,Af(u=>IC(u)&&Number.isInteger(u)))),"int"),finite:t(()=>NC(Qp(l,Af(u=>IC(u)&&Number.isFinite(u)))),"finite"),positive:t(()=>NC(Qp(l,Af(u=>IC(u)&&u>0))),"positive"),negative:t(()=>NC(Qp(l,Af(u=>IC(u)&&u<0))),"negative")}),"x"),snr=NC(Af(IC)),GA=t(l=>Object.assign(dS(l),{between:t((u,m)=>GA(Qp(l,((b,k)=>Af(I=>WA(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b<m))(u))),"lt"),gt:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b>m))(u))),"gt"),lte:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b<=m))(u))),"lte"),gte:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b>=m))(u))),"gte"),positive:t(()=>GA(Qp(l,Af(u=>WA(u)&&u>0))),"positive"),negative:t(()=>GA(Qp(l,Af(u=>WA(u)&&u<0))),"negative")}),"A"),anr=GA(Af(WA)),onr=dS(Af(function(l){return typeof l=="boolean"})),cnr=dS(Af(function(l){return typeof l=="symbol"})),lnr=dS(Af(function(l){return l==null})),unr=dS(Af(function(l){return l!=null}));var Swe=class Swe extends Error{constructor(u){let m;try{m=JSON.stringify(u)}catch{m=u}super(`Pattern matching error: no pattern matches value ${m}`),this.input=void 0,this.input=u}};t(Swe,"W");var ywe=Swe,vwe={matched:!1,value:void 0};function Zy(l){return new bwe(l,vwe)}t(Zy,"z");var bW=class bW{constructor(u,m){this.input=void 0,this.state=void 0,this.input=u,this.state=m}with(...u){if(this.state.matched)return this;let m=u[u.length-1],b=[u[0]],k;u.length===3&&typeof u[1]=="function"?k=u[1]:u.length>2&&b.push(...u.slice(1,u.length-1));let I=!1,R={},Z=t((re,pe)=>{I=!0,R[re]=pe},"a"),ce=!b.some(re=>OC(re,this.input,Z))||k&&!k(this.input)?vwe:{matched:!0,value:m(I?ile in R?R[ile]:R:this.input,this.input)};return new bW(this.input,ce)}when(u,m){if(this.state.matched)return this;let b=!!u(this.input);return new bW(this.input,b?{matched:!0,value:m(this.input,this.input)}:vwe)}otherwise(u){return this.state.matched?this.state.value:u(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ywe(this.input)}run(){return this.exhaustive()}returnType(){return this}};t(bW,"I");var bwe=bW;var xwe=2,Ktt=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],ert=["query","header","path"],m8=["get","put","post","delete","options","head","patch","trace"],trt=["string","number","integer","boolean"],xW=["allOf","anyOf","oneOf"];var J_=t(l=>l.charAt(0).toUpperCase()+l.slice(1),"capitalize"),QA=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),rrt=t(l=>l.replace(/(-\w)/g,u=>u[1].toUpperCase()),"kebabToCamel"),mg=t(l=>l.replace(/(_\w)/g,u=>u[1].toUpperCase()),"snakeToCamel"),nrt=t(l=>l.replace(/[\W_]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"nonWordCharactersToCamel"),Twe=t((l,u="")=>l.endsWith(u)?l:`${l}${u}`,"suffixIfNeeded"),irt=t((l,u)=>l.replace(new RegExp(`${u}$`),""),"removeSuffix"),SVt=t(l=>{var b;let u=l.reduce((k,I)=>({...k,[I]:(k[I]??0)+1}),{});return(b=Object.entries(u).sort((k,I)=>k[1]===I[1]?I[0].length-k[0].length:I[1]-k[1])[0])==null?void 0:b[0]},"getLongestMostCommon"),kwe=t(l=>{let u=l.map(J_).map(srt).map(m=>xVt(m)).flat();return SVt(u)},"getMostCommonAdjacentCombinationSplit"),srt=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),art=t(l=>srt(l).join(" "),"camelToSpaceSeparated"),xVt=t((l,u=["dto","by","for","of","in","to","and","with"])=>{var b;let m=[];for(let k=0;k<l.length;k++)if(!u.includes(l[k].toLowerCase()))for(let I=k+1;I<=l.length;I++)u.includes((b=l[I-1])==null?void 0:b.toLowerCase())||m.push(l.slice(k,I).join(""));return m},"getAdjacentStringCombinations"),ort=t((l,u)=>{let m=u.replace(/es$|s$/g,""),b=new RegExp(`(${QA(m)}|${J_(m)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(b,"")},"removeWord");var lrt=t(l=>`#/components/schemas/${l}`,"getSchemaRef"),h8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),XM=t(l=>h8(l).split("/").at(-1),"getSchemaNameByRef");function Ewe(l){let u=TVt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return mg(u)}t(Ewe,"normalizeString");function urt(l){return/^[a-zA-Z]\w*$/.test(l)?l:`"${l}"`}t(urt,"wrapWithQuotesIfNeeded");function frt(l){return typeof l=="string"&&l.startsWith('"')&&l.endsWith('"')?l.slice(1,-1):l}t(frt,"unwrapQuotesIfNeeded");function TVt(l){let u=Number(l[0]);return typeof u=="number"&&!Number.isNaN(u)?"_"+l:l}t(TVt,"prefixStringStartingWithNumberIfNeeded");function Pwe(l){let u=l.replaceAll("_","#");return mg(u.replaceAll("-","_")).replaceAll("#","_")}t(Pwe,"pathParamToVariableName");var FC=t(l=>trt.includes(l),"isPrimitiveType");function _rt(l){return l.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(u,m)=>{let b=m.codePointAt(),k=b.toString(16);return b<=255?`\\x${`00${k}`.slice(-2)}`:`\\u${`0000${k}`.slice(-4)}`}).replace(/\//g,"\\/")}t(_rt,"escapeControlCharacters");function MC(l){return l.includes("application/")&&l.includes("json")||Ktt.includes(l)||l.includes("text/")}t(MC,"isParamMediaTypeAllowed");function TW(l){return l>=200&&l<300}t(TW,"isMainResponseStatus");function sle(l){return!(l>=200&&l<300)}t(sle,"isErrorStatus");function ale(l){return l.startsWith("application/")}t(ale,"isMediaTypeAllowed");var crt=/({\w+})/g,kVt=/[^\w\-]+/g;function prt(l){l=J_(rrt(l.replaceAll("/","-")).replaceAll("-",""));let u=[...l.matchAll(crt)];if(u.length>0){let m=u.sort((b,k)=>b.index-k.index)[u.length-1][0];l=`${l.replace(crt,"")}By${J_(m.slice(1,-1))}`}return l.replace(kVt,"_")}t(prt,"pathToVariableName");var Cwe=/{(\b\w+(?:-\w+)*\b)}/g;function drt(l){let u=l.match(Cwe);return u===null?l.replaceAll(Cwe,":$1"):(u.forEach(m=>{let b=Pwe(m.replaceAll(Cwe,":$1"));l=l.replaceAll(m,b)}),l)}t(drt,"replaceHyphenatedPath");var mrt=t(l=>{let u=l["x-enumNames"],m=Array.isArray(u)&&u.length>0,b=!!l.schema&&Ym(l.schema)&&l.schema.type==="string";return m&&b},"isSortingParameterObject"),g8=t((l,u)=>u.excludePathRegex?new RegExp(u.excludePathRegex).test(l):!1,"isPathExcluded");var Db=t(l=>l.method==="get","isQuery"),XA=t(l=>l.method!=="get"||!!l.mediaDownload,"isMutation"),KM=t((l,u)=>Db(l)&&(u??Object.values(yW)).every(m=>l.parameters.some(b=>b.name===m&&b.type==="Query")),"isInfiniteQuery"),hrt=t((l,u,m)=>{let b=m.reduce((k,I)=>[...k,...YA(l,I,{includeOnlyRequiredParams:!0}).map(R=>R.name)],[]);return YA(l,u,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(k=>b.includes(k.name)).map(k=>k.name)},"getDestructuredVariables");function KA(l){return nrt(l)}t(KA,"formatTag");function e3(l,u){var b;let m=(b=l.tags)==null?void 0:b[0];return KA(m??u.defaultTag)}t(e3,"getOperationTag");function grt(l,u){return u.excludeTags.some(m=>m.toLowerCase()===l.toLowerCase())}t(grt,"isTagExcluded");var ole={fileName:"acl/app.ability",extension:"ts"},kW="AllAbilities",CW="AppAbilities",cle={fileName:"acl/useAclCheck",extension:"ts"},t3="useAclCheck",Qy={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},wwe={bindings:[Qy.abilityTuple,Qy.pureAbility,Qy.forcedSubject,Qy.subjectType,Qy.subject],from:"@casl/ability"};var EW="AppRestClient",lle={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Awe="src/data",Dwe="@/data",mS={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/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},r3={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ule={bindings:[r3.ErrorHandler,r3.SharedErrorHandler],from:mS.errorHandling.template},Iwe="AbilityContext",yrt={bindings:[Iwe],from:mS.abilityContext.template};var fle={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},_le={fileName:"app-rest-client",extension:"ts"},Nwe="QueryModule",ple={fileName:"queryModules",extension:"ts"},vrt={fileName:"queryConfig.context",extension:"tsx"},eL={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},dle={fileName:"useMutationEffects",extension:"ts"},hg={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},mle={fileName:"zod.utils",extension:"ts"};var Ib=t((...l)=>[...new Set(l.flat())],"getUniqueArray");var brt=t(l=>`Use${J_(mg(l.operationName))}Ability`,"getAbilityTypeName"),PW=t(l=>`canUse${J_(mg(l.operationName))}`,"getAbilityFunctionName"),Srt=t((l,u)=>`${u.tsNamespaces?`${Np({type:"acl",tag:n3(l,u),options:u})}.`:""}${PW(l)}`,"getImportedAbilityFunctionName"),xrt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].action},"getAbilityAction"),Trt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].subject},"getAbilitySubject"),hle=t(l=>{var u;return!!((u=wW(l))!=null&&u.length)},"hasAbilityConditions"),wW=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].conditionsTypes},"getAbilityConditionsTypes"),krt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].description},"getAbilityDescription"),gle=t(l=>`${J_(l)}${kW}`,"getTagAllAbilitiesName");var Crt="Schema",Ert="Enum",Prt="Body",wrt="Param",Art="Response",Drt="ErrorResponse",AW="z.void()",yle="z.instanceof(Blob)",DW="z.enum",vle="z.string()",tL={bindings:["z"],from:"zod"};function ny(l,u){if(!l)return;let{data:m,onSchema:b}=u;if(l_(l)&&b({type:"reference",schema:l,data:m})===!0)return;let k=l;if(xW.some(I=>I in k&&k[I])){let I=k.allOf??k.anyOf??k.oneOf??[];for(let R of I)(b==null?void 0:b({type:"composite",parentSchema:l,schema:R,data:m}))!==!0&&ny(R,{data:m,onSchema:b})}if(k.properties)for(let[I,R]of Object.entries(k.properties))b({type:"property",parentSchema:l,schema:R,data:m,propertyName:I})!==!0&&ny(R,u);if(k.additionalProperties&&typeof k.additionalProperties=="object"){if(b({type:"additionalProperties",parentSchema:l,schema:k.additionalProperties,data:m})===!0)return;ny(k.additionalProperties,u)}if(k.type==="array"){let I=l.items;if(b({type:"array",parentSchema:l,schema:I,data:m})===!0)return;ny(I,u)}}t(ny,"iterateSchema");var LC=t((l,u)=>Twe(J_(Ewe(l)),u),"getZodSchemaName"),IW=t((l,u,m)=>Twe(J_(Ewe(l)),`${u}${m}`),"getEnumZodSchemaName"),Yy=t(l=>["z.",`${hg.namespace}.`].every(u=>!l.startsWith(u)),"isNamedZodSchema"),Irt=t(l=>l.startsWith(DW),"isEnumZodSchema"),y8=t((l,u,m)=>u?l:`${m}_${l}`,"getZodSchemaOperationName"),ble=t(l=>mg(`${l}_${Prt}`),"getBodyZodSchemaName"),Nrt=t((l,u)=>mg(`${l}_${u}${wrt}`),"getParamZodSchemaName"),CVt=t(l=>mg(`${l}${Art}`),"getMainResponseZodSchemaName"),EVt=t((l,u)=>mg(`${l}_${u}_${Drt}`),"getErrorResponseZodSchemaName");function Sle({statusCode:l,operationName:u,isUniqueOperationName:m,tag:b}){let k=Number(l),I=y8(u,m,b);return!TW(k)&&l!=="default"&&sle(k)?EVt(I,l):CVt(I)}t(Sle,"getResponseZodSchemaName");function NW(l){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(b=>l[b]).reduce((b,k)=>[...b,`${J_(art(k))}: \`${l[k]}\``],[])}t(NW,"getSchemaDescriptions");var OW=t((l,u)=>irt(l,u.schemaSuffix),"getZodSchemaInferedTypeName"),Ort=t((l,u)=>Yy(u)?`${l.options.tsNamespaces?`${Np({type:"models",tag:l.getTagByZodSchemaName(u),options:l.options})}.`:""}${u}`:u,"getImportedZodSchemaName"),v8=t((l,u,m)=>{if(!Yy(u))return u===AW?"void":u;let b=l.getTagByZodSchemaName(u);return`${l.options.tsNamespaces&&b!==m?`${Np({type:"models",tag:b,options:l.options})}.`:""}${OW(u,l.options)}`},"getImportedZodSchemaInferedTypeName");function Frt(l){var u;return l.isEnum?"enum":((u=l.schemaObj)==null?void 0:u.type)??"object"}t(Frt,"getZodSchemaType");function Mrt(l){if(l.schemaObj)return[l.schemaObj.description,...NW(l.schemaObj)].filter(Boolean).join(". ")}t(Mrt,"getZodSchemaDescription");function Lrt(l,u,m){var b;if(l_(u)){let k=l.getZodSchemaNameByRef(u.$ref);return k?v8(l,k,m):void 0}if(rle(u)){if(!l_(u.items))return`${((b=u.items)==null?void 0:b.type)??"unknown"}[]`;let k=l.getZodSchemaNameByRef(u.items.$ref);return k?`${v8(l,k,m)}[]`:void 0}if(xW.some(k=>k in u&&u[k])){let k=u.allOf??u.anyOf??u.oneOf??[];if(k.length>0)return Lrt(l,k[0],m)}return u.type}t(Lrt,"getType");function Rrt(l,u,m){if(!u.schemaObj)return[];let b="[0]",k="[key]",I={},R=t(Z=>{var re;if(Z.type==="reference")return!0;if(Z.type==="composite")return;let ce=[...((re=Z.data)==null?void 0:re.pathSegments)??[]];if(Z.type==="array"?ce.push(b):Z.type==="property"?ce.push(Z.propertyName):Z.type==="additionalProperties"&&ce.push(k),Z.schema&&ce[ce.length-1]!==b){let pe=l.resolveObject(Z.schema),ke=[pe.description,...NW(pe)].filter(Boolean),et=ce.join(".");I[et]&&"type"in Z.schema&&Z.schema.type==="object"||(delete I[et],I[et]={type:Lrt(l,Z.schema,m)??"unknown",description:ke.join(". ")})}return ny(Z.schema,{data:{pathSegments:[...ce]},onSchema:R}),!0},"onSchema");return"allOf"in u.schemaObj&&u.schemaObj.allOf&&u.schemaObj.allOf.forEach(Z=>{if(l_(Z)){let ce=l.resolveObject(Z);ny(ce,{data:{pathSegments:[]},onSchema:R})}}),ny(u.schemaObj,{data:{pathSegments:[]},onSchema:R}),I}t(Rrt,"getZodSchemaPropertyDescriptions");function i3({resolver:l,tag:u,zodSchemas:m=[],zodSchemasAsTypes:b=[]}){let k="models",I=t(ce=>l.getTagByZodSchemaName(ce),"getTag"),R=xle({type:k,tag:u,entities:m,getTag:I,getEntityName:t(ce=>ce,"getEntityName"),options:l.options}),Z=xle({type:k,tag:u,entities:b,getTag:I,getEntityName:t(ce=>OW(ce,l.options),"getEntityName"),options:l.options});return PVt(l.options,R,Z)}t(i3,"getModelsImports");function jrt({tag:l,endpoints:u,options:m}){return xle({type:"endpoints",tag:l,entities:u,getTag:t(b=>n3(b,m),"getTag"),getEntityName:FW,options:m})}t(jrt,"getEndpointsImports");function Brt({tag:l,endpoints:u,options:m}){return xle({type:"acl",tag:l,entities:u,getTag:t(b=>n3(b,m),"getTag"),getEntityName:PW,options:m})}t(Brt,"getAclImports");function $rt({tags:l,entityName:u,getAliasEntityName:m,type:b,options:k}){let I=new Map;return l.forEach(R=>{let Z=`${u}${m?` as ${m(R)}`:""}`;I.has(R)?k.tsNamespaces||I.get(R).bindings.push(Z):I.set(R,{bindings:[k.tsNamespaces?Np({type:b,tag:R,options:k}):Z],from:`${RC(k)}${Tle({type:b,tag:R,includeTagDir:!0,options:k})}`})}),Array.from(I.values())}t($rt,"getEntityImports");function RC(l){let u=Dwe;return l.importPath==="relative"?u="../":l.importPath==="absolute"?u=l.output:new RegExp(`${Awe}`,"g").test(l.output)&&(u=l.output.replace(new RegExp(`.*${Awe}`,"g"),Dwe)),`${u}/`.replace(/\/\//g,"/")}t(RC,"getImportPath");function xle({type:l="models",tag:u,entities:m,getTag:b,getEntityName:k,options:I}){let R=new Map;return m.forEach(Z=>{let ce=b(Z);if(R.has(ce))I.tsNamespaces||R.get(ce).bindings.push(k(Z));else{let re=u===ce;R.set(ce,{bindings:[I.tsNamespaces?Np({type:l,tag:ce,options:I}):k(Z)],from:`${re?"./":RC(I)}${Tle({type:l,tag:ce,includeTagDir:!re,options:I})}`})}}),Array.from(R.values())}t(xle,"getImports");function PVt(l,...u){let m=new Map;return u.forEach(b=>{b.forEach(k=>{m.has(k.from)?l.tsNamespaces||m.get(k.from).bindings.push(...k.bindings):m.set(k.from,k)})}),Array.from(m.values()).map(b=>({...b,bindings:Ib(b.bindings)}))}t(PVt,"mergeImports");function b8({fileName:l,extension:u}){return`${l}.${u}`}t(b8,"getFileNameWithExtension");function Jrt({type:l,tag:u,options:m,includeTagDir:b=!0}){let k=m.configs[l].outputFileNameSuffix;return u?`${b?`${QA(u)}/`:""}${QA(u)}.${k}`:k}t(Jrt,"getTagFileNameWithoutExtension");function Tle(...l){return Jrt(...l)}t(Tle,"getTagImportPath");function kle(...l){return`${Jrt(...l)}.ts`}t(kle,"getTagFileName");var Np=t(({type:l,tag:u,options:m})=>`${J_(u)}${m.configs[l].namespaceSuffix}`,"getNamespaceName");function qrt(l){return l.standalone?`${RC(l)}${_le.fileName}`:l.restClientImportPath}t(qrt,"getAppRestClientImportPath");function zrt(l){return l.standalone?`${RC(l)}${fle.reactQueryTypes.fileName}`:l.queryTypesImportPath}t(zrt,"getQueryTypesImportPath");function Vrt(l){return`${RC(l)}${ple.fileName}`}t(Vrt,"getQueryModulesImportPath");function Urt(l){return`${RC(l)}${dle.fileName}`}t(Urt,"getMutationEffectsImportPath");function Wrt(l){return`${RC(l)}${cle.fileName}`}t(Wrt,"getAclCheckImportPath");function Cle(l){return`${RC(l)}${mle.fileName}`}t(Cle,"getZodUtilsImportPath");function Hrt(l){return`${RC(l)}${ole.fileName}`}t(Hrt,"getAppAbilitiesImportPath");function Grt(l){return Zy(l).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}t(Grt,"primitiveTypeToTsType");var FW=t(l=>QA(mg(l.operationName)),"getEndpointName");function Qrt(l,u){return`${u.tsNamespaces?`${Np({type:"endpoints",tag:n3(l,u),options:u})}.`:""}${FW(l)}`}t(Qrt,"getImportedEndpointName");var Yrt=t(l=>l.method!==Zrt.OpenAPIV3.HttpMethods.GET,"requiresBody"),Ele=t(l=>l.parameters.find(u=>u.type==="Body"),"getEndpointBody"),Xrt=t((l,u)=>{let m=Owe(l),b=u.options.axiosRequestConfig;return Object.keys(m).length>0||b},"hasEndpointConfig"),Krt=t(l=>l.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function n3(l,u){var b;let m=u.splitByTags?(b=l.tags)==null?void 0:b[0]:u.defaultTag;return KA(m??u.defaultTag)}t(n3,"getEndpointTag");function YA(l,u,m){let b=u.parameters.map(k=>{var R,Z,ce,re;let I="string";if(Yy(k.zodSchema))I=v8(l,k.zodSchema);else if((R=k.parameterObject)!=null&&R.schema&&Ym(k.parameterObject.schema)){let pe=(ce=(Z=k.parameterObject)==null?void 0:Z.schema)==null?void 0:ce.type;pe&&FC(pe)&&(I=Grt(pe))}return{name:VA(k.name),type:I,paramType:k.type,required:((re=k.parameterObject)==null?void 0:re.required)??!0,parameterObject:k.parameterObject,bodyObject:k.bodyObject}});return m!=null&&m.includeFileParam&&u.mediaUpload&&b.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),b.sort((k,I)=>{if(k.required===I.required){let R=["Path","Body","Query","Header"];return R.indexOf(k.paramType)-R.indexOf(I.paramType)}return k.required?-1:1}).filter(k=>(!(m!=null&&m.excludeBodyParam)||k.name!==ele)&&(!(m!=null&&m.excludePageParam)||k.name!==yW.pageParamName)&&(!(m!=null&&m.includeOnlyRequiredParams)||k.required)).map(k=>({...k,name:m!=null&&m.replacePageParam&&k.name===yW.pageParamName?"pageParam":k.name,required:k.required&&(k.paramType==="Path"||!(m!=null&&m.pathParamsRequiredOnly))}))}t(YA,"mapEndpointParamsToFunctionParams");function Owe(l){let u=l.parameters.filter(k=>k.type==="Query").map(k=>{let I=Qtt(k.name)?k.name:`"${k.name}"`,R=VA(k.name);return{...k,name:I,value:R}}),m={};return l.requestFormat!==mwe["Content-Type"]&&(m["Content-Type"]=`'${l.requestFormat}'`),l.responseFormat&&l.responseFormat!==mwe.Accept&&(m.Accept=`'${l.responseFormat}'`),l.parameters.filter(k=>k.type==="Header").forEach(k=>{m[k.name]=VA(k.name)}),{...u.length>0?{params:u}:{},...Object.keys(m).length?{headers:m}:{}}}t(Owe,"getEndpointConfig");function ent(l,u){return u.filter(m=>Db(m)&&m.parameters.filter(b=>{var k;return(k=b.parameterObject)==null?void 0:k.required}).every(b=>l.parameters.some(k=>k.name===b.name))&&m.response===l.response)}t(ent,"getUpdateQueryEndpoints");var Fwe=["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 S8(l,u){let m={};return Object.keys(l).forEach(b=>{u.includes(b)&&(m[b]=l[b])}),m}t(S8,"pick");function Ple(l,...u){if(u.length===0)return l;let m=l;for(let b of u)m=tnt(m,b);return m}t(Ple,"deepMerge");function tnt(l,u){if(u==null)return l;if(l==null)return rL(u);if(Array.isArray(l)&&Array.isArray(u))return[...l,...u];if(MW(l)&&MW(u)){let m={};for(let[b,k]of Object.entries(l))m[b]=rL(k);for(let[b,k]of Object.entries(u)){let I=m[b];k!==void 0&&(k===null?m[b]=k:MW(I)&&MW(k)?m[b]=tnt(I,k):Array.isArray(I)&&Array.isArray(k)?m[b]=[...I,...k]:m[b]=rL(k))}return m}return rL(u)}t(tnt,"mergeTwoValues");function rL(l){if(l==null||typeof l!="object")return l;if(Array.isArray(l))return l.map(u=>rL(u));if(MW(l)){let u={};for(let[m,b]of Object.entries(l))u[m]=rL(b);return u}return l}t(rL,"deepClone");function MW(l){return l!==null&&typeof l=="object"&&!Array.isArray(l)&&Object.prototype.toString.call(l)==="[object Object]"}t(MW,"isPlainObject");function nL(l,u){let m=l.deprecated&&!u.withDeprecatedEndpoints,b=e3(l,u),k=grt(b,u);return m||k}t(nL,"isOperationExcluded");function Mwe({path:l,method:u,operation:m,options:b,tag:k,keepOperationTag:I,keepOperationPrefix:R}){let Z=`${u}${prt(l)}`,ce=m.operationId?VA(m.operationId):Z;if(b.removeOperationPrefixEndingWith&&R)ce=ce.split(b.removeOperationPrefixEndingWith).map((pe,ke)=>ke===0?pe:J_(pe)).join("");else if(b.removeOperationPrefixEndingWith&&!R){let re=new RegExp(`^.*${b.removeOperationPrefixEndingWith}`);ce=ce.replace(re,"")}if(b.tsNamespaces&&!I){let re=ort(ce,k);re===""?ce=u.toLowerCase():Fwe.includes(re)||(ce=re)}return Fwe.includes(ce)?Z:ce}t(Mwe,"getOperationName");function LW({operationsByTag:l,...u}){let{operation:m,options:b}=u,k=b.splitByTags?e3(m,b):b.defaultTag,I=t(R=>{let Z=Mwe({...u,tag:k,keepOperationTag:R});if(l[k].filter(re=>Mwe({...u,operation:re,tag:k,keepOperationTag:R})===Z).length===1)return Z},"operationName");return I()??I(!0)??Mwe({...u,tag:k,keepOperationTag:!0,keepOperationPrefix:!0})}t(LW,"getUniqueOperationName");function rnt(l,u,m){let b=[];for(let k in l.paths){if(g8(k,m))continue;let I=l.paths[k],R=S8(I,m8);for(let Z in R){let ce=R[Z];if(!ce||nL(ce,m))continue;let re=LW({path:k,method:Z,operation:ce,operationsByTag:u,options:m});b.push(re)}}return b}t(rnt,"getUniqueOperationNamesWithoutSplitByTags");function nnt(l,u){let m={};for(let b in l.paths){if(g8(b,u))continue;let k=l.paths[b],I=S8(k,m8);for(let R in I){let Z=I[R];if(!Z||nL(Z,u))continue;let ce=u.splitByTags?e3(Z,u):u.defaultTag;m[ce]||(m[ce]=[]),m[ce].push(Z)}}return m}t(nnt,"getOperationsByTag");function RW(l){return{type:"invalid-schema",message:l}}t(RW,"getInvalidSchemaError");function int(l){return{type:"invalid-operation-id",message:`Operation ${l}`}}t(int,"getInvalidOperationIdError");function snt(l,u){return{type:"missing-path-parameter",message:`Path ${u} is missing [${l.map(({name:m})=>m).join(", ")}]`}}t(snt,"getMissingPathParameterError");function ant(l){return{type:"not-allowed-inline-enum",message:`${l} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}t(ant,"getNotAllowedInlineEnumError");function ont(l){return{type:"not-allowed-circular-schema",message:l}}t(ont,"getNotAllowedCircularSchemaError");function cnt(l,u,m){return{type:"missing-acl-condition-property",message:`Condition property ${l} is not found in parameters or body in operation ${Ale(u,m)}`}}t(cnt,"getMissingAclConditionPropertyError");function Lwe(l,u,m){return{type:"missing-status-code",message:`Missing HTTP status code ${wle(l)} in operation ${Ale(u,m)}`}}t(Lwe,"getMissingStatusCodeError");function lnt(l,u,m){return{type:"invalid-status-code",message:`Operation ${Ale(u,m)} expected HTTP status code ${wle(l.expected)} but received ${wle(l.received)}`}}t(lnt,"getInvalidStatusCodeError");function unt(l,u,m){return{type:"multiple-success-status-codes",message:`Operation ${Ale(u,m)} has multiple success HTTP status codes: ${l.map(wle).join(", ")}`}}t(unt,"getMultipleSuccessStatusCodesError");function Ale(l,u){return l.operationId??`${u.method} ${u.path}`}t(Ale,"getOperationDescriptor");function wle(l){return`${l} (${Wtt[l]})`}t(wle,"getStatusCodeDescription");function fnt(l){return l.reduce((u,m)=>({...u,[m.type]:[...u[m.type]??[],m.message]}),{})}t(fnt,"groupByType");function jC({schema:l,meta:u,options:m}){let b=[];Zy(l.type).with("string",()=>b.push(DVt(l))).with("number","integer",()=>b.push(NVt(l))).with("array",()=>b.push(OVt(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&m.withDescription&&([`
525
+ `);return I!==-1&&(u=oZe(u,k,b,I)),b+u+k},"applyStyle");Object.defineProperties(EU.prototype,_M);var TYt=EU(),kYt=EU({level:lZe?lZe.level:0});var CA=new Voe;function TEe(l){console.log(l)}t(TEe,"log");function cS(l){console.log(`[INFO] ${l}`)}t(cS,"logInfo");function PU(l){console.log(CA.green(`[SUCCESS] ${l}`))}t(PU,"logSuccess");function HN(l,u){l instanceof Error?console.log(CA.red(`[ERROR] ${u||l.message}`)):console.log(CA.red(`[ERROR] ${l}`))}t(HN,"logError");function Woe(l){console.log(CA.bgYellow(`==== ${l} ====`))}t(Woe,"logBanner");var _Ze=Zm(require("fs"));function pM(){return"0.15.5"}t(pM,"getVersion");var RYt=Zm(dZe());var kEe=Symbol("options_key");function Au(l){return(u,m)=>{var b,k;if(l!=null){let I={...Reflect.getMetadata(kEe,u)||{},[m]:{...l,describe:l.envAlias?`${l.describe||""} [${l.envAlias}]`:l.describe,type:l.type||((k=(b=Reflect.getMetadata("design:type",u,m))==null?void 0:b.name)==null?void 0:k.toLowerCase())}};Reflect.defineMetadata(kEe,I,u)}}}t(Au,"YargOption");function mZe(l){let u=Reflect.getMetadata(kEe,l.prototype);if(!u)throw new Error(`Options for ${l.name} were not defined`);return u}t(mZe,"getYargsOption");function Hoe(l){return async u=>u.options(v5t(l)).middleware(async m=>await b5t(l,m),!0)}t(Hoe,"getBuilder");function v5t(l){return Object.entries(mZe(l)).reduce((u,[m,b])=>(u[m]=Object.fromEntries(Object.entries(b).filter(([k])=>!["envAlias","default"].includes(k))),u),{})}t(v5t,"getYargsOptions");async function b5t(l,u){let m=new l;for(let[b,k]of Object.entries(mZe(l)))m[b]=u[b]??k.default;return m}t(b5t,"loadYargsConfig");var $nt=Zm(dwe());var Wtt={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"},Htt={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var Zrt=Zm(Gtt());var uT={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},Ztt={bindings:[uT.query,uT.infiniteQuery,uT.mutation],from:"@tanstack/react-query"},yW={pageParamName:"page"},Kce={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vW="moduleName";var mwe={"Content-Type":"application/json",Accept:"application/json"},ele="data",hwe="axios",zA="config",DC="AxiosRequestConfig",tle={defaultImport:hwe,bindings:[DC],from:"axios"};var Qtt=t(l=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(l),"isValidPropertyName"),VA=t(l=>l.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function l_(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(l_,"isReferenceObject");function Ym(l){return!l_(l)}t(Ym,"isSchemaObject");function rle(l){return l.type==="array"}t(rle,"isArraySchemaObject");function Ytt(l){if(!l.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[u,m]=l.allOf.reduce((k,I)=>{if(gVt(I)){let R=I.required;k[0].push(...R??[])}else k[1].push(I);return k},[[],[]]),b={properties:u.reduce((k,I)=>(k[I]={},k),{}),type:"object",required:u};return{noRequiredOnlyAllof:m,composedRequiredSchema:b,patchRequiredSchemaInLoop:t((k,I)=>{if(l_(k)){let R=I(k.$ref);R&&b.required.forEach(Z=>{var ce;b.properties[Z]=((ce=R==null?void 0:R.properties)==null?void 0:ce[Z])??{}})}else{let R=k.properties??{};b.required.forEach(Z=>{R[Z]&&(b.properties[Z]=R[Z]??{})})}},"patchRequiredSchemaInLoop")}}t(Ytt,"inferRequiredSchema");var gVt=t(l=>!l_(l)&&!!l.required&&!l.type&&!l.properties&&!(l!=null&&l.allOf)&&!(l!=null&&l.anyOf)&&!l.oneOf,"isBrokenAllOfItem");var s6=Symbol.for("@ts-pattern/matcher"),yVt=Symbol.for("@ts-pattern/isVariadic"),ile="@ts-pattern/anonymous-select-key",gwe=t(l=>!!(l&&typeof l=="object"),"r"),nle=t(l=>l&&!!l[s6],"i"),OC=t((l,u,m)=>{if(nle(l)){let b=l[s6](),{matched:k,selections:I}=b.match(u);return k&&I&&Object.keys(I).forEach(R=>m(R,I[R])),k}if(gwe(l)){if(!gwe(u))return!1;if(Array.isArray(l)){if(!Array.isArray(u))return!1;let b=[],k=[],I=[];for(let R of l.keys()){let Z=l[R];nle(Z)&&Z[yVt]?I.push(Z):I.length?k.push(Z):b.push(Z)}if(I.length){if(I.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(u.length<b.length+k.length)return!1;let R=u.slice(0,b.length),Z=k.length===0?[]:u.slice(-k.length),ce=u.slice(b.length,k.length===0?1/0:-k.length);return b.every((re,pe)=>OC(re,R[pe],m))&&k.every((re,pe)=>OC(re,Z[pe],m))&&(I.length===0||OC(I[0],ce,m))}return l.length===u.length&&l.every((R,Z)=>OC(R,u[Z],m))}return Reflect.ownKeys(l).every(b=>{let k=l[b];return(b in u||nle(I=k)&&I[s6]().matcherType==="optional")&&OC(k,u[b],m);var I})}return Object.is(u,l)},"s"),ZA=t(l=>{var u,m,b;return gwe(l)?nle(l)?(u=(m=(b=l[s6]()).getSelectionKeys)==null?void 0:m.call(b))!=null?u:[]:Array.isArray(l)?SW(l,ZA):SW(Object.values(l),ZA):[]},"o"),SW=t((l,u)=>l.reduce((m,b)=>m.concat(u(b)),[]),"c");function dS(l){return Object.assign(l,{optional:t(()=>vVt(l),"optional"),and:t(u=>Qp(l,u),"and"),or:t(u=>bVt(l,u),"or"),select:t(u=>u===void 0?Xtt(l):Xtt(u,l),"select")})}t(dS,"u");function vVt(l){return dS({[s6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return u===void 0?(ZA(l).forEach(k=>b(k,void 0)),{matched:!0,selections:m}):{matched:OC(l,u,b),selections:m}},"match"),getSelectionKeys:t(()=>ZA(l),"getSelectionKeys"),matcherType:"optional"})})}t(vVt,"h");function Qp(...l){return dS({[s6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return{matched:l.every(k=>OC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,ZA),"getSelectionKeys"),matcherType:"and"})})}t(Qp,"m");function bVt(...l){return dS({[s6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return SW(l,ZA).forEach(k=>b(k,void 0)),{matched:l.some(k=>OC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,ZA),"getSelectionKeys"),matcherType:"or"})})}t(bVt,"d");function Af(l){return{[s6]:()=>({match:t(u=>({matched:!!l(u)}),"match")})}}t(Af,"p");function Xtt(...l){let u=typeof l[0]=="string"?l[0]:void 0,m=l.length===2?l[1]:typeof l[0]=="string"?void 0:l[0];return dS({[s6]:()=>({match:t(b=>{let k={[u??ile]:b};return{matched:m===void 0||OC(m,b,(I,R)=>{k[I]=R}),selections:k}},"match"),getSelectionKeys:t(()=>[u??ile].concat(m===void 0?[]:ZA(m)),"getSelectionKeys")})})}t(Xtt,"y");function IC(l){return typeof l=="number"}t(IC,"v");function UA(l){return typeof l=="string"}t(UA,"b");function WA(l){return typeof l=="bigint"}t(WA,"w");var nnr=dS(Af(function(l){return!0}));var HA=t(l=>Object.assign(dS(l),{startsWith:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&b.startsWith(m)))));var m},"startsWith"),endsWith:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&b.endsWith(m)))));var m},"endsWith"),minLength:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b.length>=m))(u))),"minLength"),length:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b.length===m))(u))),"length"),maxLength:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b.length<=m))(u))),"maxLength"),includes:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&b.includes(m)))));var m},"includes"),regex:t(u=>{return HA(Qp(l,(m=u,Af(b=>UA(b)&&!!b.match(m)))));var m},"regex")}),"j"),inr=HA(Af(UA)),NC=t(l=>Object.assign(dS(l),{between:t((u,m)=>NC(Qp(l,((b,k)=>Af(I=>IC(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b<m))(u))),"lt"),gt:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b>m))(u))),"gt"),lte:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b<=m))(u))),"lte"),gte:t(u=>NC(Qp(l,(m=>Af(b=>IC(b)&&b>=m))(u))),"gte"),int:t(()=>NC(Qp(l,Af(u=>IC(u)&&Number.isInteger(u)))),"int"),finite:t(()=>NC(Qp(l,Af(u=>IC(u)&&Number.isFinite(u)))),"finite"),positive:t(()=>NC(Qp(l,Af(u=>IC(u)&&u>0))),"positive"),negative:t(()=>NC(Qp(l,Af(u=>IC(u)&&u<0))),"negative")}),"x"),snr=NC(Af(IC)),GA=t(l=>Object.assign(dS(l),{between:t((u,m)=>GA(Qp(l,((b,k)=>Af(I=>WA(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b<m))(u))),"lt"),gt:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b>m))(u))),"gt"),lte:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b<=m))(u))),"lte"),gte:t(u=>GA(Qp(l,(m=>Af(b=>WA(b)&&b>=m))(u))),"gte"),positive:t(()=>GA(Qp(l,Af(u=>WA(u)&&u>0))),"positive"),negative:t(()=>GA(Qp(l,Af(u=>WA(u)&&u<0))),"negative")}),"A"),anr=GA(Af(WA)),onr=dS(Af(function(l){return typeof l=="boolean"})),cnr=dS(Af(function(l){return typeof l=="symbol"})),lnr=dS(Af(function(l){return l==null})),unr=dS(Af(function(l){return l!=null}));var Swe=class Swe extends Error{constructor(u){let m;try{m=JSON.stringify(u)}catch{m=u}super(`Pattern matching error: no pattern matches value ${m}`),this.input=void 0,this.input=u}};t(Swe,"W");var ywe=Swe,vwe={matched:!1,value:void 0};function Zy(l){return new bwe(l,vwe)}t(Zy,"z");var bW=class bW{constructor(u,m){this.input=void 0,this.state=void 0,this.input=u,this.state=m}with(...u){if(this.state.matched)return this;let m=u[u.length-1],b=[u[0]],k;u.length===3&&typeof u[1]=="function"?k=u[1]:u.length>2&&b.push(...u.slice(1,u.length-1));let I=!1,R={},Z=t((re,pe)=>{I=!0,R[re]=pe},"a"),ce=!b.some(re=>OC(re,this.input,Z))||k&&!k(this.input)?vwe:{matched:!0,value:m(I?ile in R?R[ile]:R:this.input,this.input)};return new bW(this.input,ce)}when(u,m){if(this.state.matched)return this;let b=!!u(this.input);return new bW(this.input,b?{matched:!0,value:m(this.input,this.input)}:vwe)}otherwise(u){return this.state.matched?this.state.value:u(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ywe(this.input)}run(){return this.exhaustive()}returnType(){return this}};t(bW,"I");var bwe=bW;var xwe=2,Ktt=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],ert=["query","header","path"],m8=["get","put","post","delete","options","head","patch","trace"],trt=["string","number","integer","boolean"],xW=["allOf","anyOf","oneOf"];var J_=t(l=>l.charAt(0).toUpperCase()+l.slice(1),"capitalize"),QA=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),rrt=t(l=>l.replace(/(-\w)/g,u=>u[1].toUpperCase()),"kebabToCamel"),mg=t(l=>l.replace(/(_\w)/g,u=>u[1].toUpperCase()),"snakeToCamel"),nrt=t(l=>l.replace(/[\W_]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"nonWordCharactersToCamel"),Twe=t((l,u="")=>l.endsWith(u)?l:`${l}${u}`,"suffixIfNeeded"),irt=t((l,u)=>l.replace(new RegExp(`${u}$`),""),"removeSuffix"),SVt=t(l=>{var b;let u=l.reduce((k,I)=>({...k,[I]:(k[I]??0)+1}),{});return(b=Object.entries(u).sort((k,I)=>k[1]===I[1]?I[0].length-k[0].length:I[1]-k[1])[0])==null?void 0:b[0]},"getLongestMostCommon"),kwe=t(l=>{let u=l.map(J_).map(srt).map(m=>xVt(m)).flat();return SVt(u)},"getMostCommonAdjacentCombinationSplit"),srt=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),art=t(l=>srt(l).join(" "),"camelToSpaceSeparated"),xVt=t((l,u=["dto","by","for","of","in","to","and","with"])=>{var b;let m=[];for(let k=0;k<l.length;k++)if(!u.includes(l[k].toLowerCase()))for(let I=k+1;I<=l.length;I++)u.includes((b=l[I-1])==null?void 0:b.toLowerCase())||m.push(l.slice(k,I).join(""));return m},"getAdjacentStringCombinations"),ort=t((l,u)=>{let m=u.replace(/es$|s$/g,""),b=new RegExp(`(${QA(m)}|${J_(m)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(b,"")},"removeWord");var lrt=t(l=>`#/components/schemas/${l}`,"getSchemaRef"),h8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),XM=t(l=>h8(l).split("/").at(-1),"getSchemaNameByRef");function Ewe(l){let u=TVt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return mg(u)}t(Ewe,"normalizeString");function urt(l){return/^[a-zA-Z]\w*$/.test(l)?l:`"${l}"`}t(urt,"wrapWithQuotesIfNeeded");function frt(l){return typeof l=="string"&&l.startsWith('"')&&l.endsWith('"')?l.slice(1,-1):l}t(frt,"unwrapQuotesIfNeeded");function TVt(l){let u=Number(l[0]);return typeof u=="number"&&!Number.isNaN(u)?"_"+l:l}t(TVt,"prefixStringStartingWithNumberIfNeeded");function Pwe(l){let u=l.replaceAll("_","#");return mg(u.replaceAll("-","_")).replaceAll("#","_")}t(Pwe,"pathParamToVariableName");var FC=t(l=>trt.includes(l),"isPrimitiveType");function _rt(l){return l.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(u,m)=>{let b=m.codePointAt(),k=b.toString(16);return b<=255?`\\x${`00${k}`.slice(-2)}`:`\\u${`0000${k}`.slice(-4)}`}).replace(/\//g,"\\/")}t(_rt,"escapeControlCharacters");function MC(l){return l.includes("application/")&&l.includes("json")||Ktt.includes(l)||l.includes("text/")}t(MC,"isParamMediaTypeAllowed");function TW(l){return l>=200&&l<300}t(TW,"isMainResponseStatus");function sle(l){return!(l>=200&&l<300)}t(sle,"isErrorStatus");function ale(l){return l.startsWith("application/")}t(ale,"isMediaTypeAllowed");var crt=/({\w+})/g,kVt=/[^\w\-]+/g;function prt(l){l=J_(rrt(l.replaceAll("/","-")).replaceAll("-",""));let u=[...l.matchAll(crt)];if(u.length>0){let m=u.sort((b,k)=>b.index-k.index)[u.length-1][0];l=`${l.replace(crt,"")}By${J_(m.slice(1,-1))}`}return l.replace(kVt,"_")}t(prt,"pathToVariableName");var Cwe=/{(\b\w+(?:-\w+)*\b)}/g;function drt(l){let u=l.match(Cwe);return u===null?l.replaceAll(Cwe,":$1"):(u.forEach(m=>{let b=Pwe(m.replaceAll(Cwe,":$1"));l=l.replaceAll(m,b)}),l)}t(drt,"replaceHyphenatedPath");var mrt=t(l=>{let u=l["x-enumNames"],m=Array.isArray(u)&&u.length>0,b=!!l.schema&&Ym(l.schema)&&l.schema.type==="string";return m&&b},"isSortingParameterObject"),g8=t((l,u)=>u.excludePathRegex?new RegExp(u.excludePathRegex).test(l):!1,"isPathExcluded");var Db=t(l=>l.method==="get","isQuery"),XA=t(l=>l.method!=="get"||!!l.mediaDownload,"isMutation"),KM=t((l,u)=>Db(l)&&(u??Object.values(yW)).every(m=>l.parameters.some(b=>b.name===m&&b.type==="Query")),"isInfiniteQuery"),hrt=t((l,u,m)=>{let b=m.reduce((k,I)=>[...k,...YA(l,I,{includeOnlyRequiredParams:!0}).map(R=>R.name)],[]);return YA(l,u,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(k=>b.includes(k.name)).map(k=>k.name)},"getDestructuredVariables");function KA(l){return nrt(l)}t(KA,"formatTag");function e3(l,u){var b;let m=(b=l.tags)==null?void 0:b[0];return KA(m??u.defaultTag)}t(e3,"getOperationTag");function grt(l,u){return u.excludeTags.some(m=>m.toLowerCase()===l.toLowerCase())}t(grt,"isTagExcluded");var ole={fileName:"acl/app.ability",extension:"ts"},kW="AllAbilities",CW="AppAbilities",cle={fileName:"acl/useAclCheck",extension:"ts"},t3="useAclCheck",Qy={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},wwe={bindings:[Qy.abilityTuple,Qy.pureAbility,Qy.forcedSubject,Qy.subjectType,Qy.subject],from:"@casl/ability"};var EW="AppRestClient",lle={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Awe="src/data",Dwe="@/data",mS={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"}},r3={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ule={bindings:[r3.ErrorHandler,r3.SharedErrorHandler],from:mS.errorHandling.template},Iwe="AbilityContext",yrt={bindings:[Iwe],from:mS.abilityContext.template};var fle={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},_le={fileName:"app-rest-client",extension:"ts"},Nwe="QueryModule",ple={fileName:"queryModules",extension:"ts"},vrt={fileName:"queryConfig.context",extension:"tsx"},eL={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},dle={fileName:"useMutationEffects",extension:"ts"},hg={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},mle={fileName:"zod.utils",extension:"ts"};var Ib=t((...l)=>[...new Set(l.flat())],"getUniqueArray");var brt=t(l=>`Use${J_(mg(l.operationName))}Ability`,"getAbilityTypeName"),PW=t(l=>`canUse${J_(mg(l.operationName))}`,"getAbilityFunctionName"),Srt=t((l,u)=>`${u.tsNamespaces?`${Np({type:"acl",tag:n3(l,u),options:u})}.`:""}${PW(l)}`,"getImportedAbilityFunctionName"),xrt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].action},"getAbilityAction"),Trt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].subject},"getAbilitySubject"),hle=t(l=>{var u;return!!((u=wW(l))!=null&&u.length)},"hasAbilityConditions"),wW=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].conditionsTypes},"getAbilityConditionsTypes"),krt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].description},"getAbilityDescription"),gle=t(l=>`${J_(l)}${kW}`,"getTagAllAbilitiesName");var Crt="Schema",Ert="Enum",Prt="Body",wrt="Param",Art="Response",Drt="ErrorResponse",AW="z.void()",yle="z.instanceof(Blob)",DW="z.enum",vle="z.string()",tL={bindings:["z"],from:"zod"};function ny(l,u){if(!l)return;let{data:m,onSchema:b}=u;if(l_(l)&&b({type:"reference",schema:l,data:m})===!0)return;let k=l;if(xW.some(I=>I in k&&k[I])){let I=k.allOf??k.anyOf??k.oneOf??[];for(let R of I)(b==null?void 0:b({type:"composite",parentSchema:l,schema:R,data:m}))!==!0&&ny(R,{data:m,onSchema:b})}if(k.properties)for(let[I,R]of Object.entries(k.properties))b({type:"property",parentSchema:l,schema:R,data:m,propertyName:I})!==!0&&ny(R,u);if(k.additionalProperties&&typeof k.additionalProperties=="object"){if(b({type:"additionalProperties",parentSchema:l,schema:k.additionalProperties,data:m})===!0)return;ny(k.additionalProperties,u)}if(k.type==="array"){let I=l.items;if(b({type:"array",parentSchema:l,schema:I,data:m})===!0)return;ny(I,u)}}t(ny,"iterateSchema");var LC=t((l,u)=>Twe(J_(Ewe(l)),u),"getZodSchemaName"),IW=t((l,u,m)=>Twe(J_(Ewe(l)),`${u}${m}`),"getEnumZodSchemaName"),Yy=t(l=>["z.",`${hg.namespace}.`].every(u=>!l.startsWith(u)),"isNamedZodSchema"),Irt=t(l=>l.startsWith(DW),"isEnumZodSchema"),y8=t((l,u,m)=>u?l:`${m}_${l}`,"getZodSchemaOperationName"),ble=t(l=>mg(`${l}_${Prt}`),"getBodyZodSchemaName"),Nrt=t((l,u)=>mg(`${l}_${u}${wrt}`),"getParamZodSchemaName"),CVt=t(l=>mg(`${l}${Art}`),"getMainResponseZodSchemaName"),EVt=t((l,u)=>mg(`${l}_${u}_${Drt}`),"getErrorResponseZodSchemaName");function Sle({statusCode:l,operationName:u,isUniqueOperationName:m,tag:b}){let k=Number(l),I=y8(u,m,b);return!TW(k)&&l!=="default"&&sle(k)?EVt(I,l):CVt(I)}t(Sle,"getResponseZodSchemaName");function NW(l){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(b=>l[b]).reduce((b,k)=>[...b,`${J_(art(k))}: \`${l[k]}\``],[])}t(NW,"getSchemaDescriptions");var OW=t((l,u)=>irt(l,u.schemaSuffix),"getZodSchemaInferedTypeName"),Ort=t((l,u)=>Yy(u)?`${l.options.tsNamespaces?`${Np({type:"models",tag:l.getTagByZodSchemaName(u),options:l.options})}.`:""}${u}`:u,"getImportedZodSchemaName"),v8=t((l,u,m)=>{if(!Yy(u))return u===AW?"void":u;let b=l.getTagByZodSchemaName(u);return`${l.options.tsNamespaces&&b!==m?`${Np({type:"models",tag:b,options:l.options})}.`:""}${OW(u,l.options)}`},"getImportedZodSchemaInferedTypeName");function Frt(l){var u;return l.isEnum?"enum":((u=l.schemaObj)==null?void 0:u.type)??"object"}t(Frt,"getZodSchemaType");function Mrt(l){if(l.schemaObj)return[l.schemaObj.description,...NW(l.schemaObj)].filter(Boolean).join(". ")}t(Mrt,"getZodSchemaDescription");function Lrt(l,u,m){var b;if(l_(u)){let k=l.getZodSchemaNameByRef(u.$ref);return k?v8(l,k,m):void 0}if(rle(u)){if(!l_(u.items))return`${((b=u.items)==null?void 0:b.type)??"unknown"}[]`;let k=l.getZodSchemaNameByRef(u.items.$ref);return k?`${v8(l,k,m)}[]`:void 0}if(xW.some(k=>k in u&&u[k])){let k=u.allOf??u.anyOf??u.oneOf??[];if(k.length>0)return Lrt(l,k[0],m)}return u.type}t(Lrt,"getType");function Rrt(l,u,m){if(!u.schemaObj)return[];let b="[0]",k="[key]",I={},R=t(Z=>{var re;if(Z.type==="reference")return!0;if(Z.type==="composite")return;let ce=[...((re=Z.data)==null?void 0:re.pathSegments)??[]];if(Z.type==="array"?ce.push(b):Z.type==="property"?ce.push(Z.propertyName):Z.type==="additionalProperties"&&ce.push(k),Z.schema&&ce[ce.length-1]!==b){let pe=l.resolveObject(Z.schema),ke=[pe.description,...NW(pe)].filter(Boolean),et=ce.join(".");I[et]&&"type"in Z.schema&&Z.schema.type==="object"||(delete I[et],I[et]={type:Lrt(l,Z.schema,m)??"unknown",description:ke.join(". ")})}return ny(Z.schema,{data:{pathSegments:[...ce]},onSchema:R}),!0},"onSchema");return"allOf"in u.schemaObj&&u.schemaObj.allOf&&u.schemaObj.allOf.forEach(Z=>{if(l_(Z)){let ce=l.resolveObject(Z);ny(ce,{data:{pathSegments:[]},onSchema:R})}}),ny(u.schemaObj,{data:{pathSegments:[]},onSchema:R}),I}t(Rrt,"getZodSchemaPropertyDescriptions");function i3({resolver:l,tag:u,zodSchemas:m=[],zodSchemasAsTypes:b=[]}){let k="models",I=t(ce=>l.getTagByZodSchemaName(ce),"getTag"),R=xle({type:k,tag:u,entities:m,getTag:I,getEntityName:t(ce=>ce,"getEntityName"),options:l.options}),Z=xle({type:k,tag:u,entities:b,getTag:I,getEntityName:t(ce=>OW(ce,l.options),"getEntityName"),options:l.options});return PVt(l.options,R,Z)}t(i3,"getModelsImports");function jrt({tag:l,endpoints:u,options:m}){return xle({type:"endpoints",tag:l,entities:u,getTag:t(b=>n3(b,m),"getTag"),getEntityName:FW,options:m})}t(jrt,"getEndpointsImports");function Brt({tag:l,endpoints:u,options:m}){return xle({type:"acl",tag:l,entities:u,getTag:t(b=>n3(b,m),"getTag"),getEntityName:PW,options:m})}t(Brt,"getAclImports");function $rt({tags:l,entityName:u,getAliasEntityName:m,type:b,options:k}){let I=new Map;return l.forEach(R=>{let Z=`${u}${m?` as ${m(R)}`:""}`;I.has(R)?k.tsNamespaces||I.get(R).bindings.push(Z):I.set(R,{bindings:[k.tsNamespaces?Np({type:b,tag:R,options:k}):Z],from:`${RC(k)}${Tle({type:b,tag:R,includeTagDir:!0,options:k})}`})}),Array.from(I.values())}t($rt,"getEntityImports");function RC(l){let u=Dwe;return l.importPath==="relative"?u="../":l.importPath==="absolute"?u=l.output:new RegExp(`${Awe}`,"g").test(l.output)&&(u=l.output.replace(new RegExp(`.*${Awe}`,"g"),Dwe)),`${u}/`.replace(/\/\//g,"/")}t(RC,"getImportPath");function xle({type:l="models",tag:u,entities:m,getTag:b,getEntityName:k,options:I}){let R=new Map;return m.forEach(Z=>{let ce=b(Z);if(R.has(ce))I.tsNamespaces||R.get(ce).bindings.push(k(Z));else{let re=u===ce;R.set(ce,{bindings:[I.tsNamespaces?Np({type:l,tag:ce,options:I}):k(Z)],from:`${re?"./":RC(I)}${Tle({type:l,tag:ce,includeTagDir:!re,options:I})}`})}}),Array.from(R.values())}t(xle,"getImports");function PVt(l,...u){let m=new Map;return u.forEach(b=>{b.forEach(k=>{m.has(k.from)?l.tsNamespaces||m.get(k.from).bindings.push(...k.bindings):m.set(k.from,k)})}),Array.from(m.values()).map(b=>({...b,bindings:Ib(b.bindings)}))}t(PVt,"mergeImports");function b8({fileName:l,extension:u}){return`${l}.${u}`}t(b8,"getFileNameWithExtension");function Jrt({type:l,tag:u,options:m,includeTagDir:b=!0}){let k=m.configs[l].outputFileNameSuffix;return u?`${b?`${QA(u)}/`:""}${QA(u)}.${k}`:k}t(Jrt,"getTagFileNameWithoutExtension");function Tle(...l){return Jrt(...l)}t(Tle,"getTagImportPath");function kle(...l){return`${Jrt(...l)}.ts`}t(kle,"getTagFileName");var Np=t(({type:l,tag:u,options:m})=>`${J_(u)}${m.configs[l].namespaceSuffix}`,"getNamespaceName");function qrt(l){return l.standalone?`${RC(l)}${_le.fileName}`:l.restClientImportPath}t(qrt,"getAppRestClientImportPath");function zrt(l){return l.standalone?`${RC(l)}${fle.reactQueryTypes.fileName}`:l.queryTypesImportPath}t(zrt,"getQueryTypesImportPath");function Vrt(l){return`${RC(l)}${ple.fileName}`}t(Vrt,"getQueryModulesImportPath");function Urt(l){return`${RC(l)}${dle.fileName}`}t(Urt,"getMutationEffectsImportPath");function Wrt(l){return`${RC(l)}${cle.fileName}`}t(Wrt,"getAclCheckImportPath");function Cle(l){return`${RC(l)}${mle.fileName}`}t(Cle,"getZodUtilsImportPath");function Hrt(l){return`${RC(l)}${ole.fileName}`}t(Hrt,"getAppAbilitiesImportPath");function Grt(l){return Zy(l).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}t(Grt,"primitiveTypeToTsType");var FW=t(l=>QA(mg(l.operationName)),"getEndpointName");function Qrt(l,u){return`${u.tsNamespaces?`${Np({type:"endpoints",tag:n3(l,u),options:u})}.`:""}${FW(l)}`}t(Qrt,"getImportedEndpointName");var Yrt=t(l=>l.method!==Zrt.OpenAPIV3.HttpMethods.GET,"requiresBody"),Ele=t(l=>l.parameters.find(u=>u.type==="Body"),"getEndpointBody"),Xrt=t((l,u)=>{let m=Owe(l),b=u.options.axiosRequestConfig;return Object.keys(m).length>0||b},"hasEndpointConfig"),Krt=t(l=>l.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function n3(l,u){var b;let m=u.splitByTags?(b=l.tags)==null?void 0:b[0]:u.defaultTag;return KA(m??u.defaultTag)}t(n3,"getEndpointTag");function YA(l,u,m){let b=u.parameters.map(k=>{var R,Z,ce,re;let I="string";if(Yy(k.zodSchema))I=v8(l,k.zodSchema);else if((R=k.parameterObject)!=null&&R.schema&&Ym(k.parameterObject.schema)){let pe=(ce=(Z=k.parameterObject)==null?void 0:Z.schema)==null?void 0:ce.type;pe&&FC(pe)&&(I=Grt(pe))}return{name:VA(k.name),type:I,paramType:k.type,required:((re=k.parameterObject)==null?void 0:re.required)??!0,parameterObject:k.parameterObject,bodyObject:k.bodyObject}});return m!=null&&m.includeFileParam&&u.mediaUpload&&b.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),b.sort((k,I)=>{if(k.required===I.required){let R=["Path","Body","Query","Header"];return R.indexOf(k.paramType)-R.indexOf(I.paramType)}return k.required?-1:1}).filter(k=>(!(m!=null&&m.excludeBodyParam)||k.name!==ele)&&(!(m!=null&&m.excludePageParam)||k.name!==yW.pageParamName)&&(!(m!=null&&m.includeOnlyRequiredParams)||k.required)).map(k=>({...k,name:m!=null&&m.replacePageParam&&k.name===yW.pageParamName?"pageParam":k.name,required:k.required&&(k.paramType==="Path"||!(m!=null&&m.pathParamsRequiredOnly))}))}t(YA,"mapEndpointParamsToFunctionParams");function Owe(l){let u=l.parameters.filter(k=>k.type==="Query").map(k=>{let I=Qtt(k.name)?k.name:`"${k.name}"`,R=VA(k.name);return{...k,name:I,value:R}}),m={};return l.requestFormat!==mwe["Content-Type"]&&(m["Content-Type"]=`'${l.requestFormat}'`),l.responseFormat&&l.responseFormat!==mwe.Accept&&(m.Accept=`'${l.responseFormat}'`),l.parameters.filter(k=>k.type==="Header").forEach(k=>{m[k.name]=VA(k.name)}),{...u.length>0?{params:u}:{},...Object.keys(m).length?{headers:m}:{}}}t(Owe,"getEndpointConfig");function ent(l,u){return u.filter(m=>Db(m)&&m.parameters.filter(b=>{var k;return(k=b.parameterObject)==null?void 0:k.required}).every(b=>l.parameters.some(k=>k.name===b.name))&&m.response===l.response)}t(ent,"getUpdateQueryEndpoints");var Fwe=["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 S8(l,u){let m={};return Object.keys(l).forEach(b=>{u.includes(b)&&(m[b]=l[b])}),m}t(S8,"pick");function Ple(l,...u){if(u.length===0)return l;let m=l;for(let b of u)m=tnt(m,b);return m}t(Ple,"deepMerge");function tnt(l,u){if(u==null)return l;if(l==null)return rL(u);if(Array.isArray(l)&&Array.isArray(u))return[...l,...u];if(MW(l)&&MW(u)){let m={};for(let[b,k]of Object.entries(l))m[b]=rL(k);for(let[b,k]of Object.entries(u)){let I=m[b];k!==void 0&&(k===null?m[b]=k:MW(I)&&MW(k)?m[b]=tnt(I,k):Array.isArray(I)&&Array.isArray(k)?m[b]=[...I,...k]:m[b]=rL(k))}return m}return rL(u)}t(tnt,"mergeTwoValues");function rL(l){if(l==null||typeof l!="object")return l;if(Array.isArray(l))return l.map(u=>rL(u));if(MW(l)){let u={};for(let[m,b]of Object.entries(l))u[m]=rL(b);return u}return l}t(rL,"deepClone");function MW(l){return l!==null&&typeof l=="object"&&!Array.isArray(l)&&Object.prototype.toString.call(l)==="[object Object]"}t(MW,"isPlainObject");function nL(l,u){let m=l.deprecated&&!u.withDeprecatedEndpoints,b=e3(l,u),k=grt(b,u);return m||k}t(nL,"isOperationExcluded");function Mwe({path:l,method:u,operation:m,options:b,tag:k,keepOperationTag:I,keepOperationPrefix:R}){let Z=`${u}${prt(l)}`,ce=m.operationId?VA(m.operationId):Z;if(b.removeOperationPrefixEndingWith&&R)ce=ce.split(b.removeOperationPrefixEndingWith).map((pe,ke)=>ke===0?pe:J_(pe)).join("");else if(b.removeOperationPrefixEndingWith&&!R){let re=new RegExp(`^.*${b.removeOperationPrefixEndingWith}`);ce=ce.replace(re,"")}if(b.tsNamespaces&&!I){let re=ort(ce,k);re===""?ce=u.toLowerCase():Fwe.includes(re)||(ce=re)}return Fwe.includes(ce)?Z:ce}t(Mwe,"getOperationName");function LW({operationsByTag:l,...u}){let{operation:m,options:b}=u,k=b.splitByTags?e3(m,b):b.defaultTag,I=t(R=>{let Z=Mwe({...u,tag:k,keepOperationTag:R});if(l[k].filter(re=>Mwe({...u,operation:re,tag:k,keepOperationTag:R})===Z).length===1)return Z},"operationName");return I()??I(!0)??Mwe({...u,tag:k,keepOperationTag:!0,keepOperationPrefix:!0})}t(LW,"getUniqueOperationName");function rnt(l,u,m){let b=[];for(let k in l.paths){if(g8(k,m))continue;let I=l.paths[k],R=S8(I,m8);for(let Z in R){let ce=R[Z];if(!ce||nL(ce,m))continue;let re=LW({path:k,method:Z,operation:ce,operationsByTag:u,options:m});b.push(re)}}return b}t(rnt,"getUniqueOperationNamesWithoutSplitByTags");function nnt(l,u){let m={};for(let b in l.paths){if(g8(b,u))continue;let k=l.paths[b],I=S8(k,m8);for(let R in I){let Z=I[R];if(!Z||nL(Z,u))continue;let ce=u.splitByTags?e3(Z,u):u.defaultTag;m[ce]||(m[ce]=[]),m[ce].push(Z)}}return m}t(nnt,"getOperationsByTag");function RW(l){return{type:"invalid-schema",message:l}}t(RW,"getInvalidSchemaError");function int(l){return{type:"invalid-operation-id",message:`Operation ${l}`}}t(int,"getInvalidOperationIdError");function snt(l,u){return{type:"missing-path-parameter",message:`Path ${u} is missing [${l.map(({name:m})=>m).join(", ")}]`}}t(snt,"getMissingPathParameterError");function ant(l){return{type:"not-allowed-inline-enum",message:`${l} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}t(ant,"getNotAllowedInlineEnumError");function ont(l){return{type:"not-allowed-circular-schema",message:l}}t(ont,"getNotAllowedCircularSchemaError");function cnt(l,u,m){return{type:"missing-acl-condition-property",message:`Condition property ${l} is not found in parameters or body in operation ${Ale(u,m)}`}}t(cnt,"getMissingAclConditionPropertyError");function Lwe(l,u,m){return{type:"missing-status-code",message:`Missing HTTP status code ${wle(l)} in operation ${Ale(u,m)}`}}t(Lwe,"getMissingStatusCodeError");function lnt(l,u,m){return{type:"invalid-status-code",message:`Operation ${Ale(u,m)} expected HTTP status code ${wle(l.expected)} but received ${wle(l.received)}`}}t(lnt,"getInvalidStatusCodeError");function unt(l,u,m){return{type:"multiple-success-status-codes",message:`Operation ${Ale(u,m)} has multiple success HTTP status codes: ${l.map(wle).join(", ")}`}}t(unt,"getMultipleSuccessStatusCodesError");function Ale(l,u){return l.operationId??`${u.method} ${u.path}`}t(Ale,"getOperationDescriptor");function wle(l){return`${l} (${Wtt[l]})`}t(wle,"getStatusCodeDescription");function fnt(l){return l.reduce((u,m)=>({...u,[m.type]:[...u[m.type]??[],m.message]}),{})}t(fnt,"groupByType");function jC({schema:l,meta:u,options:m}){let b=[];Zy(l.type).with("string",()=>b.push(DVt(l))).with("number","integer",()=>b.push(NVt(l))).with("array",()=>b.push(OVt(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&m.withDescription&&([`
526
526
  `,"\r",`\r
527
527
  `].some(I=>String.prototype.includes.call(l.description,I))?b.push(`describe(\`${l.description}\`)`):b.push(`describe("${l.description}")`));let k=b.concat(wVt({schema:l,meta:u,options:m}),m.withDefaultValues!==!1?AVt(l):[]).filter(Boolean).join(".");return k?`.${k}`:""}t(jC,"getZodChain");function wVt({schema:l,meta:u,options:m}){return l.nullable&&!(u!=null&&u.isRequired)?"nullish()":l.nullable||m.replaceOptionalWithNullish&&(u!=null&&u.isParentPartial)?"nullable()":u!=null&&u.isRequired?"":m.replaceOptionalWithNullish?"nullish()":"optional()"}t(wVt,"getZodChainablePresence");function AVt(l){return l.default!==void 0?`default(${Zy(l.type).with("number","integer",()=>frt(l.default)).otherwise(()=>JSON.stringify(l.default))})`:""}t(AVt,"getZodChainableDefault");function DVt(l){let u=[];if(l.enum||(l.minLength!==void 0&&u.push(`min(${l.minLength})`),l.maxLength!==void 0&&u.push(`max(${l.maxLength})`)),l.pattern&&u.push(`regex(${IVt(l.pattern)})`),l.format){let m=Zy(l.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");m&&u.push(m)}return u.join(".")}t(DVt,"getZodChainableStringValidations");function IVt(l){return l.startsWith("/")&&l.endsWith("/")&&(l=l.slice(1,-1)),l=_rt(l),`/${l}/`}t(IVt,"formatPatternIfNeeded");function NVt(l){let u=[];return l.enum?"":(l.type==="integer"&&u.push("int()"),l.minimum!==void 0?l.exclusiveMinimum===!0?u.push(`gt(${l.minimum})`):u.push(`gte(${l.minimum})`):typeof l.exclusiveMinimum=="number"&&u.push(`gt(${l.exclusiveMinimum})`),l.maximum!==void 0?l.exclusiveMaximum===!0?u.push(`lt(${l.maximum})`):u.push(`lte(${l.maximum})`):typeof l.exclusiveMaximum=="number"&&u.push(`lt(${l.exclusiveMaximum})`),l.multipleOf&&u.push(`multipleOf(${l.multipleOf})`),u.join("."))}t(NVt,"getZodChainableNumberValidations");function OVt(l){let u=[];return l.minItems&&u.push(`min(${l.minItems})`),l.maxItems&&u.push(`max(${l.maxItems})`),u.join(".")}t(OVt,"getZodChainableArrayValidations");var FVt={type:"string",format:"date-time"},MVt={type:"string",format:"email"},LVt={type:"object",properties:{start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"}}},RVt={type:"object",properties:{html:{type:"string"},json:{type:"object"}}},iL=(k=>(k.datetime="datetime",k.email="email",k.dateRange="dateRange",k.textEditor="textEditor",k))(iL||{}),Dle={datetime:FVt,email:MVt,dateRange:LVt,textEditor:RVt};function _nt(){return Object.values(iL).filter(l=>FC(Dle[l].type))}t(_nt,"getPrimitiveBrands");function pnt(){return Object.values(iL).filter(l=>!FC(Dle[l].type))}t(pnt,"getOtherBrands");function sL(l,u){let m=Dle[u];return!(l.type!==m.type||m.format&&l.format!==m.format||!Object.entries(m.properties??{}).every(([k,I])=>{var Z;let R=(Z=l.properties)==null?void 0:Z[k];return R&&R.type===I.type&&R.format===I.format}))}t(sL,"matchesBrand");function Rwe(l,u,m){return m.branded?`${hg.namespace}.${hg.exports.brand}(${l}, "${u}")`:l}t(Rwe,"wrapWithBrand");var x8=t(l=>l.reduce((u,m)=>u+m,0),"sum");function gg(l,u){if(!u)return l;if(l_(u))return l+2;if(Array.isArray(u.type))return u.type.length===1?Nb("oneOf")+gg(l,{...u,type:u.type[0]}):l+Nb("oneOf")+x8(u.type.map(m=>gg(0,{...u,type:m})));if(u.oneOf)return u.oneOf.length===1?Nb("oneOf")+gg(l,u.oneOf[0]):l+Nb("oneOf")+x8(u.oneOf.map(m=>gg(0,m)));if(u.anyOf)return u.anyOf.length===1?Nb("anyOf")+gg(l,u.anyOf[0]):l+Nb("anyOf")+x8(u.anyOf.map(m=>gg(0,m)));if(u.allOf)return u.allOf.length===1?Nb("allOf")+gg(l,u.allOf[0]):l+Nb("allOf")+x8(u.allOf.map(m=>gg(0,m)));if(!u.type)return l;if(FC(u.type))return u.enum?l+dnt(u)+Nb("enum")+x8(u.enum.map(m=>gg(0,m))):l+dnt(u);if(u.type==="array")return u.items?Nb("array")+gg(l,u.items):Nb("array")+gg(l);if(u.type==="object"||u.properties||u.additionalProperties){if(u.properties){let m=Object.values(u.properties);l+=Nb("object")+x8(m.map(b=>gg(0,b)))}else l+=Nb("empty-object");u.additionalProperties&&(typeof u.additionalProperties=="object"?l+=gg(0,u.additionalProperties):l+=gg(1))}return l}t(gg,"getOpenAPISchemaComplexity");function dnt(l){return Zy(l.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}t(dnt,"complexityByType");function Nb(l){return Zy(l).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}t(Nb,"complexityByComposite");var jwe=class jwe{constructor(u,m,b={referencedBy:[]},k){this.schema=u;this.resolver=m;l_(u)&&(this.ref=u.$ref),k&&(this.enumRef=k),this.meta={...b,referencedBy:[...(b==null?void 0:b.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(u,m){var I,R;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let b=(I=this.resolver)==null?void 0:I.getZodSchemaNameByRef(this.ref);if(!b)return this.ref;let k=(R=this.resolver)==null?void 0:R.getTagByZodSchemaName(b);return m!=null&&m.tsNamespaces&&k&&k!==u?`${Np({type:"models",tag:k,options:m})}.${b}`:b}get complexity(){return gg(0,this.schema)}assign(u){return this.code=u,this}inherit(u){return u&&u.children.push(this),this}};t(jwe,"ZodSchema");var jW=jwe;function Wd({schema:l,resolver:u,meta:m,tag:b}){var cr;let k=new jW(l,u,m),I={parent:k.inherit(m==null?void 0:m.parent),referencedBy:[...k.meta.referencedBy]},R={resolver:u,meta:I,tag:b};if(l_(l))return jVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});let Z=$Vt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(Z)return Z;let ce=BVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(ce)return ce;let re=JVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(re)return re;let pe=qVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(pe)return pe;let ke=zVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(ke)return ke;let et=u.options.allReadonly?".readonly()":"";if(rle(l))return l.items?k.assign(`z.array(${Wd({...R,schema:l.items}).getCodeString(b,u.options)}${jC({schema:l.items,meta:{...I,isRequired:!0},options:u.options})})${et}`):k.assign(`z.array(z.any())${et}`);let At=l.type?l.type.toLowerCase():void 0;if(At==="object"||l.properties||l.additionalProperties){let sr=l.required&&l.required.length>0,Bt=u.options.withImplicitRequiredProps?!1:l.properties&&!((cr=l.required)!=null&&cr.length),ar="{}";l.properties&&(ar="{ "+Object.entries(l.properties).map(([ai,eu])=>{var xs;let tf={...I,isRequired:Bt?!0:sr?(xs=l.required)==null?void 0:xs.includes(ai):u.options.withImplicitRequiredProps,name:ai,isParentPartial:Bt},ma=eu;if(l_(eu)&&u&&(ma=u.getSchemaByRef(eu.$ref),!ma))throw new Error(`Schema ${eu.$ref} not found`);let Sr=Wd({...R,schema:eu,meta:tf}).getCodeString(b,u.options)+jC({schema:ma,meta:tf,options:u.options});return Ym(eu)&&_nt().forEach(Fs=>{sL(eu,Fs)&&(Sr=Rwe(Sr,Fs,u.options))}),[ai,Sr]}).map(([ai,eu])=>`${urt(ai)}: ${eu}`).join(", ")+" }");let Zt="";l.additionalProperties&&(Zt=`.catchall(${typeof l.additionalProperties=="object"&&Object.keys(l.additionalProperties).length>0?Wd({...R,schema:l.additionalProperties}).getCodeString(b,u.options)+jC({schema:l.additionalProperties,meta:{...I,isRequired:!0},options:u.options}):"z.any()"})`);let Ai=Bt?".partial()":"",zn=u.options.strictObjects?".strict()":"",vi=`z.object(${ar})${Ai}${zn}${Zt}${et}`;return pnt().forEach(Zo=>{sL(l,Zo)&&(vi=Rwe(vi,Zo,u.options))}),k.assign(vi)}if(At==="any")return k.assign("z.any()");if(!At)return k.assign("z.unknown()");throw new Error(`Unsupported schema type: ${At}`)}t(Wd,"getZodSchema");function jVt({schema:l,zodSchema:u,resolver:m,meta:b,tag:k}){if(!l_(l))return;let I=u.meta.referencedBy.slice(0,-1).map(ce=>ce.ref?m.getZodSchemaNameByRef(ce.ref)??ce.ref:void 0).filter(Boolean),R=m.getZodSchemaNameByRef(l.$ref);if(I.length>1&&I.includes(R))return u.assign(m.getCodeByZodSchemaName(u.ref));let Z=m.getCodeByZodSchemaName(l.$ref);if(!Z){let ce=m.getSchemaByRef(l.$ref);if(!ce)throw new Error(`Schema ${l.$ref} not found`);Z=Wd({schema:ce,resolver:m,meta:b,tag:k}).getCodeString(k,m.options)}return m.getCodeByZodSchemaName(R)||m.setZodSchema(R,Z,k),u}t(jVt,"getReferenceZodSchema");function BVt({schema:l,zodSchema:u,resolver:m,meta:b,tag:k}){var R;if(!Ym(l)||!l.oneOf)return;if(l.oneOf.length===1){let Z=Wd({schema:l.oneOf[0],resolver:m,meta:b,tag:k});return u.assign(Z.getCodeString(k,m.options))}let I=(R=l.oneOf)==null?void 0:R.some(Z=>Ym(Z)&&((Z==null?void 0:Z.allOf)||[]).length>1);if(l.discriminator&&!I){let Z=l.discriminator.propertyName;return u.assign(`
528
528
  z.discriminatedUnion("${Z}", [${l.oneOf.map(ce=>Wd({schema:ce,resolver:m,meta:b,tag:k}).getCodeString(k,m.options)).join(", ")}])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"