@fern-api/php-dynamic-snippets 0.0.5 → 0.0.7

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.
Files changed (58) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +23 -15
  2. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -0
  3. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  4. package/cjs/{DynamicSnippetsGeneratorContext-7JXlOyjB.d.cts → DynamicSnippetsGeneratorContext-CwkDTYOI.d.cts} +3 -3
  5. package/cjs/EndpointSnippetGenerator.cjs +34 -15
  6. package/cjs/EndpointSnippetGenerator.cjs.map +1 -0
  7. package/cjs/EndpointSnippetGenerator.d.cts +7 -1
  8. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +22 -14
  9. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -0
  10. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  11. package/cjs/context/DynamicTypeLiteralMapper.cjs +33 -14
  12. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -0
  13. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  14. package/cjs/context/FilePropertyMapper.cjs +33 -14
  15. package/cjs/context/FilePropertyMapper.cjs.map +1 -0
  16. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  17. package/cjs/index.cjs +23 -27
  18. package/cjs/index.cjs.map +1 -0
  19. package/cjs/index.d.cts +2 -2
  20. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  21. package/esm/DynamicSnippetsGenerator.js +2 -1
  22. package/esm/DynamicSnippetsGenerator.js.map +1 -0
  23. package/esm/{DynamicSnippetsGeneratorContext-7JXlOyjB.d.ts → DynamicSnippetsGeneratorContext-CwkDTYOI.d.ts} +3 -3
  24. package/esm/EndpointSnippetGenerator.d.ts +7 -1
  25. package/esm/EndpointSnippetGenerator.js +2 -1
  26. package/esm/EndpointSnippetGenerator.js.map +1 -0
  27. package/esm/chunk-3LG5WCZI.js +2 -0
  28. package/esm/chunk-3LG5WCZI.js.map +1 -0
  29. package/esm/{chunk-2MVLIJOX.js → chunk-3QAUV5WT.js} +2 -1
  30. package/esm/chunk-3QAUV5WT.js.map +1 -0
  31. package/esm/chunk-CPIHNCS3.js +4 -0
  32. package/esm/chunk-CPIHNCS3.js.map +1 -0
  33. package/esm/chunk-DFQIKN25.js +2 -0
  34. package/esm/chunk-DFQIKN25.js.map +1 -0
  35. package/esm/{chunk-NXBUWG6C.js → chunk-EECVWAVT.js} +2 -1
  36. package/esm/chunk-EECVWAVT.js.map +1 -0
  37. package/esm/chunk-PYHFKEW4.js +47 -0
  38. package/esm/chunk-PYHFKEW4.js.map +1 -0
  39. package/esm/chunk-XX3MRTVI.js +2 -0
  40. package/esm/chunk-XX3MRTVI.js.map +1 -0
  41. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  42. package/esm/context/DynamicSnippetsGeneratorContext.js +2 -1
  43. package/esm/context/DynamicSnippetsGeneratorContext.js.map +1 -0
  44. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  45. package/esm/context/DynamicTypeLiteralMapper.js +2 -1
  46. package/esm/context/DynamicTypeLiteralMapper.js.map +1 -0
  47. package/esm/context/FilePropertyMapper.d.ts +1 -1
  48. package/esm/context/FilePropertyMapper.js +2 -1
  49. package/esm/context/FilePropertyMapper.js.map +1 -0
  50. package/esm/index.d.ts +2 -2
  51. package/esm/index.js +2 -13
  52. package/esm/index.js.map +1 -0
  53. package/package.json +1 -1
  54. package/esm/chunk-6U4ZJ2VA.js +0 -14
  55. package/esm/chunk-AEXR2D5H.js +0 -1
  56. package/esm/chunk-ESPGWZRY.js +0 -3
  57. package/esm/chunk-H4KXMOP7.js +0 -1
  58. package/esm/chunk-JCUQ3FQP.js +0 -28
@@ -0,0 +1,2 @@
1
+ import{a as g}from"./chunk-EECVWAVT.js";import{c as l}from"./chunk-3LG5WCZI.js";import{a as f}from"./chunk-3QAUV5WT.js";import{e as r,f as m,g as p,i as o,j as c,l as s,m as u}from"./chunk-PYHFKEW4.js";m();p();var h=["use","clone","list"],d="Requests",y="Types",C=class i extends l{constructor({ir:e,config:t}){var n;super({ir:e,config:t});r(this,"ir");r(this,"customConfig");r(this,"dynamicTypeLiteralMapper");r(this,"filePropertyMapper");r(this,"rootNamespace");this.ir=e,this.customConfig=t.customConfig!=null?t.customConfig:void 0,this.dynamicTypeLiteralMapper=new g({context:this}),this.filePropertyMapper=new f({context:this}),this.rootNamespace=F({organization:t.organization,namespaceOverride:(n=this.customConfig)==null?void 0:n.namespace})}clone(){return new i({ir:this.ir,config:this.config})}getParameterName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getPropertyName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getMethodName(e){let t=e.camelCase.unsafeName;return h.includes(t)?t:e.camelCase.safeName}getClassName(e){return u(e.pascalCase.safeName)}getRootClientClassName(){var e,t,n;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((t=this.customConfig)==null?void 0:t["client-class-name"])!=null?(n=this.customConfig)==null?void 0:n["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return s.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,d)}getTypesNamespace(e){return this.getNamespace(e,y)}getNamespace(e,t){let n=e.allParts.map(N=>N.pascalCase.safeName);return n=t!=null?[...n,t]:n,[this.rootNamespace,...n].join("\\")}getEnvironmentClassAccessFromID(e){let t=this.resolveEnvironmentName(e);if(t!=null)return s.codeblock(n=>{n.writeNode(this.getEnvironmentClassReference(t)),n.write("::"),n.write(this.getClassName(t))})}getEnvironmentClassReference(e){return s.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${o(c(this.config.organization))}`}};function F({organization:i,namespaceOverride:a}){return a!=null?a:`${o(c(i))}`}export{C as a};
2
+ //# sourceMappingURL=chunk-XX3MRTVI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/DynamicSnippetsGeneratorContext.ts"],"sourcesContent":["import {\n AbstractDynamicSnippetsGeneratorContext,\n FernGeneratorExec\n} from \"@fern-api/browser-compatible-base-generator\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { BasePhpCustomConfigSchema, getSafeClassName, php } from \"@fern-api/php-codegen\";\nimport { camelCase, upperFirst } from \"lodash-es\";\n\nimport { DynamicTypeLiteralMapper } from \"./DynamicTypeLiteralMapper\";\nimport { FilePropertyMapper } from \"./FilePropertyMapper\";\n\nconst RESERVED_METHOD_NAMES = [\"use\", \"clone\", \"list\"];\nconst REQUEST_NAMESPACE = \"Requests\";\nconst TYPES_NAMESPACE = \"Types\";\n\nexport class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext {\n public ir: FernIr.dynamic.DynamicIntermediateRepresentation;\n public customConfig: BasePhpCustomConfigSchema | undefined;\n public dynamicTypeLiteralMapper: DynamicTypeLiteralMapper;\n public filePropertyMapper: FilePropertyMapper;\n public rootNamespace: string;\n constructor({\n ir,\n config\n }: {\n ir: FernIr.dynamic.DynamicIntermediateRepresentation;\n config: FernGeneratorExec.GeneratorConfig;\n }) {\n super({ ir, config });\n this.ir = ir;\n this.customConfig =\n config.customConfig != null ? (config.customConfig as BasePhpCustomConfigSchema) : undefined;\n this.dynamicTypeLiteralMapper = new DynamicTypeLiteralMapper({ context: this });\n this.filePropertyMapper = new FilePropertyMapper({ context: this });\n this.rootNamespace = getRootNamespace({\n organization: config.organization,\n namespaceOverride: this.customConfig?.namespace\n });\n }\n\n public clone(): DynamicSnippetsGeneratorContext {\n return new DynamicSnippetsGeneratorContext({\n ir: this.ir,\n config: this.config\n });\n }\n\n public getParameterName(name: FernIr.Name): string {\n return this.prependUnderscoreIfNeeded(name.camelCase.unsafeName);\n }\n\n public getPropertyName(name: FernIr.Name): string {\n return this.prependUnderscoreIfNeeded(name.camelCase.unsafeName);\n }\n\n public getMethodName(name: FernIr.Name): string {\n // TODO: Propogate reserved keywords through IR via CasingsGenerator.\n const unsafeName = name.camelCase.unsafeName;\n if (RESERVED_METHOD_NAMES.includes(unsafeName)) {\n return unsafeName;\n }\n return name.camelCase.safeName;\n }\n\n public getClassName(name: FernIr.Name): string {\n return getSafeClassName(name.pascalCase.safeName);\n }\n\n public getRootClientClassName(): string {\n if (this.customConfig?.clientName != null) {\n return this.customConfig.clientName;\n }\n if (this.customConfig?.[\"client-class-name\"] != null) {\n return this.customConfig?.[\"client-class-name\"];\n }\n return this.getComputedClientName();\n }\n\n public getEnvironmentsClassReference(): php.ClassReference {\n return php.classReference({\n name: \"Environments\",\n namespace: this.rootNamespace\n });\n }\n\n public getRequestNamespace(fernFilepath: FernIr.dynamic.FernFilepath): string {\n return this.getNamespace(fernFilepath, REQUEST_NAMESPACE);\n }\n\n public getTypesNamespace(fernFilepath: FernIr.dynamic.FernFilepath): string {\n return this.getNamespace(fernFilepath, TYPES_NAMESPACE);\n }\n\n public getNamespace(fernFilepath: FernIr.dynamic.FernFilepath, suffix?: string): string {\n let parts = fernFilepath.allParts.map((path) => path.pascalCase.safeName);\n parts = suffix != null ? [...parts, suffix] : parts;\n return [this.rootNamespace, ...parts].join(\"\\\\\");\n }\n\n public getEnvironmentClassAccessFromID(environmentID: string): php.AstNode | undefined {\n const environmentName = this.resolveEnvironmentName(environmentID);\n if (environmentName == null) {\n return undefined;\n }\n return php.codeblock((writer) => {\n writer.writeNode(this.getEnvironmentClassReference(environmentName));\n writer.write(\"::\");\n writer.write(this.getClassName(environmentName));\n });\n }\n\n public getEnvironmentClassReference(name: FernIr.Name): php.ClassReference {\n return php.classReference({\n name: \"Environments\",\n namespace: this.rootNamespace\n });\n }\n\n private prependUnderscoreIfNeeded(input: string): string {\n // https://www.php.net/manual/en/language.variables.basics.php\n if (!/^[a-zA-Z_]/.test(input)) {\n return `_${input}`;\n }\n return input;\n }\n\n private getComputedClientName(): string {\n return `${this.getOrganizationPascalCase()}Client`;\n }\n\n private getOrganizationPascalCase(): string {\n return `${upperFirst(camelCase(this.config.organization))}`;\n }\n}\n\nfunction getRootNamespace({\n organization,\n namespaceOverride\n}: {\n organization: string;\n namespaceOverride?: string;\n}): string {\n return namespaceOverride ?? `${upperFirst(camelCase(organization))}`;\n}\n"],"mappings":"0MAAAA,IAAAC,IAWA,IAAMC,EAAwB,CAAC,MAAO,QAAS,MAAM,EAC/CC,EAAoB,WACpBC,EAAkB,QAEXC,EAAN,MAAMC,UAAwCC,CAAwC,CAMzF,YAAY,CACR,GAAAC,EACA,OAAAC,CACJ,EAGG,CA3BP,IAAAC,EA4BQ,MAAM,CAAE,GAAAF,EAAI,OAAAC,CAAO,CAAC,EAZxBE,EAAA,KAAO,MACPA,EAAA,KAAO,gBACPA,EAAA,KAAO,4BACPA,EAAA,KAAO,sBACPA,EAAA,KAAO,iBASH,KAAK,GAAKH,EACV,KAAK,aACDC,EAAO,cAAgB,KAAQA,EAAO,aAA6C,OACvF,KAAK,yBAA2B,IAAIG,EAAyB,CAAE,QAAS,IAAK,CAAC,EAC9E,KAAK,mBAAqB,IAAIC,EAAmB,CAAE,QAAS,IAAK,CAAC,EAClE,KAAK,cAAgBC,EAAiB,CAClC,aAAcL,EAAO,aACrB,mBAAmBC,EAAA,KAAK,eAAL,YAAAA,EAAmB,SAC1C,CAAC,CACL,CAEO,OAAyC,CAC5C,OAAO,IAAIJ,EAAgC,CACvC,GAAI,KAAK,GACT,OAAQ,KAAK,MACjB,CAAC,CACL,CAEO,iBAAiBS,EAA2B,CAC/C,OAAO,KAAK,0BAA0BA,EAAK,UAAU,UAAU,CACnE,CAEO,gBAAgBA,EAA2B,CAC9C,OAAO,KAAK,0BAA0BA,EAAK,UAAU,UAAU,CACnE,CAEO,cAAcA,EAA2B,CAE5C,IAAMC,EAAaD,EAAK,UAAU,WAClC,OAAIb,EAAsB,SAASc,CAAU,EAClCA,EAEJD,EAAK,UAAU,QAC1B,CAEO,aAAaA,EAA2B,CAC3C,OAAOE,EAAiBF,EAAK,WAAW,QAAQ,CACpD,CAEO,wBAAiC,CApE5C,IAAAL,EAAAQ,EAAAC,EAqEQ,QAAIT,EAAA,KAAK,eAAL,YAAAA,EAAmB,aAAc,KAC1B,KAAK,aAAa,aAEzBQ,EAAA,KAAK,eAAL,YAAAA,EAAoB,uBAAwB,MACrCC,EAAA,KAAK,eAAL,YAAAA,EAAoB,qBAExB,KAAK,sBAAsB,CACtC,CAEO,+BAAoD,CACvD,OAAOC,EAAI,eAAe,CACtB,KAAM,eACN,UAAW,KAAK,aACpB,CAAC,CACL,CAEO,oBAAoBC,EAAmD,CAC1E,OAAO,KAAK,aAAaA,EAAclB,CAAiB,CAC5D,CAEO,kBAAkBkB,EAAmD,CACxE,OAAO,KAAK,aAAaA,EAAcjB,CAAe,CAC1D,CAEO,aAAaiB,EAA2CC,EAAyB,CACpF,IAAIC,EAAQF,EAAa,SAAS,IAAKG,GAASA,EAAK,WAAW,QAAQ,EACxE,OAAAD,EAAQD,GAAU,KAAO,CAAC,GAAGC,EAAOD,CAAM,EAAIC,EACvC,CAAC,KAAK,cAAe,GAAGA,CAAK,EAAE,KAAK,IAAI,CACnD,CAEO,gCAAgCE,EAAgD,CACnF,IAAMC,EAAkB,KAAK,uBAAuBD,CAAa,EACjE,GAAIC,GAAmB,KAGvB,OAAON,EAAI,UAAWO,GAAW,CAC7BA,EAAO,UAAU,KAAK,6BAA6BD,CAAe,CAAC,EACnEC,EAAO,MAAM,IAAI,EACjBA,EAAO,MAAM,KAAK,aAAaD,CAAe,CAAC,CACnD,CAAC,CACL,CAEO,6BAA6BX,EAAuC,CACvE,OAAOK,EAAI,eAAe,CACtB,KAAM,eACN,UAAW,KAAK,aACpB,CAAC,CACL,CAEQ,0BAA0BQ,EAAuB,CAErD,MAAK,aAAa,KAAKA,CAAK,EAGrBA,EAFI,IAAIA,CAAK,EAGxB,CAEQ,uBAAgC,CACpC,MAAO,GAAG,KAAK,0BAA0B,CAAC,QAC9C,CAEQ,2BAAoC,CACxC,MAAO,GAAGC,EAAWC,EAAU,KAAK,OAAO,YAAY,CAAC,CAAC,EAC7D,CACJ,EAEA,SAAShB,EAAiB,CACtB,aAAAiB,EACA,kBAAAC,CACJ,EAGW,CACP,OAAOA,GAAA,KAAAA,EAAqB,GAAGH,EAAWC,EAAUC,CAAY,CAAC,CAAC,EACtE","names":["init_process","init_buffer","RESERVED_METHOD_NAMES","REQUEST_NAMESPACE","TYPES_NAMESPACE","DynamicSnippetsGeneratorContext","_DynamicSnippetsGeneratorContext","AbstractDynamicSnippetsGeneratorContext","ir","config","_a","__publicField","DynamicTypeLiteralMapper","FilePropertyMapper","getRootNamespace","name","unsafeName","getSafeClassName","_b","_c","php_exports","fernFilepath","suffix","parts","path","environmentID","environmentName","writer","input","upperFirst_default","camelCase_default","organization","namespaceOverride"]}
@@ -1,4 +1,4 @@
1
1
  import '@fern-api/browser-compatible-base-generator';
2
2
  import '@fern-api/dynamic-ir-sdk';
3
3
  import '@fern-api/php-codegen';
4
- export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-7JXlOyjB.js';
4
+ export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-CwkDTYOI.js';
@@ -1 +1,2 @@
1
- import{a}from"../chunk-6U4ZJ2VA.js";import"../chunk-NXBUWG6C.js";import"../chunk-H4KXMOP7.js";import"../chunk-2MVLIJOX.js";import"../chunk-JCUQ3FQP.js";export{a as DynamicSnippetsGeneratorContext};
1
+ import{a}from"../chunk-XX3MRTVI.js";import"../chunk-EECVWAVT.js";import"../chunk-3LG5WCZI.js";import"../chunk-3QAUV5WT.js";import"../chunk-PYHFKEW4.js";export{a as DynamicSnippetsGeneratorContext};
2
+ //# sourceMappingURL=DynamicSnippetsGeneratorContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
1
  import '@fern-api/dynamic-ir-sdk';
2
2
  import '@fern-api/php-codegen';
3
- export { a as DynamicTypeLiteralMapper } from '../DynamicSnippetsGeneratorContext-7JXlOyjB.js';
3
+ export { a as DynamicTypeLiteralMapper } from '../DynamicSnippetsGeneratorContext-CwkDTYOI.js';
4
4
  import '@fern-api/browser-compatible-base-generator';
@@ -1 +1,2 @@
1
- import{a}from"../chunk-NXBUWG6C.js";import"../chunk-H4KXMOP7.js";import"../chunk-JCUQ3FQP.js";export{a as DynamicTypeLiteralMapper};
1
+ import{a}from"../chunk-EECVWAVT.js";import"../chunk-3LG5WCZI.js";import"../chunk-PYHFKEW4.js";export{a as DynamicTypeLiteralMapper};
2
+ //# sourceMappingURL=DynamicTypeLiteralMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
1
  import '@fern-api/dynamic-ir-sdk';
2
2
  import '@fern-api/php-codegen';
3
- export { F as FilePropertyInfo, b as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-7JXlOyjB.js';
3
+ export { F as FilePropertyInfo, b as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-CwkDTYOI.js';
4
4
  import '@fern-api/browser-compatible-base-generator';
@@ -1 +1,2 @@
1
- import{a}from"../chunk-2MVLIJOX.js";import"../chunk-JCUQ3FQP.js";export{a as FilePropertyMapper};
1
+ import{a}from"../chunk-3QAUV5WT.js";import"../chunk-PYHFKEW4.js";export{a as FilePropertyMapper};
2
+ //# sourceMappingURL=FilePropertyMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/esm/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { DynamicSnippetsGenerator } from './DynamicSnippetsGenerator.js';
2
2
  import '@fern-api/browser-compatible-base-generator';
3
3
  import '@fern-api/dynamic-ir-sdk';
4
- import './EndpointSnippetGenerator.js';
5
- import './DynamicSnippetsGeneratorContext-7JXlOyjB.js';
4
+ import './DynamicSnippetsGeneratorContext-CwkDTYOI.js';
6
5
  import '@fern-api/php-codegen';
6
+ import './EndpointSnippetGenerator.js';
package/esm/index.js CHANGED
@@ -1,13 +1,2 @@
1
- import{a as yu}from"./chunk-AEXR2D5H.js";import"./chunk-ESPGWZRY.js";import"./chunk-6U4ZJ2VA.js";import"./chunk-NXBUWG6C.js";import"./chunk-H4KXMOP7.js";import"./chunk-2MVLIJOX.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-JCUQ3FQP.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 m,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?m:O(Uint8Array),J={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?m:ArrayBuffer,"%ArrayIteratorPrototype%":Z&&O?O([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%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%":qu,"%eval%":eval,"%EvalError%":xu,"%Float32Array%":typeof Float32Array=="undefined"?m:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?m:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?m:FinalizationRegistry,"%Function%":sn,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array=="undefined"?m:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?m:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Z&&O?O(O([][Symbol.iterator]())):m,"%JSON%":typeof JSON=="object"?JSON:m,"%Map%":typeof Map=="undefined"?m:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Z||!O?m:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?m:Promise,"%Proxy%":typeof Proxy=="undefined"?m:Proxy,"%RangeError%":$u,"%ReferenceError%":Iu,"%Reflect%":typeof Reflect=="undefined"?m:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?m:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Z||!O?m:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Z&&O?O(""[Symbol.iterator]()):m,"%Symbol%":Z?Symbol:m,"%SyntaxError%":tr,"%ThrowTypeError%":Tu,"%TypedArray%":Nu,"%TypeError%":er,"%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%":Fu,"%WeakMap%":typeof WeakMap=="undefined"?m:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?m:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?m: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 b,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?b:E(Uint8Array),H={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?b:ArrayBuffer,"%ArrayIteratorPrototype%":nr&&E?E([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":or,"%AsyncGenerator%":or,"%AsyncGeneratorFunction%":or,"%AsyncIteratorPrototype%":or,"%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%":ef,"%eval%":eval,"%EvalError%":tf,"%Float32Array%":typeof Float32Array=="undefined"?b:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?b:FinalizationRegistry,"%Function%":uo,"%GeneratorFunction%":or,"%Int8Array%":typeof Int8Array=="undefined"?b:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?b:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nr&&E?E(E([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map=="undefined"?b:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!nr||!E?b:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":rf,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?b:Promise,"%Proxy%":typeof Proxy=="undefined"?b:Proxy,"%RangeError%":nf,"%ReferenceError%":of,"%Reflect%":typeof Reflect=="undefined"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?b:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!nr||!E?b:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nr&&E?E(""[Symbol.iterator]()):b,"%Symbol%":nr?Symbol:b,"%SyntaxError%":ar,"%ThrowTypeError%":gf,"%TypedArray%":mf,"%TypeError%":ir,"%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%":af,"%WeakMap%":typeof WeakMap=="undefined"?b:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?b:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?b: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,"&quot;")}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};
1
+ import{a as n}from"./chunk-DFQIKN25.js";import"./chunk-CPIHNCS3.js";import"./chunk-XX3MRTVI.js";import"./chunk-EECVWAVT.js";import"./chunk-3LG5WCZI.js";import"./chunk-3QAUV5WT.js";import{f as e,g as r}from"./chunk-PYHFKEW4.js";e();r();export{n as DynamicSnippetsGenerator};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { DynamicSnippetsGenerator } from \"./DynamicSnippetsGenerator\";\n"],"mappings":"mOAAAA,IAAAC","names":["init_process","init_buffer"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/php-dynamic-snippets",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",
@@ -1,14 +0,0 @@
1
- import{a as S}from"./chunk-NXBUWG6C.js";import{c as R}from"./chunk-H4KXMOP7.js";import{a as A}from"./chunk-2MVLIJOX.js";import{j as n,k as r,m as t,p as g}from"./chunk-JCUQ3FQP.js";r();t();r();t();r();t();r();t();r();t();r();t();r();t();var ve=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,N=ve;var Ie=typeof self=="object"&&self&&self.Object===Object&&self,Oe=N||Ie||Function("return this")(),v=Oe;var Ee=v.Symbol,l=Ee;r();t();var I=Object.prototype,Te=I.hasOwnProperty,je=I.toString,c=l?l.toStringTag:void 0;function Me(e){var a=Te.call(e,c),o=e[c];try{e[c]=void 0;var u=!0}catch(d){}var f=je.call(e);return u&&(a?e[c]=o:delete e[c]),f}var O=Me;r();t();var we=Object.prototype,We=we.toString;function Fe(e){return We.call(e)}var E=Fe;var Le="[object Null]",ke="[object Undefined]",T=l?l.toStringTag:void 0;function Ue(e){return e==null?e===void 0?ke:Le:T&&T in Object(e)?O(e):E(e)}var j=Ue;r();t();function Pe(e){return e!=null&&typeof e=="object"}var M=Pe;var ze="[object Symbol]";function Be(e){return typeof e=="symbol"||M(e)&&j(e)==ze}var w=Be;r();t();r();t();function De(e,a){for(var o=-1,u=e==null?0:e.length,f=Array(u);++o<u;)f[o]=a(e[o],o,e);return f}var W=De;r();t();var Ze=Array.isArray,F=Ze;var qe=1/0,L=l?l.prototype:void 0,k=L?L.toString:void 0;function U(e){if(typeof e=="string")return e;if(F(e))return W(e,U)+"";if(w(e))return k?k.call(e):"";var a=e+"";return a=="0"&&1/e==-qe?"-0":a}var P=U;r();t();function Ge(e){return e==null?"":P(e)}var m=Ge;r();t();r();t();r();t();r();t();r();t();r();t();function He(e,a,o){var u=-1,f=e.length;a<0&&(a=-a>f?0:f+a),o=o>f?f:o,o<0&&(o+=f),f=a>o?0:o-a>>>0,a>>>=0;for(var d=Array(f);++u<f;)d[u]=e[u+a];return d}var z=He;function Ve(e,a,o){var u=e.length;return o=o===void 0?u:o,!a&&o>=u?e:z(e,a,o)}var B=Ve;r();t();var Je="\\ud800-\\udfff",_e="\\u0300-\\u036f",$e="\\ufe20-\\ufe2f",Ke="\\u20d0-\\u20ff",Ye=_e+$e+Ke,Qe="\\ufe0e\\ufe0f",Xe="\\u200d",er=RegExp("["+Xe+Je+Ye+Qe+"]");function rr(e){return er.test(e)}var b=rr;r();t();r();t();function tr(e){return e.split("")}var D=tr;r();t();var Z="\\ud800-\\udfff",or="\\u0300-\\u036f",ar="\\ufe20-\\ufe2f",fr="\\u20d0-\\u20ff",ur=or+ar+fr,sr="\\ufe0e\\ufe0f",pr="["+Z+"]",y="["+ur+"]",C="\\ud83c[\\udffb-\\udfff]",lr="(?:"+y+"|"+C+")",q="[^"+Z+"]",G="(?:\\ud83c[\\udde6-\\uddff]){2}",H="[\\ud800-\\udbff][\\udc00-\\udfff]",dr="\\u200d",V=lr+"?",J="["+sr+"]?",mr="(?:"+dr+"(?:"+[q,G,H].join("|")+")"+J+V+")*",nr=J+V+mr,ir="(?:"+[q+y+"?",y,G,H,pr].join("|")+")",xr=RegExp(C+"(?="+C+")|"+ir+nr,"g");function cr(e){return e.match(xr)||[]}var _=cr;function gr(e){return b(e)?_(e):D(e)}var $=gr;function br(e){return function(a){a=m(a);var o=b(a)?$(a):void 0,u=o?o[0]:a.charAt(0),f=o?B(o,1).join(""):a.slice(1);return u[e]()+f}}var K=br;var hr=K("toUpperCase"),i=hr;function yr(e){return i(m(e).toLowerCase())}var Y=yr;r();t();r();t();function Cr(e,a,o,u){var f=-1,d=e==null?0:e.length;for(u&&d&&(o=e[++f]);++f<d;)o=a(o,e[f],f,e);return o}var Q=Cr;r();t();r();t();r();t();function Rr(e){return function(a){return e==null?void 0:e[a]}}var X=Rr;var Sr={\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"},Ar=X(Sr),ee=Ar;var Nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vr="\\u0300-\\u036f",Ir="\\ufe20-\\ufe2f",Or="\\u20d0-\\u20ff",Er=vr+Ir+Or,Tr="["+Er+"]",jr=RegExp(Tr,"g");function Mr(e){return e=m(e),e&&e.replace(Nr,ee).replace(jr,"")}var re=Mr;r();t();r();t();var wr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Wr(e){return e.match(wr)||[]}var te=Wr;r();t();var Fr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Lr(e){return Fr.test(e)}var oe=Lr;r();t();var pe="\\ud800-\\udfff",kr="\\u0300-\\u036f",Ur="\\ufe20-\\ufe2f",Pr="\\u20d0-\\u20ff",zr=kr+Ur+Pr,le="\\u2700-\\u27bf",de="a-z\\xdf-\\xf6\\xf8-\\xff",Br="\\xac\\xb1\\xd7\\xf7",Dr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Zr="\\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",me="A-Z\\xc0-\\xd6\\xd8-\\xde",Gr="\\ufe0e\\ufe0f",ne=Br+Dr+Zr+qr,ie="['\u2019]",ae="["+ne+"]",Hr="["+zr+"]",xe="\\d+",Vr="["+le+"]",ce="["+de+"]",ge="[^"+pe+ne+xe+le+de+me+"]",Jr="\\ud83c[\\udffb-\\udfff]",_r="(?:"+Hr+"|"+Jr+")",$r="[^"+pe+"]",be="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",x="["+me+"]",Kr="\\u200d",fe="(?:"+ce+"|"+ge+")",Yr="(?:"+x+"|"+ge+")",ue="(?:"+ie+"(?:d|ll|m|re|s|t|ve))?",se="(?:"+ie+"(?:D|LL|M|RE|S|T|VE))?",ye=_r+"?",Ce="["+Gr+"]?",Qr="(?:"+Kr+"(?:"+[$r,be,he].join("|")+")"+Ce+ye+")*",Xr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",et="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rt=Ce+ye+Qr,tt="(?:"+[Vr,be,he].join("|")+")"+rt,ot=RegExp([x+"?"+ce+"+"+ue+"(?="+[ae,x,"$"].join("|")+")",Yr+"+"+se+"(?="+[ae,x+fe,"$"].join("|")+")",x+"?"+fe+"+"+ue,x+"+"+se,et,Xr,xe,tt].join("|"),"g");function at(e){return e.match(ot)||[]}var Re=at;function ft(e,a,o){return e=m(e),a=o?void 0:a,a===void 0?oe(e)?Re(e):te(e):e.match(a)||[]}var Se=ft;var ut="['\u2019]",st=RegExp(ut,"g");function pt(e){return function(a){return Q(Se(re(a).replace(st,"")),e,"")}}var Ae=pt;var lt=Ae(function(e,a,o){return a=a.toLowerCase(),e+(o?Y(a):a)}),h=lt;var dt=["use","clone","list"],mt="Requests",nt="Types",Ne=class e extends R{constructor({ir:o,config:u}){var f;super({ir:o,config:u});n(this,"ir");n(this,"customConfig");n(this,"dynamicTypeLiteralMapper");n(this,"filePropertyMapper");n(this,"rootNamespace");this.ir=o,this.customConfig=u.customConfig!=null?u.customConfig:void 0,this.dynamicTypeLiteralMapper=new S({context:this}),this.filePropertyMapper=new A({context:this}),this.rootNamespace=it({organization:u.organization,namespaceOverride:(f=this.customConfig)==null?void 0:f.namespace})}clone(){return new e({ir:this.ir,config:this.config})}getParameterName(o){return this.prependUnderscoreIfNeeded(o.camelCase.unsafeName)}getPropertyName(o){return this.prependUnderscoreIfNeeded(o.camelCase.unsafeName)}getMethodName(o){let u=o.camelCase.unsafeName;return dt.includes(u)?u:o.camelCase.safeName}getClassName(o){return o.pascalCase.safeName}getRootClientClassName(){var o,u,f;return((o=this.customConfig)==null?void 0:o.clientName)!=null?this.customConfig.clientName:((u=this.customConfig)==null?void 0:u["client-class-name"])!=null?(f=this.customConfig)==null?void 0:f["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return g.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(o){return this.getNamespace(o,mt)}getTypesNamespace(o){return this.getNamespace(o,nt)}getNamespace(o,u){let f=o.allParts.map(d=>d.pascalCase.safeName);return f=u!=null?[...f,u]:f,[this.rootNamespace,...f].join("\\")}getEnvironmentClassAccessFromID(o){let u=this.resolveEnvironmentName(o);if(u!=null)return g.codeblock(f=>{f.writeNode(this.getEnvironmentClassReference(u)),f.write("::"),f.write(this.getClassName(u))})}getEnvironmentClassReference(o){return g.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(o){return/^[a-zA-Z_]/.test(o)?o:`_${o}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${i(h(this.config.organization))}`}};function it({organization:e,namespaceOverride:a}){return a!=null?a:`${i(h(e))}`}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
- */
@@ -1 +0,0 @@
1
- import{a as p}from"./chunk-ESPGWZRY.js";import{a as i}from"./chunk-6U4ZJ2VA.js";import{a as t}from"./chunk-H4KXMOP7.js";import{k as n,m as r}from"./chunk-JCUQ3FQP.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};
@@ -1,3 +0,0 @@
1
- import{b as o,d as c}from"./chunk-H4KXMOP7.js";import{j as P,k as v,m as x,n as p,p as s}from"./chunk-JCUQ3FQP.js";v();x();var I="$client",f="Example",R=`<?php
2
-
3
- `,A=class{constructor({context:e}){P(this,"context");this.context=e}async generateSnippet({endpoint:e,request:t}){var n;let r=this.buildCodeBlock({endpoint:e,snippet:t});return R+await r.toStringAsync({namespace:f,rootNamespace:f,customConfig:(n=this.context.customConfig)!=null?n:{}})}generateSnippetSync({endpoint:e,request:t}){var n;let r=this.buildCodeBlock({endpoint:e,snippet:t});return R+r.toString({namespace:f,rootNamespace:f,customConfig:(n=this.context.customConfig)!=null?n:{}})}buildCodeBlock({endpoint:e,snippet:t}){return s.codeblock(r=>{r.writeNodeStatement(this.constructClient({endpoint:e,snippet:t})),r.writeNodeStatement(this.callMethod({endpoint:e,snippet:t}))})}constructClient({endpoint:e,snippet:t}){return s.codeblock(r=>{r.write(`${I} = `),r.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:e,snippet:t})))})}callMethod({endpoint:e,snippet:t}){return s.invokeMethod({on:s.codeblock(I),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:t}),multiline:!0})}getConstructorArgs({endpoint:e,snippet:t}){let r=[];e.auth!=null&&(t.auth!=null?r.push(...this.getConstructorAuthArgs({auth:e.auth,values:t.auth})):this.context.errors.add({severity:o.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let n=[],a=this.getConstructorBaseUrlArgs({baseUrl:t.baseURL,environment:t.environment});return a.length>0&&n.push(...a),this.context.errors.scope(c.Headers),this.context.ir.headers!=null&&t.headers!=null&&n.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),n.length===0?r:[...r,{name:"options",assignment:s.TypeLiteral.map({entries:n.map(i=>({key:s.TypeLiteral.string(i.name),value:i.value}))})}]}getConstructorAuthArgs({auth:e,values:t}){switch(e.type){case"basic":return t.type!=="basic"?(this.context.errors.add({severity:o.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorBasicAuthArgs({auth:e,values:t});case"bearer":return t.type!=="bearer"?(this.context.errors.add({severity:o.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:o.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:o.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):(this.context.errors.add({severity:o.Warning,message:"The PHP SDK doesn't support OAuth client credentials yet"}),[]);default:p(e)}}getConstructorBasicAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.username),assignment:s.TypeLiteral.string(t.username)},{name:this.context.getPropertyName(e.password),assignment:s.TypeLiteral.string(t.password)}]}getConstructorBaseUrlArgs({baseUrl:e,environment:t}){let r=this.getBaseUrlArg({baseUrl:e,environment:t});return s.TypeLiteral.isNop(r)?[]:[{name:"baseUrl",value:r}]}getBaseUrlArg({baseUrl:e,environment:t}){if(e!=null&&t!=null)return this.context.errors.add({severity:o.Critical,message:"Cannot specify both baseUrl and environment options"}),s.TypeLiteral.nop();if(e!=null)return s.TypeLiteral.string(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let r=this.context.getEnvironmentClassAccessFromID(t);return r==null?(this.context.errors.add({severity:o.Warning,message:`Environment ${JSON.stringify(t)} was not found`}),s.TypeLiteral.nop()):s.TypeLiteral.reference(s.codeblock(n=>{n.writeNode(r),n.write("->value")}))}this.context.isMultiEnvironmentValues(t)&&this.context.errors.add({severity:o.Warning,message:"The PHP SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}return s.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.token),assignment:s.TypeLiteral.string(t.token)}]}getConstructorHeaderAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:t.value})}]}getConstructorHeaderArgs({headers:e,values:t}){let r=[];for(let n of e){let a=this.getConstructorHeaderArg({header:n,value:t.value});a!=null&&r.push({name:this.context.getPropertyName(n.name.name),value:a})}return r}getConstructorHeaderArg({header:e,value:t}){let r=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:t});if(!s.TypeLiteral.isNop(r))return r}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:p(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:t}){var a,i;let r=[];this.context.errors.scope(c.PathParameters);let n=[...(a=this.context.ir.pathParameters)!=null?a:[],...(i=e.pathParameters)!=null?i:[]];return n.length>0&&r.push(...this.getPathParameters({namedParameters:n,snippet:t}).map(h=>h.value)),this.context.errors.unscope(),this.context.errors.scope(c.RequestBody),e.body!=null&&r.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope(),r}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t});default:p(e)}}getBytesBodyRequestArg({value:e}){return this.context.errors.add({severity:o.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),s.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:e,snippet:t}){var m,y,d,u;let r=[],n=(y=(m=this.context.customConfig)==null?void 0:m.inlinePathParameters)!=null?y:!1;this.context.errors.scope(c.PathParameters);let a=[],i=[...(d=this.context.ir.pathParameters)!=null?d:[],...(u=e.pathParameters)!=null?u:[]];i.length>0&&a.push(...this.getPathParameters({namedParameters:i,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(c.RequestBody);let h=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:n})||r.push(...a.map(g=>g.value)),this.context.needsRequestParameter({request:e,inlinePathParameters:n,inlineFileProperties:!0})&&r.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:n})?a:[],filePropertyInfo:h})),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})}getInlinedRequestArg({request:e,snippet:t,pathParameterFields:r,filePropertyInfo:n}){var d,u,g,F;this.context.errors.scope(c.QueryParameters);let i=this.context.associateQueryParametersByWireValue({parameters:(d=e.queryParameters)!=null?d:[],values:(u=t.queryParameters)!=null?u:{}}).map(l=>({name:this.context.getPropertyName(l.name.name),value:this.context.dynamicTypeLiteralMapper.convert(l)}));this.context.errors.unscope(),this.context.errors.scope(c.Headers);let m=this.context.associateByWireValue({parameters:(g=e.headers)!=null?g:[],values:(F=t.headers)!=null?F:{}}).map(l=>({name:this.context.getPropertyName(l.name.name),value:this.context.dynamicTypeLiteralMapper.convert(l)}));this.context.errors.unscope(),this.context.errors.scope(c.RequestBody);let y=e.body!=null?this.getInlinedRequestBodyConstructorFields({body:e.body,value:t.requestBody,filePropertyInfo:n}):[];return this.context.errors.unscope(),s.TypeLiteral.class_({reference:s.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getRequestNamespace(e.declaration.fernFilepath)}),fields:[...r,...i,...m,...y]})}getInlinedRequestBodyConstructorFields({body:e,value:t,filePropertyInfo:r}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:r});default:p(e)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:e}){return[...e.fileFields,...e.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:e,value:t}){return{name:this.context.getPropertyName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyTypeLiteral({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t});default:p(e)}}getInlinedRequestBodyPropertyConstructorFields({parameters:e,value:t}){var a;let r=[],n=this.context.associateByWireValue({parameters:e,values:(a=this.context.getRecord(t))!=null?a:{}});for(let i of n)r.push({name:this.context.getPropertyName(i.name.name),value:this.context.dynamicTypeLiteralMapper.convert(i)});return r}getPathParameters({namedParameters:e,snippet:t}){var a;let r=[],n=this.context.associateByWireValue({parameters:e,values:(a=t.pathParameters)!=null?a:{}});for(let i of n)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.getPropertyName(t)).join("->")}->${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getRootClientClassInstantiation(e){return s.instantiateClass({classReference:s.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:e,multiline:!0})}};export{A as a};
@@ -1 +0,0 @@
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 f,o as E}from"./chunk-JCUQ3FQP.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.reporter==null||this.reporter.size()>e.errors.size())&&(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}"`)}};var R=class{constructor(e){a(this,"context");this.context=e}async generate(e){let r=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let t=new y;for(let n of r){let i=this.context.clone(),u=this.createSnippetGenerator(i);try{let o=await u.generateSnippet({endpoint:n,request:e});if(i.errors.empty())return{snippet:o,errors:void 0};t.update({context:i,snippet:o})}catch(o){t.err==null&&(t.err=o)}}return t.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e){let r=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let t=new y;for(let n of r){let i=this.context.clone(),u=this.createSnippetGenerator(i);try{let o=u.generateSnippetSync({endpoint:n,request:e});if(i.errors.empty())return{snippet:o,errors:void 0};t.update({context:i,snippet:o})}catch(o){t.err==null&&(t.err=o)}}return t.getResponseOrThrow({endpoint:e.endpoint})}};p();l();var s={Critical:"CRITICAL",Warning:"WARNING"},g=class h{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 h;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}){a(this,"config");a(this,"errors");a(this,"_ir");a(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,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 u=e.find(m=>m.name.wireValue===n);if(u==null)throw this.newParameterNotRecognizedError(n);let o=this.isListTypeReference(u.typeReference)&&!Array.isArray(i)?[i]:i;t.push({name:u.name,typeReference:u.typeReference,value:o})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let n=[];for(let[i,u]of Object.entries(r)){this.errors.scope(i);try{let o=e.find(m=>m.name.wireValue===i);if(o==null){if(t)continue;this.errors.add({severity:s.Critical,message:this.newParameterNotRecognizedError(i).message});continue}n.push({name:o.name,typeReference:o.typeReference,value:u})}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:s.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:s.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:s.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:s.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:s.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:s.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof i!="string"){this.errors.add({severity:s.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let u=e.types[i];if(u==null){this.errors.add({severity:s.Critical,message:`No type found for discriminant value "${i}"`});return}let x=t,{[n]:o}=x,m=b(x,[S(n)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.discriminantValue,value:m}}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:f(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:f(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:s.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:s.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:s.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:s.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:s.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:s.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:s.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:f(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:f(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:f(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,s as b,w as c,A as d};
@@ -1,28 +0,0 @@
1
- var lt=Object.create;var ae=Object.defineProperty,ht=Object.defineProperties,pt=Object.getOwnPropertyDescriptor,mt=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertyNames,he=Object.getOwnPropertySymbols,wt=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var ve=(r,t,e)=>t in r?ae(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,pe=(r,t)=>{for(var e in t||(t={}))Ne.call(t,e)&&ve(r,e,t[e]);if(he)for(var e of he(t))Ce.call(t,e)&&ve(r,e,t[e]);return r},me=(r,t)=>ht(r,mt(t));var Hr=r=>typeof r=="symbol"?r:r+"",Qr=(r,t)=>{var e={};for(var i in r)Ne.call(r,i)&&t.indexOf(i)<0&&(e[i]=r[i]);if(r!=null&&he)for(var i of he(r))t.indexOf(i)<0&&Ce.call(r,i)&&(e[i]=r[i]);return e};var Le=(r,t)=>()=>(r&&(t=r(r=0)),t);var jr=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),xt=(r,t)=>{for(var e in t)ae(r,e,{get:t[e],enumerable:!0})},Se=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of dt(t))!Ne.call(r,n)&&n!==e&&ae(r,n,{get:()=>t[n],enumerable:!(i=pt(t,n))||i.enumerable});return r};var Xr=(r,t,e)=>(e=r!=null?lt(wt(r)):{},Se(t||!r||!r.__esModule?ae(e,"default",{value:r,enumerable:!0}):e,r)),Zr=r=>Se(ae({},"__esModule",{value:!0}),r);var f=(r,t,e)=>ve(r,typeof t!="symbol"?t+"":t,e);function Ue(){throw new Error("setTimeout has not been defined")}function Pe(){throw new Error("clearTimeout has not been defined")}function Me(r){if(Y===setTimeout)return setTimeout(r,0);if((Y===Ue||!Y)&&setTimeout)return Y=setTimeout,setTimeout(r,0);try{return Y(r,0)}catch(t){try{return Y.call(null,r,0)}catch(e){return Y.call(this,r,0)}}}function yt(r){if(F===clearTimeout)return clearTimeout(r);if((F===Pe||!F)&&clearTimeout)return F=clearTimeout,clearTimeout(r);try{return F(r)}catch(t){try{return F.call(null,r)}catch(e){return F.call(this,r)}}}function gt(){!se||!q||(se=!1,q.length?B=q.concat(B):de=-1,B.length&&$e())}function $e(){if(!se){var r=Me(gt);se=!0;for(var t=B.length;t;){for(q=B,B=[];++de<t;)q&&q[de].run();de=-1,t=B.length}q=null,se=!1,yt(r)}}function Tt(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];B.push(new De(r,t)),B.length===1&&!se&&Me($e)}function De(r,t){this.fun=r,this.array=t}function G(){}function $t(r){throw new Error("process.binding is not supported")}function Dt(){return"/"}function Ot(r){throw new Error("process.chdir is not supported")}function Yt(){return 0}function Wt(r){var t=Ft.call(ne)*.001,e=Math.floor(t),i=Math.floor(t%1*1e9);return r&&(e=e-r[0],i=i-r[1],i<0&&(e--,i+=1e9)),[e,i]}function zt(){var r=new Date,t=r-Vt;return t/1e3}var Y,F,B,se,q,de,At,Et,vt,Nt,Lt,It,_t,Rt,kt,bt,Ct,St,Bt,Ut,Pt,Mt,ne,Ft,Vt,d,Be,u=Le(()=>{"use strict";Y=Ue,F=Pe;typeof globalThis.setTimeout=="function"&&(Y=setTimeout);typeof globalThis.clearTimeout=="function"&&(F=clearTimeout);B=[],se=!1,de=-1;De.prototype.run=function(){this.fun.apply(null,this.array)};At="browser",Et="browser",vt=!0,Nt={},Lt=[],It="",_t={},Rt={},kt={};bt=G,Ct=G,St=G,Bt=G,Ut=G,Pt=G,Mt=G;ne=globalThis.performance||{},Ft=ne.now||ne.mozNow||ne.msNow||ne.oNow||ne.webkitNow||function(){return new Date().getTime()};Vt=new Date;d={nextTick:Tt,title:At,browser:vt,env:Nt,argv:Lt,version:It,versions:_t,on:bt,addListener:Ct,once:St,off:Bt,removeListener:Ut,removeAllListeners:Pt,emit:Mt,binding:$t,cwd:Dt,chdir:Ot,umask:Yt,hrtime:Wt,platform:Et,release:Rt,config:kt,uptime:zt},Be={};Object.keys(Be).forEach(r=>{let t=r.split("."),e=d;for(let i=0;i<t.length;i++){let n=t[i];i===t.length-1?e[n]=Be[r]:e=e[n]||(e[n]={})}})});function We(){_e=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)R[t]=r[t],N[r.charCodeAt(t)]=t;N[45]=62,N[95]=63}function Gt(r){_e||We();var t,e,i,n,s,o,c=r.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=r[c-2]==="="?2:r[c-1]==="="?1:0,o=new qt(c*3/4-s),i=s>0?c-4:c;var h=0;for(t=0,e=0;t<i;t+=4,e+=3)n=N[r.charCodeAt(t)]<<18|N[r.charCodeAt(t+1)]<<12|N[r.charCodeAt(t+2)]<<6|N[r.charCodeAt(t+3)],o[h++]=n>>16&255,o[h++]=n>>8&255,o[h++]=n&255;return s===2?(n=N[r.charCodeAt(t)]<<2|N[r.charCodeAt(t+1)]>>4,o[h++]=n&255):s===1&&(n=N[r.charCodeAt(t)]<<10|N[r.charCodeAt(t+1)]<<4|N[r.charCodeAt(t+2)]>>2,o[h++]=n>>8&255,o[h++]=n&255),o}function Jt(r){return R[r>>18&63]+R[r>>12&63]+R[r>>6&63]+R[r&63]}function Ht(r,t,e){for(var i,n=[],s=t;s<e;s+=3)i=(r[s]<<16)+(r[s+1]<<8)+r[s+2],n.push(Jt(i));return n.join("")}function Oe(r){_e||We();for(var t,e=r.length,i=e%3,n="",s=[],o=16383,c=0,h=e-i;c<h;c+=o)s.push(Ht(r,c,c+o>h?h:c+o));return i===1?(t=r[e-1],n+=R[t>>2],n+=R[t<<4&63],n+="=="):i===2&&(t=(r[e-2]<<8)+r[e-1],n+=R[t>>10],n+=R[t>>4&63],n+=R[t<<2&63],n+="="),s.push(n),s.join("")}function we(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(r,t){if(we()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=a.prototype):(r===null&&(r=new a(t)),r.length=t),r}function a(r,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Re(this,r)}return Ve(this,r,t,e)}function Ve(r,t,e,i){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Xt(r,t,e,i):typeof t=="string"?jt(r,t,e):Zt(r,t)}function ze(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Qt(r,t,e,i){return ze(t),t<=0?U(r,t):e!==void 0?typeof i=="string"?U(r,t).fill(e,i):U(r,t).fill(e):U(r,t)}function Re(r,t){if(ze(t),r=U(r,t<0?0:ke(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function jt(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=qe(t,e)|0;r=U(r,i);var n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}function Ie(r,t){var e=t.length<0?0:ke(t.length)|0;r=U(r,e);for(var i=0;i<e;i+=1)r[i]=t[i]&255;return r}function Xt(r,t,e,i){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?t=new Uint8Array(t):i===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,i),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=Ie(r,t),r}function Zt(r,t){if(k(t)){var e=ke(t.length)|0;return r=U(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||xr(t.length)?U(r,0):Ie(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ie(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ke(r){if(r>=we())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+we().toString(16)+" bytes");return r|0}function k(r){return!!(r!=null&&r._isBuffer)}function qe(r,t){if(k(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return xe(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ze(r).length;default:if(i)return xe(r).length;t=(""+t).toLowerCase(),i=!0}}function Kt(r,t,e){var i=!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(r||(r="utf8");;)switch(r){case"hex":return cr(this,t,e);case"utf8":case"utf-8":return He(this,t,e);case"ascii":return ar(this,t,e);case"latin1":case"binary":return fr(this,t,e);case"base64":return sr(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ur(this,t,e);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}function J(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}function Ge(r,t,e,i,n){if(r.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(n)return-1;e=r.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,i)),k(t))return t.length===0?-1:Ye(r,t,e,i,n);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ye(r,[t],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Ye(r,t,e,i,n){var s=1,o=r.length,c=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||t.length<2)return-1;s=2,o/=2,c/=2,e/=2}function h(E,ie){return s===1?E[ie]:E.readUInt16BE(ie*s)}var m;if(n){var w=-1;for(m=e;m<o;m++)if(h(r,m)===h(t,w===-1?0:m-w)){if(w===-1&&(w=m),m-w+1===c)return w*s}else w!==-1&&(m-=m-w),w=-1}else for(e+c>o&&(e=o-c),m=e;m>=0;m--){for(var x=!0,L=0;L<c;L++)if(h(r,m+L)!==h(t,L)){x=!1;break}if(x)return m}return-1}function er(r,t,e,i){e=Number(e)||0;var n=r.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o<i;++o){var c=parseInt(t.substr(o*2,2),16);if(isNaN(c))return o;r[e+o]=c}return o}function tr(r,t,e,i){return Te(xe(t,r.length-e),r,e,i)}function Je(r,t,e,i){return Te(dr(t),r,e,i)}function rr(r,t,e,i){return Je(r,t,e,i)}function ir(r,t,e,i){return Te(Ze(t),r,e,i)}function nr(r,t,e,i){return Te(wr(t,r.length-e),r,e,i)}function sr(r,t,e){return t===0&&e===r.length?Oe(r):Oe(r.slice(t,e))}function He(r,t,e){e=Math.min(r.length,e);for(var i=[],n=t;n<e;){var s=r[n],o=null,c=s>239?4:s>223?3:s>191?2:1;if(n+c<=e){var h,m,w,x;switch(c){case 1:s<128&&(o=s);break;case 2:h=r[n+1],(h&192)===128&&(x=(s&31)<<6|h&63,x>127&&(o=x));break;case 3:h=r[n+1],m=r[n+2],(h&192)===128&&(m&192)===128&&(x=(s&15)<<12|(h&63)<<6|m&63,x>2047&&(x<55296||x>57343)&&(o=x));break;case 4:h=r[n+1],m=r[n+2],w=r[n+3],(h&192)===128&&(m&192)===128&&(w&192)===128&&(x=(s&15)<<18|(h&63)<<12|(m&63)<<6|w&63,x>65535&&x<1114112&&(o=x))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=c}return or(i)}function or(r){var t=r.length;if(t<=Fe)return String.fromCharCode.apply(String,r);for(var e="",i=0;i<t;)e+=String.fromCharCode.apply(String,r.slice(i,i+=Fe));return e}function ar(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]&127);return i}function fr(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]);return i}function cr(r,t,e){var i=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>i)&&(e=i);for(var n="",s=t;s<e;++s)n+=mr(r[s]);return n}function ur(r,t,e){for(var i=r.slice(t,e),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}function y(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function A(r,t,e,i,n,s){if(!k(r))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+i>r.length)throw new RangeError("Index out of range")}function ye(r,t,e,i){t<0&&(t=65535+t+1);for(var n=0,s=Math.min(r.length-e,2);n<s;++n)r[e+n]=(t&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}function ge(r,t,e,i){t<0&&(t=4294967295+t+1);for(var n=0,s=Math.min(r.length-e,4);n<s;++n)r[e+n]=t>>>(i?n:3-n)*8&255}function Qe(r,t,e,i,n,s){if(e+i>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function je(r,t,e,i,n){return n||Qe(r,t,e,4,34028234663852886e22,-34028234663852886e22),et(r,t,e,i,23,4),e+4}function Xe(r,t,e,i,n){return n||Qe(r,t,e,8,17976931348623157e292,-17976931348623157e292),et(r,t,e,i,52,8),e+8}function hr(r){if(r=pr(r).replace(lr,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function pr(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function mr(r){return r<16?"0"+r.toString(16):r.toString(16)}function xe(r,t){t=t||1/0;for(var e,i=r.length,n=null,s=[],o=0;o<i;++o){if(e=r.charCodeAt(o),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(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 dr(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function wr(r,t){for(var e,i,n,s=[],o=0;o<r.length&&!((t-=2)<0);++o)e=r.charCodeAt(o),i=e>>8,n=e%256,s.push(n),s.push(i);return s}function Ze(r){return Gt(hr(r))}function Te(r,t,e,i){for(var n=0;n<i&&!(n+e>=t.length||n>=r.length);++n)t[n+e]=r[n];return n}function xr(r){return r!==r}function yr(r){return r!=null&&(!!r._isBuffer||Ke(r)||gr(r))}function Ke(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function gr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ke(r.slice(0,0))}function Ae(r,t,e,i,n){var s,o,c=n*8-i-1,h=(1<<c)-1,m=h>>1,w=-7,x=e?n-1:0,L=e?-1:1,E=r[t+x];for(x+=L,s=E&(1<<-w)-1,E>>=-w,w+=c;w>0;s=s*256+r[t+x],x+=L,w-=8);for(o=s&(1<<-w)-1,s>>=-w,w+=i;w>0;o=o*256+r[t+x],x+=L,w-=8);if(s===0)s=1-m;else{if(s===h)return o?NaN:(E?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-m}return(E?-1:1)*o*Math.pow(2,s-i)}function et(r,t,e,i,n,s){var o,c,h,m=s*8-n-1,w=(1<<m)-1,x=w>>1,L=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=i?0:s-1,ie=i?1:-1,ut=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,o=w):(o=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-o))<1&&(o--,h*=2),o+x>=1?t+=L/h:t+=L*Math.pow(2,1-x),t*h>=2&&(o++,h/=2),o+x>=w?(c=0,o=w):o+x>=1?(c=(t*h-1)*Math.pow(2,n),o=o+x):(c=t*Math.pow(2,x-1)*Math.pow(2,n),o=0));n>=8;r[e+E]=c&255,E+=ie,c/=256,n-=8);for(o=o<<n|c,m+=n;m>0;r[e+E]=o&255,E+=ie,o/=256,m-=8);r[e+E-ie]|=ut*128}var R,N,qt,_e,Fe,lr,tt=Le(()=>{"use strict";u();l();R=[],N=[],qt=typeof Uint8Array!="undefined"?Uint8Array:Array,_e=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return Ve(null,r,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(r,t,e){return Qt(null,r,t,e)};a.allocUnsafe=function(r){return Re(null,r)};a.allocUnsafeSlow=function(r){return Re(null,r)};a.isBuffer=yr;a.compare=function(t,e){if(!k(t)||!k(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,s=0,o=Math.min(i,n);s<o;++s)if(t[s]!==e[s]){i=t[s],n=e[s];break}return i<n?-1:n<i?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 i;if(e===void 0)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=a.allocUnsafe(e),s=0;for(i=0;i<t.length;++i){var o=t[i];if(!k(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};a.byteLength=qe;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)J(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)J(this,e,e+3),J(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)J(this,e,e+7),J(this,e+1,e+6),J(this,e+2,e+5),J(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?He(this,0,t):Kt.apply(this,arguments)};a.prototype.equals=function(t){if(!k(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,i,n,s){if(!k(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=t?t.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),e<0||i>t.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&e>=i)return 0;if(n>=s)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,s>>>=0,this===t)return 0;for(var o=s-n,c=i-e,h=Math.min(o,c),m=this.slice(n,s),w=t.slice(e,i),x=0;x<h;++x)if(m[x]!==w[x]){o=m[x],c=w[x];break}return o<c?-1:c<o?1:0};a.prototype.includes=function(t,e,i){return this.indexOf(t,e,i)!==-1};a.prototype.indexOf=function(t,e,i){return Ge(this,t,e,i,!0)};a.prototype.lastIndexOf=function(t,e,i){return Ge(this,t,e,i,!1)};a.prototype.write=function(t,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-e;if((i===void 0||i>s)&&(i=s),t.length>0&&(i<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 er(this,t,e,i);case"utf8":case"utf-8":return tr(this,t,e,i);case"ascii":return Je(this,t,e,i);case"latin1":case"binary":return rr(this,t,e,i);case"base64":return ir(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nr(this,t,e,i);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)}};Fe=4096;a.prototype.slice=function(t,e){var i=this.length;t=~~t,e=e===void 0?i:~~e,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),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,i){t=t|0,e=e|0,i||y(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,i){t=t|0,e=e|0,i||y(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||y(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||y(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||y(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||y(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||y(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,i){t=t|0,e=e|0,i||y(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,i){t=t|0,e=e|0,i||y(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||y(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||y(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(t,e){e||y(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(t,e){return e||y(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||y(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||y(t,4,this.length),Ae(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||y(t,4,this.length),Ae(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||y(t,8,this.length),Ae(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||y(t,8,this.length),Ae(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var s=Math.pow(2,8*i)-1;A(this,t,e,i,s,0)}var o=1,c=0;for(this[e]=t&255;++c<i&&(o*=256);)this[e+c]=t/o&255;return e+i};a.prototype.writeUIntBE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var s=Math.pow(2,8*i)-1;A(this,t,e,i,s,0)}var o=i-1,c=1;for(this[e+o]=t&255;--o>=0&&(c*=256);)this[e+o]=t/c&255;return e+i};a.prototype.writeUInt8=function(t,e,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i,n){if(t=+t,e=e|0,!n){var s=Math.pow(2,8*i-1);A(this,t,e,i,s-1,-s)}var o=0,c=1,h=0;for(this[e]=t&255;++o<i&&(c*=256);)t<0&&h===0&&this[e+o-1]!==0&&(h=1),this[e+o]=(t/c>>0)-h&255;return e+i};a.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e=e|0,!n){var s=Math.pow(2,8*i-1);A(this,t,e,i,s-1,-s)}var o=i-1,c=1,h=0;for(this[e+o]=t&255;--o>=0&&(c*=256);)t<0&&h===0&&this[e+o+1]!==0&&(h=1),this[e+o]=(t/c>>0)-h&255;return e+i};a.prototype.writeInt8=function(t,e,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(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,i){return je(this,t,e,!0,i)};a.prototype.writeFloatBE=function(t,e,i){return je(this,t,e,!1,i)};a.prototype.writeDoubleLE=function(t,e,i){return Xe(this,t,e,!0,i)};a.prototype.writeDoubleBE=function(t,e,i){return Xe(this,t,e,!1,i)};a.prototype.copy=function(t,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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-i&&(n=t.length-e+i);var s=n-i,o;if(this===t&&i<e&&e<n)for(o=s-1;o>=0;--o)t[o+e]=this[o+i];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)t[o+e]=this[o+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+s),e);return s};a.prototype.fill=function(t,e,i,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=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<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var o;if(typeof t=="number")for(o=e;o<i;++o)this[o]=t;else{var c=k(t)?t:xe(new a(t,n).toString()),h=c.length;for(o=0;o<i-e;++o)this[o+e]=c[o%h]}return this};lr=/[^+\/0-9A-Za-z-_]/g});var l=Le(()=>{"use strict";tt()});u();l();function H(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();l();u();l();function Tr(r){return Object.keys(r)}var le={};xt(le,{Access:()=>W,Array:()=>Q,AstNode:()=>p,Attribute:()=>j,Class:()=>M,ClassInstantiation:()=>S,ClassReference:()=>g,CodeBlock:()=>T,DataClass:()=>Z,Enum:()=>K,Field:()=>ee,Map:()=>te,Method:()=>O,MethodInvocation:()=>D,Parameter:()=>$,Trait:()=>X,Type:()=>_,TypeLiteral:()=>I,Writer:()=>C,array:()=>kr,assignVariable:()=>Vr,attribute:()=>br,classReference:()=>Br,class_:()=>Cr,codeblock:()=>re,dataClass:()=>Ur,enum_:()=>Pr,field:()=>Mr,instantiateClass:()=>ct,invokeMethod:()=>$r,map:()=>Or,mergeArrays:()=>Gr,method:()=>Yr,parameter:()=>Fr,string:()=>qr,ternary:()=>Wr,this_:()=>Jr,throwException:()=>Dr,trait:()=>Sr,variable:()=>zr});u();l();u();l();u();l();var P=class{};u();l();u();l();var b=class extends P{constructor(e){super();f(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var Ar=4,fe=class{constructor(){f(this,"buffer","");f(this,"indentLevel",0);f(this,"hasWrittenAnything",!1);f(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
2
- `),i=e?t.substring(0,t.length-1):t,n=this.getIndentString(),s=i.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 b(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new b(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new b(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new b(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",i,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(),i(),this.dedent()}finally{this.write(n!=null?n:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
- `)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:i}){if(t.length>0){let n=t[0];n!=null&&i(n);for(let s=1;s<t.length;s++){this.write(e);let o=t[s];o!=null&&i(o)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
8
- `)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*Ar)}};u();l();function be(r){return(r==null?void 0:r.name)!=null}u();l();var ce=class extends P{constructor({condition:e,true_:i,false_:n}){super();f(this,"condition");f(this,"true_");f(this,"false_");this.condition=e,this.true_=i,this.false_=n}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};u();l();u();l();var W={Public:"public",PublicReadonly:"public readonly",Protected:"protected",Private:"private"};u();l();u();l();u();l();u();l();var ue="",rt="self",it="static";function nt(r){return{namespace:r.substring(0,r.lastIndexOf("\\")),name:r.substring(r.lastIndexOf("\\")+1)}}var C=class extends fe{constructor({namespace:e,rootNamespace:i,customConfig:n}){super();f(this,"namespace");f(this,"rootNamespace");f(this,"customConfig");f(this,"references",{});this.namespace=e,this.rootNamespace=i,this.customConfig=n}addReference(e){var o,c;if(e.namespace==null)return;if(Object.keys(this.references).filter(h=>{let m=nt(h);return m.namespace!==e.namespace&&m.name===e.name}).length>0){e.requireFullyQualified();return}let n=e.namespace===ue?e.name:`${e.namespace}\\${e.name}`;((c=(o=this.references)[n])!=null?c:o[n]=[]).push(e)}toString(){let e=`namespace ${this.namespace};`,i=this.stringifyImports();return i.length>0?`${e}
9
-
10
- ${i}
11
-
12
- ${this.buffer}`:e+`
13
-
14
- `+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(i=>nt(i).namespace!==this.namespace).map(i=>`use ${i};`).join(`
15
- `)}};var p=class extends P{toString(t){if(t==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:i,customConfig:n}=t,s=new C({namespace:e,rootNamespace:i,customConfig:n});return this.write(s),s.toString()}async toStringAsync({namespace:t,rootNamespace:e,customConfig:i}){let n=new C({namespace:t,rootNamespace:e,customConfig:i});return this.write(n),n.toString()}};var Q=class extends p{constructor({entries:e}){super();f(this,"entries");this.entries=e!=null?e:[]}write(e){e.write("["),this.entries.forEach((i,n)=>{n>0&&e.write(", "),i.write(e)}),e.write("]")}};u();l();var j=class extends p{constructor(e){var i;super();f(this,"reference");f(this,"arguments");this.reference=e.reference,this.arguments=(i=e.arguments)!=null?i:[]}write(e){e.addReference(this.reference),e.write(`${this.reference.name}`),this.arguments.length>0&&(e.write("("),this.arguments.forEach((i,n)=>{n>0&&e.write(","),typeof i=="string"?e.write(i):i.write(e)}),e.write(")"))}};u();l();u();l();var g=class extends p{constructor({name:e,namespace:i,generics:n}){super();f(this,"name");f(this,"namespace");f(this,"generics");f(this,"fullyQualified");this.name=e,this.namespace=i,this.generics=n,this.fullyQualified=!1}requireFullyQualified(){this.fullyQualified=!0}write(e){e.addReference(this);let i=this.fullyQualified?`\\${this.namespace}\\${this.name}`:this.name;e.write(`${i}`)}};u();l();u();l();function V(r){return r.startsWith("$")?r:`$${r}`}var v=class extends p{constructor({docs:e}={}){super();f(this,"docs");f(this,"tags",[]);this.docs=e}addTag(e){this.tags.push(me(pe({},e),{name:e.name!=null?V(e.name):void 0}))}write(e){e.writeLine("/**"),this.docs!=null&&(this.docs.split(`
16
- `).forEach(i=>{e.writeLine(` * ${i}`)}),this.tags.length>0&&e.writeLine(" *"));for(let i of this.tags)this.writeTag({writer:e,tag:i});e.writeLine(" */")}writeTag({writer:e,tag:i}){let n=i.docs!=null?i.docs.split(`
17
- `):void 0;n!=null&&n.length>1&&(n.forEach(s=>{e.writeLine(` * ${s}`)}),e.writeLine(" *")),e.write(` * @${i.tagType} `),i.type.write(e,{comment:!0}),i.name!=null&&e.write(` ${i.name}`),n!=null&&n.length===1&&e.write(` ${n[0]}`),e.newLine()}};u();l();function z(r){return Er(r,[W.Public,W.PublicReadonly,W.Protected,W.Private])}function Er(r,t){return t.reduce((e,i)=>[...e,...r.filter(n=>n.access===i)],[])}var M=class extends p{constructor({name:e,namespace:i,abstract:n,docs:s,parentClassReference:o,traits:c}){super();f(this,"name");f(this,"namespace");f(this,"abstract");f(this,"docs");f(this,"parentClassReference");f(this,"traits");f(this,"fields",[]);f(this,"methods",[]);f(this,"constructor_");this.name=e,this.namespace=i,this.abstract=n!=null?n:!1,this.docs=s,this.parentClassReference=o,this.traits=c!=null?c:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addMethods(e){this.methods.push(...e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new g({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((i,n)=>{n>0&&e.write(","),e.writeNode(i)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:z(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:z(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new v({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:i}){var n;this.writeConstructorComment({writer:e,constructor:i}),i.access!=null&&e.write(`${i.access} `),e.write("function __construct("),e.indent(),i.parameters.forEach((s,o)=>{o===0&&e.newLine(),s.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(n=i.body)==null||n.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:i}){if(i.parameters.length===0)return;let n=new v;for(let s of i.parameters)n.addTag(s.getCommentTag());n.write(e)}writeFields({writer:e,fields:i}){i.filter(n=>!n.inherited).forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:i}){i.forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}};u();l();var X=class extends p{constructor({name:e,namespace:i,docs:n,traits:s}){super();f(this,"name");f(this,"namespace");f(this,"docs");f(this,"traits");f(this,"fields",[]);f(this,"methods",[]);this.name=e,this.namespace=i,this.docs=n,this.traits=s!=null?s:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((i,n)=>{n>0&&e.write(","),e.writeNode(i)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:z(this.fields)}),this.fields.length>0&&this.methods.length>0&&e.newLine(),this.writeMethods({writer:e,methods:z(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){let i=new v({docs:this.docs});for(let n of this.fields)i.addTag({tagType:"property",type:n.type,name:n.name});i.write(e)}writeFields({writer:e,fields:i}){i.forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:i}){i.forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}};u();l();u();l();function oe({writer:r,arguments_:t,multiline:e}){if(t.length===0){r.write("()");return}if(e){vr({writer:r,arguments_:t});return}Nr({writer:r,arguments_:t})}function vr({writer:r,arguments_:t}){r.writeLine("("),r.indent();for(let e of t)st({writer:r,argument:e,writeCompact:!1}),r.writeLine(",");r.dedent(),r.write(")")}function Nr({writer:r,arguments_:t}){r.write("("),t.forEach((e,i)=>{i>0&&r.write(", "),st({writer:r,argument:e,writeCompact:!0})}),r.write(")")}function st({writer:r,argument:t,writeCompact:e}){be(t)?(t.docs&&(e?r.write(`/* ${t.docs} */ `):r.writeLine(`/* ${t.docs} */`)),r.write(`${t.name}: `),r.writeNodeOrString(t.assignment)):t.write(r)}var S=class extends p{constructor({classReference:e,arguments_:i,multiline:n}){super();f(this,"classReference");f(this,"arguments_");f(this,"multiline");this.classReference=e,this.arguments_=i,this.multiline=n!=null?n:!1}write(e){e.write("new "),e.writeNode(this.classReference),oe({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};u();l();var T=class extends p{constructor(e){super();f(this,"arg");this.arg=e}write(e){return new b(this.arg).write(e)}};u();l();u();l();u();l();var $=class extends p{constructor({name:e,type:i,docs:n,initializer:s,access:o,readonly_:c}){super();f(this,"name");f(this,"type");f(this,"docs");f(this,"initializer");f(this,"access");f(this,"readonly_");this.name=V(e),this.type=i,this.docs=n,this.initializer=s,this.access=o,this.readonly_=c!=null?c:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};u();l();u();l();u();l();var D=class extends p{constructor({method:e,arguments_:i,static_:n,multiline:s,on:o}){super();f(this,"method");f(this,"arguments_");f(this,"multiline");f(this,"static_");f(this,"on");this.method=e,this.arguments_=i,this.static_=n!=null?n:!1,this.multiline=s!=null?s:!1,this.on=o}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),oe({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};u();l();var I=class r extends p{constructor(e){super();f(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(Ir({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(Lr({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
18
- `)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}if(this.internalType.value.includes("'")){e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}e.write(`'${this.internalType.value}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:H(this.internalType)}}isClass(){return this.internalType.type==="class"}asClassOrThrow(){if(this.isClass())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a class")}writeStringWithHeredoc({writer:e,value:i}){e.writeLine("<<<EOT"),e.writeNoIndent(i),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:i}){e.writeNode(new S({classReference:i.reference,arguments_:[r.map({entries:i.fields.map(n=>({key:r.string(n.name),value:n.value}))})]}))}writeList({writer:e,list:i}){let n=Rr({values:i.values});if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of n)s.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:i}){let n=_r({entries:i.entries});if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of n)s.key.write(e),e.write(" => "),s.value.write(e),e.writeLine(",");e.dedent(),e.write("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:i}){return new this({type:"class",reference:e,fields:i})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:i}){switch(typeof i){case"boolean":e.write(i.toString());return;case"string":e.write(i.includes('"')?`\`${i}\``:`"${i}"`);return;case"number":e.write(i.toString());return;case"object":if(i==null){e.write("null");return}if(Array.isArray(i)){this.writeUnknownArray({writer:e,value:i});return}this.writeUnknownMap({writer:e,value:i});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof i}`)}}writeUnknownArray({writer:e,value:i}){if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let n of i)e.writeNode(r.unknown(n)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:i}){let n=Object.entries(i);if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[s,o]of n)e.write(`'${s}' => `),e.writeNode(r.unknown(o)),e.writeLine(",");e.dedent(),e.write("]")}};function Lr({writer:r,value:t}){return new S({classReference:new g({name:"DateTime",namespace:""}),arguments_:[new T(`'${t}'`)]})}function Ir({writer:r,value:t}){return new D({on:new g({name:"File",namespace:`${r.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new T(`"${t}"`)]})}function _r({entries:r}){return r.filter(t=>!I.isNop(t.key)&&!I.isNop(t.value))}function Rr({values:r}){return r.filter(t=>!I.isNop(t))}var _=class r extends p{constructor(e){super();f(this,"internalType");this.internalType=e}write(e,{comment:i}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(ot),e.write("DateTime");break;case"dateTime":e.addReference(ot),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!i){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:i}),e.write(">");break;case"map":{if(!i){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:i}),e.write(", "),this.internalType.valueType.write(e,{comment:i}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!i){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");let n=this.internalType.entries.filter(c=>!c.valueType.isOptional()),s=this.internalType.entries.filter(c=>c.valueType.isOptional()),o=[...n,...s];for(let c of o)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:c,comment:i}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((n,s)=>{s>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:n,comment:i})}),e.write("}");break}case"union":{let n=this.getUniqueTypes({types:this.internalType.types,comment:i,writer:e}),s=n.filter(o=>o.underlyingType().internalType.type==="mixed").length>0;if(s&&!i){e.write("mixed");break}n.length>0&&i?(e.writeLine("("),n.forEach((o,c)=>{c>0?e.write(" * |"):e.write(" * "),s&&(o=o.underlyingType()),o.write(e,{comment:i}),e.writeLine(),c++}),e.write(" * )")):n.forEach((o,c)=>{c>0&&e.write("|"),s&&(o=o.underlyingType()),o.write(e,{comment:i}),c++});break}case"optional":{let n=this.internalType.value.internalType.type==="mixed",s=this.internalType.value.internalType.type==="union";!s&&!n&&e.write("?"),this.internalType.value.write(e,{comment:i}),s&&(e.write("|"),e.writeNode(r.null()));break}case"reference":if(i){e.writeNode(this.internalType.value);let n=this.internalType.value.generics;n&&n.length>0&&(e.write("<"),n.forEach((s,o)=>{o>0&&e.write(", "),s.write(e,{comment:i})}),e.write(">"))}else e.writeNode(this.internalType.value);break;case"enumString":i?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;case"literal":if(i)e.writeNode(this.internalType.value);else switch(this.internalType.value.internalType.type){case"string":e.write("string");break;case"boolean":e.write("bool");break;default:H(this.internalType.value.internalType)}break;default:H(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:r.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}getClassReference(){switch(this.internalType.type){case"date":case"dateTime":return new g({name:"DateTime",namespace:ue});case"enumString":case"reference":return this.internalType.value;case"int":case"string":case"bool":case"float":case"object":case"map":case"array":case"null":case"mixed":case"optional":case"typeDict":case"union":case"literal":throw new Error("Cannot get class reference for "+this.internalType.type);default:H(this.internalType)}}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,i){return new this({type:"map",keyType:e,valueType:i})}static typeDict(e,{multiline:i}={}){return new this({type:"typeDict",entries:e,multiline:i})}static union(e){return new this({type:"union",types:e})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static literalString(e){return new this({type:"literal",value:I.string(e)})}static literalBoolean(e){return new this({type:"literal",value:I.boolean(e)})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeTypeDictEntry({writer:e,entry:i,comment:n}){e.write(i.key),i.optional&&e.write("?"),e.write(": "),i.valueType.write(e,{comment:n})}getUniqueTypes({writer:e,types:i,comment:n}){let s=new Set;return i.filter(o=>{let c=o.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig,comment:n});return s.has(c)?!1:(s.add(c),!0)})}toString({namespace:e,rootNamespace:i,customConfig:n,comment:s}){let o=new C({namespace:e,rootNamespace:i,customConfig:n});return this.write(o,{comment:s!=null?s:!1}),o.toString()}},ot=new g({namespace:ue,name:"DateTime"});u();l();function at(r){return r.startsWith("$")?r.slice(1):r}var ft="values",Z=class extends p{constructor({name:e,namespace:i,abstract:n,docs:s,parentClassReference:o,traits:c,constructorAccess:h}){super();f(this,"name");f(this,"namespace");f(this,"constructorAccess");f(this,"class_");this.name=e,this.namespace=i,this.constructorAccess=h!=null?h:"public",this.class_=new M({name:e,namespace:i,abstract:n,docs:s,parentClassReference:o,traits:c})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let i=z(this.class_.fields).map(n=>me(pe({},n),{name:at(n.name)}));i.length>0&&this.class_.addConstructor({access:this.constructorAccess,parameters:this.getConstructorParameters({orderedFields:i}),body:le.codeblock(n=>{for(let s of i)n.write(`$this->${s.name} = $${ft}['${s.name}']`),s.type.isOptional()&&n.write(" ?? null"),n.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new $({name:ft,type:_.typeDict(e.map(i=>({key:i.name,valueType:i.type,optional:i.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new T("[]"):void 0})]}};u();l();u();l();var O=class extends p{constructor({name:e,access:i,parameters:n,throws:s,return_:o,body:c,docs:h,classReference:m,static_:w}){super();f(this,"name");f(this,"access");f(this,"parameters");f(this,"throws");f(this,"return_");f(this,"body");f(this,"docs");f(this,"classReference");f(this,"static_");this.name=e,this.access=i,this.parameters=n,this.throws=s!=null?s:[],this.return_=o,this.body=c,this.docs=h,this.classReference=m,this.static_=w!=null?w:!1}write(e){var o;this.writeComment(e),e.write(`${this.access}${this.static_?" static":""} function ${this.name}(`);let i=this.parameters.filter(c=>!c.type.isOptional()),n=this.parameters.filter(c=>c.type.isOptional());[...i,...n].forEach((c,h)=>{h>0&&e.write(", "),c.write(e)}),e.write("): "),this.return_!=null?e.writeNodeOrString(this.return_):e.write("void"),e.writeLine(" {"),e.indent(),(o=this.body)==null||o.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let i=new v({docs:this.docs});for(let n of this.parameters)i.addTag({tagType:"param",type:n.type,name:n.name,docs:n.docs});this.return_!=null&&this.return_!==rt&&this.return_!==it&&i.addTag({tagType:"return",type:this.return_});for(let n of this.throws)i.addTag({tagType:"throws",type:_.reference(n)});e.writeNode(i)}};var K=class extends p{constructor({name:e,namespace:i,backing:n,docs:s,serializable:o}){super();f(this,"name");f(this,"namespace");f(this,"backing");f(this,"docs");f(this,"members",[]);f(this,"serializable");this.name=e,this.namespace=i,this.backing=n,this.docs=s,this.serializable=o!=null?o:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new g({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let i of this.members)e.write(`case ${i.name}`),i.value!=null&&(typeof i.value=="string"?e.write(` = "${i.value}"`):e.write(` = ${i.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new O({name:"jsonSerialize",return_:_.string(),access:"public",parameters:[],body:new T("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new v({docs:this.docs}).write(e)}};u();l();var ee=class extends p{constructor({name:e,type:i,access:n,readonly_:s,initializer:o,docs:c,inlineDocs:h,attributes:m,inherited:w}){super();f(this,"name");f(this,"type");f(this,"access");f(this,"readonly_");f(this,"initializer");f(this,"docs");f(this,"inlineDocs");f(this,"attributes");f(this,"inherited");this.name=V(e),this.type=i,this.access=n,this.readonly_=s!=null?s:!1,this.initializer=o,this.docs=c,this.inlineDocs=h,this.attributes=m!=null?m:[],this.inherited=w!=null?w:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let i=new v;i.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),i.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((i,n)=>{n>0&&e.write(", "),i.write(e)}),e.writeLine("]"))}};u();l();var te=class extends p{constructor({entries:e,multiline:i}){super();f(this,"entries");f(this,"multiline");this.entries=e!=null?e:[],this.multiline=i!=null?i:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:i,value:n}of this.entries)i.write(e),e.write(" => "),n.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[i,{key:n,value:s}]of this.entries.entries())i>0&&e.write(", "),n.write(e),e.write(" => "),s.write(e);e.write("]")}};u();l();var Ee=class extends p{constructor(e){super();f(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),oe({writer:e,arguments_:this.arrays.map(i=>re(n=>{if(typeof i=="string"||i instanceof p){n.writeNodeOrString(i);return}n.writeNodeOrString(i.ref),i.fallback&&(n.write(" ?? "),n.writeNodeOrString(i.fallback))}))})}};function kr(r){return new Q(r)}function br(r){return new j(r)}function Cr(r){return new M(r)}function Sr(r){return new X(r)}function Br(r){return new g(r)}function re(r){return new T(r)}function Ur(r){return new Z(r)}function Pr(r){return new K(r)}function Mr(r){return new ee(r)}function ct(r){return new S(r)}function $r(r){return new D(r)}function Dr(r){return re(t=>{t.write("throw "),t.writeNode(ct(r))})}function Or(r){return new te(r)}function Yr(r){return new O(r)}function Fr(r){return new $(r)}function Wr(r){return new ce(r)}function Vr(r,t){return re(e=>{e.writeNodeOrString(r),e.write(" = "),e.writeNodeOrString(t)})}function zr(r){return re(V(r))}function qr(r){return re(`"${r}"`)}function Gr(...r){return new Ee(r)}function Jr(){return new T(r=>{r.write("$this")})}export{pe as a,me as b,Hr as c,Qr as d,Le as e,jr as f,xt as g,Xr as h,Zr as i,f as j,u as k,a as l,l as m,H as n,Tr as o,le as p};
19
- /*! Bundled license information:
20
-
21
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
22
- (*!
23
- * The buffer module from node.js, for the browser.
24
- *
25
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
26
- * @license MIT
27
- *)
28
- */