@povio/openapi-codegen-cli 0.10.3 → 0.10.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/dist/index.js CHANGED
@@ -55,8 +55,8 @@ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-contr
55
55
  `+this.lexer.showPosition()+`
56
56
  Expecting `+ln.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Ya="Parse error on line "+(p+1)+": Unexpected "+(_==1?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Ya,{text:this.lexer.match,token:this.terminals_[_]||_,line:this.lexer.yylineno,loc:v,expected:ln})}}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+_);switch(T[0]){case 1:a.push(_),c.push(this.lexer.yytext),u.push(this.lexer.yylloc),a.push(T[1]),_=null,P?(_=P,P=null):(d=this.lexer.yyleng,f=this.lexer.yytext,p=this.lexer.yylineno,v=this.lexer.yylloc,m>0&&m--);break;case 2:if(Ce=this.productions_[T[1]][1],K.$=c[c.length-Ce],K._$={first_line:u[u.length-(Ce||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(Ce||1)].first_column,last_column:u[u.length-1].last_column},S&&(K._$.range=[u[u.length-(Ce||1)].range[0],u[u.length-1].range[1]]),se=this.performAction.call(K,f,d,p,this.yy,T[1],c,u),typeof se<"u")return se;Ce&&(a=a.slice(0,-1*Ce*2),c=c.slice(0,-1*Ce),u=u.slice(0,-1*Ce)),a.push(this.productions_[T[1]][0]),c.push(K.$),u.push(K._$),mi=l[a[a.length-2]][a[a.length-1]],a.push(mi);break;case 3:return!0}}return!0},"parse")},t=function(){var n={EOF:1,parseError:o(function(s,a){if(this.yy.parser)this.yy.parser.parseError(s,a);else throw new Error(s)},"parseError"),setInput:o(function(s){return this._input=s,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var a=s.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var a=s.length,c=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a-1),this.offset-=a;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var l=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[l[0],l[0]+this.yyleng-a]),this},"unput"),more:o(function(){return this._more=!0,this},"more"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),a=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
57
57
  `+a+"^"},"showPosition"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,a,c,u,l,f;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;d<p.length&&(c=this._input.match(this.rules[p[d]]),!(c&&(!a||c[0].length>a[0].length)&&(a=c,u=d,!this.options.flex)));d++);return a?(f=a[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],s=this.performAction.call(this,this.yy,this,p[u],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
58
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var s=this.next();return typeof s<"u"?s:this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){return this.conditionStack.pop()},"popState"),_currentRules:o(function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},"_currentRules"),topState:o(function(){return this.conditionStack[this.conditionStack.length-2]},"topState"),pushState:o(function(s){this.begin(s)},"begin")};return n.options={},n.performAction=o(function(s,a,c,u){function l(p,d){return a.yytext=a.yytext.substring(p,a.yyleng-d+p)}o(l,"strip");var f=u;switch(c){case 0:if(a.yytext.slice(-2)==="\\\\"?(l(0,1),this.begin("mu")):a.yytext.slice(-1)==="\\"?(l(0,1),this.begin("emu")):this.begin("mu"),a.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(l(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(a.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return a.yytext=l(1,2).replace(/\\"/g,'"'),80;break;case 32:return a.yytext=l(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return a.yytext=a.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},"anonymous"),n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n}();e.lexer=t;function r(){this.yy={}}return o(r,"Parser"),r.prototype=e,e.Parser=r,new r}();ka.default=Zk;p_.exports=ka.default});var Da=h((Ma,h_)=>{"use strict";Ma.__esModule=!0;function zk(e){return e&&e.__esModule?e:{default:e}}o(zk,"_interopRequireDefault");var Kk=Ye(),qf=zk(Kk);function ja(){this.parents=[]}o(ja,"Visitor");ja.prototype={constructor:ja,mutating:!1,acceptKey:o(function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!ja.prototype[n.type])throw new qf.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+t.type);t[r]=n}},"acceptKey"),acceptRequired:o(function(t,r){if(this.acceptKey(t,r),!t[r])throw new qf.default(t.type+" requires "+r)},"acceptRequired"),acceptArray:o(function(t){for(var r=0,n=t.length;r<n;r++)this.acceptKey(t,r),t[r]||(t.splice(r,1),r--,n--)},"acceptArray"),accept:o(function(t){if(t){if(!this[t.type])throw new qf.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var r=this[t.type](t);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return t}},"accept"),Program:o(function(t){this.acceptArray(t.body)},"Program"),MustacheStatement:qa,Decorator:qa,BlockStatement:d_,DecoratorBlock:d_,PartialStatement:m_,PartialBlockStatement:o(function(t){m_.call(this,t),this.acceptKey(t,"program")},"PartialBlockStatement"),ContentStatement:o(function(){},"ContentStatement"),CommentStatement:o(function(){},"CommentStatement"),SubExpression:qa,PathExpression:o(function(){},"PathExpression"),StringLiteral:o(function(){},"StringLiteral"),NumberLiteral:o(function(){},"NumberLiteral"),BooleanLiteral:o(function(){},"BooleanLiteral"),UndefinedLiteral:o(function(){},"UndefinedLiteral"),NullLiteral:o(function(){},"NullLiteral"),Hash:o(function(t){this.acceptArray(t.pairs)},"Hash"),HashPair:o(function(t){this.acceptRequired(t,"value")},"HashPair")};function qa(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}o(qa,"visitSubExpression");function d_(e){qa.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}o(d_,"visitBlock");function m_(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}o(m_,"visitPartial");Ma.default=ja;h_.exports=Ma.default});var y_=h((La,g_)=>{"use strict";La.__esModule=!0;function Qk(e){return e&&e.__esModule?e:{default:e}}o(Qk,"_interopRequireDefault");var Wk=Da(),Yk=Qk(Wk);function jt(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}o(jt,"WhitespaceControl");jt.prototype=new Yk.default;jt.prototype.Program=function(e){var t=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,i=0,s=n.length;i<s;i++){var a=n[i],c=this.accept(a);if(c){var u=Mf(n,i,r),l=Df(n,i,r),f=c.openStandalone&&u,p=c.closeStandalone&&l,d=c.inlineStandalone&&u&&l;c.close&&nn(n,i,!0),c.open&&Er(n,i,!0),t&&d&&(nn(n,i),Er(n,i)&&a.type==="PartialStatement"&&(a.indent=/([ \t]+$)/.exec(n[i-1].original)[1])),t&&f&&(nn((a.program||a.inverse).body),Er(n,i)),t&&p&&(nn(n,i),Er((a.inverse||a.program).body))}}return e};jt.prototype.BlockStatement=jt.prototype.DecoratorBlock=jt.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,r=e.program&&e.inverse,n=r,i=r;if(r&&r.chained)for(n=r.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var s={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:Df(t.body),closeStandalone:Mf((n||t).body)};if(e.openStrip.close&&nn(t.body,null,!0),r){var a=e.inverseStrip;a.open&&Er(t.body,null,!0),a.close&&nn(n.body,null,!0),e.closeStrip.open&&Er(i.body,null,!0),!this.options.ignoreStandalone&&Mf(t.body)&&Df(n.body)&&(Er(t.body),nn(n.body))}else e.closeStrip.open&&Er(t.body,null,!0);return s};jt.prototype.Decorator=jt.prototype.MustacheStatement=function(e){return e.strip};jt.prototype.PartialStatement=jt.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function Mf(e,t,r){t===void 0&&(t=e.length);var n=e[t-1],i=e[t-2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original)}o(Mf,"isPrevWhitespace");function Df(e,t,r){t===void 0&&(t=-1);var n=e[t+1],i=e[t+2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}o(Df,"isNextWhitespace");function nn(e,t,r){var n=e[t==null?0:t+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var i=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==i}}o(nn,"omitRight");function Er(e,t,r){var n=e[t==null?e.length-1:t-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var i=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==i,n.leftStripped}}o(Er,"omitLeft");La.default=jt;g_.exports=La.default});var v_=h(Je=>{"use strict";Je.__esModule=!0;Je.SourceLocation=ej;Je.id=tj;Je.stripFlags=rj;Je.stripComment=nj;Je.preparePath=ij;Je.prepareMustache=oj;Je.prepareRawBlock=sj;Je.prepareBlock=aj;Je.prepareProgram=cj;Je.preparePartialBlock=uj;function Jk(e){return e&&e.__esModule?e:{default:e}}o(Jk,"_interopRequireDefault");var Xk=Ye(),Lf=Jk(Xk);function Ff(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Lf.default(e.path.original+" doesn't match "+t,r)}}o(Ff,"validateClose");function ej(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}o(ej,"SourceLocation");function tj(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}o(tj,"id");function rj(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}o(rj,"stripFlags");function nj(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}o(nj,"stripComment");function ij(e,t,r){r=this.locInfo(r);for(var n=e?"@":"",i=[],s=0,a=0,c=t.length;a<c;a++){var u=t[a].part,l=t[a].original!==u;if(n+=(t[a].separator||"")+u,!l&&(u===".."||u==="."||u==="this")){if(i.length>0)throw new Lf.default("Invalid path: "+n,{loc:r});u===".."&&s++}else i.push(u)}return{type:"PathExpression",data:e,depth:s,parts:i,original:n,loc:r}}o(ij,"preparePath");function oj(e,t,r,n,i,s){var a=n.charAt(3)||n.charAt(2),c=a!=="{"&&a!=="&",u=/\*/.test(n);return{type:u?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:c,strip:i,loc:this.locInfo(s)}}o(oj,"prepareMustache");function sj(e,t,r,n){Ff(e,r),n=this.locInfo(n);var i={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}o(sj,"prepareRawBlock");function aj(e,t,r,n,i,s){n&&n.path&&Ff(e,n);var a=/\*/.test(e.open);t.blockParams=e.blockParams;var c=void 0,u=void 0;if(r){if(a)throw new Lf.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),u=r.strip,c=r.program}return i&&(i=c,c=t,t=i),{type:a?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:c,openStrip:e.strip,inverseStrip:u,closeStrip:n&&n.strip,loc:this.locInfo(s)}}o(aj,"prepareBlock");function cj(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}o(cj,"prepareProgram");function uj(e,t,r,n){return Ff(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}o(uj,"preparePartialBlock")});var __=h(No=>{"use strict";No.__esModule=!0;No.parseWithoutProcessing=b_;No.parse=yj;function lj(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}o(lj,"_interopRequireWildcard");function S_(e){return e&&e.__esModule?e:{default:e}}o(S_,"_interopRequireDefault");var pj=f_(),Vf=S_(pj),fj=y_(),dj=S_(fj),mj=v_(),hj=lj(mj),gj=Ee();No.parser=Vf.default;var Fa={};gj.extend(Fa,hj);function b_(e,t){if(e.type==="Program")return e;Vf.default.yy=Fa,Fa.locInfo=function(n){return new Fa.SourceLocation(t&&t.srcName,n)};var r=Vf.default.parse(e);return r}o(b_,"parseWithoutProcessing");function yj(e,t){var r=b_(e,t),n=new dj.default(t);return n.accept(r)}o(yj,"parse")});var O_=h(jo=>{"use strict";jo.__esModule=!0;jo.Compiler=Hf;jo.precompile=_j;jo.compile=Pj;function E_(e){return e&&e.__esModule?e:{default:e}}o(E_,"_interopRequireDefault");var vj=Ye(),Co=E_(vj),ko=Ee(),Sj=jf(),Ro=E_(Sj),bj=[].slice;function Hf(){}o(Hf,"Compiler");Hf.prototype={compiler:Hf,equals:o(function(t){var r=this.opcodes.length;if(t.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var i=this.opcodes[n],s=t.opcodes[n];if(i.opcode!==s.opcode||!$_(i.args,s.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(t.children[n]))return!1;return!0},"equals"),guid:0,compile:o(function(t,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=ko.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(t)},"compile"),compileProgram:o(function(t){var r=new this.compiler,n=r.compile(t,this.options),i=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[i]=n,this.useDepths=this.useDepths||n.useDepths,i},"compileProgram"),accept:o(function(t){if(!this[t.type])throw new Co.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var r=this[t.type](t);return this.sourceNode.shift(),r},"accept"),Program:o(function(t){this.options.blockParams.unshift(t.blockParams);for(var r=t.body,n=r.length,i=0;i<n;i++)this.accept(r[i]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=t.blockParams?t.blockParams.length:0,this},"Program"),BlockStatement:o(function(t){P_(t);var r=t.program,n=t.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var i=this.classifySexpr(t);i==="helper"?this.helperSexpr(t,r,n):i==="simple"?(this.simpleSexpr(t),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},"BlockStatement"),DecoratorBlock:o(function(t){var r=t.program&&this.compileProgram(t.program),n=this.setupFullMustacheParams(t,r,void 0),i=t.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,i.original)},"DecoratorBlock"),PartialStatement:o(function(t){this.usePartial=!0;var r=t.program;r&&(r=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new Co.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var i=t.name.original,s=t.name.type==="SubExpression";s&&this.accept(t.name),this.setupFullMustacheParams(t,r,void 0,!0);var a=t.indent||"";this.options.preventIndent&&a&&(this.opcode("appendContent",a),a=""),this.opcode("invokePartial",s,i,a),this.opcode("append")},"PartialStatement"),PartialBlockStatement:o(function(t){this.PartialStatement(t)},"PartialBlockStatement"),MustacheStatement:o(function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},"MustacheStatement"),Decorator:o(function(t){this.DecoratorBlock(t)},"Decorator"),ContentStatement:o(function(t){t.value&&this.opcode("appendContent",t.value)},"ContentStatement"),CommentStatement:o(function(){},"CommentStatement"),SubExpression:o(function(t){P_(t);var r=this.classifySexpr(t);r==="simple"?this.simpleSexpr(t):r==="helper"?this.helperSexpr(t):this.ambiguousSexpr(t)},"SubExpression"),ambiguousSexpr:o(function(t,r,n){var i=t.path,s=i.parts[0],a=r!=null||n!=null;this.opcode("getContext",i.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",n),i.strict=!0,this.accept(i),this.opcode("invokeAmbiguous",s,a)},"ambiguousSexpr"),simpleSexpr:o(function(t){var r=t.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},"simpleSexpr"),helperSexpr:o(function(t,r,n){var i=this.setupFullMustacheParams(t,r,n),s=t.path,a=s.parts[0];if(this.options.knownHelpers[a])this.opcode("invokeKnownHelper",i.length,a);else{if(this.options.knownHelpersOnly)throw new Co.default("You specified knownHelpersOnly, but used the unknown helper "+a,t);s.strict=!0,s.falsy=!0,this.accept(s),this.opcode("invokeHelper",i.length,s.original,Ro.default.helpers.simpleId(s))}},"helperSexpr"),PathExpression:o(function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=Ro.default.helpers.scopedId(t),i=!t.depth&&!n&&this.blockParamIndex(r);i?this.opcode("lookupBlockParam",i,t.parts):r?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n):this.opcode("pushContext")},"PathExpression"),StringLiteral:o(function(t){this.opcode("pushString",t.value)},"StringLiteral"),NumberLiteral:o(function(t){this.opcode("pushLiteral",t.value)},"NumberLiteral"),BooleanLiteral:o(function(t){this.opcode("pushLiteral",t.value)},"BooleanLiteral"),UndefinedLiteral:o(function(){this.opcode("pushLiteral","undefined")},"UndefinedLiteral"),NullLiteral:o(function(){this.opcode("pushLiteral","null")},"NullLiteral"),Hash:o(function(t){var r=t.pairs,n=0,i=r.length;for(this.opcode("pushHash");n<i;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},"Hash"),opcode:o(function(t){this.opcodes.push({opcode:t,args:bj.call(arguments,1),loc:this.sourceNode[0].loc})},"opcode"),addDepth:o(function(t){t&&(this.useDepths=!0)},"addDepth"),classifySexpr:o(function(t){var r=Ro.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),i=!n&&Ro.default.helpers.helperExpression(t),s=!n&&(i||r);if(s&&!i){var a=t.path.parts[0],c=this.options;c.knownHelpers[a]?i=!0:c.knownHelpersOnly&&(s=!1)}return i?"helper":s?"ambiguous":"simple"},"classifySexpr"),pushParams:o(function(t){for(var r=0,n=t.length;r<n;r++)this.pushParam(t[r])},"pushParams"),pushParam:o(function(t){var r=t.value!=null?t.value:t.original||"";if(this.stringParams)r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",r,t.type),t.type==="SubExpression"&&this.accept(t);else{if(this.trackIds){var n=void 0;if(t.parts&&!Ro.default.helpers.scopedId(t)&&!t.depth&&(n=this.blockParamIndex(t.parts[0])),n){var i=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,i)}else r=t.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,r)}this.accept(t)}},"pushParam"),setupFullMustacheParams:o(function(t,r,n,i){var s=t.params;return this.pushParams(s),this.opcode("pushProgram",r),this.opcode("pushProgram",n),t.hash?this.accept(t.hash):this.opcode("emptyHash",i),s},"setupFullMustacheParams"),blockParamIndex:o(function(t){for(var r=0,n=this.options.blockParams.length;r<n;r++){var i=this.options.blockParams[r],s=i&&ko.indexOf(i,t);if(i&&s>=0)return[r,s]}},"blockParamIndex")};function _j(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new Co.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);t=t||{},"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=r.parse(e,t),i=new r.Compiler().compile(n,t);return new r.JavaScriptCompiler().compile(i,t)}o(_j,"precompile");function Pj(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new Co.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=ko.extend({},t),"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function i(){var a=r.parse(e,t),c=new r.Compiler().compile(a,t),u=new r.JavaScriptCompiler().compile(c,t,void 0,!0);return r.template(u)}o(i,"compileInput");function s(a,c){return n||(n=i()),n.call(this,a,c)}return o(s,"ret"),s._setup=function(a){return n||(n=i()),n._setup(a)},s._child=function(a,c,u,l){return n||(n=i()),n._child(a,c,u,l)},s}o(Pj,"compile");function $_(e,t){if(e===t)return!0;if(ko.isArray(e)&&ko.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!$_(e[r],t[r]))return!1;return!0}}o($_,"argEquals");function P_(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}o(P_,"transformLiteralToPath")});var w_=h(Bf=>{var x_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Bf.encode=function(e){if(0<=e&&e<x_.length)return x_[e];throw new TypeError("Must be between 0 and 63: "+e)};Bf.decode=function(e){var t=65,r=90,n=97,i=122,s=48,a=57,c=43,u=47,l=26,f=52;return t<=e&&e<=r?e-t:n<=e&&e<=i?e-n+l:s<=e&&e<=a?e-s+f:e==c?62:e==u?63:-1}});var Zf=h(Gf=>{var A_=w_(),Uf=5,I_=1<<Uf,T_=I_-1,N_=I_;function Ej(e){return e<0?(-e<<1)+1:(e<<1)+0}o(Ej,"toVLQSigned");function $j(e){var t=(e&1)===1,r=e>>1;return t?-r:r}o($j,"fromVLQSigned");Gf.encode=o(function(t){var r="",n,i=Ej(t);do n=i&T_,i>>>=Uf,i>0&&(n|=N_),r+=A_.encode(n);while(i>0);return r},"base64VLQ_encode");Gf.decode=o(function(t,r,n){var i=t.length,s=0,a=0,c,u;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=A_.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));c=!!(u&N_),u&=T_,s=s+(u<<a),a+=Uf}while(c);n.value=$j(s),n.rest=r},"base64VLQ_decode")});var ai=h(ge=>{function Oj(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}o(Oj,"getArg");ge.getArg=Oj;var R_=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,xj=/^data:.+\,.+$/;function qo(e){var t=e.match(R_);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}o(qo,"urlParse");ge.urlParse=qo;function oi(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}o(oi,"urlGenerate");ge.urlGenerate=oi;function zf(e){var t=e,r=qo(e);if(r){if(!r.path)return e;t=r.path}for(var n=ge.isAbsolute(t),i=t.split(/\/+/),s,a=0,c=i.length-1;c>=0;c--)s=i[c],s==="."?i.splice(c,1):s===".."?a++:a>0&&(s===""?(i.splice(c+1,a),a=0):(i.splice(c,2),a--));return t=i.join("/"),t===""&&(t=n?"/":"."),r?(r.path=t,oi(r)):t}o(zf,"normalize");ge.normalize=zf;function C_(e,t){e===""&&(e="."),t===""&&(t=".");var r=qo(t),n=qo(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),oi(r);if(r||t.match(xj))return t;if(n&&!n.host&&!n.path)return n.host=t,oi(n);var i=t.charAt(0)==="/"?t:zf(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=i,oi(n)):i}o(C_,"join");ge.join=C_;ge.isAbsolute=function(e){return e.charAt(0)==="/"||R_.test(e)};function wj(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}o(wj,"relative");ge.relative=wj;var k_=function(){var e=Object.create(null);return!("__proto__"in e)}();function j_(e){return e}o(j_,"identity");function Aj(e){return q_(e)?"$"+e:e}o(Aj,"toSetString");ge.toSetString=k_?j_:Aj;function Ij(e){return q_(e)?e.slice(1):e}o(Ij,"fromSetString");ge.fromSetString=k_?j_:Ij;function q_(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}o(q_,"isProtoString");function Tj(e,t,r){var n=si(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:si(e.name,t.name)}o(Tj,"compareByOriginalPositions");ge.compareByOriginalPositions=Tj;function Nj(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=si(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:si(e.name,t.name)}o(Nj,"compareByGeneratedPositionsDeflated");ge.compareByGeneratedPositionsDeflated=Nj;function si(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}o(si,"strcmp");function Rj(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=si(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:si(e.name,t.name)}o(Rj,"compareByGeneratedPositionsInflated");ge.compareByGeneratedPositionsInflated=Rj;function Cj(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}o(Cj,"parseSourceMapInput");ge.parseSourceMapInput=Cj;function kj(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=qo(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}t=C_(oi(n),t)}return zf(t)}o(kj,"computeSourceURL");ge.computeSourceURL=kj});var Wf=h(M_=>{var Kf=ai(),Qf=Object.prototype.hasOwnProperty,on=typeof Map<"u";function Zt(){this._array=[],this._set=on?new Map:Object.create(null)}o(Zt,"ArraySet");Zt.fromArray=o(function(t,r){for(var n=new Zt,i=0,s=t.length;i<s;i++)n.add(t[i],r);return n},"ArraySet_fromArray");Zt.prototype.size=o(function(){return on?this._set.size:Object.getOwnPropertyNames(this._set).length},"ArraySet_size");Zt.prototype.add=o(function(t,r){var n=on?t:Kf.toSetString(t),i=on?this.has(t):Qf.call(this._set,n),s=this._array.length;(!i||r)&&this._array.push(t),i||(on?this._set.set(t,s):this._set[n]=s)},"ArraySet_add");Zt.prototype.has=o(function(t){if(on)return this._set.has(t);var r=Kf.toSetString(t);return Qf.call(this._set,r)},"ArraySet_has");Zt.prototype.indexOf=o(function(t){if(on){var r=this._set.get(t);if(r>=0)return r}else{var n=Kf.toSetString(t);if(Qf.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')},"ArraySet_indexOf");Zt.prototype.at=o(function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},"ArraySet_at");Zt.prototype.toArray=o(function(){return this._array.slice()},"ArraySet_toArray");M_.ArraySet=Zt});var F_=h(L_=>{var D_=ai();function jj(e,t){var r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,s=t.generatedColumn;return n>r||n==r&&s>=i||D_.compareByGeneratedPositionsInflated(e,t)<=0}o(jj,"generatedPositionAfter");function Va(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o(Va,"MappingList");Va.prototype.unsortedForEach=o(function(t,r){this._array.forEach(t,r)},"MappingList_forEach");Va.prototype.add=o(function(t){jj(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},"MappingList_add");Va.prototype.toArray=o(function(){return this._sorted||(this._array.sort(D_.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");L_.MappingList=Va});var Yf=h(V_=>{var Mo=Zf(),ee=ai(),Ha=Wf().ArraySet,qj=F_().MappingList;function Xe(e){e||(e={}),this._file=ee.getArg(e,"file",null),this._sourceRoot=ee.getArg(e,"sourceRoot",null),this._skipValidation=ee.getArg(e,"skipValidation",!1),this._sources=new Ha,this._names=new Ha,this._mappings=new qj,this._sourcesContents=null}o(Xe,"SourceMapGenerator");Xe.prototype._version=3;Xe.fromSourceMap=o(function(t){var r=t.sourceRoot,n=new Xe({file:t.file,sourceRoot:r});return t.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,r!=null&&(s.source=ee.relative(r,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),n.addMapping(s)}),t.sources.forEach(function(i){var s=i;r!==null&&(s=ee.relative(r,i)),n._sources.has(s)||n._sources.add(s);var a=t.sourceContentFor(i);a!=null&&n.setSourceContent(i,a)}),n},"SourceMapGenerator_fromSourceMap");Xe.prototype.addMapping=o(function(t){var r=ee.getArg(t,"generated"),n=ee.getArg(t,"original",null),i=ee.getArg(t,"source",null),s=ee.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,i,s),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s})},"SourceMapGenerator_addMapping");Xe.prototype.setSourceContent=o(function(t,r){var n=t;this._sourceRoot!=null&&(n=ee.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ee.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[ee.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");Xe.prototype.applySourceMap=o(function(t,r,n){var i=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=t.file}var s=this._sourceRoot;s!=null&&(i=ee.relative(s,i));var a=new Ha,c=new Ha;this._mappings.unsortedForEach(function(u){if(u.source===i&&u.originalLine!=null){var l=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});l.source!=null&&(u.source=l.source,n!=null&&(u.source=ee.join(n,u.source)),s!=null&&(u.source=ee.relative(s,u.source)),u.originalLine=l.line,u.originalColumn=l.column,l.name!=null&&(u.name=l.name))}var f=u.source;f!=null&&!a.has(f)&&a.add(f);var p=u.name;p!=null&&!c.has(p)&&c.add(p)},this),this._sources=a,this._names=c,t.sources.forEach(function(u){var l=t.sourceContentFor(u);l!=null&&(n!=null&&(u=ee.join(n,u)),s!=null&&(u=ee.relative(s,u)),this.setSourceContent(u,l))},this)},"SourceMapGenerator_applySourceMap");Xe.prototype._validateMapping=o(function(t,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!i)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:i}))}},"SourceMapGenerator_validateMapping");Xe.prototype._serializeMappings=o(function(){for(var t=0,r=1,n=0,i=0,s=0,a=0,c="",u,l,f,p,d=this._mappings.toArray(),m=0,g=d.length;m<g;m++){if(l=d[m],u="",l.generatedLine!==r)for(t=0;l.generatedLine!==r;)u+=";",r++;else if(m>0){if(!ee.compareByGeneratedPositionsInflated(l,d[m-1]))continue;u+=","}u+=Mo.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),u+=Mo.encode(p-a),a=p,u+=Mo.encode(l.originalLine-1-i),i=l.originalLine-1,u+=Mo.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(f=this._names.indexOf(l.name),u+=Mo.encode(f-s),s=f)),c+=u}return c},"SourceMapGenerator_serializeMappings");Xe.prototype._generateSourcesContent=o(function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=ee.relative(r,n));var i=ee.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)},"SourceMapGenerator_generateSourcesContent");Xe.prototype.toJSON=o(function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},"SourceMapGenerator_toJSON");Xe.prototype.toString=o(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");V_.SourceMapGenerator=Xe});var H_=h(sn=>{sn.GREATEST_LOWER_BOUND=1;sn.LEAST_UPPER_BOUND=2;function Jf(e,t,r,n,i,s){var a=Math.floor((t-e)/2)+e,c=i(r,n[a],!0);return c===0?a:c>0?t-a>1?Jf(a,t,r,n,i,s):s==sn.LEAST_UPPER_BOUND?t<n.length?t:-1:a:a-e>1?Jf(e,a,r,n,i,s):s==sn.LEAST_UPPER_BOUND?a:e<0?-1:e}o(Jf,"recursiveSearch");sn.search=o(function(t,r,n,i){if(r.length===0)return-1;var s=Jf(-1,r.length,t,r,n,i||sn.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var U_=h(B_=>{function Xf(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}o(Xf,"swap");function Mj(e,t){return Math.round(e+Math.random()*(t-e))}o(Mj,"randomIntInRange");function ed(e,t,r,n){if(r<n){var i=Mj(r,n),s=r-1;Xf(e,i,n);for(var a=e[n],c=r;c<n;c++)t(e[c],a)<=0&&(s+=1,Xf(e,s,c));Xf(e,s+1,c);var u=s+1;ed(e,t,r,u-1),ed(e,t,u+1,n)}}o(ed,"doQuickSort");B_.quickSort=function(e,t){ed(e,t,0,e.length-1)}});var Z_=h(Ba=>{var $=ai(),td=H_(),ci=Wf().ArraySet,Dj=Zf(),Do=U_().quickSort;function Z(e,t){var r=e;return typeof e=="string"&&(r=$.parseSourceMapInput(e)),r.sections!=null?new dt(r,t):new ue(r,t)}o(Z,"SourceMapConsumer");Z.fromSourceMap=function(e,t){return ue.fromSourceMap(e,t)};Z.prototype._version=3;Z.prototype.__generatedMappings=null;Object.defineProperty(Z.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:o(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Z.prototype.__originalMappings=null;Object.defineProperty(Z.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:o(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Z.prototype._charIsMappingSeparator=o(function(t,r){var n=t.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Z.prototype._parseMappings=o(function(t,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Z.GENERATED_ORDER=1;Z.ORIGINAL_ORDER=2;Z.GREATEST_LOWER_BOUND=1;Z.LEAST_UPPER_BOUND=2;Z.prototype.eachMapping=o(function(t,r,n){var i=r||null,s=n||Z.GENERATED_ORDER,a;switch(s){case Z.GENERATED_ORDER:a=this._generatedMappings;break;case Z.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var c=this.sourceRoot;a.map(function(u){var l=u.source===null?null:this._sources.at(u.source);return l=$.computeSourceURL(c,l,this._sourceMapURL),{source:l,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(t,i)},"SourceMapConsumer_eachMapping");Z.prototype.allGeneratedPositionsFor=o(function(t){var r=$.getArg(t,"line"),n={source:$.getArg(t,"source"),originalLine:r,originalColumn:$.getArg(t,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",$.compareByOriginalPositions,td.LEAST_UPPER_BOUND);if(s>=0){var a=this._originalMappings[s];if(t.column===void 0)for(var c=a.originalLine;a&&a.originalLine===c;)i.push({line:$.getArg(a,"generatedLine",null),column:$.getArg(a,"generatedColumn",null),lastColumn:$.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s];else for(var u=a.originalColumn;a&&a.originalLine===r&&a.originalColumn==u;)i.push({line:$.getArg(a,"generatedLine",null),column:$.getArg(a,"generatedColumn",null),lastColumn:$.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s]}return i},"SourceMapConsumer_allGeneratedPositionsFor");Ba.SourceMapConsumer=Z;function ue(e,t){var r=e;typeof e=="string"&&(r=$.parseSourceMapInput(e));var n=$.getArg(r,"version"),i=$.getArg(r,"sources"),s=$.getArg(r,"names",[]),a=$.getArg(r,"sourceRoot",null),c=$.getArg(r,"sourcesContent",null),u=$.getArg(r,"mappings"),l=$.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);a&&(a=$.normalize(a)),i=i.map(String).map($.normalize).map(function(f){return a&&$.isAbsolute(a)&&$.isAbsolute(f)?$.relative(a,f):f}),this._names=ci.fromArray(s.map(String),!0),this._sources=ci.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(f){return $.computeSourceURL(a,f,t)}),this.sourceRoot=a,this.sourcesContent=c,this._mappings=u,this._sourceMapURL=t,this.file=l}o(ue,"BasicSourceMapConsumer");ue.prototype=Object.create(Z.prototype);ue.prototype.consumer=Z;ue.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=$.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};ue.fromSourceMap=o(function(t,r){var n=Object.create(ue.prototype),i=n._names=ci.fromArray(t._names.toArray(),!0),s=n._sources=ci.fromArray(t._sources.toArray(),!0);n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(m){return $.computeSourceURL(n.sourceRoot,m,r)});for(var a=t._mappings.toArray().slice(),c=n.__generatedMappings=[],u=n.__originalMappings=[],l=0,f=a.length;l<f;l++){var p=a[l],d=new G_;d.generatedLine=p.generatedLine,d.generatedColumn=p.generatedColumn,p.source&&(d.source=s.indexOf(p.source),d.originalLine=p.originalLine,d.originalColumn=p.originalColumn,p.name&&(d.name=i.indexOf(p.name)),u.push(d)),c.push(d)}return Do(n.__originalMappings,$.compareByOriginalPositions),n},"SourceMapConsumer_fromSourceMap");ue.prototype._version=3;Object.defineProperty(ue.prototype,"sources",{get:o(function(){return this._absoluteSources.slice()},"get")});function G_(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}o(G_,"Mapping");ue.prototype._parseMappings=o(function(t,r){for(var n=1,i=0,s=0,a=0,c=0,u=0,l=t.length,f=0,p={},d={},m=[],g=[],y,v,S,b,E;f<l;)if(t.charAt(f)===";")n++,f++,i=0;else if(t.charAt(f)===",")f++;else{for(y=new G_,y.generatedLine=n,b=f;b<l&&!this._charIsMappingSeparator(t,b);b++);if(v=t.slice(f,b),S=p[v],S)f+=v.length;else{for(S=[];f<b;)Dj.decode(t,f,d),E=d.value,f=d.rest,S.push(E);if(S.length===2)throw new Error("Found a source, but no line and column");if(S.length===3)throw new Error("Found a source and line, but no column");p[v]=S}y.generatedColumn=i+S[0],i=y.generatedColumn,S.length>1&&(y.source=c+S[1],c+=S[1],y.originalLine=s+S[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=a+S[3],a=y.originalColumn,S.length>4&&(y.name=u+S[4],u+=S[4])),g.push(y),typeof y.originalLine=="number"&&m.push(y)}Do(g,$.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,Do(m,$.compareByOriginalPositions),this.__originalMappings=m},"SourceMapConsumer_parseMappings");ue.prototype._findMapping=o(function(t,r,n,i,s,a){if(t[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[i]);return td.search(t,r,s,a)},"SourceMapConsumer_findMapping");ue.prototype.computeColumnSpans=o(function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var n=this._generatedMappings[t+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}},"SourceMapConsumer_computeColumnSpans");ue.prototype.originalPositionFor=o(function(t){var r={generatedLine:$.getArg(t,"line"),generatedColumn:$.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",$.compareByGeneratedPositionsDeflated,$.getArg(t,"bias",Z.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var s=$.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=$.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var a=$.getArg(i,"name",null);return a!==null&&(a=this._names.at(a)),{source:s,line:$.getArg(i,"originalLine",null),column:$.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");ue.prototype.hasContentsOfAllSources=o(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");ue.prototype.sourceContentFor=o(function(t,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];var i=t;this.sourceRoot!=null&&(i=$.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=$.urlParse(this.sourceRoot))){var a=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");ue.prototype.generatedPositionFor=o(function(t){var r=$.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:$.getArg(t,"line"),originalColumn:$.getArg(t,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",$.compareByOriginalPositions,$.getArg(t,"bias",Z.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:$.getArg(s,"generatedLine",null),column:$.getArg(s,"generatedColumn",null),lastColumn:$.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Ba.BasicSourceMapConsumer=ue;function dt(e,t){var r=e;typeof e=="string"&&(r=$.parseSourceMapInput(e));var n=$.getArg(r,"version"),i=$.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ci,this._names=new ci;var s={line:-1,column:0};this._sections=i.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var c=$.getArg(a,"offset"),u=$.getArg(c,"line"),l=$.getArg(c,"column");if(u<s.line||u===s.line&&l<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=c,{generatedOffset:{generatedLine:u+1,generatedColumn:l+1},consumer:new Z($.getArg(a,"map"),t)}})}o(dt,"IndexedSourceMapConsumer");dt.prototype=Object.create(Z.prototype);dt.prototype.constructor=Z;dt.prototype._version=3;Object.defineProperty(dt.prototype,"sources",{get:o(function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e},"get")});dt.prototype.originalPositionFor=o(function(t){var r={generatedLine:$.getArg(t,"line"),generatedColumn:$.getArg(t,"column")},n=td.search(r,this._sections,function(s,a){var c=s.generatedLine-a.generatedOffset.generatedLine;return c||s.generatedColumn-a.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},"IndexedSourceMapConsumer_originalPositionFor");dt.prototype.hasContentsOfAllSources=o(function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})},"IndexedSourceMapConsumer_hasContentsOfAllSources");dt.prototype.sourceContentFor=o(function(t,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(t,!0);if(s)return s}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')},"IndexedSourceMapConsumer_sourceContentFor");dt.prototype.generatedPositionFor=o(function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex($.getArg(t,"source"))!==-1){var i=n.consumer.generatedPositionFor(t);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}},"IndexedSourceMapConsumer_generatedPositionFor");dt.prototype._parseMappings=o(function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,a=0;a<s.length;a++){var c=s[a],u=i.consumer._sources.at(c.source);u=$.computeSourceURL(i.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;c.name&&(l=i.consumer._names.at(c.name),this._names.add(l),l=this._names.indexOf(l));var f={source:u,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:l};this.__generatedMappings.push(f),typeof f.originalLine=="number"&&this.__originalMappings.push(f)}Do(this.__generatedMappings,$.compareByGeneratedPositionsDeflated),Do(this.__originalMappings,$.compareByOriginalPositions)},"IndexedSourceMapConsumer_parseMappings");Ba.IndexedSourceMapConsumer=dt});var K_=h(z_=>{var Lj=Yf().SourceMapGenerator,Ua=ai(),Fj=/(\r?\n)/,Vj=10,ui="$$$isSourceNode$$$";function He(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=i??null,this[ui]=!0,n!=null&&this.add(n)}o(He,"SourceNode");He.fromStringWithSourceMap=o(function(t,r,n){var i=new He,s=t.split(Fj),a=0,c=o(function(){var d=g(),m=g()||"";return d+m;function g(){return a<s.length?s[a++]:void 0}},"shiftNextLine"),u=1,l=0,f=null;return r.eachMapping(function(d){if(f!==null)if(u<d.generatedLine)p(f,c()),u++,l=0;else{var m=s[a]||"",g=m.substr(0,d.generatedColumn-l);s[a]=m.substr(d.generatedColumn-l),l=d.generatedColumn,p(f,g),f=d;return}for(;u<d.generatedLine;)i.add(c()),u++;if(l<d.generatedColumn){var m=s[a]||"";i.add(m.substr(0,d.generatedColumn)),s[a]=m.substr(d.generatedColumn),l=d.generatedColumn}f=d},this),a<s.length&&(f&&p(f,c()),i.add(s.splice(a).join(""))),r.sources.forEach(function(d){var m=r.sourceContentFor(d);m!=null&&(n!=null&&(d=Ua.join(n,d)),i.setSourceContent(d,m))}),i;function p(d,m){if(d===null||d.source===void 0)i.add(m);else{var g=n?Ua.join(n,d.source):d.source;i.add(new He(d.originalLine,d.originalColumn,g,m,d.name))}}o(p,"addMappingWithCode")},"SourceNode_fromStringWithSourceMap");He.prototype.add=o(function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[ui]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this},"SourceNode_add");He.prototype.prepend=o(function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[ui]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this},"SourceNode_prepend");He.prototype.walk=o(function(t){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[ui]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})},"SourceNode_walk");He.prototype.join=o(function(t){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this},"SourceNode_join");He.prototype.replaceRight=o(function(t,r){var n=this.children[this.children.length-1];return n[ui]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this},"SourceNode_replaceRight");He.prototype.setSourceContent=o(function(t,r){this.sourceContents[Ua.toSetString(t)]=r},"SourceNode_setSourceContent");He.prototype.walkSourceContents=o(function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][ui]&&this.children[r].walkSourceContents(t);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)t(Ua.fromSetString(i[r]),this.sourceContents[i[r]])},"SourceNode_walkSourceContents");He.prototype.toString=o(function(){var t="";return this.walk(function(r){t+=r}),t},"SourceNode_toString");He.prototype.toStringWithSourceMap=o(function(t){var r={code:"",line:1,column:0},n=new Lj(t),i=!1,s=null,a=null,c=null,u=null;return this.walk(function(l,f){r.code+=l,f.source!==null&&f.line!==null&&f.column!==null?((s!==f.source||a!==f.line||c!==f.column||u!==f.name)&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name}),s=f.source,a=f.line,c=f.column,u=f.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),s=null,i=!1);for(var p=0,d=l.length;p<d;p++)l.charCodeAt(p)===Vj?(r.line++,r.column=0,p+1===d?(s=null,i=!1):i&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name})):r.column++}),this.walkSourceContents(function(l,f){n.setSourceContent(l,f)}),{code:r.code,map:n}},"SourceNode_toStringWithSourceMap");z_.SourceNode=He});var Q_=h(Ga=>{Ga.SourceMapGenerator=Yf().SourceMapGenerator;Ga.SourceMapConsumer=Z_().SourceMapConsumer;Ga.SourceNode=K_().SourceNode});var X_=h((Za,J_)=>{"use strict";Za.__esModule=!0;var nd=Ee(),an=void 0;try{(typeof define!="function"||!define.amd)&&(W_=Q_(),an=W_.SourceNode)}catch{}var W_;an||(an=o(function(e,t,r,n){this.src="",n&&this.add(n)},"SourceNode"),an.prototype={add:o(function(t){nd.isArray(t)&&(t=t.join("")),this.src+=t},"add"),prepend:o(function(t){nd.isArray(t)&&(t=t.join("")),this.src=t+this.src},"prepend"),toStringWithSourceMap:o(function(){return{code:this.toString()}},"toStringWithSourceMap"),toString:o(function(){return this.src},"toString")});function rd(e,t,r){if(nd.isArray(e)){for(var n=[],i=0,s=e.length;i<s;i++)n.push(t.wrap(e[i],r));return n}else if(typeof e=="boolean"||typeof e=="number")return e+"";return e}o(rd,"castChunk");function Y_(e){this.srcFile=e,this.source=[]}o(Y_,"CodeGen");Y_.prototype={isEmpty:o(function(){return!this.source.length},"isEmpty"),prepend:o(function(t,r){this.source.unshift(this.wrap(t,r))},"prepend"),push:o(function(t,r){this.source.push(this.wrap(t,r))},"push"),merge:o(function(){var t=this.empty();return this.each(function(r){t.add([" ",r,`
59
- `])}),t},"merge"),each:o(function(t){for(var r=0,n=this.source.length;r<n;r++)t(this.source[r])},"each"),empty:o(function(){var t=this.currentLocation||{start:{}};return new an(t.start.line,t.start.column,this.srcFile)},"empty"),wrap:o(function(t){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return t instanceof an?t:(t=rd(t,this,r),new an(r.start.line,r.start.column,this.srcFile,t))},"wrap"),functionCall:o(function(t,r,n){return n=this.generateList(n),this.wrap([t,r?"."+r+"(":"(",n,")"])},"functionCall"),quotedString:o(function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},"quotedString"),objectLiteral:o(function(t){var r=this,n=[];Object.keys(t).forEach(function(s){var a=rd(t[s],r);a!=="undefined"&&n.push([r.quotedString(s),":",a])});var i=this.generateList(n);return i.prepend("{"),i.add("}"),i},"objectLiteral"),generateList:o(function(t){for(var r=this.empty(),n=0,i=t.length;n<i;n++)n&&r.add(","),r.add(rd(t[n],this));return r},"generateList"),generateArray:o(function(t){var r=this.generateList(t);return r.prepend("["),r.add("]"),r},"generateArray")};Za.default=Y_;J_.exports=Za.default});var iP=h((za,nP)=>{"use strict";za.__esModule=!0;function rP(e){return e&&e.__esModule?e:{default:e}}o(rP,"_interopRequireDefault");var eP=Aa(),Hj=Ye(),id=rP(Hj),Bj=Ee(),Uj=X_(),tP=rP(Uj);function li(e){this.value=e}o(li,"Literal");function pi(){}o(pi,"JavaScriptCompiler");pi.prototype={nameLookup:o(function(t,r){return this.internalNameLookup(t,r)},"nameLookup"),depthedLookup:o(function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},"depthedLookup"),compilerInfo:o(function(){var t=eP.COMPILER_REVISION,r=eP.REVISION_CHANGES[t];return[t,r]},"compilerInfo"),appendToBuffer:o(function(t,r,n){return Bj.isArray(t)||(t=[t]),t=this.source.wrap(t,r),this.environment.isSimple?["return ",t,";"]:n?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},"appendToBuffer"),initializeBuffer:o(function(){return this.quotedString("")},"initializeBuffer"),internalNameLookup:o(function(t,r){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(r),")"]},"internalNameLookup"),lookupPropertyFunctionIsUsed:!1,compile:o(function(t,r,n,i){this.environment=t,this.options=r,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!i,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,r),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var s=t.opcodes,a=void 0,c=void 0,u=void 0,l=void 0;for(u=0,l=s.length;u<l;u++)a=s[u],this.source.currentLocation=a.loc,c=c||a.loc,this[a.opcode].apply(this,a.args);if(this.source.currentLocation=c,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new id.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
58
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var s=this.next();return typeof s<"u"?s:this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){return this.conditionStack.pop()},"popState"),_currentRules:o(function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},"_currentRules"),topState:o(function(){return this.conditionStack[this.conditionStack.length-2]},"topState"),pushState:o(function(s){this.begin(s)},"begin")};return n.options={},n.performAction=o(function(s,a,c,u){function l(p,d){return a.yytext=a.yytext.substring(p,a.yyleng-d+p)}o(l,"strip");var f=u;switch(c){case 0:if(a.yytext.slice(-2)==="\\\\"?(l(0,1),this.begin("mu")):a.yytext.slice(-1)==="\\"?(l(0,1),this.begin("emu")):this.begin("mu"),a.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(l(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(a.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return a.yytext=l(1,2).replace(/\\"/g,'"'),80;break;case 32:return a.yytext=l(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return a.yytext=a.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},"anonymous"),n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n}();e.lexer=t;function r(){this.yy={}}return o(r,"Parser"),r.prototype=e,e.Parser=r,new r}();ka.default=Zk;p_.exports=ka.default});var Da=h((Ma,h_)=>{"use strict";Ma.__esModule=!0;function zk(e){return e&&e.__esModule?e:{default:e}}o(zk,"_interopRequireDefault");var Kk=Ye(),qf=zk(Kk);function ja(){this.parents=[]}o(ja,"Visitor");ja.prototype={constructor:ja,mutating:!1,acceptKey:o(function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!ja.prototype[n.type])throw new qf.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+t.type);t[r]=n}},"acceptKey"),acceptRequired:o(function(t,r){if(this.acceptKey(t,r),!t[r])throw new qf.default(t.type+" requires "+r)},"acceptRequired"),acceptArray:o(function(t){for(var r=0,n=t.length;r<n;r++)this.acceptKey(t,r),t[r]||(t.splice(r,1),r--,n--)},"acceptArray"),accept:o(function(t){if(t){if(!this[t.type])throw new qf.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var r=this[t.type](t);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return t}},"accept"),Program:o(function(t){this.acceptArray(t.body)},"Program"),MustacheStatement:qa,Decorator:qa,BlockStatement:d_,DecoratorBlock:d_,PartialStatement:m_,PartialBlockStatement:o(function(t){m_.call(this,t),this.acceptKey(t,"program")},"PartialBlockStatement"),ContentStatement:o(function(){},"ContentStatement"),CommentStatement:o(function(){},"CommentStatement"),SubExpression:qa,PathExpression:o(function(){},"PathExpression"),StringLiteral:o(function(){},"StringLiteral"),NumberLiteral:o(function(){},"NumberLiteral"),BooleanLiteral:o(function(){},"BooleanLiteral"),UndefinedLiteral:o(function(){},"UndefinedLiteral"),NullLiteral:o(function(){},"NullLiteral"),Hash:o(function(t){this.acceptArray(t.pairs)},"Hash"),HashPair:o(function(t){this.acceptRequired(t,"value")},"HashPair")};function qa(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}o(qa,"visitSubExpression");function d_(e){qa.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}o(d_,"visitBlock");function m_(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}o(m_,"visitPartial");Ma.default=ja;h_.exports=Ma.default});var y_=h((La,g_)=>{"use strict";La.__esModule=!0;function Qk(e){return e&&e.__esModule?e:{default:e}}o(Qk,"_interopRequireDefault");var Wk=Da(),Yk=Qk(Wk);function jt(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}o(jt,"WhitespaceControl");jt.prototype=new Yk.default;jt.prototype.Program=function(e){var t=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,i=0,s=n.length;i<s;i++){var a=n[i],c=this.accept(a);if(c){var u=Mf(n,i,r),l=Df(n,i,r),f=c.openStandalone&&u,p=c.closeStandalone&&l,d=c.inlineStandalone&&u&&l;c.close&&nn(n,i,!0),c.open&&Er(n,i,!0),t&&d&&(nn(n,i),Er(n,i)&&a.type==="PartialStatement"&&(a.indent=/([ \t]+$)/.exec(n[i-1].original)[1])),t&&f&&(nn((a.program||a.inverse).body),Er(n,i)),t&&p&&(nn(n,i),Er((a.inverse||a.program).body))}}return e};jt.prototype.BlockStatement=jt.prototype.DecoratorBlock=jt.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,r=e.program&&e.inverse,n=r,i=r;if(r&&r.chained)for(n=r.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var s={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:Df(t.body),closeStandalone:Mf((n||t).body)};if(e.openStrip.close&&nn(t.body,null,!0),r){var a=e.inverseStrip;a.open&&Er(t.body,null,!0),a.close&&nn(n.body,null,!0),e.closeStrip.open&&Er(i.body,null,!0),!this.options.ignoreStandalone&&Mf(t.body)&&Df(n.body)&&(Er(t.body),nn(n.body))}else e.closeStrip.open&&Er(t.body,null,!0);return s};jt.prototype.Decorator=jt.prototype.MustacheStatement=function(e){return e.strip};jt.prototype.PartialStatement=jt.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function Mf(e,t,r){t===void 0&&(t=e.length);var n=e[t-1],i=e[t-2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original)}o(Mf,"isPrevWhitespace");function Df(e,t,r){t===void 0&&(t=-1);var n=e[t+1],i=e[t+2];if(!n)return r;if(n.type==="ContentStatement")return(i||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}o(Df,"isNextWhitespace");function nn(e,t,r){var n=e[t==null?0:t+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var i=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==i}}o(nn,"omitRight");function Er(e,t,r){var n=e[t==null?e.length-1:t-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var i=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==i,n.leftStripped}}o(Er,"omitLeft");La.default=jt;g_.exports=La.default});var v_=h(Je=>{"use strict";Je.__esModule=!0;Je.SourceLocation=e3;Je.id=t3;Je.stripFlags=r3;Je.stripComment=n3;Je.preparePath=i3;Je.prepareMustache=o3;Je.prepareRawBlock=s3;Je.prepareBlock=a3;Je.prepareProgram=c3;Je.preparePartialBlock=u3;function Jk(e){return e&&e.__esModule?e:{default:e}}o(Jk,"_interopRequireDefault");var Xk=Ye(),Lf=Jk(Xk);function Ff(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Lf.default(e.path.original+" doesn't match "+t,r)}}o(Ff,"validateClose");function e3(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}o(e3,"SourceLocation");function t3(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}o(t3,"id");function r3(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}o(r3,"stripFlags");function n3(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}o(n3,"stripComment");function i3(e,t,r){r=this.locInfo(r);for(var n=e?"@":"",i=[],s=0,a=0,c=t.length;a<c;a++){var u=t[a].part,l=t[a].original!==u;if(n+=(t[a].separator||"")+u,!l&&(u===".."||u==="."||u==="this")){if(i.length>0)throw new Lf.default("Invalid path: "+n,{loc:r});u===".."&&s++}else i.push(u)}return{type:"PathExpression",data:e,depth:s,parts:i,original:n,loc:r}}o(i3,"preparePath");function o3(e,t,r,n,i,s){var a=n.charAt(3)||n.charAt(2),c=a!=="{"&&a!=="&",u=/\*/.test(n);return{type:u?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:c,strip:i,loc:this.locInfo(s)}}o(o3,"prepareMustache");function s3(e,t,r,n){Ff(e,r),n=this.locInfo(n);var i={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}o(s3,"prepareRawBlock");function a3(e,t,r,n,i,s){n&&n.path&&Ff(e,n);var a=/\*/.test(e.open);t.blockParams=e.blockParams;var c=void 0,u=void 0;if(r){if(a)throw new Lf.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),u=r.strip,c=r.program}return i&&(i=c,c=t,t=i),{type:a?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:c,openStrip:e.strip,inverseStrip:u,closeStrip:n&&n.strip,loc:this.locInfo(s)}}o(a3,"prepareBlock");function c3(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}o(c3,"prepareProgram");function u3(e,t,r,n){return Ff(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}o(u3,"preparePartialBlock")});var __=h(No=>{"use strict";No.__esModule=!0;No.parseWithoutProcessing=b_;No.parse=y3;function l3(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}o(l3,"_interopRequireWildcard");function S_(e){return e&&e.__esModule?e:{default:e}}o(S_,"_interopRequireDefault");var p3=f_(),Vf=S_(p3),f3=y_(),d3=S_(f3),m3=v_(),h3=l3(m3),g3=Ee();No.parser=Vf.default;var Fa={};g3.extend(Fa,h3);function b_(e,t){if(e.type==="Program")return e;Vf.default.yy=Fa,Fa.locInfo=function(n){return new Fa.SourceLocation(t&&t.srcName,n)};var r=Vf.default.parse(e);return r}o(b_,"parseWithoutProcessing");function y3(e,t){var r=b_(e,t),n=new d3.default(t);return n.accept(r)}o(y3,"parse")});var O_=h(jo=>{"use strict";jo.__esModule=!0;jo.Compiler=Hf;jo.precompile=_3;jo.compile=P3;function E_(e){return e&&e.__esModule?e:{default:e}}o(E_,"_interopRequireDefault");var v3=Ye(),Co=E_(v3),ko=Ee(),S3=jf(),Ro=E_(S3),b3=[].slice;function Hf(){}o(Hf,"Compiler");Hf.prototype={compiler:Hf,equals:o(function(t){var r=this.opcodes.length;if(t.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var i=this.opcodes[n],s=t.opcodes[n];if(i.opcode!==s.opcode||!$_(i.args,s.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(t.children[n]))return!1;return!0},"equals"),guid:0,compile:o(function(t,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=ko.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(t)},"compile"),compileProgram:o(function(t){var r=new this.compiler,n=r.compile(t,this.options),i=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[i]=n,this.useDepths=this.useDepths||n.useDepths,i},"compileProgram"),accept:o(function(t){if(!this[t.type])throw new Co.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var r=this[t.type](t);return this.sourceNode.shift(),r},"accept"),Program:o(function(t){this.options.blockParams.unshift(t.blockParams);for(var r=t.body,n=r.length,i=0;i<n;i++)this.accept(r[i]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=t.blockParams?t.blockParams.length:0,this},"Program"),BlockStatement:o(function(t){P_(t);var r=t.program,n=t.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var i=this.classifySexpr(t);i==="helper"?this.helperSexpr(t,r,n):i==="simple"?(this.simpleSexpr(t),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},"BlockStatement"),DecoratorBlock:o(function(t){var r=t.program&&this.compileProgram(t.program),n=this.setupFullMustacheParams(t,r,void 0),i=t.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,i.original)},"DecoratorBlock"),PartialStatement:o(function(t){this.usePartial=!0;var r=t.program;r&&(r=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new Co.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var i=t.name.original,s=t.name.type==="SubExpression";s&&this.accept(t.name),this.setupFullMustacheParams(t,r,void 0,!0);var a=t.indent||"";this.options.preventIndent&&a&&(this.opcode("appendContent",a),a=""),this.opcode("invokePartial",s,i,a),this.opcode("append")},"PartialStatement"),PartialBlockStatement:o(function(t){this.PartialStatement(t)},"PartialBlockStatement"),MustacheStatement:o(function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},"MustacheStatement"),Decorator:o(function(t){this.DecoratorBlock(t)},"Decorator"),ContentStatement:o(function(t){t.value&&this.opcode("appendContent",t.value)},"ContentStatement"),CommentStatement:o(function(){},"CommentStatement"),SubExpression:o(function(t){P_(t);var r=this.classifySexpr(t);r==="simple"?this.simpleSexpr(t):r==="helper"?this.helperSexpr(t):this.ambiguousSexpr(t)},"SubExpression"),ambiguousSexpr:o(function(t,r,n){var i=t.path,s=i.parts[0],a=r!=null||n!=null;this.opcode("getContext",i.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",n),i.strict=!0,this.accept(i),this.opcode("invokeAmbiguous",s,a)},"ambiguousSexpr"),simpleSexpr:o(function(t){var r=t.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},"simpleSexpr"),helperSexpr:o(function(t,r,n){var i=this.setupFullMustacheParams(t,r,n),s=t.path,a=s.parts[0];if(this.options.knownHelpers[a])this.opcode("invokeKnownHelper",i.length,a);else{if(this.options.knownHelpersOnly)throw new Co.default("You specified knownHelpersOnly, but used the unknown helper "+a,t);s.strict=!0,s.falsy=!0,this.accept(s),this.opcode("invokeHelper",i.length,s.original,Ro.default.helpers.simpleId(s))}},"helperSexpr"),PathExpression:o(function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=Ro.default.helpers.scopedId(t),i=!t.depth&&!n&&this.blockParamIndex(r);i?this.opcode("lookupBlockParam",i,t.parts):r?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n):this.opcode("pushContext")},"PathExpression"),StringLiteral:o(function(t){this.opcode("pushString",t.value)},"StringLiteral"),NumberLiteral:o(function(t){this.opcode("pushLiteral",t.value)},"NumberLiteral"),BooleanLiteral:o(function(t){this.opcode("pushLiteral",t.value)},"BooleanLiteral"),UndefinedLiteral:o(function(){this.opcode("pushLiteral","undefined")},"UndefinedLiteral"),NullLiteral:o(function(){this.opcode("pushLiteral","null")},"NullLiteral"),Hash:o(function(t){var r=t.pairs,n=0,i=r.length;for(this.opcode("pushHash");n<i;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},"Hash"),opcode:o(function(t){this.opcodes.push({opcode:t,args:b3.call(arguments,1),loc:this.sourceNode[0].loc})},"opcode"),addDepth:o(function(t){t&&(this.useDepths=!0)},"addDepth"),classifySexpr:o(function(t){var r=Ro.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),i=!n&&Ro.default.helpers.helperExpression(t),s=!n&&(i||r);if(s&&!i){var a=t.path.parts[0],c=this.options;c.knownHelpers[a]?i=!0:c.knownHelpersOnly&&(s=!1)}return i?"helper":s?"ambiguous":"simple"},"classifySexpr"),pushParams:o(function(t){for(var r=0,n=t.length;r<n;r++)this.pushParam(t[r])},"pushParams"),pushParam:o(function(t){var r=t.value!=null?t.value:t.original||"";if(this.stringParams)r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",r,t.type),t.type==="SubExpression"&&this.accept(t);else{if(this.trackIds){var n=void 0;if(t.parts&&!Ro.default.helpers.scopedId(t)&&!t.depth&&(n=this.blockParamIndex(t.parts[0])),n){var i=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,i)}else r=t.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,r)}this.accept(t)}},"pushParam"),setupFullMustacheParams:o(function(t,r,n,i){var s=t.params;return this.pushParams(s),this.opcode("pushProgram",r),this.opcode("pushProgram",n),t.hash?this.accept(t.hash):this.opcode("emptyHash",i),s},"setupFullMustacheParams"),blockParamIndex:o(function(t){for(var r=0,n=this.options.blockParams.length;r<n;r++){var i=this.options.blockParams[r],s=i&&ko.indexOf(i,t);if(i&&s>=0)return[r,s]}},"blockParamIndex")};function _3(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new Co.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);t=t||{},"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=r.parse(e,t),i=new r.Compiler().compile(n,t);return new r.JavaScriptCompiler().compile(i,t)}o(_3,"precompile");function P3(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new Co.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=ko.extend({},t),"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function i(){var a=r.parse(e,t),c=new r.Compiler().compile(a,t),u=new r.JavaScriptCompiler().compile(c,t,void 0,!0);return r.template(u)}o(i,"compileInput");function s(a,c){return n||(n=i()),n.call(this,a,c)}return o(s,"ret"),s._setup=function(a){return n||(n=i()),n._setup(a)},s._child=function(a,c,u,l){return n||(n=i()),n._child(a,c,u,l)},s}o(P3,"compile");function $_(e,t){if(e===t)return!0;if(ko.isArray(e)&&ko.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!$_(e[r],t[r]))return!1;return!0}}o($_,"argEquals");function P_(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}o(P_,"transformLiteralToPath")});var w_=h(Bf=>{var x_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Bf.encode=function(e){if(0<=e&&e<x_.length)return x_[e];throw new TypeError("Must be between 0 and 63: "+e)};Bf.decode=function(e){var t=65,r=90,n=97,i=122,s=48,a=57,c=43,u=47,l=26,f=52;return t<=e&&e<=r?e-t:n<=e&&e<=i?e-n+l:s<=e&&e<=a?e-s+f:e==c?62:e==u?63:-1}});var Zf=h(Gf=>{var A_=w_(),Uf=5,I_=1<<Uf,T_=I_-1,N_=I_;function E3(e){return e<0?(-e<<1)+1:(e<<1)+0}o(E3,"toVLQSigned");function $3(e){var t=(e&1)===1,r=e>>1;return t?-r:r}o($3,"fromVLQSigned");Gf.encode=o(function(t){var r="",n,i=E3(t);do n=i&T_,i>>>=Uf,i>0&&(n|=N_),r+=A_.encode(n);while(i>0);return r},"base64VLQ_encode");Gf.decode=o(function(t,r,n){var i=t.length,s=0,a=0,c,u;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=A_.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));c=!!(u&N_),u&=T_,s=s+(u<<a),a+=Uf}while(c);n.value=$3(s),n.rest=r},"base64VLQ_decode")});var ai=h(ge=>{function O3(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}o(O3,"getArg");ge.getArg=O3;var R_=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,x3=/^data:.+\,.+$/;function qo(e){var t=e.match(R_);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}o(qo,"urlParse");ge.urlParse=qo;function oi(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}o(oi,"urlGenerate");ge.urlGenerate=oi;function zf(e){var t=e,r=qo(e);if(r){if(!r.path)return e;t=r.path}for(var n=ge.isAbsolute(t),i=t.split(/\/+/),s,a=0,c=i.length-1;c>=0;c--)s=i[c],s==="."?i.splice(c,1):s===".."?a++:a>0&&(s===""?(i.splice(c+1,a),a=0):(i.splice(c,2),a--));return t=i.join("/"),t===""&&(t=n?"/":"."),r?(r.path=t,oi(r)):t}o(zf,"normalize");ge.normalize=zf;function C_(e,t){e===""&&(e="."),t===""&&(t=".");var r=qo(t),n=qo(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),oi(r);if(r||t.match(x3))return t;if(n&&!n.host&&!n.path)return n.host=t,oi(n);var i=t.charAt(0)==="/"?t:zf(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=i,oi(n)):i}o(C_,"join");ge.join=C_;ge.isAbsolute=function(e){return e.charAt(0)==="/"||R_.test(e)};function w3(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}o(w3,"relative");ge.relative=w3;var k_=function(){var e=Object.create(null);return!("__proto__"in e)}();function j_(e){return e}o(j_,"identity");function A3(e){return q_(e)?"$"+e:e}o(A3,"toSetString");ge.toSetString=k_?j_:A3;function I3(e){return q_(e)?e.slice(1):e}o(I3,"fromSetString");ge.fromSetString=k_?j_:I3;function q_(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}o(q_,"isProtoString");function T3(e,t,r){var n=si(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:si(e.name,t.name)}o(T3,"compareByOriginalPositions");ge.compareByOriginalPositions=T3;function N3(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=si(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:si(e.name,t.name)}o(N3,"compareByGeneratedPositionsDeflated");ge.compareByGeneratedPositionsDeflated=N3;function si(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}o(si,"strcmp");function R3(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=si(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:si(e.name,t.name)}o(R3,"compareByGeneratedPositionsInflated");ge.compareByGeneratedPositionsInflated=R3;function C3(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}o(C3,"parseSourceMapInput");ge.parseSourceMapInput=C3;function k3(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=qo(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}t=C_(oi(n),t)}return zf(t)}o(k3,"computeSourceURL");ge.computeSourceURL=k3});var Wf=h(M_=>{var Kf=ai(),Qf=Object.prototype.hasOwnProperty,on=typeof Map<"u";function Zt(){this._array=[],this._set=on?new Map:Object.create(null)}o(Zt,"ArraySet");Zt.fromArray=o(function(t,r){for(var n=new Zt,i=0,s=t.length;i<s;i++)n.add(t[i],r);return n},"ArraySet_fromArray");Zt.prototype.size=o(function(){return on?this._set.size:Object.getOwnPropertyNames(this._set).length},"ArraySet_size");Zt.prototype.add=o(function(t,r){var n=on?t:Kf.toSetString(t),i=on?this.has(t):Qf.call(this._set,n),s=this._array.length;(!i||r)&&this._array.push(t),i||(on?this._set.set(t,s):this._set[n]=s)},"ArraySet_add");Zt.prototype.has=o(function(t){if(on)return this._set.has(t);var r=Kf.toSetString(t);return Qf.call(this._set,r)},"ArraySet_has");Zt.prototype.indexOf=o(function(t){if(on){var r=this._set.get(t);if(r>=0)return r}else{var n=Kf.toSetString(t);if(Qf.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')},"ArraySet_indexOf");Zt.prototype.at=o(function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},"ArraySet_at");Zt.prototype.toArray=o(function(){return this._array.slice()},"ArraySet_toArray");M_.ArraySet=Zt});var F_=h(L_=>{var D_=ai();function j3(e,t){var r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,s=t.generatedColumn;return n>r||n==r&&s>=i||D_.compareByGeneratedPositionsInflated(e,t)<=0}o(j3,"generatedPositionAfter");function Va(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o(Va,"MappingList");Va.prototype.unsortedForEach=o(function(t,r){this._array.forEach(t,r)},"MappingList_forEach");Va.prototype.add=o(function(t){j3(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},"MappingList_add");Va.prototype.toArray=o(function(){return this._sorted||(this._array.sort(D_.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");L_.MappingList=Va});var Yf=h(V_=>{var Mo=Zf(),ee=ai(),Ha=Wf().ArraySet,q3=F_().MappingList;function Xe(e){e||(e={}),this._file=ee.getArg(e,"file",null),this._sourceRoot=ee.getArg(e,"sourceRoot",null),this._skipValidation=ee.getArg(e,"skipValidation",!1),this._sources=new Ha,this._names=new Ha,this._mappings=new q3,this._sourcesContents=null}o(Xe,"SourceMapGenerator");Xe.prototype._version=3;Xe.fromSourceMap=o(function(t){var r=t.sourceRoot,n=new Xe({file:t.file,sourceRoot:r});return t.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,r!=null&&(s.source=ee.relative(r,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),n.addMapping(s)}),t.sources.forEach(function(i){var s=i;r!==null&&(s=ee.relative(r,i)),n._sources.has(s)||n._sources.add(s);var a=t.sourceContentFor(i);a!=null&&n.setSourceContent(i,a)}),n},"SourceMapGenerator_fromSourceMap");Xe.prototype.addMapping=o(function(t){var r=ee.getArg(t,"generated"),n=ee.getArg(t,"original",null),i=ee.getArg(t,"source",null),s=ee.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,i,s),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s})},"SourceMapGenerator_addMapping");Xe.prototype.setSourceContent=o(function(t,r){var n=t;this._sourceRoot!=null&&(n=ee.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ee.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[ee.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");Xe.prototype.applySourceMap=o(function(t,r,n){var i=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=t.file}var s=this._sourceRoot;s!=null&&(i=ee.relative(s,i));var a=new Ha,c=new Ha;this._mappings.unsortedForEach(function(u){if(u.source===i&&u.originalLine!=null){var l=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});l.source!=null&&(u.source=l.source,n!=null&&(u.source=ee.join(n,u.source)),s!=null&&(u.source=ee.relative(s,u.source)),u.originalLine=l.line,u.originalColumn=l.column,l.name!=null&&(u.name=l.name))}var f=u.source;f!=null&&!a.has(f)&&a.add(f);var p=u.name;p!=null&&!c.has(p)&&c.add(p)},this),this._sources=a,this._names=c,t.sources.forEach(function(u){var l=t.sourceContentFor(u);l!=null&&(n!=null&&(u=ee.join(n,u)),s!=null&&(u=ee.relative(s,u)),this.setSourceContent(u,l))},this)},"SourceMapGenerator_applySourceMap");Xe.prototype._validateMapping=o(function(t,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!i)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:i}))}},"SourceMapGenerator_validateMapping");Xe.prototype._serializeMappings=o(function(){for(var t=0,r=1,n=0,i=0,s=0,a=0,c="",u,l,f,p,d=this._mappings.toArray(),m=0,g=d.length;m<g;m++){if(l=d[m],u="",l.generatedLine!==r)for(t=0;l.generatedLine!==r;)u+=";",r++;else if(m>0){if(!ee.compareByGeneratedPositionsInflated(l,d[m-1]))continue;u+=","}u+=Mo.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),u+=Mo.encode(p-a),a=p,u+=Mo.encode(l.originalLine-1-i),i=l.originalLine-1,u+=Mo.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(f=this._names.indexOf(l.name),u+=Mo.encode(f-s),s=f)),c+=u}return c},"SourceMapGenerator_serializeMappings");Xe.prototype._generateSourcesContent=o(function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=ee.relative(r,n));var i=ee.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)},"SourceMapGenerator_generateSourcesContent");Xe.prototype.toJSON=o(function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},"SourceMapGenerator_toJSON");Xe.prototype.toString=o(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");V_.SourceMapGenerator=Xe});var H_=h(sn=>{sn.GREATEST_LOWER_BOUND=1;sn.LEAST_UPPER_BOUND=2;function Jf(e,t,r,n,i,s){var a=Math.floor((t-e)/2)+e,c=i(r,n[a],!0);return c===0?a:c>0?t-a>1?Jf(a,t,r,n,i,s):s==sn.LEAST_UPPER_BOUND?t<n.length?t:-1:a:a-e>1?Jf(e,a,r,n,i,s):s==sn.LEAST_UPPER_BOUND?a:e<0?-1:e}o(Jf,"recursiveSearch");sn.search=o(function(t,r,n,i){if(r.length===0)return-1;var s=Jf(-1,r.length,t,r,n,i||sn.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var U_=h(B_=>{function Xf(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}o(Xf,"swap");function M3(e,t){return Math.round(e+Math.random()*(t-e))}o(M3,"randomIntInRange");function ed(e,t,r,n){if(r<n){var i=M3(r,n),s=r-1;Xf(e,i,n);for(var a=e[n],c=r;c<n;c++)t(e[c],a)<=0&&(s+=1,Xf(e,s,c));Xf(e,s+1,c);var u=s+1;ed(e,t,r,u-1),ed(e,t,u+1,n)}}o(ed,"doQuickSort");B_.quickSort=function(e,t){ed(e,t,0,e.length-1)}});var Z_=h(Ba=>{var $=ai(),td=H_(),ci=Wf().ArraySet,D3=Zf(),Do=U_().quickSort;function Z(e,t){var r=e;return typeof e=="string"&&(r=$.parseSourceMapInput(e)),r.sections!=null?new dt(r,t):new ue(r,t)}o(Z,"SourceMapConsumer");Z.fromSourceMap=function(e,t){return ue.fromSourceMap(e,t)};Z.prototype._version=3;Z.prototype.__generatedMappings=null;Object.defineProperty(Z.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:o(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Z.prototype.__originalMappings=null;Object.defineProperty(Z.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:o(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Z.prototype._charIsMappingSeparator=o(function(t,r){var n=t.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Z.prototype._parseMappings=o(function(t,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Z.GENERATED_ORDER=1;Z.ORIGINAL_ORDER=2;Z.GREATEST_LOWER_BOUND=1;Z.LEAST_UPPER_BOUND=2;Z.prototype.eachMapping=o(function(t,r,n){var i=r||null,s=n||Z.GENERATED_ORDER,a;switch(s){case Z.GENERATED_ORDER:a=this._generatedMappings;break;case Z.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var c=this.sourceRoot;a.map(function(u){var l=u.source===null?null:this._sources.at(u.source);return l=$.computeSourceURL(c,l,this._sourceMapURL),{source:l,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(t,i)},"SourceMapConsumer_eachMapping");Z.prototype.allGeneratedPositionsFor=o(function(t){var r=$.getArg(t,"line"),n={source:$.getArg(t,"source"),originalLine:r,originalColumn:$.getArg(t,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",$.compareByOriginalPositions,td.LEAST_UPPER_BOUND);if(s>=0){var a=this._originalMappings[s];if(t.column===void 0)for(var c=a.originalLine;a&&a.originalLine===c;)i.push({line:$.getArg(a,"generatedLine",null),column:$.getArg(a,"generatedColumn",null),lastColumn:$.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s];else for(var u=a.originalColumn;a&&a.originalLine===r&&a.originalColumn==u;)i.push({line:$.getArg(a,"generatedLine",null),column:$.getArg(a,"generatedColumn",null),lastColumn:$.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s]}return i},"SourceMapConsumer_allGeneratedPositionsFor");Ba.SourceMapConsumer=Z;function ue(e,t){var r=e;typeof e=="string"&&(r=$.parseSourceMapInput(e));var n=$.getArg(r,"version"),i=$.getArg(r,"sources"),s=$.getArg(r,"names",[]),a=$.getArg(r,"sourceRoot",null),c=$.getArg(r,"sourcesContent",null),u=$.getArg(r,"mappings"),l=$.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);a&&(a=$.normalize(a)),i=i.map(String).map($.normalize).map(function(f){return a&&$.isAbsolute(a)&&$.isAbsolute(f)?$.relative(a,f):f}),this._names=ci.fromArray(s.map(String),!0),this._sources=ci.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(f){return $.computeSourceURL(a,f,t)}),this.sourceRoot=a,this.sourcesContent=c,this._mappings=u,this._sourceMapURL=t,this.file=l}o(ue,"BasicSourceMapConsumer");ue.prototype=Object.create(Z.prototype);ue.prototype.consumer=Z;ue.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=$.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};ue.fromSourceMap=o(function(t,r){var n=Object.create(ue.prototype),i=n._names=ci.fromArray(t._names.toArray(),!0),s=n._sources=ci.fromArray(t._sources.toArray(),!0);n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(m){return $.computeSourceURL(n.sourceRoot,m,r)});for(var a=t._mappings.toArray().slice(),c=n.__generatedMappings=[],u=n.__originalMappings=[],l=0,f=a.length;l<f;l++){var p=a[l],d=new G_;d.generatedLine=p.generatedLine,d.generatedColumn=p.generatedColumn,p.source&&(d.source=s.indexOf(p.source),d.originalLine=p.originalLine,d.originalColumn=p.originalColumn,p.name&&(d.name=i.indexOf(p.name)),u.push(d)),c.push(d)}return Do(n.__originalMappings,$.compareByOriginalPositions),n},"SourceMapConsumer_fromSourceMap");ue.prototype._version=3;Object.defineProperty(ue.prototype,"sources",{get:o(function(){return this._absoluteSources.slice()},"get")});function G_(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}o(G_,"Mapping");ue.prototype._parseMappings=o(function(t,r){for(var n=1,i=0,s=0,a=0,c=0,u=0,l=t.length,f=0,p={},d={},m=[],g=[],y,v,S,b,E;f<l;)if(t.charAt(f)===";")n++,f++,i=0;else if(t.charAt(f)===",")f++;else{for(y=new G_,y.generatedLine=n,b=f;b<l&&!this._charIsMappingSeparator(t,b);b++);if(v=t.slice(f,b),S=p[v],S)f+=v.length;else{for(S=[];f<b;)D3.decode(t,f,d),E=d.value,f=d.rest,S.push(E);if(S.length===2)throw new Error("Found a source, but no line and column");if(S.length===3)throw new Error("Found a source and line, but no column");p[v]=S}y.generatedColumn=i+S[0],i=y.generatedColumn,S.length>1&&(y.source=c+S[1],c+=S[1],y.originalLine=s+S[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=a+S[3],a=y.originalColumn,S.length>4&&(y.name=u+S[4],u+=S[4])),g.push(y),typeof y.originalLine=="number"&&m.push(y)}Do(g,$.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,Do(m,$.compareByOriginalPositions),this.__originalMappings=m},"SourceMapConsumer_parseMappings");ue.prototype._findMapping=o(function(t,r,n,i,s,a){if(t[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[i]);return td.search(t,r,s,a)},"SourceMapConsumer_findMapping");ue.prototype.computeColumnSpans=o(function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var n=this._generatedMappings[t+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}},"SourceMapConsumer_computeColumnSpans");ue.prototype.originalPositionFor=o(function(t){var r={generatedLine:$.getArg(t,"line"),generatedColumn:$.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",$.compareByGeneratedPositionsDeflated,$.getArg(t,"bias",Z.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var s=$.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=$.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var a=$.getArg(i,"name",null);return a!==null&&(a=this._names.at(a)),{source:s,line:$.getArg(i,"originalLine",null),column:$.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");ue.prototype.hasContentsOfAllSources=o(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");ue.prototype.sourceContentFor=o(function(t,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];var i=t;this.sourceRoot!=null&&(i=$.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=$.urlParse(this.sourceRoot))){var a=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");ue.prototype.generatedPositionFor=o(function(t){var r=$.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:$.getArg(t,"line"),originalColumn:$.getArg(t,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",$.compareByOriginalPositions,$.getArg(t,"bias",Z.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:$.getArg(s,"generatedLine",null),column:$.getArg(s,"generatedColumn",null),lastColumn:$.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Ba.BasicSourceMapConsumer=ue;function dt(e,t){var r=e;typeof e=="string"&&(r=$.parseSourceMapInput(e));var n=$.getArg(r,"version"),i=$.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ci,this._names=new ci;var s={line:-1,column:0};this._sections=i.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var c=$.getArg(a,"offset"),u=$.getArg(c,"line"),l=$.getArg(c,"column");if(u<s.line||u===s.line&&l<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=c,{generatedOffset:{generatedLine:u+1,generatedColumn:l+1},consumer:new Z($.getArg(a,"map"),t)}})}o(dt,"IndexedSourceMapConsumer");dt.prototype=Object.create(Z.prototype);dt.prototype.constructor=Z;dt.prototype._version=3;Object.defineProperty(dt.prototype,"sources",{get:o(function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e},"get")});dt.prototype.originalPositionFor=o(function(t){var r={generatedLine:$.getArg(t,"line"),generatedColumn:$.getArg(t,"column")},n=td.search(r,this._sections,function(s,a){var c=s.generatedLine-a.generatedOffset.generatedLine;return c||s.generatedColumn-a.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},"IndexedSourceMapConsumer_originalPositionFor");dt.prototype.hasContentsOfAllSources=o(function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})},"IndexedSourceMapConsumer_hasContentsOfAllSources");dt.prototype.sourceContentFor=o(function(t,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(t,!0);if(s)return s}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')},"IndexedSourceMapConsumer_sourceContentFor");dt.prototype.generatedPositionFor=o(function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex($.getArg(t,"source"))!==-1){var i=n.consumer.generatedPositionFor(t);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}},"IndexedSourceMapConsumer_generatedPositionFor");dt.prototype._parseMappings=o(function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,a=0;a<s.length;a++){var c=s[a],u=i.consumer._sources.at(c.source);u=$.computeSourceURL(i.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;c.name&&(l=i.consumer._names.at(c.name),this._names.add(l),l=this._names.indexOf(l));var f={source:u,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:l};this.__generatedMappings.push(f),typeof f.originalLine=="number"&&this.__originalMappings.push(f)}Do(this.__generatedMappings,$.compareByGeneratedPositionsDeflated),Do(this.__originalMappings,$.compareByOriginalPositions)},"IndexedSourceMapConsumer_parseMappings");Ba.IndexedSourceMapConsumer=dt});var K_=h(z_=>{var L3=Yf().SourceMapGenerator,Ua=ai(),F3=/(\r?\n)/,V3=10,ui="$$$isSourceNode$$$";function He(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=i??null,this[ui]=!0,n!=null&&this.add(n)}o(He,"SourceNode");He.fromStringWithSourceMap=o(function(t,r,n){var i=new He,s=t.split(F3),a=0,c=o(function(){var d=g(),m=g()||"";return d+m;function g(){return a<s.length?s[a++]:void 0}},"shiftNextLine"),u=1,l=0,f=null;return r.eachMapping(function(d){if(f!==null)if(u<d.generatedLine)p(f,c()),u++,l=0;else{var m=s[a]||"",g=m.substr(0,d.generatedColumn-l);s[a]=m.substr(d.generatedColumn-l),l=d.generatedColumn,p(f,g),f=d;return}for(;u<d.generatedLine;)i.add(c()),u++;if(l<d.generatedColumn){var m=s[a]||"";i.add(m.substr(0,d.generatedColumn)),s[a]=m.substr(d.generatedColumn),l=d.generatedColumn}f=d},this),a<s.length&&(f&&p(f,c()),i.add(s.splice(a).join(""))),r.sources.forEach(function(d){var m=r.sourceContentFor(d);m!=null&&(n!=null&&(d=Ua.join(n,d)),i.setSourceContent(d,m))}),i;function p(d,m){if(d===null||d.source===void 0)i.add(m);else{var g=n?Ua.join(n,d.source):d.source;i.add(new He(d.originalLine,d.originalColumn,g,m,d.name))}}o(p,"addMappingWithCode")},"SourceNode_fromStringWithSourceMap");He.prototype.add=o(function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[ui]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this},"SourceNode_add");He.prototype.prepend=o(function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[ui]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this},"SourceNode_prepend");He.prototype.walk=o(function(t){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[ui]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})},"SourceNode_walk");He.prototype.join=o(function(t){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this},"SourceNode_join");He.prototype.replaceRight=o(function(t,r){var n=this.children[this.children.length-1];return n[ui]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this},"SourceNode_replaceRight");He.prototype.setSourceContent=o(function(t,r){this.sourceContents[Ua.toSetString(t)]=r},"SourceNode_setSourceContent");He.prototype.walkSourceContents=o(function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][ui]&&this.children[r].walkSourceContents(t);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)t(Ua.fromSetString(i[r]),this.sourceContents[i[r]])},"SourceNode_walkSourceContents");He.prototype.toString=o(function(){var t="";return this.walk(function(r){t+=r}),t},"SourceNode_toString");He.prototype.toStringWithSourceMap=o(function(t){var r={code:"",line:1,column:0},n=new L3(t),i=!1,s=null,a=null,c=null,u=null;return this.walk(function(l,f){r.code+=l,f.source!==null&&f.line!==null&&f.column!==null?((s!==f.source||a!==f.line||c!==f.column||u!==f.name)&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name}),s=f.source,a=f.line,c=f.column,u=f.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),s=null,i=!1);for(var p=0,d=l.length;p<d;p++)l.charCodeAt(p)===V3?(r.line++,r.column=0,p+1===d?(s=null,i=!1):i&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name})):r.column++}),this.walkSourceContents(function(l,f){n.setSourceContent(l,f)}),{code:r.code,map:n}},"SourceNode_toStringWithSourceMap");z_.SourceNode=He});var Q_=h(Ga=>{Ga.SourceMapGenerator=Yf().SourceMapGenerator;Ga.SourceMapConsumer=Z_().SourceMapConsumer;Ga.SourceNode=K_().SourceNode});var X_=h((Za,J_)=>{"use strict";Za.__esModule=!0;var nd=Ee(),an=void 0;try{(typeof define!="function"||!define.amd)&&(W_=Q_(),an=W_.SourceNode)}catch{}var W_;an||(an=o(function(e,t,r,n){this.src="",n&&this.add(n)},"SourceNode"),an.prototype={add:o(function(t){nd.isArray(t)&&(t=t.join("")),this.src+=t},"add"),prepend:o(function(t){nd.isArray(t)&&(t=t.join("")),this.src=t+this.src},"prepend"),toStringWithSourceMap:o(function(){return{code:this.toString()}},"toStringWithSourceMap"),toString:o(function(){return this.src},"toString")});function rd(e,t,r){if(nd.isArray(e)){for(var n=[],i=0,s=e.length;i<s;i++)n.push(t.wrap(e[i],r));return n}else if(typeof e=="boolean"||typeof e=="number")return e+"";return e}o(rd,"castChunk");function Y_(e){this.srcFile=e,this.source=[]}o(Y_,"CodeGen");Y_.prototype={isEmpty:o(function(){return!this.source.length},"isEmpty"),prepend:o(function(t,r){this.source.unshift(this.wrap(t,r))},"prepend"),push:o(function(t,r){this.source.push(this.wrap(t,r))},"push"),merge:o(function(){var t=this.empty();return this.each(function(r){t.add([" ",r,`
59
+ `])}),t},"merge"),each:o(function(t){for(var r=0,n=this.source.length;r<n;r++)t(this.source[r])},"each"),empty:o(function(){var t=this.currentLocation||{start:{}};return new an(t.start.line,t.start.column,this.srcFile)},"empty"),wrap:o(function(t){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return t instanceof an?t:(t=rd(t,this,r),new an(r.start.line,r.start.column,this.srcFile,t))},"wrap"),functionCall:o(function(t,r,n){return n=this.generateList(n),this.wrap([t,r?"."+r+"(":"(",n,")"])},"functionCall"),quotedString:o(function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},"quotedString"),objectLiteral:o(function(t){var r=this,n=[];Object.keys(t).forEach(function(s){var a=rd(t[s],r);a!=="undefined"&&n.push([r.quotedString(s),":",a])});var i=this.generateList(n);return i.prepend("{"),i.add("}"),i},"objectLiteral"),generateList:o(function(t){for(var r=this.empty(),n=0,i=t.length;n<i;n++)n&&r.add(","),r.add(rd(t[n],this));return r},"generateList"),generateArray:o(function(t){var r=this.generateList(t);return r.prepend("["),r.add("]"),r},"generateArray")};Za.default=Y_;J_.exports=Za.default});var iP=h((za,nP)=>{"use strict";za.__esModule=!0;function rP(e){return e&&e.__esModule?e:{default:e}}o(rP,"_interopRequireDefault");var eP=Aa(),H3=Ye(),id=rP(H3),B3=Ee(),U3=X_(),tP=rP(U3);function li(e){this.value=e}o(li,"Literal");function pi(){}o(pi,"JavaScriptCompiler");pi.prototype={nameLookup:o(function(t,r){return this.internalNameLookup(t,r)},"nameLookup"),depthedLookup:o(function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},"depthedLookup"),compilerInfo:o(function(){var t=eP.COMPILER_REVISION,r=eP.REVISION_CHANGES[t];return[t,r]},"compilerInfo"),appendToBuffer:o(function(t,r,n){return B3.isArray(t)||(t=[t]),t=this.source.wrap(t,r),this.environment.isSimple?["return ",t,";"]:n?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},"appendToBuffer"),initializeBuffer:o(function(){return this.quotedString("")},"initializeBuffer"),internalNameLookup:o(function(t,r){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(r),")"]},"internalNameLookup"),lookupPropertyFunctionIsUsed:!1,compile:o(function(t,r,n,i){this.environment=t,this.options=r,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!i,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,r),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var s=t.opcodes,a=void 0,c=void 0,u=void 0,l=void 0;for(u=0,l=s.length;u<l;u++)a=s[u],this.source.currentLocation=a.loc,c=c||a.loc,this[a.opcode].apply(this,a.args);if(this.source.currentLocation=c,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new id.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
60
60
  `]),this.decorators.push("return fn;"),i?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
61
61
  `),this.decorators.push(`}
62
62
  `),this.decorators=this.decorators.merge()));var f=this.createFunctionContext(i);if(this.isChild)return f;var p={compiler:this.compilerInfo(),main:f};this.decorators&&(p.main_d=this.decorators,p.useDecorators=!0);var d=this.context,m=d.programs,g=d.decorators;for(u=0,l=m.length;u<l;u++)m[u]&&(p[u]=m[u],g[u]&&(p[u+"_d"]=g[u],p.useDecorators=!0));return this.environment.usePartial&&(p.usePartial=!0),this.options.data&&(p.useData=!0),this.useDepths&&(p.useDepths=!0),this.useBlockParams&&(p.useBlockParams=!0),this.options.compat&&(p.compat=!0),i?p.compilerOptions=this.options:(p.compiler=JSON.stringify(p.compiler),this.source.currentLocation={start:{line:1,column:0}},p=this.objectLiteral(p),r.srcName?(p=p.toStringWithSourceMap({file:r.destName}),p.map=p.map&&p.map.toString()):p=p.toString()),p},"compile"),preamble:o(function(){this.lastContext=0,this.source=new tP.default(this.options.srcName),this.decorators=new tP.default(this.options.srcName)},"preamble"),createFunctionContext:o(function(t){var r=this,n="",i=this.stackVars.concat(this.registers.list);i.length>0&&(n+=", "+i.join(", "));var s=0;Object.keys(this.aliases).forEach(function(u){var l=r.aliases[u];l.children&&l.referenceCount>1&&(n+=", alias"+ ++s+"="+u,l.children[0]="alias"+s)}),this.lookupPropertyFunctionIsUsed&&(n+=", "+this.lookupPropertyFunctionVarDeclaration());var a=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths");var c=this.mergeSource(n);return t?(a.push(c),Function.apply(this,a)):this.source.wrap(["function(",a.join(","),`) {
@@ -68,10 +68,10 @@ Expecting `+ln.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Ya="Parse error
68
68
  }
69
69
  return undefined
70
70
  }
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(Gj(this.options.strict&&s,this,r,n,t));return}for(var c=r.length;n<c;n++)this.replaceStack(function(u){var l=a.nameLookup(u,r[n],t);return i?[" && ",l]:[" != null ? ",l," : ",u]})},"resolvePath"),resolvePossibleLambda:o(function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},"resolvePossibleLambda"),pushStringParam:o(function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},"pushStringParam"),emptyHash:o(function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},"emptyHash"),pushHash:o(function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},"pushHash"),popHash:o(function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},"popHash"),pushString:o(function(t){this.pushStackLiteral(this.quotedString(t))},"pushString"),pushLiteral:o(function(t){this.pushStackLiteral(t)},"pushLiteral"),pushProgram:o(function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},"pushProgram"),registerDecorator:o(function(t,r){var n=this.nameLookup("decorators",r,"decorator"),i=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",i])," || fn;"])},"registerDecorator"),invokeHelper:o(function(t,r,n){var i=this.popStack(),s=this.setupHelper(t,r),a=[];n&&a.push(s.name),a.push(i),this.options.strict||a.push(this.aliasable("container.hooks.helperMissing"));var c=["(",this.itemsSeparatedBy(a,"||"),")"],u=this.source.functionCall(c,"call",s.callParams);this.push(u)},"invokeHelper"),itemsSeparatedBy:o(function(t,r){var n=[];n.push(t[0]);for(var i=1;i<t.length;i++)n.push(r,t[i]);return n},"itemsSeparatedBy"),invokeKnownHelper:o(function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},"invokeKnownHelper"),invokeAmbiguous:o(function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,t,r),s=this.lastHelper=this.nameLookup("helpers",t,"helper"),a=["(","(helper = ",s," || ",n,")"];this.options.strict||(a[0]="(helper = ",a.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",a,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},"invokeAmbiguous"),invokePartial:o(function(t,r,n){var i=[],s=this.setupParams(r,1,i);t&&(r=this.popStack(),delete s.name),n&&(s.indent=JSON.stringify(n)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",t?i.unshift(r):i.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},"invokePartial"),assignToHash:o(function(t){var r=this.popStack(),n=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var a=this.hash;n&&(a.contexts[t]=n),i&&(a.types[t]=i),s&&(a.ids[t]=s),a.values[t]=r},"assignToHash"),pushId:o(function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},"pushId"),compiler:pi,compileChildren:o(function(t,r){for(var n=t.children,i=void 0,s=void 0,a=0,c=n.length;a<c;a++){i=n[a],s=new this.compiler;var u=this.matchExistingProgram(i);if(u==null){this.context.programs.push("");var l=this.context.programs.length;i.index=l,i.name="program"+l,this.context.programs[l]=s.compile(i,r,this.context,!this.precompile),this.context.decorators[l]=s.decorators,this.context.environments[l]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=u.index,i.name="program"+u.index,this.useDepths=this.useDepths||u.useDepths,this.useBlockParams=this.useBlockParams||u.useBlockParams}},"compileChildren"),matchExistingProgram:o(function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var i=this.context.environments[r];if(i&&i.equals(t))return i}},"matchExistingProgram"),programExpression:o(function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},"programExpression"),useRegister:o(function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},"useRegister"),push:o(function(t){return t instanceof li||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new li(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 id.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof li)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 li)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 li)return n.value;if(!r){if(!this.stackSlot)throw new id.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 li?r.value:r},"topStack"),contextName:o(function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},"contextName"),quotedString:o(function(t){return this.source.quotedString(t)},"quotedString"),objectLiteral:o(function(t){return this.source.objectLiteral(t)},"objectLiteral"),aliasable:o(function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},"aliasable"),setupHelper:o(function(t,r,n){var i=[],s=this.setupHelperArgs(r,t,i,n),a=this.nameLookup("helpers",r,"helper"),c=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:a,callParams:[c].concat(i)}},"setupHelper"),setupParams:o(function(t,r,n){var i={},s=[],a=[],c=[],u=!n,l=void 0;u&&(n=[]),i.name=this.quotedString(t),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var f=this.popStack(),p=this.popStack();(p||f)&&(i.fn=p||"container.noop",i.inverse=f||"container.noop");for(var d=r;d--;)l=this.popStack(),n[d]=l,this.trackIds&&(c[d]=this.popStack()),this.stringParams&&(a[d]=this.popStack(),s[d]=this.popStack());return u&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(c)),this.stringParams&&(i.types=this.source.generateArray(a),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},"setupParams"),setupHelperArgs:o(function(t,r,n,i){var s=this.setupParams(t,r,n);return s.loc=JSON.stringify(this.source.currentLocation),s=this.objectLiteral(s),i?(this.useRegister("options"),n.push("options"),["options=",s]):n?(n.push(s),""):s},"setupHelperArgs")};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=pi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();pi.isValidJavaScriptVariableName=function(e){return!pi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function Gj(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(Gj,"strictLookup");za.default=pi;nP.exports=za.default});var aP=h((Ka,sP)=>{"use strict";Ka.__esModule=!0;function Lo(e){return e&&e.__esModule?e:{default:e}}o(Lo,"_interopRequireDefault");var Zj=c_(),zj=Lo(Zj),Kj=jf(),Qj=Lo(Kj),od=__(),sd=O_(),Wj=iP(),Yj=Lo(Wj),Jj=Da(),Xj=Lo(Jj),e3=Nf(),t3=Lo(e3),r3=zj.default.create;function oP(){var e=r3();return e.compile=function(t,r){return sd.compile(t,r,e)},e.precompile=function(t,r){return sd.precompile(t,r,e)},e.AST=Qj.default,e.Compiler=sd.Compiler,e.JavaScriptCompiler=Yj.default,e.Parser=od.parser,e.parse=od.parse,e.parseWithoutProcessing=od.parseWithoutProcessing,e}o(oP,"create");var fi=oP();fi.create=oP;t3.default(fi);fi.Visitor=Xj.default;fi.default=fi;Ka.default=fi;sP.exports=Ka.default});var cP=h(Qa=>{"use strict";Qa.__esModule=!0;Qa.print=s3;Qa.PrintVisitor=Y;function n3(e){return e&&e.__esModule?e:{default:e}}o(n3,"_interopRequireDefault");var i3=Da(),o3=n3(i3);function s3(e){return new Y().accept(e)}o(s3,"print");function Y(){this.padding=0}o(Y,"PrintVisitor");Y.prototype=new o3.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 zt=h((NH,pP)=>{var Wa=aP().default,lP=cP();Wa.PrintVisitor=lP.PrintVisitor;Wa.print=lP.print;pP.exports=Wa;function uP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Wa.compile(n)}o(uP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=uP,require.extensions[".hbs"]=uP)});var tq={};MP(tq,{getGenerateFilesData:()=>eq,getGenerateMetadata:()=>X3});module.exports=DP(tq);var pd=et(Vv());var so="AppRestClient",Zs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Vp="src/data",Hp="@/data",Bp={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/data/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"}};var zs={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ks={fileName:"app-rest-client",extension:"ts"},CR="QueryModule",pr={queryModuleEnum:CR,optionsType:"InvalidateQueryOptions",functionName:"invalidateQueries"},Qs={fileName:"invalidateQueries",extension:"ts"},ao={name:"zodExtended",properties:{sortingString:"sortingString"}},Ws={fileName:"zodExtended",extension:"ts"};var Hv="Schema",Bv="Enum",Uv="Body",Gv="Param",Zv="Response",zv="ErrorResponse",co="z.void()",Ys="z.instanceof(Blob)",uo="z.enum",Js="z.string()",Xs={bindings:["z"],from:"zod"};var lo={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"}},standalone:!1,baseUrl:"",schemaSuffix:Hv,enumSuffix:Bv,withDefaultValues:!0,extractEnums:!0,replaceOptionalWithNullish:!1,restClientImportPath:Bp.appRestClient.template,removeOperationPrefixEndingWith:"Controller_",queryTypesImportPath:Bp.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,invalidateQueryOptions:!0};var Me={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},Kv={bindings:[Me.query,Me.infiniteQuery,Me.mutation,Me.queryClient],from:"@tanstack/react-query"},po={pageParamName:"page"},ea={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},fo="moduleName";var De=o(e=>e.method==="get","isQuery"),Ot=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),Qn=o((e,t)=>De(e)&&(t??Object.values(po)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),fr=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),Qv=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ie=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),Wv=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Up=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),Yv=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),kR=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"),Gp=o(e=>{let t=e.map(U).map(Jv).map(r=>jR(r)).flat();return kR(t)},"getMostCommonAdjacentCombinationSplit"),Jv=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),Xv=o(e=>Jv(e).join(" "),"camelToSpaceSeparated"),jR=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"),eS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${fr(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord"),tS=o(e=>e!==void 0,"isString");var ta=o((e,t)=>{let r=De(e)&&Ot(e)&&t;return`use${U(ie(e.operationName))}${r?"Mutation":""}`},"getQueryName"),rS=o(e=>`use${U(ie(e.operationName))}Infinite`,"getInfiniteQueryName");var Le=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Zp={"Content-Type":"application/json",Accept:"application/json"},nS="data",zp="axios",dr="config",xt="AxiosRequestConfig",ra={defaultImport:zp,bindings:[xt],from:"axios"};var iS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),wt=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function M(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(M,"isReferenceObject");function be(e){return!M(e)}o(be,"isSchemaObject");function na(e){return e.type==="array"}o(na,"isArraySchemaObject");function oS(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(qR(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(M(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(oS,"inferRequiredSchema");var qR=o(e=>!M(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"),MR=Symbol.for("@ts-pattern/isVariadic"),oa="@ts-pattern/anonymous-select-key",Kp=o(e=>!!(e&&typeof e=="object"),"r"),ia=o(e=>e&&!!e[Vt],"i"),Tt=o((e,t,r)=>{if(ia(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(Kp(e)){if(!Kp(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];ia(c)&&c[MR]?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||ia(s=i)&&s[Vt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),vr=o(e=>{var t,r,n;return Kp(e)?ia(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?ho(e,vr):ho(Object.values(e),vr):[]},"o"),ho=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>DR(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>LR(e,t),"or"),select:o(t=>t===void 0?sS(e):sS(t,e),"select")})}o(Qe,"u");function DR(e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(vr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>vr(e),"getSelectionKeys"),matcherType:"optional"})})}o(DR,"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(()=>ho(e,vr),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function LR(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return ho(e,vr).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>ho(e,vr),"getSelectionKeys"),matcherType:"or"})})}o(LR,"d");function D(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(D,"p");function sS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Vt]:()=>({match:o(n=>{let i={[t??oa]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??oa].concat(r===void 0?[]:vr(r)),"getSelectionKeys")})})}o(sS,"y");function At(e){return typeof e=="number"}o(At,"v");function mr(e){return typeof e=="string"}o(mr,"b");function hr(e){return typeof e=="bigint"}o(hr,"w");var jL=Qe(D(function(e){return!0}));var gr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>gr(z(e,(r=>D(n=>mr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>gr(z(e,(r=>D(n=>mr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>gr(z(e,(r=>D(n=>mr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&!!n.match(r)))));var r},"regex")}),"j"),qL=gr(D(mr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(z(e,((n,i)=>D(s=>At(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(z(e,(r=>D(n=>At(n)&&n<r))(t))),"lt"),gt:o(t=>It(z(e,(r=>D(n=>At(n)&&n>r))(t))),"gt"),lte:o(t=>It(z(e,(r=>D(n=>At(n)&&n<=r))(t))),"lte"),gte:o(t=>It(z(e,(r=>D(n=>At(n)&&n>=r))(t))),"gte"),int:o(()=>It(z(e,D(t=>At(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(z(e,D(t=>At(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(z(e,D(t=>At(t)&&t>0))),"positive"),negative:o(()=>It(z(e,D(t=>At(t)&&t<0))),"negative")}),"x"),ML=It(D(At)),yr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>yr(z(e,((n,i)=>D(s=>hr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n<r))(t))),"lt"),gt:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n>r))(t))),"gt"),lte:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n<=r))(t))),"lte"),gte:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n>=r))(t))),"gte"),positive:o(()=>yr(z(e,D(t=>hr(t)&&t>0))),"positive"),negative:o(()=>yr(z(e,D(t=>hr(t)&&t<0))),"negative")}),"A"),DL=yr(D(hr)),LL=Qe(D(function(e){return typeof e=="boolean"})),FL=Qe(D(function(e){return typeof e=="symbol"})),VL=Qe(D(function(e){return e==null})),HL=Qe(D(function(e){return e!=null}));var Jp=class Jp 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(Jp,"W");var Qp=Jp,Wp={matched:!1,value:void 0};function he(e){return new Yp(e,Wp)}o(he,"z");var mo=class mo{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)?Wp:{matched:!0,value:r(s?oa in a?a[oa]:a:this.input,this.input)};return new mo(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new mo(this.input,n?{matched:!0,value:r(this.input,this.input)}:Wp)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Qp(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(mo,"I");var Yp=mo;var Xp=2,aS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],cS=["query","header","path"],Zr=["get","put","post","delete","options","head","patch","trace"],uS=["string","number","integer","boolean"],Wn=["allOf","anyOf","oneOf"];var pS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),zr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),Yn=o(e=>zr(e).split("/").at(-1),"getSchemaNameByRef");function tf(e){let t=FR(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ie(t)}o(tf,"normalizeString");function fS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(fS,"wrapWithQuotesIfNeeded");function dS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(dS,"unwrapQuotesIfNeeded");function FR(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(FR,"prefixStringStartingWithNumberIfNeeded");function rf(e){let t=e.replaceAll("_","#");return ie(t.replaceAll("-","_")).replaceAll("#","_")}o(rf,"pathParamToVariableName");var Ht=o(e=>uS.includes(e),"isPrimitiveType");function mS(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(mS,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||aS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function sa(e){return e>=200&&e<300}o(sa,"isMainResponseStatus");function aa(e){return!(e>=200&&e<300)}o(aa,"isErrorStatus");function Jn(e){return["application/json","application/pdf"].includes(e)}o(Jn,"isMediaTypeAllowed");var lS=/({\w+})/g,VR=/[^\w\-]+/g;function hS(e){e=U(Qv(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(lS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(lS,"")}By${U(r.slice(1,-1))}`}return e.replace(VR,"_")}o(hS,"pathToVariableName");var ef=/{(\b\w+(?:-\w+)*\b)}/g;function gS(e){let t=e.match(ef);return t===null?e.replaceAll(ef,":$1"):(t.forEach(r=>{let n=rf(r.replaceAll(ef,":$1"));e=e.replaceAll(r,n)}),e)}o(gS,"replaceHyphenatedPath");var yS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&be(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Kr=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Nt(e){return Wv(e)}o(Nt,"formatTag");function Sr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Nt(r??t.defaultTag)}o(Sr,"getOperationTag");function vS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(vS,"isTagExcluded");function _e(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(M(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Wn.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&&_e(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&&_e(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;_e(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;_e(s,t)}}o(_e,"iterateSchema");var Rt=o((e,t)=>Up(U(tf(e)),t),"getZodSchemaName"),go=o((e,t,r)=>Up(U(tf(e)),`${t}${r}`),"getEnumZodSchemaName"),Pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),SS=o(e=>e.startsWith(uo),"isEnumZodSchema"),Qr=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),ca=o(e=>ie(`${e}_${Uv}`),"getBodyZodSchemaName"),bS=o((e,t)=>ie(`${e}_${t}${Gv}`),"getParamZodSchemaName"),HR=o(e=>ie(`${e}${Zv}`),"getMainResponseZodSchemaName"),BR=o((e,t)=>ie(`${e}_${t}_${zv}`),"getErrorResponseZodSchemaName");function ua({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Qr(t,r,n);return!sa(i)&&e!=="default"&&aa(i)?BR(s,e):HR(s)}o(ua,"getResponseZodSchemaName");function yo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(Xv(i))}: \`${e[i]}\``],[])}o(yo,"getSchemaDescriptions");var vo=o((e,t)=>Yv(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),_S=o((e,t)=>Pe(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),br=o((e,t,r)=>{if(!Pe(t))return t===co?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${vo(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function PS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(PS,"getZodSchemaType");function ES(e){if(e.schemaObj)return[e.schemaObj.description,...yo(e.schemaObj).join(". ")].filter(Boolean)}o(ES,"getZodSchemaDescription");function $S(e,t,r){var n;if(M(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?br(e,i,r):void 0}if(na(t)){if(!M(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${br(e,i,r)}[]`:void 0}if(Wn.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return $S(e,i[0],r)}return t.type}o($S,"getType");function OS(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,...yo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:$S(e,c.schema,r)??"unknown",description:p.join(". ")})}return _e(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(M(c)){let u=e.resolveObject(c);_e(u,{data:{pathSegments:[]},onSchema:a})}}),_e(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(OS,"getZodSchemaPropertyDescriptions");function la(e){return he(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(la,"primitiveTypeToTsType");function Xn({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&Pe(e)?(n=br(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Ht(t==null?void 0:t.type)&&(n=la(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:Yr({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(Xn,"getTsTypeBase");function Wr({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of Wn){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return Wr({schema:u,parentTypes:r,resolver:n})});return a.every(({metaType:c})=>c==="object")?{metaType:"object",objectProperties:a.reduce((c,{objectProperties:u})=>{let l=u.map(({name:f})=>f);return[...c.filter(({name:f})=>!l.includes(f)),...u]},[])}:{metaType:"composite",[i]:a}}else e=n.resolveObject(s[0])}return e.type==="array"?{metaType:"array",arrayType:xS({arraySchema:e,resolver:n,parentTypes:r})}:(e.type==="object"||e.properties)&&t?{metaType:"object",objectProperties:[],isCircular:!0}:e.type==="object"||e.properties?{metaType:"object",objectProperties:UR({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(Wr,"getSchemaTsMetaType");function xS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(M(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=Xn({zodSchemaName:n,schema:i,resolver:r}),a=wS(s,t),c=Wr({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(xS,"getArraySchemaTsType");function UR({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(M(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=Xn({zodSchemaName:c,schema:u,resolver:r}),f=wS(l,t),p=Wr({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=xS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Ht(i.type))return{name:n,isRequired:s,type:la(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(UR,"getSchemaTsProperties");function wS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(wS,"getIsCircular");var So=o(e=>fr(ie(e.operationName)),"getEndpointName");function AS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:bo(e,t),options:t})}.`:""}${So(e)}`}o(AS,"getImportedEndpointName");var IS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function bo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Nt(r??t.defaultTag)}o(bo,"getEndpointTag");function _o(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(Pe(i.zodSchema))s=br(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&be(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Ht(f)&&(s=la(f))}return{name:wt(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>!(r!=null&&r.removePageParam)||i.name!==po.pageParamName).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===po.pageParamName?"pageParam":i.name}))}o(_o,"mapEndpointParamsToFunctionParams");function TS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=iS(i.name)?i.name:`"${i.name}"`,a=wt(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Zp["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Zp.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=wt(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(TS,"getEndpointConfig");function _r({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=nf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=nf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>vo(u,e.options),"getEntityName"),options:e.options});return GR(e.options,a,c)}o(_r,"getModelsImports");function NS({tag:e,endpoints:t,options:r}){return nf({type:"endpoints",tag:e,entities:t,getTag:o(n=>bo(n,r),"getTag"),getEntityName:So,options:r})}o(NS,"getEndpointsImports");function RS({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:`${Jr(i)}${Yr({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(RS,"getEntityImports");function Jr(e){let t=Hp;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Vp}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Vp}`,"g"),Hp)),`${t}/`.replace(/\/\//g,"/")}o(Jr,"getImportPath");function nf({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?"./":Jr(s)}${Yr({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(nf,"getImports");function GR(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:Le(n.bindings)}))}o(GR,"mergeImports");function ei({fileName:e,extension:t}){return`${e}.${t}`}o(ei,"getFileNameWithExtension");function CS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${fr(t)}/`:""}${fr(t)}.${i}`:i}o(CS,"getTagFileNameWithoutExtension");function Yr(...e){return CS(...e)}o(Yr,"getTagImportPath");function kS(...e){return`${CS(...e)}.ts`}o(kS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function jS(e){return e.standalone?`${Jr(e)}${Ks.fileName}`:e.restClientImportPath}o(jS,"getAppRestClientImportPath");function qS(e){return e.standalone?`${Jr(e)}${zs.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(qS,"getQueryTypesImportPath");function MS(e){return`${Jr(e)}${Qs.fileName}`}o(MS,"getInvalidateQueriesImportPath");function DS(e){return`${Jr(e)}${Ws.fileName}`}o(DS,"getZodExtendedImportPath");var of=["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 Xr(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Xr,"pick");function ti(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Sr(e,t),i=vS(n,t);return r||i}o(ti,"isOperationExcluded");function sf({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${hS(e)}`,u=r.operationId?wt(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=eS(u,i);of.includes(l)||(u=l)}return of.includes(u)?c:u}o(sf,"getOperationName");function Po({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Sr(r,n):n.defaultTag,s=o(a=>{let c=sf({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>sf({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??sf({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Po,"getUniqueOperationName");function LS(e,t,r){let n=[];for(let i in e.paths){if(Kr(i,r))continue;let s=e.paths[i],a=Xr(s,Zr);for(let c in a){let u=a[c];if(!u||ti(u,r))continue;let l=Po({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(LS,"getUniqueOperationNamesWithoutSplitByTags");function FS(e,t){let r={};for(let n in e.paths){if(Kr(n,t))continue;let i=e.paths[n],s=Xr(i,Zr);for(let a in s){let c=s[a];if(!c||ti(c,t))continue;let u=t.splitByTags?Sr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(FS,"getOperationsByTag");var VS={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 Eo(e){return{type:"invalid-schema",message:e}}o(Eo,"getInvalidSchemaError");function HS(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(HS,"getInvalidOperationIdError");function BS(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(BS,"getMissingPathParameterError");function US(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(US,"getNotAllowedInlineEnumError");function GS(e){return{type:"not-allowed-circular-schema",message:e}}o(GS,"getNotAllowedCircularSchemaError");function ZS(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${uf(t,r)}`}}o(ZS,"getMissingAclConditionPropertyError");function cf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${af(e)} in operation ${uf(t,r)}`}}o(cf,"getMissingStatusCodeError");function zS(e,t,r){return{type:"invalid-status-code",message:`Operation ${uf(t,r)} expected HTTP status code ${af(e.expected)} but received ${af(e.received)}`}}o(zS,"getInvalidStatusCodeError");function uf(e,t){return e.operationId??`${t.method} ${t.path}`}o(uf,"getOperationDescriptor");function af(e){return`${e} (${VS[e]})`}o(af,"getStatusCodeDescription");function Ct({schema:e,meta:t,options:r}){let n=[];he(e.type).with("string",()=>n.push(KR(e))).with("number","integer",()=>n.push(WR(e))).with("array",()=>n.push(YR(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
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(G3(this.options.strict&&s,this,r,n,t));return}for(var c=r.length;n<c;n++)this.replaceStack(function(u){var l=a.nameLookup(u,r[n],t);return i?[" && ",l]:[" != null ? ",l," : ",u]})},"resolvePath"),resolvePossibleLambda:o(function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},"resolvePossibleLambda"),pushStringParam:o(function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},"pushStringParam"),emptyHash:o(function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},"emptyHash"),pushHash:o(function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},"pushHash"),popHash:o(function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},"popHash"),pushString:o(function(t){this.pushStackLiteral(this.quotedString(t))},"pushString"),pushLiteral:o(function(t){this.pushStackLiteral(t)},"pushLiteral"),pushProgram:o(function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},"pushProgram"),registerDecorator:o(function(t,r){var n=this.nameLookup("decorators",r,"decorator"),i=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",i])," || fn;"])},"registerDecorator"),invokeHelper:o(function(t,r,n){var i=this.popStack(),s=this.setupHelper(t,r),a=[];n&&a.push(s.name),a.push(i),this.options.strict||a.push(this.aliasable("container.hooks.helperMissing"));var c=["(",this.itemsSeparatedBy(a,"||"),")"],u=this.source.functionCall(c,"call",s.callParams);this.push(u)},"invokeHelper"),itemsSeparatedBy:o(function(t,r){var n=[];n.push(t[0]);for(var i=1;i<t.length;i++)n.push(r,t[i]);return n},"itemsSeparatedBy"),invokeKnownHelper:o(function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},"invokeKnownHelper"),invokeAmbiguous:o(function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,t,r),s=this.lastHelper=this.nameLookup("helpers",t,"helper"),a=["(","(helper = ",s," || ",n,")"];this.options.strict||(a[0]="(helper = ",a.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",a,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},"invokeAmbiguous"),invokePartial:o(function(t,r,n){var i=[],s=this.setupParams(r,1,i);t&&(r=this.popStack(),delete s.name),n&&(s.indent=JSON.stringify(n)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",t?i.unshift(r):i.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},"invokePartial"),assignToHash:o(function(t){var r=this.popStack(),n=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var a=this.hash;n&&(a.contexts[t]=n),i&&(a.types[t]=i),s&&(a.ids[t]=s),a.values[t]=r},"assignToHash"),pushId:o(function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},"pushId"),compiler:pi,compileChildren:o(function(t,r){for(var n=t.children,i=void 0,s=void 0,a=0,c=n.length;a<c;a++){i=n[a],s=new this.compiler;var u=this.matchExistingProgram(i);if(u==null){this.context.programs.push("");var l=this.context.programs.length;i.index=l,i.name="program"+l,this.context.programs[l]=s.compile(i,r,this.context,!this.precompile),this.context.decorators[l]=s.decorators,this.context.environments[l]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=u.index,i.name="program"+u.index,this.useDepths=this.useDepths||u.useDepths,this.useBlockParams=this.useBlockParams||u.useBlockParams}},"compileChildren"),matchExistingProgram:o(function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var i=this.context.environments[r];if(i&&i.equals(t))return i}},"matchExistingProgram"),programExpression:o(function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},"programExpression"),useRegister:o(function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},"useRegister"),push:o(function(t){return t instanceof li||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new li(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 id.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof li)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 li)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 li)return n.value;if(!r){if(!this.stackSlot)throw new id.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 li?r.value:r},"topStack"),contextName:o(function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},"contextName"),quotedString:o(function(t){return this.source.quotedString(t)},"quotedString"),objectLiteral:o(function(t){return this.source.objectLiteral(t)},"objectLiteral"),aliasable:o(function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},"aliasable"),setupHelper:o(function(t,r,n){var i=[],s=this.setupHelperArgs(r,t,i,n),a=this.nameLookup("helpers",r,"helper"),c=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:a,callParams:[c].concat(i)}},"setupHelper"),setupParams:o(function(t,r,n){var i={},s=[],a=[],c=[],u=!n,l=void 0;u&&(n=[]),i.name=this.quotedString(t),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var f=this.popStack(),p=this.popStack();(p||f)&&(i.fn=p||"container.noop",i.inverse=f||"container.noop");for(var d=r;d--;)l=this.popStack(),n[d]=l,this.trackIds&&(c[d]=this.popStack()),this.stringParams&&(a[d]=this.popStack(),s[d]=this.popStack());return u&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(c)),this.stringParams&&(i.types=this.source.generateArray(a),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},"setupParams"),setupHelperArgs:o(function(t,r,n,i){var s=this.setupParams(t,r,n);return s.loc=JSON.stringify(this.source.currentLocation),s=this.objectLiteral(s),i?(this.useRegister("options"),n.push("options"),["options=",s]):n?(n.push(s),""):s},"setupHelperArgs")};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=pi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();pi.isValidJavaScriptVariableName=function(e){return!pi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function G3(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(G3,"strictLookup");za.default=pi;nP.exports=za.default});var aP=h((Ka,sP)=>{"use strict";Ka.__esModule=!0;function Lo(e){return e&&e.__esModule?e:{default:e}}o(Lo,"_interopRequireDefault");var Z3=c_(),z3=Lo(Z3),K3=jf(),Q3=Lo(K3),od=__(),sd=O_(),W3=iP(),Y3=Lo(W3),J3=Da(),X3=Lo(J3),ej=Nf(),tj=Lo(ej),rj=z3.default.create;function oP(){var e=rj();return e.compile=function(t,r){return sd.compile(t,r,e)},e.precompile=function(t,r){return sd.precompile(t,r,e)},e.AST=Q3.default,e.Compiler=sd.Compiler,e.JavaScriptCompiler=Y3.default,e.Parser=od.parser,e.parse=od.parse,e.parseWithoutProcessing=od.parseWithoutProcessing,e}o(oP,"create");var fi=oP();fi.create=oP;tj.default(fi);fi.Visitor=X3.default;fi.default=fi;Ka.default=fi;sP.exports=Ka.default});var cP=h(Qa=>{"use strict";Qa.__esModule=!0;Qa.print=sj;Qa.PrintVisitor=Y;function nj(e){return e&&e.__esModule?e:{default:e}}o(nj,"_interopRequireDefault");var ij=Da(),oj=nj(ij);function sj(e){return new Y().accept(e)}o(sj,"print");function Y(){this.padding=0}o(Y,"PrintVisitor");Y.prototype=new oj.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 zt=h((NH,pP)=>{var Wa=aP().default,lP=cP();Wa.PrintVisitor=lP.PrintVisitor;Wa.print=lP.print;pP.exports=Wa;function uP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Wa.compile(n)}o(uP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=uP,require.extensions[".hbs"]=uP)});var tq={};MP(tq,{getGenerateFilesData:()=>eq,getGenerateMetadata:()=>Xj});module.exports=DP(tq);var pd=et(Vv());var so="AppRestClient",Zs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Vp="src/data",Hp="@/data",Bp={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/data/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"}};var zs={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ks={fileName:"app-rest-client",extension:"ts"},CR="QueryModule",pr={queryModuleEnum:CR,optionsType:"InvalidateQueryOptions",functionName:"invalidateQueries"},Qs={fileName:"invalidateQueries",extension:"ts"},ao={name:"zodExtended",properties:{sortingString:"sortingString"}},Ws={fileName:"zodExtended",extension:"ts"};var Hv="Schema",Bv="Enum",Uv="Body",Gv="Param",Zv="Response",zv="ErrorResponse",co="z.void()",Ys="z.instanceof(Blob)",uo="z.enum",Js="z.string()",Xs={bindings:["z"],from:"zod"};var lo={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"}},standalone:!1,baseUrl:"",schemaSuffix:Hv,enumSuffix:Bv,withDefaultValues:!0,extractEnums:!0,replaceOptionalWithNullish:!1,restClientImportPath:Bp.appRestClient.template,removeOperationPrefixEndingWith:"Controller_",queryTypesImportPath:Bp.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,invalidateQueryOptions:!0};var Me={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},Kv={bindings:[Me.query,Me.infiniteQuery,Me.mutation,Me.queryClient],from:"@tanstack/react-query"},po={pageParamName:"page"},ea={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},fo="moduleName";var De=o(e=>e.method==="get","isQuery"),Ot=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),Qn=o((e,t)=>De(e)&&(t??Object.values(po)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),fr=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),Qv=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ie=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),Wv=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Up=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),Yv=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),kR=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"),Gp=o(e=>{let t=e.map(U).map(Jv).map(r=>jR(r)).flat();return kR(t)},"getMostCommonAdjacentCombinationSplit"),Jv=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),Xv=o(e=>Jv(e).join(" "),"camelToSpaceSeparated"),jR=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"),eS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${fr(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord"),tS=o(e=>e!==void 0,"isString");var ta=o((e,t)=>{let r=De(e)&&Ot(e)&&t;return`use${U(ie(e.operationName))}${r?"Mutation":""}`},"getQueryName"),rS=o(e=>`use${U(ie(e.operationName))}Infinite`,"getInfiniteQueryName");var Le=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Zp={"Content-Type":"application/json",Accept:"application/json"},nS="data",zp="axios",dr="config",xt="AxiosRequestConfig",ra={defaultImport:zp,bindings:[xt],from:"axios"};var iS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),wt=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function M(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(M,"isReferenceObject");function be(e){return!M(e)}o(be,"isSchemaObject");function na(e){return e.type==="array"}o(na,"isArraySchemaObject");function oS(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(qR(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(M(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(oS,"inferRequiredSchema");var qR=o(e=>!M(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"),MR=Symbol.for("@ts-pattern/isVariadic"),oa="@ts-pattern/anonymous-select-key",Kp=o(e=>!!(e&&typeof e=="object"),"r"),ia=o(e=>e&&!!e[Vt],"i"),Tt=o((e,t,r)=>{if(ia(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(Kp(e)){if(!Kp(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];ia(c)&&c[MR]?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||ia(s=i)&&s[Vt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),vr=o(e=>{var t,r,n;return Kp(e)?ia(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?ho(e,vr):ho(Object.values(e),vr):[]},"o"),ho=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>DR(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>LR(e,t),"or"),select:o(t=>t===void 0?sS(e):sS(t,e),"select")})}o(Qe,"u");function DR(e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(vr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>vr(e),"getSelectionKeys"),matcherType:"optional"})})}o(DR,"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(()=>ho(e,vr),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function LR(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return ho(e,vr).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>ho(e,vr),"getSelectionKeys"),matcherType:"or"})})}o(LR,"d");function D(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(D,"p");function sS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Vt]:()=>({match:o(n=>{let i={[t??oa]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??oa].concat(r===void 0?[]:vr(r)),"getSelectionKeys")})})}o(sS,"y");function At(e){return typeof e=="number"}o(At,"v");function mr(e){return typeof e=="string"}o(mr,"b");function hr(e){return typeof e=="bigint"}o(hr,"w");var jL=Qe(D(function(e){return!0}));var gr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>gr(z(e,(r=>D(n=>mr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>gr(z(e,(r=>D(n=>mr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>gr(z(e,(r=>D(n=>mr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return gr(z(e,(r=t,D(n=>mr(n)&&!!n.match(r)))));var r},"regex")}),"j"),qL=gr(D(mr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(z(e,((n,i)=>D(s=>At(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(z(e,(r=>D(n=>At(n)&&n<r))(t))),"lt"),gt:o(t=>It(z(e,(r=>D(n=>At(n)&&n>r))(t))),"gt"),lte:o(t=>It(z(e,(r=>D(n=>At(n)&&n<=r))(t))),"lte"),gte:o(t=>It(z(e,(r=>D(n=>At(n)&&n>=r))(t))),"gte"),int:o(()=>It(z(e,D(t=>At(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(z(e,D(t=>At(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(z(e,D(t=>At(t)&&t>0))),"positive"),negative:o(()=>It(z(e,D(t=>At(t)&&t<0))),"negative")}),"x"),ML=It(D(At)),yr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>yr(z(e,((n,i)=>D(s=>hr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n<r))(t))),"lt"),gt:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n>r))(t))),"gt"),lte:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n<=r))(t))),"lte"),gte:o(t=>yr(z(e,(r=>D(n=>hr(n)&&n>=r))(t))),"gte"),positive:o(()=>yr(z(e,D(t=>hr(t)&&t>0))),"positive"),negative:o(()=>yr(z(e,D(t=>hr(t)&&t<0))),"negative")}),"A"),DL=yr(D(hr)),LL=Qe(D(function(e){return typeof e=="boolean"})),FL=Qe(D(function(e){return typeof e=="symbol"})),VL=Qe(D(function(e){return e==null})),HL=Qe(D(function(e){return e!=null}));var Jp=class Jp 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(Jp,"W");var Qp=Jp,Wp={matched:!1,value:void 0};function he(e){return new Yp(e,Wp)}o(he,"z");var mo=class mo{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)?Wp:{matched:!0,value:r(s?oa in a?a[oa]:a:this.input,this.input)};return new mo(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new mo(this.input,n?{matched:!0,value:r(this.input,this.input)}:Wp)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Qp(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(mo,"I");var Yp=mo;var Xp=2,aS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],cS=["query","header","path"],Zr=["get","put","post","delete","options","head","patch","trace"],uS=["string","number","integer","boolean"],Wn=["allOf","anyOf","oneOf"];var pS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),zr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),Yn=o(e=>zr(e).split("/").at(-1),"getSchemaNameByRef");function tf(e){let t=FR(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ie(t)}o(tf,"normalizeString");function fS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(fS,"wrapWithQuotesIfNeeded");function dS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(dS,"unwrapQuotesIfNeeded");function FR(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(FR,"prefixStringStartingWithNumberIfNeeded");function rf(e){let t=e.replaceAll("_","#");return ie(t.replaceAll("-","_")).replaceAll("#","_")}o(rf,"pathParamToVariableName");var Ht=o(e=>uS.includes(e),"isPrimitiveType");function mS(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(mS,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||aS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function sa(e){return e>=200&&e<300}o(sa,"isMainResponseStatus");function aa(e){return!(e>=200&&e<300)}o(aa,"isErrorStatus");function Jn(e){return e.startsWith("application/")}o(Jn,"isMediaTypeAllowed");var lS=/({\w+})/g,VR=/[^\w\-]+/g;function hS(e){e=U(Qv(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(lS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(lS,"")}By${U(r.slice(1,-1))}`}return e.replace(VR,"_")}o(hS,"pathToVariableName");var ef=/{(\b\w+(?:-\w+)*\b)}/g;function gS(e){let t=e.match(ef);return t===null?e.replaceAll(ef,":$1"):(t.forEach(r=>{let n=rf(r.replaceAll(ef,":$1"));e=e.replaceAll(r,n)}),e)}o(gS,"replaceHyphenatedPath");var yS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&be(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Kr=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Nt(e){return Wv(e)}o(Nt,"formatTag");function Sr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Nt(r??t.defaultTag)}o(Sr,"getOperationTag");function vS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(vS,"isTagExcluded");function _e(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(M(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Wn.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&&_e(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&&_e(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;_e(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;_e(s,t)}}o(_e,"iterateSchema");var Rt=o((e,t)=>Up(U(tf(e)),t),"getZodSchemaName"),go=o((e,t,r)=>Up(U(tf(e)),`${t}${r}`),"getEnumZodSchemaName"),Pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),SS=o(e=>e.startsWith(uo),"isEnumZodSchema"),Qr=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),ca=o(e=>ie(`${e}_${Uv}`),"getBodyZodSchemaName"),bS=o((e,t)=>ie(`${e}_${t}${Gv}`),"getParamZodSchemaName"),HR=o(e=>ie(`${e}${Zv}`),"getMainResponseZodSchemaName"),BR=o((e,t)=>ie(`${e}_${t}_${zv}`),"getErrorResponseZodSchemaName");function ua({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Qr(t,r,n);return!sa(i)&&e!=="default"&&aa(i)?BR(s,e):HR(s)}o(ua,"getResponseZodSchemaName");function yo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(Xv(i))}: \`${e[i]}\``],[])}o(yo,"getSchemaDescriptions");var vo=o((e,t)=>Yv(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),_S=o((e,t)=>Pe(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),br=o((e,t,r)=>{if(!Pe(t))return t===co?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${vo(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function PS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(PS,"getZodSchemaType");function ES(e){if(e.schemaObj)return[e.schemaObj.description,...yo(e.schemaObj).join(". ")].filter(Boolean)}o(ES,"getZodSchemaDescription");function $S(e,t,r){var n;if(M(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?br(e,i,r):void 0}if(na(t)){if(!M(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${br(e,i,r)}[]`:void 0}if(Wn.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return $S(e,i[0],r)}return t.type}o($S,"getType");function OS(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,...yo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:$S(e,c.schema,r)??"unknown",description:p.join(". ")})}return _e(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(M(c)){let u=e.resolveObject(c);_e(u,{data:{pathSegments:[]},onSchema:a})}}),_e(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(OS,"getZodSchemaPropertyDescriptions");function la(e){return he(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(la,"primitiveTypeToTsType");function Xn({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&Pe(e)?(n=br(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Ht(t==null?void 0:t.type)&&(n=la(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:Yr({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(Xn,"getTsTypeBase");function Wr({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of Wn){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return Wr({schema:u,parentTypes:r,resolver:n})});return a.every(({metaType:c})=>c==="object")?{metaType:"object",objectProperties:a.reduce((c,{objectProperties:u})=>{let l=u.map(({name:f})=>f);return[...c.filter(({name:f})=>!l.includes(f)),...u]},[])}:{metaType:"composite",[i]:a}}else e=n.resolveObject(s[0])}return e.type==="array"?{metaType:"array",arrayType:xS({arraySchema:e,resolver:n,parentTypes:r})}:(e.type==="object"||e.properties)&&t?{metaType:"object",objectProperties:[],isCircular:!0}:e.type==="object"||e.properties?{metaType:"object",objectProperties:UR({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(Wr,"getSchemaTsMetaType");function xS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(M(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=Xn({zodSchemaName:n,schema:i,resolver:r}),a=wS(s,t),c=Wr({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(xS,"getArraySchemaTsType");function UR({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(M(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=Xn({zodSchemaName:c,schema:u,resolver:r}),f=wS(l,t),p=Wr({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=xS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Ht(i.type))return{name:n,isRequired:s,type:la(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(UR,"getSchemaTsProperties");function wS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(wS,"getIsCircular");var So=o(e=>fr(ie(e.operationName)),"getEndpointName");function AS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:bo(e,t),options:t})}.`:""}${So(e)}`}o(AS,"getImportedEndpointName");var IS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function bo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Nt(r??t.defaultTag)}o(bo,"getEndpointTag");function _o(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(Pe(i.zodSchema))s=br(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&be(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Ht(f)&&(s=la(f))}return{name:wt(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>!(r!=null&&r.removePageParam)||i.name!==po.pageParamName).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===po.pageParamName?"pageParam":i.name}))}o(_o,"mapEndpointParamsToFunctionParams");function TS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=iS(i.name)?i.name:`"${i.name}"`,a=wt(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Zp["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Zp.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=wt(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(TS,"getEndpointConfig");function _r({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=nf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=nf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>vo(u,e.options),"getEntityName"),options:e.options});return GR(e.options,a,c)}o(_r,"getModelsImports");function NS({tag:e,endpoints:t,options:r}){return nf({type:"endpoints",tag:e,entities:t,getTag:o(n=>bo(n,r),"getTag"),getEntityName:So,options:r})}o(NS,"getEndpointsImports");function RS({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:`${Jr(i)}${Yr({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(RS,"getEntityImports");function Jr(e){let t=Hp;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Vp}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Vp}`,"g"),Hp)),`${t}/`.replace(/\/\//g,"/")}o(Jr,"getImportPath");function nf({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?"./":Jr(s)}${Yr({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(nf,"getImports");function GR(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:Le(n.bindings)}))}o(GR,"mergeImports");function ei({fileName:e,extension:t}){return`${e}.${t}`}o(ei,"getFileNameWithExtension");function CS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${fr(t)}/`:""}${fr(t)}.${i}`:i}o(CS,"getTagFileNameWithoutExtension");function Yr(...e){return CS(...e)}o(Yr,"getTagImportPath");function kS(...e){return`${CS(...e)}.ts`}o(kS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function jS(e){return e.standalone?`${Jr(e)}${Ks.fileName}`:e.restClientImportPath}o(jS,"getAppRestClientImportPath");function qS(e){return e.standalone?`${Jr(e)}${zs.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(qS,"getQueryTypesImportPath");function MS(e){return`${Jr(e)}${Qs.fileName}`}o(MS,"getInvalidateQueriesImportPath");function DS(e){return`${Jr(e)}${Ws.fileName}`}o(DS,"getZodExtendedImportPath");var of=["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 Xr(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Xr,"pick");function ti(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Sr(e,t),i=vS(n,t);return r||i}o(ti,"isOperationExcluded");function sf({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${hS(e)}`,u=r.operationId?wt(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=eS(u,i);of.includes(l)||(u=l)}return of.includes(u)?c:u}o(sf,"getOperationName");function Po({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Sr(r,n):n.defaultTag,s=o(a=>{let c=sf({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>sf({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??sf({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Po,"getUniqueOperationName");function LS(e,t,r){let n=[];for(let i in e.paths){if(Kr(i,r))continue;let s=e.paths[i],a=Xr(s,Zr);for(let c in a){let u=a[c];if(!u||ti(u,r))continue;let l=Po({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(LS,"getUniqueOperationNamesWithoutSplitByTags");function FS(e,t){let r={};for(let n in e.paths){if(Kr(n,t))continue;let i=e.paths[n],s=Xr(i,Zr);for(let a in s){let c=s[a];if(!c||ti(c,t))continue;let u=t.splitByTags?Sr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(FS,"getOperationsByTag");var VS={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 Eo(e){return{type:"invalid-schema",message:e}}o(Eo,"getInvalidSchemaError");function HS(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(HS,"getInvalidOperationIdError");function BS(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(BS,"getMissingPathParameterError");function US(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(US,"getNotAllowedInlineEnumError");function GS(e){return{type:"not-allowed-circular-schema",message:e}}o(GS,"getNotAllowedCircularSchemaError");function ZS(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${uf(t,r)}`}}o(ZS,"getMissingAclConditionPropertyError");function cf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${af(e)} in operation ${uf(t,r)}`}}o(cf,"getMissingStatusCodeError");function zS(e,t,r){return{type:"invalid-status-code",message:`Operation ${uf(t,r)} expected HTTP status code ${af(e.expected)} but received ${af(e.received)}`}}o(zS,"getInvalidStatusCodeError");function uf(e,t){return e.operationId??`${t.method} ${t.path}`}o(uf,"getOperationDescriptor");function af(e){return`${e} (${VS[e]})`}o(af,"getStatusCodeDescription");function Ct({schema:e,meta:t,options:r}){let n=[];he(e.type).with("string",()=>n.push(KR(e))).with("number","integer",()=>n.push(WR(e))).with("array",()=>n.push(YR(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(ZR({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?zR(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(Ct,"getZodChain");function ZR({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(ZR,"getZodChainablePresence");function zR(e){return e.default!==void 0?`default(${he(e.type).with("number","integer",()=>dS(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(zR,"getZodChainableDefault");function KR(e){let t=[];if(e.enum||(e.minLength!==void 0&&t.push(`min(${e.minLength})`),e.maxLength!==void 0&&t.push(`max(${e.maxLength})`)),e.pattern&&t.push(`regex(${QR(e.pattern)})`),e.format){let r=he(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(KR,"getZodChainableStringValidations");function QR(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=mS(e),`/${e}/`}o(QR,"formatPatternIfNeeded");function WR(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(WR,"getZodChainableNumberValidations");function YR(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(YR,"getZodChainableArrayValidations");var en=o(e=>e.reduce((t,r)=>t+r,0),"sum");function oe(e,t){if(!t)return e;if(M(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Fe("oneOf")+oe(e,{...t,type:t.type[0]}):e+Fe("oneOf")+en(t.type.map(r=>oe(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Fe("oneOf")+oe(e,t.oneOf[0]):e+Fe("oneOf")+en(t.oneOf.map(r=>oe(0,r)));if(t.anyOf)return t.anyOf.length===1?Fe("anyOf")+oe(e,t.anyOf[0]):e+Fe("anyOf")+en(t.anyOf.map(r=>oe(0,r)));if(t.allOf)return t.allOf.length===1?Fe("allOf")+oe(e,t.allOf[0]):e+Fe("allOf")+en(t.allOf.map(r=>oe(0,r)));if(!t.type)return e;if(Ht(t.type))return t.enum?e+KS(t)+Fe("enum")+en(t.enum.map(r=>oe(0,r))):e+KS(t);if(t.type==="array")return t.items?Fe("array")+oe(e,t.items):Fe("array")+oe(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Fe("object")+en(r.map(n=>oe(0,n)))}else e+=Fe("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=oe(0,t.additionalProperties):e+=oe(1))}return e}o(oe,"getOpenAPISchemaComplexity");function KS(e){return he(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(KS,"complexityByType");function Fe(e){return he(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Fe,"complexityByComposite");var lf=class lf{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;M(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 oe(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(lf,"ZodSchema");var $o=lf;function W({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new $o(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(M(e))return JR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=eC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=XR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=tC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=rC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=nC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(na(e))return e.items?i.assign(`z.array(${W({...a,schema:e.items}).getCodeString(n,t.options)}${Ct({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(([L,T])=>{var Oe;let $e={...s,isRequired:v?!0:y?(Oe=e.required)==null?void 0:Oe.includes(L):t.options.withImplicitRequiredProps,name:L,isParentPartial:v},se=T;if(M(T)&&t&&(se=t.getSchemaByRef(T.$ref),!se))throw new Error(`Schema ${T.$ref} not found`);let K=W({...a,schema:T,meta:$e}).getCodeString(n,t.options)+Ct({schema:se,meta:$e,options:t.options});return[L,K]}).map(([L,T])=>`${fS(L)}: ${T}`).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)+Ct({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let E=v?".partial()":"",_=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${S})${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 JR({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!M(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(JR,"getReferenceZodSchema");function XR({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!be(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=>be(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
75
75
  z.discriminatedUnion("${c}", [${e.oneOf.map(u=>W({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
76
- `)}return t.assign(`z.union([${e.oneOf.map(c=>W({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(XR,"getOneOfZodSchema");function eC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!be(e)||!Array.isArray(e.type)))return e.type.length===1?W({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>W({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(eC,"getArrayZodSchema");function tC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!be(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=W({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>W({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o(tC,"getAnyOfZodSchema");function rC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!be(e)||!e.allOf)return;if(e.allOf.length===1){let p=W({schema:e.allOf[0],resolver:r,meta:n,tag:i});return t.assign(p.getCodeString(i,r.options))}let{patchRequiredSchemaInLoop:s,noRequiredOnlyAllof:a,composedRequiredSchema:c}=oS(e),u=a.map(p=>{let d=W({schema:p,resolver:r,meta:n,tag:i});return r&&s(p,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(W({schema:c,resolver:r,meta:n,tag:i}));let l=u.at(0),f=u.slice(1).map(p=>`merge(${p.getCodeString(i,r.options)})`).join(".");return t.assign(`${l.getCodeString(i,r.options)}.${f}`)}o(rC,"getAllOfZodSchema");function nC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!be(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Ht(s)){if(e.enum){if(s==="string")return iC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i});if(e.enum.some(a=>typeof a=="string"))return t.assign("z.never()");if(e.enum.length===1){let a=e.enum[0];return t.assign(`z.literal(${a===null?"null":a})`)}return t.assign(`z.union([${e.enum.map(a=>`z.literal(${a===null?"null":a})`).join(", ")}])`)}return t.assign(he(s).with("integer",()=>"z.number()").with("string",()=>he(e.format).with("binary",()=>Ys).otherwise(()=>Js)).otherwise(a=>`z.${a}()`))}}o(nC,"getPrimitiveZodSchema");function iC({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){var l;if(!be(t))return;let s=ri(t);if(!e.options.extractEnums)return r.assign(s);let a=e.getEnumZodSchemaDataByCode(s);if(a)return((l=r.meta.parent)==null?void 0:l.ref)===e.getRefByZodSchemaName(a.zodSchemaName)?r.assign(a.code):new $o({$ref:e.getRefByZodSchemaName(a.zodSchemaName)},e,n).inherit(r).assign(s);let c=e.getExtractedEnumZodSchemaDataByCode(s);if(!c)return r.assign(s);if(!c.zodSchemaName||!c.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let u=e.options.tsNamespaces&&c.tag!==i?`${G({type:"models",tag:c.tag,options:e.options})}.`:"";return r.assign(`${u}${c.zodSchemaName}`)}o(iC,"getEnumZodSchema");function ri(e){var t;return`${uo}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(ri,"getEnumZodSchemaCode");function QS(e){return`${uo}([${e.map(t=>`"${t}"`).join(", ")}])`}o(QS,"getEnumZodSchemaCodeFromEnumNames");function ni({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!Pe(s)||t.ref===void 0)&&r){if(t.complexity<Xp)return s;let u=Rt(r,n.options.schemaSuffix);for(;n.getCodeByZodSchemaName(u);){if((c=n.getZodSchemaNamesByCompositeCode(s))!=null&&c.includes(u))return u;if(n.getCodeByZodSchemaName(u)===u)return u;throw new Error(`Can't uniquely resolve zod schema name: ${u}`)}return n.setZodSchema(u,s,i),n.addZodSchemaForCompositeCode(s,t,u,e),u}let a=n.getCodeByZodSchemaName(s);if(!a&&t.ref&&(a=n.getCodeByZodSchemaName(n.getZodSchemaNameByRef(t.ref))),t.ref&&a)return oe(0,n.getSchemaByRef(t.ref))<Xp?n.getCodeByZodSchemaName(s):s;if(t.ref)return n.getZodSchemaNameByRef(t.ref);throw new Error(`Invalid ref: ${t.ref}`)}o(ni,"resolveZodSchemaName");function WS({resolver:e,endpoint:t,operation:r}){let n=r["x-acl"];return n==null?void 0:n.map(i=>{let s=Object.keys(i.conditions??{}).reduce((a,c)=>{let u=oC({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(ZS(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(WS,"getEndpointAcl");function oC({resolver:e,endpoint:t,acl:r,name:n}){var p,d,m,g,y,v,S,b,E,_;let i=(d=(p=r[0])==null?void 0:p.conditions)==null?void 0:d[n];if(!i)return;let s=i.replace(/^\$[^.]*\./,"").split("."),a,c,u,l=0,f=t.parameters.find(({name:P})=>P===s[l]);if(f)c=(m=f.parameterObject)==null?void 0:m.required,a=(g=f.parameterObject)==null?void 0:g.schema,u=`${f.name} ${fr(f.type)} parameter`,l++;else{let P=t.parameters.find(({bodyObject:$e})=>!!$e),T=Object.keys(((y=P==null?void 0:P.bodyObject)==null?void 0:y.content)??{}).find(We);T&&(a=(b=(S=(v=P==null?void 0:P.bodyObject)==null?void 0:v.content)==null?void 0:S[T])==null?void 0:b.schema,u=`${De(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let P=e.resolveObject(a);a=(E=Object.entries(P.properties??{}).find(([T])=>T===s[l]))==null?void 0:E[1],c=((_=P.required)==null?void 0:_.includes(s[l]))??!1,l++}if(a)return{name:n,type:M(a)?void 0:a.type,zodSchemaName:M(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(oC,"getEndpointAclConditionPropertyType");function YS({resolver:e,operation:t,operationName:r,isUniqueOperationName:n,tag:i}){var m,g;let s=e.resolveObject(t.requestBody);if(!s)return;let c=Object.keys(s.content??{}).find(We);if(!c)return;let u=(g=(m=s.content)==null?void 0:m[c])==null?void 0:g.schema;if(!u)return;let l=W({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),f=e.resolveObject(u),p=ni({schema:f,zodSchema:l,fallbackName:ca(Qr(r,n,i)),resolver:e,tag:i}),d=Ct({schema:f,meta:l.meta,options:e.options});return{endpointParameter:{name:nS,type:"Body",description:s.description,zodSchema:p+d,bodyObject:s},requestFormat:c}}o(YS,"getEndpointBody");function JS({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!cS.includes(s.in))return;let a={};if(s.content){let m=Object.keys(s.content??{}),g=m.find(We);if(!g)throw new Error(`Unsupported media type for param ${s.name}: ${m.join(", ")}`);let y=s.content[g];if(!y)throw new Error(`No content with media type for param ${s.name}: ${g}`);a=(y==null?void 0:y.schema)??y}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=bS(Qr(r,n,i),s.name),u;if(yS(s)){let m=go(c,e.options.enumSuffix,e.options.schemaSuffix),g=QS(s["x-enumNames"]);e.setZodSchema(m,g,i),u=m}let l=W({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),f=e.resolveObject(a),p=Ct({schema:f,meta:l.meta,options:e.options}),d=ni({schema:f,zodSchema:l.assign(l.getCodeString(i)+p),fallbackName:c,resolver:e,tag:i});return{name:he(s.in).with("path",()=>rf(s.name)).otherwise(()=>s.name),type:he(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:d,parameterObject:s,parameterSortingEnumSchemaName:u}}o(JS,"getEndpointParameter");function eb(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){if(Kr(c,e.options))continue;let u=e.openApiDoc.paths[c],l=Xr(u,Zr),f=XS(u.parameters??[]);for(let p in l){let d=l[p];if(!d||ti(d,e.options))continue;let m=d.operationId&&d.operationId!==wt(d.operationId);d.operationId&&m&&e.validationErrors.push(HS(d.operationId));let g=Object.entries({...f,...XS(d.parameters??[])}).map(([,_])=>_),y=Po({path:c,method:p,operation:d,operationsByTag:e.operationsByTag,options:e.options}),v=e.operationNames.filter(_=>_===y).length<=1,S=Sr(d,e.options),b={method:p,path:gS(c),operationName:y,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(Nt),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[],mediaUpload:!!d["x-media-upload"],mediaDownload:!!d["x-media-download"]};if(d.requestBody){let _=YS({resolver:e,operation:d,operationName:y,isUniqueOperationName:v,tag:S});_&&(b.parameters.push(_.endpointParameter),b.requestFormat=_.requestFormat)}for(let _ of g){let P=JS({resolver:e,param:_,operationName:y,isUniqueOperationName:v,tag:S});P&&b.parameters.push(P)}let E=sC(b);E.forEach(_=>{b.parameters.push(_)}),E.length>0&&e.validationErrors.push(BS(E,c));for(let _ in d.responses){b.responseStatusCodes.push(_);let P=e.resolveObject(d.responses[_]),T=Object.keys(P.content??{}).find(Jn),$e,se;if(T?(b.responseFormat=T,$e=(i=(n=P.content)==null?void 0:n[T])==null?void 0:i.schema):(se=co,_==="200"&&e.validationErrors.push(zS({received:"200",expected:"204"},d,b))),$e){let K=W({schema:$e,resolver:e,meta:{isRequired:!0},tag:S}),Oe=e.resolveObject($e);se=ni({schema:Oe,zodSchema:K,fallbackName:K.ref?void 0:ua({statusCode:_,operationName:y,isUniqueOperationName:v,tag:S}),resolver:e,tag:S})+Ct({schema:Oe,meta:K.meta,options:e.options})}if(se){let K=Number(_);sa(K)?(b.response=se,b.responseObject=P,b.responseDescription=P.description):_!=="default"&&aa(K)&&b.errors.push({zodSchema:se,status:K,description:P.description})}}b.response||(b.response=co),b.acl=WS({resolver:e,endpoint:b,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!b.responseStatusCodes.includes("401")&&e.validationErrors.push(cf("401",d,b)),(a=b.acl)!=null&&a[0]&&!b.responseStatusCodes.includes("403")&&e.validationErrors.push(cf("403",d,b)),t.push(b)}}return t}o(eb,"getEndpointsFromOpenAPIDoc");function XS(e){return Object.fromEntries((e??[]).map(t=>[M(t)?t.$ref:t.name,t]))}o(XS,"getParameters");function sC(e){return[...e.path.matchAll(/:([a-zA-Z0-9_]+)/g)].map(r=>r[1]).filter(r=>e.parameters.findIndex(({name:n})=>n===r)===-1).map(r=>aC(r))}o(sC,"getMissingPathParameters");function aC(e){return{name:e,type:"Path",zodSchema:Js,parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(aC,"getPathParameterFromName");function tb(e,t){let r=cC(e,t),n=uC(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o(tb,"getOpenAPISchemaDependencyGraph");function cC(e,t){let r={},n={};return e.forEach(i=>lC({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o(cC,"getRefsDependencyGraph");function uC(e,t){let r={},n={},i=o((s,a)=>{n[a].add(s),t[s]&&a!==s&&t[s].forEach(c=>{let u=`${a}__${c}`;r[u]||(r[u]=!0,i(c,a))})},"visit");return e.forEach(s=>{let a=t[s];a&&(n[s]||(n[s]=new Set),a.forEach(c=>i(c,s)))}),n}o(uC,"getDeepRefsDependencyGraph");function lC({schema:e,fromRef:t,getSchemaByRef:r,visitedRefs:n={},refsDependencyGraph:i={}}){let s=o(a=>{if(a.type!=="reference"||!a.data)return;let{schema:c,data:u}=a;if(i[u.fromRef]||(i[u.fromRef]=new Set),i[u.fromRef].add(c.$ref),n[c.$ref])return!0;n[u.fromRef]=!0,_e(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return _e(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(lC,"getSchemaRefsDependencyGraph");function pa(e,t,r){let n=[];return _e(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):M(s.parentSchema)&&(s.type==="property"?e.validationErrors.push(Eo(`${r} has both reference and properties`)):s.type==="additionalProperties"?e.validationErrors.push(Eo(`${r} has both reference and additionalProperties`)):s.type==="array"?e.validationErrors.push(Eo(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(Eo(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(pa,"getSchemaRefObjs");function rb(e,t){return t.map(i=>zr(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(rb,"getDeepSchemaRefObjs");function nb(e){e.extractedEnumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=Gp(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=go(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!pf(e);)pC(e,t+2),t++;if(pf(e)||e.extractedEnumZodSchemaData.filter(n=>!ib(e,n)).forEach(n=>{n.zodSchemaName=go(n.meta.zodSchemaNameSegments[0].map(i=>ff(U(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!pf(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(nb,"resolveExtractedEnumZodSchemaNames");function pf(e){return e.extractedEnumZodSchemaData.every(t=>ib(e,t))}o(pf,"allExtractedEnumZodSchemaNamesAreUnique");function pC(e,t){e.extractedEnumZodSchemaData.forEach(r=>{let n=e.extractedEnumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&fC(n,t)})}o(pC,"additionalResolveExtractedEnumZodSchemaName");function fC(e,t=2){e.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(i=>i[i.length-t]).filter(Boolean);if(n.length===1){let i=[ff(U(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=Gp(n),s=[i?ff(U(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(fC,"suffixWithPreviousSegmentName");function ib(e,t){return e.extractedEnumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(ib,"isUnique");function ff(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(ff,"sanitizeName");function ob(e){e.extractedEnumZodSchemaData.forEach(t=>{let r=Le(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(ob,"resolveExtractedEnumZodSchemaTags");function Oo({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&sb({schema:e,nameSegments:t,...n}),_e(e,{data:{nameSegments:t},onSchema:o(s=>{var c;if(s.type==="reference")return!0;let a=[...((c=s.data)==null?void 0:c.nameSegments)??[]];s.type==="property"&&a.push(s.propertyName),sb({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(Oo,"updateExtractedEnumZodSchemaData");function sb({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||M(t)||!t.enum)return;let a=ri(t),c=e.extractedEnumZodSchemaData.find(u=>u.code===a);c?(c.meta.zodSchemaNameSegments.push(s),c.meta.tags.push(...i),c.meta.schemaRefs.push(...r?[r]:[]),c.meta.schemas.push(...t?[t]:[])):e.extractedEnumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(US(r?`${Yn(r)}.${s[s.length-1]}`:n??s.join(".")))}o(sb,"handleExtractedEnumZodSchemaDataUpdate");function ab(e){var n;let t={},r={};return Object.entries(((n=e.openApiDoc.components)==null?void 0:n.schemas)??{}).forEach(([i,s])=>{let a=e.getSchemaDataByName(i);if(e.options.excludeRedundantZodSchemas&&(!a||a.deepRefOperations.length===0&&a.tags.length===0))return;let c=Rt(i,e.options.schemaSuffix);if(t[c])return;let u=e.getTagByZodSchemaName(c),l=e.resolveObject(s);l.enum?r[c]=ri(l):t[c]=W({schema:s,resolver:e,tag:u}).getCodeString(u)}),{zodSchemas:t,enumZodSchemas:r}}o(ab,"getZodSchemasFromOpenAPIDoc");function cb(e){var r;let t=[];return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=Rt(n,e.options.schemaSuffix),a=e.resolveObject(i);!t.find(c=>c.zodSchemaName===s)&&a.enum&&t.push({zodSchemaName:s,code:ri(a)})}),t}o(cb,"getEnumZodSchemasFromOpenAPIDoc");var df=class df{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=tb(this.schemaRefs,this.getSchemaByRef.bind(this)),this.enumZodSchemas=cb(this),this.operationsByTag=FS(t,r),this.operationNames=LS(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];dependencyGraph;enumZodSchemas=[];extractedEnumZodSchemaData=[];operationsByTag={};operationNames=[];validationErrors=[];get docSchemas(){var t;return((t=this.openApiDoc.components)==null?void 0:t.schemas)??{}}get schemaRefs(){return Object.keys(this.docSchemas).map(pS)}getSchemaByRef(t){return this.docSchemas[Yn(t)]}getSchemaDataByName(t){return this.schemaData.find(r=>r.name===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(zr(t)))==null?void 0:n.zodSchemaName)??((i=this.extractedEnumZodSchemaData.find(s=>s.zodSchemaName===t))==null?void 0:i.zodSchemaName);if(!r)throw new Error(`Zod schema not found for ref: ${t}`);return r}getRefByZodSchemaName(t){var r;return(r=this.schemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.ref}getTagByZodSchemaName(t){var u,l;if(!this.options.splitByTags)return this.options.defaultTag;let r=this.extractedEnumZodSchemaData.find(f=>f.zodSchemaName===t);if(r)return Nt(r.tag??this.options.defaultTag);let n=this.getRefByZodSchemaName(t),i=n?((u=this.getSchemaDataByRef(n))==null?void 0:u.tags)??[]:[],s=((l=this.zodSchemaData.find(f=>f.zodSchemaName===t))==null?void 0:l.tags)??[],a=Le(i,s),c=a.length===1?a[0]:this.options.defaultTag;return Nt(c??this.options.defaultTag)}getCodeByZodSchemaName(t){var r;return(r=this.zodSchemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.code}getZodSchemaNamesByCompositeCode(t){var r;return(r=this.compositeZodSchemaData.find(n=>n.code===t))==null?void 0:r.zodSchemas.map(n=>n.zodSchemaName)}setZodSchema(t,r,n){let i=this.zodSchemaData.find(s=>s.zodSchemaName===t);i?(i.code=r,i.tags=(i.tags??[]).concat(n)):this.zodSchemaData.push({zodSchemaName:t,code:r,tags:[n]})}addZodSchemaForCompositeCode(t,r,n,i){let s={zodSchemaName:n,zodSchema:r,schema:i},a=this.compositeZodSchemaData.find(c=>c.code===t);a?a.zodSchemas.push(s):this.compositeZodSchemaData.push({code:t,zodSchemas:[s]})}getCompositeZodSchemaByZodSchemaName(t){var n;let r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t));return(n=r==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.zodSchema}getSchemaByCompositeZodSchemaName(t){var r,n;return(n=(r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t)))==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.schema}getEnumZodSchemaDataByCode(t){return this.enumZodSchemas.find(r=>r.code===t)}getExtractedEnumZodSchemaDataByCode(t){return this.extractedEnumZodSchemaData.find(r=>r.code===t)}getExtractedEnumZodSchemaNamesReferencedBySchemaRef(t){return this.extractedEnumZodSchemaData.reduce((r,{zodSchemaName:n,meta:i})=>(n&&i.schemaRefs.includes(t)&&r.push(n),r),[])}getZodSchemas(){return this.zodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>({...t,[r]:n}),{})}getExtractedEnumZodSchemas(){return this.extractedEnumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return M(t)?this.getSchemaByRef(t.$ref):t}isSchemaCircular(t){var r;return(r=this.dependencyGraph.deepDependencyGraph[t])==null?void 0:r.has(t)}getCircularSchemaChain(t,r=t,n=[],i=[]){var s,a;return i.includes(r)?[]:(i.push(r),(s=this.dependencyGraph.refsDependencyGraph[r])!=null&&s.has(t)?[...n,r,t]:Array.from(((a=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:a.values())??[]).map(c=>{let u=this.getCircularSchemaChain(t,c,n,i);return u.length>0?[r,...u]:u}).flat())}getBaseUrl(){var r,n;let t=(n=(r=this.openApiDoc.servers)==null?void 0:r[0])==null?void 0:n.url;return this.options.baseUrl===""&&t?t:this.options.baseUrl}getZodSchemaObj(t){let r=this.getRefByZodSchemaName(t);if(r)return this.getSchemaByRef(r);let n=this.getSchemaByCompositeZodSchemaName(t);if(n)return n;let i=this.getExtractedEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getExtractedEnumZodSchemaDataByName(t){return this.extractedEnumZodSchemaData.find(({zodSchemaName:r})=>r===t)}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=zr(a),u=Yn(c),l=Rt(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[],deepRefOperations:[]})});for(let a in this.openApiDoc.paths){if(Kr(a,this.options))continue;let c=this.openApiDoc.paths[a],u=Xr(c,Zr);for(let l in u){let f=u[l];if(!f||ti(f,this.options))continue;let p=Sr(f,this.options),d=Po({path:a,method:l,operation:f,operationsByTag:this.operationsByTag,options:this.options}),m=this.operationNames.filter(S=>S===d).length<=1,g=ie(Qr(d,m,p)),y=[];if((t=f.parameters)==null||t.map(S=>{let b=S,E=b.schema,_=`Operation ${f.operationId??a} parameter ${b.name}`;y.push(...pa(this,E,_)),this.options.extractEnums&&Oo({resolver:this,schema:E,schemaInfo:_,tags:[p],nameSegments:[g,b.name],includeSelf:!0})}),f.requestBody){let S=this.resolveObject(f.requestBody),E=Object.keys(S.content??{}).find(We);if(E){let _=(n=(r=S.content)==null?void 0:r[E])==null?void 0:n.schema,P=`Operation ${f.operationId} request body`;y.push(...pa(this,_,P)),this.options.extractEnums&&Oo({resolver:this,schema:_,schemaInfo:P,tags:[p],nameSegments:[ca(g)]})}}for(let S in f.responses){let b=this.resolveObject(f.responses[S]),_=Object.keys(b.content??{}).find(Jn);if(_){let P=(s=(i=b.content)==null?void 0:i[_])==null?void 0:s.schema,L=`Operation ${f.operationId} response body`;y.push(...pa(this,P,L)),this.options.extractEnums&&Oo({resolver:this,schema:P,schemaInfo:L,tags:[p],nameSegments:[ua({statusCode:S,operationName:d,isUniqueOperationName:m,tag:p})]})}}rb(this,y).forEach(S=>{let b=this.getSchemaDataByRef(S);b&&(b.tags.push(p),b.deepRefOperations.push(f))})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=zr(a);Oo({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[Yn(c)]})}),ob(this),this.handleDuplicateEnumZodSchemas(),nb(this))}handleDuplicateEnumZodSchemas(){let t=this.enumZodSchemas.map(({code:n})=>n),r=this.enumZodSchemas.filter(({code:n})=>t.includes(n));this.schemaData.forEach(n=>{var a,c;let i=(a=r.find(({zodSchemaName:u})=>u===n.zodSchemaName))==null?void 0:a.code;if(!i)return;let s=this.extractedEnumZodSchemaData.find(({code:u})=>u===i);!s||((c=this.getEnumZodSchemaDataByCode(s.code))==null?void 0:c.zodSchemaName)!==n.zodSchemaName||(n.tags.push(...s.meta.tags??[]),s.meta.schemaRefs.forEach(u=>{this.dependencyGraph.refsDependencyGraph[u]||(this.dependencyGraph.refsDependencyGraph[u]=new Set),this.dependencyGraph.refsDependencyGraph[u].add(n.ref),this.dependencyGraph.deepDependencyGraph[u]||(this.dependencyGraph.deepDependencyGraph[u]=new Set),this.dependencyGraph.deepDependencyGraph[u].add(n.ref)}))}),this.extractedEnumZodSchemaData.splice(0,this.extractedEnumZodSchemaData.length,...this.extractedEnumZodSchemaData.filter(({code:n})=>!t.includes(n)))}};o(df,"SchemaResolver");var fa=df;function ub(e){let t=[],r={};function n(i,s){Array.isArray(s)||(s=[]),s.push(i),r[i]=!0,e[i]&&e[i].forEach(a=>{s.includes(a)||r[a]||n(a,s.slice(0))}),t.includes(i)||t.push(i)}return o(n,"visit"),Object.keys(e).forEach(i=>n(i,[])),t}o(ub,"topologicalSort");function lb(e,t){let r=Object.entries(e),n=r.filter(([i])=>t.includes(i)).sort(([i],[s])=>t.indexOf(i)-t.indexOf(s)).concat(r.filter(([i])=>!t.includes(i)));return Object.fromEntries(n)}o(lb,"sortObjKeysFromArray");function pb(e,t){let r=ub(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return lb(t,r)}o(pb,"sortZodSchemasByTopology");function fb(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(GS(e.getCircularSchemaChain(s).join(" -> "))),r[Rt(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[Rt(n,e.options.schemaSuffix)]=i}),r}o(fb,"wrapCircularZodSchemas");function da(e,t){let r=new fa(e,t),n=eb(r),i=ab(r),s={...i.zodSchemas,...r.getZodSchemas(),...i.enumZodSchemas};return s=fb(r,s),s=pb(r,s),s={...r.getExtractedEnumZodSchemas(),...s},{resolver:r,data:dC({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(da,"getDataFromOpenAPIDoc");function dC({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=bo(s,n);db(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(db(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(dC,"splitDataByTags");function db(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(db,"getTagElement");async function mb(e,t){let{resolver:r,data:n}=await da(e,t),i=[],s=[];return n.forEach(({endpoints:c,zodSchemas:u},l)=>{Object.keys(u).forEach(f=>{let p=r.getRefByZodSchemaName(f),d=p?r.getSchemaByRef(p):r.getSchemaByCompositeZodSchemaName(f),m=Xn({zodSchemaName:f,schema:d,resolver:r}),g;d&&(g=Wr({schema:d,parentTypes:[m],resolver:r})),i.push({...m,metaType:"primitive",...g})}),c.forEach(f=>{let p="queries",d=Nt(l);s.push({name:ta(f),importPath:Yr({type:p,tag:d,includeTagDir:!0,options:t}),namespace:t.tsNamespaces?G({type:p,tag:d,options:t}):void 0,isQuery:De(f),isMutation:Ot(f),params:mC({resolver:r,endpoint:f}),response:hC({resolver:r,endpoint:f})})})}),{openApiDoc:e,models:i,queries:s}}o(mb,"getMetadataFromOpenAPIDoc");function mC({resolver:e,endpoint:t}){return t.parameters.map(r=>{var a,c,u,l;let n;if((a=r.parameterObject)!=null&&a.schema)n=e.resolveObject(r.parameterObject.schema);else if(r.bodyObject){let p=Object.keys(r.bodyObject.content??{}).find(We);p&&(n=e.resolveObject((u=(c=r.bodyObject.content)==null?void 0:c[p])==null?void 0:u.schema))}let i=Xn({zodSchemaName:r.zodSchema,schema:n,resolver:e}),s;return n&&(s=Wr({schema:n,parentTypes:[i],resolver:e})),{name:wt(r.name),isRequired:((l=r.parameterObject)==null?void 0:l.required)??!0,...i,...s,paramType:r.type}}).sort((r,n)=>{if(r.isRequired===n.isRequired){let i=["Path","Body","Query","Header"];return i.indexOf(r.paramType)-i.indexOf(n.paramType)}return r.isRequired?-1:1}).map(({paramType:r,...n})=>n)}o(mC,"getQueryMetadataParams");function hC({resolver:e,endpoint:t}){var a,c,u,l;let r,n=Object.keys(((a=t.responseObject)==null?void 0:a.content)??{}).find(Jn);n&&(r=e.resolveObject((l=(u=(c=t.responseObject)==null?void 0:c.content)==null?void 0:u[n])==null?void 0:l.schema));let i=Xn({zodSchemaName:t.response,schema:r,resolver:e}),s;return r&&(s=Wr({schema:r,parentTypes:[i],resolver:e})),{...i,metaType:"primitive",...s}}o(hC,"getQueryMetadataResponse");var hb={fileName:"acl/app.ability",extension:"ts"},xo="AllAbilities",ft={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"subject"},mf={bindings:[ft.abilityTuple,ft.pureAbility,ft.forcedSubject,ft.subject],from:"@casl/ability"};var gb=o(e=>`Use${U(ie(e.operationName))}Ability`,"getAbilityTypeName"),yb=o(e=>`canUse${U(ie(e.operationName))}`,"getAbilityFunctionName"),vb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),Sb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),bb=o(e=>{var t;return!!((t=hf(e))!=null&&t.length)},"hasAbilityConditions"),hf=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),_b=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ma=o(e=>`${U(e)}${xo}`,"getTagAllAbilitiesName");var ld=et(zt());var ad=et(require("fs")),fP=et(require("path"));function dP(e){return ad.default.readFileSync(fP.default.join(__dirname,`../${e}`),"utf-8")}o(dP,"readFileSync");function cd(e){let t=`src/generators/templates/${e}.hbs`;return dP(t)}o(cd,"readHbsTemplateSync");function ud(e){let t=`src/assets/${e}`;return dP(t)}o(ud,"readAssetSync");function cn({output:e,fileName:t}){return`${e}/${t}`}o(cn,"getOutputFileName");var Kt=et(zt());function mP(){a3(),c3(),u3(),l3(),p3(),f3(),d3(),m3()}o(mP,"registerAclHbsHelpers");function a3(){Kt.default.registerHelper("abilityTypeName",gb)}o(a3,"registerAbilityTypeNameHelper");function c3(){Kt.default.registerHelper("abilityFunctionName",yb)}o(c3,"registerAbilityFunctionNameHelper");function u3(){Kt.default.registerHelper("ablityAction",vb)}o(u3,"registerAbilityActionHelper");function l3(){Kt.default.registerHelper("ablitySubject",Sb)}o(l3,"registerAbilitySubjectHelper");function p3(){Kt.default.registerHelper("hasAbilityConditions",bb)}o(p3,"registerHasAbilityConditionsHelper");function f3(){Kt.default.registerHelper("abilityConditionsTypes",hf)}o(f3,"registerAbilityConditionsTypesHelper");function d3(){Kt.default.registerHelper("abilityDescription",_b)}o(d3,"registerAbilityDescriptionHelper");function m3(){Kt.default.registerHelper("tagAllAbilitiesName",ma)}o(m3,"registerTagAllAbilitiesNameHelper");var Fo=et(zt());function hP(){h3(),g3(),y3(),v3()}o(hP,"registerCommonHbsHelpers");function h3(){Fo.default.registerHelper("isEqual",(e,t)=>e===t)}o(h3,"registerIsEqualHelper");function g3(){Fo.default.registerHelper("commaSeparated",e=>e.join(", "))}o(g3,"registerCommaSeparatedListHelper");function y3(){Fo.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
77
- *`))}o(y3,"registerAddAsteriskAfterNewLineHelper");function v3(){Fo.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(v3,"registerJsonStringifyHelper");var $r=et(zt());function gP(e){S3(),b3(e.options),E3(e),_3(),P3(),$3(e),O3()}o(gP,"registerEndpointsHbsHelpers");function S3(){$r.default.registerHelper("endpointName",So)}o(S3,"registerEndpointNameHelper");function b3(e){$r.default.registerHelper("importedEndpointName",t=>AS(t,e))}o(b3,"registerImportedEndpointNameHelper");function _3(){$r.default.registerHelper("endpointPath",IS)}o(_3,"registerEndpointPathHelper");function P3(){$r.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(P3,"registerEndpointBodyHelper");function E3(e){$r.default.registerHelper("endpointParams",(t,r)=>_o(e,t,r.hash))}o(E3,"registerEndpointParamsHelper");function $3(e){$r.default.registerHelper("endpointArgs",(t,r)=>_o(e,t,r.hash).map(n=>n.name).join(", "))}o($3,"registerEndpointArgsHelper");function O3(){$r.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&be(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let p=Object.keys(e.bodyObject.content??{}).find(We);p&&(i=e.bodyObject.content[p],i.schema&&be(i.schema)&&(n=i.schema))}if(n){let f=yo(n);t.push(...f)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(O3,"registerEndpointParamDescriptionHelper");var Ne=et(zt());function yP(e){x3(),w3(),A3(),I3(e),T3(),N3(e),R3(e),C3(e),k3(e),j3(e),q3(),M3(),D3()}o(yP,"registerPartialsHbsHelpers");function x3(){Ne.default.registerHelper("genModelJsDocs",(e,t,r)=>Re("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(x3,"registerGenerateModelJsDocsHelper");function w3(){Ne.default.registerHelper("genImport",e=>Re("import")({import:e}))}o(w3,"registerImportHelper");function A3(){Ne.default.registerHelper("genEndpointParams",(e,t)=>Re("endpoint-params")({endpoint:e,options:t}))}o(A3,"registerGenerateEndpointParamsHelper");function I3(e){Ne.default.registerHelper("genEndpointConfig",t=>{let r=TS(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?dr:"":Re("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===Ys,hasFileDownload:t.mediaDownload,axiosRequestConfigName:dr})})}o(I3,"registerGenerateEndpointConfigHelper");function T3(){Ne.default.registerHelper("genEndpointParamSorting",(e,t)=>Re("endpoint-param-sorting")({enumSchemaName:e,paramName:t,zodExtended:ao.name,sortingString:ao.properties.sortingString}))}o(T3,"registerGenerateEndpointParamSortingHelper");function N3(e){Ne.default.registerHelper("genQueryKeys",t=>t.length===0?"":Re("query-keys")({queryEndpoints:t,queriesModuleName:fo,generateInfiniteQueries:e.options.infiniteQueries}))}o(N3,"registerGenerateQueryKeysHelper");function R3(e){Ne.default.registerHelper("genQuery",t=>{if(!De(t))return;let r=e.options.axiosRequestConfig;return Re("query-use-query")({endpoint:t,queryHook:Me.query,hasQueryFn:_o(e,t).length>0||r,hasAxiosRequestConfig:r,axiosRequestConfigName:dr,axiosRequestConfigType:xt})})}o(R3,"registerGenerateQueryHelper");function C3(e){Ne.default.registerHelper("genMutation",t=>{if(Ot(t))return Re("query-use-mutation")({endpoint:t,queryHook:Me.mutation,queriesModuleName:fo,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:dr,axiosRequestConfigType:xt,hasInvalidateQueryOptions:e.options.invalidateQueryOptions,invalidateQueryOptionsType:pr.optionsType})})}o(C3,"registerGenerateMutationHelper");function k3(e){Ne.default.registerHelper("genInfiniteQuery",t=>{if(!(!e.options.infiniteQueries||!Qn(t)))return Re("query-use-infinite-query")({endpoint:t,infiniteQueryHook:Me.infiniteQuery,pageParamName:ea.pageParamName,totalItemsName:ea.totalItemsName,limitParamName:ea.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:dr,axiosRequestConfigType:xt})})}o(k3,"registerGenerateInfiniteQueryHelper");function j3(e){Ne.default.registerHelper("genQueryJsDocs",(t,r)=>Re("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasInvalidateQueryOptions:e.options.invalidateQueryOptions,invalidateQueryOptionsType:pr.optionsType}))}o(j3,"registerGenerateQueryJsDocsHelper");function q3(){Ne.default.registerHelper("genCaslAbilityType",e=>Re("casl-ability-type")({endpoint:e,abilityTupleType:ft.abilityTuple}))}o(q3,"registerGenerateCaslAbilityTypeHelper");function M3(){Ne.default.registerHelper("genCaslAbilityFunction",e=>Re("casl-ability-function")({endpoint:e}))}o(M3,"registerGenerateCaslAbilityFunctionHelper");function D3(){Ne.default.registerHelper("genCaslAbilityQuery",e=>Re("casl-ability-query")({endpoint:e}))}o(D3,"registerGenerateCaslAbilityQueryHelper");var di=et(zt());function vP(){L3(),V3(),H3(),F3(),B3()}o(vP,"registerQueryHbsHelpers");function L3(){di.default.registerHelper("queryName",(e,t)=>ta(e,t.hash.mutation))}o(L3,"registerQueryNameHelper");function F3(){di.default.registerHelper("infiniteQueryName",rS)}o(F3,"registerInfiniteQueryNameHelper");function V3(){di.default.registerHelper("isQuery",De)}o(V3,"registerIsQueryHelper");function H3(){di.default.registerHelper("isMutation",Ot)}o(H3,"registerIsMutationHelper");function B3(){di.default.registerHelper("isInfiniteQuery",e=>Qn(e))}o(B3,"registerIsInfiniteQueryHelper");var un=et(zt());function SP(e){U3(e.options),G3(e),Z3(e),z3(),K3(),Q3(e)}o(SP,"registerZodHbsHelpers");function U3(e){un.default.registerHelper("zodInferedType",t=>vo(t,e))}o(U3,"registerInferedTypeHelper");function G3(e){un.default.registerHelper("importedZodSchemaName",t=>_S(e,t))}o(G3,"registerImportedZodSchemaNameHelper");function Z3(e){un.default.registerHelper("importedZodSchemaInferedType",t=>br(e,t))}o(Z3,"registerImportedZodSchemaInferedTypeHelper");function z3(){un.default.registerHelper("zodSchemaType",e=>PS(e))}o(z3,"registerZodSchemaTypeHelper");function K3(){un.default.registerHelper("zodSchemaDescription",e=>ES(e))}o(K3,"registerZodSchemaDescriptionHelper");function Q3(e){un.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>OS(e,t,r))}o(Q3,"registerZodSchemaPropertyDescriptionsHelper");var bP=et(zt());function _P(){W3()}o(_P,"registerImportsHbsHelpers");function W3(){bP.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(W3,"registerBindingsHelper");function Be(e,t){let r=cd(t);return hP(),_P(),SP(e),gP(e),vP(),mP(),yP(e),ld.default.compile(r)}o(Be,"getHbsTemplateDelegate");function Re(e){let t=cd(`partials/${e}`);return ld.default.compile(t)}o(Re,"getHbsPartialTemplateDelegate");function PP({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:f})=>f&&f.length>0);if(!n||n.length===0)return;let i=n.some(({acl:f})=>(f==null?void 0:f[0].conditions)&&Object.keys(f[0].conditions).length>0),s={bindings:[ft.abilityTuple,...i?[ft.forcedSubject,ft.subject]:[]],from:mf.from},a=n.reduce((f,p)=>{var m,g;let d=(g=(m=p.acl)==null?void 0:m[0].conditionsTypes)==null?void 0:g.reduce((y,v)=>[...y,...v!=null&&v.zodSchemaName?[v.zodSchemaName]:[]],[]);return[...f,...d??[]]},[]),c=_r({resolver:e,tag:r,zodSchemasAsTypes:Le(a)});return Be(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:G({type:"acl",tag:r,options:e.options}),endpoints:n})}o(PP,"generateAcl");function EP(e,t){if(!t||t.length===0)return;let r={bindings:[ft.pureAbility],from:mf.from},n=RS({tags:t,entityName:xo,getAliasEntityName:ma,type:"acl",options:e.options}),i=t.map(a=>G({type:"acl",tag:a,options:e.options}));return Be(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:xo,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i})}o(EP,"generateAppAcl");function $P(e){return Be(e,"app-rest-client")({appRestClientName:so,baseUrl:e.getBaseUrl()})}o($P,"generateAppRestClient");function OP({resolver:e,data:t,tag:r=""}){var y;let n=(y=t.get(r))==null?void 0:y.endpoints;if(!n||n.length===0)return;let i={bindings:[so],from:jS(e.options)},s=n.some(v=>v.parameters.some(S=>S.parameterSortingEnumSchemaName)),a={bindings:[ao.name],from:DS(e.options)},c=e.options.axiosRequestConfig,u=c,l={bindings:c?[xt]:[],from:ra.from},f=n.map(v=>v.response),p=f.some(v=>!Pe(v)),d=n.reduce((v,S)=>[...v,...S.parameters],[]),m=_r({resolver:e,tag:r,zodSchemas:Le([...f.filter(Pe),...d.map(v=>v.parameterSortingEnumSchemaName).filter(tS)]),zodSchemasAsTypes:Le(d.map(v=>v.zodSchema).filter(Pe))});return Be(e,"endpoints")({appRestClientImport:i,hasAxiosImport:u,axiosImport:l,hasZodImport:p,zodImport:Xs,hasZodExtendedImport:s,zodExtendedImport:a,modelsImports:m,includeNamespace:e.options.tsNamespaces,namespace:G({type:"endpoints",tag:r,options:e.options}),restClientName:so,hasAxiosRequestConfig:c,axiosRequestConfigName:dr,axiosRequestConfigType:xt,endpoints:n})}o(OP,"generateEndpoints");function xP({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:G({type:"queries",tag:s,options:e.options})})}),Be(e,"invalidate-queries")({modules:r})}o(xP,"generateInvalidateQueries");function wP(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(AP(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(wP,"getZodSchemaRefs");function AP(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&AP(n).forEach(s=>r.add(s)),r},new Set)}o(AP,"getSchemaRefs");function IP({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,f)=>[...l,...wP(e,f)],[]).filter(l=>!n[l]),s=_r({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[f,p])=>{let d=e.getRefByZodSchemaName(f);return{...l,[f]:{code:p,isCircular:!!d&&e.isSchemaCircular(d),isEnum:SS(p),schemaObj:e.getZodSchemaObj(f)}}},{});return Be(e,"models")({zodImport:Xs,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:G({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(IP,"generateModels");function TP({resolver:e,data:t,tag:r=""}){var b;let n=(b=t.get(r))==null?void 0:b.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:E})=>E),a=i||s,c={defaultImport:s?zp:void 0,bindings:i?[xt]:[],from:ra.from},u=n.filter(De),l=u.filter(E=>Qn(E)),f=n.filter(Ot),p={bindings:[...u.length>0?[Me.query]:[],...e.options.infiniteQueries&&l.length>0?[Me.infiniteQuery]:[],...f.length>0?[Me.mutation,Me.queryClient]:[]],from:Kv.from},d={bindings:[pr.queryModuleEnum,...f.length>0?[pr.optionsType,pr.functionName]:[]],from:MS(e.options)},m={bindings:[...u.length>0?[Zs.query]:[],...e.options.infiniteQueries&&l.length>0?[Zs.infiniteQuery]:[],...f.length>0?[Zs.mutation]:[]],from:qS(e.options)},g=n.reduce((E,_)=>[...E,..._.parameters],[]),y=_r({resolver:e,tag:r,zodSchemasAsTypes:Le(g.map(E=>E.zodSchema).filter(Pe))}),v=NS({tag:r,endpoints:n,options:e.options});return Be(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:p,hasInvalidateQueryOptions:e.options.invalidateQueryOptions,invalidateQueriesImport:d,queryTypesImport:m,modelsImports:y,endpointsImports:v,includeNamespace:e.options.tsNamespaces,tag:r,namespace:G({type:"queries",tag:r,options:e.options}),queriesModuleName:fo,queryModuleEnum:pr.queryModuleEnum,endpoints:n,queryEndpoints:u})}o(TP,"generateQueries");function NP(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...lo,...t,importPath:r},{resolver:i,data:s}=da(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:IP,endpoints:OP,queries:TP,acl:PP};s.forEach((p,d)=>{u.forEach(m=>{let g=l[m]({resolver:i,data:s,tag:d});if(g){let y=cn({output:n.output,fileName:kS({tag:d,type:m,options:n})});a.push({fileName:y,content:g}),m==="acl"&&c.push(d)}})});let f=EP(i,c);if(f){let p=cn({output:n.output,fileName:ei(hb)});a.push({fileName:p,content:f})}if(n.invalidateQueryOptions&&a.push({fileName:cn({output:i.options.output,fileName:ei(Qs)}),content:xP({resolver:i,data:s})}),n.standalone&&a.push(...Y3(i)),J3(s)){let p=ei(Ws);a.push({content:ud(p),fileName:cn({output:i.options.output,fileName:p})})}return a}o(NP,"generateCodeFromOpenAPIDoc");function Y3(e){let t=[];return Object.values(zs).forEach(r=>{let n=ei(r);t.push({content:ud(n),fileName:cn({output:e.options.output,fileName:n})})}),t.push({fileName:cn({output:e.options.output,fileName:ei(Ks)}),content:$P(e)}),t}o(Y3,"getStandaloneFiles");function J3(e){return Array.from(e.values()).some(({endpoints:t})=>t.some(r=>r.parameters.some(n=>n.parameterSortingEnumSchemaName)))}o(J3,"hasZodExtendedFile");async function X3({input:e,options:t}){let r={...lo,...t},n=await pd.default.bundle(e);return await mb(n,r)}o(X3,"getGenerateMetadata");async function eq({input:e,options:t}){let r={...lo,...t},n=await pd.default.bundle(e);return NP(n,r)}o(eq,"getGenerateFilesData");0&&(module.exports={getGenerateFilesData,getGenerateMetadata});
76
+ `)}return t.assign(`z.union([${e.oneOf.map(c=>W({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(XR,"getOneOfZodSchema");function eC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!be(e)||!Array.isArray(e.type)))return e.type.length===1?W({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>W({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(eC,"getArrayZodSchema");function tC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!be(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=W({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>W({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o(tC,"getAnyOfZodSchema");function rC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!be(e)||!e.allOf)return;if(e.allOf.length===1){let p=W({schema:e.allOf[0],resolver:r,meta:n,tag:i});return t.assign(p.getCodeString(i,r.options))}let{patchRequiredSchemaInLoop:s,noRequiredOnlyAllof:a,composedRequiredSchema:c}=oS(e),u=a.map(p=>{let d=W({schema:p,resolver:r,meta:n,tag:i});return r&&s(p,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(W({schema:c,resolver:r,meta:n,tag:i}));let l=u.at(0),f=u.slice(1).map(p=>`merge(${p.getCodeString(i,r.options)})`).join(".");return t.assign(`${l.getCodeString(i,r.options)}.${f}`)}o(rC,"getAllOfZodSchema");function nC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!be(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Ht(s)){if(e.enum){if(s==="string")return iC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i});if(e.enum.some(a=>typeof a=="string"))return t.assign("z.never()");if(e.enum.length===1){let a=e.enum[0];return t.assign(`z.literal(${a===null?"null":a})`)}return t.assign(`z.union([${e.enum.map(a=>`z.literal(${a===null?"null":a})`).join(", ")}])`)}return t.assign(he(s).with("integer",()=>"z.number()").with("string",()=>he(e.format).with("binary",()=>Ys).otherwise(()=>Js)).otherwise(a=>`z.${a}()`))}}o(nC,"getPrimitiveZodSchema");function iC({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){var l;if(!be(t))return;let s=ri(t);if(!e.options.extractEnums)return r.assign(s);let a=e.getEnumZodSchemaDataByCode(s);if(a)return((l=r.meta.parent)==null?void 0:l.ref)===e.getRefByZodSchemaName(a.zodSchemaName)?r.assign(a.code):new $o({$ref:e.getRefByZodSchemaName(a.zodSchemaName)},e,n).inherit(r).assign(s);let c=e.getExtractedEnumZodSchemaDataByCode(s);if(!c)return r.assign(s);if(!c.zodSchemaName||!c.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let u=e.options.tsNamespaces&&c.tag!==i?`${G({type:"models",tag:c.tag,options:e.options})}.`:"";return r.assign(`${u}${c.zodSchemaName}`)}o(iC,"getEnumZodSchema");function ri(e){var t;return`${uo}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(ri,"getEnumZodSchemaCode");function QS(e){return`${uo}([${e.map(t=>`"${t}"`).join(", ")}])`}o(QS,"getEnumZodSchemaCodeFromEnumNames");function ni({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!Pe(s)||t.ref===void 0)&&r){if(t.complexity<Xp)return s;let u=Rt(r,n.options.schemaSuffix);for(;n.getCodeByZodSchemaName(u);){if((c=n.getZodSchemaNamesByCompositeCode(s))!=null&&c.includes(u))return u;if(n.getCodeByZodSchemaName(u)===u)return u;throw new Error(`Can't uniquely resolve zod schema name: ${u}`)}return n.setZodSchema(u,s,i),n.addZodSchemaForCompositeCode(s,t,u,e),u}let a=n.getCodeByZodSchemaName(s);if(!a&&t.ref&&(a=n.getCodeByZodSchemaName(n.getZodSchemaNameByRef(t.ref))),t.ref&&a)return oe(0,n.getSchemaByRef(t.ref))<Xp?n.getCodeByZodSchemaName(s):s;if(t.ref)return n.getZodSchemaNameByRef(t.ref);throw new Error(`Invalid ref: ${t.ref}`)}o(ni,"resolveZodSchemaName");function WS({resolver:e,endpoint:t,operation:r}){let n=r["x-acl"];return n==null?void 0:n.map(i=>{let s=Object.keys(i.conditions??{}).reduce((a,c)=>{let u=oC({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(ZS(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(WS,"getEndpointAcl");function oC({resolver:e,endpoint:t,acl:r,name:n}){var p,d,m,g,y,v,S,b,E,_;let i=(d=(p=r[0])==null?void 0:p.conditions)==null?void 0:d[n];if(!i)return;let s=i.replace(/^\$[^.]*\./,"").split("."),a,c,u,l=0,f=t.parameters.find(({name:P})=>P===s[l]);if(f)c=(m=f.parameterObject)==null?void 0:m.required,a=(g=f.parameterObject)==null?void 0:g.schema,u=`${f.name} ${fr(f.type)} parameter`,l++;else{let P=t.parameters.find(({bodyObject:$e})=>!!$e),T=Object.keys(((y=P==null?void 0:P.bodyObject)==null?void 0:y.content)??{}).find(We);T&&(a=(b=(S=(v=P==null?void 0:P.bodyObject)==null?void 0:v.content)==null?void 0:S[T])==null?void 0:b.schema,u=`${De(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let P=e.resolveObject(a);a=(E=Object.entries(P.properties??{}).find(([T])=>T===s[l]))==null?void 0:E[1],c=((_=P.required)==null?void 0:_.includes(s[l]))??!1,l++}if(a)return{name:n,type:M(a)?void 0:a.type,zodSchemaName:M(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(oC,"getEndpointAclConditionPropertyType");function YS({resolver:e,operation:t,operationName:r,isUniqueOperationName:n,tag:i}){var m,g;let s=e.resolveObject(t.requestBody);if(!s)return;let c=Object.keys(s.content??{}).find(We);if(!c)return;let u=(g=(m=s.content)==null?void 0:m[c])==null?void 0:g.schema;if(!u)return;let l=W({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),f=e.resolveObject(u),p=ni({schema:f,zodSchema:l,fallbackName:ca(Qr(r,n,i)),resolver:e,tag:i}),d=Ct({schema:f,meta:l.meta,options:e.options});return{endpointParameter:{name:nS,type:"Body",description:s.description,zodSchema:p+d,bodyObject:s},requestFormat:c}}o(YS,"getEndpointBody");function JS({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!cS.includes(s.in))return;let a={};if(s.content){let m=Object.keys(s.content??{}),g=m.find(We);if(!g)throw new Error(`Unsupported media type for param ${s.name}: ${m.join(", ")}`);let y=s.content[g];if(!y)throw new Error(`No content with media type for param ${s.name}: ${g}`);a=(y==null?void 0:y.schema)??y}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=bS(Qr(r,n,i),s.name),u;if(yS(s)){let m=go(c,e.options.enumSuffix,e.options.schemaSuffix),g=QS(s["x-enumNames"]);e.setZodSchema(m,g,i),u=m}let l=W({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),f=e.resolveObject(a),p=Ct({schema:f,meta:l.meta,options:e.options}),d=ni({schema:f,zodSchema:l.assign(l.getCodeString(i)+p),fallbackName:c,resolver:e,tag:i});return{name:he(s.in).with("path",()=>rf(s.name)).otherwise(()=>s.name),type:he(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:d,parameterObject:s,parameterSortingEnumSchemaName:u}}o(JS,"getEndpointParameter");function eb(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){if(Kr(c,e.options))continue;let u=e.openApiDoc.paths[c],l=Xr(u,Zr),f=XS(u.parameters??[]);for(let p in l){let d=l[p];if(!d||ti(d,e.options))continue;let m=d.operationId&&d.operationId!==wt(d.operationId);d.operationId&&m&&e.validationErrors.push(HS(d.operationId));let g=Object.entries({...f,...XS(d.parameters??[])}).map(([,_])=>_),y=Po({path:c,method:p,operation:d,operationsByTag:e.operationsByTag,options:e.options}),v=e.operationNames.filter(_=>_===y).length<=1,S=Sr(d,e.options),b={method:p,path:gS(c),operationName:y,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(Nt),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[],mediaUpload:!!d["x-media-upload"],mediaDownload:!!d["x-media-download"]};if(d.requestBody){let _=YS({resolver:e,operation:d,operationName:y,isUniqueOperationName:v,tag:S});_&&(b.parameters.push(_.endpointParameter),b.requestFormat=_.requestFormat)}for(let _ of g){let P=JS({resolver:e,param:_,operationName:y,isUniqueOperationName:v,tag:S});P&&b.parameters.push(P)}let E=sC(b);E.forEach(_=>{b.parameters.push(_)}),E.length>0&&e.validationErrors.push(BS(E,c));for(let _ in d.responses){b.responseStatusCodes.push(_);let P=e.resolveObject(d.responses[_]),T=Object.keys(P.content??{}).find(Jn),$e,se;if(T?(b.responseFormat=T,$e=(i=(n=P.content)==null?void 0:n[T])==null?void 0:i.schema):(se=co,_==="200"&&e.validationErrors.push(zS({received:"200",expected:"204"},d,b))),$e){let K=W({schema:$e,resolver:e,meta:{isRequired:!0},tag:S}),Oe=e.resolveObject($e);se=ni({schema:Oe,zodSchema:K,fallbackName:K.ref?void 0:ua({statusCode:_,operationName:y,isUniqueOperationName:v,tag:S}),resolver:e,tag:S})+Ct({schema:Oe,meta:K.meta,options:e.options})}if(se){let K=Number(_);sa(K)?(b.response=se,b.responseObject=P,b.responseDescription=P.description):_!=="default"&&aa(K)&&b.errors.push({zodSchema:se,status:K,description:P.description})}}b.response||(b.response=co),b.acl=WS({resolver:e,endpoint:b,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!b.responseStatusCodes.includes("401")&&e.validationErrors.push(cf("401",d,b)),(a=b.acl)!=null&&a[0]&&!b.responseStatusCodes.includes("403")&&e.validationErrors.push(cf("403",d,b)),t.push(b)}}return t}o(eb,"getEndpointsFromOpenAPIDoc");function XS(e){return Object.fromEntries((e??[]).map(t=>[M(t)?t.$ref:t.name,t]))}o(XS,"getParameters");function sC(e){return[...e.path.matchAll(/:([a-zA-Z0-9_]+)/g)].map(r=>r[1]).filter(r=>e.parameters.findIndex(({name:n})=>n===r)===-1).map(r=>aC(r))}o(sC,"getMissingPathParameters");function aC(e){return{name:e,type:"Path",zodSchema:Js,parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(aC,"getPathParameterFromName");function tb(e,t){let r=cC(e,t),n=uC(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o(tb,"getOpenAPISchemaDependencyGraph");function cC(e,t){let r={},n={};return e.forEach(i=>lC({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o(cC,"getRefsDependencyGraph");function uC(e,t){let r={},n={},i=o((s,a)=>{n[a].add(s),t[s]&&a!==s&&t[s].forEach(c=>{let u=`${a}__${c}`;r[u]||(r[u]=!0,i(c,a))})},"visit");return e.forEach(s=>{let a=t[s];a&&(n[s]||(n[s]=new Set),a.forEach(c=>i(c,s)))}),n}o(uC,"getDeepRefsDependencyGraph");function lC({schema:e,fromRef:t,getSchemaByRef:r,visitedRefs:n={},refsDependencyGraph:i={}}){let s=o(a=>{if(a.type!=="reference"||!a.data)return;let{schema:c,data:u}=a;if(i[u.fromRef]||(i[u.fromRef]=new Set),i[u.fromRef].add(c.$ref),n[c.$ref])return!0;n[u.fromRef]=!0,_e(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return _e(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(lC,"getSchemaRefsDependencyGraph");function pa(e,t,r){let n=[];return _e(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):M(s.parentSchema)&&(s.type==="property"?e.validationErrors.push(Eo(`${r} has both reference and properties`)):s.type==="additionalProperties"?e.validationErrors.push(Eo(`${r} has both reference and additionalProperties`)):s.type==="array"?e.validationErrors.push(Eo(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(Eo(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(pa,"getSchemaRefObjs");function rb(e,t){return t.map(i=>zr(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(rb,"getDeepSchemaRefObjs");function nb(e){e.extractedEnumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=Gp(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=go(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!pf(e);)pC(e,t+2),t++;if(pf(e)||e.extractedEnumZodSchemaData.filter(n=>!ib(e,n)).forEach(n=>{n.zodSchemaName=go(n.meta.zodSchemaNameSegments[0].map(i=>ff(U(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!pf(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(nb,"resolveExtractedEnumZodSchemaNames");function pf(e){return e.extractedEnumZodSchemaData.every(t=>ib(e,t))}o(pf,"allExtractedEnumZodSchemaNamesAreUnique");function pC(e,t){e.extractedEnumZodSchemaData.forEach(r=>{let n=e.extractedEnumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&fC(n,t)})}o(pC,"additionalResolveExtractedEnumZodSchemaName");function fC(e,t=2){e.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(i=>i[i.length-t]).filter(Boolean);if(n.length===1){let i=[ff(U(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=Gp(n),s=[i?ff(U(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(fC,"suffixWithPreviousSegmentName");function ib(e,t){return e.extractedEnumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(ib,"isUnique");function ff(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(ff,"sanitizeName");function ob(e){e.extractedEnumZodSchemaData.forEach(t=>{let r=Le(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(ob,"resolveExtractedEnumZodSchemaTags");function Oo({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&sb({schema:e,nameSegments:t,...n}),_e(e,{data:{nameSegments:t},onSchema:o(s=>{var c;if(s.type==="reference")return!0;let a=[...((c=s.data)==null?void 0:c.nameSegments)??[]];s.type==="property"&&a.push(s.propertyName),sb({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(Oo,"updateExtractedEnumZodSchemaData");function sb({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||M(t)||!t.enum)return;let a=ri(t),c=e.extractedEnumZodSchemaData.find(u=>u.code===a);c?(c.meta.zodSchemaNameSegments.push(s),c.meta.tags.push(...i),c.meta.schemaRefs.push(...r?[r]:[]),c.meta.schemas.push(...t?[t]:[])):e.extractedEnumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(US(r?`${Yn(r)}.${s[s.length-1]}`:n??s.join(".")))}o(sb,"handleExtractedEnumZodSchemaDataUpdate");function ab(e){var n;let t={},r={};return Object.entries(((n=e.openApiDoc.components)==null?void 0:n.schemas)??{}).forEach(([i,s])=>{let a=e.getSchemaDataByName(i);if(e.options.excludeRedundantZodSchemas&&(!a||a.deepRefOperations.length===0&&a.tags.length===0))return;let c=Rt(i,e.options.schemaSuffix);if(t[c])return;let u=e.getTagByZodSchemaName(c),l=e.resolveObject(s);l.enum?r[c]=ri(l):t[c]=W({schema:s,resolver:e,tag:u}).getCodeString(u)}),{zodSchemas:t,enumZodSchemas:r}}o(ab,"getZodSchemasFromOpenAPIDoc");function cb(e){var r;let t=[];return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=Rt(n,e.options.schemaSuffix),a=e.resolveObject(i);!t.find(c=>c.zodSchemaName===s)&&a.enum&&t.push({zodSchemaName:s,code:ri(a)})}),t}o(cb,"getEnumZodSchemasFromOpenAPIDoc");var df=class df{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=tb(this.schemaRefs,this.getSchemaByRef.bind(this)),this.enumZodSchemas=cb(this),this.operationsByTag=FS(t,r),this.operationNames=LS(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];dependencyGraph;enumZodSchemas=[];extractedEnumZodSchemaData=[];operationsByTag={};operationNames=[];validationErrors=[];get docSchemas(){var t;return((t=this.openApiDoc.components)==null?void 0:t.schemas)??{}}get schemaRefs(){return Object.keys(this.docSchemas).map(pS)}getSchemaByRef(t){return this.docSchemas[Yn(t)]}getSchemaDataByName(t){return this.schemaData.find(r=>r.name===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(zr(t)))==null?void 0:n.zodSchemaName)??((i=this.extractedEnumZodSchemaData.find(s=>s.zodSchemaName===t))==null?void 0:i.zodSchemaName);if(!r)throw new Error(`Zod schema not found for ref: ${t}`);return r}getRefByZodSchemaName(t){var r;return(r=this.schemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.ref}getTagByZodSchemaName(t){var u,l;if(!this.options.splitByTags)return this.options.defaultTag;let r=this.extractedEnumZodSchemaData.find(f=>f.zodSchemaName===t);if(r)return Nt(r.tag??this.options.defaultTag);let n=this.getRefByZodSchemaName(t),i=n?((u=this.getSchemaDataByRef(n))==null?void 0:u.tags)??[]:[],s=((l=this.zodSchemaData.find(f=>f.zodSchemaName===t))==null?void 0:l.tags)??[],a=Le(i,s),c=a.length===1?a[0]:this.options.defaultTag;return Nt(c??this.options.defaultTag)}getCodeByZodSchemaName(t){var r;return(r=this.zodSchemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.code}getZodSchemaNamesByCompositeCode(t){var r;return(r=this.compositeZodSchemaData.find(n=>n.code===t))==null?void 0:r.zodSchemas.map(n=>n.zodSchemaName)}setZodSchema(t,r,n){let i=this.zodSchemaData.find(s=>s.zodSchemaName===t);i?(i.code=r,i.tags=(i.tags??[]).concat(n)):this.zodSchemaData.push({zodSchemaName:t,code:r,tags:[n]})}addZodSchemaForCompositeCode(t,r,n,i){let s={zodSchemaName:n,zodSchema:r,schema:i},a=this.compositeZodSchemaData.find(c=>c.code===t);a?a.zodSchemas.push(s):this.compositeZodSchemaData.push({code:t,zodSchemas:[s]})}getCompositeZodSchemaByZodSchemaName(t){var n;let r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t));return(n=r==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.zodSchema}getSchemaByCompositeZodSchemaName(t){var r,n;return(n=(r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t)))==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.schema}getEnumZodSchemaDataByCode(t){return this.enumZodSchemas.find(r=>r.code===t)}getExtractedEnumZodSchemaDataByCode(t){return this.extractedEnumZodSchemaData.find(r=>r.code===t)}getExtractedEnumZodSchemaNamesReferencedBySchemaRef(t){return this.extractedEnumZodSchemaData.reduce((r,{zodSchemaName:n,meta:i})=>(n&&i.schemaRefs.includes(t)&&r.push(n),r),[])}getZodSchemas(){return this.zodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>({...t,[r]:n}),{})}getExtractedEnumZodSchemas(){return this.extractedEnumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return M(t)?this.getSchemaByRef(t.$ref):t}isSchemaCircular(t){var r;return(r=this.dependencyGraph.deepDependencyGraph[t])==null?void 0:r.has(t)}getCircularSchemaChain(t,r=t,n=[],i=[]){var s,a;return i.includes(r)?[]:(i.push(r),(s=this.dependencyGraph.refsDependencyGraph[r])!=null&&s.has(t)?[...n,r,t]:Array.from(((a=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:a.values())??[]).map(c=>{let u=this.getCircularSchemaChain(t,c,n,i);return u.length>0?[r,...u]:u}).flat())}getBaseUrl(){var r,n;let t=(n=(r=this.openApiDoc.servers)==null?void 0:r[0])==null?void 0:n.url;return this.options.baseUrl===""&&t?t:this.options.baseUrl}getZodSchemaObj(t){let r=this.getRefByZodSchemaName(t);if(r)return this.getSchemaByRef(r);let n=this.getSchemaByCompositeZodSchemaName(t);if(n)return n;let i=this.getExtractedEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getExtractedEnumZodSchemaDataByName(t){return this.extractedEnumZodSchemaData.find(({zodSchemaName:r})=>r===t)}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=zr(a),u=Yn(c),l=Rt(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[],deepRefOperations:[]})});for(let a in this.openApiDoc.paths){if(Kr(a,this.options))continue;let c=this.openApiDoc.paths[a],u=Xr(c,Zr);for(let l in u){let f=u[l];if(!f||ti(f,this.options))continue;let p=Sr(f,this.options),d=Po({path:a,method:l,operation:f,operationsByTag:this.operationsByTag,options:this.options}),m=this.operationNames.filter(S=>S===d).length<=1,g=ie(Qr(d,m,p)),y=[];if((t=f.parameters)==null||t.map(S=>{let b=S,E=b.schema,_=`Operation ${f.operationId??a} parameter ${b.name}`;y.push(...pa(this,E,_)),this.options.extractEnums&&Oo({resolver:this,schema:E,schemaInfo:_,tags:[p],nameSegments:[g,b.name],includeSelf:!0})}),f.requestBody){let S=this.resolveObject(f.requestBody),E=Object.keys(S.content??{}).find(We);if(E){let _=(n=(r=S.content)==null?void 0:r[E])==null?void 0:n.schema,P=`Operation ${f.operationId} request body`;y.push(...pa(this,_,P)),this.options.extractEnums&&Oo({resolver:this,schema:_,schemaInfo:P,tags:[p],nameSegments:[ca(g)]})}}for(let S in f.responses){let b=this.resolveObject(f.responses[S]),_=Object.keys(b.content??{}).find(Jn);if(_){let P=(s=(i=b.content)==null?void 0:i[_])==null?void 0:s.schema,L=`Operation ${f.operationId} response body`;y.push(...pa(this,P,L)),this.options.extractEnums&&Oo({resolver:this,schema:P,schemaInfo:L,tags:[p],nameSegments:[ua({statusCode:S,operationName:d,isUniqueOperationName:m,tag:p})]})}}rb(this,y).forEach(S=>{let b=this.getSchemaDataByRef(S);b&&(b.tags.push(p),b.deepRefOperations.push(f))})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=zr(a);Oo({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[Yn(c)]})}),ob(this),this.handleDuplicateEnumZodSchemas(),nb(this))}handleDuplicateEnumZodSchemas(){let t=this.enumZodSchemas.map(({code:n})=>n),r=this.enumZodSchemas.filter(({code:n})=>t.includes(n));this.schemaData.forEach(n=>{var a,c;let i=(a=r.find(({zodSchemaName:u})=>u===n.zodSchemaName))==null?void 0:a.code;if(!i)return;let s=this.extractedEnumZodSchemaData.find(({code:u})=>u===i);!s||((c=this.getEnumZodSchemaDataByCode(s.code))==null?void 0:c.zodSchemaName)!==n.zodSchemaName||(n.tags.push(...s.meta.tags??[]),s.meta.schemaRefs.forEach(u=>{this.dependencyGraph.refsDependencyGraph[u]||(this.dependencyGraph.refsDependencyGraph[u]=new Set),this.dependencyGraph.refsDependencyGraph[u].add(n.ref),this.dependencyGraph.deepDependencyGraph[u]||(this.dependencyGraph.deepDependencyGraph[u]=new Set),this.dependencyGraph.deepDependencyGraph[u].add(n.ref)}))}),this.extractedEnumZodSchemaData.splice(0,this.extractedEnumZodSchemaData.length,...this.extractedEnumZodSchemaData.filter(({code:n})=>!t.includes(n)))}};o(df,"SchemaResolver");var fa=df;function ub(e){let t=[],r={};function n(i,s){Array.isArray(s)||(s=[]),s.push(i),r[i]=!0,e[i]&&e[i].forEach(a=>{s.includes(a)||r[a]||n(a,s.slice(0))}),t.includes(i)||t.push(i)}return o(n,"visit"),Object.keys(e).forEach(i=>n(i,[])),t}o(ub,"topologicalSort");function lb(e,t){let r=Object.entries(e),n=r.filter(([i])=>t.includes(i)).sort(([i],[s])=>t.indexOf(i)-t.indexOf(s)).concat(r.filter(([i])=>!t.includes(i)));return Object.fromEntries(n)}o(lb,"sortObjKeysFromArray");function pb(e,t){let r=ub(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return lb(t,r)}o(pb,"sortZodSchemasByTopology");function fb(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(GS(e.getCircularSchemaChain(s).join(" -> "))),r[Rt(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[Rt(n,e.options.schemaSuffix)]=i}),r}o(fb,"wrapCircularZodSchemas");function da(e,t){let r=new fa(e,t),n=eb(r),i=ab(r),s={...i.zodSchemas,...r.getZodSchemas(),...i.enumZodSchemas};return s=fb(r,s),s=pb(r,s),s={...r.getExtractedEnumZodSchemas(),...s},{resolver:r,data:dC({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(da,"getDataFromOpenAPIDoc");function dC({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=bo(s,n);db(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(db(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(dC,"splitDataByTags");function db(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(db,"getTagElement");async function mb(e,t){let{resolver:r,data:n}=await da(e,t),i=[],s=[];return n.forEach(({endpoints:c,zodSchemas:u},l)=>{Object.keys(u).forEach(f=>{let p=r.getRefByZodSchemaName(f),d=p?r.getSchemaByRef(p):r.getSchemaByCompositeZodSchemaName(f),m=Xn({zodSchemaName:f,schema:d,resolver:r}),g;d&&(g=Wr({schema:d,parentTypes:[m],resolver:r})),i.push({...m,metaType:"primitive",...g})}),c.forEach(f=>{let p="queries",d=Nt(l);s.push({name:ta(f),importPath:Yr({type:p,tag:d,includeTagDir:!0,options:t}),namespace:t.tsNamespaces?G({type:p,tag:d,options:t}):void 0,isQuery:De(f),isMutation:Ot(f),params:mC({resolver:r,endpoint:f}),response:hC({resolver:r,endpoint:f})})})}),{openApiDoc:e,models:i,queries:s}}o(mb,"getMetadataFromOpenAPIDoc");function mC({resolver:e,endpoint:t}){return t.parameters.map(r=>{var a,c,u,l;let n;if((a=r.parameterObject)!=null&&a.schema)n=e.resolveObject(r.parameterObject.schema);else if(r.bodyObject){let p=Object.keys(r.bodyObject.content??{}).find(We);p&&(n=e.resolveObject((u=(c=r.bodyObject.content)==null?void 0:c[p])==null?void 0:u.schema))}let i=Xn({zodSchemaName:r.zodSchema,schema:n,resolver:e}),s;return n&&(s=Wr({schema:n,parentTypes:[i],resolver:e})),{name:wt(r.name),isRequired:((l=r.parameterObject)==null?void 0:l.required)??!0,...i,...s,paramType:r.type}}).sort((r,n)=>{if(r.isRequired===n.isRequired){let i=["Path","Body","Query","Header"];return i.indexOf(r.paramType)-i.indexOf(n.paramType)}return r.isRequired?-1:1}).map(({paramType:r,...n})=>n)}o(mC,"getQueryMetadataParams");function hC({resolver:e,endpoint:t}){var a,c,u,l;let r,n=Object.keys(((a=t.responseObject)==null?void 0:a.content)??{}).find(Jn);n&&(r=e.resolveObject((l=(u=(c=t.responseObject)==null?void 0:c.content)==null?void 0:u[n])==null?void 0:l.schema));let i=Xn({zodSchemaName:t.response,schema:r,resolver:e}),s;return r&&(s=Wr({schema:r,parentTypes:[i],resolver:e})),{...i,metaType:"primitive",...s}}o(hC,"getQueryMetadataResponse");var hb={fileName:"acl/app.ability",extension:"ts"},xo="AllAbilities",ft={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"subject"},mf={bindings:[ft.abilityTuple,ft.pureAbility,ft.forcedSubject,ft.subject],from:"@casl/ability"};var gb=o(e=>`Use${U(ie(e.operationName))}Ability`,"getAbilityTypeName"),yb=o(e=>`canUse${U(ie(e.operationName))}`,"getAbilityFunctionName"),vb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),Sb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),bb=o(e=>{var t;return!!((t=hf(e))!=null&&t.length)},"hasAbilityConditions"),hf=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),_b=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ma=o(e=>`${U(e)}${xo}`,"getTagAllAbilitiesName");var ld=et(zt());var ad=et(require("fs")),fP=et(require("path"));function dP(e){return ad.default.readFileSync(fP.default.join(__dirname,`../${e}`),"utf-8")}o(dP,"readFileSync");function cd(e){let t=`src/generators/templates/${e}.hbs`;return dP(t)}o(cd,"readHbsTemplateSync");function ud(e){let t=`src/assets/${e}`;return dP(t)}o(ud,"readAssetSync");function cn({output:e,fileName:t}){return`${e}/${t}`}o(cn,"getOutputFileName");var Kt=et(zt());function mP(){aj(),cj(),uj(),lj(),pj(),fj(),dj(),mj()}o(mP,"registerAclHbsHelpers");function aj(){Kt.default.registerHelper("abilityTypeName",gb)}o(aj,"registerAbilityTypeNameHelper");function cj(){Kt.default.registerHelper("abilityFunctionName",yb)}o(cj,"registerAbilityFunctionNameHelper");function uj(){Kt.default.registerHelper("ablityAction",vb)}o(uj,"registerAbilityActionHelper");function lj(){Kt.default.registerHelper("ablitySubject",Sb)}o(lj,"registerAbilitySubjectHelper");function pj(){Kt.default.registerHelper("hasAbilityConditions",bb)}o(pj,"registerHasAbilityConditionsHelper");function fj(){Kt.default.registerHelper("abilityConditionsTypes",hf)}o(fj,"registerAbilityConditionsTypesHelper");function dj(){Kt.default.registerHelper("abilityDescription",_b)}o(dj,"registerAbilityDescriptionHelper");function mj(){Kt.default.registerHelper("tagAllAbilitiesName",ma)}o(mj,"registerTagAllAbilitiesNameHelper");var Fo=et(zt());function hP(){hj(),gj(),yj(),vj()}o(hP,"registerCommonHbsHelpers");function hj(){Fo.default.registerHelper("isEqual",(e,t)=>e===t)}o(hj,"registerIsEqualHelper");function gj(){Fo.default.registerHelper("commaSeparated",e=>e.join(", "))}o(gj,"registerCommaSeparatedListHelper");function yj(){Fo.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
77
+ *`))}o(yj,"registerAddAsteriskAfterNewLineHelper");function vj(){Fo.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(vj,"registerJsonStringifyHelper");var $r=et(zt());function gP(e){Sj(),bj(e.options),Ej(e),_j(),Pj(),$j(e),Oj()}o(gP,"registerEndpointsHbsHelpers");function Sj(){$r.default.registerHelper("endpointName",So)}o(Sj,"registerEndpointNameHelper");function bj(e){$r.default.registerHelper("importedEndpointName",t=>AS(t,e))}o(bj,"registerImportedEndpointNameHelper");function _j(){$r.default.registerHelper("endpointPath",IS)}o(_j,"registerEndpointPathHelper");function Pj(){$r.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(Pj,"registerEndpointBodyHelper");function Ej(e){$r.default.registerHelper("endpointParams",(t,r)=>_o(e,t,r.hash))}o(Ej,"registerEndpointParamsHelper");function $j(e){$r.default.registerHelper("endpointArgs",(t,r)=>_o(e,t,r.hash).map(n=>n.name).join(", "))}o($j,"registerEndpointArgsHelper");function Oj(){$r.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&be(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let p=Object.keys(e.bodyObject.content??{}).find(We);p&&(i=e.bodyObject.content[p],i.schema&&be(i.schema)&&(n=i.schema))}if(n){let f=yo(n);t.push(...f)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(Oj,"registerEndpointParamDescriptionHelper");var Ne=et(zt());function yP(e){xj(),wj(),Aj(),Ij(e),Tj(),Nj(e),Rj(e),Cj(e),kj(e),jj(e),qj(),Mj(),Dj()}o(yP,"registerPartialsHbsHelpers");function xj(){Ne.default.registerHelper("genModelJsDocs",(e,t,r)=>Re("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(xj,"registerGenerateModelJsDocsHelper");function wj(){Ne.default.registerHelper("genImport",e=>Re("import")({import:e}))}o(wj,"registerImportHelper");function Aj(){Ne.default.registerHelper("genEndpointParams",(e,t)=>Re("endpoint-params")({endpoint:e,options:t}))}o(Aj,"registerGenerateEndpointParamsHelper");function Ij(e){Ne.default.registerHelper("genEndpointConfig",t=>{let r=TS(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?dr:"":Re("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===Ys,hasFileDownload:t.mediaDownload,axiosRequestConfigName:dr})})}o(Ij,"registerGenerateEndpointConfigHelper");function Tj(){Ne.default.registerHelper("genEndpointParamSorting",(e,t)=>Re("endpoint-param-sorting")({enumSchemaName:e,paramName:t,zodExtended:ao.name,sortingString:ao.properties.sortingString}))}o(Tj,"registerGenerateEndpointParamSortingHelper");function Nj(e){Ne.default.registerHelper("genQueryKeys",t=>t.length===0?"":Re("query-keys")({queryEndpoints:t,queriesModuleName:fo,generateInfiniteQueries:e.options.infiniteQueries}))}o(Nj,"registerGenerateQueryKeysHelper");function Rj(e){Ne.default.registerHelper("genQuery",t=>{if(!De(t))return;let r=e.options.axiosRequestConfig;return Re("query-use-query")({endpoint:t,queryHook:Me.query,hasQueryFn:_o(e,t).length>0||r,hasAxiosRequestConfig:r,axiosRequestConfigName:dr,axiosRequestConfigType:xt})})}o(Rj,"registerGenerateQueryHelper");function Cj(e){Ne.default.registerHelper("genMutation",t=>{if(Ot(t))return Re("query-use-mutation")({endpoint:t,queryHook:Me.mutation,queriesModuleName:fo,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:dr,axiosRequestConfigType:xt,hasInvalidateQueryOptions:e.options.invalidateQueryOptions,invalidateQueryOptionsType:pr.optionsType})})}o(Cj,"registerGenerateMutationHelper");function kj(e){Ne.default.registerHelper("genInfiniteQuery",t=>{if(!(!e.options.infiniteQueries||!Qn(t)))return Re("query-use-infinite-query")({endpoint:t,infiniteQueryHook:Me.infiniteQuery,pageParamName:ea.pageParamName,totalItemsName:ea.totalItemsName,limitParamName:ea.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:dr,axiosRequestConfigType:xt})})}o(kj,"registerGenerateInfiniteQueryHelper");function jj(e){Ne.default.registerHelper("genQueryJsDocs",(t,r)=>Re("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasInvalidateQueryOptions:e.options.invalidateQueryOptions,invalidateQueryOptionsType:pr.optionsType}))}o(jj,"registerGenerateQueryJsDocsHelper");function qj(){Ne.default.registerHelper("genCaslAbilityType",e=>Re("casl-ability-type")({endpoint:e,abilityTupleType:ft.abilityTuple}))}o(qj,"registerGenerateCaslAbilityTypeHelper");function Mj(){Ne.default.registerHelper("genCaslAbilityFunction",e=>Re("casl-ability-function")({endpoint:e}))}o(Mj,"registerGenerateCaslAbilityFunctionHelper");function Dj(){Ne.default.registerHelper("genCaslAbilityQuery",e=>Re("casl-ability-query")({endpoint:e}))}o(Dj,"registerGenerateCaslAbilityQueryHelper");var di=et(zt());function vP(){Lj(),Vj(),Hj(),Fj(),Bj()}o(vP,"registerQueryHbsHelpers");function Lj(){di.default.registerHelper("queryName",(e,t)=>ta(e,t.hash.mutation))}o(Lj,"registerQueryNameHelper");function Fj(){di.default.registerHelper("infiniteQueryName",rS)}o(Fj,"registerInfiniteQueryNameHelper");function Vj(){di.default.registerHelper("isQuery",De)}o(Vj,"registerIsQueryHelper");function Hj(){di.default.registerHelper("isMutation",Ot)}o(Hj,"registerIsMutationHelper");function Bj(){di.default.registerHelper("isInfiniteQuery",e=>Qn(e))}o(Bj,"registerIsInfiniteQueryHelper");var un=et(zt());function SP(e){Uj(e.options),Gj(e),Zj(e),zj(),Kj(),Qj(e)}o(SP,"registerZodHbsHelpers");function Uj(e){un.default.registerHelper("zodInferedType",t=>vo(t,e))}o(Uj,"registerInferedTypeHelper");function Gj(e){un.default.registerHelper("importedZodSchemaName",t=>_S(e,t))}o(Gj,"registerImportedZodSchemaNameHelper");function Zj(e){un.default.registerHelper("importedZodSchemaInferedType",t=>br(e,t))}o(Zj,"registerImportedZodSchemaInferedTypeHelper");function zj(){un.default.registerHelper("zodSchemaType",e=>PS(e))}o(zj,"registerZodSchemaTypeHelper");function Kj(){un.default.registerHelper("zodSchemaDescription",e=>ES(e))}o(Kj,"registerZodSchemaDescriptionHelper");function Qj(e){un.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>OS(e,t,r))}o(Qj,"registerZodSchemaPropertyDescriptionsHelper");var bP=et(zt());function _P(){Wj()}o(_P,"registerImportsHbsHelpers");function Wj(){bP.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(Wj,"registerBindingsHelper");function Be(e,t){let r=cd(t);return hP(),_P(),SP(e),gP(e),vP(),mP(),yP(e),ld.default.compile(r)}o(Be,"getHbsTemplateDelegate");function Re(e){let t=cd(`partials/${e}`);return ld.default.compile(t)}o(Re,"getHbsPartialTemplateDelegate");function PP({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:f})=>f&&f.length>0);if(!n||n.length===0)return;let i=n.some(({acl:f})=>(f==null?void 0:f[0].conditions)&&Object.keys(f[0].conditions).length>0),s={bindings:[ft.abilityTuple,...i?[ft.forcedSubject,ft.subject]:[]],from:mf.from},a=n.reduce((f,p)=>{var m,g;let d=(g=(m=p.acl)==null?void 0:m[0].conditionsTypes)==null?void 0:g.reduce((y,v)=>[...y,...v!=null&&v.zodSchemaName?[v.zodSchemaName]:[]],[]);return[...f,...d??[]]},[]),c=_r({resolver:e,tag:r,zodSchemasAsTypes:Le(a)});return Be(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:G({type:"acl",tag:r,options:e.options}),endpoints:n})}o(PP,"generateAcl");function EP(e,t){if(!t||t.length===0)return;let r={bindings:[ft.pureAbility],from:mf.from},n=RS({tags:t,entityName:xo,getAliasEntityName:ma,type:"acl",options:e.options}),i=t.map(a=>G({type:"acl",tag:a,options:e.options}));return Be(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:xo,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i})}o(EP,"generateAppAcl");function $P(e){return Be(e,"app-rest-client")({appRestClientName:so,baseUrl:e.getBaseUrl()})}o($P,"generateAppRestClient");function OP({resolver:e,data:t,tag:r=""}){var y;let n=(y=t.get(r))==null?void 0:y.endpoints;if(!n||n.length===0)return;let i={bindings:[so],from:jS(e.options)},s=n.some(v=>v.parameters.some(S=>S.parameterSortingEnumSchemaName)),a={bindings:[ao.name],from:DS(e.options)},c=e.options.axiosRequestConfig,u=c,l={bindings:c?[xt]:[],from:ra.from},f=n.map(v=>v.response),p=f.some(v=>!Pe(v)),d=n.reduce((v,S)=>[...v,...S.parameters],[]),m=_r({resolver:e,tag:r,zodSchemas:Le([...f.filter(Pe),...d.map(v=>v.parameterSortingEnumSchemaName).filter(tS)]),zodSchemasAsTypes:Le(d.map(v=>v.zodSchema).filter(Pe))});return Be(e,"endpoints")({appRestClientImport:i,hasAxiosImport:u,axiosImport:l,hasZodImport:p,zodImport:Xs,hasZodExtendedImport:s,zodExtendedImport:a,modelsImports:m,includeNamespace:e.options.tsNamespaces,namespace:G({type:"endpoints",tag:r,options:e.options}),restClientName:so,hasAxiosRequestConfig:c,axiosRequestConfigName:dr,axiosRequestConfigType:xt,endpoints:n})}o(OP,"generateEndpoints");function xP({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:G({type:"queries",tag:s,options:e.options})})}),Be(e,"invalidate-queries")({modules:r})}o(xP,"generateInvalidateQueries");function wP(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(AP(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(wP,"getZodSchemaRefs");function AP(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&AP(n).forEach(s=>r.add(s)),r},new Set)}o(AP,"getSchemaRefs");function IP({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,f)=>[...l,...wP(e,f)],[]).filter(l=>!n[l]),s=_r({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[f,p])=>{let d=e.getRefByZodSchemaName(f);return{...l,[f]:{code:p,isCircular:!!d&&e.isSchemaCircular(d),isEnum:SS(p),schemaObj:e.getZodSchemaObj(f)}}},{});return Be(e,"models")({zodImport:Xs,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:G({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(IP,"generateModels");function TP({resolver:e,data:t,tag:r=""}){var b;let n=(b=t.get(r))==null?void 0:b.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:E})=>E),a=i||s,c={defaultImport:s?zp:void 0,bindings:i?[xt]:[],from:ra.from},u=n.filter(De),l=u.filter(E=>Qn(E)),f=n.filter(Ot),p={bindings:[...u.length>0?[Me.query]:[],...e.options.infiniteQueries&&l.length>0?[Me.infiniteQuery]:[],...f.length>0?[Me.mutation,Me.queryClient]:[]],from:Kv.from},d={bindings:[pr.queryModuleEnum,...f.length>0?[pr.optionsType,pr.functionName]:[]],from:MS(e.options)},m={bindings:[...u.length>0?[Zs.query]:[],...e.options.infiniteQueries&&l.length>0?[Zs.infiniteQuery]:[],...f.length>0?[Zs.mutation]:[]],from:qS(e.options)},g=n.reduce((E,_)=>[...E,..._.parameters],[]),y=_r({resolver:e,tag:r,zodSchemasAsTypes:Le(g.map(E=>E.zodSchema).filter(Pe))}),v=NS({tag:r,endpoints:n,options:e.options});return Be(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:p,hasInvalidateQueryOptions:e.options.invalidateQueryOptions,invalidateQueriesImport:d,queryTypesImport:m,modelsImports:y,endpointsImports:v,includeNamespace:e.options.tsNamespaces,tag:r,namespace:G({type:"queries",tag:r,options:e.options}),queriesModuleName:fo,queryModuleEnum:pr.queryModuleEnum,endpoints:n,queryEndpoints:u})}o(TP,"generateQueries");function NP(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...lo,...t,importPath:r},{resolver:i,data:s}=da(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:IP,endpoints:OP,queries:TP,acl:PP};s.forEach((p,d)=>{u.forEach(m=>{let g=l[m]({resolver:i,data:s,tag:d});if(g){let y=cn({output:n.output,fileName:kS({tag:d,type:m,options:n})});a.push({fileName:y,content:g}),m==="acl"&&c.push(d)}})});let f=EP(i,c);if(f){let p=cn({output:n.output,fileName:ei(hb)});a.push({fileName:p,content:f})}if(n.invalidateQueryOptions&&a.push({fileName:cn({output:i.options.output,fileName:ei(Qs)}),content:xP({resolver:i,data:s})}),n.standalone&&a.push(...Yj(i)),Jj(s)){let p=ei(Ws);a.push({content:ud(p),fileName:cn({output:i.options.output,fileName:p})})}return a}o(NP,"generateCodeFromOpenAPIDoc");function Yj(e){let t=[];return Object.values(zs).forEach(r=>{let n=ei(r);t.push({content:ud(n),fileName:cn({output:e.options.output,fileName:n})})}),t.push({fileName:cn({output:e.options.output,fileName:ei(Ks)}),content:$P(e)}),t}o(Yj,"getStandaloneFiles");function Jj(e){return Array.from(e.values()).some(({endpoints:t})=>t.some(r=>r.parameters.some(n=>n.parameterSortingEnumSchemaName)))}o(Jj,"hasZodExtendedFile");async function Xj({input:e,options:t}){let r={...lo,...t},n=await pd.default.bundle(e);return await mb(n,r)}o(Xj,"getGenerateMetadata");async function eq({input:e,options:t}){let r={...lo,...t},n=await pd.default.bundle(e);return NP(n,r)}o(eq,"getGenerateFilesData");0&&(module.exports={getGenerateFilesData,getGenerateMetadata});
package/dist/sh.js CHANGED
@@ -137,7 +137,7 @@ ${y.join(`
137
137
  `:`
138
138
  `)+r,i=n+1,n=e.indexOf(`
139
139
  `,i)}while(n!==-1);return s+=e.slice(i),s}o(sb,"stringEncaseCRLFWithFirstIndex");var{stdout:ab,stderr:cb}=ib,Ef=Symbol("GENERATOR"),po=Symbol("STYLER"),As=Symbol("IS_EMPTY"),ub=["ansi","ansi","ansi256","ansi16m"],ho=Object.create(null),C$=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=ab?ab.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),wf=class wf{constructor(t){return lb(t)}};o(wf,"Chalk");var Cc=wf,lb=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return C$(t,e),Object.setPrototypeOf(t,Is.prototype),t},"chalkFactory");function Is(e){return lb(e)}o(Is,"createChalk");Object.setPrototypeOf(Is.prototype,Function.prototype);for(let[e,t]of Object.entries(Or))ho[e]={get(){let r=Tc(this,$f(t.open,t.close,this[po]),this[As]);return Object.defineProperty(this,e,{value:r}),r}};ho.visible={get(){let e=Tc(this,this[po],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var xf=o((e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Or[r].ansi16m(...n):t==="ansi256"?Or[r].ansi256(Or.rgbToAnsi256(...n)):Or[r].ansi(Or.rgbToAnsi(...n)):e==="hex"?xf("rgb",t,r,...Or.hexToRgb(...n)):Or[r][e](...n),"getModelAnsi"),T$=["rgb","hex","ansi256"];for(let e of T$){ho[e]={get(){let{level:r}=this;return function(...n){let i=$f(xf(e,ub[r],"color",...n),Or.color.close,this[po]);return Tc(this,i,this[As])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);ho[t]={get(){let{level:r}=this;return function(...n){let i=$f(xf(e,ub[r],"bgColor",...n),Or.bgColor.close,this[po]);return Tc(this,i,this[As])}}}}var R$=Object.defineProperties(()=>{},{...ho,level:{enumerable:!0,get(){return this[Ef].level},set(e){this[Ef].level=e}}}),$f=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"),Tc=o((e,t,r)=>{let n=o((...i)=>N$(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,R$),n[Ef]=e,n[po]=t,n[As]=r,n},"createBuilder"),N$=o((e,t)=>{if(e.level<=0||!t)return e[As]?"":t;let r=e[po];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=ob(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
140
- `);return s!==-1&&(t=sb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Is.prototype,ho);var C6=Is(),T6=Is({level:cb?cb.level:0});var Fr=new Cc;function Cs(e,t,r){console.log(r!==void 0&&r!==t?`${Fr.yellow(`${e}:`.padEnd(20))}${Fr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Cs,"logVariable");function ur(e){console.log(`[INFO] ${e}`)}o(ur,"logInfo");function In(e){console.log(Fr.green(`[SUCCESS] ${e}`))}o(In,"logSuccess");function Ts(e,t){e instanceof Error?(console.log(Fr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Fr.red(`[ERROR] ${e}`))}o(Ts,"logError");function Rc(e){console.log(Fr.bgYellow(`==== ${e} ====`))}o(Rc,"logBanner");var fb=mt(require("fs"));function mo(){return"0.10.3"}o(mo,"getVersion");var U6=mt(db());var Af=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Af,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(Af,s,t)}}}o(Ee,"YargOption");function hb(e){let t=Reflect.getMetadata(Af,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(hb,"getYargsOption");function Nc(e){return async t=>t.options(j$(e)).middleware(async r=>await M$(e,r),!0)}o(Nc,"getBuilder");function j$(e){return Object.entries(hb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(j$,"getYargsOptions");async function M$(e,t){let r=new e;for(let[n,i]of Object.entries(hb(e)))r[n]=t[n]??i.default;return r}o(M$,"loadYargsConfig");var f1=mt(bm());var HP={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"},UP={"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"};var Qt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},GP={bindings:[Qt.query,Qt.infiniteQuery,Qt.mutation,Qt.queryClient],from:"@tanstack/react-query"},Oa={pageParamName:"page"},Lu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Pa="moduleName";var vm={"Content-Type":"application/json",Accept:"application/json"},zP="data",_m="axios",zn="config",Yr="AxiosRequestConfig",Fu={defaultImport:_m,bindings:[Yr],from:"axios"};var ZP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Zn=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 xe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(xe,"isReferenceObject");function Ct(e){return!xe(e)}o(Ct,"isSchemaObject");function Vu(e){return e.type==="array"}o(Vu,"isArraySchemaObject");function WP(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(Cq(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(xe(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(WP,"inferRequiredSchema");var Cq=o(e=>!xe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var hn=Symbol.for("@ts-pattern/matcher"),Tq=Symbol.for("@ts-pattern/isVariadic"),Hu="@ts-pattern/anonymous-select-key",Sm=o(e=>!!(e&&typeof e=="object"),"r"),Bu=o(e=>e&&!!e[hn],"i"),en=o((e,t,r)=>{if(Bu(e)){let n=e[hn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Sm(e)){if(!Sm(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];Bu(c)&&c[Tq]?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)=>en(l,a[p],r))&&i.every((l,p)=>en(l,c[p],r))&&(s.length===0||en(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>en(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Bu(s=i)&&s[hn]().matcherType==="optional")&&en(i,t[n],r);var s})}return Object.is(t,e)},"s"),Jn=o(e=>{var t,r,n;return Sm(e)?Bu(e)?(t=(r=(n=e[hn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?xa(e,Jn):xa(Object.values(e),Jn):[]},"o"),xa=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function mr(e){return Object.assign(e,{optional:o(()=>Rq(e),"optional"),and:o(t=>He(e,t),"and"),or:o(t=>Nq(e,t),"or"),select:o(t=>t===void 0?KP(e):KP(t,e),"select")})}o(mr,"u");function Rq(e){return mr({[hn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Jn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:en(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Jn(e),"getSelectionKeys"),matcherType:"optional"})})}o(Rq,"h");function He(...e){return mr({[hn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>en(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>xa(e,Jn),"getSelectionKeys"),matcherType:"and"})})}o(He,"m");function Nq(...e){return mr({[hn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return xa(e,Jn).forEach(i=>n(i,void 0)),{matched:e.some(i=>en(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>xa(e,Jn),"getSelectionKeys"),matcherType:"or"})})}o(Nq,"d");function Oe(e){return{[hn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Oe,"p");function KP(...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 mr({[hn]:()=>({match:o(n=>{let i={[t??Hu]:n};return{matched:r===void 0||en(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Hu].concat(r===void 0?[]:Jn(r)),"getSelectionKeys")})})}o(KP,"y");function Jr(e){return typeof e=="number"}o(Jr,"v");function Wn(e){return typeof e=="string"}o(Wn,"b");function Kn(e){return typeof e=="bigint"}o(Kn,"w");var cU=mr(Oe(function(e){return!0}));var Qn=o(e=>Object.assign(mr(e),{startsWith:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(He(e,(r=>Oe(n=>Wn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(He(e,(r=>Oe(n=>Wn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(He(e,(r=>Oe(n=>Wn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&!!n.match(r)))));var r},"regex")}),"j"),uU=Qn(Oe(Wn)),Xr=o(e=>Object.assign(mr(e),{between:o((t,r)=>Xr(He(e,((n,i)=>Oe(s=>Jr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n<r))(t))),"lt"),gt:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n>r))(t))),"gt"),lte:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n<=r))(t))),"lte"),gte:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n>=r))(t))),"gte"),int:o(()=>Xr(He(e,Oe(t=>Jr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Xr(He(e,Oe(t=>Jr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Xr(He(e,Oe(t=>Jr(t)&&t>0))),"positive"),negative:o(()=>Xr(He(e,Oe(t=>Jr(t)&&t<0))),"negative")}),"x"),lU=Xr(Oe(Jr)),Yn=o(e=>Object.assign(mr(e),{between:o((t,r)=>Yn(He(e,((n,i)=>Oe(s=>Kn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n<r))(t))),"lt"),gt:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n>r))(t))),"gt"),lte:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n<=r))(t))),"lte"),gte:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n>=r))(t))),"gte"),positive:o(()=>Yn(He(e,Oe(t=>Kn(t)&&t>0))),"positive"),negative:o(()=>Yn(He(e,Oe(t=>Kn(t)&&t<0))),"negative")}),"A"),fU=Yn(Oe(Kn)),pU=mr(Oe(function(e){return typeof e=="boolean"})),dU=mr(Oe(function(e){return typeof e=="symbol"})),hU=mr(Oe(function(e){return e==null})),mU=mr(Oe(function(e){return e!=null}));var xm=class xm 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(xm,"W");var Om=xm,Pm={matched:!1,value:void 0};function Et(e){return new Em(e,Pm)}o(Et,"z");var Ea=class Ea{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=>en(l,this.input,c))||i&&!i(this.input)?Pm:{matched:!0,value:r(s?Hu in a?a[Hu]:a:this.input,this.input)};return new Ea(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Ea(this.input,n?{matched:!0,value:r(this.input,this.input)}:Pm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Om(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Ea,"I");var Em=Ea;var $m=2,QP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],YP=["query","header","path"],Vi=["get","put","post","delete","options","head","patch","trace"],JP=["string","number","integer","boolean"],$a=["allOf","anyOf","oneOf"];var Le=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),Xn=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),XP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),eE=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),wm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),tE=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),jq=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"),Am=o(e=>{let t=e.map(Le).map(rE).map(r=>Mq(r)).flat();return jq(t)},"getMostCommonAdjacentCombinationSplit"),rE=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),nE=o(e=>rE(e).join(" "),"camelToSpaceSeparated"),Mq=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"),iE=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${Xn(r)}|${Le(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord"),oE=o(e=>e!==void 0,"isString");var aE=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Bi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),es=o(e=>Bi(e).split("/").at(-1),"getSchemaNameByRef");function Cm(e){let t=kq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Cm,"normalizeString");function cE(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(cE,"wrapWithQuotesIfNeeded");function uE(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(uE,"unwrapQuotesIfNeeded");function kq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(kq,"prefixStringStartingWithNumberIfNeeded");function Tm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Tm,"pathParamToVariableName");var Hi=o(e=>JP.includes(e),"isPrimitiveType");function lE(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(lE,"escapeControlCharacters");function tn(e){return e.includes("application/")&&e.includes("json")||QP.includes(e)||e.includes("text/")}o(tn,"isParamMediaTypeAllowed");function Uu(e){return e>=200&&e<300}o(Uu,"isMainResponseStatus");function Gu(e){return!(e>=200&&e<300)}o(Gu,"isErrorStatus");function zu(e){return["application/json","application/pdf"].includes(e)}o(zu,"isMediaTypeAllowed");var sE=/({\w+})/g,qq=/[^\w\-]+/g;function fE(e){e=Le(XP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(sE)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(sE,"")}By${Le(r.slice(1,-1))}`}return e.replace(qq,"_")}o(fE,"pathToVariableName");var Im=/{(\b\w+(?:-\w+)*\b)}/g;function pE(e){let t=e.match(Im);return t===null?e.replaceAll(Im,":$1"):(t.forEach(r=>{let n=Tm(r.replaceAll(Im,":$1"));e=e.replaceAll(r,n)}),e)}o(pE,"replaceHyphenatedPath");var dE=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Ct(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Ui=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function ei(e){return eE(e)}o(ei,"formatTag");function ti(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ei(r??t.defaultTag)}o(ti,"getOperationTag");function hE(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(hE,"isTagExcluded");var Yt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Tt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(xe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if($a.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&&Tt(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&&Tt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Tt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Tt(s,t)}}o(Tt,"iterateSchema");var rn=o((e,t)=>wm(Le(Cm(e)),t),"getZodSchemaName"),wa=o((e,t,r)=>wm(Le(Cm(e)),`${t}${r}`),"getEnumZodSchemaName"),Ft=o(e=>!e.startsWith("z."),"isNamedZodSchema"),mE=o(e=>e.startsWith(ws),"isEnumZodSchema"),Gi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Zu=o(e=>pt(`${e}_${Ky}`),"getBodyZodSchemaName"),gE=o((e,t)=>pt(`${e}_${t}${Qy}`),"getParamZodSchemaName"),Dq=o(e=>pt(`${e}${Yy}`),"getMainResponseZodSchemaName"),Lq=o((e,t)=>pt(`${e}_${t}_${Jy}`),"getErrorResponseZodSchemaName");function Wu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Gi(t,r,n);return!Uu(i)&&e!=="default"&&Gu(i)?Lq(s,e):Dq(s)}o(Wu,"getResponseZodSchemaName");function Aa(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Le(nE(i))}: \`${e[i]}\``],[])}o(Aa,"getSchemaDescriptions");var Ia=o((e,t)=>tE(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),yE=o((e,t)=>Ft(t)?`${e.options.tsNamespaces?`${ze({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),zi=o((e,t,r)=>{if(!Ft(t))return t===$s?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${ze({type:"models",tag:n,options:e.options})}.`:""}${Ia(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function bE(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(bE,"getZodSchemaType");function vE(e){if(e.schemaObj)return[e.schemaObj.description,...Aa(e.schemaObj).join(". ")].filter(Boolean)}o(vE,"getZodSchemaDescription");function _E(e,t,r){var n;if(xe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?zi(e,i,r):void 0}if(Vu(t)){if(!xe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${zi(e,i,r)}[]`:void 0}if($a.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return _E(e,i[0],r)}return t.type}o(_E,"getType");function SE(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,...Aa(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:_E(e,c.schema,r)??"unknown",description:f.join(". ")})}return Tt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(xe(c)){let u=e.resolveObject(c);Tt(u,{data:{pathSegments:[]},onSchema:a})}}),Tt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(SE,"getZodSchemaPropertyDescriptions");function ri({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Rm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Rm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ia(u,e.options),"getEntityName"),options:e.options});return Fq(e.options,a,c)}o(ri,"getModelsImports");function OE({tag:e,endpoints:t,options:r}){return Rm({type:"endpoints",tag:e,entities:t,getTag:o(n=>Ta(n,r),"getTag"),getEntityName:Ca,options:r})}o(OE,"getEndpointsImports");function PE({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:`${Zi(i)}${Ku({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(PE,"getEntityImports");function Zi(e){let t=Of;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Sf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Sf}`,"g"),Of)),`${t}/`.replace(/\/\//g,"/")}o(Zi,"getImportPath");function Rm({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?"./":Zi(s)}${Ku({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Rm,"getImports");function Fq(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:Yt(n.bindings)}))}o(Fq,"mergeImports");function ts({fileName:e,extension:t}){return`${e}.${t}`}o(ts,"getFileNameWithExtension");function EE({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${Xn(t)}/`:""}${Xn(t)}.${i}`:i}o(EE,"getTagFileNameWithoutExtension");function Ku(...e){return EE(...e)}o(Ku,"getTagImportPath");function Qu(...e){return`${EE(...e)}.ts`}o(Qu,"getTagFileName");var ze=o(({type:e,tag:t,options:r})=>`${Le(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function xE(e){return e.standalone?`${Zi(e)}${Oc.fileName}`:e.restClientImportPath}o(xE,"getAppRestClientImportPath");function $E(e){return e.standalone?`${Zi(e)}${Sc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o($E,"getQueryTypesImportPath");function wE(e){return`${Zi(e)}${Pc.fileName}`}o(wE,"getInvalidateQueriesImportPath");function AE(e){return`${Zi(e)}${Ec.fileName}`}o(AE,"getZodExtendedImportPath");function IE(e){return Et(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(IE,"primitiveTypeToTsType");var Ca=o(e=>Xn(pt(e.operationName)),"getEndpointName");function CE(e,t){return`${t.tsNamespaces?`${ze({type:"endpoints",tag:Ta(e,t),options:t})}.`:""}${Ca(e)}`}o(CE,"getImportedEndpointName");var TE=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Ta(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ei(r??t.defaultTag)}o(Ta,"getEndpointTag");function Ra(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(Ft(i.zodSchema))s=zi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Ct(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Hi(p)&&(s=IE(p))}return{name:Zn(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.removePageParam)||i.name!==Oa.pageParamName).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===Oa.pageParamName?"pageParam":i.name}))}o(Ra,"mapEndpointParamsToFunctionParams");function RE(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=ZP(i.name)?i.name:`"${i.name}"`,a=Zn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==vm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==vm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Zn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(RE,"getEndpointConfig");var Nm=["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 Wi(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Wi,"pick");function rs(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ti(e,t),i=hE(n,t);return r||i}o(rs,"isOperationExcluded");function jm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${fE(e)}`,u=r.operationId?Zn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Le(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=iE(u,i);Nm.includes(l)||(u=l)}return Nm.includes(u)?c:u}o(jm,"getOperationName");function Na({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ti(r,n):n.defaultTag,s=o(a=>{let c=jm({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>jm({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??jm({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Na,"getUniqueOperationName");function NE(e,t,r){let n=[];for(let i in e.paths){if(Ui(i,r))continue;let s=e.paths[i],a=Wi(s,Vi);for(let c in a){let u=a[c];if(!u||rs(u,r))continue;let l=Na({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(NE,"getUniqueOperationNamesWithoutSplitByTags");function jE(e,t){let r={};for(let n in e.paths){if(Ui(n,t))continue;let i=e.paths[n],s=Wi(i,Vi);for(let a in s){let c=s[a];if(!c||rs(c,t))continue;let u=t.splitByTags?ti(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(jE,"getOperationsByTag");function ja(e){return{type:"invalid-schema",message:e}}o(ja,"getInvalidSchemaError");function ME(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(ME,"getInvalidOperationIdError");function kE(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(kE,"getMissingPathParameterError");function qE(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(qE,"getNotAllowedInlineEnumError");function DE(e){return{type:"not-allowed-circular-schema",message:e}}o(DE,"getNotAllowedCircularSchemaError");function LE(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${qm(t,r)}`}}o(LE,"getMissingAclConditionPropertyError");function km(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${Mm(e)} in operation ${qm(t,r)}`}}o(km,"getMissingStatusCodeError");function FE(e,t,r){return{type:"invalid-status-code",message:`Operation ${qm(t,r)} expected HTTP status code ${Mm(e.expected)} but received ${Mm(e.received)}`}}o(FE,"getInvalidStatusCodeError");function qm(e,t){return e.operationId??`${t.method} ${t.path}`}o(qm,"getOperationDescriptor");function Mm(e){return`${e} (${HP[e]})`}o(Mm,"getStatusCodeDescription");function VE(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(VE,"groupByType");function nn({schema:e,meta:t,options:r}){let n=[];Et(e.type).with("string",()=>n.push(Hq(e))).with("number","integer",()=>n.push(Gq(e))).with("array",()=>n.push(zq(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
140
+ `);return s!==-1&&(t=sb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Is.prototype,ho);var C6=Is(),T6=Is({level:cb?cb.level:0});var Fr=new Cc;function Cs(e,t,r){console.log(r!==void 0&&r!==t?`${Fr.yellow(`${e}:`.padEnd(20))}${Fr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Cs,"logVariable");function ur(e){console.log(`[INFO] ${e}`)}o(ur,"logInfo");function In(e){console.log(Fr.green(`[SUCCESS] ${e}`))}o(In,"logSuccess");function Ts(e,t){e instanceof Error?(console.log(Fr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Fr.red(`[ERROR] ${e}`))}o(Ts,"logError");function Rc(e){console.log(Fr.bgYellow(`==== ${e} ====`))}o(Rc,"logBanner");var fb=mt(require("fs"));function mo(){return"0.10.4"}o(mo,"getVersion");var U6=mt(db());var Af=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Af,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(Af,s,t)}}}o(Ee,"YargOption");function hb(e){let t=Reflect.getMetadata(Af,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(hb,"getYargsOption");function Nc(e){return async t=>t.options(j$(e)).middleware(async r=>await M$(e,r),!0)}o(Nc,"getBuilder");function j$(e){return Object.entries(hb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(j$,"getYargsOptions");async function M$(e,t){let r=new e;for(let[n,i]of Object.entries(hb(e)))r[n]=t[n]??i.default;return r}o(M$,"loadYargsConfig");var f1=mt(bm());var HP={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"},UP={"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"};var Qt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},GP={bindings:[Qt.query,Qt.infiniteQuery,Qt.mutation,Qt.queryClient],from:"@tanstack/react-query"},Oa={pageParamName:"page"},Lu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Pa="moduleName";var vm={"Content-Type":"application/json",Accept:"application/json"},zP="data",_m="axios",zn="config",Yr="AxiosRequestConfig",Fu={defaultImport:_m,bindings:[Yr],from:"axios"};var ZP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Zn=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 xe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(xe,"isReferenceObject");function Ct(e){return!xe(e)}o(Ct,"isSchemaObject");function Vu(e){return e.type==="array"}o(Vu,"isArraySchemaObject");function WP(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(Cq(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(xe(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(WP,"inferRequiredSchema");var Cq=o(e=>!xe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var hn=Symbol.for("@ts-pattern/matcher"),Tq=Symbol.for("@ts-pattern/isVariadic"),Hu="@ts-pattern/anonymous-select-key",Sm=o(e=>!!(e&&typeof e=="object"),"r"),Bu=o(e=>e&&!!e[hn],"i"),en=o((e,t,r)=>{if(Bu(e)){let n=e[hn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Sm(e)){if(!Sm(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];Bu(c)&&c[Tq]?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)=>en(l,a[p],r))&&i.every((l,p)=>en(l,c[p],r))&&(s.length===0||en(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>en(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Bu(s=i)&&s[hn]().matcherType==="optional")&&en(i,t[n],r);var s})}return Object.is(t,e)},"s"),Jn=o(e=>{var t,r,n;return Sm(e)?Bu(e)?(t=(r=(n=e[hn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?xa(e,Jn):xa(Object.values(e),Jn):[]},"o"),xa=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function mr(e){return Object.assign(e,{optional:o(()=>Rq(e),"optional"),and:o(t=>He(e,t),"and"),or:o(t=>Nq(e,t),"or"),select:o(t=>t===void 0?KP(e):KP(t,e),"select")})}o(mr,"u");function Rq(e){return mr({[hn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Jn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:en(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Jn(e),"getSelectionKeys"),matcherType:"optional"})})}o(Rq,"h");function He(...e){return mr({[hn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>en(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>xa(e,Jn),"getSelectionKeys"),matcherType:"and"})})}o(He,"m");function Nq(...e){return mr({[hn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return xa(e,Jn).forEach(i=>n(i,void 0)),{matched:e.some(i=>en(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>xa(e,Jn),"getSelectionKeys"),matcherType:"or"})})}o(Nq,"d");function Oe(e){return{[hn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Oe,"p");function KP(...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 mr({[hn]:()=>({match:o(n=>{let i={[t??Hu]:n};return{matched:r===void 0||en(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Hu].concat(r===void 0?[]:Jn(r)),"getSelectionKeys")})})}o(KP,"y");function Jr(e){return typeof e=="number"}o(Jr,"v");function Wn(e){return typeof e=="string"}o(Wn,"b");function Kn(e){return typeof e=="bigint"}o(Kn,"w");var cU=mr(Oe(function(e){return!0}));var Qn=o(e=>Object.assign(mr(e),{startsWith:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(He(e,(r=>Oe(n=>Wn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(He(e,(r=>Oe(n=>Wn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(He(e,(r=>Oe(n=>Wn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(He(e,(r=t,Oe(n=>Wn(n)&&!!n.match(r)))));var r},"regex")}),"j"),uU=Qn(Oe(Wn)),Xr=o(e=>Object.assign(mr(e),{between:o((t,r)=>Xr(He(e,((n,i)=>Oe(s=>Jr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n<r))(t))),"lt"),gt:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n>r))(t))),"gt"),lte:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n<=r))(t))),"lte"),gte:o(t=>Xr(He(e,(r=>Oe(n=>Jr(n)&&n>=r))(t))),"gte"),int:o(()=>Xr(He(e,Oe(t=>Jr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Xr(He(e,Oe(t=>Jr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Xr(He(e,Oe(t=>Jr(t)&&t>0))),"positive"),negative:o(()=>Xr(He(e,Oe(t=>Jr(t)&&t<0))),"negative")}),"x"),lU=Xr(Oe(Jr)),Yn=o(e=>Object.assign(mr(e),{between:o((t,r)=>Yn(He(e,((n,i)=>Oe(s=>Kn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n<r))(t))),"lt"),gt:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n>r))(t))),"gt"),lte:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n<=r))(t))),"lte"),gte:o(t=>Yn(He(e,(r=>Oe(n=>Kn(n)&&n>=r))(t))),"gte"),positive:o(()=>Yn(He(e,Oe(t=>Kn(t)&&t>0))),"positive"),negative:o(()=>Yn(He(e,Oe(t=>Kn(t)&&t<0))),"negative")}),"A"),fU=Yn(Oe(Kn)),pU=mr(Oe(function(e){return typeof e=="boolean"})),dU=mr(Oe(function(e){return typeof e=="symbol"})),hU=mr(Oe(function(e){return e==null})),mU=mr(Oe(function(e){return e!=null}));var xm=class xm 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(xm,"W");var Om=xm,Pm={matched:!1,value:void 0};function Et(e){return new Em(e,Pm)}o(Et,"z");var Ea=class Ea{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=>en(l,this.input,c))||i&&!i(this.input)?Pm:{matched:!0,value:r(s?Hu in a?a[Hu]:a:this.input,this.input)};return new Ea(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Ea(this.input,n?{matched:!0,value:r(this.input,this.input)}:Pm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Om(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Ea,"I");var Em=Ea;var $m=2,QP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],YP=["query","header","path"],Vi=["get","put","post","delete","options","head","patch","trace"],JP=["string","number","integer","boolean"],$a=["allOf","anyOf","oneOf"];var Le=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),Xn=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),XP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),eE=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),wm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),tE=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),jq=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"),Am=o(e=>{let t=e.map(Le).map(rE).map(r=>Mq(r)).flat();return jq(t)},"getMostCommonAdjacentCombinationSplit"),rE=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),nE=o(e=>rE(e).join(" "),"camelToSpaceSeparated"),Mq=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"),iE=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${Xn(r)}|${Le(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord"),oE=o(e=>e!==void 0,"isString");var aE=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Bi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),es=o(e=>Bi(e).split("/").at(-1),"getSchemaNameByRef");function Cm(e){let t=kq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Cm,"normalizeString");function cE(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(cE,"wrapWithQuotesIfNeeded");function uE(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(uE,"unwrapQuotesIfNeeded");function kq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(kq,"prefixStringStartingWithNumberIfNeeded");function Tm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Tm,"pathParamToVariableName");var Hi=o(e=>JP.includes(e),"isPrimitiveType");function lE(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(lE,"escapeControlCharacters");function tn(e){return e.includes("application/")&&e.includes("json")||QP.includes(e)||e.includes("text/")}o(tn,"isParamMediaTypeAllowed");function Uu(e){return e>=200&&e<300}o(Uu,"isMainResponseStatus");function Gu(e){return!(e>=200&&e<300)}o(Gu,"isErrorStatus");function zu(e){return e.startsWith("application/")}o(zu,"isMediaTypeAllowed");var sE=/({\w+})/g,qq=/[^\w\-]+/g;function fE(e){e=Le(XP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(sE)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(sE,"")}By${Le(r.slice(1,-1))}`}return e.replace(qq,"_")}o(fE,"pathToVariableName");var Im=/{(\b\w+(?:-\w+)*\b)}/g;function pE(e){let t=e.match(Im);return t===null?e.replaceAll(Im,":$1"):(t.forEach(r=>{let n=Tm(r.replaceAll(Im,":$1"));e=e.replaceAll(r,n)}),e)}o(pE,"replaceHyphenatedPath");var dE=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Ct(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Ui=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function ei(e){return eE(e)}o(ei,"formatTag");function ti(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ei(r??t.defaultTag)}o(ti,"getOperationTag");function hE(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(hE,"isTagExcluded");var Yt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Tt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(xe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if($a.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&&Tt(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&&Tt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Tt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Tt(s,t)}}o(Tt,"iterateSchema");var rn=o((e,t)=>wm(Le(Cm(e)),t),"getZodSchemaName"),wa=o((e,t,r)=>wm(Le(Cm(e)),`${t}${r}`),"getEnumZodSchemaName"),Ft=o(e=>!e.startsWith("z."),"isNamedZodSchema"),mE=o(e=>e.startsWith(ws),"isEnumZodSchema"),Gi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Zu=o(e=>pt(`${e}_${Ky}`),"getBodyZodSchemaName"),gE=o((e,t)=>pt(`${e}_${t}${Qy}`),"getParamZodSchemaName"),Dq=o(e=>pt(`${e}${Yy}`),"getMainResponseZodSchemaName"),Lq=o((e,t)=>pt(`${e}_${t}_${Jy}`),"getErrorResponseZodSchemaName");function Wu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Gi(t,r,n);return!Uu(i)&&e!=="default"&&Gu(i)?Lq(s,e):Dq(s)}o(Wu,"getResponseZodSchemaName");function Aa(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Le(nE(i))}: \`${e[i]}\``],[])}o(Aa,"getSchemaDescriptions");var Ia=o((e,t)=>tE(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),yE=o((e,t)=>Ft(t)?`${e.options.tsNamespaces?`${ze({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),zi=o((e,t,r)=>{if(!Ft(t))return t===$s?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${ze({type:"models",tag:n,options:e.options})}.`:""}${Ia(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function bE(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(bE,"getZodSchemaType");function vE(e){if(e.schemaObj)return[e.schemaObj.description,...Aa(e.schemaObj).join(". ")].filter(Boolean)}o(vE,"getZodSchemaDescription");function _E(e,t,r){var n;if(xe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?zi(e,i,r):void 0}if(Vu(t)){if(!xe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${zi(e,i,r)}[]`:void 0}if($a.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return _E(e,i[0],r)}return t.type}o(_E,"getType");function SE(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,...Aa(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:_E(e,c.schema,r)??"unknown",description:f.join(". ")})}return Tt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(xe(c)){let u=e.resolveObject(c);Tt(u,{data:{pathSegments:[]},onSchema:a})}}),Tt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(SE,"getZodSchemaPropertyDescriptions");function ri({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Rm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Rm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ia(u,e.options),"getEntityName"),options:e.options});return Fq(e.options,a,c)}o(ri,"getModelsImports");function OE({tag:e,endpoints:t,options:r}){return Rm({type:"endpoints",tag:e,entities:t,getTag:o(n=>Ta(n,r),"getTag"),getEntityName:Ca,options:r})}o(OE,"getEndpointsImports");function PE({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:`${Zi(i)}${Ku({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(PE,"getEntityImports");function Zi(e){let t=Of;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Sf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Sf}`,"g"),Of)),`${t}/`.replace(/\/\//g,"/")}o(Zi,"getImportPath");function Rm({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?"./":Zi(s)}${Ku({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Rm,"getImports");function Fq(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:Yt(n.bindings)}))}o(Fq,"mergeImports");function ts({fileName:e,extension:t}){return`${e}.${t}`}o(ts,"getFileNameWithExtension");function EE({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${Xn(t)}/`:""}${Xn(t)}.${i}`:i}o(EE,"getTagFileNameWithoutExtension");function Ku(...e){return EE(...e)}o(Ku,"getTagImportPath");function Qu(...e){return`${EE(...e)}.ts`}o(Qu,"getTagFileName");var ze=o(({type:e,tag:t,options:r})=>`${Le(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function xE(e){return e.standalone?`${Zi(e)}${Oc.fileName}`:e.restClientImportPath}o(xE,"getAppRestClientImportPath");function $E(e){return e.standalone?`${Zi(e)}${Sc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o($E,"getQueryTypesImportPath");function wE(e){return`${Zi(e)}${Pc.fileName}`}o(wE,"getInvalidateQueriesImportPath");function AE(e){return`${Zi(e)}${Ec.fileName}`}o(AE,"getZodExtendedImportPath");function IE(e){return Et(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(IE,"primitiveTypeToTsType");var Ca=o(e=>Xn(pt(e.operationName)),"getEndpointName");function CE(e,t){return`${t.tsNamespaces?`${ze({type:"endpoints",tag:Ta(e,t),options:t})}.`:""}${Ca(e)}`}o(CE,"getImportedEndpointName");var TE=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Ta(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ei(r??t.defaultTag)}o(Ta,"getEndpointTag");function Ra(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(Ft(i.zodSchema))s=zi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Ct(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Hi(p)&&(s=IE(p))}return{name:Zn(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.removePageParam)||i.name!==Oa.pageParamName).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===Oa.pageParamName?"pageParam":i.name}))}o(Ra,"mapEndpointParamsToFunctionParams");function RE(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=ZP(i.name)?i.name:`"${i.name}"`,a=Zn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==vm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==vm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Zn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(RE,"getEndpointConfig");var Nm=["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 Wi(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Wi,"pick");function rs(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ti(e,t),i=hE(n,t);return r||i}o(rs,"isOperationExcluded");function jm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${fE(e)}`,u=r.operationId?Zn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Le(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=iE(u,i);Nm.includes(l)||(u=l)}return Nm.includes(u)?c:u}o(jm,"getOperationName");function Na({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ti(r,n):n.defaultTag,s=o(a=>{let c=jm({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>jm({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??jm({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Na,"getUniqueOperationName");function NE(e,t,r){let n=[];for(let i in e.paths){if(Ui(i,r))continue;let s=e.paths[i],a=Wi(s,Vi);for(let c in a){let u=a[c];if(!u||rs(u,r))continue;let l=Na({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(NE,"getUniqueOperationNamesWithoutSplitByTags");function jE(e,t){let r={};for(let n in e.paths){if(Ui(n,t))continue;let i=e.paths[n],s=Wi(i,Vi);for(let a in s){let c=s[a];if(!c||rs(c,t))continue;let u=t.splitByTags?ti(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(jE,"getOperationsByTag");function ja(e){return{type:"invalid-schema",message:e}}o(ja,"getInvalidSchemaError");function ME(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(ME,"getInvalidOperationIdError");function kE(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(kE,"getMissingPathParameterError");function qE(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(qE,"getNotAllowedInlineEnumError");function DE(e){return{type:"not-allowed-circular-schema",message:e}}o(DE,"getNotAllowedCircularSchemaError");function LE(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${qm(t,r)}`}}o(LE,"getMissingAclConditionPropertyError");function km(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${Mm(e)} in operation ${qm(t,r)}`}}o(km,"getMissingStatusCodeError");function FE(e,t,r){return{type:"invalid-status-code",message:`Operation ${qm(t,r)} expected HTTP status code ${Mm(e.expected)} but received ${Mm(e.received)}`}}o(FE,"getInvalidStatusCodeError");function qm(e,t){return e.operationId??`${t.method} ${t.path}`}o(qm,"getOperationDescriptor");function Mm(e){return`${e} (${HP[e]})`}o(Mm,"getStatusCodeDescription");function VE(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(VE,"groupByType");function nn({schema:e,meta:t,options:r}){let n=[];Et(e.type).with("string",()=>n.push(Hq(e))).with("number","integer",()=>n.push(Gq(e))).with("array",()=>n.push(zq(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(Vq({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?Bq(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(nn,"getZodChain");function Vq({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(Vq,"getZodChainablePresence");function Bq(e){return e.default!==void 0?`default(${Et(e.type).with("number","integer",()=>uE(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(Bq,"getZodChainableDefault");function Hq(e){let t=[];if(e.enum||(e.minLength!==void 0&&t.push(`min(${e.minLength})`),e.maxLength!==void 0&&t.push(`max(${e.maxLength})`)),e.pattern&&t.push(`regex(${Uq(e.pattern)})`),e.format){let r=Et(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(Hq,"getZodChainableStringValidations");function Uq(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=lE(e),`/${e}/`}o(Uq,"formatPatternIfNeeded");function Gq(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(Gq,"getZodChainableNumberValidations");function zq(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(zq,"getZodChainableArrayValidations");var Ki=o(e=>e.reduce((t,r)=>t+r,0),"sum");function dt(e,t){if(!t)return e;if(xe(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Jt("oneOf")+dt(e,{...t,type:t.type[0]}):e+Jt("oneOf")+Ki(t.type.map(r=>dt(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Jt("oneOf")+dt(e,t.oneOf[0]):e+Jt("oneOf")+Ki(t.oneOf.map(r=>dt(0,r)));if(t.anyOf)return t.anyOf.length===1?Jt("anyOf")+dt(e,t.anyOf[0]):e+Jt("anyOf")+Ki(t.anyOf.map(r=>dt(0,r)));if(t.allOf)return t.allOf.length===1?Jt("allOf")+dt(e,t.allOf[0]):e+Jt("allOf")+Ki(t.allOf.map(r=>dt(0,r)));if(!t.type)return e;if(Hi(t.type))return t.enum?e+BE(t)+Jt("enum")+Ki(t.enum.map(r=>dt(0,r))):e+BE(t);if(t.type==="array")return t.items?Jt("array")+dt(e,t.items):Jt("array")+dt(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Jt("object")+Ki(r.map(n=>dt(0,n)))}else e+=Jt("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=dt(0,t.additionalProperties):e+=dt(1))}return e}o(dt,"getOpenAPISchemaComplexity");function BE(e){return Et(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(BE,"complexityByType");function Jt(e){return Et(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Jt,"complexityByComposite");var Dm=class Dm{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;xe(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(Dm,"ZodSchema");var Ma=Dm;function Ye({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new Ma(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(xe(e))return Zq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=Kq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=Wq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=Qq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=Yq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=Jq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Vu(e))return e.items?i.assign(`z.array(${Ye({...a,schema:e.items}).getCodeString(n,t.options)}${nn({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),E="{}";e.properties&&(E="{ "+Object.entries(e.properties).map(([ae,J])=>{var M;let Ue={...s,isRequired:g?!0:b?(M=e.required)==null?void 0:M.includes(ae):t.options.withImplicitRequiredProps,name:ae,isParentPartial:g},we=J;if(xe(J)&&t&&(we=t.getSchemaByRef(J.$ref),!we))throw new Error(`Schema ${J.$ref} not found`);let X=Ye({...a,schema:J,meta:Ue}).getCodeString(n,t.options)+nn({schema:we,meta:Ue,options:t.options});return[ae,X]}).map(([ae,J])=>`${cE(ae)}: ${J}`).join(", ")+" }");let $="";e.additionalProperties&&($=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Ye({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+nn({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let T=g?".partial()":"",I=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${E})${T}${I}${$}${d}`)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(Ye,"getZodSchema");function Zq({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!xe(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=Ye({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(Zq,"getReferenceZodSchema");function Wq({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Ct(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Ye({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=>Ct(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=>Ye({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.10.3",
3
+ "version": "0.10.4",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"