@zuplo/runtime 6.70.33 → 6.70.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/esm/{chunk-SFFHEDT5.js → chunk-HOAEPNOG.js} +29 -29
- package/out/esm/{chunk-SFFHEDT5.js.map → chunk-HOAEPNOG.js.map} +1 -1
- package/out/esm/index.js +1 -1
- package/out/esm/mcp-gateway/index.js +1 -1
- package/out/types/index.d.ts +7 -0
- package/package.json +1 -1
- /package/out/esm/{chunk-SFFHEDT5.js.LEGAL.txt → chunk-HOAEPNOG.js.LEGAL.txt} +0 -0
package/out/esm/index.js
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{$a as qt,$b as Jr,Aa as ht,Ab as hr,B as v,Ba as mt,Bb as mr,C as G,Ca as gt,Cb as gr,D as I,Da as dt,Db as dr,E as J,Ea as ut,Eb as ur,F as K,Fa as ft,Fb as fr,G as M,Ga as xt,Gb as xr,H as N,Ha as yt,Hb as yr,I as O,Ia as wt,Ib as wr,Ja as At,Jb as Ar,Ka as bt,Kb as br,La as lt,Lb as lr,Ma as jt,Mb as jr,Na as Bt,Nb as Br,Oa as Ct,Ob as Cr,Pa as Dt,Pb as Dr,Qa as Et,Qb as Er,Ra as Ht,Rb as $r,Sa as Pt,Sb as kr,Ta as St,Tb as Fr,Ua as Tt,Ub as Lr,Va as Ut,Vb as Rr,Wa as $t,Wb as qr,Xa as kt,Xb as vr,Ya as Ft,Yb as zr,Za as Lt,Zb as Gr,_a as Rt,_b as Ir,a as n,ab as vt,ac as Kr,bb as zt,bc as Mr,c as x,cb as Gt,cc as Nr,d as y,db as It,dc as Or,e as w,eb as Jt,ec as Qr,f as A,fb as Kt,fc as Vr,g as b,gb as Mt,gc as Wr,h as l,hb as Nt,hc as Xr,i as j,ib as Ot,ic as Yr,j as B,ja as Q,jb as Qt,jc as Zr,ka as V,kb as Vt,kc as _r,l as C,la as W,lb as Wt,lc as ts,m as D,ma as X,mb as Xt,mc as rs,n as E,na as Y,nb as Yt,nc as ss,o as H,oa as Z,ob as Zt,oc as es,p as P,pa as _,pb as _t,pc as os,qa as tt,qb as tr,qc as as,r as T,ra as rt,rb as rr,s as U,sa as st,sb as sr,t as $,ta as et,tb as er,u as k,ua as ot,ub as or,v as F,va as at,vb as ar,w as L,wa as nt,wb as nr,xa as it,xb as ir,y as R,ya as pt,yb as pr,z as q,za as ct,zb as cr}from"./chunk-
|
|
25
|
+
import{$a as qt,$b as Jr,Aa as ht,Ab as hr,B as v,Ba as mt,Bb as mr,C as G,Ca as gt,Cb as gr,D as I,Da as dt,Db as dr,E as J,Ea as ut,Eb as ur,F as K,Fa as ft,Fb as fr,G as M,Ga as xt,Gb as xr,H as N,Ha as yt,Hb as yr,I as O,Ia as wt,Ib as wr,Ja as At,Jb as Ar,Ka as bt,Kb as br,La as lt,Lb as lr,Ma as jt,Mb as jr,Na as Bt,Nb as Br,Oa as Ct,Ob as Cr,Pa as Dt,Pb as Dr,Qa as Et,Qb as Er,Ra as Ht,Rb as $r,Sa as Pt,Sb as kr,Ta as St,Tb as Fr,Ua as Tt,Ub as Lr,Va as Ut,Vb as Rr,Wa as $t,Wb as qr,Xa as kt,Xb as vr,Ya as Ft,Yb as zr,Za as Lt,Zb as Gr,_a as Rt,_b as Ir,a as n,ab as vt,ac as Kr,bb as zt,bc as Mr,c as x,cb as Gt,cc as Nr,d as y,db as It,dc as Or,e as w,eb as Jt,ec as Qr,f as A,fb as Kt,fc as Vr,g as b,gb as Mt,gc as Wr,h as l,hb as Nt,hc as Xr,i as j,ib as Ot,ic as Yr,j as B,ja as Q,jb as Qt,jc as Zr,ka as V,kb as Vt,kc as _r,l as C,la as W,lb as Wt,lc as ts,m as D,ma as X,mb as Xt,mc as rs,n as E,na as Y,nb as Yt,nc as ss,o as H,oa as Z,ob as Zt,oc as es,p as P,pa as _,pb as _t,pc as os,qa as tt,qb as tr,qc as as,r as T,ra as rt,rb as rr,s as U,sa as st,sb as sr,t as $,ta as et,tb as er,u as k,ua as ot,ub as or,v as F,va as at,vb as ar,w as L,wa as nt,wb as nr,xa as it,xb as ir,y as R,ya as pt,yb as pr,z as q,za as ct,zb as cr}from"./chunk-HOAEPNOG.js";import{a as S,d as z,e as Hr,f as Pr,g as Sr,h as Tr,i as Ur}from"./chunk-TOF2KNST.js";import"./chunk-A2CSR4RF.js";import{_ as u,a as t,aa as a,ba as f}from"./chunk-2VLXJLVI.js";var e=["sha-1","sha-256","sha-384","sha-512"],r=class{static{t(this,"BaseCryptoBeta")}};var o=class extends r{static{t(this,"WorkerCryptoBeta")}async digest(s,p){if(n("runtime.crypto-beta"),!e.includes(s.toLowerCase()))throw new a(`Algorithm ${s} is not supported. Try using ${e.join(", ")}`);let c=new TextEncoder().encode(p),h=await crypto.subtle.digest(s,c);return Array.from(new Uint8Array(h)).map(m=>m.toString(16).padStart(2,"0")).join("")}};export{Dt as AIGatewayAnthropicToOpenAIInboundPolicy,Et as AIGatewayAuthInboundPolicy,I as AIGatewayMeteringInboundPolicy,Ht as AIGatewayOpenAIToAnthropicOutboundPolicy,Pt as AIGatewaySemanticCacheInboundPolicy,St as AIGatewaySemanticCacheOutboundPolicy,Tt as AIGatewayUsageTrackerPolicy,rt as AWSLoggingPlugin,Ut as AkamaiAIFirewallInboundPolicy,wt as AkamaiApiSecurityPlugin,$t as AkamaiFirewallForAiInboundPolicy,kt as AkamaiFirewallForAiOutboundPolicy,Lt as AmberfloMeteringInboundPolicy,Ft as AmberfloMeteringPolicy,qt as ApiAuthKeyInboundPolicy,os as ApiKeyConsumerClient,Rt as ApiKeyInboundPolicy,dt as AuditLogDataStaxProvider,ut as AuditLogPlugin,zt as Auth0JwtInboundPolicy,Gt as AuthZenInboundPolicy,K as AwsLambdaHandlerExtensions,It as AxiomaticsAuthZInboundPolicy,bt as AzureBlobPlugin,lt as AzureEventHubsRequestLoggerPlugin,At as BackgroundDispatcher,as as BackgroundLoader,Jt as BasicAuthInboundPolicy,br as BasicRateLimitInboundPolicy,P as BatchDispatch,Kt as BrownoutInboundPolicy,Mt as CachingInboundPolicy,Nt as ChangeMethodInboundPolicy,Ot as ClearHeadersInboundPolicy,Qt as ClearHeadersOutboundPolicy,Vt as ClerkJwtInboundPolicy,Wt as CognitoJwtInboundPolicy,Xt as CometOpikTracingInboundPolicy,Yt as ComplexRateLimitInboundPolicy,Zt as CompositeInboundPolicy,_t as CompositeOutboundPolicy,f as ConfigurationError,E as ContentTypes,v as ContextData,o as CryptoBeta,tr as CurityPhantomTokenInboundPolicy,F as DataDogLoggingPlugin,ct as DataDogMetricsPlugin,st as DynaTraceLoggingPlugin,ht as DynatraceMetricsPlugin,rr as FirebaseJwtInboundPolicy,sr as FormDataToJsonInboundPolicy,er as GalileoTracingInboundPolicy,or as GeoFilterInboundPolicy,k as GoogleCloudLoggingPlugin,G as Handler,ar as HttpDeprecationOutboundPolicy,B as HttpProblems,b as HttpStatusCode,Bt as HydrolixRequestLoggerPlugin,U as InboundPolicy,nr as JWTScopeValidationInboundPolicy,ft as JwtServicePlugin,et as LokiLoggingPlugin,L as LookupResult,mr as MTLSAuthInboundPolicy,xt as McpGatewayOAuthProtectedResourcePlugin,w as MemoryZoneReadThroughCache,ir as MockApiInboundPolicy,cr as MoesifInboundPolicy,hr as MonetizationInboundPolicy,ot as NewRelicLoggingPlugin,mt as NewRelicMetricsPlugin,yt as OAuthProtectedResourcePlugin,gt as OTelMetricsPlugin,gr as OktaFGAAuthZInboundPolicy,dr as OktaJwtInboundPolicy,ur as OpenFGAAuthZInboundPolicy,vt as OpenIdJwtInboundPolicy,fr as OpenMeterInboundPolicy,$ as OutboundPolicy,j as ProblemResponseFormatter,xr as PromptInjectionDetectionOutboundPolicy,yr as PropelAuthJwtInboundPolicy,wr as QueryParamToHeaderInboundPolicy,Ar as QuotaInboundPolicy,br as RateLimitInboundPolicy,lr as ReadmeMetricsInboundPolicy,jr as RemoveHeadersInboundPolicy,Br as RemoveHeadersOutboundPolicy,Cr as RemoveQueryParamsInboundPolicy,Dr as ReplaceStringOutboundPolicy,Ct as RequestLoggerPlugin,Er as RequestSizeLimitInboundPolicy,$r as RequestValidationInboundPolicy,Fr as RequireOriginInboundPolicy,R as ResponseSendingEvent,q as ResponseSentEvent,a as RuntimeError,u as SYSTEM_LOGGER,kr as SchemaBasedRequestValidation,Lr as SecretMaskingOutboundPolicy,T as SemanticAttributes,Rr as SemanticCacheInboundPolicy,es as ServiceProviderImpl,qr as SetBodyInboundPolicy,vr as SetHeadersInboundPolicy,zr as SetHeadersOutboundPolicy,Gr as SetQueryParamsInboundPolicy,Ir as SetStatusOutboundPolicy,Jr as SetUpstreamApiKeyInboundPolicy,Kr as SleepInboundPolicy,at as SplunkLoggingPlugin,A as StreamingZoneCache,Mr as StripeWebhookVerificationInboundPolicy,nt as SumoLogicLoggingPlugin,Nr as SupabaseJwtInboundPolicy,S as SystemRouteName,C as TelemetryPlugin,Or as UpstreamAzureAdServiceAuthInboundPolicy,Qr as UpstreamFirebaseAdminAuthInboundPolicy,Vr as UpstreamFirebaseUserAuthInboundPolicy,Xr as UpstreamGcpFederatedAuthInboundPolicy,Yr as UpstreamGcpJwtInboundPolicy,Zr as UpstreamGcpServiceAuthInboundPolicy,_r as UpstreamZuploJwtAuthInboundPolicy,it as VMWareLogInsightLoggingPlugin,ts as ValidateJsonSchemaInbound,rs as WebBotAuthInboundPolicy,ss as XmlToJsonOutboundPolicy,y as ZoneCache,pt as ZuploMcpSdk,D as ZuploRequest,Wr as ZuploServices,J as aiGatewayHandler,x as apiServices,M as awsLambdaHandler,jt as defaultGenerateHydrolixEntry,z as environment,Pr as getIdForParameterSchema,Tr as getIdForRefSchema,Sr as getIdForRequestBodySchema,Hr as getRawOperationDataIdentifierName,l as httpStatuses,N as legacyDevPortalHandler,Q as mcpServerHandler,V as openApiSpecHandler,W as redirectHandler,O as redirectLegacyDevPortal,Ur as sanitizedIdentifierName,H as serialize,pr as setMoesifContext,n as trackFeature,Y as urlForwardHandler,Z as urlRewriteHandler,_ as webSocketHandler,tt as webSocketPipelineHandler,X as zuploServiceProxy};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{$ as ct,A as vc,B as $t,J as lm,K as wc,L as rb,M as pm,N as f,O as mm,P as ne,Q as ue,R as fm,S as hm,T as Re,U as R,V as C,W as Pe,X as ye,Y as bc,Z as Rc,_ as me,a as zt,aa as O,b as um,ba as be,ca as gm,da as Cc,ea as ym,fa as Sm,ga as u,ha as de,ia as _m,j as Ae,k as dm,q as Sc,s as Un,x as _c}from"../chunk-SFFHEDT5.js";import{d as ni}from"../chunk-TOF2KNST.js";import{a as F}from"../chunk-A2CSR4RF.js";import{$ as K,a as o,aa as E,ba as q,c as x,ca as Eo,e as cm}from"../chunk-2VLXJLVI.js";var ha=x(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.regexpCode=ae.getEsmExportName=ae.getProperty=ae.safeStringify=ae.stringify=ae.strConcat=ae.addCodeArg=ae.str=ae._=ae.nil=ae._Code=ae.Name=ae.IDENTIFIER=ae._CodeOrName=void 0;var ma=class{static{o(this,"_CodeOrName")}};ae._CodeOrName=ma;ae.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var mn=class extends ma{static{o(this,"Name")}constructor(t){if(super(),!ae.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ae.Name=mn;var _t=class extends ma{static{o(this,"_Code")}constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof mn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ae._Code=_t;ae.nil=new _t("");function Jg(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Rd(r,t[n]),r.push(e[++n]);return new _t(r)}o(Jg,"_");ae._=Jg;var bd=new _t("+");function Wg(e,...t){let r=[fa(e[0])],n=0;for(;n<t.length;)r.push(bd),Rd(r,t[n]),r.push(bd,fa(e[++n]));return Ik(r),new _t(r)}o(Wg,"str");ae.str=Wg;function Rd(e,t){t instanceof _t?e.push(...t._items):t instanceof mn?e.push(t):e.push(kk(t))}o(Rd,"addCodeArg");ae.addCodeArg=Rd;function Ik(e){let t=1;for(;t<e.length-1;){if(e[t]===bd){let r=Pk(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(Ik,"optimize");function Pk(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof mn||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof mn))return`"${e}${t.slice(1)}`}o(Pk,"mergeExprItems");function xk(e,t){return t.emptyStr()?e:e.emptyStr()?t:Wg`${e}${t}`}o(xk,"strConcat");ae.strConcat=xk;function kk(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:fa(Array.isArray(e)?e.join(","):e)}o(kk,"interpolate");function Ak(e){return new _t(fa(e))}o(Ak,"stringify");ae.stringify=Ak;function fa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(fa,"safeStringify");ae.safeStringify=fa;function Tk(e){return typeof e=="string"&&ae.IDENTIFIER.test(e)?new _t(`.${e}`):Jg`[${e}]`}o(Tk,"getProperty");ae.getProperty=Tk;function Ek(e){if(typeof e=="string"&&ae.IDENTIFIER.test(e))return new _t(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}o(Ek,"getEsmExportName");ae.getEsmExportName=Ek;function Uk(e){return new _t(e.toString())}o(Uk,"regexpCode");ae.regexpCode=Uk});var Pd=x(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.ValueScope=at.ValueScopeName=at.Scope=at.varKinds=at.UsedValueState=void 0;var ot=ha(),Cd=class extends Error{static{o(this,"ValueError")}constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Qi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Qi||(at.UsedValueState=Qi={}));at.varKinds={const:new ot.Name("const"),let:new ot.Name("let"),var:new ot.Name("var")};var es=class{static{o(this,"Scope")}constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof ot.Name?t:this.name(t)}name(t){return new ot.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};at.Scope=es;var ts=class extends ot.Name{static{o(this,"ValueScopeName")}constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,ot._)`.${new ot.Name(r)}[${n}]`}};at.ValueScopeName=ts;var Ok=(0,ot._)`\n`,Id=class extends es{static{o(this,"ValueScope")}constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Ok:ot.nil}}get(){return this._scope}name(t){return new ts(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(t),{prefix:i}=a,s=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[i];if(c){let l=c.get(s);if(l)return l}else c=this._values[i]=new Map;c.set(s,a);let d=this._scope[i]||(this._scope[i]=[]),p=d.length;return d[p]=r.ref,a.setValue(r,{property:i,itemIndex:p}),a}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ot._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,n)}_reduceValues(t,r,n={},a){let i=ot.nil;for(let s in t){let c=t[s];if(!c)continue;let d=n[s]=n[s]||new Map;c.forEach(p=>{if(d.has(p))return;d.set(p,Qi.Started);let l=r(p);if(l){let m=this.opts.es5?at.varKinds.var:at.varKinds.const;i=(0,ot._)`${i}${m} ${p} = ${l};${this.opts._n}`}else if(l=a?.(p))i=(0,ot._)`${i}${l}${this.opts._n}`;else throw new Cd(p);d.set(p,Qi.Completed)})}return i}};at.ValueScope=Id});var W=x(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var te=ha(),kt=Pd(),Nr=ha();Object.defineProperty(X,"_",{enumerable:!0,get:o(function(){return Nr._},"get")});Object.defineProperty(X,"str",{enumerable:!0,get:o(function(){return Nr.str},"get")});Object.defineProperty(X,"strConcat",{enumerable:!0,get:o(function(){return Nr.strConcat},"get")});Object.defineProperty(X,"nil",{enumerable:!0,get:o(function(){return Nr.nil},"get")});Object.defineProperty(X,"getProperty",{enumerable:!0,get:o(function(){return Nr.getProperty},"get")});Object.defineProperty(X,"stringify",{enumerable:!0,get:o(function(){return Nr.stringify},"get")});Object.defineProperty(X,"regexpCode",{enumerable:!0,get:o(function(){return Nr.regexpCode},"get")});Object.defineProperty(X,"Name",{enumerable:!0,get:o(function(){return Nr.Name},"get")});var as=Pd();Object.defineProperty(X,"Scope",{enumerable:!0,get:o(function(){return as.Scope},"get")});Object.defineProperty(X,"ValueScope",{enumerable:!0,get:o(function(){return as.ValueScope},"get")});Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:o(function(){return as.ValueScopeName},"get")});Object.defineProperty(X,"varKinds",{enumerable:!0,get:o(function(){return as.varKinds},"get")});X.operators={GT:new te._Code(">"),GTE:new te._Code(">="),LT:new te._Code("<"),LTE:new te._Code("<="),EQ:new te._Code("==="),NEQ:new te._Code("!=="),NOT:new te._Code("!"),OR:new te._Code("||"),AND:new te._Code("&&"),ADD:new te._Code("+")};var dr=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(t,r){return this}},xd=class extends dr{static{o(this,"Def")}constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?kt.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=ro(this.rhs,t,r)),this}get names(){return this.rhs instanceof te._CodeOrName?this.rhs.names:{}}},rs=class extends dr{static{o(this,"Assign")}constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof te.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=ro(this.rhs,t,r),this}get names(){let t=this.lhs instanceof te.Name?{}:{...this.lhs.names};return os(t,this.rhs)}},kd=class extends rs{static{o(this,"AssignOp")}constructor(t,r,n,a){super(t,n,a),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Ad=class extends dr{static{o(this,"Label")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Td=class extends dr{static{o(this,"Break")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Ed=class extends dr{static{o(this,"Throw")}constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Ud=class extends dr{static{o(this,"AnyCode")}constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=ro(this.code,t,r),this}get names(){return this.code instanceof te._CodeOrName?this.code.names:{}}},ga=class extends dr{static{o(this,"ParentNode")}constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,a=n.length;for(;a--;){let i=n[a];i.optimizeNames(t,r)||(Mk(t,i.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>gn(t,r.names),{})}},lr=class extends ga{static{o(this,"BlockNode")}render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Od=class extends ga{static{o(this,"Root")}},to=class extends lr{static{o(this,"Else")}};to.kind="else";var fn=class e extends lr{static{o(this,"If")}constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new to(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Yg(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=ro(this.condition,t,r),this}get names(){let t=super.names;return os(t,this.condition),this.else&&gn(t,this.else.names),t}};fn.kind="if";var hn=class extends lr{static{o(this,"For")}};hn.kind="for";var Md=class extends hn{static{o(this,"ForLoop")}constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=ro(this.iteration,t,r),this}get names(){return gn(super.names,this.iteration.names)}},zd=class extends hn{static{o(this,"ForRange")}constructor(t,r,n,a){super(),this.varKind=t,this.name=r,this.from=n,this.to=a}render(t){let r=t.es5?kt.varKinds.var:this.varKind,{name:n,from:a,to:i}=this;return`for(${r} ${n}=${a}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=os(super.names,this.from);return os(t,this.to)}},ns=class extends hn{static{o(this,"ForIter")}constructor(t,r,n,a){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=a}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=ro(this.iterable,t,r),this}get names(){return gn(super.names,this.iterable.names)}},ya=class extends lr{static{o(this,"Func")}constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};ya.kind="func";var Sa=class extends ga{static{o(this,"Return")}render(t){return"return "+super.render(t)}};Sa.kind="return";var $d=class extends lr{static{o(this,"Try")}render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,a;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(a=this.finally)===null||a===void 0||a.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&gn(t,this.catch.names),this.finally&&gn(t,this.finally.names),t}},_a=class extends lr{static{o(this,"Catch")}constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};_a.kind="catch";var va=class extends lr{static{o(this,"Finally")}render(t){return"finally"+super.render(t)}};va.kind="finally";var qd=class{static{o(this,"CodeGen")}constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
25
|
+
import{$ as ct,A as vc,B as $t,J as lm,K as wc,L as rb,M as pm,N as f,O as mm,P as ne,Q as ue,R as fm,S as hm,T as Re,U as R,V as C,W as Pe,X as ye,Y as bc,Z as Rc,_ as me,a as zt,aa as O,b as um,ba as be,ca as gm,da as Cc,ea as ym,fa as Sm,ga as u,ha as de,ia as _m,j as Ae,k as dm,q as Sc,s as Un,x as _c}from"../chunk-HOAEPNOG.js";import{d as ni}from"../chunk-TOF2KNST.js";import{a as F}from"../chunk-A2CSR4RF.js";import{$ as K,a as o,aa as E,ba as q,c as x,ca as Eo,e as cm}from"../chunk-2VLXJLVI.js";var ha=x(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.regexpCode=ae.getEsmExportName=ae.getProperty=ae.safeStringify=ae.stringify=ae.strConcat=ae.addCodeArg=ae.str=ae._=ae.nil=ae._Code=ae.Name=ae.IDENTIFIER=ae._CodeOrName=void 0;var ma=class{static{o(this,"_CodeOrName")}};ae._CodeOrName=ma;ae.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var mn=class extends ma{static{o(this,"Name")}constructor(t){if(super(),!ae.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ae.Name=mn;var _t=class extends ma{static{o(this,"_Code")}constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof mn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ae._Code=_t;ae.nil=new _t("");function Jg(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Rd(r,t[n]),r.push(e[++n]);return new _t(r)}o(Jg,"_");ae._=Jg;var bd=new _t("+");function Wg(e,...t){let r=[fa(e[0])],n=0;for(;n<t.length;)r.push(bd),Rd(r,t[n]),r.push(bd,fa(e[++n]));return Ik(r),new _t(r)}o(Wg,"str");ae.str=Wg;function Rd(e,t){t instanceof _t?e.push(...t._items):t instanceof mn?e.push(t):e.push(kk(t))}o(Rd,"addCodeArg");ae.addCodeArg=Rd;function Ik(e){let t=1;for(;t<e.length-1;){if(e[t]===bd){let r=Pk(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(Ik,"optimize");function Pk(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof mn||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof mn))return`"${e}${t.slice(1)}`}o(Pk,"mergeExprItems");function xk(e,t){return t.emptyStr()?e:e.emptyStr()?t:Wg`${e}${t}`}o(xk,"strConcat");ae.strConcat=xk;function kk(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:fa(Array.isArray(e)?e.join(","):e)}o(kk,"interpolate");function Ak(e){return new _t(fa(e))}o(Ak,"stringify");ae.stringify=Ak;function fa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(fa,"safeStringify");ae.safeStringify=fa;function Tk(e){return typeof e=="string"&&ae.IDENTIFIER.test(e)?new _t(`.${e}`):Jg`[${e}]`}o(Tk,"getProperty");ae.getProperty=Tk;function Ek(e){if(typeof e=="string"&&ae.IDENTIFIER.test(e))return new _t(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}o(Ek,"getEsmExportName");ae.getEsmExportName=Ek;function Uk(e){return new _t(e.toString())}o(Uk,"regexpCode");ae.regexpCode=Uk});var Pd=x(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.ValueScope=at.ValueScopeName=at.Scope=at.varKinds=at.UsedValueState=void 0;var ot=ha(),Cd=class extends Error{static{o(this,"ValueError")}constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Qi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Qi||(at.UsedValueState=Qi={}));at.varKinds={const:new ot.Name("const"),let:new ot.Name("let"),var:new ot.Name("var")};var es=class{static{o(this,"Scope")}constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof ot.Name?t:this.name(t)}name(t){return new ot.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};at.Scope=es;var ts=class extends ot.Name{static{o(this,"ValueScopeName")}constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,ot._)`.${new ot.Name(r)}[${n}]`}};at.ValueScopeName=ts;var Ok=(0,ot._)`\n`,Id=class extends es{static{o(this,"ValueScope")}constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Ok:ot.nil}}get(){return this._scope}name(t){return new ts(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(t),{prefix:i}=a,s=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[i];if(c){let l=c.get(s);if(l)return l}else c=this._values[i]=new Map;c.set(s,a);let d=this._scope[i]||(this._scope[i]=[]),p=d.length;return d[p]=r.ref,a.setValue(r,{property:i,itemIndex:p}),a}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ot._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,n)}_reduceValues(t,r,n={},a){let i=ot.nil;for(let s in t){let c=t[s];if(!c)continue;let d=n[s]=n[s]||new Map;c.forEach(p=>{if(d.has(p))return;d.set(p,Qi.Started);let l=r(p);if(l){let m=this.opts.es5?at.varKinds.var:at.varKinds.const;i=(0,ot._)`${i}${m} ${p} = ${l};${this.opts._n}`}else if(l=a?.(p))i=(0,ot._)`${i}${l}${this.opts._n}`;else throw new Cd(p);d.set(p,Qi.Completed)})}return i}};at.ValueScope=Id});var W=x(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var te=ha(),kt=Pd(),Nr=ha();Object.defineProperty(X,"_",{enumerable:!0,get:o(function(){return Nr._},"get")});Object.defineProperty(X,"str",{enumerable:!0,get:o(function(){return Nr.str},"get")});Object.defineProperty(X,"strConcat",{enumerable:!0,get:o(function(){return Nr.strConcat},"get")});Object.defineProperty(X,"nil",{enumerable:!0,get:o(function(){return Nr.nil},"get")});Object.defineProperty(X,"getProperty",{enumerable:!0,get:o(function(){return Nr.getProperty},"get")});Object.defineProperty(X,"stringify",{enumerable:!0,get:o(function(){return Nr.stringify},"get")});Object.defineProperty(X,"regexpCode",{enumerable:!0,get:o(function(){return Nr.regexpCode},"get")});Object.defineProperty(X,"Name",{enumerable:!0,get:o(function(){return Nr.Name},"get")});var as=Pd();Object.defineProperty(X,"Scope",{enumerable:!0,get:o(function(){return as.Scope},"get")});Object.defineProperty(X,"ValueScope",{enumerable:!0,get:o(function(){return as.ValueScope},"get")});Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:o(function(){return as.ValueScopeName},"get")});Object.defineProperty(X,"varKinds",{enumerable:!0,get:o(function(){return as.varKinds},"get")});X.operators={GT:new te._Code(">"),GTE:new te._Code(">="),LT:new te._Code("<"),LTE:new te._Code("<="),EQ:new te._Code("==="),NEQ:new te._Code("!=="),NOT:new te._Code("!"),OR:new te._Code("||"),AND:new te._Code("&&"),ADD:new te._Code("+")};var dr=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(t,r){return this}},xd=class extends dr{static{o(this,"Def")}constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?kt.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=ro(this.rhs,t,r)),this}get names(){return this.rhs instanceof te._CodeOrName?this.rhs.names:{}}},rs=class extends dr{static{o(this,"Assign")}constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof te.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=ro(this.rhs,t,r),this}get names(){let t=this.lhs instanceof te.Name?{}:{...this.lhs.names};return os(t,this.rhs)}},kd=class extends rs{static{o(this,"AssignOp")}constructor(t,r,n,a){super(t,n,a),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Ad=class extends dr{static{o(this,"Label")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Td=class extends dr{static{o(this,"Break")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Ed=class extends dr{static{o(this,"Throw")}constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Ud=class extends dr{static{o(this,"AnyCode")}constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=ro(this.code,t,r),this}get names(){return this.code instanceof te._CodeOrName?this.code.names:{}}},ga=class extends dr{static{o(this,"ParentNode")}constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,a=n.length;for(;a--;){let i=n[a];i.optimizeNames(t,r)||(Mk(t,i.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>gn(t,r.names),{})}},lr=class extends ga{static{o(this,"BlockNode")}render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Od=class extends ga{static{o(this,"Root")}},to=class extends lr{static{o(this,"Else")}};to.kind="else";var fn=class e extends lr{static{o(this,"If")}constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new to(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Yg(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=ro(this.condition,t,r),this}get names(){let t=super.names;return os(t,this.condition),this.else&&gn(t,this.else.names),t}};fn.kind="if";var hn=class extends lr{static{o(this,"For")}};hn.kind="for";var Md=class extends hn{static{o(this,"ForLoop")}constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=ro(this.iteration,t,r),this}get names(){return gn(super.names,this.iteration.names)}},zd=class extends hn{static{o(this,"ForRange")}constructor(t,r,n,a){super(),this.varKind=t,this.name=r,this.from=n,this.to=a}render(t){let r=t.es5?kt.varKinds.var:this.varKind,{name:n,from:a,to:i}=this;return`for(${r} ${n}=${a}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=os(super.names,this.from);return os(t,this.to)}},ns=class extends hn{static{o(this,"ForIter")}constructor(t,r,n,a){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=a}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=ro(this.iterable,t,r),this}get names(){return gn(super.names,this.iterable.names)}},ya=class extends lr{static{o(this,"Func")}constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};ya.kind="func";var Sa=class extends ga{static{o(this,"Return")}render(t){return"return "+super.render(t)}};Sa.kind="return";var $d=class extends lr{static{o(this,"Try")}render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,a;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(a=this.finally)===null||a===void 0||a.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&gn(t,this.catch.names),this.finally&&gn(t,this.finally.names),t}},_a=class extends lr{static{o(this,"Catch")}constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};_a.kind="catch";var va=class extends lr{static{o(this,"Finally")}render(t){return"finally"+super.render(t)}};va.kind="finally";var qd=class{static{o(this,"CodeGen")}constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
26
26
|
`:""},this._extScope=t,this._scope=new kt.Scope({parent:t}),this._nodes=[new Od]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,a){let i=this._scope.toName(r);return n!==void 0&&a&&(this._constants[i.str]=n),this._leafNode(new xd(t,i,n)),i}const(t,r,n){return this._def(kt.varKinds.const,t,r,n)}let(t,r,n){return this._def(kt.varKinds.let,t,r,n)}var(t,r,n){return this._def(kt.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new rs(t,r,n))}add(t,r){return this._leafNode(new kd(t,X.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==te.nil&&this._leafNode(new Ud(t)),this}object(...t){let r=["{"];for(let[n,a]of t)r.length>1&&r.push(","),r.push(n),(n!==a||this.opts.es5)&&(r.push(":"),(0,te.addCodeArg)(r,a));return r.push("}"),new te._Code(r)}if(t,r,n){if(this._blockNode(new fn(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new fn(t))}else(){return this._elseNode(new to)}endIf(){return this._endBlockNode(fn,to)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Md(t),r)}forRange(t,r,n,a,i=this.opts.es5?kt.varKinds.var:kt.varKinds.let){let s=this._scope.toName(t);return this._for(new zd(i,s,r,n),()=>a(s))}forOf(t,r,n,a=kt.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof te.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,te._)`${s}.length`,c=>{this.var(i,(0,te._)`${s}[${c}]`),n(i)})}return this._for(new ns("of",a,i,r),()=>n(i))}forIn(t,r,n,a=this.opts.es5?kt.varKinds.var:kt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,te._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new ns("in",a,i,r),()=>n(i))}endFor(){return this._endBlockNode(hn)}label(t){return this._leafNode(new Ad(t))}break(t){return this._leafNode(new Td(t))}return(t){let r=new Sa;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Sa)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let a=new $d;if(this._blockNode(a),this.code(t),r){let i=this.name("e");this._currNode=a.catch=new _a(i),r(i)}return n&&(this._currNode=a.finally=new va,this.code(n)),this._endBlockNode(_a,va)}throw(t){return this._leafNode(new Ed(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=te.nil,n,a){return this._blockNode(new ya(t,r,n)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(ya)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof fn))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};X.CodeGen=qd;function gn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(gn,"addNames");function os(e,t){return t instanceof te._CodeOrName?gn(e,t.names):e}o(os,"addExprNames");function ro(e,t,r){if(e instanceof te.Name)return n(e);if(!a(e))return e;return new te._Code(e._items.reduce((i,s)=>(s instanceof te.Name&&(s=n(s)),s instanceof te._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function a(i){return i instanceof te._Code&&i._items.some(s=>s instanceof te.Name&&t[s.str]===1&&r[s.str]!==void 0)}}o(ro,"optimizeExpr");function Mk(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(Mk,"subtractNames");function Yg(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,te._)`!${Nd(e)}`}o(Yg,"not");X.not=Yg;var zk=Xg(X.operators.AND);function $k(...e){return e.reduce(zk)}o($k,"and");X.and=$k;var qk=Xg(X.operators.OR);function Nk(...e){return e.reduce(qk)}o(Nk,"or");X.or=Nk;function Xg(e){return(t,r)=>t===te.nil?r:r===te.nil?t:(0,te._)`${Nd(t)} ${e} ${Nd(r)}`}o(Xg,"mappend");function Nd(e){return e instanceof te.Name?e:(0,te._)`(${e})`}o(Nd,"par")});var ie=x(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;var pe=W(),Dk=ha();function jk(e){let t={};for(let r of e)t[r]=!0;return t}o(jk,"toHash");ee.toHash=jk;function Hk(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(ty(e,t),!ry(t,e.self.RULES.all))}o(Hk,"alwaysValidSchema");ee.alwaysValidSchema=Hk;function ty(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let a=n.RULES.keywords;for(let i in t)a[i]||ay(e,`unknown keyword: "${i}"`)}o(ty,"checkUnknownRules");ee.checkUnknownRules=ty;function ry(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(ry,"schemaHasRules");ee.schemaHasRules=ry;function Lk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(Lk,"schemaHasRulesButRef");ee.schemaHasRulesButRef=Lk;function Bk({topSchemaRef:e,schemaPath:t},r,n,a){if(!a){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pe._)`${r}`}return(0,pe._)`${e}${t}${(0,pe.getProperty)(n)}`}o(Bk,"schemaRefOrVal");ee.schemaRefOrVal=Bk;function Gk(e){return ny(decodeURIComponent(e))}o(Gk,"unescapeFragment");ee.unescapeFragment=Gk;function Vk(e){return encodeURIComponent(jd(e))}o(Vk,"escapeFragment");ee.escapeFragment=Vk;function jd(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}o(jd,"escapeJsonPointer");ee.escapeJsonPointer=jd;function ny(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(ny,"unescapeJsonPointer");ee.unescapeJsonPointer=ny;function Fk(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(Fk,"eachItem");ee.eachItem=Fk;function Qg({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(a,i,s,c)=>{let d=s===void 0?i:s instanceof pe.Name?(i instanceof pe.Name?e(a,i,s):t(a,i,s),s):i instanceof pe.Name?(t(a,s,i),i):r(i,s);return c===pe.Name&&!(d instanceof pe.Name)?n(a,d):d}}o(Qg,"makeMergeEvaluated");ee.mergeEvaluated={props:Qg({mergeNames:o((e,t,r)=>e.if((0,pe._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,pe._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,pe._)`${r} || {}`).code((0,pe._)`Object.assign(${r}, ${t})`))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,pe._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,pe._)`${r} || {}`),Hd(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:{...e,...t},"mergeValues"),resultToName:oy}),items:Qg({mergeNames:o((e,t,r)=>e.if((0,pe._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,pe._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,pe._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,pe._)`${r} > ${t} ? ${r} : ${t}`)),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};function oy(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,pe._)`{}`);return t!==void 0&&Hd(e,r,t),r}o(oy,"evaluatedPropsToName");ee.evaluatedPropsToName=oy;function Hd(e,t,r){Object.keys(r).forEach(n=>e.assign((0,pe._)`${t}${(0,pe.getProperty)(n)}`,!0))}o(Hd,"setEvaluated");ee.setEvaluated=Hd;var ey={};function Zk(e,t){return e.scopeValue("func",{ref:t,code:ey[t.code]||(ey[t.code]=new Dk._Code(t.code))})}o(Zk,"useFunc");ee.useFunc=Zk;var Dd;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Dd||(ee.Type=Dd={}));function Kk(e,t,r){if(e instanceof pe.Name){let n=t===Dd.Num;return r?n?(0,pe._)`"[" + ${e} + "]"`:(0,pe._)`"['" + ${e} + "']"`:n?(0,pe._)`"/" + ${e}`:(0,pe._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,pe.getProperty)(e).toString():"/"+jd(e)}o(Kk,"getErrorPath");ee.getErrorPath=Kk;function ay(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}o(ay,"checkStrictMode");ee.checkStrictMode=ay});var pr=x(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var Ve=W(),Jk={data:new Ve.Name("data"),valCxt:new Ve.Name("valCxt"),instancePath:new Ve.Name("instancePath"),parentData:new Ve.Name("parentData"),parentDataProperty:new Ve.Name("parentDataProperty"),rootData:new Ve.Name("rootData"),dynamicAnchors:new Ve.Name("dynamicAnchors"),vErrors:new Ve.Name("vErrors"),errors:new Ve.Name("errors"),this:new Ve.Name("this"),self:new Ve.Name("self"),scope:new Ve.Name("scope"),json:new Ve.Name("json"),jsonPos:new Ve.Name("jsonPos"),jsonLen:new Ve.Name("jsonLen"),jsonPart:new Ve.Name("jsonPart")};Ld.default=Jk});var wa=x(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.extendErrors=Fe.resetErrorsCount=Fe.reportExtraError=Fe.reportError=Fe.keyword$DataError=Fe.keywordError=void 0;var re=W(),is=ie(),Je=pr();Fe.keywordError={message:o(({keyword:e})=>(0,re.str)`must pass "${e}" keyword validation`,"message")};Fe.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,re.str)`"${e}" keyword must be ${t} ($data)`:(0,re.str)`"${e}" keyword is invalid ($data)`,"message")};function Wk(e,t=Fe.keywordError,r,n){let{it:a}=e,{gen:i,compositeRule:s,allErrors:c}=a,d=cy(e,t,r);n??(s||c)?iy(i,d):sy(a,(0,re._)`[${d}]`)}o(Wk,"reportError");Fe.reportError=Wk;function Yk(e,t=Fe.keywordError,r){let{it:n}=e,{gen:a,compositeRule:i,allErrors:s}=n,c=cy(e,t,r);iy(a,c),i||s||sy(n,Je.default.vErrors)}o(Yk,"reportExtraError");Fe.reportExtraError=Yk;function Xk(e,t){e.assign(Je.default.errors,t),e.if((0,re._)`${Je.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,re._)`${Je.default.vErrors}.length`,t),()=>e.assign(Je.default.vErrors,null)))}o(Xk,"resetErrorsCount");Fe.resetErrorsCount=Xk;function Qk({gen:e,keyword:t,schemaValue:r,data:n,errsCount:a,it:i}){if(a===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",a,Je.default.errors,c=>{e.const(s,(0,re._)`${Je.default.vErrors}[${c}]`),e.if((0,re._)`${s}.instancePath === undefined`,()=>e.assign((0,re._)`${s}.instancePath`,(0,re.strConcat)(Je.default.instancePath,i.errorPath))),e.assign((0,re._)`${s}.schemaPath`,(0,re.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,re._)`${s}.schema`,r),e.assign((0,re._)`${s}.data`,n))})}o(Qk,"extendErrors");Fe.extendErrors=Qk;function iy(e,t){let r=e.const("err",t);e.if((0,re._)`${Je.default.vErrors} === null`,()=>e.assign(Je.default.vErrors,(0,re._)`[${r}]`),(0,re._)`${Je.default.vErrors}.push(${r})`),e.code((0,re._)`${Je.default.errors}++`)}o(iy,"addError");function sy(e,t){let{gen:r,validateName:n,schemaEnv:a}=e;a.$async?r.throw((0,re._)`new ${e.ValidationError}(${t})`):(r.assign((0,re._)`${n}.errors`,t),r.return(!1))}o(sy,"returnErrors");var yn={keyword:new re.Name("keyword"),schemaPath:new re.Name("schemaPath"),params:new re.Name("params"),propertyName:new re.Name("propertyName"),message:new re.Name("message"),schema:new re.Name("schema"),parentSchema:new re.Name("parentSchema")};function cy(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,re._)`{}`:eA(e,t,r)}o(cy,"errorObjectCode");function eA(e,t,r={}){let{gen:n,it:a}=e,i=[tA(a,r),rA(e,r)];return nA(e,t,i),n.object(...i)}o(eA,"errorObject");function tA({errorPath:e},{instancePath:t}){let r=t?(0,re.str)`${e}${(0,is.getErrorPath)(t,is.Type.Str)}`:e;return[Je.default.instancePath,(0,re.strConcat)(Je.default.instancePath,r)]}o(tA,"errorInstancePath");function rA({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let a=n?t:(0,re.str)`${t}/${e}`;return r&&(a=(0,re.str)`${a}${(0,is.getErrorPath)(r,is.Type.Str)}`),[yn.schemaPath,a]}o(rA,"errorSchemaPath");function nA(e,{params:t,message:r},n){let{keyword:a,data:i,schemaValue:s,it:c}=e,{opts:d,propertyName:p,topSchemaRef:l,schemaPath:m}=c;n.push([yn.keyword,a],[yn.params,typeof t=="function"?t(e):t||(0,re._)`{}`]),d.messages&&n.push([yn.message,typeof r=="function"?r(e):r]),d.verbose&&n.push([yn.schema,s],[yn.parentSchema,(0,re._)`${l}${m}`],[Je.default.data,i]),p&&n.push([yn.propertyName,p])}o(nA,"extraErrorProps")});var dy=x(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.boolOrEmptySchema=no.topBoolOrEmptySchema=void 0;var oA=wa(),aA=W(),iA=pr(),sA={message:"boolean schema is false"};function cA(e){let{gen:t,schema:r,validateName:n}=e;r===!1?uy(e,!1):typeof r=="object"&&r.$async===!0?t.return(iA.default.data):(t.assign((0,aA._)`${n}.errors`,null),t.return(!0))}o(cA,"topBoolOrEmptySchema");no.topBoolOrEmptySchema=cA;function uA(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),uy(e)):r.var(t,!0)}o(uA,"boolOrEmptySchema");no.boolOrEmptySchema=uA;function uy(e,t){let{gen:r,data:n}=e,a={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,oA.reportError)(a,sA,void 0,t)}o(uy,"falseSchemaError")});var Bd=x(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.getRules=oo.isJSONType=void 0;var dA=["string","number","integer","boolean","null","object","array"],lA=new Set(dA);function pA(e){return typeof e=="string"&&lA.has(e)}o(pA,"isJSONType");oo.isJSONType=pA;function mA(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(mA,"getRules");oo.getRules=mA});var Gd=x(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.shouldUseRule=Dr.shouldUseGroup=Dr.schemaHasRulesForType=void 0;function fA({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&ly(e,n)}o(fA,"schemaHasRulesForType");Dr.schemaHasRulesForType=fA;function ly(e,t){return t.rules.some(r=>py(e,r))}o(ly,"shouldUseGroup");Dr.shouldUseGroup=ly;function py(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(py,"shouldUseRule");Dr.shouldUseRule=py});var ba=x(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.reportTypeError=Ze.checkDataTypes=Ze.checkDataType=Ze.coerceAndCheckDataType=Ze.getJSONTypes=Ze.getSchemaTypes=Ze.DataType=void 0;var hA=Bd(),gA=Gd(),yA=wa(),Z=W(),my=ie(),ao;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ao||(Ze.DataType=ao={}));function SA(e){let t=fy(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(SA,"getSchemaTypes");Ze.getSchemaTypes=SA;function fy(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(hA.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(fy,"getJSONTypes");Ze.getJSONTypes=fy;function _A(e,t){let{gen:r,data:n,opts:a}=e,i=vA(t,a.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,gA.schemaHasRulesForType)(e,t[0]));if(s){let c=Fd(t,n,a.strictNumbers,ao.Wrong);r.if(c,()=>{i.length?wA(e,t,i):Zd(e)})}return s}o(_A,"coerceAndCheckDataType");Ze.coerceAndCheckDataType=_A;var hy=new Set(["string","number","integer","boolean","null"]);function vA(e,t){return t?e.filter(r=>hy.has(r)||t==="array"&&r==="array"):[]}o(vA,"coerceToTypes");function wA(e,t,r){let{gen:n,data:a,opts:i}=e,s=n.let("dataType",(0,Z._)`typeof ${a}`),c=n.let("coerced",(0,Z._)`undefined`);i.coerceTypes==="array"&&n.if((0,Z._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>n.assign(a,(0,Z._)`${a}[0]`).assign(s,(0,Z._)`typeof ${a}`).if(Fd(t,a,i.strictNumbers),()=>n.assign(c,a))),n.if((0,Z._)`${c} !== undefined`);for(let p of r)(hy.has(p)||p==="array"&&i.coerceTypes==="array")&&d(p);n.else(),Zd(e),n.endIf(),n.if((0,Z._)`${c} !== undefined`,()=>{n.assign(a,c),bA(e,c)});function d(p){switch(p){case"string":n.elseIf((0,Z._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,Z._)`"" + ${a}`).elseIf((0,Z._)`${a} === null`).assign(c,(0,Z._)`""`);return;case"number":n.elseIf((0,Z._)`${s} == "boolean" || ${a} === null
|
|
27
27
|
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,Z._)`+${a}`);return;case"integer":n.elseIf((0,Z._)`${s} === "boolean" || ${a} === null
|
|
28
28
|
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,Z._)`+${a}`);return;case"boolean":n.elseIf((0,Z._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,Z._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case"null":n.elseIf((0,Z._)`${a} === "" || ${a} === 0 || ${a} === false`),n.assign(c,null);return;case"array":n.elseIf((0,Z._)`${s} === "string" || ${s} === "number"
|
package/out/types/index.d.ts
CHANGED
|
@@ -6072,6 +6072,13 @@ export declare interface MonetizationSubscription {
|
|
|
6072
6072
|
* Defaults to 3 days.
|
|
6073
6073
|
*/
|
|
6074
6074
|
maxPaymentOverdueDays: number;
|
|
6075
|
+
/**
|
|
6076
|
+
* If true, end-user API requests for this subscription have been
|
|
6077
|
+
* administratively blocked by the Zuplo customer. The policy returns 403
|
|
6078
|
+
* regardless of payment / entitlement status. Toggled via the
|
|
6079
|
+
* block-access / unblock-access endpoints.
|
|
6080
|
+
*/
|
|
6081
|
+
accessBlocked?: boolean;
|
|
6075
6082
|
createdAt: string;
|
|
6076
6083
|
updatedAt: string;
|
|
6077
6084
|
}
|
package/package.json
CHANGED
|
File without changes
|