@fern-api/python-dynamic-snippets 0.0.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.
- package/cjs/DynamicSnippetsGenerator.cjs +34 -0
- package/cjs/DynamicSnippetsGenerator.d.cts +18 -0
- package/cjs/DynamicSnippetsGeneratorContext-aXWxVpwD.d.cts +86 -0
- package/cjs/EndpointSnippetGenerator.cjs +23 -0
- package/cjs/EndpointSnippetGenerator.d.cts +52 -0
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +34 -0
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +5 -0
- package/cjs/context/DynamicTypeLiteralMapper.cjs +23 -0
- package/cjs/context/DynamicTypeLiteralMapper.d.cts +5 -0
- package/cjs/context/FilePropertyMapper.cjs +23 -0
- package/cjs/context/FilePropertyMapper.d.cts +5 -0
- package/cjs/index.cjs +46 -0
- package/cjs/index.d.cts +7 -0
- package/esm/DynamicSnippetsGenerator.d.ts +18 -0
- package/esm/DynamicSnippetsGenerator.js +1 -0
- package/esm/DynamicSnippetsGeneratorContext-aXWxVpwD.d.ts +86 -0
- package/esm/EndpointSnippetGenerator.d.ts +52 -0
- package/esm/EndpointSnippetGenerator.js +1 -0
- package/esm/chunk-BVS32MTY.js +1 -0
- package/esm/chunk-EX7EKKG4.js +1 -0
- package/esm/chunk-IM4ZUKD4.js +1 -0
- package/esm/chunk-LKHXBDU2.js +1 -0
- package/esm/chunk-NPWTXI2T.js +23 -0
- package/esm/chunk-OCJMJMBV.js +14 -0
- package/esm/chunk-ZMJ4WKFB.js +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +5 -0
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -0
- package/esm/context/DynamicTypeLiteralMapper.d.ts +5 -0
- package/esm/context/DynamicTypeLiteralMapper.js +1 -0
- package/esm/context/FilePropertyMapper.d.ts +5 -0
- package/esm/context/FilePropertyMapper.js +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +13 -0
- package/package.json +27 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FernIr } from '@fern-api/dynamic-ir-sdk';
|
|
2
|
+
import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-aXWxVpwD.js';
|
|
3
|
+
import '@fern-api/browser-compatible-base-generator';
|
|
4
|
+
import '@fern-api/python-ast';
|
|
5
|
+
import '@fern-api/python-browser-compatible-base';
|
|
6
|
+
|
|
7
|
+
declare class EndpointSnippetGenerator {
|
|
8
|
+
private context;
|
|
9
|
+
constructor({ context }: {
|
|
10
|
+
context: DynamicSnippetsGeneratorContext;
|
|
11
|
+
});
|
|
12
|
+
generateSnippet({ endpoint, request }: {
|
|
13
|
+
endpoint: FernIr.dynamic.Endpoint;
|
|
14
|
+
request: FernIr.dynamic.EndpointSnippetRequest;
|
|
15
|
+
}): Promise<string>;
|
|
16
|
+
generateSnippetSync({ endpoint, request }: {
|
|
17
|
+
endpoint: FernIr.dynamic.Endpoint;
|
|
18
|
+
request: FernIr.dynamic.EndpointSnippetRequest;
|
|
19
|
+
}): string;
|
|
20
|
+
private buildPythonFile;
|
|
21
|
+
private constructClient;
|
|
22
|
+
private getConstructorArgs;
|
|
23
|
+
private getConstructorEnvironmentArgs;
|
|
24
|
+
private getEnvironmentValue;
|
|
25
|
+
private getConstructorAuthArgs;
|
|
26
|
+
private getConstructorBasicAuthArg;
|
|
27
|
+
private getConstructorBearerAuthArgs;
|
|
28
|
+
private getConstructorHeaderAuthArgs;
|
|
29
|
+
private getConstructorOAuthArgs;
|
|
30
|
+
private getConstructorHeaderArgs;
|
|
31
|
+
private getConstructorHeaderArg;
|
|
32
|
+
private callMethod;
|
|
33
|
+
private getMethodArgs;
|
|
34
|
+
private getMethodArgsForBodyRequest;
|
|
35
|
+
private getBodyRequestArgs;
|
|
36
|
+
private getBodyRequestArgsForTypeReference;
|
|
37
|
+
private getBodyRequestArgsForNamedTypeReference;
|
|
38
|
+
private getBodyRequestArgsForBytes;
|
|
39
|
+
private getBytesBodyRequestTypeInstantiation;
|
|
40
|
+
private getMethodArgsForInlinedRequest;
|
|
41
|
+
private getFilePropertyInfo;
|
|
42
|
+
private getInlinedRequestArgs;
|
|
43
|
+
private getInlinedRequestBodyObjectFields;
|
|
44
|
+
private getFileUploadRequestBodyObjectFields;
|
|
45
|
+
private getReferencedRequestBodyPropertyTypeInstantiation;
|
|
46
|
+
private getInlinedRequestBodyPropertyObjectFields;
|
|
47
|
+
private getPathParameters;
|
|
48
|
+
private getMethod;
|
|
49
|
+
private getEnvironmentOptionName;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { EndpointSnippetGenerator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-IM4ZUKD4.js";import"./chunk-EX7EKKG4.js";import"./chunk-NPWTXI2T.js";export{a as EndpointSnippetGenerator};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as s}from"./chunk-EX7EKKG4.js";import{j as p,k as u,m as l,n as c,p as r}from"./chunk-NPWTXI2T.js";u();l();var d="value",y=class{constructor({context:e}){p(this,"context");this.context=e}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?r.TypeInstantiation.none():(this.context.errors.add({severity:s.Critical,message:"Expected non-null value, but got null"}),r.TypeInstantiation.nop());if(e.value===void 0)return r.TypeInstantiation.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return this.convertLiteral({literalType:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?r.TypeInstantiation.nop():this.convertNamed({named:t,value:e.value,as:e.as})}case"optional":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"nullable":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value});case"unknown":return r.TypeInstantiation.unknown(e.value);default:c(e.typeReference)}}convertLiteral({literalType:e,value:t}){switch(e.type){case"boolean":{let i=this.context.getValueAsBoolean({value:t});return i==null?r.TypeInstantiation.nop():r.TypeInstantiation.bool(i)}case"string":{let i=this.context.getValueAsString({value:t});return i==null?r.TypeInstantiation.nop():r.TypeInstantiation.str(i)}default:c(e)}}convertList({list:e,value:t}){return Array.isArray(t)?r.TypeInstantiation.list(t.map((i,n)=>{this.context.errors.scope({index:n});try{return this.convert({typeReference:e,value:i})}finally{this.context.errors.unscope()}}),{multiline:!0}):(this.context.errors.add({severity:s.Critical,message:`Expected array but got: ${typeof t}`}),r.TypeInstantiation.nop())}convertSet({set:e,value:t}){return Array.isArray(t)?r.TypeInstantiation.set(t.map((i,n)=>{this.context.errors.scope({index:n});try{return this.convert({typeReference:e,value:i})}finally{this.context.errors.unscope()}}),{multiline:!0}):(this.context.errors.add({severity:s.Critical,message:`Expected array but got: ${typeof t}`}),r.TypeInstantiation.nop())}convertMap({map:e,value:t}){return typeof t!="object"||t==null?(this.context.errors.add({severity:s.Critical,message:`Expected object but got: ${t==null?"null":typeof t}`}),r.TypeInstantiation.nop()):r.TypeInstantiation.dict(Object.entries(t).map(([i,n])=>{this.context.errors.scope(i);try{return{key:this.convert({typeReference:e.key,value:i,as:"key"}),value:this.convert({typeReference:e.value,value:n})}}finally{this.context.errors.unscope()}}),{multiline:!0})}convertNamed({named:e,value:t,as:i}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:t,as:i});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:t});case"enum":return this.convertEnum({enum_:e,value:t});case"object":return this.convertObject({object_:e,value:t});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t});default:c(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:t}){let i=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t});if(i==null)return r.TypeInstantiation.nop();let n=i.singleDiscriminatedUnionType,a=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:i,unionVariant:n});if(a==null)return r.TypeInstantiation.nop();let o={name:this.context.getPropertyName(e.discriminant.name),value:r.TypeInstantiation.str(n.discriminantValue.wireValue)};return r.TypeInstantiation.typedDict([o,...a],{multiline:!0})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:e,unionVariant:t}){let i=this.getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:t});switch(t.type){case"samePropertiesAsObject":{let n=this.context.resolveNamedType({typeId:t.typeId});if(n==null)return;let a=this.convertNamed({named:n,value:e.value});if(!a.isTypedDict()){this.context.errors.add({severity:s.Critical,message:"Internal error; expected union value to be an object"});return}let o=a.asTypedDictOrThrow();return[...i,...o.entries]}case"singleProperty":try{this.context.errors.scope(t.discriminantValue.wireValue);let n=this.context.getRecord(e.value);return n==null?[...i,{name:d,value:this.convert({typeReference:t.typeReference,value:e.value})}]:[...i,{name:this.context.getPropertyName(t.discriminantValue.name),value:this.convert({typeReference:t.typeReference,value:n[t.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return i;default:c(t)}}getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:t}){var n,a;return this.context.associateByWireValue({parameters:(n=t.properties)!=null?n:[],values:(a=this.context.getRecord(e.value))!=null?a:{},ignoreMissingParameters:!0}).map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getPropertyName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})}convertObject({object_:e,value:t}){var n;let i=this.context.associateByWireValue({parameters:e.properties,values:(n=this.context.getRecord(t))!=null?n:{}});return r.TypeInstantiation.typedDict(i.map(a=>{this.context.errors.scope(a.name.wireValue);try{return{name:this.context.getPropertyName(a.name.name),value:this.convert(a)}}finally{this.context.errors.unscope()}}),{multiline:!0})}convertEnum({enum_:e,value:t}){let i=this.getEnumValue({enum_:e,value:t});return i==null?r.TypeInstantiation.nop():r.TypeInstantiation.str(i)}getEnumValue({enum_:e,value:t}){if(typeof t!="string"){this.context.errors.add({severity:s.Critical,message:`Expected enum value string, got: ${typeof t}`});return}if(e.values.find(n=>n.wireValue===t)==null){this.context.errors.add({severity:s.Critical,message:`An enum value named "${t}" does not exist in this context`});return}return t}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t}){let i=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t});return i==null?r.TypeInstantiation.nop():i}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t}){for(let i of e.types)try{return this.convert({typeReference:i,value:t})}catch(n){continue}this.context.errors.add({severity:s.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof t}" value`})}convertPrimitive({primitive:e,value:t,as:i}){switch(e){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let n=this.getValueAsNumber({value:t,as:i});return n==null?r.TypeInstantiation.nop():r.TypeInstantiation.int(n)}case"FLOAT":case"DOUBLE":{let n=this.getValueAsNumber({value:t});return n==null?r.TypeInstantiation.nop():r.TypeInstantiation.float(n)}case"BOOLEAN":{let n=this.getValueAsBoolean({value:t,as:i});return n==null?r.TypeInstantiation.nop():r.TypeInstantiation.bool(n)}case"BASE_64":case"BIG_INTEGER":case"STRING":{let n=this.context.getValueAsString({value:t});return n==null?r.TypeInstantiation.nop():r.TypeInstantiation.str(n)}case"UUID":{let n=this.context.getValueAsString({value:t});return n==null?r.TypeInstantiation.nop():r.TypeInstantiation.uuid(n)}case"DATE":{let n=this.context.getValueAsString({value:t});return n==null?r.TypeInstantiation.nop():r.TypeInstantiation.date(n)}case"DATE_TIME":{let n=this.context.getValueAsString({value:t});return n==null?r.TypeInstantiation.nop():r.TypeInstantiation.datetime(n)}default:c(e)}}getValueAsNumber({value:e,as:t}){let i=t==="key"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:i})}getValueAsBoolean({value:e,as:t}){let i=t==="key"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:i})}};export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as P,b as T,c as S,d as b,j as a,k as p,m as l,n as h,o as E}from"./chunk-NPWTXI2T.js";p();l();p();l();var y=class{constructor(){a(this,"reporter");a(this,"snippet");a(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){this.shouldUpdate({snippet:r,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:r}){var t,n;return this.reporter==null||this.reporter.size()>0&&r.size()===0?!0:e.length>((n=(t=this.snippet)==null?void 0:t.length)!=null?n:0)}};var R=class{constructor(e){a(this,"context");this.context=e}async generate(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new y;for(let i of t){let s=this.context.clone(),d=this.createSnippetGenerator(s);try{let u=await d.generateSnippet({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:u,errors:void 0};n.update({context:s,snippet:u})}catch(u){n.err==null&&(n.err=u)}}return n.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new y;for(let i of t){let s=this.context.clone(),d=this.createSnippetGenerator(s);try{let u=d.generateSnippetSync({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:u,errors:void 0};n.update({context:s,snippet:u})}catch(u){n.err==null&&(n.err=u)}}return n.getResponseOrThrow({endpoint:e.endpoint})}};p();l();var o={Critical:"CRITICAL",Warning:"WARNING"},g=class m{constructor(){a(this,"errors");a(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(T(P({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new m;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let t of e){if(typeof t=="string"){r.push(t);continue}r[r.length-1]+=`[${t.index}]`}return r}};p();l();p();l();p();l();var v=class{constructor(){a(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let t=e.match(this.REFERENCE_REGEX);if(!(t==null||t[1]==null||t[2]==null))return{method:t[1],path:t[2]}}};var w=class{constructor({ir:e,config:r,options:t={}}){a(this,"config");a(this,"options");a(this,"errors");a(this,"_ir");a(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.options=t,this.errors=new g,this.httpEndpointReferenceParser=new v}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[n,i]of Object.entries(r)){this.errors.scope(n);try{let s=e.find(u=>u.name.wireValue===n);if(s==null)throw this.newParameterNotRecognizedError(n);let d=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;t.push({name:s.name,typeReference:s.typeReference,value:d})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let n=[];for(let[i,s]of Object.entries(r)){this.errors.scope(i);try{let d=e.find(u=>u.name.wireValue===i);if(d==null){if(t)continue;this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(i).message});continue}n.push({name:d.name,typeReference:d.typeReference,value:s})}finally{this.errors.unscope()}}return n}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:o.Critical,message:`Expected file value to be a string, got ${typeof t}`});return}return t}}getFileArrayValues({property:e,record:r}){let t=r[e.wireValue];if(t==null)return;if(!Array.isArray(t)){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let n=[];for(let i of t){if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}n.push(i)}return n}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:o.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:o.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let t=this.getRecord(r);if(t==null)return;let n=e.discriminant.wireValue,i=t[n];if(i==null){this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:o.Critical,message:`No type found for discriminant value "${i}"`});return}let x=t,{[n]:d}=x,u=b(x,[S(n)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:u}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocationOrThrow(e){let r=[];for(let t of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:t,parsedEndpoint:e})&&r.push(t);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:t}){var n;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:t}):!((n=e.metadata)!=null&&n.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,n;return r&&((n=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?n:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:h(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}default:h(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let t=r.environments[0];if(t==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let n=new Set(E(t.urls));for(let i of E(e))n.has(i)&&n.delete(i);return n.size>0?(this.errors.add({severity:o.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${E(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:h(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:h(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:h(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};p();l();var A={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};p();l();export{R as a,o as b,w as c,A as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c,d as o}from"./chunk-EX7EKKG4.js";import{j as g,k as f,m as v,n as u,p as n}from"./chunk-NPWTXI2T.js";f();v();var x={type:"primitive",value:"STRING"},A=["example"],I="client",d="request",F=class{constructor({context:e}){g(this,"context");this.context=e}async generateSnippet({endpoint:e,request:t}){return this.buildPythonFile({endpoint:e,snippet:t}).toString()}generateSnippetSync({endpoint:e,request:t}){return this.buildPythonFile({endpoint:e,snippet:t}).toString()}buildPythonFile({endpoint:e,snippet:t}){return n.file({path:A,statements:[this.constructClient({endpoint:e,snippet:t}),this.callMethod({endpoint:e,snippet:t})]})}constructClient({endpoint:e,snippet:t}){return n.assign({lhs:n.reference({name:I}),rhs:n.instantiateClass({classReference:this.context.getRootClientClassReference(),arguments_:this.getConstructorArgs({endpoint:e,snippet:t}).map(r=>n.methodArgument({name:r.name,value:r.value})),multiline:!0})})}getConstructorArgs({endpoint:e,snippet:t}){let r=[],a=this.getConstructorEnvironmentArgs({baseUrl:t.baseURL,environment:t.environment});return a.length>0&&r.push(...a),e.auth!=null&&(t.auth!=null?r.push(...this.getConstructorAuthArgs({auth:e.auth,values:t.auth})):this.context.errors.add({severity:c.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`})),this.context.errors.scope(o.PathParameters),this.context.ir.pathParameters!=null&&r.push(...this.getPathParameters({namedParameters:this.context.ir.pathParameters,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(o.Headers),this.context.ir.headers!=null&&t.headers!=null&&r.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),r}getConstructorEnvironmentArgs({baseUrl:e,environment:t}){let r=this.getEnvironmentValue({baseUrl:e,environment:t});return r==null?[]:[{name:this.getEnvironmentOptionName({environment:t}),value:r}]}getEnvironmentValue({baseUrl:e,environment:t}){if(e!=null&&t!=null){this.context.errors.add({severity:c.Critical,message:"Cannot specify both baseUrl and environment options"});return}if(e!=null)return n.TypeInstantiation.str(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let r=this.context.getEnvironmentTypeReferenceFromID(t);if(r==null){this.context.errors.add({severity:c.Warning,message:`Environment ${JSON.stringify(t)} was not found`});return}return n.TypeInstantiation.reference(r)}if(this.context.isMultiEnvironmentValues(t))return this.context.validateMultiEnvironmentUrlValues(t)?n.TypeInstantiation.reference(n.instantiateClass({classReference:this.context.getEnvironmentClassReference(),arguments_:Object.entries(t).map(([r,a])=>({name:r,value:this.context.dynamicTypeLiteralMapper.convert({typeReference:x,value:a})})).map(r=>n.methodArgument({name:r.name,value:r.value})),multiline:!0})):void 0}}getConstructorAuthArgs({auth:e,values:t}){switch(e.type){case"basic":return t.type!=="basic"?(this.context.errors.add({severity:c.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorBasicAuthArg({auth:e,values:t});case"bearer":return t.type!=="bearer"?(this.context.errors.add({severity:c.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorBearerAuthArgs({auth:e,values:t});case"header":return t.type!=="header"?(this.context.errors.add({severity:c.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorHeaderAuthArgs({auth:e,values:t});case"oauth":return t.type!=="oauth"?(this.context.errors.add({severity:c.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorOAuthArgs({auth:e,values:t});default:u(e)}}getConstructorBasicAuthArg({auth:e,values:t}){return[{name:this.context.getPropertyName(e.username),value:n.TypeInstantiation.str(t.username)},{name:this.context.getPropertyName(e.password),value:n.TypeInstantiation.str(t.password)}]}getConstructorBearerAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.token),value:n.TypeInstantiation.str(t.token)}]}getConstructorHeaderAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.header.name.name),value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:t.value})}]}getConstructorOAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.clientId),value:n.TypeInstantiation.str(t.clientId)},{name:this.context.getPropertyName(e.clientSecret),value:n.TypeInstantiation.str(t.clientSecret)}]}getConstructorHeaderArgs({headers:e,values:t}){let r=[];for(let a of e){let s=this.getConstructorHeaderArg({header:a,value:t.value});s!=null&&r.push(s)}return r}getConstructorHeaderArg({header:e,value:t}){let r=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:t});if(!n.TypeInstantiation.isNop(r))return{name:this.context.getPropertyName(e.name.name),value:r}}callMethod({endpoint:e,snippet:t}){return n.invokeMethod({on:n.reference({name:I}),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:t}).map(r=>n.methodArgument({name:r.name,value:r.value})),multiline:!0})}getMethodArgs({endpoint:e,snippet:t}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:t});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:t});default:u(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:t}){var s,i;let r=[];this.context.errors.scope(o.PathParameters);let a=[...(s=this.context.ir.pathParameters)!=null?s:[],...(i=e.pathParameters)!=null?i:[]];return a.length>0&&r.push(...this.getPathParameters({namedParameters:a,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(o.RequestBody),e.body!=null&&r.push(...this.getBodyRequestArgs({body:e.body,value:t.requestBody})),this.context.errors.unscope(),r}getBodyRequestArgs({body:e,value:t}){switch(e.type){case"bytes":return[{name:d,value:this.getBytesBodyRequestTypeInstantiation({value:t})}];case"typeReference":return this.getBodyRequestArgsForTypeReference({typeReference:e.value,value:t});default:u(e)}}getBodyRequestArgsForTypeReference({typeReference:e,value:t}){switch(e.type){case"named":{let r=this.context.resolveNamedType({typeId:e.value});return r==null?[]:this.getBodyRequestArgsForNamedTypeReference({typeReference:e,named:r,value:t})}case"nullable":case"optional":return this.getBodyRequestArgsForTypeReference({typeReference:e.value,value:t});case"list":case"map":case"set":case"literal":case"primitive":case"unknown":return[{name:d,value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e,value:t})}];default:u(e)}}getBodyRequestArgsForNamedTypeReference({typeReference:e,named:t,value:r}){var a;switch(t.type){case"alias":return this.getBodyRequestArgsForTypeReference({typeReference:t.typeReference,value:r});case"enum":case"discriminatedUnion":case"undiscriminatedUnion":return[{name:d,value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e,value:r})}];case"object":return this.context.associateByWireValue({parameters:t.properties,values:(a=this.context.getRecord(r))!=null?a:{}}).map(i=>({name:this.context.getPropertyName(i.name.name),value:this.context.dynamicTypeLiteralMapper.convert(i)}));default:u(t)}}getBodyRequestArgsForBytes({body:e,value:t}){let r=this.getBytesBodyRequestTypeInstantiation({value:t});return n.TypeInstantiation.isNop(r)?[]:[{name:this.context.getPropertyName(e.bodyKey),value:r}]}getBytesBodyRequestTypeInstantiation({value:e}){return typeof e!="string"?(this.context.errors.add({severity:c.Critical,message:`Expected bytes value to be a string, got ${typeof e}`}),n.TypeInstantiation.nop()):n.TypeInstantiation.bytes(e)}getMethodArgsForInlinedRequest({request:e,snippet:t}){let r=[],a=this.context.shouldInlinePathParameters();this.context.errors.scope(o.PathParameters);let s=[];e.pathParameters!=null&&s.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(o.RequestBody);let i=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:a})||r.push(...s),this.context.needsRequestParameter({request:e,inlinePathParameters:a,inlineFileProperties:!0})&&r.push(...this.getInlinedRequestArgs({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:a})?s:[],filePropertyInfo:i})),r}getFilePropertyInfo({request:e,snippet:t}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:t.requestBody})}getInlinedRequestArgs({request:e,snippet:t,pathParameterFields:r,filePropertyInfo:a}){var y,m,l,h;this.context.errors.scope(o.QueryParameters);let i=this.context.associateQueryParametersByWireValue({parameters:(y=e.queryParameters)!=null?y:[],values:(m=t.queryParameters)!=null?m:{}}).map(p=>({name:this.context.getPropertyName(p.name.name),value:this.context.dynamicTypeLiteralMapper.convert(p)}));this.context.errors.unscope(),this.context.errors.scope(o.Headers);let P=this.context.associateByWireValue({parameters:(l=e.headers)!=null?l:[],values:(h=t.headers)!=null?h:{}}).map(p=>({name:this.context.getPropertyName(p.name.name),value:this.context.dynamicTypeLiteralMapper.convert(p)}));this.context.errors.unscope(),this.context.errors.scope(o.RequestBody);let R=e.body!=null?this.getInlinedRequestBodyObjectFields({body:e.body,value:t.requestBody,filePropertyInfo:a}):[];return this.context.errors.unscope(),[...r,...i,...P,...R]}getInlinedRequestBodyObjectFields({body:e,value:t,filePropertyInfo:r}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyObjectFields({parameters:e.value,value:t});case"referenced":return this.getReferencedRequestBodyPropertyTypeInstantiation({body:e,value:t});case"fileUpload":return this.getFileUploadRequestBodyObjectFields({filePropertyInfo:r});default:u(e)}}getFileUploadRequestBodyObjectFields({filePropertyInfo:e}){return[...e.fileFields,...e.bodyPropertyFields]}getReferencedRequestBodyPropertyTypeInstantiation({body:e,value:t}){let r=e.bodyType;switch(r.type){case"bytes":return this.getBodyRequestArgsForBytes({body:e,value:t});case"typeReference":return this.getBodyRequestArgsForTypeReference({typeReference:r.value,value:t});default:u(r)}}getInlinedRequestBodyPropertyObjectFields({parameters:e,value:t}){var s;let r=[],a=this.context.associateByWireValue({parameters:e,values:(s=this.context.getRecord(t))!=null?s:{}});for(let i of a)r.push({name:this.context.getPropertyName(i.name.name),value:this.context.dynamicTypeLiteralMapper.convert(i)});return r}getPathParameters({namedParameters:e,snippet:t}){var s;let r=[],a=this.context.associateByWireValue({parameters:e,values:(s=t.pathParameters)!=null?s:{},ignoreMissingParameters:!0});for(let i of a)r.push({name:this.context.getPropertyName(i.name.name),value:this.context.dynamicTypeLiteralMapper.convert(i)});return r}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>this.context.getMethodName(t)).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getEnvironmentOptionName({environment:e}){return e!=null?"environment":"base_url"}};export{F as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s,k as y,m as l,n as c,p as o}from"./chunk-NPWTXI2T.js";y();l();var d=class{constructor({context:t}){s(this,"context");this.context=t}getFilePropertyInfo({body:t,value:i}){var p;let e={fileFields:[],bodyPropertyFields:[]},a=(p=this.context.getRecord(i))!=null?p:{};for(let r of t.properties)switch(r.type){case"file":{let n=this.getSingleFileProperty({property:r,record:a});if(o.TypeInstantiation.isNop(n))break;e.fileFields.push({name:this.context.getPropertyName(r.name),value:n});break}case"fileArray":{let n=this.getArrayFileProperty({property:r,record:a});if(o.TypeInstantiation.isNop(n))break;e.fileFields.push({name:this.context.getPropertyName(r.name),value:n});break}case"bodyProperty":{let n=this.getBodyProperty({property:r,record:a});if(o.TypeInstantiation.isNop(n))break;e.bodyPropertyFields.push({name:this.context.getPropertyName(r.name.name),value:n});break}default:c(r)}return e}getSingleFileProperty({property:t,record:i}){let e=this.context.getSingleFileValue({property:t,record:i});return e==null?o.TypeInstantiation.nop():this.context.getFileFromString(e)}getArrayFileProperty({property:t,record:i}){let e=this.context.getFileArrayValues({property:t,record:i});return e==null?o.TypeInstantiation.nop():o.TypeInstantiation.list(e.map(a=>this.context.getFileFromString(a)))}getBodyProperty({property:t,record:i}){let e=i[t.name.wireValue];return e==null?o.TypeInstantiation.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:e})}};export{d as a};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var ot=Object.create;var ce=Object.defineProperty,at=Object.defineProperties,ft=Object.getOwnPropertyDescriptor,ht=Object.getOwnPropertyDescriptors,ut=Object.getOwnPropertyNames,me=Object.getOwnPropertySymbols,ct=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var Ne=(i,t,e)=>t in i?ce(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,_e=(i,t)=>{for(var e in t||(t={}))ve.call(t,e)&&Ne(i,e,t[e]);if(me)for(var e of me(t))Be.call(t,e)&&Ne(i,e,t[e]);return i},Yr=(i,t)=>at(i,ht(t));var Fr=i=>typeof i=="symbol"?i:i+"",be=(i,t)=>{var e={};for(var r in i)ve.call(i,r)&&t.indexOf(r)<0&&(e[r]=i[r]);if(i!=null&&me)for(var r of me(i))t.indexOf(r)<0&&Be.call(i,r)&&(e[r]=i[r]);return e};var Ie=(i,t)=>()=>(i&&(t=i(i=0)),t);var Or=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),lt=(i,t)=>{for(var e in t)ce(i,e,{get:t[e],enumerable:!0})},Ce=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ut(t))!ve.call(i,n)&&n!==e&&ce(i,n,{get:()=>t[n],enumerable:!(r=ft(t,n))||r.enumerable});return i};var Wr=(i,t,e)=>(e=i!=null?ot(ct(i)):{},Ce(t||!i||!i.__esModule?ce(e,"default",{value:i,enumerable:!0}):e,i)),$r=i=>Ce(ce({},"__esModule",{value:!0}),i);var f=(i,t,e)=>Ne(i,typeof t!="symbol"?t+"":t,e);function De(){throw new Error("setTimeout has not been defined")}function Ye(){throw new Error("clearTimeout has not been defined")}function Fe(i){if(Y===setTimeout)return setTimeout(i,0);if((Y===De||!Y)&&setTimeout)return Y=setTimeout,setTimeout(i,0);try{return Y(i,0)}catch(t){try{return Y.call(null,i,0)}catch(e){return Y.call(this,i,0)}}}function pt(i){if(F===clearTimeout)return clearTimeout(i);if((F===Ye||!F)&&clearTimeout)return F=clearTimeout,clearTimeout(i);try{return F(i)}catch(t){try{return F.call(null,i)}catch(e){return F.call(this,i)}}}function mt(){!q||!Z||(q=!1,Z.length?C=Z.concat(C):de=-1,C.length&&Oe())}function Oe(){if(!q){var i=Fe(mt);q=!0;for(var t=C.length;t;){for(Z=C,C=[];++de<t;)Z&&Z[de].run();de=-1,t=C.length}Z=null,q=!1,pt(i)}}function dt(i){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];C.push(new We(i,t)),C.length===1&&!q&&Fe(Oe)}function We(i,t){this.fun=i,this.array=t}function J(){}function Bt(i){throw new Error("process.binding is not supported")}function _t(){return"/"}function bt(i){throw new Error("process.chdir is not supported")}function Ct(){return 0}function Dt(i){var t=Mt.call(j)*.001,e=Math.floor(t),r=Math.floor(t%1*1e9);return i&&(e=e-i[0],r=r-i[1],r<0&&(e--,r+=1e9)),[e,r]}function Ft(){var i=new Date,t=i-Yt;return t/1e3}var Y,F,C,q,Z,de,wt,xt,yt,gt,Et,Tt,At,Rt,Nt,vt,It,Lt,St,kt,Ut,Pt,j,Mt,Yt,y,Me,u=Ie(()=>{"use strict";Y=De,F=Ye;typeof globalThis.setTimeout=="function"&&(Y=setTimeout);typeof globalThis.clearTimeout=="function"&&(F=clearTimeout);C=[],q=!1,de=-1;We.prototype.run=function(){this.fun.apply(null,this.array)};wt="browser",xt="browser",yt=!0,gt={},Et=[],Tt="",At={},Rt={},Nt={};vt=J,It=J,Lt=J,St=J,kt=J,Ut=J,Pt=J;j=globalThis.performance||{},Mt=j.now||j.mozNow||j.msNow||j.oNow||j.webkitNow||function(){return new Date().getTime()};Yt=new Date;y={nextTick:dt,title:wt,browser:yt,env:gt,argv:Et,version:Tt,versions:At,on:vt,addListener:It,once:Lt,off:St,removeListener:kt,removeAllListeners:Ut,emit:Pt,binding:Bt,cwd:_t,chdir:bt,umask:Ct,hrtime:Dt,platform:xt,release:Rt,config:Nt,uptime:Ft},Me={};Object.keys(Me).forEach(i=>{let t=i.split("."),e=y;for(let r=0;r<t.length;r++){let n=t[r];r===t.length-1?e[n]=Me[i]:e=e[n]||(e[n]={})}})});function Ve(){Se=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=i.length;t<e;++t)B[t]=i[t],S[i.charCodeAt(t)]=t;S[45]=62,S[95]=63}function Wt(i){Se||Ve();var t,e,r,n,s,o,h=i.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=i[h-2]==="="?2:i[h-1]==="="?1:0,o=new Ot(h*3/4-s),r=s>0?h-4:h;var l=0;for(t=0,e=0;t<r;t+=4,e+=3)n=S[i.charCodeAt(t)]<<18|S[i.charCodeAt(t+1)]<<12|S[i.charCodeAt(t+2)]<<6|S[i.charCodeAt(t+3)],o[l++]=n>>16&255,o[l++]=n>>8&255,o[l++]=n&255;return s===2?(n=S[i.charCodeAt(t)]<<2|S[i.charCodeAt(t+1)]>>4,o[l++]=n&255):s===1&&(n=S[i.charCodeAt(t)]<<10|S[i.charCodeAt(t+1)]<<4|S[i.charCodeAt(t+2)]>>2,o[l++]=n>>8&255,o[l++]=n&255),o}function $t(i){return B[i>>18&63]+B[i>>12&63]+B[i>>6&63]+B[i&63]}function Qt(i,t,e){for(var r,n=[],s=t;s<e;s+=3)r=(i[s]<<16)+(i[s+1]<<8)+i[s+2],n.push($t(r));return n.join("")}function $e(i){Se||Ve();for(var t,e=i.length,r=e%3,n="",s=[],o=16383,h=0,l=e-r;h<l;h+=o)s.push(Qt(i,h,h+o>l?l:h+o));return r===1?(t=i[e-1],n+=B[t>>2],n+=B[t<<4&63],n+="=="):r===2&&(t=(i[e-2]<<8)+i[e-1],n+=B[t>>10],n+=B[t>>4&63],n+=B[t<<2&63],n+="="),s.push(n),s.join("")}function we(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function M(i,t){if(we()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(t),i.__proto__=a.prototype):(i===null&&(i=new a(t)),i.length=t),i}function a(i,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(i,t,e);if(typeof i=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return ke(this,i)}return Ze(this,i,t,e)}function Ze(i,t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Zt(i,t,e,r):typeof t=="string"?Vt(i,t,e):Jt(i,t)}function Je(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function zt(i,t,e,r){return Je(t),t<=0?M(i,t):e!==void 0?typeof r=="string"?M(i,t).fill(e,r):M(i,t).fill(e):M(i,t)}function ke(i,t){if(Je(t),i=M(i,t<0?0:Ue(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)i[e]=0;return i}function Vt(i,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=He(t,e)|0;i=M(i,r);var n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Le(i,t){var e=t.length<0?0:Ue(t.length)|0;i=M(i,e);for(var r=0;r<e;r+=1)i[r]=t[r]&255;return i}function Zt(i,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),a.TYPED_ARRAY_SUPPORT?(i=t,i.__proto__=a.prototype):i=Le(i,t),i}function Jt(i,t){if(_(t)){var e=Ue(t.length)|0;return i=M(i,e),i.length===0||t.copy(i,0,0,e),i}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||lr(t.length)?M(i,0):Le(i,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Le(i,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ue(i){if(i>=we())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+we().toString(16)+" bytes");return i|0}function _(i){return!!(i!=null&&i._isBuffer)}function He(i,t){if(_(i))return i.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var e=i.length;if(e===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return xe(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return tt(i).length;default:if(r)return xe(i).length;t=(""+t).toLowerCase(),r=!0}}function Ht(i,t,e){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(i||(i="utf8");;)switch(i){case"hex":return nr(this,t,e);case"utf8":case"utf-8":return je(this,t,e);case"ascii":return rr(this,t,e);case"latin1":case"binary":return ir(this,t,e);case"base64":return er(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sr(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),r=!0}}function H(i,t,e){var r=i[t];i[t]=i[e],i[e]=r}function Ge(i,t,e,r,n){if(i.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:i.length-1),e<0&&(e=i.length+e),e>=i.length){if(n)return-1;e=i.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,r)),_(t))return t.length===0?-1:Qe(i,t,e,r,n);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(i,t,e):Uint8Array.prototype.lastIndexOf.call(i,t,e):Qe(i,[t],e,r,n);throw new TypeError("val must be string, number or Buffer")}function Qe(i,t,e,r,n){var s=1,o=i.length,h=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(i.length<2||t.length<2)return-1;s=2,o/=2,h/=2,e/=2}function l(g,w){return s===1?g[w]:g.readUInt16BE(w*s)}var m;if(n){var p=-1;for(m=e;m<o;m++)if(l(i,m)===l(t,p===-1?0:m-p)){if(p===-1&&(p=m),m-p+1===h)return p*s}else p!==-1&&(m-=m-p),p=-1}else for(e+h>o&&(e=o-h),m=e;m>=0;m--){for(var d=!0,A=0;A<h;A++)if(l(i,m+A)!==l(t,A)){d=!1;break}if(d)return m}return-1}function Gt(i,t,e,r){e=Number(e)||0;var n=i.length-e;r?(r=Number(r),r>n&&(r=n)):r=n;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var h=parseInt(t.substr(o*2,2),16);if(isNaN(h))return o;i[e+o]=h}return o}function Xt(i,t,e,r){return Ee(xe(t,i.length-e),i,e,r)}function Xe(i,t,e,r){return Ee(ur(t),i,e,r)}function jt(i,t,e,r){return Xe(i,t,e,r)}function qt(i,t,e,r){return Ee(tt(t),i,e,r)}function Kt(i,t,e,r){return Ee(cr(t,i.length-e),i,e,r)}function er(i,t,e){return t===0&&e===i.length?$e(i):$e(i.slice(t,e))}function je(i,t,e){e=Math.min(i.length,e);for(var r=[],n=t;n<e;){var s=i[n],o=null,h=s>239?4:s>223?3:s>191?2:1;if(n+h<=e){var l,m,p,d;switch(h){case 1:s<128&&(o=s);break;case 2:l=i[n+1],(l&192)===128&&(d=(s&31)<<6|l&63,d>127&&(o=d));break;case 3:l=i[n+1],m=i[n+2],(l&192)===128&&(m&192)===128&&(d=(s&15)<<12|(l&63)<<6|m&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:l=i[n+1],m=i[n+2],p=i[n+3],(l&192)===128&&(m&192)===128&&(p&192)===128&&(d=(s&15)<<18|(l&63)<<12|(m&63)<<6|p&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,h=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),n+=h}return tr(r)}function tr(i){var t=i.length;if(t<=ze)return String.fromCharCode.apply(String,i);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,i.slice(r,r+=ze));return e}function rr(i,t,e){var r="";e=Math.min(i.length,e);for(var n=t;n<e;++n)r+=String.fromCharCode(i[n]&127);return r}function ir(i,t,e){var r="";e=Math.min(i.length,e);for(var n=t;n<e;++n)r+=String.fromCharCode(i[n]);return r}function nr(i,t,e){var r=i.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var n="",s=t;s<e;++s)n+=hr(i[s]);return n}function sr(i,t,e){for(var r=i.slice(t,e),n="",s=0;s<r.length;s+=2)n+=String.fromCharCode(r[s]+r[s+1]*256);return n}function R(i,t,e){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+t>e)throw new RangeError("Trying to access beyond buffer length")}function L(i,t,e,r,n,s){if(!_(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(e+r>i.length)throw new RangeError("Index out of range")}function ye(i,t,e,r){t<0&&(t=65535+t+1);for(var n=0,s=Math.min(i.length-e,2);n<s;++n)i[e+n]=(t&255<<8*(r?n:1-n))>>>(r?n:1-n)*8}function ge(i,t,e,r){t<0&&(t=4294967295+t+1);for(var n=0,s=Math.min(i.length-e,4);n<s;++n)i[e+n]=t>>>(r?n:3-n)*8&255}function qe(i,t,e,r,n,s){if(e+r>i.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Ke(i,t,e,r,n){return n||qe(i,t,e,4,34028234663852886e22,-34028234663852886e22),it(i,t,e,r,23,4),e+4}function et(i,t,e,r,n){return n||qe(i,t,e,8,17976931348623157e292,-17976931348623157e292),it(i,t,e,r,52,8),e+8}function ar(i){if(i=fr(i).replace(or,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function fr(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function hr(i){return i<16?"0"+i.toString(16):i.toString(16)}function xe(i,t){t=t||1/0;for(var e,r=i.length,n=null,s=[],o=0;o<r;++o){if(e=i.charCodeAt(o),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&s.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,e<128){if((t-=1)<0)break;s.push(e)}else if(e<2048){if((t-=2)<0)break;s.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;s.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;s.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return s}function ur(i){for(var t=[],e=0;e<i.length;++e)t.push(i.charCodeAt(e)&255);return t}function cr(i,t){for(var e,r,n,s=[],o=0;o<i.length&&!((t-=2)<0);++o)e=i.charCodeAt(o),r=e>>8,n=e%256,s.push(n),s.push(r);return s}function tt(i){return Wt(ar(i))}function Ee(i,t,e,r){for(var n=0;n<r&&!(n+e>=t.length||n>=i.length);++n)t[n+e]=i[n];return n}function lr(i){return i!==i}function pr(i){return i!=null&&(!!i._isBuffer||rt(i)||mr(i))}function rt(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function mr(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&rt(i.slice(0,0))}function Te(i,t,e,r,n){var s,o,h=n*8-r-1,l=(1<<h)-1,m=l>>1,p=-7,d=e?n-1:0,A=e?-1:1,g=i[t+d];for(d+=A,s=g&(1<<-p)-1,g>>=-p,p+=h;p>0;s=s*256+i[t+d],d+=A,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=r;p>0;o=o*256+i[t+d],d+=A,p-=8);if(s===0)s=1-m;else{if(s===l)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-m}return(g?-1:1)*o*Math.pow(2,s-r)}function it(i,t,e,r,n,s){var o,h,l,m=s*8-n-1,p=(1<<m)-1,d=p>>1,A=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:s-1,w=r?1:-1,E=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(h=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=A/l:t+=A*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=p?(h=0,o=p):o+d>=1?(h=(t*l-1)*Math.pow(2,n),o=o+d):(h=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;i[e+g]=h&255,g+=w,h/=256,n-=8);for(o=o<<n|h,m+=n;m>0;i[e+g]=o&255,g+=w,o/=256,m-=8);i[e+g-w]|=E*128}var B,S,Ot,Se,ze,or,nt=Ie(()=>{"use strict";u();c();B=[],S=[],Ot=typeof Uint8Array!="undefined"?Uint8Array:Array,Se=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(i){return i.__proto__=a.prototype,i};a.from=function(i,t,e){return Ze(null,i,t,e)};a.kMaxLength=we();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(i,t,e){return zt(null,i,t,e)};a.allocUnsafe=function(i){return ke(null,i)};a.allocUnsafeSlow=function(i){return ke(null,i)};a.isBuffer=pr;a.compare=function(t,e){if(!_(t)||!_(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,s=0,o=Math.min(r,n);s<o;++s)if(t[s]!==e[s]){r=t[s],n=e[s];break}return r<n?-1:n<r?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),s=0;for(r=0;r<t.length;++r){var o=t[r];if(!_(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};a.byteLength=He;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)H(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)H(this,e,e+3),H(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)H(this,e,e+7),H(this,e+1,e+6),H(this,e+2,e+5),H(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?je(this,0,t):Ht.apply(this,arguments)};a.prototype.equals=function(t){if(!_(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,r,n,s){if(!_(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),e<0||r>t.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&e>=r)return 0;if(n>=s)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,s>>>=0,this===t)return 0;for(var o=s-n,h=r-e,l=Math.min(o,h),m=this.slice(n,s),p=t.slice(e,r),d=0;d<l;++d)if(m[d]!==p[d]){o=m[d],h=p[d];break}return o<h?-1:h<o?1:0};a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};a.prototype.indexOf=function(t,e,r){return Ge(this,t,e,r,!0)};a.prototype.lastIndexOf=function(t,e,r){return Ge(this,t,e,r,!1)};a.prototype.write=function(t,e,r,n){if(e===void 0)n="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")n=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-e;if((r===void 0||r>s)&&(r=s),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Gt(this,t,e,r);case"utf8":case"utf-8":return Xt(this,t,e,r);case"ascii":return Xe(this,t,e,r);case"latin1":case"binary":return jt(this,t,e,r);case"base64":return qt(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};ze=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=a.prototype;else{var s=e-t;n=new a(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+t]}return n};a.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||R(t,e,this.length);for(var n=this[t],s=1,o=0;++o<e&&(s*=256);)n+=this[t+o]*s;return n};a.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||R(t,e,this.length);for(var n=this[t+--e],s=1;e>0&&(s*=256);)n+=this[t+--e]*s;return n};a.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||R(t,e,this.length);for(var n=this[t],s=1,o=0;++o<e&&(s*=256);)n+=this[t+o]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||R(t,e,this.length);for(var n=e,s=1,o=this[t+--n];n>0&&(s*=256);)o+=this[t+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*e)),o};a.prototype.readInt8=function(t,e){return e||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};a.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};a.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),Te(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),Te(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),Te(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),Te(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=e|0,r=r|0,!n){var s=Math.pow(2,8*r)-1;L(this,t,e,r,s,0)}var o=1,h=0;for(this[e]=t&255;++h<r&&(o*=256);)this[e+h]=t/o&255;return e+r};a.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e=e|0,r=r|0,!n){var s=Math.pow(2,8*r)-1;L(this,t,e,r,s,0)}var o=r-1,h=1;for(this[e+o]=t&255;--o>=0&&(h*=256);)this[e+o]=t/h&255;return e+r};a.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ye(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ye(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):ge(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ge(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=e|0,!n){var s=Math.pow(2,8*r-1);L(this,t,e,r,s-1,-s)}var o=0,h=1,l=0;for(this[e]=t&255;++o<r&&(h*=256);)t<0&&l===0&&this[e+o-1]!==0&&(l=1),this[e+o]=(t/h>>0)-l&255;return e+r};a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=e|0,!n){var s=Math.pow(2,8*r-1);L(this,t,e,r,s-1,-s)}var o=r-1,h=1,l=0;for(this[e+o]=t&255;--o>=0&&(h*=256);)t<0&&l===0&&this[e+o+1]!==0&&(l=1),this[e+o]=(t/h>>0)-l&255;return e+r};a.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ye(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ye(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):ge(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ge(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,r){return Ke(this,t,e,!0,r)};a.prototype.writeFloatBE=function(t,e,r){return Ke(this,t,e,!1,r)};a.prototype.writeDoubleLE=function(t,e,r){return et(this,t,e,!0,r)};a.prototype.writeDoubleBE=function(t,e,r){return et(this,t,e,!1,r)};a.prototype.copy=function(t,e,r,n){if(r||(r=0),!n&&n!==0&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var s=n-r,o;if(this===t&&r<e&&e<n)for(o=s-1;o>=0;--o)t[o+e]=this[o+r];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+s),e);return s};a.prototype.fill=function(t,e,r,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),t.length===1){var s=t.charCodeAt(0);s<256&&(t=s)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var o;if(typeof t=="number")for(o=e;o<r;++o)this[o]=t;else{var h=_(t)?t:xe(new a(t,n).toString()),l=h.length;for(o=0;o<r-e;++o)this[o+e]=h[o%l]}return this};or=/[^+\/0-9A-Za-z-_]/g});var c=Ie(()=>{"use strict";nt()});u();c();function G(i){throw new Error("Unexpected value: "+JSON.stringify(i))}u();c();u();c();function dr(i){return Object.keys(i)}var T={};lt(T,{AccessAttribute:()=>K,AstNode:()=>x,Class:()=>O,ClassInstantiation:()=>te,CodeBlock:()=>D,Comment:()=>re,Decorator:()=>ie,Field:()=>W,Lambda:()=>ne,LambdaParameter:()=>se,Method:()=>Q,MethodArgument:()=>ae,MethodInvocation:()=>fe,Operator:()=>he,Parameter:()=>$,PythonFile:()=>ue,Reference:()=>k,StarImport:()=>z,Type:()=>Re,TypeInstantiation:()=>V,accessAttribute:()=>gr,assign:()=>Er,class_:()=>Ar,codeBlock:()=>Sr,comment:()=>kr,decorator:()=>Nr,field:()=>Lr,file:()=>Tr,instantiateClass:()=>Rr,invokeFunction:()=>_r,invokeMethod:()=>br,lambda:()=>Ur,lambdaParameter:()=>Pr,method:()=>Br,methodArgument:()=>Mr,operator:()=>Dr,parameter:()=>Cr,reference:()=>vr,starImport:()=>Ir});u();c();u();c();u();c();u();c();u();c();var X=class{};u();c();u();c();var P=class extends X{constructor(e){super();f(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var wr=4,le=class{constructor(){f(this,"buffer","");f(this,"indentLevel",0);f(this,"hasWrittenAnything",!1);f(this,"lastCharacterIsSemicolon",!1);f(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
2
|
+
`),r=e?t.substring(0,t.length-1):t,n=this.getIndentString(),s=r.replaceAll(`
|
|
3
|
+
`,`
|
|
4
|
+
${n}`);this.isAtStartOfLine()&&(s=n+s),e&&(s+=`
|
|
5
|
+
`),this.writeInternal(s)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new P(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new P(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}controlFlowWithoutStatement(t){new P(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new P(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new P(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",r,n="}"){let s=t.filter(o=>o!==void 0).join(" ");s?this.write(`${s} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),r(),this.dedent()}finally{this.write(n!=null?n:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
6
|
+
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
7
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:r}){if(t.length>0){let n=t[0];n!=null&&r(n);for(let s=1;s<t.length;s++){this.write(e);let o=t[s];o!=null&&r(o)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
8
|
+
`),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*wr)}};u();c();var pe=class extends le{constructor(){super(...arguments);f(this,"fullyQualifiedModulePathsToImportedNames",{})}setRefNameOverrides(e){this.fullyQualifiedModulePathsToImportedNames=e}unsetRefNameOverrides(){this.fullyQualifiedModulePathsToImportedNames={}}getRefNameOverride(e){var n;let r=this.fullyQualifiedModulePathsToImportedNames[e.getFullyQualifiedModulePath()];return r||{name:(n=e.alias)!=null?n:e.name,isAlias:!!e.alias}}toString(){return this.buffer}async toStringFormatted(e){return e.format(this.buffer)}};var x=class extends X{constructor(){super(...arguments);f(this,"references",[])}addReference(e){this.references.push(e)}inheritReferences(e){e!==void 0&&e.references.forEach(r=>{this.references.includes(r)||this.addReference(r)})}getReferences(){return this.references}toString(){let e=new pe;return this.write(e),e.toString()}async toStringFormatted(e){let r=new pe;return this.write(r),r.toStringFormatted(e)}};var K=class extends x{constructor({lhs:e,rhs:r}){super();f(this,"lhs");f(this,"rhs");this.lhs=e,this.inheritReferences(e),this.rhs=r,this.inheritReferences(r)}write(e){this.lhs.write(e),e.write("."),this.rhs.write(e)}};u();c();var Ae=class extends x{constructor({lhs:e,rhs:r}){super();f(this,"lhs");f(this,"rhs");this.lhs=e,this.inheritReferences(e),this.rhs=r,this.inheritReferences(r)}write(e){this.lhs.write(e),e.write(" = "),this.rhs.write(e)}};u();c();var ee=class extends x{constructor({reference:e,arguments_:r,multiline:n}){super();f(this,"reference");f(this,"arguments");f(this,"multiline");this.reference=e,this.arguments=r,this.multiline=n!=null?n:!1,this.inheritReferences(e),this.arguments.forEach(s=>{this.inheritReferences(s)})}write(e){if(this.reference.write(e),this.arguments.length===0){e.write("()");return}e.write("("),this.multiline&&(e.newLine(),e.indent()),this.arguments.forEach((r,n)=>{r.write(e),n<this.arguments.length-1&&(e.write(","),this.multiline?e.newLine():e.write(" "))}),this.multiline&&(e.newLine(),e.dedent()),e.write(")")}};u();c();var O=class extends x{constructor({docs:e,name:r,extends_:n,decorators:s}){super();f(this,"name");f(this,"extends_");f(this,"decorators");f(this,"fields",[]);f(this,"docs");f(this,"statements",[]);this.name=r,this.extends_=n!=null?n:[],this.decorators=s!=null?s:[],this.docs=e,this.extends_.forEach(o=>{this.inheritReferences(o)}),this.decorators.forEach(o=>{this.inheritReferences(o)})}write(e){this.decorators.forEach(r=>{r.write(e)}),e.write(`class ${this.name}`),this.extends_.length>0&&(e.write("("),this.extends_.forEach((r,n)=>{n>0&&e.write(", "),r.write(e)}),e.write(")")),e.write(":"),e.newLine(),e.indent(),this.docs!=null&&(e.write('"""'),e.write(this.docs),e.write('"""')),e.writeNewLineIfLastLineNot(),this.fields.forEach(r=>{r.write(e),e.writeNewLineIfLastLineNot()}),e.dedent(),e.indent(),this.statements.length?this.writeStatements({writer:e}):e.write("pass"),e.dedent()}add(e){this.statements.push(e),this.inheritReferences(e)}writeStatements({writer:e}){this.statements.forEach((r,n)=>{r.write(e),e.writeNewLineIfLastLineNot()})}addField(e){this.add(e)}};u();c();var te=class extends ee{constructor(r){var n=r,{classReference:t}=n,e=be(n,["classReference"]);super(_e({reference:t},e))}};u();c();var D=class extends x{constructor(e){super();f(this,"arg");this.arg=e}write(e){return new P(this.arg).write(e)}};u();c();var re=class extends x{constructor({docs:e}){super();f(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
9
|
+
`).forEach(r=>{e.writeLine(`# ${r}`)})}};u();c();var ie=class extends x{constructor({callable:e}){super();f(this,"callable");this.callable=e,this.inheritReferences(e)}write(e){e.write("@"),this.callable.write(e),e.newLine()}};u();c();var W=class extends x{constructor({name:e,type:r,initializer:n,docs:s}){super();f(this,"name");f(this,"type");f(this,"initializer");f(this,"docs");this.name=e,this.type=r,this.initializer=n,this.docs=s,this.inheritReferences(this.type),this.inheritReferences(this.initializer)}write(e){e.write(this.name),this.type!==void 0&&(e.write(": "),this.type.write(e)),this.initializer!==void 0&&(e.write(" = "),this.initializer.write(e)),this.docs!=null&&(e.newLine(),e.write('"""'),e.newLine(),e.write(this.docs),e.newLine(),e.write('"""'))}};u();c();var ne=class extends x{constructor({parameters:e,body:r}){super();f(this,"parameters");f(this,"body");this.parameters=e!=null?e:[],this.body=r,this.inheritReferences(r)}write(e){e.write("lambda"),this.parameters&&this.parameters.length&&(e.write(" "),this.parameters.forEach((r,n)=>{r.write(e),n<this.parameters.length-1&&e.write(", ")})),e.write(": "),this.body.write(e)}};u();c();u();c();var $=class extends x{constructor({name:e,type:r,initializer:n}){super();f(this,"name");f(this,"initializer");f(this,"type");this.name=e,this.type=r,this.initializer=n}write(e){e.write(this.name),this.type&&(e.write(": "),this.type.write(e)),this.initializer!==void 0&&(e.write(" = "),this.initializer.write(e))}};var se=class extends ${constructor({name:t,initializer:e}){super({name:t,initializer:e,type:void 0})}};u();c();u();c();var oe;(function(i){i[i.STATIC=0]="STATIC",i[i.INSTANCE=1]="INSTANCE",i[i.CLASS=2]="CLASS"})(oe||(oe={}));var Q=class extends x{constructor({static_:e,name:r,parameters:n,return_:s,docstring:o,type:h,decorators:l}){super();f(this,"name");f(this,"return");f(this,"docstring");f(this,"type");f(this,"parameters");f(this,"decorators");f(this,"statements",[]);f(this,"static_");this.name=r,this.parameters=n!=null?n:[],this.return=s,this.docstring=o,this.type=h,this.decorators=l!=null?l:[],this.static_=e!=null?e:!1,this.parameters.forEach(m=>{this.inheritReferences(m)}),this.inheritReferences(this.return),this.decorators.forEach(m=>{this.inheritReferences(m)}),this.statements.forEach(m=>{this.inheritReferences(m)})}addStatement(e){this.statements.push(e),this.inheritReferences(e)}write(e){this.static_&&this.decorators.push(T.decorator({callable:T.codeBlock("staticmethod")})),this.decorators.forEach(r=>{r.write(e)}),this.type===oe.CLASS?T.decorator({callable:new D("classmethod")}).write(e):this.type===oe.STATIC&&T.decorator({callable:new D("staticmethod")}).write(e),e.write(`def ${this.name}(`),this.type===oe.INSTANCE?(e.write("self"),this.parameters.length>0&&e.write(", ")):this.type===oe.CLASS&&(e.write("cls"),this.parameters.length>0&&e.write(", ")),this.parameters.forEach((r,n)=>{r.write(e),n<this.parameters.length-1&&e.write(", ")}),e.write(")"),this.return&&(e.write(" -> "),this.return.write(e)),e.write(":"),e.newLine(),this.docstring&&(e.indent(),e.write('"""'),e.write(this.docstring),e.write('"""'),e.newLine(),e.dedent()),this.statements.length?(e.indent(),this.statements.forEach((r,n)=>{r.write(e),n<this.statements.length-1&&e.newLine()}),e.dedent()):(e.indent(),e.write("pass"),e.dedent()),e.newLine()}};u();c();var ae=class extends x{constructor({name:e,value:r}){super();f(this,"name");f(this,"value");this.name=e,this.value=r,this.inheritReferences(this.value)}write(e){this.name!==void 0&&(e.write(this.name),e.write("=")),this.value.write(e)}};u();c();var fe=class extends x{constructor({on:e,method:r,arguments_:n,multiline:s}){super();f(this,"on");f(this,"method");f(this,"arguments");f(this,"multiline");this.on=e,this.method=r,this.arguments=n,this.multiline=s!=null?s:!1,this.inheritReferences(e),this.arguments.forEach(o=>{this.inheritReferences(o)})}write(e){if(this.on.write(e),e.write("."),e.write(this.method),this.arguments.length===0){e.write("()");return}e.write("("),this.multiline&&(e.newLine(),e.indent()),this.arguments.forEach((r,n)=>{r.write(e),n<this.arguments.length-1&&(e.write(","),this.multiline?e.newLine():e.write(" "))}),this.multiline&&(e.newLine(),e.dedent()),e.write(")")}};u();c();u();c();var b={Or:"or",And:"and",Add:"add",Subtract:"subtract",Multiply:"multiple",Divide:"divide",Modulo:"modulo",LeftShift:"leftShift",RightShift:"rightShift"};var he=class extends x{constructor({operator:e,lhs:r,rhs:n}){super();f(this,"operator");f(this,"lhs");f(this,"rhs");this.operator=e,this.lhs=r,this.inheritReferences(r),this.rhs=n,this.inheritReferences(n)}getOperatorString(){switch(this.operator){case b.Or:return"or";case b.And:return"and";case b.Add:return"+";case b.Subtract:return"-";case b.Multiply:return"*";case b.Divide:return"/";case b.Modulo:return"%";case b.LeftShift:return"<<";case b.RightShift:return">>";default:G(this.operator)}}write(e){this.lhs.write(e),e.write(" "),e.write(this.getOperatorString()),e.write(" "),this.rhs.write(e)}};u();c();u();c();u();c();var k=class extends x{constructor({name:e,modulePath:r,genericTypes:n,alias:s,attribute:o}){super();f(this,"name");f(this,"modulePath");f(this,"genericTypes");f(this,"alias");f(this,"attribute");this.name=e,this.modulePath=r!=null?r:[],this.genericTypes=n!=null?n:[],this.alias=s,this.attribute=o!=null?o:[],this.references.push(this),this.genericTypes.forEach(h=>{this.inheritReferences(h)})}write(e){let r=e.getRefNameOverride(this);e.write(r.name),this.genericTypes.length>0&&(e.write("["),this.genericTypes.forEach((n,s)=>{s>0&&e.write(", "),n.write(e)}),e.write("]")),this.attribute.length>0&&(e.write("."),this.attribute.forEach((n,s)=>{s>0&&e.write("."),e.write(n)}))}getFullyQualifiedPath(){return this.modulePath.join(".")}getFullyQualifiedModulePath(){return`${this.getFullyQualifiedPath()}.${this.name}`}};var z=class extends k{constructor({modulePath:e}){super({name:"*",modulePath:e});f(this,"docs")}write(e){throw new Error("Not intended to be written outside the context of a PythonFile.")}};u();c();function st(i){if(!i)return"Class";let t=i.replace(/[^a-zA-Z0-9\s_-]/g," ").replace(/[-_\s]+/g," ").trim();return!t||/^\d+$/.test(t)?"Class"+(t||""):(/^\d/.test(t)&&(t="Class"+t),t.split(/(?=[A-Z])|[-_\s]+/).filter(r=>r.length>0).map(r=>r.split(new RegExp("(?<=\\d)(?=[a-zA-Z])|(?<=[a-zA-Z])(?=\\d)")).filter(n=>n.length>0)).flat().map((r,n)=>n===0&&/^\d/.test(r)?"Class"+r.charAt(0).toUpperCase()+r.slice(1).toLowerCase():r.length>1&&r===r.toUpperCase()&&!/^\d+$/.test(r)?r:r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join(""))}var ue=class extends x{constructor({path:e,statements:r,isInitFile:n=!1,comments:s,imports:o}){super();f(this,"path");f(this,"isInitFile");f(this,"statements",[]);f(this,"comments");this.path=e,this.isInitFile=n,r==null||r.forEach(h=>this.addStatement(h)),this.comments=s!=null?s:[],o==null||o.forEach(h=>this.addReference(h))}addStatement(e){this.statements.push(e),this.inheritReferences(e)}write(e){let r=this.deduplicateReferences();this.updateWriterRefNameOverrides({writer:e,uniqueReferences:r}),this.writeComments(e),this.writeImports({writer:e,uniqueReferences:r}),this.statements.forEach((n,s)=>{n.write(e),e.newLine(),s<this.statements.length-1&&e.newLine()}),e.unsetRefNameOverrides()}updateWriterRefNameOverrides({writer:e,uniqueReferences:r}){let n=new Map(r),s={},o=this.getInitialUsedNames(),h=this.path.join("."),l=r.get(h);if(l){let{references:p}=l;p.forEach(d=>{let A=d.getFullyQualifiedModulePath(),g=d.name;s[A]={name:g,isAlias:!1},o.add(d.name)}),n.delete(h)}Array.from(n.values()).flatMap(({references:p})=>p).forEach(p=>{var v;if(p instanceof z)return;let d=(v=p.alias)!=null?v:p.name,A=p.getFullyQualifiedModulePath(),g=d,w=p.modulePath.length-1,E=!!p.alias;for(;o.has(g);){E=!0;let N=p.modulePath[w];w<0||!N?g=`_${g}`:g=`${st(N)}${g}`,w--}o.add(g),s[A]={name:g,isAlias:E}}),e.setRefNameOverrides(s)}getInitialUsedNames(){let e=new Set;return this.statements.forEach(r=>{(r instanceof O||r instanceof Q||r instanceof W)&&e.add(r.name)}),e}deduplicateReferences(){let e=new Map;for(let r of this.references){let n=r.name,s=r.getFullyQualifiedPath();if(s==="")continue;let o=e.get(s);o?o.referenceNames.has(n)||(o.references.push(r),o.referenceNames.add(n)):e.set(s,{modulePath:r.modulePath,references:[r],referenceNames:new Set([n])})}return e}writeComments(e){this.comments.forEach(r=>{r.write(e)}),this.comments.length>0&&e.newLine()}getImportName({writer:e,reference:r}){let n=e.getRefNameOverride(r),s=r.name,o=n.isAlias?n.name:void 0;return`${s}${o?` as ${o}`:""}`}writeImports({writer:e,uniqueReferences:r}){if(r.size!==0){for(let[n,{modulePath:s,references:o}]of r){let h=s;if(!this.isDefinedInFile(h)){if(h[0]===this.path[0]){let l=0;for(;l<this.path.length&&l<h.length&&this.path[l]===h[l];)l++;let m=this.path.length-l;this.isInitFile&&m++;let p=m>0?".".repeat(m):".";p+=h.slice(l).join("."),e.write(`from ${p} import ${o.map(d=>this.getImportName({writer:e,reference:d})).join(", ")}`)}else e.write(`from ${n} import ${o.map(l=>this.getImportName({writer:e,reference:l})).join(", ")}`);e.newLine()}}e.newLine()}}isDefinedInFile(e){return e.length===this.path.length&&e.every((r,n)=>r===this.path[n])}};u();c();var Re=class extends x{constructor(e){super();f(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"int":e.write("int");break;case"float":e.write("float");break;case"bool":e.write("bool");break;case"str":e.write("str");break;case"bytes":e.write("bytes");break;case"list":e.write("List["),this.internalType.value.write(e),e.write("]");break;case"set":e.write("Set["),this.internalType.value.write(e),e.write("]");break;case"tuple":e.write("Tuple["),this.internalType.values.forEach((r,n)=>{n>0&&e.write(", "),r.write(e)}),e.write("]");break;case"dict":e.write("Dict["),this.internalType.keyType.write(e),e.write(", "),this.internalType.valueType.write(e),e.write("]");break;case"none":e.write("None");break;case"uuid":e.write("UUID");break;case"optional":e.write("Optional["),this.internalType.value.write(e),e.write("]");break;case"union":e.write("Union["),this.internalType.values.forEach((r,n)=>{n>0&&e.write(", "),r.write(e)}),e.write("]");break;case"any":e.write("Any");break;case"reference":this.internalType.value.write(e);break;case"datetime":e.write("datetime");break;case"literal":typeof this.internalType.value=="string"?e.write(`Literal["${this.internalType.value}"]`):e.write(`Literal[${this.internalType.value}]`);break;default:G(this.internalType)}}static int(){return new this({type:"int"})}static float(){return new this({type:"float"})}static bool(){return new this({type:"bool"})}static str(){return new this({type:"str"})}static bytes(){return new this({type:"bytes"})}static list(e){let r=new this({type:"list",value:e});return r.addReference(T.reference({name:"List",modulePath:["typing"]})),r.inheritReferences(e),r}static set(e){let r=new this({type:"set",value:e});return r.addReference(T.reference({name:"Set",modulePath:["typing"]})),r.inheritReferences(e),r}static tuple(e){let r=new this({type:"tuple",values:e});return r.addReference(T.reference({name:"Tuple",modulePath:["typing"]})),e.forEach(n=>r.inheritReferences(n)),r}static dict(e,r){let n=new this({type:"dict",keyType:e,valueType:r});return n.addReference(T.reference({name:"Dict",modulePath:["typing"]})),n.inheritReferences(e),n.inheritReferences(r),n}static none(){return new this({type:"none"})}static uuid(){let e=new this({type:"uuid"});return e.addReference(T.reference({name:"UUID",modulePath:["uuid"]})),e}static optional(e){if(this.isAlreadyOptional(e))return e;let r=new this({type:"optional",value:e});return r.addReference(T.reference({name:"Optional",modulePath:["typing"]})),r.inheritReferences(e),r}static union(e){let r=new this({type:"union",values:e});return r.addReference(T.reference({name:"Union",modulePath:["typing"]})),e.forEach(n=>r.inheritReferences(n)),r}static any(){let e=new this({type:"any"});return e.addReference(T.reference({name:"Any",modulePath:["typing"]})),e}static datetime(){let e=new this({type:"datetime"});return e.addReference(T.reference({name:"datetime",modulePath:["datetime"]})),e}static reference(e){let r=new this({type:"reference",value:e});return r.addReference(e),r}static literal(e){let r=new this({type:"literal",value:e});return r.addReference(T.reference({name:"Literal",modulePath:["typing"]})),r}static isAlreadyOptional(e){return e.internalType.type==="optional"}};u();c();var V=class i extends x{constructor(e){super();f(this,"internalType");this.internalType=e}static int(e){return new this({type:"int",value:e})}static float(e){return new this({type:"float",value:e})}static bool(e){return new this({type:"bool",value:e})}static str(e,r={multiline:!1,startOnNewLine:!1,endWithNewLine:!1}){return new this({type:"str",value:e,config:r})}static bytes(e){return new this({type:"bytes",value:e})}static list(e,r={endWithComma:!1}){let n=new this({type:"list",values:e,config:r});return e.forEach(s=>n.inheritReferences(s)),n}static set(e,r={endWithComma:!1}){let n=new this({type:"set",values:e,config:r});return e.forEach(s=>n.inheritReferences(s)),n}static tuple(e,r={endWithComma:!1}){let n=new this({type:"tuple",values:e,config:r});return e.forEach(s=>n.inheritReferences(s)),n}static typedDict(e,r={endWithComma:!1}){let n=new this({type:"typedDict",entries:e,config:r});return e.forEach(s=>n.inheritReferences(s.value)),n}static date(e){let r=new this({type:"date",value:e});return r.addReference(new k({name:"date",modulePath:["datetime"]})),r}static datetime(e){let r=new this({type:"datetime",value:e});return r.addReference(new k({name:"datetime",modulePath:["datetime"]})),r}static dict(e,r={endWithComma:!1}){let n=new this({type:"dict",entries:e,config:r});return e.forEach(s=>{n.inheritReferences(s.key),n.inheritReferences(s.value)}),n}static reference(e){let r=new this({type:"reference",value:e});return r.inheritReferences(e),r}static none(){return new this({type:"none"})}static unknown(e){return new this({type:"unknown",value:e})}static uuid(e){let r=new this({type:"uuid",value:e});return r.addReference(new k({name:"UUID",modulePath:["uuid"]})),r}static nop(){return new this({type:"nop"})}static isNop(e){return e instanceof i&&e.internalType.type==="nop"}isTypedDict(){return this.internalType.type==="typedDict"}asTypedDictOrThrow(){if(this.isTypedDict())return this.internalType;throw new Error("Internal error; python.TypeInstantiation is not a TypedDict")}write(e){var r,n,s,o,h,l,m,p,d,A,g;switch(this.internalType.type){case"int":e.write(this.internalType.value.toString());break;case"float":e.write(this.internalType.value.toString());break;case"bool":this.internalType.value?e.write("True"):e.write("False");break;case"str":if((r=this.internalType.config)!=null&&r.multiline){let{startOnNewLine:w,endWithNewLine:E}=this.internalType.config;this.writeStringWithTripleQuotes({writer:e,value:this.internalType.value,startOnNewLine:w,endWithNewLine:E})}else e.write(`"${this.escapeString(this.internalType.value)}"`);break;case"date":e.write(`date.fromisoformat("${this.internalType.value}")`);break;case"datetime":e.write(`datetime.fromisoformat("${this.internalType.value}")`);break;case"bytes":e.write(`b"${this.internalType.value}"`);break;case"list":{let w=this.internalType,E=Pe({values:w.values});if(E.length===0){e.write("[]");break}e.write("["),(n=w.config)!=null&&n.multiline&&(e.newLine(),e.indent()),E.forEach((v,N)=>{var I,U;N>0&&(e.write(","),(I=w.config)!=null&&I.multiline?e.newLine():e.write(" ")),v.write(e),N===E.length-1&&((U=w.config)!=null&&U.endWithComma)&&e.write(",")}),(s=w.config)!=null&&s.multiline&&(e.newLine(),e.dedent()),e.write("]");break}case"set":{let w=this.internalType,E=Pe({values:w.values});if(E.length===0){e.write("{}");break}e.write("{"),(o=w.config)!=null&&o.multiline&&(e.newLine(),e.indent()),E.forEach((v,N)=>{var I,U;N>0&&(e.write(","),(I=w.config)!=null&&I.multiline?e.newLine():e.write(" ")),v.write(e),N===E.length-1&&((U=w.config)!=null&&U.endWithComma)&&e.write(",")}),(h=w.config)!=null&&h.multiline&&(e.newLine(),e.dedent()),e.write("}");break}case"tuple":{let w=this.internalType,E=Pe({values:w.values});if(E.length===0){e.write("()");break}e.write("("),(l=w.config)!=null&&l.multiline&&(e.newLine(),e.indent()),E.forEach((v,N)=>{var I,U;N>0&&(e.write(","),(I=w.config)!=null&&I.multiline?e.newLine():e.write(" ")),v.write(e),(E.length===1||N===E.length-1&&((U=w.config)!=null&&U.endWithComma))&&e.write(",")}),(m=w.config)!=null&&m.multiline&&(e.newLine(),e.dedent()),e.write(")");break}case"dict":{let w=this.internalType,E=xr({entries:w.entries});if(E.length===0){e.write("{}");break}e.write("{"),(p=w.config)!=null&&p.multiline&&(e.newLine(),e.indent()),E.forEach((v,N)=>{var I,U;N>0&&(e.write(","),(I=w.config)!=null&&I.multiline?e.newLine():e.write(" ")),v.key.write(e),e.write(": "),v.value.write(e),N===E.length-1&&((U=w.config)!=null&&U.endWithComma)&&e.write(",")}),(d=w.config)!=null&&d.multiline&&(e.newLine(),e.dedent()),e.write("}");break}case"typedDict":{let w=this.internalType,E=yr({entries:w.entries});if(E.length===0){e.write("{}");break}e.write("{"),(A=w.config)!=null&&A.multiline&&(e.writeLine(),e.indent()),E.forEach((v,N)=>{var I;N>0&&(e.write(","),(I=w.config)!=null&&I.multiline?e.newLine():e.write(" ")),e.write(`"${v.name}": `),v.value.write(e)}),(g=w.config)!=null&&g.multiline&&(e.newLine(),e.dedent()),e.write("}");break}case"reference":{this.internalType.value.write(e);break}case"none":e.write("None");break;case"unknown":this.writeUnknown({writer:e,value:this.internalType.value});break;case"uuid":e.write(`UUID("${this.internalType.value}")`);break;case"nop":break;default:G(this.internalType)}}writeStringWithTripleQuotes({writer:e,value:r,startOnNewLine:n,endWithNewLine:s}){var h;e.write('"""');let o=r.split(`
|
|
10
|
+
`);if(o.length<=1){e.write(this.escapeString((h=o[0])!=null?h:"")),e.write('"""');return}n&&e.writeNoIndent(`\\
|
|
11
|
+
`),o.forEach((l,m)=>{e.writeNoIndent(this.escapeString(l)),m===o.length-1?s&&e.writeNoIndent(`\\
|
|
12
|
+
`):e.writeNoIndent(`
|
|
13
|
+
`)}),e.writeNoIndent('"""')}escapeString(e){let r=new RegExp(`(?<!\\\\)(["'\\\\\\t\\n\\r])`,"g"),n={'"':'\\"',"'":"\\'","\\":"\\\\"," ":"\\t","\n":"\\n","\r":"\\r"};return e.replace(r,s=>{var o;return(o=n[s])!=null?o:s})}writeUnknown({writer:e,value:r}){switch(typeof r){case"boolean":e.write(r?"True":"False");return;case"string":e.write(`"${this.escapeString(r)}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("None");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownObject({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let n of r)e.writeNode(i.unknown(n)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownObject({writer:e,value:r}){let n=Object.entries(r);if(n.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[s,o]of n)e.write(`"${s}": `),e.writeNode(i.unknown(o)),e.writeLine(",");e.dedent(),e.write("}")}};function xr({entries:i}){return i.filter(t=>!V.isNop(t.key)&&!V.isNop(t.value))}function yr({entries:i}){return i.filter(t=>!V.isNop(t.value))}function Pe({values:i}){return i.filter(t=>!V.isNop(t))}function gr(i){return new K(i)}function Er(i){return new Ae(i)}function Tr(i){return new ue(i)}function Ar(i){return new O(i)}function Rr(i){return new te(i)}function Nr(i){return new ie(i)}function vr(i){return new k(i)}function Ir(i){return new z(i)}function Lr(i){return new W(i)}function Sr(i){return new D(i)}function kr(i){return new re(i)}function Ur(i){return new ne(i)}function Pr(i){return new se(i)}function Br(i){return new Q(i)}function _r(i){return new ee(i)}function br(i){return new fe(i)}function Cr(i){return new $(i)}function Mr(i){return new ae(i)}function Dr(i){return new he(i)}export{_e as a,Yr as b,Fr as c,be as d,Ie as e,Or as f,lt as g,Wr as h,$r as i,f as j,u as k,a as l,c as m,G as n,dr as o,T as p};
|
|
14
|
+
/*! Bundled license information:
|
|
15
|
+
|
|
16
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
17
|
+
(*!
|
|
18
|
+
* The buffer module from node.js, for the browser.
|
|
19
|
+
*
|
|
20
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
21
|
+
* @license MIT
|
|
22
|
+
*)
|
|
23
|
+
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{a as A}from"./chunk-BVS32MTY.js";import{c as S}from"./chunk-EX7EKKG4.js";import{a as O}from"./chunk-LKHXBDU2.js";import{j as x,k as t,m as a,n as b,p as i}from"./chunk-NPWTXI2T.js";t();a();t();a();t();a();t();a();t();a();t();a();t();a();var Ie=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,N=Ie;var ke=typeof self=="object"&&self&&self.Object===Object&&self,Te=N||ke||Function("return this")(),I=Te;var Ee=I.Symbol,p=Ee;t();a();var k=Object.prototype,Me=k.hasOwnProperty,we=k.toString,c=p?p.toStringTag:void 0;function je(e){var o=Me.call(e,c),r=e[c];try{e[c]=void 0;var f=!0}catch(n){}var l=we.call(e);return f&&(o?e[c]=r:delete e[c]),l}var T=je;t();a();var We=Object.prototype,Le=We.toString;function Pe(e){return Le.call(e)}var E=Pe;var Ue="[object Null]",ze="[object Undefined]",M=p?p.toStringTag:void 0;function Be(e){return e==null?e===void 0?ze:Ue:M&&M in Object(e)?T(e):E(e)}var w=Be;t();a();function Fe(e){return e!=null&&typeof e=="object"}var j=Fe;var De="[object Symbol]";function _e(e){return typeof e=="symbol"||j(e)&&w(e)==De}var W=_e;t();a();t();a();function Ze(e,o){for(var r=-1,f=e==null?0:e.length,l=Array(f);++r<f;)l[r]=o(e[r],r,e);return l}var L=Ze;t();a();var Ge=Array.isArray,P=Ge;var qe=1/0,U=p?p.prototype:void 0,z=U?U.toString:void 0;function B(e){if(typeof e=="string")return e;if(P(e))return L(e,B)+"";if(W(e))return z?z.call(e):"";var o=e+"";return o=="0"&&1/e==-qe?"-0":o}var F=B;t();a();function He(e){return e==null?"":F(e)}var m=He;t();a();t();a();t();a();t();a();t();a();t();a();function Ve(e,o,r){var f=-1,l=e.length;o<0&&(o=-o>l?0:l+o),r=r>l?l:r,r<0&&(r+=l),l=o>r?0:r-o>>>0,o>>>=0;for(var n=Array(l);++f<l;)n[f]=e[f+o];return n}var D=Ve;function Je(e,o,r){var f=e.length;return r=r===void 0?f:r,!o&&r>=f?e:D(e,o,r)}var _=Je;t();a();var Ke="\\ud800-\\udfff",$e="\\u0300-\\u036f",Ye="\\ufe20-\\ufe2f",Qe="\\u20d0-\\u20ff",Xe=$e+Ye+Qe,er="\\ufe0e\\ufe0f",rr="\\u200d",tr=RegExp("["+rr+Ke+Xe+er+"]");function ar(e){return tr.test(e)}var g=ar;t();a();t();a();function or(e){return e.split("")}var Z=or;t();a();var G="\\ud800-\\udfff",fr="\\u0300-\\u036f",ur="\\ufe20-\\ufe2f",sr="\\u20d0-\\u20ff",lr=fr+ur+sr,pr="\\ufe0e\\ufe0f",mr="["+G+"]",y="["+lr+"]",C="\\ud83c[\\udffb-\\udfff]",nr="(?:"+y+"|"+C+")",q="[^"+G+"]",H="(?:\\ud83c[\\udde6-\\uddff]){2}",V="[\\ud800-\\udbff][\\udc00-\\udfff]",ir="\\u200d",J=nr+"?",K="["+pr+"]?",dr="(?:"+ir+"(?:"+[q,H,V].join("|")+")"+K+J+")*",xr=K+J+dr,cr="(?:"+[q+y+"?",y,H,V,mr].join("|")+")",gr=RegExp(C+"(?="+C+")|"+cr+xr,"g");function hr(e){return e.match(gr)||[]}var $=hr;function br(e){return g(e)?$(e):Z(e)}var Y=br;function yr(e){return function(o){o=m(o);var r=g(o)?Y(o):void 0,f=r?r[0]:o.charAt(0),l=r?_(r,1).join(""):o.slice(1);return f[e]()+l}}var Q=yr;var Cr=Q("toUpperCase"),X=Cr;function Rr(e){return X(m(e).toLowerCase())}var ee=Rr;t();a();t();a();function vr(e,o,r,f){var l=-1,n=e==null?0:e.length;for(f&&n&&(r=e[++l]);++l<n;)r=o(r,e[l],l,e);return r}var re=vr;t();a();t();a();t();a();function Sr(e){return function(o){return e==null?void 0:e[o]}}var te=Sr;var Ar={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Or=te(Ar),ae=Or;var Nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ir="\\u0300-\\u036f",kr="\\ufe20-\\ufe2f",Tr="\\u20d0-\\u20ff",Er=Ir+kr+Tr,Mr="["+Er+"]",wr=RegExp(Mr,"g");function jr(e){return e=m(e),e&&e.replace(Nr,ae).replace(wr,"")}var oe=jr;t();a();t();a();var Wr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Lr(e){return e.match(Wr)||[]}var fe=Lr;t();a();var Pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ur(e){return Pr.test(e)}var ue=Ur;t();a();var ne="\\ud800-\\udfff",zr="\\u0300-\\u036f",Br="\\ufe20-\\ufe2f",Fr="\\u20d0-\\u20ff",Dr=zr+Br+Fr,ie="\\u2700-\\u27bf",de="a-z\\xdf-\\xf6\\xf8-\\xff",_r="\\xac\\xb1\\xd7\\xf7",Zr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Gr="\\u2000-\\u206f",qr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xe="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",ce=_r+Zr+Gr+qr,ge="['\u2019]",se="["+ce+"]",Vr="["+Dr+"]",he="\\d+",Jr="["+ie+"]",be="["+de+"]",ye="[^"+ne+ce+he+ie+de+xe+"]",Kr="\\ud83c[\\udffb-\\udfff]",$r="(?:"+Vr+"|"+Kr+")",Yr="[^"+ne+"]",Ce="(?:\\ud83c[\\udde6-\\uddff]){2}",Re="[\\ud800-\\udbff][\\udc00-\\udfff]",d="["+xe+"]",Qr="\\u200d",le="(?:"+be+"|"+ye+")",Xr="(?:"+d+"|"+ye+")",pe="(?:"+ge+"(?:d|ll|m|re|s|t|ve))?",me="(?:"+ge+"(?:D|LL|M|RE|S|T|VE))?",ve=$r+"?",Se="["+Hr+"]?",et="(?:"+Qr+"(?:"+[Yr,Ce,Re].join("|")+")"+Se+ve+")*",rt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",at=Se+ve+et,ot="(?:"+[Jr,Ce,Re].join("|")+")"+at,ft=RegExp([d+"?"+be+"+"+pe+"(?="+[se,d,"$"].join("|")+")",Xr+"+"+me+"(?="+[se,d+le,"$"].join("|")+")",d+"?"+le+"+"+pe,d+"+"+me,tt,rt,he,ot].join("|"),"g");function ut(e){return e.match(ft)||[]}var Ae=ut;function st(e,o,r){return e=m(e),o=r?void 0:o,o===void 0?ue(e)?Ae(e):fe(e):e.match(o)||[]}var Oe=st;var lt="['\u2019]",pt=RegExp(lt,"g");function mt(e){return function(o){return re(Oe(oe(o).replace(pt,"")),e,"")}}var h=mt;var nt=h(function(e,o,r){return o=o.toLowerCase(),e+(r?ee(o):o)}),R=nt;t();a();var it=h(function(e,o,r){return e+(r?"_":"")+o.toLowerCase()}),v=it;var dt=["list","set"],Ne=class e extends S{constructor({ir:r,config:f}){var l;super({ir:r,config:f});x(this,"ir");x(this,"customConfig");x(this,"dynamicTypeLiteralMapper");x(this,"filePropertyMapper");this.ir=r,this.customConfig=(l=f.customConfig)!=null?l:{},this.dynamicTypeLiteralMapper=new A({context:this}),this.filePropertyMapper=new O({context:this})}clone(){return new e({ir:this.ir,config:this.config})}getClassName(r){let f=r.pascalCase.safeName,l=this.getRootClientClassName();return f===l?`${l}Model`:f}getTypedDictClassName(r){return`${this.getClassName(r)}Params`}getPropertyName(r){let f=r.snakeCase.safeName;return f.startsWith("_")?"f_"+f.substring(f.lastIndexOf("_")+1):f}getMethodName(r){return dt.includes(r.snakeCase.unsafeName)?r.snakeCase.unsafeName:r.snakeCase.safeName}getRootClientClassReference(){return i.reference({name:this.getRootClientClassName(),modulePath:this.getRootModulePath()})}getRootClientClassName(){var r,f;return((r=this.customConfig.client)==null?void 0:r.exported_class_name)!=null?this.customConfig.client.exported_class_name:this.customConfig.client_class_name!=null?this.customConfig.client_class_name:((f=this.customConfig.client)==null?void 0:f.class_name)!=null?this.customConfig.client.class_name:this.pascalCase(this.config.organization)+this.pascalCase(this.config.workspaceName)}getEnvironmentClassName(){return`${this.getRootClientClassName()}Environment`}getEnvironmentTypeReferenceFromID(r){let f=this.resolveEnvironmentName(r);if(f!=null)return i.accessAttribute({lhs:this.getEnvironmentClassReference(),rhs:i.codeBlock(this.getEnvironmentEnumName(f))})}getEnvironmentClassReference(){return i.reference({name:this.getEnvironmentClassName(),modulePath:this.getRootModulePath()})}getEnvironmentEnumName(r){return r.screamingSnakeCase.safeName}isPrimitive(r){switch(r.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(r.value);case"named":{let f=this.resolveNamedType({typeId:r.value});if(f==null)return!1;switch(f.type){case"alias":return this.isPrimitive(f.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:b(f)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:b(r)}}getFileFromString(r){return i.TypeInstantiation.str(r)}getRootModulePath(){if(this.customConfig.package_name!=null)return[this.customConfig.package_name];let r=this.cleanOrganizationName();return this.customConfig.use_api_name_in_package?[r,this.getApiName()]:[r]}getCoreModulePath(){return this.getRootModulePath().concat("core")}shouldInlinePathParameters(){return!0}cleanOrganizationName(){return this.config.organization.replace(/[^a-zA-Z0-9]/g,"_")}getApiName(){return v(this.config.workspaceName)}pascalCase(r){let f=R(r);return f.charAt(0).toUpperCase()+f.slice(1)}};export{Ne as a};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
lodash-es/lodash.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license
|
|
7
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
8
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
9
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
10
|
+
* Released under MIT license <https://lodash.com/license>
|
|
11
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
12
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
13
|
+
*)
|
|
14
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-IM4ZUKD4.js";import{a as i}from"./chunk-OCJMJMBV.js";import{a as t}from"./chunk-EX7EKKG4.js";import{k as n,m as r}from"./chunk-NPWTXI2T.js";n();r();var o=class extends t{constructor({ir:e,config:a}){super(new i({ir:e,config:a}))}async generate(e){return super.generate(e)}generateSync(e){return super.generateSync(e)}createSnippetGenerator(e){return new p({context:e})}};export{o as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import '@fern-api/browser-compatible-base-generator';
|
|
2
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
3
|
+
import '@fern-api/python-ast';
|
|
4
|
+
import '@fern-api/python-browser-compatible-base';
|
|
5
|
+
export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-aXWxVpwD.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-OCJMJMBV.js";import"../chunk-BVS32MTY.js";import"../chunk-EX7EKKG4.js";import"../chunk-LKHXBDU2.js";import"../chunk-NPWTXI2T.js";export{a as DynamicSnippetsGeneratorContext};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
2
|
+
import '@fern-api/python-ast';
|
|
3
|
+
export { a as DynamicTypeLiteralMapper } from '../DynamicSnippetsGeneratorContext-aXWxVpwD.js';
|
|
4
|
+
import '@fern-api/browser-compatible-base-generator';
|
|
5
|
+
import '@fern-api/python-browser-compatible-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-BVS32MTY.js";import"../chunk-EX7EKKG4.js";import"../chunk-NPWTXI2T.js";export{a as DynamicTypeLiteralMapper};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
2
|
+
import '@fern-api/python-ast';
|
|
3
|
+
export { F as FilePropertyInfo, b as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-aXWxVpwD.js';
|
|
4
|
+
import '@fern-api/browser-compatible-base-generator';
|
|
5
|
+
import '@fern-api/python-browser-compatible-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-LKHXBDU2.js";import"../chunk-NPWTXI2T.js";export{a as FilePropertyMapper};
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DynamicSnippetsGenerator } from './DynamicSnippetsGenerator.js';
|
|
2
|
+
import '@fern-api/browser-compatible-base-generator';
|
|
3
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
4
|
+
import './EndpointSnippetGenerator.js';
|
|
5
|
+
import './DynamicSnippetsGeneratorContext-aXWxVpwD.js';
|
|
6
|
+
import '@fern-api/python-ast';
|
|
7
|
+
import '@fern-api/python-browser-compatible-base';
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as yu}from"./chunk-ZMJ4WKFB.js";import"./chunk-IM4ZUKD4.js";import"./chunk-OCJMJMBV.js";import"./chunk-BVS32MTY.js";import"./chunk-EX7EKKG4.js";import"./chunk-LKHXBDU2.js";import{e as be,f as l,g as su,h as lu,i as cu,k as o,l as p,m as i}from"./chunk-NPWTXI2T.js";var Lt=l((Ql,kt)=>{"use strict";o();i();var vu="Function.prototype.bind called on incompatible ",gu=Object.prototype.toString,du=Math.max,hu="[object Function]",Wt=function(r,t){for(var n=[],a=0;a<r.length;a+=1)n[a]=r[a];for(var u=0;u<t.length;u+=1)n[u+r.length]=t[u];return n},mu=function(r,t){for(var n=[],a=t||0,u=0;a<r.length;a+=1,u+=1)n[u]=r[a];return n},bu=function(e,r){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=r);return t};kt.exports=function(r){var t=this;if(typeof t!="function"||gu.apply(t)!==hu)throw new TypeError(vu+t);for(var n=mu(arguments,1),a,u=function(){if(this instanceof a){var g=t.apply(this,Wt(n,arguments));return Object(g)===g?g:this}return t.apply(r,Wt(n,arguments))},f=du(0,t.length-n.length),c=[],y=0;y<f;y++)c[y]="$"+y;if(a=Function("binder","return function ("+bu(c,",")+"){ return binder.apply(this,arguments); }")(u),t.prototype){var h=function(){};h.prototype=t.prototype,a.prototype=new h,h.prototype=null}return a}});var L=l((rc,zt)=>{"use strict";o();i();var Su=Lt();zt.exports=Function.prototype.bind||Su});var Se=l((nc,Jt)=>{"use strict";o();i();Jt.exports=Error});var Ae=l((ac,Ht)=>{"use strict";o();i();Ht.exports=EvalError});var we=l((pc,Kt)=>{"use strict";o();i();Kt.exports=RangeError});var Pe=l((cc,Vt)=>{"use strict";o();i();Vt.exports=ReferenceError});var Ur=l((gc,Yt)=>{"use strict";o();i();Yt.exports=SyntaxError});var w=l((mc,Qt)=>{"use strict";o();i();Qt.exports=TypeError});var Oe=l((Ac,Xt)=>{"use strict";o();i();Xt.exports=URIError});var rn=l((Oc,Zt)=>{"use strict";o();i();Zt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var u=Object.getOwnPropertySymbols(r);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(r,t);if(f.value!==a||f.enumerable!==!0)return!1}return!0}});var Ee=l((xc,tn)=>{"use strict";o();i();var en=typeof Symbol!="undefined"&&Symbol,Au=rn();tn.exports=function(){return typeof en!="function"||typeof Symbol!="function"||typeof en("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Au()}});var on=l((Fc,nn)=>{"use strict";o();i();var qe={__proto__:null,foo:{}},wu=Object;nn.exports=function(){return{__proto__:qe}.foo===qe.foo&&!(qe instanceof wu)}});var xe=l((Nc,an)=>{"use strict";o();i();var Pu=Function.prototype.call,Ou=Object.prototype.hasOwnProperty,Eu=L();an.exports=Eu.call(Pu,Ou)});var F=l((Dc,ln)=>{"use strict";o();i();var b,qu=Se(),xu=Ae(),$u=we(),Iu=Pe(),tr=Ur(),er=w(),Fu=Oe(),sn=Function,$e=function(e){try{return sn('"use strict"; return ('+e+").constructor;")()}catch(r){}},z=Object.getOwnPropertyDescriptor;if(z)try{z({},"")}catch(e){z=null}var Ie=function(){throw new er},Tu=z?function(){try{return arguments.callee,Ie}catch(e){try{return z(arguments,"callee").get}catch(r){return Ie}}}():Ie,Z=Ee()(),Ru=on()(),O=Object.getPrototypeOf||(Ru?function(e){return e.__proto__}:null),rr={},Nu=typeof Uint8Array=="undefined"||!O?b:O(Uint8Array),J={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?b:ArrayBuffer,"%ArrayIteratorPrototype%":Z&&O?O([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%Atomics%":typeof Atomics=="undefined"?b:Atomics,"%BigInt%":typeof BigInt=="undefined"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":qu,"%eval%":eval,"%EvalError%":xu,"%Float32Array%":typeof Float32Array=="undefined"?b:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?b:FinalizationRegistry,"%Function%":sn,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array=="undefined"?b:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?b:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Z&&O?O(O([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map=="undefined"?b:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Z||!O?b:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?b:Promise,"%Proxy%":typeof Proxy=="undefined"?b:Proxy,"%RangeError%":$u,"%ReferenceError%":Iu,"%Reflect%":typeof Reflect=="undefined"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?b:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Z||!O?b:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Z&&O?O(""[Symbol.iterator]()):b,"%Symbol%":Z?Symbol:b,"%SyntaxError%":tr,"%ThrowTypeError%":Tu,"%TypedArray%":Nu,"%TypeError%":er,"%Uint8Array%":typeof Uint8Array=="undefined"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?b:Uint32Array,"%URIError%":Fu,"%WeakMap%":typeof WeakMap=="undefined"?b:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?b:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?b:WeakSet};if(O)try{null.error}catch(e){un=O(O(e)),J["%Error.prototype%"]=un}var un,_u=function e(r){var t;if(r==="%AsyncFunction%")t=$e("async function () {}");else if(r==="%GeneratorFunction%")t=$e("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=$e("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&O&&(t=O(a.prototype))}return J[r]=t,t},fn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},vr=L(),Dr=xe(),Uu=vr.call(Function.call,Array.prototype.concat),Du=vr.call(Function.apply,Array.prototype.splice),pn=vr.call(Function.call,String.prototype.replace),Br=vr.call(Function.call,String.prototype.slice),Bu=vr.call(Function.call,RegExp.prototype.exec),Mu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Cu=/\\(\\)?/g,ju=function(r){var t=Br(r,0,1),n=Br(r,-1);if(t==="%"&&n!=="%")throw new tr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new tr("invalid intrinsic syntax, expected opening `%`");var a=[];return pn(r,Mu,function(u,f,c,y){a[a.length]=c?pn(y,Cu,"$1"):f||u}),a},Gu=function(r,t){var n=r,a;if(Dr(fn,n)&&(a=fn[n],n="%"+a[0]+"%"),Dr(J,n)){var u=J[n];if(u===rr&&(u=_u(n)),typeof u=="undefined"&&!t)throw new er("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:u}}throw new tr("intrinsic "+r+" does not exist!")};ln.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new er("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new er('"allowMissing" argument must be a boolean');if(Bu(/^%?[^%]*%?$/,r)===null)throw new tr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ju(r),a=n.length>0?n[0]:"",u=Gu("%"+a+"%",t),f=u.name,c=u.value,y=!1,h=u.alias;h&&(a=h[0],Du(n,Uu([0,1],h)));for(var g=1,d=!0;g<n.length;g+=1){var v=n[g],A=Br(v,0,1),P=Br(v,-1);if((A==='"'||A==="'"||A==="`"||P==='"'||P==="'"||P==="`")&&A!==P)throw new tr("property names with quotes must have matching quotes");if((v==="constructor"||!d)&&(y=!0),a+="."+v,f="%"+a+"%",Dr(J,f))c=J[f];else if(c!=null){if(!(v in c)){if(!t)throw new er("base intrinsic for "+r+" exists, but the property is not available.");return}if(z&&g+1>=n.length){var S=z(c,v);d=!!S,d&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[v]}else d=Dr(c,v),c=c[v];d&&!y&&(J[f]=c)}}return c}});var Fe=l((Cc,cn)=>{"use strict";o();i();cn.exports=Object});var vn=l((Wc,yn)=>{"use strict";o();i();yn.exports=Math.abs});var dn=l((zc,gn)=>{"use strict";o();i();gn.exports=Math.floor});var mn=l((Kc,hn)=>{"use strict";o();i();hn.exports=Math.max});var Sn=l((Qc,bn)=>{"use strict";o();i();bn.exports=Math.min});var wn=l((ry,An)=>{"use strict";o();i();An.exports=Math.pow});var On=l((ny,Pn)=>{"use strict";o();i();Pn.exports=Math.round});var qn=l((ay,En)=>{"use strict";o();i();En.exports=Number.isNaN||function(r){return r!==r}});var $n=l((py,xn)=>{"use strict";o();i();var Wu=qn();xn.exports=function(r){return Wu(r)||r===0?r:r<0?-1:1}});var Fn=l((cy,In)=>{"use strict";o();i();In.exports=Object.getOwnPropertyDescriptor});var gr=l((gy,Tn)=>{"use strict";o();i();var Mr=Fn();if(Mr)try{Mr([],"length")}catch(e){Mr=null}Tn.exports=Mr});var jr=l((my,Rn)=>{"use strict";o();i();var Cr=Object.defineProperty||!1;if(Cr)try{Cr({},"a",{value:1})}catch(e){Cr=!1}Rn.exports=Cr});var Te=l((Ay,Nn)=>{"use strict";o();i();Nn.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(var u in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var f=Object.getOwnPropertySymbols(r);if(f.length!==1||f[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(r,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0}});var Dn=l((Oy,Un)=>{"use strict";o();i();var _n=typeof Symbol!="undefined"&&Symbol,ku=Te();Un.exports=function(){return typeof _n!="function"||typeof Symbol!="function"||typeof _n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ku()}});var Re=l((xy,Bn)=>{"use strict";o();i();Bn.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var Ne=l((Fy,Mn)=>{"use strict";o();i();var Lu=Fe();Mn.exports=Lu.getPrototypeOf||null});var Gr=l((Ny,Cn)=>{"use strict";o();i();Cn.exports=Function.prototype.call});var _e=l((Dy,jn)=>{"use strict";o();i();jn.exports=Function.prototype.apply});var Wn=l((Cy,Gn)=>{"use strict";o();i();Gn.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var Ln=l((Wy,kn)=>{"use strict";o();i();var zu=L(),Ju=_e(),Hu=Gr(),Ku=Wn();kn.exports=Ku||zu.call(Hu,Ju)});var Jn=l((zy,zn)=>{"use strict";o();i();var Vu=L(),Yu=w(),Qu=Gr(),Xu=Ln();zn.exports=function(r){if(r.length<1||typeof r[0]!="function")throw new Yu("a function is required");return Xu(Vu,Qu,r)}});var Xn=l((Ky,Qn)=>{"use strict";o();i();var Zu=Jn(),Hn=gr(),Vn;try{Vn=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ue=!!Vn&&Hn&&Hn(Object.prototype,"__proto__"),Yn=Object,Kn=Yn.getPrototypeOf;Qn.exports=Ue&&typeof Ue.get=="function"?Zu([Ue.get]):typeof Kn=="function"?function(r){return Kn(r==null?r:Yn(r))}:!1});var no=l((Qy,to)=>{"use strict";o();i();var Zn=Re(),ro=Ne(),eo=Xn();to.exports=Zn?function(r){return Zn(r)}:ro?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return ro(r)}:eo?function(r){return eo(r)}:null});var Me=l((rv,po)=>{"use strict";o();i();var m,rf=Fe(),ef=Se(),tf=Ae(),nf=we(),of=Pe(),ar=Ur(),ir=w(),af=Oe(),uf=vn(),ff=dn(),pf=mn(),sf=Sn(),lf=wn(),cf=On(),yf=$n(),uo=Function,De=function(e){try{return uo('"use strict"; return ('+e+").constructor;")()}catch(r){}},dr=gr(),vf=jr(),Be=function(){throw new ir},gf=dr?function(){try{return arguments.callee,Be}catch(e){try{return dr(arguments,"callee").get}catch(r){return Be}}}():Be,nr=Dn()(),E=no(),df=Ne(),hf=Re(),fo=_e(),hr=Gr(),or={},mf=typeof Uint8Array=="undefined"||!E?m:E(Uint8Array),H={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?m:ArrayBuffer,"%ArrayIteratorPrototype%":nr&&E?E([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":or,"%AsyncGenerator%":or,"%AsyncGeneratorFunction%":or,"%AsyncIteratorPrototype%":or,"%Atomics%":typeof Atomics=="undefined"?m:Atomics,"%BigInt%":typeof BigInt=="undefined"?m:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?m:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?m:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?m:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ef,"%eval%":eval,"%EvalError%":tf,"%Float16Array%":typeof Float16Array=="undefined"?m:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?m:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?m:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?m:FinalizationRegistry,"%Function%":uo,"%GeneratorFunction%":or,"%Int8Array%":typeof Int8Array=="undefined"?m:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?m:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nr&&E?E(E([][Symbol.iterator]())):m,"%JSON%":typeof JSON=="object"?JSON:m,"%Map%":typeof Map=="undefined"?m:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!nr||!E?m:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":rf,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?m:Promise,"%Proxy%":typeof Proxy=="undefined"?m:Proxy,"%RangeError%":nf,"%ReferenceError%":of,"%Reflect%":typeof Reflect=="undefined"?m:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?m:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!nr||!E?m:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nr&&E?E(""[Symbol.iterator]()):m,"%Symbol%":nr?Symbol:m,"%SyntaxError%":ar,"%ThrowTypeError%":gf,"%TypedArray%":mf,"%TypeError%":ir,"%Uint8Array%":typeof Uint8Array=="undefined"?m:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?m:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?m:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?m:Uint32Array,"%URIError%":af,"%WeakMap%":typeof WeakMap=="undefined"?m:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?m:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?m:WeakSet,"%Function.prototype.call%":hr,"%Function.prototype.apply%":fo,"%Object.defineProperty%":vf,"%Object.getPrototypeOf%":df,"%Math.abs%":uf,"%Math.floor%":ff,"%Math.max%":pf,"%Math.min%":sf,"%Math.pow%":lf,"%Math.round%":cf,"%Math.sign%":yf,"%Reflect.getPrototypeOf%":hf};if(E)try{null.error}catch(e){oo=E(E(e)),H["%Error.prototype%"]=oo}var oo,bf=function e(r){var t;if(r==="%AsyncFunction%")t=De("async function () {}");else if(r==="%GeneratorFunction%")t=De("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=De("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&E&&(t=E(a.prototype))}return H[r]=t,t},io={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},mr=L(),Wr=xe(),Sf=mr.call(hr,Array.prototype.concat),Af=mr.call(fo,Array.prototype.splice),ao=mr.call(hr,String.prototype.replace),kr=mr.call(hr,String.prototype.slice),wf=mr.call(hr,RegExp.prototype.exec),Pf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Of=/\\(\\)?/g,Ef=function(r){var t=kr(r,0,1),n=kr(r,-1);if(t==="%"&&n!=="%")throw new ar("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new ar("invalid intrinsic syntax, expected opening `%`");var a=[];return ao(r,Pf,function(u,f,c,y){a[a.length]=c?ao(y,Of,"$1"):f||u}),a},qf=function(r,t){var n=r,a;if(Wr(io,n)&&(a=io[n],n="%"+a[0]+"%"),Wr(H,n)){var u=H[n];if(u===or&&(u=bf(n)),typeof u=="undefined"&&!t)throw new ir("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:u}}throw new ar("intrinsic "+r+" does not exist!")};po.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new ir("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new ir('"allowMissing" argument must be a boolean');if(wf(/^%?[^%]*%?$/,r)===null)throw new ar("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ef(r),a=n.length>0?n[0]:"",u=qf("%"+a+"%",t),f=u.name,c=u.value,y=!1,h=u.alias;h&&(a=h[0],Af(n,Sf([0,1],h)));for(var g=1,d=!0;g<n.length;g+=1){var v=n[g],A=kr(v,0,1),P=kr(v,-1);if((A==='"'||A==="'"||A==="`"||P==='"'||P==="'"||P==="`")&&A!==P)throw new ar("property names with quotes must have matching quotes");if((v==="constructor"||!d)&&(y=!0),a+="."+v,f="%"+a+"%",Wr(H,f))c=H[f];else if(c!=null){if(!(v in c)){if(!t)throw new ir("base intrinsic for "+r+" exists, but the property is not available.");return}if(dr&&g+1>=n.length){var S=dr(c,v);d=!!S,d&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[v]}else d=Wr(c,v),c=c[v];d&&!y&&(H[f]=c)}}return c}});var Ce=l((nv,co)=>{"use strict";o();i();var so=jr(),xf=Ur(),ur=w(),lo=gr();co.exports=function(r,t,n){if(!r||typeof r!="object"&&typeof r!="function")throw new ur("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ur("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ur("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ur("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ur("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ur("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,y=!!lo&&lo(r,t);if(so)so(r,t,{configurable:f===null&&y?y.configurable:!f,enumerable:a===null&&y?y.enumerable:!a,value:n,writable:u===null&&y?y.writable:!u});else if(c||!a&&!u&&!f)r[t]=n;else throw new xf("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ge=l((av,vo)=>{"use strict";o();i();var je=jr(),yo=function(){return!!je};yo.hasArrayLengthDefineBug=function(){if(!je)return null;try{return je([],"length",{value:1}).length!==1}catch(r){return!0}};vo.exports=yo});var So=l((pv,bo)=>{"use strict";o();i();var $f=Me(),go=Ce(),If=Ge()(),ho=gr(),mo=w(),Ff=$f("%Math.floor%");bo.exports=function(r,t){if(typeof r!="function")throw new mo("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Ff(t)!==t)throw new mo("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,u=!0;if("length"in r&&ho){var f=ho(r,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(u=!1)}return(a||u||!n)&&(If?go(r,"length",t,!0,!0):go(r,"length",t)),r}});var wo=l((cv,Ao)=>{"use strict";o();i();var Tf=Me(),Lr=Tf("%Object.defineProperty%",!0)||!1;if(Lr)try{Lr({},"a",{value:1})}catch(e){Lr=!1}Ao.exports=Lr});var Hr=l((gv,zr)=>{"use strict";o();i();var We=L(),Jr=F(),Rf=So(),Nf=w(),Eo=Jr("%Function.prototype.apply%"),qo=Jr("%Function.prototype.call%"),xo=Jr("%Reflect.apply%",!0)||We.call(qo,Eo),Po=wo(),_f=Jr("%Math.max%");zr.exports=function(r){if(typeof r!="function")throw new Nf("a function is required");var t=xo(We,qo,arguments);return Rf(t,1+_f(0,r.length-(arguments.length-1)),!0)};var Oo=function(){return xo(We,Eo,arguments)};Po?Po(zr.exports,"apply",{value:Oo}):zr.exports.apply=Oo});var ke=l((mv,Io)=>{"use strict";o();i();var $o=Object.prototype.toString;Io.exports=function(r){var t=$o.call(r),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&$o.call(r.callee)==="[object Function]"),n}});var Mo=l((Av,Bo)=>{"use strict";o();i();var Do;Object.keys||(br=Object.prototype.hasOwnProperty,Le=Object.prototype.toString,Fo=ke(),ze=Object.prototype.propertyIsEnumerable,To=!ze.call({toString:null},"toString"),Ro=ze.call(function(){},"prototype"),Sr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Kr=function(e){var r=e.constructor;return r&&r.prototype===e},No={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},_o=function(){if(typeof window=="undefined")return!1;for(var e in window)try{if(!No["$"+e]&&br.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Kr(window[e])}catch(r){return!0}}catch(r){return!0}return!1}(),Uo=function(e){if(typeof window=="undefined"||!_o)return Kr(e);try{return Kr(e)}catch(r){return!1}},Do=function(r){var t=r!==null&&typeof r=="object",n=Le.call(r)==="[object Function]",a=Fo(r),u=t&&Le.call(r)==="[object String]",f=[];if(!t&&!n&&!a)throw new TypeError("Object.keys called on a non-object");var c=Ro&&n;if(u&&r.length>0&&!br.call(r,0))for(var y=0;y<r.length;++y)f.push(String(y));if(a&&r.length>0)for(var h=0;h<r.length;++h)f.push(String(h));else for(var g in r)!(c&&g==="prototype")&&br.call(r,g)&&f.push(String(g));if(To)for(var d=Uo(r),v=0;v<Sr.length;++v)!(d&&Sr[v]==="constructor")&&br.call(r,Sr[v])&&f.push(Sr[v]);return f});var br,Le,Fo,ze,To,Ro,Sr,Kr,No,_o,Uo;Bo.exports=Do});var Wo=l((Ov,Go)=>{"use strict";o();i();var Uf=Array.prototype.slice,Df=ke(),Co=Object.keys,Vr=Co?function(r){return Co(r)}:Mo(),jo=Object.keys;Vr.shim=function(){if(Object.keys){var r=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);r||(Object.keys=function(n){return Df(n)?jo(Uf.call(n)):jo(n)})}else Object.keys=Vr;return Object.keys||Vr};Go.exports=Vr});var Ar=l((xv,Jo)=>{"use strict";o();i();var Bf=Wo(),Mf=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Cf=Object.prototype.toString,jf=Array.prototype.concat,ko=Ce(),Gf=function(e){return typeof e=="function"&&Cf.call(e)==="[object Function]"},Lo=Ge()(),Wf=function(e,r,t,n){if(r in e){if(n===!0){if(e[r]===t)return}else if(!Gf(n)||!n())return}Lo?ko(e,r,t,!0):ko(e,r,t)},zo=function(e,r){var t=arguments.length>2?arguments[2]:{},n=Bf(r);Mf&&(n=jf.call(n,Object.getOwnPropertySymbols(r)));for(var a=0;a<n.length;a+=1)Wf(e,n[a],r[n[a]],t[n[a]])};zo.supportsDescriptors=!!Lo;Jo.exports=zo});var I=l((Fv,Vo)=>{"use strict";o();i();var Ho=F(),Ko=Hr(),kf=Ko(Ho("String.prototype.indexOf"));Vo.exports=function(r,t){var n=Ho(r,!!t);return typeof n=="function"&&kf(r,".prototype.")>-1?Ko(n):n}});var Xo=l((Nv,Qo)=>{"use strict";o();i();var Lf=F(),Yo=Lf("%Array%"),zf=!Yo.isArray&&I()("Object.prototype.toString");Qo.exports=Yo.isArray||function(r){return zf(r)==="[object Array]"}});var Je=l((Dv,Zo)=>{"use strict";o();i();Zo.exports=Xo()});var ei=l((Cv,ri)=>{"use strict";o();i();var Jf=F(),Hf=I(),Kf=w(),Vf=Je(),Yf=Jf("%Reflect.apply%",!0)||Hf("Function.prototype.apply");ri.exports=function(r,t){var n=arguments.length>2?arguments[2]:[];if(!Vf(n))throw new Kf("Assertion failed: optional `argumentsList`, if provided, must be a List");return Yf(r,t,n)}});function ti(){throw new Error("setTimeout has not been defined")}function ni(){throw new Error("clearTimeout has not been defined")}function oi(e){if(C===setTimeout)return setTimeout(e,0);if((C===ti||!C)&&setTimeout)return C=setTimeout,setTimeout(e,0);try{return C(e,0)}catch(r){try{return C.call(null,e,0)}catch(t){return C.call(this,e,0)}}}function Qf(e){if(j===clearTimeout)return clearTimeout(e);if((j===ni||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(e);try{return j(e)}catch(r){try{return j.call(null,e)}catch(t){return j.call(this,e)}}}function Xf(){!pr||!K||(pr=!1,K.length?U=K.concat(U):Yr=-1,U.length&&ii())}function ii(){if(!pr){var e=oi(Xf);pr=!0;for(var r=U.length;r;){for(K=U,U=[];++Yr<r;)K&&K[Yr].run();Yr=-1,r=U.length}K=null,pr=!1,Qf(e)}}function Zf(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];U.push(new ai(e,r)),U.length===1&&!pr&&oi(ii)}function ai(e,r){this.fun=e,this.array=r}function V(){}function dp(e){throw new Error("process.binding is not supported")}function hp(){return"/"}function mp(e){throw new Error("process.chdir is not supported")}function bp(){return 0}function Ap(e){var r=Sp.call(fr)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}function Pp(){var e=new Date,r=e-wp;return r/1e3}var C,j,U,pr,K,Yr,rp,ep,tp,np,op,ip,ap,up,fp,pp,sp,lp,cp,yp,vp,gp,fr,Sp,wp,Op,wr,ui=be(()=>{"use strict";o();i();C=ti,j=ni;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(j=clearTimeout);U=[],pr=!1,Yr=-1;ai.prototype.run=function(){this.fun.apply(null,this.array)};rp="browser",ep="browser",tp=!0,np={},op=[],ip="",ap={},up={},fp={};pp=V,sp=V,lp=V,cp=V,yp=V,vp=V,gp=V;fr=globalThis.performance||{},Sp=fr.now||fr.mozNow||fr.msNow||fr.oNow||fr.webkitNow||function(){return new Date().getTime()};wp=new Date;Op={nextTick:Zf,title:rp,browser:tp,env:np,argv:op,version:ip,versions:ap,on:pp,addListener:sp,once:lp,off:cp,removeListener:yp,removeAllListeners:vp,emit:gp,binding:dp,cwd:hp,chdir:mp,umask:bp,hrtime:Ap,platform:ep,release:up,config:fp,uptime:Pp},wr=Op});var He,Ke,fi=be(()=>{"use strict";o();i();typeof Object.create=="function"?He=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:He=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};Ke=He});var di={};su(di,{_extend:()=>nt,debuglog:()=>pi,default:()=>_p,deprecate:()=>Ze,format:()=>re,inherits:()=>Ke,inspect:()=>R,isArray:()=>rt,isBoolean:()=>ee,isBuffer:()=>yi,isDate:()=>Zr,isError:()=>Or,isFunction:()=>Er,isNull:()=>qr,isNullOrUndefined:()=>si,isNumber:()=>et,isObject:()=>Y,isPrimitive:()=>ci,isRegExp:()=>Pr,isString:()=>xr,isSymbol:()=>li,isUndefined:()=>T,log:()=>vi});function re(e){if(!xr(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(R(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,a=n.length,u=String(e).replace(Ep,function(c){if(c==="%%")return"%";if(t>=a)return c;switch(c){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(y){return"[Circular]"}default:return c}}),f=n[t];t<a;f=n[++t])qr(f)||!Y(f)?u+=" "+f:u+=" "+R(f);return u}function Ze(e,r){if(T(globalThis.process))return function(){return Ze(e,r).apply(this,arguments)};if(wr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(wr.throwDeprecation)throw new Error(r);wr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}function pi(e){if(T(Ve)&&(Ve=wr.env.NODE_DEBUG||""),e=e.toUpperCase(),!Qr[e])if(new RegExp("\\b"+e+"\\b","i").test(Ve)){var r=0;Qr[e]=function(){var t=re.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else Qr[e]=function(){};return Qr[e]}function R(e,r){var t={seen:[],stylize:xp};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),ee(r)?t.showHidden=r:r&&nt(t,r),T(t.showHidden)&&(t.showHidden=!1),T(t.depth)&&(t.depth=2),T(t.colors)&&(t.colors=!1),T(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=qp),Xr(t,e,t.depth)}function qp(e,r){var t=R.styles[r];return t?"\x1B["+R.colors[t][0]+"m"+e+"\x1B["+R.colors[t][1]+"m":e}function xp(e,r){return e}function $p(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Xr(e,r,t){if(e.customInspect&&r&&Er(r.inspect)&&r.inspect!==R&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return xr(n)||(n=Xr(e,n,t)),n}var a=Ip(e,r);if(a)return a;var u=Object.keys(r),f=$p(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(r)),Or(r)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return Ye(r);if(u.length===0){if(Er(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(Pr(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(Zr(r))return e.stylize(Date.prototype.toString.call(r),"date");if(Or(r))return Ye(r)}var y="",h=!1,g=["{","}"];if(rt(r)&&(h=!0,g=["[","]"]),Er(r)){var d=r.name?": "+r.name:"";y=" [Function"+d+"]"}if(Pr(r)&&(y=" "+RegExp.prototype.toString.call(r)),Zr(r)&&(y=" "+Date.prototype.toUTCString.call(r)),Or(r)&&(y=" "+Ye(r)),u.length===0&&(!h||r.length==0))return g[0]+y+g[1];if(t<0)return Pr(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var v;return h?v=Fp(e,r,t,f,u):v=u.map(function(A){return Xe(e,r,t,f,A,h)}),e.seen.pop(),Tp(v,y,g)}function Ip(e,r){if(T(r))return e.stylize("undefined","undefined");if(xr(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(et(r))return e.stylize(""+r,"number");if(ee(r))return e.stylize(""+r,"boolean");if(qr(r))return e.stylize("null","null")}function Ye(e){return"["+Error.prototype.toString.call(e)+"]"}function Fp(e,r,t,n,a){for(var u=[],f=0,c=r.length;f<c;++f)gi(r,String(f))?u.push(Xe(e,r,t,n,String(f),!0)):u.push("");return a.forEach(function(y){y.match(/^\d+$/)||u.push(Xe(e,r,t,n,y,!0))}),u}function Xe(e,r,t,n,a,u){var f,c,y;if(y=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]},y.get?y.set?c=e.stylize("[Getter/Setter]","special"):c=e.stylize("[Getter]","special"):y.set&&(c=e.stylize("[Setter]","special")),gi(n,a)||(f="["+a+"]"),c||(e.seen.indexOf(y.value)<0?(qr(t)?c=Xr(e,y.value,null):c=Xr(e,y.value,t-1),c.indexOf(`
|
|
2
|
+
`)>-1&&(u?c=c.split(`
|
|
3
|
+
`).map(function(h){return" "+h}).join(`
|
|
4
|
+
`).substr(2):c=`
|
|
5
|
+
`+c.split(`
|
|
6
|
+
`).map(function(h){return" "+h}).join(`
|
|
7
|
+
`))):c=e.stylize("[Circular]","special")),T(f)){if(u&&a.match(/^\d+$/))return c;f=JSON.stringify(""+a),f.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(f=f.substr(1,f.length-2),f=e.stylize(f,"name")):(f=f.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),f=e.stylize(f,"string"))}return f+": "+c}function Tp(e,r,t){var n=0,a=e.reduce(function(u,f){return n++,f.indexOf(`
|
|
8
|
+
`)>=0&&n++,u+f.replace(/\u001b\[\d\d?m/g,"").length+1},0);return a>60?t[0]+(r===""?"":r+`
|
|
9
|
+
`)+" "+e.join(`,
|
|
10
|
+
`)+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function rt(e){return Array.isArray(e)}function ee(e){return typeof e=="boolean"}function qr(e){return e===null}function si(e){return e==null}function et(e){return typeof e=="number"}function xr(e){return typeof e=="string"}function li(e){return typeof e=="symbol"}function T(e){return e===void 0}function Pr(e){return Y(e)&&tt(e)==="[object RegExp]"}function Y(e){return typeof e=="object"&&e!==null}function Zr(e){return Y(e)&&tt(e)==="[object Date]"}function Or(e){return Y(e)&&(tt(e)==="[object Error]"||e instanceof Error)}function Er(e){return typeof e=="function"}function ci(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}function yi(e){return p.isBuffer(e)}function tt(e){return Object.prototype.toString.call(e)}function Qe(e){return e<10?"0"+e.toString(10):e.toString(10)}function Np(){var e=new Date,r=[Qe(e.getHours()),Qe(e.getMinutes()),Qe(e.getSeconds())].join(":");return[e.getDate(),Rp[e.getMonth()],r].join(" ")}function vi(){console.log("%s - %s",Np(),re.apply(null,arguments))}function nt(e,r){if(!r||!Y(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e}function gi(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var Ep,Qr,Ve,Rp,_p,hi=be(()=>{"use strict";o();i();ui();fi();Ep=/%[sdj%]/g;Qr={};R.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};R.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};Rp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];_p={inherits:Ke,_extend:nt,log:vi,isBuffer:yi,isPrimitive:ci,isFunction:Er,isError:Or,isDate:Zr,isObject:Y,isRegExp:Pr,isUndefined:T,isSymbol:li,isString:xr,isNumber:et,isNullOrUndefined:si,isNull:qr,isBoolean:ee,isArray:rt,inspect:R,deprecate:Ze,format:re,debuglog:pi}});var mi=l((Xv,te)=>{"use strict";o();i();var Q=(hi(),cu(di));if(Q&&Q.default){te.exports=Q.default;for(let e in Q)te.exports[e]=Q[e]}else Q&&(te.exports=Q)});var Si=l((eg,bi)=>{"use strict";o();i();bi.exports=mi().inspect});var Tr=l((og,ji)=>{"use strict";o();i();var yt=typeof Map=="function"&&Map.prototype,ot=Object.getOwnPropertyDescriptor&&yt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,oe=yt&&ot&&typeof ot.get=="function"?ot.get:null,Ai=yt&&Map.prototype.forEach,vt=typeof Set=="function"&&Set.prototype,it=Object.getOwnPropertyDescriptor&&vt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ie=vt&&it&&typeof it.get=="function"?it.get:null,wi=vt&&Set.prototype.forEach,Up=typeof WeakMap=="function"&&WeakMap.prototype,Ir=Up?WeakMap.prototype.has:null,Dp=typeof WeakSet=="function"&&WeakSet.prototype,Fr=Dp?WeakSet.prototype.has:null,Bp=typeof WeakRef=="function"&&WeakRef.prototype,Pi=Bp?WeakRef.prototype.deref:null,Mp=Boolean.prototype.valueOf,Cp=Object.prototype.toString,jp=Function.prototype.toString,Gp=String.prototype.match,gt=String.prototype.slice,G=String.prototype.replace,Wp=String.prototype.toUpperCase,Oi=String.prototype.toLowerCase,Ni=RegExp.prototype.test,Ei=Array.prototype.concat,N=Array.prototype.join,kp=Array.prototype.slice,qi=Math.floor,ft=typeof BigInt=="function"?BigInt.prototype.valueOf:null,at=Object.getOwnPropertySymbols,pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,sr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===sr||!0)?Symbol.toStringTag:null,_i=Object.prototype.propertyIsEnumerable,xi=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function $i(e,r){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Ni.call(/e/,r))return r;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-qi(-e):qi(e);if(n!==e){var a=String(n),u=gt.call(r,a.length+1);return G.call(a,t,"$&_")+"."+G.call(G.call(u,/([0-9]{3})/g,"$&_"),/_$/,"")}}return G.call(r,t,"$&_")}var st=Si(),Ii=st.custom,Fi=Bi(Ii)?Ii:null,Ui={__proto__:null,double:'"',single:"'"},Lp={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ji.exports=function e(r,t,n,a){var u=t||{};if(D(u,"quoteStyle")&&!D(Ui,u.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(D(u,"maxStringLength")&&(typeof u.maxStringLength=="number"?u.maxStringLength<0&&u.maxStringLength!==1/0:u.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=D(u,"customInspect")?u.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(D(u,"indent")&&u.indent!==null&&u.indent!==" "&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(D(u,"numericSeparator")&&typeof u.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=u.numericSeparator;if(typeof r=="undefined")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return Ci(r,u);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var y=String(r);return c?$i(r,y):y}if(typeof r=="bigint"){var h=String(r)+"n";return c?$i(r,h):h}var g=typeof u.depth=="undefined"?5:u.depth;if(typeof n=="undefined"&&(n=0),n>=g&&g>0&&typeof r=="object")return lt(r)?"[Array]":"[Object]";var d=fs(u,n);if(typeof a=="undefined")a=[];else if(Mi(a,r)>=0)return"[Circular]";function v(X,_r,pu){if(_r&&(a=kp.call(a),a.push(_r)),pu){var Gt={depth:u.depth};return D(u,"quoteStyle")&&(Gt.quoteStyle=u.quoteStyle),e(X,Gt,n+1,a)}return e(X,u,n+1,a)}if(typeof r=="function"&&!Ti(r)){var A=Zp(r),P=ne(r,v);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(P.length>0?" { "+N.call(P,", ")+" }":"")}if(Bi(r)){var S=sr?G.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):pt.call(r);return typeof r=="object"&&!sr?$r(S):S}if(is(r)){for(var x="<"+Oi.call(String(r.nodeName)),$=r.attributes||[],_=0;_<$.length;_++)x+=" "+$[_].name+"="+Di(zp($[_].value),"double",u);return x+=">",r.childNodes&&r.childNodes.length&&(x+="..."),x+="</"+Oi.call(String(r.nodeName))+">",x}if(lt(r)){if(r.length===0)return"[]";var k=ne(r,v);return d&&!us(k)?"["+ct(k,d)+"]":"[ "+N.call(k,", ")+" ]"}if(Hp(r)){var yr=ne(r,v);return!("cause"in Error.prototype)&&"cause"in r&&!_i.call(r,"cause")?"{ ["+String(r)+"] "+N.call(Ei.call("[cause]: "+v(r.cause),yr),", ")+" }":yr.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+N.call(yr,", ")+" }"}if(typeof r=="object"&&f){if(Fi&&typeof r[Fi]=="function"&&st)return st(r,{depth:g-n});if(f!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(rs(r)){var Nr=[];return Ai&&Ai.call(r,function(X,_r){Nr.push(v(_r,r,!0)+" => "+v(X,r))}),Ri("Map",oe.call(r),Nr,d)}if(ns(r)){var Mt=[];return wi&&wi.call(r,function(X){Mt.push(v(X,r))}),Ri("Set",ie.call(r),Mt,d)}if(es(r))return ut("WeakMap");if(os(r))return ut("WeakSet");if(ts(r))return ut("WeakRef");if(Vp(r))return $r(v(Number(r)));if(Qp(r))return $r(v(ft.call(r)));if(Yp(r))return $r(Mp.call(r));if(Kp(r))return $r(v(String(r)));if(typeof window!="undefined"&&r===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&r===globalThis||typeof globalThis!="undefined"&&r===globalThis)return"{ [object globalThis] }";if(!Jp(r)&&!Ti(r)){var de=ne(r,v),Ct=xi?xi(r)===Object.prototype:r instanceof Object||r.constructor===Object,he=r instanceof Object?"":"null prototype",jt=!Ct&&q&&Object(r)===r&&q in r?gt.call(W(r),8,-1):he?"Object":"",fu=Ct||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",me=fu+(jt||he?"["+N.call(Ei.call([],jt||[],he||[]),": ")+"] ":"");return de.length===0?me+"{}":d?me+"{"+ct(de,d)+"}":me+"{ "+N.call(de,", ")+" }"}return String(r)};function Di(e,r,t){var n=t.quoteStyle||r,a=Ui[n];return a+e+a}function zp(e){return G.call(String(e),/"/g,""")}function lt(e){return W(e)==="[object Array]"&&(!q||!(typeof e=="object"&&q in e))}function Jp(e){return W(e)==="[object Date]"&&(!q||!(typeof e=="object"&&q in e))}function Ti(e){return W(e)==="[object RegExp]"&&(!q||!(typeof e=="object"&&q in e))}function Hp(e){return W(e)==="[object Error]"&&(!q||!(typeof e=="object"&&q in e))}function Kp(e){return W(e)==="[object String]"&&(!q||!(typeof e=="object"&&q in e))}function Vp(e){return W(e)==="[object Number]"&&(!q||!(typeof e=="object"&&q in e))}function Yp(e){return W(e)==="[object Boolean]"&&(!q||!(typeof e=="object"&&q in e))}function Bi(e){if(sr)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!pt)return!1;try{return pt.call(e),!0}catch(r){}return!1}function Qp(e){if(!e||typeof e!="object"||!ft)return!1;try{return ft.call(e),!0}catch(r){}return!1}var Xp=Object.prototype.hasOwnProperty||function(e){return e in this};function D(e,r){return Xp.call(e,r)}function W(e){return Cp.call(e)}function Zp(e){if(e.name)return e.name;var r=Gp.call(jp.call(e),/^function\s*([\w$]+)/);return r?r[1]:null}function Mi(e,r){if(e.indexOf)return e.indexOf(r);for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}function rs(e){if(!oe||!e||typeof e!="object")return!1;try{oe.call(e);try{ie.call(e)}catch(r){return!0}return e instanceof Map}catch(r){}return!1}function es(e){if(!Ir||!e||typeof e!="object")return!1;try{Ir.call(e,Ir);try{Fr.call(e,Fr)}catch(r){return!0}return e instanceof WeakMap}catch(r){}return!1}function ts(e){if(!Pi||!e||typeof e!="object")return!1;try{return Pi.call(e),!0}catch(r){}return!1}function ns(e){if(!ie||!e||typeof e!="object")return!1;try{ie.call(e);try{oe.call(e)}catch(r){return!0}return e instanceof Set}catch(r){}return!1}function os(e){if(!Fr||!e||typeof e!="object")return!1;try{Fr.call(e,Fr);try{Ir.call(e,Ir)}catch(r){return!0}return e instanceof WeakSet}catch(r){}return!1}function is(e){return!e||typeof e!="object"?!1:typeof HTMLElement!="undefined"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Ci(e,r){if(e.length>r.maxStringLength){var t=e.length-r.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Ci(gt.call(e,0,r.maxStringLength),r)+n}var a=Lp[r.quoteStyle||"single"];a.lastIndex=0;var u=G.call(G.call(e,a,"\\$1"),/[\x00-\x1f]/g,as);return Di(u,"single",r)}function as(e){var r=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return t?"\\"+t:"\\x"+(r<16?"0":"")+Wp.call(r.toString(16))}function $r(e){return"Object("+e+")"}function ut(e){return e+" { ? }"}function Ri(e,r,t,n){var a=n?ct(t,n):N.call(t,", ");return e+" ("+r+") {"+a+"}"}function us(e){for(var r=0;r<e.length;r++)if(Mi(e[r],`
|
|
11
|
+
`)>=0)return!1;return!0}function fs(e,r){var t;if(e.indent===" ")t=" ";else if(typeof e.indent=="number"&&e.indent>0)t=N.call(Array(e.indent+1)," ");else return null;return{base:t,prev:N.call(Array(r+1),t)}}function ct(e,r){if(e.length===0)return"";var t=`
|
|
12
|
+
`+r.prev+r.base;return t+N.call(e,","+t)+`
|
|
13
|
+
`+r.prev}function ne(e,r){var t=lt(e),n=[];if(t){n.length=e.length;for(var a=0;a<e.length;a++)n[a]=D(e,a)?r(e[a],e):""}var u=typeof at=="function"?at(e):[],f;if(sr){f={};for(var c=0;c<u.length;c++)f["$"+u[c]]=u[c]}for(var y in e)D(e,y)&&(t&&String(Number(y))===y&&y<e.length||sr&&f["$"+y]instanceof Symbol||(Ni.call(/[^\w$]/,y)?n.push(r(y,e)+": "+r(e[y],e)):n.push(y+": "+r(e[y],e))));if(typeof at=="function")for(var h=0;h<u.length;h++)_i.call(e,u[h])&&n.push("["+r(u[h])+"]: "+r(e[u[h]],e));return n}});var ae=l((ug,Gi)=>{"use strict";o();i();Gi.exports=function(r){return typeof r=="string"||typeof r=="symbol"}});var ki=l((sg,Wi)=>{"use strict";o();i();var ps=w(),ss=Tr(),ls=ae();Wi.exports=function(r,t){if(!ls(t))throw new ps("Assertion failed: IsPropertyKey(P) is not true, got "+ss(t));return r[t]}});var Hi=l((yg,Ji)=>{"use strict";o();i();var zi=Function.prototype.toString,lr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ht,ue;if(typeof lr=="function"&&typeof Object.defineProperty=="function")try{ht=Object.defineProperty({},"length",{get:function(){throw ue}}),ue={},lr(function(){throw 42},null,ht)}catch(e){e!==ue&&(lr=null)}else lr=null;var cs=/^\s*class\b/,mt=function(r){try{var t=zi.call(r);return cs.test(t)}catch(n){return!1}},dt=function(r){try{return mt(r)?!1:(zi.call(r),!0)}catch(t){return!1}},fe=Object.prototype.toString,ys="[object Object]",vs="[object Function]",gs="[object GeneratorFunction]",ds="[object HTMLAllCollection]",hs="[object HTML document.all class]",ms="[object HTMLCollection]",bs=typeof Symbol=="function"&&!!Symbol.toStringTag,Ss=!(0 in[,]),bt=function(){return!1};typeof document=="object"&&(Li=document.all,fe.call(Li)===fe.call(document.all)&&(bt=function(r){if((Ss||!r)&&(typeof r=="undefined"||typeof r=="object"))try{var t=fe.call(r);return(t===ds||t===hs||t===ms||t===ys)&&r("")==null}catch(n){}return!1}));var Li;Ji.exports=lr?function(r){if(bt(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;try{lr(r,null,ht)}catch(t){if(t!==ue)return!1}return!mt(r)&&dt(r)}:function(r){if(bt(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;if(bs)return dt(r);if(mt(r))return!1;var t=fe.call(r);return t!==vs&&t!==gs&&!/^\[object HTML/.test(t)?!1:dt(r)}});var St=l((dg,Ki)=>{"use strict";o();i();Ki.exports=Hi()});var Xi=l((bg,Qi)=>{"use strict";o();i();var Vi=w(),As=ki(),ws=St(),Ps=ae(),Yi=Tr();Qi.exports=function(r,t){if(!Ps(t))throw new Vi("Assertion failed: IsPropertyKey(P) is not true");var n=As(r,t);if(n!=null){if(!ws(n))throw new Vi(Yi(t)+" is not a function: "+Yi(n));return n}}});var ra=l((wg,Zi)=>{"use strict";o();i();var Os=Te();Zi.exports=function(){return Os()&&!!Symbol.toStringTag}});var Ot=l((Eg,oa)=>{"use strict";o();i();var At=I(),ea=ra()(),ta,na,wt,Pt;ea&&(ta=At("Object.prototype.hasOwnProperty"),na=At("RegExp.prototype.exec"),wt={},pe=function(){throw wt},Pt={toString:pe,valueOf:pe},typeof Symbol.toPrimitive=="symbol"&&(Pt[Symbol.toPrimitive]=pe));var pe,Es=At("Object.prototype.toString"),qs=Object.getOwnPropertyDescriptor,xs="[object RegExp]";oa.exports=ea?function(r){if(!r||typeof r!="object")return!1;var t=qs(r,"lastIndex"),n=t&&ta(t,"value");if(!n)return!1;try{na(r,Pt)}catch(a){return a===wt}}:function(r){return!r||typeof r!="object"&&typeof r!="function"?!1:Es(r)===xs}});var Et=l(($g,ia)=>{"use strict";o();i();var $s=I(),Is=Ot(),Fs=$s("RegExp.prototype.exec"),Ts=w();ia.exports=function(r){if(!Is(r))throw new Ts("`regex` must be a RegExp");return function(n){return Fs(r,n)!==null}}});var ua=l((Tg,aa)=>{"use strict";o();i();aa.exports=function(r,t){for(var n=0;n<r.length;n+=1)if(!t(r[n],n,r))return!1;return!0}});var pa=l((_g,fa)=>{"use strict";o();i();fa.exports=function(r){if(r===null)return"Null";if(typeof r=="undefined")return"Undefined";if(typeof r=="function"||typeof r=="object")return"Object";if(typeof r=="number")return"Number";if(typeof r=="boolean")return"Boolean";if(typeof r=="string")return"String"}});var qt=l((Bg,sa)=>{"use strict";o();i();var Rs=pa();sa.exports=function(r){return typeof r=="symbol"?"Symbol":typeof r=="bigint"?"BigInt":Rs(r)}});var ya=l((jg,ca)=>{"use strict";o();i();var la=w(),Ns=Tr(),_s=ae(),Us=qt();ca.exports=function(r,t){if(Us(r)!=="Object")throw new la("Assertion failed: Type(O) is not Object");if(!_s(t))throw new la("Assertion failed: IsPropertyKey(P) is not true, got "+Ns(t));return r[t]}});var ga=l((kg,va)=>{"use strict";o();i();var Ds=F();va.exports=Ds("%Math.min%")});var xt=l((Jg,da)=>{"use strict";o();i();da.exports=Number.isNaN||function(r){return r!==r}});var ma=l((Vg,ha)=>{"use strict";o();i();var Bs=xt();ha.exports=function(e){return(typeof e=="number"||typeof e=="bigint")&&!Bs(e)&&e!==1/0&&e!==-1/0}});var se=l((Xg,Sa)=>{"use strict";o();i();var ba=F(),Ms=ba("%Math.abs%"),Cs=ba("%Math.floor%"),js=xt(),Gs=ma();Sa.exports=function(r){if(typeof r!="number"||js(r)||!Gs(r))return!1;var t=Ms(r);return Cs(t)===t}});var It=l((ed,Aa)=>{"use strict";o();i();var Ws=I(),$t=w(),ks=se(),Ls=Ws("String.prototype.slice");Aa.exports=function(r,t,n){if(typeof r!="string")throw new $t("Assertion failed: `string` must be a String");if(typeof t!="string")throw new $t("Assertion failed: `searchValue` must be a String");if(!ks(n)||n<0)throw new $t("Assertion failed: `fromIndex` must be a non-negative integer");var a=r.length;if(t===""&&n<=a)return n;for(var u=t.length,f=n;f<=a-u;f+=1){var c=Ls(r,f,f+u);if(c===t)return f}return-1}});var le=l((od,wa)=>{"use strict";o();i();var zs=w();wa.exports=function(r){if(r==null)throw new zs(arguments.length>0&&arguments[1]||"Cannot call method on "+r);return r}});var ce=l((ud,Pa)=>{"use strict";o();i();var Js=F(),Hs=Js("%String%"),Ks=w();Pa.exports=function(r){if(typeof r=="symbol")throw new Ks("Cannot convert a Symbol value to a string");return Hs(r)}});var Ft=l((sd,qa)=>{"use strict";o();i();var Vs=le(),Ys=ce(),Qs=I(),Oa=Qs("String.prototype.replace"),Ea=/^\s$/.test("\u180E"),Xs=Ea?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Zs=Ea?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;qa.exports=function(){var r=Ys(Vs(this));return Oa(Oa(r,Xs,""),Zs,"")}});var Tt=l((yd,$a)=>{"use strict";o();i();var rl=Ft(),xa="\u200B",cr="\u180E";$a.exports=function(){return String.prototype.trim&&xa.trim()===xa&&cr.trim()===cr&&("_"+cr).trim()==="_"+cr&&(cr+"_").trim()===cr+"_"?String.prototype.trim:rl}});var Fa=l((dd,Ia)=>{"use strict";o();i();var el=Ar(),tl=Tt();Ia.exports=function(){var r=tl();return el(String.prototype,{trim:r},{trim:function(){return String.prototype.trim!==r}}),r}});var _a=l((bd,Na)=>{"use strict";o();i();var nl=Hr(),ol=Ar(),il=le(),al=Ft(),Ta=Tt(),ul=Fa(),fl=nl(Ta()),Ra=function(r){return il(r),fl(r)};ol(Ra,{getPolyfill:Ta,implementation:al,shim:ul});Na.exports=Ra});var Ma=l((wd,Ba)=>{"use strict";o();i();var Nt=F(),Rt=Nt("%Number%"),pl=Nt("%RegExp%"),sl=w(),Ua=Nt("%parseInt%"),ll=I(),ye=Et(),Da=ll("String.prototype.slice"),cl=ye(/^0b[01]+$/i),yl=ye(/^0o[0-7]+$/i),vl=ye(/^[-+]0x[0-9a-f]+$/i),gl=["\x85","\u200B","\uFFFE"].join(""),dl=new pl("["+gl+"]","g"),hl=ye(dl),ml=_a();Ba.exports=function e(r){if(typeof r!="string")throw new sl("Assertion failed: `argument` is not a String");if(cl(r))return Rt(Ua(Da(r,2),2));if(yl(r))return Rt(Ua(Da(r,2),8));if(hl(r)||vl(r))return NaN;var t=ml(r);return t!==r?e(t):Rt(r)}});var Ga=l((Ed,ja)=>{"use strict";o();i();var bl=w(),Ca=se(),Sl=I(),Al=Sl("String.prototype.slice");ja.exports=function(r,t,n){if(typeof r!="string"||!Ca(t)||arguments.length>2&&!Ca(n))throw new bl("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return Al(r,t,arguments.length>2?n:r.length)}});var ka=l(($d,Wa)=>{"use strict";o();i();Wa.exports=function(r){return typeof r=="string"||typeof r=="undefined"}});var za=l((Td,La)=>{"use strict";o();i();var wl=I()("String.prototype.slice");La.exports=function(r,t){return r===t?!0:r.length>t.length?!1:wl(t,0,r.length)===r}});var Ya=l((_d,Va)=>{"use strict";o();i();var B=w(),Ka=Et(),Pl=ua(),_t=Tr(),Ol=ya(),El=Je(),ql=ga(),xl=It(),Ja=Ma(),M=Ga(),$l=ce(),Ha=qt(),Il=se(),Fl=ka(),Rr=za(),Tl=Ka(/^\$[0-9]/),Rl=Ka(/^\$[0-9][0-9]/);Va.exports=function(r,t,n,a,u,f){if(typeof r!="string")throw new B("Assertion failed: `matched` must be a String");if(typeof t!="string")throw new B("Assertion failed: `str` must be a String");if(!Il(n)||n<0)throw new B("Assertion failed: `position` must be a nonnegative integer, got "+_t(n));if(!El(a)||!Pl(a,Fl))throw new B("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+_t(a));if(typeof u!="undefined"&&Ha(u)!=="Object")throw new B("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof f!="string")throw new B("Assertion failed: `replacementTemplate` must be a String");var c=t.length;if(n>c)throw new B("Assertion failed: position > stringLength, got "+_t(n));for(var y=f,h="";y!=="";){var g,d,v;if(Rr("$$",y))g="$$",d="$";else if(Rr("$`",y))g="$`",d=M(t,0,n);else if(Rr("$&",y))g="$&",d=r;else if(Rr("$'",y)){g="$'";var A=r.length,P=n+A;d=M(t,ql(P,c))}else if(Tl(y)){var S=Rl(y)?2:1,x=M(y,1,1+S),$=Ja(x);if($<0||$>99)throw new B("Assertion failed: `index` must be >= 0 and <= 99");var _=a.length;$>_&&S===2&&(S=1,x=M(x,0,1),$=Ja(x)),g=M(y,0,1+S),1<=$&&$<=_?(v=a[$-1],typeof v=="undefined"?d="":d=v):d=g}else if(Rr("$<",y)){var k=xl(y,">",0);if(k===-1||typeof u=="undefined")g="$<",d=g;else{g=M(y,0,k+1);var yr=M(y,2,k);if(Ha(u)!=="Object")throw new B("Assertion failed: Type(namedCaptures) is not Object");v=Ol(u,yr),typeof v=="undefined"?d="":d=$l(v)}}else g=M(y,0,1),d=g;var Nr=g.length;y=M(y,Nr),h+=d}return h}});var Dt=l((Bd,ru)=>{"use strict";o();i();var Qa=ei(),Nl=Xi(),_l=Ya(),Ul=St(),Dl=le(),ve=ce(),Xa=It(),Bl=F(),ge=I(),Ml=Ee()(),Cl=Ot(),jl=Bl("%Math.max%"),Za=w(),Gl=ge("Array.prototype.push"),Ut=ge("String.prototype.slice"),Wl=ge("String.prototype.indexOf"),kl=ge("String.prototype.replace");ru.exports=function(r,t){var n=Dl(this),a=Cl(r);if(a&&Wl(Ut(r,r.source.length+2),"g")===-1)throw new Za("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(Ml&&Symbol.replace){if(r!=null){var u=Nl(r,Symbol.replace);if(typeof u!="undefined")return Qa(u,r,[n,t])}}else if(a)return kl(n,r,t);var f=ve(n),c=ve(r),y=Ul(t);y||(t=ve(t));for(var h=c.length,g=jl(1,h),d=[],v=Xa(f,c,0);v!==-1;)Gl(d,v),v=Xa(f,c,v+g);for(var A=0,P="",S=0;S<d.length;S+=1){var x;if(y)x=ve(Qa(t,void 0,[c,d[S],f]));else{if(typeof t!="string")throw new Za("Assertion failed: `replaceValue` should be a string at this point");var $=[];x=_l(c,f,d[S],$,void 0,t)}var _=Ut(f,A,d[S]);P+=_+x,A=d[S]+h}return A<f.length&&(P+=Ut(f,A)),P}});var Bt=l((jd,eu)=>{"use strict";o();i();var Ll=Dt();eu.exports=function(){return String.prototype.replaceAll||Ll}});var nu=l((kd,tu)=>{"use strict";o();i();var zl=Ar(),Jl=Bt();tu.exports=function(){var r=Jl();return zl(String.prototype,{replaceAll:r},{replaceAll:function(){return String.prototype.replaceAll!==r}}),r}});var uu=l((Jd,au)=>{"use strict";o();i();var Hl=Hr(),Kl=Ar(),ou=Dt(),Vl=Bt(),Yl=nu(),iu=Hl(ou);Kl(iu,{getPolyfill:Vl,implementation:ou,shim:Yl});au.exports=iu});o();i();var Vd=lu(uu(),1);export{yu as DynamicSnippetsGenerator};
|