@inkeep/open-knowledge 0.50.0 → 0.50.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-CAyb1VG_.mjs → acp-harness-probe-C1dxc0Co.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-C2_LaQLC.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-xm3S7ePq.mjs → init-BeVVNDQP.mjs} +3 -3
- package/dist/init-CyDSE8iB.mjs +1 -0
- package/dist/{launch-json-removal-DRG4rr-O.mjs → launch-json-removal-gWJAk6yH.mjs} +2 -2
- package/dist/{loader-DDNYDIz4.mjs → loader-DMcXnCqV.mjs} +2 -2
- package/dist/loader-DxyNM2aa.mjs +1 -0
- package/dist/{open-browser-Bb773NFh.mjs → open-browser-CrLLxLMD.mjs} +2 -2
- package/dist/preview-BArm8TG7.mjs +1 -0
- package/dist/{preview-BJuJ4KQh.mjs → preview-BdSbm5uy.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-C3XczVNM.js → ActivityModeContent-B7PRYSdv.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-CCvn5wQ3.js → AgentDiffPane-BRJXsEB_.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-BTzPOikC.js → ChangedOutsideBadge-RgeTQl1o.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-CJOa9rBB.js → CodeMirrorPropInput-DNhnXG-N.js} +1 -1
- package/dist/public/assets/{DocumentContext-q72mQT_t.js → DocumentContext-LJdmX-5h.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-CYQ3YFwJ.js → EditorModeToggle-B2erMHVY.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-D3pGpgBV.js → EnableSyncConfirmDialog-D2KjWBxu.js} +1 -1
- package/dist/public/assets/FeedbackForm-Fs6D5fZY.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-CXQr-FGP.js → ImportSkillDialog-BV5i9wO_.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-DbAjr4jH.js → LintConfigEditor-DKIQMpUd.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-B4gUE4uy.js → ManagedArtifactProperties--sijzJ7a.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-2-HT1Uoc.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-BKY1PMJY.js → MermaidDocEditor-BtomXEEx.js} +1 -1
- package/dist/public/assets/ReportBugDialogBody-9QPpMvae.js +3 -0
- package/dist/public/assets/{SchemaConfigEditor-SePva8he.js → SchemaConfigEditor-DZdiWnMP.js} +1 -1
- package/dist/public/assets/{SessionsHost-gsjDemop.js → SessionsHost-CSy6Htd3.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-B0aiIMgi.js → SettingsDialogBody-D69UP6jY.js} +1 -1
- package/dist/public/assets/ShareBranchSwitchDialog-BbU20QHe.js +1 -0
- package/dist/public/assets/{ShareReceiveMissDialog-5admpSFE.js → ShareReceiveMissDialog-C1MQ-hX4.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-26O0onQs.js → SkillToolbarControls-nXU8I-ER.js} +1 -1
- package/dist/public/assets/{SourceEditor-DCC6j8cH.js → SourceEditor-iv3ORcCl.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CFcodtB9.js → TerminalWindowApp-C9c_zok4.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Ba292y2S.js → TextDocEditor-DQjn4m-U.js} +1 -1
- package/dist/public/assets/{ThreadView-Bxz-QRgZ.js → ThreadView-B7PdNlrS.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-FY54Yfye.js → TimelineDiffPane-CC31sk1a.js} +1 -1
- package/dist/public/assets/{agent-diff-store-DTrbnQbK.js → agent-diff-store-5SYhot9F.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CAQ4A-He.js → auth-state-cache-D41u34st.js} +1 -1
- package/dist/public/assets/{client-version-DZzYmEAI.js → client-version-B_vQj5m0.js} +1 -1
- package/dist/public/assets/{comment-chips-El0Mtul3.js → comment-chips-CEPkcvEy.js} +1 -1
- package/dist/public/assets/{config-provider-Cp4CY5__.js → config-provider-BWu19HJJ.js} +3 -3
- package/dist/public/assets/{follow-file-D8sBwhbX.js → follow-file-BIVb9Zh4.js} +1 -1
- package/dist/public/assets/i18n-DxntcKBM.js +1 -0
- package/dist/public/assets/{index-DYmWXWr6.js → index-CpEuzam0.js} +108 -108
- package/dist/public/assets/messages-Brn0orsj.js +1 -0
- package/dist/public/assets/messages-CTYJpn7y.js +1 -0
- package/dist/public/assets/messages-CdnsaE1O.js +1 -0
- package/dist/public/assets/messages-ClJuIcl3.js +1 -0
- package/dist/public/assets/messages-DZD8RInV.js +1 -0
- package/dist/public/assets/messages-DhTfyFQk.js +1 -0
- package/dist/public/assets/messages-OyMVuk7i.js +1 -0
- package/dist/public/assets/messages-RkDsy14V.js +1 -0
- package/dist/public/assets/messages-ayDZQ2cT.js +1 -0
- package/dist/public/assets/messages-dI0Gvvan.js +1 -0
- package/dist/public/assets/messages-zl567WX5.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-CitdQa34.js → pending-receive-nav-store-CE1BKmDl.js} +1 -1
- package/dist/public/assets/{selection-context-tW7mNL04.js → selection-context-VU06fkZJ.js} +1 -1
- package/dist/public/assets/{skill-actions-B-rAAmok.js → skill-actions-BaymiYHo.js} +1 -1
- package/dist/public/assets/{src-DJwM4wxS.js → src-CqXwuaNI.js} +1 -1
- package/dist/public/assets/{telemetry-impl-LPWb9DJh.js → telemetry-impl-Bbdtn9J6.js} +1 -1
- package/dist/public/assets/{telemetry-startup-B-jACYNe.js → telemetry-startup-CqGbFCKQ.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-i5YC5a51.js → typing-burst-detector-NGfWxmTo.js} +1 -1
- package/dist/public/assets/{uninstall-DTD665q0.js → uninstall-yp3xQTGT.js} +1 -1
- package/dist/public/assets/{use-activity-panel-B_OxshWx.js → use-activity-panel-cIIKwtm3.js} +1 -1
- package/dist/public/assets/{use-open-skill-BZcJfbB3.js → use-open-skill-BbWCa-6f.js} +1 -1
- package/dist/public/assets/{use-popular-skills-BI639F_L.js → use-popular-skills-BuZVrBYV.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-C1FCQb8g.js → use-terminal-enabled-B_reJguD.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-C5UrKke2.js → use-timeline-entry-diff-B3K5vpYj.js} +1 -1
- package/dist/public/index.html +21 -21
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-DQqY1ddo.mjs → repair-launch-json-Cl-ynzk1.mjs} +2 -2
- package/dist/{repair-mcp-configs-BlVWRe_X.mjs → repair-mcp-configs-DZDIjF8j.mjs} +2 -2
- package/dist/repair-skills-DbbV3jZk.mjs +1 -0
- package/dist/{repair-skills-C_mOgSqu.mjs → repair-skills-Dd0L2e5d.mjs} +2 -2
- package/dist/{skill-teardown-DT0sY6o-.mjs → skill-teardown-CdVs95OI.mjs} +2 -2
- package/dist/{src-YVZCV4Ux.mjs → src-CDh_XVa9.mjs} +1 -1
- package/dist/src-Ch-g-QTt.mjs +2033 -0
- package/dist/src-DSBq4rOK.mjs +1 -0
- package/dist/{src-DsnCRAh5.mjs → src-DvbZhU2A.mjs} +2 -2
- package/dist/start-24b2SeRf.mjs +1 -0
- package/dist/{start-DrycEKLh.mjs → start-B2X_84zH.mjs} +4 -4
- package/dist/ui-BoP6Qu3r.mjs +1 -0
- package/dist/{ui-BBDdhHyy.mjs → ui-Dss5LicQ.mjs} +3 -3
- package/dist/{write-project-skill-__SzqfoP.mjs → write-project-skill-DW0watij.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-B9zWb_fv.mjs +0 -2
- package/dist/init-UAHtpsrM.mjs +0 -1
- package/dist/loader-DGm-wuvO.mjs +0 -1
- package/dist/preview-_fm88K-5.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CPJzntj4.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-ga621KKB.js +0 -1
- package/dist/public/assets/ReportBugDialogBody-C3RLSmI4.js +0 -3
- package/dist/public/assets/ShareBranchSwitchDialog-BvB0M0F8.js +0 -1
- package/dist/public/assets/i18n-Bm86sjGW.js +0 -1
- package/dist/public/assets/messages-B12ABuMo.js +0 -1
- package/dist/public/assets/messages-BUufFcK8.js +0 -1
- package/dist/public/assets/messages-BV-Jgai1.js +0 -1
- package/dist/public/assets/messages-B_u6thtp.js +0 -1
- package/dist/public/assets/messages-CS-CWF8r.js +0 -1
- package/dist/public/assets/messages-CwQGRPEE.js +0 -1
- package/dist/public/assets/messages-Cwceyxby.js +0 -1
- package/dist/public/assets/messages-DGpodehZ.js +0 -1
- package/dist/public/assets/messages-DHl_AYzv.js +0 -1
- package/dist/public/assets/messages-DbRvxOAn.js +0 -1
- package/dist/public/assets/messages-DdKkPWw3.js +0 -1
- package/dist/repair-skills-qAm1agyb.mjs +0 -1
- package/dist/src-DJhexTh5.mjs +0 -2032
- package/dist/src-DKD0dtSw.mjs +0 -1
- package/dist/start-Y_cm7QYJ.mjs +0 -1
- package/dist/ui-BEwSKtfp.mjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-D_48KNDi.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,t as f,u as p}from"./trace-api-DH580DYm.js";import{n as m,r as ee,t as h}from"./propagation-api-DSg7UKuw.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(be||={});var _=p.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Se,e,p.instance())}getMeterProvider(){return i(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(Se,p.instance())}}.getInstance(),we=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function je(e){return new Ae(e.concurrencyLimit)}var Me=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},Ne=performance,Pe=`http.url`,Fe=`http.user_agent`,Ie=Pe,Le=Fe,Re=`deployment.environment.name`,ze=`error.type`,Be=`exception.message`,Ve=`exception.stacktrace`,He=`exception.type`,Ue=`http.request.method`,We=`http.request.method_original`,Ge=`http.response.status_code`,Ke=`server.address`,qe=`server.port`,Je=`service.name`,Ye=`service.version`,Xe=`telemetry.sdk.language`,Ze=`webjs`,Qe=`telemetry.sdk.name`,$e=`telemetry.sdk.version`,et=`url.full`,tt=9,nt=10**6,rt=10**tt;function v(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*nt)]}function it(){let e=Ne.timeOrigin;if(typeof e!=`number`){let t=Ne;e=t.timing&&t.timing.fetchStart}return e}function at(e){return st(v(it()),v(typeof e==`number`?e:Ne.now()))}function y(e){if(ot(e))return e;if(typeof e==`number`)return e<it()?at(e):v(e);if(e instanceof Date)return v(e.getTime());throw TypeError(`Invalid input type`)}function b(e){return e[0]*rt+e[1]}function ot(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function st(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=rt&&(n[1]-=rt,n[0]+=1),n}var x;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(x||={});function ct(e,t){return typeof t==`string`?e===t:!!e.match(t)}function lt(e,t){if(!t)return!1;for(let n of t)if(ct(e,n))return!0;return!1}function ut(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function dt(){return{handleResponse(e){e==null||!ut(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var ft=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:x.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:x.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:x.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:x.FAILED,error:e.error});return}else e.status===`retryable`?t({code:x.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:x.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:x.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function pt(e,t){return new ft(e.transport,e.serializer,dt(),e.promiseHandler,t.timeout)}function mt(e,t,n){return pt({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}function ht(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function gt(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=ht(e.charCodeAt(r)),a=ht(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function _t(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function vt(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function yt(e){return vt(_t(e))}function bt(e){return _t(e).toString()}var xt=typeof BigInt<`u`?bt:b;function St(e){return e}function Ct(e){if(e!==void 0)return gt(e)}var wt={encodeHrTime:yt,encodeSpanContext:gt,encodeOptionalSpanContext:Ct};function Tt(e){if(e===void 0)return wt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?yt:xt,encodeSpanContext:n?St:gt,encodeOptionalSpanContext:n?St:Ct}}function Et(e){let t={attributes:S(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Dt(e){return{name:e.name,version:e.version}}function S(e){return Object.keys(e).map(t=>Ot(t,e[t]))}function Ot(e,t){return{key:e,value:kt(t)}}function kt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(kt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Ot(e,t))}}:{}}function At(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:S(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Mt(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>jt(e,t)),droppedLinksCount:e.droppedLinksCount}}function jt(e,t){return{attributes:e.attributes?S(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Mt(e,t){return{attributes:e.attributes?S(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Nt(e,t){return{resourceSpans:Ft(e,Tt(t))}}function Pt(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Ft(e,t){let n=Pt(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>At(e,t));o.push({scope:Dt(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Et(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var It={serializeRequest:e=>{let t=Nt(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},Lt=5,Rt=1e3,zt=5e3,Bt=1.5,Vt=.2;function Ht(){return 2*Vt*Math.random()-Vt}var Ut=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Date.now()+t,r=await this._transport.send(e,t),i=Lt,a=Rt;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,zt)+Ht(),0);a*=Bt;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function Wt(e){return new Ut(e.transport)}function Gt(e){return[429,502,503,504].includes(e)}function Kt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var qt=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&Gt(r.status)?n({status:`retryable`,retryInMillis:Kt(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function Jt(e){return new qt(e)}var Yt=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function Xt(e){return new Yt(e)}var Zt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):Gt(i.status)?{status:`retryable`,retryInMillis:Kt(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function Qt(e){return new Zt(e)}function $t(e,t){return mt(e,t,Wt({transport:Jt(e)}))}function en(e,t){return mt(e,t,Wt({transport:Qt(e)}))}function tn(e,t){return mt(e,t,Wt({transport:Xt({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function nn(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function rn(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function an(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function on(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-D_48KNDi.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function sn(e,t,n){return{...Oe(e,t,n),headers:rn(nn(e.headers),t.headers,n.headers),url:an(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function cn(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:on({keepAlive:!0})}}function ln(e,t,n){return sn({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},cn(n,t))}function un(e,t,n,r){return dn(e.headers)(ln(e,n,r),t)}function dn(e){return!e&&typeof navigator.sendBeacon==`function`?tn:globalThis.fetch===void 0?$t:en}var fn=class extends we{constructor(e={}){super(un(e,It,`v1/traces`,{"Content-Type":`application/json`}))}},pn=class{emit(e){}},mn=new pn,hn=new class{getLogger(e,t,n){return new pn}},gn=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(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):mn}},_n=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new gn(this,e,t,n)}_getDelegate(){return this._delegate??hn}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},vn=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},C=Symbol.for(`io.opentelemetry.js.api.logs`),w=vn;function yn(e,t,n){return r=>r===e?t:n}var bn=class e{constructor(){this._proxyLoggerProvider=new _n}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return w[C]?this.getLoggerProvider():(w[C]=yn(1,e,hn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return w[C]?.call(w,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete w[C],this._proxyLoggerProvider=new _n}}.getInstance();function xn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Sn(e){e.forEach(e=>e.disable())}function Cn(e){let t=e.tracerProvider||f.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||bn.getLoggerProvider(),i=e.instrumentations?.flat()??[];return xn(i,t,n,r),()=>{Sn(i)}}var T=console.error.bind(console);function E(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var wn=(e,t,n)=>{if(!e||!e[t]){T(`no original function `+String(t)+` to wrap`);return}if(!n){T(`no wrapper function`),T(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){T(`original object and wrapper must be functions`);return}let i=n(r,t);return E(i,`__original`,r),E(i,`__unwrap`,()=>{e[t]===i&&E(e,t,r)}),E(i,`__wrapped`,!0),E(e,t,i),i},Tn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{wn(e,t,n)})})},En=(e,t)=>{if(!e||!e[t]){T(`no function to unwrap.`),T(Error().stack);return}let n=e[t];if(!n.__unwrap)T(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Dn=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{En(e,t)})})};function D(e){e&&e.logger&&(typeof e.logger==`function`?T=e.logger:T(`new logger isn't a function, not replacing`))}D.wrap=wn,D.massWrap=Tn,D.unwrap=En,D.massUnwrap=Dn;var On=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=f.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=bn.getLogger(e,t),this._updateMetricInstruments()}_wrap=wn;_unwrap=En;_massWrap=Tn;_massUnwrap=Dn;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},kn=class extends On{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function O(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function k(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var A;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(A||={});function An(e,t){let n=A.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=A.DUPLICATE;break}else t.toLowerCase()===e&&(n=A.STABLE);return n}var jn=s(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Mn(e){return e.setValue(jn,!0)}function Nn(e){return e.getValue(jn)===!0}var Pn=`baggage`,Fn=4096;function In(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ln(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Rn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=ee(e.substring(t+1))),{key:o,value:s,metadata:c}}function zn(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=Rn(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var Bn=class{inject(e,t,n){let r=h.getBaggage(e);if(!r||Nn(e))return;let i=In(Ln(r).filter(e=>e.length<=Fn).slice(0,180));i.length>0&&n.set(t,Pn,i)}extract(e,t,n){let r=n.get(t,Pn);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=zn(r[e],i,a,o);else [a]=zn(r,i,a,o);return a===0?e:h.setBaggage(e,h.createBaggage(i))}fields(){return[Pn]}};function j(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Vn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Hn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Vn(e){return typeof e==`string`&&e!==``}function Hn(e){return e==null?!0:Array.isArray(e)?Un(e):Wn(typeof e)}function Un(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Wn(e)){t=e;continue}return!1}return!1}}return!0}function Wn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Gn(){return e=>{_.error(Kn(e))}}function Kn(e){return typeof e==`string`?e:JSON.stringify(qn(e))}function qn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Jn=Gn();function M(e){try{Jn(e)}catch{}}var Yn=`2.9.0`,Xn=`process.runtime.name`,Zn={[Qe]:`opentelemetry`,[Xn]:`browser`,[Xe]:Ze,[$e]:Yn},N=performance,Qn=9,$n=10**6,er=10**Qn;function P(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*$n)]}function tr(e){return ar(P(N.timeOrigin),P(typeof e==`number`?e:N.now()))}function nr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=er),[n,r]}function rr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ir(e){return rr(e)||typeof e==`number`||e instanceof Date}function ar(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=er&&(n[1]-=er,n[0]+=1),n}var or;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(or||={});var sr=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},cr=`[_0-9a-z-*/]`,lr=`[a-z]${cr}{0,255}`,ur=`[a-z0-9]${cr}{0,240}@[a-z]${cr}{0,13}`,dr=RegExp(`^(?:${lr}|${ur})$`),fr=/^[ -~]{0,255}[!-~]$/,pr=/,|=/;function mr(e){return dr.test(e)}function hr(e){return fr.test(e)&&!pr.test(e)}var gr=32,_r=512,vr=`,`,yr=`=`,br=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!mr(e)||!hr(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>_r)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=vr+e),e=`${n[0]}${yr}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(vr),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(yr);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!mr(a)||!hr(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>_r)&&(t.set(a,o),n=s,t.size>=gr))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},F=`traceparent`,xr=`tracestate`,Sr=`00`,Cr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function wr(e){let t=Cr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Tr=class{inject(e,t,n){let r=f.getSpanContext(e);if(!r||Nn(e)||!d(r))return;let i=`${Sr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||l.NONE).toString(16)}`;n.set(t,F,i),r.traceState&&n.set(t,xr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,F);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=wr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,xr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new br(typeof e==`string`?e:void 0)}return f.setSpanContext(e,a)}fields(){return[F,xr]}},Er=`[object Object]`,Dr=`[object Null]`,Or=`[object Undefined]`,kr=Function.prototype.toString,Ar=kr.call(Object),jr=Object.getPrototypeOf,Mr=Object.prototype,Nr=Mr.hasOwnProperty,I=Symbol?Symbol.toStringTag:void 0,Pr=Mr.toString;function Fr(e){if(!Ir(e)||Lr(e)!==Er)return!1;let t=jr(e);if(t===null)return!0;let n=Nr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&kr.call(n)===Ar}function Ir(e){return typeof e==`object`&&!!e}function Lr(e){return e==null?e===void 0?Or:Dr:I&&I in Object(e)?Rr(e):zr(e)}function Rr(e){let t=Nr.call(e,I),n=e[I],r=!1;try{e[I]=void 0,r=!0}catch{}let i=Pr.call(e);return r&&(t?e[I]=n:delete e[I]),i}function zr(e){return Pr.call(e)}var Br=20;function Vr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Ur(t,e.shift(),0,n);return t}function Hr(e){return L(e)?e.slice():e}function Ur(e,t,n=0,r){let i;if(!(n>Br)){if(n++,z(e)||z(t)||Gr(t))i=Hr(t);else if(L(e)){if(i=e.slice(),L(t))for(let e=0,n=t.length;e<n;e++)i.push(Hr(t[e]));else if(R(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Hr(t[r]))}}}else if(R(e))if(R(t)){if(!Kr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(z(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Wr(e,s,r)||Wr(t,s,r))delete i[s];else{if(R(a)&&R(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Ur(i[s],c,n,r)}}}}else i=t;return i}}function Wr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function L(e){return Array.isArray(e)}function Gr(e){return typeof e==`function`}function R(e){return!z(e)&&!L(e)&&!Gr(e)&&typeof e==`object`}function z(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Kr(e,t){return!(!Fr(e)||!Fr(t))}var qr=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},Jr=class{_isCalled=!1;_deferred=new qr;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}},B;function Yr(){if(B===void 0)try{let e=globalThis.process.argv0;B=e?`unknown_service:${e}`:`unknown_service`}catch{B=`unknown_service`}return B}var V=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Xr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=$r(t),r._asyncAttributesPending=t.filter(([e,t])=>V(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(V(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=$r(this._rawAttributes),this._schemaUrl=ei(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,V(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(V(n)){_.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=ti(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Zr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Qr(){return Zr({[Je]:Yr(),[Xe]:Zn[Xe],[Qe]:Zn[Qe],[$e]:Zn[$e]})}function $r(e){return e.map(([e,t])=>V(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function ei(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function ti(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var ni=`exception`,ri=Symbol.for(`nodejs.util.inspect.custom`);function ii(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function ai(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var oi=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=N.now(),this._performanceOffset=t-(this._performanceStartTime+N.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return _.warn(`Invalid attribute key: ${e}`),this;if(!Hn(t))return _.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),ir(t)&&(ir(n)||(n=t),t=void 0);let i=j(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=j(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===c.UNSET||this.status.code===c.OK)return this;let t={code:e.code};return e.code===c.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){_.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=nr(this.startTime,this.endTime),this._duration[0]<0&&(_.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=N.now())return tr(e+this._performanceOffset);if(typeof e==`number`)return P(e);if(e instanceof Date)return P(e.getTime());if(rr(e))return e;if(this._startTimeProvided)return P(Date.now());let t=N.now()-this._performanceStartTime;return ar(this.startTime,P(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Be]=e:e&&(e.code?n[He]=e.code.toString():e.name&&(n[He]=e.name),e.message&&(n[Be]=e.message),e.stack&&(n[Ve]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(ni,n,t):_.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(_.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[ri](e,t,n){return ai(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this.resource)}},e,t,n)}},H;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(H||={});var si=`otel.component.name`,ci=`otel.component.type`,li=`otel.span.parent.origin`,ui=`otel.span.sampling_result`,di=`otel.sdk.processor.span.processed`,fi=`otel.sdk.processor.span.queue.capacity`,pi=`otel.sdk.processor.span.queue.size`,mi=`otel.sdk.span.live`,hi=`otel.sdk.span.started`,gi=`batching_span_processor`,_i=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(hi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(mi,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=yi(t);if(this.startedSpans.add(1,{[li]:vi(e),[ui]:n}),t===H.NOT_RECORD)return()=>{};let r={[ui]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function vi(e){return e?e.isRemote?`remote`:`local`:`none`}function yi(e){switch(e){case H.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case H.RECORD:return`RECORD_ONLY`;case H.NOT_RECORD:return`DROP`}}var bi=`2.9.0`,xi=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor,this._tracerMetrics=new _i(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,bi))}startSpan(e,t={},r=m.active()){t.root&&(r=f.deleteSpan(r));let i=f.getSpan(r);if(Nn(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),f.wrapSpanContext(n);let a=i?.spanContext(),o=this._idGenerator.generateSpanId(),s,c,u;!a||!f.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,s=a);let d=t.kind??be.INTERNAL,p=(t.links??[]).map(e=>({context:e.context,attributes:j(e.attributes)})),ee=j(t.attributes),h=this._sampler.shouldSample(r,c,e,d,ee,p),te=this._tracerMetrics.startSpan(a,h.decision);u=h.traceState??u;let g=h.decision===ye.RECORD_AND_SAMPLED?l.SAMPLED:l.NONE,ne={traceId:c,spanId:o,traceFlags:g,traceState:u};if(h.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),f.wrapSpanContext(ne);let re=j(Object.assign(ee,h.attributes));return new oi({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:p,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??m.active(),c=this.startSpan(e,i,s),l=f.setSpan(s,c);return m.with(l,o,void 0,c)}[ri](e,t,n){return ai(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this._resource)},spanLimits:this._spanLimits},e,t,n)}},Si=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{M(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},U=class{shouldSample(){return{decision:H.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},W=class{shouldSample(){return{decision:H.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},G=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(M(Error(`ParentBasedSampler must have a root sampler configured`)),new W),this._remoteParentSampled=e.remoteParentSampled??new W,this._remoteParentNotSampled=e.remoteParentNotSampled??new U,this._localParentSampled=e.localParentSampled??new W,this._localParentNotSampled=e.localParentNotSampled??new U}shouldSample(e,t,n,r,i,a){let o=f.getSpanContext(e);return!o||!d(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&l.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&l.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Ci=new Map,wi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=Ci.get(e)??0;if(Ci.set(e,r+1),this.standardAttrs={[ci]:e,[si]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[ze]:`queue_full`},this.processedSpans=t.createCounter(di,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(fi,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(pi,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[ze]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},Ti=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new Jr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize),this._metrics=new wi(gi,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):ve(),{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&l.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(_.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);m.with(Mn(m.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===or.SUCCESS?e():t(i.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{M(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,M(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Ei=class extends Ti{_visibilityChangeListener;_pageHideListener;constructor(e){super(e),this.onInit(e)}onInit(e){e.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{M(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{M(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Di=16,Oi=8,ki=new Uint8Array(Di),Ai=new Uint8Array(Oi),ji=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Mi(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ni(e){let t=``;for(let n=0;n<e.length;n++)t+=ji[e[n]];return t}var Pi=class{generateTraceId(){return Mi(ki),Ni(ki)}generateSpanId(){return Mi(Ai),Ni(Ai)}},K;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(K||={});var Fi=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Qr(),this._activeSpanProcessor=new Si(e.spanProcessors??[]),this._tracerOptions={resource:this._resource,sampler:e.sampler??new G({root:new W}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Pi,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return ve()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new xi({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(){let e=this._forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=K.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==K.timeout&&(r=K.resolved,n(r))}).catch(e=>{clearTimeout(i),r=K.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==K.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[ri](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return ai(`TracerProvider`,{resource:{attributes:ii(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Ii=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:o(t)&&this._accumulate(t)<this._upperBound?H.RECORD_AND_SAMPLED:H.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},q;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(q||={});var Li=1;function Ri(){return{sampler:zi(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function zi(){let e=q.ParentBasedAlwaysOn;switch(e){case q.AlwaysOn:return new W;case q.AlwaysOff:return new U;case q.ParentBasedAlwaysOn:return new G({root:new W});case q.ParentBasedAlwaysOff:return new G({root:new U});case q.TraceIdRatio:return new Ii(Bi());case q.ParentBasedTraceIdRatio:return new G({root:new Ii(Bi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${q.ParentBasedAlwaysOn}".`),new G({root:new W})}}function Bi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Li}.`),Li}function Vi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Hi=class extends Fi{constructor(e={}){let t=Vr({},Ri(),Vi(e));delete t.generalLimits,super(t)}},Ui=class extends Ei{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])t[e];super({exporter:e,...t})}},Wi=class{_enabled=!1;_currentContext=r;_bindFunction(e=r,t){let n=this,i=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(i,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=r,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=r,this)}with(e,t,n,...i){let a=this._currentContext;this._currentContext=e||r;try{return t.call(n,...i)}finally{this._currentContext=a}}};function Gi(e){if(e!==null){if(e===void 0){let e=new Wi;e.enable(),m.setGlobalContextManager(e);return}e.enable(),m.setGlobalContextManager(e)}}function Ki(e){if(e!==null){if(e===void 0){h.setGlobalPropagator(new sr({propagators:[new Tr,new Bn]}));return}h.setGlobalPropagator(e)}}var qi=class extends Hi{constructor(e={}){super(e)}register(e={}){f.setGlobalTracerProvider(this),Ki(e.propagator),Gi(e.contextManager)}},J;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(J||={});var Ji=`http.response_content_length`,Yi=`http.response_content_length_uncompressed`;function Y(e,t){return t in e}function X(e,t,n,r=!0){if(Y(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Xi(e,t,n=!1,r,i){if(r===void 0&&(r=t[J.START_TIME]!==0),n||(X(e,J.FETCH_START,t,r),X(e,J.DOMAIN_LOOKUP_START,t,r),X(e,J.DOMAIN_LOOKUP_END,t,r),X(e,J.CONNECT_START,t,r),X(e,J.SECURE_CONNECTION_START,t,r),X(e,J.CONNECT_END,t,r),X(e,J.REQUEST_START,t,r),X(e,J.RESPONSE_START,t,r),X(e,J.RESPONSE_END,t,r)),!i){let n=t[J.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ji,n);let r=t[J.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Yi,r)}}function Zi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=$i(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Zi(e.parentNode,t)),r+=n,r}function Qi(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function $i(e,t){let n=e.nodeType,r=Qi(e),i;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var ea;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(ea||={});var ta=`0.49.0`,na=`@opentelemetry/instrumentation-document-load`,ra;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(ra||={});var ia=()=>{let e={},t=N.getEntriesByType?.(`navigation`)[0];if(t)Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=N.timing;t&&Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},aa={"first-paint":ra.FIRST_PAINT,"first-contentful-paint":ra.FIRST_CONTENTFUL_PAINT},oa=e=>{let t=N.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{Y(aa,t)&&e.addEvent(aa[t],n)})},sa=class extends kn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(na,ta,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=N.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===F),t=ia(),n=e&&e.content||``;m.with(h.extract(r,{traceparent:n}),()=>{let e=this._startSpan(ea.DOCUMENT_LOAD,J.FETCH_START,t);e&&(m.with(f.setSpan(m.active(),e),()=>{let e=this._startSpan(ea.DOCUMENT_FETCH,J.FETCH_START,t);e&&(e.setAttribute(Ie,location.href),m.with(f.setSpan(m.active(),e),()=>{Xi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,J.RESPONSE_END,t)}))}),e.setAttribute(Ie,location.href),e.setAttribute(Le,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(X(e,J.FETCH_START,t),X(e,J.UNLOAD_EVENT_START,t),X(e,J.UNLOAD_EVENT_END,t),X(e,J.DOM_INTERACTIVE,t),X(e,J.DOM_CONTENT_LOADED_EVENT_START,t),X(e,J.DOM_CONTENT_LOADED_EVENT_END,t),X(e,J.DOM_COMPLETE,t),X(e,J.LOAD_EVENT_START,t),X(e,J.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||oa(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,J.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Y(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(ea.RESOURCE_FETCH,J.FETCH_START,e,t);n&&(n.setAttribute(Ie,e.name),Xi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,J.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Y(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?f.setSpan(m.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&O(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&O(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var ca=`http.response_content_length`,la=`http.response_content_length_uncompressed`,ua;function da(){return ua||=document.createElement(`a`),ua}function fa(e,t){return t in e}function Q(e,t,n,r=!0){if(fa(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function pa(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(ca,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(la,r)}}function ma(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function ha(){return typeof location<`u`?location.origin:void 0}function ga(e,t,n,r,i=new WeakSet,a){let o=ya(e);e=o.toString();let s=va(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=ma(s);if(o.origin!==ha()&&c.length>1){let e=c[0],t=_a(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function _a(e,t,n){let r=b(n),i=b(y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=b(y(n[Z.FETCH_START])),c=r-b(y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function va(e,t,n,r,i,a){let o=b(t),s=b(n),c=r.filter(t=>{let n=b(y(t[Z.FETCH_START])),r=b(y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function ya(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=da();return t.href=e,t}function ba(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),ya(e).origin===ha()?!0:n.some(t=>ct(e,t))}var xa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(xa||={});var Sa=`http.host`,Ca=`http.method`,wa=`http.request.body.size`,Ta=`http.request_content_length_uncompressed`,Ea=`http.scheme`,Da=`http.status_code`,Oa=`http.url`,ka=`http.user_agent`,Aa=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function ja(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Ma(t.body);return t.body=e,n}else return Promise.resolve(Pa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ia(e)):Promise.resolve()}}function Ma(e){if(!e.pipeThrough)return Aa.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Na(e){return typeof Document<`u`&&e instanceof Document}function Pa(e){if(Na(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ia(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return La(e);if(e instanceof URLSearchParams)return Ia(e.toString());if(e.byteLength!==void 0)return e.byteLength;Aa.warn(`unknown body type`)}var Fa=new TextEncoder;function Ia(e){return Fa.encode(e).byteLength}function La(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Ra(e){let t=Va(),n=e.toUpperCase();return n in t?n:`_OTHER`}var za={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ba;function Va(){return Ba===void 0&&(Ba=za),Ba}var Ha={"https:":`443`,"http:":`80`};function Ua(e){let t=Number(e.port||Ha[e.protocol]);if(t&&!isNaN(t))return t}var Wa=`0.204.0`,Ga=300,Ka=typeof process==`object`&&process.release?.name===`node`,qa=class extends kn{component=`fetch`;version=Wa;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Wa,e),this._semconvStability=An(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},f.setSpan(m.active(),e)),r=!(this._semconvStability&A.OLD);pa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=ya(t.url);if(this._semconvStability&A.OLD&&(e.setAttribute(Da,t.status),t.statusText!=null&&e.setAttribute(xa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(Sa,n.host),e.setAttribute(Ea,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(ka,navigator.userAgent)),this._semconvStability&A.STABLE){e.setAttribute(Ge,t.status),e.setAttribute(Ke,n.hostname);let r=Ua(n);r&&e.setAttribute(qe,r)}}_addHeaders(e,t){if(!ba(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};h.inject(m.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};h.inject(m.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(lt(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&A.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[xa.COMPONENT]=this.moduleName,r[Ca]=i,r[Oa]=e}if(this._semconvStability&A.STABLE){let i=t.method,a=Ra(t.method||`GET`);n||=a,r[Ue]=a,a!==i&&(r[We]=i),r[et]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ga(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&A.OLD);pa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=v(Date.now()),i=at();this._addFinalSpanAttributes(e,n),this._semconvStability&A.STABLE&&n.status>=400&&(e.setStatus({code:c.ERROR}),e.setAttribute(ze,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Ga)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=ya(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&ja(...n).then(e=>{e&&(t._semconvStability&A.OLD&&o.setAttribute(Ta,e),t._semconvStability&A.STABLE&&o.setAttribute(wa,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}finally{t(n)}}function d(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>m.with(f.setSpan(m.active(),o),()=>(t._addHeaders(a,i),t._callRequestHook(o,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o,n),d.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&O(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&O(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=at(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(Ka){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}k(fetch)&&(this._unwrap(Me,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Me,`fetch`,this._patchConstructor())}disable(){Ka||(this._unwrap(Me,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var Ja=`0.49.0`,Ya=`@opentelemetry/instrumentation-user-interaction`,Xa=`OT_ZONE_CONTEXT`,Za=`Navigation:`,Qa=[`click`];function $a(){return!1}var eo=class extends kn{version=Ja;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(Ya,Ja,e),this._eventNames=new Set(e?.eventNames??Qa),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:$a}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=tr():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Zi(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:r,[$.HTTP_URL]:window.location.href}},n?f.setSpan(m.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Xa);return t&&f.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,o=function(...t){let i,o=t[0],s=o?.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),m.with(f.setSpan(m.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){k(history.replaceState)&&this._unwrap(history,`replaceState`),k(history.pushState)&&this._unwrap(history,`pushState`),k(history.back)&&this._unwrap(history,`back`),k(history.forward)&&this._unwrap(history,`forward`),k(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=f.getSpan(m.active());t&&typeof t.updateName==`function`&&t.updateName(`${Za} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,o,s=this;if(a){if(o=e._createSpan(a,n.eventName),o)return e._incrementTask(o),s.run(()=>{try{return m.with(f.setSpan(m.active(),o),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(o)}})}else o=e._getCurrentSpan(s);try{return t.call(s,n,r,i)}finally{o&&e._shouldCountTask(n,s)&&e._decrementTask(o)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(k(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),k(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),k(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),k(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(k(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),k(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),k(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&this._unwrap(e,`addEventListener`),k(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},to=`open-knowledge-app`,no=!1;function ro(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.49.2`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function io(){if(no)return;no=!0;let e=null,t=!1;try{let n=ro(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.49.2`};e=new qi({resource:Zr({[Je]:`open-knowledge-app`,[Ye]:r?.VITE_APP_VERSION??`dev`,[Re]:r?.MODE??`dev`}),spanProcessors:[new Ui(new fn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Cn({instrumentations:[new sa,new eo({eventNames:[`click`,`submit`]}),new qa({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),no=!1}}function ao(){return f.getTracer(to)}export{ao as getAppTracer,io as install};
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,t as f,u as p}from"./trace-api-DH580DYm.js";import{n as m,r as ee,t as h}from"./propagation-api-DSg7UKuw.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(be||={});var _=p.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Se,e,p.instance())}getMeterProvider(){return i(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(Se,p.instance())}}.getInstance(),we=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function je(e){return new Ae(e.concurrencyLimit)}var Me=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},Ne=performance,Pe=`http.url`,Fe=`http.user_agent`,Ie=Pe,Le=Fe,Re=`deployment.environment.name`,ze=`error.type`,Be=`exception.message`,Ve=`exception.stacktrace`,He=`exception.type`,Ue=`http.request.method`,We=`http.request.method_original`,Ge=`http.response.status_code`,Ke=`server.address`,qe=`server.port`,Je=`service.name`,Ye=`service.version`,Xe=`telemetry.sdk.language`,Ze=`webjs`,Qe=`telemetry.sdk.name`,$e=`telemetry.sdk.version`,et=`url.full`,tt=9,nt=10**6,rt=10**tt;function v(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*nt)]}function it(){let e=Ne.timeOrigin;if(typeof e!=`number`){let t=Ne;e=t.timing&&t.timing.fetchStart}return e}function at(e){return st(v(it()),v(typeof e==`number`?e:Ne.now()))}function y(e){if(ot(e))return e;if(typeof e==`number`)return e<it()?at(e):v(e);if(e instanceof Date)return v(e.getTime());throw TypeError(`Invalid input type`)}function b(e){return e[0]*rt+e[1]}function ot(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function st(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=rt&&(n[1]-=rt,n[0]+=1),n}var x;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(x||={});function ct(e,t){return typeof t==`string`?e===t:!!e.match(t)}function lt(e,t){if(!t)return!1;for(let n of t)if(ct(e,n))return!0;return!1}function ut(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function dt(){return{handleResponse(e){e==null||!ut(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var ft=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:x.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:x.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:x.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:x.FAILED,error:e.error});return}else e.status===`retryable`?t({code:x.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:x.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:x.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function pt(e,t){return new ft(e.transport,e.serializer,dt(),e.promiseHandler,t.timeout)}function mt(e,t,n){return pt({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}function ht(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function gt(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=ht(e.charCodeAt(r)),a=ht(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function _t(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function vt(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function yt(e){return vt(_t(e))}function bt(e){return _t(e).toString()}var xt=typeof BigInt<`u`?bt:b;function St(e){return e}function Ct(e){if(e!==void 0)return gt(e)}var wt={encodeHrTime:yt,encodeSpanContext:gt,encodeOptionalSpanContext:Ct};function Tt(e){if(e===void 0)return wt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?yt:xt,encodeSpanContext:n?St:gt,encodeOptionalSpanContext:n?St:Ct}}function Et(e){let t={attributes:S(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Dt(e){return{name:e.name,version:e.version}}function S(e){return Object.keys(e).map(t=>Ot(t,e[t]))}function Ot(e,t){return{key:e,value:kt(t)}}function kt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(kt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Ot(e,t))}}:{}}function At(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:S(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Mt(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>jt(e,t)),droppedLinksCount:e.droppedLinksCount}}function jt(e,t){return{attributes:e.attributes?S(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Mt(e,t){return{attributes:e.attributes?S(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Nt(e,t){return{resourceSpans:Ft(e,Tt(t))}}function Pt(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Ft(e,t){let n=Pt(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>At(e,t));o.push({scope:Dt(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Et(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var It={serializeRequest:e=>{let t=Nt(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},Lt=5,Rt=1e3,zt=5e3,Bt=1.5,Vt=.2;function Ht(){return 2*Vt*Math.random()-Vt}var Ut=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Date.now()+t,r=await this._transport.send(e,t),i=Lt,a=Rt;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,zt)+Ht(),0);a*=Bt;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function Wt(e){return new Ut(e.transport)}function Gt(e){return[429,502,503,504].includes(e)}function Kt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var qt=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&Gt(r.status)?n({status:`retryable`,retryInMillis:Kt(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function Jt(e){return new qt(e)}var Yt=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function Xt(e){return new Yt(e)}var Zt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):Gt(i.status)?{status:`retryable`,retryInMillis:Kt(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function Qt(e){return new Zt(e)}function $t(e,t){return mt(e,t,Wt({transport:Jt(e)}))}function en(e,t){return mt(e,t,Wt({transport:Qt(e)}))}function tn(e,t){return mt(e,t,Wt({transport:Xt({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function nn(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function rn(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function an(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function on(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-D_48KNDi.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function sn(e,t,n){return{...Oe(e,t,n),headers:rn(nn(e.headers),t.headers,n.headers),url:an(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function cn(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:on({keepAlive:!0})}}function ln(e,t,n){return sn({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},cn(n,t))}function un(e,t,n,r){return dn(e.headers)(ln(e,n,r),t)}function dn(e){return!e&&typeof navigator.sendBeacon==`function`?tn:globalThis.fetch===void 0?$t:en}var fn=class extends we{constructor(e={}){super(un(e,It,`v1/traces`,{"Content-Type":`application/json`}))}},pn=class{emit(e){}},mn=new pn,hn=new class{getLogger(e,t,n){return new pn}},gn=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(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):mn}},_n=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new gn(this,e,t,n)}_getDelegate(){return this._delegate??hn}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},vn=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},C=Symbol.for(`io.opentelemetry.js.api.logs`),w=vn;function yn(e,t,n){return r=>r===e?t:n}var bn=class e{constructor(){this._proxyLoggerProvider=new _n}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return w[C]?this.getLoggerProvider():(w[C]=yn(1,e,hn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return w[C]?.call(w,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete w[C],this._proxyLoggerProvider=new _n}}.getInstance();function xn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Sn(e){e.forEach(e=>e.disable())}function Cn(e){let t=e.tracerProvider||f.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||bn.getLoggerProvider(),i=e.instrumentations?.flat()??[];return xn(i,t,n,r),()=>{Sn(i)}}var T=console.error.bind(console);function E(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var wn=(e,t,n)=>{if(!e||!e[t]){T(`no original function `+String(t)+` to wrap`);return}if(!n){T(`no wrapper function`),T(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){T(`original object and wrapper must be functions`);return}let i=n(r,t);return E(i,`__original`,r),E(i,`__unwrap`,()=>{e[t]===i&&E(e,t,r)}),E(i,`__wrapped`,!0),E(e,t,i),i},Tn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{wn(e,t,n)})})},En=(e,t)=>{if(!e||!e[t]){T(`no function to unwrap.`),T(Error().stack);return}let n=e[t];if(!n.__unwrap)T(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Dn=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{En(e,t)})})};function D(e){e&&e.logger&&(typeof e.logger==`function`?T=e.logger:T(`new logger isn't a function, not replacing`))}D.wrap=wn,D.massWrap=Tn,D.unwrap=En,D.massUnwrap=Dn;var On=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=f.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=bn.getLogger(e,t),this._updateMetricInstruments()}_wrap=wn;_unwrap=En;_massWrap=Tn;_massUnwrap=Dn;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},kn=class extends On{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function O(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function k(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var A;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(A||={});function An(e,t){let n=A.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=A.DUPLICATE;break}else t.toLowerCase()===e&&(n=A.STABLE);return n}var jn=s(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Mn(e){return e.setValue(jn,!0)}function Nn(e){return e.getValue(jn)===!0}var Pn=`baggage`,Fn=4096;function In(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ln(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Rn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=ee(e.substring(t+1))),{key:o,value:s,metadata:c}}function zn(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=Rn(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var Bn=class{inject(e,t,n){let r=h.getBaggage(e);if(!r||Nn(e))return;let i=In(Ln(r).filter(e=>e.length<=Fn).slice(0,180));i.length>0&&n.set(t,Pn,i)}extract(e,t,n){let r=n.get(t,Pn);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=zn(r[e],i,a,o);else [a]=zn(r,i,a,o);return a===0?e:h.setBaggage(e,h.createBaggage(i))}fields(){return[Pn]}};function j(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Vn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Hn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Vn(e){return typeof e==`string`&&e!==``}function Hn(e){return e==null?!0:Array.isArray(e)?Un(e):Wn(typeof e)}function Un(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Wn(e)){t=e;continue}return!1}return!1}}return!0}function Wn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Gn(){return e=>{_.error(Kn(e))}}function Kn(e){return typeof e==`string`?e:JSON.stringify(qn(e))}function qn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Jn=Gn();function M(e){try{Jn(e)}catch{}}var Yn=`2.9.0`,Xn=`process.runtime.name`,Zn={[Qe]:`opentelemetry`,[Xn]:`browser`,[Xe]:Ze,[$e]:Yn},N=performance,Qn=9,$n=10**6,er=10**Qn;function P(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*$n)]}function tr(e){return ar(P(N.timeOrigin),P(typeof e==`number`?e:N.now()))}function nr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=er),[n,r]}function rr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ir(e){return rr(e)||typeof e==`number`||e instanceof Date}function ar(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=er&&(n[1]-=er,n[0]+=1),n}var or;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(or||={});var sr=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},cr=`[_0-9a-z-*/]`,lr=`[a-z]${cr}{0,255}`,ur=`[a-z0-9]${cr}{0,240}@[a-z]${cr}{0,13}`,dr=RegExp(`^(?:${lr}|${ur})$`),fr=/^[ -~]{0,255}[!-~]$/,pr=/,|=/;function mr(e){return dr.test(e)}function hr(e){return fr.test(e)&&!pr.test(e)}var gr=32,_r=512,vr=`,`,yr=`=`,br=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!mr(e)||!hr(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>_r)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=vr+e),e=`${n[0]}${yr}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(vr),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(yr);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!mr(a)||!hr(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>_r)&&(t.set(a,o),n=s,t.size>=gr))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},F=`traceparent`,xr=`tracestate`,Sr=`00`,Cr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function wr(e){let t=Cr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Tr=class{inject(e,t,n){let r=f.getSpanContext(e);if(!r||Nn(e)||!d(r))return;let i=`${Sr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||l.NONE).toString(16)}`;n.set(t,F,i),r.traceState&&n.set(t,xr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,F);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=wr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,xr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new br(typeof e==`string`?e:void 0)}return f.setSpanContext(e,a)}fields(){return[F,xr]}},Er=`[object Object]`,Dr=`[object Null]`,Or=`[object Undefined]`,kr=Function.prototype.toString,Ar=kr.call(Object),jr=Object.getPrototypeOf,Mr=Object.prototype,Nr=Mr.hasOwnProperty,I=Symbol?Symbol.toStringTag:void 0,Pr=Mr.toString;function Fr(e){if(!Ir(e)||Lr(e)!==Er)return!1;let t=jr(e);if(t===null)return!0;let n=Nr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&kr.call(n)===Ar}function Ir(e){return typeof e==`object`&&!!e}function Lr(e){return e==null?e===void 0?Or:Dr:I&&I in Object(e)?Rr(e):zr(e)}function Rr(e){let t=Nr.call(e,I),n=e[I],r=!1;try{e[I]=void 0,r=!0}catch{}let i=Pr.call(e);return r&&(t?e[I]=n:delete e[I]),i}function zr(e){return Pr.call(e)}var Br=20;function Vr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Ur(t,e.shift(),0,n);return t}function Hr(e){return L(e)?e.slice():e}function Ur(e,t,n=0,r){let i;if(!(n>Br)){if(n++,z(e)||z(t)||Gr(t))i=Hr(t);else if(L(e)){if(i=e.slice(),L(t))for(let e=0,n=t.length;e<n;e++)i.push(Hr(t[e]));else if(R(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Hr(t[r]))}}}else if(R(e))if(R(t)){if(!Kr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(z(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Wr(e,s,r)||Wr(t,s,r))delete i[s];else{if(R(a)&&R(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Ur(i[s],c,n,r)}}}}else i=t;return i}}function Wr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function L(e){return Array.isArray(e)}function Gr(e){return typeof e==`function`}function R(e){return!z(e)&&!L(e)&&!Gr(e)&&typeof e==`object`}function z(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Kr(e,t){return!(!Fr(e)||!Fr(t))}var qr=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},Jr=class{_isCalled=!1;_deferred=new qr;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}},B;function Yr(){if(B===void 0)try{let e=globalThis.process.argv0;B=e?`unknown_service:${e}`:`unknown_service`}catch{B=`unknown_service`}return B}var V=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Xr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=$r(t),r._asyncAttributesPending=t.filter(([e,t])=>V(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(V(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=$r(this._rawAttributes),this._schemaUrl=ei(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,V(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(V(n)){_.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=ti(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Zr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Qr(){return Zr({[Je]:Yr(),[Xe]:Zn[Xe],[Qe]:Zn[Qe],[$e]:Zn[$e]})}function $r(e){return e.map(([e,t])=>V(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function ei(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function ti(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var ni=`exception`,ri=Symbol.for(`nodejs.util.inspect.custom`);function ii(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function ai(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var oi=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=N.now(),this._performanceOffset=t-(this._performanceStartTime+N.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return _.warn(`Invalid attribute key: ${e}`),this;if(!Hn(t))return _.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),ir(t)&&(ir(n)||(n=t),t=void 0);let i=j(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=j(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===c.UNSET||this.status.code===c.OK)return this;let t={code:e.code};return e.code===c.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){_.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=nr(this.startTime,this.endTime),this._duration[0]<0&&(_.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=N.now())return tr(e+this._performanceOffset);if(typeof e==`number`)return P(e);if(e instanceof Date)return P(e.getTime());if(rr(e))return e;if(this._startTimeProvided)return P(Date.now());let t=N.now()-this._performanceStartTime;return ar(this.startTime,P(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Be]=e:e&&(e.code?n[He]=e.code.toString():e.name&&(n[He]=e.name),e.message&&(n[Be]=e.message),e.stack&&(n[Ve]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(ni,n,t):_.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(_.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[ri](e,t,n){return ai(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this.resource)}},e,t,n)}},H;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(H||={});var si=`otel.component.name`,ci=`otel.component.type`,li=`otel.span.parent.origin`,ui=`otel.span.sampling_result`,di=`otel.sdk.processor.span.processed`,fi=`otel.sdk.processor.span.queue.capacity`,pi=`otel.sdk.processor.span.queue.size`,mi=`otel.sdk.span.live`,hi=`otel.sdk.span.started`,gi=`batching_span_processor`,_i=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(hi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(mi,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=yi(t);if(this.startedSpans.add(1,{[li]:vi(e),[ui]:n}),t===H.NOT_RECORD)return()=>{};let r={[ui]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function vi(e){return e?e.isRemote?`remote`:`local`:`none`}function yi(e){switch(e){case H.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case H.RECORD:return`RECORD_ONLY`;case H.NOT_RECORD:return`DROP`}}var bi=`2.9.0`,xi=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor,this._tracerMetrics=new _i(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,bi))}startSpan(e,t={},r=m.active()){t.root&&(r=f.deleteSpan(r));let i=f.getSpan(r);if(Nn(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),f.wrapSpanContext(n);let a=i?.spanContext(),o=this._idGenerator.generateSpanId(),s,c,u;!a||!f.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,s=a);let d=t.kind??be.INTERNAL,p=(t.links??[]).map(e=>({context:e.context,attributes:j(e.attributes)})),ee=j(t.attributes),h=this._sampler.shouldSample(r,c,e,d,ee,p),te=this._tracerMetrics.startSpan(a,h.decision);u=h.traceState??u;let g=h.decision===ye.RECORD_AND_SAMPLED?l.SAMPLED:l.NONE,ne={traceId:c,spanId:o,traceFlags:g,traceState:u};if(h.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),f.wrapSpanContext(ne);let re=j(Object.assign(ee,h.attributes));return new oi({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:p,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??m.active(),c=this.startSpan(e,i,s),l=f.setSpan(s,c);return m.with(l,o,void 0,c)}[ri](e,t,n){return ai(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this._resource)},spanLimits:this._spanLimits},e,t,n)}},Si=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{M(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},U=class{shouldSample(){return{decision:H.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},W=class{shouldSample(){return{decision:H.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},G=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(M(Error(`ParentBasedSampler must have a root sampler configured`)),new W),this._remoteParentSampled=e.remoteParentSampled??new W,this._remoteParentNotSampled=e.remoteParentNotSampled??new U,this._localParentSampled=e.localParentSampled??new W,this._localParentNotSampled=e.localParentNotSampled??new U}shouldSample(e,t,n,r,i,a){let o=f.getSpanContext(e);return!o||!d(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&l.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&l.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Ci=new Map,wi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=Ci.get(e)??0;if(Ci.set(e,r+1),this.standardAttrs={[ci]:e,[si]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[ze]:`queue_full`},this.processedSpans=t.createCounter(di,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(fi,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(pi,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[ze]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},Ti=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new Jr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize),this._metrics=new wi(gi,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):ve(),{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&l.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(_.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);m.with(Mn(m.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===or.SUCCESS?e():t(i.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{M(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,M(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Ei=class extends Ti{_visibilityChangeListener;_pageHideListener;constructor(e){super(e),this.onInit(e)}onInit(e){e.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{M(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{M(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Di=16,Oi=8,ki=new Uint8Array(Di),Ai=new Uint8Array(Oi),ji=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Mi(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ni(e){let t=``;for(let n=0;n<e.length;n++)t+=ji[e[n]];return t}var Pi=class{generateTraceId(){return Mi(ki),Ni(ki)}generateSpanId(){return Mi(Ai),Ni(Ai)}},K;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(K||={});var Fi=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Qr(),this._activeSpanProcessor=new Si(e.spanProcessors??[]),this._tracerOptions={resource:this._resource,sampler:e.sampler??new G({root:new W}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Pi,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return ve()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new xi({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(){let e=this._forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=K.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==K.timeout&&(r=K.resolved,n(r))}).catch(e=>{clearTimeout(i),r=K.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==K.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[ri](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return ai(`TracerProvider`,{resource:{attributes:ii(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Ii=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:o(t)&&this._accumulate(t)<this._upperBound?H.RECORD_AND_SAMPLED:H.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},q;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(q||={});var Li=1;function Ri(){return{sampler:zi(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function zi(){let e=q.ParentBasedAlwaysOn;switch(e){case q.AlwaysOn:return new W;case q.AlwaysOff:return new U;case q.ParentBasedAlwaysOn:return new G({root:new W});case q.ParentBasedAlwaysOff:return new G({root:new U});case q.TraceIdRatio:return new Ii(Bi());case q.ParentBasedTraceIdRatio:return new G({root:new Ii(Bi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${q.ParentBasedAlwaysOn}".`),new G({root:new W})}}function Bi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Li}.`),Li}function Vi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Hi=class extends Fi{constructor(e={}){let t=Vr({},Ri(),Vi(e));delete t.generalLimits,super(t)}},Ui=class extends Ei{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])t[e];super({exporter:e,...t})}},Wi=class{_enabled=!1;_currentContext=r;_bindFunction(e=r,t){let n=this,i=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(i,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=r,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=r,this)}with(e,t,n,...i){let a=this._currentContext;this._currentContext=e||r;try{return t.call(n,...i)}finally{this._currentContext=a}}};function Gi(e){if(e!==null){if(e===void 0){let e=new Wi;e.enable(),m.setGlobalContextManager(e);return}e.enable(),m.setGlobalContextManager(e)}}function Ki(e){if(e!==null){if(e===void 0){h.setGlobalPropagator(new sr({propagators:[new Tr,new Bn]}));return}h.setGlobalPropagator(e)}}var qi=class extends Hi{constructor(e={}){super(e)}register(e={}){f.setGlobalTracerProvider(this),Ki(e.propagator),Gi(e.contextManager)}},J;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(J||={});var Ji=`http.response_content_length`,Yi=`http.response_content_length_uncompressed`;function Y(e,t){return t in e}function X(e,t,n,r=!0){if(Y(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Xi(e,t,n=!1,r,i){if(r===void 0&&(r=t[J.START_TIME]!==0),n||(X(e,J.FETCH_START,t,r),X(e,J.DOMAIN_LOOKUP_START,t,r),X(e,J.DOMAIN_LOOKUP_END,t,r),X(e,J.CONNECT_START,t,r),X(e,J.SECURE_CONNECTION_START,t,r),X(e,J.CONNECT_END,t,r),X(e,J.REQUEST_START,t,r),X(e,J.RESPONSE_START,t,r),X(e,J.RESPONSE_END,t,r)),!i){let n=t[J.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ji,n);let r=t[J.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Yi,r)}}function Zi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=$i(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Zi(e.parentNode,t)),r+=n,r}function Qi(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function $i(e,t){let n=e.nodeType,r=Qi(e),i;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var ea;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(ea||={});var ta=`0.49.0`,na=`@opentelemetry/instrumentation-document-load`,ra;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(ra||={});var ia=()=>{let e={},t=N.getEntriesByType?.(`navigation`)[0];if(t)Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=N.timing;t&&Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},aa={"first-paint":ra.FIRST_PAINT,"first-contentful-paint":ra.FIRST_CONTENTFUL_PAINT},oa=e=>{let t=N.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{Y(aa,t)&&e.addEvent(aa[t],n)})},sa=class extends kn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(na,ta,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=N.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===F),t=ia(),n=e&&e.content||``;m.with(h.extract(r,{traceparent:n}),()=>{let e=this._startSpan(ea.DOCUMENT_LOAD,J.FETCH_START,t);e&&(m.with(f.setSpan(m.active(),e),()=>{let e=this._startSpan(ea.DOCUMENT_FETCH,J.FETCH_START,t);e&&(e.setAttribute(Ie,location.href),m.with(f.setSpan(m.active(),e),()=>{Xi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,J.RESPONSE_END,t)}))}),e.setAttribute(Ie,location.href),e.setAttribute(Le,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(X(e,J.FETCH_START,t),X(e,J.UNLOAD_EVENT_START,t),X(e,J.UNLOAD_EVENT_END,t),X(e,J.DOM_INTERACTIVE,t),X(e,J.DOM_CONTENT_LOADED_EVENT_START,t),X(e,J.DOM_CONTENT_LOADED_EVENT_END,t),X(e,J.DOM_COMPLETE,t),X(e,J.LOAD_EVENT_START,t),X(e,J.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||oa(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,J.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Y(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(ea.RESOURCE_FETCH,J.FETCH_START,e,t);n&&(n.setAttribute(Ie,e.name),Xi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,J.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Y(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?f.setSpan(m.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&O(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&O(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var ca=`http.response_content_length`,la=`http.response_content_length_uncompressed`,ua;function da(){return ua||=document.createElement(`a`),ua}function fa(e,t){return t in e}function Q(e,t,n,r=!0){if(fa(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function pa(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(ca,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(la,r)}}function ma(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function ha(){return typeof location<`u`?location.origin:void 0}function ga(e,t,n,r,i=new WeakSet,a){let o=ya(e);e=o.toString();let s=va(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=ma(s);if(o.origin!==ha()&&c.length>1){let e=c[0],t=_a(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function _a(e,t,n){let r=b(n),i=b(y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=b(y(n[Z.FETCH_START])),c=r-b(y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function va(e,t,n,r,i,a){let o=b(t),s=b(n),c=r.filter(t=>{let n=b(y(t[Z.FETCH_START])),r=b(y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function ya(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=da();return t.href=e,t}function ba(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),ya(e).origin===ha()?!0:n.some(t=>ct(e,t))}var xa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(xa||={});var Sa=`http.host`,Ca=`http.method`,wa=`http.request.body.size`,Ta=`http.request_content_length_uncompressed`,Ea=`http.scheme`,Da=`http.status_code`,Oa=`http.url`,ka=`http.user_agent`,Aa=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function ja(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Ma(t.body);return t.body=e,n}else return Promise.resolve(Pa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ia(e)):Promise.resolve()}}function Ma(e){if(!e.pipeThrough)return Aa.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Na(e){return typeof Document<`u`&&e instanceof Document}function Pa(e){if(Na(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ia(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return La(e);if(e instanceof URLSearchParams)return Ia(e.toString());if(e.byteLength!==void 0)return e.byteLength;Aa.warn(`unknown body type`)}var Fa=new TextEncoder;function Ia(e){return Fa.encode(e).byteLength}function La(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Ra(e){let t=Va(),n=e.toUpperCase();return n in t?n:`_OTHER`}var za={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ba;function Va(){return Ba===void 0&&(Ba=za),Ba}var Ha={"https:":`443`,"http:":`80`};function Ua(e){let t=Number(e.port||Ha[e.protocol]);if(t&&!isNaN(t))return t}var Wa=`0.204.0`,Ga=300,Ka=typeof process==`object`&&process.release?.name===`node`,qa=class extends kn{component=`fetch`;version=Wa;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Wa,e),this._semconvStability=An(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},f.setSpan(m.active(),e)),r=!(this._semconvStability&A.OLD);pa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=ya(t.url);if(this._semconvStability&A.OLD&&(e.setAttribute(Da,t.status),t.statusText!=null&&e.setAttribute(xa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(Sa,n.host),e.setAttribute(Ea,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(ka,navigator.userAgent)),this._semconvStability&A.STABLE){e.setAttribute(Ge,t.status),e.setAttribute(Ke,n.hostname);let r=Ua(n);r&&e.setAttribute(qe,r)}}_addHeaders(e,t){if(!ba(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};h.inject(m.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};h.inject(m.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(lt(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&A.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[xa.COMPONENT]=this.moduleName,r[Ca]=i,r[Oa]=e}if(this._semconvStability&A.STABLE){let i=t.method,a=Ra(t.method||`GET`);n||=a,r[Ue]=a,a!==i&&(r[We]=i),r[et]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ga(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&A.OLD);pa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=v(Date.now()),i=at();this._addFinalSpanAttributes(e,n),this._semconvStability&A.STABLE&&n.status>=400&&(e.setStatus({code:c.ERROR}),e.setAttribute(ze,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Ga)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=ya(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&ja(...n).then(e=>{e&&(t._semconvStability&A.OLD&&o.setAttribute(Ta,e),t._semconvStability&A.STABLE&&o.setAttribute(wa,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}finally{t(n)}}function d(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>m.with(f.setSpan(m.active(),o),()=>(t._addHeaders(a,i),t._callRequestHook(o,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o,n),d.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&O(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&O(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=at(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(Ka){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}k(fetch)&&(this._unwrap(Me,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Me,`fetch`,this._patchConstructor())}disable(){Ka||(this._unwrap(Me,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var Ja=`0.49.0`,Ya=`@opentelemetry/instrumentation-user-interaction`,Xa=`OT_ZONE_CONTEXT`,Za=`Navigation:`,Qa=[`click`];function $a(){return!1}var eo=class extends kn{version=Ja;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(Ya,Ja,e),this._eventNames=new Set(e?.eventNames??Qa),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:$a}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=tr():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Zi(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:r,[$.HTTP_URL]:window.location.href}},n?f.setSpan(m.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Xa);return t&&f.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,o=function(...t){let i,o=t[0],s=o?.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),m.with(f.setSpan(m.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){k(history.replaceState)&&this._unwrap(history,`replaceState`),k(history.pushState)&&this._unwrap(history,`pushState`),k(history.back)&&this._unwrap(history,`back`),k(history.forward)&&this._unwrap(history,`forward`),k(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=f.getSpan(m.active());t&&typeof t.updateName==`function`&&t.updateName(`${Za} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,o,s=this;if(a){if(o=e._createSpan(a,n.eventName),o)return e._incrementTask(o),s.run(()=>{try{return m.with(f.setSpan(m.active(),o),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(o)}})}else o=e._getCurrentSpan(s);try{return t.call(s,n,r,i)}finally{o&&e._shouldCountTask(n,s)&&e._decrementTask(o)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(k(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),k(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),k(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),k(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(k(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),k(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),k(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&this._unwrap(e,`addEventListener`),k(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},to=`open-knowledge-app`,no=!1;function ro(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.49.3`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function io(){if(no)return;no=!0;let e=null,t=!1;try{let n=ro(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.49.3`};e=new qi({resource:Zr({[Je]:`open-knowledge-app`,[Ye]:r?.VITE_APP_VERSION??`dev`,[Re]:r?.MODE??`dev`}),spanProcessors:[new Ui(new fn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Cn({instrumentations:[new sa,new eo({eventNames:[`click`,`submit`]}),new qa({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),no=!1}}function ao(){return f.getTracer(to)}export{ao as getAppTracer,io as install};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./propagation-api-DSg7UKuw.js";import{n}from"./startup-marks-BYurBbnW.js";import{getAppTracer as r}from"./telemetry-impl-
|
|
1
|
+
import{n as e,t}from"./propagation-api-DSg7UKuw.js";import{n}from"./startup-marks-BYurBbnW.js";import{getAppTracer as r}from"./telemetry-impl-Bbdtn9J6.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=t.extract(e.active(),{traceparent:a}),s=r().startSpan(`ok.app-startup`,void 0,o);i=s,n(e=>{try{s.end(e)}catch{}i=void 0})}catch{}}export{a as initStartupTrace};
|
package/dist/public/assets/{typing-burst-detector-i5YC5a51.js → typing-burst-detector-NGfWxmTo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{$ as n,D as r,Nn as i,Q as a,Sn as o,Vt as s,bt as c,gt as l,i as u,mn as d,mt as f,wt as p,zt as m}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{$ as n,D as r,Nn as i,Q as a,Sn as o,Vt as s,bt as c,gt as l,i as u,mn as d,mt as f,wt as p,zt as m}from"./DocumentContext-LJdmX-5h.js";import{t as h}from"./react-f2sANaYj.js";import{n as g,r as _}from"./dist-Nvb76hAm.js";import{r as v,t as y}from"./useQuery-ZeEDLtxh.js";import{t as b}from"./compiler-runtime-BfE3aGVn.js";import{t as x}from"./utils-CPqDy6Hr.js";import{t as S}from"./button-RQ5o7P7w.js";import{i as C,n as w,t as T}from"./tooltip-x7BNUa3s.js";import{n as E,r as D,t as O}from"./collapsible-OhEmjTXw.js";import{O as k,at as A,et as j,k as M}from"./CodeMirrorPropInput-DNhnXG-N.js";import{n as N,t as P}from"./toggle-group-DAYvcc1F.js";import{$t as F,Ba as I,F as L,Hn as R,Vn as z,en as B,mt as V,po as H,to as U,ui as W,vt as ee}from"./dist-B6uhnkqb2.js";import{o as te}from"./use-settings-route-Ln_W_o3I.js";import{t as G}from"./dist-DoS8xGN6.js";import{n as K}from"./dist-Bkx5dDHT2.js";import{d as ne}from"./documents-events-BE14yj3s.js";import{t as q}from"./createLucideIcon-6iYxif1u.js";import{t as J}from"./chevron-right-DJvandMc.js";import{r as Y}from"./CopyButton-DhHoiQJR.js";import{i as X,r as re}from"./prop-types-DOjW8INh.js";import{t as ie}from"./refresh-cw-CAV3aG7d.js";import{t as ae}from"./triangle-alert-xKPljhlK.js";import{t as oe}from"./wrench-yAsO-Pm9.js";import{f as se,u as ce}from"./doc-paths-DCnBNou3.js";import{a as le,i as ue}from"./startup-marks-BYurBbnW.js";import{t as de}from"./badge-zHd29IKW.js";import{C as fe,D as pe}from"./config-provider-BWu19HJJ.js";import{Dt as me,Ft as he,It as ge,J as _e,Q as ve,X as ye}from"./dist-B0Beym3_.js";import{a as be,c as xe,i as Se,n as Ce,r as we,s as Te,t as Ee}from"./panel-9S5Pf2VO.js";import{t as De}from"./lint-plugin-meta-FPoTE-0t.js";import{t as Oe}from"./skeleton-BOVIbSHk.js";import{a as ke,c as Ae,d as je}from"./lint-config-client-CXdpjOMj.js";var Me=q(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Ne=q(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Pe=56,Fe=2,Ie=150,Le=2e3;function Re(e,t,n){return e.top+e.height/2-(n+t)/2}function ze(e,t){let n=Math.max(0,t.scrollHeight-t.clientHeight);return Math.max(0,Math.min(e,n))}function Be(e){let{docName:t,container:n,measureTarget:r,placement:i,intent:a,grade:o,landedMode:s,transition:u,onOutcome:d,onDiscardQueuedTarget:f,toolbarOffset:m=Pe,driftThresholdPx:h=Fe,quietMs:g=Ie,abandonAfterMs:_=Le}=e,v=e.contentColumn??n.firstElementChild,y=l(t),b=c(t,{yieldsToNavigation:a===`toggle`,supersede:()=>P(`superseded`)}),x=n.style.overflowAnchor;n.style.overflowAnchor=`none`,u&&le(`ok/mode-switch/transition`,{from:u.from,to:u.to,grade:o});let S=!1,C=null,w,T,E=0,D,O=()=>{let e=r();return e===null?null:ze(i===`center`?Re(e,n.clientHeight,m):e.top-m,n)},k=()=>{let e=O();if(e===null)return{measurable:!1,moved:!1};C=e;let t=Math.abs(n.scrollTop-e)>h;return t&&(n.scrollTop=e),{measurable:!0,moved:t}},A=()=>n.scrollTop-(O()??C??n.scrollTop),j=()=>{w&&clearTimeout(w),T&&clearTimeout(T),E&&cancelAnimationFrame(E),D?.disconnect(),n.removeEventListener(`wheel`,I),n.removeEventListener(`touchstart`,I),n.removeEventListener(`contentvisibilityautostatechange`,L,!0),n.style.overflowAnchor=x,y.release(),b.release()},M=()=>{if(S)return;S=!0;let e;try{k(),e=A(),C!==null&&p({docName:t,container:n,targetScrollTop:n.scrollTop,mode:s})}finally{j()}le(`ok/landing/land`,{grade:o,delta:e}),d?.({status:`landed`,delta:e})},N=()=>{if(S)return;S=!0;let e=C??n.scrollTop,t;try{t=A()}finally{j()}le(`ok/landing/abandoned`,{grade:o,target:e,delta:t}),d?.({status:`abandoned`,delta:t})},P=e=>{S||(S=!0,j(),e===`mode-flip`&&f?.(),d?.({status:`cancelled`,reason:e}))},F=()=>{w&&clearTimeout(w),w=setTimeout(M,g)};function I(){P(`user-scroll`)}function L(){if(S)return;let{measurable:e,moved:t}=k();e&&(t||w===void 0)&&F()}try{k().measurable&&F(),n.addEventListener(`contentvisibilityautostatechange`,L,!0),n.addEventListener(`wheel`,I,{passive:!0}),n.addEventListener(`touchstart`,I,{passive:!0}),typeof ResizeObserver<`u`&&v&&(D=new ResizeObserver(L),D.observe(v)),E=requestAnimationFrame(L),T=setTimeout(N,_)}catch(e){throw S=!0,j(),e}return{cancel:P}}function Ve(e){switch(e){case`bulletList`:case`orderedList`:case`taskList`:case`list`:return`list`;case`codeBlock`:case`code`:return`code`;case`horizontalRule`:case`thematicBreak`:return`thematicBreak`;case`jsxComponent`:case`mdxJsxFlowElement`:case`mdxJsxTextElement`:return`jsx`;case`htmlBlock`:case`html`:return`html`;default:return e}}function He(e){return typeof e!=`object`||!e?``:`value`in e&&typeof e.value==`string`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(He).join(``):``}function Ue(e,t){let{frontmatter:n,body:r}=H(e),i=n===``?0:n.split(`
|
|
2
2
|
`).length-1;try{return{blocks:t.parseToEditorMdast(r).children.map(e=>({start:(e.position?.start.line??1/0)+i,end:(e.position?.end.line??-1/0)+i,kind:Ve(e.type),text:He(e)})),fmLineCount:i}}catch{return performance.mark(`ok/block-spans/parse-failed`),{blocks:[],fmLineCount:i}}}function We(e,t){let{blocks:n,fmLineCount:r}=Ue(e,t);return{spans:n.map(e=>({start:e.start,end:e.end})),fmLineCount:r}}function Ge(e,t){if(e.length===0)return null;let n=0,r=e.length-1,i=e.length-1;for(;n<=r;){let a=n+r>>1,o=e[a];o!==void 0&&o.end>=t?(i=a,r=a-1):n=a+1}return i}function Ke(e){let t=0;for(let n=e.childCount-1;n>=0;n--){let r=e.child(n);if(r.type.name!==`paragraph`||r.content.size!==0)break;t++}return t<2?e.childCount-t:e.childCount}function qe(e,t,n){let r=e.childCount,i=Math.max(0,Math.min(t,r)),a=Math.max(i,Math.min(n,r));if(a<=i)return null;let o=0;for(let t=0;t<i;t++)o+=e.child(t).nodeSize;let s=o;for(let t=i;t<a;t++)o+=e.child(t).nodeSize;let c=o,l=e.content.size,u=Math.max(0,Math.min(s,l)),d=Math.max(u,Math.min(c,l));return d<=u?null:{from:u,to:d}}function Je(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
3
3
|
`&&t.push(n+1);return t}function Ye(e,t,n){return t<=1?0:t-1>=e.length?n:e[t-1]??n}function Xe(e,t){let n=0,r=e.length-1,i=1;for(;n<=r;){let a=n+r>>1;(e[a]??0)<=t?(i=a+1,n=a+1):r=a-1}return i}function Ze(e,t,n){return Math.max(t,Math.min(e,n))}function Qe(e,t){let n=e=>e.replace(/\s+/g,` `).trim();return n(e)===n(t)}function $e(e,t){return t.inRange?t.tripwireOk?Qe(e.content,t.text)?`exact`:e.kind===t.kind?`same-type-ordinal`:`ordinal`:`ordinal`:`clamped`}function et(e){let t=null,n=null;function r(r){return n!==null&&t===r?n:(n={blocks:Ue(r,e).blocks,lineStarts:Je(r)},t=r,n)}return{captureFromWysiwyg(e,t,n){if(e.childCount===0)return null;let r=Ze(t,0,e.content.size),i=0,a=e.childCount-1,o=0;for(let t=0;t<e.childCount;t++){let n=e.child(t).nodeSize;if(r<i+n){a=t,o=i+1;break}i+=n,o=i+1}let s=e.child(a),c={blockIndex:a,kind:Ve(s.type.name),content:s.textContent};return n?.refine&&(c.selectionInBlock=Math.max(0,r-o)),c},captureFromSource(e,t,n){let{blocks:i,lineStarts:a}=r(e);if(i.length===0)return null;let o=Ze(t,0,e.length),s=Ge(i,Xe(a,o));if(s===null)return null;let c=i[s];if(!c)return null;let l={blockIndex:s,kind:c.kind,content:c.text};if(n?.refine){let t=Ye(a,c.start,e.length);l.selectionInBlock=Math.max(0,o-t)}return l},resolveInSource(e,{source:t,doc:n}){let{blocks:i,lineStarts:a}=r(t);if(i.length===0)return null;let o=e.blockIndex>=0&&e.blockIndex<i.length,s=Ke(n)===i.length,c=i[Ze(e.blockIndex,0,i.length-1)],l=Ye(a,c.start,t.length),u=Math.min(Ye(a,c.end+1,t.length),t.length),d=$e(e,{inRange:o,tripwireOk:s,kind:c.kind,text:c.text}),f=l;return d===`exact`&&e.selectionInBlock!==void 0&&(f=Ze(l+e.selectionInBlock,l,u)),{blockStart:l,blockEnd:u,point:f,confidence:d}},resolveInWysiwyg(e,{source:t,doc:n}){let i=Ke(n);if(i===0)return null;let{blocks:a}=r(t),o=e.blockIndex>=0&&e.blockIndex<i,s=i===a.length,c=Ze(e.blockIndex,0,i-1),l=qe(n,c,c+1);if(l===null)return null;let u=n.child(c),d=$e(e,{inRange:o,tripwireOk:s,kind:Ve(u.type.name),text:u.textContent});return{blockStart:l.from,blockEnd:l.to,point:l.from,confidence:d}}}}var tt=he.define(),nt=he.define(),rt=_e.mark({class:a}),it=ge.define({create(){return _e.none},update(e,t){let n=e.map(t.changes);for(let e of t.effects)e.is(tt)?n=_e.set([rt.range(e.value.from,e.value.to)]):e.is(nt)&&(n=_e.none);return n},provide:e=>ye.decorations.from(e)}),at=new WeakMap,ot=ve.define(e=>({destroy(){let t=at.get(e);t!==void 0&&(clearTimeout(t),at.delete(e))}}));function st(e,t,r,i){let a=n(e.state.doc.length,t,r,i);if(!a)return;e.dispatch({effects:tt.of(a)});let o=at.get(e);o!==void 0&&clearTimeout(o);let s=setTimeout(()=>{at.delete(e),e.dispatch({effects:nt.of(null)})},L);at.set(e,s)}function ct(){return[it,ot]}var lt=3e4;function ut(){let e=new Map,t=e=>e?Date.now()-e.rememberedAt>lt?null:e.navigation:null;return{remember(t,n){e.set(t,{navigation:n,rememberedAt:Date.now()})},peek(n){return t(e.get(n))},consume(n){let r=e.get(n);return e.delete(n),t(r)},clear(t){e.delete(t)},clearForTest(){e.clear()}}}var dt=ut(),ft=ut(),pt=dt.remember,mt=dt.peek,ht=dt.consume,gt=dt.clear;dt.clearForTest;var _t=ft.remember,vt=ft.peek,yt=ft.consume,bt=ft.clear;ft.clearForTest;function xt(e,t,n){return{start:pe(e,t),end:pe(e,n)}}function St(e,t){let n=fe(e.start,t),r=fe(e.end,t);return n===null||r===null||r.index<=n.index?null:n.index}var Ct=`open-knowledge:view-in-source`,wt=56,Tt=null;function Et(){return Tt??=et(k()),Tt}function Dt(e,t,n,r,i=`toggle`){let a=r.captureFromWysiwyg(e,t,{refine:i===`jump`});if(!a)return null;let o=r.resolveInSource(a,{source:n.toString(),doc:e});return{kind:`selection-offset`,intent:i,anchor:a,pin:o?xt(n,o.blockStart,o.blockEnd):void 0}}function Ot(e){let{editor:t,docName:n,ytext:r}=e,i=j(t);if(!i)return;let a=i.state.selection.from,o=Dt(i.state.doc,a,r,Et(),`jump`);o&&pt(n,o),window.dispatchEvent(new CustomEvent(Ct,{detail:{docName:n}}))}function kt(e,t,n,r,i){let a=r.captureFromSource(e,t);if(!a)return null;let o=i?r.resolveInSource(a,{source:e,doc:i}):null;return{kind:`selection-offset`,anchor:a,pin:o?xt(n,o.blockStart,o.blockEnd):void 0}}function At(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=St(e.pin,i);if(t===null){let t=a.resolveInWysiwyg(e.anchor,{source:n,doc:r});return t?{...t,point:t.blockStart,confidence:`clamped`}:null}let o=a.captureFromSource(n,t);if(o)return a.resolveInWysiwyg(o,{source:n,doc:r})}return a.resolveInWysiwyg(e.anchor,{source:n,doc:r})}function jt(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=St(e.pin,i);if(t===null){let t=a.resolveInSource(e.anchor,{source:n,doc:r});return t?{...t,point:t.blockStart,confidence:`clamped`}:null}let o=a.captureFromSource(n,t);if(o)return a.resolveInSource(o,{source:n,doc:r})}return a.resolveInSource(e.anchor,{source:n,doc:r})}function Mt(e,t){try{return e.coordsAtPos(t)}catch{return null}}function Nt(e,t,n){let r=Math.max(0,Math.min(n,e.state.doc.length)),i=t.getBoundingClientRect().top,a=Mt(e,r);if(a)return{top:a.top-i+t.scrollTop,height:a.bottom-a.top};try{let n=e.lineBlockAt(r);return{top:e.documentTop-i+t.scrollTop+n.top,height:n.height}}catch{return null}}function Pt(e,t){if(e.isDestroyed)return null;try{let n=e.nodeDOM(t);if(n instanceof HTMLElement)return n;let{node:r}=e.domAtPos(t);return r instanceof HTMLElement?r:r.parentElement}catch{return null}}function Ft(e,t,n){if(e.isDestroyed)return null;let r=Pt(e,Math.max(0,Math.min(n,e.state.doc.content.size)));if(!r)return null;let i=r.getBoundingClientRect(),a=t.getBoundingClientRect().top;return{top:i.top-a+t.scrollTop,height:i.height}}function It(){return typeof document>`u`?null:f()}function Lt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2;for(let t of[wt+1,wt+12,wt+40]){let i=e.posAtCoords({left:r,top:n.top+t});if(i)return i.pos}return null}function Rt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2;for(let t of[wt+1,wt+12,wt+40]){let i=e.posAtCoords({x:r,y:n.top+t});if(i!==null)return i}return null}function zt(e){let{from:t,to:n,docName:r,ytext:i}=e;t===`wysiwyg`&&n===`source`?Bt(r,i):t===`source`&&n===`wysiwyg`&&Vt(r,i)}function Bt(e,t){let n=mt(e);if(n&&n.kind!==`selection-offset`)return;let r=d(e);if(!r)return;let i=j(r);if(!i)return;let a=It();if(!a)return;let o=Lt(i,a);if(o===null)return;let s=Dt(i.state.doc,o,t,Et());s&&pt(e,s)}function Vt(e,t){let n=m(e);if(!n)return;let r=It();if(!r)return;let i=Rt(n,r);if(i===null)return;let a=d(e),o=a?j(a)?.state.doc:void 0,s=kt(t.toString(),i,t,Et(),o);s&&_t(e,s)}function Ht(e){let{view:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=d(n),s=o?j(o)?.state.doc:void 0;if(!s)return null;let l=jt(r,{source:t.state.doc.toString(),pmDoc:s,ydoc:i,resolver:Et()});if(!l)return null;let u=It();if(!u)return null;let f=l,p=r.intent===`jump`,m=p?f.point:f.blockStart;t.dispatch({effects:ye.scrollIntoView(m,{y:`start`})});let h=!1,g=null,_=c(n,{yieldsToNavigation:!p,supersede:()=>{h=!0,_.release()}}),v=e=>{if(!h){if(Mt(t,m)===null&&e<8){requestAnimationFrame(()=>v(e+1));return}try{p&&(t.dispatch({selection:me.cursor(m)}),t.focus())}finally{_.release()}g=Be({docName:n,container:u,contentColumn:t.contentDOM,measureTarget:()=>Nt(t,u,m),placement:p?`center`:`top`,intent:p?`jump`:`toggle`,grade:f.confidence,landedMode:`source`,transition:a,toolbarOffset:wt,onOutcome:p?e=>{e.status===`landed`&&st(t,f.blockStart,f.blockEnd,f.confidence)}:void 0,onDiscardQueuedTarget:()=>gt(n)})}};return v(0),{cancel:e=>{h=!0,_.release(),g?.cancel(e)}}}function Ut(e){let{editor:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=j(t);if(!o)return null;let s=At(r,{source:i.getText(`source`).toString(),pmDoc:o.state.doc,ydoc:i,resolver:Et()});if(!s)return null;let c=It();if(!c)return null;let l=s;return Be({docName:n,container:c,contentColumn:o.dom,measureTarget:()=>Ft(o,c,l.point),placement:`top`,intent:`toggle`,grade:l.confidence,landedMode:`wysiwyg`,transition:a,toolbarOffset:wt,onDiscardQueuedTarget:()=>bt(n)})}var Z=e(h(),1),Q=b(),$=t();function Wt(e){let t=(0,Q.c)(14),{scope:n,onScopeChange:r,projectLabel:i}=e,{_:a}=_(),o;t[0]===r?o=t[1]:(o=e=>{e&&r(e)},t[0]=r,t[1]=o);let s;t[2]===a?s=t[3]:(s=a({id:`aBgwis`}),t[2]=a,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(N,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,$.jsx)(g,{id:`UpCz01`})}),t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=i??(0,$.jsx)(g,{id:`e0NrBM`}),t[5]=i,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,$.jsx)(N,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n||t[10]!==o||t[11]!==s||t[12]!==u?(d=(0,$.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,$.jsxs)(P,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:o,"aria-label":s,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[c,u]})}),t[9]=n,t[10]=o,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}var Gt=null,Kt=[];function qt(e){if(e===Gt)return Kt;let t=Jt(e);return Gt=e,Kt=t,t}function Jt(e){let t=[],n=new Map,r=R();for(let i=Yt(e);i<=e.lines;i++){let a=e.line(i);if(r(a.text))continue;let o=W(a.text,n);o&&t.push({slug:o.slug,from:a.from})}return t}function Yt(e){if(!Xt(e.line(1).text))return 1;for(let t=2;t<=e.lines;t++)if(Xt(e.line(t).text))return t+1;return 1}function Xt(e){return I.test(e.endsWith(`\r`)?e.slice(0,-1):e)}function Zt(e){let t=document.getElementById(e);return t?t.getBoundingClientRect().top:null}function Qt(e){let t=new Map;for(let n of qt(e.state.doc))t.set(n.slug,n.from);let n=e.documentTop;return r=>{let i=t.get(r);return i===void 0?null:n+e.lineBlockAt(i).top}}function $t(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{isSourceMode:i,docName:a}=r,o=i===void 0?!1:i,[c,l]=(0,Z.useState)(void 0),u=(0,Z.useRef)(null),d;n[2]===a?d=n[3]:(d=()=>a?m(a):null,n[2]=a,n[3]=d);let f=(0,Z.useSyncExternalStore)(s,d,en),p,h;return n[4]!==o||n[5]!==e||n[6]!==f?(p=()=>{if(e.length===0||o&&!f){l(void 0);return}let t=function(){let t=o&&f?Qt(f):Zt,n=window.innerHeight/2,r,i;for(let a of e){let e=t(a);e!==null&&(e<0?r=a:i===void 0&&e<n&&(i=a))}l(i??r??e[0])},n=function(){u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},h=[e,o,f],n[4]=o,n[5]=e,n[6]=f,n[7]=p,n[8]=h):(p=n[7],h=n[8]),(0,Z.useEffect)(p,h),c}function en(){return null}var tn=300;async function nn(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new M(G._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=ee.safeParse(n);throw e.success?Error(e.data.title):new M(G._({id:`zlErBl`}),{status:t.status})}let r=V.safeParse(n);if(!r.success)throw new M(G._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var rn=32,an=12,on=6,sn=`open-knowledge:outline-nav`;function cn(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(ue,{name:`outline-panel`,children:(0,$.jsx)(ln,{...e})}),t[0]=e,t[1]=n),n}function ln(e){let t=(0,Q.c)(53),{docName:n,isSourceMode:r,className:i}=e,a=i===void 0?``:i,{_:o}=_(),{pages:s,loading:c}=X(),l=v(),{activeProvider:d,activeDocName:f}=u(),p,m;t[0]===n?(p=t[1],m=t[2]):(p=[`page-headings`,n],m=()=>nn(n),t[0]=n,t[1]=p,t[2]=m);let h;t[3]!==n||t[4]!==c||t[5]!==s?(h=!c&&(s.has(n)||U(n)),t[3]=n,t[4]=c,t[5]=s,t[6]=h):h=t[6];let b;t[7]!==p||t[8]!==m||t[9]!==h?(b={queryKey:p,queryFn:m,enabled:h,staleTime:1/0},t[7]=p,t[8]=m,t[9]=h,t[10]=b):b=t[10];let{data:S,isLoading:C,error:w}=y(b),T;t[11]===S?T=t[12]:(T=S===void 0?[]:S,t[11]=S,t[12]=T);let E=T,D,O;t[13]!==f||t[14]!==d||t[15]!==n||t[16]!==l?(D=()=>{if(!d||f!==n)return;let e=d.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,l.invalidateQueries({queryKey:[`page-headings`,n]})},tn)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},O=[d,f,n,l],t[13]=f,t[14]=d,t[15]=n,t[16]=l,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,Z.useEffect)(D,O);let k;t[19]===E?k=t[20]:(k=E.map(un),t[19]=E,t[20]=k);let A=k,j;t[21]!==n||t[22]!==r?(j={isSourceMode:r,docName:n},t[21]=n,t[22]=r,t[23]=j):j=t[23];let M=$t(A,j),N;t[24]!==M||t[25]!==E?(N=M?E.findIndex(e=>e.slug===M):-1,t[24]=M,t[25]=E,t[26]=N):N=t[26];let P=N,F;t[27]!==n||t[28]!==r?(F=function(e,t){let i={docName:n,index:e,slug:t,mode:r?`source`:`wysiwyg`};i.mode===`source`&&pt(n,{kind:`outline`,detail:i}),window.dispatchEvent(new CustomEvent(sn,{detail:i}))},t[27]=n,t[28]=r,t[29]=F):F=t[29];let I=F,L=((P>=0?E[P].level:1)-1)*an+(an-on)/2,R=P*rn+(rn-on)/2,z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(xe,{children:(0,$.jsx)(g,{id:`dD7NPy`})}),t[30]=z):z=t[30];let B;t[31]!==E.length||t[32]!==C?(B=!C&&(0,$.jsx)(we,{children:E.length}),t[31]=E.length,t[32]=C,t[33]=B):B=t[33];let V;t[34]===B?V=t[35]:(V=(0,$.jsxs)(Te,{children:[z,B]}),t[34]=B,t[35]=V);let H;t[36]!==o||t[37]!==P||t[38]!==M||t[39]!==w||t[40]!==I||t[41]!==E||t[42]!==C||t[43]!==L||t[44]!==R?(H=w?(0,$.jsx)(be,{className:`px-2`,children:w instanceof Error?w.message:o({id:`GuqOb1`})}):E.length===0&&!C?(0,$.jsx)(Se,{className:`px-2`,children:(0,$.jsx)(g,{id:`0BB9ID`})}):(0,$.jsxs)(`nav`,{"aria-label":o({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,$.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:on,height:on,transform:`translate(${L}px, ${R}px)`}}),E.map((e,t)=>{let n=e.slug===M;return(0,$.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>I(t,e.slug),className:x(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*an+20}px`},title:e.text,children:e.text},t)})]}),t[36]=o,t[37]=P,t[38]=M,t[39]=w,t[40]=I,t[41]=E,t[42]=C,t[43]=L,t[44]=R,t[45]=H):H=t[45];let W;t[46]!==C||t[47]!==H?(W=(0,$.jsx)(Ce,{className:`px-3 py-2`,"aria-busy":C,children:H}),t[46]=C,t[47]=H,t[48]=W):W=t[48];let ee;return t[49]!==a||t[50]!==V||t[51]!==W?(ee=(0,$.jsxs)(Ee,{className:a,children:[V,W]}),t[49]=a,t[50]=V,t[51]=W,t[52]=ee):ee=t[52],ee}function un(e){return e.slug}var dn=`audit-superseded`;async function fn(e={kind:`project`}){return mn(e,B,!1)}async function pn(e={kind:`project`},t){return mn(e,F,!0,t)}async function mn(e,t,n,r){try{let i=new URLSearchParams;e.kind===`path`?i.set(`path`,e.path):e.kind===`doc`&&i.set(`doc`,e.docName),n&&i.set(`counts`,`1`);let a=i.size===0?``:`?${i}`,o=await fetch(`/api/audit${a}`,r===void 0?void 0:{signal:r});if(!o.ok)return o.status===409?dn:(console.warn(`[audit] request failed`,o.status,o.statusText),null);let s;try{s=await o.json()}catch{return r?.aborted===!0||console.warn(`[audit] response body is not valid JSON`),null}let c=t.safeParse(s);return c.success?c.data:(console.warn(`[audit] response failed schema validation`,c.error.issues),null)}catch(e){return r?.aborted===!0||console.warn(`[audit] fetch threw`,e),null}}function hn(e){let t=(0,Q.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,i]=(0,Z.useState)(n),a,o;return t[1]===e?(a=t[2],o=t[3]):(a=()=>{if(i(vn),e===null)return;let t=!1,n=()=>{fn({kind:`doc`,docName:e}).then(e=>{if(t||e===null||e===`audit-superseded`)return;let n=e.files.flatMap(_n).filter(gn);i(e=>e.length===0&&n.length===0?e:n)})};n();let r=ne(e=>{e.includes(`backlinks`)&&n()});return()=>{t=!0,r()}},o=[e],t[1]=e,t[2]=a,t[3]=o),(0,Z.useEffect)(a,o),r}function gn(e){return e.source===`links`}function _n(e){return e.diagnostics}function vn(e){return e.length===0?e:[]}function yn(e){return Math.min(50,Math.max(1,Math.ceil(e/10)))}function bn(e,t){return e===t||e%yn(t)===0}var xn=[250,500,1e3,2e3,4e3];function Sn(e){return e.status===503&&e.problemType===`urn:ok:error:too-many-agent-sessions`}async function Cn(e,t){let n=await t.fixItem(e);for(let r of xn){if(n.ok||!Sn(n)||!t.shouldContinue()||(console.debug(`[sweep] capacity refusal, backing off %dms`,r),await t.sleep(r),!t.shouldContinue()))break;n=await t.fixItem(e)}return n}async function wn(e){let t=e.items.length,n=[];for(let[r,i]of e.items.entries()){if(r>0&&(await e.sleep(15),!e.shouldContinue()))return{failures:n,cancelled:!0};let a=await Cn(i,e);if(a.ok||n.push({item:i,detail:a.errorDetail}),!e.shouldContinue())return{failures:n,cancelled:!0};let o=r+1;bn(o,t)&&e.onProgress(o,t)}return{failures:n,cancelled:!1}}function Tn(e){return new Promise(t=>setTimeout(t,e))}var En=null,Dn=!1,On=new Set,kn=new Set;function An(e){En=e;for(let e of On)e()}function jn(e){return On.add(e),()=>{On.delete(e)}}function Mn(){return En}function Nn(){return(0,Z.useSyncExternalStore)(jn,Mn,Mn)}function Pn(e){return kn.add(e),()=>{kn.delete(e)}}function Fn(){Dn=!0}function In(e,t,n){if(e.length>0&&(console.warn(`[lint] fix-all: ${e.length} of ${n} files failed`,e.map(e=>({file:e.item.file,detail:e.detail}))),!t)){let t=e[0];K.error(G._({id:`se-tU0`,values:{0:e.length,total:n}}),{description:t===void 0?void 0:`${t.item.file}${t.detail===null?``:` — ${t.detail}`}`})}if(t){K.info(G._({id:`H1TmTu`}));return}e.length===0&&K.success(G._({id:`SWX1O7`,values:{total:n}}))}async function Ln({items:e,fixItem:t,sleep:n=Tn}){if(En!==null||e.length===0)return;let r=e.length;Dn=!1,An({done:0,total:r});let i=[],a=!1,o=!1;try{let o=await wn({items:e,fixItem:t,sleep:n,onProgress:e=>An({done:e,total:r}),shouldContinue:()=>!Dn});i=o.failures,a=o.cancelled}catch(e){console.warn(`[lint] fix-all: sweep threw`,e),o=!0}finally{An(null)}try{o?K.error(G._({id:`vwV-kH`})):In(i,a,r)}finally{for(let e of kn)e()}}var Rn={errorCount:0,warningCount:0},zn=new Map,Bn=new Set,Vn=new Map;function Hn(){let e=new Map;for(let[t,n]of zn){let r=n.lint.errorCount+n.links.errorCount,i=n.lint.warningCount+n.links.warningCount;r===0&&i===0||e.set(t,{errorCount:r,warningCount:i})}Vn=e;for(let e of Bn)e()}var Un=z;function Wn(e){return Bn.add(e),()=>{Bn.delete(e)}}function Gn(){return Vn}function Kn(e){zn.clear();for(let t of e)zn.set(ce(t.file),Un(t.diagnostics));Hn()}function qn(e){zn.clear();for(let t of e)zn.set(ce(t.file),{lint:t.lint,links:t.links});Hn()}function Jn(e,t){zn.set(e,Un(t)),Hn()}function Yn(e,t,n){let r=zn.get(e)??{lint:Rn,links:Rn},i=r[t];i.errorCount===n.errorCount&&i.warningCount===n.warningCount||(zn.set(e,{...r,[t]:n}),Hn())}var Xn=`open-knowledge:lint-nav`;function Zn(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function Qn(e,t){return{docName:e,line:t.range.start.line+1,column:t.range.start.character+1,source:t.source}}function $n(e){let t=(0,Q.c)(35),{diagnostic:n,instanceCount:r}=e,{_:a}=_(),o=n.severity===`error`?Y:ae,s=n.range.start.line+1,c=n.source===`links`,l=r!==void 0&&r>1,u=n.severity===`error`?`text-destructive`:`text-amber-500`,d;t[0]===u?d=t[1]:(d=x(`mt-0.5 size-3.5 shrink-0`,u),t[0]=u,t[1]=d);let f;t[2]!==o||t[3]!==d?(f=(0,$.jsx)(o,{"aria-hidden":`true`,className:d}),t[2]=o,t[3]=d,t[4]=f):f=t[4];let p;t[5]===n.message?p=t[6]:(p=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 text-foreground`,children:n.message}),t[5]=n.message,t[6]=p);let m;t[7]!==l||t[8]!==r?(m=l?(0,$.jsxs)(`span`,{className:`mt-0.5 flex shrink-0 items-center gap-1`,children:[(0,$.jsx)(de,{variant:`gray`,"data-testid":`problems-instance-count`,className:`h-4 px-1 font-sans text-[10px] leading-none`,children:(0,$.jsx)(g,{id:`iZCZmF`,values:{instanceCount:r}})}),(0,$.jsx)(J,{"aria-hidden":`true`,className:`size-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`})]}):null,t[7]=l,t[8]=r,t[9]=m):m=t[9];let h;t[10]!==f||t[11]!==p||t[12]!==m?(h=(0,$.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[f,p,m]}),t[10]=f,t[11]=p,t[12]=m,t[13]=h):h=t[13];let v=c&&`gap-0.5`,y;t[14]===v?y=t[15]:(y=x(`h-4 shrink-0 px-1 font-sans text-[10px] uppercase leading-none`,v),t[14]=v,t[15]=y);let b;t[16]===c?b=t[17]:(b=c?(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-2.5`}):null,t[16]=c,t[17]=b);let S;t[18]!==n.source||t[19]!==y||t[20]!==b?(S=(0,$.jsxs)(de,{variant:`gray`,"data-testid":`problems-source-tag`,className:y,children:[b,n.source]}),t[18]=n.source,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==a||t[23]!==n.code||t[24]!==s||t[25]!==l?(C=l?n.code:`${n.code} · ${a({id:`enPTnx`,values:{displayLine:s}})}`,t[22]=a,t[23]=n.code,t[24]=s,t[25]=l,t[26]=C):C=t[26];let w;t[27]===C?w=t[28]:(w=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:C}),t[27]=C,t[28]=w);let T;t[29]!==S||t[30]!==w?(T=(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 ps-5 font-mono text-xs text-muted-foreground`,children:[S,w]}),t[29]=S,t[30]=w,t[31]=T):T=t[31];let E;return t[32]!==T||t[33]!==h?(E=(0,$.jsxs)($.Fragment,{children:[h,T]}),t[32]=T,t[33]=h,t[34]=E):E=t[34],E}function er(e){let t=new Map;for(let n of e){let e=`${n.source}/${n.code}\u0000${n.linkTarget??``}\u0000${n.message}`,r=t.get(e);r===void 0?t.set(e,{key:e,instances:[n]}):r.instances.push(n)}return[...t.values()]}function tr(e){let t=(0,Q.c)(43),{group:n,onNavigate:r,navTitle:i,renderActions:a}=e,{_:o}=_(),s=n.instances[0];if(n.instances.length===1){let e;t[0]!==s||t[1]!==a?(e=a(s),t[0]=s,t[1]=a,t[2]=e):e=t[2];let n=e,o;t[3]!==s||t[4]!==r?(o=()=>r(s),t[3]=s,t[4]=r,t[5]=o):o=t[5];let c;t[6]!==s||t[7]!==i?(c=i(s),t[6]=s,t[7]=i,t[8]=c):c=t[8];let l;t[9]===s?l=t[10]:(l=(0,$.jsx)($n,{diagnostic:s}),t[9]=s,t[10]=l);let u;t[11]!==o||t[12]!==c||t[13]!==l?(u=(0,$.jsx)(`button`,{type:`button`,onClick:o,className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:c,children:l}),t[11]=o,t[12]=c,t[13]=l,t[14]=u):u=t[14];let d;t[15]===n?d=t[16]:(d=n===null?null:(0,$.jsx)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:n}),t[15]=n,t[16]=d);let f;return t[17]!==u||t[18]!==d?(f=(0,$.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[u,d]}),t[17]=u,t[18]=d,t[19]=f):f=t[19],f}let c;t[20]!==s||t[21]!==n.instances.length?(c=(0,$.jsx)(D,{className:`group flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:(0,$.jsx)($n,{diagnostic:s,instanceCount:n.instances.length})}),t[20]=s,t[21]=n.instances.length,t[22]=c):c=t[22];let l;t[23]!==o||t[24]!==s.message?(l=o({id:`EUiJEM`,values:{0:s.message}}),t[23]=o,t[24]=s.message,t[25]=l):l=t[25];let u;if(t[26]!==o||t[27]!==n.instances||t[28]!==i||t[29]!==r||t[30]!==a){let e;t[32]!==o||t[33]!==i||t[34]!==r||t[35]!==a?(e=e=>{let t=a(e),n=e.range.start.line+1;return(0,$.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:`flex w-full cursor-pointer rounded px-2 py-1 text-left font-mono text-xs text-muted-foreground`,title:i(e),"aria-label":o({id:`uCe4AX`,values:{0:e.message,displayLine:n}}),children:o({id:`enPTnx`,values:{displayLine:n}})}),t===null?null:(0,$.jsx)(`div`,{className:`absolute bottom-0.5 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:t})]},nr(e))},t[32]=o,t[33]=i,t[34]=r,t[35]=a,t[36]=e):e=t[36],u=n.instances.map(e),t[26]=o,t[27]=n.instances,t[28]=i,t[29]=r,t[30]=a,t[31]=u}else u=t[31];let d;t[37]!==l||t[38]!==u?(d=(0,$.jsx)(E,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,children:(0,$.jsx)(`ul`,{"aria-label":l,className:`flex flex-col gap-0.5 pb-1 ps-5`,"data-testid":`problems-duplicate-instances`,children:u})}),t[37]=l,t[38]=u,t[39]=d):d=t[39];let f;return t[40]!==c||t[41]!==d?(f=(0,$.jsx)(`li`,{className:`rounded`,"data-testid":`problems-duplicate-group`,children:(0,$.jsxs)(O,{children:[c,d]})}),t[40]=c,t[41]=d,t[42]=f):f=t[42],f}function nr(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function rr(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function ir(e){let t=(0,Q.c)(11),{target:n,creating:r,disabled:i,onCreate:a}=e,{_:o}=_(),s;t[0]!==o||t[1]!==n?(s=o({id:`oWsZk8`,values:{target:n}}),t[0]=o,t[1]=n,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(A,{"aria-hidden":`true`,className:`size-3`}),t[3]=c):c=t[3];let l;t[4]===r?l=t[5]:(l=r?(0,$.jsx)(g,{id:`E9bKSA`}):(0,$.jsx)(g,{id:`XRuL0i`}),t[4]=r,t[5]=l);let u;return t[6]!==i||t[7]!==a||t[8]!==s||t[9]!==l?(u=(0,$.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:i,onClick:a,"aria-label":s,"data-testid":`problems-create-page`,children:[c,l]}),t[6]=i,t[7]=a,t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function ar(e){let t=(0,Q.c)(8),{tip:n,testId:r,children:i}=e,a;t[0]===i?a=t[1]:(a=(0,$.jsx)(C,{asChild:!0,children:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:i})}),t[0]=i,t[1]=a);let o;t[2]!==r||t[3]!==n?(o=(0,$.jsx)(w,{"data-testid":r,children:n}),t[2]=r,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(T,{children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function or(e){let t=(0,Q.c)(21),{count:n,problemCount:r,aiAvailable:i,disabled:a,onClick:o,children:s}=e,{_:c}=_(),l;t[0]!==i||t[1]!==n||t[2]!==r?(l=n>0?(0,$.jsx)(g,{id:`vjwsDi`,values:{count:n}}):r===0?(0,$.jsx)(g,{id:`gAhHu7`}):i?(0,$.jsx)(g,{id:`zA9zRL`}):(0,$.jsx)(g,{id:`X3MMeA`}),t[0]=i,t[1]=n,t[2]=r,t[3]=l):l=t[3];let u;t[4]!==c||t[5]!==s||t[6]!==n||t[7]!==r?(u=s===void 0?r===0?c({id:`4m-xuX`}):n===0?c({id:`SqIoy_`}):void 0:void 0,t[4]=c,t[5]=s,t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),t[9]=d):d=t[9];let f;t[10]!==s||t[11]!==n?(f=s??(0,$.jsx)(g,{id:`RZXTlY`,values:{count:n}}),t[10]=s,t[11]=n,t[12]=f):f=t[12];let p;t[13]!==a||t[14]!==o||t[15]!==u||t[16]!==f?(p=(0,$.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:a,onClick:o,"aria-label":u,"data-testid":`problems-auto-fix`,children:[d,f]}),t[13]=a,t[14]=o,t[15]=u,t[16]=f,t[17]=p):p=t[17];let m;return t[18]!==l||t[19]!==p?(m=(0,$.jsx)(ar,{testId:`problems-auto-fix-tip`,tip:l,children:p}),t[18]=l,t[19]=p,t[20]=m):m=t[20],m}function sr(e){let t=(0,Q.c)(12),{count:n,disabled:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(g,{id:`mgDKWS`,values:{count:n}}),t[0]=n,t[1]=a);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(o,{"aria-hidden":`true`,className:`size-3`}),t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,$.jsx)(g,{id:`gyHDWC`,values:{count:n}}),t[3]=n,t[4]=c);let l;t[5]!==r||t[6]!==i||t[7]!==c?(l=(0,$.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:i,"data-testid":`problems-fix-with-ai`,children:[s,c]}),t[5]=r,t[6]=i,t[7]=c,t[8]=l):l=t[8];let u;return t[9]!==a||t[10]!==l?(u=(0,$.jsx)(ar,{testId:`problems-fix-with-ai-tip`,tip:a,children:l}),t[9]=a,t[10]=l,t[11]=u):u=t[11],u}function cr(e){let t=(0,Q.c)(48),{docName:n,diagnostics:i,onFix:a,onAutoFix:s,onAskAi:c,onFixWithAi:l}=e,{_:u}=_(),[d,f]=(0,Z.useState)(`doc`),{data:p}=je(),m=p===null?null:p.effective.enabled?De.filter(e=>p.effective.plugins[e.id].enabled):[],h=m!==null&&m.length===0,v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={status:`idle`},t[0]=v):v=t[0];let[y,b]=(0,Z.useState)(v),x=Nn(),E=re(),[D,O]=(0,Z.useState)(null),k=(0,Z.useRef)(!0),A,j;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>(k.current=!0,()=>{k.current=!1}),j=[],t[1]=A,t[2]=j):(A=t[1],j=t[2]),(0,Z.useEffect)(A,j);let M=(0,Z.useRef)(gr),N=(0,Z.useRef)(hr),P;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(P={status:`idle`},t[3]=P):P=t[3];let F=(0,Z.useRef)(P),I;t[4]===y?I=t[5]:(I=()=>{y.status!==`loading`&&(F.current=y)},t[4]=y,t[5]=I),(0,Z.useEffect)(I);let L=(0,Z.useRef)(0),R=[...i].sort(Zn),z=rr(R),B;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(B=async function(){L.current+=1;let e=L.current,t=F.current;b({status:`loading`});let n=await fn();if(n===`audit-superseded`){L.current===e&&k.current&&b(t.status===`idle`?{status:`failed`}:t);return}n!==null&&Kn(n.files),k.current&&b(n===null?{status:`failed`}:{status:`loaded`,result:n})},t[6]=B):B=t[6];let V=B,H;t[7]!==u||t[8]!==y.status||t[9]!==D||t[10]!==E?(H=async function(e){let t=e.linkTarget;if(!(t===void 0||D!==null||E===null)){O(t);try{await r({initialDir:``,suggestedName:t},{addPage:E.addPage})}catch(e){let t=e;K.error(t instanceof Error?t.message:u({id:`tfi40B`})),k.current&&O(null);return}K.success(u({id:`EWCJFu`,values:{target:t}})),k.current&&O(null),k.current&&y.status===`loaded`&&await V()}},t[7]=u,t[8]=y.status,t[9]=D,t[10]=E,t[11]=H):H=t[11];let U=H,W=y.status===`loaded`?y.result.files.filter(pr):[],ee=function(){Ln({items:W,fixItem:fr})},G;t[12]===y.status?G=t[13]:(G=function(e){f(e),e===`project`&&y.status===`idle`&&V()},t[12]=y.status,t[13]=G);let ne=G,q;t[14]===y.status?q=t[15]:(q=()=>{M.current=()=>{y.status===`idle`||y.status===`failed`||V()}},t[14]=y.status,t[15]=q),(0,Z.useEffect)(q);let J,Y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(J=()=>Ae(()=>M.current()),Y=[],t[16]=J,t[17]=Y):(J=t[16],Y=t[17]),(0,Z.useEffect)(J,Y);let X;t[18]===y.status?X=t[19]:(X=()=>{N.current=()=>{y.status===`idle`||y.status===`failed`||V().catch(e=>{console.warn(`[lint] post-sweep re-audit failed`,e),k.current&&b({status:`failed`})})}},t[18]=y.status,t[19]=X),(0,Z.useEffect)(X);let ie,ae;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>Pn(()=>N.current()),ae=[],t[20]=ie,t[21]=ae):(ie=t[20],ae=t[21]),(0,Z.useEffect)(ie,ae);let le;t[22]===n?le=t[23]:(le=function(e){let t=Qn(n,e);pt(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(Xn,{detail:t}))},t[22]=n,t[23]=le);let ue=le,de;t[24]!==n||t[25]!==ue?(de=function(e,t){let r=ce(e);if(r===n){ue(t);return}pt(r,{kind:`lint`,detail:Qn(r,t)}),window.location.hash=se(r)},t[24]=n,t[25]=ue,t[26]=de):de=t[26];let fe=de,pe;t[27]!==u||t[28]!==U||t[29]!==D||t[30]!==c||t[31]!==a||t[32]!==E?(pe=function(e){let t=a!==void 0&&(e.fixes?.length??0)>0,n=e.linkTarget!==void 0&&E!==null;if(!t&&!n&&c===void 0)return null;let r=`${e.source}/${e.code}`;return(0,$.jsxs)($.Fragment,{children:[n?(0,$.jsx)(ir,{target:e.linkTarget??``,creating:D===e.linkTarget,disabled:D!==null,onCreate:()=>void U(e)}):null,t?(0,$.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>a?.(e),"aria-label":u({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,$.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(g,{id:`c4fVUV`})]}):null,c===void 0?null:(0,$.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":u({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,$.jsx)(o,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(g,{id:`xWEvuo`})]})]})},t[27]=u,t[28]=U,t[29]=D,t[30]=c,t[31]=a,t[32]=E,t[33]=pe):pe=t[33];let me=pe,he=Ee,ge;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,$.jsx)(xe,{children:(0,$.jsx)(g,{id:`OXdGnd`})}),t[34]=ge):ge=t[34];let _e=m!==null&&m.length>0&&(0,$.jsxs)(T,{children:[(0,$.jsx)(C,{className:`shrink-0 cursor-default rounded-md bg-muted-foreground/5 px-2 py-1 font-mono text-xs text-muted-foreground`,"data-testid":`problems-active-plugins`,children:(0,$.jsx)(g,{id:`yxF19Y`,values:{0:m.length}})}),(0,$.jsx)(w,{"data-testid":`problems-active-plugins-tooltip`,children:(0,$.jsx)(g,{id:`ws5o1F`,values:{0:m.map(dr).join(`, `)}})})]}),ve;t[35]===_e?ve=t[36]:(ve=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ge,_e]}),t[35]=_e,t[36]=ve);let ye=d===`doc`&&R.length>0&&(0,$.jsx)(we,{children:R.length}),be;t[37]!==ve||t[38]!==ye?(be=(0,$.jsxs)(Te,{children:[ve,ye]}),t[37]=ve,t[38]=ye,t[39]=be):be=t[39];let Oe;t[40]!==ne||t[41]!==d?(Oe=(0,$.jsx)(Wt,{scope:d,onScopeChange:ne}),t[40]=ne,t[41]=d,t[42]=Oe):Oe=t[42];let ke=d===`doc`?(0,$.jsx)(Ce,{className:`px-2 py-2`,children:R.length===0?h?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Se,{className:`px-2`,"data-testid":`problems-no-plugins`,children:(0,$.jsx)(g,{id:`Hngy37`})}),(0,$.jsx)(`div`,{className:`px-2 pt-2`,children:(0,$.jsx)(S,{variant:`outline`,size:`sm`,onClick:te,"data-testid":`problems-enable-plugins`,children:(0,$.jsx)(g,{id:`rnX-1S`})})})]}):(0,$.jsx)(Se,{className:`px-2`,children:(0,$.jsx)(g,{id:`ZI8uvA`})}):(0,$.jsxs)($.Fragment,{children:[s!==void 0||l!==void 0?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 px-2 pb-1`,children:[s!==void 0&&(0,$.jsx)(or,{count:z,problemCount:R.length,aiAvailable:l!==void 0,disabled:z===0,onClick:s}),l!==void 0&&(0,$.jsx)(sr,{count:R.length,disabled:!1,onClick:()=>l(`doc`)})]}):null,(0,$.jsx)(`ul`,{"aria-label":u({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:er(R).map(e=>(0,$.jsx)(tr,{group:e,onNavigate:ue,navTitle:e=>u({id:`vbMHjo`,values:{0:e.range.start.line+1}}),renderActions:me},e.key))})]})}):(0,$.jsx)(_r,{audit:y,onRefresh:()=>void V(),onNavigate:fe,fixableCount:W.reduce(ur,0),problemCount:y.status===`loaded`?y.result.files.reduce(lr,0):0,fixing:x,onAutoFix:ee,onCancelFix:Fn,onFixWithAi:l===void 0||y.status!==`loaded`?void 0:()=>l(`project`),onCreateTarget:E===null?void 0:e=>void U(e),creatingTarget:D}),Me;return t[43]!==he||t[44]!==be||t[45]!==Oe||t[46]!==ke?(Me=(0,$.jsxs)(he,{children:[be,Oe,ke]}),t[43]=he,t[44]=be,t[45]=Oe,t[46]=ke,t[47]=Me):Me=t[47],Me}function lr(e,t){return e+t.diagnostics.length}function ur(e,t){return e+rr(t.diagnostics)}function dr(e){return e.label}function fr(e){return ke(ce(e.file))}function pr(e){return e.diagnostics.some(mr)}function mr(e){return(e.fixes?.length??0)>0}function hr(){}function gr(){}function _r(e){let t=(0,Q.c)(81),{audit:n,onRefresh:r,onNavigate:i,fixableCount:a,problemCount:o,fixing:s,onAutoFix:c,onCancelFix:l,onFixWithAi:u,onCreateTarget:d,creatingTarget:f}=e,{_:p}=_(),m=n.status===`loading`||n.status===`idle`,h;t[0]!==n.result||t[1]!==n.status?(h=n.status===`loaded`?n.result.files:[],t[0]=n.result,t[1]=n.status,t[2]=h):h=t[2];let v=h,[y,b]=(0,Z.useState)(br),x;t[3]!==y||t[4]!==v?(x=v.length>0&&v.every(e=>y.has(e.file)),t[3]=y,t[4]=v,t[5]=x):x=t[5];let E=x,D;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(e,t){b(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},t[6]=D):D=t[6];let O=D,k;t[7]!==E||t[8]!==v?(k=function(){b(E?new Set:new Set(v.map(yr)))},t[7]=E,t[8]=v,t[9]=k):k=t[9];let A=k,j;t[10]!==n.result||t[11]!==n.status?(j=n.status===`loaded`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,$.jsx)(g,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[10]=n.result,t[11]=n.status,t[12]=j):j=t[12];let M;t[13]===j?M=t[14]:(M=(0,$.jsx)(`p`,{className:`min-w-0 truncate text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:j}),t[13]=j,t[14]=M);let N;t[15]!==p||t[16]!==E||t[17]!==v.length||t[18]!==A?(N=v.length>0?(0,$.jsxs)(T,{children:[(0,$.jsx)(C,{asChild:!0,children:(0,$.jsx)(S,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":p(E?{id:`I4LGsH`}:{id:`Ugvy4O`}),"data-testid":`problems-audit-expand-toggle`,onClick:A,children:E?(0,$.jsx)(Me,{"aria-hidden":`true`,className:`size-3.5`}):(0,$.jsx)(Ne,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,$.jsx)(w,{"data-testid":`problems-audit-expand-toggle-tooltip`,children:E?(0,$.jsx)(g,{id:`I4LGsH`}):(0,$.jsx)(g,{id:`Ugvy4O`})})]}):null,t[15]=p,t[16]=E,t[17]=v.length,t[18]=A,t[19]=N):N=t[19];let P;t[20]===p?P=t[21]:(P=p({id:`I7y_vn`}),t[20]=p,t[21]=P);let F=m||s!==null,I;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(ie,{"aria-hidden":`true`,className:`size-3.5`}),t[22]=I):I=t[22];let L;t[23]!==r||t[24]!==P||t[25]!==F?(L=(0,$.jsx)(C,{asChild:!0,children:(0,$.jsx)(S,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":P,"data-testid":`problems-audit-refresh`,disabled:F,onClick:r,children:I})}),t[23]=r,t[24]=P,t[25]=F,t[26]=L):L=t[26];let R;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(w,{"data-testid":`problems-audit-refresh-tooltip`,children:(0,$.jsx)(g,{id:`I7y_vn`})}),t[27]=R):R=t[27];let z;t[28]===L?z=t[29]:(z=(0,$.jsxs)(T,{children:[L,R]}),t[28]=L,t[29]=z);let B;t[30]!==z||t[31]!==N?(B=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[N,z]}),t[30]=z,t[31]=N,t[32]=B):B=t[32];let V;t[33]!==B||t[34]!==M?(V=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[M,B]}),t[33]=B,t[34]=M,t[35]=V):V=t[35];let H;t[36]!==p||t[37]!==s?(H=s===null?null:(0,$.jsx)(`span`,{className:`sr-only`,role:`status`,children:p({id:`gZElfU`,values:{0:s.done,1:s.total}})}),t[36]=p,t[37]=s,t[38]=H):H=t[38];let U;t[39]!==p||t[40]!==s||t[41]!==l?(U=s===null?null:(0,$.jsxs)(T,{children:[(0,$.jsx)(C,{asChild:!0,children:(0,$.jsx)(S,{variant:`ghost`,size:`sm`,className:`h-6 shrink-0 px-2 text-muted-foreground`,"aria-label":p({id:`q2cLM6`}),"data-testid":`problems-cancel-fix`,onClick:l,children:(0,$.jsx)(g,{id:`ygCKqB`})})}),(0,$.jsx)(w,{"data-testid":`problems-cancel-fix-tooltip`,children:(0,$.jsx)(g,{id:`yvSAuM`})})]}),t[39]=p,t[40]=s,t[41]=l,t[42]=U):U=t[42];let W=u!==void 0,ee=m||s!==null||a===0,te;t[43]===s?te=t[44]:(te=s===null?void 0:(0,$.jsx)(g,{id:`S9t1PI`,values:{0:s.done,1:s.total}}),t[43]=s,t[44]=te);let G;t[45]!==a||t[46]!==c||t[47]!==o||t[48]!==W||t[49]!==ee||t[50]!==te?(G=(0,$.jsx)(or,{count:a,problemCount:o,aiAvailable:W,disabled:ee,onClick:c,children:te}),t[45]=a,t[46]=c,t[47]=o,t[48]=W,t[49]=ee,t[50]=te,t[51]=G):G=t[51];let K;t[52]!==s||t[53]!==u||t[54]!==o?(K=u!==void 0&&o>0?(0,$.jsx)(sr,{count:o,disabled:s!==null,onClick:u}):null,t[52]=s,t[53]=u,t[54]=o,t[55]=K):K=t[55];let ne;t[56]!==H||t[57]!==U||t[58]!==G||t[59]!==K?(ne=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:[H,U,G,K]}),t[56]=H,t[57]=U,t[58]=G,t[59]=K,t[60]=ne):ne=t[60];let q;t[61]!==V||t[62]!==ne?(q=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 px-2 pb-1`,children:[V,ne]}),t[61]=V,t[62]=ne,t[63]=q):q=t[63];let J;t[64]!==p||t[65]!==m?(J=m&&(0,$.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":p({id:`dx-TwN`}),children:[1,2,3].map(vr)}),t[64]=p,t[65]=m,t[66]=J):J=t[66];let Y;t[67]===n.status?Y=t[68]:(Y=n.status===`failed`&&(0,$.jsx)(be,{className:`px-2 text-xs`,children:(0,$.jsx)(g,{id:`IFezUv`})}),t[67]=n.status,t[68]=Y);let X;t[69]!==n.result||t[70]!==n.status||t[71]!==f||t[72]!==y||t[73]!==d||t[74]!==i?(X=n.status===`loaded`&&(0,$.jsx)(xr,{result:n.result,onNavigate:i,onCreateTarget:d,creatingTarget:f,expandedFiles:y,onToggleFile:O}),t[69]=n.result,t[70]=n.status,t[71]=f,t[72]=y,t[73]=d,t[74]=i,t[75]=X):X=t[75];let re;return t[76]!==q||t[77]!==J||t[78]!==Y||t[79]!==X?(re=(0,$.jsxs)(Ce,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[q,J,Y,X]}),t[76]=q,t[77]=J,t[78]=Y,t[79]=X,t[80]=re):re=t[80],re}function vr(e){return(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,$.jsx)(Oe,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(Oe,{className:`h-3 w-28`}),(0,$.jsx)(Oe,{className:`h-3 w-40`})]})]},e)}function yr(e){return e.file}function br(){return new Set}function xr(e){let t=(0,Q.c)(14),{result:n,onNavigate:r,onCreateTarget:i,creatingTarget:a,expandedFiles:o,onToggleFile:s}=e,{_:c}=_(),l;t[0]!==c||t[1]!==n.warnings?(l=n.warnings.length>0&&(0,$.jsx)(`ul`,{"aria-label":c({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(Sr)}),t[0]=c,t[1]=n.warnings,t[2]=l):l=t[2];let u;t[3]!==a||t[4]!==o||t[5]!==i||t[6]!==r||t[7]!==s||t[8]!==n.fileCount||t[9]!==n.files?(u=n.files.length===0?(0,$.jsx)(Se,{className:`px-2`,children:(0,$.jsx)(g,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,$.jsx)(Cr,{file:e,onNavigate:r,onCreateTarget:i,creatingTarget:a,open:o.has(e.file),onOpenChange:t=>s(e.file,t)},e.file)),t[3]=a,t[4]=o,t[5]=i,t[6]=r,t[7]=s,t[8]=n.fileCount,t[9]=n.files,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Sr(e,t){return(0,$.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,$.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Cr(e){let t=(0,Q.c)(45),{file:n,onNavigate:r,onCreateTarget:i,creatingTarget:a,open:o,onOpenChange:s}=e,{_:c}=_(),l,u,d,f,p,m,h,g,v,y;if(t[0]!==c||t[1]!==a||t[2]!==n.diagnostics||t[3]!==n.file||t[4]!==i||t[5]!==r||t[6]!==s||t[7]!==o){let e=[...n.diagnostics].sort(Zn);u=O,h=o,g=s,v=`problems-audit-group`;let _;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(J,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[18]=_):_=t[18];let b;t[19]===n.file?b=t[20]:(b=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[19]=n.file,t[20]=b),y=(0,$.jsxs)(D,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[_,b,(0,$.jsx)(de,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),l=E,m=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,t[21]!==c||t[22]!==n.file?(d=c({id:`zAJzIg`,values:{0:n.file}}),t[21]=c,t[22]=n.file,t[23]=d):d=t[23],f=`flex flex-col gap-0.5 pb-1 ps-3`;let x;t[24]!==c||t[25]!==a||t[26]!==n.file||t[27]!==i||t[28]!==r?(x=e=>(0,$.jsx)(tr,{group:e,onNavigate:e=>r(n.file,e),navTitle:e=>c({id:`xKDsGS`,values:{0:e.range.start.line+1,1:n.file}}),renderActions:e=>e.linkTarget===void 0||i===void 0?null:(0,$.jsx)(ir,{target:e.linkTarget,creating:a===e.linkTarget,disabled:a!==null,onCreate:()=>i(e)})},e.key),t[24]=c,t[25]=a,t[26]=n.file,t[27]=i,t[28]=r,t[29]=x):x=t[29],p=er(e).map(x),t[0]=c,t[1]=a,t[2]=n.diagnostics,t[3]=n.file,t[4]=i,t[5]=r,t[6]=s,t[7]=o,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h,t[15]=g,t[16]=v,t[17]=y}else l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14],g=t[15],v=t[16],y=t[17];let b;t[30]!==d||t[31]!==f||t[32]!==p?(b=(0,$.jsx)(`ul`,{"aria-label":d,className:f,children:p}),t[30]=d,t[31]=f,t[32]=p,t[33]=b):b=t[33];let x;t[34]!==l||t[35]!==m||t[36]!==b?(x=(0,$.jsx)(l,{className:m,children:b}),t[34]=l,t[35]=m,t[36]=b,t[37]=x):x=t[37];let S;return t[38]!==u||t[39]!==x||t[40]!==h||t[41]!==g||t[42]!==v||t[43]!==y?(S=(0,$.jsxs)(u,{open:h,onOpenChange:g,"data-testid":v,children:[y,x]}),t[38]=u,t[39]=x,t[40]=h,t[41]=g,t[42]=v,t[43]=y,t[44]=S):S=t[44],S}var wr={words:0,chars:0,tokens:0},Tr=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,Er=/[\p{L}\p{N}]/u,Dr=new Set([`text`,`inlineCode`,`code`,`tag`]),Or=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),kr=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Ar(e,t){if(!e)return;let n=e.type;if(!Or.has(n)){if(Dr.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
4
4
|
`));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)Ar(n,t);if(kr.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|