@yukino.js/yukino 0.0.13 → 0.0.15
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 +13 -11
- package/dist/a2a-ANR7PFD4.js +15 -0
- package/dist/acp-4E7R254I.js +14 -0
- package/dist/{anthropic-74ALYMH2.js → anthropic-ZO73YJFY.js} +1 -1
- package/dist/browser/dist/index.html +44 -0
- package/dist/browser/dist/static/index.css +2 -0
- package/dist/browser/dist/static/index.js +203 -0
- package/dist/bwrap-LVIPV72Q.js +0 -0
- package/dist/chunk-3KKA6537.js +0 -0
- package/dist/chunk-3RH3COZW.js +365 -0
- package/dist/chunk-4JHZPFU6.js +67 -0
- package/dist/chunk-7MKA3SHV.js +0 -0
- package/dist/{chunk-OREDGNI6.js → chunk-B2RNOTT5.js} +1 -1
- package/dist/{chunk-APJAUOF6.js → chunk-C56EKYBO.js} +1 -1
- package/dist/{chunk-WGFROGUC.js → chunk-CKOUBYG6.js} +0 -0
- package/dist/{chunk-6JUOKMSJ.js → chunk-CW6G3RYM.js} +1 -1
- package/dist/{chunk-556TRLPT.js → chunk-CWWRUTF2.js} +1 -1
- package/dist/chunk-DVB57IVG.js +18 -0
- package/dist/chunk-ETZPOVUC.js +4 -0
- package/dist/chunk-F3JTT3TI.js +110 -0
- package/dist/chunk-FC2LG24U.js +4 -0
- package/dist/chunk-FNQMXCCE.js +4 -0
- package/dist/chunk-HWCLMDQF.js +0 -0
- package/dist/chunk-I74AL3PF.js +0 -0
- package/dist/chunk-IOMQY54U.js +967 -0
- package/dist/chunk-IQT2IFSO.js +4 -0
- package/dist/chunk-K45OXLJJ.js +16 -0
- package/dist/chunk-KJJYW5IY.js +0 -0
- package/dist/chunk-LCWNSYZU.js +0 -0
- package/dist/chunk-LR4ZNAAM.js +4 -0
- package/dist/chunk-LTMY67B2.js +5 -0
- package/dist/chunk-MDPSQ6L7.js +0 -0
- package/dist/chunk-MQAQBW7F.js +0 -0
- package/dist/{chunk-NEU4ER5V.js → chunk-NSNTZXFL.js} +1 -1
- package/dist/chunk-P6DHMU7R.js +0 -0
- package/dist/chunk-VCIRD267.js +0 -0
- package/dist/chunk-VM4YKTHC.js +0 -0
- package/dist/chunk-VU3JWAJR.js +0 -0
- package/dist/chunk-W4GMCNWF.js +0 -0
- package/dist/chunk-XY7ZFVZL.js +4 -0
- package/dist/devtools-UVGRIXO2.js +0 -0
- package/dist/{esm-HW2JMFYC.js → esm-2JJG3HR7.js} +1 -1
- package/dist/esm-7DWXO52B.js +4 -0
- package/dist/{esm-6L5BJ5GT.js → esm-EOOB75BT.js} +1 -1
- package/dist/{esm-DIYJ5HX6.js → esm-H73EL6IR.js} +1 -1
- package/dist/{esm-YKAO4ES6.js → esm-IBZKE3IU.js} +1 -1
- package/dist/esm-W4NAAZTQ.js +225 -0
- package/dist/{esm-RPR2GBJ2.js → esm-Y237QNPJ.js} +1 -1
- package/dist/getMachineId-bsd-A3UCSHLE.js +4 -0
- package/dist/getMachineId-bsd-E27XJQLX.js +0 -0
- package/dist/getMachineId-darwin-35UPAIXP.js +0 -0
- package/dist/getMachineId-darwin-MWJEU7OI.js +5 -0
- package/dist/getMachineId-linux-FNSLKUDN.js +4 -0
- package/dist/getMachineId-linux-MKXIYT6A.js +0 -0
- package/dist/getMachineId-unsupported-PKQWB2OJ.js +4 -0
- package/dist/getMachineId-unsupported-ZXVGGFX2.js +0 -0
- package/dist/getMachineId-win-3A667JT3.js +4 -0
- package/dist/getMachineId-win-RNVIYJG5.js +0 -0
- package/dist/lib/{anthropic-EQRUGP2C.js → anthropic-SQBOFRPQ.js} +4 -4
- package/dist/lib/{chunk-EGT7BJRD.js → chunk-AW2577J5.js} +2 -2
- package/dist/lib/{chunk-JYCSWXCR.js → chunk-GPJL4PLE.js} +2 -2
- package/dist/lib/{chunk-UBVKYJFI.js → chunk-IHVYAEY2.js} +1058 -522
- package/dist/lib/{chunk-CDMR25FD.js → chunk-U3OT4POQ.js} +3 -3
- package/dist/lib/{chunk-HUTUNNDX.js → chunk-WNGF7243.js} +0 -1
- package/dist/lib/{chunk-FUJDUZTH.js → chunk-WXR5HNB4.js} +1 -1
- package/dist/lib/{chunk-WWCSFKMR.js → chunk-XS3GONYN.js} +2 -11
- package/dist/lib/index.d.ts +98 -282
- package/dist/lib/index.js +1092 -2409
- package/dist/lib/{openai-B3I5WBFT.js → openai-UV4KFNQV.js} +3 -3
- package/dist/lib/{providers-EJ4VBHNP.js → providers-77VBEX3K.js} +2 -2
- package/dist/lib/{tool-filter-TURPCYFR.js → tool-filter-MLYQGWM5.js} +3 -3
- package/dist/{main-JEEKFCGX.js → main-653YZQHY.js} +228 -232
- package/dist/main.js +2 -2
- package/dist/node-634LOHDX.js +0 -0
- package/dist/{openai-7C6BVQ7M.js → openai-FKLMHNNC.js} +1 -1
- package/dist/providers-4IU7SUEQ.js +4 -0
- package/dist/seatbelt-UO7HGD4Z.js +0 -0
- package/dist/server-4NHV4RJL.js +4 -0
- package/dist/slim-Q56GHZZP.js +0 -0
- package/dist/{src-JBRNH4FA.js → src-DEVJGNXS.js} +1 -1
- package/dist/{src-X6JWWHHT.js → src-EMFESWQS.js} +1 -1
- package/dist/{src-R4BSSIJJ.js → src-GG4YROJH.js} +1 -1
- package/dist/{src-43CPCEK2.js → src-JFAO2DGP.js} +1 -1
- package/dist/tool-filter-LJTLMGFP.js +4 -0
- package/dist/turndown.es-NQ3KDXM7.js +0 -0
- package/package.json +22 -21
- package/dist/a2a-DKWMWGID.js +0 -14
- package/dist/acp-RL6DKS3R.js +0 -14
- package/dist/chunk-2LHY3FND.js +0 -67
- package/dist/chunk-3QL446GD.js +0 -4
- package/dist/chunk-6FSIG63T.js +0 -364
- package/dist/chunk-A5G5NTDB.js +0 -1015
- package/dist/chunk-A7CJPQC5.js +0 -5
- package/dist/chunk-AGSYLE4E.js +0 -16
- package/dist/chunk-CJSMVCUF.js +0 -6
- package/dist/chunk-CU3IISCC.js +0 -4
- package/dist/chunk-HMZQYFYG.js +0 -4
- package/dist/chunk-JFKC4VCA.js +0 -4
- package/dist/chunk-KCMBAHWU.js +0 -4
- package/dist/chunk-SCR7NDDL.js +0 -63
- package/dist/esm-57CJEGGK.js +0 -4
- package/dist/esm-YOQPBF42.js +0 -225
- package/dist/fe/dist/index.html +0 -21
- package/dist/fe/dist/static/index.css +0 -2
- package/dist/fe/dist/static/index.js +0 -203
- package/dist/providers-U23PWAHG.js +0 -4
- package/dist/server-EOSEQPNY.js +0 -4
- package/dist/tool-filter-UDSHRE5F.js +0 -4
package/dist/chunk-3QL446GD.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{a as M,c as L,i as oe}from"./chunk-AGSYLE4E.js";import{E as y,M as G,c as V,h as Qt,i as A,u as St,w as Zt,x as te,z as ee}from"./chunk-CU3IISCC.js";import{e as Kt,f as B,p,u as h}from"./chunk-VCIRD267.js";import{b as a,d as _t}from"./chunk-7MKA3SHV.js";var v,ne=a(()=>{"use strict";(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(v||(v={}))});function Xo(){return bt}var $,bt,Z=a(()=>{"use strict";$=class{emit(e){}enabled(){return!1}},bt=new $});function se(t,e,o){return n=>n===t?e:o}var q,F,Lt,re=a(()=>{"use strict";q=Symbol.for("io.opentelemetry.js.api.logs"),F=globalThis;Lt=1});var At,tt,Rt=a(()=>{"use strict";Z();At=class{getLogger(e,o,n){return new $}},tt=new At});var et,ie=a(()=>{"use strict";Z();et=class{constructor(e,o,n,s){this._provider=e,this.name=o,this.version=n,this.options=s}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):bt}}});var W,ae=a(()=>{"use strict";Rt();ie();W=class{getLogger(e,o,n){var s;return(s=this._getDelegateLogger(e,o,n))!==null&&s!==void 0?s:new et(this,e,o,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:tt}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,o,n){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,o,n)}}});var ot,ce=a(()=>{"use strict";re();Rt();ae();ot=class t{constructor(){this._proxyLoggerProvider=new W}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return F[q]?this.getLoggerProvider():(F[q]=se(Lt,e,tt),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,o;return(o=(e=F[q])===null||e===void 0?void 0:e.call(F,Lt))!==null&&o!==void 0?o:this._proxyLoggerProvider}getLogger(e,o,n){return this.getLoggerProvider().getLogger(e,o,n)}disable(){delete F[q],this._proxyLoggerProvider=new W}}});var Fs,ue=a(()=>{"use strict";ne();Z();ce();Fs=ot.getInstance()});var nt,pe=a(()=>{"use strict";nt=class{_delegate;constructor(e){this._delegate=e}export(e,o){this._delegate.export(e,o)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}setMetrics(e){this._delegate.setMetrics(e)}}});var S,X=a(()=>{"use strict";S=class extends Error{code;name="OTLPExporterError";data;constructor(e,o,n){super(e),this.data=n,this.code=o}}});function Jo(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function st(t){if(t!=null)return async()=>t}function rt(t,e,o){return{timeoutMillis:Jo(t.timeoutMillis??e.timeoutMillis??o.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??o.concurrencyLimit,compression:t.compression??e.compression??o.compression}}function it(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var J=a(()=>{"use strict"});var at,fe=a(()=>{"use strict";(function(t){t.NONE="none",t.GZIP="gzip"})(at||(at={}))});function ct(t){return new Ot(t.concurrencyLimit)}var Ot,yt=a(()=>{"use strict";Ot=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);let o=()=>{let n=this._sendingPromises.indexOf(e);this._sendingPromises.splice(n,1)};e.then(o,o)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}});function jo(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function le(){return{handleResponse(t){t==null||!jo(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||p.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}var de=a(()=>{"use strict";h()});function ut(t,e){return new Pt(t.transport,t.serializer,le(),t.promiseHandler,t.metrics,e.timeout)}var Pt,It=a(()=>{"use strict";G();X();de();h();Pt=class{_metrics;_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,o,n,s,r,i){this._transport=e,this._serializer=o,this._responseHandler=n,this._promiseQueue=s,this._timeout=i,this._diagLogger=p.createComponentLogger({namespace:"OTLPExportDelegate"}),this._metrics=r}export(e,o){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){o({code:y.FAILED,error:new Error("Concurrent export limit reached")});return}let n=this._serializer.serializeRequest(e);if(n==null){o({code:y.FAILED,error:new Error("Nothing to send")});return}let s=this._metrics.startExport(e);this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(r=>{if(r.status==="success"){if(s(void 0),r.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(r.data))}catch(i){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,r.data)}o({code:y.SUCCESS});return}else if(r.status==="failure"&&r.error){s(r.error),o({code:y.FAILED,error:r.error});return}else r.status==="retryable"?(s("export_max_retries"),o({code:y.FAILED,error:r.error??new S("Export failed with retryable status")})):(s("export_failed"),o({code:y.FAILED,error:new S("Export failed with unknown error")}))},r=>{s(r),o({code:y.FAILED,error:r})}))}forceFlush(){return this._promiseQueue.awaitAll()}setMetrics(e){this._metrics=e}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}});function me(t,e,o,n){return ut({transport:n,serializer:e,promiseHandler:ct(t),metrics:o},{timeout:t.timeoutMillis})}var he=a(()=>{"use strict";yt();It()});var Ct,ge,Te,xe,Ee,_e,Dt=a(()=>{"use strict";Ct="http.response.status_code",ge="otel.component.name",Te="otel.component.type",xe="server.address",Ee="server.port",_e="error.type"});var pt,Mt=a(()=>{"use strict";pt="0.222.0"});var Se,N,Ft=a(()=>{"use strict";h();G();Dt();Mt();Se=new Map,N=class{inflight;exported;duration;standardAttrs;responseAttributesFromError;helper;constructor(e){let{componentType:o,metricsHelper:n,meterProvider:s,url:r,responseAttributesFromError:i}=e;this.responseAttributesFromError=i;let u=s?s.getMeter("@opentelemetry/otlp-exporter",pt):Kt(),c=Se.get(o)??0;if(Se.set(o,c+1),this.standardAttrs={[Te]:o,[ge]:`${o}/${c}`},r){let d=r;r.includes("://")||(d=`http://${r}`);try{let m=new URL(d);this.standardAttrs[xe]=m.hostname;let l;m.port?l=Number(m.port):m.protocol==="http:"?l=80:m.protocol==="https:"&&(l=443),typeof l=="number"&&(this.standardAttrs[Ee]=l)}catch{}}this.helper=n,this.inflight=u.createUpDownCounter(`otel.sdk.exporter.${this.helper.name}.inflight`,{unit:`{${this.helper.name}}`,description:`The number of ${this.helper.name}s which were passed to the exporter, but that have not been exported yet (neither successful, nor failed).`}),this.exported=u.createCounter(`otel.sdk.exporter.${this.helper.name}.exported`,{unit:`{${this.helper.name}}`,description:`The number of ${this.helper.name}s for which the export has finished, either successful or failed.`}),this.duration=u.createHistogram("otel.sdk.exporter.operation.duration",{unit:"s",description:"The duration of exporting a batch of telemetry records.",advice:{explicitBucketBoundaries:[]}})}startExport(e){let o=this.helper.countItems(e),n=St();return this.inflight.add(o,this.standardAttrs),s=>{let r=St();this.inflight.add(-o,this.standardAttrs);let i=s?{...this.standardAttrs,[_e]:s instanceof Error?s.name:"export_failed"}:this.standardAttrs;this.exported.add(o,i);let u={...i,...this.responseAttributesFromError(s)},c=ee(Zt(n,r))/1e3;this.duration.record(c,u)}}}});var Yo={};_t(Yo,{CompressionAlgorithm:()=>at,ExporterMetrics:()=>N,OTLPExporterBase:()=>nt,OTLPExporterError:()=>S,createOtlpNetworkExportDelegate:()=>me,getSharedConfigurationDefaults:()=>it,mergeOtlpSharedConfigurationWithDefaults:()=>rt});var Ko=a(()=>{"use strict";pe();X();J();fe();he();Ft()});var be,Le=a(()=>{"use strict";be={name:"metric_data_point",countItems:t=>{let e=0;for(let o of t.scopeMetrics)for(let n of o.metrics)e+=n.dataPoints.length;return e}}});var Ae,Re=a(()=>{"use strict";Ae={name:"span",countItems:t=>t.length}});var Oe,ye=a(()=>{"use strict";Oe={name:"log",countItems:t=>t.length}});function R(t){return t<0?10:t<128?1:t<16384?2:t<2097152?3:t<268435456?4:t<34359738368?5:t<4398046511104?6:t<562949953421312?7:t<72057594037927940?8:9}var Nt=a(()=>{"use strict"});var Qo,j,P,ft=a(()=>{"use strict";h();Nt();Qo="ProtobufWriter: estimated size was too small, growing buffer.",j=1,P=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(e){let o=this.pos+e;if(o<=this._buffer.length)return;p.debug(Qo);let n=this._buffer.length*2;for(;n<o;)n*=2;let s=new Uint8Array(n);s.set(this._buffer),this._buffer=s,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(j),this.pos+=j,e}finishLengthDelimited(e,o){let n=o>>>0,s=R(n);if(s>j){let i=s-j;this._ensureCapacity(i),this._buffer.copyWithin(e+s,e+j,this.pos),this.pos+=i}let r=e;n<128?this._buffer[r]=n:n<16384?(this._buffer[r++]=n&127|128,this._buffer[r]=n>>>7):n<2097152?(this._buffer[r++]=n&127|128,this._buffer[r++]=n>>>7&127|128,this._buffer[r]=n>>>14):n<268435456?(this._buffer[r++]=n&127|128,this._buffer[r++]=n>>>7&127|128,this._buffer[r++]=n>>>14&127|128,this._buffer[r]=n>>>21):(this._buffer[r++]=n&127|128,this._buffer[r++]=n>>>7&127|128,this._buffer[r++]=n>>>14&127|128,this._buffer[r++]=n>>>21&127|128,this._buffer[r]=n>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let o,n;if(e>=0)o=e>>>0,n=e/4294967296>>>0;else{let s=Math.abs(e);o=s>>>0,n=s/4294967296>>>0,o=~o>>>0,n=~n>>>0,o=o+1>>>0,o===0&&(n=n+1>>>0)}this.writeFixed64(o,n)}writeVarint(e){if(this._ensureCapacity(R(e)),e>=0&&e<=4294967295){let o=e>>>0;for(;o>127;)this._buffer[this.pos++]=o&127|128,o>>>=7;this._buffer[this.pos++]=o}else{let o,n;if(e>=0)o=e>>>0,n=e/4294967296>>>0;else{let s=Math.abs(e);o=s>>>0,n=s/4294967296>>>0,o=~o>>>0,n=~n>>>0,o=o+1>>>0,o===0&&(n=n+1>>>0)}for(;n>0||o>127;)this._buffer[this.pos++]=o&127|128,o=(o>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=o&127}}writeFixed32(e){this._ensureCapacity(4);let o=e>>>0;this._buffer[this.pos++]=o&255,this._buffer[this.pos++]=o>>>8&255,this._buffer[this.pos++]=o>>>16&255,this._buffer[this.pos++]=o>>>24&255}writeFixed64(e,o){this._ensureCapacity(8);let n=e>>>0,s=o>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=s&255,this._buffer[this.pos++]=s>>>8&255,this._buffer[this.pos++]=s>>>16&255,this._buffer[this.pos++]=s>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,o){this.writeVarint(e<<3|o)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let o=!0,n=e.length;for(let s=0;s<n;s++)if(e.charCodeAt(s)>127){o=!1;break}if(o){this.writeVarint(n),this._ensureCapacity(n);for(let s=0;s<n;s++)this._buffer[this.pos++]=e.charCodeAt(s)}else{let s=this._textEncoder.encode(e);this.writeBytes(s)}}}});function Pe(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function O(t){let e=new Uint8Array(t.length/2),o=0;for(let n=0;n<t.length;n+=2){let s=Pe(t.charCodeAt(n)),r=Pe(t.charCodeAt(n+1));e[o++]=s<<4|r}return e}var Ut=a(()=>{"use strict"});function g(t,e){let o=e[0],n=e[1],s=1e9,r=o&65535,i=o/65536>>>0,u=r*s,c=i*s,d=u>>>0,m=Math.floor(u/4294967296),l=(c&65535)*65536>>>0,f=c/65536>>>0,E=d+l+n,D=E>>>0,_=Math.floor(E/4294967296),Et=m+f+_>>>0;t.writeFixed64(D,Et)}function T(t,e,o){for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=e[n];t.writeTag(o,2);let r=t.startLengthDelimited(),i=t.pos;Zo(t,n,s),t.finishLengthDelimited(r,t.pos-i)}}function Zo(t,e,o){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),s=t.pos;Y(t,o),t.finishLengthDelimited(n,t.pos-s)}function Y(t,e){let o=typeof e;if(o==="string")t.writeTag(1,2),t.writeString(e);else if(o==="boolean")t.writeTag(2,0),t.writeVarint(e?1:0);else if(o==="number"){let n=e;Number.isInteger(n)&&n>=tn&&n<en?(t.writeTag(3,0),t.writeVarint(n)):(t.writeTag(4,1),t.writeDouble(n))}else if(e instanceof Uint8Array)t.writeTag(7,2),t.writeBytes(e);else if(Array.isArray(e)){t.writeTag(5,2);let n=t.startLengthDelimited(),s=t.pos;for(let r of e){t.writeTag(1,2);let i=t.startLengthDelimited(),u=t.pos;Y(t,r),t.finishLengthDelimited(i,t.pos-u)}t.finishLengthDelimited(n,t.pos-s)}else if(o==="object"&&e!=null){t.writeTag(6,2);let n=t.startLengthDelimited(),s=t.pos,r=e;for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let u=r[i];t.writeTag(1,2);let c=t.startLengthDelimited(),d=t.pos;t.writeTag(1,2),t.writeString(i),t.writeTag(2,2);let m=t.startLengthDelimited(),l=t.pos;Y(t,u),t.finishLengthDelimited(m,t.pos-l),t.finishLengthDelimited(c,t.pos-d)}t.finishLengthDelimited(n,t.pos-s)}}function U(t,e,o){t.writeTag(o,2);let n=t.startLengthDelimited(),s=t.pos;t.writeTag(1,2),t.writeString(e.name),e.version&&(t.writeTag(2,2),t.writeString(e.version)),e.attributes&&T(t,e.attributes,3),e.droppedAttributesCount&&(t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount)),t.finishLengthDelimited(n,t.pos-s)}function z(t,e,o){t.writeTag(o,2);let n=t.startLengthDelimited(),s=t.pos;e.attributes&&T(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-s)}var tn,en,lt=a(()=>{"use strict";tn=-(2**63),en=2**63});function on(t){let e=t.length,o=0;for(let n=0;n<e;n++){let s=t.charCodeAt(n);s<128?o+=1:s<2048?o+=2:s<55296||s>=57344?o+=3:(n++,o+=4)}return o}var I,dt=a(()=>{"use strict";Nt();I=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,o){this.pos+=R(o)}writeVarint(e){this.pos+=R(e)}writeSint32(e){this.pos+=R((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,o){this.pos+=8}writeBytes(e){this.pos+=R(e.length),this.pos+=e.length}writeTag(e,o){this.writeVarint(e<<3|o)}writeDouble(e){this.pos+=8}writeString(e){let o=on(e);this.pos+=R(o),this.pos+=o}}});function nn(t,e){let o=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),g(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==v.UNSPECIFIED&&(t.writeTag(2,0),t.writeVarint(e.severityNumber)),e.severityText&&(t.writeTag(3,2),t.writeString(e.severityText)),e.body!==void 0){t.writeTag(5,2);let s=t.startLengthDelimited(),r=t.pos;Y(t,e.body),t.finishLengthDelimited(s,t.pos-r)}e.attributes&&T(t,e.attributes,6),t.writeTag(7,0),t.writeVarint(e.droppedAttributesCount),e.spanContext?.traceFlags&&(t.writeTag(8,5),t.writeFixed32(e.spanContext.traceFlags)),e.spanContext?.traceId&&(t.writeTag(9,2),t.writeBytes(O(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(O(e.spanContext.spanId))),t.writeTag(11,1),g(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(o,t.pos-n)}function sn(t,e,o){let n=t.startLengthDelimited(),s=t.pos;U(t,e,1);for(let r of o)t.writeTag(2,2),nn(t,r);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-s)}function Ie(t,e,o){let n=t.startLengthDelimited(),s=t.pos;z(t,e,1);for(let r of o.values()){t.writeTag(2,2);let i=r[0].instrumentationScope;sn(t,i,r)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-s)}function rn(t){let e=new Map;for(let o of t){let n=o.resource,s=o.instrumentationScope,r=e.get(n);r||(r=new Map,e.set(n,r));let i=r.get(s);i||(i=[],r.set(s,i)),i.push(o)}return e}function Ce(t){let e=rn(t),o=new I;for(let[s,r]of e)o.writeTag(1,2),Ie(o,s,r);let n=new P(o.pos);for(let[s,r]of e)n.writeTag(1,2),Ie(n,s,r);return n.finish()}var De=a(()=>{"use strict";ft();Ut();ue();lt();dt()});var b,mt=a(()=>{"use strict";b=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,o=0,n=!1;for(;this.pos<this._buf.length;){let s=this._buf[this.pos++];if(e+=(s&127)*Math.pow(2,o),o+=7,(s&128)===0){n=!0;break}}if(!n)throw new Error("Truncated buffer: unexpected end of data while reading varint");return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw new Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let o=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,o}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${e}, cannot safely skip`)}}}});function an(t){let e=new b(t),o={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:s}=e.readTag();switch(n){case 1:s===0?o.rejectedLogRecords=e.readVarint():e.skip(s);break;case 2:s===2?o.errorMessage=e.readString():e.skip(s);break;default:e.skip(s);break}}return o}function Me(t){let e=new b(t),o={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:s}=e.readTag();n===1&&s===2?o.partialSuccess=an(e.readBytes()):e.skip(s)}return o}var Fe=a(()=>{"use strict";mt()});var zt,Ne=a(()=>{"use strict";De();Fe();zt={serializeRequest:t=>Ce(t),deserializeResponse:t=>Me(t)}});var Ue=a(()=>{"use strict";Ne()});function He(t,e,o){let n=t.startLengthDelimited(),s=t.pos;t.writeTag(2,1),g(t,e.startTime),t.writeTag(3,1),g(t,e.endTime),o===B.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&T(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-s)}function cn(t,e){let o=t.startLengthDelimited(),n=t.pos,s=e.value;if(t.writeTag(2,1),g(t,e.startTime),t.writeTag(3,1),g(t,e.endTime),t.writeTag(4,1),t.writeFixed64(s.count>>>0,s.count/4294967296>>>0),s.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(s.sum)),s.buckets.counts.length>0){t.writeTag(6,2);let r=t.startLengthDelimited(),i=t.pos;for(let u of s.buckets.counts)t.writeFixed64(u>>>0,u/4294967296>>>0);t.finishLengthDelimited(r,t.pos-i)}if(s.buckets.boundaries.length>0){t.writeTag(7,2);let r=t.startLengthDelimited(),i=t.pos;for(let u of s.buckets.boundaries)t.writeDouble(u);t.finishLengthDelimited(r,t.pos-i)}e.attributes&&T(t,e.attributes,9),s.min!==void 0&&(t.writeTag(11,1),t.writeDouble(s.min)),s.max!==void 0&&(t.writeTag(12,1),t.writeDouble(s.max)),t.finishLengthDelimited(o,t.pos-n)}function ze(t,e,o){let n=t.startLengthDelimited(),s=t.pos;if(e!==0&&(t.writeTag(1,0),t.writeSint32(e)),o.length>0){t.writeTag(2,2);let r=t.startLengthDelimited(),i=t.pos;for(let u of o)t.writeVarint(u);t.finishLengthDelimited(r,t.pos-i)}t.finishLengthDelimited(n,t.pos-s)}function un(t,e){let o=t.startLengthDelimited(),n=t.pos,s=e.value;e.attributes&&T(t,e.attributes,1),t.writeTag(2,1),g(t,e.startTime),t.writeTag(3,1),g(t,e.endTime),t.writeTag(4,1),t.writeFixed64(s.count>>>0,s.count/4294967296>>>0),s.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(s.sum)),s.scale!==0&&(t.writeTag(6,0),t.writeSint32(s.scale)),t.writeTag(7,1),t.writeFixed64(s.zeroCount>>>0,s.zeroCount/4294967296>>>0),t.writeTag(8,2),ze(t,s.positive.offset,s.positive.bucketCounts),t.writeTag(9,2),ze(t,s.negative.offset,s.negative.bucketCounts),s.min!==void 0&&(t.writeTag(12,1),t.writeDouble(s.min)),s.max!==void 0&&(t.writeTag(13,1),t.writeDouble(s.max)),t.finishLengthDelimited(o,t.pos-n)}function pn(t,e){let o=t.startLengthDelimited(),n=t.pos;switch(t.writeTag(1,2),t.writeString(e.descriptor.name),e.descriptor.description&&(t.writeTag(2,2),t.writeString(e.descriptor.description)),e.descriptor.unit&&(t.writeTag(3,2),t.writeString(e.descriptor.unit)),e.dataPointType){case L.GAUGE:t.writeTag(5,2),fn(t,e);break;case L.SUM:t.writeTag(7,2),ln(t,e);break;case L.HISTOGRAM:t.writeTag(9,2),dn(t,e);break;case L.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),mn(t,e);break;default:{let s=e}}t.finishLengthDelimited(o,t.pos-n)}function fn(t,e){let o=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),He(t,s,e.descriptor.valueType);t.finishLengthDelimited(o,t.pos-n)}function ln(t,e){let o=t.startLengthDelimited(),n=t.pos;for(let r of e.dataPoints)t.writeTag(1,2),He(t,r,e.descriptor.valueType);let s=wt(e.aggregationTemporality);s!==0&&(t.writeTag(2,0),t.writeVarint(s)),e.isMonotonic&&(t.writeTag(3,0),t.writeVarint(1)),t.finishLengthDelimited(o,t.pos-n)}function dn(t,e){let o=t.startLengthDelimited(),n=t.pos;for(let r of e.dataPoints)t.writeTag(1,2),cn(t,r);let s=wt(e.aggregationTemporality);s!==0&&(t.writeTag(2,0),t.writeVarint(s)),t.finishLengthDelimited(o,t.pos-n)}function mn(t,e){let o=t.startLengthDelimited(),n=t.pos;for(let r of e.dataPoints)t.writeTag(1,2),un(t,r);let s=wt(e.aggregationTemporality);s!==0&&(t.writeTag(2,0),t.writeVarint(s)),t.finishLengthDelimited(o,t.pos-n)}function hn(t,e){let o=t.startLengthDelimited(),n=t.pos;U(t,e.scope,1);for(let s of e.metrics)t.writeTag(2,2),pn(t,s);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(o,t.pos-n)}function we(t,e){let o=t.startLengthDelimited(),n=t.pos;z(t,e.resource,1);for(let s of e.scopeMetrics)t.writeTag(2,2),hn(t,s);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(o,t.pos-n)}function wt(t){switch(t){case M.DELTA:return 1;case M.CUMULATIVE:return 2;default:return 0}}function ke(t){let e=new I;e.writeTag(1,2),we(e,t);let o=new P(e.pos);return o.writeTag(1,2),we(o,t),o.finish()}var Be=a(()=>{"use strict";h();oe();lt();dt();ft()});function gn(t){let e=new b(t),o={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:s}=e.readTag();switch(n){case 1:s===0?o.rejectedDataPoints=e.readVarint():e.skip(s);break;case 2:s===2?o.errorMessage=e.readString():e.skip(s);break;default:e.skip(s);break}}return o}function Ve(t){let e=new b(t),o={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:s}=e.readTag();n===1&&s===2?o.partialSuccess=gn(e.readBytes()):e.skip(s)}return o}var Ge=a(()=>{"use strict";mt()});var Ht,ve=a(()=>{"use strict";Be();Ge();Ht={serializeRequest:t=>ke(t),deserializeResponse:t=>Ve(t)}});var $e=a(()=>{"use strict";ve()});function We(t,e){let o=t&255|Tn;return e&&(o|=xn),o}function En(t,e){let o=t.startLengthDelimited(),n=t.pos;e.message&&(t.writeTag(2,2),t.writeString(e.message)),t.writeTag(3,0),t.writeVarint(e.code),t.finishLengthDelimited(o,t.pos-n)}function _n(t,e){let o=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),g(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&T(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(o,t.pos-n)}function Sn(t,e){let o=t.startLengthDelimited(),n=t.pos,s=e.context;t.writeTag(1,2),t.writeBytes(O(s.traceId)),t.writeTag(2,2),t.writeBytes(O(s.spanId));let r=s.traceState?.serialize();r&&(t.writeTag(3,2),t.writeString(r)),e.attributes&&T(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let i=We(s.traceFlags,s.isRemote);i&&(t.writeTag(6,5),t.writeFixed32(i)),t.finishLengthDelimited(o,t.pos-n)}function bn(t,e){let o=t.startLengthDelimited(),n=t.pos,s=e.spanContext();t.writeTag(1,2),t.writeBytes(O(s.traceId)),t.writeTag(2,2),t.writeBytes(O(s.spanId));let r=s.traceState?.serialize();r&&(t.writeTag(3,2),t.writeString(r)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(O(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let i=e.kind==null?0:e.kind+1;i!==0&&(t.writeTag(6,0),t.writeVarint(i)),t.writeTag(7,1),g(t,e.startTime),t.writeTag(8,1),g(t,e.endTime),e.attributes&&T(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),_n(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),Sn(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),En(t,e.status);let u=We(s.traceFlags,e.parentSpanContext?.isRemote);u&&(t.writeTag(16,5),t.writeFixed32(u)),t.finishLengthDelimited(o,t.pos-n)}function Ln(t,e,o){let n=t.startLengthDelimited(),s=t.pos;U(t,e,1);for(let r of o)t.writeTag(2,2),bn(t,r);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-s)}function qe(t,e,o){let n=t.startLengthDelimited(),s=t.pos;z(t,e,1);for(let r of o.values()){t.writeTag(2,2);let i=r[0].instrumentationScope;Ln(t,i,r)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-s)}function An(t){let e=new Map;for(let o of t){let n=o.resource,s=o.instrumentationScope,r=e.get(n);r||(r=new Map,e.set(n,r));let i=r.get(s);i||(i=[],r.set(s,i)),i.push(o)}return e}function Xe(t){let e=An(t),o=new I;for(let[s,r]of e)o.writeTag(1,2),qe(o,s,r);let n=new P(o.pos);for(let[s,r]of e)n.writeTag(1,2),qe(n,s,r);return n.finish()}var Tn,xn,Je=a(()=>{"use strict";ft();Ut();lt();dt();Tn=256,xn=512});function Rn(t){let e=new b(t),o={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:s}=e.readTag();switch(n){case 1:s===0?o.rejectedSpans=e.readVarint():e.skip(s);break;case 2:s===2?o.errorMessage=e.readString():e.skip(s);break;default:e.skip(s);break}}return o}function je(t){let e=new b(t),o={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:s}=e.readTag();n===1&&s===2?o.partialSuccess=Rn(e.readBytes()):e.skip(s)}return o}var Ye=a(()=>{"use strict";mt()});var kt,Ke=a(()=>{"use strict";Je();Ye();kt={serializeRequest:t=>Xe(t),deserializeResponse:t=>je(t)}});var Qe=a(()=>{"use strict";Ke()});function w(t,e){let o={attributes:x(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(o.schemaUrl=n),o}function H(t,e){let o={name:t.name,version:t.version};return t.attributes&&Object.keys(t.attributes).length>0&&(o.attributes=x(t.attributes,e),o.droppedAttributesCount=t.droppedAttributesCount??0),o}function x(t,e){return Object.keys(t).map(o=>On(o,t[o],e))}function On(t,e,o){return{key:t,value:K(e,o)}}function K(t,e){let o=typeof t;if(o==="string")return{stringValue:t};if(o==="number")return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if(o==="boolean")return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:e.encodeUint8Array(t)};if(Array.isArray(t)){let n=new Array(t.length);for(let s=0;s<t.length;s++)n[s]=K(t[s],e);return{arrayValue:{values:n}}}if(o==="object"&&t!=null){let n=Object.keys(t),s=new Array(n.length);for(let r=0;r<n.length;r++)s[r]={key:n[r],value:K(t[n[r]],e)};return{kvlistValue:{values:s}}}return{}}var ht=a(()=>{"use strict"});function Ze(t,e){return{resourceLogs:Pn(t,e)}}function yn(t){let e=new Map;for(let o of t){let{resource:n,instrumentationScope:s}=o,r=e.get(n);r||(r=new Map,e.set(n,r));let i=r.get(s);i||(i=[],r.set(s,i)),i.push(o)}return e}function Pn(t,e){let o=yn(t);return Array.from(o,([n,s])=>{let r=w(n,e);return{resource:r,scopeLogs:Array.from(s,([,i])=>({scope:H(i[0].instrumentationScope,e),logRecords:i.map(u=>In(u,e)),schemaUrl:i[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function In(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:K(t.body,e),eventName:t.eventName,attributes:x(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}var to=a(()=>{"use strict";ht()});function Cn(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Dn(t){return Cn(t).toString()}function eo(t){return t}var Mn,k,gt=a(()=>{"use strict";G();Mn=typeof BigInt<"u"?Dn:te;k={encodeHrTime:Mn,encodeSpanContext:eo,encodeOptionalSpanContext:eo,encodeUint8Array:t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64");let e=new Array(t.length);for(let o=0;o<t.length;o++)e[o]=String.fromCharCode(t[o]);return btoa(e.join(""))}}});var Bt,oo=a(()=>{"use strict";to();gt();h();Bt={serializeRequest:t=>{let e=Ze(t,k);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(o){return p.warn(`Failed to parse logs export response: ${o.message}. Returning empty response`),{}}}}});var no=a(()=>{"use strict";oo()});var Q,so=a(()=>{"use strict";(function(t){t[t.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",t[t.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",t[t.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(Q||(Q={}))});function Fn(t,e){let o=w(t.resource,e);return{resource:o,schemaUrl:o.schemaUrl,scopeMetrics:Nn(t.scopeMetrics,e)}}function Nn(t,e){return Array.from(t.map(o=>({scope:H(o.scope,e),metrics:o.metrics.map(n=>Un(n,e)),schemaUrl:o.scope.schemaUrl})))}function Un(t,e){let o={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=kn(t.aggregationTemporality);switch(t.dataPointType){case L.SUM:o.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:ro(t,e)};break;case L.GAUGE:o.gauge={dataPoints:ro(t,e)};break;case L.HISTOGRAM:o.histogram={aggregationTemporality:n,dataPoints:wn(t,e)};break;case L.EXPONENTIAL_HISTOGRAM:o.exponentialHistogram={aggregationTemporality:n,dataPoints:Hn(t,e)};break}return o}function zn(t,e,o){let n={attributes:x(t.attributes,o),startTimeUnixNano:o.encodeHrTime(t.startTime),timeUnixNano:o.encodeHrTime(t.endTime)};switch(e){case B.INT:n.asInt=t.value;break;case B.DOUBLE:n.asDouble=t.value;break}return n}function ro(t,e){return t.dataPoints.map(o=>zn(o,t.descriptor.valueType,e))}function wn(t,e){return t.dataPoints.map(o=>{let n=o.value;return{attributes:x(o.attributes,e),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(o.startTime),timeUnixNano:e.encodeHrTime(o.endTime)}})}function Hn(t,e){return t.dataPoints.map(o=>{let n=o.value;return{attributes:x(o.attributes,e),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(o.startTime),timeUnixNano:e.encodeHrTime(o.endTime)}})}function kn(t){switch(t){case M.DELTA:return Q.AGGREGATION_TEMPORALITY_DELTA;case M.CUMULATIVE:return Q.AGGREGATION_TEMPORALITY_CUMULATIVE}}function io(t,e){return{resourceMetrics:t.map(o=>Fn(o,e))}}var ao=a(()=>{"use strict";h();oe();so();ht()});var Vt,co=a(()=>{"use strict";ao();gt();h();Vt={serializeRequest:t=>{let e=io([t],k);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(o){return p.warn(`Failed to parse metrics export response: ${o.message}. Returning empty response`),{}}}}});var uo=a(()=>{"use strict";co()});function po(t,e){let o=t&255|Bn;return e&&(o|=Vn),o}function Gn(t,e){let o=t.spanContext(),n=t.status,s=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(o.traceId),spanId:e.encodeSpanContext(o.spanId),parentSpanId:s,traceState:o.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:x(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(r=>$n(r,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(r=>vn(r,e)),droppedLinksCount:t.droppedLinksCount,flags:po(o.traceFlags,t.parentSpanContext?.isRemote)}}function vn(t,e){return{attributes:t.attributes?x(t.attributes,e):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0,flags:po(t.context.traceFlags,t.context.isRemote)}}function $n(t,e){return{attributes:t.attributes?x(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function fo(t,e){return{resourceSpans:Wn(t,e)}}function qn(t){let e=new Map;for(let o of t){let n=e.get(o.resource);n||(n=new Map,e.set(o.resource,n));let s=`${o.instrumentationScope.name}@${o.instrumentationScope.version||""}:${o.instrumentationScope.schemaUrl||""}`,r=n.get(s);r||(r=[],n.set(s,r)),r.push(o)}return e}function Wn(t,e){let o=qn(t),n=[],s=o.entries(),r=s.next();for(;!r.done;){let[i,u]=r.value,c=[],d=u.values(),m=d.next();for(;!m.done;){let E=m.value;if(E.length>0){let D=E.map(_=>Gn(_,e));c.push({scope:H(E[0].instrumentationScope,e),spans:D,schemaUrl:E[0].instrumentationScope.schemaUrl})}m=d.next()}let l=w(i,e),f={resource:l,scopeSpans:c,schemaUrl:l.schemaUrl};n.push(f),r=s.next()}return n}var Bn,Vn,lo=a(()=>{"use strict";ht();Bn=256,Vn=512});var Gt,mo=a(()=>{"use strict";lo();gt();h();Gt={serializeRequest:t=>{let e=fo(t,k);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(o){return p.warn(`Failed to parse trace export response: ${o.message}. Returning empty response`),{}}}}});var ho=a(()=>{"use strict";mo()});var Xn={};_t(Xn,{JsonLogsSerializer:()=>Bt,JsonMetricsSerializer:()=>Vt,JsonTraceSerializer:()=>Gt,LogsExporterMetricsHelper:()=>Oe,MetricsExporterMetricsHelper:()=>be,ProtobufLogsSerializer:()=>zt,ProtobufMetricsSerializer:()=>Ht,ProtobufTraceSerializer:()=>kt,TraceExporterMetricsHelper:()=>Ae});var Jn=a(()=>{"use strict";Le();Re();ye();Ue();$e();Qe();no();uo();ho()});function vt(t){return t===429||t===502||t===503||t===504}function $t(t){if(t==null)return;let e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let o=new Date(t).getTime()-Date.now();return o>=0?o:0}var go=a(()=>{"use strict"});import*as Eo from"zlib";import{Readable as jn}from"stream";function _o(t,e,o,n,s,r,i,u){return new Promise(c=>{let d=new URL(e);s?o["User-Agent"]=`${s} ${To}`:o["User-Agent"]=To;let l=t(d,{method:"POST",headers:o,agent:r},f=>{let E=[],D=0;f.on("data",_=>{if(D+=_.length,D>xo){let Et=new Error(`OTLP export response body exceeded size limit of ${xo} bytes`);c({status:"failure",error:Et}),f.destroy();return}E.push(_)}),f.on("end",()=>{if(f.statusCode&&f.statusCode<=299)c({status:"success",data:Buffer.concat(E)});else if(f.statusCode&&vt(f.statusCode))c({status:"retryable",retryInMillis:$t(f.headers["retry-after"])});else{let _=new S(f.statusMessage,f.statusCode,Buffer.concat(E).toString());c({status:"failure",error:_})}}),f.on("error",_=>{f.statusCode&&f.statusCode<=299?c({status:"success"}):f.statusCode&&vt(f.statusCode)?c({status:"retryable",error:_,retryInMillis:$t(f.headers["retry-after"])}):c({status:"failure",error:_})})});l.setTimeout(u,()=>{l.destroy(),c({status:"retryable",error:new Error("Request timed out")})}),l.on("error",f=>{Qn(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),Yn(l,n,i,f=>{c({status:"failure",error:f})})})}function Yn(t,e,o,n){let s=Kn(o);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),s=s.on("error",n).pipe(Eo.createGzip()).on("error",n)),s.pipe(t).on("error",n)}function Kn(t){let e=new jn;return e.push(t),e.push(null),e}function Qn(t){let e=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in t&&typeof t.code=="string"?e.has(t.code):!1}var To,xo,So=a(()=>{"use strict";go();X();Mt();To=`OTel-OTLP-Exporter-JavaScript/${pt}`,xo=4*1024*1024});async function Zn(t){let e=t==="http:"?import("http"):import("https"),{request:o}=await e;return o}function bo(t){return new qt(t)}var qt,Lo=a(()=>{"use strict";So();qt=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,o){let{agent:n,request:s}=await this._loadUtils(),r=await this._parameters.headers();return _o(s,this._parameters.url,r,this._parameters.compression,this._parameters.userAgent,n,e,o)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let o=new URL(this._parameters.url).protocol,[n,s]=await Promise.all([this._parameters.agentFactory(o),Zn(o)]);e=this._utils={agent:n,request:s}}return e}}});function ns(){return Math.random()*(2*Ao)-Ao}function Ro(t){return new Xt(t.transport)}var Wt,ts,es,os,Ao,Xt,Oo=a(()=>{"use strict";h();Wt=5,ts=1e3,es=5e3,os=1.5,Ao=.2;Xt=class{_transport;constructor(e){this._transport=e}retry(e,o,n){return new Promise((s,r)=>{setTimeout(()=>{this._transport.send(e,o).then(s,r)},n)})}async send(e,o){let n=Wt,s=ts,r=Date.now()+o,i=await this._transport.send(e,o);for(;i.status==="retryable"&&n>0;){n--;let u=Math.max(Math.min(s*(1+ns()),es),0);s=s*os;let c=i.retryInMillis??u,d=r-Date.now();if(c>d)return p.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(d)}ms, not retrying further.`),i;p.verbose(`Scheduling export retry in ${Math.round(c)}ms`),i=await this.retry(e,d,c)}return i.status==="success"?p.verbose(`Export succeeded after ${Wt-n} retry attempts.`):i.status==="retryable"?p.info(`Export failed after maximum retry attempts (${Wt}).`):p.info(`Export failed with non-retryable error: ${i.error}`),i}shutdown(){return this._transport.shutdown()}}});function Jt(t,e,o,n){return new N({componentType:t,metricsHelper:e,url:o,meterProvider:n,responseAttributesFromError:s=>s?s instanceof S?{[Ct]:s.code}:{}:{[Ct]:200}})}function yo(t,e,o,n,s){return ut({transport:Ro({transport:bo(t)}),serializer:e,promiseHandler:ct(t),metrics:Jt(o,n,t.url,s)},{timeout:t.timeoutMillis})}var Po=a(()=>{"use strict";It();Lo();yt();Oo();X();Dt();Ft()});function Io(t){let e={};return Object.entries(t??{}).forEach(([o,n])=>{typeof n<"u"?e[o]=String(n):p.warn(`Header "${o}" has invalid value (${n}) and will be ignored`)}),e}var Co=a(()=>{"use strict";h()});function ss(t,e,o){return async()=>{let n={...await o()},s={};return e!=null&&Object.assign(s,await e()),t!=null&&Object.assign(s,Io(await t())),Object.assign(s,n)}}function rs(t){if(t!=null)try{let e=globalThis.location?.href;return new URL(t,e).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function Do(t,e,o){return{...rt(t,e,o),headers:ss(t.headers,e.headers,o.headers),url:rs(t.url)??e.url??o.url}}function Mo(t,e){return{...it(),headers:async()=>t,url:"http://localhost:4318/"+e}}var Fo=a(()=>{"use strict";J();Co()});function C(t){return async e=>{let o=e==="http:",n=o?import("http"):import("https"),{Agent:s}=await n;if(o){let{ca:r,cert:i,key:u,...c}=t;return new s(c)}return new s(t)}}function No(t,e,o){return{...Do(t,e,o),agentFactory:t.agentFactory??e.agentFactory??o.agentFactory,userAgent:t.userAgent}}function Uo(t,e){return{...Mo(t,e),agentFactory:C({keepAlive:!0})}}var Tt=a(()=>{"use strict";Fo()});function zo(t){let e=Qt(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;p.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function is(t){let e=zo(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),o=zo("OTEL_EXPORTER_OTLP_TIMEOUT");return e??o}function wo(t){let e=A(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;p.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function as(t){let e=wo(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),o=wo("OTEL_EXPORTER_OTLP_COMPRESSION");return e??o}function xt(t){return{timeoutMillis:is(t),compression:as(t)}}var jt=a(()=>{"use strict";G();h()});var cs={};_t(cs,{convertLegacyHttpOptions:()=>Ho,createOtlpHttpExportDelegate:()=>yo,createOtlpHttpExporterMetrics:()=>Jt,getSharedConfigurationFromEnvironment:()=>xt,httpAgentFactoryFromOptions:()=>C});var Bo=a(()=>{"use strict";Tt();Po();jt();ko()});import*as Vo from"fs";import*as Go from"path";function us(t){let e=A(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),o=A("OTEL_EXPORTER_OTLP_HEADERS"),n=V(e),s=V(o);if(!(Object.keys(n).length===0&&Object.keys(s).length===0))return Object.assign({},V(o),V(e))}function ps(t){try{return new URL(t).toString()}catch{p.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function fs(t,e){try{new URL(t)}catch{p.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith("/")||(t=t+"/"),t+=e;try{new URL(t)}catch{p.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function ls(t){let e=A("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return fs(e,t)}function ds(t){let e=A(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return ps(e)}function Yt(t,e,o){let n=A(t),s=A(e),r=n??s;if(r!=null)try{return Vo.readFileSync(Go.resolve(process.cwd(),r))}catch{p.warn(o);return}else return}function ms(t){return Yt(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function hs(t){return Yt(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function gs(t){return Yt(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function vo(t,e){return{...xt(t),url:ds(t)??ls(e),headers:st(us(t)),agentFactory:C({keepAlive:!0,ca:gs(t),cert:ms(t),key:hs(t)})}}var $o=a(()=>{"use strict";G();h();jt();J();Tt()});function qo(t){return typeof t.headers=="function"?t.headers:st(t.headers)}var Wo=a(()=>{"use strict";J()});function Ts(t){if(typeof t.httpAgentOptions=="function")return t.httpAgentOptions;let e=t.httpAgentOptions;if(t.keepAlive!=null&&(e={keepAlive:t.keepAlive,...e}),e!=null)return C(e)}function Ho(t,e,o,n){return t.metadata&&p.warn("Metadata cannot be set when using http"),No({url:t.url,headers:qo(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:Ts(t),userAgent:t.userAgent},vo(e,o),Uo(n,o))}var ko=a(()=>{"use strict";h();Tt();Bo();$o();Wo()});export{nt as a,Yo as b,Ko as c,be as d,Ae as e,Oe as f,v as g,Xo as h,ue as i,zt as j,Ht as k,kt as l,Bt as m,Vt as n,Gt as o,Xn as p,Jn as q,Jt as r,yo as s,Ho as t,cs as u,Bo as v};
|