@povio/openapi-codegen-cli 0.13.3 → 0.13.4

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/README.md CHANGED
@@ -51,10 +51,10 @@ yarn openapi-codegen generate --input http://localhost:3001/docs-json --standalo
51
51
  --axiosRequestConfig Include Axios request config parameters in query hooks (default: false)
52
52
  --infiniteQueries Generate infinite queries for paginated API endpoints (default: false)
53
53
  --mutationEffects Add mutation effects options to mutation hooks (default: true)
54
- --parseRequestParams Add Zod parsing to API endpoints (default: false)
54
+ --parseRequestParams Add Zod parsing to API endpoints (default: true)
55
55
 
56
56
  --acl Generate ACL related files (default: true)
57
- --checkAcl Add ACL check to queries (default: false)
57
+ --checkAcl Add ACL check to queries (default: true)
58
58
 
59
59
  --standalone Generate any missing supporting classes/types, e.g., REST client class, React Query type extensions, etc. (default: false)
60
60
  --baseUrl (Requires `--standalone`) Base URL for the REST client; falls back to the OpenAPI spec if not provided
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ Expecting `+gn.join(", ")+", got '"+(this.terminals_[E]||E)+"'":lc="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(fq(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:vi,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 yi||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new yi(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 hd.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof yi)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 yi)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 yi)return n.value;if(!r){if(!this.stackSlot)throw new hd.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 yi?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=vi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();vi.isValidJavaScriptVariableName=function(e){return!vi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function fq(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(fq,"strictLookup");sc.default=vi;yP.exports=sc.default});var _P=h((ac,bP)=>{"use strict";ac.__esModule=!0;function Zo(e){return e&&e.__esModule?e:{default:e}}o(Zo,"_interopRequireDefault");var dq=P_(),mq=Zo(dq),hq=Zf(),gq=Zo(hq),gd=j_(),yd=L_(),yq=vP(),vq=Zo(yq),Sq=Ya(),bq=Zo(Sq),_q=Vf(),Pq=Zo(_q),Eq=mq.default.create;function SP(){var e=Eq();return e.compile=function(t,r){return yd.compile(t,r,e)},e.precompile=function(t,r){return yd.precompile(t,r,e)},e.AST=gq.default,e.Compiler=yd.Compiler,e.JavaScriptCompiler=vq.default,e.Parser=gd.parser,e.parse=gd.parse,e.parseWithoutProcessing=gd.parseWithoutProcessing,e}o(SP,"create");var Si=SP();Si.create=SP;Pq.default(Si);Si.Visitor=bq.default;Si.default=Si;ac.default=Si;bP.exports=ac.default});var PP=h(cc=>{"use strict";cc.__esModule=!0;cc.print=Aq;cc.PrintVisitor=Y;function $q(e){return e&&e.__esModule?e:{default:e}}o($q,"_interopRequireDefault");var Oq=Ya(),xq=$q(Oq);function Aq(e){return new Y().accept(e)}o(Aq,"print");function Y(){this.padding=0}o(Y,"PrintVisitor");Y.prototype=new xq.default;Y.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
72
- `,t};Y.prototype.Program=function(e){var t="",r=e.body,n=void 0,i=void 0;if(e.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=e.blockParams.length;n<i;n++)s+=" "+e.blockParams[n];s+=" ]",t+=this.pad(s)}for(n=0,i=r.length;n<i;n++)t+=this.accept(r[n]);return this.padding--,t};Y.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Y.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Y.prototype.BlockStatement=Y.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Y.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Y.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Y.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Y.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Y.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,i=0,s=t.length;i<s;i++)r.push(this.accept(t[i]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Y.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Y.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Y.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Y.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Y.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Y.prototype.NullLiteral=function(){return"NULL"};Y.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,i=t.length;n<i;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Y.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Qt=h((tB,OP)=>{var uc=_P().default,$P=PP();uc.PrintVisitor=$P.PrintVisitor;uc.print=$P.print;OP.exports=uc;function EP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=uc.compile(n)}o(EP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=EP,require.extensions[".hbs"]=EP)});var P3={};oE(P3,{getGenerateFilesData:()=>_3,getGenerateMetadata:()=>b3});module.exports=sE(P3);var _d=et(Yv());var fo="AppRestClient",Xs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},ef="src/data",tf="@/data",Yr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},mr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ea={bindings:[mr.ErrorHandler,mr.SharedErrorHandler],from:Yr.errorHandling.template},rf="AbilityContext",Jv={bindings:[rf],from:Yr.abilityContext.template};var ta={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},ra={fileName:"app-rest-client",extension:"ts"},nf="QueryModule",na={fileName:"queryModules",extension:"ts"},Xv={fileName:"queryConfig.context",extension:"tsx"},ti={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},ia={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},oa={fileName:"zod",extension:"ts"};var eS="Schema",tS="Enum",rS="Body",nS="Param",iS="Response",oS="ErrorResponse",mo="z.void()",sa="z.instanceof(Blob)",ho="z.enum",aa="z.string()",ri={bindings:["z"],from:"zod"};var go={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!1,standalone:!1,baseUrl:"",abilityContextImportPath:Yr.abilityContext.template,schemaSuffix:eS,enumSuffix:tS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:Yr.appRestClient.template,errorHandlingImportPath:Yr.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!1,queryTypesImportPath:Yr.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var ft={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},sS={bindings:[ft.query,ft.infiniteQuery,ft.mutation],from:"@tanstack/react-query"},yo={pageParamName:"page"},ca={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vo="moduleName";var of={"Content-Type":"application/json",Accept:"application/json"},ua="data",sf="axios",hr="config",xt="AxiosRequestConfig",la={defaultImport:sf,bindings:[xt],from:"axios"};var aS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function Oe(e){return!D(e)}o(Oe,"isSchemaObject");function pa(e){return e.type==="array"}o(pa,"isArraySchemaObject");function cS(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(tC(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(cS,"inferRequiredSchema");var tC=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Vt=Symbol.for("@ts-pattern/matcher"),rC=Symbol.for("@ts-pattern/isVariadic"),da="@ts-pattern/anonymous-select-key",af=o(e=>!!(e&&typeof e=="object"),"r"),fa=o(e=>e&&!!e[Vt],"i"),Tt=o((e,t,r)=>{if(fa(e)){let n=e[Vt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(af(e)){if(!af(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];fa(c)&&c[rC]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,f)=>Tt(l,a[f],r))&&i.every((l,f)=>Tt(l,c[f],r))&&(s.length===0||Tt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Tt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||fa(s=i)&&s[Vt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),br=o(e=>{var t,r,n;return af(e)?fa(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?bo(e,br):bo(Object.values(e),br):[]},"o"),bo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>nC(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>iC(e,t),"or"),select:o(t=>t===void 0?uS(e):uS(t,e),"select")})}o(Qe,"u");function nC(e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(br(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>br(e),"getSelectionKeys"),matcherType:"optional"})})}o(nC,"h");function z(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function iC(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return bo(e,br).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"or"})})}o(iC,"d");function L(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function uS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Vt]:()=>({match:o(n=>{let i={[t??da]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??da].concat(r===void 0?[]:br(r)),"getSelectionKeys")})})}o(uS,"y");function wt(e){return typeof e=="number"}o(wt,"v");function gr(e){return typeof e=="string"}o(gr,"b");function yr(e){return typeof e=="bigint"}o(yr,"w");var G8=Qe(L(function(e){return!0}));var vr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&!!n.match(r)))));var r},"regex")}),"j"),Z8=vr(L(gr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(z(e,((n,i)=>L(s=>wt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<r))(t))),"lt"),gt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>r))(t))),"gt"),lte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<=r))(t))),"lte"),gte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>=r))(t))),"gte"),int:o(()=>It(z(e,L(t=>wt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(z(e,L(t=>wt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(z(e,L(t=>wt(t)&&t>0))),"positive"),negative:o(()=>It(z(e,L(t=>wt(t)&&t<0))),"negative")}),"x"),z8=It(L(wt)),Sr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>Sr(z(e,((n,i)=>L(s=>yr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<r))(t))),"lt"),gt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>r))(t))),"gt"),lte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<=r))(t))),"lte"),gte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>=r))(t))),"gte"),positive:o(()=>Sr(z(e,L(t=>yr(t)&&t>0))),"positive"),negative:o(()=>Sr(z(e,L(t=>yr(t)&&t<0))),"negative")}),"A"),K8=Sr(L(yr)),Q8=Qe(L(function(e){return typeof e=="boolean"})),W8=Qe(L(function(e){return typeof e=="symbol"})),Y8=Qe(L(function(e){return e==null})),J8=Qe(L(function(e){return e!=null}));var pf=class pf 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(pf,"W");var cf=pf,uf={matched:!1,value:void 0};function Se(e){return new lf(e,uf)}o(Se,"z");var So=class So{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,f)=>{s=!0,a[l]=f},"a"),u=!n.some(l=>Tt(l,this.input,c))||i&&!i(this.input)?uf:{matched:!0,value:r(s?da in a?a[da]:a:this.input,this.input)};return new So(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new So(this.input,n?{matched:!0,value:r(this.input,this.input)}:uf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new cf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(So,"I");var lf=So;var ff=2,lS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pS=["query","header","path"],Jr=["get","put","post","delete","options","head","patch","trace"],fS=["string","number","integer","boolean"],ni=["allOf","anyOf","oneOf"];var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),_r=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),dS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ae=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),mS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),df=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),hS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),oC=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"),mf=o(e=>{let t=e.map(U).map(gS).map(r=>sC(r)).flat();return oC(t)},"getMostCommonAdjacentCombinationSplit"),gS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),yS=o(e=>gS(e).join(" "),"camelToSpaceSeparated"),sC=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"),vS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${_r(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Xr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ii=o(e=>Xr(e).split("/").at(-1),"getSchemaNameByRef");function gf(e){let t=aC(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ae(t)}o(gf,"normalizeString");function _S(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(_S,"wrapWithQuotesIfNeeded");function PS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(PS,"unwrapQuotesIfNeeded");function aC(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(aC,"prefixStringStartingWithNumberIfNeeded");function yf(e){let t=e.replaceAll("_","#");return ae(t.replaceAll("-","_")).replaceAll("#","_")}o(yf,"pathParamToVariableName");var Bt=o(e=>fS.includes(e),"isPrimitiveType");function ES(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(ES,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||lS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function _o(e){return e>=200&&e<300}o(_o,"isMainResponseStatus");function ma(e){return!(e>=200&&e<300)}o(ma,"isErrorStatus");function oi(e){return e.startsWith("application/")}o(oi,"isMediaTypeAllowed");var SS=/({\w+})/g,cC=/[^\w\-]+/g;function $S(e){e=U(dS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(SS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(SS,"")}By${U(r.slice(1,-1))}`}return e.replace(cC,"_")}o($S,"pathToVariableName");var hf=/{(\b\w+(?:-\w+)*\b)}/g;function OS(e){let t=e.match(hf);return t===null?e.replaceAll(hf,":$1"):(t.forEach(r=>{let n=yf(r.replaceAll(hf,":$1"));e=e.replaceAll(r,n)}),e)}o(OS,"replaceHyphenatedPath");var xS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Oe(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),en=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Rt(e){return mS(e)}o(Rt,"formatTag");function Pr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Rt(r??t.defaultTag)}o(Pr,"getOperationTag");function AS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(AS,"isTagExcluded");var ha={fileName:"acl/app.ability",extension:"ts"},Po="AllAbilities",Eo="AppAbilities",ga={fileName:"acl/useAclCheck",extension:"ts"},Er="useAclCheck",xe={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},vf={bindings:[xe.abilityTuple,xe.pureAbility,xe.forcedSubject,xe.subject],from:"@casl/ability"};var Fe=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Ae(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(ni.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&&Ae(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&&Ae(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Ae(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Ae(s,t)}}o(Ae,"iterateSchema");var Nt=o((e,t)=>df(U(gf(e)),t),"getZodSchemaName"),$o=o((e,t,r)=>df(U(gf(e)),`${t}${r}`),"getEnumZodSchemaName"),pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),wS=o(e=>e.startsWith(ho),"isEnumZodSchema"),tn=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),ya=o(e=>ae(`${e}_${rS}`),"getBodyZodSchemaName"),IS=o((e,t)=>ae(`${e}_${t}${nS}`),"getParamZodSchemaName"),uC=o(e=>ae(`${e}${iS}`),"getMainResponseZodSchemaName"),lC=o((e,t)=>ae(`${e}_${t}_${oS}`),"getErrorResponseZodSchemaName");function va({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=tn(t,r,n);return!_o(i)&&e!=="default"&&ma(i)?lC(s,e):uC(s)}o(va,"getResponseZodSchemaName");function Oo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(yS(i))}: \`${e[i]}\``],[])}o(Oo,"getSchemaDescriptions");var xo=o((e,t)=>hS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),TS=o((e,t)=>pe(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),$r=o((e,t,r)=>{if(!pe(t))return t===mo?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${xo(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function RS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(RS,"getZodSchemaType");function NS(e){if(e.schemaObj)return[e.schemaObj.description,...Oo(e.schemaObj).join(". ")].filter(Boolean)}o(NS,"getZodSchemaDescription");function CS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?$r(e,i,r):void 0}if(pa(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${$r(e,i,r)}[]`:void 0}if(ni.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return CS(e,i[0],r)}return t.type}o(CS,"getType");function kS(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,...Oo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:CS(e,c.schema,r)??"unknown",description:p.join(". ")})}return Ae(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);Ae(u,{data:{pathSegments:[]},onSchema:a})}}),Ae(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(kS,"getZodSchemaPropertyDescriptions");function Or({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Sf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Sf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>xo(u,e.options),"getEntityName"),options:e.options});return pC(e.options,a,c)}o(Or,"getModelsImports");function jS({tag:e,endpoints:t,options:r}){return Sf({type:"endpoints",tag:e,entities:t,getTag:o(n=>wo(n,r),"getTag"),getEntityName:Ao,options:r})}o(jS,"getEndpointsImports");function qS({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?G({type:n,tag:a,options:i}):c],from:`${Ut(i)}${rn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(qS,"getEntityImports");function Ut(e){let t=tf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${ef}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${ef}`,"g"),tf)),`${t}/`.replace(/\/\//g,"/")}o(Ut,"getImportPath");function Sf({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?G({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Ut(s)}${rn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Sf,"getImports");function pC(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Fe(n.bindings)}))}o(pC,"mergeImports");function nn({fileName:e,extension:t}){return`${e}.${t}`}o(nn,"getFileNameWithExtension");function MS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${_r(t)}/`:""}${_r(t)}.${i}`:i}o(MS,"getTagFileNameWithoutExtension");function rn(...e){return MS(...e)}o(rn,"getTagImportPath");function DS(...e){return`${MS(...e)}.ts`}o(DS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function LS(e){return e.standalone?`${Ut(e)}${ra.fileName}`:e.restClientImportPath}o(LS,"getAppRestClientImportPath");function FS(e){return e.standalone?`${Ut(e)}${ta.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(FS,"getQueryTypesImportPath");function HS(e){return`${Ut(e)}${na.fileName}`}o(HS,"getQueryModulesImportPath");function VS(e){return`${Ut(e)}${ia.fileName}`}o(VS,"getMutationEffectsImportPath");function BS(e){return`${Ut(e)}${ga.fileName}`}o(BS,"getAclCheckImportPath");function US(e){return`${Ut(e)}${oa.fileName}`}o(US,"getZodExtendedImportPath");function GS(){return`./${ha.fileName}`}o(GS,"getAppAbilitiesImportPath");function Sa(e){return Se(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(Sa,"primitiveTypeToTsType");function si({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&pe(e)?(n=$r(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Bt(t==null?void 0:t.type)&&(n=Sa(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:rn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(si,"getTsTypeBase");function on({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of ni){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return on({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:ZS({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:fC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(on,"getSchemaTsMetaType");function ZS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=si({zodSchemaName:n,schema:i,resolver:r}),a=zS(s,t),c=on({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(ZS,"getArraySchemaTsType");function fC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=si({zodSchemaName:c,schema:u,resolver:r}),f=zS(l,t),p=on({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=ZS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Bt(i.type))return{name:n,isRequired:s,type:Sa(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(fC,"getSchemaTsProperties");function zS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(zS,"getIsCircular");var Ao=o(e=>_r(ae(e.operationName)),"getEndpointName");function KS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:wo(e,t),options:t})}.`:""}${Ao(e)}`}o(KS,"getImportedEndpointName");var QS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function wo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Rt(r??t.defaultTag)}o(wo,"getEndpointTag");function xr(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(pe(i.zodSchema))s=$r(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Oe(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Bt(f)&&(s=Sa(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==ua)&&(!(r!=null&&r.excludePageParam)||i.name!==yo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===yo.pageParamName?"pageParam":i.name}))}o(xr,"mapEndpointParamsToFunctionParams");function WS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=aS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==of["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==of.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(WS,"getEndpointConfig");function YS(e,t){return t.filter(r=>we(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(YS,"getUpdateQueryEndpoints");var we=o(e=>e.method==="get","isQuery"),Ct=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ai=o((e,t)=>we(e)&&(t??Object.values(yo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),JS=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...xr(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return xr(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var ba=o((e,t)=>{let r=we(e)&&Ct(e)&&t;return`use${U(ae(e.operationName))}${r?"Mutation":""}`},"getQueryName"),XS=o(e=>`use${U(ae(e.operationName))}Infinite`,"getInfiniteQueryName");var bf=["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 sn(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(sn,"pick");function ci(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Pr(e,t),i=AS(n,t);return r||i}o(ci,"isOperationExcluded");function _f({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${$S(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:U(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=vS(u,i);l===""?u=t.toLowerCase():bf.includes(l)||(u=l)}return bf.includes(u)?c:u}o(_f,"getOperationName");function Io({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Pr(r,n):n.defaultTag,s=o(a=>{let c=_f({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>_f({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??_f({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Io,"getUniqueOperationName");function eb(e,t,r){let n=[];for(let i in e.paths){if(en(i,r))continue;let s=e.paths[i],a=sn(s,Jr);for(let c in a){let u=a[c];if(!u||ci(u,r))continue;let l=Io({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(eb,"getUniqueOperationNamesWithoutSplitByTags");function tb(e,t){let r={};for(let n in e.paths){if(en(n,t))continue;let i=e.paths[n],s=sn(i,Jr);for(let a in s){let c=s[a];if(!c||ci(c,t))continue;let u=t.splitByTags?Pr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(tb,"getOperationsByTag");var rb={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 To(e){return{type:"invalid-schema",message:e}}o(To,"getInvalidSchemaError");function nb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nb,"getInvalidOperationIdError");function ib(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ib,"getMissingPathParameterError");function ob(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ob,"getNotAllowedInlineEnumError");function sb(e){return{type:"not-allowed-circular-schema",message:e}}o(sb,"getNotAllowedCircularSchemaError");function ab(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Pa(t,r)}`}}o(ab,"getMissingAclConditionPropertyError");function Pf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${_a(e)} in operation ${Pa(t,r)}`}}o(Pf,"getMissingStatusCodeError");function cb(e,t,r){return{type:"invalid-status-code",message:`Operation ${Pa(t,r)} expected HTTP status code ${_a(e.expected)} but received ${_a(e.received)}`}}o(cb,"getInvalidStatusCodeError");function ub(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Pa(t,r)} has multiple success HTTP status codes: ${e.map(_a).join(", ")}`}}o(ub,"getMultipleSuccessStatusCodesError");function Pa(e,t){return e.operationId??`${t.method} ${t.path}`}o(Pa,"getOperationDescriptor");function _a(e){return`${e} (${rb[e]})`}o(_a,"getStatusCodeDescription");function kt({schema:e,meta:t,options:r}){let n=[];Se(e.type).with("string",()=>n.push(hC(e,r))).with("number","integer",()=>n.push(yC(e))).with("array",()=>n.push(vC(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
72
+ `,t};Y.prototype.Program=function(e){var t="",r=e.body,n=void 0,i=void 0;if(e.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=e.blockParams.length;n<i;n++)s+=" "+e.blockParams[n];s+=" ]",t+=this.pad(s)}for(n=0,i=r.length;n<i;n++)t+=this.accept(r[n]);return this.padding--,t};Y.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Y.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Y.prototype.BlockStatement=Y.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Y.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Y.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Y.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Y.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Y.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,i=0,s=t.length;i<s;i++)r.push(this.accept(t[i]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Y.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Y.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Y.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Y.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Y.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Y.prototype.NullLiteral=function(){return"NULL"};Y.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,i=t.length;n<i;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Y.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Qt=h((tB,OP)=>{var uc=_P().default,$P=PP();uc.PrintVisitor=$P.PrintVisitor;uc.print=$P.print;OP.exports=uc;function EP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=uc.compile(n)}o(EP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=EP,require.extensions[".hbs"]=EP)});var P3={};oE(P3,{getGenerateFilesData:()=>_3,getGenerateMetadata:()=>b3});module.exports=sE(P3);var _d=et(Yv());var fo="AppRestClient",Xs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},ef="src/data",tf="@/data",Yr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},mr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ea={bindings:[mr.ErrorHandler,mr.SharedErrorHandler],from:Yr.errorHandling.template},rf="AbilityContext",Jv={bindings:[rf],from:Yr.abilityContext.template};var ta={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},ra={fileName:"app-rest-client",extension:"ts"},nf="QueryModule",na={fileName:"queryModules",extension:"ts"},Xv={fileName:"queryConfig.context",extension:"tsx"},ti={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},ia={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},oa={fileName:"zod",extension:"ts"};var eS="Schema",tS="Enum",rS="Body",nS="Param",iS="Response",oS="ErrorResponse",mo="z.void()",sa="z.instanceof(Blob)",ho="z.enum",aa="z.string()",ri={bindings:["z"],from:"zod"};var go={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!0,standalone:!1,baseUrl:"",abilityContextImportPath:Yr.abilityContext.template,schemaSuffix:eS,enumSuffix:tS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:Yr.appRestClient.template,errorHandlingImportPath:Yr.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:Yr.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var ft={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},sS={bindings:[ft.query,ft.infiniteQuery,ft.mutation],from:"@tanstack/react-query"},yo={pageParamName:"page"},ca={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vo="moduleName";var of={"Content-Type":"application/json",Accept:"application/json"},ua="data",sf="axios",hr="config",xt="AxiosRequestConfig",la={defaultImport:sf,bindings:[xt],from:"axios"};var aS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function Oe(e){return!D(e)}o(Oe,"isSchemaObject");function pa(e){return e.type==="array"}o(pa,"isArraySchemaObject");function cS(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(tC(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(cS,"inferRequiredSchema");var tC=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Vt=Symbol.for("@ts-pattern/matcher"),rC=Symbol.for("@ts-pattern/isVariadic"),da="@ts-pattern/anonymous-select-key",af=o(e=>!!(e&&typeof e=="object"),"r"),fa=o(e=>e&&!!e[Vt],"i"),Tt=o((e,t,r)=>{if(fa(e)){let n=e[Vt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(af(e)){if(!af(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];fa(c)&&c[rC]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,f)=>Tt(l,a[f],r))&&i.every((l,f)=>Tt(l,c[f],r))&&(s.length===0||Tt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Tt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||fa(s=i)&&s[Vt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),br=o(e=>{var t,r,n;return af(e)?fa(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?bo(e,br):bo(Object.values(e),br):[]},"o"),bo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>nC(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>iC(e,t),"or"),select:o(t=>t===void 0?uS(e):uS(t,e),"select")})}o(Qe,"u");function nC(e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(br(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>br(e),"getSelectionKeys"),matcherType:"optional"})})}o(nC,"h");function z(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function iC(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return bo(e,br).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"or"})})}o(iC,"d");function L(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function uS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Vt]:()=>({match:o(n=>{let i={[t??da]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??da].concat(r===void 0?[]:br(r)),"getSelectionKeys")})})}o(uS,"y");function wt(e){return typeof e=="number"}o(wt,"v");function gr(e){return typeof e=="string"}o(gr,"b");function yr(e){return typeof e=="bigint"}o(yr,"w");var G8=Qe(L(function(e){return!0}));var vr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&!!n.match(r)))));var r},"regex")}),"j"),Z8=vr(L(gr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(z(e,((n,i)=>L(s=>wt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<r))(t))),"lt"),gt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>r))(t))),"gt"),lte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<=r))(t))),"lte"),gte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>=r))(t))),"gte"),int:o(()=>It(z(e,L(t=>wt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(z(e,L(t=>wt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(z(e,L(t=>wt(t)&&t>0))),"positive"),negative:o(()=>It(z(e,L(t=>wt(t)&&t<0))),"negative")}),"x"),z8=It(L(wt)),Sr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>Sr(z(e,((n,i)=>L(s=>yr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<r))(t))),"lt"),gt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>r))(t))),"gt"),lte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<=r))(t))),"lte"),gte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>=r))(t))),"gte"),positive:o(()=>Sr(z(e,L(t=>yr(t)&&t>0))),"positive"),negative:o(()=>Sr(z(e,L(t=>yr(t)&&t<0))),"negative")}),"A"),K8=Sr(L(yr)),Q8=Qe(L(function(e){return typeof e=="boolean"})),W8=Qe(L(function(e){return typeof e=="symbol"})),Y8=Qe(L(function(e){return e==null})),J8=Qe(L(function(e){return e!=null}));var pf=class pf 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(pf,"W");var cf=pf,uf={matched:!1,value:void 0};function Se(e){return new lf(e,uf)}o(Se,"z");var So=class So{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,f)=>{s=!0,a[l]=f},"a"),u=!n.some(l=>Tt(l,this.input,c))||i&&!i(this.input)?uf:{matched:!0,value:r(s?da in a?a[da]:a:this.input,this.input)};return new So(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new So(this.input,n?{matched:!0,value:r(this.input,this.input)}:uf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new cf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(So,"I");var lf=So;var ff=2,lS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pS=["query","header","path"],Jr=["get","put","post","delete","options","head","patch","trace"],fS=["string","number","integer","boolean"],ni=["allOf","anyOf","oneOf"];var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),_r=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),dS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ae=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),mS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),df=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),hS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),oC=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"),mf=o(e=>{let t=e.map(U).map(gS).map(r=>sC(r)).flat();return oC(t)},"getMostCommonAdjacentCombinationSplit"),gS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),yS=o(e=>gS(e).join(" "),"camelToSpaceSeparated"),sC=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"),vS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${_r(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Xr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ii=o(e=>Xr(e).split("/").at(-1),"getSchemaNameByRef");function gf(e){let t=aC(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ae(t)}o(gf,"normalizeString");function _S(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(_S,"wrapWithQuotesIfNeeded");function PS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(PS,"unwrapQuotesIfNeeded");function aC(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(aC,"prefixStringStartingWithNumberIfNeeded");function yf(e){let t=e.replaceAll("_","#");return ae(t.replaceAll("-","_")).replaceAll("#","_")}o(yf,"pathParamToVariableName");var Bt=o(e=>fS.includes(e),"isPrimitiveType");function ES(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(ES,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||lS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function _o(e){return e>=200&&e<300}o(_o,"isMainResponseStatus");function ma(e){return!(e>=200&&e<300)}o(ma,"isErrorStatus");function oi(e){return e.startsWith("application/")}o(oi,"isMediaTypeAllowed");var SS=/({\w+})/g,cC=/[^\w\-]+/g;function $S(e){e=U(dS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(SS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(SS,"")}By${U(r.slice(1,-1))}`}return e.replace(cC,"_")}o($S,"pathToVariableName");var hf=/{(\b\w+(?:-\w+)*\b)}/g;function OS(e){let t=e.match(hf);return t===null?e.replaceAll(hf,":$1"):(t.forEach(r=>{let n=yf(r.replaceAll(hf,":$1"));e=e.replaceAll(r,n)}),e)}o(OS,"replaceHyphenatedPath");var xS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Oe(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),en=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Rt(e){return mS(e)}o(Rt,"formatTag");function Pr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Rt(r??t.defaultTag)}o(Pr,"getOperationTag");function AS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(AS,"isTagExcluded");var ha={fileName:"acl/app.ability",extension:"ts"},Po="AllAbilities",Eo="AppAbilities",ga={fileName:"acl/useAclCheck",extension:"ts"},Er="useAclCheck",xe={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},vf={bindings:[xe.abilityTuple,xe.pureAbility,xe.forcedSubject,xe.subject],from:"@casl/ability"};var Fe=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Ae(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(ni.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&&Ae(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&&Ae(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Ae(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Ae(s,t)}}o(Ae,"iterateSchema");var Nt=o((e,t)=>df(U(gf(e)),t),"getZodSchemaName"),$o=o((e,t,r)=>df(U(gf(e)),`${t}${r}`),"getEnumZodSchemaName"),pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),wS=o(e=>e.startsWith(ho),"isEnumZodSchema"),tn=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),ya=o(e=>ae(`${e}_${rS}`),"getBodyZodSchemaName"),IS=o((e,t)=>ae(`${e}_${t}${nS}`),"getParamZodSchemaName"),uC=o(e=>ae(`${e}${iS}`),"getMainResponseZodSchemaName"),lC=o((e,t)=>ae(`${e}_${t}_${oS}`),"getErrorResponseZodSchemaName");function va({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=tn(t,r,n);return!_o(i)&&e!=="default"&&ma(i)?lC(s,e):uC(s)}o(va,"getResponseZodSchemaName");function Oo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(yS(i))}: \`${e[i]}\``],[])}o(Oo,"getSchemaDescriptions");var xo=o((e,t)=>hS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),TS=o((e,t)=>pe(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),$r=o((e,t,r)=>{if(!pe(t))return t===mo?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${xo(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function RS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(RS,"getZodSchemaType");function NS(e){if(e.schemaObj)return[e.schemaObj.description,...Oo(e.schemaObj).join(". ")].filter(Boolean)}o(NS,"getZodSchemaDescription");function CS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?$r(e,i,r):void 0}if(pa(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${$r(e,i,r)}[]`:void 0}if(ni.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return CS(e,i[0],r)}return t.type}o(CS,"getType");function kS(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,...Oo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:CS(e,c.schema,r)??"unknown",description:p.join(". ")})}return Ae(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);Ae(u,{data:{pathSegments:[]},onSchema:a})}}),Ae(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(kS,"getZodSchemaPropertyDescriptions");function Or({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Sf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Sf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>xo(u,e.options),"getEntityName"),options:e.options});return pC(e.options,a,c)}o(Or,"getModelsImports");function jS({tag:e,endpoints:t,options:r}){return Sf({type:"endpoints",tag:e,entities:t,getTag:o(n=>wo(n,r),"getTag"),getEntityName:Ao,options:r})}o(jS,"getEndpointsImports");function qS({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?G({type:n,tag:a,options:i}):c],from:`${Ut(i)}${rn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(qS,"getEntityImports");function Ut(e){let t=tf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${ef}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${ef}`,"g"),tf)),`${t}/`.replace(/\/\//g,"/")}o(Ut,"getImportPath");function Sf({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?G({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Ut(s)}${rn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Sf,"getImports");function pC(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Fe(n.bindings)}))}o(pC,"mergeImports");function nn({fileName:e,extension:t}){return`${e}.${t}`}o(nn,"getFileNameWithExtension");function MS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${_r(t)}/`:""}${_r(t)}.${i}`:i}o(MS,"getTagFileNameWithoutExtension");function rn(...e){return MS(...e)}o(rn,"getTagImportPath");function DS(...e){return`${MS(...e)}.ts`}o(DS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function LS(e){return e.standalone?`${Ut(e)}${ra.fileName}`:e.restClientImportPath}o(LS,"getAppRestClientImportPath");function FS(e){return e.standalone?`${Ut(e)}${ta.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(FS,"getQueryTypesImportPath");function HS(e){return`${Ut(e)}${na.fileName}`}o(HS,"getQueryModulesImportPath");function VS(e){return`${Ut(e)}${ia.fileName}`}o(VS,"getMutationEffectsImportPath");function BS(e){return`${Ut(e)}${ga.fileName}`}o(BS,"getAclCheckImportPath");function US(e){return`${Ut(e)}${oa.fileName}`}o(US,"getZodExtendedImportPath");function GS(){return`./${ha.fileName}`}o(GS,"getAppAbilitiesImportPath");function Sa(e){return Se(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(Sa,"primitiveTypeToTsType");function si({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&pe(e)?(n=$r(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Bt(t==null?void 0:t.type)&&(n=Sa(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:rn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(si,"getTsTypeBase");function on({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of ni){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return on({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:ZS({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:fC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(on,"getSchemaTsMetaType");function ZS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=si({zodSchemaName:n,schema:i,resolver:r}),a=zS(s,t),c=on({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(ZS,"getArraySchemaTsType");function fC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=si({zodSchemaName:c,schema:u,resolver:r}),f=zS(l,t),p=on({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=ZS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Bt(i.type))return{name:n,isRequired:s,type:Sa(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(fC,"getSchemaTsProperties");function zS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(zS,"getIsCircular");var Ao=o(e=>_r(ae(e.operationName)),"getEndpointName");function KS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:wo(e,t),options:t})}.`:""}${Ao(e)}`}o(KS,"getImportedEndpointName");var QS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function wo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Rt(r??t.defaultTag)}o(wo,"getEndpointTag");function xr(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(pe(i.zodSchema))s=$r(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Oe(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Bt(f)&&(s=Sa(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==ua)&&(!(r!=null&&r.excludePageParam)||i.name!==yo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===yo.pageParamName?"pageParam":i.name}))}o(xr,"mapEndpointParamsToFunctionParams");function WS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=aS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==of["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==of.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(WS,"getEndpointConfig");function YS(e,t){return t.filter(r=>we(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(YS,"getUpdateQueryEndpoints");var we=o(e=>e.method==="get","isQuery"),Ct=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ai=o((e,t)=>we(e)&&(t??Object.values(yo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),JS=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...xr(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return xr(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var ba=o((e,t)=>{let r=we(e)&&Ct(e)&&t;return`use${U(ae(e.operationName))}${r?"Mutation":""}`},"getQueryName"),XS=o(e=>`use${U(ae(e.operationName))}Infinite`,"getInfiniteQueryName");var bf=["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 sn(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(sn,"pick");function ci(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Pr(e,t),i=AS(n,t);return r||i}o(ci,"isOperationExcluded");function _f({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${$S(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:U(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=vS(u,i);l===""?u=t.toLowerCase():bf.includes(l)||(u=l)}return bf.includes(u)?c:u}o(_f,"getOperationName");function Io({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Pr(r,n):n.defaultTag,s=o(a=>{let c=_f({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>_f({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??_f({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Io,"getUniqueOperationName");function eb(e,t,r){let n=[];for(let i in e.paths){if(en(i,r))continue;let s=e.paths[i],a=sn(s,Jr);for(let c in a){let u=a[c];if(!u||ci(u,r))continue;let l=Io({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(eb,"getUniqueOperationNamesWithoutSplitByTags");function tb(e,t){let r={};for(let n in e.paths){if(en(n,t))continue;let i=e.paths[n],s=sn(i,Jr);for(let a in s){let c=s[a];if(!c||ci(c,t))continue;let u=t.splitByTags?Pr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(tb,"getOperationsByTag");var rb={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 To(e){return{type:"invalid-schema",message:e}}o(To,"getInvalidSchemaError");function nb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nb,"getInvalidOperationIdError");function ib(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ib,"getMissingPathParameterError");function ob(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ob,"getNotAllowedInlineEnumError");function sb(e){return{type:"not-allowed-circular-schema",message:e}}o(sb,"getNotAllowedCircularSchemaError");function ab(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Pa(t,r)}`}}o(ab,"getMissingAclConditionPropertyError");function Pf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${_a(e)} in operation ${Pa(t,r)}`}}o(Pf,"getMissingStatusCodeError");function cb(e,t,r){return{type:"invalid-status-code",message:`Operation ${Pa(t,r)} expected HTTP status code ${_a(e.expected)} but received ${_a(e.received)}`}}o(cb,"getInvalidStatusCodeError");function ub(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Pa(t,r)} has multiple success HTTP status codes: ${e.map(_a).join(", ")}`}}o(ub,"getMultipleSuccessStatusCodesError");function Pa(e,t){return e.operationId??`${t.method} ${t.path}`}o(Pa,"getOperationDescriptor");function _a(e){return`${e} (${rb[e]})`}o(_a,"getStatusCodeDescription");function kt({schema:e,meta:t,options:r}){let n=[];Se(e.type).with("string",()=>n.push(hC(e,r))).with("number","integer",()=>n.push(yC(e))).with("array",()=>n.push(vC(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(dC({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?mC(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(kt,"getZodChain");function dC({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(dC,"getZodChainablePresence");function mC(e){return e.default!==void 0?`default(${Se(e.type).with("number","integer",()=>PS(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(mC,"getZodChainableDefault");function hC(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${gC(e.pattern)})`),e.format){let n=Se(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(hC,"getZodChainableStringValidations");function gC(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=ES(e),`/${e}/`}o(gC,"formatPatternIfNeeded");function yC(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(yC,"getZodChainableNumberValidations");function vC(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(vC,"getZodChainableArrayValidations");var an=o(e=>e.reduce((t,r)=>t+r,0),"sum");function ce(e,t){if(!t)return e;if(D(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?He("oneOf")+ce(e,{...t,type:t.type[0]}):e+He("oneOf")+an(t.type.map(r=>ce(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?He("oneOf")+ce(e,t.oneOf[0]):e+He("oneOf")+an(t.oneOf.map(r=>ce(0,r)));if(t.anyOf)return t.anyOf.length===1?He("anyOf")+ce(e,t.anyOf[0]):e+He("anyOf")+an(t.anyOf.map(r=>ce(0,r)));if(t.allOf)return t.allOf.length===1?He("allOf")+ce(e,t.allOf[0]):e+He("allOf")+an(t.allOf.map(r=>ce(0,r)));if(!t.type)return e;if(Bt(t.type))return t.enum?e+lb(t)+He("enum")+an(t.enum.map(r=>ce(0,r))):e+lb(t);if(t.type==="array")return t.items?He("array")+ce(e,t.items):He("array")+ce(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=He("object")+an(r.map(n=>ce(0,n)))}else e+=He("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=ce(0,t.additionalProperties):e+=ce(1))}return e}o(ce,"getOpenAPISchemaComplexity");function lb(e){return Se(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(lb,"complexityByType");function He(e){return Se(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(He,"complexityByComposite");var Ef=class Ef{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;D(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${G({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return ce(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Ef,"ZodSchema");var Ro=Ef;function W({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new Ro(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(D(e))return SC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=_C({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=bC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=PC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=EC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=$C({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(pa(e))return e.items?i.assign(`z.array(${W({...a,schema:e.items}).getCodeString(n,t.options)}${kt({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let m=e.type?e.type.toLowerCase():void 0;if(m==="object"||e.properties||e.additionalProperties){let y=e.required&&e.required.length>0,v=t.options.withImplicitRequiredProps?!1:e.properties&&!((g=e.required)!=null&&g.length),S="{}";e.properties&&(S="{ "+Object.entries(e.properties).map(([T,R])=>{var re;let K={...s,isRequired:v?!0:y?(re=e.required)==null?void 0:re.includes(T):t.options.withImplicitRequiredProps,name:T,isParentPartial:v},oe=R;if(D(R)&&t&&(oe=t.getSchemaByRef(R.$ref),!oe))throw new Error(`Schema ${R.$ref} not found`);let X=W({...a,schema:R,meta:K}).getCodeString(n,t.options)+kt({schema:oe,meta:K,options:t.options});return[T,X]}).map(([T,R])=>`${_S(T)}: ${R}`).join(", ")+" }");let b="";e.additionalProperties&&(b=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?W({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+kt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let P=v?".partial()":"",E=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${S})${P}${E}${b}${d}`)}if(m==="any")return i.assign("z.any()");if(!m)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${m}`)}o(W,"getZodSchema");function SC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!D(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=W({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(SC,"getReferenceZodSchema");function bC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Oe(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=W({schema:e.oneOf[0],resolver:r,meta:n,tag:i});return t.assign(c.getCodeString(i,r.options))}let s=(a=e.oneOf)==null?void 0:a.some(c=>Oe(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
75
75
  z.discriminatedUnion("${c}", [${e.oneOf.map(u=>W({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
package/dist/sh.js CHANGED
@@ -133,11 +133,11 @@ ${y.join(`
133
133
  `;d.forEach(y=>{h+=y}),t.fail(h)}},"implications");let u={};s.conflicts=o(function(f,d){F("<string|object> [array|string]",[f,d],arguments.length),typeof f=="object"?Object.keys(f).forEach(h=>{s.conflicts(h,f[h])}):(e.global(f),u[f]||(u[f]=[]),Array.isArray(d)?d.forEach(h=>s.conflicts(f,h)):u[f].push(d))},"conflicts"),s.getConflicting=()=>u,s.conflicting=o(function(f){Object.keys(f).forEach(d=>{u[d]&&u[d].forEach(h=>{h&&f[d]!==void 0&&f[h]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",d,h))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(d=>{u[d].forEach(h=>{h&&f[r.Parser.camelCase(d)]!==void 0&&f[r.Parser.camelCase(h)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",d,h))})})},"conflictingFn"),s.recommendCommands=o(function(f,d){d=d.sort((g,P)=>P.length-g.length);let y=null,b=1/0;for(let g=0,P;(P=d[g])!==void 0;g++){let $=Ry(f,P);$<=3&&$<b&&(b=$,y=P)}y&&t.fail(n("Did you mean %s?",y))},"recommendCommands"),s.reset=o(function(f){return a=$n(a,d=>!f[d]),u=$n(u,d=>!f[d]),s},"reset");let l=[];return s.freeze=o(function(){l.push({implied:a,conflicting:u})},"freeze"),s.unfreeze=o(function(){let f=l.pop();At(f,void 0,r),{implied:a,conflicting:u}=f},"unfreeze"),s}o(jy,"validation");var _f=[],xs;function $s(e,t,r,n){xs=n;let i={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return i;let s=/\.json|\..*rc$/.test(e.extends),a=null;if(s)a=H$(t,e.extends);else try{a=require.resolve(e.extends)}catch{return e}F$(a),_f.push(a),i=s?JSON.parse(xs.readFileSync(a,"utf8")):require(e.extends),delete e.extends,i=$s(i,xs.path.dirname(a),r,xs)}return _f=[],r?My(i,e):Object.assign({},i,e)}o($s,"applyExtends");function F$(e){if(_f.indexOf(e)>-1)throw new qe(`Circular extended configurations: '${e}'.`)}o(F$,"checkForCircularExtends");function H$(e,t){return xs.path.resolve(e,t)}o(H$,"getPathToDefaultConfig");function My(e,t){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}o(n,"isObject"),Object.assign(r,e);for(let i of Object.keys(t))n(t[i])&&n(r[i])?r[i]=My(e[i],t[i]):r[i]=t[i];return r}o(My,"mergeDeep");var B=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},m=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},tt,mi,ws,or,zt,yc,An,gi,bc,sr,vc,ar,Fr,Zt,cr,_c,ho,lt,Z,Sc,Ec,Wt,yi,mo,bi,In,Oc,ie,vi,_i,Si,se,Pc,Hr,Ke;function tb(e){return(t=[],r=e.process.cwd(),n)=>{let i=new Tf(t,r,n,e);return Object.defineProperty(i,"argv",{get:o(()=>i.parse(),"get"),enumerable:!0}),i.help(),i.version(),i}}o(tb,"YargsFactory");var ky=Symbol("copyDoubleDash"),qy=Symbol("copyDoubleDash"),Sf=Symbol("deleteFromParserHintObject"),Dy=Symbol("emitWarning"),Ly=Symbol("freeze"),Fy=Symbol("getDollarZero"),Ei=Symbol("getParserConfiguration"),Hy=Symbol("getUsageConfiguration"),Ef=Symbol("guessLocale"),By=Symbol("guessVersion"),Vy=Symbol("parsePositionalNumbers"),Of=Symbol("pkgUp"),Cn=Symbol("populateParserHintArray"),go=Symbol("populateParserHintSingleValueDictionary"),Pf=Symbol("populateParserHintArrayDictionary"),xf=Symbol("populateParserHintDictionary"),$f=Symbol("sanitizeKey"),wf=Symbol("setKey"),Af=Symbol("unfreeze"),Uy=Symbol("validateAsync"),Gy=Symbol("getCommandInstance"),zy=Symbol("getContext"),Zy=Symbol("getHasOutput"),Wy=Symbol("getLoggerInstance"),Ky=Symbol("getParseContext"),Yy=Symbol("getUsageInstance"),Qy=Symbol("getValidationInstance"),xc=Symbol("hasParseCallback"),Jy=Symbol("isGlobalContext"),Oi=Symbol("postProcess"),Xy=Symbol("rebase"),If=Symbol("reset"),As=Symbol("runYargsParserAndExecuteCommands"),Cf=Symbol("runValidation"),eb=Symbol("setHasOutput"),Pi=Symbol("kTrackManuallySetKeys"),Rf=class Rf{constructor(t=[],r,n,i){this.customScriptName=!1,this.parsed=!1,tt.set(this,void 0),mi.set(this,void 0),ws.set(this,{commands:[],fullCommands:[]}),or.set(this,null),zt.set(this,null),yc.set(this,"show-hidden"),An.set(this,null),gi.set(this,!0),bc.set(this,{}),sr.set(this,!0),vc.set(this,[]),ar.set(this,void 0),Fr.set(this,{}),Zt.set(this,!1),cr.set(this,null),_c.set(this,!0),ho.set(this,void 0),lt.set(this,""),Z.set(this,void 0),Sc.set(this,void 0),Ec.set(this,{}),Wt.set(this,null),yi.set(this,null),mo.set(this,{}),bi.set(this,{}),In.set(this,void 0),Oc.set(this,!1),ie.set(this,void 0),vi.set(this,!1),_i.set(this,!1),Si.set(this,!1),se.set(this,void 0),Pc.set(this,{}),Hr.set(this,null),Ke.set(this,void 0),B(this,ie,i,"f"),B(this,In,t,"f"),B(this,mi,r,"f"),B(this,Sc,n,"f"),B(this,ar,new hc(this),"f"),this.$0=this[Fy](),this[If](),B(this,tt,m(this,tt,"f"),"f"),B(this,se,m(this,se,"f"),"f"),B(this,Ke,m(this,Ke,"f"),"f"),B(this,Z,m(this,Z,"f"),"f"),m(this,Z,"f").showHiddenOpt=m(this,yc,"f"),B(this,ho,this[qy](),"f")}addHelpOpt(t,r){let n="help";return F("[string|boolean] [string]",[t,r],arguments.length),m(this,cr,"f")&&(this[Sf](m(this,cr,"f")),B(this,cr,null,"f")),t===!1&&r===void 0?this:(B(this,cr,typeof t=="string"?t:n,"f"),this.boolean(m(this,cr,"f")),this.describe(m(this,cr,"f"),r||m(this,se,"f").deferY18nLookup("Show help")),this)}help(t,r){return this.addHelpOpt(t,r)}addShowHiddenOpt(t,r){if(F("[string|boolean] [string]",[t,r],arguments.length),t===!1&&r===void 0)return this;let n=typeof t=="string"?t:m(this,yc,"f");return this.boolean(n),this.describe(n,r||m(this,se,"f").deferY18nLookup("Show hidden options")),m(this,Z,"f").showHiddenOpt=n,this}showHidden(t,r){return this.addShowHiddenOpt(t,r)}alias(t,r){return F("<object|string|array> [string|array]",[t,r],arguments.length),this[Pf](this.alias.bind(this),"alias",t,r),this}array(t){return F("<array|string>",[t],arguments.length),this[Cn]("array",t),this[Pi](t),this}boolean(t){return F("<array|string>",[t],arguments.length),this[Cn]("boolean",t),this[Pi](t),this}check(t,r){return F("<function> [boolean]",[t,r],arguments.length),this.middleware((n,i)=>hi(()=>t(n,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&m(this,se,"f").fail(s.toString(),s):m(this,se,"f").fail(m(this,ie,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(m(this,se,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(t,r){return F("<object|string|array> [string|array]",[t,r],arguments.length),this[Pf](this.choices.bind(this),"choices",t,r),this}coerce(t,r){if(F("<object|string|array> [function]",[t,r],arguments.length),Array.isArray(t)){if(!r)throw new qe("coerce callback must be provided");for(let n of t)this.coerce(n,r);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!r)throw new qe("coerce callback must be provided");return m(this,Z,"f").key[t]=!0,m(this,ar,"f").addCoerceMiddleware((n,i)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?hi(()=>(s=i.getAliases(),r(n[t])),c=>{n[t]=c;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&u!==!0)for(let l of s[t])n[l]=c;return n},c=>{throw new qe(c.message)}):n},t),this}conflicts(t,r){return F("<string|object> [string|array]",[t,r],arguments.length),m(this,Ke,"f").conflicts(t,r),this}config(t="config",r,n){return F("[object|string] [string|function] [function]",[t,r,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=$s(t,m(this,mi,"f"),this[Ei]()["deep-merge-config"]||!1,m(this,ie,"f")),m(this,Z,"f").configObjects=(m(this,Z,"f").configObjects||[]).concat(t),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(t,r||m(this,se,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{m(this,Z,"f").config[i]=n||!0}),this)}completion(t,r,n){return F("[string] [string|boolean|function] [function]",[t,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),B(this,zt,t||m(this,zt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(m(this,zt,"f"),r),n&&m(this,or,"f").registerFunction(n),this}command(t,r,n,i,s,a){return F("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,r,n,i,s,a],arguments.length),m(this,tt,"f").addHandler(t,r,n,i,s,a),this}commands(t,r,n,i,s,a){return this.command(t,r,n,i,s,a)}commandDir(t,r){F("<string> [object]",[t,r],arguments.length);let n=m(this,Sc,"f")||m(this,ie,"f").require;return m(this,tt,"f").addDirectory(t,n,m(this,ie,"f").getCallerFile(),r),this}count(t){return F("<array|string>",[t],arguments.length),this[Cn]("count",t),this[Pi](t),this}default(t,r,n){return F("<object|string|array> [*] [string]",[t,r,n],arguments.length),n&&(pf(t,m(this,ie,"f")),m(this,Z,"f").defaultDescription[t]=n),typeof r=="function"&&(pf(t,m(this,ie,"f")),m(this,Z,"f").defaultDescription[t]||(m(this,Z,"f").defaultDescription[t]=m(this,se,"f").functionDescription(r)),r=r.call()),this[go](this.default.bind(this),"default",t,r),this}defaults(t,r,n){return this.default(t,r,n)}demandCommand(t=1,r,n,i){return F("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),m(this,Z,"f").demandedCommands._={min:t,max:r,minMsg:n,maxMsg:i},this}demand(t,r,n){return Array.isArray(r)?(r.forEach(i=>{At(n,!0,m(this,ie,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof t=="number"?(At(n,!0,m(this,ie,"f")),this.demandCommand(t,r,n,n)):Array.isArray(t)?t.forEach(i=>{At(n,!0,m(this,ie,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,r){return F("<object|string|array> [string]",[t,r],arguments.length),this[go](this.demandOption.bind(this),"demandedOptions",t,r),this}deprecateOption(t,r){return F("<string> [string|boolean]",[t,r],arguments.length),m(this,Z,"f").deprecatedOptions[t]=r,this}describe(t,r){return F("<object|string|array> [string]",[t,r],arguments.length),this[wf](t,!0),m(this,se,"f").describe(t,r),this}detectLocale(t){return F("<boolean>",[t],arguments.length),B(this,gi,t,"f"),this}env(t){return F("[string|boolean]",[t],arguments.length),t===!1?delete m(this,Z,"f").envPrefix:m(this,Z,"f").envPrefix=t||"",this}epilogue(t){return F("<string>",[t],arguments.length),m(this,se,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,r){return F("<string|array> [string]",[t,r],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):m(this,se,"f").example(t,r),this}exit(t,r){B(this,Zt,!0,"f"),B(this,An,r,"f"),m(this,sr,"f")&&m(this,ie,"f").process.exit(t)}exitProcess(t=!0){return F("[boolean]",[t],arguments.length),B(this,sr,t,"f"),this}fail(t){if(F("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new qe("Invalid first argument. Expected function or boolean 'false'");return m(this,se,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,r){return F("<array> [function]",[t,r],arguments.length),r?m(this,or,"f").getCompletion(t,r):new Promise((n,i)=>{m(this,or,"f").getCompletion(t,(s,a)=>{s?i(s):n(a)})})}getDemandedOptions(){return F([],0),m(this,Z,"f").demandedOptions}getDemandedCommands(){return F([],0),m(this,Z,"f").demandedCommands}getDeprecatedOptions(){return F([],0),m(this,Z,"f").deprecatedOptions}getDetectLocale(){return m(this,gi,"f")}getExitProcess(){return m(this,sr,"f")}getGroups(){return Object.assign({},m(this,Fr,"f"),m(this,bi,"f"))}getHelp(){if(B(this,Zt,!0,"f"),!m(this,se,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[As](m(this,In,"f"),void 0,void 0,0,!0);if(De(r))return r.then(()=>m(this,se,"f").help())}let t=m(this,tt,"f").runDefaultBuilderOn(this);if(De(t))return t.then(()=>m(this,se,"f").help())}return Promise.resolve(m(this,se,"f").help())}getOptions(){return m(this,Z,"f")}getStrict(){return m(this,vi,"f")}getStrictCommands(){return m(this,_i,"f")}getStrictOptions(){return m(this,Si,"f")}global(t,r){return F("<string|array> [boolean]",[t,r],arguments.length),t=[].concat(t),r!==!1?m(this,Z,"f").local=m(this,Z,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{m(this,Z,"f").local.includes(n)||m(this,Z,"f").local.push(n)}),this}group(t,r){F("<string|array> <string>",[t,r],arguments.length);let n=m(this,bi,"f")[r]||m(this,Fr,"f")[r];m(this,bi,"f")[r]&&delete m(this,bi,"f")[r];let i={};return m(this,Fr,"f")[r]=(n||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return F("<string>",[t],arguments.length),m(this,Z,"f").hiddenOptions.push(t),this}implies(t,r){return F("<string|object> [number|string|array]",[t,r],arguments.length),m(this,Ke,"f").implies(t,r),this}locale(t){return F("[string]",[t],arguments.length),t===void 0?(this[Ef](),m(this,ie,"f").y18n.getLocale()):(B(this,gi,!1,"f"),m(this,ie,"f").y18n.setLocale(t),this)}middleware(t,r,n){return m(this,ar,"f").addMiddleware(t,!!r,n)}nargs(t,r){return F("<string|object|array> [number]",[t,r],arguments.length),this[go](this.nargs.bind(this),"narg",t,r),this}normalize(t){return F("<array|string>",[t],arguments.length),this[Cn]("normalize",t),this}number(t){return F("<array|string>",[t],arguments.length),this[Cn]("number",t),this[Pi](t),this}option(t,r){if(F("<string|object> [object]",[t,r],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof r!="object"&&(r={}),this[Pi](t),m(this,Hr,"f")&&(t==="version"||(r==null?void 0:r.alias)==="version")&&this[Dy](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
134
134
  `),void 0,"versionWarning"),m(this,Z,"f").key[t]=!0,r.alias&&this.alias(t,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(t,n);let i=r.demand||r.required||r.require;i&&this.demand(t,i),r.demandOption&&this.demandOption(t,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(t,r.conflicts),"default"in r&&this.default(t,r.default),r.implies!==void 0&&this.implies(t,r.implies),r.nargs!==void 0&&this.nargs(t,r.nargs),r.config&&this.config(t,r.configParser),r.normalize&&this.normalize(t),r.choices&&this.choices(t,r.choices),r.coerce&&this.coerce(t,r.coerce),r.group&&this.group(t,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(t),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(t),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(t),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(t),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(t),typeof r.global=="boolean"&&this.global(t,r.global),r.defaultDescription&&(m(this,Z,"f").defaultDescription[t]=r.defaultDescription),r.skipValidation&&this.skipValidation(t);let s=r.describe||r.description||r.desc,a=m(this,se,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(a,t)||typeof s=="string")&&this.describe(t,s),r.hidden&&this.hide(t),r.requiresArg&&this.requiresArg(t)}return this}options(t,r){return this.option(t,r)}parse(t,r,n){F("[string|array] [function|boolean|object] [function]",[t,r,n],arguments.length),this[Ly](),typeof t>"u"&&(t=m(this,In,"f")),typeof r=="object"&&(B(this,yi,r,"f"),r=n),typeof r=="function"&&(B(this,Wt,r,"f"),r=!1),r||B(this,In,t,"f"),m(this,Wt,"f")&&B(this,sr,!1,"f");let i=this[As](t,!!r),s=this.parsed;return m(this,or,"f").setParsed(this.parsed),De(i)?i.then(a=>(m(this,Wt,"f")&&m(this,Wt,"f").call(this,m(this,An,"f"),a,m(this,lt,"f")),a)).catch(a=>{throw m(this,Wt,"f")&&m(this,Wt,"f")(a,this.parsed.argv,m(this,lt,"f")),a}).finally(()=>{this[Af](),this.parsed=s}):(m(this,Wt,"f")&&m(this,Wt,"f").call(this,m(this,An,"f"),i,m(this,lt,"f")),this[Af](),this.parsed=s,i)}parseAsync(t,r,n){let i=this.parse(t,r,n);return De(i)?i:Promise.resolve(i)}parseSync(t,r,n){let i=this.parse(t,r,n);if(De(i))throw new qe(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return F("<object>",[t],arguments.length),B(this,Ec,t,"f"),this}pkgConf(t,r){F("<string> [string]",[t,r],arguments.length);let n=null,i=this[Of](r||m(this,mi,"f"));return i[t]&&typeof i[t]=="object"&&(n=$s(i[t],r||m(this,mi,"f"),this[Ei]()["deep-merge-config"]||!1,m(this,ie,"f")),m(this,Z,"f").configObjects=(m(this,Z,"f").configObjects||[]).concat(n)),this}positional(t,r){F("<string> <object>",[t,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=$n(r,(a,c)=>a==="type"&&!["string","number","boolean"].includes(c)?!1:n.includes(a));let i=m(this,ws,"f").fullCommands[m(this,ws,"f").fullCommands.length-1],s=i?m(this,tt,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return fo(s).forEach(a=>{let c=s[a];Array.isArray(c)?c.indexOf(t)!==-1&&(r[a]=!0):c[t]&&!(a in r)&&(r[a]=c[t])}),this.group(t,m(this,se,"f").getPositionalGroupName()),this.option(t,r)}recommendCommands(t=!0){return F("[boolean]",[t],arguments.length),B(this,Oc,t,"f"),this}required(t,r,n){return this.demand(t,r,n)}require(t,r,n){return this.demand(t,r,n)}requiresArg(t){return F("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&m(this,Z,"f").narg[t]?this:(this[go](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,r){return F("[string] [string]",[t,r],arguments.length),t=t||this.$0,m(this,ho,"f").log(m(this,or,"f").generateCompletionScript(t,r||m(this,zt,"f")||"completion")),this}showHelp(t){if(F("[string|function]",[t],arguments.length),B(this,Zt,!0,"f"),!m(this,se,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[As](m(this,In,"f"),void 0,void 0,0,!0);if(De(n))return n.then(()=>{m(this,se,"f").showHelp(t)}),this}let r=m(this,tt,"f").runDefaultBuilderOn(this);if(De(r))return r.then(()=>{m(this,se,"f").showHelp(t)}),this}return m(this,se,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,r){return F("[boolean|string] [string]",[t,r],arguments.length),m(this,se,"f").showHelpOnFail(t,r),this}showVersion(t){return F("[string|function]",[t],arguments.length),m(this,se,"f").showVersion(t),this}skipValidation(t){return F("<array|string>",[t],arguments.length),this[Cn]("skipValidation",t),this}strict(t){return F("[boolean]",[t],arguments.length),B(this,vi,t!==!1,"f"),this}strictCommands(t){return F("[boolean]",[t],arguments.length),B(this,_i,t!==!1,"f"),this}strictOptions(t){return F("[boolean]",[t],arguments.length),B(this,Si,t!==!1,"f"),this}string(t){return F("<array|string>",[t],arguments.length),this[Cn]("string",t),this[Pi](t),this}terminalWidth(){return F([],0),m(this,ie,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return F("<object>",[t],arguments.length),B(this,gi,!1,"f"),m(this,ie,"f").y18n.updateLocale(t),this}usage(t,r,n,i){if(F("<string|null|undefined> [string|boolean] [function|object] [function]",[t,r,n,i],arguments.length),r!==void 0){if(At(t,null,m(this,ie,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,r,n,i);throw new qe(".usage() description must start with $0 if being used as alias for .command()")}else return m(this,se,"f").usage(t),this}usageConfiguration(t){return F("<object>",[t],arguments.length),B(this,Pc,t,"f"),this}version(t,r,n){let i="version";if(F("[boolean|string] [string] [string]",[t,r,n],arguments.length),m(this,Hr,"f")&&(this[Sf](m(this,Hr,"f")),m(this,se,"f").version(void 0),B(this,Hr,null,"f")),arguments.length===0)n=this[By](),t=i;else if(arguments.length===1){if(t===!1)return this;n=t,t=i}else arguments.length===2&&(n=r,r=void 0);return B(this,Hr,typeof t=="string"?t:i,"f"),r=r||m(this,se,"f").deferY18nLookup("Show version number"),m(this,se,"f").version(n||void 0),this.boolean(m(this,Hr,"f")),this.describe(m(this,Hr,"f"),r),this}wrap(t){return F("<number|null|undefined>",[t],arguments.length),m(this,se,"f").wrap(t),this}[(tt=new WeakMap,mi=new WeakMap,ws=new WeakMap,or=new WeakMap,zt=new WeakMap,yc=new WeakMap,An=new WeakMap,gi=new WeakMap,bc=new WeakMap,sr=new WeakMap,vc=new WeakMap,ar=new WeakMap,Fr=new WeakMap,Zt=new WeakMap,cr=new WeakMap,_c=new WeakMap,ho=new WeakMap,lt=new WeakMap,Z=new WeakMap,Sc=new WeakMap,Ec=new WeakMap,Wt=new WeakMap,yi=new WeakMap,mo=new WeakMap,bi=new WeakMap,In=new WeakMap,Oc=new WeakMap,ie=new WeakMap,vi=new WeakMap,_i=new WeakMap,Si=new WeakMap,se=new WeakMap,Pc=new WeakMap,Hr=new WeakMap,Ke=new WeakMap,ky)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[qy](){return{log:o((...t)=>{this[xc]()||console.log(...t),B(this,Zt,!0,"f"),m(this,lt,"f").length&&B(this,lt,m(this,lt,"f")+`
135
135
  `,"f"),B(this,lt,m(this,lt,"f")+t.join(" "),"f")},"log"),error:o((...t)=>{this[xc]()||console.error(...t),B(this,Zt,!0,"f"),m(this,lt,"f").length&&B(this,lt,m(this,lt,"f")+`
136
- `,"f"),B(this,lt,m(this,lt,"f")+t.join(" "),"f")},"error")}}[Sf](t){fo(m(this,Z,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=m(this,Z,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete m(this,se,"f").getDescriptions()[t]}[Dy](t,r,n){m(this,bc,"f")[n]||(m(this,ie,"f").process.emitWarning(t,r),m(this,bc,"f")[n]=!0)}[Ly](){m(this,vc,"f").push({options:m(this,Z,"f"),configObjects:m(this,Z,"f").configObjects.slice(0),exitProcess:m(this,sr,"f"),groups:m(this,Fr,"f"),strict:m(this,vi,"f"),strictCommands:m(this,_i,"f"),strictOptions:m(this,Si,"f"),completionCommand:m(this,zt,"f"),output:m(this,lt,"f"),exitError:m(this,An,"f"),hasOutput:m(this,Zt,"f"),parsed:this.parsed,parseFn:m(this,Wt,"f"),parseContext:m(this,yi,"f")}),m(this,se,"f").freeze(),m(this,Ke,"f").freeze(),m(this,tt,"f").freeze(),m(this,ar,"f").freeze()}[Fy](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(m(this,ie,"f").process.argv()[0])?r=m(this,ie,"f").process.argv().slice(1,2):r=m(this,ie,"f").process.argv().slice(0,1),t=r.map(n=>{let i=this[Xy](m(this,mi,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),m(this,ie,"f").getEnv("_")&&m(this,ie,"f").getProcessArgvBin()===m(this,ie,"f").getEnv("_")&&(t=m(this,ie,"f").getEnv("_").replace(`${m(this,ie,"f").path.dirname(m(this,ie,"f").process.execPath())}/`,"")),t}[Ei](){return m(this,Ec,"f")}[Hy](){return m(this,Pc,"f")}[Ef](){if(!m(this,gi,"f"))return;let t=m(this,ie,"f").getEnv("LC_ALL")||m(this,ie,"f").getEnv("LC_MESSAGES")||m(this,ie,"f").getEnv("LANG")||m(this,ie,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[By](){return this[Of]().version||"unknown"}[Vy](t){let r=t["--"]?t["--"]:t._;for(let n=0,i;(i=r[n])!==void 0;n++)m(this,ie,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return t}[Of](t){let r=t||"*";if(m(this,mo,"f")[r])return m(this,mo,"f")[r];let n={};try{let i=t||m(this,ie,"f").mainFilename;!t&&m(this,ie,"f").path.extname(i)&&(i=m(this,ie,"f").path.dirname(i));let s=m(this,ie,"f").findUp(i,(a,c)=>{if(c.includes("package.json"))return"package.json"});At(s,void 0,m(this,ie,"f")),n=JSON.parse(m(this,ie,"f").readFileSync(s,"utf8"))}catch{}return m(this,mo,"f")[r]=n||{},m(this,mo,"f")[r]}[Cn](t,r){r=[].concat(r),r.forEach(n=>{n=this[$f](n),m(this,Z,"f")[t].push(n)})}[go](t,r,n,i){this[xf](t,r,n,i,(s,a,c)=>{m(this,Z,"f")[s][a]=c})}[Pf](t,r,n,i){this[xf](t,r,n,i,(s,a,c)=>{m(this,Z,"f")[s][a]=(m(this,Z,"f")[s][a]||[]).concat(c)})}[xf](t,r,n,i,s){if(Array.isArray(n))n.forEach(a=>{t(a,i)});else if((a=>typeof a=="object")(n))for(let a of fo(n))t(a,n[a]);else s(r,this[$f](n),i)}[$f](t){return t==="__proto__"?"___proto___":t}[wf](t,r){return this[go](this[wf].bind(this),"key",t,r),this}[Af](){var t,r,n,i,s,a,c,u,l,p,f,d;let h=m(this,vc,"f").pop();At(h,void 0,m(this,ie,"f"));let y;t=this,r=this,n=this,i=this,s=this,a=this,c=this,u=this,l=this,p=this,f=this,d=this,{options:{set value(b){B(t,Z,b,"f")}}.value,configObjects:y,exitProcess:{set value(b){B(r,sr,b,"f")}}.value,groups:{set value(b){B(n,Fr,b,"f")}}.value,output:{set value(b){B(i,lt,b,"f")}}.value,exitError:{set value(b){B(s,An,b,"f")}}.value,hasOutput:{set value(b){B(a,Zt,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){B(c,vi,b,"f")}}.value,strictCommands:{set value(b){B(u,_i,b,"f")}}.value,strictOptions:{set value(b){B(l,Si,b,"f")}}.value,completionCommand:{set value(b){B(p,zt,b,"f")}}.value,parseFn:{set value(b){B(f,Wt,b,"f")}}.value,parseContext:{set value(b){B(d,yi,b,"f")}}.value}=h,m(this,Z,"f").configObjects=y,m(this,se,"f").unfreeze(),m(this,Ke,"f").unfreeze(),m(this,tt,"f").unfreeze(),m(this,ar,"f").unfreeze()}[Uy](t,r){return hi(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Gy].bind(this),getContext:this[zy].bind(this),getHasOutput:this[Zy].bind(this),getLoggerInstance:this[Wy].bind(this),getParseContext:this[Ky].bind(this),getParserConfiguration:this[Ei].bind(this),getUsageConfiguration:this[Hy].bind(this),getUsageInstance:this[Yy].bind(this),getValidationInstance:this[Qy].bind(this),hasParseCallback:this[xc].bind(this),isGlobalContext:this[Jy].bind(this),postProcess:this[Oi].bind(this),reset:this[If].bind(this),runValidation:this[Cf].bind(this),runYargsParserAndExecuteCommands:this[As].bind(this),setHasOutput:this[eb].bind(this)}}[Gy](){return m(this,tt,"f")}[zy](){return m(this,ws,"f")}[Zy](){return m(this,Zt,"f")}[Wy](){return m(this,ho,"f")}[Ky](){return m(this,yi,"f")||{}}[Yy](){return m(this,se,"f")}[Qy](){return m(this,Ke,"f")}[xc](){return!!m(this,Wt,"f")}[Jy](){return m(this,_c,"f")}[Oi](t,r,n,i){return n||De(t)||(r||(t=this[ky](t)),(this[Ei]()["parse-positional-numbers"]||this[Ei]()["parse-positional-numbers"]===void 0)&&(t=this[Vy](t)),i&&(t=di(t,this,m(this,ar,"f").getMiddleware(),!1))),t}[If](t={}){B(this,Z,m(this,Z,"f")||{},"f");let r={};r.local=m(this,Z,"f").local||[],r.configObjects=m(this,Z,"f").configObjects||[];let n={};r.local.forEach(a=>{n[a]=!0,(t[a]||[]).forEach(c=>{n[c]=!0})}),Object.assign(m(this,bi,"f"),Object.keys(m(this,Fr,"f")).reduce((a,c)=>{let u=m(this,Fr,"f")[c].filter(l=>!(l in n));return u.length>0&&(a[c]=u),a},{})),B(this,Fr,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(a=>{r[a]=(m(this,Z,"f")[a]||[]).filter(c=>!n[c])}),s.forEach(a=>{r[a]=$n(m(this,Z,"f")[a],c=>!n[c])}),r.envPrefix=m(this,Z,"f").envPrefix,B(this,Z,r,"f"),B(this,se,m(this,se,"f")?m(this,se,"f").reset(n):Ay(this,m(this,ie,"f")),"f"),B(this,Ke,m(this,Ke,"f")?m(this,Ke,"f").reset(n):jy(this,m(this,se,"f"),m(this,ie,"f")),"f"),B(this,tt,m(this,tt,"f")?m(this,tt,"f").reset():xy(m(this,se,"f"),m(this,Ke,"f"),m(this,ar,"f"),m(this,ie,"f")),"f"),m(this,or,"f")||B(this,or,Ty(this,m(this,se,"f"),m(this,tt,"f"),m(this,ie,"f")),"f"),m(this,ar,"f").reset(),B(this,zt,null,"f"),B(this,lt,"","f"),B(this,An,null,"f"),B(this,Zt,!1,"f"),this.parsed=!1,this}[Xy](t,r){return m(this,ie,"f").path.relative(t,r)}[As](t,r,n,i=0,s=!1){let a=!!n||s;t=t||m(this,In,"f"),m(this,Z,"f").__=m(this,ie,"f").y18n.__,m(this,Z,"f").configuration=this[Ei]();let c=!!m(this,Z,"f").configuration["populate--"],u=Object.assign({},m(this,Z,"f").configuration,{"populate--":!0}),l=m(this,ie,"f").Parser.detailed(t,Object.assign({},m(this,Z,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),p=Object.assign(l.argv,m(this,yi,"f")),f,d=l.aliases,h=!1,y=!1;Object.keys(p).forEach(b=>{b===m(this,cr,"f")&&p[b]?h=!0:b===m(this,Hr,"f")&&p[b]&&(y=!0)}),p.$0=this.$0,this.parsed=l,i===0&&m(this,se,"f").clearCachedHelpMessage();try{if(this[Ef](),r)return this[Oi](p,c,!!n,!1);m(this,cr,"f")&&[m(this,cr,"f")].concat(d[m(this,cr,"f")]||[]).filter(C=>C.length>1).includes(""+p._[p._.length-1])&&(p._.pop(),h=!0),B(this,_c,!1,"f");let b=m(this,tt,"f").getCommands(),g=m(this,or,"f").completionKey in p,P=h||g||s;if(p._.length){if(b.length){let $;for(let C=i||0,T;p._[C]!==void 0;C++)if(T=String(p._[C]),b.includes(T)&&T!==m(this,zt,"f")){let A=m(this,tt,"f").runCommand(T,this,l,C+1,s,h||y||s);return this[Oi](A,c,!!n,!1)}else if(!$&&T!==m(this,zt,"f")){$=T;break}!m(this,tt,"f").hasDefaultCommand()&&m(this,Oc,"f")&&$&&!P&&m(this,Ke,"f").recommendCommands($,b)}m(this,zt,"f")&&p._.includes(m(this,zt,"f"))&&!g&&(m(this,sr,"f")&&wn(!0),this.showCompletionScript(),this.exit(0))}if(m(this,tt,"f").hasDefaultCommand()&&!P){let $=m(this,tt,"f").runCommand(null,this,l,0,s,h||y||s);return this[Oi]($,c,!!n,!1)}if(g){m(this,sr,"f")&&wn(!0),t=[].concat(t);let $=t.slice(t.indexOf(`--${m(this,or,"f").completionKey}`)+1);return m(this,or,"f").getCompletion($,(C,T)=>{if(C)throw new qe(C.message);(T||[]).forEach(A=>{m(this,ho,"f").log(A)}),this.exit(0)}),this[Oi](p,!c,!!n,!1)}if(m(this,Zt,"f")||(h?(m(this,sr,"f")&&wn(!0),a=!0,this.showHelp("log"),this.exit(0)):y&&(m(this,sr,"f")&&wn(!0),a=!0,m(this,se,"f").showVersion("log"),this.exit(0))),!a&&m(this,Z,"f").skipValidation.length>0&&(a=Object.keys(p).some($=>m(this,Z,"f").skipValidation.indexOf($)>=0&&p[$]===!0)),!a){if(l.error)throw new qe(l.error.message);if(!g){let $=this[Cf](d,{},l.error);n||(f=di(p,this,m(this,ar,"f").getMiddleware(),!0)),f=this[Uy]($,f??p),De(f)&&!n&&(f=f.then(()=>di(p,this,m(this,ar,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof qe)m(this,se,"f").fail(b.message,b);else throw b}return this[Oi](f??p,c,!!n,!0)}[Cf](t,r,n,i){let s={...this.getDemandedOptions()};return a=>{if(n)throw new qe(n.message);m(this,Ke,"f").nonOptionCount(a),m(this,Ke,"f").requiredArguments(a,s);let c=!1;m(this,_i,"f")&&(c=m(this,Ke,"f").unknownCommands(a)),m(this,vi,"f")&&!c?m(this,Ke,"f").unknownArguments(a,t,r,!!i):m(this,Si,"f")&&m(this,Ke,"f").unknownArguments(a,t,{},!1,!1),m(this,Ke,"f").limitedChoices(a),m(this,Ke,"f").implications(a),m(this,Ke,"f").conflicting(a)}}[eb](){B(this,Zt,!0,"f")}[Pi](t){if(typeof t=="string")m(this,Z,"f").key[t]=!0;else for(let r of t)m(this,Z,"f").key[r]=!0}};o(Rf,"YargsInstance");var Tf=Rf;function $y(e){return!!e&&typeof e.getInternalMethods=="function"}o($y,"isYargsInstance");var B$=tb(ff),rb=B$;var Is="AppRestClient",$c={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Nf="src/data",jf="@/data",ur={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"}},Tn={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},wc={bindings:[Tn.ErrorHandler,Tn.SharedErrorHandler],from:ur.errorHandling.template},Mf="AbilityContext",nb={bindings:[Mf],from:ur.abilityContext.template};var Ac={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ic={fileName:"app-rest-client",extension:"ts"},kf="QueryModule",Cc={fileName:"queryModules",extension:"ts"},ib={fileName:"queryConfig.context",extension:"tsx"},yo={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},Tc={fileName:"useMutationEffects",extension:"ts"},Br={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},Rc={fileName:"zod",extension:"ts"};var ob="Schema",sb="Enum",ab="Body",cb="Param",ub="Response",lb="ErrorResponse",Cs="z.void()",Nc="z.instanceof(Blob)",Ts="z.enum",jc="z.string()",bo={bindings:["z"],from:"zod"};var xe={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!1,standalone:!1,baseUrl:"",abilityContextImportPath:ur.abilityContext.template,schemaSuffix:ob,enumSuffix:sb,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:ur.appRestClient.template,errorHandlingImportPath:ur.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!1,queryTypesImportPath:ur.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var fb=o((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),pb=o((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),db=o((e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,"wrapAnsi16m"),Ue={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},F6=Object.keys(Ue.modifier),V$=Object.keys(Ue.color),U$=Object.keys(Ue.bgColor),H6=[...V$,...U$];function G$(){let e=new Map;for(let[t,r]of Object.entries(Ue)){for(let[n,i]of Object.entries(r))Ue[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ue[n],e.set(i[0],i[1]);Object.defineProperty(Ue,t,{value:r,enumerable:!1})}return Object.defineProperty(Ue,"codes",{value:e,enumerable:!1}),Ue.color.close="\x1B[39m",Ue.bgColor.close="\x1B[49m",Ue.color.ansi=fb(),Ue.color.ansi256=pb(),Ue.color.ansi16m=db(),Ue.bgColor.ansi=fb(10),Ue.bgColor.ansi256=pb(10),Ue.bgColor.ansi16m=db(10),Object.defineProperties(Ue,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:o(t=>Ue.rgbToAnsi256(...Ue.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let c=t%36;r=Math.floor(t/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:o((t,r,n)=>Ue.ansi256ToAnsi(Ue.rgbToAnsi256(t,r,n)),"value"),enumerable:!1},hexToAnsi:{value:o(t=>Ue.ansi256ToAnsi(Ue.hexToAnsi256(t)),"value"),enumerable:!1}}),Ue}o(G$,"assembleStyles");var z$=G$(),Pr=z$;var kc=mt(require("process"),1),mb=mt(require("os"),1),qf=mt(require("tty"),1);function lr(e,t=globalThis.Deno?globalThis.Deno.args:kc.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}o(lr,"hasFlag");var{env:ze}=kc.default,Mc;lr("no-color")||lr("no-colors")||lr("color=false")||lr("color=never")?Mc=0:(lr("color")||lr("colors")||lr("color=true")||lr("color=always"))&&(Mc=1);function Z$(){if("FORCE_COLOR"in ze)return ze.FORCE_COLOR==="true"?1:ze.FORCE_COLOR==="false"?0:ze.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ze.FORCE_COLOR,10),3)}o(Z$,"envForceColor");function W$(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}o(W$,"translateLevel");function K$(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Z$();n!==void 0&&(Mc=n);let i=r?Mc:n;if(i===0)return 0;if(r){if(lr("color=16m")||lr("color=full")||lr("color=truecolor"))return 3;if(lr("color=256"))return 2}if("TF_BUILD"in ze&&"AGENT_NAME"in ze)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(ze.TERM==="dumb")return s;if(kc.default.platform==="win32"){let a=mb.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in ze)return"GITHUB_ACTIONS"in ze||"GITEA_ACTIONS"in ze?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in ze)||ze.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ze.TEAMCITY_VERSION)?1:0;if(ze.COLORTERM==="truecolor"||ze.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in ze){let a=Number.parseInt((ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ze.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ze.TERM)||"COLORTERM"in ze?1:s}o(K$,"_supportsColor");function hb(e,t={}){let r=K$(e,{streamIsTTY:e&&e.isTTY,...t});return W$(r)}o(hb,"createSupportsColor");var Y$={stdout:hb({isTTY:qf.default.isatty(1)}),stderr:hb({isTTY:qf.default.isatty(2)})},gb=Y$;function yb(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let i=t.length,s=0,a="";do a+=e.slice(s,n)+t+r,s=n+i,n=e.indexOf(t,s);while(n!==-1);return a+=e.slice(s),a}o(yb,"stringReplaceAll");function bb(e,t,r,n){let i=0,s="";do{let a=e[n-1]==="\r";s+=e.slice(i,a?n-1:n)+t+(a?`\r
136
+ `,"f"),B(this,lt,m(this,lt,"f")+t.join(" "),"f")},"error")}}[Sf](t){fo(m(this,Z,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=m(this,Z,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete m(this,se,"f").getDescriptions()[t]}[Dy](t,r,n){m(this,bc,"f")[n]||(m(this,ie,"f").process.emitWarning(t,r),m(this,bc,"f")[n]=!0)}[Ly](){m(this,vc,"f").push({options:m(this,Z,"f"),configObjects:m(this,Z,"f").configObjects.slice(0),exitProcess:m(this,sr,"f"),groups:m(this,Fr,"f"),strict:m(this,vi,"f"),strictCommands:m(this,_i,"f"),strictOptions:m(this,Si,"f"),completionCommand:m(this,zt,"f"),output:m(this,lt,"f"),exitError:m(this,An,"f"),hasOutput:m(this,Zt,"f"),parsed:this.parsed,parseFn:m(this,Wt,"f"),parseContext:m(this,yi,"f")}),m(this,se,"f").freeze(),m(this,Ke,"f").freeze(),m(this,tt,"f").freeze(),m(this,ar,"f").freeze()}[Fy](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(m(this,ie,"f").process.argv()[0])?r=m(this,ie,"f").process.argv().slice(1,2):r=m(this,ie,"f").process.argv().slice(0,1),t=r.map(n=>{let i=this[Xy](m(this,mi,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),m(this,ie,"f").getEnv("_")&&m(this,ie,"f").getProcessArgvBin()===m(this,ie,"f").getEnv("_")&&(t=m(this,ie,"f").getEnv("_").replace(`${m(this,ie,"f").path.dirname(m(this,ie,"f").process.execPath())}/`,"")),t}[Ei](){return m(this,Ec,"f")}[Hy](){return m(this,Pc,"f")}[Ef](){if(!m(this,gi,"f"))return;let t=m(this,ie,"f").getEnv("LC_ALL")||m(this,ie,"f").getEnv("LC_MESSAGES")||m(this,ie,"f").getEnv("LANG")||m(this,ie,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[By](){return this[Of]().version||"unknown"}[Vy](t){let r=t["--"]?t["--"]:t._;for(let n=0,i;(i=r[n])!==void 0;n++)m(this,ie,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return t}[Of](t){let r=t||"*";if(m(this,mo,"f")[r])return m(this,mo,"f")[r];let n={};try{let i=t||m(this,ie,"f").mainFilename;!t&&m(this,ie,"f").path.extname(i)&&(i=m(this,ie,"f").path.dirname(i));let s=m(this,ie,"f").findUp(i,(a,c)=>{if(c.includes("package.json"))return"package.json"});At(s,void 0,m(this,ie,"f")),n=JSON.parse(m(this,ie,"f").readFileSync(s,"utf8"))}catch{}return m(this,mo,"f")[r]=n||{},m(this,mo,"f")[r]}[Cn](t,r){r=[].concat(r),r.forEach(n=>{n=this[$f](n),m(this,Z,"f")[t].push(n)})}[go](t,r,n,i){this[xf](t,r,n,i,(s,a,c)=>{m(this,Z,"f")[s][a]=c})}[Pf](t,r,n,i){this[xf](t,r,n,i,(s,a,c)=>{m(this,Z,"f")[s][a]=(m(this,Z,"f")[s][a]||[]).concat(c)})}[xf](t,r,n,i,s){if(Array.isArray(n))n.forEach(a=>{t(a,i)});else if((a=>typeof a=="object")(n))for(let a of fo(n))t(a,n[a]);else s(r,this[$f](n),i)}[$f](t){return t==="__proto__"?"___proto___":t}[wf](t,r){return this[go](this[wf].bind(this),"key",t,r),this}[Af](){var t,r,n,i,s,a,c,u,l,p,f,d;let h=m(this,vc,"f").pop();At(h,void 0,m(this,ie,"f"));let y;t=this,r=this,n=this,i=this,s=this,a=this,c=this,u=this,l=this,p=this,f=this,d=this,{options:{set value(b){B(t,Z,b,"f")}}.value,configObjects:y,exitProcess:{set value(b){B(r,sr,b,"f")}}.value,groups:{set value(b){B(n,Fr,b,"f")}}.value,output:{set value(b){B(i,lt,b,"f")}}.value,exitError:{set value(b){B(s,An,b,"f")}}.value,hasOutput:{set value(b){B(a,Zt,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){B(c,vi,b,"f")}}.value,strictCommands:{set value(b){B(u,_i,b,"f")}}.value,strictOptions:{set value(b){B(l,Si,b,"f")}}.value,completionCommand:{set value(b){B(p,zt,b,"f")}}.value,parseFn:{set value(b){B(f,Wt,b,"f")}}.value,parseContext:{set value(b){B(d,yi,b,"f")}}.value}=h,m(this,Z,"f").configObjects=y,m(this,se,"f").unfreeze(),m(this,Ke,"f").unfreeze(),m(this,tt,"f").unfreeze(),m(this,ar,"f").unfreeze()}[Uy](t,r){return hi(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Gy].bind(this),getContext:this[zy].bind(this),getHasOutput:this[Zy].bind(this),getLoggerInstance:this[Wy].bind(this),getParseContext:this[Ky].bind(this),getParserConfiguration:this[Ei].bind(this),getUsageConfiguration:this[Hy].bind(this),getUsageInstance:this[Yy].bind(this),getValidationInstance:this[Qy].bind(this),hasParseCallback:this[xc].bind(this),isGlobalContext:this[Jy].bind(this),postProcess:this[Oi].bind(this),reset:this[If].bind(this),runValidation:this[Cf].bind(this),runYargsParserAndExecuteCommands:this[As].bind(this),setHasOutput:this[eb].bind(this)}}[Gy](){return m(this,tt,"f")}[zy](){return m(this,ws,"f")}[Zy](){return m(this,Zt,"f")}[Wy](){return m(this,ho,"f")}[Ky](){return m(this,yi,"f")||{}}[Yy](){return m(this,se,"f")}[Qy](){return m(this,Ke,"f")}[xc](){return!!m(this,Wt,"f")}[Jy](){return m(this,_c,"f")}[Oi](t,r,n,i){return n||De(t)||(r||(t=this[ky](t)),(this[Ei]()["parse-positional-numbers"]||this[Ei]()["parse-positional-numbers"]===void 0)&&(t=this[Vy](t)),i&&(t=di(t,this,m(this,ar,"f").getMiddleware(),!1))),t}[If](t={}){B(this,Z,m(this,Z,"f")||{},"f");let r={};r.local=m(this,Z,"f").local||[],r.configObjects=m(this,Z,"f").configObjects||[];let n={};r.local.forEach(a=>{n[a]=!0,(t[a]||[]).forEach(c=>{n[c]=!0})}),Object.assign(m(this,bi,"f"),Object.keys(m(this,Fr,"f")).reduce((a,c)=>{let u=m(this,Fr,"f")[c].filter(l=>!(l in n));return u.length>0&&(a[c]=u),a},{})),B(this,Fr,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(a=>{r[a]=(m(this,Z,"f")[a]||[]).filter(c=>!n[c])}),s.forEach(a=>{r[a]=$n(m(this,Z,"f")[a],c=>!n[c])}),r.envPrefix=m(this,Z,"f").envPrefix,B(this,Z,r,"f"),B(this,se,m(this,se,"f")?m(this,se,"f").reset(n):Ay(this,m(this,ie,"f")),"f"),B(this,Ke,m(this,Ke,"f")?m(this,Ke,"f").reset(n):jy(this,m(this,se,"f"),m(this,ie,"f")),"f"),B(this,tt,m(this,tt,"f")?m(this,tt,"f").reset():xy(m(this,se,"f"),m(this,Ke,"f"),m(this,ar,"f"),m(this,ie,"f")),"f"),m(this,or,"f")||B(this,or,Ty(this,m(this,se,"f"),m(this,tt,"f"),m(this,ie,"f")),"f"),m(this,ar,"f").reset(),B(this,zt,null,"f"),B(this,lt,"","f"),B(this,An,null,"f"),B(this,Zt,!1,"f"),this.parsed=!1,this}[Xy](t,r){return m(this,ie,"f").path.relative(t,r)}[As](t,r,n,i=0,s=!1){let a=!!n||s;t=t||m(this,In,"f"),m(this,Z,"f").__=m(this,ie,"f").y18n.__,m(this,Z,"f").configuration=this[Ei]();let c=!!m(this,Z,"f").configuration["populate--"],u=Object.assign({},m(this,Z,"f").configuration,{"populate--":!0}),l=m(this,ie,"f").Parser.detailed(t,Object.assign({},m(this,Z,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),p=Object.assign(l.argv,m(this,yi,"f")),f,d=l.aliases,h=!1,y=!1;Object.keys(p).forEach(b=>{b===m(this,cr,"f")&&p[b]?h=!0:b===m(this,Hr,"f")&&p[b]&&(y=!0)}),p.$0=this.$0,this.parsed=l,i===0&&m(this,se,"f").clearCachedHelpMessage();try{if(this[Ef](),r)return this[Oi](p,c,!!n,!1);m(this,cr,"f")&&[m(this,cr,"f")].concat(d[m(this,cr,"f")]||[]).filter(C=>C.length>1).includes(""+p._[p._.length-1])&&(p._.pop(),h=!0),B(this,_c,!1,"f");let b=m(this,tt,"f").getCommands(),g=m(this,or,"f").completionKey in p,P=h||g||s;if(p._.length){if(b.length){let $;for(let C=i||0,T;p._[C]!==void 0;C++)if(T=String(p._[C]),b.includes(T)&&T!==m(this,zt,"f")){let A=m(this,tt,"f").runCommand(T,this,l,C+1,s,h||y||s);return this[Oi](A,c,!!n,!1)}else if(!$&&T!==m(this,zt,"f")){$=T;break}!m(this,tt,"f").hasDefaultCommand()&&m(this,Oc,"f")&&$&&!P&&m(this,Ke,"f").recommendCommands($,b)}m(this,zt,"f")&&p._.includes(m(this,zt,"f"))&&!g&&(m(this,sr,"f")&&wn(!0),this.showCompletionScript(),this.exit(0))}if(m(this,tt,"f").hasDefaultCommand()&&!P){let $=m(this,tt,"f").runCommand(null,this,l,0,s,h||y||s);return this[Oi]($,c,!!n,!1)}if(g){m(this,sr,"f")&&wn(!0),t=[].concat(t);let $=t.slice(t.indexOf(`--${m(this,or,"f").completionKey}`)+1);return m(this,or,"f").getCompletion($,(C,T)=>{if(C)throw new qe(C.message);(T||[]).forEach(A=>{m(this,ho,"f").log(A)}),this.exit(0)}),this[Oi](p,!c,!!n,!1)}if(m(this,Zt,"f")||(h?(m(this,sr,"f")&&wn(!0),a=!0,this.showHelp("log"),this.exit(0)):y&&(m(this,sr,"f")&&wn(!0),a=!0,m(this,se,"f").showVersion("log"),this.exit(0))),!a&&m(this,Z,"f").skipValidation.length>0&&(a=Object.keys(p).some($=>m(this,Z,"f").skipValidation.indexOf($)>=0&&p[$]===!0)),!a){if(l.error)throw new qe(l.error.message);if(!g){let $=this[Cf](d,{},l.error);n||(f=di(p,this,m(this,ar,"f").getMiddleware(),!0)),f=this[Uy]($,f??p),De(f)&&!n&&(f=f.then(()=>di(p,this,m(this,ar,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof qe)m(this,se,"f").fail(b.message,b);else throw b}return this[Oi](f??p,c,!!n,!0)}[Cf](t,r,n,i){let s={...this.getDemandedOptions()};return a=>{if(n)throw new qe(n.message);m(this,Ke,"f").nonOptionCount(a),m(this,Ke,"f").requiredArguments(a,s);let c=!1;m(this,_i,"f")&&(c=m(this,Ke,"f").unknownCommands(a)),m(this,vi,"f")&&!c?m(this,Ke,"f").unknownArguments(a,t,r,!!i):m(this,Si,"f")&&m(this,Ke,"f").unknownArguments(a,t,{},!1,!1),m(this,Ke,"f").limitedChoices(a),m(this,Ke,"f").implications(a),m(this,Ke,"f").conflicting(a)}}[eb](){B(this,Zt,!0,"f")}[Pi](t){if(typeof t=="string")m(this,Z,"f").key[t]=!0;else for(let r of t)m(this,Z,"f").key[r]=!0}};o(Rf,"YargsInstance");var Tf=Rf;function $y(e){return!!e&&typeof e.getInternalMethods=="function"}o($y,"isYargsInstance");var B$=tb(ff),rb=B$;var Is="AppRestClient",$c={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Nf="src/data",jf="@/data",ur={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"}},Tn={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},wc={bindings:[Tn.ErrorHandler,Tn.SharedErrorHandler],from:ur.errorHandling.template},Mf="AbilityContext",nb={bindings:[Mf],from:ur.abilityContext.template};var Ac={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ic={fileName:"app-rest-client",extension:"ts"},kf="QueryModule",Cc={fileName:"queryModules",extension:"ts"},ib={fileName:"queryConfig.context",extension:"tsx"},yo={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},Tc={fileName:"useMutationEffects",extension:"ts"},Br={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},Rc={fileName:"zod",extension:"ts"};var ob="Schema",sb="Enum",ab="Body",cb="Param",ub="Response",lb="ErrorResponse",Cs="z.void()",Nc="z.instanceof(Blob)",Ts="z.enum",jc="z.string()",bo={bindings:["z"],from:"zod"};var xe={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!0,standalone:!1,baseUrl:"",abilityContextImportPath:ur.abilityContext.template,schemaSuffix:ob,enumSuffix:sb,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:ur.appRestClient.template,errorHandlingImportPath:ur.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:ur.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var fb=o((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),pb=o((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),db=o((e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,"wrapAnsi16m"),Ue={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},F6=Object.keys(Ue.modifier),V$=Object.keys(Ue.color),U$=Object.keys(Ue.bgColor),H6=[...V$,...U$];function G$(){let e=new Map;for(let[t,r]of Object.entries(Ue)){for(let[n,i]of Object.entries(r))Ue[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ue[n],e.set(i[0],i[1]);Object.defineProperty(Ue,t,{value:r,enumerable:!1})}return Object.defineProperty(Ue,"codes",{value:e,enumerable:!1}),Ue.color.close="\x1B[39m",Ue.bgColor.close="\x1B[49m",Ue.color.ansi=fb(),Ue.color.ansi256=pb(),Ue.color.ansi16m=db(),Ue.bgColor.ansi=fb(10),Ue.bgColor.ansi256=pb(10),Ue.bgColor.ansi16m=db(10),Object.defineProperties(Ue,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:o(t=>Ue.rgbToAnsi256(...Ue.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let c=t%36;r=Math.floor(t/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:o((t,r,n)=>Ue.ansi256ToAnsi(Ue.rgbToAnsi256(t,r,n)),"value"),enumerable:!1},hexToAnsi:{value:o(t=>Ue.ansi256ToAnsi(Ue.hexToAnsi256(t)),"value"),enumerable:!1}}),Ue}o(G$,"assembleStyles");var z$=G$(),Pr=z$;var kc=mt(require("process"),1),mb=mt(require("os"),1),qf=mt(require("tty"),1);function lr(e,t=globalThis.Deno?globalThis.Deno.args:kc.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}o(lr,"hasFlag");var{env:ze}=kc.default,Mc;lr("no-color")||lr("no-colors")||lr("color=false")||lr("color=never")?Mc=0:(lr("color")||lr("colors")||lr("color=true")||lr("color=always"))&&(Mc=1);function Z$(){if("FORCE_COLOR"in ze)return ze.FORCE_COLOR==="true"?1:ze.FORCE_COLOR==="false"?0:ze.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ze.FORCE_COLOR,10),3)}o(Z$,"envForceColor");function W$(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}o(W$,"translateLevel");function K$(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Z$();n!==void 0&&(Mc=n);let i=r?Mc:n;if(i===0)return 0;if(r){if(lr("color=16m")||lr("color=full")||lr("color=truecolor"))return 3;if(lr("color=256"))return 2}if("TF_BUILD"in ze&&"AGENT_NAME"in ze)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(ze.TERM==="dumb")return s;if(kc.default.platform==="win32"){let a=mb.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in ze)return"GITHUB_ACTIONS"in ze||"GITEA_ACTIONS"in ze?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in ze)||ze.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ze.TEAMCITY_VERSION)?1:0;if(ze.COLORTERM==="truecolor"||ze.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in ze){let a=Number.parseInt((ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ze.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ze.TERM)||"COLORTERM"in ze?1:s}o(K$,"_supportsColor");function hb(e,t={}){let r=K$(e,{streamIsTTY:e&&e.isTTY,...t});return W$(r)}o(hb,"createSupportsColor");var Y$={stdout:hb({isTTY:qf.default.isatty(1)}),stderr:hb({isTTY:qf.default.isatty(2)})},gb=Y$;function yb(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let i=t.length,s=0,a="";do a+=e.slice(s,n)+t+r,s=n+i,n=e.indexOf(t,s);while(n!==-1);return a+=e.slice(s),a}o(yb,"stringReplaceAll");function bb(e,t,r,n){let i=0,s="";do{let a=e[n-1]==="\r";s+=e.slice(i,a?n-1:n)+t+(a?`\r
137
137
  `:`
138
138
  `)+r,i=n+1,n=e.indexOf(`
139
139
  `,i)}while(n!==-1);return s+=e.slice(i),s}o(bb,"stringEncaseCRLFWithFirstIndex");var{stdout:vb,stderr:_b}=gb,Df=Symbol("GENERATOR"),vo=Symbol("STYLER"),Rs=Symbol("IS_EMPTY"),Sb=["ansi","ansi","ansi256","ansi16m"],_o=Object.create(null),Q$=o((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=vb?vb.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),Hf=class Hf{constructor(t){return Eb(t)}};o(Hf,"Chalk");var qc=Hf,Eb=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return Q$(t,e),Object.setPrototypeOf(t,Ns.prototype),t},"chalkFactory");function Ns(e){return Eb(e)}o(Ns,"createChalk");Object.setPrototypeOf(Ns.prototype,Function.prototype);for(let[e,t]of Object.entries(Pr))_o[e]={get(){let r=Dc(this,Ff(t.open,t.close,this[vo]),this[Rs]);return Object.defineProperty(this,e,{value:r}),r}};_o.visible={get(){let e=Dc(this,this[vo],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Lf=o((e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Pr[r].ansi16m(...n):t==="ansi256"?Pr[r].ansi256(Pr.rgbToAnsi256(...n)):Pr[r].ansi(Pr.rgbToAnsi(...n)):e==="hex"?Lf("rgb",t,r,...Pr.hexToRgb(...n)):Pr[r][e](...n),"getModelAnsi"),J$=["rgb","hex","ansi256"];for(let e of J$){_o[e]={get(){let{level:r}=this;return function(...n){let i=Ff(Lf(e,Sb[r],"color",...n),Pr.color.close,this[vo]);return Dc(this,i,this[Rs])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);_o[t]={get(){let{level:r}=this;return function(...n){let i=Ff(Lf(e,Sb[r],"bgColor",...n),Pr.bgColor.close,this[vo]);return Dc(this,i,this[Rs])}}}}var X$=Object.defineProperties(()=>{},{..._o,level:{enumerable:!0,get(){return this[Df].level},set(e){this[Df].level=e}}}),Ff=o((e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},"createStyler"),Dc=o((e,t,r)=>{let n=o((...i)=>ew(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,X$),n[Df]=e,n[vo]=t,n[Rs]=r,n},"createBuilder"),ew=o((e,t)=>{if(e.level<=0||!t)return e[Rs]?"":t;let r=e[vo];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=yb(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
140
- `);return s!==-1&&(t=bb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Ns.prototype,_o);var Q6=Ns(),J6=Ns({level:_b?_b.level:0});var Vr=new qc;function js(e,t,r){console.log(r!==void 0&&r!==t?`${Vr.yellow(`${e}:`.padEnd(20))}${Vr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(js,"logVariable");function fr(e){console.log(`[INFO] ${e}`)}o(fr,"logInfo");function Rn(e){console.log(Vr.green(`[SUCCESS] ${e}`))}o(Rn,"logSuccess");function Ms(e,t){e instanceof Error?(console.log(Vr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Vr.red(`[ERROR] ${e}`))}o(Ms,"logError");function Lc(e){console.log(Vr.bgYellow(`==== ${e} ====`))}o(Lc,"logBanner");var Ob=mt(require("fs"));function So(){return"0.13.3"}o(So,"getVersion");var fH=mt(xb());var Bf=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Bf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(Bf,s,t)}}}o(Ee,"YargOption");function $b(e){let t=Reflect.getMetadata(Bf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o($b,"getYargsOption");function Fc(e){return async t=>t.options(tw(e)).middleware(async r=>await rw(e,r),!0)}o(Fc,"getBuilder");function tw(e){return Object.entries($b(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(tw,"getYargsOptions");async function rw(e,t){let r=new e;for(let[n,i]of Object.entries($b(e)))r[n]=t[n]??i.default;return r}o(rw,"loadYargsConfig");var Ax=mt(Rm());var tP={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"},rP={"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 kr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},nP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},$a={pageParamName:"page"},zu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},wa="moduleName";var Nm={"Content-Type":"application/json",Accept:"application/json"},Zu="data",jm="axios",Kn="config",en="AxiosRequestConfig",Wu={defaultImport:jm,bindings:[en],from:"axios"};var iP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Yn=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 we(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(we,"isReferenceObject");function Rt(e){return!we(e)}o(Rt,"isSchemaObject");function Ku(e){return e.type==="array"}o(Ku,"isArraySchemaObject");function oP(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(Qq(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(we(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(oP,"inferRequiredSchema");var Qq=o(e=>!we(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var yn=Symbol.for("@ts-pattern/matcher"),Jq=Symbol.for("@ts-pattern/isVariadic"),Qu="@ts-pattern/anonymous-select-key",Mm=o(e=>!!(e&&typeof e=="object"),"r"),Yu=o(e=>e&&!!e[yn],"i"),nn=o((e,t,r)=>{if(Yu(e)){let n=e[yn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Mm(e)){if(!Mm(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];Yu(c)&&c[Jq]?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,p)=>nn(l,a[p],r))&&i.every((l,p)=>nn(l,c[p],r))&&(s.length===0||nn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>nn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Yu(s=i)&&s[yn]().matcherType==="optional")&&nn(i,t[n],r);var s})}return Object.is(t,e)},"s"),ti=o(e=>{var t,r,n;return Mm(e)?Yu(e)?(t=(r=(n=e[yn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ia(e,ti):Ia(Object.values(e),ti):[]},"o"),Ia=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function yr(e){return Object.assign(e,{optional:o(()=>Xq(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>eD(e,t),"or"),select:o(t=>t===void 0?sP(e):sP(t,e),"select")})}o(yr,"u");function Xq(e){return yr({[yn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(ti(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:nn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>ti(e),"getSelectionKeys"),matcherType:"optional"})})}o(Xq,"h");function Ge(...e){return yr({[yn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,ti),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function eD(...e){return yr({[yn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ia(e,ti).forEach(i=>n(i,void 0)),{matched:e.some(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,ti),"getSelectionKeys"),matcherType:"or"})})}o(eD,"d");function $e(e){return{[yn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o($e,"p");function sP(...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 yr({[yn]:()=>({match:o(n=>{let i={[t??Qu]:n};return{matched:r===void 0||nn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Qu].concat(r===void 0?[]:ti(r)),"getSelectionKeys")})})}o(sP,"y");function tn(e){return typeof e=="number"}o(tn,"v");function Qn(e){return typeof e=="string"}o(Qn,"b");function Jn(e){return typeof e=="bigint"}o(Jn,"w");var IU=yr($e(function(e){return!0}));var Xn=o(e=>Object.assign(yr(e),{startsWith:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Xn(Ge(e,(r=>$e(n=>Qn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Xn(Ge(e,(r=>$e(n=>Qn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Xn(Ge(e,(r=>$e(n=>Qn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&!!n.match(r)))));var r},"regex")}),"j"),CU=Xn($e(Qn)),rn=o(e=>Object.assign(yr(e),{between:o((t,r)=>rn(Ge(e,((n,i)=>$e(s=>tn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n<r))(t))),"lt"),gt:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n>r))(t))),"gt"),lte:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n<=r))(t))),"lte"),gte:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n>=r))(t))),"gte"),int:o(()=>rn(Ge(e,$e(t=>tn(t)&&Number.isInteger(t)))),"int"),finite:o(()=>rn(Ge(e,$e(t=>tn(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>rn(Ge(e,$e(t=>tn(t)&&t>0))),"positive"),negative:o(()=>rn(Ge(e,$e(t=>tn(t)&&t<0))),"negative")}),"x"),TU=rn($e(tn)),ei=o(e=>Object.assign(yr(e),{between:o((t,r)=>ei(Ge(e,((n,i)=>$e(s=>Jn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n<r))(t))),"lt"),gt:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n>r))(t))),"gt"),lte:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n<=r))(t))),"lte"),gte:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n>=r))(t))),"gte"),positive:o(()=>ei(Ge(e,$e(t=>Jn(t)&&t>0))),"positive"),negative:o(()=>ei(Ge(e,$e(t=>Jn(t)&&t<0))),"negative")}),"A"),RU=ei($e(Jn)),NU=yr($e(function(e){return typeof e=="boolean"})),jU=yr($e(function(e){return typeof e=="symbol"})),MU=yr($e(function(e){return e==null})),kU=yr($e(function(e){return e!=null}));var Lm=class Lm 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(Lm,"W");var km=Lm,qm={matched:!1,value:void 0};function xt(e){return new Dm(e,qm)}o(xt,"z");var Aa=class Aa{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,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>nn(l,this.input,c))||i&&!i(this.input)?qm:{matched:!0,value:r(s?Qu in a?a[Qu]:a:this.input,this.input)};return new Aa(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Aa(this.input,n?{matched:!0,value:r(this.input,this.input)}:qm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new km(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Aa,"I");var Dm=Aa;var Fm=2,aP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],cP=["query","header","path"],zi=["get","put","post","delete","options","head","patch","trace"],uP=["string","number","integer","boolean"],Ca=["allOf","anyOf","oneOf"];var He=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ri=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),lP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),fP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Hm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),pP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),tD=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"),Bm=o(e=>{let t=e.map(He).map(dP).map(r=>rD(r)).flat();return tD(t)},"getMostCommonAdjacentCombinationSplit"),dP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),hP=o(e=>dP(e).join(" "),"camelToSpaceSeparated"),rD=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"),mP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ri(r)}|${He(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var yP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Zi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ss=o(e=>Zi(e).split("/").at(-1),"getSchemaNameByRef");function Um(e){let t=nD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Um,"normalizeString");function bP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(bP,"wrapWithQuotesIfNeeded");function vP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(vP,"unwrapQuotesIfNeeded");function nD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(nD,"prefixStringStartingWithNumberIfNeeded");function Gm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Gm,"pathParamToVariableName");var Wi=o(e=>uP.includes(e),"isPrimitiveType");function _P(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(_P,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||aP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ta(e){return e>=200&&e<300}o(Ta,"isMainResponseStatus");function Ju(e){return!(e>=200&&e<300)}o(Ju,"isErrorStatus");function Xu(e){return e.startsWith("application/")}o(Xu,"isMediaTypeAllowed");var gP=/({\w+})/g,iD=/[^\w\-]+/g;function SP(e){e=He(lP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(gP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(gP,"")}By${He(r.slice(1,-1))}`}return e.replace(iD,"_")}o(SP,"pathToVariableName");var Vm=/{(\b\w+(?:-\w+)*\b)}/g;function EP(e){let t=e.match(Vm);return t===null?e.replaceAll(Vm,":$1"):(t.forEach(r=>{let n=Gm(r.replaceAll(Vm,":$1"));e=e.replaceAll(r,n)}),e)}o(EP,"replaceHyphenatedPath");var OP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Rt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Ki=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Jt=o(e=>e.method==="get","isQuery"),ii=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),as=o((e,t)=>Jt(e)&&(t??Object.values($a)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),PP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ni(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ni(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function oi(e){return fP(e)}o(oi,"formatTag");function si(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return oi(r??t.defaultTag)}o(si,"getOperationTag");function xP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(xP,"isTagExcluded");var el={fileName:"acl/app.ability",extension:"ts"},Ra="AllAbilities",Na="AppAbilities",tl={fileName:"acl/useAclCheck",extension:"ts"},ai="useAclCheck",Nt={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},zm={bindings:[Nt.abilityTuple,Nt.pureAbility,Nt.forcedSubject,Nt.subject],from:"@casl/ability"};var Xt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function jt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(we(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ca.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&&jt(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&&jt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;jt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;jt(s,t)}}o(jt,"iterateSchema");var sn=o((e,t)=>Hm(He(Um(e)),t),"getZodSchemaName"),ja=o((e,t,r)=>Hm(He(Um(e)),`${t}${r}`),"getEnumZodSchemaName"),$t=o(e=>!e.startsWith("z."),"isNamedZodSchema"),$P=o(e=>e.startsWith(Ts),"isEnumZodSchema"),Yi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),rl=o(e=>pt(`${e}_${ab}`),"getBodyZodSchemaName"),wP=o((e,t)=>pt(`${e}_${t}${cb}`),"getParamZodSchemaName"),oD=o(e=>pt(`${e}${ub}`),"getMainResponseZodSchemaName"),sD=o((e,t)=>pt(`${e}_${t}_${lb}`),"getErrorResponseZodSchemaName");function nl({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Yi(t,r,n);return!Ta(i)&&e!=="default"&&Ju(i)?sD(s,e):oD(s)}o(nl,"getResponseZodSchemaName");function Ma(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${He(hP(i))}: \`${e[i]}\``],[])}o(Ma,"getSchemaDescriptions");var ka=o((e,t)=>pP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),AP=o((e,t)=>$t(t)?`${e.options.tsNamespaces?`${Ze({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Qi=o((e,t,r)=>{if(!$t(t))return t===Cs?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${Ze({type:"models",tag:n,options:e.options})}.`:""}${ka(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function IP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(IP,"getZodSchemaType");function CP(e){if(e.schemaObj)return[e.schemaObj.description,...Ma(e.schemaObj).join(". ")].filter(Boolean)}o(CP,"getZodSchemaDescription");function TP(e,t,r){var n;if(we(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Qi(e,i,r):void 0}if(Ku(t)){if(!we(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Qi(e,i,r)}[]`:void 0}if(Ca.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return TP(e,i[0],r)}return t.type}o(TP,"getType");function RP(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 p=e.resolveObject(c.schema),f=[p.description,...Ma(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:TP(e,c.schema,r)??"unknown",description:f.join(". ")})}return jt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(we(c)){let u=e.resolveObject(c);jt(u,{data:{pathSegments:[]},onSchema:a})}}),jt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(RP,"getZodSchemaPropertyDescriptions");function ci({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Zm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Zm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>ka(u,e.options),"getEntityName"),options:e.options});return aD(e.options,a,c)}o(ci,"getModelsImports");function NP({tag:e,endpoints:t,options:r}){return Zm({type:"endpoints",tag:e,entities:t,getTag:o(n=>Da(n,r),"getTag"),getEntityName:qa,options:r})}o(NP,"getEndpointsImports");function jP({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?Ze({type:n,tag:a,options:i}):c],from:`${bn(i)}${il({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(jP,"getEntityImports");function bn(e){let t=jf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Nf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Nf}`,"g"),jf)),`${t}/`.replace(/\/\//g,"/")}o(bn,"getImportPath");function Zm({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?Ze({type:e,tag:u,options:s}):i(c)],from:`${l?"./":bn(s)}${il({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Zm,"getImports");function aD(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:Xt(n.bindings)}))}o(aD,"mergeImports");function Ji({fileName:e,extension:t}){return`${e}.${t}`}o(Ji,"getFileNameWithExtension");function MP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ri(t)}/`:""}${ri(t)}.${i}`:i}o(MP,"getTagFileNameWithoutExtension");function il(...e){return MP(...e)}o(il,"getTagImportPath");function ol(...e){return`${MP(...e)}.ts`}o(ol,"getTagFileName");var Ze=o(({type:e,tag:t,options:r})=>`${He(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function kP(e){return e.standalone?`${bn(e)}${Ic.fileName}`:e.restClientImportPath}o(kP,"getAppRestClientImportPath");function qP(e){return e.standalone?`${bn(e)}${Ac.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(qP,"getQueryTypesImportPath");function DP(e){return`${bn(e)}${Cc.fileName}`}o(DP,"getQueryModulesImportPath");function LP(e){return`${bn(e)}${Tc.fileName}`}o(LP,"getMutationEffectsImportPath");function FP(e){return`${bn(e)}${tl.fileName}`}o(FP,"getAclCheckImportPath");function HP(e){return`${bn(e)}${Rc.fileName}`}o(HP,"getZodExtendedImportPath");function BP(){return`./${el.fileName}`}o(BP,"getAppAbilitiesImportPath");function VP(e){return xt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(VP,"primitiveTypeToTsType");var qa=o(e=>ri(pt(e.operationName)),"getEndpointName");function UP(e,t){return`${t.tsNamespaces?`${Ze({type:"endpoints",tag:Da(e,t),options:t})}.`:""}${qa(e)}`}o(UP,"getImportedEndpointName");var GP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Da(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return oi(r??t.defaultTag)}o(Da,"getEndpointTag");function ni(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if($t(i.zodSchema))s=Qi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Rt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Wi(p)&&(s=VP(p))}return{name:Yn(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!==Zu)&&(!(r!=null&&r.excludePageParam)||i.name!==$a.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===$a.pageParamName?"pageParam":i.name}))}o(ni,"mapEndpointParamsToFunctionParams");function zP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=iP(i.name)?i.name:`"${i.name}"`,a=Yn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Nm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Nm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Yn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(zP,"getEndpointConfig");function ZP(e,t){return t.filter(r=>Jt(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(ZP,"getUpdateQueryEndpoints");var Wm=["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 Xi(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Xi,"pick");function cs(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=si(e,t),i=xP(n,t);return r||i}o(cs,"isOperationExcluded");function Km({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${SP(e)}`,u=r.operationId?Yn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:He(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=mP(u,i);l===""?u=t.toLowerCase():Wm.includes(l)||(u=l)}return Wm.includes(u)?c:u}o(Km,"getOperationName");function La({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?si(r,n):n.defaultTag,s=o(a=>{let c=Km({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Km({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Km({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(La,"getUniqueOperationName");function WP(e,t,r){let n=[];for(let i in e.paths){if(Ki(i,r))continue;let s=e.paths[i],a=Xi(s,zi);for(let c in a){let u=a[c];if(!u||cs(u,r))continue;let l=La({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(WP,"getUniqueOperationNamesWithoutSplitByTags");function KP(e,t){let r={};for(let n in e.paths){if(Ki(n,t))continue;let i=e.paths[n],s=Xi(i,zi);for(let a in s){let c=s[a];if(!c||cs(c,t))continue;let u=t.splitByTags?si(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(KP,"getOperationsByTag");function Fa(e){return{type:"invalid-schema",message:e}}o(Fa,"getInvalidSchemaError");function YP(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(YP,"getInvalidOperationIdError");function QP(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(QP,"getMissingPathParameterError");function JP(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(JP,"getNotAllowedInlineEnumError");function XP(e){return{type:"not-allowed-circular-schema",message:e}}o(XP,"getNotAllowedCircularSchemaError");function ex(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${al(t,r)}`}}o(ex,"getMissingAclConditionPropertyError");function Ym(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${sl(e)} in operation ${al(t,r)}`}}o(Ym,"getMissingStatusCodeError");function tx(e,t,r){return{type:"invalid-status-code",message:`Operation ${al(t,r)} expected HTTP status code ${sl(e.expected)} but received ${sl(e.received)}`}}o(tx,"getInvalidStatusCodeError");function rx(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${al(t,r)} has multiple success HTTP status codes: ${e.map(sl).join(", ")}`}}o(rx,"getMultipleSuccessStatusCodesError");function al(e,t){return e.operationId??`${t.method} ${t.path}`}o(al,"getOperationDescriptor");function sl(e){return`${e} (${tP[e]})`}o(sl,"getStatusCodeDescription");function nx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(nx,"groupByType");function an({schema:e,meta:t,options:r}){let n=[];xt(e.type).with("string",()=>n.push(lD(e,r))).with("number","integer",()=>n.push(pD(e))).with("array",()=>n.push(dD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
140
+ `);return s!==-1&&(t=bb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Ns.prototype,_o);var Q6=Ns(),J6=Ns({level:_b?_b.level:0});var Vr=new qc;function js(e,t,r){console.log(r!==void 0&&r!==t?`${Vr.yellow(`${e}:`.padEnd(20))}${Vr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(js,"logVariable");function fr(e){console.log(`[INFO] ${e}`)}o(fr,"logInfo");function Rn(e){console.log(Vr.green(`[SUCCESS] ${e}`))}o(Rn,"logSuccess");function Ms(e,t){e instanceof Error?(console.log(Vr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Vr.red(`[ERROR] ${e}`))}o(Ms,"logError");function Lc(e){console.log(Vr.bgYellow(`==== ${e} ====`))}o(Lc,"logBanner");var Ob=mt(require("fs"));function So(){return"0.13.4"}o(So,"getVersion");var fH=mt(xb());var Bf=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Bf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(Bf,s,t)}}}o(Ee,"YargOption");function $b(e){let t=Reflect.getMetadata(Bf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o($b,"getYargsOption");function Fc(e){return async t=>t.options(tw(e)).middleware(async r=>await rw(e,r),!0)}o(Fc,"getBuilder");function tw(e){return Object.entries($b(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(tw,"getYargsOptions");async function rw(e,t){let r=new e;for(let[n,i]of Object.entries($b(e)))r[n]=t[n]??i.default;return r}o(rw,"loadYargsConfig");var Ax=mt(Rm());var tP={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"},rP={"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 kr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},nP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},$a={pageParamName:"page"},zu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},wa="moduleName";var Nm={"Content-Type":"application/json",Accept:"application/json"},Zu="data",jm="axios",Kn="config",en="AxiosRequestConfig",Wu={defaultImport:jm,bindings:[en],from:"axios"};var iP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Yn=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 we(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(we,"isReferenceObject");function Rt(e){return!we(e)}o(Rt,"isSchemaObject");function Ku(e){return e.type==="array"}o(Ku,"isArraySchemaObject");function oP(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(Qq(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(we(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(oP,"inferRequiredSchema");var Qq=o(e=>!we(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var yn=Symbol.for("@ts-pattern/matcher"),Jq=Symbol.for("@ts-pattern/isVariadic"),Qu="@ts-pattern/anonymous-select-key",Mm=o(e=>!!(e&&typeof e=="object"),"r"),Yu=o(e=>e&&!!e[yn],"i"),nn=o((e,t,r)=>{if(Yu(e)){let n=e[yn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Mm(e)){if(!Mm(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];Yu(c)&&c[Jq]?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,p)=>nn(l,a[p],r))&&i.every((l,p)=>nn(l,c[p],r))&&(s.length===0||nn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>nn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Yu(s=i)&&s[yn]().matcherType==="optional")&&nn(i,t[n],r);var s})}return Object.is(t,e)},"s"),ti=o(e=>{var t,r,n;return Mm(e)?Yu(e)?(t=(r=(n=e[yn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ia(e,ti):Ia(Object.values(e),ti):[]},"o"),Ia=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function yr(e){return Object.assign(e,{optional:o(()=>Xq(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>eD(e,t),"or"),select:o(t=>t===void 0?sP(e):sP(t,e),"select")})}o(yr,"u");function Xq(e){return yr({[yn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(ti(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:nn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>ti(e),"getSelectionKeys"),matcherType:"optional"})})}o(Xq,"h");function Ge(...e){return yr({[yn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,ti),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function eD(...e){return yr({[yn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ia(e,ti).forEach(i=>n(i,void 0)),{matched:e.some(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,ti),"getSelectionKeys"),matcherType:"or"})})}o(eD,"d");function $e(e){return{[yn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o($e,"p");function sP(...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 yr({[yn]:()=>({match:o(n=>{let i={[t??Qu]:n};return{matched:r===void 0||nn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Qu].concat(r===void 0?[]:ti(r)),"getSelectionKeys")})})}o(sP,"y");function tn(e){return typeof e=="number"}o(tn,"v");function Qn(e){return typeof e=="string"}o(Qn,"b");function Jn(e){return typeof e=="bigint"}o(Jn,"w");var IU=yr($e(function(e){return!0}));var Xn=o(e=>Object.assign(yr(e),{startsWith:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Xn(Ge(e,(r=>$e(n=>Qn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Xn(Ge(e,(r=>$e(n=>Qn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Xn(Ge(e,(r=>$e(n=>Qn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Xn(Ge(e,(r=t,$e(n=>Qn(n)&&!!n.match(r)))));var r},"regex")}),"j"),CU=Xn($e(Qn)),rn=o(e=>Object.assign(yr(e),{between:o((t,r)=>rn(Ge(e,((n,i)=>$e(s=>tn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n<r))(t))),"lt"),gt:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n>r))(t))),"gt"),lte:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n<=r))(t))),"lte"),gte:o(t=>rn(Ge(e,(r=>$e(n=>tn(n)&&n>=r))(t))),"gte"),int:o(()=>rn(Ge(e,$e(t=>tn(t)&&Number.isInteger(t)))),"int"),finite:o(()=>rn(Ge(e,$e(t=>tn(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>rn(Ge(e,$e(t=>tn(t)&&t>0))),"positive"),negative:o(()=>rn(Ge(e,$e(t=>tn(t)&&t<0))),"negative")}),"x"),TU=rn($e(tn)),ei=o(e=>Object.assign(yr(e),{between:o((t,r)=>ei(Ge(e,((n,i)=>$e(s=>Jn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n<r))(t))),"lt"),gt:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n>r))(t))),"gt"),lte:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n<=r))(t))),"lte"),gte:o(t=>ei(Ge(e,(r=>$e(n=>Jn(n)&&n>=r))(t))),"gte"),positive:o(()=>ei(Ge(e,$e(t=>Jn(t)&&t>0))),"positive"),negative:o(()=>ei(Ge(e,$e(t=>Jn(t)&&t<0))),"negative")}),"A"),RU=ei($e(Jn)),NU=yr($e(function(e){return typeof e=="boolean"})),jU=yr($e(function(e){return typeof e=="symbol"})),MU=yr($e(function(e){return e==null})),kU=yr($e(function(e){return e!=null}));var Lm=class Lm 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(Lm,"W");var km=Lm,qm={matched:!1,value:void 0};function xt(e){return new Dm(e,qm)}o(xt,"z");var Aa=class Aa{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,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>nn(l,this.input,c))||i&&!i(this.input)?qm:{matched:!0,value:r(s?Qu in a?a[Qu]:a:this.input,this.input)};return new Aa(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Aa(this.input,n?{matched:!0,value:r(this.input,this.input)}:qm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new km(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Aa,"I");var Dm=Aa;var Fm=2,aP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],cP=["query","header","path"],zi=["get","put","post","delete","options","head","patch","trace"],uP=["string","number","integer","boolean"],Ca=["allOf","anyOf","oneOf"];var He=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ri=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),lP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),fP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Hm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),pP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),tD=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"),Bm=o(e=>{let t=e.map(He).map(dP).map(r=>rD(r)).flat();return tD(t)},"getMostCommonAdjacentCombinationSplit"),dP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),hP=o(e=>dP(e).join(" "),"camelToSpaceSeparated"),rD=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"),mP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ri(r)}|${He(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var yP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Zi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ss=o(e=>Zi(e).split("/").at(-1),"getSchemaNameByRef");function Um(e){let t=nD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Um,"normalizeString");function bP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(bP,"wrapWithQuotesIfNeeded");function vP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(vP,"unwrapQuotesIfNeeded");function nD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(nD,"prefixStringStartingWithNumberIfNeeded");function Gm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Gm,"pathParamToVariableName");var Wi=o(e=>uP.includes(e),"isPrimitiveType");function _P(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(_P,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||aP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ta(e){return e>=200&&e<300}o(Ta,"isMainResponseStatus");function Ju(e){return!(e>=200&&e<300)}o(Ju,"isErrorStatus");function Xu(e){return e.startsWith("application/")}o(Xu,"isMediaTypeAllowed");var gP=/({\w+})/g,iD=/[^\w\-]+/g;function SP(e){e=He(lP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(gP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(gP,"")}By${He(r.slice(1,-1))}`}return e.replace(iD,"_")}o(SP,"pathToVariableName");var Vm=/{(\b\w+(?:-\w+)*\b)}/g;function EP(e){let t=e.match(Vm);return t===null?e.replaceAll(Vm,":$1"):(t.forEach(r=>{let n=Gm(r.replaceAll(Vm,":$1"));e=e.replaceAll(r,n)}),e)}o(EP,"replaceHyphenatedPath");var OP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Rt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Ki=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Jt=o(e=>e.method==="get","isQuery"),ii=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),as=o((e,t)=>Jt(e)&&(t??Object.values($a)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),PP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ni(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ni(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function oi(e){return fP(e)}o(oi,"formatTag");function si(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return oi(r??t.defaultTag)}o(si,"getOperationTag");function xP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(xP,"isTagExcluded");var el={fileName:"acl/app.ability",extension:"ts"},Ra="AllAbilities",Na="AppAbilities",tl={fileName:"acl/useAclCheck",extension:"ts"},ai="useAclCheck",Nt={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},zm={bindings:[Nt.abilityTuple,Nt.pureAbility,Nt.forcedSubject,Nt.subject],from:"@casl/ability"};var Xt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function jt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(we(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ca.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&&jt(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&&jt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;jt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;jt(s,t)}}o(jt,"iterateSchema");var sn=o((e,t)=>Hm(He(Um(e)),t),"getZodSchemaName"),ja=o((e,t,r)=>Hm(He(Um(e)),`${t}${r}`),"getEnumZodSchemaName"),$t=o(e=>!e.startsWith("z."),"isNamedZodSchema"),$P=o(e=>e.startsWith(Ts),"isEnumZodSchema"),Yi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),rl=o(e=>pt(`${e}_${ab}`),"getBodyZodSchemaName"),wP=o((e,t)=>pt(`${e}_${t}${cb}`),"getParamZodSchemaName"),oD=o(e=>pt(`${e}${ub}`),"getMainResponseZodSchemaName"),sD=o((e,t)=>pt(`${e}_${t}_${lb}`),"getErrorResponseZodSchemaName");function nl({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Yi(t,r,n);return!Ta(i)&&e!=="default"&&Ju(i)?sD(s,e):oD(s)}o(nl,"getResponseZodSchemaName");function Ma(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${He(hP(i))}: \`${e[i]}\``],[])}o(Ma,"getSchemaDescriptions");var ka=o((e,t)=>pP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),AP=o((e,t)=>$t(t)?`${e.options.tsNamespaces?`${Ze({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Qi=o((e,t,r)=>{if(!$t(t))return t===Cs?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${Ze({type:"models",tag:n,options:e.options})}.`:""}${ka(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function IP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(IP,"getZodSchemaType");function CP(e){if(e.schemaObj)return[e.schemaObj.description,...Ma(e.schemaObj).join(". ")].filter(Boolean)}o(CP,"getZodSchemaDescription");function TP(e,t,r){var n;if(we(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Qi(e,i,r):void 0}if(Ku(t)){if(!we(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Qi(e,i,r)}[]`:void 0}if(Ca.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return TP(e,i[0],r)}return t.type}o(TP,"getType");function RP(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 p=e.resolveObject(c.schema),f=[p.description,...Ma(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:TP(e,c.schema,r)??"unknown",description:f.join(". ")})}return jt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(we(c)){let u=e.resolveObject(c);jt(u,{data:{pathSegments:[]},onSchema:a})}}),jt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(RP,"getZodSchemaPropertyDescriptions");function ci({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Zm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Zm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>ka(u,e.options),"getEntityName"),options:e.options});return aD(e.options,a,c)}o(ci,"getModelsImports");function NP({tag:e,endpoints:t,options:r}){return Zm({type:"endpoints",tag:e,entities:t,getTag:o(n=>Da(n,r),"getTag"),getEntityName:qa,options:r})}o(NP,"getEndpointsImports");function jP({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?Ze({type:n,tag:a,options:i}):c],from:`${bn(i)}${il({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(jP,"getEntityImports");function bn(e){let t=jf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Nf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Nf}`,"g"),jf)),`${t}/`.replace(/\/\//g,"/")}o(bn,"getImportPath");function Zm({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?Ze({type:e,tag:u,options:s}):i(c)],from:`${l?"./":bn(s)}${il({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Zm,"getImports");function aD(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:Xt(n.bindings)}))}o(aD,"mergeImports");function Ji({fileName:e,extension:t}){return`${e}.${t}`}o(Ji,"getFileNameWithExtension");function MP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ri(t)}/`:""}${ri(t)}.${i}`:i}o(MP,"getTagFileNameWithoutExtension");function il(...e){return MP(...e)}o(il,"getTagImportPath");function ol(...e){return`${MP(...e)}.ts`}o(ol,"getTagFileName");var Ze=o(({type:e,tag:t,options:r})=>`${He(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function kP(e){return e.standalone?`${bn(e)}${Ic.fileName}`:e.restClientImportPath}o(kP,"getAppRestClientImportPath");function qP(e){return e.standalone?`${bn(e)}${Ac.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(qP,"getQueryTypesImportPath");function DP(e){return`${bn(e)}${Cc.fileName}`}o(DP,"getQueryModulesImportPath");function LP(e){return`${bn(e)}${Tc.fileName}`}o(LP,"getMutationEffectsImportPath");function FP(e){return`${bn(e)}${tl.fileName}`}o(FP,"getAclCheckImportPath");function HP(e){return`${bn(e)}${Rc.fileName}`}o(HP,"getZodExtendedImportPath");function BP(){return`./${el.fileName}`}o(BP,"getAppAbilitiesImportPath");function VP(e){return xt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(VP,"primitiveTypeToTsType");var qa=o(e=>ri(pt(e.operationName)),"getEndpointName");function UP(e,t){return`${t.tsNamespaces?`${Ze({type:"endpoints",tag:Da(e,t),options:t})}.`:""}${qa(e)}`}o(UP,"getImportedEndpointName");var GP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Da(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return oi(r??t.defaultTag)}o(Da,"getEndpointTag");function ni(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if($t(i.zodSchema))s=Qi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Rt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Wi(p)&&(s=VP(p))}return{name:Yn(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!==Zu)&&(!(r!=null&&r.excludePageParam)||i.name!==$a.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===$a.pageParamName?"pageParam":i.name}))}o(ni,"mapEndpointParamsToFunctionParams");function zP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=iP(i.name)?i.name:`"${i.name}"`,a=Yn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Nm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Nm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Yn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(zP,"getEndpointConfig");function ZP(e,t){return t.filter(r=>Jt(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(ZP,"getUpdateQueryEndpoints");var Wm=["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 Xi(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Xi,"pick");function cs(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=si(e,t),i=xP(n,t);return r||i}o(cs,"isOperationExcluded");function Km({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${SP(e)}`,u=r.operationId?Yn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:He(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=mP(u,i);l===""?u=t.toLowerCase():Wm.includes(l)||(u=l)}return Wm.includes(u)?c:u}o(Km,"getOperationName");function La({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?si(r,n):n.defaultTag,s=o(a=>{let c=Km({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Km({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Km({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(La,"getUniqueOperationName");function WP(e,t,r){let n=[];for(let i in e.paths){if(Ki(i,r))continue;let s=e.paths[i],a=Xi(s,zi);for(let c in a){let u=a[c];if(!u||cs(u,r))continue;let l=La({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(WP,"getUniqueOperationNamesWithoutSplitByTags");function KP(e,t){let r={};for(let n in e.paths){if(Ki(n,t))continue;let i=e.paths[n],s=Xi(i,zi);for(let a in s){let c=s[a];if(!c||cs(c,t))continue;let u=t.splitByTags?si(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(KP,"getOperationsByTag");function Fa(e){return{type:"invalid-schema",message:e}}o(Fa,"getInvalidSchemaError");function YP(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(YP,"getInvalidOperationIdError");function QP(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(QP,"getMissingPathParameterError");function JP(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(JP,"getNotAllowedInlineEnumError");function XP(e){return{type:"not-allowed-circular-schema",message:e}}o(XP,"getNotAllowedCircularSchemaError");function ex(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${al(t,r)}`}}o(ex,"getMissingAclConditionPropertyError");function Ym(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${sl(e)} in operation ${al(t,r)}`}}o(Ym,"getMissingStatusCodeError");function tx(e,t,r){return{type:"invalid-status-code",message:`Operation ${al(t,r)} expected HTTP status code ${sl(e.expected)} but received ${sl(e.received)}`}}o(tx,"getInvalidStatusCodeError");function rx(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${al(t,r)} has multiple success HTTP status codes: ${e.map(sl).join(", ")}`}}o(rx,"getMultipleSuccessStatusCodesError");function al(e,t){return e.operationId??`${t.method} ${t.path}`}o(al,"getOperationDescriptor");function sl(e){return`${e} (${tP[e]})`}o(sl,"getStatusCodeDescription");function nx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(nx,"groupByType");function an({schema:e,meta:t,options:r}){let n=[];xt(e.type).with("string",()=>n.push(lD(e,r))).with("number","integer",()=>n.push(pD(e))).with("array",()=>n.push(dD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
141
141
  `,"\r",`\r
142
142
  `].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(cD({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?uD(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(an,"getZodChain");function cD({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(cD,"getZodChainablePresence");function uD(e){return e.default!==void 0?`default(${xt(e.type).with("number","integer",()=>vP(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(uD,"getZodChainableDefault");function lD(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${fD(e.pattern)})`),e.format){let n=xt(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(lD,"getZodChainableStringValidations");function fD(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=_P(e),`/${e}/`}o(fD,"formatPatternIfNeeded");function pD(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(pD,"getZodChainableNumberValidations");function dD(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(dD,"getZodChainableArrayValidations");var eo=o(e=>e.reduce((t,r)=>t+r,0),"sum");function dt(e,t){if(!t)return e;if(we(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?er("oneOf")+dt(e,{...t,type:t.type[0]}):e+er("oneOf")+eo(t.type.map(r=>dt(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?er("oneOf")+dt(e,t.oneOf[0]):e+er("oneOf")+eo(t.oneOf.map(r=>dt(0,r)));if(t.anyOf)return t.anyOf.length===1?er("anyOf")+dt(e,t.anyOf[0]):e+er("anyOf")+eo(t.anyOf.map(r=>dt(0,r)));if(t.allOf)return t.allOf.length===1?er("allOf")+dt(e,t.allOf[0]):e+er("allOf")+eo(t.allOf.map(r=>dt(0,r)));if(!t.type)return e;if(Wi(t.type))return t.enum?e+ix(t)+er("enum")+eo(t.enum.map(r=>dt(0,r))):e+ix(t);if(t.type==="array")return t.items?er("array")+dt(e,t.items):er("array")+dt(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=er("object")+eo(r.map(n=>dt(0,n)))}else e+=er("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=dt(0,t.additionalProperties):e+=dt(1))}return e}o(dt,"getOpenAPISchemaComplexity");function ix(e){return xt(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(ix,"complexityByType");function er(e){return xt(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(er,"complexityByComposite");var Qm=class Qm{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;we(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?`${Ze({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return dt(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Qm,"ZodSchema");var Ha=Qm;function Qe({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new Ha(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(we(e))return hD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=gD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=mD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=yD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=bD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=vD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Ku(e))return e.items?i.assign(`z.array(${Qe({...a,schema:e.items}).getCodeString(n,t.options)}${an({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let h=e.type?e.type.toLowerCase():void 0;if(h==="object"||e.properties||e.additionalProperties){let b=e.required&&e.required.length>0,g=t.options.withImplicitRequiredProps?!1:e.properties&&!((y=e.required)!=null&&y.length),P="{}";e.properties&&(P="{ "+Object.entries(e.properties).map(([te,J])=>{var M;let Pe={...s,isRequired:g?!0:b?(M=e.required)==null?void 0:M.includes(te):t.options.withImplicitRequiredProps,name:te,isParentPartial:g},Ae=J;if(we(J)&&t&&(Ae=t.getSchemaByRef(J.$ref),!Ae))throw new Error(`Schema ${J.$ref} not found`);let re=Qe({...a,schema:J,meta:Pe}).getCodeString(n,t.options)+an({schema:Ae,meta:Pe,options:t.options});return[te,re]}).map(([te,J])=>`${bP(te)}: ${J}`).join(", ")+" }");let $="";e.additionalProperties&&($=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Qe({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+an({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let C=g?".partial()":"",T=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${C}${T}${$}${d}`)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(Qe,"getZodSchema");function hD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!we(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=Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(hD,"getReferenceZodSchema");function mD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Rt(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Qe({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=>Rt(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
143
143
  z.discriminatedUnion("${c}", [${e.oneOf.map(u=>Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "0.13.3",
3
+ "version": "0.13.4",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"