@openapi-studio/core 0.3.0 → 0.3.1

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.
@@ -1,4 +1,4 @@
1
- import{_ as aN}from"./app-B61Pkts6.js";function Ng(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vj={},mj;function lN(){return mj||(mj=1,(function(t){(function(e){function n(E){return E!==null?Object.prototype.toString.call(E)==="[object Array]":!1}function r(E){return E!==null?Object.prototype.toString.call(E)==="[object Object]":!1}function o(E,D){if(E===D)return!0;var F=Object.prototype.toString.call(E);if(F!==Object.prototype.toString.call(D))return!1;if(n(E)===!0){if(E.length!==D.length)return!1;for(var ee=0;ee<E.length;ee++)if(o(E[ee],D[ee])===!1)return!1;return!0}if(r(E)===!0){var xe={};for(var Ne in E)if(hasOwnProperty.call(E,Ne)){if(o(E[Ne],D[Ne])===!1)return!1;xe[Ne]=!0}for(var Be in D)if(hasOwnProperty.call(D,Be)&&xe[Be]!==!0)return!1;return!0}return!1}function i(E){if(E===""||E===!1||E===null||n(E)&&E.length===0)return!0;if(r(E)){for(var D in E)if(E.hasOwnProperty(D))return!1;return!0}else return!1}function s(E){for(var D=Object.keys(E),F=[],ee=0;ee<D.length;ee++)F.push(E[D[ee]]);return F}var a;typeof String.prototype.trimLeft=="function"?a=function(E){return E.trimLeft()}:a=function(E){return E.match(/^\s*(.*)/)[1]};var l=0,u=1,h=2,d=3,f=4,p=5,v=6,g=7,m=8,b=9,y={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},w="EOF",j="UnquotedIdentifier",x="QuotedIdentifier",k="Rbracket",$="Rparen",T="Comma",M="Colon",z="Rbrace",V="Number",I="Current",J="Expref",he="Pipe",re="Or",Se="And",de="EQ",we="GT",ie="LT",X="GTE",W="LTE",ce="NE",N="Flatten",_="Star",P="Filter",oe="Dot",Ae="Not",ae="Lbrace",Y="Lbracket",ye="Lparen",A="Literal",q={".":oe,"*":_,",":T,":":M,"{":ae,"}":z,"]":k,"(":ye,")":$,"@":I},U={"<":!0,">":!0,"=":!0,"!":!0},fe={" ":!0," ":!0,"\n":!0};function Z(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E==="_"}function H(E){return E>="0"&&E<="9"||E==="-"}function at(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E>="0"&&E<="9"||E==="_"}function ct(){}ct.prototype={tokenize:function(E){var D=[];this._current=0;for(var F,ee,xe;this._current<E.length;)if(Z(E[this._current]))F=this._current,ee=this._consumeUnquotedIdentifier(E),D.push({type:j,value:ee,start:F});else if(q[E[this._current]]!==void 0)D.push({type:q[E[this._current]],value:E[this._current],start:this._current}),this._current++;else if(H(E[this._current]))xe=this._consumeNumber(E),D.push(xe);else if(E[this._current]==="[")xe=this._consumeLBracket(E),D.push(xe);else if(E[this._current]==='"')F=this._current,ee=this._consumeQuotedIdentifier(E),D.push({type:x,value:ee,start:F});else if(E[this._current]==="'")F=this._current,ee=this._consumeRawStringLiteral(E),D.push({type:A,value:ee,start:F});else if(E[this._current]==="`"){F=this._current;var Ne=this._consumeLiteral(E);D.push({type:A,value:Ne,start:F})}else if(U[E[this._current]]!==void 0)D.push(this._consumeOperator(E));else if(fe[E[this._current]]!==void 0)this._current++;else if(E[this._current]==="&")F=this._current,this._current++,E[this._current]==="&"?(this._current++,D.push({type:Se,value:"&&",start:F})):D.push({type:J,value:"&",start:F});else if(E[this._current]==="|")F=this._current,this._current++,E[this._current]==="|"?(this._current++,D.push({type:re,value:"||",start:F})):D.push({type:he,value:"|",start:F});else{var Be=new Error("Unknown character:"+E[this._current]);throw Be.name="LexerError",Be}return D},_consumeUnquotedIdentifier:function(E){var D=this._current;for(this._current++;this._current<E.length&&at(E[this._current]);)this._current++;return E.slice(D,this._current)},_consumeQuotedIdentifier:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=='"'&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==='"')?ee+=2:ee++,this._current=ee}return this._current++,JSON.parse(E.slice(D,this._current))},_consumeRawStringLiteral:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=="'"&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==="'")?ee+=2:ee++,this._current=ee}this._current++;var xe=E.slice(D+1,this._current-1);return xe.replace("\\'","'")},_consumeNumber:function(E){var D=this._current;this._current++;for(var F=E.length;H(E[this._current])&&this._current<F;)this._current++;var ee=parseInt(E.slice(D,this._current));return{type:V,value:ee,start:D}},_consumeLBracket:function(E){var D=this._current;return this._current++,E[this._current]==="?"?(this._current++,{type:P,value:"[?",start:D}):E[this._current]==="]"?(this._current++,{type:N,value:"[]",start:D}):{type:Y,value:"[",start:D}},_consumeOperator:function(E){var D=this._current,F=E[D];if(this._current++,F==="!")return E[this._current]==="="?(this._current++,{type:ce,value:"!=",start:D}):{type:Ae,value:"!",start:D};if(F==="<")return E[this._current]==="="?(this._current++,{type:W,value:"<=",start:D}):{type:ie,value:"<",start:D};if(F===">")return E[this._current]==="="?(this._current++,{type:X,value:">=",start:D}):{type:we,value:">",start:D};if(F==="="&&E[this._current]==="=")return this._current++,{type:de,value:"==",start:D}},_consumeLiteral:function(E){this._current++;for(var D=this._current,F=E.length,ee;E[this._current]!=="`"&&this._current<F;){var xe=this._current;E[xe]==="\\"&&(E[xe+1]==="\\"||E[xe+1]==="`")?xe+=2:xe++,this._current=xe}var Ne=a(E.slice(D,this._current));return Ne=Ne.replace("\\`","`"),this._looksLikeJSON(Ne)?ee=JSON.parse(Ne):ee=JSON.parse('"'+Ne+'"'),this._current++,ee},_looksLikeJSON:function(E){var D='[{"',F=["true","false","null"],ee="-0123456789";if(E==="")return!1;if(D.indexOf(E[0])>=0||F.indexOf(E)>=0)return!0;if(ee.indexOf(E[0])>=0)try{return JSON.parse(E),!0}catch{return!1}else return!1}};var Ee={};Ee[w]=0,Ee[j]=0,Ee[x]=0,Ee[k]=0,Ee[$]=0,Ee[T]=0,Ee[z]=0,Ee[V]=0,Ee[I]=0,Ee[J]=0,Ee[he]=1,Ee[re]=2,Ee[Se]=3,Ee[de]=5,Ee[we]=5,Ee[ie]=5,Ee[X]=5,Ee[W]=5,Ee[ce]=5,Ee[N]=9,Ee[_]=20,Ee[P]=21,Ee[oe]=40,Ee[Ae]=45,Ee[ae]=50,Ee[Y]=55,Ee[ye]=60;function pt(){}pt.prototype={parse:function(E){this._loadTokens(E),this.index=0;var D=this.expression(0);if(this._lookahead(0)!==w){var F=this._lookaheadToken(0),ee=new Error("Unexpected token type: "+F.type+", value: "+F.value);throw ee.name="ParserError",ee}return D},_loadTokens:function(E){var D=new ct,F=D.tokenize(E);F.push({type:w,value:"",start:E.length}),this.tokens=F},expression:function(E){var D=this._lookaheadToken(0);this._advance();for(var F=this.nud(D),ee=this._lookahead(0);E<Ee[ee];)this._advance(),F=this.led(ee,F),ee=this._lookahead(0);return F},_lookahead:function(E){return this.tokens[this.index+E].type},_lookaheadToken:function(E){return this.tokens[this.index+E]},_advance:function(){this.index++},nud:function(E){var D,F,ee;switch(E.type){case A:return{type:"Literal",value:E.value};case j:return{type:"Field",name:E.value};case x:var xe={type:"Field",name:E.value};if(this._lookahead(0)===ye)throw new Error("Quoted identifier not allowed for function names.");return xe;case Ae:return F=this.expression(Ee.Not),{type:"NotExpression",children:[F]};case _:return D={type:"Identity"},F=null,this._lookahead(0)===k?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Star),{type:"ValueProjection",children:[D,F]};case P:return this.led(E.type,{type:"Identity"});case ae:return this._parseMultiselectHash();case N:return D={type:N,children:[{type:"Identity"}]},F=this._parseProjectionRHS(Ee.Flatten),{type:"Projection",children:[D,F]};case Y:return this._lookahead(0)===V||this._lookahead(0)===M?(F=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},F)):this._lookahead(0)===_&&this._lookahead(1)===k?(this._advance(),this._advance(),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[{type:"Identity"},F]}):this._parseMultiselectList();case I:return{type:I};case J:return ee=this.expression(Ee.Expref),{type:"ExpressionReference",children:[ee]};case ye:for(var Ne=[];this._lookahead(0)!==$;)this._lookahead(0)===I?(ee={type:I},this._advance()):ee=this.expression(0),Ne.push(ee);return this._match($),Ne[0];default:this._errorToken(E)}},led:function(E,D){var F;switch(E){case oe:var ee=Ee.Dot;return this._lookahead(0)!==_?(F=this._parseDotRHS(ee),{type:"Subexpression",children:[D,F]}):(this._advance(),F=this._parseProjectionRHS(ee),{type:"ValueProjection",children:[D,F]});case he:return F=this.expression(Ee.Pipe),{type:he,children:[D,F]};case re:return F=this.expression(Ee.Or),{type:"OrExpression",children:[D,F]};case Se:return F=this.expression(Ee.And),{type:"AndExpression",children:[D,F]};case ye:for(var xe=D.name,Ne=[],Be,ge;this._lookahead(0)!==$;)this._lookahead(0)===I?(Be={type:I},this._advance()):Be=this.expression(0),this._lookahead(0)===T&&this._match(T),Ne.push(Be);return this._match($),ge={type:"Function",name:xe,children:Ne},ge;case P:var je=this.expression(0);return this._match(k),this._lookahead(0)===N?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Filter),{type:"FilterProjection",children:[D,F,je]};case N:var wt={type:N,children:[D]},ut=this._parseProjectionRHS(Ee.Flatten);return{type:"Projection",children:[wt,ut]};case de:case ce:case we:case X:case ie:case W:return this._parseComparator(D,E);case Y:var Ye=this._lookaheadToken(0);return Ye.type===V||Ye.type===M?(F=this._parseIndexExpression(),this._projectIfSlice(D,F)):(this._match(_),this._match(k),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[D,F]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(E){if(this._lookahead(0)===E)this._advance();else{var D=this._lookaheadToken(0),F=new Error("Expected "+E+", got: "+D.type);throw F.name="ParserError",F}},_errorToken:function(E){var D=new Error("Invalid token ("+E.type+'): "'+E.value+'"');throw D.name="ParserError",D},_parseIndexExpression:function(){if(this._lookahead(0)===M||this._lookahead(1)===M)return this._parseSliceExpression();var E={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(k),E},_projectIfSlice:function(E,D){var F={type:"IndexExpression",children:[E,D]};return D.type==="Slice"?{type:"Projection",children:[F,this._parseProjectionRHS(Ee.Star)]}:F},_parseSliceExpression:function(){for(var E=[null,null,null],D=0,F=this._lookahead(0);F!==k&&D<3;){if(F===M)D++,this._advance();else if(F===V)E[D]=this._lookaheadToken(0).value,this._advance();else{var ee=this._lookahead(0),xe=new Error("Syntax error, unexpected token: "+ee.value+"("+ee.type+")");throw xe.name="Parsererror",xe}F=this._lookahead(0)}return this._match(k),{type:"Slice",children:E}},_parseComparator:function(E,D){var F=this.expression(Ee[D]);return{type:"Comparator",name:D,children:[E,F]}},_parseDotRHS:function(E){var D=this._lookahead(0),F=[j,x,_];if(F.indexOf(D)>=0)return this.expression(E);if(D===Y)return this._match(Y),this._parseMultiselectList();if(D===ae)return this._match(ae),this._parseMultiselectHash()},_parseProjectionRHS:function(E){var D;if(Ee[this._lookahead(0)]<10)D={type:"Identity"};else if(this._lookahead(0)===Y)D=this.expression(E);else if(this._lookahead(0)===P)D=this.expression(E);else if(this._lookahead(0)===oe)this._match(oe),D=this._parseDotRHS(E);else{var F=this._lookaheadToken(0),ee=new Error("Sytanx error, unexpected token: "+F.value+"("+F.type+")");throw ee.name="ParserError",ee}return D},_parseMultiselectList:function(){for(var E=[];this._lookahead(0)!==k;){var D=this.expression(0);if(E.push(D),this._lookahead(0)===T&&(this._match(T),this._lookahead(0)===k))throw new Error("Unexpected token Rbracket")}return this._match(k),{type:"MultiSelectList",children:E}},_parseMultiselectHash:function(){for(var E=[],D=[j,x],F,ee,xe,Ne;;){if(F=this._lookaheadToken(0),D.indexOf(F.type)<0)throw new Error("Expecting an identifier token, got: "+F.type);if(ee=F.value,this._advance(),this._match(M),xe=this.expression(0),Ne={type:"KeyValuePair",name:ee,value:xe},E.push(Ne),this._lookahead(0)===T)this._match(T);else if(this._lookahead(0)===z){this._match(z);break}}return{type:"MultiSelectHash",children:E}}};function Le(E){this.runtime=E}Le.prototype={search:function(E,D){return this.visit(E,D)},visit:function(E,D){var F,ee,xe,Ne,Be,ge,je,wt,ut,Ye;switch(E.type){case"Field":return D!==null&&r(D)?(ge=D[E.name],ge===void 0?null:ge):null;case"Subexpression":for(xe=this.visit(E.children[0],D),Ye=1;Ye<E.children.length;Ye++)if(xe=this.visit(E.children[1],xe),xe===null)return null;return xe;case"IndexExpression":return je=this.visit(E.children[0],D),wt=this.visit(E.children[1],je),wt;case"Index":if(!n(D))return null;var Xe=E.value;return Xe<0&&(Xe=D.length+Xe),xe=D[Xe],xe===void 0&&(xe=null),xe;case"Slice":if(!n(D))return null;var Jt=E.children.slice(0),Un=this.computeSliceParams(D.length,Jt),Jn=Un[0],Kt=Un[1],Nn=Un[2];if(xe=[],Nn>0)for(Ye=Jn;Ye<Kt;Ye+=Nn)xe.push(D[Ye]);else for(Ye=Jn;Ye>Kt;Ye+=Nn)xe.push(D[Ye]);return xe;case"Projection":var rn=this.visit(E.children[0],D);if(!n(rn))return null;for(ut=[],Ye=0;Ye<rn.length;Ye++)ee=this.visit(E.children[1],rn[Ye]),ee!==null&&ut.push(ee);return ut;case"ValueProjection":if(rn=this.visit(E.children[0],D),!r(rn))return null;ut=[];var ln=s(rn);for(Ye=0;Ye<ln.length;Ye++)ee=this.visit(E.children[1],ln[Ye]),ee!==null&&ut.push(ee);return ut;case"FilterProjection":if(rn=this.visit(E.children[0],D),!n(rn))return null;var Sn=[],St=[];for(Ye=0;Ye<rn.length;Ye++)F=this.visit(E.children[2],rn[Ye]),i(F)||Sn.push(rn[Ye]);for(var Mn=0;Mn<Sn.length;Mn++)ee=this.visit(E.children[1],Sn[Mn]),ee!==null&&St.push(ee);return St;case"Comparator":switch(Ne=this.visit(E.children[0],D),Be=this.visit(E.children[1],D),E.name){case de:xe=o(Ne,Be);break;case ce:xe=!o(Ne,Be);break;case we:xe=Ne>Be;break;case X:xe=Ne>=Be;break;case ie:xe=Ne<Be;break;case W:xe=Ne<=Be;break;default:throw new Error("Unknown comparator: "+E.name)}return xe;case N:var Dt=this.visit(E.children[0],D);if(!n(Dt))return null;var nt=[];for(Ye=0;Ye<Dt.length;Ye++)ee=Dt[Ye],n(ee)?nt.push.apply(nt,ee):nt.push(ee);return nt;case"Identity":return D;case"MultiSelectList":if(D===null)return null;for(ut=[],Ye=0;Ye<E.children.length;Ye++)ut.push(this.visit(E.children[Ye],D));return ut;case"MultiSelectHash":if(D===null)return null;ut={};var cn;for(Ye=0;Ye<E.children.length;Ye++)cn=E.children[Ye],ut[cn.name]=this.visit(cn.value,D);return ut;case"OrExpression":return F=this.visit(E.children[0],D),i(F)&&(F=this.visit(E.children[1],D)),F;case"AndExpression":return Ne=this.visit(E.children[0],D),i(Ne)===!0?Ne:this.visit(E.children[1],D);case"NotExpression":return Ne=this.visit(E.children[0],D),i(Ne);case"Literal":return E.value;case he:return je=this.visit(E.children[0],D),this.visit(E.children[1],je);case I:return D;case"Function":var Gt=[];for(Ye=0;Ye<E.children.length;Ye++)Gt.push(this.visit(E.children[Ye],D));return this.runtime.callFunction(E.name,Gt);case"ExpressionReference":var ir=E.children[0];return ir.jmespathType=J,ir;default:throw new Error("Unknown node type: "+E.type)}},computeSliceParams:function(E,D){var F=D[0],ee=D[1],xe=D[2],Ne=[null,null,null];if(xe===null)xe=1;else if(xe===0){var Be=new Error("Invalid slice, step cannot be 0");throw Be.name="RuntimeError",Be}var ge=xe<0;return F===null?F=ge?E-1:0:F=this.capSliceRange(E,F,xe),ee===null?ee=ge?-1:E:ee=this.capSliceRange(E,ee,xe),Ne[0]=F,Ne[1]=ee,Ne[2]=xe,Ne},capSliceRange:function(E,D,F){return D<0?(D+=E,D<0&&(D=F<0?-1:0)):D>=E&&(D=F<0?E-1:E),D}};function Ke(E){this._interpreter=E,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[m]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[h,d]},{types:[u]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[h]},{types:[h]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[h,d,f]}]},map:{_func:this._functionMap,_signature:[{types:[v]},{types:[d]}]},max:{_func:this._functionMax,_signature:[{types:[m,b]}]},merge:{_func:this._functionMerge,_signature:[{types:[f],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[d]},{types:[v]}]},sum:{_func:this._functionSum,_signature:[{types:[m]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[h]},{types:[h]}]},min:{_func:this._functionMin,_signature:[{types:[m,b]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[d]},{types:[v]}]},type:{_func:this._functionType,_signature:[{types:[u]}]},keys:{_func:this._functionKeys,_signature:[{types:[f]}]},values:{_func:this._functionValues,_signature:[{types:[f]}]},sort:{_func:this._functionSort,_signature:[{types:[b,m]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[d]},{types:[v]}]},join:{_func:this._functionJoin,_signature:[{types:[h]},{types:[b]}]},reverse:{_func:this._functionReverse,_signature:[{types:[h,d]}]},to_array:{_func:this._functionToArray,_signature:[{types:[u]}]},to_string:{_func:this._functionToString,_signature:[{types:[u]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[u]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[u],variadic:!0}]}}}Ke.prototype={callFunction:function(E,D){var F=this.functionTable[E];if(F===void 0)throw new Error("Unknown function: "+E+"()");return this._validateArgs(E,D,F._signature),F._func.call(this,D)},_validateArgs:function(E,D,F){var ee;if(F[F.length-1].variadic){if(D.length<F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes at least"+F.length+ee+" but received "+D.length)}else if(D.length!==F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes "+F.length+ee+" but received "+D.length);for(var xe,Ne,Be,ge=0;ge<F.length;ge++){Be=!1,xe=F[ge].types,Ne=this._getTypeName(D[ge]);for(var je=0;je<xe.length;je++)if(this._typeMatches(Ne,xe[je],D[ge])){Be=!0;break}if(!Be){var wt=xe.map(function(ut){return y[ut]}).join(",");throw new Error("TypeError: "+E+"() expected argument "+(ge+1)+" to be type "+wt+" but received type "+y[Ne]+" instead.")}}},_typeMatches:function(E,D,F){if(D===u)return!0;if(D===b||D===m||D===d){if(D===d)return E===d;if(E===d){var ee;D===m?ee=l:D===b&&(ee=h);for(var xe=0;xe<F.length;xe++)if(!this._typeMatches(this._getTypeName(F[xe]),ee,F[xe]))return!1;return!0}}else return E===D},_getTypeName:function(E){switch(Object.prototype.toString.call(E)){case"[object String]":return h;case"[object Number]":return l;case"[object Array]":return d;case"[object Boolean]":return p;case"[object Null]":return g;case"[object Object]":return E.jmespathType===J?v:f}},_functionStartsWith:function(E){return E[0].lastIndexOf(E[1])===0},_functionEndsWith:function(E){var D=E[0],F=E[1];return D.indexOf(F,D.length-F.length)!==-1},_functionReverse:function(E){var D=this._getTypeName(E[0]);if(D===h){for(var F=E[0],ee="",xe=F.length-1;xe>=0;xe--)ee+=F[xe];return ee}else{var Ne=E[0].slice(0);return Ne.reverse(),Ne}},_functionAbs:function(E){return Math.abs(E[0])},_functionCeil:function(E){return Math.ceil(E[0])},_functionAvg:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D/F.length},_functionContains:function(E){return E[0].indexOf(E[1])>=0},_functionFloor:function(E){return Math.floor(E[0])},_functionLength:function(E){return r(E[0])?Object.keys(E[0]).length:E[0].length},_functionMap:function(E){for(var D=[],F=this._interpreter,ee=E[0],xe=E[1],Ne=0;Ne<xe.length;Ne++)D.push(F.visit(ee,xe[Ne]));return D},_functionMerge:function(E){for(var D={},F=0;F<E.length;F++){var ee=E[F];for(var xe in ee)D[xe]=ee[xe]}return D},_functionMax:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.max.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)ee.localeCompare(F[xe])<0&&(ee=F[xe]);return ee}else return null},_functionMin:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.min.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)F[xe].localeCompare(ee)<0&&(ee=F[xe]);return ee}else return null},_functionSum:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D},_functionType:function(E){switch(this._getTypeName(E[0])){case l:return"number";case h:return"string";case d:return"array";case f:return"object";case p:return"boolean";case v:return"expref";case g:return"null"}},_functionKeys:function(E){return Object.keys(E[0])},_functionValues:function(E){for(var D=E[0],F=Object.keys(D),ee=[],xe=0;xe<F.length;xe++)ee.push(D[F[xe]]);return ee},_functionJoin:function(E){var D=E[0],F=E[1];return F.join(D)},_functionToArray:function(E){return this._getTypeName(E[0])===d?E[0]:[E[0]]},_functionToString:function(E){return this._getTypeName(E[0])===h?E[0]:JSON.stringify(E[0])},_functionToNumber:function(E){var D=this._getTypeName(E[0]),F;return D===l?E[0]:D===h&&(F=+E[0],!isNaN(F))?F:null},_functionNotNull:function(E){for(var D=0;D<E.length;D++)if(this._getTypeName(E[D])!==g)return E[D];return null},_functionSort:function(E){var D=E[0].slice(0);return D.sort(),D},_functionSortBy:function(E){var D=E[0].slice(0);if(D.length===0)return D;var F=this._interpreter,ee=E[1],xe=this._getTypeName(F.visit(ee,D[0]));if([l,h].indexOf(xe)<0)throw new Error("TypeError");for(var Ne=this,Be=[],ge=0;ge<D.length;ge++)Be.push([ge,D[ge]]);Be.sort(function(wt,ut){var Ye=F.visit(ee,wt[1]),Xe=F.visit(ee,ut[1]);if(Ne._getTypeName(Ye)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Ye));if(Ne._getTypeName(Xe)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Xe));return Ye>Xe?1:Ye<Xe?-1:wt[0]-ut[0]});for(var je=0;je<Be.length;je++)D[je]=Be[je][1];return D},_functionMaxBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=-1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be>xe&&(xe=Be,Ne=F[ge]);return Ne},_functionMinBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be<xe&&(xe=Be,Ne=F[ge]);return Ne},createKeyFunction:function(E,D){var F=this,ee=this._interpreter,xe=function(Ne){var Be=ee.visit(E,Ne);if(D.indexOf(F._getTypeName(Be))<0){var ge="TypeError: expected one of "+D+", received "+F._getTypeName(Be);throw new Error(ge)}return Be};return xe}};function ft(E){var D=new pt,F=D.parse(E);return F}function We(E){var D=new ct;return D.tokenize(E)}function Nt(E,D){var F=new pt,ee=new Ke,xe=new Le(ee);ee._interpreter=xe;var Ne=F.parse(D);return xe.search(Ne,E)}e.tokenize=We,e.compile=ft,e.search=Nt,e.strictDeepEqual=o})(t)})(vj)),vj}var cN=lN();const uN=Ng(cN);var Tp={},gj;function hN(){if(gj)return Tp;gj=1;var t={b:"\b",f:"\f",n:`
1
+ import{_ as aN}from"./app-DBSHy7TS.js";function Ng(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vj={},mj;function lN(){return mj||(mj=1,(function(t){(function(e){function n(E){return E!==null?Object.prototype.toString.call(E)==="[object Array]":!1}function r(E){return E!==null?Object.prototype.toString.call(E)==="[object Object]":!1}function o(E,D){if(E===D)return!0;var F=Object.prototype.toString.call(E);if(F!==Object.prototype.toString.call(D))return!1;if(n(E)===!0){if(E.length!==D.length)return!1;for(var ee=0;ee<E.length;ee++)if(o(E[ee],D[ee])===!1)return!1;return!0}if(r(E)===!0){var xe={};for(var Ne in E)if(hasOwnProperty.call(E,Ne)){if(o(E[Ne],D[Ne])===!1)return!1;xe[Ne]=!0}for(var Be in D)if(hasOwnProperty.call(D,Be)&&xe[Be]!==!0)return!1;return!0}return!1}function i(E){if(E===""||E===!1||E===null||n(E)&&E.length===0)return!0;if(r(E)){for(var D in E)if(E.hasOwnProperty(D))return!1;return!0}else return!1}function s(E){for(var D=Object.keys(E),F=[],ee=0;ee<D.length;ee++)F.push(E[D[ee]]);return F}var a;typeof String.prototype.trimLeft=="function"?a=function(E){return E.trimLeft()}:a=function(E){return E.match(/^\s*(.*)/)[1]};var l=0,u=1,h=2,d=3,f=4,p=5,v=6,g=7,m=8,b=9,y={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},w="EOF",j="UnquotedIdentifier",x="QuotedIdentifier",k="Rbracket",$="Rparen",T="Comma",M="Colon",z="Rbrace",V="Number",I="Current",J="Expref",he="Pipe",re="Or",Se="And",de="EQ",we="GT",ie="LT",X="GTE",W="LTE",ce="NE",N="Flatten",_="Star",P="Filter",oe="Dot",Ae="Not",ae="Lbrace",Y="Lbracket",ye="Lparen",A="Literal",q={".":oe,"*":_,",":T,":":M,"{":ae,"}":z,"]":k,"(":ye,")":$,"@":I},U={"<":!0,">":!0,"=":!0,"!":!0},fe={" ":!0," ":!0,"\n":!0};function Z(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E==="_"}function H(E){return E>="0"&&E<="9"||E==="-"}function at(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E>="0"&&E<="9"||E==="_"}function ct(){}ct.prototype={tokenize:function(E){var D=[];this._current=0;for(var F,ee,xe;this._current<E.length;)if(Z(E[this._current]))F=this._current,ee=this._consumeUnquotedIdentifier(E),D.push({type:j,value:ee,start:F});else if(q[E[this._current]]!==void 0)D.push({type:q[E[this._current]],value:E[this._current],start:this._current}),this._current++;else if(H(E[this._current]))xe=this._consumeNumber(E),D.push(xe);else if(E[this._current]==="[")xe=this._consumeLBracket(E),D.push(xe);else if(E[this._current]==='"')F=this._current,ee=this._consumeQuotedIdentifier(E),D.push({type:x,value:ee,start:F});else if(E[this._current]==="'")F=this._current,ee=this._consumeRawStringLiteral(E),D.push({type:A,value:ee,start:F});else if(E[this._current]==="`"){F=this._current;var Ne=this._consumeLiteral(E);D.push({type:A,value:Ne,start:F})}else if(U[E[this._current]]!==void 0)D.push(this._consumeOperator(E));else if(fe[E[this._current]]!==void 0)this._current++;else if(E[this._current]==="&")F=this._current,this._current++,E[this._current]==="&"?(this._current++,D.push({type:Se,value:"&&",start:F})):D.push({type:J,value:"&",start:F});else if(E[this._current]==="|")F=this._current,this._current++,E[this._current]==="|"?(this._current++,D.push({type:re,value:"||",start:F})):D.push({type:he,value:"|",start:F});else{var Be=new Error("Unknown character:"+E[this._current]);throw Be.name="LexerError",Be}return D},_consumeUnquotedIdentifier:function(E){var D=this._current;for(this._current++;this._current<E.length&&at(E[this._current]);)this._current++;return E.slice(D,this._current)},_consumeQuotedIdentifier:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=='"'&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==='"')?ee+=2:ee++,this._current=ee}return this._current++,JSON.parse(E.slice(D,this._current))},_consumeRawStringLiteral:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=="'"&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==="'")?ee+=2:ee++,this._current=ee}this._current++;var xe=E.slice(D+1,this._current-1);return xe.replace("\\'","'")},_consumeNumber:function(E){var D=this._current;this._current++;for(var F=E.length;H(E[this._current])&&this._current<F;)this._current++;var ee=parseInt(E.slice(D,this._current));return{type:V,value:ee,start:D}},_consumeLBracket:function(E){var D=this._current;return this._current++,E[this._current]==="?"?(this._current++,{type:P,value:"[?",start:D}):E[this._current]==="]"?(this._current++,{type:N,value:"[]",start:D}):{type:Y,value:"[",start:D}},_consumeOperator:function(E){var D=this._current,F=E[D];if(this._current++,F==="!")return E[this._current]==="="?(this._current++,{type:ce,value:"!=",start:D}):{type:Ae,value:"!",start:D};if(F==="<")return E[this._current]==="="?(this._current++,{type:W,value:"<=",start:D}):{type:ie,value:"<",start:D};if(F===">")return E[this._current]==="="?(this._current++,{type:X,value:">=",start:D}):{type:we,value:">",start:D};if(F==="="&&E[this._current]==="=")return this._current++,{type:de,value:"==",start:D}},_consumeLiteral:function(E){this._current++;for(var D=this._current,F=E.length,ee;E[this._current]!=="`"&&this._current<F;){var xe=this._current;E[xe]==="\\"&&(E[xe+1]==="\\"||E[xe+1]==="`")?xe+=2:xe++,this._current=xe}var Ne=a(E.slice(D,this._current));return Ne=Ne.replace("\\`","`"),this._looksLikeJSON(Ne)?ee=JSON.parse(Ne):ee=JSON.parse('"'+Ne+'"'),this._current++,ee},_looksLikeJSON:function(E){var D='[{"',F=["true","false","null"],ee="-0123456789";if(E==="")return!1;if(D.indexOf(E[0])>=0||F.indexOf(E)>=0)return!0;if(ee.indexOf(E[0])>=0)try{return JSON.parse(E),!0}catch{return!1}else return!1}};var Ee={};Ee[w]=0,Ee[j]=0,Ee[x]=0,Ee[k]=0,Ee[$]=0,Ee[T]=0,Ee[z]=0,Ee[V]=0,Ee[I]=0,Ee[J]=0,Ee[he]=1,Ee[re]=2,Ee[Se]=3,Ee[de]=5,Ee[we]=5,Ee[ie]=5,Ee[X]=5,Ee[W]=5,Ee[ce]=5,Ee[N]=9,Ee[_]=20,Ee[P]=21,Ee[oe]=40,Ee[Ae]=45,Ee[ae]=50,Ee[Y]=55,Ee[ye]=60;function pt(){}pt.prototype={parse:function(E){this._loadTokens(E),this.index=0;var D=this.expression(0);if(this._lookahead(0)!==w){var F=this._lookaheadToken(0),ee=new Error("Unexpected token type: "+F.type+", value: "+F.value);throw ee.name="ParserError",ee}return D},_loadTokens:function(E){var D=new ct,F=D.tokenize(E);F.push({type:w,value:"",start:E.length}),this.tokens=F},expression:function(E){var D=this._lookaheadToken(0);this._advance();for(var F=this.nud(D),ee=this._lookahead(0);E<Ee[ee];)this._advance(),F=this.led(ee,F),ee=this._lookahead(0);return F},_lookahead:function(E){return this.tokens[this.index+E].type},_lookaheadToken:function(E){return this.tokens[this.index+E]},_advance:function(){this.index++},nud:function(E){var D,F,ee;switch(E.type){case A:return{type:"Literal",value:E.value};case j:return{type:"Field",name:E.value};case x:var xe={type:"Field",name:E.value};if(this._lookahead(0)===ye)throw new Error("Quoted identifier not allowed for function names.");return xe;case Ae:return F=this.expression(Ee.Not),{type:"NotExpression",children:[F]};case _:return D={type:"Identity"},F=null,this._lookahead(0)===k?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Star),{type:"ValueProjection",children:[D,F]};case P:return this.led(E.type,{type:"Identity"});case ae:return this._parseMultiselectHash();case N:return D={type:N,children:[{type:"Identity"}]},F=this._parseProjectionRHS(Ee.Flatten),{type:"Projection",children:[D,F]};case Y:return this._lookahead(0)===V||this._lookahead(0)===M?(F=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},F)):this._lookahead(0)===_&&this._lookahead(1)===k?(this._advance(),this._advance(),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[{type:"Identity"},F]}):this._parseMultiselectList();case I:return{type:I};case J:return ee=this.expression(Ee.Expref),{type:"ExpressionReference",children:[ee]};case ye:for(var Ne=[];this._lookahead(0)!==$;)this._lookahead(0)===I?(ee={type:I},this._advance()):ee=this.expression(0),Ne.push(ee);return this._match($),Ne[0];default:this._errorToken(E)}},led:function(E,D){var F;switch(E){case oe:var ee=Ee.Dot;return this._lookahead(0)!==_?(F=this._parseDotRHS(ee),{type:"Subexpression",children:[D,F]}):(this._advance(),F=this._parseProjectionRHS(ee),{type:"ValueProjection",children:[D,F]});case he:return F=this.expression(Ee.Pipe),{type:he,children:[D,F]};case re:return F=this.expression(Ee.Or),{type:"OrExpression",children:[D,F]};case Se:return F=this.expression(Ee.And),{type:"AndExpression",children:[D,F]};case ye:for(var xe=D.name,Ne=[],Be,ge;this._lookahead(0)!==$;)this._lookahead(0)===I?(Be={type:I},this._advance()):Be=this.expression(0),this._lookahead(0)===T&&this._match(T),Ne.push(Be);return this._match($),ge={type:"Function",name:xe,children:Ne},ge;case P:var je=this.expression(0);return this._match(k),this._lookahead(0)===N?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Filter),{type:"FilterProjection",children:[D,F,je]};case N:var wt={type:N,children:[D]},ut=this._parseProjectionRHS(Ee.Flatten);return{type:"Projection",children:[wt,ut]};case de:case ce:case we:case X:case ie:case W:return this._parseComparator(D,E);case Y:var Ye=this._lookaheadToken(0);return Ye.type===V||Ye.type===M?(F=this._parseIndexExpression(),this._projectIfSlice(D,F)):(this._match(_),this._match(k),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[D,F]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(E){if(this._lookahead(0)===E)this._advance();else{var D=this._lookaheadToken(0),F=new Error("Expected "+E+", got: "+D.type);throw F.name="ParserError",F}},_errorToken:function(E){var D=new Error("Invalid token ("+E.type+'): "'+E.value+'"');throw D.name="ParserError",D},_parseIndexExpression:function(){if(this._lookahead(0)===M||this._lookahead(1)===M)return this._parseSliceExpression();var E={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(k),E},_projectIfSlice:function(E,D){var F={type:"IndexExpression",children:[E,D]};return D.type==="Slice"?{type:"Projection",children:[F,this._parseProjectionRHS(Ee.Star)]}:F},_parseSliceExpression:function(){for(var E=[null,null,null],D=0,F=this._lookahead(0);F!==k&&D<3;){if(F===M)D++,this._advance();else if(F===V)E[D]=this._lookaheadToken(0).value,this._advance();else{var ee=this._lookahead(0),xe=new Error("Syntax error, unexpected token: "+ee.value+"("+ee.type+")");throw xe.name="Parsererror",xe}F=this._lookahead(0)}return this._match(k),{type:"Slice",children:E}},_parseComparator:function(E,D){var F=this.expression(Ee[D]);return{type:"Comparator",name:D,children:[E,F]}},_parseDotRHS:function(E){var D=this._lookahead(0),F=[j,x,_];if(F.indexOf(D)>=0)return this.expression(E);if(D===Y)return this._match(Y),this._parseMultiselectList();if(D===ae)return this._match(ae),this._parseMultiselectHash()},_parseProjectionRHS:function(E){var D;if(Ee[this._lookahead(0)]<10)D={type:"Identity"};else if(this._lookahead(0)===Y)D=this.expression(E);else if(this._lookahead(0)===P)D=this.expression(E);else if(this._lookahead(0)===oe)this._match(oe),D=this._parseDotRHS(E);else{var F=this._lookaheadToken(0),ee=new Error("Sytanx error, unexpected token: "+F.value+"("+F.type+")");throw ee.name="ParserError",ee}return D},_parseMultiselectList:function(){for(var E=[];this._lookahead(0)!==k;){var D=this.expression(0);if(E.push(D),this._lookahead(0)===T&&(this._match(T),this._lookahead(0)===k))throw new Error("Unexpected token Rbracket")}return this._match(k),{type:"MultiSelectList",children:E}},_parseMultiselectHash:function(){for(var E=[],D=[j,x],F,ee,xe,Ne;;){if(F=this._lookaheadToken(0),D.indexOf(F.type)<0)throw new Error("Expecting an identifier token, got: "+F.type);if(ee=F.value,this._advance(),this._match(M),xe=this.expression(0),Ne={type:"KeyValuePair",name:ee,value:xe},E.push(Ne),this._lookahead(0)===T)this._match(T);else if(this._lookahead(0)===z){this._match(z);break}}return{type:"MultiSelectHash",children:E}}};function Le(E){this.runtime=E}Le.prototype={search:function(E,D){return this.visit(E,D)},visit:function(E,D){var F,ee,xe,Ne,Be,ge,je,wt,ut,Ye;switch(E.type){case"Field":return D!==null&&r(D)?(ge=D[E.name],ge===void 0?null:ge):null;case"Subexpression":for(xe=this.visit(E.children[0],D),Ye=1;Ye<E.children.length;Ye++)if(xe=this.visit(E.children[1],xe),xe===null)return null;return xe;case"IndexExpression":return je=this.visit(E.children[0],D),wt=this.visit(E.children[1],je),wt;case"Index":if(!n(D))return null;var Xe=E.value;return Xe<0&&(Xe=D.length+Xe),xe=D[Xe],xe===void 0&&(xe=null),xe;case"Slice":if(!n(D))return null;var Jt=E.children.slice(0),Un=this.computeSliceParams(D.length,Jt),Jn=Un[0],Kt=Un[1],Nn=Un[2];if(xe=[],Nn>0)for(Ye=Jn;Ye<Kt;Ye+=Nn)xe.push(D[Ye]);else for(Ye=Jn;Ye>Kt;Ye+=Nn)xe.push(D[Ye]);return xe;case"Projection":var rn=this.visit(E.children[0],D);if(!n(rn))return null;for(ut=[],Ye=0;Ye<rn.length;Ye++)ee=this.visit(E.children[1],rn[Ye]),ee!==null&&ut.push(ee);return ut;case"ValueProjection":if(rn=this.visit(E.children[0],D),!r(rn))return null;ut=[];var ln=s(rn);for(Ye=0;Ye<ln.length;Ye++)ee=this.visit(E.children[1],ln[Ye]),ee!==null&&ut.push(ee);return ut;case"FilterProjection":if(rn=this.visit(E.children[0],D),!n(rn))return null;var Sn=[],St=[];for(Ye=0;Ye<rn.length;Ye++)F=this.visit(E.children[2],rn[Ye]),i(F)||Sn.push(rn[Ye]);for(var Mn=0;Mn<Sn.length;Mn++)ee=this.visit(E.children[1],Sn[Mn]),ee!==null&&St.push(ee);return St;case"Comparator":switch(Ne=this.visit(E.children[0],D),Be=this.visit(E.children[1],D),E.name){case de:xe=o(Ne,Be);break;case ce:xe=!o(Ne,Be);break;case we:xe=Ne>Be;break;case X:xe=Ne>=Be;break;case ie:xe=Ne<Be;break;case W:xe=Ne<=Be;break;default:throw new Error("Unknown comparator: "+E.name)}return xe;case N:var Dt=this.visit(E.children[0],D);if(!n(Dt))return null;var nt=[];for(Ye=0;Ye<Dt.length;Ye++)ee=Dt[Ye],n(ee)?nt.push.apply(nt,ee):nt.push(ee);return nt;case"Identity":return D;case"MultiSelectList":if(D===null)return null;for(ut=[],Ye=0;Ye<E.children.length;Ye++)ut.push(this.visit(E.children[Ye],D));return ut;case"MultiSelectHash":if(D===null)return null;ut={};var cn;for(Ye=0;Ye<E.children.length;Ye++)cn=E.children[Ye],ut[cn.name]=this.visit(cn.value,D);return ut;case"OrExpression":return F=this.visit(E.children[0],D),i(F)&&(F=this.visit(E.children[1],D)),F;case"AndExpression":return Ne=this.visit(E.children[0],D),i(Ne)===!0?Ne:this.visit(E.children[1],D);case"NotExpression":return Ne=this.visit(E.children[0],D),i(Ne);case"Literal":return E.value;case he:return je=this.visit(E.children[0],D),this.visit(E.children[1],je);case I:return D;case"Function":var Gt=[];for(Ye=0;Ye<E.children.length;Ye++)Gt.push(this.visit(E.children[Ye],D));return this.runtime.callFunction(E.name,Gt);case"ExpressionReference":var ir=E.children[0];return ir.jmespathType=J,ir;default:throw new Error("Unknown node type: "+E.type)}},computeSliceParams:function(E,D){var F=D[0],ee=D[1],xe=D[2],Ne=[null,null,null];if(xe===null)xe=1;else if(xe===0){var Be=new Error("Invalid slice, step cannot be 0");throw Be.name="RuntimeError",Be}var ge=xe<0;return F===null?F=ge?E-1:0:F=this.capSliceRange(E,F,xe),ee===null?ee=ge?-1:E:ee=this.capSliceRange(E,ee,xe),Ne[0]=F,Ne[1]=ee,Ne[2]=xe,Ne},capSliceRange:function(E,D,F){return D<0?(D+=E,D<0&&(D=F<0?-1:0)):D>=E&&(D=F<0?E-1:E),D}};function Ke(E){this._interpreter=E,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[m]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[h,d]},{types:[u]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[h]},{types:[h]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[h,d,f]}]},map:{_func:this._functionMap,_signature:[{types:[v]},{types:[d]}]},max:{_func:this._functionMax,_signature:[{types:[m,b]}]},merge:{_func:this._functionMerge,_signature:[{types:[f],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[d]},{types:[v]}]},sum:{_func:this._functionSum,_signature:[{types:[m]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[h]},{types:[h]}]},min:{_func:this._functionMin,_signature:[{types:[m,b]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[d]},{types:[v]}]},type:{_func:this._functionType,_signature:[{types:[u]}]},keys:{_func:this._functionKeys,_signature:[{types:[f]}]},values:{_func:this._functionValues,_signature:[{types:[f]}]},sort:{_func:this._functionSort,_signature:[{types:[b,m]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[d]},{types:[v]}]},join:{_func:this._functionJoin,_signature:[{types:[h]},{types:[b]}]},reverse:{_func:this._functionReverse,_signature:[{types:[h,d]}]},to_array:{_func:this._functionToArray,_signature:[{types:[u]}]},to_string:{_func:this._functionToString,_signature:[{types:[u]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[u]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[u],variadic:!0}]}}}Ke.prototype={callFunction:function(E,D){var F=this.functionTable[E];if(F===void 0)throw new Error("Unknown function: "+E+"()");return this._validateArgs(E,D,F._signature),F._func.call(this,D)},_validateArgs:function(E,D,F){var ee;if(F[F.length-1].variadic){if(D.length<F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes at least"+F.length+ee+" but received "+D.length)}else if(D.length!==F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes "+F.length+ee+" but received "+D.length);for(var xe,Ne,Be,ge=0;ge<F.length;ge++){Be=!1,xe=F[ge].types,Ne=this._getTypeName(D[ge]);for(var je=0;je<xe.length;je++)if(this._typeMatches(Ne,xe[je],D[ge])){Be=!0;break}if(!Be){var wt=xe.map(function(ut){return y[ut]}).join(",");throw new Error("TypeError: "+E+"() expected argument "+(ge+1)+" to be type "+wt+" but received type "+y[Ne]+" instead.")}}},_typeMatches:function(E,D,F){if(D===u)return!0;if(D===b||D===m||D===d){if(D===d)return E===d;if(E===d){var ee;D===m?ee=l:D===b&&(ee=h);for(var xe=0;xe<F.length;xe++)if(!this._typeMatches(this._getTypeName(F[xe]),ee,F[xe]))return!1;return!0}}else return E===D},_getTypeName:function(E){switch(Object.prototype.toString.call(E)){case"[object String]":return h;case"[object Number]":return l;case"[object Array]":return d;case"[object Boolean]":return p;case"[object Null]":return g;case"[object Object]":return E.jmespathType===J?v:f}},_functionStartsWith:function(E){return E[0].lastIndexOf(E[1])===0},_functionEndsWith:function(E){var D=E[0],F=E[1];return D.indexOf(F,D.length-F.length)!==-1},_functionReverse:function(E){var D=this._getTypeName(E[0]);if(D===h){for(var F=E[0],ee="",xe=F.length-1;xe>=0;xe--)ee+=F[xe];return ee}else{var Ne=E[0].slice(0);return Ne.reverse(),Ne}},_functionAbs:function(E){return Math.abs(E[0])},_functionCeil:function(E){return Math.ceil(E[0])},_functionAvg:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D/F.length},_functionContains:function(E){return E[0].indexOf(E[1])>=0},_functionFloor:function(E){return Math.floor(E[0])},_functionLength:function(E){return r(E[0])?Object.keys(E[0]).length:E[0].length},_functionMap:function(E){for(var D=[],F=this._interpreter,ee=E[0],xe=E[1],Ne=0;Ne<xe.length;Ne++)D.push(F.visit(ee,xe[Ne]));return D},_functionMerge:function(E){for(var D={},F=0;F<E.length;F++){var ee=E[F];for(var xe in ee)D[xe]=ee[xe]}return D},_functionMax:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.max.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)ee.localeCompare(F[xe])<0&&(ee=F[xe]);return ee}else return null},_functionMin:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.min.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)F[xe].localeCompare(ee)<0&&(ee=F[xe]);return ee}else return null},_functionSum:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D},_functionType:function(E){switch(this._getTypeName(E[0])){case l:return"number";case h:return"string";case d:return"array";case f:return"object";case p:return"boolean";case v:return"expref";case g:return"null"}},_functionKeys:function(E){return Object.keys(E[0])},_functionValues:function(E){for(var D=E[0],F=Object.keys(D),ee=[],xe=0;xe<F.length;xe++)ee.push(D[F[xe]]);return ee},_functionJoin:function(E){var D=E[0],F=E[1];return F.join(D)},_functionToArray:function(E){return this._getTypeName(E[0])===d?E[0]:[E[0]]},_functionToString:function(E){return this._getTypeName(E[0])===h?E[0]:JSON.stringify(E[0])},_functionToNumber:function(E){var D=this._getTypeName(E[0]),F;return D===l?E[0]:D===h&&(F=+E[0],!isNaN(F))?F:null},_functionNotNull:function(E){for(var D=0;D<E.length;D++)if(this._getTypeName(E[D])!==g)return E[D];return null},_functionSort:function(E){var D=E[0].slice(0);return D.sort(),D},_functionSortBy:function(E){var D=E[0].slice(0);if(D.length===0)return D;var F=this._interpreter,ee=E[1],xe=this._getTypeName(F.visit(ee,D[0]));if([l,h].indexOf(xe)<0)throw new Error("TypeError");for(var Ne=this,Be=[],ge=0;ge<D.length;ge++)Be.push([ge,D[ge]]);Be.sort(function(wt,ut){var Ye=F.visit(ee,wt[1]),Xe=F.visit(ee,ut[1]);if(Ne._getTypeName(Ye)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Ye));if(Ne._getTypeName(Xe)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Xe));return Ye>Xe?1:Ye<Xe?-1:wt[0]-ut[0]});for(var je=0;je<Be.length;je++)D[je]=Be[je][1];return D},_functionMaxBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=-1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be>xe&&(xe=Be,Ne=F[ge]);return Ne},_functionMinBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be<xe&&(xe=Be,Ne=F[ge]);return Ne},createKeyFunction:function(E,D){var F=this,ee=this._interpreter,xe=function(Ne){var Be=ee.visit(E,Ne);if(D.indexOf(F._getTypeName(Be))<0){var ge="TypeError: expected one of "+D+", received "+F._getTypeName(Be);throw new Error(ge)}return Be};return xe}};function ft(E){var D=new pt,F=D.parse(E);return F}function We(E){var D=new ct;return D.tokenize(E)}function Nt(E,D){var F=new pt,ee=new Ke,xe=new Le(ee);ee._interpreter=xe;var Ne=F.parse(D);return xe.search(Ne,E)}e.tokenize=We,e.compile=ft,e.search=Nt,e.strictDeepEqual=o})(t)})(vj)),vj}var cN=lN();const uN=Ng(cN);var Tp={},gj;function hN(){if(gj)return Tp;gj=1;var t={b:"\b",f:"\f",n:`
2
2
  `,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},e=97;Tp.parse=function(v,g,m){var b={},y=0,w=0,j=0,x=m&&m.bigint&&typeof BigInt<"u";return{data:k("",!0),pointers:b};function k(N,_){$();var P;de(N,"value");var oe=J();switch(oe){case"t":I("rue"),P=!0;break;case"f":I("alse"),P=!1;break;case"n":I("ull"),P=null;break;case'"':P=T();break;case"[":P=z(N);break;case"{":P=V(N);break;default:he(),"-0123456789".indexOf(oe)>=0?P=M():X()}return de(N,"valueEnd"),$(),_&&j<v.length&&X(),P}function $(){e:for(;j<v.length;){switch(v[j]){case" ":w++;break;case" ":w+=4;break;case"\r":w=0;break;case`
3
3
  `:w=0,y++;break;default:break e}j++}}function T(){for(var N="",_;_=J(),_!='"';)_=="\\"?(_=J(),_ in t?N+=t[_]:_=="u"?N+=re():W()):N+=_;return N}function M(){var N="",_=!0;v[j]=="-"&&(N+=J()),N+=v[j]=="0"?J():Se(),v[j]=="."&&(N+=J()+Se(),_=!1),(v[j]=="e"||v[j]=="E")&&(N+=J(),(v[j]=="+"||v[j]=="-")&&(N+=J()),N+=Se(),_=!1);var P=+N;return x&&_&&(P>Number.MAX_SAFE_INTEGER||P<Number.MIN_SAFE_INTEGER)?BigInt(N):P}function z(N){$();var _=[],P=0;if(J()=="]")return _;for(he();;){var oe=N+"/"+P;_.push(k(oe)),$();var Ae=J();if(Ae=="]")break;Ae!=","&&W(),$(),P++}return _}function V(N){$();var _={};if(J()=="}")return _;for(he();;){var P=ie();J()!='"'&&W();var oe=T(),Ae=N+"/"+p(oe);we(Ae,"key",P),de(Ae,"keyEnd"),$(),J()!=":"&&W(),$(),_[oe]=k(Ae),$();var ae=J();if(ae=="}")break;ae!=","&&W(),$()}return _}function I(N){for(var _=0;_<N.length;_++)J()!==N[_]&&W()}function J(){ce();var N=v[j];return j++,w++,N}function he(){j--,w--}function re(){for(var N=4,_=0;N--;){_<<=4;var P=J().toLowerCase();P>="a"&&P<="f"?_+=P.charCodeAt()-e+10:P>="0"&&P<="9"?_+=+P:W()}return String.fromCharCode(_)}function Se(){for(var N="";v[j]>="0"&&v[j]<="9";)N+=J();if(N.length)return N;ce(),X()}function de(N,_){we(N,_,ie())}function we(N,_,P){b[N]=b[N]||{},b[N][_]=P}function ie(){return{line:y,column:w,pos:j}}function X(){throw new SyntaxError("Unexpected token "+v[j]+" in JSON at position "+j)}function W(){he(),X()}function ce(){if(j>=v.length)throw new SyntaxError("Unexpected end of JSON input")}},Tp.stringify=function(v,g,m){if(!r(v))return;var b=0,y,w,j=typeof m=="object"?m.space:m;switch(typeof j){case"number":var x=j>10?10:j<0?0:Math.floor(j);j=x&&we(x," "),y=x,w=x;break;case"string":j=j.slice(0,10),y=0,w=0;for(var k=0;k<j.length;k++){var $=j[k];switch($){case" ":w++;break;case" ":w+=4;break;case"\r":w=0;break;case`
4
4
  `:w=0,b++;break;default:throw new Error("whitespace characters not allowed in JSON")}y++}break;default:j=void 0}var T="",M={},z=0,V=0,I=0,J=m&&m.es6&&typeof Map=="function";return he(v,0,""),{json:T,pointers:M};function he(ie,X,W){switch(de(W,"value"),typeof ie){case"number":case"bigint":case"boolean":re(""+ie);break;case"string":re(h(ie));break;case"object":ie===null?re("null"):typeof ie.toJSON=="function"?re(h(ie.toJSON())):Array.isArray(ie)?ce():J?ie.constructor.BYTES_PER_ELEMENT?ce():ie instanceof Map?_():ie instanceof Set?_(!0):N():N()}de(W,"valueEnd");function ce(){if(ie.length){re("[");for(var P=X+1,oe=0;oe<ie.length;oe++){oe&&re(","),Se(P);var Ae=r(ie[oe])?ie[oe]:null,ae=W+"/"+oe;he(Ae,P,ae)}Se(X),re("]")}else re("[]")}function N(){var P=Object.keys(ie);if(P.length){re("{");for(var oe=X+1,Ae=0;Ae<P.length;Ae++){var ae=P[Ae],Y=ie[ae];if(r(Y)){Ae&&re(",");var ye=W+"/"+p(ae);Se(oe),de(ye,"key"),re(h(ae)),de(ye,"keyEnd"),re(":"),j&&re(" "),he(Y,oe,ye)}}Se(X),re("}")}else re("{}")}function _(P){if(ie.size){re("{");for(var oe=X+1,Ae=!0,ae=ie.entries(),Y=ae.next();!Y.done;){var ye=Y.value,A=ye[0],q=P?!0:ye[1];if(r(q)){Ae||re(","),Ae=!1;var U=W+"/"+p(A);Se(oe),de(U,"key"),re(h(A)),de(U,"keyEnd"),re(":"),j&&re(" "),he(q,oe,U)}Y=ae.next()}Se(X),re("}")}else re("{}")}}function re(ie){V+=ie.length,I+=ie.length,T+=ie}function Se(ie){if(j){for(T+=`
package/dist/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  type="module"
15
15
  async
16
16
  crossorigin
17
- src="/assets/app-B61Pkts6.js"
17
+ src="/assets/app-DBSHy7TS.js"
18
18
  ></script>
19
19
  <style>
20
20
  @font-face {
@@ -220,11 +220,11 @@
220
220
  display: flex;
221
221
  flex-direction: column;
222
222
  }
223
- .service-host-dropdown-wrapper[data-v-d602e67b] {
223
+ .service-host-dropdown-wrapper[data-v-2eb02fe1] {
224
224
  position: relative;
225
225
  margin-left: auto;
226
226
  }
227
- .service-host-dropdown[data-v-d602e67b] {
227
+ .service-host-dropdown[data-v-2eb02fe1] {
228
228
  display: flex;
229
229
  align-items: center;
230
230
  gap: 0.5rem;
@@ -239,31 +239,31 @@
239
239
  cursor: pointer;
240
240
  transition: border-color 0.2s;
241
241
  }
242
- .service-host-dropdown[data-v-d602e67b]:hover {
242
+ .service-host-dropdown[data-v-2eb02fe1]:hover {
243
243
  border-color: hsl(var(--ring));
244
244
  }
245
- .service-host-dropdown .service-host-placeholder[data-v-d602e67b] {
245
+ .service-host-dropdown .service-host-placeholder[data-v-2eb02fe1] {
246
246
  flex: 1;
247
247
  color: hsl(var(--muted-foreground));
248
248
  }
249
- .service-host-dropdown .service-host-chevron[data-v-d602e67b] {
249
+ .service-host-dropdown .service-host-chevron[data-v-2eb02fe1] {
250
250
  color: hsl(var(--muted-foreground));
251
251
  transition: transform 0.2s;
252
252
  flex-shrink: 0;
253
253
  }
254
- .welcome-description[data-v-cbfcc6b2] {
254
+ .welcome-description[data-v-d0cf2fc7] {
255
255
  font-size: 1.125rem;
256
256
  color: hsl(var(--muted-foreground));
257
257
  margin: 0 0 2.5rem;
258
258
  line-height: 1.6;
259
259
  }
260
- .service-host-input-section[data-v-cbfcc6b2] {
260
+ .service-host-input-section[data-v-d0cf2fc7] {
261
261
  margin: 2rem 0;
262
262
  }
263
- .service-host-direct-form[data-v-cbfcc6b2] {
263
+ .service-host-direct-form[data-v-d0cf2fc7] {
264
264
  margin-top: 1.5rem;
265
265
  }
266
- .service-host-direct-form .service-host-input-wrapper[data-v-cbfcc6b2] {
266
+ .service-host-direct-form .service-host-input-wrapper[data-v-d0cf2fc7] {
267
267
  display: flex;
268
268
  flex-direction: column;
269
269
  gap: 0.75rem;
@@ -272,14 +272,14 @@
272
272
  max-width: 500px;
273
273
  margin: 0 auto;
274
274
  }
275
- .service-host-input-wrapper[data-v-cbfcc6b2] {
275
+ .service-host-input-wrapper[data-v-d0cf2fc7] {
276
276
  display: flex;
277
277
  gap: 0.75rem;
278
278
  align-items: center;
279
279
  justify-content: center;
280
280
  margin-top: 1.5rem;
281
281
  }
282
- .service-host-input[data-v-cbfcc6b2] {
282
+ .service-host-input[data-v-d0cf2fc7] {
283
283
  padding: 0.75rem 1rem;
284
284
  border: 1px solid hsl(var(--border));
285
285
  border-radius: var(--radius);
@@ -289,17 +289,17 @@
289
289
  min-width: 300px;
290
290
  transition: border-color 0.2s;
291
291
  }
292
- .service-host-input[data-v-cbfcc6b2]:hover {
292
+ .service-host-input[data-v-d0cf2fc7]:hover {
293
293
  border-color: hsl(var(--accent));
294
294
  }
295
- .service-host-input[data-v-cbfcc6b2]:focus {
295
+ .service-host-input[data-v-d0cf2fc7]:focus {
296
296
  outline: none;
297
297
  border-color: hsl(var(--ring));
298
298
  }
299
- .service-host-input[data-v-cbfcc6b2]::placeholder {
299
+ .service-host-input[data-v-d0cf2fc7]::placeholder {
300
300
  color: hsl(var(--muted-foreground));
301
301
  }
302
- .service-host-submit-btn[data-v-cbfcc6b2] {
302
+ .service-host-submit-btn[data-v-d0cf2fc7] {
303
303
  padding: 0.75rem 1.5rem;
304
304
  border: 1px solid hsl(var(--border));
305
305
  border-radius: var(--radius);
@@ -310,14 +310,14 @@
310
310
  cursor: pointer;
311
311
  transition: background 0.2s;
312
312
  }
313
- .service-host-submit-btn[data-v-cbfcc6b2]:hover:not(:disabled) {
313
+ .service-host-submit-btn[data-v-d0cf2fc7]:hover:not(:disabled) {
314
314
  background: hsl(var(--primary) / 0.9);
315
315
  }
316
- .service-host-submit-btn[data-v-cbfcc6b2]:disabled {
316
+ .service-host-submit-btn[data-v-d0cf2fc7]:disabled {
317
317
  opacity: 0.5;
318
318
  cursor: not-allowed;
319
319
  }
320
- .service-host-direct-form .service-host-submit-btn[data-v-cbfcc6b2] {
320
+ .service-host-direct-form .service-host-submit-btn[data-v-d0cf2fc7] {
321
321
  width: 100%;
322
322
  }
323
323
  .openapi-test {
@@ -499,8 +499,8 @@
499
499
  href="/assets/app-Dzrp8B7R.css"
500
500
  as="style"
501
501
  />
502
- <link rel="modulepreload" crossorigin href="/assets/Main-DDhM93Le.js" />
503
- <link rel="preload" href="/assets/Main-Dyp3FJcB.css" as="style" />
502
+ <link rel="modulepreload" crossorigin href="/assets/Main-BD4o1zjI.js" />
503
+ <link rel="preload" href="/assets/Main-Cy83ExML.css" as="style" />
504
504
  <link
505
505
  rel="preload"
506
506
  as="font"
@@ -597,9 +597,9 @@
597
597
  <!---->
598
598
  </div>
599
599
  <div class="header-actions">
600
- <div class="service-host-dropdown-wrapper" data-v-d602e67b>
601
- <div class="service-host-dropdown" data-v-d602e67b>
602
- <span class="service-host-placeholder" data-v-d602e67b
600
+ <div class="service-host-dropdown-wrapper" data-v-2eb02fe1>
601
+ <div class="service-host-dropdown" data-v-2eb02fe1>
602
+ <span class="service-host-placeholder" data-v-2eb02fe1
603
603
  >Select service host</span
604
604
  ><svg
605
605
  xmlns="http://www.w3.org/2000/svg"
@@ -612,7 +612,7 @@
612
612
  stroke-linecap="round"
613
613
  stroke-linejoin="round"
614
614
  class="lucide service-host-chevron lucide-chevron-down-icon lucide-chevron-down service-host-chevron"
615
- data-v-d602e67b=""
615
+ data-v-2eb02fe1=""
616
616
  >
617
617
  <path d="m6 9 6 6 6-6" />
618
618
  </svg>
@@ -717,28 +717,28 @@
717
717
  </div>
718
718
  <h1 class="welcome-title">Welcome to OpenAPI Studio</h1>
719
719
  <!---->
720
- <div class="service-host-input-section" data-v-cbfcc6b2>
721
- <p class="welcome-description" data-v-cbfcc6b2>
720
+ <div class="service-host-input-section" data-v-d0cf2fc7>
721
+ <p class="welcome-description" data-v-d0cf2fc7>
722
722
  Please enter your service host URL to get started.
723
723
  </p>
724
- <div class="service-host-direct-form" data-v-cbfcc6b2>
725
- <div class="service-host-input-wrapper" data-v-cbfcc6b2>
724
+ <div class="service-host-direct-form" data-v-d0cf2fc7>
725
+ <div class="service-host-input-wrapper" data-v-d0cf2fc7>
726
726
  <input
727
727
  value
728
728
  type="text"
729
729
  placeholder="Base URL (e.g., https://api.example.com)"
730
730
  class="service-host-input"
731
- data-v-cbfcc6b2
731
+ data-v-d0cf2fc7
732
732
  /><input
733
733
  value
734
734
  type="text"
735
735
  placeholder="OpenAPI Path (optional, e.g., /openapi.json)"
736
736
  class="service-host-input"
737
- data-v-cbfcc6b2
737
+ data-v-d0cf2fc7
738
738
  /><button
739
739
  class="service-host-submit-btn"
740
740
  disabled
741
- data-v-cbfcc6b2
741
+ data-v-d0cf2fc7
742
742
  >
743
743
  Connect
744
744
  </button>
@@ -756,7 +756,7 @@
756
756
 
757
757
  <link rel="stylesheet" crossorigin href="/assets/app-Dzrp8B7R.css" /><link
758
758
  rel="stylesheet"
759
- href="/assets/Main-Dyp3FJcB.css"
759
+ href="/assets/Main-Cy83ExML.css"
760
760
  />
761
761
  </body>
762
762
  </html>
@@ -0,0 +1 @@
1
+ {"version":"0.3.1","build_id":"1e44a6cf23aa136fda69c192a099bcb6decb88ff"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openapi-studio/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": "^20.19.0 || >=22.12.0"
@@ -1,17 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vanilla-jsoneditor-DV7rbr0h.js","assets/app-B61Pkts6.js","assets/app-Dzrp8B7R.css","assets/styles-handler-DNBZYvBB.js"])))=>i.map(i=>d[i]);
2
- import{d as Be,c as s,o as t,r as ut,a as f,w as ie,n as Te,b as J,i as ct,e as q,f as p,g as dt,h as le,_ as de,j as Fe,k as Ve,l as et,m as De,p as vt,u as Me,q as e,s as F,t as b,v as g,F as ve,x as pe,y as he,z as ge,A as Pe,B as tt,C as ze,D as Ue,E as Ke,G as st,H as Z,I as We,J as nt,K as pt,L as ht,M as mt,S as yt,U as ft,N as Qe}from"./app-B61Pkts6.js";const _t=["selection","mainMenuBar","navigationBar","statusBar","askToFormat","readOnly","indentation","tabSize","escapeControlCharacters","escapeUnicodeCharacters","flattenColumns","validator","onClassName","onRenderValue","onRenderMenu"],kt=["selection","mode","mainMenuBar","navigationBar","statusBar","askToFormat","readOnly","indentation","tabSize","escapeControlCharacters","escapeUnicodeCharacters","flattenColumns","validator","parser","validationParser","pathParser","onClassName","onRenderValue","onRenderMenu"],gt=(i={},l)=>{const a={};for(const u of kt){const $=l[u]!==void 0?l[u]:i[u];$!==void 0&&(a[u]=$)}return a},St=`
3
- <svg
4
- class="fa-icon svelte-1dof0an"
5
- viewBox="0 0 1024 1024"
6
- version="1.1"
7
- xmlns="http://www.w3.org/2000/svg"
8
- p-id="1927" xmlns:xlink="http://www.w3.org/1999/xlink"
9
- width="24"
10
- height="24"
11
- >
12
- <path d="M63.989383 105.442494l0 268.396843c0 18.935258 15.368012 34.304294 34.304294 34.304294 18.936281 0 34.304294-15.369036 34.304294-34.304294L132.597971 180.156126l218.107483 218.176045c12.82919 12.830213 33.618679 12.830213 46.515407 0 12.830213-12.897751 12.830213-33.686217 0-46.51643l-218.176045-218.107483 193.683211 0c18.935258 0 34.304294-15.369036 34.304294-34.304294 0-18.935258-15.369036-34.304294-34.304294-34.304294L104.331183 65.09967C79.288834 65.09967 63.989383 77.999468 63.989383 105.442494L63.989383 105.442494z" p-id="1928" fill="#e6e6e6"></path><path d="M917.688719 65.09967 649.290853 65.09967c-18.935258 0-34.304294 15.369036-34.304294 34.304294 0 18.936281 15.369036 34.304294 34.304294 34.304294l193.683211 0-218.176045 218.107483c-12.830213 12.82919-12.830213 33.618679 0 46.51643 12.897751 12.830213 33.686217 12.830213 46.515407 0L889.420909 180.156126l0 193.683211c0 18.935258 15.369036 34.304294 34.304294 34.304294 18.936281 0 34.304294-15.369036 34.304294-34.304294L958.029496 105.442494C958.029496 77.999468 942.79963 65.09967 917.688719 65.09967L917.688719 65.09967z" p-id="1929" fill="#e6e6e6"></path>
13
- <path d="M104.331183 957.013353l268.397866 0c18.935258 0 34.304294-15.368012 34.304294-34.304294 0-18.936281-15.369036-34.304294-34.304294-34.304294L179.045839 888.404766l218.176045-218.107483c12.830213-12.82919 12.830213-33.618679 0-46.515407-12.897751-12.830213-33.686217-12.830213-46.515407 0l-218.107483 218.176045L132.598994 648.27471c0-18.935258-15.368012-34.304294-34.304294-34.304294-18.936281 0-34.304294 15.369036-34.304294 34.304294l0 268.397866C63.989383 944.115602 79.288834 957.013353 104.331183 957.013353L104.331183 957.013353z" p-id="1930" fill="#e6e6e6"></path>
14
- <path d="M958.029496 916.671553 958.029496 648.27471c0-18.935258-15.368012-34.304294-34.304294-34.304294-18.935258 0-34.304294 15.369036-34.304294 34.304294l0 193.683211L671.313425 623.781876c-12.82919-12.830213-33.618679-12.830213-46.515407 0-12.830213 12.897751-12.830213 33.686217 0 46.515407l218.176045 218.107483L649.290853 888.404766c-18.935258 0-34.304294 15.368012-34.304294 34.304294 0 18.936281 15.369036 34.304294 34.304294 34.304294l268.397866 0C942.79963 957.013353 958.029496 944.115602 958.029496 916.671553L958.029496 916.671553z" p-id="1931" fill="#e6e6e6"></path>
15
- </svg>
16
- `,Ae=(i,l,a=!1)=>{const u=i&&typeof i[l]<"u";return!u&&a&&console.warn("Typeguard warn!!! The object has no property: ",l),u},bt=Be({name:"JsonEditor",props:{modelValue:[Object,Array,Number,String,Boolean,String,null],value:{type:[Object,Array,Number,String,Boolean,String,null],default:void 0},json:{type:[Object,Array,Number,String,Boolean,null],default:void 0},text:String,jsonString:String,selection:{type:Object,default:void 0},mode:{type:String,default:"tree"},mainMenuBar:{type:Boolean,default:void 0},navigationBar:{type:Boolean,default:void 0},statusBar:{type:Boolean,default:void 0},askToFormat:{type:Boolean,default:void 0},readOnly:{type:Boolean,default:void 0},indentation:[String,Number],tabSize:Number,escapeControlCharacters:{type:Boolean,default:void 0},escapeUnicodeCharacters:{type:Boolean,default:void 0},flattenColumns:{type:Boolean,default:void 0},validator:Function,parser:Object,validationParser:Object,pathParser:Object,queryLanguagesIds:Array,queryLanguageId:String,onClassName:Function,onRenderValue:Function,onRenderMenu:Function,height:[String,Number],fullWidthButton:{type:Boolean,default:void 0},darkTheme:{type:Boolean,default:void 0}},emits:["update:modelValue","update:json","update:text","update:jsonString","update:selection","change","error","change-mode","update:mode","change-query-language","focus","blur"],setup(i,{expose:l,emit:a}){const u=ct("jsonEditorOptions",{}),$=q(),k=q(null),H=q(!1),h=q(!1),R=q("tree"),w=q(null),L=p(()=>{const o=i.height||u?.height;return o&&!H.value?{height:o+"px"}:{}}),P=p(()=>i.darkTheme||u?.darkTheme),O=p(()=>i.queryLanguagesIds||u?.queryLanguagesIds),G=p(()=>i.queryLanguageId||u?.queryLanguageId),N=dt({}),X=async()=>{if(typeof window>"u"||typeof O.value>"u"||!O.value?.length)return;for(const B of O.value)if(!N[B])switch(B){case"javascript":{const{javascriptQueryLanguage:z}=await de(async()=>{const{javascriptQueryLanguage:M}=await import("./vanilla-jsoneditor-DV7rbr0h.js");return{javascriptQueryLanguage:M}},__vite__mapDeps([0,1,2]));N[B]=z;break}case"lodash":{const{lodashQueryLanguage:z}=await de(async()=>{const{lodashQueryLanguage:M}=await import("./vanilla-jsoneditor-DV7rbr0h.js");return{lodashQueryLanguage:M}},__vite__mapDeps([0,1,2]));N[B]=z;break}case"jmespath":{const{jmespathQueryLanguage:z}=await de(async()=>{const{jmespathQueryLanguage:M}=await import("./vanilla-jsoneditor-DV7rbr0h.js");return{jmespathQueryLanguage:M}},__vite__mapDeps([0,1,2]));N[B]=z;break}case"jsonquery":{const{jsonQueryLanguage:z}=await de(async()=>{const{jsonQueryLanguage:M}=await import("./vanilla-jsoneditor-DV7rbr0h.js");return{jsonQueryLanguage:M}},__vite__mapDeps([0,1,2]));N[B]=z;break}case"jsonpath":{const{jsonpathQueryLanguage:z}=await de(async()=>{const{jsonpathQueryLanguage:M}=await import("./vanilla-jsoneditor-DV7rbr0h.js");return{jsonpathQueryLanguage:M}},__vite__mapDeps([0,1,2]));N[B]=z;break}}const o=Object.values(N);if(o.length!==0)return o},T=()=>{k.value&&(k.value.removeEventListener("click",A),k.value=null)},x=async()=>{if(typeof window>"u")return;const{getElement:o,createElement:B}=await de(async()=>{const{getElement:y,createElement:n}=await import("./full-width-button-handler-oqK5S8oj.js");return{getElement:y,createElement:n}},[]),{setFullWidthButtonStyle:z}=await de(async()=>{const{setFullWidthButtonStyle:y}=await import("./styles-handler-DNBZYvBB.js");return{setFullWidthButtonStyle:y}},__vite__mapDeps([3,1,2]));await z();const M=o($.value,".jse-full-width"),ye=u?.fullWidthButton!==void 0?u?.fullWidthButton:!0;if(!(i.fullWidthButton!==void 0?i.fullWidthButton:ye)||M)return;k.value&&T();const fe=o($.value,".jse-menu"),_=Array.from(fe.classList).find(y=>y.startsWith("svelte-"));k.value=B("button"),k.value.classList.add("jse-full-width"),H.value&&k.value.classList.add("jse-full-width--active"),k.value.classList.add("jse-button"),k.value.classList.add(_),k.value.innerHTML+=St,fe.appendChild(k.value),k.value.addEventListener("click",A)},A=()=>{H.value=!H.value,H.value?k.value?.classList.add("jse-full-width--active"):(k.value?.classList.remove("jse-full-width--active"),k.value?.blur())},U=(o,B,z)=>{if(h.value){setTimeout(()=>{h.value=!1});return}h.value=!0,Ae(o,"json")&&(a("update:json",o.json),a("update:modelValue",o.json)),Ae(o,"text")&&(a("update:text",o.text),a("update:jsonString",o.text),a("update:modelValue",o.text)),a("change",o,B,z),setTimeout(()=>{h.value=!1})},Y=o=>{a("error",o)},E=o=>{R.value=o,a("change-mode",o),a("update:mode",o)},C=o=>{a("change-query-language",o)},S=()=>{a("focus")},c=()=>{a("blur")},v=o=>{a("update:selection",o)},V=(o,B)=>(Ve(()=>{x()}),typeof i.onRenderMenu=="function"?i.onRenderMenu(o,B):o),ue=async()=>{const o={fullWidthButton:!0,...u||{}},B=await X();return{...gt(o,i),queryLanguages:B,queryLanguageId:G.value,onChange:U,onError:Y,onChangeMode:E,onChangeQueryLanguage:C,onFocus:S,onBlur:c,onRenderMenu:V,onSelect:v}},te=q(!0),ce=()=>{const o=(M={})=>M===null||typeof M>"u"||typeof M=="number"||typeof M=="bigint"||typeof M=="string"||typeof M=="boolean"?{json:M}:Array.isArray(M)?{json:[...M]}:{json:{...M}},B=(M="")=>({text:M||""}),z=i.modelValue||i.value;return z?R.value==="text"&&typeof z=="string"?B(z):o(z):typeof i.json<"u"?o(i.json):typeof i.text<"u"?B(i.text):typeof i.jsonString<"u"?B(i.jsonString):B()},Se=async()=>{if(!(typeof window>"u")){if(!w.value){const o=await ue(),{createJSONEditor:B}=await de(async()=>{const{createJSONEditor:M}=await import("./vanilla-jsoneditor-DV7rbr0h.js");return{createJSONEditor:M}},__vite__mapDeps([0,1,2]));te.value=!1,w.value=B({target:$.value,props:o});const z=ce();w.value.set(z),setTimeout(()=>{h.value=!1},0)}w.value.focus()}},be=async()=>{const o=await ue();w.value?.updateProps(o)},we=()=>{if(h.value)return;const o=ce(),B=w.value?.get();let z=!1;if(Ae(o,"text")&&Ae(B,"text"))z=o.text===B.text;else if(Ae(o,"json")&&Ae(B,"json"))z=JSON.stringify(o.json)===JSON.stringify(B.json);else{const M=JSON.stringify(o),ye=JSON.stringify(B);z=M===ye}z||(h.value=!0,w.value?.update(o),setTimeout(()=>{h.value=!1}))},me=()=>{w.value&&(w.value.destroy(),w.value=null),T()};le([..._t.map(o=>()=>i[o])],be,{deep:!0});const se=()=>{h.value&&setTimeout(()=>{h.value=!1},10)};return le([()=>i.modelValue,()=>i.value,()=>i.json,()=>i.text,()=>i.jsonString],()=>{we(),se()},{deep:!0}),le(()=>i.mode,o=>{o!==R.value&&(R.value=o,be())}),le(()=>P.value,async o=>{if(o){const{setDarkThemeStyle:B}=await de(async()=>{const{setDarkThemeStyle:z}=await import("./styles-handler-DNBZYvBB.js");return{setDarkThemeStyle:z}},__vite__mapDeps([3,1,2]));await B()}},{immediate:!0}),Fe(()=>{Ve(()=>{Se()})}),et(()=>{me()}),l({$collapseAll(){R.value==="tree"&&w.value?.collapse([],!0)},$expandAll(){R.value==="tree"&&w.value?.expand([])},$expand(o,B){typeof o=="function"?(w.value?.expand([],o),console.warn("In new API you must pass the path before the callback!!! Backwards compatibility is deprecated and will be discontinued in the future")):w.value?.expand(o,B)},$get(){return w.value?.get()},$set(o){w.value?.set(o)},$update(o){w.value?.update(o)},$updateProps(o){w.value?.updateProps(o)},async $refresh(){await w.value?.refresh()},$focus(){w.value?.focus()},async $destroy(){await w.value?.destroy()},$patch(o){return w.value?.patch(o)},$transform(o){w.value?.transform(o)},async $scrollTo(o){await w.value?.scrollTo(o)},$findElement(o){return w.value?.findElement(o)},$acceptAutoRepair(){return w.value?.acceptAutoRepair()},$validate(){return w.value?.validate()}}),{max:H,getHeight:L,container:$,darkThemeStyle:P,fallbackSlot:te}}}),wt=(i,l)=>{const a=i.__vccOpts||i;for(const[u,$]of l)a[u]=$;return a};function Ct(i,l,a,u,$,k){return t(),s("div",{class:J(["vue-ts-json-editor",{"vue-ts-json-editor--max-box":i.max,"jse-theme-dark":i.darkThemeStyle}]),style:Te(i.getHeight),ref:"container",onKeydown:l[0]||(l[0]=ie(()=>{},["stop"]))},[i.fallbackSlot?ut(i.$slots,"default",{key:0}):f("",!0)],38)}const Ee=wt(bt,[["render",Ct]]);Ee.install=()=>{console.error(`Default import not working!!! Use "import {JsonEditorPlugin} from 'vue3-ts-jsoneditor';"`)};const at=i=>new Proxy(()=>{},{apply:async(l,a,u)=>{if(typeof window>"u")throw new Error(`${i} is not available on server side. Please use it only in client-side code.`);return(await de(()=>import("./vanilla-jsoneditor-DV7rbr0h.js"),__vite__mapDeps([0,1,2])))[i](...u)}});at("renderValue");at("renderJSONSchemaEnum");const Ge=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$t=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,a,u)=>u?u.toUpperCase():a.toLowerCase()),xt=i=>{const l=$t(i);return l.charAt(0).toUpperCase()+l.slice(1)},At=(...i)=>i.filter((l,a,u)=>!!l&&l.trim()!==""&&u.indexOf(l)===a).join(" ").trim(),Xe=i=>i==="";var Le={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Et=({name:i,iconNode:l,absoluteStrokeWidth:a,"absolute-stroke-width":u,strokeWidth:$,"stroke-width":k,size:H=Le.width,color:h=Le.stroke,...R},{slots:w})=>De("svg",{...Le,...R,width:H,height:H,stroke:h,"stroke-width":Xe(a)||Xe(u)||a===!0||u===!0?Number($||k||Le["stroke-width"])*24/Number(H):$||k||Le["stroke-width"],class:At("lucide",R.class,...i?[`lucide-${Ge(xt(i))}-icon`,`lucide-${Ge(i)}`]:["lucide-icon"])},[...l.map(L=>De(...L)),...w.default?[w.default()]:[]]);const re=(i,l)=>(a,{slots:u,attrs:$})=>De(Et,{...$,...a,iconNode:l,name:i},u);const Bt=re("chart-no-axes-column-increasing",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]]);const Oe=re("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Ze=re("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const Re=re("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const qt=re("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Ye=re("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Lt=re("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const Ne=re("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);const ke=re("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const jt=re("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const ot=re("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);const lt=re("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const Rt=re("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Je=vt("endpoint",()=>{const i=q(null),l=q(null),a=q(null),u=q(!1),$=q([]),k=q(new Map),H=(C,S)=>!C||!S?null:`${S}:${C}`,h=p(()=>H(i.value,l.value)),R=p(()=>{const C=h.value;return C&&k.value.get(C)||null}),w=p(()=>!i.value||!l.value?[]:$.value.filter(C=>C.path===i.value&&C.method===l.value));function L(C,S){i.value=C,l.value=S}function P(C){a.value=C}function O(C){C===null||a.value===C?a.value=null:a.value=C}function G(){u.value=!u.value}function N(){u.value=!0}function X(){u.value=!1}function T(C,S,c){const v=H(C,S);v&&k.value.set(v,{...c})}function x(C,S){const c=H(C,S);return c&&k.value.get(c)||null}function A(C,S){const c=H(C,S);c&&k.value.delete(c)}function U(C){$.value.unshift(C)}function Y(C,S){$.value=$.value.filter(c=>!(c.path===C&&c.method===S))}function E(){$.value=[]}return{selectedPath:i,selectedMethod:l,selectedAuthScheme:a,authMenuOpen:u,requestHistory:$,endpointFormState:k,currentEndpointKey:h,currentFormState:R,filteredRequestHistory:w,setSelectedEndpoint:L,setSelectedAuthScheme:P,toggleSelectedAuthScheme:O,toggleAuthMenu:G,openAuthMenu:N,closeAuthMenu:X,saveEndpointFormState:T,getEndpointFormState:x,clearEndpointFormState:A,addRequestHistory:U,clearEndpointHistory:Y,clearAllHistory:E,getEndpointKey:H}}),Tt={class:"service-host-dropdown-wrapper"},Mt={key:0,class:"service-host-selected"},Ht={key:1,class:"service-host-placeholder"},Pt={class:"service-host-list"},Ot={key:0,class:"service-host-empty-state"},zt=["onClick"],It={class:"service-host-item-content"},Vt={class:"service-host-item-label"},Dt={class:"service-host-item-url"},Ft=["onClick"],Ut={class:"service-host-add-section"},Kt={key:1,class:"service-host-add-form"},Nt={class:"service-host-add-actions"},Jt=["disabled"],Wt=Be({__name:"ServiceHostPicker",setup(i){const l=tt(),a=Me(),u=q(!1),$=q(!1),k=q(""),H=q(""),h=p(()=>a.serviceHosts),R=p(()=>a.getSelectedServiceHost),w=p(()=>R.value?.id||null),L=T=>T.label?T.label:T.baseUrl+(T.openApiPath?` (${T.openApiPath})`:""),P=async T=>{const x=h.value.find(A=>A.id===T);x&&(l.setSelectedServiceHostId(T),await a.handleHostSelected(x),u.value=!1)},O=async()=>{if(!k.value.trim())return;const T={id:crypto.randomUUID(),baseUrl:k.value.trim(),openApiPath:H.value.trim()||void 0};l.addServiceHost(T),a.handleHostAdded(),l.setSelectedServiceHostId(T.id),await a.handleHostSelected(T),k.value="",H.value="",$.value=!1,u.value=!1},G=()=>{$.value=!1,k.value="",H.value=""},N=T=>{l.removeServiceHost(T),a.handleHostRemoved()},X=T=>{T.target.closest(".service-host-dropdown-wrapper")||(u.value=!1)};return le(()=>a.serviceHosts,()=>{},{deep:!0}),Fe(async()=>{a.loadServiceHosts(),a.getSelectedServiceHost&&await a.loadOpenApiSpec(),document.addEventListener("click",X)}),et(()=>{document.removeEventListener("click",X)}),(T,x)=>(t(),s("div",Tt,[e("div",{class:"service-host-dropdown",onClick:x[0]||(x[0]=ie(A=>u.value=!u.value,["stop"]))},[R.value?(t(),s("span",Mt,b(L(R.value)),1)):(t(),s("span",Ht,"Select service host")),F(g(Oe),{size:16,class:"service-host-chevron"})]),u.value?(t(),s("div",{key:0,class:"service-host-dropdown-menu",onClick:x[4]||(x[4]=ie(()=>{},["stop"]))},[e("div",Pt,[h.value.length===0?(t(),s("div",Ot,[...x[5]||(x[5]=[e("p",{class:"service-host-empty-text"},"No service hosts yet",-1),e("p",{class:"service-host-empty-hint"},"Add one below to get started",-1)])])):f("",!0),(t(!0),s(ve,null,pe(h.value,A=>(t(),s("div",{key:A.id,class:J(["service-host-item",{selected:w.value===A.id}]),onClick:U=>P(A.id)},[e("div",It,[e("div",Vt,b(L(A)),1),e("div",Dt,b(A.baseUrl),1)]),e("button",{class:"service-host-item-remove",onClick:ie(U=>N(A.id),["stop"]),title:"Remove"},[F(g(lt),{size:14})],8,Ft)],10,zt))),128))]),e("div",Ut,[$.value?(t(),s("div",Kt,[he(e("input",{"onUpdate:modelValue":x[2]||(x[2]=A=>k.value=A),type:"text",placeholder:"Base URL (e.g., https://api.example.com)",class:"service-host-add-input",onKeyup:Pe(O,["enter"])},null,544),[[ge,k.value]]),he(e("input",{"onUpdate:modelValue":x[3]||(x[3]=A=>H.value=A),type:"text",placeholder:"OpenAPI Path (optional, e.g., /openapi.json)",class:"service-host-add-input",onKeyup:Pe(O,["enter"])},null,544),[[ge,H.value]]),e("div",Nt,[e("button",{onClick:O,class:"service-host-add-submit",disabled:!k.value.trim()}," Add ",8,Jt),e("button",{onClick:G,class:"service-host-add-cancel"}," Cancel ")])])):(t(),s("button",{key:0,class:"service-host-add-btn",onClick:x[1]||(x[1]=A=>$.value=!0)}," + Add Service Host "))])])):f("",!0)]))}}),rt=ze(Wt,[["__scopeId","data-v-d602e67b"]]),Qt={class:"endpoint-tester"},Gt={class:"endpoint-header"},Xt={class:"endpoint-title"},Zt={class:"endpoint-path"},Yt={key:0,class:"endpoint-info"},es={key:0,class:"endpoint-summary-text"},ts={key:1,class:"endpoint-description"},ss={key:0,class:"security-schemes-wrapper"},ns={class:"security-schemes-section"},as=["onClick"],os={class:"scheme-name"},ls={class:"request-section"},rs={key:0,class:"params-section"},is={class:"params-list"},us={class:"param-name"},cs={key:0,class:"required"},ds={key:1,class:"param-desc"},vs=["onUpdate:modelValue","placeholder"],ps={key:1,class:"params-section"},hs={class:"params-list"},ms={class:"param-name"},ys={key:0,class:"required"},fs={key:1,class:"param-desc"},_s=["onUpdate:modelValue","placeholder"],ks={key:2,class:"body-section"},gs={class:"body-section-header"},Ss={class:"view-toggle"},bs={key:0,class:"schema-display"},ws={class:"schema-text"},Cs={key:1,class:"json-editor-wrapper"},$s=["disabled"],xs={class:"response-section"},As={class:"section-header"},Es={key:0,class:"no-response"},Bs={key:1,class:"no-response"},qs={key:2,class:"request-history-list"},Ls={class:"history-item-header"},js={class:"history-item-title"},Rs={class:"history-url"},Ts={class:"history-meta-group"},Ms={key:0,class:"history-auth-scheme"},Hs={key:1,class:"history-auth-scheme"},Ps={class:"history-timestamp"},Os={class:"history-curl-section"},zs=["onClick"],Is={class:"curl-header-left"},Vs=["onClick"],Ds={key:0,class:"curl-command"},Fs={key:0,class:"history-request-body"},Us={class:"json-editor-wrapper"},Ks={key:1,class:"history-error"},Ns={class:"error-message"},Js={key:2,class:"history-response"},Ws={class:"json-editor-wrapper"},Qs={class:"app-footer"},je="__clerk_bearer__",Gs=Be({__name:"EndpointTester",props:{path:{},method:{}},setup(i){const l=i,a=Ue(),u=Je(),$=Me(),H=Ke().hasClerkKey;let h=null;if(H)try{h=st()}catch(_){console.warn("Failed to initialize Clerk auth:",_),h=null}const R=p(()=>{if(!h)return!1;try{return h.isSignedIn.value??!1}catch{return!1}}),w=h?.getToken?.value??(()=>Promise.resolve(null)),L=p(()=>{if(!h)return!1;try{return h.isLoaded.value??!1}catch{return!1}}),P=q({}),O=q(""),G=q(null),N=q(null),X=q(!1),T=q({}),x=q(new Set),A=q(!1),U=p(()=>u.selectedAuthScheme),Y=p(()=>u.filteredRequestHistory),E=p(()=>!l.path||!l.method?null:a.getSelectedEndpoint(l.path,l.method)),C=p(()=>a.endpoints),S=p(()=>!E.value||!E.value.parameters?[]:E.value.parameters.map(a.resolveParameter).filter(_=>_!==null&&_.in==="path")),c=p(()=>!E.value||!E.value.parameters?[]:E.value.parameters.map(a.resolveParameter).filter(_=>_!==null&&_.in==="query")),v=p({get:()=>{if(!O.value.trim())return"{}";try{return O.value}catch{return"{}"}},set:_=>{O.value=_}}),V=p(()=>E.value?a.getRequestBodySchema(E.value):null),ue=p(()=>!V.value||!a.openApiSpec?null:a.formatSchemaForDisplay(V.value,a.openApiSpec)),te=()=>{A.value=!A.value},ce=p(()=>a.securitySchemes),Se=p(()=>E.value?a.getAvailableSecuritySchemes(E.value):[]),be=p(()=>(E.value?Se.value:ce.value).some(y=>y.scheme.type==="http"&&y.scheme.scheme==="bearer")),we=p(()=>{const _=E.value?[...Se.value]:[...ce.value];return be.value&&H&&(_.some(n=>n.name===je)||_.push({name:je,scheme:{type:"http",scheme:"bearer",description:"Clerk Bearer Authentication"}})),_}),me=_=>a.endpointRequiresSecurity(_),se=_=>{u.toggleSelectedAuthScheme(_)},o=_=>({GET:"#61affe",POST:"#49cc90",PUT:"#fca130",PATCH:"#50e3c2",DELETE:"#f93e3e"})[_]||"#999",B=async()=>{if(!l.path||!l.method)return;X.value=!0,G.value=null,N.value=null;const _={id:Date.now().toString()+Math.random().toString(36).substr(2,9),timestamp:new Date,method:l.method,path:l.path||"",url:"",requestBody:O.value.trim()?(()=>{try{return JSON.parse(O.value)}catch{return O.value}})():null,requestParams:{...P.value},headers:{},response:null,responseError:null,authScheme:U.value||null};try{let n=`${$.getServiceHostSync()}${l.path}`;const W={},ne=new URLSearchParams;for(const[K,I]of Object.entries(P.value))if(I!==""&&I!=null){const ae=C.value.find(m=>m.path===l.path&&m.method===l.method);let $e=!1;if(ae?.operation.parameters)for(const m of ae.operation.parameters){const r=a.resolveParameter(m);if(r&&r.name===K){$e=r.in==="path";break}}$e?W[K]=String(I):ne.append(K,String(I))}for(const[K,I]of Object.entries(W))n=n.replace(`{${K}}`,encodeURIComponent(I));const ee={"Content-Type":"application/json"};if(U.value===je){if(R.value){L.value||await new Promise(I=>{const ae=setInterval(()=>{L.value&&(clearInterval(ae),I(void 0))},100)});const K=await w();K&&(ee.Authorization=`Bearer ${K}`)}}else if(U.value&&a.openApiSpec?.components?.securitySchemes){const K=a.openApiSpec.components.securitySchemes[U.value];if(K&&typeof K=="object"&&!("$ref"in K)){const I=T.value[U.value];if(K.type==="apiKey"){const ae=K;I?.value&&(ae.in==="header"?ee[ae.name]=I.value:ae.in==="query"&&ne.append(ae.name,I.value))}else if(K.type==="http"){const ae=K;if(ae.scheme==="basic"){if(I?.username&&I?.password){const $e=`${I.username}:${I.password}`;ee.Authorization=`Basic ${btoa($e)}`}}else ae.scheme==="bearer"&&I?.token&&(ee.Authorization=`Bearer ${I.token}`)}else K.type==="oauth2"?I?.accessToken&&(ee.Authorization=`Bearer ${I.accessToken}`):K.type==="openIdConnect"&&I?.idToken&&(ee.Authorization=`Bearer ${I.idToken}`)}}ne.toString()&&(n+=`?${ne.toString()}`),_.url=n,_.headers={...ee};const Q={method:l.method,headers:ee};if(["POST","PUT","PATCH"].includes(l.method)&&O.value.trim())try{Q.body=JSON.stringify(JSON.parse(O.value))}catch{const I="Invalid JSON in request body";N.value=I,_.responseError=I,u.addRequestHistory(_),X.value=!1;return}const D=await fetch(n,Q),qe=D.headers.get("content-type");let Ce;if(qe?.includes("application/json"))Ce={status:D.status,statusText:D.statusText,headers:Object.fromEntries(D.headers.entries()),body:await D.json()};else{const K=await D.text();Ce={status:D.status,statusText:D.statusText,headers:Object.fromEntries(D.headers.entries()),body:K}}G.value=Ce,_.response=Ce,_.status=D.status,_.statusText=D.statusText}catch(y){const n=y instanceof Error?y.message:"Request failed";N.value=n,_.responseError=n}finally{X.value=!1,u.addRequestHistory(_)}},z=_=>{const y=["curl"];_.method!=="GET"&&y.push(`-X ${_.method}`);for(const[n,W]of Object.entries(_.headers||{})){const ne=W.replace(/"/g,'\\"');y.push(`-H "${n}: ${ne}"`)}if(["POST","PUT","PATCH"].includes(_.method)&&_.requestBody){const W=(typeof _.requestBody=="string"?_.requestBody:JSON.stringify(_.requestBody,null,2)).replace(/'/g,"'\\''").replace(/\n/g,"\\n");y.push(`-d '${W}'`)}return y.push(`"${_.url}"`),y.join(` \\
17
- `)},M=async _=>{const y=z(_);try{await navigator.clipboard.writeText(y)}catch(n){console.error("Failed to copy to clipboard:",n)}},ye=()=>{!l.path||!l.method||u.clearEndpointHistory(l.path,l.method)},fe=()=>{!l.path||!l.method||u.saveEndpointFormState(l.path,l.method,{requestParams:{...P.value},requestBody:O.value,selectedAuthScheme:U.value})};return le([()=>l.path,()=>l.method],([_,y],[n,W])=>{if(_!==n||y!==W){n&&W&&fe(),G.value=null,N.value=null,x.value.clear();const ne=u.getEndpointFormState(_||"",y||""),ee=!!ne;if(ee&&ne?(P.value={...ne.requestParams},O.value=ne.requestBody,u.setSelectedAuthScheme(ne.selectedAuthScheme)):(P.value={},O.value="",u.setSelectedAuthScheme(null)),E.value?.parameters)for(const Q of E.value.parameters){const D=a.resolveParameter(Q);D&&(D.in==="query"||D.in==="path")&&(!ee||!(D.name in P.value))&&(P.value[D.name]="")}else ee||(P.value={});if(!ee&&E.value?.requestBody){let Q=E.value.requestBody;if(Q&&typeof Q=="object"&&"$ref"in Q&&Q.$ref&&a.openApiSpec){const D=a.resolveReference(Q.$ref,a.openApiSpec);D&&typeof D=="object"&&(Q=D)}if(Q&&typeof Q=="object"&&"content"in Q&&Q.content){const D=Q.content["application/json"];if(D?.schema&&a.openApiSpec){const qe=a.generateExampleFromSchema(D.schema,a.openApiSpec);O.value=JSON.stringify(qe||{},null,2)}else O.value=JSON.stringify({},null,2)}}else ee||(O.value="")}},{immediate:!0}),le([P,O,U],()=>{l.path&&l.method&&fe()},{deep:!0}),(_,y)=>(t(),s("main",Qt,[e("div",Gt,[e("div",Xt,[e("span",{class:"method-badge large",style:Te({backgroundColor:o(i.method||"")})},b(i.method),5),e("span",Zt,b(i.path),1),E.value&&me(E.value)?(t(),Z(g(ke),{key:0,size:18,class:"security-indicator-large",title:"Requires authentication"})):f("",!0)]),E.value&&(E.value.summary||E.value.description)?(t(),s("div",Yt,[E.value.summary?(t(),s("p",es,b(E.value.summary),1)):f("",!0),E.value.description?(t(),s("p",ts,b(E.value.description),1)):f("",!0)])):f("",!0)]),we.value.length>0?(t(),s("div",ss,[y[1]||(y[1]=e("h4",{class:"security-schemes-title"},"Security Schemes",-1)),e("div",ns,[(t(!0),s(ve,null,pe(we.value,n=>(t(),s("div",{key:n.name,class:J(["security-scheme-card",{selected:U.value===n.name}]),onClick:W=>se(n.name)},[F(g(ke),{size:12,class:"security-card-icon"}),e("span",os,b(n.name===je?"Clerk Bearer":n.name),1)],10,as))),128))])])):f("",!0),e("div",ls,[y[5]||(y[5]=e("h3",null,"Request",-1)),S.value.length>0?(t(),s("div",rs,[y[2]||(y[2]=e("h4",null,"Path Parameters",-1)),e("dl",is,[(t(!0),s(ve,null,pe(S.value,n=>(t(),s("div",{key:n.name,class:"param-item"},[e("dt",null,[e("span",us,b(n.name),1),n.required?(t(),s("span",cs,"*")):f("",!0),n.description?(t(),s("span",ds," - "+b(n.description),1)):f("",!0)]),e("dd",null,[he(e("input",{"onUpdate:modelValue":W=>P.value[n.name]=W,type:"text",placeholder:n.schema&&"default"in n.schema?String(n.schema.default):""},null,8,vs),[[ge,P.value[n.name]]])])]))),128))])])):f("",!0),c.value.length>0?(t(),s("div",ps,[y[3]||(y[3]=e("h4",null,"Query Parameters",-1)),e("dl",hs,[(t(!0),s(ve,null,pe(c.value,n=>(t(),s("div",{key:n.name,class:"param-item"},[e("dt",null,[e("span",ms,b(n.name),1),n.required?(t(),s("span",ys,"*")):f("",!0),n.description?(t(),s("span",fs," - "+b(n.description),1)):f("",!0)]),e("dd",null,[he(e("input",{"onUpdate:modelValue":W=>P.value[n.name]=W,type:"text",placeholder:n.schema&&"default"in n.schema?String(n.schema.default):""},null,8,_s),[[ge,P.value[n.name]]])])]))),128))])])):f("",!0),E.value&&E.value.requestBody?(t(),s("div",ks,[e("div",gs,[y[4]||(y[4]=e("h4",null,"Request Body",-1)),e("div",Ss,[e("button",{onClick:te,class:J([{active:!A.value},"toggle-btn small"])}," Edit ",2),e("button",{onClick:te,class:J([{active:A.value},"toggle-btn small"])}," Schema ",2)])]),A.value&&ue.value?(t(),s("div",bs,[e("pre",ws,b(ue.value),1)])):A.value?f("",!0):(t(),s("div",Cs,[F(g(Ee),{text:v.value,"onUpdate:text":y[0]||(y[0]=n=>v.value=n),mode:"text",mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["text"])]))])):f("",!0),e("button",{onClick:B,class:"send-button",disabled:X.value},[F(g(ot),{size:16,class:"send-button-icon"}),e("span",null,b(X.value?"Sending...":"Send Request"),1)],8,$s)]),e("div",xs,[e("div",As,[y[6]||(y[6]=e("h3",null,"Request History",-1)),Y.value.length>0?(t(),s("button",{key:0,onClick:ye,class:"clear-history-btn"}," Clear History ")):f("",!0)]),!i.path||!i.method?(t(),s("div",Es," Select an endpoint to view request history. ")):Y.value.length===0?(t(),s("div",Bs,' No requests sent yet. Click "Send Request" to test the endpoint. ')):(t(),s("div",qs,[(t(!0),s(ve,null,pe(Y.value,n=>(t(),s("div",{key:n.id,class:"history-item"},[e("div",Ls,[e("div",js,[e("span",{class:J(["status-code",{success:n.status&&n.status>=200&&n.status<300,error:n.status&&n.status>=400,redirect:n.status&&n.status>=300&&n.status<400}])},b(n.status||"N/A"),3),e("span",Rs,b(n.url),1)]),e("div",Ts,[n.authScheme?(t(),s("span",Ms,[F(g(ke),{size:12}),We(" "+b(n.authScheme===je?"Clerk Bearer":n.authScheme),1)])):(t(),s("span",Hs,[F(g(Ne),{size:12}),y[7]||(y[7]=We(" Anonymous ",-1))])),e("span",Ps,b(new Date(n.timestamp).toLocaleTimeString()),1)])]),e("div",Os,[e("div",{class:"curl-header",onClick:W=>x.value.has(n.id)?x.value.delete(n.id):x.value.add(n.id)},[e("div",Is,[x.value.has(n.id)?(t(),Z(g(Oe),{key:0,size:16,class:"curl-toggle-icon"})):(t(),Z(g(Re),{key:1,size:16,class:"curl-toggle-icon"})),y[8]||(y[8]=e("h5",null,"cURL Command",-1))]),e("button",{onClick:ie(W=>M(n),["stop"]),class:"copy-curl-btn",title:"Copy cURL command"},[F(g(qt),{size:16}),y[9]||(y[9]=e("span",null,"Copy",-1))],8,Vs)],8,zs),x.value.has(n.id)?(t(),s("div",Ds,[e("pre",null,b(z(n)),1)])):f("",!0)]),n.requestBody?(t(),s("div",Fs,[y[10]||(y[10]=e("h5",null,"Request Body",-1)),e("div",Us,[F(g(Ee),{"model-value":n.requestBody,mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])])])):f("",!0),n.responseError?(t(),s("div",Ks,[y[11]||(y[11]=e("h5",null,"Error",-1)),e("div",Ns,b(n.responseError),1)])):n.response?(t(),s("div",Js,[y[12]||(y[12]=e("h5",null,"Response",-1)),e("div",Ws,[F(g(Ee),{"model-value":(()=>{if(typeof n.response.body=="string")try{return JSON.parse(n.response.body)}catch{return{text:n.response.body}}return n.response.body||{}})(),mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])])])):f("",!0)]))),128))]))]),e("footer",Qs,[e("p",null,"© "+b(new Date().getFullYear())+" Gamja Labs",1)])]))}}),Xs=ze(Gs,[["__scopeId","data-v-22faa190"]]),Zs={key:0,class:"auth-side-menu"},Ys={class:"auth-menu-header"},en={class:"auth-menu-content"},tn={class:"auth-scheme-header"},sn={style:{display:"flex","align-items":"center",gap:"0.5rem"}},nn={class:"auth-scheme-header"},an={style:{display:"flex","align-items":"center",gap:"0.5rem"}},on=["onClick"],ln={class:"auth-scheme-header"},rn={style:{display:"flex","align-items":"center",gap:"0.5rem"}},un={class:"auth-scheme-type"},cn={key:0,class:"auth-scheme-description"},dn={class:"field-location"},vn=["value","onInput","placeholder"],pn=["onClick"],hn=["value","onInput"],mn=["value","onInput"],yn=["onClick"],fn=["value","onInput"],_n=["onClick"],kn=["value","onInput"],gn=["onClick"],Sn=["value","onInput"],bn=["onClick"],wn={key:1,class:"clerk-key-card"},Cn={class:"clerk-key-description"},$n={key:0},xn={key:1},An={class:"clerk-key-fields"},En=["disabled"],Ie="__clerk_bearer__",Bn=Be({__name:"SecuritySchemeMenu",setup(i,{expose:l}){const a=Ke(),u=Ue(),$=Je(),k=Me(),H=p(()=>a.hasClerkKey),h=p(()=>u.securitySchemes),R=p(()=>$.selectedAuthScheme),w=p(()=>$.authMenuOpen),L=q({});p(()=>{if(!R.value)return"Anonymous";if(R.value===Ie)return"Clerk Bearer";const S=h.value.find(c=>c.name===R.value);return S?S.name:"Anonymous"});const P=p(()=>k.getSelectedServiceHost),O=q("");le(P,S=>{O.value=S?.clerkKey||""},{immediate:!0});const G=p(()=>!!P.value?.clerkKey?.trim()),N=p(()=>k.isClerkKeyFromConfig()||k.isClerkKeyFromEnv()),X=p(()=>k.isClerkKeyFromConfig()?"config.json":k.isClerkKeyFromEnv()?"env":P.value?.clerkKey?"serviceHost":null),T=p(()=>{const S=X.value;return S==="config.json"?`Key loaded from ${k.getConfigJsonPath()}`:S==="env"?"Key loaded from environment variable":S==="serviceHost"?"Key stored with service host":null}),x=(S,c,v)=>{L.value[S]||(L.value[S]={}),L.value[S][c]=v},A=S=>{delete L.value[S]},U=S=>{$.toggleSelectedAuthScheme(S)},Y=()=>{P.value&&(k.saveClerkKeyForSelectedHost(O.value),typeof window<"u"&&window.location.reload())},E=()=>{P.value&&(k.clearClerkKeyForSelectedHost(),typeof window<"u"&&window.location.reload())},C=()=>{$.closeAuthMenu()};return l({authCredentials:L}),(S,c)=>w.value?(t(),s("aside",Zs,[e("div",Ys,[c[8]||(c[8]=e("h2",null,"Security Scheme",-1)),e("button",{onClick:C,class:"close-auth-menu",title:"Close"},[F(g(lt),{size:20})])]),e("div",en,[e("div",{class:J(["auth-scheme anonymous-option",{selected:R.value===null}]),onClick:c[0]||(c[0]=v=>U(null))},[e("div",tn,[e("div",sn,[F(g(Ne),{size:18}),c[9]||(c[9]=e("h3",null,"Anonymous",-1))]),c[10]||(c[10]=e("span",{class:"auth-scheme-type"},"NONE",-1))]),c[11]||(c[11]=e("div",{class:"auth-scheme-description"}," Make requests without authentication ",-1))],2),H.value?(t(),s("div",{key:0,class:J(["auth-scheme clerk-bearer-option",{selected:R.value===Ie}]),onClick:c[1]||(c[1]=v=>U(Ie))},[e("div",nn,[e("div",an,[F(g(ke),{size:18}),c[12]||(c[12]=e("h3",null,"Clerk Bearer",-1))]),c[13]||(c[13]=e("span",{class:"auth-scheme-type"},"CLERK",-1))]),c[14]||(c[14]=e("div",{class:"auth-scheme-description"}," Use Clerk authentication token for bearer authentication ",-1))],2)):f("",!0),(t(!0),s(ve,null,pe(h.value,v=>(t(),s("div",{key:v.name,class:J(["auth-scheme",{selected:R.value===v.name}]),onClick:V=>U(v.name)},[e("div",ln,[e("div",rn,[F(g(ke),{size:18}),e("h3",null,b(v.name),1)]),e("span",un,b(v.scheme.type),1)]),v.scheme.description?(t(),s("div",cn,b(v.scheme.description),1)):f("",!0),v.scheme.type==="apiKey"?(t(),s("div",{key:1,class:"auth-scheme-fields",onClick:c[2]||(c[2]=ie(()=>{},["stop"]))},[e("label",null,[e("span",null,b(v.scheme.name),1),e("span",dn,"("+b(v.scheme.in)+")",1),e("input",{type:"text",value:L.value[v.name]?.value||"",onInput:V=>x(v.name,"value",V.target.value),placeholder:`Enter ${v.scheme.name}`,class:"auth-input"},null,40,vn)]),L.value[v.name]?.value?(t(),s("button",{key:0,onClick:V=>A(v.name),class:"clear-credential-btn"}," Clear ",8,pn)):f("",!0)])):v.scheme.type==="http"&&v.scheme.scheme==="basic"?(t(),s("div",{key:2,class:"auth-scheme-fields",onClick:c[3]||(c[3]=ie(()=>{},["stop"]))},[e("label",null,[c[15]||(c[15]=e("span",null,"Username",-1)),e("input",{type:"text",value:L.value[v.name]?.username||"",onInput:V=>x(v.name,"username",V.target.value),placeholder:"Enter username",class:"auth-input"},null,40,hn)]),e("label",null,[c[16]||(c[16]=e("span",null,"Password",-1)),e("input",{type:"text",value:L.value[v.name]?.password||"",onInput:V=>x(v.name,"password",V.target.value),placeholder:"Enter password",class:"auth-input"},null,40,mn)]),L.value[v.name]?.username||L.value[v.name]?.password?(t(),s("button",{key:0,onClick:V=>A(v.name),class:"clear-credential-btn"}," Clear ",8,yn)):f("",!0)])):v.scheme.type==="http"&&v.scheme.scheme==="bearer"?(t(),s("div",{key:3,class:"auth-scheme-fields",onClick:c[4]||(c[4]=ie(()=>{},["stop"]))},[e("label",null,[c[17]||(c[17]=e("span",null,"Bearer Token",-1)),e("input",{type:"text",value:L.value[v.name]?.token||"",onInput:V=>x(v.name,"token",V.target.value),placeholder:"Enter bearer token",class:"auth-input"},null,40,fn)]),L.value[v.name]?.token?(t(),s("button",{key:0,onClick:V=>A(v.name),class:"clear-credential-btn"}," Clear ",8,_n)):f("",!0)])):v.scheme.type==="oauth2"?(t(),s("div",{key:4,class:"auth-scheme-fields",onClick:c[5]||(c[5]=ie(()=>{},["stop"]))},[e("label",null,[c[18]||(c[18]=e("span",null,"Access Token",-1)),e("input",{type:"text",value:L.value[v.name]?.accessToken||"",onInput:V=>x(v.name,"accessToken",V.target.value),placeholder:"Enter OAuth2 access token",class:"auth-input"},null,40,kn)]),L.value[v.name]?.accessToken?(t(),s("button",{key:0,onClick:V=>A(v.name),class:"clear-credential-btn"}," Clear ",8,gn)):f("",!0)])):v.scheme.type==="openIdConnect"?(t(),s("div",{key:5,class:"auth-scheme-fields",onClick:c[6]||(c[6]=ie(()=>{},["stop"]))},[e("label",null,[c[19]||(c[19]=e("span",null,"ID Token",-1)),e("input",{type:"text",value:L.value[v.name]?.idToken||"",onInput:V=>x(v.name,"idToken",V.target.value),placeholder:"Enter OpenID Connect ID token",class:"auth-input"},null,40,Sn)]),L.value[v.name]?.idToken?(t(),s("button",{key:0,onClick:V=>A(v.name),class:"clear-credential-btn"}," Clear ",8,bn)):f("",!0)])):f("",!0)],10,on))),128)),P.value?(t(),s("div",wn,[c[21]||(c[21]=e("div",{class:"clerk-key-header"},[e("h3",null,"Clerk Publishable Key")],-1)),e("div",Cn,[T.value?(t(),s("span",$n,b(T.value),1)):(t(),s("span",xn," Enter your Clerk publishable key to enable authentication. This will be stored with the selected service host. "))]),e("div",An,[e("label",null,[c[20]||(c[20]=e("span",null,"Publishable Key",-1)),he(e("input",{"onUpdate:modelValue":c[7]||(c[7]=v=>O.value=v),type:"text",placeholder:"pk_test_...",class:"clerk-key-input",disabled:G.value||N.value},null,8,En),[[ge,O.value]])]),!G.value&&!N.value?(t(),s("button",{key:0,onClick:Y,class:"save-button"}," Save and reload ")):G.value&&!N.value?(t(),s("button",{key:1,onClick:E,class:"save-button"}," Clear and reload ")):f("",!0)])])):f("",!0)])])):f("",!0)}}),qn=ze(Bn,[["__scopeId","data-v-5eddcad1"]]),Ln={key:0,class:"service-host-input-section"},jn={key:0,class:"welcome-description"},Rn={key:1,class:"welcome-description"},Tn={key:3,class:"service-host-direct-form"},Mn={class:"service-host-input-wrapper"},Hn=["disabled"],Pn=Be({__name:"WelcomeServiceHostInput",setup(i){const l=Me(),a=nt(),u=q(""),$=q(""),k=p(()=>l.serviceHosts),H=p(()=>l.hasServiceHost),h=async()=>{u.value.trim()&&(await l.handleDirectConnect(u.value.trim(),$.value.trim()||void 0),u.value="",$.value="")};return(R,w)=>g(a).isServiceHostPickerEnabled&&!H.value?(t(),s("div",Ln,[k.value.length>0?(t(),s("p",jn," Please select or add a service host to get started. ")):(t(),s("p",Rn," Please enter your service host URL to get started. ")),k.value.length>0?(t(),Z(rt,{key:2})):(t(),s("div",Tn,[e("div",Mn,[he(e("input",{"onUpdate:modelValue":w[0]||(w[0]=L=>u.value=L),type:"text",placeholder:"Base URL (e.g., https://api.example.com)",class:"service-host-input",onKeyup:Pe(h,["enter"])},null,544),[[ge,u.value]]),he(e("input",{"onUpdate:modelValue":w[1]||(w[1]=L=>$.value=L),type:"text",placeholder:"OpenAPI Path (optional, e.g., /openapi.json)",class:"service-host-input",onKeyup:Pe(h,["enter"])},null,544),[[ge,$.value]]),e("button",{onClick:h,class:"service-host-submit-btn",disabled:!u.value.trim()}," Connect ",8,Hn)])]))])):f("",!0)}}),On=ze(Pn,[["__scopeId","data-v-cbfcc6b2"]]),zn={class:"openapi-test"},In={class:"test-header"},Vn={class:"header-content"},Dn={class:"header-title-section"},Fn={class:"title-section-content"},Un={class:"title-row"},Kn={class:"logo"},Nn={key:0,class:"api-version"},Jn={key:0,class:"api-description"},Wn={key:0,class:"header-title-section"},Qn=["disabled"],Gn={class:"header-actions"},Xn=["href"],Zn={href:"https://github.com/gamja-labs/openapi-studio",target:"_blank",rel:"noopener noreferrer",class:"github-link",title:"View on GitHub"},Yn={key:1,class:"auth-section"},ea={key:1,class:"user-section"},ta={class:"test-container"},sa={class:"sidebar-header"},na=["title"],aa={class:"sidebar-content"},oa={key:0,class:"loading"},la={key:1,class:"error"},ra={key:2,class:"endpoints-groups"},ia=["onClick"],ua={class:"group-name"},ca={class:"group-count"},da={class:"group-toggle"},va={key:0,class:"group-endpoints"},pa=["onClick"],ha={class:"endpoint-path"},ma={key:0,class:"endpoint-summary"},ya={key:2,class:"endpoint-content"},fa={class:"examples-header"},_a=["title"],ka={class:"examples-content"},ga={key:0,class:"example-section"},Sa={class:"example-section-header"},ba={class:"view-toggle"},wa={class:"example-content"},Ca={key:0,class:"schema-display"},$a={class:"schema-text"},xa={key:1,class:"json-editor-wrapper"},Aa={key:1,class:"example-section"},Ea={class:"response-codes-list"},Ba={class:"response-code-header"},qa={class:"response-code-number"},La={class:"response-code-right"},ja={key:0,class:"response-code-description"},Ra={class:"view-toggle"},Ta=["onClick"],Ma=["onClick"],Ha={key:0,class:"example-content"},Pa={key:0,class:"schema-display"},Oa={class:"schema-text"},za={key:1,class:"json-editor-wrapper"},Ia={key:1,class:"no-example"},Va={key:2,class:"no-examples"},Da={key:3,class:"example-section"},Fa={class:"schema-references-list"},Ua=["onClick"],Ka={class:"schema-reference-toggle"},Na={class:"schema-reference-name"},Ja={key:0,class:"example-content"},Wa={class:"schema-display"},Qa={class:"schema-text"},Ga={key:3,class:"endpoint-tester empty"},Xa={class:"empty-state"},Za={class:"welcome-content"},Ya={class:"welcome-icon"},eo={key:0,class:"welcome-description"},to={key:1,class:"welcome-tips"},so={class:"tip-item"},no={class:"tip-item"},ao={class:"tip-item"},oo={class:"app-footer"},lo="__clerk_bearer__",io=Be({__name:"Main",setup(i){const l=tt(),a=Me(),u=p(()=>a.hasServiceHost),$=pt(),k=ht(),H=Ke(),h=Ue(),R=Je(),w=nt();let L=H.hasClerkKey,P=null;if(L)try{P=st()}catch(m){console.warn("Failed to initialize Clerk auth:",m),L=!1,P=null}const O=p(()=>{if(!P)return!1;try{return P.isSignedIn.value??!1}catch{return!1}}),G=p(()=>h.openApiSpec),N=p(()=>h.loading),X=p(()=>h.error),T=p(()=>R.selectedPath),x=p(()=>R.selectedMethod),A=p(()=>R.selectedAuthScheme),U=q(new Set),Y=q(new Set),E=q(new Map),C=q(!1),S=q(!1),c=q(500),v=q(400),V=q(!1),ue=q(!1),te=p(()=>h.getSelectedEndpoint(T.value,x.value)),ce=p(()=>h.endpoints),Se=p(()=>{if(ce.value.length===0)return[];const m=new Map;for(const r of ce.value){const d=r.operation.tags||[];if(d.length>0){const j=d[0];j&&(m.has(j)||m.set(j,{name:j,endpoints:[]}),m.get(j).endpoints.push(r))}else{const j=r.path.split("/").filter(_e=>_e),oe=j.length>0?`/${j[0]}`:"Other";m.has(oe)||m.set(oe,{name:oe,endpoints:[]}),m.get(oe).endpoints.push(r)}}return U.value.size===0&&m.forEach((r,d)=>U.value.add(d)),Array.from(m.values()).sort((r,d)=>r.name.localeCompare(d.name))}),be=m=>{U.value.has(m)?U.value.delete(m):U.value.add(m)},we=m=>{Y.value.has(m)?Y.value.delete(m):Y.value.add(m)},me=m=>{const r=E.value.get(m)||!1;E.value.set(m,!r)},se=m=>E.value.get(m)||!1,o=new Map;async function B(m,r){const d=`${r}:${m}`;if(o.has(d))return o.get(d);const oe=new TextEncoder().encode(d),_e=await crypto.subtle.digest("SHA-256",oe),xe=Array.from(new Uint8Array(_e)).map(it=>it.toString(16).padStart(2,"0")).join("").slice(0,16);return o.set(d,xe),xe}function z(m,r){const d=`${r}:${m}`;return o.get(d)||""}async function M(){const m=k.query.endpoint;if(!m)return null;for(const r of ce.value)if(await B(r.path,r.method)===m)return{path:r.path,method:r.method};return null}Fe(async()=>{H.loadClerkKey(),a.initialize(),C.value=l.loadSidebarCollapsed(),S.value=l.loadExamplesSidebarCollapsed(),c.value=l.loadEndpointsSidebarWidth(),v.value=l.loadExamplesSidebarWidth(),await a.loadOpenApiSpec();for(const r of ce.value)await B(r.path,r.method);const m=await M();m&&(await Ve(),await _(m.path,m.method,!1)),le(()=>k.query.endpoint,async r=>{if(r){const d=await M();d&&(T.value!==d.path||x.value!==d.method)&&await _(d.path,d.method,!1)}else(T.value||x.value)&&R.setSelectedEndpoint(null,null)}),le(C,r=>{l.saveSidebarCollapsed(r)}),le(S,r=>{l.saveExamplesSidebarCollapsed(r)}),le(c,r=>{l.saveEndpointsSidebarWidth(r)}),le(v,r=>{l.saveExamplesSidebarWidth(r)})});const ye=m=>{V.value=!0;const r=m.clientX,d=c.value,j=_e=>{const He=_e.clientX-r,xe=Math.max(200,Math.min(800,d+He));c.value=xe},oe=()=>{V.value=!1,document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",oe)};document.addEventListener("mousemove",j),document.addEventListener("mouseup",oe)},fe=m=>{ue.value=!0;const r=m.clientX,d=v.value,j=_e=>{const He=r-_e.clientX,xe=Math.max(200,Math.min(800,d+He));v.value=xe},oe=()=>{ue.value=!1,document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",oe)};document.addEventListener("mousemove",j),document.addEventListener("mouseup",oe)},_=async(m,r,d=!0)=>{if(R.setSelectedEndpoint(m,r),Y.value.clear(),E.value.clear(),d){const j=z(m,r)||await B(m,r);k.query.endpoint!==j&&await $.replace({query:{...k.query,endpoint:j}})}},y=m=>({GET:"#61affe",POST:"#49cc90",PUT:"#fca130",PATCH:"#50e3c2",DELETE:"#f93e3e"})[m]||"#999",n=p(()=>te.value?h.getExampleFromRequestBody(te.value):null),W=p(()=>te.value?h.getRequestBodySchema(te.value):null),ne=p(()=>!W.value||!G.value?null:h.formatSchemaForDisplay(W.value,G.value)),ee=m=>!m||!G.value?null:h.formatSchemaForDisplay(m,G.value),Q=p(()=>te.value?h.getAllResponseExamples(te.value):[]),D=p(()=>te.value?h.getEndpointSchemaReferences(te.value):[]),qe=m=>h.endpointRequiresSecurity(m),Ce=p(()=>h.openApiTitle),K=p(()=>h.openApiDescription),I=p(()=>h.openApiVersion),ae=p(()=>{if(!A.value)return"Anonymous";if(A.value===lo)return"Clerk Bearer";const r=h.securitySchemes.find(d=>d.name===A.value);return r?r.name:"Anonymous"}),$e=async()=>{a.clearConfigCache(),await h.loadSpec()};return(m,r)=>(t(),s("div",zn,[e("header",In,[e("div",Vn,[e("div",Dn,[e("div",Fn,[e("div",Un,[e("h1",Kn,b(Ce.value),1),I.value?(t(),s("div",Nn,"v"+b(I.value),1)):f("",!0)]),K.value?(t(),s("p",Jn,b(K.value),1)):f("",!0)]),u.value?(t(),s("div",Wn,[u.value?(t(),s("button",{key:0,onClick:$e,class:"refresh-spec-btn",disabled:g(h).loading,title:"Refresh OpenAPI Spec"},[F(g(jt),{size:20,class:J({spinning:g(h).loading})},null,8,["class"])],8,Qn)):f("",!0)])):f("",!0)]),e("div",Gn,[g(w).isServiceHostPickerEnabled?(t(),Z(rt,{key:0})):f("",!0),e("a",{href:g(h).openApiSpecUrl,target:"_blank",rel:"noopener noreferrer",class:"openapi-spec-link",title:"View OpenAPI Spec JSON"},[F(g(Ye),{size:20})],8,Xn),e("a",Zn,[F(g(Lt),{size:20})]),e("button",{onClick:r[0]||(r[0]=(...d)=>g(R).toggleAuthMenu&&g(R).toggleAuthMenu(...d)),class:J(["auth-menu-toggle",{active:g(R).authMenuOpen,"has-selection":A.value}]),title:"Security Scheme"},[A.value?(t(),Z(g(ke),{key:1,size:16})):(t(),Z(g(Ne),{key:0,size:16})),e("span",null,b(A.value?ae.value:"Security"),1)],2),g(L)?(t(),s("div",Yn,[O.value?(t(),s("div",ea,[F(g(ft))])):(t(),Z(g(yt),{key:0,mode:"modal"},{default:mt(()=>[...r[5]||(r[5]=[e("button",{class:"sign-in-btn"},"Sign In",-1)])]),_:1}))])):f("",!0)])])]),F(qn),e("div",ta,[u.value?(t(),s("aside",{key:0,class:J(["endpoints-sidebar",{collapsed:C.value,resizing:V.value}]),style:Te({width:C.value?"60px":`${c.value}px`})},[e("div",sa,[r[6]||(r[6]=e("h2",null,"Endpoints ",-1)),e("button",{onClick:r[1]||(r[1]=d=>C.value=!C.value),class:"sidebar-toggle",title:C.value?"Expand sidebar":"Collapse sidebar"},[C.value?(t(),Z(g(Re),{key:0,size:16})):(t(),Z(g(Ze),{key:1,size:16}))],8,na)]),he(e("div",aa,[N.value?(t(),s("div",oa,"Loading OpenAPI spec...")):X.value?(t(),s("div",la,b(X.value),1)):(t(),s("div",ra,[(t(!0),s(ve,null,pe(Se.value,d=>(t(),s("div",{key:d.name,class:"endpoint-group"},[e("div",{class:"group-header",onClick:j=>be(d.name)},[e("span",ua,b(d.name),1),e("span",ca,"("+b(d.endpoints.length)+")",1),e("span",da,[U.value.has(d.name)?(t(),Z(g(Oe),{key:0,size:14})):(t(),Z(g(Re),{key:1,size:14}))])],8,ia),U.value.has(d.name)?(t(),s("div",va,[(t(!0),s(ve,null,pe(d.endpoints,j=>(t(),s("div",{key:`${j.method}-${j.path}`,class:J(["endpoint-item",{active:T.value===j.path&&x.value===j.method}]),onClick:ie(oe=>_(j.path,j.method),["stop"])},[e("span",{class:"method-badge",style:Te({backgroundColor:y(j.method)})},b(j.method),5),e("span",ha,b(j.path),1),j.operation.summary?(t(),s("span",ma,b(j.operation.summary),1)):f("",!0),qe(j.operation)?(t(),Z(g(ke),{key:1,size:14,class:"security-indicator",title:"Requires authentication"})):f("",!0)],10,pa))),128))])):f("",!0)]))),128))]))],512),[[Qe,!C.value]])],6)):f("",!0),u.value&&!C.value?(t(),s("div",{key:1,class:J(["resize-handle resize-handle-endpoints",{resizing:V.value}]),onMousedown:ye},null,34)):f("",!0),te.value?(t(),s("div",ya,[F(Xs,{path:T.value,method:x.value},null,8,["path","method"]),S.value?f("",!0):(t(),s("div",{key:0,class:J(["resize-handle resize-handle-examples",{resizing:ue.value}]),onMousedown:fe},null,34)),e("aside",{class:J(["examples-sidebar",{collapsed:S.value,resizing:ue.value}]),style:Te({width:S.value?"60px":`${v.value}px`})},[e("div",fa,[r[7]||(r[7]=e("h3",null,"Examples",-1)),e("button",{onClick:r[2]||(r[2]=d=>S.value=!S.value),class:"examples-toggle",title:S.value?"Expand examples":"Collapse examples"},[S.value?(t(),Z(g(Ze),{key:0,size:16})):(t(),Z(g(Re),{key:1,size:16}))],8,_a)]),he(e("div",ka,[n.value||W.value?(t(),s("div",ga,[e("div",Sa,[e("h4",null,b(se("request-body")?"Request Body Schema":"Example Request Body"),1),e("div",ba,[e("button",{onClick:r[3]||(r[3]=d=>me("request-body")),class:J([{active:!se("request-body")},"toggle-btn"])}," Example ",2),e("button",{onClick:r[4]||(r[4]=d=>me("request-body")),class:J([{active:se("request-body")},"toggle-btn"])}," Schema ",2)])]),e("div",wa,[se("request-body")&&ne.value?(t(),s("div",Ca,[e("pre",$a,b(ne.value),1)])):se("request-body")?f("",!0):(t(),s("div",xa,[F(g(Ee),{"model-value":n.value,mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])]))])])):f("",!0),Q.value.length>0?(t(),s("div",Aa,[r[8]||(r[8]=e("h4",null,"Response Codes",-1)),e("div",Ea,[(t(!0),s(ve,null,pe(Q.value,d=>(t(),s("div",{key:d.code,class:"response-code-item"},[e("div",Ba,[e("div",{class:J(["response-code-left",{success:d.isSuccess,error:!d.isSuccess}])},[e("span",qa,b(d.code),1)],2),e("div",La,[d.description?(t(),s("div",ja,b(d.description),1)):f("",!0),e("div",Ra,[e("button",{onClick:j=>me(`response-${d.code}`),class:J([{active:!se(`response-${d.code}`)},"toggle-btn small"])}," Example ",10,Ta),e("button",{onClick:j=>me(`response-${d.code}`),class:J([{active:se(`response-${d.code}`)},"toggle-btn small"])}," Schema ",10,Ma)])])]),(se(`response-${d.code}`)?d.schema:d.example)?(t(),s("div",Ha,[se(`response-${d.code}`)&&d.schema?(t(),s("div",Pa,[e("pre",Oa,b(ee(d.schema)),1)])):se(`response-${d.code}`)?f("",!0):(t(),s("div",za,[F(g(Ee),{"model-value":d.example,mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])]))])):(t(),s("div",Ia," No "+b(se(`response-${d.code}`)?"schema":"example")+" available ",1))]))),128))])])):f("",!0),!n.value&&Q.value.length===0?(t(),s("div",Va," No examples available for this endpoint. ")):f("",!0),D.value.length>0?(t(),s("div",Da,[r[9]||(r[9]=e("h4",null,"Referenced Schemas",-1)),e("div",Fa,[(t(!0),s(ve,null,pe(D.value,d=>(t(),s("div",{key:d.name,class:"schema-reference-item"},[e("div",{class:"schema-reference-header",onClick:j=>we(d.name)},[e("span",Ka,[Y.value.has(d.name)?(t(),Z(g(Oe),{key:0,size:14})):(t(),Z(g(Re),{key:1,size:14}))]),e("span",Na,b(d.name),1)],8,Ua),Y.value.has(d.name)?(t(),s("div",Ja,[e("div",Wa,[e("pre",Qa,b(g(h).formatSchemaForDisplay(d.schema,G.value)),1)])])):f("",!0)]))),128))])])):f("",!0)],512),[[Qe,!S.value]])],6)])):(t(),s("main",Ga,[e("div",Xa,[e("div",Za,[e("div",Ya,[F(g(ot),{size:64})]),r[13]||(r[13]=e("h1",{class:"welcome-title"},"Welcome to OpenAPI Studio",-1)),u.value?(t(),s("p",eo," Select an endpoint from the sidebar to start testing your API endpoints. ")):f("",!0),F(On),u.value?(t(),s("div",to,[e("div",so,[F(g(Ye),{size:20,class:"tip-icon"}),r[10]||(r[10]=e("span",null,"Browse available endpoints in the sidebar",-1))]),e("div",no,[F(g(Rt),{size:20,class:"tip-icon"}),r[11]||(r[11]=e("span",null,"Test requests with custom parameters",-1))]),e("div",ao,[F(g(Bt),{size:20,class:"tip-icon"}),r[12]||(r[12]=e("span",null,"View responses and schema documentation",-1))])])):f("",!0)])]),e("footer",oo,[e("p",null,"© "+b(new Date().getFullYear())+" Gamja Labs",1)])]))])]))}});export{io as default};