@swifty.js/swifty 0.0.32 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +64 -0
  2. package/dist/acp-A4KRKOHD.js +14 -0
  3. package/dist/agent-VDWIGFIV.js +4 -0
  4. package/dist/anthropic-AR2Y4FBR.js +4 -0
  5. package/dist/bwrap-4KOC7P3X.js +4 -0
  6. package/dist/chunk-2U4IWZ6E.js +4 -0
  7. package/dist/{chunk-2EV72T5X.js → chunk-325L2ILZ.js} +1 -1
  8. package/dist/chunk-35X3GW25.js +4 -0
  9. package/dist/chunk-44LPRRYU.js +60 -0
  10. package/dist/chunk-4B4SGVJH.js +164 -0
  11. package/dist/chunk-5W2TCASL.js +4 -0
  12. package/dist/chunk-6I3HEMIE.js +4 -0
  13. package/dist/{chunk-TKQ5T5VO.js → chunk-7JQHFZRD.js} +2 -2
  14. package/dist/chunk-F4FOFPKL.js +611 -0
  15. package/dist/chunk-FZORZF22.js +16 -0
  16. package/dist/chunk-G2TE2QZM.js +4 -0
  17. package/dist/{chunk-JMF2DWGY.js → chunk-H56UQALW.js} +1 -1
  18. package/dist/chunk-IOLGXPUQ.js +6 -0
  19. package/dist/chunk-IXCJZNBB.js +5 -0
  20. package/dist/chunk-IZ7QOBSB.js +4 -0
  21. package/dist/chunk-JC44NVST.js +4 -0
  22. package/dist/chunk-LC7ZWLIH.js +4 -0
  23. package/dist/chunk-M4D66APS.js +67 -0
  24. package/dist/chunk-NCZR3AGA.js +65 -0
  25. package/dist/chunk-NDPYUGE5.js +5 -0
  26. package/dist/chunk-PH643I2P.js +4 -0
  27. package/dist/{chunk-FPQ2LBL4.js → chunk-QQVDL4QT.js} +1 -1
  28. package/dist/{chunk-TCQ4EB4G.js → chunk-TNF3EHFY.js} +1 -1
  29. package/dist/{server-QMMIYNXW.js → chunk-TOM34LJB.js} +16 -16
  30. package/dist/{chunk-NERVCUWE.js → chunk-UJGMTIYO.js} +1 -1
  31. package/dist/chunk-XGUH7SGV.js +4 -0
  32. package/dist/chunk-YBS5ATGZ.js +4 -0
  33. package/dist/chunk-YKWIZE5D.js +4 -0
  34. package/dist/{devtools-OJ75EP3T.js → devtools-WJM4UVVT.js} +1 -1
  35. package/dist/esm-46WSO26W.js +4 -0
  36. package/dist/esm-6EDGM6QS.js +4 -0
  37. package/dist/esm-D6BB3FBR.js +4 -0
  38. package/dist/esm-P2KEXEEK.js +4 -0
  39. package/dist/esm-VBV56AO5.js +229 -0
  40. package/dist/esm-XYKZYVLV.js +4 -0
  41. package/dist/esm-YJVVI2QX.js +4 -0
  42. package/dist/getMachineId-bsd-NBOQ3GRQ.js +4 -0
  43. package/dist/getMachineId-darwin-6VBNSUFR.js +5 -0
  44. package/dist/getMachineId-linux-RQ33NIOO.js +4 -0
  45. package/dist/getMachineId-unsupported-IWOYPUHZ.js +4 -0
  46. package/dist/getMachineId-win-ITT3WXP6.js +4 -0
  47. package/dist/lib/agent-TC4HSVMS.js +16 -0
  48. package/dist/lib/{anthropic-B33M2AVN.js → anthropic-FKIGL7NL.js} +6 -5
  49. package/dist/lib/bwrap-2OL7VPSO.js +7 -0
  50. package/dist/lib/{chunk-FODSMOWP.js → chunk-6V7RW6HA.js} +34 -16
  51. package/dist/lib/{chunk-TJLAJGG4.js → chunk-ALQHMYOZ.js} +14 -3
  52. package/dist/lib/{chunk-XT67KGWE.js → chunk-BQFVUVLI.js} +12 -2
  53. package/dist/lib/chunk-FFM2LB4C.js +132 -0
  54. package/dist/lib/{chunk-VUD72RTY.js → chunk-FLKB4BK7.js} +16 -5
  55. package/dist/lib/{chunk-3OFLDUAW.js → chunk-HQSYRTER.js} +96 -49
  56. package/dist/lib/{chunk-4BPKIIQD.js → chunk-LRN4MOQ3.js} +31 -5
  57. package/dist/lib/chunk-MLKGABMK.js +9 -0
  58. package/dist/lib/chunk-OJTISIYU.js +462 -0
  59. package/dist/lib/{chunk-BCBD34D2.js → chunk-OLFXCZVH.js} +25 -7
  60. package/dist/lib/{chunk-SOOSTGHI.js → chunk-RUDYC7OS.js} +32 -48
  61. package/dist/lib/{chunk-UH5M7FDP.js → chunk-S5VWPTME.js} +1189 -126
  62. package/dist/lib/chunk-YIWNQ7OA.js +47 -0
  63. package/dist/lib/{chunk-3XCGUKGJ.js → chunk-ZPIF7IJN.js} +219 -6
  64. package/dist/lib/index.d.ts +3267 -1143
  65. package/dist/lib/index.js +13214 -12207
  66. package/dist/lib/{openai-C2PZFGJ2.js → openai-ZWIYIBLC.js} +4 -3
  67. package/dist/lib/{checker-QNMXPZ7C.js → permissions-BW4QPZXV.js} +4 -3
  68. package/dist/lib/providers-ROWSB6ND.js +9 -0
  69. package/dist/lib/sandbox-runtime-CCQ3X3SM.js +9 -0
  70. package/dist/lib/seatbelt-WO7YWKLR.js +7 -0
  71. package/dist/lib/{tool-filter-IMIU7CW2.js → tool-filter-QU4LOZII.js} +2 -1
  72. package/dist/main.js +231 -190
  73. package/dist/{node-GXMM4JG3.js → node-A6KBFKOV.js} +1 -1
  74. package/dist/{openai-M7B2TITO.js → openai-7LMX5HKW.js} +1 -1
  75. package/dist/permissions-74IHQW76.js +4 -0
  76. package/dist/providers-2J4JJYQD.js +4 -0
  77. package/dist/sandbox-runtime-RVW4BK3L.js +4 -0
  78. package/dist/seatbelt-GMQUP6SV.js +4 -0
  79. package/dist/server-ZYK4L22D.js +4 -0
  80. package/dist/src-3A5BCUSZ.js +4 -0
  81. package/dist/src-CRYFVH7Y.js +12 -0
  82. package/dist/src-Y77IB66J.js +4 -0
  83. package/dist/src-ZCW4GCG2.js +4 -0
  84. package/dist/{tool-filter-7LLVAHD5.js → tool-filter-U5SSL3LR.js} +1 -1
  85. package/dist/turndown.es-WNOSVZF6.js +83 -0
  86. package/package.json +34 -5
  87. package/dist/agent-2DUTUJFX.js +0 -4
  88. package/dist/anthropic-KR5MXB5I.js +0 -4
  89. package/dist/bwrap-TPE6G4BM.js +0 -4
  90. package/dist/checker-RKAWOOXC.js +0 -4
  91. package/dist/chunk-4YVJP2CO.js +0 -4
  92. package/dist/chunk-BWWNI2FK.js +0 -121
  93. package/dist/chunk-LTFPTWX4.js +0 -612
  94. package/dist/chunk-S35E7OYL.js +0 -5
  95. package/dist/chunk-TW7RHCDS.js +0 -150
  96. package/dist/chunk-X3UA5OZL.js +0 -4
  97. package/dist/lib/agent-3OEC4SOB.js +0 -10
  98. package/dist/lib/bwrap-QRGPUP4J.js +0 -6
  99. package/dist/lib/chunk-ORSYNBMM.js +0 -38
  100. package/dist/lib/seatbelt-FT5IY73W.js +0 -6
  101. package/dist/seatbelt-3GM2YGXV.js +0 -5
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __swiftyCreateRequire } from "node:module";
3
+ const require = __swiftyCreateRequire(import.meta.url);
4
+ import{A as Ie,E as w,K as Oe,M as R,O as Ce,P as kr,g as jt,t as L,u as Kt,w as Ne,y as Y}from"./chunk-YKWIZE5D.js";import{e as at,f as C,o as ct,p as m,u as g}from"./chunk-LC7ZWLIH.js";import{b as u,d as Gr}from"./chunk-IZ7QOBSB.js";function lt(i){let t=Object.keys(i);return t.length===0?"":(t=t.sort(),JSON.stringify(t.map(e=>[e,i[e]])))}function Re(i){return`${i.name}:${i.version??""}:${i.schemaUrl??""}`}function A(i,t){let e,r=new Promise(function(n,a){e=setTimeout(function(){a(new v("Operation timed out."))},t)});return Promise.race([i,r]).then(s=>(clearTimeout(e),s),s=>{throw clearTimeout(e),s})}function ve(i,t){if(i.size!==t.size)return!1;for(let e of i)if(!t.has(e))return!1;return!0}function Pe(i,t){let e=0,r=i.length-1,s=i.length;for(;r>=e;){let n=e+Math.trunc((r-e)/2);i[n]<t?e=n+1:(s=n,r=n-1)}return s}function Le(i,t){return i.toLowerCase()===t.toLowerCase()}var v,S=u(()=>{"use strict";v=class i extends Error{constructor(t){super(t),Object.setPrototypeOf(this,i.prototype)}}});var y,ut=u(()=>{"use strict";(function(i){i[i.DELTA=0]="DELTA",i[i.CUMULATIVE=1]="CUMULATIVE"})(y||(y={}))});var f,U=u(()=>{"use strict";(function(i){i[i.DROP=0]="DROP",i[i.SUM=1]="SUM",i[i.LAST_VALUE=2]="LAST_VALUE",i[i.HISTOGRAM=3]="HISTOGRAM",i[i.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(f||(f={}))});var q,Ue=u(()=>{"use strict";U();q=class{kind=f.DROP;createAccumulation(){}merge(t,e){}diff(t,e){}toMetricData(t,e,r,s){}}});var h,x,E=u(()=>{"use strict";(function(i){i.COUNTER="COUNTER",i.GAUGE="GAUGE",i.HISTOGRAM="HISTOGRAM",i.UP_DOWN_COUNTER="UP_DOWN_COUNTER",i.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",i.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",i.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(h||(h={}));(function(i){i[i.HISTOGRAM=0]="HISTOGRAM",i[i.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",i[i.GAUGE=2]="GAUGE",i[i.SUM=3]="SUM"})(x||(x={}))});function Vr(i){let t=i.map(()=>0);return t.push(0),{buckets:{boundaries:i,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var B,G,Be=u(()=>{"use strict";U();E();S();B=class{startTime;_boundaries;_recordMinMax;_current;constructor(t,e,r=!0,s=Vr(e)){this.startTime=t,this._boundaries=e,this._recordMinMax=r,this._current=s}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=Pe(this._boundaries,t);this._current.buckets.counts[e]+=1}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},G=class{kind=f.HISTOGRAM;_boundaries;_recordMinMax;constructor(t,e){this._boundaries=t,this._recordMinMax=e}createAccumulation(t){return new B(t,this._boundaries,this._recordMinMax)}merge(t,e){let r=t.toPointValue(),s=e.toPointValue(),n=r.buckets.counts,a=s.buckets.counts,o=new Array(n.length);for(let _=0;_<n.length;_++)o[_]=n[_]+a[_];let l=1/0,c=-1/0;return this._recordMinMax&&(r.hasMinMax&&s.hasMinMax?(l=Math.min(r.min,s.min),c=Math.max(r.max,s.max)):r.hasMinMax?(l=r.min,c=r.max):s.hasMinMax&&(l=s.min,c=s.max)),new B(t.startTime,r.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:r.buckets.boundaries,counts:o},count:r.count+s.count,sum:r.sum+s.sum,hasMinMax:this._recordMinMax&&(r.hasMinMax||s.hasMinMax),min:l,max:c})}diff(t,e){let r=t.toPointValue(),s=e.toPointValue(),n=r.buckets.counts,a=s.buckets.counts,o=new Array(n.length);for(let l=0;l<n.length;l++)o[l]=a[l]-n[l];return new B(e.startTime,r.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:r.buckets.boundaries,counts:o},count:s.count-r.count,sum:s.sum-r.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(t,e,r,s){return{descriptor:t,aggregationTemporality:e,dataPointType:x.HISTOGRAM,dataPoints:r.map(([n,a])=>{let o=a.toPointValue(),l=t.type===h.GAUGE||t.type===h.UP_DOWN_COUNTER||t.type===h.OBSERVABLE_GAUGE||t.type===h.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:n,startTime:a.startTime,endTime:s,value:{min:o.hasMinMax?o.min:void 0,max:o.hasMinMax?o.max:void 0,sum:l?void 0:o.sum,buckets:o.buckets,count:o.count}}})}}}});var j,Jt,Ge=u(()=>{"use strict";j=class i{backing;indexBase;indexStart;indexEnd;constructor(t=new Jt,e=0,r=0,s=0){this.backing=t,this.indexBase=e,this.indexStart=r,this.indexEnd=s}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,r=1<<t,s=0,n=0;for(let a=this.indexStart;a<=this.indexEnd;){let o=a%r;o<0&&(o+=r);for(let l=o;l<r&&s<e;l++)this._relocateBucket(n,s),s++,a++;n++}this.indexStart>>=t,this.indexEnd>>=t,this.indexBase=this.indexStart}clone(){return new i(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))}},Jt=class i{_counts;constructor(t=[0]){this._counts=t}get length(){return this._counts.length}countAt(t){return this._counts[t]}growTo(t,e,r){let s=new Array(t).fill(0);s.splice(r,this._counts.length-e,...this._counts.slice(e)),s.splice(0,e,...this._counts.slice(0,e)),this._counts=s}reverse(t,e){let r=Math.floor((t+e)/2)-t;for(let s=0;s<r;s++){let n=this._counts[t+s];this._counts[t+s]=this._counts[e-s-1],this._counts[e-s-1]=n}}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 i([...this._counts])}}});function ke(i){return Zt.setFloat64(0,i),{hi:Zt.getUint32(0),lo:Zt.getUint32(4)}}function ht(i){let{hi:t}=ke(i);return((t&2146435072)>>20)-1023}function mt(i){let{hi:t,lo:e}=ke(i);return(t&1048575)===0&&e===0}var K,Zt,Qt=u(()=>{"use strict";K=Math.pow(2,-1022),Zt=new DataView(new ArrayBuffer(8))});function J(i,t){return i===0||i===Number.POSITIVE_INFINITY||i===Number.NEGATIVE_INFINITY||Number.isNaN(i)?i:i*Math.pow(2,t)}function Fe(i){return i--,i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,i++,i}var _t=u(()=>{"use strict"});var T,dt=u(()=>{"use strict";T=class extends Error{}});var pt,$e=u(()=>{"use strict";Qt();_t();dt();pt=class{_shift;constructor(t){this._shift=-t}mapToIndex(t){if(t<K)return this._minNormalLowerBoundaryIndex();let e=ht(t),r=mt(t)?-1:0;return e+r>>this._shift}lowerBoundary(t){let e=this._minNormalLowerBoundaryIndex();if(t<e)throw new T(`underflow: ${t} is < minimum lower boundary: ${e}`);let r=this._maxNormalLowerBoundaryIndex();if(t>r)throw new T(`overflow: ${t} is > maximum lower boundary: ${r}`);return J(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 gt,ze=u(()=>{"use strict";Qt();_t();dt();gt=class{_scale;_scaleFactor;_inverseFactor;constructor(t){this._scale=t,this._scaleFactor=J(Math.LOG2E,t),this._inverseFactor=J(Math.LN2,-t)}mapToIndex(t){if(t<=K)return this._minNormalLowerBoundaryIndex()-1;if(mt(t))return(ht(t)<<this._scale)-1;let e=Math.floor(Math.log(t)*this._scaleFactor),r=this._maxNormalLowerBoundaryIndex();return e>=r?r: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 T(`overflow: ${t} is > maximum lower boundary: ${e}`)}let r=this._minNormalLowerBoundaryIndex();if(t<=r){if(t===r)return K;if(t===r-1)return Math.exp((t+(1<<this._scale))/this._scaleFactor)/2;throw new T(`overflow: ${t} is < minimum lower boundary: ${r}`)}return Math.exp(t*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}});function re(i){if(i>Xe||i<He)throw new T(`expected scale >= ${He} && <= ${Xe}, got: ${i}`);return Fr[i+10]}var He,Xe,Fr,We=u(()=>{"use strict";$e();ze();dt();He=-10,Xe=20,Fr=Array.from({length:31},(i,t)=>t>10?new gt(t-10):new pt(t-10))});var k,Dr,$r,ie,ft,Z,Ye=u(()=>{"use strict";U();E();g();Ge();We();_t();k=class i{static combine(t,e){return new i(Math.min(t.low,e.low),Math.max(t.high,e.high))}low;high;constructor(t,e){this.low=t,this.high=e}},Dr=20,$r=160,ie=2,ft=class i{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(t,e=$r,r=!0,s=0,n=0,a=0,o=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=new j,_=new j,O=re(Dr)){this.startTime=t,this._maxSize=e,this._recordMinMax=r,this._sum=s,this._count=n,this._zeroCount=a,this._min=o,this._max=l,this._positive=c,this._negative=_,this._mapping=O,this._maxSize<ie&&(m.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${ie}`),this._maxSize=ie)}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 i(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,r){let s=this._mapping.mapToIndex(e),n=!1,a=0,o=0;if(t.length===0?(t.indexStart=s,t.indexEnd=t.indexStart,t.indexBase=t.indexStart):s<t.indexStart&&t.indexEnd-s>=this._maxSize?(n=!0,o=s,a=t.indexEnd):s>t.indexEnd&&s-t.indexStart>=this._maxSize&&(n=!0,o=t.indexStart,a=s),n){let l=this._changeScale(a,o);this._downscale(l),s=this._mapping.mapToIndex(e)}this._incrementIndexBy(t,s,r)}_incrementIndexBy(t,e,r){if(r===0)return;if(t.length===0&&(t.indexStart=t.indexEnd=t.indexBase=e),e<t.indexStart){let n=t.indexEnd-e;n>=t.backing.length&&this._grow(t,n+1),t.indexStart=e}else if(e>t.indexEnd){let n=e-t.indexStart;n>=t.backing.length&&this._grow(t,n+1),t.indexEnd=e}let s=e-t.indexBase;s<0&&(s+=t.backing.length),t.incrementBucket(s,r)}_grow(t,e){let r=t.backing.length,s=t.indexBase-t.indexStart,n=r-s,a=Fe(e);a>this._maxSize&&(a=this._maxSize);let o=a-s;t.backing.growTo(a,n,o)}_changeScale(t,e){let r=0;for(;t-e>=this._maxSize;)t>>=1,e>>=1,r++;return r}_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=re(e)}_minScale(t){let e=Math.min(this.scale,t.scale),r=k.combine(this._highLowAtScale(this.positive,this.scale,e),this._highLowAtScale(t.positive,t.scale,e)),s=k.combine(this._highLowAtScale(this.negative,this.scale,e),this._highLowAtScale(t.negative,t.scale,e));return Math.min(e-this._changeScale(r.high,r.low),e-this._changeScale(s.high,s.low))}_highLowAtScale(t,e,r){if(t.length===0)return new k(0,-1);let s=e-r;return new k(t.indexStart>>s,t.indexEnd>>s)}_mergeBuckets(t,e,r,s){let n=r.offset,a=e.scale-s;for(let o=0;o<r.length;o++)this._incrementIndexBy(t,n+o>>a,r.at(o))}_diffBuckets(t,e,r,s){let n=r.offset,a=e.scale-s;for(let o=0;o<r.length;o++){let c=(n+o>>a)-t.indexBase;c<0&&(c+=t.backing.length),t.decrementBucket(c,r.at(o))}t.trim()}},Z=class{kind=f.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(t,e){this._maxSize=t,this._recordMinMax=e}createAccumulation(t){return new ft(t,this._maxSize,this._recordMinMax)}merge(t,e){let r=e.clone();return r.merge(t),r}diff(t,e){let r=e.clone();return r.diff(t),r}toMetricData(t,e,r,s){return{descriptor:t,aggregationTemporality:e,dataPointType:x.EXPONENTIAL_HISTOGRAM,dataPoints:r.map(([n,a])=>{let o=a.toPointValue(),l=t.type===h.GAUGE||t.type===h.UP_DOWN_COUNTER||t.type===h.OBSERVABLE_GAUGE||t.type===h.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:n,startTime:a.startTime,endTime:s,value:{min:o.hasMinMax?o.min:void 0,max:o.hasMinMax?o.max:void 0,sum:l?void 0:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},count:o.count,scale:o.scale,zeroCount:o.zeroCount}}})}}}});var V,Q,qe=u(()=>{"use strict";U();R();E();V=class{startTime;_current;sampleTime;constructor(t,e=0,r=[0,0]){this.startTime=t,this._current=e,this.sampleTime=r}record(t){this._current=t,this.sampleTime=L(Date.now())}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},Q=class{kind=f.LAST_VALUE;createAccumulation(t){return new V(t)}merge(t,e){let r=Y(e.sampleTime)>=Y(t.sampleTime)?e:t;return new V(t.startTime,r.toPointValue(),r.sampleTime)}diff(t,e){let r=Y(e.sampleTime)>=Y(t.sampleTime)?e:t;return new V(e.startTime,r.toPointValue(),r.sampleTime)}toMetricData(t,e,r,s){return{descriptor:t,aggregationTemporality:e,dataPointType:x.GAUGE,dataPoints:r.map(([n,a])=>({attributes:n,startTime:a.startTime,endTime:s,value:a.toPointValue()}))}}}});var b,F,je=u(()=>{"use strict";U();E();b=class{startTime;monotonic;_current;reset;constructor(t,e,r=0,s=!1){this.startTime=t,this.monotonic=e,this._current=r,this.reset=s}record(t){this.monotonic&&t<0||(this._current+=t)}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},F=class{kind=f.SUM;monotonic;constructor(t){this.monotonic=t}createAccumulation(t){return new b(t,this.monotonic)}merge(t,e){let r=t.toPointValue(),s=e.toPointValue();return e.reset?new b(e.startTime,this.monotonic,s,e.reset):new b(t.startTime,this.monotonic,r+s)}diff(t,e){let r=t.toPointValue(),s=e.toPointValue();return this.monotonic&&r>s?new b(e.startTime,this.monotonic,s,!0):new b(e.startTime,this.monotonic,s-r)}toMetricData(t,e,r,s){return{descriptor:t,aggregationTemporality:e,dataPointType:x.SUM,dataPoints:r.map(([n,a])=>({attributes:n,startTime:a.startTime,endTime:s,value:a.toPointValue()})),isMonotonic:this.monotonic}}}});var Ke=u(()=>{"use strict";Ue();Be();Ye();qe();je()});var se,oe,ne,ae,tt,et,ce,ue,he,me,_e,Hi,Je,Ze=u(()=>{"use strict";g();Ke();E();se=class i{static DEFAULT_INSTANCE=new q;createAggregator(t){return i.DEFAULT_INSTANCE}},oe=class i{static MONOTONIC_INSTANCE=new F(!0);static NON_MONOTONIC_INSTANCE=new F(!1);createAggregator(t){switch(t.type){case h.COUNTER:case h.OBSERVABLE_COUNTER:case h.HISTOGRAM:return i.MONOTONIC_INSTANCE;default:return i.NON_MONOTONIC_INSTANCE}}},ne=class i{static DEFAULT_INSTANCE=new Q;createAggregator(t){return i.DEFAULT_INSTANCE}},ae=class i{static DEFAULT_INSTANCE=new G([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(t){return i.DEFAULT_INSTANCE}},tt=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((n,a)=>n-a);let r=t.lastIndexOf(-1/0),s=t.indexOf(1/0);s===-1&&(s=void 0),this._boundaries=t.slice(r+1,s),this._recordMinMax=e}createAggregator(t){return new G(this._boundaries,this._recordMinMax)}},et=class{_maxSize;_recordMinMax;constructor(t=160,e=!0){this._maxSize=t,this._recordMinMax=e}createAggregator(t){return new Z(this._maxSize,this._recordMinMax)}},ce=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 he;case h.GAUGE:case h.OBSERVABLE_GAUGE:return me;case h.HISTOGRAM:return t.advice.explicitBucketBoundaries?new tt(t.advice.explicitBucketBoundaries):_e}return m.warn(`Unable to recognize instrument type: ${t.type}`),ue}createAggregator(t){return this._resolve(t).createAggregator(t)}},ue=new se,he=new oe,me=new ne,_e=new ae,Hi=new et,Je=new ce});function xt(i){switch(i.type){case d.DEFAULT:return Je;case d.DROP:return ue;case d.SUM:return he;case d.LAST_VALUE:return me;case d.EXPONENTIAL_HISTOGRAM:{let t=i;return new et(t.options?.maxSize,t.options?.recordMinMax)}case d.EXPLICIT_BUCKET_HISTOGRAM:{let t=i;return t.options==null?_e:new tt(t.options?.boundaries,t.options?.recordMinMax)}default:throw new Error("Unsupported Aggregation")}}var d,rt=u(()=>{"use strict";Ze();(function(i){i[i.DEFAULT=0]="DEFAULT",i[i.DROP=1]="DROP",i[i.SUM=2]="SUM",i[i.LAST_VALUE=3]="LAST_VALUE",i[i.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",i[i.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(d||(d={}))});var Qe,St,de=u(()=>{"use strict";ut();rt();Qe=i=>({type:d.DEFAULT}),St=i=>y.CUMULATIVE});var tr,er,rr,ir,sr,pe=u(()=>{"use strict";tr="otel.component.name",er="otel.component.type",rr="periodic_metric_reader",ir="otel.sdk.metric_reader.collection.duration",sr="error.type"});var or,it,nr=u(()=>{"use strict";pe();or=new Map,it=class{collectionDuration;standardAttrs;constructor(t,e){let r=or.get(t)??0;or.set(t,r+1),this.standardAttrs={[er]:t,[tr]:`${t}/${r}`},this.collectionDuration=e.createHistogram(ir,{unit:"s",description:"The duration of the collect operation of the metric reader.",advice:{explicitBucketBoundaries:[]}})}recordCollection(t,e){let r=e?{...this.standardAttrs,[sr]:e}:this.standardAttrs;this.collectionDuration.record(t,r)}}});var ar,cr=u(()=>{"use strict";ar="2.11.0"});var N,Tt=u(()=>{"use strict";g();S();de();nr();cr();R();N=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_selfObsMetrics;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;_otelComponentType;constructor(t){this._aggregationSelector=t?.aggregationSelector??Qe,this._aggregationTemporalitySelector=t?.aggregationTemporalitySelector??St,this._metricProducers=t?.metricProducers??[],this._cardinalitySelector=t?.cardinalitySelector,this._otelComponentType=t?.otelComponentType??this.constructor.name,this._selfObsMetrics=new it(this._otelComponentType,at())}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",ar);this._selfObsMetrics=new it(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=Kt(),[r,...s]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:t?.timeoutMillis}),...this._metricProducers.map(_=>_.collect({timeoutMillis:t?.timeoutMillis}))]),n=Kt(),a=r.errors.concat(s.flatMap(_=>_.errors)),o=Ie(Ne(e,n));this._selfObsMetrics.recordCollection(o,a.length>0?a[0].name??"collect_error":void 0);let l=r.resourceMetrics.resource,c=r.resourceMetrics.scopeMetrics.concat(s.flatMap(_=>_.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:l,scopeMetrics:c},errors:a}}async shutdown(t){if(this._shutdown){m.error("Cannot call shutdown twice.");return}t?.timeoutMillis==null?await this.onShutdown():await A(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 A(this.onForceFlush(),t.timeoutMillis)}}});function lr(i,t){if(!Number.isInteger(t)||t<=0)throw new Error("maxExportBatchSize must be a positive integer");let e=[],r=0,s=[];function n(){s.length>0&&(e.push({resource:i.resource,scopeMetrics:s}),s=[],r=0)}for(let a of i.scopeMetrics){let o=null;for(let l of a.metrics){let c=l.dataPoints;if(c.length===0){o||(o={scope:a.scope,metrics:[]},s.push(o)),o.metrics.push(l);continue}let _=0;for(;_<c.length;){let O=t-r,P=Math.min(O,c.length-_);o||(o={scope:a.scope,metrics:[]},s.push(o));let Br={...l,dataPoints:c.slice(_,_+P)};o.metrics.push(Br),_+=P,r+=P,r===t&&(n(),o=null)}}}return n(),e}var ur=u(()=>{"use strict"});var Mt,hr=u(()=>{"use strict";g();R();Tt();S();E();ur();pe();Mt=class extends N{_interval;_exporter;_exportInterval;_exportTimeout;_maxExportBatchSize;_ongoingExportPromise=null;constructor(t){let{exporter:e,exportIntervalMillis:r=6e4,metricProducers:s,cardinalityLimits:n,maxExportBatchSize:a}=t,{exportTimeoutMillis:o=3e4}=t;if(super({aggregationSelector:e.selectAggregation?.bind(e),aggregationTemporalitySelector:e.selectAggregationTemporality?.bind(e),otelComponentType:rr,metricProducers:s,cardinalitySelector:l=>{let c={default:2e3,...n};switch(l){case h.COUNTER:return c.counter??c.default;case h.GAUGE:return c.gauge??c.default;case h.HISTOGRAM:return c.histogram??c.default;case h.OBSERVABLE_COUNTER:return c.observableCounter??c.default;case h.OBSERVABLE_UP_DOWN_COUNTER:return c.observableUpDownCounter??c.default;case h.OBSERVABLE_GAUGE:return c.observableGauge??c.default;case h.UP_DOWN_COUNTER:return c.upDownCounter??c.default;default:return c.default}}}),r<=0)throw Error("exportIntervalMillis must be greater than 0");if(o<=0)throw Error("exportTimeoutMillis must be greater than 0");if(a!==void 0&&(!Number.isInteger(a)||a<=0))throw Error("maxExportBatchSize must be a positive integer");if(r<o){if("exportIntervalMillis"in t&&"exportTimeoutMillis"in t)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");m.info(`Timeout of ${o} exceeds the interval of ${r}. Clamping timeout to interval duration.`),o=r}this._exportInterval=r,this._exportTimeout=o,this._exporter=e,this._maxExportBatchSize=a}async _runOnce(){try{await this._doRun()}catch(t){jt(t)}}async _doRun(){if(this._ongoingExportPromise){m.debug("PeriodicExportingMetricReader: export already in progress, skipping");return}let t=async()=>{let{resourceMetrics:e,errors:r}=await this.collect({timeoutMillis:this._exportTimeout});if(r.length>0&&m.error("PeriodicExportingMetricReader: metrics collection errors",...r),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(a){m.debug("Error while resolving async portion of resource: ",a),jt(a)}if(e.scopeMetrics.length===0)return;let s=this._maxExportBatchSize?lr(e,this._maxExportBatchSize):[e],n=null;for(let a of s)try{let o=await A(Oe._export(this._exporter,a),this._exportTimeout);o.code!==w.SUCCESS&&(n=new Error(`PeriodicExportingMetricReader: metrics export failed (error ${o.error})`))}catch(o){if(o instanceof v){m.error(`PeriodicExportingMetricReader: metrics export timed out after ${this._exportTimeout}ms`);break}else m.error("PeriodicExportingMetricReader: metrics export threw error",o),n=o instanceof Error?o:new Error(String(o))}if(n)throw n};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 Et,mr=u(()=>{"use strict";R();de();Et=class i{_shutdown=!1;_temporalitySelector;constructor(t){this._temporalitySelector=t?.temporalitySelector??St}export(t,e){if(this._shutdown){e({code:w.FAILED});return}return i._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 r of t.scopeMetrics)for(let s of r.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});e({code:w.SUCCESS})}}});var wt,_r=u(()=>{"use strict";wt=class{_registeredViews=[];addView(t){this._registeredViews.push(t)}findViews(t,e){return this._registeredViews.filter(s=>this._matchInstrument(s.instrumentSelector,t)&&this._matchMeter(s.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 M(i,t,e){return Hr(i)||m.warn(`Invalid metric name: "${i}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:i,type:t,description:e?.description??"",unit:e?.unit??"",valueType:e?.valueType??C.DOUBLE,advice:e?.advice??{}}}function dr(i,t){return{name:i.name??t.name,description:i.description??t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function pr(i,t){return Le(i.name,t.name)&&i.unit===t.unit&&i.type===t.type&&i.valueType===t.valueType}function Hr(i){return zr.test(i)}var zr,st=u(()=>{"use strict";g();S();zr=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function ot(i){return i instanceof $}var D,At,yt,bt,Nt,$,It,Ot,Ct,Rt=u(()=>{"use strict";g();D=class{_writableMetricStorage;_descriptor;constructor(t,e){this._writableMetricStorage=t,this._descriptor=e}_record(t,e={},r){if(typeof t!="number"){m.warn(`non-number value provided to metric ${this._descriptor.name}: ${t}`);return}this._descriptor.valueType===C.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,r,Date.now())}},At=class extends D{add(t,e,r){this._record(t,e,r)}},yt=class extends D{add(t,e,r){if(t<0){m.warn(`negative value provided to counter ${this._descriptor.name}: ${t}`);return}this._record(t,e,r)}},bt=class extends D{record(t,e,r){this._record(t,e,r)}},Nt=class extends D{record(t,e,r){if(t<0){m.warn(`negative value provided to histogram ${this._descriptor.name}: ${t}`);return}this._record(t,e,r)}},$=class{_metricStorages;_descriptor;_observableRegistry;constructor(t,e,r){this._descriptor=t,this._metricStorages=e,this._observableRegistry=r}addCallback(t){this._observableRegistry.addCallback(t,this)}removeCallback(t){this._observableRegistry.removeCallback(t,this)}},It=class extends ${},Ot=class extends ${},Ct=class extends ${}});var vt,gr=u(()=>{"use strict";st();Rt();E();vt=class{_meterSharedState;constructor(t){this._meterSharedState=t}createGauge(t,e){let r=M(t,h.GAUGE,e),s=this._meterSharedState.registerMetricStorage(r);return new bt(s,r)}createHistogram(t,e){let r=M(t,h.HISTOGRAM,e),s=this._meterSharedState.registerMetricStorage(r);return new Nt(s,r)}createCounter(t,e){let r=M(t,h.COUNTER,e),s=this._meterSharedState.registerMetricStorage(r);return new yt(s,r)}createUpDownCounter(t,e){let r=M(t,h.UP_DOWN_COUNTER,e),s=this._meterSharedState.registerMetricStorage(r);return new At(s,r)}createObservableGauge(t,e){let r=M(t,h.OBSERVABLE_GAUGE,e),s=this._meterSharedState.registerAsyncMetricStorage(r);return new Ot(r,s,this._meterSharedState.observableRegistry)}createObservableCounter(t,e){let r=M(t,h.OBSERVABLE_COUNTER,e),s=this._meterSharedState.registerAsyncMetricStorage(r);return new It(r,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(t,e){let r=M(t,h.OBSERVABLE_UP_DOWN_COUNTER,e),s=this._meterSharedState.registerAsyncMetricStorage(r);return new Ct(r,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(t,e){this._meterSharedState.observableRegistry.addBatchCallback(t,e)}removeBatchObservableCallback(t,e){this._meterSharedState.observableRegistry.removeBatchCallback(t,e)}}});var z,ge=u(()=>{"use strict";st();z=class{_instrumentDescriptor;constructor(t){this._instrumentDescriptor=t}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(t){this._instrumentDescriptor=M(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:t,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var fe,p,nt=u(()=>{"use strict";S();fe=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 r=this._hash(t);if(this._valueMap.has(r))return this._valueMap.get(r);let s=e();return this._keyMap.has(r)||this._keyMap.set(r,t),this._valueMap.set(r,s),s}set(t,e,r){r??=this._hash(t),this._keyMap.has(r)||this._keyMap.set(r,t),this._valueMap.set(r,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}},p=class extends fe{constructor(){super(lt)}}});var H,xe=u(()=>{"use strict";R();S();nt();H=class{_activeCollectionStorage=new p;_cumulativeMemoStorage=new p;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(t,e){this._aggregator=t,this._cardinalityLimit=(e??2e3)-1,this._overflowHashCode=lt(this._overflowAttributes)}record(t,e,r){let s=this._activeCollectionStorage.get(e);if(!s){let n=L(r);if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(n))?.record(t);return}s=this._aggregator.createAccumulation(n),this._activeCollectionStorage.set(e,s)}s?.record(t)}batchCumulate(t,e){for(let[r,s,n]of t.entries()){let a=r,o=n,l=this._aggregator.createAccumulation(e);l?.record(s);let c=l;if(this._cumulativeMemoStorage.has(a,o)){let _=this._cumulativeMemoStorage.get(a,o);c=this._aggregator.diff(_,l)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(a=this._overflowAttributes,o=this._overflowHashCode,this._cumulativeMemoStorage.has(a,o))){let _=this._cumulativeMemoStorage.get(a,o);c=this._aggregator.diff(_,l)}if(this._activeCollectionStorage.has(a,o)){let _=this._activeCollectionStorage.get(a,o);c=this._aggregator.merge(_,c)}this._cumulativeMemoStorage.set(a,l,o),this._activeCollectionStorage.set(a,c,o)}}collect(){let t=this._activeCollectionStorage;return this._activeCollectionStorage=new p,t}}});function Xr(i){return Array.from(i.entries())}var X,Se=u(()=>{"use strict";ut();nt();X=class i{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(t,e){this._aggregator=t,e.forEach(r=>{this._unreportedAccumulations.set(r,[])})}buildMetrics(t,e,r,s){this._stashAccumulations(r);let n=this._getMergedUnreportedAccumulations(t),a=n,o;if(this._reportHistory.has(t)){let c=this._reportHistory.get(t),_=c.collectionTime;o=c.aggregationTemporality,o===y.CUMULATIVE?a=i.merge(c.accumulations,n,this._aggregator):a=i.calibrateStartTime(c.accumulations,n,_)}else o=t.selectAggregationTemporality(e.type);this._reportHistory.set(t,{accumulations:a,collectionTime:s,aggregationTemporality:o});let l=Xr(a);if(l.length!==0)return this._aggregator.toMetricData(e,o,l,s)}_stashAccumulations(t){let e=this._unreportedAccumulations.keys();for(let r of e){let s=this._unreportedAccumulations.get(r);s===void 0&&(s=[],this._unreportedAccumulations.set(r,s)),s.push(t)}}_getMergedUnreportedAccumulations(t){let e=new p,r=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),r===void 0)return e;for(let s of r)e=i.merge(e,s,this._aggregator);return e}static merge(t,e,r){let s=t,n=e.entries(),a=n.next();for(;a.done!==!0;){let[o,l,c]=a.value;if(t.has(o,c)){let _=t.get(o,c),O=r.merge(_,l);s.set(o,O,c)}else s.set(o,l,c);a=n.next()}return s}static calibrateStartTime(t,e,r){for(let[s,n]of t.keys())e.get(s,n)?.setStartTime(r);return e}}});var Pt,fr=u(()=>{"use strict";ge();xe();Se();nt();Pt=class extends z{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(t,e,r,s,n){super(t),this._aggregationCardinalityLimit=n,this._deltaMetricStorage=new H(e,this._aggregationCardinalityLimit),this._temporalMetricStorage=new X(e,s),this._attributesProcessor=r}record(t,e){if(this._attributesProcessor===void 0){this._deltaMetricStorage.batchCumulate(t,e);return}let r=new p;for(let[s,n]of t.entries())r.set(this._attributesProcessor.process(s),n);this._deltaMetricStorage.batchCumulate(r,e)}collect(t,e){let r=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,r,e)}}});function Te(i,t){let e="";return i.unit!==t.unit&&(e+=` - Unit '${i.unit}' does not match '${t.unit}'
5
+ `),i.type!==t.type&&(e+=` - Type '${i.type}' does not match '${t.type}'
6
+ `),i.valueType!==t.valueType&&(e+=` - Value Type '${i.valueType}' does not match '${t.valueType}'
7
+ `),i.description!==t.description&&(e+=` - Description '${i.description}' does not match '${t.description}'
8
+ `),e}function Wr(i,t){return` - use valueType '${i.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function Yr(i,t){return` - use unit '${i.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function qr(i,t){let e={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(e);return` - create a new view with a name other than '${i.name}' and InstrumentSelector '${r}'`}function jr(i,t){let e={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(e);return` - create a new view with a name other than '${i.name}' and InstrumentSelector '${r}'
9
+ - OR - create a new view with the name ${i.name} and description '${i.description}' and InstrumentSelector ${r}
10
+ - OR - create a new view with the name ${t.name} and description '${i.description}' and InstrumentSelector ${r}`}function Me(i,t){return i.valueType!==t.valueType?Wr(i,t):i.unit!==t.unit?Yr(i,t):i.type!==t.type?qr(i,t):i.description!==t.description?jr(i,t):""}var xr=u(()=>{"use strict"});var Lt,Sr=u(()=>{"use strict";st();g();xr();Lt=class i{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new i}getStorages(t){let e=[];for(let s of this._sharedRegistry.values())e=e.concat(s);let r=this._perCollectorRegistry.get(t);if(r!=null)for(let s of r.values())e=e.concat(s);return e}register(t){this._registerStorage(t,this._sharedRegistry)}registerForCollector(t,e){let r=this._perCollectorRegistry.get(t);r==null&&(r=new Map,this._perCollectorRegistry.set(t,r)),this._registerStorage(e,r)}findOrUpdateCompatibleStorage(t){let e=this._sharedRegistry.get(t.name);return e===void 0?null:this._findOrUpdateCompatibleStorage(t,e)}findOrUpdateCompatibleCollectorStorage(t,e){let r=this._perCollectorRegistry.get(t);if(r===void 0)return null;let s=r.get(e.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(e,s)}_registerStorage(t,e){let r=t.getInstrumentDescriptor(),s=e.get(r.name);if(s===void 0){e.set(r.name,[t]);return}s.push(t)}_findOrUpdateCompatibleStorage(t,e){let r=null;for(let s of e){let n=s.getInstrumentDescriptor();pr(n,t)?(n.description!==t.description&&(t.description.length>n.description.length&&s.updateDescription(t.description),m.warn("A view or instrument with the name ",t.name,` has already been registered, but has a different description and is incompatible with another registered view.
11
+ `,`Details:
12
+ `,Te(n,t),`The longer description will be used.
13
+ To resolve the conflict:`,Me(n,t))),r=s):m.warn("A view or instrument with the name ",t.name,` has already been registered and is incompatible with another registered view.
14
+ `,`Details:
15
+ `,Te(n,t),`To resolve the conflict:
16
+ `,Me(n,t))}return r}}});var Ut,Tr=u(()=>{"use strict";g();Ut=class{_backingStorages;hasAttributeProcessor;constructor(t){this._backingStorages=t,this.hasAttributeProcessor=t.some(e=>e.hasAttributeProcessor)}record(t,e,r,s){this.hasAttributeProcessor&&r===void 0&&(r=ct.active());let n=this._backingStorages;for(let a=0;a<n.length;a++)n[a].record(t,e,r,s)}}});var Bt,Gt,Mr=u(()=>{"use strict";g();nt();Rt();Bt=class{_buffer=new p;_instrumentName;_valueType;constructor(t,e){this._instrumentName=t,this._valueType=e}observe(t,e={}){if(typeof t!="number"){m.warn(`non-number value provided to metric ${this._instrumentName}: ${t}`);return}this._valueType===C.INT&&!Number.isInteger(t)&&(m.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._buffer.set(e,t)}},Gt=class{_buffer=new Map;observe(t,e,r={}){if(!ot(t))return;let s=this._buffer.get(t);if(s==null&&(s=new p,this._buffer.set(t,s)),typeof e!="number"){m.warn(`non-number value provided to metric ${t._descriptor.name}: ${e}`);return}t._descriptor.valueType===C.INT&&!Number.isInteger(e)&&(m.warn(`INT value type cannot accept a floating-point value for ${t._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||s.set(r,e)}}});var kt,Er=u(()=>{"use strict";g();Rt();Mr();S();kt=class{_callbacks=[];_batchCallbacks=[];addCallback(t,e){this._findCallback(t,e)>=0||this._callbacks.push({callback:t,instrument:e})}removeCallback(t,e){let r=this._findCallback(t,e);r<0||this._callbacks.splice(r,1)}addBatchCallback(t,e){let r=new Set(e.filter(ot));if(r.size===0){m.error("BatchObservableCallback is not associated with valid instruments",e);return}this._findBatchCallback(t,r)>=0||this._batchCallbacks.push({callback:t,instruments:r})}removeBatchCallback(t,e){let r=new Set(e.filter(ot)),s=this._findBatchCallback(t,r);s<0||this._batchCallbacks.splice(s,1)}async observe(t,e){let r=this._observeCallbacks(t,e),s=this._observeBatchCallbacks(t,e);return(await Promise.allSettled([...r,...s])).filter(o=>o.status==="rejected").map(o=>o.reason)}_observeCallbacks(t,e){return this._callbacks.map(async({callback:r,instrument:s})=>{let n=new Bt(s._descriptor.name,s._descriptor.valueType),a=Promise.resolve(r(n));e!=null&&(a=A(a,e)),await a,s._metricStorages.forEach(o=>{o.record(n._buffer,t)})})}_observeBatchCallbacks(t,e){return this._batchCallbacks.map(async({callback:r,instruments:s})=>{let n=new Gt,a=Promise.resolve(r(n));e!=null&&(a=A(a,e)),await a,s.forEach(o=>{let l=n._buffer.get(o);l!=null&&o._metricStorages.forEach(c=>{c.record(l,t)})})})}_findCallback(t,e){return this._callbacks.findIndex(r=>r.callback===t&&r.instrument===e)}_findBatchCallback(t,e){return this._batchCallbacks.findIndex(r=>r.callback===t&&ve(r.instruments,e))}}});var Vt,wr=u(()=>{"use strict";g();ge();xe();Se();Vt=class extends z{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(t,e,r,s,n){super(t),this._aggregationCardinalityLimit=n,this._deltaMetricStorage=new H(e,this._aggregationCardinalityLimit),this._temporalMetricStorage=new X(e,s),this._attributesProcessor=r,this.hasAttributeProcessor=r!==void 0}hasAttributeProcessor;record(t,e,r,s){this._attributesProcessor!==void 0&&(e=this._attributesProcessor.process(e,r??ct.active())),this._deltaMetricStorage.record(t,e,s)}collect(t,e){let r=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,r,e)}}});var Ft,Ar=u(()=>{"use strict";st();gr();fr();Sr();Tr();Er();wr();Ft=class{metricStorageRegistry=new Lt;observableRegistry=new kt;meter;_meterProviderSharedState;_instrumentationScope;constructor(t,e){this.meter=new vt(this),this._meterProviderSharedState=t,this._instrumentationScope=e}registerMetricStorage(t){let e=this._registerMetricStorage(t,Vt);return e.length===1?e[0]:new Ut(e)}registerAsyncMetricStorage(t){return this._registerMetricStorage(t,Pt)}async collect(t,e,r){let s=await this.observableRegistry.observe(e,r?.timeoutMillis),n=this.metricStorageRegistry.getStorages(t);if(n.length===0)return null;let a=[];return n.forEach(o=>{let l=o.collect(t,e);l!=null&&a.push(l)}),a.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:a},errors:s}}_registerMetricStorage(t,e){let s=this._meterProviderSharedState.viewRegistry.findViews(t,this._instrumentationScope).map(n=>{let a=dr(n,t),o=this.metricStorageRegistry.findOrUpdateCompatibleStorage(a);if(o!=null)return o;let l=n.aggregation.createAggregator(a),c=new e(a,l,n.attributesProcessor,this._meterProviderSharedState.metricCollectors,n.aggregationCardinalityLimit);return this.metricStorageRegistry.register(c),c});if(s.length===0){let a=this._meterProviderSharedState.selectAggregations(t.type).map(([o,l])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(o,t);if(c!=null)return c;let _=l.createAggregator(t),O=o.selectCardinalityLimit(t.type),P=new e(t,_,void 0,[o],O);return this.metricStorageRegistry.registerForCollector(o,P),P});s=s.concat(a)}return s}}});var Dt,yr=u(()=>{"use strict";S();_r();Ar();rt();Dt=class{viewRegistry=new wt;metricCollectors=[];meterSharedStates=new Map;resource;constructor(t){this.resource=t}getMeterSharedState(t){let e=Re(t),r=this.meterSharedStates.get(e);return r==null&&(r=new Ft(this,t),this.meterSharedStates.set(e,r)),r}selectAggregations(t){let e=[];for(let r of this.metricCollectors)e.push([r,xt(r.selectAggregation(t))]);return e}}});var $t,br=u(()=>{"use strict";R();$t=class{_sharedState;_metricReader;constructor(t,e){this._sharedState=t,this._metricReader=e}async collect(t){let e=L(Date.now()),r=[],s=[],n=Array.from(this._sharedState.meterSharedStates.values()).map(async a=>{let o=await a.collect(this,e,t);o?.scopeMetrics!=null&&r.push(o.scopeMetrics),o?.errors!=null&&s.push(...o.errors)});return await Promise.all(n),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:r},errors:s}}async forceFlush(t){await this._metricReader.forceFlush(t)}async shutdown(t){await this._metricReader.shutdown(t)}selectAggregationTemporality(t){return this._metricReader.selectAggregationTemporality(t)}selectAggregation(t){return this._metricReader.selectAggregation(t)}selectCardinalityLimit(t){return this._metricReader.selectCardinalityLimit?.(t)??2e3}}});var Kr,W,I,zt=u(()=>{"use strict";Kr=/[\^$\\.+?()[\]{}|]/g,W=class i{_matchAll;_regexp;constructor(t){t==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(i.escapePattern(t)))}match(t){return this._matchAll?!0:this._regexp.test(t)}static escapePattern(t){return`^${t.replace(Kr,"\\$&").replace("*",".*")}$`}static hasWildcard(t){return t.includes("*")}},I=class{_matchAll;_pattern;constructor(t){this._matchAll=t===void 0,this._pattern=t}match(t){return!!(this._matchAll||t===this._pattern)}}});function Nr(){return Jr}function Ir(i){return new we(i)}function Or(i){return new Ae(i)}function Cr(i){return new ye(i)}var Ee,we,Ae,ye,Jr,be=u(()=>{"use strict";Ee=class{process(t,e){return t}},we=class{_processors;constructor(t){this._processors=t}process(t,e){let r=t;for(let s of this._processors)r=s.process(r,e);return r}},Ae=class{_allowedAttributeNames;constructor(t){this._allowedAttributeNames=new Set(t)}process(t,e){let r={};for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&this._allowedAttributeNames.has(s)&&(r[s]=t[s]);return r}},ye=class{_deniedAttributeNames;constructor(t){this._deniedAttributeNames=new Set(t)}process(t,e){let r={};for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&!this._deniedAttributeNames.has(s)&&(r[s]=t[s]);return r}};Jr=new Ee});var Ht,Rr=u(()=>{"use strict";zt();Ht=class{_nameFilter;_type;_unitFilter;constructor(t){this._nameFilter=new W(t?.name??"*"),this._type=t?.type,this._unitFilter=new I(t?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Xt,vr=u(()=>{"use strict";zt();Xt=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(t){this._nameFilter=new I(t?.name),this._versionFilter=new I(t?.version),this._schemaUrlFilter=new I(t?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function Zr(i){return i.instrumentName==null&&i.instrumentType==null&&i.instrumentUnit==null&&i.meterName==null&&i.meterVersion==null&&i.meterSchemaUrl==null}function Qr(i){if(Zr(i))throw new Error("Cannot create view with no selector arguments supplied");if(i.name!=null&&(i?.instrumentName==null||W.hasWildcard(i.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.")}var Wt,Pr=u(()=>{"use strict";zt();be();Rr();vr();rt();Wt=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(t){Qr(t),t.attributesProcessors!=null?this.attributesProcessor=Ir(t.attributesProcessors):this.attributesProcessor=Nr(),this.name=t.name,this.description=t.description,this.aggregation=xt(t.aggregation??{type:d.DEFAULT}),this.instrumentSelector=new Ht({name:t.instrumentName,type:t.instrumentType,unit:t.instrumentUnit}),this.meterSelector=new Xt({name:t.meterName,version:t.meterVersion,schemaUrl:t.meterSchemaUrl}),this.aggregationCardinalityLimit=t.aggregationCardinalityLimit}}});var Yt,Lr=u(()=>{"use strict";g();kr();Tt();yr();br();Pr();Yt=class{_sharedState;_shutdown=!1;constructor(t){if(this._sharedState=new Dt(t?.resource??Ce()),t?.views!=null&&t.views.length>0)for(let e of t.views)this._sharedState.viewRegistry.addView(new Wt(e));if(t?.readers!=null&&t.readers.length>0)for(let e of t.readers){let r=new $t(this._sharedState,e);e.setMetricProducer(r),this._sharedState.metricCollectors.push(r),t.sdkMetricsEnabled&&e instanceof N&&e._setSelfObsMeterProvider(this)}}getMeter(t,e="",r={}){return this._shutdown?(m.warn("A shutdown MeterProvider cannot provide a Meter"),at()):this._sharedState.getMeterSharedState({name:t,version:e,schemaUrl:r.schemaUrl}).meter}async shutdown(t){if(this._shutdown){m.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(e=>e.shutdown(t)))}async forceFlush(t){if(this._shutdown){m.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(e=>e.forceFlush(t)))}}});var qt,Ur=u(()=>{"use strict";R();qt=class{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(t){this._aggregationTemporality=t}export(t,e){if(this._shutdown){setTimeout(()=>e({code:w.FAILED}),0);return}this._metrics.push(t),setTimeout(()=>e({code:w.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 ti={};Gr(ti,{AggregationTemporality:()=>y,AggregationType:()=>d,ConsoleMetricExporter:()=>Et,DataPointType:()=>x,InMemoryMetricExporter:()=>qt,InstrumentType:()=>h,MeterProvider:()=>Yt,MetricReader:()=>N,PeriodicExportingMetricReader:()=>Mt,TimeoutError:()=>v,createAllowListAttributesProcessor:()=>Or,createDenyListAttributesProcessor:()=>Cr});var ei=u(()=>{"use strict";ut();E();Tt();hr();Ur();mr();Lr();rt();be();S()});export{y as a,h as b,x as c,d,Mt as e,Et as f,Yt as g,ti as h,ei as i};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __swiftyCreateRequire } from "node:module";
3
+ const require = __swiftyCreateRequire(import.meta.url);
4
+ import{a as M,c as L,i as oe}from"./chunk-FZORZF22.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-YKWIZE5D.js";import{e as Kt,f as B,p,u as h}from"./chunk-LC7ZWLIH.js";import{b as a,d as _t}from"./chunk-IZ7QOBSB.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};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __swiftyCreateRequire } from "node:module";
3
3
  const require = __swiftyCreateRequire(import.meta.url);
4
- import{a as i,d as s}from"./chunk-2EV72T5X.js";var a=10,p=2.5,E="advanced-tool-use-2025-11-20",f=new Set(["api.anthropic.com"]),d="SWIFTY_MCP_LOADING";function u(o){if(!o)return!0;try{return f.has(new URL(o).hostname.toLowerCase())}catch{return!1}}function l(o){return Math.floor(o/p)}function m(o,t,e,n=a){let r=(process.env[d]??"").trim().toLowerCase();if(r==="eager"||r==="native"||r==="dispatch")return r;if(e<=0)return"eager";let c=t*n/100;return l(e)<c?"eager":u(o)?"native":"dispatch"}function g(o){let t=0;for(let e of o.listTools())if(e.name.startsWith(i))try{t+=JSON.stringify(e.schema()).length}catch{t+=e.name.length+(e.description?.length??0)}return t}function T(o,t){o.mcpLoadingMode=t;let e=t==="eager";for(let n of o.listTools())s(n)&&typeof n.setDeferLoading=="function"&&n.setDeferLoading(!e);o.exposeToolSearch=!e,o.exposeMcpCall=t==="dispatch"}function M(o,t,e){let n=m(t,e,g(o));return T(o,n),n}export{E as a,T as b,M as c};
4
+ import{a as i,d as s}from"./chunk-325L2ILZ.js";var a=10,p=2.5,E="advanced-tool-use-2025-11-20",f=new Set(["api.anthropic.com"]),d="SWIFTY_MCP_LOADING";function u(o){if(!o)return!0;try{return f.has(new URL(o).hostname.toLowerCase())}catch{return!1}}function l(o){return Math.floor(o/p)}function m(o,t,e,n=a){let r=(process.env[d]??"").trim().toLowerCase();if(r==="eager"||r==="native"||r==="dispatch")return r;if(e<=0)return"eager";let c=t*n/100;return l(e)<c?"eager":u(o)?"native":"dispatch"}function g(o){let t=0;for(let e of o.listTools())if(e.name.startsWith(i))try{t+=JSON.stringify(e.schema()).length}catch{t+=e.name.length+(e.description?.length??0)}return t}function T(o,t){o.mcpLoadingMode=t;let e=t==="eager";for(let n of o.listTools())s(n)&&typeof n.setDeferLoading=="function"&&n.setDeferLoading(!e);o.exposeToolSearch=!e,o.exposeMcpCall=t==="dispatch"}function M(o,t,e){let n=m(t,e,g(o));return T(o,n),n}export{E as a,T as b,M as c};