@inkeep/open-knowledge 0.45.0-beta.1 → 0.46.0-beta.0
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-CpjBgaZC.mjs → acp-harness-probe-CxRHExTF.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/assets/skills/write-skill/SKILL.md +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/constants-CaJonkjd.mjs +2 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{init-VrTLo-2L.mjs → init-BywyN3bZ.mjs} +3 -3
- package/dist/init-CXNuZ1vN.mjs +1 -0
- package/dist/{launch-json-removal-BKzdQPnK.mjs → launch-json-removal-DUhfwUL4.mjs} +2 -2
- package/dist/loader-CNnz66sA.mjs +1 -0
- package/dist/{loader-Cj7AJe_7.mjs → loader-CV5nEQVy.mjs} +2 -2
- package/dist/{preview-DBuQW-Xj.mjs → preview-CuTwyBl2.mjs} +2 -2
- package/dist/preview-nhAfQjAn.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-CcG8767K.js → ActivityModeContent-B6-70ang.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-D8YoofwF.js → AgentDiffPane-DeWSzAp-.js} +1 -1
- package/dist/public/assets/{BugReportHistory-B0qbbAw0.js → BugReportHistory-DrMLEEP8.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-Bp4PHyEI.js → BugReportHistoryDialog-Cf_ZrCjH.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-B4tL-3Ht.js → CodeMirrorPropInput-CUPvWzYm.js} +1 -1
- package/dist/public/assets/{DocumentContext-FCJwmuAo.js → DocumentContext-B-29n_HL.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-DcuaOmV8.js → EditorModeToggle-CigjLJ2Z.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CTsdvp_5.js → EnableSyncConfirmDialog-DTG7riiK.js} +1 -1
- package/dist/public/assets/FeedbackForm-BtkuXFGI.js +1 -0
- package/dist/public/assets/{LintConfigEditor-MRWig8E3.js → LintConfigEditor-ylJ89_uD.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DIfvPtzN.js → ManagedArtifactProperties-D3xtiDXY.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DsEY1FOt.js → MermaidDocEditor-R8D5JpPi.js} +1 -1
- package/dist/public/assets/{PropertyPanel-DA4qhX7-.js → PropertyPanel-H098JdnP.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-C2dU04N7.js → RegisteredAgentIcon-DplzDEhh.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CgzQLCKM.js → ReportBugDialogBody-DZFX9Uby.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-BdzkNqsH.js → SchemaConfigEditor-BHuEU14f.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-B4PW-A-w.js → SettingsDialogBody-ZYeLdOBh.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-_26zWSVZ.js → ShareReceiveMissDialog-CIsXJHV5.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-CBKpfxev.js → SkillEditorActions-DesRWfir.js} +1 -1
- package/dist/public/assets/{SourceEditor-BcRIK3Uz.js → SourceEditor-Gg4gFBXn.js} +1 -1
- package/dist/public/assets/{TerminalSessionsHost-B0kLulV_.js → TerminalSessionsHost-BVUmqdhT.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-CMdYDyv_.js → TerminalWindowApp-BrV49Q8V.js} +1 -1
- package/dist/public/assets/{ThreadView-DQThTEIO.js → ThreadView-DouqkaQt.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CsNp0WRG.js → TimelineDiffPane-DrdY8iSv.js} +1 -1
- package/dist/public/assets/{auth-state-cache-EkXfX8vV.js → auth-state-cache-DOwAr8pE.js} +1 -1
- package/dist/public/assets/{client-version-CVjSHBE0.js → client-version-CWjw2o37.js} +1 -1
- package/dist/public/assets/{config-provider-CvXAYjor.js → config-provider--LBV5X-F.js} +1 -1
- package/dist/public/assets/globals-BtCTpjIr.css +1 -0
- package/dist/public/assets/{index-Dw-K4FA8.js → index-D6QuW6BA.js} +7 -7
- package/dist/public/assets/{pending-receive-nav-store-Da_9JJXI.js → pending-receive-nav-store-B6dtzPFx.js} +1 -1
- package/dist/public/assets/{selection-context-np7NtN5p.js → selection-context-B2HcUOkN.js} +1 -1
- package/dist/public/assets/{skill-actions-BgdyM_G0.js → skill-actions-C5Jj4vq_.js} +1 -1
- package/dist/public/assets/{src-D452d0cv.js → src-CttimVGm.js} +1 -1
- package/dist/public/assets/{telemetry-impl-C8kYleYy.js → telemetry-impl-BFTBY40l.js} +1 -1
- package/dist/public/assets/{telemetry-startup-CEgptpjf.js → telemetry-startup-DI3YRseI.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-rVKisiec.js → typing-burst-detector-ZNMuwopa.js} +1 -1
- package/dist/public/assets/{uninstall-DnE1CJ4K.js → uninstall-940RMTvq.js} +1 -1
- package/dist/public/assets/{use-activity-panel-D5Ud5rAK.js → use-activity-panel-BtuJNY3q.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-DLUyAvNx.js → use-terminal-enabled-U4ycZNGm.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-g0StQlEH.js → use-timeline-entry-diff-DIrGiWpg.js} +1 -1
- package/dist/public/index.html +16 -16
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-CdsetcKS.mjs → repair-launch-json-BHjMUArH.mjs} +2 -2
- package/dist/{repair-mcp-configs-DUyYOlv0.mjs → repair-mcp-configs-DaZNyTJh.mjs} +2 -2
- package/dist/{src-O3bbxbKj.mjs → src-SPeh14QP.mjs} +2 -2
- package/dist/{start-C5aCZqhv.mjs → start-5jiM99lZ.mjs} +2 -2
- package/dist/start-CNaLDf-C.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-B0ABWo7p.mjs +0 -2
- package/dist/init-DJOhCR0z.mjs +0 -1
- package/dist/loader-BrYT-GRN.mjs +0 -1
- package/dist/preview-zknwrCOu.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DamXgXPd.js +0 -1
- package/dist/public/assets/globals-B1VH9dVh.css +0 -1
- package/dist/start-BFpIbOtS.mjs +0 -1
- /package/dist/public/assets/{globals-DLE5hh7Z.js → globals-Dsi-fA9A.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-BckCY-VI.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-DHyWZzIa.js";import{n as m,r as ee,t as h}from"./propagation-api-OHat7V1z.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-BckCY-VI.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.44.0`}?.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.44.0`};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-DHyWZzIa.js";import{n as m,r as ee,t as h}from"./propagation-api-OHat7V1z.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-BckCY-VI.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.45.0`}?.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.45.0`};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-OHat7V1z.js";import{n}from"./startup-marks-CqVzdU1y.js";import{getAppTracer as r}from"./telemetry-impl-
|
|
1
|
+
import{n as e,t}from"./propagation-api-OHat7V1z.js";import{n}from"./startup-marks-CqVzdU1y.js";import{getAppTracer as r}from"./telemetry-impl-BFTBY40l.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-rVKisiec.js → typing-burst-detector-ZNMuwopa.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{C as n,G as r,It as i,Rt as a,Tn as o,W as s,Wt as c,_t as l,dt as u,pt as d,r as f,xt as p}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{C as n,G as r,It as i,Rt as a,Tn as o,W as s,Wt as c,_t as l,dt as u,pt as d,r as f,xt as p}from"./DocumentContext-B-29n_HL.js";import{t as m}from"./react-f2sANaYj.js";import{n as h,r as g}from"./dist-Nvb76hAm.js";import{r as _,t as v}from"./useQuery-ZeEDLtxh.js";import{t as y}from"./compiler-runtime-BfE3aGVn.js";import{s as b}from"./createLucideIcon-DAkhoPjT.js";import{t as x}from"./button-Gol9BgNB.js";import{i as S,n as C,t as w}from"./tooltip-B4J7VHmA.js";import{n as T,r as E,t as D}from"./collapsible-B1mS1n9y.js";import{A as O,E as k,P as A,lt as j}from"./CodeMirrorPropInput-CUPvWzYm.js";import{n as M,t as N}from"./toggle-group-CjXmmTGy.js";import{$r as P,Jt as F,R as I,ci as L,gt as R,jn as z,xr as B,yt as V,z as H}from"./dist-CYN1QNvi.js";import{t as U}from"./chevron-right-C8oTR6gu.js";import{n as W}from"./CopyButton-1Q6Wnnjb.js";import{i as ee,r as te}from"./prop-types-B-j2FcIV.js";import{l as ne}from"./workspace-paths-C4Wwi52h.js";import{t as G}from"./refresh-cw-BfeWGCsv.js";import{t as K}from"./triangle-alert-Clgvyc7B.js";import{t as re}from"./wrench-BfoTvqT9.js";import{n as ie}from"./dist-BLAMau9Z.js";import{t as q}from"./dist-q14fBS3T.js";import{a as ae}from"./use-settings-route-Ch_E9Uw0.js";import{c as oe}from"./documents-events-DUo-r8o3.js";import{a as se,i as ce}from"./startup-marks-CqVzdU1y.js";import{a as le,s as ue}from"./doc-hash-BKfBCyjO.js";import{t as de}from"./badge-Dba4cvJR.js";import{C as fe,y as pe}from"./config-provider--LBV5X-F.js";import{Dt as me,Ft as he,It as ge,J as _e,Q as ve,X as ye}from"./dist-DNwOaDhC.js";import{a as be,i as xe,n as Se,o as Ce,r as we,s as Te,t as Ee}from"./panel-C8ZhM4q-.js";import{t as De}from"./lint-plugin-meta-J-wb-uxW.js";import{t as Oe}from"./skeleton-BG12Hmzn.js";import{a as ke,d as Ae}from"./lint-config-client-bcseyVIk.js";var je=56,Me=2,Ne=150,Pe=2e3;function Fe(e,t,n){return e.top+e.height/2-(n+t)/2}function Ie(e,t){let n=Math.max(0,t.scrollHeight-t.clientHeight);return Math.max(0,Math.min(e,n))}function Le(e){let{docName:t,container:n,measureTarget:r,placement:i,intent:a,grade:o,landedMode:s,transition:c,onOutcome:u,onDiscardQueuedTarget:f,toolbarOffset:m=je,driftThresholdPx:h=Me,quietMs:g=Ne,abandonAfterMs:_=Pe}=e,v=e.contentColumn??n.firstElementChild,y=d(t),b=l(t,{yieldsToNavigation:a===`toggle`,supersede:()=>P(`superseded`)}),x=n.style.overflowAnchor;n.style.overflowAnchor=`none`,c&&se(`ok/mode-switch/transition`,{from:c.from,to:c.to,grade:o});let S=!1,C=null,w,T,E=0,D,O=()=>{let e=r();return e===null?null:Ie(i===`center`?Fe(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()}se(`ok/landing/land`,{grade:o,delta:e}),u?.({status:`landed`,delta:e})},N=()=>{if(S)return;S=!0;let e=C??n.scrollTop,t;try{t=A()}finally{j()}se(`ok/landing/abandoned`,{grade:o,target:e,delta:t}),u?.({status:`abandoned`,delta:t})},P=e=>{S||(S=!0,j(),e===`mode-flip`&&f?.(),u?.({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 Re(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 ze(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(ze).join(``):``}function Be(e,t){let{frontmatter:n,body:r}=L(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:Re(e.type),text:ze(e)})),fmLineCount:i}}catch{return performance.mark(`ok/block-spans/parse-failed`),{blocks:[],fmLineCount:i}}}function Ve(e,t){let{blocks:n,fmLineCount:r}=Be(e,t);return{spans:n.map(e=>({start:e.start,end:e.end})),fmLineCount:r}}function He(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 Ue(e){let t=e.childCount>0?e.child(e.childCount-1):null;return t!==null&&t.type.name===`paragraph`&&t.content.size===0?e.childCount-1:e.childCount}function We(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 Ge(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
3
3
|
`&&t.push(n+1);return t}function Ke(e,t,n){return t<=1?0:t-1>=e.length?n:e[t-1]??n}function qe(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 Je(e,t,n){return Math.max(t,Math.min(e,n))}function Ye(e,t){let n=e=>e.replace(/\s+/g,` `).trim();return n(e)===n(t)}function Xe(e,t){return t.inRange?t.tripwireOk?Ye(e.content,t.text)?`exact`:e.kind===t.kind?`same-type-ordinal`:`ordinal`:`ordinal`:`clamped`}function Ze(e){let t=null,n=null;function r(r){return n!==null&&t===r?n:(n={blocks:Be(r,e).blocks,lineStarts:Ge(r)},t=r,n)}return{captureFromWysiwyg(e,t,n){if(e.childCount===0)return null;let r=Je(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:Re(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=Je(t,0,e.length),s=He(i,qe(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=Ke(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=Ue(n)===i.length,c=i[Je(e.blockIndex,0,i.length-1)],l=Ke(a,c.start,t.length),u=Math.min(Ke(a,c.end+1,t.length),t.length),d=Xe(e,{inRange:o,tripwireOk:s,kind:c.kind,text:c.text}),f=l;return d===`exact`&&e.selectionInBlock!==void 0&&(f=Je(l+e.selectionInBlock,l,u)),{blockStart:l,blockEnd:u,point:f,confidence:d}},resolveInWysiwyg(e,{source:t,doc:n}){let i=Ue(n);if(i===0)return null;let{blocks:a}=r(t),o=e.blockIndex>=0&&e.blockIndex<i,s=i===a.length,c=Je(e.blockIndex,0,i-1),l=We(n,c,c+1);if(l===null)return null;let u=n.child(c),d=Xe(e,{inRange:o,tripwireOk:s,kind:Re(u.type.name),text:u.textContent});return{blockStart:l.from,blockEnd:l.to,point:l.from,confidence:d}}}}var Qe=he.define(),$e=he.define(),et=_e.mark({class:s}),tt=ge.define({create(){return _e.none},update(e,t){let n=e.map(t.changes);for(let e of t.effects)e.is(Qe)?n=_e.set([et.range(e.value.from,e.value.to)]):e.is($e)&&(n=_e.none);return n},provide:e=>ye.decorations.from(e)}),nt=new WeakMap,rt=ve.define(e=>({destroy(){let t=nt.get(e);t!==void 0&&(clearTimeout(t),nt.delete(e))}}));function it(e,t,n,i){let a=r(e.state.doc.length,t,n,i);if(!a)return;e.dispatch({effects:Qe.of(a)});let o=nt.get(e);o!==void 0&&clearTimeout(o);let s=setTimeout(()=>{nt.delete(e),e.dispatch({effects:$e.of(null)})},I);nt.set(e,s)}function at(){return[tt,rt]}var ot=3e4;function st(){let e=new Map,t=e=>e?Date.now()-e.rememberedAt>ot?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 ct=st(),lt=st(),J=ct.remember,ut=ct.peek,dt=ct.consume,ft=ct.clear;ct.clearForTest;var pt=lt.remember,mt=lt.peek,ht=lt.consume,gt=lt.clear;lt.clearForTest;function _t(e,t,n){return{start:fe(e,t),end:fe(e,n)}}function vt(e,t){let n=pe(e.start,t),r=pe(e.end,t);return n===null||r===null||r.index<=n.index?null:n.index}var yt=`open-knowledge:view-in-source`,Y=56,bt=null;function xt(){return bt??=Ze(O()),bt}function St(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?_t(n,o.blockStart,o.blockEnd):void 0}}function Ct(e){let{editor:t,docName:n,ytext:r}=e,i=k(t);if(!i)return;let a=i.state.selection.from,o=St(i.state.doc,a,r,xt(),`jump`);o&&J(n,o),window.dispatchEvent(new CustomEvent(yt,{detail:{docName:n}}))}function wt(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?_t(n,o.blockStart,o.blockEnd):void 0}}function Tt(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=vt(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 Et(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=vt(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 Dt(e,t){try{return e.coordsAtPos(t)}catch{return null}}function Ot(e,t,n){let r=Math.max(0,Math.min(n,e.state.doc.length)),i=t.getBoundingClientRect().top,a=Dt(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 kt(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 At(e,t,n){if(e.isDestroyed)return null;let r=kt(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 jt(){return typeof document>`u`?null:u()}function Mt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2;for(let t of[Y+1,Y+12,Y+40]){let i=e.posAtCoords({left:r,top:n.top+t});if(i)return i.pos}return null}function Nt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2;for(let t of[Y+1,Y+12,Y+40]){let i=e.posAtCoords({x:r,y:n.top+t});if(i!==null)return i}return null}function Pt(e){let{from:t,to:n,docName:r,ytext:i}=e;t===`wysiwyg`&&n===`source`?Ft(r,i):t===`source`&&n===`wysiwyg`&&It(r,i)}function Ft(e,t){let n=ut(e);if(n&&n.kind!==`selection-offset`)return;let r=c(e);if(!r)return;let i=k(r);if(!i)return;let a=jt();if(!a)return;let o=Mt(i,a);if(o===null)return;let s=St(i.state.doc,o,t,xt());s&&J(e,s)}function It(e,t){let n=i(e);if(!n)return;let r=jt();if(!r)return;let a=Nt(n,r);if(a===null)return;let o=c(e),s=o?k(o)?.state.doc:void 0,l=wt(t.toString(),a,t,xt(),s);l&&pt(e,l)}function Lt(e){let{view:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=c(n),s=o?k(o)?.state.doc:void 0;if(!s)return null;let u=Et(r,{source:t.state.doc.toString(),pmDoc:s,ydoc:i,resolver:xt()});if(!u)return null;let d=jt();if(!d)return null;let f=u,p=r.intent===`jump`,m=p?f.point:f.blockStart;t.dispatch({effects:ye.scrollIntoView(m,{y:`start`})});let h=!1,g=null,_=l(n,{yieldsToNavigation:!p,supersede:()=>{h=!0,_.release()}}),v=e=>{if(!h){if(Dt(t,m)===null&&e<8){requestAnimationFrame(()=>v(e+1));return}try{p&&(t.dispatch({selection:me.cursor(m)}),t.focus())}finally{_.release()}g=Le({docName:n,container:d,contentColumn:t.contentDOM,measureTarget:()=>Ot(t,d,m),placement:p?`center`:`top`,intent:p?`jump`:`toggle`,grade:f.confidence,landedMode:`source`,transition:a,toolbarOffset:Y,onOutcome:p?e=>{e.status===`landed`&&it(t,f.blockStart,f.blockEnd,f.confidence)}:void 0,onDiscardQueuedTarget:()=>ft(n)})}};return v(0),{cancel:e=>{h=!0,_.release(),g?.cancel(e)}}}function Rt(e){let{editor:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=k(t);if(!o)return null;let s=Tt(r,{source:i.getText(`source`).toString(),pmDoc:o.state.doc,ydoc:i,resolver:xt()});if(!s)return null;let c=jt();if(!c)return null;let l=s;return Le({docName:n,container:c,contentColumn:o.dom,measureTarget:()=>At(o,c,l.point),placement:`top`,intent:`toggle`,grade:l.confidence,landedMode:`wysiwyg`,transition:a,toolbarOffset:Y,onDiscardQueuedTarget:()=>gt(n)})}var X=e(m(),1),Z=y(),zt=null,Bt=[];function Vt(e){if(e===zt)return Bt;let t=Ht(e);return zt=e,Bt=t,t}function Ht(e){let t=[],n=new Map,r=z();for(let i=Ut(e);i<=e.lines;i++){let a=e.line(i);if(r(a.text))continue;let o=P(a.text,n);o&&t.push({slug:o.slug,from:a.from})}return t}function Ut(e){if(!Wt(e.line(1).text))return 1;for(let t=2;t<=e.lines;t++)if(Wt(e.line(t).text))return t+1;return 1}function Wt(e){return H.test(e.endsWith(`\r`)?e.slice(0,-1):e)}function Gt(e){let t=document.getElementById(e);return t?t.getBoundingClientRect().top:null}function Kt(e){let t=new Map;for(let n of Vt(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 qt(e,t){let n=(0,Z.c)(9),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{isSourceMode:o,docName:s}=r,c=o===void 0?!1:o,[l,u]=(0,X.useState)(void 0),d=(0,X.useRef)(null),f;n[2]===s?f=n[3]:(f=()=>s?i(s):null,n[2]=s,n[3]=f);let p=(0,X.useSyncExternalStore)(a,f,Jt),m,h;return n[4]!==c||n[5]!==e||n[6]!==p?(m=()=>{if(e.length===0||c&&!p){u(void 0);return}let t=function(){let t=c&&p?Kt(p):Gt,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))}u(i??r??e[0])},n=function(){d.current===null&&(d.current=requestAnimationFrame(()=>{d.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),d.current!==null&&(cancelAnimationFrame(d.current),d.current=null)}},h=[e,c,p],n[4]=c,n[5]=e,n[6]=p,n[7]=m,n[8]=h):(m=n[7],h=n[8]),(0,X.useEffect)(m,h),l}function Jt(){return null}var Q=t(),Yt=300;async function Xt(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new A(q._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=V.safeParse(n);throw e.success?Error(e.data.title):new A(q._({id:`zlErBl`}),{status:t.status})}let r=R.safeParse(n);if(!r.success)throw new A(q._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var Zt=32,Qt=12,$t=6,en=`open-knowledge:outline-nav`;function tn(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(ce,{name:`outline-panel`,children:(0,Q.jsx)(nn,{...e})}),t[0]=e,t[1]=n),n}function nn(e){let t=(0,Z.c)(53),{docName:n,isSourceMode:r,className:i}=e,a=i===void 0?``:i,{_:o}=g(),{pages:s,loading:c}=ee(),l=_(),{activeProvider:u,activeDocName:d}=f(),p,m;t[0]===n?(p=t[1],m=t[2]):(p=[`page-headings`,n],m=()=>Xt(n),t[0]=n,t[1]=p,t[2]=m);let y;t[3]!==n||t[4]!==c||t[5]!==s?(y=!c&&(s.has(n)||B(n)),t[3]=n,t[4]=c,t[5]=s,t[6]=y):y=t[6];let x;t[7]!==p||t[8]!==m||t[9]!==y?(x={queryKey:p,queryFn:m,enabled:y,staleTime:1/0},t[7]=p,t[8]=m,t[9]=y,t[10]=x):x=t[10];let{data:S,isLoading:C,error:w}=v(x),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]!==d||t[14]!==u||t[15]!==n||t[16]!==l?(D=()=>{if(!u||d!==n)return;let e=u.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,l.invalidateQueries({queryKey:[`page-headings`,n]})},Yt)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},O=[u,d,n,l],t[13]=d,t[14]=u,t[15]=n,t[16]=l,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,X.useEffect)(D,O);let k;t[19]===E?k=t[20]:(k=E.map(rn),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=qt(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={index:e,slug:t,mode:r?`source`:`wysiwyg`};i.mode===`source`&&J(n,{kind:`outline`,detail:i}),window.dispatchEvent(new CustomEvent(en,{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)*Qt+(Qt-$t)/2,R=P*Zt+(Zt-$t)/2,z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(Te,{children:(0,Q.jsx)(h,{id:`dD7NPy`})}),t[30]=z):z=t[30];let V;t[31]!==E.length||t[32]!==C?(V=!C&&(0,Q.jsx)(we,{children:E.length}),t[31]=E.length,t[32]=C,t[33]=V):V=t[33];let H;t[34]===V?H=t[35]:(H=(0,Q.jsxs)(Ce,{children:[z,V]}),t[34]=V,t[35]=H);let U;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?(U=w?(0,Q.jsx)(be,{className:`px-2`,children:w instanceof Error?w.message:o({id:`GuqOb1`})}):E.length===0&&!C?(0,Q.jsx)(xe,{className:`px-2`,children:(0,Q.jsx)(h,{id:`0BB9ID`})}):(0,Q.jsxs)(`nav`,{"aria-label":o({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,Q.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:$t,height:$t,transform:`translate(${L}px, ${R}px)`}}),E.map((e,t)=>{let n=e.slug===M;return(0,Q.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>I(t,e.slug),className:b(`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)*Qt+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]=U):U=t[45];let W;t[46]!==C||t[47]!==U?(W=(0,Q.jsx)(Se,{className:`px-3 py-2`,"aria-busy":C,children:U}),t[46]=C,t[47]=U,t[48]=W):W=t[48];let te;return t[49]!==a||t[50]!==H||t[51]!==W?(te=(0,Q.jsxs)(Ee,{className:a,children:[H,W]}),t[49]=a,t[50]=H,t[51]=W,t[52]=te):te=t[52],te}function rn(e){return e.slug}function an(e){let t=(0,Z.c)(10),{scope:n,onScopeChange:r}=e,{_:i}=g(),a;t[0]===r?a=t[1]:(a=e=>{e&&r(e)},t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i({id:`aBgwis`}),t[2]=i,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(M,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,Q.jsx)(h,{id:`UpCz01`})}),t[4]=s):s=t[4];let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(M,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,Q.jsx)(h,{id:`e0NrBM`})}),t[5]=c):c=t[5];let l;return t[6]!==n||t[7]!==a||t[8]!==o?(l=(0,Q.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,Q.jsxs)(N,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:a,"aria-label":o,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[s,c]})}),t[6]=n,t[7]=a,t[8]=o,t[9]=l):l=t[9],l}async function on(e={kind:`project`}){try{let t=e.kind===`path`?`?path=${encodeURIComponent(e.path)}`:e.kind===`doc`?`?doc=${encodeURIComponent(e.docName)}`:``,n=await fetch(`/api/audit${t}`);if(!n.ok)return console.warn(`[audit] request failed`,n.status,n.statusText),null;let r=await n.json().catch(()=>null),i=F.safeParse(r);return i.success?i.data:(console.warn(`[audit] response failed schema validation`,i.error.issues),null)}catch(e){return console.warn(`[audit] fetch threw`,e),null}}function sn(e){let t=(0,Z.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,i]=(0,X.useState)(n),a,o;return t[1]===e?(a=t[2],o=t[3]):(a=()=>{if(i(un),e===null)return;let t=!1,n=()=>{on({kind:`doc`,docName:e}).then(e=>{if(t||e===null)return;let n=e.files.flatMap(ln).filter(cn);i(e=>e.length===0&&n.length===0?e:n)})};n();let r=oe(e=>{e.includes(`backlinks`)&&n()});return()=>{t=!0,r()}},o=[e],t[1]=e,t[2]=a,t[3]=o),(0,X.useEffect)(a,o),r}function cn(e){return e.source===`links`}function ln(e){return e.diagnostics}function un(e){return e.length===0?e:[]}var dn={errorCount:0,warningCount:0},$=new Map,fn=new Set,pn=new Map;function mn(){let e=new Map;for(let[t,n]of $){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})}pn=e;for(let e of fn)e()}function hn(e){let t={lint:{errorCount:0,warningCount:0},links:{errorCount:0,warningCount:0}};for(let n of e){let e=n.source===`links`?t.links:t.lint;n.severity===`error`?e.errorCount+=1:e.warningCount+=1}return t}function gn(e){return fn.add(e),()=>{fn.delete(e)}}function _n(){return pn}function vn(e){$.clear();for(let t of e)$.set(le(t.file),hn(t.diagnostics));mn()}function yn(e,t){$.set(e,hn(t)),mn()}function bn(e,t,n){let r=$.get(e)??{lint:dn,links:dn},i=r[t];i.errorCount===n.errorCount&&i.warningCount===n.warningCount||($.set(e,{...r,[t]:n}),mn())}var xn=`open-knowledge:lint-nav`;function Sn(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function Cn(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function wn(e){let t=(0,Z.c)(35),{diagnostic:n,instanceCount:r}=e,{_:i}=g(),a=n.severity===`error`?W:K,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=b(`mt-0.5 size-3.5 shrink-0`,u),t[0]=u,t[1]=d);let f;t[2]!==a||t[3]!==d?(f=(0,Q.jsx)(a,{"aria-hidden":`true`,className:d}),t[2]=a,t[3]=d,t[4]=f):f=t[4];let p;t[5]===n.message?p=t[6]:(p=(0,Q.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,Q.jsxs)(`span`,{className:`mt-0.5 flex shrink-0 items-center gap-1`,children:[(0,Q.jsx)(de,{variant:`gray`,"data-testid":`problems-instance-count`,className:`h-4 px-1 font-sans text-[10px] leading-none`,children:(0,Q.jsx)(h,{id:`iZCZmF`,values:{instanceCount:r}})}),(0,Q.jsx)(U,{"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 _;t[10]!==f||t[11]!==p||t[12]!==m?(_=(0,Q.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]=_):_=t[13];let v=c&&`gap-0.5`,y;t[14]===v?y=t[15]:(y=b(`h-4 shrink-0 px-1 font-sans text-[10px] uppercase leading-none`,v),t[14]=v,t[15]=y);let x;t[16]===c?x=t[17]:(x=c?(0,Q.jsx)(o,{"aria-hidden":`true`,className:`size-2.5`}):null,t[16]=c,t[17]=x);let S;t[18]!==n.source||t[19]!==y||t[20]!==x?(S=(0,Q.jsxs)(de,{variant:`gray`,"data-testid":`problems-source-tag`,className:y,children:[x,n.source]}),t[18]=n.source,t[19]=y,t[20]=x,t[21]=S):S=t[21];let C;t[22]!==i||t[23]!==n.code||t[24]!==s||t[25]!==l?(C=l?n.code:`${n.code} · ${i({id:`enPTnx`,values:{displayLine:s}})}`,t[22]=i,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,Q.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,Q.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]!==_?(E=(0,Q.jsxs)(Q.Fragment,{children:[_,T]}),t[32]=T,t[33]=_,t[34]=E):E=t[34],E}function Tn(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 En(e){let t=(0,Z.c)(43),{group:n,onNavigate:r,navTitle:i,renderActions:a}=e,{_:o}=g(),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,Q.jsx)(wn,{diagnostic:s}),t[9]=s,t[10]=l);let u;t[11]!==o||t[12]!==c||t[13]!==l?(u=(0,Q.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,Q.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,Q.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,Q.jsx)(E,{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,Q.jsx)(wn,{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,Q.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,Q.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,Q.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})]},Dn(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,Q.jsx)(T,{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,Q.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,Q.jsx)(`li`,{className:`rounded`,"data-testid":`problems-duplicate-group`,children:(0,Q.jsxs)(D,{children:[c,d]})}),t[40]=c,t[41]=d,t[42]=f):f=t[42],f}function Dn(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function On(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function kn(e){let t=(0,Z.c)(11),{target:n,creating:r,disabled:i,onCreate:a}=e,{_:o}=g(),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,Q.jsx)(j,{"aria-hidden":`true`,className:`size-3`}),t[3]=c):c=t[3];let l;t[4]===r?l=t[5]:(l=r?(0,Q.jsx)(h,{id:`E9bKSA`}):(0,Q.jsx)(h,{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,Q.jsxs)(x,{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 An(e){let t=(0,Z.c)(8),{tip:n,testId:r,children:i}=e,a;t[0]===i?a=t[1]:(a=(0,Q.jsx)(S,{asChild:!0,children:(0,Q.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,Q.jsx)(C,{"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,Q.jsxs)(w,{children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function jn(e){let t=(0,Z.c)(21),{count:n,problemCount:r,aiAvailable:i,disabled:a,onClick:o,children:s}=e,{_:c}=g(),l;t[0]!==i||t[1]!==n||t[2]!==r?(l=n>0?(0,Q.jsx)(h,{id:`vjwsDi`,values:{count:n}}):r===0?(0,Q.jsx)(h,{id:`gAhHu7`}):i?(0,Q.jsx)(h,{id:`zA9zRL`}):(0,Q.jsx)(h,{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,Q.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),t[9]=d):d=t[9];let f;t[10]!==s||t[11]!==n?(f=s??(0,Q.jsx)(h,{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,Q.jsxs)(x,{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,Q.jsx)(An,{testId:`problems-auto-fix-tip`,tip:l,children:p}),t[18]=l,t[19]=p,t[20]=m):m=t[20],m}function Mn(e){let t=(0,Z.c)(12),{count:n,disabled:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(h,{id:`mgDKWS`,values:{count:n}}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(ne,{"aria-hidden":`true`,className:`size-3`}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Q.jsx)(h,{id:`gyHDWC`,values:{count:n}}),t[3]=n,t[4]=s);let c;t[5]!==r||t[6]!==i||t[7]!==s?(c=(0,Q.jsxs)(x,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:i,"data-testid":`problems-fix-with-ai`,children:[o,s]}),t[5]=r,t[6]=i,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsx)(An,{testId:`problems-fix-with-ai-tip`,tip:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Nn(e){let t=(0,Z.c)(14),{docName:r,diagnostics:i,onFix:a,onAutoFix:o,onAskAi:s,onFixWithAi:c}=e,{_:l}=g(),[u,d]=(0,X.useState)(`doc`),{data:f}=Ae(),p=f===null?null:f.effective.enabled?De.filter(e=>f.effective.plugins[e.id].enabled):[],m=p!==null&&p.length===0,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={status:`idle`},t[0]=_):_=t[0];let[v,y]=(0,X.useState)(_),[b,T]=(0,X.useState)(null),E=te(),[D,O]=(0,X.useState)(null),k=(0,X.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,X.useEffect)(A,j);let M=[...i].sort(Sn),N=On(M),P=async function(e){let t=e.linkTarget;if(!(t===void 0||D!==null||E===null)){O(t);try{await n({initialDir:``,suggestedName:t},{addPage:E.addPage})}catch(e){let t=e;ie.error(t instanceof Error?t.message:l({id:`tfi40B`})),k.current&&O(null);return}ie.success(l({id:`EWCJFu`,values:{target:t}})),k.current&&O(null),k.current&&v.status===`loaded`&&await F()}};async function F(){y({status:`loading`});let e=await on();e!==null&&vn(e.files),k.current&&y(e===null?{status:`failed`}:{status:`loaded`,result:e})}let I=v.status===`loaded`?v.result.files.filter(Rn):[],L=async function(){if(b!==null||I.length===0)return;T({done:0,total:I.length});let e=[];for(let t of I){let n=await ke(le(t.file));if(!k.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),T(Ln)}if(T(null),e.length>0){let t=e[0];ie.error(l({id:`fru3T7`,values:{0:e.length,1:I.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await F()}catch{k.current&&y({status:`failed`})}},R=function(e){d(e),e===`project`&&v.status===`idle`&&F()},z;t[3]===r?z=t[4]:(z=function(e){let t=Cn(e);J(r,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(xn,{detail:t}))},t[3]=r,t[4]=z);let B=z,V;t[5]!==r||t[6]!==B?(V=function(e,t){let n=le(e);if(n===r){B(t);return}J(n,{kind:`lint`,detail:Cn(t)}),window.location.hash=ue(n)},t[5]=r,t[6]=B,t[7]=V):V=t[7];let H=V,U=function(e){let t=a!==void 0&&(e.fixes?.length??0)>0,n=e.linkTarget!==void 0&&E!==null;if(!t&&!n&&s===void 0)return null;let r=`${e.source}/${e.code}`;return(0,Q.jsxs)(Q.Fragment,{children:[n?(0,Q.jsx)(kn,{target:e.linkTarget??``,creating:D===e.linkTarget,disabled:D!==null,onCreate:()=>void P(e)}):null,t?(0,Q.jsxs)(x,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>a?.(e),"aria-label":l({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,Q.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),(0,Q.jsx)(h,{id:`c4fVUV`})]}):null,s===void 0?null:(0,Q.jsxs)(x,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>s(e),"aria-label":l({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,Q.jsx)(ne,{"aria-hidden":`true`,className:`size-3`}),(0,Q.jsx)(h,{id:`xWEvuo`})]})]})},W;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(Te,{children:(0,Q.jsx)(h,{id:`OXdGnd`})}),t[8]=W):W=t[8];let ee=p!==null&&p.length>0&&(0,Q.jsxs)(w,{children:[(0,Q.jsx)(S,{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,Q.jsx)(h,{id:`yxF19Y`,values:{0:p.length}})}),(0,Q.jsx)(C,{"data-testid":`problems-active-plugins-tooltip`,children:(0,Q.jsx)(h,{id:`ws5o1F`,values:{0:p.map(In).join(`, `)}})})]}),G;t[9]===ee?G=t[10]:(G=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[W,ee]}),t[9]=ee,t[10]=G);let K=u===`doc`&&M.length>0&&(0,Q.jsx)(we,{children:M.length}),q;return t[11]!==K||t[12]!==G?(q=(0,Q.jsxs)(Ce,{children:[G,K]}),t[11]=K,t[12]=G,t[13]=q):q=t[13],(0,Q.jsxs)(Ee,{children:[q,(0,Q.jsx)(an,{scope:u,onScopeChange:R}),u===`doc`?(0,Q.jsx)(Se,{className:`px-2 py-2`,children:M.length===0?m?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xe,{className:`px-2`,"data-testid":`problems-no-plugins`,children:(0,Q.jsx)(h,{id:`Hngy37`})}),(0,Q.jsx)(`div`,{className:`px-2 pt-2`,children:(0,Q.jsx)(x,{variant:`outline`,size:`sm`,onClick:ae,"data-testid":`problems-enable-plugins`,children:(0,Q.jsx)(h,{id:`rnX-1S`})})})]}):(0,Q.jsx)(xe,{className:`px-2`,children:(0,Q.jsx)(h,{id:`ZI8uvA`})}):(0,Q.jsxs)(Q.Fragment,{children:[o!==void 0||c!==void 0?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 px-2 pb-1`,children:[o!==void 0&&(0,Q.jsx)(jn,{count:N,problemCount:M.length,aiAvailable:c!==void 0,disabled:N===0,onClick:o}),c!==void 0&&(0,Q.jsx)(Mn,{count:M.length,disabled:!1,onClick:()=>c(`doc`)})]}):null,(0,Q.jsx)(`ul`,{"aria-label":l({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:Tn(M).map(e=>(0,Q.jsx)(En,{group:e,onNavigate:B,navTitle:e=>l({id:`vbMHjo`,values:{0:e.range.start.line+1}}),renderActions:U},e.key))})]})}):(0,Q.jsx)(Bn,{audit:v,onRefresh:()=>void F(),onNavigate:H,fixableCount:I.reduce(Fn,0),problemCount:v.status===`loaded`?v.result.files.reduce(Pn,0):0,fixing:b,onAutoFix:()=>void L(),onFixWithAi:c===void 0||v.status!==`loaded`?void 0:()=>c(`project`),onCreateTarget:E===null?void 0:e=>void P(e),creatingTarget:D})]})}function Pn(e,t){return e+t.diagnostics.length}function Fn(e,t){return e+On(t.diagnostics)}function In(e){return e.label}function Ln(e){return e===null?e:{...e,done:e.done+1}}function Rn(e){return e.diagnostics.some(zn)}function zn(e){return(e.fixes?.length??0)>0}function Bn(e){let t=(0,Z.c)(57),{audit:n,onRefresh:r,onNavigate:i,fixableCount:a,problemCount:o,fixing:s,onAutoFix:c,onFixWithAi:l,onCreateTarget:u,creatingTarget:d}=e,{_:f}=g(),p=n.status===`loading`||n.status===`idle`,m;t[0]!==n.result||t[1]!==n.status?(m=n.status===`loaded`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,Q.jsx)(h,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=m):m=t[2];let _;t[3]===m?_=t[4]:(_=(0,Q.jsx)(`p`,{className:`min-w-0 truncate text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:m}),t[3]=m,t[4]=_);let v;t[5]===f?v=t[6]:(v=f({id:`I7y_vn`}),t[5]=f,t[6]=v);let y=p||s!==null,b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(G,{"aria-hidden":`true`,className:`size-3.5`}),t[7]=b):b=t[7];let T;t[8]!==r||t[9]!==v||t[10]!==y?(T=(0,Q.jsx)(S,{asChild:!0,children:(0,Q.jsx)(x,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":v,"data-testid":`problems-audit-refresh`,disabled:y,onClick:r,children:b})}),t[8]=r,t[9]=v,t[10]=y,t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(C,{"data-testid":`problems-audit-refresh-tooltip`,children:(0,Q.jsx)(h,{id:`I7y_vn`})}),t[12]=E):E=t[12];let D;t[13]===T?D=t[14]:(D=(0,Q.jsxs)(w,{children:[T,E]}),t[13]=T,t[14]=D);let O;t[15]!==_||t[16]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[_,D]}),t[15]=_,t[16]=D,t[17]=O):O=t[17];let k;t[18]!==f||t[19]!==s?(k=s===null?null:(0,Q.jsx)(`span`,{className:`sr-only`,role:`status`,children:f({id:`gZElfU`,values:{0:s.done,1:s.total}})}),t[18]=f,t[19]=s,t[20]=k):k=t[20];let A=l!==void 0,j=p||s!==null||a===0,M;t[21]===s?M=t[22]:(M=s===null?void 0:(0,Q.jsx)(h,{id:`S9t1PI`,values:{0:s.done,1:s.total}}),t[21]=s,t[22]=M);let N;t[23]!==a||t[24]!==c||t[25]!==o||t[26]!==A||t[27]!==j||t[28]!==M?(N=(0,Q.jsx)(jn,{count:a,problemCount:o,aiAvailable:A,disabled:j,onClick:c,children:M}),t[23]=a,t[24]=c,t[25]=o,t[26]=A,t[27]=j,t[28]=M,t[29]=N):N=t[29];let P;t[30]!==s||t[31]!==l||t[32]!==o?(P=l!==void 0&&o>0?(0,Q.jsx)(Mn,{count:o,disabled:s!==null,onClick:l}):null,t[30]=s,t[31]=l,t[32]=o,t[33]=P):P=t[33];let F;t[34]!==k||t[35]!==N||t[36]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:[k,N,P]}),t[34]=k,t[35]=N,t[36]=P,t[37]=F):F=t[37];let I;t[38]!==F||t[39]!==O?(I=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 px-2 pb-1`,children:[O,F]}),t[38]=F,t[39]=O,t[40]=I):I=t[40];let L;t[41]!==f||t[42]!==p?(L=p&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":f({id:`dx-TwN`}),children:[1,2,3].map(Vn)}),t[41]=f,t[42]=p,t[43]=L):L=t[43];let R;t[44]===n.status?R=t[45]:(R=n.status===`failed`&&(0,Q.jsx)(be,{className:`px-2 text-xs`,children:(0,Q.jsx)(h,{id:`IFezUv`})}),t[44]=n.status,t[45]=R);let z;t[46]!==n.result||t[47]!==n.status||t[48]!==d||t[49]!==u||t[50]!==i?(z=n.status===`loaded`&&(0,Q.jsx)(Hn,{result:n.result,onNavigate:i,onCreateTarget:u,creatingTarget:d}),t[46]=n.result,t[47]=n.status,t[48]=d,t[49]=u,t[50]=i,t[51]=z):z=t[51];let B;return t[52]!==I||t[53]!==L||t[54]!==R||t[55]!==z?(B=(0,Q.jsxs)(Se,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[I,L,R,z]}),t[52]=I,t[53]=L,t[54]=R,t[55]=z,t[56]=B):B=t[56],B}function Vn(e){return(0,Q.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,Q.jsx)(Oe,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(Oe,{className:`h-3 w-28`}),(0,Q.jsx)(Oe,{className:`h-3 w-40`})]})]},e)}function Hn(e){let t=(0,Z.c)(12),{result:n,onNavigate:r,onCreateTarget:i,creatingTarget:a}=e,{_:o}=g(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,Q.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(Un)}),t[0]=o,t[1]=n.warnings,t[2]=s):s=t[2];let c;t[3]!==a||t[4]!==i||t[5]!==r||t[6]!==n.fileCount||t[7]!==n.files?(c=n.files.length===0?(0,Q.jsx)(xe,{className:`px-2`,children:(0,Q.jsx)(h,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,Q.jsx)(Wn,{file:e,onNavigate:r,onCreateTarget:i,creatingTarget:a},e.file)),t[3]=a,t[4]=i,t[5]=r,t[6]=n.fileCount,t[7]=n.files,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Un(e,t){return(0,Q.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,Q.jsx)(K,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,Q.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Wn(e){let t=(0,Z.c)(41),{file:n,onNavigate:r,onCreateTarget:i,creatingTarget:a}=e,{_:o}=g(),s,c,l,u,d,f,p,m,h;if(t[0]!==o||t[1]!==a||t[2]!==n.diagnostics||t[3]!==n.file||t[4]!==i||t[5]!==r){let e=[...n.diagnostics].sort(Sn);c=D,p=!0,m=`problems-audit-group`;let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(U,{"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[15]=g):g=t[15];let _;t[16]===n.file?_=t[17]:(_=(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[16]=n.file,t[17]=_),h=(0,Q.jsxs)(E,{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:[g,_,(0,Q.jsx)(de,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),s=T,f=`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[18]!==o||t[19]!==n.file?(l=o({id:`zAJzIg`,values:{0:n.file}}),t[18]=o,t[19]=n.file,t[20]=l):l=t[20],u=`flex flex-col gap-0.5 pb-1 ps-3`;let v;t[21]!==o||t[22]!==a||t[23]!==n.file||t[24]!==i||t[25]!==r?(v=e=>(0,Q.jsx)(En,{group:e,onNavigate:e=>r(n.file,e),navTitle:e=>o({id:`xKDsGS`,values:{0:e.range.start.line+1,1:n.file}}),renderActions:e=>e.linkTarget===void 0||i===void 0?null:(0,Q.jsx)(kn,{target:e.linkTarget,creating:a===e.linkTarget,disabled:a!==null,onCreate:()=>i(e)})},e.key),t[21]=o,t[22]=a,t[23]=n.file,t[24]=i,t[25]=r,t[26]=v):v=t[26],d=Tn(e).map(v),t[0]=o,t[1]=a,t[2]=n.diagnostics,t[3]=n.file,t[4]=i,t[5]=r,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h}else s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14];let _;t[27]!==l||t[28]!==u||t[29]!==d?(_=(0,Q.jsx)(`ul`,{"aria-label":l,className:u,children:d}),t[27]=l,t[28]=u,t[29]=d,t[30]=_):_=t[30];let v;t[31]!==s||t[32]!==f||t[33]!==_?(v=(0,Q.jsx)(s,{className:f,children:_}),t[31]=s,t[32]=f,t[33]=_,t[34]=v):v=t[34];let y;return t[35]!==c||t[36]!==p||t[37]!==m||t[38]!==h||t[39]!==v?(y=(0,Q.jsxs)(c,{defaultOpen:p,"data-testid":m,children:[h,v]}),t[35]=c,t[36]=p,t[37]=m,t[38]=h,t[39]=v,t[40]=y):y=t[40],y}var Gn={words:0,chars:0,tokens:0},Kn=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,qn=/[\p{L}\p{N}]/u,Jn=new Set([`text`,`inlineCode`,`code`,`tag`]),Yn=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Xn=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Zn(e,t){if(!e)return;let n=e.type;if(!Yn.has(n)){if(Jn.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)Zn(n,t);if(Xn.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./globals-DLE5hh7Z.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a,t as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{s as c}from"./createLucideIcon-DAkhoPjT.js";import{t as l}from"./button-Gol9BgNB.js";import{t as u}from"./checkbox-DY-vIhnZ.js";import{t as d}from"./label-DyipnO5I.js";import{n as f,t as p}from"./radio-group-CGEdWasQ.js";import{Gt as m,Kt as h}from"./dist-CYN1QNvi.js";import{t as g}from"./check-GqWaoTdV.js";import{t as _}from"./loader-circle-Cg5SU7AZ.js";import{t as v}from"./input-D0ZW0Opq.js";import{t as y}from"./dist-q14fBS3T.js";import{t as b}from"./badge-Dba4cvJR.js";import{t as x}from"./textarea-tdCJViKf.js";var S=e(r(),1),C=t(),w=s();async function T(){let e=typeof window>`u`?void 0:window.okUninstall;if(e===void 0)return null;try{let t=await e.ready();return t.kind===`screen`?t.screen:null}catch{return null}}function E(e){let t=typeof window>`u`?void 0:window.okUninstall;t!==void 0&&t.send(e).catch(()=>void 0)}var D=n();function O(e){let t=(0,w.c)(6),{items:n}=e,r;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>(0,D.jsxs)(`li`,{className:`relative pb-5 pl-[30px] last:pb-1`,children:[t<n.length-1&&(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[22px] bottom-0.5 left-[9px] w-0.5 bg-border`}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:c(`absolute top-px left-0 inline-flex size-5 items-center justify-center rounded-full`,e.done?`bg-primary/15 text-primary`:`border-[1.5px] border-muted-foreground/50`),children:e.done&&(0,D.jsx)(g,{className:`size-3`})}),(0,D.jsx)(`span`,{className:`sr-only`,children:e.done?(0,D.jsx)(i,{id:`clJ3qM`}):(0,D.jsx)(i,{id:`yU_9ur`})}),(0,D.jsxs)(`span`,{className:`block`,children:[(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),e.detail!==void 0&&(0,D.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground leading-snug`,children:e.detail})]})]},e.label),t[2]=n.length,t[3]=e),r=n.map(e),t[0]=n,t[1]=r}else r=t[1];let a;return t[4]===r?a=t[5]:(a=(0,D.jsx)(`ol`,{className:`mb-1.5`,children:r}),t[4]=r,t[5]=a),a}function k(e){let t=(0,w.c)(49),{notice:n,onConfirm:r,onCancel:i,onRevealLog:o}=e,{_:s}=a(),c=(0,S.useId)(),u=(0,S.useId)(),d=n.cancelLabel!==void 0,f,p;t[0]!==d||t[1]!==i||t[2]!==r?(f=()=>{let e=e=>{e.key===`Escape`&&(d?i():r())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},p=[d,i,r],t[0]=d,t[1]=i,t[2]=r,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,S.useEffect)(f,p);let m;t[5]!==n.title||t[6]!==c?(m=(0,D.jsx)(`h1`,{id:c,className:`font-medium text-base leading-none`,children:n.title}),t[5]=n.title,t[6]=c,t[7]=m):m=t[7];let h;t[8]===n.subtitle?h=t[9]:(h=n.subtitle!==void 0&&(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-snug`,children:n.subtitle}),t[8]=n.subtitle,t[9]=h);let g;t[10]!==m||t[11]!==h?(g=(0,D.jsxs)(`header`,{className:`shrink-0 space-y-4 px-6 pt-5 pb-3.5`,children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]===n.paragraphs?_=t[14]:(_=n.paragraphs.map(A),t[13]=n.paragraphs,t[14]=_);let v;t[15]===n.checklist?v=t[16]:(v=n.checklist!==void 0&&(0,D.jsx)(O,{items:n.checklist}),t[15]=n.checklist,t[16]=v);let y;t[17]!==s||t[18]!==n.log?(y=n.log!==void 0&&(0,D.jsx)(`section`,{"aria-label":s({id:`Oi56Cu`}),tabIndex:0,className:`subtle-scrollbar mt-0.5 mb-2.5 min-h-20 flex-1 overflow-auto rounded-lg border border-border border-dotted bg-muted/40 px-3 py-2.5 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,D.jsx)(`pre`,{className:`select-text whitespace-pre-wrap font-mono text-xs leading-relaxed wrap-anywhere`,children:n.log})}),t[17]=s,t[18]=n.log,t[19]=y):y=t[19];let b;t[20]===n.footnote?b=t[21]:(b=n.footnote!==void 0&&(0,D.jsx)(`p`,{className:`select-text text-muted-foreground text-xs wrap-anywhere`,children:n.footnote}),t[20]=n.footnote,t[21]=b);let x;t[22]!==n.logRevealLabel||t[23]!==o?(x=n.logRevealLabel!==void 0&&(0,D.jsx)(`p`,{className:`mt-0.5`,children:(0,D.jsx)(l,{type:`button`,variant:`link-muted`,size:`xs`,className:`h-auto px-0 underline underline-offset-2`,onClick:o,children:n.logRevealLabel})}),t[22]=n.logRevealLabel,t[23]=o,t[24]=x):x=t[24];let C;t[25]!==u||t[26]!==x||t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==b?(C=(0,D.jsxs)(`div`,{id:u,className:`flex min-h-0 flex-1 flex-col px-6 pt-1 pb-4 text-sm`,children:[_,v,y,b,x]}),t[25]=u,t[26]=x,t[27]=_,t[28]=v,t[29]=y,t[30]=b,t[31]=C):C=t[31];let T;t[32]!==n.cancelLabel||t[33]!==i?(T=n.cancelLabel!==void 0&&(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:i,children:n.cancelLabel}),t[32]=n.cancelLabel,t[33]=i,t[34]=T):T=t[34];let E=n.danger===!0?`destructive`:`default`,k=!d,j;t[35]!==n.confirmLabel||t[36]!==r||t[37]!==E||t[38]!==k?(j=(0,D.jsx)(l,{type:`button`,variant:E,autoFocus:k,onClick:r,children:n.confirmLabel}),t[35]=n.confirmLabel,t[36]=r,t[37]=E,t[38]=k,t[39]=j):j=t[39];let M;t[40]!==T||t[41]!==j?(M=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[T,j]}),t[40]=T,t[41]=j,t[42]=M):M=t[42];let N;return t[43]!==u||t[44]!==C||t[45]!==M||t[46]!==g||t[47]!==c?(N=(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-labelledby":c,"aria-describedby":u,className:`flex h-dvh flex-col bg-background text-foreground`,children:[g,C,M]}),t[43]=u,t[44]=C,t[45]=M,t[46]=g,t[47]=c,t[48]=N):N=t[48],N}function A(e){return(0,D.jsx)(`p`,{className:`mb-2.5 leading-normal`,children:e},e)}function j(e){return e.open||e.running?`active`:e.recent?`recent`:null}function M(e){return e.split(`/`).filter(Boolean).at(-1)??e}function N(e){let t=(0,w.c)(9),{status:n}=e,{_:r}=a(),i;t[0]===r?i=t[1]:(i=r({id:`s_ereB`}),t[0]=r,t[1]=i);let o;t[2]===r?o=t[3]:(o=r({id:`_2cM9E`}),t[2]=r,t[3]=o);let s;t[4]!==i||t[5]!==o?(s={active:i,recent:o},t[4]=i,t[5]=o,t[6]=s):s=t[6];let c=s[n],l;return t[7]===c?l=t[8]:(l=(0,D.jsx)(b,{variant:`secondary`,className:`rounded-sm text-muted-foreground`,children:c}),t[7]=c,t[8]=l),l}function P(e){let t=(0,w.c)(28),{project:n,checked:r,onCheckedChange:i}=e,{_:o}=a(),s=(0,S.useId)(),c;t[0]===n?c=t[1]:(c=j(n),t[0]=n,t[1]=c);let l=c,f;t[2]===i?f=t[3]:(f=e=>i(e===!0),t[2]=i,t[3]=f);let p;t[4]!==o||t[5]!==n.path?(p=o({id:`CHfFN_`,values:{0:n.path}}),t[4]=o,t[5]=n.path,t[6]=p):p=t[6];let m;t[7]!==s||t[8]!==r||t[9]!==f||t[10]!==p?(m=(0,D.jsx)(u,{id:s,className:`mt-0.5`,checked:r,onCheckedChange:f,"aria-label":p}),t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===n.path?h=t[13]:(h=M(n.path),t[12]=n.path,t[13]=h);let g;t[14]===h?g=t[15]:(g=(0,D.jsx)(`span`,{className:`w-full truncate font-medium text-sm`,children:h}),t[14]=h,t[15]=g);let _;t[16]===n.path?_=t[17]:(_=(0,D.jsx)(`span`,{className:`w-full select-text break-words text-muted-foreground text-xs`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==s||t[19]!==g||t[20]!==_?(v=(0,D.jsxs)(d,{htmlFor:s,className:`min-w-0 flex-col items-start gap-0.5 font-normal`,children:[g,_]}),t[18]=s,t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;t[22]===l?y=t[23]:(y=l!==null&&(0,D.jsx)(`div`,{className:`flex justify-end max-sm:col-start-2 max-sm:justify-start`,children:(0,D.jsx)(N,{status:l})}),t[22]=l,t[23]=y);let b;return t[24]!==m||t[25]!==v||t[26]!==y?(b=(0,D.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2.5 border-border/60 border-b px-3 py-2.5 last:border-b-0 hover:bg-accent/40 max-sm:grid-cols-[auto_minmax(0,1fr)]`,children:[m,v,y]}),t[24]=m,t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function F(e){let t=(0,w.c)(45),{projects:n,onConfirm:r,onCancel:o}=e,{_:s}=a(),[c,f]=(0,S.useState)(ne),p=(0,S.useId)(),m=(0,S.useId)(),h=(0,S.useId)(),g=n.length>0&&c.size===n.length?!0:c.size>0?`indeterminate`:!1,_;t[0]===n?_=t[1]:(_=e=>f(e?new Set(n.map(I)):new Set),t[0]=n,t[1]=_);let v=_,y,b;t[2]!==o||t[3]!==n?(y=()=>{let e=e=>{if(e.key===`Escape`){o();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),f(new Set(n.map(te))))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},b=[o,n],t[2]=o,t[3]=n,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,S.useEffect)(y,b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,D.jsx)(i,{id:`PrVaZo`}),t[6]=x):x=t[6];let C;t[7]===p?C=t[8]:(C=(0,D.jsx)(`h1`,{id:p,className:`font-medium leading-none text-base`,children:x}),t[7]=p,t[8]=C);let T;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,D.jsx)(i,{id:`keop3U`}),t[9]=T):T=t[9];let E;t[10]===m?E=t[11]:(E=(0,D.jsx)(`p`,{id:m,className:`text-sm text-muted-foreground`,children:T}),t[10]=m,t[11]=E);let O;t[12]!==C||t[13]!==E?(O=(0,D.jsxs)(`header`,{className:`shrink-0 px-6 pt-5 pb-3.5 space-y-4`,children:[C,E]}),t[12]=C,t[13]=E,t[14]=O):O=t[14];let k;t[15]===s?k=t[16]:(k=s({id:`QySH4I`}),t[15]=s,t[16]=k);let A;t[17]!==s||t[18]!==n||t[19]!==h||t[20]!==g||t[21]!==c||t[22]!==v?(A=n.length===0?(0,D.jsx)(`div`,{className:`rounded-lg border border-border p-4`,children:(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`bKt9Jk`})})}):(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border`,children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2.5 border-border border-b px-3 py-2.5 bg-muted/30`,children:[(0,D.jsx)(u,{id:h,checked:g,onCheckedChange:e=>v(e===!0)}),(0,D.jsx)(d,{htmlFor:h,className:`flex-1 font-medium text-sm`,children:(0,D.jsx)(i,{id:`wgNoIs`})}),(0,D.jsxs)(`span`,{role:`status`,"aria-label":s({id:`nsUDL8`,values:{0:c.size,1:n.length}}),className:`text-muted-foreground text-xs tabular-nums`,children:[c.size,` / `,n.length]})]}),(0,D.jsx)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-scroll [scrollbar-gutter:stable]`,children:n.map((e,t)=>(0,D.jsx)(P,{project:e,checked:c.has(t),onCheckedChange:e=>{f(n=>{let r=new Set(n);return e?r.add(t):r.delete(t),r})}},e.path))})]}),t[17]=s,t[18]=n,t[19]=h,t[20]=g,t[21]=c,t[22]=v,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==k?(j=(0,D.jsx)(`section`,{"aria-label":k,className:`flex min-h-0 flex-1 flex-col px-6 py-3.5`,children:A}),t[24]=A,t[25]=k,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,D.jsx)(i,{id:`dEgA5A`}),t[27]=M):M=t[27];let N;t[28]===o?N=t[29]:(N=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:o,children:M}),t[28]=o,t[29]=N);let F;t[30]!==r||t[31]!==c?(F=()=>r([...c].sort(ee)),t[30]=r,t[31]=c,t[32]=F):F=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(i,{id:`J7nMqi`}),t[33]=L):L=t[33];let R;t[34]===F?R=t[35]:(R=(0,D.jsx)(l,{type:`button`,variant:`destructive`,onClick:F,children:L}),t[34]=F,t[35]=R);let z;t[36]!==N||t[37]!==R?(z=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[N,R]}),t[36]=N,t[37]=R,t[38]=z):z=t[38];let B;return t[39]!==m||t[40]!==j||t[41]!==z||t[42]!==O||t[43]!==p?(B=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":p,"aria-describedby":m,className:`flex h-dvh flex-col overflow-hidden bg-background text-foreground`,children:[O,j,z]}),t[39]=m,t[40]=j,t[41]=z,t[42]=O,t[43]=p,t[44]=B):B=t[44],B}function ee(e,t){return e-t}function te(e,t){return t}function I(e,t){return t}function ne(){return new Set}function L(){let e=(0,w.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(_,{"aria-hidden":`true`,className:`mx-auto mb-4 size-8 animate-spin text-primary motion-reduce:animate-none`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,D.jsx)(`h1`,{className:`mb-2 font-medium text-base leading-none`,children:(0,D.jsx)(i,{id:`j2229h`})}),e[1]=n):n=e[1];let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,D.jsx)(`main`,{className:`grid h-dvh place-items-center bg-background text-foreground`,children:(0,D.jsxs)(`div`,{role:`status`,className:`max-w-vw px-7 py-7 text-center`,children:[t,n,(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-relaxed`,children:(0,D.jsx)(i,{id:`kCjkGY`})})]})}),e[2]=r):r=e[2],r}function R(){let{_:e}=a();return{"workflow-fit":e({id:`5vAI6Z`}),"missing-feature":e({id:`cH0dkG`}),"hard-to-start":e({id:`uoJF_D`}),unreliable:e({id:`WGMoTY`}),"switched-tool":e({id:`jO18NZ`}),"one-off":e({id:`S3qu11`}),other:e({id:`aQyGJc`})}}function z(e){let t=(0,w.c)(86),{onSend:n,onSkip:r}=e,{_:o}=a(),s=R(),[c,g]=(0,S.useState)(``),[_,y]=(0,S.useState)(``),[b,C]=(0,S.useState)(!1),[T,E]=(0,S.useState)(``),O=(0,S.useRef)(null),k=(0,S.useId)(),A=(0,S.useId)(),j=(0,S.useId)(),M=(0,S.useId)(),N=(0,S.useId)(),P=(0,S.useId)(),F,ee;t[0]===b?(F=t[1],ee=t[2]):(F=()=>{b&&O.current?.focus()},ee=[b],t[0]=b,t[1]=F,t[2]=ee),(0,S.useEffect)(F,ee);let te;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,D.jsx)(i,{id:`ElyuiT`}),t[3]=te):te=t[3];let I;t[4]===k?I=t[5]:(I=(0,D.jsx)(`h1`,{id:k,className:`font-medium leading-none text-base`,children:te}),t[4]=k,t[5]=I);let ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,D.jsx)(i,{id:`ZDOq9A`}),t[6]=ne):ne=t[6];let L;t[7]===A?L=t[8]:(L=(0,D.jsx)(`p`,{id:A,className:`text-muted-foreground text-sm`,children:ne}),t[7]=A,t[8]=L);let z;t[9]!==I||t[10]!==L?(z=(0,D.jsxs)(`header`,{className:`px-6 pt-5 pb-3.5 space-y-4`,children:[I,L]}),t[9]=I,t[10]=L,t[11]=z):z=t[11];let B;t[12]!==T||t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==c?(B=e=>{e.preventDefault();let t=_.trim(),r=b?T.trim():``;n({...c===``?{}:{reason:c},...t===``?{}:{note:t},...r===``?{}:{email:r}})},t[12]=T,t[13]=b,t[14]=_,t[15]=n,t[16]=c,t[17]=B):B=t[17];let re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,D.jsx)(i,{id:`oxdGJn`}),t[18]=re):re=t[18];let V;t[19]===j?V=t[20]:(V=(0,D.jsx)(`p`,{id:j,className:`mb-2 font-medium text-sm`,children:re}),t[19]=j,t[20]=V);let H;t[21]!==j||t[22]!==s?(H=h.map(e=>(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-1 py-1`,children:[(0,D.jsx)(f,{id:`${j}-${e.value}`,value:e.value}),(0,D.jsx)(d,{htmlFor:`${j}-${e.value}`,className:`font-normal text-sm leading-snug`,children:s[e.value]})]},e.value)),t[21]=j,t[22]=s,t[23]=H):H=t[23];let U;t[24]!==j||t[25]!==c||t[26]!==H?(U=(0,D.jsx)(p,{"aria-labelledby":j,value:c,onValueChange:g,children:H}),t[24]=j,t[25]=c,t[26]=H,t[27]=U):U=t[27];let W;t[28]!==V||t[29]!==U?(W=(0,D.jsxs)(`div`,{className:`mb-6`,children:[V,U]}),t[28]=V,t[29]=U,t[30]=W):W=t[30];let ie;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(i,{id:`axQ1h6`}),t[31]=ie):ie=t[31];let G;t[32]===M?G=t[33]:(G=(0,D.jsx)(d,{htmlFor:M,className:`mb-2 font-medium text-sm`,children:ie}),t[32]=M,t[33]=G);let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=e=>y(e.target.value),t[34]=K):K=t[34];let q;t[35]!==_||t[36]!==M?(q=(0,D.jsx)(x,{id:M,rows:3,maxLength:m,value:_,onChange:K}),t[35]=_,t[36]=M,t[37]=q):q=t[37];let J;t[38]!==G||t[39]!==q?(J=(0,D.jsxs)(`div`,{className:`mb-6`,children:[G,q]}),t[38]=G,t[39]=q,t[40]=J):J=t[40];let ae;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>C(e===!0),t[41]=ae):ae=t[41];let Y;t[42]!==b||t[43]!==N?(Y=(0,D.jsx)(u,{id:N,checked:b,onCheckedChange:ae}),t[42]=b,t[43]=N,t[44]=Y):Y=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,D.jsx)(i,{id:`xEb24l`}),t[45]=oe):oe=t[45];let X;t[46]===N?X=t[47]:(X=(0,D.jsx)(d,{htmlFor:N,className:`font-medium text-sm`,children:oe}),t[46]=N,t[47]=X);let Z;t[48]!==Y||t[49]!==X?(Z=(0,D.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[Y,X]}),t[48]=Y,t[49]=X,t[50]=Z):Z=t[50];let se=!b,ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,D.jsx)(i,{id:`ATGYL1`}),t[51]=ce):ce=t[51];let Q;t[52]===P?Q=t[53]:(Q=(0,D.jsx)(d,{htmlFor:P,className:`mb-2 font-medium text-sm sr-only`,children:ce}),t[52]=P,t[53]=Q);let le;t[54]===o?le=t[55]:(le=o({id:`JHf6qZ`}),t[54]=o,t[55]=le);let ue=!b,de;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>E(e.target.value),t[56]=de):de=t[56];let fe;t[57]!==T||t[58]!==P||t[59]!==le||t[60]!==ue?(fe=(0,D.jsx)(v,{id:P,ref:O,type:`email`,maxLength:320,autoComplete:`email`,spellCheck:!1,placeholder:le,disabled:ue,value:T,onChange:de}),t[57]=T,t[58]=P,t[59]=le,t[60]=ue,t[61]=fe):fe=t[61];let $;t[62]!==se||t[63]!==Q||t[64]!==fe?($=(0,D.jsxs)(`div`,{className:`mb-6`,hidden:se,children:[Q,fe]}),t[62]=se,t[63]=Q,t[64]=fe,t[65]=$):$=t[65];let pe;t[66]!==W||t[67]!==J||t[68]!==Z||t[69]!==$?(pe=(0,D.jsxs)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-6 pt-1 pb-4`,children:[W,J,Z,$]}),t[66]=W,t[67]=J,t[68]=Z,t[69]=$,t[70]=pe):pe=t[70];let me;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,D.jsx)(i,{id:`6Uau97`}),t[71]=me):me=t[71];let he;t[72]===r?he=t[73]:(he=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:r,children:me}),t[72]=r,t[73]=he);let ge;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,D.jsx)(l,{type:`submit`,children:(0,D.jsx)(i,{id:`xMsnTe`})}),t[74]=ge):ge=t[74];let _e;t[75]===he?_e=t[76]:(_e=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[he,ge]}),t[75]=he,t[76]=_e);let ve;t[77]!==pe||t[78]!==_e||t[79]!==B?(ve=(0,D.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:B,children:[pe,_e]}),t[77]=pe,t[78]=_e,t[79]=B,t[80]=ve):ve=t[80];let ye;return t[81]!==A||t[82]!==ve||t[83]!==z||t[84]!==k?(ye=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":k,"aria-describedby":A,className:`flex h-dvh flex-col bg-background text-foreground`,children:[z,ve]}),t[81]=A,t[82]=ve,t[83]=z,t[84]=k,t[85]=ye):ye=t[85],ye}function B(){let e=(0,w.c)(9),[t,n]=(0,S.useState)(null),r,a;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return T().then(t=>{e&&n(t)}),()=>{e=!1}},a=[],e[0]=r,e[1]=a):(r=e[0],a=e[1]),(0,S.useEffect)(r,a),t!==null)switch(t.kind){case`picker`:{let n;return e[2]===t.projects?n=e[3]:(n=(0,D.jsx)(F,{projects:t.projects,onConfirm:G,onCancel:ie}),e[2]=t.projects,e[3]=n),n}case`survey`:{let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(z,{onSend:W,onSkip:U}),e[4]=t):t=e[4],t}case`progress`:{let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(L,{}),e[5]=t):t=e[5],t}case`notice`:{let n;return e[6]===t.notice?n=e[7]:(n=(0,D.jsx)(k,{notice:t.notice,onConfirm:H,onCancel:V,onRevealLog:re}),e[6]=t.notice,e[7]=n),n}default:return t}let o;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,D.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background p-8 text-foreground`,children:(0,D.jsx)(`p`,{className:`text-center text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`tzGWeg`})})}),e[8]=o):o=e[8],o}function re(){return E({kind:`notice-reveal-log`})}function V(){return E({kind:`notice-cancel`})}function H(){return E({kind:`notice-confirm`})}function U(){return E({kind:`survey-skip`})}function W(e){return E({kind:`survey-send`,...e})}function ie(){return E({kind:`picker-cancel`})}function G(e){return E({kind:`picker-confirm`,selectedIndexes:e})}var K=document.getElementById(`root`);if(!K)throw Error(`Root element not found`);(0,C.createRoot)(K).render((0,D.jsx)(S.StrictMode,{children:(0,D.jsx)(o,{i18n:y,children:(0,D.jsx)(B,{})})}));
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./globals-Dsi-fA9A.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a,t as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{s as c}from"./createLucideIcon-DAkhoPjT.js";import{t as l}from"./button-Gol9BgNB.js";import{t as u}from"./checkbox-DY-vIhnZ.js";import{t as d}from"./label-DyipnO5I.js";import{n as f,t as p}from"./radio-group-CGEdWasQ.js";import{Gt as m,Kt as h}from"./dist-CYN1QNvi.js";import{t as g}from"./check-GqWaoTdV.js";import{t as _}from"./loader-circle-Cg5SU7AZ.js";import{t as v}from"./input-D0ZW0Opq.js";import{t as y}from"./dist-q14fBS3T.js";import{t as b}from"./badge-Dba4cvJR.js";import{t as x}from"./textarea-tdCJViKf.js";var S=e(r(),1),C=t(),w=s();async function T(){let e=typeof window>`u`?void 0:window.okUninstall;if(e===void 0)return null;try{let t=await e.ready();return t.kind===`screen`?t.screen:null}catch{return null}}function E(e){let t=typeof window>`u`?void 0:window.okUninstall;t!==void 0&&t.send(e).catch(()=>void 0)}var D=n();function O(e){let t=(0,w.c)(6),{items:n}=e,r;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>(0,D.jsxs)(`li`,{className:`relative pb-5 pl-[30px] last:pb-1`,children:[t<n.length-1&&(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[22px] bottom-0.5 left-[9px] w-0.5 bg-border`}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:c(`absolute top-px left-0 inline-flex size-5 items-center justify-center rounded-full`,e.done?`bg-primary/15 text-primary`:`border-[1.5px] border-muted-foreground/50`),children:e.done&&(0,D.jsx)(g,{className:`size-3`})}),(0,D.jsx)(`span`,{className:`sr-only`,children:e.done?(0,D.jsx)(i,{id:`clJ3qM`}):(0,D.jsx)(i,{id:`yU_9ur`})}),(0,D.jsxs)(`span`,{className:`block`,children:[(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),e.detail!==void 0&&(0,D.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground leading-snug`,children:e.detail})]})]},e.label),t[2]=n.length,t[3]=e),r=n.map(e),t[0]=n,t[1]=r}else r=t[1];let a;return t[4]===r?a=t[5]:(a=(0,D.jsx)(`ol`,{className:`mb-1.5`,children:r}),t[4]=r,t[5]=a),a}function k(e){let t=(0,w.c)(49),{notice:n,onConfirm:r,onCancel:i,onRevealLog:o}=e,{_:s}=a(),c=(0,S.useId)(),u=(0,S.useId)(),d=n.cancelLabel!==void 0,f,p;t[0]!==d||t[1]!==i||t[2]!==r?(f=()=>{let e=e=>{e.key===`Escape`&&(d?i():r())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},p=[d,i,r],t[0]=d,t[1]=i,t[2]=r,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,S.useEffect)(f,p);let m;t[5]!==n.title||t[6]!==c?(m=(0,D.jsx)(`h1`,{id:c,className:`font-medium text-base leading-none`,children:n.title}),t[5]=n.title,t[6]=c,t[7]=m):m=t[7];let h;t[8]===n.subtitle?h=t[9]:(h=n.subtitle!==void 0&&(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-snug`,children:n.subtitle}),t[8]=n.subtitle,t[9]=h);let g;t[10]!==m||t[11]!==h?(g=(0,D.jsxs)(`header`,{className:`shrink-0 space-y-4 px-6 pt-5 pb-3.5`,children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]===n.paragraphs?_=t[14]:(_=n.paragraphs.map(A),t[13]=n.paragraphs,t[14]=_);let v;t[15]===n.checklist?v=t[16]:(v=n.checklist!==void 0&&(0,D.jsx)(O,{items:n.checklist}),t[15]=n.checklist,t[16]=v);let y;t[17]!==s||t[18]!==n.log?(y=n.log!==void 0&&(0,D.jsx)(`section`,{"aria-label":s({id:`Oi56Cu`}),tabIndex:0,className:`subtle-scrollbar mt-0.5 mb-2.5 min-h-20 flex-1 overflow-auto rounded-lg border border-border border-dotted bg-muted/40 px-3 py-2.5 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,D.jsx)(`pre`,{className:`select-text whitespace-pre-wrap font-mono text-xs leading-relaxed wrap-anywhere`,children:n.log})}),t[17]=s,t[18]=n.log,t[19]=y):y=t[19];let b;t[20]===n.footnote?b=t[21]:(b=n.footnote!==void 0&&(0,D.jsx)(`p`,{className:`select-text text-muted-foreground text-xs wrap-anywhere`,children:n.footnote}),t[20]=n.footnote,t[21]=b);let x;t[22]!==n.logRevealLabel||t[23]!==o?(x=n.logRevealLabel!==void 0&&(0,D.jsx)(`p`,{className:`mt-0.5`,children:(0,D.jsx)(l,{type:`button`,variant:`link-muted`,size:`xs`,className:`h-auto px-0 underline underline-offset-2`,onClick:o,children:n.logRevealLabel})}),t[22]=n.logRevealLabel,t[23]=o,t[24]=x):x=t[24];let C;t[25]!==u||t[26]!==x||t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==b?(C=(0,D.jsxs)(`div`,{id:u,className:`flex min-h-0 flex-1 flex-col px-6 pt-1 pb-4 text-sm`,children:[_,v,y,b,x]}),t[25]=u,t[26]=x,t[27]=_,t[28]=v,t[29]=y,t[30]=b,t[31]=C):C=t[31];let T;t[32]!==n.cancelLabel||t[33]!==i?(T=n.cancelLabel!==void 0&&(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:i,children:n.cancelLabel}),t[32]=n.cancelLabel,t[33]=i,t[34]=T):T=t[34];let E=n.danger===!0?`destructive`:`default`,k=!d,j;t[35]!==n.confirmLabel||t[36]!==r||t[37]!==E||t[38]!==k?(j=(0,D.jsx)(l,{type:`button`,variant:E,autoFocus:k,onClick:r,children:n.confirmLabel}),t[35]=n.confirmLabel,t[36]=r,t[37]=E,t[38]=k,t[39]=j):j=t[39];let M;t[40]!==T||t[41]!==j?(M=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[T,j]}),t[40]=T,t[41]=j,t[42]=M):M=t[42];let N;return t[43]!==u||t[44]!==C||t[45]!==M||t[46]!==g||t[47]!==c?(N=(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-labelledby":c,"aria-describedby":u,className:`flex h-dvh flex-col bg-background text-foreground`,children:[g,C,M]}),t[43]=u,t[44]=C,t[45]=M,t[46]=g,t[47]=c,t[48]=N):N=t[48],N}function A(e){return(0,D.jsx)(`p`,{className:`mb-2.5 leading-normal`,children:e},e)}function j(e){return e.open||e.running?`active`:e.recent?`recent`:null}function M(e){return e.split(`/`).filter(Boolean).at(-1)??e}function N(e){let t=(0,w.c)(9),{status:n}=e,{_:r}=a(),i;t[0]===r?i=t[1]:(i=r({id:`s_ereB`}),t[0]=r,t[1]=i);let o;t[2]===r?o=t[3]:(o=r({id:`_2cM9E`}),t[2]=r,t[3]=o);let s;t[4]!==i||t[5]!==o?(s={active:i,recent:o},t[4]=i,t[5]=o,t[6]=s):s=t[6];let c=s[n],l;return t[7]===c?l=t[8]:(l=(0,D.jsx)(b,{variant:`secondary`,className:`rounded-sm text-muted-foreground`,children:c}),t[7]=c,t[8]=l),l}function P(e){let t=(0,w.c)(28),{project:n,checked:r,onCheckedChange:i}=e,{_:o}=a(),s=(0,S.useId)(),c;t[0]===n?c=t[1]:(c=j(n),t[0]=n,t[1]=c);let l=c,f;t[2]===i?f=t[3]:(f=e=>i(e===!0),t[2]=i,t[3]=f);let p;t[4]!==o||t[5]!==n.path?(p=o({id:`CHfFN_`,values:{0:n.path}}),t[4]=o,t[5]=n.path,t[6]=p):p=t[6];let m;t[7]!==s||t[8]!==r||t[9]!==f||t[10]!==p?(m=(0,D.jsx)(u,{id:s,className:`mt-0.5`,checked:r,onCheckedChange:f,"aria-label":p}),t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===n.path?h=t[13]:(h=M(n.path),t[12]=n.path,t[13]=h);let g;t[14]===h?g=t[15]:(g=(0,D.jsx)(`span`,{className:`w-full truncate font-medium text-sm`,children:h}),t[14]=h,t[15]=g);let _;t[16]===n.path?_=t[17]:(_=(0,D.jsx)(`span`,{className:`w-full select-text break-words text-muted-foreground text-xs`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==s||t[19]!==g||t[20]!==_?(v=(0,D.jsxs)(d,{htmlFor:s,className:`min-w-0 flex-col items-start gap-0.5 font-normal`,children:[g,_]}),t[18]=s,t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;t[22]===l?y=t[23]:(y=l!==null&&(0,D.jsx)(`div`,{className:`flex justify-end max-sm:col-start-2 max-sm:justify-start`,children:(0,D.jsx)(N,{status:l})}),t[22]=l,t[23]=y);let b;return t[24]!==m||t[25]!==v||t[26]!==y?(b=(0,D.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2.5 border-border/60 border-b px-3 py-2.5 last:border-b-0 hover:bg-accent/40 max-sm:grid-cols-[auto_minmax(0,1fr)]`,children:[m,v,y]}),t[24]=m,t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function F(e){let t=(0,w.c)(45),{projects:n,onConfirm:r,onCancel:o}=e,{_:s}=a(),[c,f]=(0,S.useState)(ne),p=(0,S.useId)(),m=(0,S.useId)(),h=(0,S.useId)(),g=n.length>0&&c.size===n.length?!0:c.size>0?`indeterminate`:!1,_;t[0]===n?_=t[1]:(_=e=>f(e?new Set(n.map(I)):new Set),t[0]=n,t[1]=_);let v=_,y,b;t[2]!==o||t[3]!==n?(y=()=>{let e=e=>{if(e.key===`Escape`){o();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),f(new Set(n.map(te))))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},b=[o,n],t[2]=o,t[3]=n,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,S.useEffect)(y,b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,D.jsx)(i,{id:`PrVaZo`}),t[6]=x):x=t[6];let C;t[7]===p?C=t[8]:(C=(0,D.jsx)(`h1`,{id:p,className:`font-medium leading-none text-base`,children:x}),t[7]=p,t[8]=C);let T;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,D.jsx)(i,{id:`keop3U`}),t[9]=T):T=t[9];let E;t[10]===m?E=t[11]:(E=(0,D.jsx)(`p`,{id:m,className:`text-sm text-muted-foreground`,children:T}),t[10]=m,t[11]=E);let O;t[12]!==C||t[13]!==E?(O=(0,D.jsxs)(`header`,{className:`shrink-0 px-6 pt-5 pb-3.5 space-y-4`,children:[C,E]}),t[12]=C,t[13]=E,t[14]=O):O=t[14];let k;t[15]===s?k=t[16]:(k=s({id:`QySH4I`}),t[15]=s,t[16]=k);let A;t[17]!==s||t[18]!==n||t[19]!==h||t[20]!==g||t[21]!==c||t[22]!==v?(A=n.length===0?(0,D.jsx)(`div`,{className:`rounded-lg border border-border p-4`,children:(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`bKt9Jk`})})}):(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border`,children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2.5 border-border border-b px-3 py-2.5 bg-muted/30`,children:[(0,D.jsx)(u,{id:h,checked:g,onCheckedChange:e=>v(e===!0)}),(0,D.jsx)(d,{htmlFor:h,className:`flex-1 font-medium text-sm`,children:(0,D.jsx)(i,{id:`wgNoIs`})}),(0,D.jsxs)(`span`,{role:`status`,"aria-label":s({id:`nsUDL8`,values:{0:c.size,1:n.length}}),className:`text-muted-foreground text-xs tabular-nums`,children:[c.size,` / `,n.length]})]}),(0,D.jsx)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-scroll [scrollbar-gutter:stable]`,children:n.map((e,t)=>(0,D.jsx)(P,{project:e,checked:c.has(t),onCheckedChange:e=>{f(n=>{let r=new Set(n);return e?r.add(t):r.delete(t),r})}},e.path))})]}),t[17]=s,t[18]=n,t[19]=h,t[20]=g,t[21]=c,t[22]=v,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==k?(j=(0,D.jsx)(`section`,{"aria-label":k,className:`flex min-h-0 flex-1 flex-col px-6 py-3.5`,children:A}),t[24]=A,t[25]=k,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,D.jsx)(i,{id:`dEgA5A`}),t[27]=M):M=t[27];let N;t[28]===o?N=t[29]:(N=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:o,children:M}),t[28]=o,t[29]=N);let F;t[30]!==r||t[31]!==c?(F=()=>r([...c].sort(ee)),t[30]=r,t[31]=c,t[32]=F):F=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(i,{id:`J7nMqi`}),t[33]=L):L=t[33];let R;t[34]===F?R=t[35]:(R=(0,D.jsx)(l,{type:`button`,variant:`destructive`,onClick:F,children:L}),t[34]=F,t[35]=R);let z;t[36]!==N||t[37]!==R?(z=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[N,R]}),t[36]=N,t[37]=R,t[38]=z):z=t[38];let B;return t[39]!==m||t[40]!==j||t[41]!==z||t[42]!==O||t[43]!==p?(B=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":p,"aria-describedby":m,className:`flex h-dvh flex-col overflow-hidden bg-background text-foreground`,children:[O,j,z]}),t[39]=m,t[40]=j,t[41]=z,t[42]=O,t[43]=p,t[44]=B):B=t[44],B}function ee(e,t){return e-t}function te(e,t){return t}function I(e,t){return t}function ne(){return new Set}function L(){let e=(0,w.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(_,{"aria-hidden":`true`,className:`mx-auto mb-4 size-8 animate-spin text-primary motion-reduce:animate-none`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,D.jsx)(`h1`,{className:`mb-2 font-medium text-base leading-none`,children:(0,D.jsx)(i,{id:`j2229h`})}),e[1]=n):n=e[1];let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,D.jsx)(`main`,{className:`grid h-dvh place-items-center bg-background text-foreground`,children:(0,D.jsxs)(`div`,{role:`status`,className:`max-w-vw px-7 py-7 text-center`,children:[t,n,(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-relaxed`,children:(0,D.jsx)(i,{id:`kCjkGY`})})]})}),e[2]=r):r=e[2],r}function R(){let{_:e}=a();return{"workflow-fit":e({id:`5vAI6Z`}),"missing-feature":e({id:`cH0dkG`}),"hard-to-start":e({id:`uoJF_D`}),unreliable:e({id:`WGMoTY`}),"switched-tool":e({id:`jO18NZ`}),"one-off":e({id:`S3qu11`}),other:e({id:`aQyGJc`})}}function z(e){let t=(0,w.c)(86),{onSend:n,onSkip:r}=e,{_:o}=a(),s=R(),[c,g]=(0,S.useState)(``),[_,y]=(0,S.useState)(``),[b,C]=(0,S.useState)(!1),[T,E]=(0,S.useState)(``),O=(0,S.useRef)(null),k=(0,S.useId)(),A=(0,S.useId)(),j=(0,S.useId)(),M=(0,S.useId)(),N=(0,S.useId)(),P=(0,S.useId)(),F,ee;t[0]===b?(F=t[1],ee=t[2]):(F=()=>{b&&O.current?.focus()},ee=[b],t[0]=b,t[1]=F,t[2]=ee),(0,S.useEffect)(F,ee);let te;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,D.jsx)(i,{id:`ElyuiT`}),t[3]=te):te=t[3];let I;t[4]===k?I=t[5]:(I=(0,D.jsx)(`h1`,{id:k,className:`font-medium leading-none text-base`,children:te}),t[4]=k,t[5]=I);let ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,D.jsx)(i,{id:`ZDOq9A`}),t[6]=ne):ne=t[6];let L;t[7]===A?L=t[8]:(L=(0,D.jsx)(`p`,{id:A,className:`text-muted-foreground text-sm`,children:ne}),t[7]=A,t[8]=L);let z;t[9]!==I||t[10]!==L?(z=(0,D.jsxs)(`header`,{className:`px-6 pt-5 pb-3.5 space-y-4`,children:[I,L]}),t[9]=I,t[10]=L,t[11]=z):z=t[11];let B;t[12]!==T||t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==c?(B=e=>{e.preventDefault();let t=_.trim(),r=b?T.trim():``;n({...c===``?{}:{reason:c},...t===``?{}:{note:t},...r===``?{}:{email:r}})},t[12]=T,t[13]=b,t[14]=_,t[15]=n,t[16]=c,t[17]=B):B=t[17];let re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,D.jsx)(i,{id:`oxdGJn`}),t[18]=re):re=t[18];let V;t[19]===j?V=t[20]:(V=(0,D.jsx)(`p`,{id:j,className:`mb-2 font-medium text-sm`,children:re}),t[19]=j,t[20]=V);let H;t[21]!==j||t[22]!==s?(H=h.map(e=>(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-1 py-1`,children:[(0,D.jsx)(f,{id:`${j}-${e.value}`,value:e.value}),(0,D.jsx)(d,{htmlFor:`${j}-${e.value}`,className:`font-normal text-sm leading-snug`,children:s[e.value]})]},e.value)),t[21]=j,t[22]=s,t[23]=H):H=t[23];let U;t[24]!==j||t[25]!==c||t[26]!==H?(U=(0,D.jsx)(p,{"aria-labelledby":j,value:c,onValueChange:g,children:H}),t[24]=j,t[25]=c,t[26]=H,t[27]=U):U=t[27];let W;t[28]!==V||t[29]!==U?(W=(0,D.jsxs)(`div`,{className:`mb-6`,children:[V,U]}),t[28]=V,t[29]=U,t[30]=W):W=t[30];let ie;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(i,{id:`axQ1h6`}),t[31]=ie):ie=t[31];let G;t[32]===M?G=t[33]:(G=(0,D.jsx)(d,{htmlFor:M,className:`mb-2 font-medium text-sm`,children:ie}),t[32]=M,t[33]=G);let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=e=>y(e.target.value),t[34]=K):K=t[34];let q;t[35]!==_||t[36]!==M?(q=(0,D.jsx)(x,{id:M,rows:3,maxLength:m,value:_,onChange:K}),t[35]=_,t[36]=M,t[37]=q):q=t[37];let J;t[38]!==G||t[39]!==q?(J=(0,D.jsxs)(`div`,{className:`mb-6`,children:[G,q]}),t[38]=G,t[39]=q,t[40]=J):J=t[40];let ae;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>C(e===!0),t[41]=ae):ae=t[41];let Y;t[42]!==b||t[43]!==N?(Y=(0,D.jsx)(u,{id:N,checked:b,onCheckedChange:ae}),t[42]=b,t[43]=N,t[44]=Y):Y=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,D.jsx)(i,{id:`xEb24l`}),t[45]=oe):oe=t[45];let X;t[46]===N?X=t[47]:(X=(0,D.jsx)(d,{htmlFor:N,className:`font-medium text-sm`,children:oe}),t[46]=N,t[47]=X);let Z;t[48]!==Y||t[49]!==X?(Z=(0,D.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[Y,X]}),t[48]=Y,t[49]=X,t[50]=Z):Z=t[50];let se=!b,ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,D.jsx)(i,{id:`ATGYL1`}),t[51]=ce):ce=t[51];let Q;t[52]===P?Q=t[53]:(Q=(0,D.jsx)(d,{htmlFor:P,className:`mb-2 font-medium text-sm sr-only`,children:ce}),t[52]=P,t[53]=Q);let le;t[54]===o?le=t[55]:(le=o({id:`JHf6qZ`}),t[54]=o,t[55]=le);let ue=!b,de;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>E(e.target.value),t[56]=de):de=t[56];let fe;t[57]!==T||t[58]!==P||t[59]!==le||t[60]!==ue?(fe=(0,D.jsx)(v,{id:P,ref:O,type:`email`,maxLength:320,autoComplete:`email`,spellCheck:!1,placeholder:le,disabled:ue,value:T,onChange:de}),t[57]=T,t[58]=P,t[59]=le,t[60]=ue,t[61]=fe):fe=t[61];let $;t[62]!==se||t[63]!==Q||t[64]!==fe?($=(0,D.jsxs)(`div`,{className:`mb-6`,hidden:se,children:[Q,fe]}),t[62]=se,t[63]=Q,t[64]=fe,t[65]=$):$=t[65];let pe;t[66]!==W||t[67]!==J||t[68]!==Z||t[69]!==$?(pe=(0,D.jsxs)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-6 pt-1 pb-4`,children:[W,J,Z,$]}),t[66]=W,t[67]=J,t[68]=Z,t[69]=$,t[70]=pe):pe=t[70];let me;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,D.jsx)(i,{id:`6Uau97`}),t[71]=me):me=t[71];let he;t[72]===r?he=t[73]:(he=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:r,children:me}),t[72]=r,t[73]=he);let ge;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,D.jsx)(l,{type:`submit`,children:(0,D.jsx)(i,{id:`xMsnTe`})}),t[74]=ge):ge=t[74];let _e;t[75]===he?_e=t[76]:(_e=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[he,ge]}),t[75]=he,t[76]=_e);let ve;t[77]!==pe||t[78]!==_e||t[79]!==B?(ve=(0,D.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:B,children:[pe,_e]}),t[77]=pe,t[78]=_e,t[79]=B,t[80]=ve):ve=t[80];let ye;return t[81]!==A||t[82]!==ve||t[83]!==z||t[84]!==k?(ye=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":k,"aria-describedby":A,className:`flex h-dvh flex-col bg-background text-foreground`,children:[z,ve]}),t[81]=A,t[82]=ve,t[83]=z,t[84]=k,t[85]=ye):ye=t[85],ye}function B(){let e=(0,w.c)(9),[t,n]=(0,S.useState)(null),r,a;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return T().then(t=>{e&&n(t)}),()=>{e=!1}},a=[],e[0]=r,e[1]=a):(r=e[0],a=e[1]),(0,S.useEffect)(r,a),t!==null)switch(t.kind){case`picker`:{let n;return e[2]===t.projects?n=e[3]:(n=(0,D.jsx)(F,{projects:t.projects,onConfirm:G,onCancel:ie}),e[2]=t.projects,e[3]=n),n}case`survey`:{let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(z,{onSend:W,onSkip:U}),e[4]=t):t=e[4],t}case`progress`:{let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(L,{}),e[5]=t):t=e[5],t}case`notice`:{let n;return e[6]===t.notice?n=e[7]:(n=(0,D.jsx)(k,{notice:t.notice,onConfirm:H,onCancel:V,onRevealLog:re}),e[6]=t.notice,e[7]=n),n}default:return t}let o;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,D.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background p-8 text-foreground`,children:(0,D.jsx)(`p`,{className:`text-center text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`tzGWeg`})})}),e[8]=o):o=e[8],o}function re(){return E({kind:`notice-reveal-log`})}function V(){return E({kind:`notice-cancel`})}function H(){return E({kind:`notice-confirm`})}function U(){return E({kind:`survey-skip`})}function W(e){return E({kind:`survey-send`,...e})}function ie(){return E({kind:`picker-cancel`})}function G(e){return E({kind:`picker-confirm`,selectedIndexes:e})}var K=document.getElementById(`root`);if(!K)throw Error(`Root element not found`);(0,C.createRoot)(K).render((0,D.jsx)(S.StrictMode,{children:(0,D.jsx)(o,{i18n:y,children:(0,D.jsx)(B,{})})}));
|