@yukino.js/yukino 0.0.21-dev → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{anthropic-LB4T3BEN.js → anthropic-5FTO3Q7W.js} +1 -1
- package/dist/browser/dist/static/{highlight-KNDEBJWF.js → highlight-7IMT657L.js} +9 -9
- package/dist/browser/dist/static/index.css +2 -2
- package/dist/browser/dist/static/index.js +81 -75
- package/dist/browser/dist/static/webapi-433PWHPB.js +4 -0
- package/dist/{chunk-NPIMUWFO.js → chunk-3FNHYMQD.js} +1 -1
- package/dist/{chunk-D6YQITPD.js → chunk-4UBQFHOG.js} +1 -1
- package/dist/{chunk-N7G2FDAI.js → chunk-5JFKXDO6.js} +1 -1
- package/dist/chunk-6YD572HB.js +4 -0
- package/dist/{chunk-XDERLDVW.js → chunk-7R67JSKQ.js} +1 -1
- package/dist/{chunk-FNQMXCCE.js → chunk-D5XGRVMZ.js} +1 -1
- package/dist/{chunk-WKKH2UE5.js → chunk-FOFOAOHI.js} +1 -1
- package/dist/{chunk-QYUIIFJY.js → chunk-GQKXEVHQ.js} +1 -1
- package/dist/{chunk-5D3QKHYQ.js → chunk-HNVICTWL.js} +1 -1
- package/dist/{chunk-7WP7SERS.js → chunk-HQ6FH7CR.js} +1 -1
- package/dist/{chunk-P6K7EQHF.js → chunk-I2KB6I3D.js} +2 -2
- package/dist/chunk-KBRCX7GE.js +30 -0
- package/dist/chunk-LLPVYWAK.js +10 -0
- package/dist/{chunk-2N7OIUQW.js → chunk-TVVVY2T4.js} +173 -173
- package/dist/{chunk-6SWKDCK3.js → chunk-WXCPYSJ3.js} +1 -1
- package/dist/{chunk-57IGGFHK.js → chunk-XB5QPPSI.js} +1 -1
- package/dist/{chunk-EQABLL4S.js → chunk-YWUBKWGK.js} +1 -1
- package/dist/{devtools-UVGRIXO2.js → devtools-BODX7K3L.js} +1 -1
- package/dist/{esm-HB7M3TZY.js → esm-4BJKCG42.js} +1 -1
- package/dist/{esm-63A57VQM.js → esm-AWTGQAUK.js} +1 -1
- package/dist/{esm-FURF4AWD.js → esm-JKMLEWEU.js} +1 -1
- package/dist/{esm-46K5BSA6.js → esm-MG7NDA4I.js} +1 -1
- package/dist/{esm-73AG4F4H.js → esm-NCNRWOJD.js} +1 -1
- package/dist/{esm-QAEO3U72.js → esm-QVP2GBDR.js} +1 -1
- package/dist/esm-ZR7DS25X.js +225 -0
- package/dist/file-type-Z4DPJWZH.js +12 -0
- package/dist/getMachineId-bsd-RSPO2LUX.js +4 -0
- package/dist/getMachineId-bsd-YMN7H6LU.js +4 -0
- package/dist/getMachineId-darwin-AOWQPOSH.js +5 -0
- package/dist/getMachineId-darwin-FEQVNOUN.js +5 -0
- package/dist/{getMachineId-win-2ZKMVYDE.js → getMachineId-win-H5SABCRW.js} +1 -1
- package/dist/{getMachineId-win-JOM5JSRW.js → getMachineId-win-RV3BPBHF.js} +1 -1
- package/dist/image-worker.js +1 -1
- package/dist/lib/{chunk-XVXFUSSS.js → chunk-IOPSBIYR.js} +1 -1
- package/dist/lib/index.d.ts +802 -802
- package/dist/lib/index.js +19 -17
- package/dist/lib/{providers-2NPR2VR4.js → providers-U3O7GOPH.js} +1 -1
- package/dist/{main-OMIZDIYB.js → main-BIBLUWZX.js} +219 -213
- package/dist/main.js +2 -2
- package/dist/{openai-UOCUBMFA.js → openai-AYEJOJTA.js} +1 -1
- package/dist/{providers-G5SKN22T.js → providers-USI6GYZC.js} +9 -9
- package/dist/{server-Z742CQSK.js → server-RGAJNHA4.js} +1 -1
- package/dist/{server-ESDMJACZ.js → server-XHQ7YJGI.js} +2 -2
- package/dist/{src-CHQYSTW5.js → src-E2NOTM6J.js} +1 -1
- package/dist/{src-HH6MC5CF.js → src-EBGRLYAR.js} +1 -1
- package/dist/{src-YWYPK5QA.js → src-HBBKRA75.js} +1 -1
- package/dist/src-P77FB5XW.js +12 -0
- package/dist/{turndown.es-NQ3KDXM7.js → turndown.es-E6SHSU5B.js} +13 -13
- package/package.json +2 -2
- package/dist/browser/dist/static/webapi-HZESKPJE.js +0 -4
- package/dist/chunk-5AOJ5ZSQ.js +0 -30
- package/dist/chunk-VM4YKTHC.js +0 -10
- package/dist/chunk-WKTO7XPO.js +0 -4
- package/dist/esm-6D27H27M.js +0 -225
- package/dist/file-type-PSFVPAEH.js +0 -12
- package/dist/getMachineId-bsd-2MDOCJCH.js +0 -4
- package/dist/getMachineId-bsd-L5XEQF74.js +0 -4
- package/dist/getMachineId-darwin-SMQEPEZ2.js +0 -5
- package/dist/getMachineId-darwin-V3OSZDJX.js +0 -5
- package/dist/src-P2WNZ6IY.js +0 -12
- /package/dist/{chunk-HKQWGX5S.js → chunk-UJIMMEIV.js} +0 -0
- /package/dist/{getMachineId-linux-OWR5YFVH.js → getMachineId-linux-337SESKP.js} +0 -0
- /package/dist/{getMachineId-linux-C4WJW6ZL.js → getMachineId-linux-P6HXMSZR.js} +0 -0
- /package/dist/{getMachineId-unsupported-M7AEHRA4.js → getMachineId-unsupported-52TDEFNE.js} +0 -0
- /package/dist/{getMachineId-unsupported-J7U5FNFT.js → getMachineId-unsupported-FWRH7XFO.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{a as td}from"./chunk-XN7SUAOW.js";import{c as Zu,d as ed,v as ev,w as tv}from"./chunk-NPIMUWFO.js";import{o as Qm,p as Zm}from"./chunk-WKKH2UE5.js";import{a as z,b as Xm,c as g,d as Jm,f as Ai}from"./chunk-7MKA3SHV.js";var rd=g(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.VERSION=void 0;qn.VERSION="0.222.0"});var B=g($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=$e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=$e.Propagate=$e.LogVerbosity=$e.Status=void 0;var id;(function(i){i[i.OK=0]="OK",i[i.CANCELLED=1]="CANCELLED",i[i.UNKNOWN=2]="UNKNOWN",i[i.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",i[i.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",i[i.NOT_FOUND=5]="NOT_FOUND",i[i.ALREADY_EXISTS=6]="ALREADY_EXISTS",i[i.PERMISSION_DENIED=7]="PERMISSION_DENIED",i[i.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",i[i.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",i[i.ABORTED=10]="ABORTED",i[i.OUT_OF_RANGE=11]="OUT_OF_RANGE",i[i.UNIMPLEMENTED=12]="UNIMPLEMENTED",i[i.INTERNAL=13]="INTERNAL",i[i.UNAVAILABLE=14]="UNAVAILABLE",i[i.DATA_LOSS=15]="DATA_LOSS",i[i.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(id||($e.Status=id={}));var nd;(function(i){i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.ERROR=2]="ERROR",i[i.NONE=3]="NONE"})(nd||($e.LogVerbosity=nd={}));var sd;(function(i){i[i.DEADLINE=1]="DEADLINE",i[i.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",i[i.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",i[i.CANCELLATION=8]="CANCELLATION",i[i.DEFAULTS=65535]="DEFAULTS"})(sd||($e.Propagate=sd={}));$e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;$e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var Va=g((aw,rv)=>{rv.exports={name:"@grpc/grpc-js",version:"1.14.7",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto","copy-protos":"node ./copy-protos"},dependencies:{"@grpc/proto-loader":"^0.8.0","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/**/*.proto","proto/**/LICENSE","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var ee=g(Be=>{"use strict";var Ya,Ka,Xa,Ja;Object.defineProperty(Be,"__esModule",{value:!0});Be.log=Be.setLoggerVerbosity=Be.setLogger=Be.getLogger=void 0;Be.trace=fv;Be.isTracerEnabled=ld;var $t=B(),iv=z("process"),nv=Va().version,sv={error:(i,...e)=>{console.error("E "+i,...e)},info:(i,...e)=>{console.error("I "+i,...e)},debug:(i,...e)=>{console.error("D "+i,...e)}},gr=sv,Ur=$t.LogVerbosity.ERROR,av=(Ka=(Ya=process.env.GRPC_NODE_VERBOSITY)!==null&&Ya!==void 0?Ya:process.env.GRPC_VERBOSITY)!==null&&Ka!==void 0?Ka:"";switch(av.toUpperCase()){case"DEBUG":Ur=$t.LogVerbosity.DEBUG;break;case"INFO":Ur=$t.LogVerbosity.INFO;break;case"ERROR":Ur=$t.LogVerbosity.ERROR;break;case"NONE":Ur=$t.LogVerbosity.NONE;break;default:}var ov=()=>gr;Be.getLogger=ov;var lv=i=>{gr=i};Be.setLogger=lv;var cv=i=>{Ur=i};Be.setLoggerVerbosity=cv;var uv=(i,...e)=>{let t;if(i>=Ur){switch(i){case $t.LogVerbosity.DEBUG:t=gr.debug;break;case $t.LogVerbosity.INFO:t=gr.info;break;case $t.LogVerbosity.ERROR:t=gr.error;break}t||(t=gr.error),t&&t.bind(gr)(...e)}};Be.log=uv;var dv=(Ja=(Xa=process.env.GRPC_NODE_TRACE)!==null&&Xa!==void 0?Xa:process.env.GRPC_TRACE)!==null&&Ja!==void 0?Ja:"",Un=new Set,ad=new Set;for(let i of dv.split(","))i.length!==0&&(i.startsWith("-")?ad.add(i.substring(1)):Un.add(i));var od=Un.has("all"),hv=od||Un.size>0;function fv(i,e,t){ld(e)&&(0,Be.log)(i,new Date().toISOString()+" | v"+nv+" "+iv.pid+" | "+e+" | "+t)}function ld(i){return hv?!ad.has(i)&&(od||Un.has(i)):!1}});var zn=g(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.getErrorMessage=pv;Bn.getErrorCode=gv;function pv(i){return i instanceof Error?i.message:String(i)}function gv(i){return typeof i=="object"&&i!==null&&"code"in i&&typeof i.code=="number"?i.code:null}});var pe=g(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Metadata=void 0;var mv=ee(),vv=B(),yv=zn(),_v=/^[:0-9a-z_.-]+$/,Ev=/^[ -~]*$/;function Sv(i){return _v.test(i)}function Cv(i){return Ev.test(i)}function dd(i){return i.endsWith("-bin")}function Tv(i){return!i.startsWith("grpc-")}function Hn(i){return i.toLowerCase()}function cd(i,e){if(!Sv(i))throw new Error('Metadata key "'+i+'" contains illegal characters');if(e!=null)if(dd(i)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!Cv(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var Qa=class i{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=Hn(e),cd(e,t),this.internalRepr.set(e,[t])}add(e,t){e=Hn(e),cd(e,t);let r=this.internalRepr.get(e);r===void 0?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=Hn(e),this.internalRepr.delete(e)}get(e){return e=Hn(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,r]of this.internalRepr)if(r.length>0){let n=r[0];e[t]=Buffer.isBuffer(n)?Buffer.from(n):n}return e}clone(){let e=new i(this.options),t=e.internalRepr;for(let[r,n]of this.internalRepr){let s=n.map(a=>Buffer.isBuffer(a)?Buffer.from(a):a);t.set(r,s)}return e}merge(e){for(let[t,r]of e.internalRepr){let n=(this.internalRepr.get(t)||[]).concat(r);this.internalRepr.set(t,n)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,r]of this.internalRepr)t.startsWith(":")||(r.length===1?e[t]=ud(r[0]):e[t]=r.map(ud));return e}toJSON(){let e={};for(let[t,r]of this.internalRepr)e[t]=r;return e}setOpaque(e,t){this.opaqueData||(this.opaqueData=new Map),this.opaqueData.set(e,t)}getOpaque(e){var t;return(t=this.opaqueData)===null||t===void 0?void 0:t.get(e)}static fromHttp2Headers(e){let t=new i;for(let r of Object.keys(e)){if(r.charAt(0)===":")continue;let n=e[r];try{dd(r)?Array.isArray(n)?n.forEach(s=>{t.add(r,Buffer.from(s,"base64"))}):n!==void 0&&(Tv(r)?n.split(",").forEach(s=>{t.add(r,Buffer.from(s.trim(),"base64"))}):t.add(r,Buffer.from(n,"base64"))):Array.isArray(n)?n.forEach(s=>{t.add(r,s)}):n!==void 0&&t.add(r,n)}catch(s){let a=`Failed to add metadata entry ${r}: ${n}. ${(0,yv.getErrorMessage)(s)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,mv.log)(vv.LogVerbosity.ERROR,a)}}return t}};jn.Metadata=Qa;var ud=i=>Buffer.isBuffer(i)?i.toString("base64"):i});var Pi=g(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.CallCredentials=void 0;Ni.isEmptyCallCredentials=Rv;var to=pe();function bv(i){return"getRequestHeaders"in i&&typeof i.getRequestHeaders=="function"}var Br=class i{static createFromMetadataGenerator(e){return new eo(e)}static createFromGoogleCredential(e){return i.createFromMetadataGenerator((t,r)=>{let n;bv(e)?n=e.getRequestHeaders(t.service_url):n=new Promise((s,a)=>{e.getRequestMetadata(t.service_url,(o,l)=>{if(o){a(o);return}if(!l){a(new Error("Headers not set by metadata plugin"));return}s(l)})}),n.then(s=>{let a=new to.Metadata;for(let o of Object.keys(s))a.add(o,s[o]);r(null,a)},s=>{r(s)})})}static createEmpty(){return new zr}};Ni.CallCredentials=Br;var Za=class i extends Br{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new to.Metadata,r=await Promise.all(this.creds.map(n=>n.generateMetadata(e)));for(let n of r)t.merge(n);return t}compose(e){return e instanceof zr?this:new i(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof i?this.creds.every((t,r)=>t._equals(e.creds[r])):!1}},eo=class i extends Br{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,r)=>{this.metadataGenerator(e,(n,s)=>{s!==void 0?t(s):r(n)})})}compose(e){return e instanceof zr?this:new Za([this,e])}_equals(e){return this===e?!0:e instanceof i?this.metadataGenerator===e.metadataGenerator:!1}},zr=class i extends Br{generateMetadata(e){return Promise.resolve(new to.Metadata)}compose(e){return e}_equals(e){return e instanceof i}};function Rv(i){return i instanceof zr}});var io=g(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CIPHER_SUITES=void 0;Ii.getDefaultRootsData=Ov;var wv=z("fs");Ii.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var hd=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,ro=null;function Ov(){return hd?(ro===null&&(ro=wv.readFileSync(hd)),ro):null}});var ke=g(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.parseUri=Nv;Vt.splitHostPort=pd;Vt.combineHostPort=Pv;Vt.uriToString=Iv;Vt.extractServiceName=gd;Vt.computeServiceUrl=Mv;var Av=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Nv(i){let e=Av.exec(i);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var fd=/^\d+$/;function pd(i){if(i.startsWith("[")){let e=i.indexOf("]");if(e===-1)return null;let t=i.substring(1,e);if(t.indexOf(":")===-1)return null;if(i.length>e+1)if(i[e+1]===":"){let r=i.substring(e+2);return fd.test(r)?{host:t,port:+r}:null}else return null;else return{host:t}}else{let e=i.split(":");return e.length===2?fd.test(e[1])?{host:e[0],port:+e[1]}:null:{host:i}}}function Pv(i){return i.port===void 0?i.host:i.host.includes(":")?`[${i.host}]:${i.port}`:`${i.host}:${i.port}`}function Iv(i){let e="";return i.scheme!==void 0&&(e+=i.scheme+":"),i.authority!==void 0&&(e+="//"+i.authority+"/"),e+=i.path,e}function gd(i){let e=i.indexOf("/");if(e===-1)return"";let t=i.indexOf("/",e+1);return t===-1?i.substring(e+1):i.substring(e+1,t)}function Mv(i,e){var t,r;let n=gd(e);return`https://${(r=(t=pd(i))===null||t===void 0?void 0:t.host)!==null&&r!==void 0?r:"localhost"}/${n}`}});var et=g(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;kt.registerResolver=kv;kt.registerDefaultScheme=xv;kt.createResolver=Dv;kt.getDefaultAuthority=Lv;kt.mapUriDefaultScheme=Fv;var so=ke();kt.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var Hr={},no=null;function kv(i,e){Hr[i]=e}function xv(i){no=i}function Dv(i,e,t){if(i.scheme!==void 0&&i.scheme in Hr)return new Hr[i.scheme](i,e,t);throw new Error(`No resolver could be created for target ${(0,so.uriToString)(i)}`)}function Lv(i){if(i.scheme!==void 0&&i.scheme in Hr)return Hr[i.scheme].getDefaultAuthority(i);throw new Error(`Invalid target ${(0,so.uriToString)(i)}`)}function Fv(i){return i.scheme===void 0||!(i.scheme in Hr)?no!==null?{scheme:no,authority:void 0,path:(0,so.uriToString)(i)}:null:i}});var jr=g(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ChannelCredentials=void 0;ki.createCertificateProviderChannelCredentials=zv;var Mi=z("tls"),$n=Pi(),oo=io(),md=ke(),qv=et(),Uv=ee(),Bv=B();function ao(i,e){if(i&&!(i instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var mr=class{compose(e){return new uo(this,e)}static createSsl(e,t,r,n){var s;if(ao(e,"Root certificate"),ao(t,"Private key"),ao(r,"Certificate chain"),t&&!r)throw new Error("Private key must be given with accompanying certificate chain");if(!t&&r)throw new Error("Certificate chain must be given with accompanying private key");let a=(0,Mi.createSecureContext)({ca:(s=e??(0,oo.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,key:t??void 0,cert:r??void 0,ciphers:oo.CIPHER_SUITES});return new Wn(a,n??{})}static createFromSecureContext(e,t){return new Wn(e,t??{})}static createInsecure(){return new lo}};ki.ChannelCredentials=mr;var lo=class i extends mr{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof i}_createSecureConnector(e,t,r){let n=r??$n.CallCredentials.createEmpty();return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>n,destroy(){}}}};function vd(i,e,t,r){var n,s;let a={secureContext:i},o=t;if("grpc.http_connect_target"in r){let h=(0,md.parseUri)(r["grpc.http_connect_target"]);h&&(o=h)}let l=(0,qv.getDefaultAuthority)(o),c=(0,md.splitHostPort)(l),u=(n=c?.host)!==null&&n!==void 0?n:l;if(a.host=u,e.checkServerIdentity&&(a.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(a.rejectUnauthorized=e.rejectUnauthorized),a.ALPNProtocols=["h2"],r["grpc.ssl_target_name_override"]){let h=r["grpc.ssl_target_name_override"],f=(s=a.checkServerIdentity)!==null&&s!==void 0?s:Mi.checkServerIdentity;a.checkServerIdentity=(_,p)=>f(h,p),a.servername=h}else a.servername=u;return r["grpc-node.tls_enable_trace"]&&(a.enableTrace=!0),a}var co=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((r,n)=>{let s=(0,Mi.connect)(t,()=>{var a;if((!((a=this.connectionOptions.rejectUnauthorized)!==null&&a!==void 0)||a)&&!s.authorized){n(s.authorizationError);return}r({socket:s,secure:!0})});s.on("error",a=>{n(a)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Wn=class i extends mr{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof i?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,r){let n=vd(this.secureContext,this.verifyOptions,e,t);return new co(n,r??$n.CallCredentials.createEmpty())}},Gn=class i extends mr{constructor(e,t,r){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=r,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,r;return this===e?!0:e instanceof i?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((r=e.verifyOptions)===null||r===void 0?void 0:r.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,r){return this.ref(),new i.SecureConnectorImpl(this,e,t,r??$n.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,Mi.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:oo.CIPHER_SUITES})}catch(r){return(0,Uv.log)(Bv.LogVerbosity.ERROR,"Failed to createSecureContext with error "+r.message),null}}};Gn.SecureConnectorImpl=class{constructor(i,e,t,r){this.parent=i,this.channelTarget=e,this.options=t,this.callCredentials=r}connect(i){return new Promise((e,t)=>{let r=this.parent.getLatestSecureContext();if(!r){t(new Error("Failed to load credentials"));return}i.closed&&t(new Error("Socket closed while loading credentials"));let n=vd(r,this.parent.verifyOptions,this.channelTarget,this.options),s=Object.assign({socket:i},n),a=()=>{t(new Error("Socket closed"))},o=c=>{t(c)},l=(0,Mi.connect)(s,()=>{var c;if(l.removeListener("close",a),l.removeListener("error",o),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&&c!==void 0)||c)&&!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once("close",a),l.once("error",o)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function zv(i,e,t){return new Gn(i,e,t??{})}var uo=class i extends mr{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let t=this.callCredentials.compose(e);return new i(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof i?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,r){let n=this.callCredentials.compose(r??$n.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,n)}}});var Kt=g(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.createChildChannelControlHelper=Wv;mt.registerLoadBalancerType=Gv;mt.registerDefaultLoadBalancerType=$v;mt.createLoadBalancer=Vv;mt.isLoadBalancerNameRegistered=Yv;mt.parseLoadBalancingConfig=yd;mt.getDefaultConfig=Kv;mt.selectLbConfigFromList=Xv;var Hv=ee(),jv=B();function Wv(i,e){var t,r,n,s,a,o,l,c,u,h;return{createSubchannel:(r=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&&r!==void 0?r:i.createSubchannel.bind(i),updateState:(s=(n=e.updateState)===null||n===void 0?void 0:n.bind(e))!==null&&s!==void 0?s:i.updateState.bind(i),requestReresolution:(o=(a=e.requestReresolution)===null||a===void 0?void 0:a.bind(e))!==null&&o!==void 0?o:i.requestReresolution.bind(i),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&&c!==void 0?c:i.addChannelzChild.bind(i),removeChannelzChild:(h=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&h!==void 0?h:i.removeChannelzChild.bind(i)}}var Yt={},xi=null;function Gv(i,e,t){Yt[i]={LoadBalancer:e,LoadBalancingConfig:t}}function $v(i){xi=i}function Vv(i,e){let t=i.getLoadBalancerName();return t in Yt?new Yt[t].LoadBalancer(e):null}function Yv(i){return i in Yt}function yd(i){let e=Object.keys(i);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let t=e[0];if(t in Yt)try{return Yt[t].LoadBalancingConfig.createFromJson(i[t])}catch(r){throw new Error(`${t}: ${r.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Kv(){if(!xi)throw new Error("No default load balancer type registered");return new Yt[xi].LoadBalancingConfig}function Xv(i,e=!1){for(let t of i)try{return yd(t)}catch(r){(0,Hv.log)(jv.LogVerbosity.DEBUG,"Config parsing failed with error",r.message);continue}return e&&xi?new Yt[xi].LoadBalancingConfig:null}});var ho=g(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.validateRetryThrottling=_d;Di.validateServiceConfig=Ed;Di.extractAndSelectServiceConfig=ay;var Jv=z("os"),Vn=B(),Yn=/^\d+(\.\d{1,9})?s$/,Qv="node";function Zv(i){if("service"in i&&i.service!==""){if(typeof i.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof i.service}`);if("method"in i&&i.method!==""){if(typeof i.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof i.service}`);return{service:i.service,method:i.method}}else return{service:i.service}}else{if("method"in i&&i.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function ey(i){if(!("maxAttempts"in i)||!Number.isInteger(i.maxAttempts)||i.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in i)||typeof i.initialBackoff!="string"||!Yn.test(i.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in i)||typeof i.maxBackoff!="string"||!Yn.test(i.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in i)||typeof i.backoffMultiplier!="number"||i.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in i&&Array.isArray(i.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(i.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of i.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(Vn.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(Vn.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:i.maxAttempts,initialBackoff:i.initialBackoff,maxBackoff:i.maxBackoff,backoffMultiplier:i.backoffMultiplier,retryableStatusCodes:i.retryableStatusCodes}}function ty(i){if(!("maxAttempts"in i)||!Number.isInteger(i.maxAttempts)||i.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in i&&(typeof i.hedgingDelay!="string"||!Yn.test(i.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in i&&Array.isArray(i.nonFatalStatusCodes))for(let t of i.nonFatalStatusCodes)if(typeof t=="number"){if(!Object.values(Vn.Status).includes(t))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(Vn.Status).includes(t.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:i.maxAttempts};return i.hedgingDelay&&(e.hedgingDelay=i.hedgingDelay),i.nonFatalStatusCodes&&(e.nonFatalStatusCodes=i.nonFatalStatusCodes),e}function ry(i){var e;let t={name:[]};if(!("name"in i)||!Array.isArray(i.name))throw new Error("Invalid method config: invalid name array");for(let r of i.name)t.name.push(Zv(r));if("waitForReady"in i){if(typeof i.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");t.waitForReady=i.waitForReady}if("timeout"in i)if(typeof i.timeout=="object"){if(!("seconds"in i.timeout)||typeof i.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in i.timeout)||typeof i.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");t.timeout=i.timeout}else if(typeof i.timeout=="string"&&Yn.test(i.timeout)){let r=i.timeout.substring(0,i.timeout.length-1).split(".");t.timeout={seconds:r[0]|0,nanos:((e=r[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in i){if(typeof i.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxRequestBytes=i.maxRequestBytes}if("maxResponseBytes"in i){if(typeof i.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxResponseBytes=i.maxResponseBytes}if("retryPolicy"in i){if("hedgingPolicy"in i)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");t.retryPolicy=ey(i.retryPolicy)}else"hedgingPolicy"in i&&(t.hedgingPolicy=ty(i.hedgingPolicy));return t}function _d(i){if(!("maxTokens"in i)||typeof i.maxTokens!="number"||i.maxTokens<=0||i.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in i)||typeof i.tokenRatio!="number"||i.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+i.maxTokens.toFixed(3),tokenRatio:+i.tokenRatio.toFixed(3)}}function iy(i){if(!(typeof i=="object"&&i!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof i}`);let e=Object.keys(i);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:i[e[0]]}}function Ed(i){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in i)if(typeof i.loadBalancingPolicy=="string")e.loadBalancingPolicy=i.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in i)if(Array.isArray(i.loadBalancingConfig))for(let r of i.loadBalancingConfig)e.loadBalancingConfig.push(iy(r));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in i&&Array.isArray(i.methodConfig))for(let r of i.methodConfig)e.methodConfig.push(ry(r));"retryThrottling"in i&&(e.retryThrottling=_d(i.retryThrottling));let t=[];for(let r of e.methodConfig)for(let n of r.name){for(let s of t)if(n.service===s.service&&n.method===s.method)throw new Error(`Invalid service config: duplicate name ${n.service}/${n.method}`);t.push(n)}return e}function ny(i){if(!("serviceConfig"in i))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:Ed(i.serviceConfig)};if("clientLanguage"in i)if(Array.isArray(i.clientLanguage)){e.clientLanguage=[];for(let r of i.clientLanguage)if(typeof r=="string")e.clientLanguage.push(r);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in i)if(Array.isArray(i.clientHostname)){e.clientHostname=[];for(let r of i.clientHostname)if(typeof r=="string")e.clientHostname.push(r);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in i)if(typeof i.percentage=="number"&&0<=i.percentage&&i.percentage<=100)e.percentage=i.percentage;else throw new Error("Invalid service config choice: invalid percentage");let t=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let r in i)if(!t.includes(r))throw new Error(`Invalid service config choice: unexpected field ${r}`);return e}function sy(i,e){if(!Array.isArray(i))throw new Error("Invalid service config list");for(let t of i){let r=ny(t);if(!(typeof r.percentage=="number"&&e>r.percentage)){if(Array.isArray(r.clientHostname)){let n=!1;for(let s of r.clientHostname)s===Jv.hostname()&&(n=!0);if(!n)continue}if(Array.isArray(r.clientLanguage)){let n=!1;for(let s of r.clientLanguage)s===Qv&&(n=!0);if(!n)continue}return r.serviceConfig}}throw new Error("No matching service config found")}function ay(i,e){for(let t of i)if(t.length>0&&t[0].startsWith("grpc_config=")){let r=t.join("").substring(12),n=JSON.parse(r);return sy(n,e)}return null}});var Pe=g(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.ConnectivityState=void 0;var Sd;(function(i){i[i.IDLE=0]="IDLE",i[i.CONNECTING=1]="CONNECTING",i[i.READY=2]="READY",i[i.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",i[i.SHUTDOWN=4]="SHUTDOWN"})(Sd||(Kn.ConnectivityState=Sd={}))});var xt=g(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.QueuePicker=Xt.UnavailablePicker=Xt.PickResultType=void 0;var oy=pe(),ly=B(),Xn;(function(i){i[i.COMPLETE=0]="COMPLETE",i[i.QUEUE=1]="QUEUE",i[i.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",i[i.DROP=3]="DROP"})(Xn||(Xt.PickResultType=Xn={}));var fo=class{constructor(e){this.status=Object.assign({code:ly.Status.UNAVAILABLE,details:"No connection established",metadata:new oy.Metadata},e)}pick(e){return{pickResultType:Xn.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Xt.UnavailablePicker=fo;var po=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:Xn.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Xt.QueuePicker=po});var Wr=g(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.BackoffTimeout=void 0;var cy=B(),Cd=ee(),Td="backoff",uy=1e3,dy=1.6,hy=12e4,fy=.2;function py(i,e){return Math.random()*(e-i)+i}var Jn=class i{constructor(e,t){this.callback=e,this.initialDelay=uy,this.multiplier=dy,this.maxDelay=hy,this.jitter=fy,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=i.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.traceEnabled&&this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}get traceEnabled(){return Cd.isTracerEnabled(Td)}trace(e){this.traceEnabled&&Cd.trace(cy.LogVerbosity.DEBUG,Td,"{"+this.id+"} "+e)}runTimer(e){var t,r;this.traceEnabled&&this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(r=(t=this.timerId).unref)===null||r===void 0||r.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+py(-t,t)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.traceEnabled&&this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};Qn.BackoffTimeout=Jn;Jn.nextId=0});var es=g(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ChildLoadBalancerHandler=void 0;var gy=Kt(),my=Pe(),vy="child_load_balancer_helper",go=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,r){return this.parent.channelControlHelper.createSubchannel(t,r)}updateState(t,r,n){var s;if(this.calledByPendingChild()){if(t===my.ConnectivityState.CONNECTING)return;(s=this.parent.currentChild)===null||s===void 0||s.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,r,n)}requestReresolution(){var t;let r=(t=this.parent.pendingChild)!==null&&t!==void 0?t:this.parent.currentChild;this.child===r&&this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,r,n){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),o=(0,gy.createLoadBalancer)(t,a);a.setChild(o),this.currentChild===null?(this.currentChild=o,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=o,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;return this.latestConfig=t,s.updateAddressList(e,t,r,n)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return vy}};Zn.ChildLoadBalancerHandler=go});var Ad=g(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ResolvingLoadBalancer=void 0;Fi.getDefaultConfigSelector=Od;var yy=Kt(),_y=ho(),xe=Pe(),bd=et(),Li=xt(),Ey=Wr(),wd=B(),Sy=pe(),Cy=ee(),Ty=B(),by=ke(),Ry=es(),wy="resolving_load_balancer";function Rd(i){Cy.trace(Ty.LogVerbosity.DEBUG,wy,i)}var Oy=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function Ay(i,e,t,r){for(let n of t.name)switch(r){case"EMPTY":if(!n.service&&!n.method)return!0;break;case"SERVICE":if(n.service===i&&!n.method)return!0;break;case"SERVICE_AND_METHOD":if(n.service===i&&n.method===e)return!0}return!1}function Ny(i,e,t,r){for(let n of t)if(Ay(i,e,n,r))return n;return null}var Py=100;function Od(i){let e=new Map;return{invoke(t,r,n){var s,a;let o=e.get(t);if(o===void 0){let l=t.split("/").filter(h=>h.length>0),c=(s=l[0])!==null&&s!==void 0?s:"",u=(a=l[1])!==null&&a!==void 0?a:"";if(o={name:[]},i&&i.methodConfig)for(let h of Oy){let f=Ny(c,u,i.methodConfig,h);if(f){o=f;break}}e.size<Py&&e.set(t,o)}return{methodConfig:o,pickInformation:{},status:wd.Status.OK,dynamicFilterFactories:[]}},unref(){e.clear()}}}var mo=class{constructor(e,t,r,n,s){this.target=e,this.channelControlHelper=t,this.channelOptions=r,this.onSuccessfulResolution=n,this.onFailedResolution=s,this.latestChildState=xe.ConnectivityState.IDLE,this.latestChildPicker=new Li.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=xe.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,r["grpc.service_config"]?this.defaultServiceConfig=(0,_y.validateServiceConfig)(JSON.parse(r["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(xe.ConnectivityState.IDLE,new Li.QueuePicker(this),null),this.childLoadBalancer=new Ry.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?(Rd("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(o,l,c)=>{this.latestChildState=o,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(o,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,bd.createResolver)(e,this.handleResolverResult.bind(this),r);let a={initialDelay:r["grpc.initial_reconnect_backoff_ms"],maxDelay:r["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Ey.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},a),this.backoffTimeout.unref()}handleResolverResult(e,t,r,n){var s,a;this.backoffTimeout.stop(),this.backoffTimeout.reset();let o=!0,l=null;if(r===null?l=this.defaultServiceConfig:r.ok?l=r.value:this.previousServiceConfig!==null?l=this.previousServiceConfig:(o=!1,this.handleResolutionFailure(r.error)),l!==null){let c=(s=l?.loadBalancingConfig)!==null&&s!==void 0?s:[],u=(0,yy.selectLbConfigFromList)(c,!0);u===null?(o=!1,this.handleResolutionFailure({code:wd.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new Sy.Metadata})):o=this.childLoadBalancer.updateAddressList(e,u,Object.assign(Object.assign({},this.channelOptions),t),n)}return o&&this.onSuccessfulResolution(l,(a=t[bd.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&a!==void 0?a:Od(l)),o}updateResolution(){this.innerResolver.updateResolution(),this.currentState===xe.ConnectivityState.IDLE&&this.updateState(xe.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,r){Rd((0,by.uriToString)(this.target)+" "+xe.ConnectivityState[this.currentState]+" -> "+xe.ConnectivityState[e]),e===xe.ConnectivityState.IDLE&&(t=new Li.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,r)}handleResolutionFailure(e){this.latestChildState===xe.ConnectivityState.IDLE&&(this.updateState(xe.ConnectivityState.TRANSIENT_FAILURE,new Li.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===xe.ConnectivityState.IDLE||this.currentState===xe.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=xe.ConnectivityState.IDLE,this.latestChildPicker=new Li.QueuePicker(this),this.currentState=xe.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Fi.ResolvingLoadBalancer=mo});var Nd=g(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.recognizedOptions=void 0;qi.channelOptionsEqual=Iy;qi.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0};function Iy(i,e){let t=Object.keys(i).sort(),r=Object.keys(e).sort();if(t.length!==r.length)return!1;for(let n=0;n<t.length;n+=1)if(t[n]!==r[n]||i[t[n]]!==e[r[n]])return!1;return!0}});var De=g(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.EndpointMap=void 0;tt.isTcpSubchannelAddress=Bi;tt.subchannelAddressEqual=ts;tt.subchannelAddressToString=Id;tt.stringToSubchannelAddress=ky;tt.endpointEqual=xy;tt.endpointToString=Dy;tt.endpointHasAddress=Md;var Pd=z("net");function Bi(i){return"port"in i}function ts(i,e){return!i&&!e?!0:!i||!e?!1:Bi(i)?Bi(e)&&i.host===e.host&&i.port===e.port:!Bi(e)&&i.path===e.path}function Id(i){return Bi(i)?(0,Pd.isIPv6)(i.host)?"["+i.host+"]:"+i.port:i.host+":"+i.port:i.path}var My=443;function ky(i,e){return(0,Pd.isIP)(i)?{host:i,port:e??My}:{path:i}}function xy(i,e){if(i.addresses.length!==e.addresses.length)return!1;for(let t=0;t<i.addresses.length;t++)if(!ts(i.addresses[t],e.addresses[t]))return!1;return!0}function Dy(i){return"["+i.addresses.map(Id).join(", ")+"]"}function Md(i,e){for(let t of i.addresses)if(ts(t,e))return!0;return!1}function Ui(i,e){if(i.addresses.length!==e.addresses.length)return!1;for(let t of i.addresses){let r=!1;for(let n of e.addresses)if(ts(t,n)){r=!0;break}if(!r)return!1}return!0}var vo=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Md(t.key,e))return t.value}deleteMissing(e){let t=[];for(let r of this.map){let n=!1;for(let s of e)Ui(s,r.key)&&(n=!0);n||(t.push(r.value),this.map.delete(r))}return t}get(e){for(let t of this.map)if(Ui(e,t.key))return t.value}set(e,t){for(let r of this.map)if(Ui(e,r.key)){r.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ui(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ui(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};tt.EndpointMap=vo});var xd={};Jm(xd,{OrderedMap:()=>jy});function Gr(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");yo(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Ly(i,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(t=0)),t;)try{if(r=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,n=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(i,t)}catch(u){c=[6,u],n=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function vr(){throw new RangeError("Iterator access denied!")}var yo,kd,Fy,qy,Uy,By,zy,Hy,Dt,jy,Dd=Xm(()=>{"use strict";yo=function(i,e){return yo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},yo(i,e)};kd=(function(){function i(e,t,r){r===void 0&&(r=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=r}return i.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var r=e.h;r.t===e;)e=r,r=e.h;e=r}return e},i.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},i.prototype.T=function(){var e=this.h,t=this.i,r=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=r,r&&(r.h=this),t},i.prototype.I=function(){var e=this.h,t=this.t,r=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=r,r&&(r.h=this),t},i})(),Fy=(function(i){Gr(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=i.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=i.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e})(kd),qy=(function(){function i(e){e===void 0&&(e=0),this.iteratorType=e}return i.prototype.equals=function(e){return this.C===e.C},i})(),Uy=(function(){function i(){this._=0}return Object.defineProperty(i.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this._},i.prototype.empty=function(){return this._===0},i})(),By=(function(i){Gr(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e})(Uy);zy=(function(i){Gr(e,i);function e(t,r){t===void 0&&(t=function(s,a){return s<a?-1:s>a?1:0}),r===void 0&&(r=!1);var n=i.call(this)||this;return n.N=void 0,n.g=t,n.enableIndex=r,n.S=r?Fy:kd,n.A=new n.S,n}return e.prototype.m=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);if(s<0)t=t.i;else if(s>0)n=t,t=t.t;else return t}return n},e.prototype.B=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);s<=0?t=t.i:(n=t,t=t.t)}return n},e.prototype.j=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);if(s<0)n=t,t=t.i;else if(s>0)t=t.t;else return t}return n},e.prototype.k=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);s<0?(n=t,t=t.i):t=t.t}return n},e.prototype.R=function(t){for(;;){var r=t.h;if(r===this.A)return;if(t.l===1){t.l=0;return}if(t===r.t){var n=r.i;if(n.l===1)n.l=0,r.l=1,r===this.N?this.N=r.T():r.T();else if(n.i&&n.i.l===1){n.l=r.l,r.l=0,n.i.l=0,r===this.N?this.N=r.T():r.T();return}else n.t&&n.t.l===1?(n.l=1,n.t.l=0,n.I()):(n.l=1,t=r)}else{var n=r.t;if(n.l===1)n.l=0,r.l=1,r===this.N?this.N=r.I():r.I();else if(n.t&&n.t.l===1){n.l=r.l,r.l=0,n.t.l=0,r===this.N?this.N=r.I():r.I();return}else n.i&&n.i.l===1?(n.l=1,n.i.l=0,n.T()):(n.l=1,t=r)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var r=t;r.t||r.i;){if(r.i)for(r=r.i;r.t;)r=r.t;else r=r.t;var n=t.u;t.u=r.u,r.u=n;var s=t.o;t.o=r.o,r.o=s,t=r}this.A.t===r?this.A.t=r.h:this.A.i===r&&(this.A.i=r.h),this.R(r);var a=r.h;if(r===a.t?a.t=void 0:a.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;a!==this.A;)a.O-=1,a=a.h},e.prototype.P=function(t){for(var r=typeof t=="number"?t:void 0,n=typeof t=="function"?t:void 0,s=typeof t>"u"?[]:void 0,a=0,o=this.N,l=[];l.length||o;)if(o)l.push(o),o=o.t;else{if(o=l.pop(),a===r)return o;s&&s.push(o),n&&n(o,a,this),a+=1,o=o.i}return s},e.prototype.q=function(t){for(;;){var r=t.h;if(r.l===0)return;var n=r.h;if(r===n.t){var s=n.i;if(s&&s.l===1){if(s.l=r.l=0,n===this.N)return;n.l=1,t=n;continue}else if(t===r.i){if(t.l=0,t.t&&(t.t.h=r),t.i&&(t.i.h=n),r.i=t.t,n.t=t.i,t.t=r,t.i=n,n===this.N)this.N=t,this.A.h=t;else{var a=n.h;a.t===n?a.t=t:a.i=t}t.h=n.h,r.h=t,n.h=t,n.l=1}else{r.l=0,n===this.N?this.N=n.I():n.I(),n.l=1;return}}else{var s=n.t;if(s&&s.l===1){if(s.l=r.l=0,n===this.N)return;n.l=1,t=n;continue}else if(t===r.t){if(t.l=0,t.t&&(t.t.h=n),t.i&&(t.i.h=r),n.i=t.t,r.t=t.i,t.t=n,t.i=r,n===this.N)this.N=t,this.A.h=t;else{var a=n.h;a.t===n?a.t=t:a.i=t}t.h=n.h,r.h=t,n.h=t,n.l=1}else{r.l=0,n===this.N?this.N=n.T():n.T(),n.l=1;return}}this.enableIndex&&(r.M(),n.M(),t.M());return}},e.prototype.D=function(t,r,n){if(this.N===void 0)return this._+=1,this.N=new this.S(t,r,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var s,a=this.A.t,o=this.g(a.u,t);if(o===0)return a.o=r,this._;if(o>0)a.t=new this.S(t,r),a.t.h=a,s=a.t,this.A.t=s;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=r,this._;if(c<0)l.i=new this.S(t,r),l.i.h=l,s=l.i,this.A.i=s;else{if(n!==void 0){var u=n.C;if(u!==this.A){var h=this.g(u.u,t);if(h===0)return u.o=r,this._;if(h>0){var f=u.v(),_=this.g(f.u,t);if(_===0)return f.o=r,this._;_<0&&(s=new this.S(t,r),f.i===void 0?(f.i=s,s.h=f):(u.t=s,s.h=u))}}}if(s===void 0)for(s=this.N;;){var p=this.g(s.u,t);if(p>0){if(s.t===void 0){s.t=new this.S(t,r),s.t.h=s,s=s.t;break}s=s.t}else if(p<0){if(s.i===void 0){s.i=new this.S(t,r),s.i.h=s,s=s.i;break}s=s.i}else return s.o=r,this._}}}if(this.enableIndex)for(var v=s.h;v!==this.A;)v.O+=1,v=v.h;return this.q(s),this._+=1,this._},e.prototype.F=function(t,r){for(;t;){var n=this.g(t.u,r);if(n<0)t=t.i;else if(n>0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,r){var n=t.C;if(n===this.A&&vr(),this._===1)return n.u=r,!0;var s=n.p().u;if(n===this.A.t)return this.g(s,r)>0?(n.u=r,!0):!1;var a=n.v().u;return n===this.A.i?this.g(a,r)<0?(n.u=r,!0):!1:this.g(a,r)>=0||this.g(s,r)<=0?!1:(n.u=r,!0)},e.prototype.eraseElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var r=this.P(t);return this.G(r),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var r=this.F(this.N,t);return r===this.A?!1:(this.G(r),!0)},e.prototype.eraseElementByIterator=function(t){var r=t.C;r===this.A&&vr();var n=r.i===void 0,s=t.iteratorType===0;return s?n&&t.next():(!n||r.t===void 0)&&t.next(),this.G(r),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(r){return r?Math.max(t(r.t),t(r.i))+1:0}return t(this.N)},e})(By),Hy=(function(i){Gr(e,i);function e(t,r,n){var s=i.call(this,n)||this;return s.C=t,s.A=r,s.iteratorType===0?(s.pre=function(){return this.C===this.A.t&&vr(),this.C=this.C.v(),this},s.next=function(){return this.C===this.A&&vr(),this.C=this.C.p(),this}):(s.pre=function(){return this.C===this.A.i&&vr(),this.C=this.C.p(),this},s.next=function(){return this.C===this.A&&vr(),this.C=this.C.v(),this}),s}return Object.defineProperty(e.prototype,"index",{get:function(){var t=this.C,r=this.A.h;if(t===this.A)return r?r.O-1:0;var n=0;for(t.t&&(n+=t.t.O);t!==r;){var s=t.h;t===s.i&&(n+=1,s.t&&(n+=s.t.O)),t=s}return n},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(qy),Dt=(function(i){Gr(e,i);function e(t,r,n,s){var a=i.call(this,t,r,s)||this;return a.container=n,a}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&vr();var t=this;return new Proxy([],{get:function(r,n){return n==="0"?t.C.u:n==="1"?t.C.o:(r[0]=t.C.u,r[1]=t.C.o,r[n])},set:function(r,n,s){if(n!=="1")throw new TypeError("prop must be 1");return t.C.o=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Hy),jy=(function(i){Gr(e,i);function e(t,r,n){t===void 0&&(t=[]);var s=i.call(this,r,n)||this,a=s;return t.forEach((function(o){a.setElement(o[0],o[1])})),s}return e.prototype.begin=function(){return new Dt(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new Dt(this.A,this.A,this)},e.prototype.rBegin=function(){return new Dt(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new Dt(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var r=this.m(this.N,t);return new Dt(r,this.A,this)},e.prototype.upperBound=function(t){var r=this.B(this.N,t);return new Dt(r,this.A,this)},e.prototype.reverseLowerBound=function(t){var r=this.j(this.N,t);return new Dt(r,this.A,this)},e.prototype.reverseUpperBound=function(t){var r=this.k(this.N,t);return new Dt(r,this.A,this)},e.prototype.forEach=function(t){this.P((function(r,n,s){t([r.u,r.o],n,s)}))},e.prototype.setElement=function(t,r,n){return this.D(t,r,n)},e.prototype.getElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var r=this.P(t);return[r.u,r.o]},e.prototype.find=function(t){var r=this.F(this.N,t);return new Dt(r,this.A,this)},e.prototype.getElementByKey=function(t){var r=this.F(this.N,t);return r.o},e.prototype.union=function(t){var r=this;return t.forEach((function(n){r.setElement(n[0],n[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,r,n,s;return Ly(this,(function(a){switch(a.label){case 0:t=this._,r=this.P(),n=0,a.label=1;case 1:return n<t?(s=r[n],[4,[s.u,s.o]]):[3,4];case 2:a.sent(),a.label=3;case 3:return++n,[3,1];case 4:return[2]}}))},e})(zy)});var is=g(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.registerAdminService=Wy;rs.addAdminServicesToServer=Gy;var Ld=[];function Wy(i,e){Ld.push({getServiceDefinition:i,getHandlers:e})}function Gy(i){for(let{getServiceDefinition:e,getHandlers:t}of Ld)i.addService(e(),t())}});var Fd=g(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ClientDuplexStreamImpl=rt.ClientWritableStreamImpl=rt.ClientReadableStreamImpl=rt.ClientUnaryCallImpl=void 0;rt.callErrorFromStatus=Vy;var $y=z("events"),To=z("stream"),zi=B();function Vy(i,e){let t=`${i.code} ${zi.Status[i.code]}: ${i.details}`,n=`${new Error(t).stack}
|
|
4
|
+
import{a as td}from"./chunk-XN7SUAOW.js";import{c as Zu,d as ed,v as ev,w as tv}from"./chunk-3FNHYMQD.js";import{o as Qm,p as Zm}from"./chunk-FOFOAOHI.js";import{a as z,b as Xm,c as g,d as Jm,f as Ai}from"./chunk-7MKA3SHV.js";var rd=g(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.VERSION=void 0;qn.VERSION="0.222.0"});var B=g($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=$e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=$e.Propagate=$e.LogVerbosity=$e.Status=void 0;var id;(function(i){i[i.OK=0]="OK",i[i.CANCELLED=1]="CANCELLED",i[i.UNKNOWN=2]="UNKNOWN",i[i.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",i[i.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",i[i.NOT_FOUND=5]="NOT_FOUND",i[i.ALREADY_EXISTS=6]="ALREADY_EXISTS",i[i.PERMISSION_DENIED=7]="PERMISSION_DENIED",i[i.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",i[i.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",i[i.ABORTED=10]="ABORTED",i[i.OUT_OF_RANGE=11]="OUT_OF_RANGE",i[i.UNIMPLEMENTED=12]="UNIMPLEMENTED",i[i.INTERNAL=13]="INTERNAL",i[i.UNAVAILABLE=14]="UNAVAILABLE",i[i.DATA_LOSS=15]="DATA_LOSS",i[i.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(id||($e.Status=id={}));var nd;(function(i){i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.ERROR=2]="ERROR",i[i.NONE=3]="NONE"})(nd||($e.LogVerbosity=nd={}));var sd;(function(i){i[i.DEADLINE=1]="DEADLINE",i[i.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",i[i.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",i[i.CANCELLATION=8]="CANCELLATION",i[i.DEFAULTS=65535]="DEFAULTS"})(sd||($e.Propagate=sd={}));$e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;$e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var Va=g((aw,rv)=>{rv.exports={name:"@grpc/grpc-js",version:"1.14.7",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto","copy-protos":"node ./copy-protos"},dependencies:{"@grpc/proto-loader":"^0.8.0","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/**/*.proto","proto/**/LICENSE","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var ee=g(Be=>{"use strict";var Ya,Ka,Xa,Ja;Object.defineProperty(Be,"__esModule",{value:!0});Be.log=Be.setLoggerVerbosity=Be.setLogger=Be.getLogger=void 0;Be.trace=fv;Be.isTracerEnabled=ld;var $t=B(),iv=z("process"),nv=Va().version,sv={error:(i,...e)=>{console.error("E "+i,...e)},info:(i,...e)=>{console.error("I "+i,...e)},debug:(i,...e)=>{console.error("D "+i,...e)}},gr=sv,Ur=$t.LogVerbosity.ERROR,av=(Ka=(Ya=process.env.GRPC_NODE_VERBOSITY)!==null&&Ya!==void 0?Ya:process.env.GRPC_VERBOSITY)!==null&&Ka!==void 0?Ka:"";switch(av.toUpperCase()){case"DEBUG":Ur=$t.LogVerbosity.DEBUG;break;case"INFO":Ur=$t.LogVerbosity.INFO;break;case"ERROR":Ur=$t.LogVerbosity.ERROR;break;case"NONE":Ur=$t.LogVerbosity.NONE;break;default:}var ov=()=>gr;Be.getLogger=ov;var lv=i=>{gr=i};Be.setLogger=lv;var cv=i=>{Ur=i};Be.setLoggerVerbosity=cv;var uv=(i,...e)=>{let t;if(i>=Ur){switch(i){case $t.LogVerbosity.DEBUG:t=gr.debug;break;case $t.LogVerbosity.INFO:t=gr.info;break;case $t.LogVerbosity.ERROR:t=gr.error;break}t||(t=gr.error),t&&t.bind(gr)(...e)}};Be.log=uv;var dv=(Ja=(Xa=process.env.GRPC_NODE_TRACE)!==null&&Xa!==void 0?Xa:process.env.GRPC_TRACE)!==null&&Ja!==void 0?Ja:"",Un=new Set,ad=new Set;for(let i of dv.split(","))i.length!==0&&(i.startsWith("-")?ad.add(i.substring(1)):Un.add(i));var od=Un.has("all"),hv=od||Un.size>0;function fv(i,e,t){ld(e)&&(0,Be.log)(i,new Date().toISOString()+" | v"+nv+" "+iv.pid+" | "+e+" | "+t)}function ld(i){return hv?!ad.has(i)&&(od||Un.has(i)):!1}});var zn=g(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.getErrorMessage=pv;Bn.getErrorCode=gv;function pv(i){return i instanceof Error?i.message:String(i)}function gv(i){return typeof i=="object"&&i!==null&&"code"in i&&typeof i.code=="number"?i.code:null}});var pe=g(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Metadata=void 0;var mv=ee(),vv=B(),yv=zn(),_v=/^[:0-9a-z_.-]+$/,Ev=/^[ -~]*$/;function Sv(i){return _v.test(i)}function Cv(i){return Ev.test(i)}function dd(i){return i.endsWith("-bin")}function Tv(i){return!i.startsWith("grpc-")}function Hn(i){return i.toLowerCase()}function cd(i,e){if(!Sv(i))throw new Error('Metadata key "'+i+'" contains illegal characters');if(e!=null)if(dd(i)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!Cv(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var Qa=class i{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=Hn(e),cd(e,t),this.internalRepr.set(e,[t])}add(e,t){e=Hn(e),cd(e,t);let r=this.internalRepr.get(e);r===void 0?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=Hn(e),this.internalRepr.delete(e)}get(e){return e=Hn(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,r]of this.internalRepr)if(r.length>0){let n=r[0];e[t]=Buffer.isBuffer(n)?Buffer.from(n):n}return e}clone(){let e=new i(this.options),t=e.internalRepr;for(let[r,n]of this.internalRepr){let s=n.map(a=>Buffer.isBuffer(a)?Buffer.from(a):a);t.set(r,s)}return e}merge(e){for(let[t,r]of e.internalRepr){let n=(this.internalRepr.get(t)||[]).concat(r);this.internalRepr.set(t,n)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,r]of this.internalRepr)t.startsWith(":")||(r.length===1?e[t]=ud(r[0]):e[t]=r.map(ud));return e}toJSON(){let e={};for(let[t,r]of this.internalRepr)e[t]=r;return e}setOpaque(e,t){this.opaqueData||(this.opaqueData=new Map),this.opaqueData.set(e,t)}getOpaque(e){var t;return(t=this.opaqueData)===null||t===void 0?void 0:t.get(e)}static fromHttp2Headers(e){let t=new i;for(let r of Object.keys(e)){if(r.charAt(0)===":")continue;let n=e[r];try{dd(r)?Array.isArray(n)?n.forEach(s=>{t.add(r,Buffer.from(s,"base64"))}):n!==void 0&&(Tv(r)?n.split(",").forEach(s=>{t.add(r,Buffer.from(s.trim(),"base64"))}):t.add(r,Buffer.from(n,"base64"))):Array.isArray(n)?n.forEach(s=>{t.add(r,s)}):n!==void 0&&t.add(r,n)}catch(s){let a=`Failed to add metadata entry ${r}: ${n}. ${(0,yv.getErrorMessage)(s)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,mv.log)(vv.LogVerbosity.ERROR,a)}}return t}};jn.Metadata=Qa;var ud=i=>Buffer.isBuffer(i)?i.toString("base64"):i});var Pi=g(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.CallCredentials=void 0;Ni.isEmptyCallCredentials=Rv;var to=pe();function bv(i){return"getRequestHeaders"in i&&typeof i.getRequestHeaders=="function"}var Br=class i{static createFromMetadataGenerator(e){return new eo(e)}static createFromGoogleCredential(e){return i.createFromMetadataGenerator((t,r)=>{let n;bv(e)?n=e.getRequestHeaders(t.service_url):n=new Promise((s,a)=>{e.getRequestMetadata(t.service_url,(o,l)=>{if(o){a(o);return}if(!l){a(new Error("Headers not set by metadata plugin"));return}s(l)})}),n.then(s=>{let a=new to.Metadata;for(let o of Object.keys(s))a.add(o,s[o]);r(null,a)},s=>{r(s)})})}static createEmpty(){return new zr}};Ni.CallCredentials=Br;var Za=class i extends Br{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new to.Metadata,r=await Promise.all(this.creds.map(n=>n.generateMetadata(e)));for(let n of r)t.merge(n);return t}compose(e){return e instanceof zr?this:new i(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof i?this.creds.every((t,r)=>t._equals(e.creds[r])):!1}},eo=class i extends Br{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,r)=>{this.metadataGenerator(e,(n,s)=>{s!==void 0?t(s):r(n)})})}compose(e){return e instanceof zr?this:new Za([this,e])}_equals(e){return this===e?!0:e instanceof i?this.metadataGenerator===e.metadataGenerator:!1}},zr=class i extends Br{generateMetadata(e){return Promise.resolve(new to.Metadata)}compose(e){return e}_equals(e){return e instanceof i}};function Rv(i){return i instanceof zr}});var io=g(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CIPHER_SUITES=void 0;Ii.getDefaultRootsData=Ov;var wv=z("fs");Ii.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var hd=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,ro=null;function Ov(){return hd?(ro===null&&(ro=wv.readFileSync(hd)),ro):null}});var ke=g(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.parseUri=Nv;Vt.splitHostPort=pd;Vt.combineHostPort=Pv;Vt.uriToString=Iv;Vt.extractServiceName=gd;Vt.computeServiceUrl=Mv;var Av=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function Nv(i){let e=Av.exec(i);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var fd=/^\d+$/;function pd(i){if(i.startsWith("[")){let e=i.indexOf("]");if(e===-1)return null;let t=i.substring(1,e);if(t.indexOf(":")===-1)return null;if(i.length>e+1)if(i[e+1]===":"){let r=i.substring(e+2);return fd.test(r)?{host:t,port:+r}:null}else return null;else return{host:t}}else{let e=i.split(":");return e.length===2?fd.test(e[1])?{host:e[0],port:+e[1]}:null:{host:i}}}function Pv(i){return i.port===void 0?i.host:i.host.includes(":")?`[${i.host}]:${i.port}`:`${i.host}:${i.port}`}function Iv(i){let e="";return i.scheme!==void 0&&(e+=i.scheme+":"),i.authority!==void 0&&(e+="//"+i.authority+"/"),e+=i.path,e}function gd(i){let e=i.indexOf("/");if(e===-1)return"";let t=i.indexOf("/",e+1);return t===-1?i.substring(e+1):i.substring(e+1,t)}function Mv(i,e){var t,r;let n=gd(e);return`https://${(r=(t=pd(i))===null||t===void 0?void 0:t.host)!==null&&r!==void 0?r:"localhost"}/${n}`}});var et=g(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;kt.registerResolver=kv;kt.registerDefaultScheme=xv;kt.createResolver=Dv;kt.getDefaultAuthority=Lv;kt.mapUriDefaultScheme=Fv;var so=ke();kt.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var Hr={},no=null;function kv(i,e){Hr[i]=e}function xv(i){no=i}function Dv(i,e,t){if(i.scheme!==void 0&&i.scheme in Hr)return new Hr[i.scheme](i,e,t);throw new Error(`No resolver could be created for target ${(0,so.uriToString)(i)}`)}function Lv(i){if(i.scheme!==void 0&&i.scheme in Hr)return Hr[i.scheme].getDefaultAuthority(i);throw new Error(`Invalid target ${(0,so.uriToString)(i)}`)}function Fv(i){return i.scheme===void 0||!(i.scheme in Hr)?no!==null?{scheme:no,authority:void 0,path:(0,so.uriToString)(i)}:null:i}});var jr=g(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ChannelCredentials=void 0;ki.createCertificateProviderChannelCredentials=zv;var Mi=z("tls"),$n=Pi(),oo=io(),md=ke(),qv=et(),Uv=ee(),Bv=B();function ao(i,e){if(i&&!(i instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var mr=class{compose(e){return new uo(this,e)}static createSsl(e,t,r,n){var s;if(ao(e,"Root certificate"),ao(t,"Private key"),ao(r,"Certificate chain"),t&&!r)throw new Error("Private key must be given with accompanying certificate chain");if(!t&&r)throw new Error("Certificate chain must be given with accompanying private key");let a=(0,Mi.createSecureContext)({ca:(s=e??(0,oo.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,key:t??void 0,cert:r??void 0,ciphers:oo.CIPHER_SUITES});return new Wn(a,n??{})}static createFromSecureContext(e,t){return new Wn(e,t??{})}static createInsecure(){return new lo}};ki.ChannelCredentials=mr;var lo=class i extends mr{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof i}_createSecureConnector(e,t,r){let n=r??$n.CallCredentials.createEmpty();return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>n,destroy(){}}}};function vd(i,e,t,r){var n,s;let a={secureContext:i},o=t;if("grpc.http_connect_target"in r){let h=(0,md.parseUri)(r["grpc.http_connect_target"]);h&&(o=h)}let l=(0,qv.getDefaultAuthority)(o),c=(0,md.splitHostPort)(l),u=(n=c?.host)!==null&&n!==void 0?n:l;if(a.host=u,e.checkServerIdentity&&(a.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(a.rejectUnauthorized=e.rejectUnauthorized),a.ALPNProtocols=["h2"],r["grpc.ssl_target_name_override"]){let h=r["grpc.ssl_target_name_override"],f=(s=a.checkServerIdentity)!==null&&s!==void 0?s:Mi.checkServerIdentity;a.checkServerIdentity=(_,p)=>f(h,p),a.servername=h}else a.servername=u;return r["grpc-node.tls_enable_trace"]&&(a.enableTrace=!0),a}var co=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((r,n)=>{let s=(0,Mi.connect)(t,()=>{var a;if((!((a=this.connectionOptions.rejectUnauthorized)!==null&&a!==void 0)||a)&&!s.authorized){n(s.authorizationError);return}r({socket:s,secure:!0})});s.on("error",a=>{n(a)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},Wn=class i extends mr{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof i?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,r){let n=vd(this.secureContext,this.verifyOptions,e,t);return new co(n,r??$n.CallCredentials.createEmpty())}},Gn=class i extends mr{constructor(e,t,r){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=r,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,r;return this===e?!0:e instanceof i?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((r=e.verifyOptions)===null||r===void 0?void 0:r.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,r){return this.ref(),new i.SecureConnectorImpl(this,e,t,r??$n.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,Mi.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:oo.CIPHER_SUITES})}catch(r){return(0,Uv.log)(Bv.LogVerbosity.ERROR,"Failed to createSecureContext with error "+r.message),null}}};Gn.SecureConnectorImpl=class{constructor(i,e,t,r){this.parent=i,this.channelTarget=e,this.options=t,this.callCredentials=r}connect(i){return new Promise((e,t)=>{let r=this.parent.getLatestSecureContext();if(!r){t(new Error("Failed to load credentials"));return}i.closed&&t(new Error("Socket closed while loading credentials"));let n=vd(r,this.parent.verifyOptions,this.channelTarget,this.options),s=Object.assign({socket:i},n),a=()=>{t(new Error("Socket closed"))},o=c=>{t(c)},l=(0,Mi.connect)(s,()=>{var c;if(l.removeListener("close",a),l.removeListener("error",o),(!((c=this.parent.verifyOptions.rejectUnauthorized)!==null&&c!==void 0)||c)&&!l.authorized){t(l.authorizationError);return}e({socket:l,secure:!0})});l.once("close",a),l.once("error",o)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function zv(i,e,t){return new Gn(i,e,t??{})}var uo=class i extends mr{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let t=this.callCredentials.compose(e);return new i(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof i?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,r){let n=this.callCredentials.compose(r??$n.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,n)}}});var Kt=g(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.createChildChannelControlHelper=Wv;mt.registerLoadBalancerType=Gv;mt.registerDefaultLoadBalancerType=$v;mt.createLoadBalancer=Vv;mt.isLoadBalancerNameRegistered=Yv;mt.parseLoadBalancingConfig=yd;mt.getDefaultConfig=Kv;mt.selectLbConfigFromList=Xv;var Hv=ee(),jv=B();function Wv(i,e){var t,r,n,s,a,o,l,c,u,h;return{createSubchannel:(r=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&&r!==void 0?r:i.createSubchannel.bind(i),updateState:(s=(n=e.updateState)===null||n===void 0?void 0:n.bind(e))!==null&&s!==void 0?s:i.updateState.bind(i),requestReresolution:(o=(a=e.requestReresolution)===null||a===void 0?void 0:a.bind(e))!==null&&o!==void 0?o:i.requestReresolution.bind(i),addChannelzChild:(c=(l=e.addChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&&c!==void 0?c:i.addChannelzChild.bind(i),removeChannelzChild:(h=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&h!==void 0?h:i.removeChannelzChild.bind(i)}}var Yt={},xi=null;function Gv(i,e,t){Yt[i]={LoadBalancer:e,LoadBalancingConfig:t}}function $v(i){xi=i}function Vv(i,e){let t=i.getLoadBalancerName();return t in Yt?new Yt[t].LoadBalancer(e):null}function Yv(i){return i in Yt}function yd(i){let e=Object.keys(i);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let t=e[0];if(t in Yt)try{return Yt[t].LoadBalancingConfig.createFromJson(i[t])}catch(r){throw new Error(`${t}: ${r.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function Kv(){if(!xi)throw new Error("No default load balancer type registered");return new Yt[xi].LoadBalancingConfig}function Xv(i,e=!1){for(let t of i)try{return yd(t)}catch(r){(0,Hv.log)(jv.LogVerbosity.DEBUG,"Config parsing failed with error",r.message);continue}return e&&xi?new Yt[xi].LoadBalancingConfig:null}});var ho=g(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.validateRetryThrottling=_d;Di.validateServiceConfig=Ed;Di.extractAndSelectServiceConfig=ay;var Jv=z("os"),Vn=B(),Yn=/^\d+(\.\d{1,9})?s$/,Qv="node";function Zv(i){if("service"in i&&i.service!==""){if(typeof i.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof i.service}`);if("method"in i&&i.method!==""){if(typeof i.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof i.service}`);return{service:i.service,method:i.method}}else return{service:i.service}}else{if("method"in i&&i.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function ey(i){if(!("maxAttempts"in i)||!Number.isInteger(i.maxAttempts)||i.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in i)||typeof i.initialBackoff!="string"||!Yn.test(i.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in i)||typeof i.maxBackoff!="string"||!Yn.test(i.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in i)||typeof i.backoffMultiplier!="number"||i.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in i&&Array.isArray(i.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(i.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of i.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(Vn.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(Vn.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:i.maxAttempts,initialBackoff:i.initialBackoff,maxBackoff:i.maxBackoff,backoffMultiplier:i.backoffMultiplier,retryableStatusCodes:i.retryableStatusCodes}}function ty(i){if(!("maxAttempts"in i)||!Number.isInteger(i.maxAttempts)||i.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in i&&(typeof i.hedgingDelay!="string"||!Yn.test(i.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in i&&Array.isArray(i.nonFatalStatusCodes))for(let t of i.nonFatalStatusCodes)if(typeof t=="number"){if(!Object.values(Vn.Status).includes(t))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(Vn.Status).includes(t.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:i.maxAttempts};return i.hedgingDelay&&(e.hedgingDelay=i.hedgingDelay),i.nonFatalStatusCodes&&(e.nonFatalStatusCodes=i.nonFatalStatusCodes),e}function ry(i){var e;let t={name:[]};if(!("name"in i)||!Array.isArray(i.name))throw new Error("Invalid method config: invalid name array");for(let r of i.name)t.name.push(Zv(r));if("waitForReady"in i){if(typeof i.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");t.waitForReady=i.waitForReady}if("timeout"in i)if(typeof i.timeout=="object"){if(!("seconds"in i.timeout)||typeof i.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in i.timeout)||typeof i.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");t.timeout=i.timeout}else if(typeof i.timeout=="string"&&Yn.test(i.timeout)){let r=i.timeout.substring(0,i.timeout.length-1).split(".");t.timeout={seconds:r[0]|0,nanos:((e=r[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in i){if(typeof i.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxRequestBytes=i.maxRequestBytes}if("maxResponseBytes"in i){if(typeof i.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxResponseBytes=i.maxResponseBytes}if("retryPolicy"in i){if("hedgingPolicy"in i)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");t.retryPolicy=ey(i.retryPolicy)}else"hedgingPolicy"in i&&(t.hedgingPolicy=ty(i.hedgingPolicy));return t}function _d(i){if(!("maxTokens"in i)||typeof i.maxTokens!="number"||i.maxTokens<=0||i.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in i)||typeof i.tokenRatio!="number"||i.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+i.maxTokens.toFixed(3),tokenRatio:+i.tokenRatio.toFixed(3)}}function iy(i){if(!(typeof i=="object"&&i!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof i}`);let e=Object.keys(i);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:i[e[0]]}}function Ed(i){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in i)if(typeof i.loadBalancingPolicy=="string")e.loadBalancingPolicy=i.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in i)if(Array.isArray(i.loadBalancingConfig))for(let r of i.loadBalancingConfig)e.loadBalancingConfig.push(iy(r));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in i&&Array.isArray(i.methodConfig))for(let r of i.methodConfig)e.methodConfig.push(ry(r));"retryThrottling"in i&&(e.retryThrottling=_d(i.retryThrottling));let t=[];for(let r of e.methodConfig)for(let n of r.name){for(let s of t)if(n.service===s.service&&n.method===s.method)throw new Error(`Invalid service config: duplicate name ${n.service}/${n.method}`);t.push(n)}return e}function ny(i){if(!("serviceConfig"in i))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:Ed(i.serviceConfig)};if("clientLanguage"in i)if(Array.isArray(i.clientLanguage)){e.clientLanguage=[];for(let r of i.clientLanguage)if(typeof r=="string")e.clientLanguage.push(r);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in i)if(Array.isArray(i.clientHostname)){e.clientHostname=[];for(let r of i.clientHostname)if(typeof r=="string")e.clientHostname.push(r);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in i)if(typeof i.percentage=="number"&&0<=i.percentage&&i.percentage<=100)e.percentage=i.percentage;else throw new Error("Invalid service config choice: invalid percentage");let t=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let r in i)if(!t.includes(r))throw new Error(`Invalid service config choice: unexpected field ${r}`);return e}function sy(i,e){if(!Array.isArray(i))throw new Error("Invalid service config list");for(let t of i){let r=ny(t);if(!(typeof r.percentage=="number"&&e>r.percentage)){if(Array.isArray(r.clientHostname)){let n=!1;for(let s of r.clientHostname)s===Jv.hostname()&&(n=!0);if(!n)continue}if(Array.isArray(r.clientLanguage)){let n=!1;for(let s of r.clientLanguage)s===Qv&&(n=!0);if(!n)continue}return r.serviceConfig}}throw new Error("No matching service config found")}function ay(i,e){for(let t of i)if(t.length>0&&t[0].startsWith("grpc_config=")){let r=t.join("").substring(12),n=JSON.parse(r);return sy(n,e)}return null}});var Pe=g(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.ConnectivityState=void 0;var Sd;(function(i){i[i.IDLE=0]="IDLE",i[i.CONNECTING=1]="CONNECTING",i[i.READY=2]="READY",i[i.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",i[i.SHUTDOWN=4]="SHUTDOWN"})(Sd||(Kn.ConnectivityState=Sd={}))});var xt=g(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.QueuePicker=Xt.UnavailablePicker=Xt.PickResultType=void 0;var oy=pe(),ly=B(),Xn;(function(i){i[i.COMPLETE=0]="COMPLETE",i[i.QUEUE=1]="QUEUE",i[i.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",i[i.DROP=3]="DROP"})(Xn||(Xt.PickResultType=Xn={}));var fo=class{constructor(e){this.status=Object.assign({code:ly.Status.UNAVAILABLE,details:"No connection established",metadata:new oy.Metadata},e)}pick(e){return{pickResultType:Xn.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Xt.UnavailablePicker=fo;var po=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:Xn.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Xt.QueuePicker=po});var Wr=g(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.BackoffTimeout=void 0;var cy=B(),Cd=ee(),Td="backoff",uy=1e3,dy=1.6,hy=12e4,fy=.2;function py(i,e){return Math.random()*(e-i)+i}var Jn=class i{constructor(e,t){this.callback=e,this.initialDelay=uy,this.multiplier=dy,this.maxDelay=hy,this.jitter=fy,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=i.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.traceEnabled&&this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}get traceEnabled(){return Cd.isTracerEnabled(Td)}trace(e){this.traceEnabled&&Cd.trace(cy.LogVerbosity.DEBUG,Td,"{"+this.id+"} "+e)}runTimer(e){var t,r;this.traceEnabled&&this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(r=(t=this.timerId).unref)===null||r===void 0||r.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+py(-t,t)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.traceEnabled&&this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};Qn.BackoffTimeout=Jn;Jn.nextId=0});var es=g(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ChildLoadBalancerHandler=void 0;var gy=Kt(),my=Pe(),vy="child_load_balancer_helper",go=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,r){return this.parent.channelControlHelper.createSubchannel(t,r)}updateState(t,r,n){var s;if(this.calledByPendingChild()){if(t===my.ConnectivityState.CONNECTING)return;(s=this.parent.currentChild)===null||s===void 0||s.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,r,n)}requestReresolution(){var t;let r=(t=this.parent.pendingChild)!==null&&t!==void 0?t:this.parent.currentChild;this.child===r&&this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,r,n){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let a=new this.ChildPolicyHelper(this),o=(0,gy.createLoadBalancer)(t,a);a.setChild(o),this.currentChild===null?(this.currentChild=o,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=o,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;return this.latestConfig=t,s.updateAddressList(e,t,r,n)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return vy}};Zn.ChildLoadBalancerHandler=go});var Ad=g(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ResolvingLoadBalancer=void 0;Fi.getDefaultConfigSelector=Od;var yy=Kt(),_y=ho(),xe=Pe(),bd=et(),Li=xt(),Ey=Wr(),wd=B(),Sy=pe(),Cy=ee(),Ty=B(),by=ke(),Ry=es(),wy="resolving_load_balancer";function Rd(i){Cy.trace(Ty.LogVerbosity.DEBUG,wy,i)}var Oy=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function Ay(i,e,t,r){for(let n of t.name)switch(r){case"EMPTY":if(!n.service&&!n.method)return!0;break;case"SERVICE":if(n.service===i&&!n.method)return!0;break;case"SERVICE_AND_METHOD":if(n.service===i&&n.method===e)return!0}return!1}function Ny(i,e,t,r){for(let n of t)if(Ay(i,e,n,r))return n;return null}var Py=100;function Od(i){let e=new Map;return{invoke(t,r,n){var s,a;let o=e.get(t);if(o===void 0){let l=t.split("/").filter(h=>h.length>0),c=(s=l[0])!==null&&s!==void 0?s:"",u=(a=l[1])!==null&&a!==void 0?a:"";if(o={name:[]},i&&i.methodConfig)for(let h of Oy){let f=Ny(c,u,i.methodConfig,h);if(f){o=f;break}}e.size<Py&&e.set(t,o)}return{methodConfig:o,pickInformation:{},status:wd.Status.OK,dynamicFilterFactories:[]}},unref(){e.clear()}}}var mo=class{constructor(e,t,r,n,s){this.target=e,this.channelControlHelper=t,this.channelOptions=r,this.onSuccessfulResolution=n,this.onFailedResolution=s,this.latestChildState=xe.ConnectivityState.IDLE,this.latestChildPicker=new Li.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=xe.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,r["grpc.service_config"]?this.defaultServiceConfig=(0,_y.validateServiceConfig)(JSON.parse(r["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(xe.ConnectivityState.IDLE,new Li.QueuePicker(this),null),this.childLoadBalancer=new Ry.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?(Rd("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(o,l,c)=>{this.latestChildState=o,this.latestChildPicker=l,this.latestChildErrorMessage=c,this.updateState(o,l,c)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,bd.createResolver)(e,this.handleResolverResult.bind(this),r);let a={initialDelay:r["grpc.initial_reconnect_backoff_ms"],maxDelay:r["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Ey.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},a),this.backoffTimeout.unref()}handleResolverResult(e,t,r,n){var s,a;this.backoffTimeout.stop(),this.backoffTimeout.reset();let o=!0,l=null;if(r===null?l=this.defaultServiceConfig:r.ok?l=r.value:this.previousServiceConfig!==null?l=this.previousServiceConfig:(o=!1,this.handleResolutionFailure(r.error)),l!==null){let c=(s=l?.loadBalancingConfig)!==null&&s!==void 0?s:[],u=(0,yy.selectLbConfigFromList)(c,!0);u===null?(o=!1,this.handleResolutionFailure({code:wd.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new Sy.Metadata})):o=this.childLoadBalancer.updateAddressList(e,u,Object.assign(Object.assign({},this.channelOptions),t),n)}return o&&this.onSuccessfulResolution(l,(a=t[bd.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&a!==void 0?a:Od(l)),o}updateResolution(){this.innerResolver.updateResolution(),this.currentState===xe.ConnectivityState.IDLE&&this.updateState(xe.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,r){Rd((0,by.uriToString)(this.target)+" "+xe.ConnectivityState[this.currentState]+" -> "+xe.ConnectivityState[e]),e===xe.ConnectivityState.IDLE&&(t=new Li.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,r)}handleResolutionFailure(e){this.latestChildState===xe.ConnectivityState.IDLE&&(this.updateState(xe.ConnectivityState.TRANSIENT_FAILURE,new Li.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===xe.ConnectivityState.IDLE||this.currentState===xe.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=xe.ConnectivityState.IDLE,this.latestChildPicker=new Li.QueuePicker(this),this.currentState=xe.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Fi.ResolvingLoadBalancer=mo});var Nd=g(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.recognizedOptions=void 0;qi.channelOptionsEqual=Iy;qi.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0};function Iy(i,e){let t=Object.keys(i).sort(),r=Object.keys(e).sort();if(t.length!==r.length)return!1;for(let n=0;n<t.length;n+=1)if(t[n]!==r[n]||i[t[n]]!==e[r[n]])return!1;return!0}});var De=g(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.EndpointMap=void 0;tt.isTcpSubchannelAddress=Bi;tt.subchannelAddressEqual=ts;tt.subchannelAddressToString=Id;tt.stringToSubchannelAddress=ky;tt.endpointEqual=xy;tt.endpointToString=Dy;tt.endpointHasAddress=Md;var Pd=z("net");function Bi(i){return"port"in i}function ts(i,e){return!i&&!e?!0:!i||!e?!1:Bi(i)?Bi(e)&&i.host===e.host&&i.port===e.port:!Bi(e)&&i.path===e.path}function Id(i){return Bi(i)?(0,Pd.isIPv6)(i.host)?"["+i.host+"]:"+i.port:i.host+":"+i.port:i.path}var My=443;function ky(i,e){return(0,Pd.isIP)(i)?{host:i,port:e??My}:{path:i}}function xy(i,e){if(i.addresses.length!==e.addresses.length)return!1;for(let t=0;t<i.addresses.length;t++)if(!ts(i.addresses[t],e.addresses[t]))return!1;return!0}function Dy(i){return"["+i.addresses.map(Id).join(", ")+"]"}function Md(i,e){for(let t of i.addresses)if(ts(t,e))return!0;return!1}function Ui(i,e){if(i.addresses.length!==e.addresses.length)return!1;for(let t of i.addresses){let r=!1;for(let n of e.addresses)if(ts(t,n)){r=!0;break}if(!r)return!1}return!0}var vo=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(Md(t.key,e))return t.value}deleteMissing(e){let t=[];for(let r of this.map){let n=!1;for(let s of e)Ui(s,r.key)&&(n=!0);n||(t.push(r.value),this.map.delete(r))}return t}get(e){for(let t of this.map)if(Ui(e,t.key))return t.value}set(e,t){for(let r of this.map)if(Ui(e,r.key)){r.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(Ui(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(Ui(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};tt.EndpointMap=vo});var xd={};Jm(xd,{OrderedMap:()=>jy});function Gr(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");yo(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Ly(i,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(t=0)),t;)try{if(r=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,n=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(i,t)}catch(u){c=[6,u],n=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function vr(){throw new RangeError("Iterator access denied!")}var yo,kd,Fy,qy,Uy,By,zy,Hy,Dt,jy,Dd=Xm(()=>{"use strict";yo=function(i,e){return yo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},yo(i,e)};kd=(function(){function i(e,t,r){r===void 0&&(r=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=r}return i.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var r=e.h;r.t===e;)e=r,r=e.h;e=r}return e},i.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},i.prototype.T=function(){var e=this.h,t=this.i,r=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=r,r&&(r.h=this),t},i.prototype.I=function(){var e=this.h,t=this.t,r=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=r,r&&(r.h=this),t},i})(),Fy=(function(i){Gr(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=i.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=i.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e})(kd),qy=(function(){function i(e){e===void 0&&(e=0),this.iteratorType=e}return i.prototype.equals=function(e){return this.C===e.C},i})(),Uy=(function(){function i(){this._=0}return Object.defineProperty(i.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this._},i.prototype.empty=function(){return this._===0},i})(),By=(function(i){Gr(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e})(Uy);zy=(function(i){Gr(e,i);function e(t,r){t===void 0&&(t=function(s,a){return s<a?-1:s>a?1:0}),r===void 0&&(r=!1);var n=i.call(this)||this;return n.N=void 0,n.g=t,n.enableIndex=r,n.S=r?Fy:kd,n.A=new n.S,n}return e.prototype.m=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);if(s<0)t=t.i;else if(s>0)n=t,t=t.t;else return t}return n},e.prototype.B=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);s<=0?t=t.i:(n=t,t=t.t)}return n},e.prototype.j=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);if(s<0)n=t,t=t.i;else if(s>0)t=t.t;else return t}return n},e.prototype.k=function(t,r){for(var n=this.A;t;){var s=this.g(t.u,r);s<0?(n=t,t=t.i):t=t.t}return n},e.prototype.R=function(t){for(;;){var r=t.h;if(r===this.A)return;if(t.l===1){t.l=0;return}if(t===r.t){var n=r.i;if(n.l===1)n.l=0,r.l=1,r===this.N?this.N=r.T():r.T();else if(n.i&&n.i.l===1){n.l=r.l,r.l=0,n.i.l=0,r===this.N?this.N=r.T():r.T();return}else n.t&&n.t.l===1?(n.l=1,n.t.l=0,n.I()):(n.l=1,t=r)}else{var n=r.t;if(n.l===1)n.l=0,r.l=1,r===this.N?this.N=r.I():r.I();else if(n.t&&n.t.l===1){n.l=r.l,r.l=0,n.t.l=0,r===this.N?this.N=r.I():r.I();return}else n.i&&n.i.l===1?(n.l=1,n.i.l=0,n.T()):(n.l=1,t=r)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var r=t;r.t||r.i;){if(r.i)for(r=r.i;r.t;)r=r.t;else r=r.t;var n=t.u;t.u=r.u,r.u=n;var s=t.o;t.o=r.o,r.o=s,t=r}this.A.t===r?this.A.t=r.h:this.A.i===r&&(this.A.i=r.h),this.R(r);var a=r.h;if(r===a.t?a.t=void 0:a.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;a!==this.A;)a.O-=1,a=a.h},e.prototype.P=function(t){for(var r=typeof t=="number"?t:void 0,n=typeof t=="function"?t:void 0,s=typeof t>"u"?[]:void 0,a=0,o=this.N,l=[];l.length||o;)if(o)l.push(o),o=o.t;else{if(o=l.pop(),a===r)return o;s&&s.push(o),n&&n(o,a,this),a+=1,o=o.i}return s},e.prototype.q=function(t){for(;;){var r=t.h;if(r.l===0)return;var n=r.h;if(r===n.t){var s=n.i;if(s&&s.l===1){if(s.l=r.l=0,n===this.N)return;n.l=1,t=n;continue}else if(t===r.i){if(t.l=0,t.t&&(t.t.h=r),t.i&&(t.i.h=n),r.i=t.t,n.t=t.i,t.t=r,t.i=n,n===this.N)this.N=t,this.A.h=t;else{var a=n.h;a.t===n?a.t=t:a.i=t}t.h=n.h,r.h=t,n.h=t,n.l=1}else{r.l=0,n===this.N?this.N=n.I():n.I(),n.l=1;return}}else{var s=n.t;if(s&&s.l===1){if(s.l=r.l=0,n===this.N)return;n.l=1,t=n;continue}else if(t===r.t){if(t.l=0,t.t&&(t.t.h=n),t.i&&(t.i.h=r),n.i=t.t,r.t=t.i,t.t=n,t.i=r,n===this.N)this.N=t,this.A.h=t;else{var a=n.h;a.t===n?a.t=t:a.i=t}t.h=n.h,r.h=t,n.h=t,n.l=1}else{r.l=0,n===this.N?this.N=n.T():n.T(),n.l=1;return}}this.enableIndex&&(r.M(),n.M(),t.M());return}},e.prototype.D=function(t,r,n){if(this.N===void 0)return this._+=1,this.N=new this.S(t,r,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var s,a=this.A.t,o=this.g(a.u,t);if(o===0)return a.o=r,this._;if(o>0)a.t=new this.S(t,r),a.t.h=a,s=a.t,this.A.t=s;else{var l=this.A.i,c=this.g(l.u,t);if(c===0)return l.o=r,this._;if(c<0)l.i=new this.S(t,r),l.i.h=l,s=l.i,this.A.i=s;else{if(n!==void 0){var u=n.C;if(u!==this.A){var h=this.g(u.u,t);if(h===0)return u.o=r,this._;if(h>0){var f=u.v(),_=this.g(f.u,t);if(_===0)return f.o=r,this._;_<0&&(s=new this.S(t,r),f.i===void 0?(f.i=s,s.h=f):(u.t=s,s.h=u))}}}if(s===void 0)for(s=this.N;;){var p=this.g(s.u,t);if(p>0){if(s.t===void 0){s.t=new this.S(t,r),s.t.h=s,s=s.t;break}s=s.t}else if(p<0){if(s.i===void 0){s.i=new this.S(t,r),s.i.h=s,s=s.i;break}s=s.i}else return s.o=r,this._}}}if(this.enableIndex)for(var v=s.h;v!==this.A;)v.O+=1,v=v.h;return this.q(s),this._+=1,this._},e.prototype.F=function(t,r){for(;t;){var n=this.g(t.u,r);if(n<0)t=t.i;else if(n>0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,r){var n=t.C;if(n===this.A&&vr(),this._===1)return n.u=r,!0;var s=n.p().u;if(n===this.A.t)return this.g(s,r)>0?(n.u=r,!0):!1;var a=n.v().u;return n===this.A.i?this.g(a,r)<0?(n.u=r,!0):!1:this.g(a,r)>=0||this.g(s,r)<=0?!1:(n.u=r,!0)},e.prototype.eraseElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var r=this.P(t);return this.G(r),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var r=this.F(this.N,t);return r===this.A?!1:(this.G(r),!0)},e.prototype.eraseElementByIterator=function(t){var r=t.C;r===this.A&&vr();var n=r.i===void 0,s=t.iteratorType===0;return s?n&&t.next():(!n||r.t===void 0)&&t.next(),this.G(r),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(r){return r?Math.max(t(r.t),t(r.i))+1:0}return t(this.N)},e})(By),Hy=(function(i){Gr(e,i);function e(t,r,n){var s=i.call(this,n)||this;return s.C=t,s.A=r,s.iteratorType===0?(s.pre=function(){return this.C===this.A.t&&vr(),this.C=this.C.v(),this},s.next=function(){return this.C===this.A&&vr(),this.C=this.C.p(),this}):(s.pre=function(){return this.C===this.A.i&&vr(),this.C=this.C.p(),this},s.next=function(){return this.C===this.A&&vr(),this.C=this.C.v(),this}),s}return Object.defineProperty(e.prototype,"index",{get:function(){var t=this.C,r=this.A.h;if(t===this.A)return r?r.O-1:0;var n=0;for(t.t&&(n+=t.t.O);t!==r;){var s=t.h;t===s.i&&(n+=1,s.t&&(n+=s.t.O)),t=s}return n},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e})(qy),Dt=(function(i){Gr(e,i);function e(t,r,n,s){var a=i.call(this,t,r,s)||this;return a.container=n,a}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&vr();var t=this;return new Proxy([],{get:function(r,n){return n==="0"?t.C.u:n==="1"?t.C.o:(r[0]=t.C.u,r[1]=t.C.o,r[n])},set:function(r,n,s){if(n!=="1")throw new TypeError("prop must be 1");return t.C.o=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e})(Hy),jy=(function(i){Gr(e,i);function e(t,r,n){t===void 0&&(t=[]);var s=i.call(this,r,n)||this,a=s;return t.forEach((function(o){a.setElement(o[0],o[1])})),s}return e.prototype.begin=function(){return new Dt(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new Dt(this.A,this.A,this)},e.prototype.rBegin=function(){return new Dt(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new Dt(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var r=this.m(this.N,t);return new Dt(r,this.A,this)},e.prototype.upperBound=function(t){var r=this.B(this.N,t);return new Dt(r,this.A,this)},e.prototype.reverseLowerBound=function(t){var r=this.j(this.N,t);return new Dt(r,this.A,this)},e.prototype.reverseUpperBound=function(t){var r=this.k(this.N,t);return new Dt(r,this.A,this)},e.prototype.forEach=function(t){this.P((function(r,n,s){t([r.u,r.o],n,s)}))},e.prototype.setElement=function(t,r,n){return this.D(t,r,n)},e.prototype.getElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var r=this.P(t);return[r.u,r.o]},e.prototype.find=function(t){var r=this.F(this.N,t);return new Dt(r,this.A,this)},e.prototype.getElementByKey=function(t){var r=this.F(this.N,t);return r.o},e.prototype.union=function(t){var r=this;return t.forEach((function(n){r.setElement(n[0],n[1])})),this._},e.prototype[Symbol.iterator]=function(){var t,r,n,s;return Ly(this,(function(a){switch(a.label){case 0:t=this._,r=this.P(),n=0,a.label=1;case 1:return n<t?(s=r[n],[4,[s.u,s.o]]):[3,4];case 2:a.sent(),a.label=3;case 3:return++n,[3,1];case 4:return[2]}}))},e})(zy)});var is=g(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.registerAdminService=Wy;rs.addAdminServicesToServer=Gy;var Ld=[];function Wy(i,e){Ld.push({getServiceDefinition:i,getHandlers:e})}function Gy(i){for(let{getServiceDefinition:e,getHandlers:t}of Ld)i.addService(e(),t())}});var Fd=g(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ClientDuplexStreamImpl=rt.ClientWritableStreamImpl=rt.ClientReadableStreamImpl=rt.ClientUnaryCallImpl=void 0;rt.callErrorFromStatus=Vy;var $y=z("events"),To=z("stream"),zi=B();function Vy(i,e){let t=`${i.code} ${zi.Status[i.code]}: ${i.details}`,n=`${new Error(t).stack}
|
|
5
5
|
for call at
|
|
6
6
|
${e}`;return Object.assign(new Error(t),i,{stack:n})}var _o=class extends $y.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(zi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}getAuthContext(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&t!==void 0?t:null}};rt.ClientUnaryCallImpl=_o;var Eo=class extends To.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(zi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}getAuthContext(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&t!==void 0?t:null}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};rt.ClientReadableStreamImpl=Eo;var So=class extends To.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(zi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}getAuthContext(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&t!==void 0?t:null}_write(e,t,r){var n;let s={callback:r},a=Number(t);Number.isNaN(a)||(s.flags=a),(n=this.call)===null||n===void 0||n.sendMessageWithContext(s,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};rt.ClientWritableStreamImpl=So;var Co=class extends To.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(zi.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}getAuthContext(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&t!==void 0?t:null}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,r){var n;let s={callback:r},a=Number(t);Number.isNaN(a)||(s.flags=a),(n=this.call)===null||n===void 0||n.sendMessageWithContext(s,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};rt.ClientDuplexStreamImpl=Co});var _r=g(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.InterceptingListenerImpl=void 0;yr.statusOrFromValue=Ky;yr.statusOrFromError=Xy;yr.isInterceptingListener=Jy;var Yy=pe();function Ky(i){return{ok:!0,value:i}}function Xy(i){var e;return{ok:!1,error:Object.assign(Object.assign({},i),{metadata:(e=i.metadata)!==null&&e!==void 0?e:new Yy.Metadata})}}function Jy(i){return i.onReceiveMetadata!==void 0&&i.onReceiveMetadata.length===1}var bo=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,t=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};yr.InterceptingListenerImpl=bo});var Io=g(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.InterceptingCall=it.RequesterBuilder=it.ListenerBuilder=it.InterceptorConfigurationError=void 0;it.getInterceptingCall=t_;var Qy=pe(),qd=_r(),Ud=B(),Bd=zn(),ji=class i extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,i)}};it.InterceptorConfigurationError=ji;var wo=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};it.ListenerBuilder=wo;var Oo=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};it.RequesterBuilder=Oo;var Ro={onReceiveMetadata:(i,e)=>{e(i)},onReceiveMessage:(i,e)=>{e(i)},onReceiveStatus:(i,e)=>{e(i)}},Hi={start:(i,e,t)=>{t(i,e)},sendMessage:(i,e)=>{e(i)},halfClose:i=>{i()},cancel:i=>{i()}},Ao=class{constructor(e,t){var r,n,s,a;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(r=t.start)!==null&&r!==void 0?r:Hi.start,sendMessage:(n=t.sendMessage)!==null&&n!==void 0?n:Hi.sendMessage,halfClose:(s=t.halfClose)!==null&&s!==void 0?s:Hi.halfClose,cancel:(a=t.cancel)!==null&&a!==void 0?a:Hi.cancel}:this.requester=Hi}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){var r,n,s,a,o,l;let c={onReceiveMetadata:(n=(r=t?.onReceiveMetadata)===null||r===void 0?void 0:r.bind(t))!==null&&n!==void 0?n:(u=>{}),onReceiveMessage:(a=(s=t?.onReceiveMessage)===null||s===void 0?void 0:s.bind(t))!==null&&a!==void 0?a:(u=>{}),onReceiveStatus:(l=(o=t?.onReceiveStatus)===null||o===void 0?void 0:o.bind(t))!==null&&l!==void 0?l:(u=>{})};this.processingMetadata=!0,this.requester.start(e,c,(u,h)=>{var f,_,p;this.processingMetadata=!1;let v;if((0,qd.isInterceptingListener)(h))v=h;else{let R={onReceiveMetadata:(f=h.onReceiveMetadata)!==null&&f!==void 0?f:Ro.onReceiveMetadata,onReceiveMessage:(_=h.onReceiveMessage)!==null&&_!==void 0?_:Ro.onReceiveMessage,onReceiveStatus:(p=h.onReceiveStatus)!==null&&p!==void 0?p:Ro.onReceiveStatus};v=new qd.InterceptingListenerImpl(R,c)}this.nextCall.start(u,v),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,r),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};it.InterceptingCall=Ao;function Zy(i,e,t){var r,n;let s=(r=t.deadline)!==null&&r!==void 0?r:1/0,a=t.host,o=(n=t.parent)!==null&&n!==void 0?n:null,l=t.propagate_flags,c=t.credentials,u=i.createCall(e,s,a,o,l);return c&&u.setCredentials(c),u}var ns=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let r;try{r=this.methodDefinition.requestSerialize(t)}catch(n){this.call.cancelWithStatus(Ud.Status.INTERNAL,`Request message serialization failure: ${(0,Bd.getErrorMessage)(n)}`);return}this.call.sendMessageWithContext(e,r)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let r=null;this.call.start(e,{onReceiveMetadata:n=>{var s;(s=t?.onReceiveMetadata)===null||s===void 0||s.call(t,n)},onReceiveMessage:n=>{var s;let a;try{a=this.methodDefinition.responseDeserialize(n)}catch(o){r={code:Ud.Status.INTERNAL,details:`Response message parsing error: ${(0,Bd.getErrorMessage)(o)}`,metadata:new Qy.Metadata},this.call.cancelWithStatus(r.code,r.details);return}(s=t?.onReceiveMessage)===null||s===void 0||s.call(t,a)},onReceiveStatus:n=>{var s,a;r?(s=t?.onReceiveStatus)===null||s===void 0||s.call(t,r):(a=t?.onReceiveStatus)===null||a===void 0||a.call(t,n)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},No=class extends ns{constructor(e,t){super(e,t)}start(e,t){var r,n;let s=!1,a={onReceiveMetadata:(n=(r=t?.onReceiveMetadata)===null||r===void 0?void 0:r.bind(t))!==null&&n!==void 0?n:(o=>{}),onReceiveMessage:o=>{var l;s=!0,(l=t?.onReceiveMessage)===null||l===void 0||l.call(t,o)},onReceiveStatus:o=>{var l,c;s||(l=t?.onReceiveMessage)===null||l===void 0||l.call(t,null),(c=t?.onReceiveStatus)===null||c===void 0||c.call(t,o)}};super.start(e,a),this.call.startRead()}},Po=class extends ns{};function e_(i,e,t){let r=Zy(i,t.path,e);return t.responseStream?new Po(r,t):new No(r,t)}function t_(i,e,t,r){if(i.clientInterceptors.length>0&&i.clientInterceptorProviders.length>0)throw new ji("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(i.callInterceptors.length>0&&i.callInterceptorProviders.length>0)throw new ji("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let n=[];i.callInterceptors.length>0||i.callInterceptorProviders.length>0?n=[].concat(i.callInterceptors,i.callInterceptorProviders.map(o=>o(e))).filter(o=>o):n=[].concat(i.clientInterceptors,i.clientInterceptorProviders.map(o=>o(e))).filter(o=>o);let s=Object.assign({},t,{method_definition:e});return n.reduceRight((o,l)=>c=>l(c,o),o=>e_(r,o,e))(s)}});var xo=g(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.Client=void 0;var vt=Fd(),r_=Do(),i_=Pe(),Jt=B(),$r=pe(),ss=Io(),nt=Symbol(),Vr=Symbol(),Yr=Symbol(),Lt=Symbol();function Mo(i){return typeof i=="function"}function Kr(i){var e;return((e=i.stack)===null||e===void 0?void 0:e.split(`
|
|
7
7
|
`).slice(1).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import*as
|
|
4
|
+
import*as e from"child_process";import*as c from"util";var i=c.promisify(e.exec),s=c.promisify(e.execFile);export{i as a,s as b};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{e as Br,g as it,h as Dr,i as nt,j as ot,k as Vr}from"./chunk-HKQWGX5S.js";import{a as b,b as vr,c as Nt,d as Ot,e as G,f as Ur,i as Gr,m as B,n as m,o as It,p as Be,q as p}from"./chunk-456FRBGE.js";import{b as u,d as Lr}from"./chunk-7MKA3SHV.js";import{inspect as Fr}from"util";function Pt(r){let t=process.env[r];if(t==null||t.trim()==="")return;let e=Number(t);if(isNaN(e)){m.warn(`Unknown value ${Fr(t)} for ${r}, expected a number, using defaults`);return}return e}function st(r){let t=process.env[r];if(!(t==null||t.trim()===""))return t}function Ct(r){let t=process.env[r]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||m.warn(`Unknown value ${Fr(t)} for ${r}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function Lt(r){return st(r)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}var kr=u(()=>{"use strict";p()});var vt,$r=u(()=>{"use strict";vt=globalThis});var Hr,zr=u(()=>{"use strict";Hr="2.11.0"});var jr,Xr=u(()=>{"use strict";jr="process.runtime.name"});var O,Kr=u(()=>{"use strict";zr();Vr();Xr();O={[nt]:"opentelemetry",[jr]:"node",[it]:Dr,[ot]:Hr}});var I,Wr=u(()=>{"use strict";kr();$r();Kr();I=performance});var De=u(()=>{"use strict";Wr()});function g(r){let t=r/1e3,e=Math.trunc(t),i=Math.round(r%1e3*po);return[e,i]}function qr(){return I.timeOrigin}function k(r){let t=g(I.timeOrigin),e=g(typeof r=="number"?r:I.now());return Ve(t,e)}function Jr(r){if(Bt(r))return r;if(typeof r=="number")return r<I.timeOrigin/2?k(r):g(r);if(r instanceof Date)return g(r.getTime());throw TypeError("Invalid input type")}function Ut(r,t){let e=t[0]-r[0],i=t[1]-r[1];return i<0&&(e-=1,i+=at),[e,i]}function Zr(r){let t=Yr,e=`${"0".repeat(t)}${r[1]}Z`,i=e.substring(e.length-t-1);return new Date(r[0]*1e3).toISOString().replace("000Z",i)}function Qr(r){return r[0]*at+r[1]}function D(r){return r[0]*1e6+r[1]/1e3}function ti(r){return r[0]*1e3+r[1]/1e6}function Gt(r){return r[0]+r[1]/at}function Bt(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function ei(r){return Bt(r)||typeof r=="number"||r instanceof Date}function Ve(r,t){let e=[r[0]+t[0],r[1]+t[1]];return e[1]>=at&&(e[1]-=at,e[0]+=1),e}var Yr,fo,po,at,ri=u(()=>{"use strict";De();Yr=9,fo=6,po=Math.pow(10,fo),at=Math.pow(10,Yr)});var E,ii=u(()=>{"use strict";(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(E||(E={}))});var Dt,ni=u(()=>{"use strict";Dt=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,e)=>{this._resolve=t,this._reject=e})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}});var Vt,oi=u(()=>{"use strict";ni();Vt=class{_isCalled=!1;_deferred=new Dt;_callback;_that;constructor(t,e){this._callback=t,this._that=e}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}});function Ft(r){return r.setValue(Fe,!0)}function si(r){return r.deleteValue(Fe)}function $(r){return r.getValue(Fe)===!0}var Fe,ct=u(()=>{"use strict";p();Fe=Nt("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var kt,ai=u(()=>{"use strict";kt="baggage"});function mi(r){return r.reduce((t,e)=>{let i=`${t}${t!==""?",":""}${e}`;return i.length>8192?t:i},"")}function hi(r){return r.getAllEntries().map(([t,e])=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(e.value)}`;return e.metadata!==void 0&&(i+=";"+e.metadata.toString()),i})}function fi(r){if(!r)return;let t=r.indexOf(";"),e=t===-1?r:r.substring(0,t),i=e.indexOf("=");if(i<=0)return;let n=e.substring(0,i).trim(),o=e.substring(i+1).trim();if(!n||!o)return;let s,a;try{s=decodeURIComponent(n),a=decodeURIComponent(o)}catch{return}let c;if(t!==-1&&t<r.length-1){let l=r.substring(t+1);c=vr(l)}return{key:s,value:a,metadata:c}}function ke(r,t,e,i){let n=0;for(;n<r.length&&e<180;){let o=r.indexOf(",",n),s=o===-1?r.length:o,a=s-n;if(a<=4096){let c=fi(r.substring(n,s));if(c){let l=(e===0?0:1)+a;if(i+l>8192)break;t[c.key]=c.metadata?{value:c.value,metadata:c.metadata}:{value:c.value},e++,i+=l}}if(o===-1)break;n=o+1}return[e,i]}function pi(r){let t={};return typeof r=="string"&&r.length>0&&r.split(",").forEach(e=>{let i=fi(e);i!==void 0&&i.value.length>0&&(t[i.key]=i.value)}),t}var $e=u(()=>{"use strict";p()});var $t,_i=u(()=>{"use strict";p();ct();ai();$e();$t=class{inject(t,e,i){let n=It.getBaggage(t);if(!n||$(t))return;let o=hi(n).filter(a=>a.length<=4096).slice(0,180),s=mi(o);s.length>0&&i.set(e,kt,s)}extract(t,e,i){let n=i.get(e,kt);if(!n)return t;let o={},s=0,a=0;if(Array.isArray(n))for(let c=0;c<n.length;c++)[s,a]=ke(n[c],o,s,a);else[s]=ke(n,o,s,a);return s===0?t:It.setBaggage(t,It.createBaggage(o))}fields(){return[kt]}}});var Ht,di=u(()=>{"use strict";Ht=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,e){this._monotonicClock=e,this._epochMillis=t.now(),this._performanceMillis=e.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}}});function gi(r){let t={};if(typeof r!="object"||r==null)return t;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;if(!Eo(e)){m.warn(`Invalid attribute key: ${e}`);continue}let i=r[e];if(!He(i)){m.warn(`Invalid attribute value set for key: ${e}`);continue}Array.isArray(i)?t[e]=i.slice():t[e]=i}return t}function Eo(r){return typeof r=="string"&&r!==""}function He(r){return r==null?!0:Array.isArray(r)?So(r):Ei(typeof r)}function So(r){let t;for(let e of r){if(e==null)continue;let i=typeof e;if(i!==t){if(!t){if(Ei(i)){t=i;continue}return!1}return!1}}return!0}function Ei(r){switch(r){case"number":case"boolean":case"string":return!0}return!1}var Si=u(()=>{"use strict";p()});function zt(){return r=>{m.error(Ao(r))}}function Ao(r){return typeof r=="string"?r:JSON.stringify(To(r))}function To(r){let t={},e=r;for(;e!==null;)Object.getOwnPropertyNames(e).forEach(i=>{if(t[i])return;let n=e[i];n&&(t[i]=String(n))}),e=Object.getPrototypeOf(e);return t}var ze=u(()=>{"use strict";p()});function Ti(r){Ai=r}function ut(r){try{Ai(r)}catch{}}var Ai,xi=u(()=>{"use strict";ze();Ai=zt()});function Mi(r){typeof r!="number"&&r.unref()}var wi=u(()=>{"use strict"});var jt,yi=u(()=>{"use strict";p();jt=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let e=new Set;for(let i of this._propagators){let n=typeof i.fields=="function"?i.fields():[];for(let o of n)e.add(o)}this._fields=Array.from(e)}inject(t,e,i){for(let n of this._propagators)try{n.inject(t,e,i)}catch(o){m.warn(`Failed to inject with ${n.constructor.name}. Err: ${o.message}`)}}extract(t,e,i){return this._propagators.reduce((n,o)=>{try{return o.extract(n,e,i)}catch(s){m.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return n},t)}fields(){return this._fields.slice()}}});function Xe(r){return wo.test(r)}function Ke(r){return yo.test(r)&&!bo.test(r)}var je,xo,Mo,wo,yo,bo,bi=u(()=>{"use strict";je="[_0-9a-z-*/]",xo=`[a-z]${je}{0,255}`,Mo=`[a-z0-9]${je}{0,240}@[a-z]${je}{0,13}`,wo=new RegExp(`^(?:${xo}|${Mo})$`),yo=/^[ -~]{0,255}[!-~]$/,bo=/,|=/});var Ro,Ri,Ni,Oi,H,We=u(()=>{"use strict";bi();Ro=32,Ri=512,Ni=",",Oi="=",H=class r{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,e){if(!Xe(t)||!Ke(e))return this;let i=this._getState(),n=i.get(t),o=this._length;if(typeof n=="string"?o+=e.length-n.length:o+=t.length+e.length+(i.size>0?2:1),o>Ri)return this;let s=new Map(i);return s.delete(t),s.set(t,e),this._fromState(s,o)}unset(t){let e=this._getState(),i=e.get(t);if(typeof i!="string")return this;let n=this._length-(t.length+i.length+1);e.size>1&&(n=n-1);let o=new Map(e);return o.delete(t),this._fromState(o,n)}get(t){return this._getState().get(t)}serialize(){let t="",e=0;for(let i of this._getState())e>0&&(t=Ni+t),t=`${i[0]}${Oi}${i[1]}`+t,e++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(Ni),e=new Map,i=0;for(let n of t){let o=n.trim(),s=o.indexOf(Oi);if(s===-1)continue;let a=o.slice(0,s),c=o.slice(s+1);if(!Xe(a)||!Ke(c))continue;let l=i+o.length+(e.size>0?1:0);if(!(l>Ri)&&(e.set(a,c),i=l,e.size>=Ro))break}return this._length=i,this._internalState=new Map(Array.from(e.entries()).reverse()),this._internalState}_fromState(t,e){let i=Object.create(r.prototype);return i._internalState=t,i._length=e,i}}});function Ye(r){let t=Lo.exec(r);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var lt,mt,No,Oo,Io,Po,Co,Lo,Xt,Ii=u(()=>{"use strict";p();ct();We();lt="traceparent",mt="tracestate",No="00",Oo="(?!ff)[\\da-f]{2}",Io="(?![0]{32})[\\da-f]{32}",Po="(?![0]{16})[\\da-f]{16}",Co="[\\da-f]{2}",Lo=new RegExp(`^\\s?(${Oo})-(${Io})-(${Po})-(${Co})(-.*)?\\s?$`);Xt=class{inject(t,e,i){let n=Be.getSpanContext(t);if(!n||$(t)||!Gr(n))return;let o=`${No}-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Ur.NONE).toString(16)}`;i.set(e,lt,o),n.traceState&&i.set(e,mt,n.traceState.serialize())}extract(t,e,i){let n=i.get(e,lt);if(!n)return t;let o=Array.isArray(n)?n[0]:n;if(typeof o!="string")return t;let s=Ye(o);if(!s)return t;s.isRemote=!0;let a=i.get(e,mt);if(a){let c=Array.isArray(a)?a.join(","):a;s.traceState=new H(typeof c=="string"?c:void 0)}return Be.setSpanContext(t,s)}fields(){return[lt,mt]}}});function Pi(r,t){return r.setValue(qe,t)}function Ci(r){return r.deleteValue(qe)}function Li(r){return r.getValue(qe)}var qe,Kt,vi=u(()=>{"use strict";p();qe=Nt("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(Kt||(Kt={}))});function Je(r){if(!Fo(r)||ko(r)!==vo)return!1;let t=Vo(r);if(t===null)return!0;let e=Bi.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Ui.call(e)===Do}function Fo(r){return r!=null&&typeof r=="object"}function ko(r){return r==null?r===void 0?Go:Uo:V&&V in Object(r)?$o(r):Ho(r)}function $o(r){let t=Bi.call(r,V),e=r[V],i=!1;try{r[V]=void 0,i=!0}catch{}let n=Di.call(r);return i&&(t?r[V]=e:delete r[V]),n}function Ho(r){return Di.call(r)}var vo,Uo,Go,Bo,Ui,Do,Vo,Gi,Bi,V,Di,Vi=u(()=>{"use strict";vo="[object Object]",Uo="[object Null]",Go="[object Undefined]",Bo=Function.prototype,Ui=Bo.toString,Do=Ui.call(Object),Vo=Object.getPrototypeOf,Gi=Object.prototype,Bi=Gi.hasOwnProperty,V=Symbol?Symbol.toStringTag:void 0,Di=Gi.toString});function ki(...r){let t=r.shift(),e=new WeakMap;for(;r.length>0;)t=$i(t,r.shift(),0,e);return t}function Ze(r){return Yt(r)?r.slice():r}function $i(r,t,e=0,i){let n;if(!(e>zo)){if(e++,Wt(r)||Wt(t)||Hi(t))n=Ze(t);else if(Yt(r)){if(n=r.slice(),Yt(t))for(let o=0,s=t.length;o<s;o++)n.push(Ze(t[o]));else if(ht(t)){let o=Object.keys(t);for(let s=0,a=o.length;s<a;s++){let c=o[s];c==="__proto__"||c==="constructor"||c==="prototype"||(n[c]=Ze(t[c]))}}}else if(ht(r))if(ht(t)){if(!jo(r,t))return t;n=Object.assign({},r);let o=Object.keys(t);for(let s=0,a=o.length;s<a;s++){let c=o[s];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let l=t[c];if(Wt(l))typeof l>"u"?delete n[c]:n[c]=l;else{let f=n[c],T=l;if(Fi(r,c,i)||Fi(t,c,i))delete n[c];else{if(ht(f)&&ht(T)){let y=i.get(f)||[],Rt=i.get(T)||[];y.push({obj:r,key:c}),Rt.push({obj:t,key:c}),i.set(f,y),i.set(T,Rt)}n[c]=$i(n[c],l,e,i)}}}}else n=t;return n}}function Fi(r,t,e){let i=e.get(r[t])||[];for(let n=0,o=i.length;n<o;n++){let s=i[n];if(s.key===t&&s.obj===r)return!0}return!1}function Yt(r){return Array.isArray(r)}function Hi(r){return typeof r=="function"}function ht(r){return!Wt(r)&&!Yt(r)&&!Hi(r)&&typeof r=="object"}function Wt(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function jo(r,t){return!(!Je(r)||!Je(t))}var zo,zi=u(()=>{"use strict";Vi();zo=20});function ji(r,t){let e,i=new Promise(function(o,s){e=setTimeout(function(){s(new ft("Operation timed out."))},t)});return Promise.race([r,i]).then(n=>(clearTimeout(e),n),n=>{throw clearTimeout(e),n})}var ft,Xi=u(()=>{"use strict";ft=class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}});function Qe(r,t){return typeof t=="string"?r===t:!!r.match(t)}function Ki(r,t){if(!t)return!1;for(let e of t)if(Qe(r,e))return!0;return!1}var Wi=u(()=>{"use strict"});function qi(r){if(r==null)return;let t=Yi[r.toUpperCase()];return t??(m.warn(`Unknown log level "${r}", expected one of ${Object.keys(Yi)}, using default`),b.INFO)}var Yi,Ji=u(()=>{"use strict";p();Yi={ALL:b.ALL,VERBOSE:b.VERBOSE,DEBUG:b.DEBUG,INFO:b.INFO,WARN:b.WARN,ERROR:b.ERROR,NONE:b.NONE}});function Zi(r,t){return new Promise(e=>{B.with(Ft(B.active()),()=>{r.export(t,e)})})}var Qi=u(()=>{"use strict";p();ct()});var Xo={};Lr(Xo,{AnchoredClock:()=>Ht,BindOnceFuture:()=>Vt,CompositePropagator:()=>jt,ExportResultCode:()=>E,RPCType:()=>Kt,SDK_INFO:()=>O,TRACE_PARENT_HEADER:()=>lt,TRACE_STATE_HEADER:()=>mt,TimeoutError:()=>ft,TraceState:()=>H,W3CBaggagePropagator:()=>$t,W3CTraceContextPropagator:()=>Xt,_globalThis:()=>vt,addHrTimes:()=>Ve,callWithTimeout:()=>ji,deleteRPCMetadata:()=>Ci,diagLogLevelFromString:()=>qi,getBooleanFromEnv:()=>Ct,getNumberFromEnv:()=>Pt,getRPCMetadata:()=>Li,getStringFromEnv:()=>st,getStringListFromEnv:()=>Lt,getTimeOrigin:()=>qr,globalErrorHandler:()=>ut,hrTime:()=>k,hrTimeDuration:()=>Ut,hrTimeToMicroseconds:()=>D,hrTimeToMilliseconds:()=>ti,hrTimeToNanoseconds:()=>Qr,hrTimeToSeconds:()=>Gt,hrTimeToTimeStamp:()=>Zr,internal:()=>tr,isAttributeValue:()=>He,isTimeInput:()=>ei,isTimeInputHrTime:()=>Bt,isTracingSuppressed:()=>$,isUrlIgnored:()=>Ki,loggingErrorHandler:()=>zt,merge:()=>ki,millisToHrTime:()=>g,otperformance:()=>I,parseKeyPairsIntoRecord:()=>pi,parseTraceParent:()=>Ye,sanitizeAttributes:()=>gi,setGlobalErrorHandler:()=>Ti,setRPCMetadata:()=>Pi,suppressTracing:()=>Ft,timeInputToHrTime:()=>Jr,unrefTimer:()=>Mi,unsuppressTracing:()=>si,urlMatches:()=>Qe});var tr,R=u(()=>{"use strict";_i();di();Si();xi();ze();ri();wi();ii();$e();De();yi();Ii();vi();ct();We();zi();Xi();Wi();oi();Ji();Qi();tr={_export:Zi}});var P,qt=u(()=>{"use strict";(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(P||(P={}))});var h,S,N=u(()=>{"use strict";(function(r){r.COUNTER="COUNTER",r.GAUGE="GAUGE",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(h||(h={}));(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(S||(S={}))});var A,z=u(()=>{"use strict";(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(A||(A={}))});var pt,tn=u(()=>{"use strict";z();pt=class{kind=A.DROP;createAccumulation(){}merge(t,e){}diff(t,e){}toMetricData(t,e,i,n){}}});function Jt(r){let t=Object.keys(r);return t.length===0?"":(t=t.sort(),JSON.stringify(t.map(e=>[e,r[e]])))}function en(r){return`${r.name}:${r.version??""}:${r.schemaUrl??""}`}function C(r,t){let e,i=new Promise(function(o,s){e=setTimeout(function(){s(new F("Operation timed out."))},t)});return Promise.race([r,i]).then(n=>(clearTimeout(e),n),n=>{throw clearTimeout(e),n})}function rn(r,t){if(r.size!==t.size)return!1;for(let e of r)if(!t.has(e))return!1;return!0}function nn(r,t){let e=0,i=r.length-1,n=r.length;for(;i>=e;){let o=e+Math.trunc((i-e)/2);r[o]<t?e=o+1:(n=o,i=o-1)}return n}function on(r,t){return r.toLowerCase()===t.toLowerCase()}var F,x=u(()=>{"use strict";F=class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}});function Ko(r){let t=r.map(()=>0);return t.push(0),{buckets:{boundaries:r,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var j,X,sn=u(()=>{"use strict";z();N();x();j=class{startTime;_boundaries;_recordMinMax;_current;constructor(t,e,i=!0,n=Ko(e)){this.startTime=t,this._boundaries=e,this._recordMinMax=i,this._current=n}record(t){if(Number.isNaN(t))return;this._current.count+=1,this._current.sum+=t,this._recordMinMax&&(this._current.min=Math.min(t,this._current.min),this._current.max=Math.max(t,this._current.max),this._current.hasMinMax=!0);let e=nn(this._boundaries,t);this._current.buckets.counts[e]+=1}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},X=class{kind=A.HISTOGRAM;_boundaries;_recordMinMax;constructor(t,e){this._boundaries=t,this._recordMinMax=e}createAccumulation(t){return new j(t,this._boundaries,this._recordMinMax)}merge(t,e){let i=t.toPointValue(),n=e.toPointValue(),o=i.buckets.counts,s=n.buckets.counts,a=new Array(o.length);for(let f=0;f<o.length;f++)a[f]=o[f]+s[f];let c=1/0,l=-1/0;return this._recordMinMax&&(i.hasMinMax&&n.hasMinMax?(c=Math.min(i.min,n.min),l=Math.max(i.max,n.max)):i.hasMinMax?(c=i.min,l=i.max):n.hasMinMax&&(c=n.min,l=n.max)),new j(t.startTime,i.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:i.buckets.boundaries,counts:a},count:i.count+n.count,sum:i.sum+n.sum,hasMinMax:this._recordMinMax&&(i.hasMinMax||n.hasMinMax),min:c,max:l})}diff(t,e){let i=t.toPointValue(),n=e.toPointValue(),o=i.buckets.counts,s=n.buckets.counts,a=new Array(o.length);for(let c=0;c<o.length;c++)a[c]=s[c]-o[c];return new j(e.startTime,i.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:i.buckets.boundaries,counts:a},count:n.count-i.count,sum:n.sum-i.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.HISTOGRAM,dataPoints:i.map(([o,s])=>{let a=s.toPointValue(),c=t.type===h.GAUGE||t.type===h.UP_DOWN_COUNTER||t.type===h.OBSERVABLE_GAUGE||t.type===h.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:o,startTime:s.startTime,endTime:n,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:c?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}}});var _t,er,an=u(()=>{"use strict";_t=class r{backing;indexBase;indexStart;indexEnd;constructor(t=new er,e=0,i=0,n=0){this.backing=t,this.indexBase=e,this.indexStart=i,this.indexEnd=n}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(t,e)=>this.at(e))}at(t){let e=this.indexBase-this.indexStart;return t<e&&(t+=this.backing.length),t-=e,this.backing.countAt(t)}incrementBucket(t,e){this.backing.increment(t,e)}decrementBucket(t,e){this.backing.decrement(t,e)}trim(){for(let t=0;t<this.length;t++)if(this.at(t)!==0){this.indexStart+=t;break}else if(t===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let t=this.length-1;t>=0;t--)if(this.at(t)!==0){this.indexEnd-=this.length-t-1;break}this._rotate()}downscale(t){this._rotate();let e=1+this.indexEnd-this.indexStart,i=1<<t,n=0,o=0;for(let s=this.indexStart;s<=this.indexEnd;){let a=s%i;a<0&&(a+=i);for(let c=a;c<i&&n<e;c++)this._relocateBucket(o,n),n++,s++;o++}this.indexStart>>=t,this.indexEnd>>=t,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let t=this.indexBase-this.indexStart;t!==0&&(t>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,t),this.backing.reverse(t,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+t)),this.indexBase=this.indexStart)}_relocateBucket(t,e){t!==e&&this.incrementBucket(t,this.backing.emptyBucket(e))}},er=class r{_counts;constructor(t=[0]){this._counts=t}get length(){return this._counts.length}countAt(t){return this._counts[t]}growTo(t,e,i){let n=new Array(t).fill(0);n.splice(i,this._counts.length-e,...this._counts.slice(e)),n.splice(0,e,...this._counts.slice(0,e)),this._counts=n}reverse(t,e){let i=Math.floor((t+e)/2)-t;for(let n=0;n<i;n++){let o=this._counts[t+n];this._counts[t+n]=this._counts[e-n-1],this._counts[e-n-1]=o}}emptyBucket(t){let e=this._counts[t];return this._counts[t]=0,e}increment(t,e){this._counts[t]+=e}decrement(t,e){this._counts[t]>=e?this._counts[t]-=e:this._counts[t]=0}clone(){return new r([...this._counts])}}});function cn(r){return rr.setFloat64(0,r),{hi:rr.getUint32(0),lo:rr.getUint32(4)}}function Zt(r){let{hi:t}=cn(r);return((t&2146435072)>>20)-1023}function Qt(r){let{hi:t,lo:e}=cn(r);return(t&1048575)===0&&e===0}var dt,rr,ir=u(()=>{"use strict";dt=Math.pow(2,-1022),rr=new DataView(new ArrayBuffer(8))});function gt(r,t){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,t)}function ln(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}var te=u(()=>{"use strict"});var M,ee=u(()=>{"use strict";M=class extends Error{}});var re,hn=u(()=>{"use strict";ir();te();ee();re=class{_shift;constructor(t){this._shift=-t}mapToIndex(t){if(t<dt)return this._minNormalLowerBoundaryIndex();let e=Zt(t),i=Qt(t)?-1:0;return e+i>>this._shift}lowerBoundary(t){let e=this._minNormalLowerBoundaryIndex();if(t<e)throw new M(`underflow: ${t} is < minimum lower boundary: ${e}`);let i=this._maxNormalLowerBoundaryIndex();if(t>i)throw new M(`overflow: ${t} is > maximum lower boundary: ${i}`);return gt(1,t<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let t=-1022>>this._shift;return this._shift<2&&t--,t}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}}});var ie,fn=u(()=>{"use strict";ir();te();ee();ie=class{_scale;_scaleFactor;_inverseFactor;constructor(t){this._scale=t,this._scaleFactor=gt(Math.LOG2E,t),this._inverseFactor=gt(Math.LN2,-t)}mapToIndex(t){if(t<=dt)return this._minNormalLowerBoundaryIndex()-1;if(Qt(t))return(Zt(t)<<this._scale)-1;let e=Math.floor(Math.log(t)*this._scaleFactor),i=this._maxNormalLowerBoundaryIndex();return e>=i?i:e}lowerBoundary(t){let e=this._maxNormalLowerBoundaryIndex();if(t>=e){if(t===e)return 2*Math.exp((t-(1<<this._scale))/this._scaleFactor);throw new M(`overflow: ${t} is > maximum lower boundary: ${e}`)}let i=this._minNormalLowerBoundaryIndex();if(t<=i){if(t===i)return dt;if(t===i-1)return Math.exp((t+(1<<this._scale))/this._scaleFactor)/2;throw new M(`overflow: ${t} is < minimum lower boundary: ${i}`)}return Math.exp(t*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}});function sr(r){if(r>_n||r<pn)throw new M(`expected scale >= ${pn} && <= ${_n}, got: ${r}`);return Wo[r+10]}var pn,_n,Wo,dn=u(()=>{"use strict";hn();fn();ee();pn=-10,_n=20,Wo=Array.from({length:31},(r,t)=>t>10?new ie(t-10):new re(t-10))});var K,Yo,qo,ar,ne,Et,gn=u(()=>{"use strict";z();N();p();an();dn();te();K=class r{static combine(t,e){return new r(Math.min(t.low,e.low),Math.max(t.high,e.high))}low;high;constructor(t,e){this.low=t,this.high=e}},Yo=20,qo=160,ar=2,ne=class r{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(t,e=qo,i=!0,n=0,o=0,s=0,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=new _t,f=new _t,T=sr(Yo)){this.startTime=t,this._maxSize=e,this._recordMinMax=i,this._sum=n,this._count=o,this._zeroCount=s,this._min=a,this._max=c,this._positive=l,this._negative=f,this._mapping=T,this._maxSize<ar&&(m.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${ar}`),this._maxSize=ar)}record(t){this.updateByIncrement(t,1)}setStartTime(t){this.startTime=t}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(t,e){if(Number.isFinite(t)){if(t>this._max&&(this._max=t),t<this._min&&(this._min=t),this._count+=e,t===0){this._zeroCount+=e;return}this._sum+=t*e,t>0?this._updateBuckets(this._positive,t,e):this._updateBuckets(this._negative,-t,e)}}merge(t){this._count===0?(this._min=t.min,this._max=t.max):t.count!==0&&(t.min<this.min&&(this._min=t.min),t.max>this.max&&(this._max=t.max)),this.startTime=t.startTime,this._sum+=t.sum,this._count+=t.count,this._zeroCount+=t.zeroCount;let e=this._minScale(t);this._downscale(this.scale-e),this._mergeBuckets(this.positive,t,t.positive,e),this._mergeBuckets(this.negative,t,t.negative,e)}diff(t){this._min=1/0,this._max=-1/0,this._sum-=t.sum,this._count-=t.count,this._zeroCount-=t.zeroCount;let e=this._minScale(t);this._downscale(this.scale-e),this._diffBuckets(this.positive,t,t.positive,e),this._diffBuckets(this.negative,t,t.negative,e)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(t,e,i){let n=this._mapping.mapToIndex(e),o=!1,s=0,a=0;if(t.length===0?(t.indexStart=n,t.indexEnd=t.indexStart,t.indexBase=t.indexStart):n<t.indexStart&&t.indexEnd-n>=this._maxSize?(o=!0,a=n,s=t.indexEnd):n>t.indexEnd&&n-t.indexStart>=this._maxSize&&(o=!0,a=t.indexStart,s=n),o){let c=this._changeScale(s,a);this._downscale(c),n=this._mapping.mapToIndex(e)}this._incrementIndexBy(t,n,i)}_incrementIndexBy(t,e,i){if(i===0)return;if(t.length===0&&(t.indexStart=t.indexEnd=t.indexBase=e),e<t.indexStart){let o=t.indexEnd-e;o>=t.backing.length&&this._grow(t,o+1),t.indexStart=e}else if(e>t.indexEnd){let o=e-t.indexStart;o>=t.backing.length&&this._grow(t,o+1),t.indexEnd=e}let n=e-t.indexBase;n<0&&(n+=t.backing.length),t.incrementBucket(n,i)}_grow(t,e){let i=t.backing.length,n=t.indexBase-t.indexStart,o=i-n,s=ln(e);s>this._maxSize&&(s=this._maxSize);let a=s-n;t.backing.growTo(s,o,a)}_changeScale(t,e){let i=0;for(;t-e>=this._maxSize;)t>>=1,e>>=1,i++;return i}_downscale(t){if(t===0)return;if(t<0)throw new Error(`impossible change of scale: ${this.scale}`);let e=this._mapping.scale-t;this._positive.downscale(t),this._negative.downscale(t),this._mapping=sr(e)}_minScale(t){let e=Math.min(this.scale,t.scale),i=K.combine(this._highLowAtScale(this.positive,this.scale,e),this._highLowAtScale(t.positive,t.scale,e)),n=K.combine(this._highLowAtScale(this.negative,this.scale,e),this._highLowAtScale(t.negative,t.scale,e));return Math.min(e-this._changeScale(i.high,i.low),e-this._changeScale(n.high,n.low))}_highLowAtScale(t,e,i){if(t.length===0)return new K(0,-1);let n=e-i;return new K(t.indexStart>>n,t.indexEnd>>n)}_mergeBuckets(t,e,i,n){let o=i.offset,s=e.scale-n;for(let a=0;a<i.length;a++)this._incrementIndexBy(t,o+a>>s,i.at(a))}_diffBuckets(t,e,i,n){let o=i.offset,s=e.scale-n;for(let a=0;a<i.length;a++){let l=(o+a>>s)-t.indexBase;l<0&&(l+=t.backing.length),t.decrementBucket(l,i.at(a))}t.trim()}},Et=class{kind=A.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(t,e){this._maxSize=t,this._recordMinMax=e}createAccumulation(t){return new ne(t,this._maxSize,this._recordMinMax)}merge(t,e){let i=e.clone();return i.merge(t),i}diff(t,e){let i=e.clone();return i.diff(t),i}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.EXPONENTIAL_HISTOGRAM,dataPoints:i.map(([o,s])=>{let a=s.toPointValue(),c=t.type===h.GAUGE||t.type===h.UP_DOWN_COUNTER||t.type===h.OBSERVABLE_GAUGE||t.type===h.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:o,startTime:s.startTime,endTime:n,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:c?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}}});var W,St,En=u(()=>{"use strict";z();R();N();W=class{startTime;_current;sampleTime;constructor(t,e=0,i=[0,0]){this.startTime=t,this._current=e,this.sampleTime=i}record(t){this._current=t,this.sampleTime=g(Date.now())}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},St=class{kind=A.LAST_VALUE;createAccumulation(t){return new W(t)}merge(t,e){let i=D(e.sampleTime)>=D(t.sampleTime)?e:t;return new W(t.startTime,i.toPointValue(),i.sampleTime)}diff(t,e){let i=D(e.sampleTime)>=D(t.sampleTime)?e:t;return new W(e.startTime,i.toPointValue(),i.sampleTime)}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.GAUGE,dataPoints:i.map(([o,s])=>({attributes:o,startTime:s.startTime,endTime:n,value:s.toPointValue()}))}}}});var L,Y,Sn=u(()=>{"use strict";z();N();L=class{startTime;monotonic;_current;reset;constructor(t,e,i=0,n=!1){this.startTime=t,this.monotonic=e,this._current=i,this.reset=n}record(t){this.monotonic&&t<0||(this._current+=t)}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},Y=class{kind=A.SUM;monotonic;constructor(t){this.monotonic=t}createAccumulation(t){return new L(t,this.monotonic)}merge(t,e){let i=t.toPointValue(),n=e.toPointValue();return e.reset?new L(e.startTime,this.monotonic,n,e.reset):new L(t.startTime,this.monotonic,i+n)}diff(t,e){let i=t.toPointValue(),n=e.toPointValue();return this.monotonic&&i>n?new L(e.startTime,this.monotonic,n,!0):new L(e.startTime,this.monotonic,n-i)}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.SUM,dataPoints:i.map(([o,s])=>({attributes:o,startTime:s.startTime,endTime:n,value:s.toPointValue()})),isMonotonic:this.monotonic}}}});var An=u(()=>{"use strict";tn();sn();gn();En();Sn()});var cr,ur,lr,mr,At,Tt,hr,pr,_r,dr,gr,Oc,Tn,xn=u(()=>{"use strict";p();An();N();cr=class r{static DEFAULT_INSTANCE=new pt;createAggregator(t){return r.DEFAULT_INSTANCE}},ur=class r{static MONOTONIC_INSTANCE=new Y(!0);static NON_MONOTONIC_INSTANCE=new Y(!1);createAggregator(t){switch(t.type){case h.COUNTER:case h.OBSERVABLE_COUNTER:case h.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}},lr=class r{static DEFAULT_INSTANCE=new St;createAggregator(t){return r.DEFAULT_INSTANCE}},mr=class r{static DEFAULT_INSTANCE=new X([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(t){return r.DEFAULT_INSTANCE}},At=class{_boundaries;_recordMinMax;constructor(t,e=!0){if(t==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");t=t.concat(),t=t.sort((o,s)=>o-s);let i=t.lastIndexOf(-1/0),n=t.indexOf(1/0);n===-1&&(n=void 0),this._boundaries=t.slice(i+1,n),this._recordMinMax=e}createAggregator(t){return new X(this._boundaries,this._recordMinMax)}},Tt=class{_maxSize;_recordMinMax;constructor(t=160,e=!0){this._maxSize=t,this._recordMinMax=e}createAggregator(t){return new Et(this._maxSize,this._recordMinMax)}},hr=class{_resolve(t){switch(t.type){case h.COUNTER:case h.UP_DOWN_COUNTER:case h.OBSERVABLE_COUNTER:case h.OBSERVABLE_UP_DOWN_COUNTER:return _r;case h.GAUGE:case h.OBSERVABLE_GAUGE:return dr;case h.HISTOGRAM:return t.advice.explicitBucketBoundaries?new At(t.advice.explicitBucketBoundaries):gr}return m.warn(`Unable to recognize instrument type: ${t.type}`),pr}createAggregator(t){return this._resolve(t).createAggregator(t)}},pr=new cr,_r=new ur,dr=new lr,gr=new mr,Oc=new Tt,Tn=new hr});function oe(r){switch(r.type){case _.DEFAULT:return Tn;case _.DROP:return pr;case _.SUM:return _r;case _.LAST_VALUE:return dr;case _.EXPONENTIAL_HISTOGRAM:{let t=r;return new Tt(t.options?.maxSize,t.options?.recordMinMax)}case _.EXPLICIT_BUCKET_HISTOGRAM:{let t=r;return t.options==null?gr:new At(t.options?.boundaries,t.options?.recordMinMax)}default:throw new Error("Unsupported Aggregation")}}var _,xt=u(()=>{"use strict";xn();(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.DROP=1]="DROP",r[r.SUM=2]="SUM",r[r.LAST_VALUE=3]="LAST_VALUE",r[r.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(_||(_={}))});function Mn(){if(se===void 0)try{let r=globalThis.process.argv0;se=r?`unknown_service:${r}`:"unknown_service"}catch{se="unknown_service"}return se}var se,wn=u(()=>{"use strict"});var q,yn=u(()=>{"use strict";q=r=>r!==null&&typeof r=="object"&&typeof r.then=="function"});function Rn(r,t){return Er.FromAttributeList(Object.entries(r),t)}function Sr(){return Rn({[Br]:Mn(),[it]:O[it],[nt]:O[nt],[ot]:O[ot]})}function bn(r){return r.map(([t,e])=>q(e)?[t,e.catch(i=>{m.debug("promise rejection for resource attribute: %s - %s",t,i)})]:[t,e])}function Jo(r){if(typeof r=="string"||r===void 0)return r;m.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",r)}function Zo(r,t){let e=r?.schemaUrl,i=t?.schemaUrl,n=e===void 0||e==="",o=i===void 0||i==="";if(n)return i;if(o||e===i)return e;m.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',e,i)}var Er,Nn=u(()=>{"use strict";p();R();Vr();wn();yn();Er=class r{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,e){let i=new r({},e);return i._rawAttributes=bn(t),i._asyncAttributesPending=t.filter(([n,o])=>q(o)).length>0,i}constructor(t,e){let i=t.attributes??{};this._rawAttributes=Object.entries(i).map(([n,o])=>(q(o)&&(this._asyncAttributesPending=!0),[n,o])),this._rawAttributes=bn(this._rawAttributes),this._schemaUrl=Jo(e?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){let[e,i]=this._rawAttributes[t];this._rawAttributes[t]=[e,q(i)?await i:i]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&m.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let t={};for(let[e,i]of this._rawAttributes){if(q(i)){m.debug(`Unsettled resource attribute ${e} skipped`);continue}i!=null&&(t[e]??=i)}return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let e=Zo(this,t),i=e?{schemaUrl:e}:void 0;return r.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],i)}}});var On=u(()=>{"use strict";Nn()});var In,ae,Ar=u(()=>{"use strict";qt();xt();In=r=>({type:_.DEFAULT}),ae=r=>P.CUMULATIVE});var Pn,Cn,Ln,vn,Un,Tr=u(()=>{"use strict";Pn="otel.component.name",Cn="otel.component.type",Ln="periodic_metric_reader",vn="otel.sdk.metric_reader.collection.duration",Un="error.type"});var Gn,Mt,Bn=u(()=>{"use strict";Tr();Gn=new Map,Mt=class{collectionDuration;standardAttrs;constructor(t,e){let i=Gn.get(t)??0;Gn.set(t,i+1),this.standardAttrs={[Cn]:t,[Pn]:`${t}/${i}`},this.collectionDuration=e.createHistogram(vn,{unit:"s",description:"The duration of the collect operation of the metric reader.",advice:{explicitBucketBoundaries:[]}})}recordCollection(t,e){let i=e?{...this.standardAttrs,[Un]:e}:this.standardAttrs;this.collectionDuration.record(t,i)}}});var Dn,Vn=u(()=>{"use strict";Dn="2.11.0"});var v,ce=u(()=>{"use strict";p();x();Ar();Bn();Vn();R();v=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_selfObsMetrics;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;_otelComponentType;constructor(t){this._aggregationSelector=t?.aggregationSelector??In,this._aggregationTemporalitySelector=t?.aggregationTemporalitySelector??ae,this._metricProducers=t?.metricProducers??[],this._cardinalitySelector=t?.cardinalitySelector,this._otelComponentType=t?.otelComponentType??this.constructor.name,this._selfObsMetrics=new Mt(this._otelComponentType,Ot())}setMetricProducer(t){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=t,this.onInitialized()}_setSelfObsMeterProvider(t){let e=t.getMeter("@opentelemetry/sdk-metrics",Dn);this._selfObsMetrics=new Mt(this._otelComponentType,e)}selectAggregation(t){return this._aggregationSelector(t)}selectAggregationTemporality(t){return this._aggregationTemporalitySelector(t)}selectCardinalityLimit(t){return this._cardinalitySelector?this._cardinalitySelector(t):2e3}onInitialized(){}async collect(t){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let e=k(),[i,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:t?.timeoutMillis}),...this._metricProducers.map(f=>f.collect({timeoutMillis:t?.timeoutMillis}))]),o=k(),s=i.errors.concat(n.flatMap(f=>f.errors)),a=Gt(Ut(e,o));this._selfObsMetrics.recordCollection(a,s.length>0?s[0].name??"collect_error":void 0);let c=i.resourceMetrics.resource,l=i.resourceMetrics.scopeMetrics.concat(n.flatMap(f=>f.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:c,scopeMetrics:l},errors:s}}async shutdown(t){if(this._shutdown){m.error("Cannot call shutdown twice.");return}t?.timeoutMillis==null?await this.onShutdown():await C(this.onShutdown(),t.timeoutMillis),this._shutdown=!0}async forceFlush(t){if(this._shutdown){m.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(t?.timeoutMillis==null){await this.onForceFlush();return}await C(this.onForceFlush(),t.timeoutMillis)}}});function Fn(r,t){if(!Number.isInteger(t)||t<=0)throw new Error("maxExportBatchSize must be a positive integer");let e=[],i=0,n=[];function o(){n.length>0&&(e.push({resource:r.resource,scopeMetrics:n}),n=[],i=0)}for(let s of r.scopeMetrics){let a=null;for(let c of s.metrics){let l=c.dataPoints;if(l.length===0){a||(a={scope:s.scope,metrics:[]},n.push(a)),a.metrics.push(c);continue}let f=0;for(;f<l.length;){let T=t-i,y=Math.min(T,l.length-f);a||(a={scope:s.scope,metrics:[]},n.push(a));let Rt={...c,dataPoints:l.slice(f,f+y)};a.metrics.push(Rt),f+=y,i+=y,i===t&&(o(),a=null)}}}return o(),e}var kn=u(()=>{"use strict"});var ue,$n=u(()=>{"use strict";p();R();ce();x();N();kn();Tr();ue=class extends v{_interval;_exporter;_exportInterval;_exportTimeout;_maxExportBatchSize;_ongoingExportPromise=null;constructor(t){let{exporter:e,exportIntervalMillis:i=6e4,metricProducers:n,cardinalityLimits:o,maxExportBatchSize:s}=t,{exportTimeoutMillis:a=3e4}=t;if(super({aggregationSelector:e.selectAggregation?.bind(e),aggregationTemporalitySelector:e.selectAggregationTemporality?.bind(e),otelComponentType:Ln,metricProducers:n,cardinalitySelector:c=>{let l={default:2e3,...o};switch(c){case h.COUNTER:return l.counter??l.default;case h.GAUGE:return l.gauge??l.default;case h.HISTOGRAM:return l.histogram??l.default;case h.OBSERVABLE_COUNTER:return l.observableCounter??l.default;case h.OBSERVABLE_UP_DOWN_COUNTER:return l.observableUpDownCounter??l.default;case h.OBSERVABLE_GAUGE:return l.observableGauge??l.default;case h.UP_DOWN_COUNTER:return l.upDownCounter??l.default;default:return l.default}}}),i<=0)throw Error("exportIntervalMillis must be greater than 0");if(a<=0)throw Error("exportTimeoutMillis must be greater than 0");if(s!==void 0&&(!Number.isInteger(s)||s<=0))throw Error("maxExportBatchSize must be a positive integer");if(i<a){if("exportIntervalMillis"in t&&"exportTimeoutMillis"in t)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");m.info(`Timeout of ${a} exceeds the interval of ${i}. Clamping timeout to interval duration.`),a=i}this._exportInterval=i,this._exportTimeout=a,this._exporter=e,this._maxExportBatchSize=s}async _runOnce(){try{await this._doRun()}catch(t){ut(t)}}async _doRun(){if(this._ongoingExportPromise){m.debug("PeriodicExportingMetricReader: export already in progress, skipping");return}let t=async()=>{let{resourceMetrics:e,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});if(i.length>0&&m.error("PeriodicExportingMetricReader: metrics collection errors",...i),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(s){m.debug("Error while resolving async portion of resource: ",s),ut(s)}if(e.scopeMetrics.length===0)return;let n=this._maxExportBatchSize?Fn(e,this._maxExportBatchSize):[e],o=null;for(let s of n)try{let a=await C(tr._export(this._exporter,s),this._exportTimeout);a.code!==E.SUCCESS&&(o=new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`))}catch(a){if(a instanceof F){m.error(`PeriodicExportingMetricReader: metrics export timed out after ${this._exportTimeout}ms`);break}else m.error("PeriodicExportingMetricReader: metrics export threw error",a),o=a instanceof Error?a:new Error(String(a))}if(o)throw o};this._ongoingExportPromise=t();try{await this._ongoingExportPromise}finally{this._ongoingExportPromise=null}}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!="number"&&this._interval.unref()}async onForceFlush(){await this._awaitOngoingExport(),this._ongoingExportPromise?await this._awaitOngoingExport():await this._runOnce(),await this._exporter.forceFlush()}async _awaitOngoingExport(){if(this._ongoingExportPromise){m.debug("PeriodicExportingMetricReader: export already in progress, awaiting ongoing export");try{await this._ongoingExportPromise}catch{}}}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}});var le,Hn=u(()=>{"use strict";R();le=class{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(t){this._aggregationTemporality=t}export(t,e){if(this._shutdown){setTimeout(()=>e({code:E.FAILED}),0);return}this._metrics.push(t),setTimeout(()=>e({code:E.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(t){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var me,zn=u(()=>{"use strict";R();Ar();me=class r{_shutdown=!1;_temporalitySelector;constructor(t){this._temporalitySelector=t?.temporalitySelector??ae}export(t,e){if(this._shutdown){e({code:E.FAILED});return}return r._sendMetrics(t,e)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(t){return this._temporalitySelector(t)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(t,e){for(let i of t.scopeMetrics)for(let n of i.metrics)console.dir({descriptor:n.descriptor,dataPointType:n.dataPointType,dataPoints:n.dataPoints},{depth:null});e({code:E.SUCCESS})}}});var he,jn=u(()=>{"use strict";he=class{_registeredViews=[];addView(t){this._registeredViews.push(t)}findViews(t,e){return this._registeredViews.filter(n=>this._matchInstrument(n.instrumentSelector,t)&&this._matchMeter(n.meterSelector,e))}_matchInstrument(t,e){return(t.getType()===void 0||e.type===t.getType())&&t.getNameFilter().match(e.name)&&t.getUnitFilter().match(e.unit)}_matchMeter(t,e){return t.getNameFilter().match(e.name)&&(e.version===void 0||t.getVersionFilter().match(e.version))&&(e.schemaUrl===void 0||t.getSchemaUrlFilter().match(e.schemaUrl))}}});function w(r,t,e){return ts(r)||m.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:t,description:e?.description??"",unit:e?.unit??"",valueType:e?.valueType??G.DOUBLE,advice:e?.advice??{}}}function Xn(r,t){return{name:r.name??t.name,description:r.description??t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function Kn(r,t){return on(r.name,t.name)&&r.unit===t.unit&&r.type===t.type&&r.valueType===t.valueType}function ts(r){return Qo.test(r)}var Qo,wt=u(()=>{"use strict";p();x();Qo=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function yt(r){return r instanceof Z}var J,fe,pe,_e,de,Z,ge,Ee,Se,Ae=u(()=>{"use strict";p();J=class{_writableMetricStorage;_descriptor;constructor(t,e){this._writableMetricStorage=t,this._descriptor=e}_record(t,e={},i){if(typeof t!="number"){m.warn(`non-number value provided to metric ${this._descriptor.name}: ${t}`);return}this._descriptor.valueType===G.INT&&!Number.isInteger(t)&&(m.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._writableMetricStorage.record(t,e,i,Date.now())}},fe=class extends J{add(t,e,i){this._record(t,e,i)}},pe=class extends J{add(t,e,i){if(t<0){m.warn(`negative value provided to counter ${this._descriptor.name}: ${t}`);return}this._record(t,e,i)}},_e=class extends J{record(t,e,i){this._record(t,e,i)}},de=class extends J{record(t,e,i){if(t<0){m.warn(`negative value provided to histogram ${this._descriptor.name}: ${t}`);return}this._record(t,e,i)}},Z=class{_metricStorages;_descriptor;_observableRegistry;constructor(t,e,i){this._descriptor=t,this._metricStorages=e,this._observableRegistry=i}addCallback(t){this._observableRegistry.addCallback(t,this)}removeCallback(t){this._observableRegistry.removeCallback(t,this)}},ge=class extends Z{},Ee=class extends Z{},Se=class extends Z{}});var Te,Wn=u(()=>{"use strict";wt();Ae();N();Te=class{_meterSharedState;constructor(t){this._meterSharedState=t}createGauge(t,e){let i=w(t,h.GAUGE,e),n=this._meterSharedState.registerMetricStorage(i);return new _e(n,i)}createHistogram(t,e){let i=w(t,h.HISTOGRAM,e),n=this._meterSharedState.registerMetricStorage(i);return new de(n,i)}createCounter(t,e){let i=w(t,h.COUNTER,e),n=this._meterSharedState.registerMetricStorage(i);return new pe(n,i)}createUpDownCounter(t,e){let i=w(t,h.UP_DOWN_COUNTER,e),n=this._meterSharedState.registerMetricStorage(i);return new fe(n,i)}createObservableGauge(t,e){let i=w(t,h.OBSERVABLE_GAUGE,e),n=this._meterSharedState.registerAsyncMetricStorage(i);return new Ee(i,n,this._meterSharedState.observableRegistry)}createObservableCounter(t,e){let i=w(t,h.OBSERVABLE_COUNTER,e),n=this._meterSharedState.registerAsyncMetricStorage(i);return new ge(i,n,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(t,e){let i=w(t,h.OBSERVABLE_UP_DOWN_COUNTER,e),n=this._meterSharedState.registerAsyncMetricStorage(i);return new Se(i,n,this._meterSharedState.observableRegistry)}addBatchObservableCallback(t,e){this._meterSharedState.observableRegistry.addBatchCallback(t,e)}removeBatchObservableCallback(t,e){this._meterSharedState.observableRegistry.removeBatchCallback(t,e)}}});var Q,xr=u(()=>{"use strict";wt();Q=class{_instrumentDescriptor;constructor(t){this._instrumentDescriptor=t}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(t){this._instrumentDescriptor=w(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:t,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var Mr,d,bt=u(()=>{"use strict";x();Mr=class{_valueMap=new Map;_keyMap=new Map;_hash;constructor(t){this._hash=t}get(t,e){return e??=this._hash(t),this._valueMap.get(e)}getOrDefault(t,e){let i=this._hash(t);if(this._valueMap.has(i))return this._valueMap.get(i);let n=e();return this._keyMap.has(i)||this._keyMap.set(i,t),this._valueMap.set(i,n),n}set(t,e,i){i??=this._hash(t),this._keyMap.has(i)||this._keyMap.set(i,t),this._valueMap.set(i,e)}has(t,e){return e??=this._hash(t),this._valueMap.has(e)}*keys(){let t=this._keyMap.entries(),e=t.next();for(;e.done!==!0;)yield[e.value[1],e.value[0]],e=t.next()}*entries(){let t=this._valueMap.entries(),e=t.next();for(;e.done!==!0;)yield[this._keyMap.get(e.value[0]),e.value[1],e.value[0]],e=t.next()}get size(){return this._valueMap.size}},d=class extends Mr{constructor(){super(Jt)}}});var tt,wr=u(()=>{"use strict";R();x();bt();tt=class{_activeCollectionStorage=new d;_cumulativeMemoStorage=new d;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(t,e){this._aggregator=t,this._cardinalityLimit=(e??2e3)-1,this._overflowHashCode=Jt(this._overflowAttributes)}record(t,e,i){let n=this._activeCollectionStorage.get(e);if(!n){let o=g(i);if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(o))?.record(t);return}n=this._aggregator.createAccumulation(o),this._activeCollectionStorage.set(e,n)}n?.record(t)}batchCumulate(t,e){for(let[i,n,o]of t.entries()){let s=i,a=o,c=this._aggregator.createAccumulation(e);c?.record(n);let l=c;if(this._cumulativeMemoStorage.has(s,a)){let f=this._cumulativeMemoStorage.get(s,a);l=this._aggregator.diff(f,c)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(s=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(s,a))){let f=this._cumulativeMemoStorage.get(s,a);l=this._aggregator.diff(f,c)}if(this._activeCollectionStorage.has(s,a)){let f=this._activeCollectionStorage.get(s,a);l=this._aggregator.merge(f,l)}this._cumulativeMemoStorage.set(s,c,a),this._activeCollectionStorage.set(s,l,a)}}collect(){let t=this._activeCollectionStorage;return this._activeCollectionStorage=new d,t}}});function es(r){return Array.from(r.entries())}var et,yr=u(()=>{"use strict";qt();bt();et=class r{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(t,e){this._aggregator=t,e.forEach(i=>{this._unreportedAccumulations.set(i,[])})}buildMetrics(t,e,i,n){this._stashAccumulations(i);let o=this._getMergedUnreportedAccumulations(t),s=o,a;if(this._reportHistory.has(t)){let l=this._reportHistory.get(t),f=l.collectionTime;a=l.aggregationTemporality,a===P.CUMULATIVE?s=r.merge(l.accumulations,o,this._aggregator):s=r.calibrateStartTime(l.accumulations,o,f)}else a=t.selectAggregationTemporality(e.type);this._reportHistory.set(t,{accumulations:s,collectionTime:n,aggregationTemporality:a});let c=es(s);if(c.length!==0)return this._aggregator.toMetricData(e,a,c,n)}_stashAccumulations(t){let e=this._unreportedAccumulations.keys();for(let i of e){let n=this._unreportedAccumulations.get(i);n===void 0&&(n=[],this._unreportedAccumulations.set(i,n)),n.push(t)}}_getMergedUnreportedAccumulations(t){let e=new d,i=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),i===void 0)return e;for(let n of i)e=r.merge(e,n,this._aggregator);return e}static merge(t,e,i){let n=t,o=e.entries(),s=o.next();for(;s.done!==!0;){let[a,c,l]=s.value;if(t.has(a,l)){let f=t.get(a,l),T=i.merge(f,c);n.set(a,T,l)}else n.set(a,c,l);s=o.next()}return n}static calibrateStartTime(t,e,i){for(let[n,o]of t.keys())e.get(n,o)?.setStartTime(i);return e}}});var xe,Yn=u(()=>{"use strict";xr();wr();yr();bt();xe=class extends Q{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(t,e,i,n,o){super(t),this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new tt(e,this._aggregationCardinalityLimit),this._temporalMetricStorage=new et(e,n),this._attributesProcessor=i}record(t,e){if(this._attributesProcessor===void 0){this._deltaMetricStorage.batchCumulate(t,e);return}let i=new d;for(let[n,o]of t.entries())i.set(this._attributesProcessor.process(n),o);this._deltaMetricStorage.batchCumulate(i,e)}collect(t,e){let i=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,i,e)}}});function br(r,t){let e="";return r.unit!==t.unit&&(e+=` - Unit '${r.unit}' does not match '${t.unit}'
|
|
4
|
+
import{e as Br,g as it,h as Dr,i as nt,j as ot,k as Vr}from"./chunk-UJIMMEIV.js";import{a as b,b as vr,c as Nt,d as Ot,e as G,f as Ur,i as Gr,m as B,n as m,o as It,p as Be,q as p}from"./chunk-456FRBGE.js";import{b as u,d as Lr}from"./chunk-7MKA3SHV.js";import{inspect as Fr}from"util";function Pt(r){let t=process.env[r];if(t==null||t.trim()==="")return;let e=Number(t);if(isNaN(e)){m.warn(`Unknown value ${Fr(t)} for ${r}, expected a number, using defaults`);return}return e}function st(r){let t=process.env[r];if(!(t==null||t.trim()===""))return t}function Ct(r){let t=process.env[r]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||m.warn(`Unknown value ${Fr(t)} for ${r}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function Lt(r){return st(r)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}var kr=u(()=>{"use strict";p()});var vt,$r=u(()=>{"use strict";vt=globalThis});var Hr,zr=u(()=>{"use strict";Hr="2.11.0"});var jr,Xr=u(()=>{"use strict";jr="process.runtime.name"});var O,Kr=u(()=>{"use strict";zr();Vr();Xr();O={[nt]:"opentelemetry",[jr]:"node",[it]:Dr,[ot]:Hr}});var I,Wr=u(()=>{"use strict";kr();$r();Kr();I=performance});var De=u(()=>{"use strict";Wr()});function g(r){let t=r/1e3,e=Math.trunc(t),i=Math.round(r%1e3*po);return[e,i]}function qr(){return I.timeOrigin}function k(r){let t=g(I.timeOrigin),e=g(typeof r=="number"?r:I.now());return Ve(t,e)}function Jr(r){if(Bt(r))return r;if(typeof r=="number")return r<I.timeOrigin/2?k(r):g(r);if(r instanceof Date)return g(r.getTime());throw TypeError("Invalid input type")}function Ut(r,t){let e=t[0]-r[0],i=t[1]-r[1];return i<0&&(e-=1,i+=at),[e,i]}function Zr(r){let t=Yr,e=`${"0".repeat(t)}${r[1]}Z`,i=e.substring(e.length-t-1);return new Date(r[0]*1e3).toISOString().replace("000Z",i)}function Qr(r){return r[0]*at+r[1]}function D(r){return r[0]*1e6+r[1]/1e3}function ti(r){return r[0]*1e3+r[1]/1e6}function Gt(r){return r[0]+r[1]/at}function Bt(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}function ei(r){return Bt(r)||typeof r=="number"||r instanceof Date}function Ve(r,t){let e=[r[0]+t[0],r[1]+t[1]];return e[1]>=at&&(e[1]-=at,e[0]+=1),e}var Yr,fo,po,at,ri=u(()=>{"use strict";De();Yr=9,fo=6,po=Math.pow(10,fo),at=Math.pow(10,Yr)});var E,ii=u(()=>{"use strict";(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(E||(E={}))});var Dt,ni=u(()=>{"use strict";Dt=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,e)=>{this._resolve=t,this._reject=e})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}});var Vt,oi=u(()=>{"use strict";ni();Vt=class{_isCalled=!1;_deferred=new Dt;_callback;_that;constructor(t,e){this._callback=t,this._that=e}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}});function Ft(r){return r.setValue(Fe,!0)}function si(r){return r.deleteValue(Fe)}function $(r){return r.getValue(Fe)===!0}var Fe,ct=u(()=>{"use strict";p();Fe=Nt("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var kt,ai=u(()=>{"use strict";kt="baggage"});function mi(r){return r.reduce((t,e)=>{let i=`${t}${t!==""?",":""}${e}`;return i.length>8192?t:i},"")}function hi(r){return r.getAllEntries().map(([t,e])=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(e.value)}`;return e.metadata!==void 0&&(i+=";"+e.metadata.toString()),i})}function fi(r){if(!r)return;let t=r.indexOf(";"),e=t===-1?r:r.substring(0,t),i=e.indexOf("=");if(i<=0)return;let n=e.substring(0,i).trim(),o=e.substring(i+1).trim();if(!n||!o)return;let s,a;try{s=decodeURIComponent(n),a=decodeURIComponent(o)}catch{return}let c;if(t!==-1&&t<r.length-1){let l=r.substring(t+1);c=vr(l)}return{key:s,value:a,metadata:c}}function ke(r,t,e,i){let n=0;for(;n<r.length&&e<180;){let o=r.indexOf(",",n),s=o===-1?r.length:o,a=s-n;if(a<=4096){let c=fi(r.substring(n,s));if(c){let l=(e===0?0:1)+a;if(i+l>8192)break;t[c.key]=c.metadata?{value:c.value,metadata:c.metadata}:{value:c.value},e++,i+=l}}if(o===-1)break;n=o+1}return[e,i]}function pi(r){let t={};return typeof r=="string"&&r.length>0&&r.split(",").forEach(e=>{let i=fi(e);i!==void 0&&i.value.length>0&&(t[i.key]=i.value)}),t}var $e=u(()=>{"use strict";p()});var $t,_i=u(()=>{"use strict";p();ct();ai();$e();$t=class{inject(t,e,i){let n=It.getBaggage(t);if(!n||$(t))return;let o=hi(n).filter(a=>a.length<=4096).slice(0,180),s=mi(o);s.length>0&&i.set(e,kt,s)}extract(t,e,i){let n=i.get(e,kt);if(!n)return t;let o={},s=0,a=0;if(Array.isArray(n))for(let c=0;c<n.length;c++)[s,a]=ke(n[c],o,s,a);else[s]=ke(n,o,s,a);return s===0?t:It.setBaggage(t,It.createBaggage(o))}fields(){return[kt]}}});var Ht,di=u(()=>{"use strict";Ht=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,e){this._monotonicClock=e,this._epochMillis=t.now(),this._performanceMillis=e.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}}});function gi(r){let t={};if(typeof r!="object"||r==null)return t;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;if(!Eo(e)){m.warn(`Invalid attribute key: ${e}`);continue}let i=r[e];if(!He(i)){m.warn(`Invalid attribute value set for key: ${e}`);continue}Array.isArray(i)?t[e]=i.slice():t[e]=i}return t}function Eo(r){return typeof r=="string"&&r!==""}function He(r){return r==null?!0:Array.isArray(r)?So(r):Ei(typeof r)}function So(r){let t;for(let e of r){if(e==null)continue;let i=typeof e;if(i!==t){if(!t){if(Ei(i)){t=i;continue}return!1}return!1}}return!0}function Ei(r){switch(r){case"number":case"boolean":case"string":return!0}return!1}var Si=u(()=>{"use strict";p()});function zt(){return r=>{m.error(Ao(r))}}function Ao(r){return typeof r=="string"?r:JSON.stringify(To(r))}function To(r){let t={},e=r;for(;e!==null;)Object.getOwnPropertyNames(e).forEach(i=>{if(t[i])return;let n=e[i];n&&(t[i]=String(n))}),e=Object.getPrototypeOf(e);return t}var ze=u(()=>{"use strict";p()});function Ti(r){Ai=r}function ut(r){try{Ai(r)}catch{}}var Ai,xi=u(()=>{"use strict";ze();Ai=zt()});function Mi(r){typeof r!="number"&&r.unref()}var wi=u(()=>{"use strict"});var jt,yi=u(()=>{"use strict";p();jt=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let e=new Set;for(let i of this._propagators){let n=typeof i.fields=="function"?i.fields():[];for(let o of n)e.add(o)}this._fields=Array.from(e)}inject(t,e,i){for(let n of this._propagators)try{n.inject(t,e,i)}catch(o){m.warn(`Failed to inject with ${n.constructor.name}. Err: ${o.message}`)}}extract(t,e,i){return this._propagators.reduce((n,o)=>{try{return o.extract(n,e,i)}catch(s){m.warn(`Failed to extract with ${o.constructor.name}. Err: ${s.message}`)}return n},t)}fields(){return this._fields.slice()}}});function Xe(r){return wo.test(r)}function Ke(r){return yo.test(r)&&!bo.test(r)}var je,xo,Mo,wo,yo,bo,bi=u(()=>{"use strict";je="[_0-9a-z-*/]",xo=`[a-z]${je}{0,255}`,Mo=`[a-z0-9]${je}{0,240}@[a-z]${je}{0,13}`,wo=new RegExp(`^(?:${xo}|${Mo})$`),yo=/^[ -~]{0,255}[!-~]$/,bo=/,|=/});var Ro,Ri,Ni,Oi,H,We=u(()=>{"use strict";bi();Ro=32,Ri=512,Ni=",",Oi="=",H=class r{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,e){if(!Xe(t)||!Ke(e))return this;let i=this._getState(),n=i.get(t),o=this._length;if(typeof n=="string"?o+=e.length-n.length:o+=t.length+e.length+(i.size>0?2:1),o>Ri)return this;let s=new Map(i);return s.delete(t),s.set(t,e),this._fromState(s,o)}unset(t){let e=this._getState(),i=e.get(t);if(typeof i!="string")return this;let n=this._length-(t.length+i.length+1);e.size>1&&(n=n-1);let o=new Map(e);return o.delete(t),this._fromState(o,n)}get(t){return this._getState().get(t)}serialize(){let t="",e=0;for(let i of this._getState())e>0&&(t=Ni+t),t=`${i[0]}${Oi}${i[1]}`+t,e++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(Ni),e=new Map,i=0;for(let n of t){let o=n.trim(),s=o.indexOf(Oi);if(s===-1)continue;let a=o.slice(0,s),c=o.slice(s+1);if(!Xe(a)||!Ke(c))continue;let l=i+o.length+(e.size>0?1:0);if(!(l>Ri)&&(e.set(a,c),i=l,e.size>=Ro))break}return this._length=i,this._internalState=new Map(Array.from(e.entries()).reverse()),this._internalState}_fromState(t,e){let i=Object.create(r.prototype);return i._internalState=t,i._length=e,i}}});function Ye(r){let t=Lo.exec(r);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var lt,mt,No,Oo,Io,Po,Co,Lo,Xt,Ii=u(()=>{"use strict";p();ct();We();lt="traceparent",mt="tracestate",No="00",Oo="(?!ff)[\\da-f]{2}",Io="(?![0]{32})[\\da-f]{32}",Po="(?![0]{16})[\\da-f]{16}",Co="[\\da-f]{2}",Lo=new RegExp(`^\\s?(${Oo})-(${Io})-(${Po})-(${Co})(-.*)?\\s?$`);Xt=class{inject(t,e,i){let n=Be.getSpanContext(t);if(!n||$(t)||!Gr(n))return;let o=`${No}-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Ur.NONE).toString(16)}`;i.set(e,lt,o),n.traceState&&i.set(e,mt,n.traceState.serialize())}extract(t,e,i){let n=i.get(e,lt);if(!n)return t;let o=Array.isArray(n)?n[0]:n;if(typeof o!="string")return t;let s=Ye(o);if(!s)return t;s.isRemote=!0;let a=i.get(e,mt);if(a){let c=Array.isArray(a)?a.join(","):a;s.traceState=new H(typeof c=="string"?c:void 0)}return Be.setSpanContext(t,s)}fields(){return[lt,mt]}}});function Pi(r,t){return r.setValue(qe,t)}function Ci(r){return r.deleteValue(qe)}function Li(r){return r.getValue(qe)}var qe,Kt,vi=u(()=>{"use strict";p();qe=Nt("OpenTelemetry SDK Context Key RPC_METADATA");(function(r){r.HTTP="http"})(Kt||(Kt={}))});function Je(r){if(!Fo(r)||ko(r)!==vo)return!1;let t=Vo(r);if(t===null)return!0;let e=Bi.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Ui.call(e)===Do}function Fo(r){return r!=null&&typeof r=="object"}function ko(r){return r==null?r===void 0?Go:Uo:V&&V in Object(r)?$o(r):Ho(r)}function $o(r){let t=Bi.call(r,V),e=r[V],i=!1;try{r[V]=void 0,i=!0}catch{}let n=Di.call(r);return i&&(t?r[V]=e:delete r[V]),n}function Ho(r){return Di.call(r)}var vo,Uo,Go,Bo,Ui,Do,Vo,Gi,Bi,V,Di,Vi=u(()=>{"use strict";vo="[object Object]",Uo="[object Null]",Go="[object Undefined]",Bo=Function.prototype,Ui=Bo.toString,Do=Ui.call(Object),Vo=Object.getPrototypeOf,Gi=Object.prototype,Bi=Gi.hasOwnProperty,V=Symbol?Symbol.toStringTag:void 0,Di=Gi.toString});function ki(...r){let t=r.shift(),e=new WeakMap;for(;r.length>0;)t=$i(t,r.shift(),0,e);return t}function Ze(r){return Yt(r)?r.slice():r}function $i(r,t,e=0,i){let n;if(!(e>zo)){if(e++,Wt(r)||Wt(t)||Hi(t))n=Ze(t);else if(Yt(r)){if(n=r.slice(),Yt(t))for(let o=0,s=t.length;o<s;o++)n.push(Ze(t[o]));else if(ht(t)){let o=Object.keys(t);for(let s=0,a=o.length;s<a;s++){let c=o[s];c==="__proto__"||c==="constructor"||c==="prototype"||(n[c]=Ze(t[c]))}}}else if(ht(r))if(ht(t)){if(!jo(r,t))return t;n=Object.assign({},r);let o=Object.keys(t);for(let s=0,a=o.length;s<a;s++){let c=o[s];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let l=t[c];if(Wt(l))typeof l>"u"?delete n[c]:n[c]=l;else{let f=n[c],T=l;if(Fi(r,c,i)||Fi(t,c,i))delete n[c];else{if(ht(f)&&ht(T)){let y=i.get(f)||[],Rt=i.get(T)||[];y.push({obj:r,key:c}),Rt.push({obj:t,key:c}),i.set(f,y),i.set(T,Rt)}n[c]=$i(n[c],l,e,i)}}}}else n=t;return n}}function Fi(r,t,e){let i=e.get(r[t])||[];for(let n=0,o=i.length;n<o;n++){let s=i[n];if(s.key===t&&s.obj===r)return!0}return!1}function Yt(r){return Array.isArray(r)}function Hi(r){return typeof r=="function"}function ht(r){return!Wt(r)&&!Yt(r)&&!Hi(r)&&typeof r=="object"}function Wt(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function jo(r,t){return!(!Je(r)||!Je(t))}var zo,zi=u(()=>{"use strict";Vi();zo=20});function ji(r,t){let e,i=new Promise(function(o,s){e=setTimeout(function(){s(new ft("Operation timed out."))},t)});return Promise.race([r,i]).then(n=>(clearTimeout(e),n),n=>{throw clearTimeout(e),n})}var ft,Xi=u(()=>{"use strict";ft=class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}});function Qe(r,t){return typeof t=="string"?r===t:!!r.match(t)}function Ki(r,t){if(!t)return!1;for(let e of t)if(Qe(r,e))return!0;return!1}var Wi=u(()=>{"use strict"});function qi(r){if(r==null)return;let t=Yi[r.toUpperCase()];return t??(m.warn(`Unknown log level "${r}", expected one of ${Object.keys(Yi)}, using default`),b.INFO)}var Yi,Ji=u(()=>{"use strict";p();Yi={ALL:b.ALL,VERBOSE:b.VERBOSE,DEBUG:b.DEBUG,INFO:b.INFO,WARN:b.WARN,ERROR:b.ERROR,NONE:b.NONE}});function Zi(r,t){return new Promise(e=>{B.with(Ft(B.active()),()=>{r.export(t,e)})})}var Qi=u(()=>{"use strict";p();ct()});var Xo={};Lr(Xo,{AnchoredClock:()=>Ht,BindOnceFuture:()=>Vt,CompositePropagator:()=>jt,ExportResultCode:()=>E,RPCType:()=>Kt,SDK_INFO:()=>O,TRACE_PARENT_HEADER:()=>lt,TRACE_STATE_HEADER:()=>mt,TimeoutError:()=>ft,TraceState:()=>H,W3CBaggagePropagator:()=>$t,W3CTraceContextPropagator:()=>Xt,_globalThis:()=>vt,addHrTimes:()=>Ve,callWithTimeout:()=>ji,deleteRPCMetadata:()=>Ci,diagLogLevelFromString:()=>qi,getBooleanFromEnv:()=>Ct,getNumberFromEnv:()=>Pt,getRPCMetadata:()=>Li,getStringFromEnv:()=>st,getStringListFromEnv:()=>Lt,getTimeOrigin:()=>qr,globalErrorHandler:()=>ut,hrTime:()=>k,hrTimeDuration:()=>Ut,hrTimeToMicroseconds:()=>D,hrTimeToMilliseconds:()=>ti,hrTimeToNanoseconds:()=>Qr,hrTimeToSeconds:()=>Gt,hrTimeToTimeStamp:()=>Zr,internal:()=>tr,isAttributeValue:()=>He,isTimeInput:()=>ei,isTimeInputHrTime:()=>Bt,isTracingSuppressed:()=>$,isUrlIgnored:()=>Ki,loggingErrorHandler:()=>zt,merge:()=>ki,millisToHrTime:()=>g,otperformance:()=>I,parseKeyPairsIntoRecord:()=>pi,parseTraceParent:()=>Ye,sanitizeAttributes:()=>gi,setGlobalErrorHandler:()=>Ti,setRPCMetadata:()=>Pi,suppressTracing:()=>Ft,timeInputToHrTime:()=>Jr,unrefTimer:()=>Mi,unsuppressTracing:()=>si,urlMatches:()=>Qe});var tr,R=u(()=>{"use strict";_i();di();Si();xi();ze();ri();wi();ii();$e();De();yi();Ii();vi();ct();We();zi();Xi();Wi();oi();Ji();Qi();tr={_export:Zi}});var P,qt=u(()=>{"use strict";(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(P||(P={}))});var h,S,N=u(()=>{"use strict";(function(r){r.COUNTER="COUNTER",r.GAUGE="GAUGE",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(h||(h={}));(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(S||(S={}))});var A,z=u(()=>{"use strict";(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(A||(A={}))});var pt,tn=u(()=>{"use strict";z();pt=class{kind=A.DROP;createAccumulation(){}merge(t,e){}diff(t,e){}toMetricData(t,e,i,n){}}});function Jt(r){let t=Object.keys(r);return t.length===0?"":(t=t.sort(),JSON.stringify(t.map(e=>[e,r[e]])))}function en(r){return`${r.name}:${r.version??""}:${r.schemaUrl??""}`}function C(r,t){let e,i=new Promise(function(o,s){e=setTimeout(function(){s(new F("Operation timed out."))},t)});return Promise.race([r,i]).then(n=>(clearTimeout(e),n),n=>{throw clearTimeout(e),n})}function rn(r,t){if(r.size!==t.size)return!1;for(let e of r)if(!t.has(e))return!1;return!0}function nn(r,t){let e=0,i=r.length-1,n=r.length;for(;i>=e;){let o=e+Math.trunc((i-e)/2);r[o]<t?e=o+1:(n=o,i=o-1)}return n}function on(r,t){return r.toLowerCase()===t.toLowerCase()}var F,x=u(()=>{"use strict";F=class r extends Error{constructor(t){super(t),Object.setPrototypeOf(this,r.prototype)}}});function Ko(r){let t=r.map(()=>0);return t.push(0),{buckets:{boundaries:r,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var j,X,sn=u(()=>{"use strict";z();N();x();j=class{startTime;_boundaries;_recordMinMax;_current;constructor(t,e,i=!0,n=Ko(e)){this.startTime=t,this._boundaries=e,this._recordMinMax=i,this._current=n}record(t){if(Number.isNaN(t))return;this._current.count+=1,this._current.sum+=t,this._recordMinMax&&(this._current.min=Math.min(t,this._current.min),this._current.max=Math.max(t,this._current.max),this._current.hasMinMax=!0);let e=nn(this._boundaries,t);this._current.buckets.counts[e]+=1}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},X=class{kind=A.HISTOGRAM;_boundaries;_recordMinMax;constructor(t,e){this._boundaries=t,this._recordMinMax=e}createAccumulation(t){return new j(t,this._boundaries,this._recordMinMax)}merge(t,e){let i=t.toPointValue(),n=e.toPointValue(),o=i.buckets.counts,s=n.buckets.counts,a=new Array(o.length);for(let f=0;f<o.length;f++)a[f]=o[f]+s[f];let c=1/0,l=-1/0;return this._recordMinMax&&(i.hasMinMax&&n.hasMinMax?(c=Math.min(i.min,n.min),l=Math.max(i.max,n.max)):i.hasMinMax?(c=i.min,l=i.max):n.hasMinMax&&(c=n.min,l=n.max)),new j(t.startTime,i.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:i.buckets.boundaries,counts:a},count:i.count+n.count,sum:i.sum+n.sum,hasMinMax:this._recordMinMax&&(i.hasMinMax||n.hasMinMax),min:c,max:l})}diff(t,e){let i=t.toPointValue(),n=e.toPointValue(),o=i.buckets.counts,s=n.buckets.counts,a=new Array(o.length);for(let c=0;c<o.length;c++)a[c]=s[c]-o[c];return new j(e.startTime,i.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:i.buckets.boundaries,counts:a},count:n.count-i.count,sum:n.sum-i.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.HISTOGRAM,dataPoints:i.map(([o,s])=>{let a=s.toPointValue(),c=t.type===h.GAUGE||t.type===h.UP_DOWN_COUNTER||t.type===h.OBSERVABLE_GAUGE||t.type===h.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:o,startTime:s.startTime,endTime:n,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:c?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}}});var _t,er,an=u(()=>{"use strict";_t=class r{backing;indexBase;indexStart;indexEnd;constructor(t=new er,e=0,i=0,n=0){this.backing=t,this.indexBase=e,this.indexStart=i,this.indexEnd=n}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(t,e)=>this.at(e))}at(t){let e=this.indexBase-this.indexStart;return t<e&&(t+=this.backing.length),t-=e,this.backing.countAt(t)}incrementBucket(t,e){this.backing.increment(t,e)}decrementBucket(t,e){this.backing.decrement(t,e)}trim(){for(let t=0;t<this.length;t++)if(this.at(t)!==0){this.indexStart+=t;break}else if(t===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let t=this.length-1;t>=0;t--)if(this.at(t)!==0){this.indexEnd-=this.length-t-1;break}this._rotate()}downscale(t){this._rotate();let e=1+this.indexEnd-this.indexStart,i=1<<t,n=0,o=0;for(let s=this.indexStart;s<=this.indexEnd;){let a=s%i;a<0&&(a+=i);for(let c=a;c<i&&n<e;c++)this._relocateBucket(o,n),n++,s++;o++}this.indexStart>>=t,this.indexEnd>>=t,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let t=this.indexBase-this.indexStart;t!==0&&(t>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,t),this.backing.reverse(t,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+t)),this.indexBase=this.indexStart)}_relocateBucket(t,e){t!==e&&this.incrementBucket(t,this.backing.emptyBucket(e))}},er=class r{_counts;constructor(t=[0]){this._counts=t}get length(){return this._counts.length}countAt(t){return this._counts[t]}growTo(t,e,i){let n=new Array(t).fill(0);n.splice(i,this._counts.length-e,...this._counts.slice(e)),n.splice(0,e,...this._counts.slice(0,e)),this._counts=n}reverse(t,e){let i=Math.floor((t+e)/2)-t;for(let n=0;n<i;n++){let o=this._counts[t+n];this._counts[t+n]=this._counts[e-n-1],this._counts[e-n-1]=o}}emptyBucket(t){let e=this._counts[t];return this._counts[t]=0,e}increment(t,e){this._counts[t]+=e}decrement(t,e){this._counts[t]>=e?this._counts[t]-=e:this._counts[t]=0}clone(){return new r([...this._counts])}}});function cn(r){return rr.setFloat64(0,r),{hi:rr.getUint32(0),lo:rr.getUint32(4)}}function Zt(r){let{hi:t}=cn(r);return((t&2146435072)>>20)-1023}function Qt(r){let{hi:t,lo:e}=cn(r);return(t&1048575)===0&&e===0}var dt,rr,ir=u(()=>{"use strict";dt=Math.pow(2,-1022),rr=new DataView(new ArrayBuffer(8))});function gt(r,t){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,t)}function ln(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}var te=u(()=>{"use strict"});var M,ee=u(()=>{"use strict";M=class extends Error{}});var re,hn=u(()=>{"use strict";ir();te();ee();re=class{_shift;constructor(t){this._shift=-t}mapToIndex(t){if(t<dt)return this._minNormalLowerBoundaryIndex();let e=Zt(t),i=Qt(t)?-1:0;return e+i>>this._shift}lowerBoundary(t){let e=this._minNormalLowerBoundaryIndex();if(t<e)throw new M(`underflow: ${t} is < minimum lower boundary: ${e}`);let i=this._maxNormalLowerBoundaryIndex();if(t>i)throw new M(`overflow: ${t} is > maximum lower boundary: ${i}`);return gt(1,t<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let t=-1022>>this._shift;return this._shift<2&&t--,t}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}}});var ie,fn=u(()=>{"use strict";ir();te();ee();ie=class{_scale;_scaleFactor;_inverseFactor;constructor(t){this._scale=t,this._scaleFactor=gt(Math.LOG2E,t),this._inverseFactor=gt(Math.LN2,-t)}mapToIndex(t){if(t<=dt)return this._minNormalLowerBoundaryIndex()-1;if(Qt(t))return(Zt(t)<<this._scale)-1;let e=Math.floor(Math.log(t)*this._scaleFactor),i=this._maxNormalLowerBoundaryIndex();return e>=i?i:e}lowerBoundary(t){let e=this._maxNormalLowerBoundaryIndex();if(t>=e){if(t===e)return 2*Math.exp((t-(1<<this._scale))/this._scaleFactor);throw new M(`overflow: ${t} is > maximum lower boundary: ${e}`)}let i=this._minNormalLowerBoundaryIndex();if(t<=i){if(t===i)return dt;if(t===i-1)return Math.exp((t+(1<<this._scale))/this._scaleFactor)/2;throw new M(`overflow: ${t} is < minimum lower boundary: ${i}`)}return Math.exp(t*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}});function sr(r){if(r>_n||r<pn)throw new M(`expected scale >= ${pn} && <= ${_n}, got: ${r}`);return Wo[r+10]}var pn,_n,Wo,dn=u(()=>{"use strict";hn();fn();ee();pn=-10,_n=20,Wo=Array.from({length:31},(r,t)=>t>10?new ie(t-10):new re(t-10))});var K,Yo,qo,ar,ne,Et,gn=u(()=>{"use strict";z();N();p();an();dn();te();K=class r{static combine(t,e){return new r(Math.min(t.low,e.low),Math.max(t.high,e.high))}low;high;constructor(t,e){this.low=t,this.high=e}},Yo=20,qo=160,ar=2,ne=class r{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(t,e=qo,i=!0,n=0,o=0,s=0,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=new _t,f=new _t,T=sr(Yo)){this.startTime=t,this._maxSize=e,this._recordMinMax=i,this._sum=n,this._count=o,this._zeroCount=s,this._min=a,this._max=c,this._positive=l,this._negative=f,this._mapping=T,this._maxSize<ar&&(m.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${ar}`),this._maxSize=ar)}record(t){this.updateByIncrement(t,1)}setStartTime(t){this.startTime=t}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(t,e){if(Number.isFinite(t)){if(t>this._max&&(this._max=t),t<this._min&&(this._min=t),this._count+=e,t===0){this._zeroCount+=e;return}this._sum+=t*e,t>0?this._updateBuckets(this._positive,t,e):this._updateBuckets(this._negative,-t,e)}}merge(t){this._count===0?(this._min=t.min,this._max=t.max):t.count!==0&&(t.min<this.min&&(this._min=t.min),t.max>this.max&&(this._max=t.max)),this.startTime=t.startTime,this._sum+=t.sum,this._count+=t.count,this._zeroCount+=t.zeroCount;let e=this._minScale(t);this._downscale(this.scale-e),this._mergeBuckets(this.positive,t,t.positive,e),this._mergeBuckets(this.negative,t,t.negative,e)}diff(t){this._min=1/0,this._max=-1/0,this._sum-=t.sum,this._count-=t.count,this._zeroCount-=t.zeroCount;let e=this._minScale(t);this._downscale(this.scale-e),this._diffBuckets(this.positive,t,t.positive,e),this._diffBuckets(this.negative,t,t.negative,e)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(t,e,i){let n=this._mapping.mapToIndex(e),o=!1,s=0,a=0;if(t.length===0?(t.indexStart=n,t.indexEnd=t.indexStart,t.indexBase=t.indexStart):n<t.indexStart&&t.indexEnd-n>=this._maxSize?(o=!0,a=n,s=t.indexEnd):n>t.indexEnd&&n-t.indexStart>=this._maxSize&&(o=!0,a=t.indexStart,s=n),o){let c=this._changeScale(s,a);this._downscale(c),n=this._mapping.mapToIndex(e)}this._incrementIndexBy(t,n,i)}_incrementIndexBy(t,e,i){if(i===0)return;if(t.length===0&&(t.indexStart=t.indexEnd=t.indexBase=e),e<t.indexStart){let o=t.indexEnd-e;o>=t.backing.length&&this._grow(t,o+1),t.indexStart=e}else if(e>t.indexEnd){let o=e-t.indexStart;o>=t.backing.length&&this._grow(t,o+1),t.indexEnd=e}let n=e-t.indexBase;n<0&&(n+=t.backing.length),t.incrementBucket(n,i)}_grow(t,e){let i=t.backing.length,n=t.indexBase-t.indexStart,o=i-n,s=ln(e);s>this._maxSize&&(s=this._maxSize);let a=s-n;t.backing.growTo(s,o,a)}_changeScale(t,e){let i=0;for(;t-e>=this._maxSize;)t>>=1,e>>=1,i++;return i}_downscale(t){if(t===0)return;if(t<0)throw new Error(`impossible change of scale: ${this.scale}`);let e=this._mapping.scale-t;this._positive.downscale(t),this._negative.downscale(t),this._mapping=sr(e)}_minScale(t){let e=Math.min(this.scale,t.scale),i=K.combine(this._highLowAtScale(this.positive,this.scale,e),this._highLowAtScale(t.positive,t.scale,e)),n=K.combine(this._highLowAtScale(this.negative,this.scale,e),this._highLowAtScale(t.negative,t.scale,e));return Math.min(e-this._changeScale(i.high,i.low),e-this._changeScale(n.high,n.low))}_highLowAtScale(t,e,i){if(t.length===0)return new K(0,-1);let n=e-i;return new K(t.indexStart>>n,t.indexEnd>>n)}_mergeBuckets(t,e,i,n){let o=i.offset,s=e.scale-n;for(let a=0;a<i.length;a++)this._incrementIndexBy(t,o+a>>s,i.at(a))}_diffBuckets(t,e,i,n){let o=i.offset,s=e.scale-n;for(let a=0;a<i.length;a++){let l=(o+a>>s)-t.indexBase;l<0&&(l+=t.backing.length),t.decrementBucket(l,i.at(a))}t.trim()}},Et=class{kind=A.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(t,e){this._maxSize=t,this._recordMinMax=e}createAccumulation(t){return new ne(t,this._maxSize,this._recordMinMax)}merge(t,e){let i=e.clone();return i.merge(t),i}diff(t,e){let i=e.clone();return i.diff(t),i}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.EXPONENTIAL_HISTOGRAM,dataPoints:i.map(([o,s])=>{let a=s.toPointValue(),c=t.type===h.GAUGE||t.type===h.UP_DOWN_COUNTER||t.type===h.OBSERVABLE_GAUGE||t.type===h.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:o,startTime:s.startTime,endTime:n,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:c?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}}});var W,St,En=u(()=>{"use strict";z();R();N();W=class{startTime;_current;sampleTime;constructor(t,e=0,i=[0,0]){this.startTime=t,this._current=e,this.sampleTime=i}record(t){this._current=t,this.sampleTime=g(Date.now())}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},St=class{kind=A.LAST_VALUE;createAccumulation(t){return new W(t)}merge(t,e){let i=D(e.sampleTime)>=D(t.sampleTime)?e:t;return new W(t.startTime,i.toPointValue(),i.sampleTime)}diff(t,e){let i=D(e.sampleTime)>=D(t.sampleTime)?e:t;return new W(e.startTime,i.toPointValue(),i.sampleTime)}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.GAUGE,dataPoints:i.map(([o,s])=>({attributes:o,startTime:s.startTime,endTime:n,value:s.toPointValue()}))}}}});var L,Y,Sn=u(()=>{"use strict";z();N();L=class{startTime;monotonic;_current;reset;constructor(t,e,i=0,n=!1){this.startTime=t,this.monotonic=e,this._current=i,this.reset=n}record(t){this.monotonic&&t<0||(this._current+=t)}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},Y=class{kind=A.SUM;monotonic;constructor(t){this.monotonic=t}createAccumulation(t){return new L(t,this.monotonic)}merge(t,e){let i=t.toPointValue(),n=e.toPointValue();return e.reset?new L(e.startTime,this.monotonic,n,e.reset):new L(t.startTime,this.monotonic,i+n)}diff(t,e){let i=t.toPointValue(),n=e.toPointValue();return this.monotonic&&i>n?new L(e.startTime,this.monotonic,n,!0):new L(e.startTime,this.monotonic,n-i)}toMetricData(t,e,i,n){return{descriptor:t,aggregationTemporality:e,dataPointType:S.SUM,dataPoints:i.map(([o,s])=>({attributes:o,startTime:s.startTime,endTime:n,value:s.toPointValue()})),isMonotonic:this.monotonic}}}});var An=u(()=>{"use strict";tn();sn();gn();En();Sn()});var cr,ur,lr,mr,At,Tt,hr,pr,_r,dr,gr,Oc,Tn,xn=u(()=>{"use strict";p();An();N();cr=class r{static DEFAULT_INSTANCE=new pt;createAggregator(t){return r.DEFAULT_INSTANCE}},ur=class r{static MONOTONIC_INSTANCE=new Y(!0);static NON_MONOTONIC_INSTANCE=new Y(!1);createAggregator(t){switch(t.type){case h.COUNTER:case h.OBSERVABLE_COUNTER:case h.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}},lr=class r{static DEFAULT_INSTANCE=new St;createAggregator(t){return r.DEFAULT_INSTANCE}},mr=class r{static DEFAULT_INSTANCE=new X([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(t){return r.DEFAULT_INSTANCE}},At=class{_boundaries;_recordMinMax;constructor(t,e=!0){if(t==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");t=t.concat(),t=t.sort((o,s)=>o-s);let i=t.lastIndexOf(-1/0),n=t.indexOf(1/0);n===-1&&(n=void 0),this._boundaries=t.slice(i+1,n),this._recordMinMax=e}createAggregator(t){return new X(this._boundaries,this._recordMinMax)}},Tt=class{_maxSize;_recordMinMax;constructor(t=160,e=!0){this._maxSize=t,this._recordMinMax=e}createAggregator(t){return new Et(this._maxSize,this._recordMinMax)}},hr=class{_resolve(t){switch(t.type){case h.COUNTER:case h.UP_DOWN_COUNTER:case h.OBSERVABLE_COUNTER:case h.OBSERVABLE_UP_DOWN_COUNTER:return _r;case h.GAUGE:case h.OBSERVABLE_GAUGE:return dr;case h.HISTOGRAM:return t.advice.explicitBucketBoundaries?new At(t.advice.explicitBucketBoundaries):gr}return m.warn(`Unable to recognize instrument type: ${t.type}`),pr}createAggregator(t){return this._resolve(t).createAggregator(t)}},pr=new cr,_r=new ur,dr=new lr,gr=new mr,Oc=new Tt,Tn=new hr});function oe(r){switch(r.type){case _.DEFAULT:return Tn;case _.DROP:return pr;case _.SUM:return _r;case _.LAST_VALUE:return dr;case _.EXPONENTIAL_HISTOGRAM:{let t=r;return new Tt(t.options?.maxSize,t.options?.recordMinMax)}case _.EXPLICIT_BUCKET_HISTOGRAM:{let t=r;return t.options==null?gr:new At(t.options?.boundaries,t.options?.recordMinMax)}default:throw new Error("Unsupported Aggregation")}}var _,xt=u(()=>{"use strict";xn();(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.DROP=1]="DROP",r[r.SUM=2]="SUM",r[r.LAST_VALUE=3]="LAST_VALUE",r[r.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(_||(_={}))});function Mn(){if(se===void 0)try{let r=globalThis.process.argv0;se=r?`unknown_service:${r}`:"unknown_service"}catch{se="unknown_service"}return se}var se,wn=u(()=>{"use strict"});var q,yn=u(()=>{"use strict";q=r=>r!==null&&typeof r=="object"&&typeof r.then=="function"});function Rn(r,t){return Er.FromAttributeList(Object.entries(r),t)}function Sr(){return Rn({[Br]:Mn(),[it]:O[it],[nt]:O[nt],[ot]:O[ot]})}function bn(r){return r.map(([t,e])=>q(e)?[t,e.catch(i=>{m.debug("promise rejection for resource attribute: %s - %s",t,i)})]:[t,e])}function Jo(r){if(typeof r=="string"||r===void 0)return r;m.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",r)}function Zo(r,t){let e=r?.schemaUrl,i=t?.schemaUrl,n=e===void 0||e==="",o=i===void 0||i==="";if(n)return i;if(o||e===i)return e;m.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',e,i)}var Er,Nn=u(()=>{"use strict";p();R();Vr();wn();yn();Er=class r{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,e){let i=new r({},e);return i._rawAttributes=bn(t),i._asyncAttributesPending=t.filter(([n,o])=>q(o)).length>0,i}constructor(t,e){let i=t.attributes??{};this._rawAttributes=Object.entries(i).map(([n,o])=>(q(o)&&(this._asyncAttributesPending=!0),[n,o])),this._rawAttributes=bn(this._rawAttributes),this._schemaUrl=Jo(e?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){let[e,i]=this._rawAttributes[t];this._rawAttributes[t]=[e,q(i)?await i:i]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&m.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let t={};for(let[e,i]of this._rawAttributes){if(q(i)){m.debug(`Unsettled resource attribute ${e} skipped`);continue}i!=null&&(t[e]??=i)}return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let e=Zo(this,t),i=e?{schemaUrl:e}:void 0;return r.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],i)}}});var On=u(()=>{"use strict";Nn()});var In,ae,Ar=u(()=>{"use strict";qt();xt();In=r=>({type:_.DEFAULT}),ae=r=>P.CUMULATIVE});var Pn,Cn,Ln,vn,Un,Tr=u(()=>{"use strict";Pn="otel.component.name",Cn="otel.component.type",Ln="periodic_metric_reader",vn="otel.sdk.metric_reader.collection.duration",Un="error.type"});var Gn,Mt,Bn=u(()=>{"use strict";Tr();Gn=new Map,Mt=class{collectionDuration;standardAttrs;constructor(t,e){let i=Gn.get(t)??0;Gn.set(t,i+1),this.standardAttrs={[Cn]:t,[Pn]:`${t}/${i}`},this.collectionDuration=e.createHistogram(vn,{unit:"s",description:"The duration of the collect operation of the metric reader.",advice:{explicitBucketBoundaries:[]}})}recordCollection(t,e){let i=e?{...this.standardAttrs,[Un]:e}:this.standardAttrs;this.collectionDuration.record(t,i)}}});var Dn,Vn=u(()=>{"use strict";Dn="2.11.0"});var v,ce=u(()=>{"use strict";p();x();Ar();Bn();Vn();R();v=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_selfObsMetrics;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;_otelComponentType;constructor(t){this._aggregationSelector=t?.aggregationSelector??In,this._aggregationTemporalitySelector=t?.aggregationTemporalitySelector??ae,this._metricProducers=t?.metricProducers??[],this._cardinalitySelector=t?.cardinalitySelector,this._otelComponentType=t?.otelComponentType??this.constructor.name,this._selfObsMetrics=new Mt(this._otelComponentType,Ot())}setMetricProducer(t){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=t,this.onInitialized()}_setSelfObsMeterProvider(t){let e=t.getMeter("@opentelemetry/sdk-metrics",Dn);this._selfObsMetrics=new Mt(this._otelComponentType,e)}selectAggregation(t){return this._aggregationSelector(t)}selectAggregationTemporality(t){return this._aggregationTemporalitySelector(t)}selectCardinalityLimit(t){return this._cardinalitySelector?this._cardinalitySelector(t):2e3}onInitialized(){}async collect(t){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let e=k(),[i,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:t?.timeoutMillis}),...this._metricProducers.map(f=>f.collect({timeoutMillis:t?.timeoutMillis}))]),o=k(),s=i.errors.concat(n.flatMap(f=>f.errors)),a=Gt(Ut(e,o));this._selfObsMetrics.recordCollection(a,s.length>0?s[0].name??"collect_error":void 0);let c=i.resourceMetrics.resource,l=i.resourceMetrics.scopeMetrics.concat(n.flatMap(f=>f.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:c,scopeMetrics:l},errors:s}}async shutdown(t){if(this._shutdown){m.error("Cannot call shutdown twice.");return}t?.timeoutMillis==null?await this.onShutdown():await C(this.onShutdown(),t.timeoutMillis),this._shutdown=!0}async forceFlush(t){if(this._shutdown){m.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(t?.timeoutMillis==null){await this.onForceFlush();return}await C(this.onForceFlush(),t.timeoutMillis)}}});function Fn(r,t){if(!Number.isInteger(t)||t<=0)throw new Error("maxExportBatchSize must be a positive integer");let e=[],i=0,n=[];function o(){n.length>0&&(e.push({resource:r.resource,scopeMetrics:n}),n=[],i=0)}for(let s of r.scopeMetrics){let a=null;for(let c of s.metrics){let l=c.dataPoints;if(l.length===0){a||(a={scope:s.scope,metrics:[]},n.push(a)),a.metrics.push(c);continue}let f=0;for(;f<l.length;){let T=t-i,y=Math.min(T,l.length-f);a||(a={scope:s.scope,metrics:[]},n.push(a));let Rt={...c,dataPoints:l.slice(f,f+y)};a.metrics.push(Rt),f+=y,i+=y,i===t&&(o(),a=null)}}}return o(),e}var kn=u(()=>{"use strict"});var ue,$n=u(()=>{"use strict";p();R();ce();x();N();kn();Tr();ue=class extends v{_interval;_exporter;_exportInterval;_exportTimeout;_maxExportBatchSize;_ongoingExportPromise=null;constructor(t){let{exporter:e,exportIntervalMillis:i=6e4,metricProducers:n,cardinalityLimits:o,maxExportBatchSize:s}=t,{exportTimeoutMillis:a=3e4}=t;if(super({aggregationSelector:e.selectAggregation?.bind(e),aggregationTemporalitySelector:e.selectAggregationTemporality?.bind(e),otelComponentType:Ln,metricProducers:n,cardinalitySelector:c=>{let l={default:2e3,...o};switch(c){case h.COUNTER:return l.counter??l.default;case h.GAUGE:return l.gauge??l.default;case h.HISTOGRAM:return l.histogram??l.default;case h.OBSERVABLE_COUNTER:return l.observableCounter??l.default;case h.OBSERVABLE_UP_DOWN_COUNTER:return l.observableUpDownCounter??l.default;case h.OBSERVABLE_GAUGE:return l.observableGauge??l.default;case h.UP_DOWN_COUNTER:return l.upDownCounter??l.default;default:return l.default}}}),i<=0)throw Error("exportIntervalMillis must be greater than 0");if(a<=0)throw Error("exportTimeoutMillis must be greater than 0");if(s!==void 0&&(!Number.isInteger(s)||s<=0))throw Error("maxExportBatchSize must be a positive integer");if(i<a){if("exportIntervalMillis"in t&&"exportTimeoutMillis"in t)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");m.info(`Timeout of ${a} exceeds the interval of ${i}. Clamping timeout to interval duration.`),a=i}this._exportInterval=i,this._exportTimeout=a,this._exporter=e,this._maxExportBatchSize=s}async _runOnce(){try{await this._doRun()}catch(t){ut(t)}}async _doRun(){if(this._ongoingExportPromise){m.debug("PeriodicExportingMetricReader: export already in progress, skipping");return}let t=async()=>{let{resourceMetrics:e,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});if(i.length>0&&m.error("PeriodicExportingMetricReader: metrics collection errors",...i),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(s){m.debug("Error while resolving async portion of resource: ",s),ut(s)}if(e.scopeMetrics.length===0)return;let n=this._maxExportBatchSize?Fn(e,this._maxExportBatchSize):[e],o=null;for(let s of n)try{let a=await C(tr._export(this._exporter,s),this._exportTimeout);a.code!==E.SUCCESS&&(o=new Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`))}catch(a){if(a instanceof F){m.error(`PeriodicExportingMetricReader: metrics export timed out after ${this._exportTimeout}ms`);break}else m.error("PeriodicExportingMetricReader: metrics export threw error",a),o=a instanceof Error?a:new Error(String(a))}if(o)throw o};this._ongoingExportPromise=t();try{await this._ongoingExportPromise}finally{this._ongoingExportPromise=null}}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!="number"&&this._interval.unref()}async onForceFlush(){await this._awaitOngoingExport(),this._ongoingExportPromise?await this._awaitOngoingExport():await this._runOnce(),await this._exporter.forceFlush()}async _awaitOngoingExport(){if(this._ongoingExportPromise){m.debug("PeriodicExportingMetricReader: export already in progress, awaiting ongoing export");try{await this._ongoingExportPromise}catch{}}}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}});var le,Hn=u(()=>{"use strict";R();le=class{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(t){this._aggregationTemporality=t}export(t,e){if(this._shutdown){setTimeout(()=>e({code:E.FAILED}),0);return}this._metrics.push(t),setTimeout(()=>e({code:E.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(t){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var me,zn=u(()=>{"use strict";R();Ar();me=class r{_shutdown=!1;_temporalitySelector;constructor(t){this._temporalitySelector=t?.temporalitySelector??ae}export(t,e){if(this._shutdown){e({code:E.FAILED});return}return r._sendMetrics(t,e)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(t){return this._temporalitySelector(t)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(t,e){for(let i of t.scopeMetrics)for(let n of i.metrics)console.dir({descriptor:n.descriptor,dataPointType:n.dataPointType,dataPoints:n.dataPoints},{depth:null});e({code:E.SUCCESS})}}});var he,jn=u(()=>{"use strict";he=class{_registeredViews=[];addView(t){this._registeredViews.push(t)}findViews(t,e){return this._registeredViews.filter(n=>this._matchInstrument(n.instrumentSelector,t)&&this._matchMeter(n.meterSelector,e))}_matchInstrument(t,e){return(t.getType()===void 0||e.type===t.getType())&&t.getNameFilter().match(e.name)&&t.getUnitFilter().match(e.unit)}_matchMeter(t,e){return t.getNameFilter().match(e.name)&&(e.version===void 0||t.getVersionFilter().match(e.version))&&(e.schemaUrl===void 0||t.getSchemaUrlFilter().match(e.schemaUrl))}}});function w(r,t,e){return ts(r)||m.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:t,description:e?.description??"",unit:e?.unit??"",valueType:e?.valueType??G.DOUBLE,advice:e?.advice??{}}}function Xn(r,t){return{name:r.name??t.name,description:r.description??t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function Kn(r,t){return on(r.name,t.name)&&r.unit===t.unit&&r.type===t.type&&r.valueType===t.valueType}function ts(r){return Qo.test(r)}var Qo,wt=u(()=>{"use strict";p();x();Qo=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function yt(r){return r instanceof Z}var J,fe,pe,_e,de,Z,ge,Ee,Se,Ae=u(()=>{"use strict";p();J=class{_writableMetricStorage;_descriptor;constructor(t,e){this._writableMetricStorage=t,this._descriptor=e}_record(t,e={},i){if(typeof t!="number"){m.warn(`non-number value provided to metric ${this._descriptor.name}: ${t}`);return}this._descriptor.valueType===G.INT&&!Number.isInteger(t)&&(m.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._writableMetricStorage.record(t,e,i,Date.now())}},fe=class extends J{add(t,e,i){this._record(t,e,i)}},pe=class extends J{add(t,e,i){if(t<0){m.warn(`negative value provided to counter ${this._descriptor.name}: ${t}`);return}this._record(t,e,i)}},_e=class extends J{record(t,e,i){this._record(t,e,i)}},de=class extends J{record(t,e,i){if(t<0){m.warn(`negative value provided to histogram ${this._descriptor.name}: ${t}`);return}this._record(t,e,i)}},Z=class{_metricStorages;_descriptor;_observableRegistry;constructor(t,e,i){this._descriptor=t,this._metricStorages=e,this._observableRegistry=i}addCallback(t){this._observableRegistry.addCallback(t,this)}removeCallback(t){this._observableRegistry.removeCallback(t,this)}},ge=class extends Z{},Ee=class extends Z{},Se=class extends Z{}});var Te,Wn=u(()=>{"use strict";wt();Ae();N();Te=class{_meterSharedState;constructor(t){this._meterSharedState=t}createGauge(t,e){let i=w(t,h.GAUGE,e),n=this._meterSharedState.registerMetricStorage(i);return new _e(n,i)}createHistogram(t,e){let i=w(t,h.HISTOGRAM,e),n=this._meterSharedState.registerMetricStorage(i);return new de(n,i)}createCounter(t,e){let i=w(t,h.COUNTER,e),n=this._meterSharedState.registerMetricStorage(i);return new pe(n,i)}createUpDownCounter(t,e){let i=w(t,h.UP_DOWN_COUNTER,e),n=this._meterSharedState.registerMetricStorage(i);return new fe(n,i)}createObservableGauge(t,e){let i=w(t,h.OBSERVABLE_GAUGE,e),n=this._meterSharedState.registerAsyncMetricStorage(i);return new Ee(i,n,this._meterSharedState.observableRegistry)}createObservableCounter(t,e){let i=w(t,h.OBSERVABLE_COUNTER,e),n=this._meterSharedState.registerAsyncMetricStorage(i);return new ge(i,n,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(t,e){let i=w(t,h.OBSERVABLE_UP_DOWN_COUNTER,e),n=this._meterSharedState.registerAsyncMetricStorage(i);return new Se(i,n,this._meterSharedState.observableRegistry)}addBatchObservableCallback(t,e){this._meterSharedState.observableRegistry.addBatchCallback(t,e)}removeBatchObservableCallback(t,e){this._meterSharedState.observableRegistry.removeBatchCallback(t,e)}}});var Q,xr=u(()=>{"use strict";wt();Q=class{_instrumentDescriptor;constructor(t){this._instrumentDescriptor=t}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(t){this._instrumentDescriptor=w(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:t,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var Mr,d,bt=u(()=>{"use strict";x();Mr=class{_valueMap=new Map;_keyMap=new Map;_hash;constructor(t){this._hash=t}get(t,e){return e??=this._hash(t),this._valueMap.get(e)}getOrDefault(t,e){let i=this._hash(t);if(this._valueMap.has(i))return this._valueMap.get(i);let n=e();return this._keyMap.has(i)||this._keyMap.set(i,t),this._valueMap.set(i,n),n}set(t,e,i){i??=this._hash(t),this._keyMap.has(i)||this._keyMap.set(i,t),this._valueMap.set(i,e)}has(t,e){return e??=this._hash(t),this._valueMap.has(e)}*keys(){let t=this._keyMap.entries(),e=t.next();for(;e.done!==!0;)yield[e.value[1],e.value[0]],e=t.next()}*entries(){let t=this._valueMap.entries(),e=t.next();for(;e.done!==!0;)yield[this._keyMap.get(e.value[0]),e.value[1],e.value[0]],e=t.next()}get size(){return this._valueMap.size}},d=class extends Mr{constructor(){super(Jt)}}});var tt,wr=u(()=>{"use strict";R();x();bt();tt=class{_activeCollectionStorage=new d;_cumulativeMemoStorage=new d;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(t,e){this._aggregator=t,this._cardinalityLimit=(e??2e3)-1,this._overflowHashCode=Jt(this._overflowAttributes)}record(t,e,i){let n=this._activeCollectionStorage.get(e);if(!n){let o=g(i);if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(o))?.record(t);return}n=this._aggregator.createAccumulation(o),this._activeCollectionStorage.set(e,n)}n?.record(t)}batchCumulate(t,e){for(let[i,n,o]of t.entries()){let s=i,a=o,c=this._aggregator.createAccumulation(e);c?.record(n);let l=c;if(this._cumulativeMemoStorage.has(s,a)){let f=this._cumulativeMemoStorage.get(s,a);l=this._aggregator.diff(f,c)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(s=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(s,a))){let f=this._cumulativeMemoStorage.get(s,a);l=this._aggregator.diff(f,c)}if(this._activeCollectionStorage.has(s,a)){let f=this._activeCollectionStorage.get(s,a);l=this._aggregator.merge(f,l)}this._cumulativeMemoStorage.set(s,c,a),this._activeCollectionStorage.set(s,l,a)}}collect(){let t=this._activeCollectionStorage;return this._activeCollectionStorage=new d,t}}});function es(r){return Array.from(r.entries())}var et,yr=u(()=>{"use strict";qt();bt();et=class r{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(t,e){this._aggregator=t,e.forEach(i=>{this._unreportedAccumulations.set(i,[])})}buildMetrics(t,e,i,n){this._stashAccumulations(i);let o=this._getMergedUnreportedAccumulations(t),s=o,a;if(this._reportHistory.has(t)){let l=this._reportHistory.get(t),f=l.collectionTime;a=l.aggregationTemporality,a===P.CUMULATIVE?s=r.merge(l.accumulations,o,this._aggregator):s=r.calibrateStartTime(l.accumulations,o,f)}else a=t.selectAggregationTemporality(e.type);this._reportHistory.set(t,{accumulations:s,collectionTime:n,aggregationTemporality:a});let c=es(s);if(c.length!==0)return this._aggregator.toMetricData(e,a,c,n)}_stashAccumulations(t){let e=this._unreportedAccumulations.keys();for(let i of e){let n=this._unreportedAccumulations.get(i);n===void 0&&(n=[],this._unreportedAccumulations.set(i,n)),n.push(t)}}_getMergedUnreportedAccumulations(t){let e=new d,i=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),i===void 0)return e;for(let n of i)e=r.merge(e,n,this._aggregator);return e}static merge(t,e,i){let n=t,o=e.entries(),s=o.next();for(;s.done!==!0;){let[a,c,l]=s.value;if(t.has(a,l)){let f=t.get(a,l),T=i.merge(f,c);n.set(a,T,l)}else n.set(a,c,l);s=o.next()}return n}static calibrateStartTime(t,e,i){for(let[n,o]of t.keys())e.get(n,o)?.setStartTime(i);return e}}});var xe,Yn=u(()=>{"use strict";xr();wr();yr();bt();xe=class extends Q{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(t,e,i,n,o){super(t),this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new tt(e,this._aggregationCardinalityLimit),this._temporalMetricStorage=new et(e,n),this._attributesProcessor=i}record(t,e){if(this._attributesProcessor===void 0){this._deltaMetricStorage.batchCumulate(t,e);return}let i=new d;for(let[n,o]of t.entries())i.set(this._attributesProcessor.process(n),o);this._deltaMetricStorage.batchCumulate(i,e)}collect(t,e){let i=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,i,e)}}});function br(r,t){let e="";return r.unit!==t.unit&&(e+=` - Unit '${r.unit}' does not match '${t.unit}'
|
|
5
5
|
`),r.type!==t.type&&(e+=` - Type '${r.type}' does not match '${t.type}'
|
|
6
6
|
`),r.valueType!==t.valueType&&(e+=` - Value Type '${r.valueType}' does not match '${t.valueType}'
|
|
7
7
|
`),r.description!==t.description&&(e+=` - Description '${r.description}' does not match '${t.description}'
|