@inkeep/open-knowledge 0.86.22-beta.2 → 0.86.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES.md +2 -3
- package/dist/cli.mjs +6 -6
- package/dist/constants-CKiX5Z0-.mjs +1 -0
- package/dist/{dist-Da2th568.mjs → dist-0qA3xZU8.mjs} +1 -1
- package/dist/{dist-Ba5C1acL.mjs → dist-CJAnJkM1.mjs} +350 -350
- package/dist/index.mjs +193 -193
- package/dist/init-BSBhjVTS.mjs +1 -0
- package/dist/{init-DQwwxClT.mjs → init-DQY_k8Bb.mjs} +2 -2
- package/dist/{launch-json-removal-BTsyhNZa.mjs → launch-json-removal-BToQcc3e.mjs} +1 -1
- package/dist/{loader-C9Q5gQZX.mjs → loader-BcKRvBDf.mjs} +1 -1
- package/dist/loader-vXeyPd6b.mjs +1 -0
- package/dist/{md-manager-BGnqyqi1-I7NmBKjQ.mjs → md-manager-BGnqyqi1-BzZ_8EQ9.mjs} +108 -108
- package/dist/native/native-config.win32-arm64-msvc.node +0 -0
- package/dist/native/native-config.win32-x64-msvc.node +0 -0
- package/dist/{open-browser-BHiCxjqR.mjs → open-browser-DhYyRIyx.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-ZSBZ3xb0.mjs → preview-BNlI5MHG.mjs} +1 -1
- package/dist/preview-Cvm5I8jO.mjs +1 -0
- package/dist/public/assets/{AboutSection-Bddd4fs4.js → AboutSection-LPELvEUl.js} +1 -1
- package/dist/public/assets/{AccountSection-CNRD1xil.js → AccountSection-Dla17okM.js} +1 -1
- package/dist/public/assets/ActivityModeContent-fbqWmmqu.js +1 -0
- package/dist/public/assets/{AddPropertiesButton-DQJbyeKa.js → AddPropertiesButton-C0bGsu-F.js} +2 -2
- package/dist/public/assets/AgentConnectionsSection-DhbJCdHu.js +1 -0
- package/dist/public/assets/{AgentDiffPane-BWmu01VJ.js → AgentDiffPane-BIzndumu.js} +1 -1
- package/dist/public/assets/{AppMenubar-vPHVy2jk.js → AppMenubar-ClplcAeM.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-TNXgljAW.js → AttachmentsSection-BjrHOhme.js} +1 -1
- package/dist/public/assets/AuthModal-DT32BOAJ.js +3 -0
- package/dist/public/assets/{BugReportHistory-CHujhV74.js → BugReportHistory-BM589t1t.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-CaE3cXFx.js → BugReportHistoryDialog-BfdDMBqN.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-BfH3veLO.js → ChangedOutsideBadge-DhpGZlDx.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-C58hE-N0.js → CodeMirrorPropInput-C5fRuWf2.js} +3 -3
- package/dist/public/assets/{ConsentDialogBody-k0k7metW.js → ConsentDialogBody-CaPp8huq.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-CtsS1TzN.js → ContentRulesSection-B5CAsULt.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DFNHnF7f.js → DiffViewBoundary-Czp-0Arc.js} +1 -1
- package/dist/public/assets/{DocumentContext-CTU0e2Bx.js → DocumentContext-DDDUTQJi.js} +5 -5
- package/dist/public/assets/{EditorModeToggle-Bx7oydUE.js → EditorModeToggle-Bd8FyUeG.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-J2mlKXB-.js → ExcalidrawDocEditor-4RZPPTS9.js} +1 -1
- package/dist/public/assets/FeedbackForm-DTSn-xTq.js +1 -0
- package/dist/public/assets/{GraphPanel-4ARXQVWm.js → GraphPanel-D1tkoAHM.js} +1 -1
- package/dist/public/assets/{HotkeysSection-D1qQH68p.js → HotkeysSection-C9sCf3j3.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DdVNq36t.js → ImportSkillDialog-Be_RD2Gk.js} +1 -1
- package/dist/public/assets/{IntegrationsSection-r5E7Aje8.js → IntegrationsSection-D3htSKMO.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-BnjR66BK.js → LinkPreviewsSection-D0uy1PxC.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-K6kei489.js → LintConfigEditor-l01M8Bbg.js} +1 -1
- package/dist/public/assets/{LintingSection-C3iZfRMz.js → LintingSection-12fgbDnF.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BNV1pKhc.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-0Sh_NEJL.js → ManagedArtifactProperties-vcuTAbYr.js} +1 -1
- package/dist/public/assets/McpConsentDialogBody-BwguVGDQ.js +1 -0
- package/dist/public/assets/{Mermaid-DqNhHNi1.js → Mermaid-Dqzqybsn.js} +2 -2
- package/dist/public/assets/{MermaidDocEditor-BoT5qW40.js → MermaidDocEditor-BCNSGhNo.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-BC8eehFh.js → NetworkAccessSection-Cxln0QK5.js} +1 -1
- package/dist/public/assets/{OkignoreSection-DplnnxQb.js → OkignoreSection-BudJQycp.js} +2 -2
- package/dist/public/assets/{ProjectTemplatesSection-BEchYRnN.js → ProjectTemplatesSection-DCliKsre.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-Cw-slag3.js → PropertyDisplayRow-CGpmYjl6.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-D9kayXul.js → PublishToGitHubDialog-BCeR1wkm.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-B0qjAvei.js → RegisteredAgentIcon-FmoZTlpS.js} +1 -1
- package/dist/public/assets/ReportBugDialogBody-J5o6Nxwn.js +3 -0
- package/dist/public/assets/ReportBugMenuTrigger-CAUKQKXn.js +1 -0
- package/dist/public/assets/SchemaConfigEditor-CHGUkiVe.js +1 -0
- package/dist/public/assets/{SearchSection-BEyNdgnB.js → SearchSection-Bcm55yb6.js} +1 -1
- package/dist/public/assets/{SessionsHost-CUCiAIsU.js → SessionsHost-DQ1ys2Oj.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Ckgz5zG7.js → SettingsDialogBody-BZpyRgRK.js} +2 -2
- package/dist/public/assets/{SettingsSectionHeader-BKhNIRp2.js → SettingsSectionHeader-DDNA1hrR.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DJbtqR4t.js → ShareReceiveDialog-DVtBOlIm.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-S1NDrjIK.js → ShareReceiveMissDialog-NFqekHGn.js} +1 -1
- package/dist/public/assets/{SharingSection-C-9tTPow.js → SharingSection-Y4AD8HPt.js} +1 -1
- package/dist/public/assets/SkillCostValue-DBT6aDG-.js +1 -0
- package/dist/public/assets/{SkillForkDialog-BHqkO5bK.js → SkillForkDialog-CPkWchji.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-29VzNm-A.js → SkillInstallMenu-DyKWxkEY.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-Z5JCe0T2.js → SkillOriginInline-D6YyylB6.js} +1 -1
- package/dist/public/assets/{SkillPluginBundleDialog-BnQu_DSM.js → SkillPluginBundleDialog-BmLQqQms.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CA1jXRwY.js → SkillToolbarControls-Bs8p51PI.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-D4YW1uOY.js → SkillsManagerSection-C0pgRzfs.js} +1 -1
- package/dist/public/assets/{SlidesPluginSection-BhUKklqb.js → SlidesPluginSection-B8KiQkqa.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-DXn_DkWH.js → SlidesToolbarControls-DxIDubwo.js} +1 -1
- package/dist/public/assets/{SourceEditor-qBn4t3Pw.js → SourceEditor-DP0HyTpn.js} +1 -1
- package/dist/public/assets/{SpellingSettings-C72xD-Zu.js → SpellingSettings-CElN7mrA.js} +1 -1
- package/dist/public/assets/{SyncSection-DGoZawVA.js → SyncSection-C1jLDoRh.js} +1 -1
- package/dist/public/assets/SyncStatusBadge-uu4Is4Gu.js +1 -0
- package/dist/public/assets/{TemplateRow-4LHta_yW.js → TemplateRow-DsoFn6-i.js} +2 -2
- package/dist/public/assets/{TerminalLaunchContext-DprnLNoQ.js → TerminalLaunchContext-DWUMDSpw.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BKIxzbz3.js → TerminalPanel-ByCiyPt3.js} +2 -2
- package/dist/public/assets/{TerminalSection-DeA7Mc8S.js → TerminalSection-C8HHQC_K.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DBpj8x6n.js → TerminalWindowApp-D6hHsUKZ.js} +1 -1
- package/dist/public/assets/{TextDocEditor-D-0SJlWs.js → TextDocEditor-BZCB5p1t.js} +1 -1
- package/dist/public/assets/ThemePluginSection-McKmY5If.js +6 -0
- package/dist/public/assets/ThreadView-OBNSZb0r.js +28 -0
- package/dist/public/assets/{TimelineDiffPane-DjUD0btj.js → TimelineDiffPane-BiVpBG0u.js} +1 -1
- package/dist/public/assets/agent-connections-DSKODCmO.js +1 -0
- package/dist/public/assets/{agent-registry-BdHe0AEQ.js → agent-registry-DoeDgmSS.js} +1 -1
- package/dist/public/assets/badge-DmdA1C7r.js +1 -0
- package/dist/public/assets/{bridge-BMIee44l.js → bridge-BeevbgaB.js} +1 -1
- package/dist/public/assets/{catalog-CEXii1s5.js → catalog-C1GEA-Va.js} +1 -1
- package/dist/public/assets/{client-version-BIzhoRew.js → client-version-CVbC_NDn.js} +1 -1
- package/dist/public/assets/{comment-chips-BPvAABqa.js → comment-chips-bT3Pgeu8.js} +1 -1
- package/dist/public/assets/{config-provider-Bp6jjEJo.js → config-provider-4lMZjvv1.js} +1 -1
- package/dist/public/assets/config-schema-CIaXsCAX.js +1 -0
- package/dist/public/assets/{css-color-to-hex-Csde6-Qs.js → css-color-to-hex-BRv_r6oZ.js} +1 -1
- package/dist/public/assets/{dist-DjMGDcCv.js → dist-BrKroYq_.js} +2 -2
- package/dist/public/assets/{doc-undo-manager-CZ6EGRm1.js → doc-undo-manager-BKDHRnV-.js} +1 -1
- package/dist/public/assets/field-controls-CCcf2ybM.js +1 -0
- package/dist/public/assets/field-controls-CKb1JSHS.js +6 -0
- package/dist/public/assets/globals-Cr0S8PDH.css +1 -0
- package/dist/public/assets/{ime-composition-DSJh5ynW.js → ime-composition-_BDVzXn4.js} +1 -1
- package/dist/public/assets/index-xygm6gU4.js +2209 -0
- package/dist/public/assets/{lint-config-client-B249C1D2.js → lint-config-client-DRJNyM2s.js} +1 -1
- package/dist/public/assets/{lint-plugins-BC7OZF4g.js → lint-plugins-Dufc6pEn.js} +1 -1
- package/dist/public/assets/{markdown-lint-BMeMGAz_.js → markdown-lint-BuEapKhE.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-Bt2f856y.js → markdownlint-rule-browser-BQ4c4vDN.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-EMNodxR7.js → pending-receive-nav-store-3JlvmWi7.js} +1 -1
- package/dist/public/assets/{preferred-session-events-csr4BF7i.js → preferred-session-events-Crz1K3Z-.js} +1 -1
- package/dist/public/assets/{progress-BuA8fnJw.js → progress-BK046Tty.js} +1 -1
- package/dist/public/assets/saved-themes-client-D09wxYQm.js +1 -0
- package/dist/public/assets/{schema-section-BHt16UFk.js → schema-section-CalUQFIh.js} +1 -1
- package/dist/public/assets/{schemas-api-CL5ZXlEj.js → schemas-api-CD98jV86.js} +4 -4
- package/dist/public/assets/{selection-context-XSpYhQXS.js → selection-context-BbfG0HO9.js} +1 -1
- package/dist/public/assets/{skills-api-CCijBzjo.js → skills-api-zXSg3eSX.js} +1 -1
- package/dist/public/assets/{src-BAjhxBed.js → src-D_7G4loI.js} +1 -1
- package/dist/public/assets/storage-scope-ldi41iCU.js +1 -0
- package/dist/public/assets/{tag-pill-input-qgfgpKpV.js → tag-pill-input-D6mNhknm.js} +1 -1
- package/dist/public/assets/{telemetry-impl-2aWm1nNh.js → telemetry-impl-C8ZWEJkv.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BWFcZ2S6.js → telemetry-startup-DNrsQYjz.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-3vnER_eI.js → terminal-launch-events-BhFGIVo_.js} +1 -1
- package/dist/public/assets/typing-burst-detector-DQWG6VAz.js +8 -0
- package/dist/public/assets/{uninstall-Is26Mh1k.js → uninstall-DFTOzPT_.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Cdry8WCA.js → use-activity-panel-D5VDwOQt.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-Bpi7AD0s.js → use-apply-config-color-theme-hiddt1uL.js} +2 -2
- package/dist/public/assets/{use-conflicts-CIjDyM9c.js → use-conflicts-BAjZ5TAV.js} +1 -1
- package/dist/public/assets/use-installed-clis-BopBqnEZ.js +2 -0
- package/dist/public/assets/{use-live-xterm-theme-BJbDRXxo.js → use-live-xterm-theme-C1wLG0Im.js} +1 -1
- package/dist/public/assets/{use-open-skill-CMD1tbhQ.js → use-open-skill-CFZd4B8h.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-7_z6UOU1.js → use-semantic-search-status-CRj98qO1.js} +1 -1
- package/dist/public/assets/{use-skill-origin-B9YRoKsz.js → use-skill-origin-BAc45a3e.js} +1 -1
- package/dist/public/assets/{use-skill-targets-DZmqRDS7.js → use-skill-targets-DIBQkXNG.js} +1 -1
- package/dist/public/assets/{use-skills-CkvdjORj.js → use-skills-B2fLFrq6.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BGuJ8pJt.js → use-terminal-enabled-B51ji6oG.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-KqewHehA.js → use-timeline-entry-diff-B6Z6EtU2.js} +1 -1
- package/dist/public/assets/{use-workspace-h2j0Puyv.js → use-workspace-Bgh-YT5K.js} +1 -1
- package/dist/public/index.html +54 -54
- package/dist/public/uninstall.html +4 -4
- package/dist/{registry-probes-CDCMWQYJ.mjs → registry-probes-DPKKrRUM.mjs} +1 -1
- package/dist/{removal-file-path-kusl1ATL.mjs → removal-file-path-Bxa6y1-K.mjs} +1 -1
- package/dist/{repair-launch-json-YZph-k4Q.mjs → repair-launch-json-GQqTV6X4.mjs} +1 -1
- package/dist/{repair-mcp-configs-y5VF8vXc.mjs → repair-mcp-configs-CZ1wHZDY.mjs} +1 -1
- package/dist/src-DJMiqowA.mjs +1 -0
- package/dist/{src-rjy1qN8a.mjs → src-DZwvkGg3.mjs} +1 -1
- package/dist/start-BAXRLMKN.mjs +1 -0
- package/dist/{start-CnRszU4H.mjs → start-DGllIRmH.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-ChfxeP5D.mjs +0 -1
- package/dist/init-DcaXhAp0.mjs +0 -1
- package/dist/loader-AcJm8RwD.mjs +0 -1
- package/dist/preview-DPCVWkPC.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-CMhH2SLu.js +0 -1
- package/dist/public/assets/AgentConnectionsSection-B9_oKPEW.js +0 -1
- package/dist/public/assets/AuthModal-YZGpNH__.js +0 -3
- package/dist/public/assets/FeedbackForm-WS2FLqgo.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DWt9xeVR.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-CVZcuVhW.js +0 -1
- package/dist/public/assets/ReportBugDialogBody-jHepd9au.js +0 -3
- package/dist/public/assets/ReportBugMenuTrigger-KsljCE5p.js +0 -1
- package/dist/public/assets/SchemaConfigEditor-DGbLXHPy.js +0 -1
- package/dist/public/assets/SkillCostValue-DK-VfwfI.js +0 -1
- package/dist/public/assets/SyncStatusBadge-LQ5mE5K2.js +0 -1
- package/dist/public/assets/ThemePluginSection-BHfep7sw.js +0 -6
- package/dist/public/assets/ThreadView-CBptoPIq.js +0 -28
- package/dist/public/assets/agent-connections-D6YhmKlS.js +0 -1
- package/dist/public/assets/badge-BIamhtRR.js +0 -1
- package/dist/public/assets/config-schema-zP71feeS.js +0 -1
- package/dist/public/assets/field-controls-B49FSs4r.js +0 -1
- package/dist/public/assets/field-controls-DBnF9Har.js +0 -6
- package/dist/public/assets/globals-kLKgmkBv.css +0 -1
- package/dist/public/assets/index-BFrCFx2V.js +0 -2209
- package/dist/public/assets/saved-themes-client-DFijgxrT.js +0 -1
- package/dist/public/assets/storage-scope-GPc8n3Ml.js +0 -1
- package/dist/public/assets/typing-burst-detector-Cjmr9jct.js +0 -8
- package/dist/public/assets/use-installed-clis-BTrIR9--.js +0 -2
- package/dist/src-Dxy4-Igo.mjs +0 -1
- package/dist/start-DUFCK-k6.mjs +0 -1
- /package/dist/public/assets/{globals-CcgTjZMO.js → globals-DHDe92Ga.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{i as o,n as ee,t as te}from"./tooltip-Bz6z4_se.js";import{a as ne,t as s}from"./ime-composition-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{i as o,n as ee,t as te}from"./tooltip-Bz6z4_se.js";import{a as ne,t as s}from"./ime-composition-_BDVzXn4.js";import{t as re}from"./x-DM2drskU.js";import{t as ie}from"./badge-DmdA1C7r.js";var c=i(),l=e(n(),1),u=t();function d(e){let t=(0,c.c)(96),{value:n,onChange:i,onBlur:d,placeholder:ae,id:f,disabled:p,grammar:oe,entryProblems:m,"aria-describedby":se,"aria-invalid":ce,ref:h}=e,le=oe===void 0?`frontmatter-tag`:oe,{_:g}=r(),[_,ue]=(0,l.useState)(``),[v,de]=(0,l.useState)(null),[y,b]=(0,l.useState)(null),fe=(0,l.useRef)(null),x;t[0]===h?x=t[1]:(x=e=>{fe.current=e,typeof h==`function`?h(e):h&&(h.current=e)},t[0]=h,t[1]=x);let pe=x,[S,C]=(0,l.useState)(!1),me=(0,l.useId)(),w=`${f??me}-grammar-hint`,T=`${f??me}-pill`,E;t[2]!==g||t[3]!==ae?(E=ae??g({id:`M5mfAe`}),t[2]=g,t[3]=ae,t[4]=E):E=t[4];let he=E,D=le===`frontmatter-tag`,O;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{ue(``),C(!1),de(null)},t[5]=O):O=t[5];let k=O,A;t[6]!==v||t[7]!==i||t[8]!==D||t[9]!==n?(A=e=>{let t=e.trim(),r=v===null?-1:n.indexOf(v);if(!t)return r!==-1&&i(n.filter((e,t)=>t!==r)),v!==null&&k(),!0;if(D&&!ne(t))return C(!0),!1;let a=D&&t.startsWith(`#`)?t.slice(1):t,o=n.indexOf(a);if(r===-1)return o===-1&&i([...n,a]),k(),!0;let ee=n.map((e,t)=>t===r?a:e);return i(o===-1||o===r?ee:ee.filter((e,t)=>t!==r)),k(),!0},t[6]=v,t[7]=i,t[8]=D,t[9]=n,t[10]=A):A=t[10];let j=A,M;t[11]!==i||t[12]!==n?(M=e=>{i(n.filter((t,n)=>n!==e))},t[11]=i,t[12]=n,t[13]=M):M=t[13];let N=M,P;t[14]!==j||t[15]!==p||t[16]!==_?(P=e=>{p||(_.trim()!==``&&j(_),ue(e),C(!1),b(null),de(e))},t[14]=j,t[15]=p,t[16]=_,t[17]=P):P=t[17];let F=P,I;t[18]!==y||t[19]!==n?(I=y===null?-1:n.indexOf(y),t[18]=y,t[19]=n,t[20]=I):I=t[20];let L=I,R;t[21]===n?R=t[22]:(R=e=>{b(e===null?null:n[e]??null)},t[21]=n,t[22]=R);let z=R,B,V;t[23]===v?(B=t[24],V=t[25]):(B=()=>{v!==null&&(fe.current?.focus(),fe.current?.select())},V=[v],t[23]=v,t[24]=B,t[25]=V),(0,l.useEffect)(B,V);let H=S?`true`:ce,ge=p&&`pointer-events-none opacity-60`,U;t[26]===ge?U=t[27]:(U=a(`flex min-h-8 w-full flex-wrap items-center gap-1.5 rounded-lg border border-input bg-transparent px-2 py-1 text-sm transition-colors`,`focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,ge),t[26]=ge,t[27]=U);let W;if(t[28]!==g||t[29]!==F||t[30]!==p||t[31]!==v||t[32]!==m||t[33]!==y||t[34]!==T||t[35]!==N||t[36]!==D||t[37]!==n){let e;t[39]!==g||t[40]!==F||t[41]!==p||t[42]!==v||t[43]!==m||t[44]!==y||t[45]!==T||t[46]!==N||t[47]!==D?(e=(e,t)=>{if(e===v)return null;let n=D&&!ne(e),r=m?.get(e),i=n||r!==void 0,s=r??(n?`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`:void 0),c=e===y,l=(0,u.jsxs)(ie,{id:`${T}-${t}`,variant:i?`destructive`:`secondary`,"data-tag-invalid":n?`true`:void 0,"data-tag-problem":r===void 0?void 0:`true`,"data-highlighted":c?`true`:void 0,className:a(`gap-1 pl-2 pr-1 normal-case`,i&&`ring-1 ring-destructive/40`,c&&`ring-2 ring-ring/70`),children:[(0,u.jsx)(`button`,{type:`button`,tabIndex:-1,className:`cursor-pointer rounded-sm font-mono`,onDoubleClick:()=>F(e),disabled:p,"aria-label":g({id:`NkNfSr`,values:{tag:e}}),title:s===void 0?g({id:`vHlhDc`}):void 0,children:e}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>N(t),"aria-label":g({id:`D4H2N6`,values:{tag:e}}),className:`rounded-sm p-0.5 hover:bg-background/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,disabled:p,children:(0,u.jsx)(re,{className:`size-3`,"aria-hidden":`true`})})]},e);return s===void 0?l:(0,u.jsxs)(te,{children:[(0,u.jsx)(o,{asChild:!0,children:l}),(0,u.jsx)(ee,{children:s})]},e)},t[39]=g,t[40]=F,t[41]=p,t[42]=v,t[43]=m,t[44]=y,t[45]=T,t[46]=N,t[47]=D,t[48]=e):e=t[48],W=n.map(e),t[28]=g,t[29]=F,t[30]=p,t[31]=v,t[32]=m,t[33]=y,t[34]=T,t[35]=N,t[36]=D,t[37]=n,t[38]=W}else W=t[38];let G;t[49]!==S||t[50]!==y?(G=e=>{ue(e.target.value),S&&C(!1),y!==null&&b(null)},t[49]=S,t[50]=y,t[51]=G):G=t[51];let K;t[52]!==j||t[53]!==F||t[54]!==_||t[55]!==S||t[56]!==v||t[57]!==z||t[58]!==L||t[59]!==N||t[60]!==n?(K=e=>{if(s(e))return;let t=e.currentTarget,r=t.selectionStart===0&&t.selectionEnd===0;if(v===null&&n.length>0){if(e.key===`ArrowLeft`&&(L!==-1||r)){e.preventDefault(),z(L===-1?n.length-1:Math.max(0,L-1));return}if(e.key===`ArrowRight`&&L!==-1){e.preventDefault(),z(L===n.length-1?null:L+1);return}if((e.key===`Home`||e.key===`End`)&&L!==-1){e.preventDefault(),z(e.key===`Home`?0:n.length-1);return}}if(L!==-1&&v===null){if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=n[L];t!==void 0&&F(t);return}if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let t=n[L-1]??null,r=n[L+1]??null;N(L),b(e.key===`Backspace`?t??r:r??t);return}}e.key===`Enter`?(_.trim()||v!==null)&&(e.preventDefault(),j(_)):e.key===`,`?(e.preventDefault(),_.trim()&&j(_)):e.key===`Tab`?_.trim()&&(e.preventDefault(),j(_)):e.key===`Backspace`&&_===``&&n.length>0&&v===null?(e.preventDefault(),N(n.length-1)):e.key===`Escape`&&(v!==null||S?(e.preventDefault(),k(),b(null)):L!==-1&&(e.preventDefault(),b(null)))},t[52]=j,t[53]=F,t[54]=_,t[55]=S,t[56]=v,t[57]=z,t[58]=L,t[59]=N,t[60]=n,t[61]=K):K=t[61];let q;t[62]!==j||t[63]!==_||t[64]!==v||t[65]!==d?(q=()=>{(_.trim()||v!==null)&&!j(_)&&v!==null&&k(),b(null),d?.()},t[62]=j,t[63]=_,t[64]=v,t[65]=d,t[66]=q):q=t[66];let J=n.length===0?he:``,_e=S?`true`:void 0,Y;t[67]!==se||t[68]!==S||t[69]!==w?(Y=[S?w:void 0,se].filter(Boolean).join(` `)||void 0,t[67]=se,t[68]=S,t[69]=w,t[70]=Y):Y=t[70];let ve=S?`true`:ce,ye=L===-1?void 0:`${T}-${L}`,be=S&&`text-destructive placeholder:text-destructive/60`,X;t[71]===be?X=t[72]:(X=a(`min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`,be),t[71]=be,t[72]=X);let Z;t[73]!==pe||t[74]!==p||t[75]!==_||t[76]!==f||t[77]!==G||t[78]!==K||t[79]!==q||t[80]!==J||t[81]!==_e||t[82]!==Y||t[83]!==ve||t[84]!==ye||t[85]!==X?(Z=(0,u.jsx)(`input`,{id:f,ref:pe,type:`text`,value:_,onChange:G,onKeyDown:K,onBlur:q,placeholder:J,"data-tag-invalid":_e,"aria-describedby":Y,"aria-invalid":ve,"aria-activedescendant":ye,disabled:p,className:X}),t[73]=pe,t[74]=p,t[75]=_,t[76]=f,t[77]=G,t[78]=K,t[79]=q,t[80]=J,t[81]=_e,t[82]=Y,t[83]=ve,t[84]=ye,t[85]=X,t[86]=Z):Z=t[86];let Q;t[87]!==S||t[88]!==w?(Q=S&&(0,u.jsx)(`span`,{id:w,role:`alert`,"data-testid":`tag-pill-input-error`,className:`w-full px-1 pt-0.5 text-xs text-destructive`,children:`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`}),t[87]=S,t[88]=w,t[89]=Q):Q=t[89];let $;return t[90]!==H||t[91]!==U||t[92]!==W||t[93]!==Z||t[94]!==Q?($=(0,u.jsxs)(`div`,{"data-slot":`tag-pill-input`,"aria-invalid":H,className:U,children:[W,Z,Q]}),t[90]=H,t[91]=U,t[92]=W,t[93]=Z,t[94]=Q,t[95]=$):$=t[95],$}export{d as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-B35O8xpx.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,r as l,s as u,t as d,u as f}from"./trace-api-BSvaJNnr.js";import{n as ee,t as p}from"./propagation-api-B1IlUKzT.js";import{t as m}from"./status-BNivpG-Q.js";import{t as h}from"./context-api-B9rp0hJb.js";import{n as te,o as ne}from"./client-version-BIzhoRew.js";var re=class{constructor(){}createGauge(e,t){return me}createHistogram(e,t){return he}createCounter(e,t){return pe}createUpDownCounter(e,t){return ge}createObservableGauge(e,t){return ve}createObservableCounter(e,t){return _e}createObservableUpDownCounter(e,t){return ye}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ie=class extends g{add(e,t){}},ae=class extends g{add(e,t){}},oe=class extends g{record(e,t){}},se=class extends g{record(e,t){}},ce=class{addCallback(e){}removeCallback(e){}},le=class extends ce{},ue=class extends ce{},de=class extends ce{},fe=new re,pe=new ie,me=new oe,he=new se,ge=new ae,_e=new le,ve=new ue,ye=new de;function be(){return fe}var xe;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(xe||={});var Se;(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`})(Se||={});var _=s.instance(),Ce=new class{getMeter(e,t,n){return fe}},we=`metrics`,Te=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return i(we,e,s.instance())}getMeterProvider(){return f(we)||Ce}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){a(we,s.instance())}}.getInstance(),Ee=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()}},De=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Oe(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function ke(e){if(e!=null)return()=>e}function Ae(e,t,n){return{timeoutMillis:Oe(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function je(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Me=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 Ne(e){return new Me(e.concurrencyLimit)}var Pe=r(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Fe(e){return e.setValue(Pe,!0)}function Ie(e){return e.getValue(Pe)===!0}var Le=`baggage`,Re=4096;function ze(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Be(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 Ve(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 He(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=Ve(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 Ue=class{inject(e,t,n){let r=p.getBaggage(e);if(!r||Ie(e))return;let i=ze(Be(r).filter(e=>e.length<=Re).slice(0,180));i.length>0&&n.set(t,Le,i)}extract(e,t,n){let r=n.get(t,Le);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=He(r[e],i,a,o);else [a]=He(r,i,a,o);return a===0?e:p.setBaggage(e,p.createBaggage(i))}fields(){return[Le]}};function v(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!We(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ge(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function We(e){return typeof e==`string`&&e!==``}function Ge(e){return e==null?!0:Array.isArray(e)?Ke(e):qe(typeof e)}function Ke(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(qe(e)){t=e;continue}return!1}return!1}}return!0}function qe(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Je(){return e=>{_.error(Ye(e))}}function Ye(e){return typeof e==`string`?e:JSON.stringify(Xe(e))}function Xe(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 Ze=Je();function y(e){try{Ze(e)}catch{}}var Qe=globalThis,$e=`2.8.0`,et=`http.url`,tt=`http.user_agent`,nt=et,rt=tt,it=`deployment.environment.name`,at=`error.type`,ot=`exception.message`,st=`exception.stacktrace`,ct=`exception.type`,lt=`http.request.method`,ut=`http.request.method_original`,dt=`http.response.status_code`,ft=`server.address`,pt=`server.port`,mt=`service.name`,ht=`service.version`,gt=`telemetry.sdk.language`,_t=`webjs`,vt=`telemetry.sdk.name`,yt=`telemetry.sdk.version`,bt=`url.full`,xt=`process.runtime.name`,St={[vt]:`opentelemetry`,[xt]:`browser`,[gt]:_t,[yt]:$e},b=performance,Ct=9,wt=10**6,x=10**Ct;function S(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*wt)]}function C(e){return Ot(S(b.timeOrigin),S(typeof e==`number`?e:b.now()))}function w(e){if(Et(e))return e;if(typeof e==`number`)return e<b.timeOrigin?C(e):S(e);if(e instanceof Date)return S(e.getTime());throw TypeError(`Invalid input type`)}function Tt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=x),[n,r]}function T(e){return e[0]*x+e[1]}function Et(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Dt(e){return Et(e)||typeof e==`number`||e instanceof Date}function Ot(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=x&&(n[1]-=x,n[0]+=1),n}var E;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(E||={});var kt=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()}},At=`[_0-9a-z-*/]`,jt=`[a-z]${At}{0,255}`,Mt=`[a-z0-9]${At}{0,240}@[a-z]${At}{0,13}`,Nt=RegExp(`^(?:${jt}|${Mt})$`),Pt=/^[ -~]{0,255}[!-~]$/,Ft=/,|=/;function It(e){return Nt.test(e)}function Lt(e){return Pt.test(e)&&!Ft.test(e)}var Rt=32,zt=512,Bt=`,`,Vt=`=`,Ht=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!It(e)||!Lt(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>zt)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=Bt+e),e=`${n[0]}${Vt}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Bt),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(Vt);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!It(a)||!Lt(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>zt)&&(t.set(a,o),n=s,t.size>=Rt))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}},D=`traceparent`,Ut=`tracestate`,Wt=`00`,Gt=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Kt(e){let t=Gt.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var qt=class{inject(e,t,r){let i=d.getSpanContext(e);if(!i||Ie(e)||!c(i))return;let a=`${Wt}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||n.NONE).toString(16)}`;r.set(t,D,a),i.traceState&&r.set(t,Ut,i.traceState.serialize())}extract(e,t,n){let r=n.get(t,D);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Kt(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Ut);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Ht(typeof e==`string`?e:void 0)}return d.setSpanContext(e,a)}fields(){return[D,Ut]}},Jt=`[object Object]`,Yt=`[object Null]`,Xt=`[object Undefined]`,Zt=Function.prototype.toString,Qt=Zt.call(Object),$t=Object.getPrototypeOf,en=Object.prototype,tn=en.hasOwnProperty,O=Symbol?Symbol.toStringTag:void 0,nn=en.toString;function rn(e){if(!an(e)||on(e)!==Jt)return!1;let t=$t(e);if(t===null)return!0;let n=tn.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Zt.call(n)===Qt}function an(e){return typeof e==`object`&&!!e}function on(e){return e==null?e===void 0?Xt:Yt:O&&O in Object(e)?sn(e):cn(e)}function sn(e){let t=tn.call(e,O),n=e[O],r=!1;try{e[O]=void 0,r=!0}catch{}let i=nn.call(e);return r&&(t?e[O]=n:delete e[O]),i}function cn(e){return nn.call(e)}var ln=20;function un(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=fn(t,e.shift(),0,n);return t}function dn(e){return k(e)?e.slice():e}function fn(e,t,n=0,r){let i;if(!(n>ln)){if(n++,j(e)||j(t)||mn(t))i=dn(t);else if(k(e)){if(i=e.slice(),k(t))for(let e=0,n=t.length;e<n;e++)i.push(dn(t[e]));else if(A(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]=dn(t[r]))}}}else if(A(e))if(A(t)){if(!hn(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(j(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(pn(e,s,r)||pn(t,s,r))delete i[s];else{if(A(a)&&A(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]=fn(i[s],c,n,r)}}}}else i=t;return i}}function pn(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 k(e){return Array.isArray(e)}function mn(e){return typeof e==`function`}function A(e){return!j(e)&&!k(e)&&!mn(e)&&typeof e==`object`}function j(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function hn(e,t){return!(!rn(e)||!rn(t))}function gn(e,t){return typeof t==`string`?e===t:!!e.match(t)}function _n(e,t){if(!t)return!1;for(let n of t)if(gn(e,n))return!0;return!1}var vn=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)}},yn=class{_isCalled=!1;_deferred=new vn;_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}};function bn(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function xn(){return{handleResponse(e){e==null||!bn(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var Sn=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:E.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:E.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:E.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:E.FAILED,error:e.error});return}else e.status===`retryable`?t({code:E.FAILED,error:new De(`Export failed with retryable status`)}):t({code:E.FAILED,error:new De(`Export failed with unknown error`)})},e=>t({code:E.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Cn(e,t){return new Sn(e.transport,e.serializer,xn(),e.promiseHandler,t.timeout)}function wn(e,t,n){return Cn({transport:n,serializer:t,promiseHandler:Ne(e)},{timeout:e.timeoutMillis})}function Tn(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function En(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=Tn(e.charCodeAt(r)),a=Tn(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function Dn(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function On(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function kn(e){return On(Dn(e))}function An(e){return Dn(e).toString()}var jn=typeof BigInt<`u`?An:T;function Mn(e){return e}function Nn(e){if(e!==void 0)return En(e)}var Pn={encodeHrTime:kn,encodeSpanContext:En,encodeOptionalSpanContext:Nn};function Fn(e){if(e===void 0)return Pn;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?kn:jn,encodeSpanContext:n?Mn:En,encodeOptionalSpanContext:n?Mn:Nn}}function In(e){let t={attributes:M(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Ln(e){return{name:e.name,version:e.version}}function M(e){return Object.keys(e).map(t=>Rn(t,e[t]))}function Rn(e,t){return{key:e,value:zn(t)}}function zn(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(zn)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Rn(e,t))}}:{}}function Bn(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:M(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Hn(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Vn(e,t)),droppedLinksCount:e.droppedLinksCount}}function Vn(e,t){return{attributes:e.attributes?M(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Hn(e,t){return{attributes:e.attributes?M(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Un(e,t){return{resourceSpans:Gn(e,Fn(t))}}function Wn(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 Gn(e,t){let n=Wn(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=>Bn(e,t));o.push({scope:Ln(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=In(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Kn={serializeRequest:e=>{let t=Un(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))}},qn=5,Jn=1e3,Yn=5e3,Xn=1.5,Zn=.2;function Qn(){return 2*Zn*Math.random()-Zn}var $n=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=qn,a=Jn;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,Yn)+Qn(),0);a*=Xn;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 er(e){return new $n(e.transport)}function tr(e){return[429,502,503,504].includes(e)}function nr(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 rr=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&&tr(r.status)?n({status:`retryable`,retryInMillis:nr(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 ir(e){return new rr(e)}var ar=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 or(e){return new ar(e)}var sr=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`}):tr(i.status)?{status:`retryable`,retryInMillis:nr(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 cr(e){return new sr(e)}function lr(e,t){return wn(e,t,er({transport:ir(e)}))}function ur(e,t){return wn(e,t,er({transport:cr(e)}))}function dr(e,t){return wn(e,t,er({transport:or({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function fr(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 pr(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 mr(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 hr(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-B35O8xpx.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function gr(e,t,n){return{...Ae(e,t,n),headers:pr(fr(e.headers),t.headers,n.headers),url:mr(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function _r(e,t){return{...je(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:hr({keepAlive:!0})}}function vr(e,t,n){return gr({url:e.url,timeoutMillis:e.timeoutMillis,headers:ke(e.headers),concurrencyLimit:e.concurrencyLimit},{},_r(n,t))}function yr(e,t,n,r){return br(e.headers)(vr(e,n,r),t)}function br(e){return!e&&typeof navigator.sendBeacon==`function`?dr:globalThis.fetch===void 0?lr:ur}var xr=class extends Ee{constructor(e={}){super(yr(e,Kn,`v1/traces`,{"Content-Type":`application/json`}))}},Sr=class{emit(e){}},Cr=new Sr,wr=new class{getLogger(e,t,n){return new Sr}},Tr=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):Cr}},Er=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new Tr(this,e,t,n)}_getDelegate(){return this._delegate??wr}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},Dr=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},N=Symbol.for(`io.opentelemetry.js.api.logs`),P=Dr;function Or(e,t,n){return r=>r===e?t:n}var kr=class e{constructor(){this._proxyLoggerProvider=new Er}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return P[N]?this.getLoggerProvider():(P[N]=Or(1,e,wr),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return P[N]?.call(P,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete P[N],this._proxyLoggerProvider=new Er}}.getInstance();function Ar(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 jr(e){e.forEach(e=>e.disable())}function Mr(e){let t=e.tracerProvider||d.getTracerProvider(),n=e.meterProvider||Te.getMeterProvider(),r=e.loggerProvider||kr.getLoggerProvider(),i=e.instrumentations?.flat()??[];return Ar(i,t,n,r),()=>{jr(i)}}var F=console.error.bind(console);function I(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 Nr=(e,t,n)=>{if(!e||!e[t]){F(`no original function `+String(t)+` to wrap`);return}if(!n){F(`no wrapper function`),F(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){F(`original object and wrapper must be functions`);return}let i=n(r,t);return I(i,`__original`,r),I(i,`__unwrap`,()=>{e[t]===i&&I(e,t,r)}),I(i,`__wrapped`,!0),I(e,t,i),i},Pr=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{F(`must provide one or more modules to patch`),F(Error().stack);return}if(!(t&&Array.isArray(t))){F(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Nr(e,t,n)})})},Fr=(e,t)=>{if(!e||!e[t]){F(`no function to unwrap.`),F(Error().stack);return}let n=e[t];if(!n.__unwrap)F(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ir=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{F(`must provide one or more modules to patch`),F(Error().stack);return}if(!(t&&Array.isArray(t))){F(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Fr(e,t)})})};function L(e){e&&e.logger&&(typeof e.logger==`function`?F=e.logger:F(`new logger isn't a function, not replacing`))}L.wrap=Nr,L.massWrap=Pr,L.unwrap=Fr,L.massUnwrap=Ir;var Lr=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=d.getTracer(e,t),this._meter=Te.getMeter(e,t),this._logger=kr.getLogger(e,t),this._updateMetricInstruments()}_wrap=Nr;_unwrap=Fr;_massWrap=Pr;_massUnwrap=Ir;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)}}},Rr=class extends Lr{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function R(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 z(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var B;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(B||={});function zr(e,t){let n=B.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=B.DUPLICATE;break}else t.toLowerCase()===e&&(n=B.STABLE);return n}var V;function Br(){if(V===void 0)try{let e=globalThis.process.argv0;V=e?`unknown_service:${e}`:`unknown_service`}catch{V=`unknown_service`}return V}var H=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Vr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Wr(t),r._asyncAttributesPending=t.filter(([e,t])=>H(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(H(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Wr(this._rawAttributes),this._schemaUrl=Gr(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,H(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(H(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=Kr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Hr(e,t){return Vr.FromAttributeList(Object.entries(e),t)}function Ur(){return Hr({[mt]:Br(),[gt]:St[gt],[vt]:St[vt],[yt]:St[yt]})}function Wr(e){return e.map(([e,t])=>H(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Gr(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 Kr(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 qr=`exception`,Jr=Symbol.for(`nodejs.util.inspect.custom`);function Yr(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function Xr(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 Zr=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:m.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=b.now(),this._performanceOffset=t-(this._performanceStartTime+b.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(!Ge(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++),Dt(t)&&(Dt(n)||(n=t),t=void 0);let i=v(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=v(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===m.UNSET||this.status.code===m.OK)return this;let t={code:e.code};return e.code===m.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=Tt(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<=b.now())return C(e+this._performanceOffset);if(typeof e==`number`)return S(e);if(e instanceof Date)return S(e.getTime());if(Et(e))return e;if(this._startTimeProvided)return S(Date.now());let t=b.now()-this._performanceStartTime;return Ot(this.startTime,S(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[ot]=e:e&&(e.code?n[ct]=e.code.toString():e.name&&(n[ct]=e.name),e.message&&(n[ot]=e.message),e.stack&&(n[st]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(qr,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}[Jr](e,t,n){return Xr(`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:Yr(this.resource)}},e,t,n)}},U;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(U||={});var Qr=`otel.component.name`,$r=`otel.component.type`,ei=`otel.span.parent.origin`,ti=`otel.span.sampling_result`,ni=`otel.sdk.processor.span.processed`,ri=`otel.sdk.processor.span.queue.capacity`,ii=`otel.sdk.processor.span.queue.size`,ai=`otel.sdk.span.live`,oi=`otel.sdk.span.started`,si=`batching_span_processor`,ci=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(oi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ai,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=ui(t);if(this.startedSpans.add(1,{[ei]:li(e),[ti]:n}),t===U.NOT_RECORD)return()=>{};let r={[ti]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function li(e){return e?e.isRemote?`remote`:`local`:`none`}function ui(e){switch(e){case U.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case U.RECORD:return`RECORD_ONLY`;case U.NOT_RECORD:return`DROP`}}var di=`2.9.0`,fi=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 ci(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,di))}startSpan(e,t={},r=h.active()){t.root&&(r=d.deleteSpan(r));let i=d.getSpan(r);if(Ie(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),d.wrapSpanContext(o);let a=i?.spanContext(),s=this._idGenerator.generateSpanId(),c,l,u;!a||!d.isSpanContextValid(a)?l=this._idGenerator.generateTraceId():(l=a.traceId,u=a.traceState,c=a);let f=t.kind??Se.INTERNAL,ee=(t.links??[]).map(e=>({context:e.context,attributes:v(e.attributes)})),p=v(t.attributes),m=this._sampler.shouldSample(r,l,e,f,p,ee),te=this._tracerMetrics.startSpan(a,m.decision);u=m.traceState??u;let ne=m.decision===xe.RECORD_AND_SAMPLED?n.SAMPLED:n.NONE,re={traceId:l,spanId:s,traceFlags:ne,traceState:u};if(m.decision===xe.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),d.wrapSpanContext(re);let g=v(Object.assign(p,m.attributes));return new Zr({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:re,name:e,kind:f,links:ee,parentSpanContext:c,attributes:g,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??h.active(),c=this.startSpan(e,i,s),l=d.setSpan(s,c);return h.with(l,o,void 0,c)}[Jr](e,t,n){return Xr(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:Yr(this._resource)},spanLimits:this._spanLimits},e,t,n)}},pi=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=>{y(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)})}},mi=class{shouldSample(){return{decision:U.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},W=class{shouldSample(){return{decision:U.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},G=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(y(Error(`ParentBasedSampler must have a root sampler configured`)),new W),this._remoteParentSampled=e.remoteParentSampled??new W,this._remoteParentNotSampled=e.remoteParentNotSampled??new mi,this._localParentSampled=e.localParentSampled??new W,this._localParentNotSampled=e.localParentNotSampled??new mi}shouldSample(e,t,r,i,a,o){let s=d.getSpanContext(e);return!s||!c(s)?this._root.shouldSample(e,t,r,i,a,o):s.isRemote?s.traceFlags&n.SAMPLED?this._remoteParentSampled.shouldSample(e,t,r,i,a,o):this._remoteParentNotSampled.shouldSample(e,t,r,i,a,o):s.traceFlags&n.SAMPLED?this._localParentSampled.shouldSample(e,t,r,i,a,o):this._localParentNotSampled.shouldSample(e,t,r,i,a,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},hi=new Map,gi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=hi.get(e)??0;if(hi.set(e,r+1),this.standardAttrs={[$r]:e,[Qr]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[at]:`queue_full`},this.processedSpans=t.createCounter(ni,{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(ri,{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(ii,{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,[at]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},_i=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 yn(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 gi(si,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):be(),{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&n.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);h.with(Fe(h.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===E.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=>{y(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,y(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)}},vi=class extends _i{_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=>{y(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{y(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))}},yi=16,bi=8,xi=new Uint8Array(yi),Si=new Uint8Array(bi),Ci=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function wi(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 Ti(e){let t=``;for(let n=0;n<e.length;n++)t+=Ci[e[n]];return t}var Ei=class{generateTraceId(){return wi(xi),Ti(xi)}generateSpanId(){return wi(Si),Ti(Si)}},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 Di=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Ur(),this._activeSpanProcessor=new pi(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 Ei,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return be()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new fi({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()}[Jr](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return Xr(`TracerProvider`,{resource:{attributes:Yr(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Oi=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:l(t)&&this._accumulate(t)<this._upperBound?U.RECORD_AND_SAMPLED:U.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 ki=1;function Ai(){return{sampler:ji(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function ji(){let e=q.ParentBasedAlwaysOn;switch(e){case q.AlwaysOn:return new W;case q.AlwaysOff:return new mi;case q.ParentBasedAlwaysOn:return new G({root:new W});case q.ParentBasedAlwaysOff:return new G({root:new mi});case q.TraceIdRatio:return new Oi(Mi());case q.ParentBasedTraceIdRatio:return new G({root:new Oi(Mi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${q.ParentBasedAlwaysOn}".`),new G({root:new W})}}function Mi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${ki}.`),ki}function Ni(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 Pi=class extends Di{constructor(e={}){let t=un({},Ai(),Ni(e));delete t.generalLimits,super(t)}},Fi=class extends vi{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})}},Ii=class{_enabled=!1;_currentContext=u;_bindFunction(e=u,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}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=u,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=u,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||u;try{return t.call(n,...r)}finally{this._currentContext=i}}};function Li(e){if(e!==null){if(e===void 0){let e=new Ii;e.enable(),h.setGlobalContextManager(e);return}e.enable(),h.setGlobalContextManager(e)}}function Ri(e){if(e!==null){if(e===void 0){p.setGlobalPropagator(new kt({propagators:[new qt,new Ue]}));return}p.setGlobalPropagator(e)}}var zi=class extends Pi{constructor(e={}){super(e)}register(e={}){d.setGlobalTracerProvider(this),Ri(e.propagator),Li(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 Bi=`http.response_content_length`,Vi=`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 Hi(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(Bi,n);let r=t[J.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Vi,r)}}function Ui(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Gi(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Ui(e.parentNode,t)),r+=n,r}function Wi(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 Gi(e,t){let n=e.nodeType,r=Wi(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 Ki;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(Ki||={});var qi=`0.49.0`,Ji=`@opentelemetry/instrumentation-document-load`,Yi;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(Yi||={});var Xi=()=>{let e={},t=b.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=b.timing;t&&Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},Zi={"first-paint":Yi.FIRST_PAINT,"first-contentful-paint":Yi.FIRST_CONTENTFUL_PAINT},Qi=e=>{let t=b.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{Y(Zi,t)&&e.addEvent(Zi[t],n)})},$i=class extends Rr{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(Ji,qi,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=b.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===D),t=Xi(),n=e&&e.content||``;h.with(p.extract(u,{traceparent:n}),()=>{let e=this._startSpan(Ki.DOCUMENT_LOAD,J.FETCH_START,t);e&&(h.with(d.setSpan(h.active(),e),()=>{let e=this._startSpan(Ki.DOCUMENT_FETCH,J.FETCH_START,t);e&&(e.setAttribute(nt,location.href),h.with(d.setSpan(h.active(),e),()=>{Hi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,J.RESPONSE_END,t)}))}),e.setAttribute(nt,location.href),e.setAttribute(rt,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||Qi(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(Ki.RESOURCE_FETCH,J.FETCH_START,e,t);n&&(n.setAttribute(nt,e.name),Hi(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?d.setSpan(h.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&&R(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&R(()=>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 ea=`http.response_content_length`,ta=`http.response_content_length_uncompressed`,na;function ra(){return na||=document.createElement(`a`),na}function ia(e,t){return t in e}function Q(e,t,n,r=!0){if(ia(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function aa(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(ea,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(ta,r)}}function oa(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 sa(){return typeof location<`u`?location.origin:void 0}function ca(e,t,n,r,i=new WeakSet,a){let o=da(e);e=o.toString();let s=ua(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=oa(s);if(o.origin!==sa()&&c.length>1){let e=c[0],t=la(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 la(e,t,n){let r=T(n),i=T(w(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=T(w(n[Z.FETCH_START])),c=r-T(w(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function ua(e,t,n,r,i,a){let o=T(t),s=T(n),c=r.filter(t=>{let n=T(w(t[Z.FETCH_START])),r=T(w(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 da(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ra();return t.href=e,t}function fa(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),da(e).origin===sa()?!0:n.some(t=>gn(e,t))}var pa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(pa||={});var ma=`http.host`,ha=`http.method`,ga=`http.request.body.size`,_a=`http.request_content_length_uncompressed`,va=`http.scheme`,ya=`http.status_code`,ba=`http.url`,xa=`http.user_agent`,Sa=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function Ca(...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}=wa(t.body);return t.body=e,n}else return Promise.resolve(Ea(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Oa(e)):Promise.resolve()}}function wa(e){if(!e.pipeThrough)return Sa.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 Ta(e){return typeof Document<`u`&&e instanceof Document}function Ea(e){if(Ta(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Oa(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return ka(e);if(e instanceof URLSearchParams)return Oa(e.toString());if(e.byteLength!==void 0)return e.byteLength;Sa.warn(`unknown body type`)}var Da=new TextEncoder;function Oa(e){return Da.encode(e).byteLength}function ka(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 Aa(e){let t=Na(),n=e.toUpperCase();return n in t?n:`_OTHER`}var ja={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ma;function Na(){return Ma===void 0&&(Ma=ja),Ma}var Pa={"https:":`443`,"http:":`80`};function Fa(e){let t=Number(e.port||Pa[e.protocol]);if(t&&!isNaN(t))return t}var Ia=`0.204.0`,La=300,Ra=typeof process==`object`&&process.release?.name===`node`,za=class extends Rr{component=`fetch`;version=Ia;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Ia,e),this._semconvStability=zr(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},d.setSpan(h.active(),e)),r=!(this._semconvStability&B.OLD);aa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=da(t.url);if(this._semconvStability&B.OLD&&(e.setAttribute(ya,t.status),t.statusText!=null&&e.setAttribute(pa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(ma,n.host),e.setAttribute(va,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(xa,navigator.userAgent)),this._semconvStability&B.STABLE){e.setAttribute(dt,t.status),e.setAttribute(ft,n.hostname);let r=Fa(n);r&&e.setAttribute(pt,r)}}_addHeaders(e,t){if(!fa(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};p.inject(h.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)p.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)p.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)p.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};p.inject(h.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(_n(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&B.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[pa.COMPONENT]=this.moduleName,r[ha]=i,r[ba]=e}if(this._semconvStability&B.STABLE){let i=t.method,a=Aa(t.method||`GET`);n||=a,r[lt]=a,a!==i&&(r[ut]=i),r[bt]=e}return this.tracer.startSpan(n,{kind:Se.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ca(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&B.OLD);aa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=S(Date.now()),i=C();this._addFinalSpanAttributes(e,n),this._semconvStability&B.STABLE&&n.status>=400&&(e.setStatus({code:m.ERROR}),e.setAttribute(at,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},La)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=da(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&&Ca(...n).then(e=>{e&&(t._semconvStability&B.OLD&&o.setAttribute(_a,e),t._semconvStability&B.STABLE&&o.setAttribute(ga,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 f(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>h.with(d.setSpan(h.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),f.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&R(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&R(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=C(),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(Ra){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}z(fetch)&&(this._unwrap(Qe,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Qe,`fetch`,this._patchConstructor())}disable(){Ra||(this._unwrap(Qe,`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 Ba=`0.49.0`,Va=`@opentelemetry/instrumentation-user-interaction`,Ha=`OT_ZONE_CONTEXT`,Ua=`Navigation:`,Wa=[`click`];function Ga(){return!1}var Ka=class extends Rr{version=Ba;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(Va,Ba,e),this._eventNames=new Set(e?.eventNames??Wa),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:Ga}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=C():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=Ui(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?d.setSpan(h.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(Ha);return t&&d.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),h.with(d.setSpan(h.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(){z(history.replaceState)&&this._unwrap(history,`replaceState`),z(history.pushState)&&this._unwrap(history,`pushState`),z(history.back)&&this._unwrap(history,`back`),z(history.forward)&&this._unwrap(history,`forward`),z(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=d.getSpan(h.active());t&&typeof t.updateName==`function`&&t.updateName(`${Ua} ${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 h.with(d.setSpan(h.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?(z(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),z(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),z(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=>{z(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),z(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?(z(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),z(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),z(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{z(e.addEventListener)&&this._unwrap(e,`addEventListener`),z(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},qa=`open-knowledge-app`,Ja=!1;function Ya(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.86.22-beta.2`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function Xa(){if(Ja)return;Ja=!0;let e=null,t=!1;try{let n=Ya(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.86.22-beta.2`};e=new zi({resource:Hr({[mt]:`open-knowledge-app`,[ht]:r?.VITE_APP_VERSION??`dev`,[it]:r?.MODE??`dev`,[ne]:te}),spanProcessors:[new Fi(new xr({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Mr({instrumentations:[new $i,new Ka({eventNames:[`click`,`submit`]}),new za({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(()=>{}),Ja=!1}}function Za(){return d.getTracer(qa)}export{Za as getAppTracer,Xa 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,r as l,s as u,t as d,u as f}from"./trace-api-BSvaJNnr.js";import{n as ee,t as p}from"./propagation-api-B1IlUKzT.js";import{t as m}from"./status-BNivpG-Q.js";import{t as h}from"./context-api-B9rp0hJb.js";import{n as te,o as ne}from"./client-version-CVbC_NDn.js";var re=class{constructor(){}createGauge(e,t){return me}createHistogram(e,t){return he}createCounter(e,t){return pe}createUpDownCounter(e,t){return ge}createObservableGauge(e,t){return ve}createObservableCounter(e,t){return _e}createObservableUpDownCounter(e,t){return ye}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ie=class extends g{add(e,t){}},ae=class extends g{add(e,t){}},oe=class extends g{record(e,t){}},se=class extends g{record(e,t){}},ce=class{addCallback(e){}removeCallback(e){}},le=class extends ce{},ue=class extends ce{},de=class extends ce{},fe=new re,pe=new ie,me=new oe,he=new se,ge=new ae,_e=new le,ve=new ue,ye=new de;function be(){return fe}var xe;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(xe||={});var Se;(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`})(Se||={});var _=s.instance(),Ce=new class{getMeter(e,t,n){return fe}},we=`metrics`,Te=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return i(we,e,s.instance())}getMeterProvider(){return f(we)||Ce}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){a(we,s.instance())}}.getInstance(),Ee=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()}},De=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Oe(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function ke(e){if(e!=null)return()=>e}function Ae(e,t,n){return{timeoutMillis:Oe(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function je(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Me=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 Ne(e){return new Me(e.concurrencyLimit)}var Pe=r(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Fe(e){return e.setValue(Pe,!0)}function Ie(e){return e.getValue(Pe)===!0}var Le=`baggage`,Re=4096;function ze(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Be(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 Ve(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 He(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=Ve(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 Ue=class{inject(e,t,n){let r=p.getBaggage(e);if(!r||Ie(e))return;let i=ze(Be(r).filter(e=>e.length<=Re).slice(0,180));i.length>0&&n.set(t,Le,i)}extract(e,t,n){let r=n.get(t,Le);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=He(r[e],i,a,o);else [a]=He(r,i,a,o);return a===0?e:p.setBaggage(e,p.createBaggage(i))}fields(){return[Le]}};function v(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!We(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ge(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function We(e){return typeof e==`string`&&e!==``}function Ge(e){return e==null?!0:Array.isArray(e)?Ke(e):qe(typeof e)}function Ke(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(qe(e)){t=e;continue}return!1}return!1}}return!0}function qe(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Je(){return e=>{_.error(Ye(e))}}function Ye(e){return typeof e==`string`?e:JSON.stringify(Xe(e))}function Xe(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 Ze=Je();function y(e){try{Ze(e)}catch{}}var Qe=globalThis,$e=`2.8.0`,et=`http.url`,tt=`http.user_agent`,nt=et,rt=tt,it=`deployment.environment.name`,at=`error.type`,ot=`exception.message`,st=`exception.stacktrace`,ct=`exception.type`,lt=`http.request.method`,ut=`http.request.method_original`,dt=`http.response.status_code`,ft=`server.address`,pt=`server.port`,mt=`service.name`,ht=`service.version`,gt=`telemetry.sdk.language`,_t=`webjs`,vt=`telemetry.sdk.name`,yt=`telemetry.sdk.version`,bt=`url.full`,xt=`process.runtime.name`,St={[vt]:`opentelemetry`,[xt]:`browser`,[gt]:_t,[yt]:$e},b=performance,Ct=9,wt=10**6,x=10**Ct;function S(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*wt)]}function C(e){return Ot(S(b.timeOrigin),S(typeof e==`number`?e:b.now()))}function w(e){if(Et(e))return e;if(typeof e==`number`)return e<b.timeOrigin?C(e):S(e);if(e instanceof Date)return S(e.getTime());throw TypeError(`Invalid input type`)}function Tt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=x),[n,r]}function T(e){return e[0]*x+e[1]}function Et(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Dt(e){return Et(e)||typeof e==`number`||e instanceof Date}function Ot(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=x&&(n[1]-=x,n[0]+=1),n}var E;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(E||={});var kt=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()}},At=`[_0-9a-z-*/]`,jt=`[a-z]${At}{0,255}`,Mt=`[a-z0-9]${At}{0,240}@[a-z]${At}{0,13}`,Nt=RegExp(`^(?:${jt}|${Mt})$`),Pt=/^[ -~]{0,255}[!-~]$/,Ft=/,|=/;function It(e){return Nt.test(e)}function Lt(e){return Pt.test(e)&&!Ft.test(e)}var Rt=32,zt=512,Bt=`,`,Vt=`=`,Ht=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!It(e)||!Lt(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>zt)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=Bt+e),e=`${n[0]}${Vt}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Bt),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(Vt);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!It(a)||!Lt(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>zt)&&(t.set(a,o),n=s,t.size>=Rt))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}},D=`traceparent`,Ut=`tracestate`,Wt=`00`,Gt=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Kt(e){let t=Gt.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var qt=class{inject(e,t,r){let i=d.getSpanContext(e);if(!i||Ie(e)||!c(i))return;let a=`${Wt}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||n.NONE).toString(16)}`;r.set(t,D,a),i.traceState&&r.set(t,Ut,i.traceState.serialize())}extract(e,t,n){let r=n.get(t,D);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Kt(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Ut);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Ht(typeof e==`string`?e:void 0)}return d.setSpanContext(e,a)}fields(){return[D,Ut]}},Jt=`[object Object]`,Yt=`[object Null]`,Xt=`[object Undefined]`,Zt=Function.prototype.toString,Qt=Zt.call(Object),$t=Object.getPrototypeOf,en=Object.prototype,tn=en.hasOwnProperty,O=Symbol?Symbol.toStringTag:void 0,nn=en.toString;function rn(e){if(!an(e)||on(e)!==Jt)return!1;let t=$t(e);if(t===null)return!0;let n=tn.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Zt.call(n)===Qt}function an(e){return typeof e==`object`&&!!e}function on(e){return e==null?e===void 0?Xt:Yt:O&&O in Object(e)?sn(e):cn(e)}function sn(e){let t=tn.call(e,O),n=e[O],r=!1;try{e[O]=void 0,r=!0}catch{}let i=nn.call(e);return r&&(t?e[O]=n:delete e[O]),i}function cn(e){return nn.call(e)}var ln=20;function un(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=fn(t,e.shift(),0,n);return t}function dn(e){return k(e)?e.slice():e}function fn(e,t,n=0,r){let i;if(!(n>ln)){if(n++,j(e)||j(t)||mn(t))i=dn(t);else if(k(e)){if(i=e.slice(),k(t))for(let e=0,n=t.length;e<n;e++)i.push(dn(t[e]));else if(A(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]=dn(t[r]))}}}else if(A(e))if(A(t)){if(!hn(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(j(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(pn(e,s,r)||pn(t,s,r))delete i[s];else{if(A(a)&&A(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]=fn(i[s],c,n,r)}}}}else i=t;return i}}function pn(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 k(e){return Array.isArray(e)}function mn(e){return typeof e==`function`}function A(e){return!j(e)&&!k(e)&&!mn(e)&&typeof e==`object`}function j(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function hn(e,t){return!(!rn(e)||!rn(t))}function gn(e,t){return typeof t==`string`?e===t:!!e.match(t)}function _n(e,t){if(!t)return!1;for(let n of t)if(gn(e,n))return!0;return!1}var vn=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)}},yn=class{_isCalled=!1;_deferred=new vn;_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}};function bn(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function xn(){return{handleResponse(e){e==null||!bn(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var Sn=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:E.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:E.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:E.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:E.FAILED,error:e.error});return}else e.status===`retryable`?t({code:E.FAILED,error:new De(`Export failed with retryable status`)}):t({code:E.FAILED,error:new De(`Export failed with unknown error`)})},e=>t({code:E.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Cn(e,t){return new Sn(e.transport,e.serializer,xn(),e.promiseHandler,t.timeout)}function wn(e,t,n){return Cn({transport:n,serializer:t,promiseHandler:Ne(e)},{timeout:e.timeoutMillis})}function Tn(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function En(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=Tn(e.charCodeAt(r)),a=Tn(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function Dn(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function On(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function kn(e){return On(Dn(e))}function An(e){return Dn(e).toString()}var jn=typeof BigInt<`u`?An:T;function Mn(e){return e}function Nn(e){if(e!==void 0)return En(e)}var Pn={encodeHrTime:kn,encodeSpanContext:En,encodeOptionalSpanContext:Nn};function Fn(e){if(e===void 0)return Pn;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?kn:jn,encodeSpanContext:n?Mn:En,encodeOptionalSpanContext:n?Mn:Nn}}function In(e){let t={attributes:M(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Ln(e){return{name:e.name,version:e.version}}function M(e){return Object.keys(e).map(t=>Rn(t,e[t]))}function Rn(e,t){return{key:e,value:zn(t)}}function zn(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(zn)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Rn(e,t))}}:{}}function Bn(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:M(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Hn(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Vn(e,t)),droppedLinksCount:e.droppedLinksCount}}function Vn(e,t){return{attributes:e.attributes?M(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Hn(e,t){return{attributes:e.attributes?M(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Un(e,t){return{resourceSpans:Gn(e,Fn(t))}}function Wn(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 Gn(e,t){let n=Wn(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=>Bn(e,t));o.push({scope:Ln(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=In(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Kn={serializeRequest:e=>{let t=Un(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))}},qn=5,Jn=1e3,Yn=5e3,Xn=1.5,Zn=.2;function Qn(){return 2*Zn*Math.random()-Zn}var $n=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=qn,a=Jn;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,Yn)+Qn(),0);a*=Xn;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 er(e){return new $n(e.transport)}function tr(e){return[429,502,503,504].includes(e)}function nr(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 rr=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&&tr(r.status)?n({status:`retryable`,retryInMillis:nr(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 ir(e){return new rr(e)}var ar=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 or(e){return new ar(e)}var sr=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`}):tr(i.status)?{status:`retryable`,retryInMillis:nr(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 cr(e){return new sr(e)}function lr(e,t){return wn(e,t,er({transport:ir(e)}))}function ur(e,t){return wn(e,t,er({transport:cr(e)}))}function dr(e,t){return wn(e,t,er({transport:or({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function fr(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 pr(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 mr(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 hr(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-B35O8xpx.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function gr(e,t,n){return{...Ae(e,t,n),headers:pr(fr(e.headers),t.headers,n.headers),url:mr(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function _r(e,t){return{...je(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:hr({keepAlive:!0})}}function vr(e,t,n){return gr({url:e.url,timeoutMillis:e.timeoutMillis,headers:ke(e.headers),concurrencyLimit:e.concurrencyLimit},{},_r(n,t))}function yr(e,t,n,r){return br(e.headers)(vr(e,n,r),t)}function br(e){return!e&&typeof navigator.sendBeacon==`function`?dr:globalThis.fetch===void 0?lr:ur}var xr=class extends Ee{constructor(e={}){super(yr(e,Kn,`v1/traces`,{"Content-Type":`application/json`}))}},Sr=class{emit(e){}},Cr=new Sr,wr=new class{getLogger(e,t,n){return new Sr}},Tr=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):Cr}},Er=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new Tr(this,e,t,n)}_getDelegate(){return this._delegate??wr}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},Dr=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},N=Symbol.for(`io.opentelemetry.js.api.logs`),P=Dr;function Or(e,t,n){return r=>r===e?t:n}var kr=class e{constructor(){this._proxyLoggerProvider=new Er}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return P[N]?this.getLoggerProvider():(P[N]=Or(1,e,wr),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return P[N]?.call(P,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete P[N],this._proxyLoggerProvider=new Er}}.getInstance();function Ar(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 jr(e){e.forEach(e=>e.disable())}function Mr(e){let t=e.tracerProvider||d.getTracerProvider(),n=e.meterProvider||Te.getMeterProvider(),r=e.loggerProvider||kr.getLoggerProvider(),i=e.instrumentations?.flat()??[];return Ar(i,t,n,r),()=>{jr(i)}}var F=console.error.bind(console);function I(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 Nr=(e,t,n)=>{if(!e||!e[t]){F(`no original function `+String(t)+` to wrap`);return}if(!n){F(`no wrapper function`),F(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){F(`original object and wrapper must be functions`);return}let i=n(r,t);return I(i,`__original`,r),I(i,`__unwrap`,()=>{e[t]===i&&I(e,t,r)}),I(i,`__wrapped`,!0),I(e,t,i),i},Pr=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{F(`must provide one or more modules to patch`),F(Error().stack);return}if(!(t&&Array.isArray(t))){F(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Nr(e,t,n)})})},Fr=(e,t)=>{if(!e||!e[t]){F(`no function to unwrap.`),F(Error().stack);return}let n=e[t];if(!n.__unwrap)F(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ir=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{F(`must provide one or more modules to patch`),F(Error().stack);return}if(!(t&&Array.isArray(t))){F(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Fr(e,t)})})};function L(e){e&&e.logger&&(typeof e.logger==`function`?F=e.logger:F(`new logger isn't a function, not replacing`))}L.wrap=Nr,L.massWrap=Pr,L.unwrap=Fr,L.massUnwrap=Ir;var Lr=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=d.getTracer(e,t),this._meter=Te.getMeter(e,t),this._logger=kr.getLogger(e,t),this._updateMetricInstruments()}_wrap=Nr;_unwrap=Fr;_massWrap=Pr;_massUnwrap=Ir;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)}}},Rr=class extends Lr{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function R(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 z(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var B;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(B||={});function zr(e,t){let n=B.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=B.DUPLICATE;break}else t.toLowerCase()===e&&(n=B.STABLE);return n}var V;function Br(){if(V===void 0)try{let e=globalThis.process.argv0;V=e?`unknown_service:${e}`:`unknown_service`}catch{V=`unknown_service`}return V}var H=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Vr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Wr(t),r._asyncAttributesPending=t.filter(([e,t])=>H(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(H(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Wr(this._rawAttributes),this._schemaUrl=Gr(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,H(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(H(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=Kr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Hr(e,t){return Vr.FromAttributeList(Object.entries(e),t)}function Ur(){return Hr({[mt]:Br(),[gt]:St[gt],[vt]:St[vt],[yt]:St[yt]})}function Wr(e){return e.map(([e,t])=>H(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Gr(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 Kr(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 qr=`exception`,Jr=Symbol.for(`nodejs.util.inspect.custom`);function Yr(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function Xr(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 Zr=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:m.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=b.now(),this._performanceOffset=t-(this._performanceStartTime+b.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(!Ge(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++),Dt(t)&&(Dt(n)||(n=t),t=void 0);let i=v(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=v(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===m.UNSET||this.status.code===m.OK)return this;let t={code:e.code};return e.code===m.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=Tt(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<=b.now())return C(e+this._performanceOffset);if(typeof e==`number`)return S(e);if(e instanceof Date)return S(e.getTime());if(Et(e))return e;if(this._startTimeProvided)return S(Date.now());let t=b.now()-this._performanceStartTime;return Ot(this.startTime,S(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[ot]=e:e&&(e.code?n[ct]=e.code.toString():e.name&&(n[ct]=e.name),e.message&&(n[ot]=e.message),e.stack&&(n[st]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(qr,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}[Jr](e,t,n){return Xr(`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:Yr(this.resource)}},e,t,n)}},U;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(U||={});var Qr=`otel.component.name`,$r=`otel.component.type`,ei=`otel.span.parent.origin`,ti=`otel.span.sampling_result`,ni=`otel.sdk.processor.span.processed`,ri=`otel.sdk.processor.span.queue.capacity`,ii=`otel.sdk.processor.span.queue.size`,ai=`otel.sdk.span.live`,oi=`otel.sdk.span.started`,si=`batching_span_processor`,ci=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(oi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ai,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=ui(t);if(this.startedSpans.add(1,{[ei]:li(e),[ti]:n}),t===U.NOT_RECORD)return()=>{};let r={[ti]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function li(e){return e?e.isRemote?`remote`:`local`:`none`}function ui(e){switch(e){case U.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case U.RECORD:return`RECORD_ONLY`;case U.NOT_RECORD:return`DROP`}}var di=`2.9.0`,fi=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 ci(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,di))}startSpan(e,t={},r=h.active()){t.root&&(r=d.deleteSpan(r));let i=d.getSpan(r);if(Ie(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),d.wrapSpanContext(o);let a=i?.spanContext(),s=this._idGenerator.generateSpanId(),c,l,u;!a||!d.isSpanContextValid(a)?l=this._idGenerator.generateTraceId():(l=a.traceId,u=a.traceState,c=a);let f=t.kind??Se.INTERNAL,ee=(t.links??[]).map(e=>({context:e.context,attributes:v(e.attributes)})),p=v(t.attributes),m=this._sampler.shouldSample(r,l,e,f,p,ee),te=this._tracerMetrics.startSpan(a,m.decision);u=m.traceState??u;let ne=m.decision===xe.RECORD_AND_SAMPLED?n.SAMPLED:n.NONE,re={traceId:l,spanId:s,traceFlags:ne,traceState:u};if(m.decision===xe.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),d.wrapSpanContext(re);let g=v(Object.assign(p,m.attributes));return new Zr({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:re,name:e,kind:f,links:ee,parentSpanContext:c,attributes:g,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??h.active(),c=this.startSpan(e,i,s),l=d.setSpan(s,c);return h.with(l,o,void 0,c)}[Jr](e,t,n){return Xr(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:Yr(this._resource)},spanLimits:this._spanLimits},e,t,n)}},pi=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=>{y(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)})}},mi=class{shouldSample(){return{decision:U.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},W=class{shouldSample(){return{decision:U.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},G=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(y(Error(`ParentBasedSampler must have a root sampler configured`)),new W),this._remoteParentSampled=e.remoteParentSampled??new W,this._remoteParentNotSampled=e.remoteParentNotSampled??new mi,this._localParentSampled=e.localParentSampled??new W,this._localParentNotSampled=e.localParentNotSampled??new mi}shouldSample(e,t,r,i,a,o){let s=d.getSpanContext(e);return!s||!c(s)?this._root.shouldSample(e,t,r,i,a,o):s.isRemote?s.traceFlags&n.SAMPLED?this._remoteParentSampled.shouldSample(e,t,r,i,a,o):this._remoteParentNotSampled.shouldSample(e,t,r,i,a,o):s.traceFlags&n.SAMPLED?this._localParentSampled.shouldSample(e,t,r,i,a,o):this._localParentNotSampled.shouldSample(e,t,r,i,a,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},hi=new Map,gi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=hi.get(e)??0;if(hi.set(e,r+1),this.standardAttrs={[$r]:e,[Qr]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[at]:`queue_full`},this.processedSpans=t.createCounter(ni,{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(ri,{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(ii,{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,[at]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},_i=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 yn(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 gi(si,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):be(),{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&n.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);h.with(Fe(h.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===E.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=>{y(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,y(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)}},vi=class extends _i{_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=>{y(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{y(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))}},yi=16,bi=8,xi=new Uint8Array(yi),Si=new Uint8Array(bi),Ci=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function wi(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 Ti(e){let t=``;for(let n=0;n<e.length;n++)t+=Ci[e[n]];return t}var Ei=class{generateTraceId(){return wi(xi),Ti(xi)}generateSpanId(){return wi(Si),Ti(Si)}},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 Di=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Ur(),this._activeSpanProcessor=new pi(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 Ei,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return be()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new fi({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()}[Jr](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return Xr(`TracerProvider`,{resource:{attributes:Yr(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Oi=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:l(t)&&this._accumulate(t)<this._upperBound?U.RECORD_AND_SAMPLED:U.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 ki=1;function Ai(){return{sampler:ji(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function ji(){let e=q.ParentBasedAlwaysOn;switch(e){case q.AlwaysOn:return new W;case q.AlwaysOff:return new mi;case q.ParentBasedAlwaysOn:return new G({root:new W});case q.ParentBasedAlwaysOff:return new G({root:new mi});case q.TraceIdRatio:return new Oi(Mi());case q.ParentBasedTraceIdRatio:return new G({root:new Oi(Mi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${q.ParentBasedAlwaysOn}".`),new G({root:new W})}}function Mi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${ki}.`),ki}function Ni(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 Pi=class extends Di{constructor(e={}){let t=un({},Ai(),Ni(e));delete t.generalLimits,super(t)}},Fi=class extends vi{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})}},Ii=class{_enabled=!1;_currentContext=u;_bindFunction(e=u,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}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=u,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=u,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||u;try{return t.call(n,...r)}finally{this._currentContext=i}}};function Li(e){if(e!==null){if(e===void 0){let e=new Ii;e.enable(),h.setGlobalContextManager(e);return}e.enable(),h.setGlobalContextManager(e)}}function Ri(e){if(e!==null){if(e===void 0){p.setGlobalPropagator(new kt({propagators:[new qt,new Ue]}));return}p.setGlobalPropagator(e)}}var zi=class extends Pi{constructor(e={}){super(e)}register(e={}){d.setGlobalTracerProvider(this),Ri(e.propagator),Li(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 Bi=`http.response_content_length`,Vi=`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 Hi(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(Bi,n);let r=t[J.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Vi,r)}}function Ui(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Gi(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Ui(e.parentNode,t)),r+=n,r}function Wi(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 Gi(e,t){let n=e.nodeType,r=Wi(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 Ki;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(Ki||={});var qi=`0.49.0`,Ji=`@opentelemetry/instrumentation-document-load`,Yi;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(Yi||={});var Xi=()=>{let e={},t=b.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=b.timing;t&&Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},Zi={"first-paint":Yi.FIRST_PAINT,"first-contentful-paint":Yi.FIRST_CONTENTFUL_PAINT},Qi=e=>{let t=b.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{Y(Zi,t)&&e.addEvent(Zi[t],n)})},$i=class extends Rr{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(Ji,qi,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=b.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===D),t=Xi(),n=e&&e.content||``;h.with(p.extract(u,{traceparent:n}),()=>{let e=this._startSpan(Ki.DOCUMENT_LOAD,J.FETCH_START,t);e&&(h.with(d.setSpan(h.active(),e),()=>{let e=this._startSpan(Ki.DOCUMENT_FETCH,J.FETCH_START,t);e&&(e.setAttribute(nt,location.href),h.with(d.setSpan(h.active(),e),()=>{Hi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,J.RESPONSE_END,t)}))}),e.setAttribute(nt,location.href),e.setAttribute(rt,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||Qi(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(Ki.RESOURCE_FETCH,J.FETCH_START,e,t);n&&(n.setAttribute(nt,e.name),Hi(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?d.setSpan(h.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&&R(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&R(()=>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 ea=`http.response_content_length`,ta=`http.response_content_length_uncompressed`,na;function ra(){return na||=document.createElement(`a`),na}function ia(e,t){return t in e}function Q(e,t,n,r=!0){if(ia(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function aa(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(ea,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(ta,r)}}function oa(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 sa(){return typeof location<`u`?location.origin:void 0}function ca(e,t,n,r,i=new WeakSet,a){let o=da(e);e=o.toString();let s=ua(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=oa(s);if(o.origin!==sa()&&c.length>1){let e=c[0],t=la(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 la(e,t,n){let r=T(n),i=T(w(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=T(w(n[Z.FETCH_START])),c=r-T(w(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function ua(e,t,n,r,i,a){let o=T(t),s=T(n),c=r.filter(t=>{let n=T(w(t[Z.FETCH_START])),r=T(w(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 da(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ra();return t.href=e,t}function fa(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),da(e).origin===sa()?!0:n.some(t=>gn(e,t))}var pa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(pa||={});var ma=`http.host`,ha=`http.method`,ga=`http.request.body.size`,_a=`http.request_content_length_uncompressed`,va=`http.scheme`,ya=`http.status_code`,ba=`http.url`,xa=`http.user_agent`,Sa=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function Ca(...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}=wa(t.body);return t.body=e,n}else return Promise.resolve(Ea(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Oa(e)):Promise.resolve()}}function wa(e){if(!e.pipeThrough)return Sa.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 Ta(e){return typeof Document<`u`&&e instanceof Document}function Ea(e){if(Ta(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Oa(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return ka(e);if(e instanceof URLSearchParams)return Oa(e.toString());if(e.byteLength!==void 0)return e.byteLength;Sa.warn(`unknown body type`)}var Da=new TextEncoder;function Oa(e){return Da.encode(e).byteLength}function ka(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 Aa(e){let t=Na(),n=e.toUpperCase();return n in t?n:`_OTHER`}var ja={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ma;function Na(){return Ma===void 0&&(Ma=ja),Ma}var Pa={"https:":`443`,"http:":`80`};function Fa(e){let t=Number(e.port||Pa[e.protocol]);if(t&&!isNaN(t))return t}var Ia=`0.204.0`,La=300,Ra=typeof process==`object`&&process.release?.name===`node`,za=class extends Rr{component=`fetch`;version=Ia;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Ia,e),this._semconvStability=zr(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},d.setSpan(h.active(),e)),r=!(this._semconvStability&B.OLD);aa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=da(t.url);if(this._semconvStability&B.OLD&&(e.setAttribute(ya,t.status),t.statusText!=null&&e.setAttribute(pa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(ma,n.host),e.setAttribute(va,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(xa,navigator.userAgent)),this._semconvStability&B.STABLE){e.setAttribute(dt,t.status),e.setAttribute(ft,n.hostname);let r=Fa(n);r&&e.setAttribute(pt,r)}}_addHeaders(e,t){if(!fa(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};p.inject(h.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)p.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)p.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)p.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};p.inject(h.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(_n(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&B.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[pa.COMPONENT]=this.moduleName,r[ha]=i,r[ba]=e}if(this._semconvStability&B.STABLE){let i=t.method,a=Aa(t.method||`GET`);n||=a,r[lt]=a,a!==i&&(r[ut]=i),r[bt]=e}return this.tracer.startSpan(n,{kind:Se.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ca(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&B.OLD);aa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=S(Date.now()),i=C();this._addFinalSpanAttributes(e,n),this._semconvStability&B.STABLE&&n.status>=400&&(e.setStatus({code:m.ERROR}),e.setAttribute(at,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},La)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=da(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&&Ca(...n).then(e=>{e&&(t._semconvStability&B.OLD&&o.setAttribute(_a,e),t._semconvStability&B.STABLE&&o.setAttribute(ga,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 f(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>h.with(d.setSpan(h.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),f.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&R(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&R(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=C(),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(Ra){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}z(fetch)&&(this._unwrap(Qe,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Qe,`fetch`,this._patchConstructor())}disable(){Ra||(this._unwrap(Qe,`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 Ba=`0.49.0`,Va=`@opentelemetry/instrumentation-user-interaction`,Ha=`OT_ZONE_CONTEXT`,Ua=`Navigation:`,Wa=[`click`];function Ga(){return!1}var Ka=class extends Rr{version=Ba;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(Va,Ba,e),this._eventNames=new Set(e?.eventNames??Wa),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:Ga}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=C():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=Ui(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?d.setSpan(h.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(Ha);return t&&d.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),h.with(d.setSpan(h.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(){z(history.replaceState)&&this._unwrap(history,`replaceState`),z(history.pushState)&&this._unwrap(history,`pushState`),z(history.back)&&this._unwrap(history,`back`),z(history.forward)&&this._unwrap(history,`forward`),z(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=d.getSpan(h.active());t&&typeof t.updateName==`function`&&t.updateName(`${Ua} ${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 h.with(d.setSpan(h.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?(z(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),z(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),z(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=>{z(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),z(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?(z(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),z(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),z(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{z(e.addEventListener)&&this._unwrap(e,`addEventListener`),z(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},qa=`open-knowledge-app`,Ja=!1;function Ya(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.86.22`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function Xa(){if(Ja)return;Ja=!0;let e=null,t=!1;try{let n=Ya(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.86.22`};e=new zi({resource:Hr({[mt]:`open-knowledge-app`,[ht]:r?.VITE_APP_VERSION??`dev`,[it]:r?.MODE??`dev`,[ne]:te}),spanProcessors:[new Fi(new xr({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Mr({instrumentations:[new $i,new Ka({eventNames:[`click`,`submit`]}),new za({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(()=>{}),Ja=!1}}function Za(){return d.getTracer(qa)}export{Za as getAppTracer,Xa as install};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./propagation-api-B1IlUKzT.js";import{t}from"./context-api-B9rp0hJb.js";import{n}from"./startup-marks-Cb3e8PuI.js";import{getAppTracer as r}from"./telemetry-impl-
|
|
1
|
+
import{t as e}from"./propagation-api-B1IlUKzT.js";import{t}from"./context-api-B9rp0hJb.js";import{n}from"./startup-marks-Cb3e8PuI.js";import{getAppTracer as r}from"./telemetry-impl-C8ZWEJkv.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=e.extract(t.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/{terminal-launch-events-3vnER_eI.js → terminal-launch-events-BhFGIVo_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{t as i}from"./utils-CPqDy6Hr.js";import{t as a}from"./dist-BsJYDohW.js";import"./separator-D7s_9ZwH.js";import{i as o,n as s,o as c,r as l}from"./RegisteredAgentIcon-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{t as i}from"./utils-CPqDy6Hr.js";import{t as a}from"./dist-BsJYDohW.js";import"./separator-D7s_9ZwH.js";import{i as o,n as s,o as c,r as l}from"./RegisteredAgentIcon-FmoZTlpS.js";import{a as u}from"./local-menu-action-bus-Dyh2UJJF.js";import{x as d}from"./handoff-DzPPe6fp.js";import{u as f}from"./agent-registry-DoeDgmSS.js";import{t as p}from"./createLucideIcon-DdBzwsHe.js";var m=`open-knowledge:comments-send-to-open-chat`,h=`open-knowledge:comments-send-in-thread`,g=typeof window>`u`?new EventTarget:window;function _(e){g.dispatchEvent(new CustomEvent(m,{detail:{threadIds:e}}))}function v(e){let t=t=>{e(t instanceof CustomEvent?t.detail??{}:{})};return g.addEventListener(m,t),()=>g.removeEventListener(m,t)}function y(e,t){g.dispatchEvent(new CustomEvent(h,{detail:{threadId:e,threadIds:t}}))}function b(e){let t=t=>{let n=t instanceof CustomEvent?t.detail:null;n==null||typeof n.threadId!=`string`||n.threadId===``||e(n.threadId,n.threadIds)};return g.addEventListener(h,t),()=>g.removeEventListener(h,t)}var x=p(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),S=r(),C=t(),w=a(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function T(e){let t=(0,S.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,orientation:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]!==n||t[5]!==r?(o=i(w({orientation:r}),n),t[4]=n,t[5]=r,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==a||t[9]!==o?(s=(0,C.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:o,...a}),t[7]=r,t[8]=a,t[9]=o,t[10]=s):s=t[10],s}var E=e(n(),1),D=`ok-ask-ai-agent-v2`,O=`ok-ask-ai-default-agent-v1`,k=`ok-preferred-agent-v1`,A=`terminal-cli`;function j(e){return`${A}:${e}`}var M=`in-app-thread`;function N(e){return`${M}:${e.source}:${e.id}`}function P(e){if(e===null)return null;if(e===`in-app-thread`)return{kind:`default`};let t=`${M}:`;if(!e.startsWith(t))return null;let n=e.slice(t.length),r=n.indexOf(`:`);if(r<=0)return null;let i=n.slice(0,r),a=n.slice(r+1);return i!==`registry`&&i!==`custom`||a===``?null:{kind:`concrete`,source:i,id:a}}function F(e){return e===null?null:e===`terminal-cli`?`claude`:d.find(t=>e===j(t))??null}function I(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function L(e){let t=I(e);if(!t)return null;try{let e=t.getItem(D);return e===null?t.getItem(O)??t.getItem(k):e}catch{return null}}function R(e,t){let n=I(t);if(n)try{n.setItem(D,e)}catch(e){console.warn(`[ask-ai] Failed to persist default agent:`,e)}for(let e of z)e()}var z=new Set;function B(){return L()}function V(){for(let e of z)e()}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===`ok-ask-ai-agent-v2`||e.key===null)&&V()});function H(e){return z.add(e),()=>z.delete(e)}function U(){return(0,E.useSyncExternalStore)(H,B,B)}var W={thread:`agents`,none:`agents`,cli:`terminal`,terminal:`terminal`,desktop:`terminal`};function G(e,t){return e.filter(e=>l(t,e.source,e.id,!0,e.supported))}function K(e,t){return d.filter(n=>o(e,n,t))}function q(e,t){return f.filter(n=>s(e,n.id,t[n.id]?.installed)).map(e=>e.id)}function J(e,t){return f.filter(n=>e[c(n.id)]===void 0&&t[n.id]?.installed==null).map(e=>e.id)}function Y(e){let{sticky:t,effectiveThreadAgent:n,enabledClis:r,enabledDesktopTargets:i,unresolvedDesktopTargets:a=[],installedClis:o,terminalAvailable:s,threadsAvailable:c,desktopSelectable:l,preferBareTerminal:u,bareTerminalFallback:d}=e;if(u&&s)return{kind:`terminal`};if(c&&P(t)!==null&&n!==null)return{kind:`thread`,agent:n};if(s){let e=F(t);if(e!==null&&r.includes(e))return{kind:`cli`,cli:e}}return l&&t!==null&&(i.includes(t)||a.includes(t))?{kind:`desktop`,target:t}:c&&n!==null?{kind:`thread`,agent:n}:s&&r.length>0?{kind:`cli`,cli:r.find(e=>o[e]===!0)??r[0]}:l&&i.length>0?{kind:`desktop`,target:i[0]}:d&&s?{kind:`terminal`}:{kind:`none`}}var X=`open-knowledge:terminal-launch`;function Z(){return typeof window>`u`?new EventTarget:window}function Q(e,t){e.dispatchEvent(new CustomEvent(X,{detail:t}))}function $(e,t,n,r=Z()){let i=n?.stage===!0;u({kind:`terminal-launch`,prompt:e,cli:t,stage:i},r)||Q(r,{kind:`cli`,prompt:e,cli:t,stage:i,...n?.signInThreadId===void 0?{}:{signInThreadId:n.signInThreadId}})}function ee(e,t=Z()){Q(t,{kind:`command`,...e})}function te(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent&&typeof t.detail==`object`&&t.detail!==null?t.detail:void 0;if(n===void 0)return;let r=typeof n.signInThreadId==`string`?{signInThreadId:n.signInThreadId}:{};if(n.kind===`command`){let t=n.command;typeof t==`object`&&t&&typeof t.executable==`string`&&Array.isArray(t.args)&&typeof n.label==`string`&&e({kind:`command`,command:t,label:n.label,...r});return}n.kind!==void 0&&n.kind!==`cli`||typeof n.prompt!=`string`||typeof n.cli!=`string`||e({kind:`cli`,prompt:n.prompt,cli:n.cli,stage:n.stage===!0,...r})};return t.addEventListener(X,n),()=>t.removeEventListener(X,n)}export{v as S,T as _,q as a,y as b,Y as c,L as d,F as f,U as g,N as h,W as i,J as l,j as m,$ as n,K as o,R as p,te as r,G as s,ee as t,M as u,x as v,b as x,_ as y};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{$t as n,Dn as r,Ei as i,Kn as a,Lr as o,Qt as s,Xn as c,Y as l,i as u,jr as d,ki as f,pr as p,tr as m}from"./DocumentContext-DDDUTQJi.js";import{t as h}from"./react-f2sANaYj.js";import{n as g,r as _}from"./dist-Nvb76hAm.js";import{r as v,t as y}from"./useQuery-ZeEDLtxh.js";import{t as b}from"./compiler-runtime-BfE3aGVn.js";import{t as x}from"./utils-CPqDy6Hr.js";import{i as S,n as C,t as w}from"./tooltip-Bz6z4_se.js";import{n as T,r as E,t as D}from"./collapsible-BKbszYZV.js";import{n as O,t as k}from"./toggle-group-B7p69Qfd.js";import{t as A}from"./button-DzgjsZzC.js";import{y as j}from"./constants-upload-CVKO8P4d.js";import{n as M}from"./dist-BGzUo_18.js";import{t as N}from"./dist-C_FzPxEX2.js";import{d as P}from"./constants-cc1-Bt4QPTUe.js";import{f as F,v as I}from"./documents-events-ddyuXdQl.js";import{n as L}from"./_envelope-q8XHEv4O-C-Qnl5Tu.js";import{C as ee,ht as R,vt as z}from"./schemas-api-CD98jV86.js";import{t as te}from"./note-window-mode-CI3Yju9B.js";import{t as B}from"./createLucideIcon-DdBzwsHe.js";import{t as V}from"./chevron-right-Bofu4lib.js";import{n as ne,t as re}from"./lint-plugin-meta-CtDE2R0v.js";import{t as H}from"./circle-alert-eBm4JPxY.js";import{Vn as U,fn as W,gr as G,ut as K,vr as q,vt as J,x as Y,xr as ie,xt as X,zn as ae}from"./CodeMirrorPropInput-C5fRuWf2.js";import{t as oe}from"./info-CyR0W2SK.js";import{t as se}from"./refresh-cw-CC7UZEnZ.js";import{t as ce}from"./sparkles-BS2TX_Um.js";import{t as le}from"./triangle-alert-BXrUEeRU.js";import{t as ue}from"./wrench-DqFwoSdV.js";import{t as de}from"./badge-DmdA1C7r.js";import{c as fe}from"./use-settings-route-Bj-m9X61.js";import{l as pe,s as me}from"./doc-hash-BJkweiX9.js";import{t as he}from"./diagnostic-breadcrumb-DPgUDxA8.js";import{n as ge,t as _e}from"./perf-CPPbaRwr.js";import{T as ve,x as ye}from"./config-provider-4lMZjvv1.js";import{A as be}from"./navigation-targets-DSSJ_2xi.js";import{J as xe,K as Se,Mt as Ce,Nt as we,X as Te,wt as Ee}from"./dist-BosZaL03.js";import{n as De,r as Oe}from"./PageListContext-CbzXXblg.js";import{a as ke,c as Ae,i as je,n as Me,r as Ne,s as Pe,t as Fe}from"./panel-4D0jDR6z.js";import{d as Ie,h as Le,u as Re,y as ze}from"./markdown-lint-BuEapKhE.js";import{t as Be}from"./skeleton-CrbF9ppq.js";import{a as Ve,c as He,d as Ue}from"./lint-config-client-DRJNyM2s.js";var We=B(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Ge=56,Ke=2,qe=150,Je=2e3;function Ye(e,t,n){return e.top+e.height/2-(n+t)/2}function Xe(e,t){let n=Math.max(0,t.scrollHeight-t.clientHeight);return Math.max(0,Math.min(e,n))}function Ze(e){let{docName:t,container:n,measureTarget:r,placement:i,intent:o,grade:s,landedMode:l,transition:u,onOutcome:d,onDiscardQueuedTarget:f,toolbarOffset:p=Ge,driftThresholdPx:h=Ke,quietMs:g=qe,abandonAfterMs:_=Je}=e,v=e.contentColumn??n.firstElementChild,y=a(t,`landing`),b=c(t,{yieldsToNavigation:o===`toggle`,supersede:()=>P(`superseded`)}),x=n.style.overflowAnchor;n.style.overflowAnchor=`none`,u&&ge(`ok/mode-switch/transition`,{from:u.from,to:u.to,grade:s});let S=!1,C=null,w,T,E=0,D,O=()=>{let e=r();return e===null?null:Xe(i===`center`?Ye(e,n.clientHeight,p):e.top-p,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&&m({docName:t,container:n,targetScrollTop:n.scrollTop,mode:l})}finally{j()}ge(`ok/landing/land`,{grade:s,delta:e}),d?.({status:`landed`,delta:e})},N=()=>{if(S)return;S=!0;let e=C??n.scrollTop,t;try{t=A()}finally{j()}ge(`ok/landing/abandoned`,{grade:s,target:e,delta:t}),d?.({status:`abandoned`,delta:t})},P=e=>{S||(S=!0,j(),e===`mode-flip`&&f?.(),d?.({status:`cancelled`,reason:e}))},F=()=>{w&&clearTimeout(w),w=setTimeout(M,g)};function I(){P(`user-scroll`)}function L(){if(S)return;let{measurable:e,moved:t}=k();e&&(t||w===void 0)&&F()}try{k().measurable&&F(),n.addEventListener(`contentvisibilityautostatechange`,L,!0),n.addEventListener(`wheel`,I,{passive:!0}),n.addEventListener(`touchstart`,I,{passive:!0}),typeof ResizeObserver<`u`&&v&&(D=new ResizeObserver(L),D.observe(v)),E=requestAnimationFrame(L),T=setTimeout(N,_)}catch(e){throw S=!0,j(),e}return{cancel:P}}function Qe(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 $e(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($e).join(``):``}function et(e,t){let{frontmatter:n,body:r}=z(e),i=n===``?0:n.split(`
|
|
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:Qe(e.type),text:$e(e)})),fmLineCount:i}}catch{return performance.mark(`ok/block-spans/parse-failed`),{blocks:[],fmLineCount:i}}}function tt(e,t){let{blocks:n,fmLineCount:r}=et(e,t);return{spans:n.map(e=>({start:e.start,end:e.end})),fmLineCount:r}}function nt(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 rt(e){let t=0;for(let n=e.childCount-1;n>=0;n--){let r=e.child(n);if(r.type.name!==`paragraph`||r.content.size!==0)break;t++}return t===e.childCount?0:e.childCount}function it(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 at(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
3
|
+
`&&t.push(n+1);return t}function ot(e,t,n){return t<=1?0:t-1>=e.length?n:e[t-1]??n}function st(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 ct(e,t,n){return Math.max(t,Math.min(e,n))}function lt(e,t){let n=e=>e.replace(/\s+/g,` `).trim();return n(e)===n(t)}function ut(e,t){return t.inRange?t.tripwireOk?lt(e.content,t.text)?`exact`:e.kind===t.kind?`same-type-ordinal`:`ordinal`:`ordinal`:`clamped`}function dt(e){let t=null,n=null;function r(r){return n!==null&&t===r?n:(n={blocks:et(r,e).blocks,lineStarts:at(r)},t=r,n)}return{captureFromWysiwyg(e,t,n){if(e.childCount===0)return null;let r=ct(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:Qe(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=ct(t,0,e.length),s=nt(i,st(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=ot(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=rt(n)===i.length,c=i[ct(e.blockIndex,0,i.length-1)],l=ot(a,c.start,t.length),u=Math.min(ot(a,c.end+1,t.length),t.length),d=ut(e,{inRange:o,tripwireOk:s,kind:c.kind,text:c.text}),f=l;return d===`exact`&&e.selectionInBlock!==void 0&&(f=ct(l+e.selectionInBlock,l,u)),{blockStart:l,blockEnd:u,point:f,confidence:d}},resolveInWysiwyg(e,{source:t,doc:n}){let i=rt(n);if(i===0)return null;let{blocks:a}=r(t),o=e.blockIndex>=0&&e.blockIndex<i,s=i===a.length,c=ct(e.blockIndex,0,i-1),l=it(n,c,c+1);if(l===null)return null;let u=n.child(c),d=ut(e,{inRange:o,tripwireOk:s,kind:Qe(u.type.name),text:u.textContent});return{blockStart:l.from,blockEnd:l.to,point:l.from,confidence:d}}}}var ft=Ce.define(),pt=Ce.define(),mt=Se.mark({class:s}),ht=we.define({create(){return Se.none},update(e,t){let n=e.map(t.changes);for(let e of t.effects)e.is(ft)?n=Se.set([mt.range(e.value.from,e.value.to)]):e.is(pt)&&(n=Se.none);return n},provide:e=>xe.decorations.from(e)}),gt=new WeakMap,_t=Te.define(e=>({destroy(){let t=gt.get(e);t!==void 0&&(clearTimeout(t),gt.delete(e))}}));function vt(e,t,r,i){let a=n(e.state.doc.length,t,r,i);if(!a)return;e.dispatch({effects:ft.of(a)});let o=gt.get(e);o!==void 0&&clearTimeout(o);let s=setTimeout(()=>{gt.delete(e),e.dispatch({effects:pt.of(null)})},J);gt.set(e,s)}function yt(){return[ht,_t]}var bt=3e4;function xt(){let e=new Map,t=e=>e?Date.now()-e.rememberedAt>bt?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 St=xt(),Ct=xt(),wt=St.remember,Tt=St.peek,Et=St.consume,Dt=St.clear;St.clearForTest;var Ot=Ct.remember,kt=Ct.peek,At=Ct.consume,jt=Ct.clear;Ct.clearForTest;function Mt(e,t,n){return{start:ve(e,t),end:ve(e,n)}}function Nt(e,t){let n=ye(e.start,t),r=ye(e.end,t);return n===null||r===null||r.index<=n.index?null:n.index}var Pt=`open-knowledge:view-in-source`,Ft=null;function It(){return Ft??=dt(K()),Ft}function Lt(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?Mt(n,o.blockStart,o.blockEnd):void 0}}function Rt(e){let{editor:t,docName:n,ytext:r}=e,i=G(t);if(!i)return;let a=i.state.selection.from,o=Lt(i.state.doc,a,r,It(),`jump`);o&&wt(n,o),window.dispatchEvent(new CustomEvent(Pt,{detail:{docName:n}}))}function zt(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?Mt(n,o.blockStart,o.blockEnd):void 0}}function Bt(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=Nt(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 Vt(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=Nt(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 Ht(e,t){try{return e.coordsAtPos(t)}catch{return null}}function Ut(e,t,n){let r=Math.max(0,Math.min(n,e.state.doc.length)),i=t.getBoundingClientRect().top,a=Ht(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 Wt(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 Gt(e,t,n){if(e.isDestroyed)return null;let r=Wt(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 Kt(){return typeof document>`u`?null:r()}function qt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=Y();for(let t of[i+1,i+12,i+40]){let i=e.posAtCoords({left:r,top:n.top+t});if(i)return i.pos}return null}function Jt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=Y();for(let t of[i+1,i+12,i+40]){let i=e.posAtCoords({x:r,y:n.top+t});if(i!==null)return i}return null}function Yt(e){let{from:t,to:n,docName:r,ytext:i}=e;t===`wysiwyg`&&n===`source`?Xt(r,i):t===`source`&&n===`wysiwyg`&&Zt(r,i)}function Xt(e,t){let n=Tt(e);if(n&&n.kind!==`selection-offset`)return;let r=p(e);if(!r)return;let i=G(r);if(!i)return;let a=Kt();if(!a)return;let o=qt(i,a);if(o===null)return;let s=Lt(i.state.doc,o,t,It());s&&wt(e,s)}function Zt(e,t){let n=ae(e);if(!n)return;let r=Kt();if(!r)return;let i=Jt(n,r);if(i===null)return;let a=p(e),o=a?G(a)?.state.doc:void 0,s=zt(t.toString(),i,t,It(),o);s&&Ot(e,s)}function Qt(e){let{view:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=p(n),s=o?G(o)?.state.doc:void 0;if(!s)return null;let l=Vt(r,{source:t.state.doc.toString(),pmDoc:s,ydoc:i,resolver:It()});if(!l)return null;let u=Kt();if(!u)return null;let d=l,f=r.intent===`jump`,m=f?d.point:d.blockStart;t.dispatch({effects:xe.scrollIntoView(m,{y:`start`})});let h=!1,g=null,_=c(n,{yieldsToNavigation:!f,supersede:()=>{h=!0,_.release()}}),v=e=>{if(!h){if(Ht(t,m)===null&&e<8){requestAnimationFrame(()=>v(e+1));return}try{f&&(t.dispatch({selection:Ee.cursor(m)}),t.focus())}finally{_.release()}g=Ze({docName:n,container:u,contentColumn:t.contentDOM,measureTarget:()=>Ut(t,u,m),placement:f?`center`:`top`,intent:f?`jump`:`toggle`,grade:d.confidence,landedMode:`source`,transition:a,toolbarOffset:Y(),onOutcome:f?e=>{e.status===`landed`&&vt(t,d.blockStart,d.blockEnd,d.confidence)}:void 0,onDiscardQueuedTarget:()=>Dt(n)})}};return v(0),{cancel:e=>{h=!0,_.release(),g?.cancel(e)}}}function $t(e){let{editor:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=G(t);if(!o)return null;let s=Bt(r,{source:i.getText(`source`).toString(),pmDoc:o.state.doc,ydoc:i,resolver:It()});if(!s)return null;let c=Kt();if(!c)return null;let l=s;return Ze({docName:n,container:c,contentColumn:o.dom,measureTarget:()=>Gt(o,c,l.point),placement:`top`,intent:`toggle`,grade:l.confidence,landedMode:`wysiwyg`,transition:a,toolbarOffset:Y(),onDiscardQueuedTarget:()=>jt(n)})}var en={words:0,chars:0,tokens:0},tn=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,nn=/[\p{L}\p{N}]/u,rn=new Set([`text`,`inlineCode`,`code`,`tag`]),an=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),on=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function sn(e,t){if(!e)return;let n=e.type;if(!an.has(n)){if(rn.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
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)sn(n,t);if(on.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
5
|
+
`)&&t.push(`
|
|
6
|
+
`)}}}}function cn(e){try{let t=K().parseToMdast(e),n=[];return sn(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function ln(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))nn.test(n)&&t++;return t}function un(e){let t=globalThis.Intl.Segmenter;if(!t)return ln(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function dn(e){let t=tn.test(e)?1.5:4;return Math.ceil(e.length/t)}function fn(e){return e?{words:tn.test(e)?un(e):ln(e),chars:e.length,tokens:dn(e)}:{words:0,chars:0,tokens:0}}function pn(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=z(e);return t.trim()?fn(cn(t)):{words:0,chars:0,tokens:0}}function mn(e){return fn(e)}function hn(e,{isMarkdown:t}){let n=e.trim();return n?fn(t?cn(e):n):en}function gn(e,t){return e!==null&&j(e)?`source`:t}var _n=new Map,vn=new Set,yn=(e,t)=>`${t}:${e}`;function bn(){for(let e of vn)e()}function xn(e,t,n){let r=yn(e,t);if(n===null){_n.delete(r)&&bn();return}let i=_n.get(r);i&&i.words===n.words&&i.chars===n.chars&&i.tokens===n.tokens||(_n.set(r,n),bn())}function Sn(e,t){return e===null?null:_n.get(yn(e,t))??null}function Cn(e){return vn.add(e),()=>{vn.delete(e)}}function wn(e){let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
|
7
|
+
`,` `);return i.trim()?hn(i,{isMarkdown:!1}):null}function Tn(e){let t=[];for(let n of e.state.selection.ranges)n.empty||t.push(e.state.sliceDoc(n.from,n.to));if(t.length===0)return null;let n=t.join(`
|
|
8
|
+
`);return n.trim()?hn(n,{isMarkdown:!0}):null}var Z=e(h(),1),Q=b(),$=t();function En(e){let t=(0,Q.c)(14),{scope:n,onScopeChange:r,projectLabel:i}=e,{_:a}=_(),o;t[0]===r?o=t[1]:(o=e=>{e&&r(e)},t[0]=r,t[1]=o);let s;t[2]===a?s=t[3]:(s=a({id:`aBgwis`}),t[2]=a,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(O,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,$.jsx)(g,{id:`UpCz01`})}),t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=i??(0,$.jsx)(g,{id:`ZWyHmq`}),t[5]=i,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,$.jsx)(O,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n||t[10]!==o||t[11]!==s||t[12]!==u?(d=(0,$.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,$.jsxs)(k,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:o,"aria-label":s,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[c,u]})}),t[9]=n,t[10]=o,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function Dn(e){let t=e.localTarget;if(e.source!==`links`||t===void 0)return e.message;let n=t.resolvedTarget??t.href;return t.reason===`unresolvable`?t.role===`image`?N._({id:`W5qdI_`,values:{shown:n}}):N._({id:`bpMVIA`,values:{shown:n}}):t.reason===`excluded`?t.role===`image`?N._({id:`qAC6UE`,values:{shown:n}}):N._({id:`gssxm9`,values:{shown:n}}):t.targetKind===`file`?t.role===`image`?N._({id:`iSWh95`,values:{shown:n}}):N._({id:`fOzzSV`,values:{shown:n}}):N._({id:`XBBZnv`,values:{shown:n}})}var On=`audit-superseded`;async function kn(e={kind:`project`},t){return jn(e,Ie,!1,t)}async function An(e={kind:`project`},t){return jn(e,Re,!0,t)}async function jn(e,t,n,r){try{let i=new URLSearchParams;e.kind===`path`?i.set(`path`,e.path):e.kind===`doc`&&i.set(`doc`,e.docName),n&&i.set(`counts`,`1`);let a=i.size===0?``:`?${i}`,o=await fetch(`/api/audit${a}`,r===void 0?void 0:{signal:r});if(!o.ok)return o.status===409?On:(console.warn(`[audit] request failed`,o.status,o.statusText),null);let s;try{s=await o.json()}catch{return r?.aborted===!0||console.warn(`[audit] response body is not valid JSON`),null}let c=t.safeParse(s);return c.success?c.data:(console.warn(`[audit] response failed schema validation`,c.error.issues),null)}catch(e){return r?.aborted===!0||console.warn(`[audit] fetch threw`,e),null}}function Mn(e,t){let n=!1,r=!1,i=!1,a=[],o,s=null,c=()=>({findings:a,...o===void 0?{}:{brokenLinkSuppression:o}}),l=()=>{if(r){i=!0;return}r=!0,s=new AbortController,t({status:`loading`,...c()}),kn({kind:`doc`,docName:e},s.signal).then(e=>{if(!(n||s?.signal.aborted===!0)){if(e===null){t({status:`failed`,...c()});return}if(e===`audit-superseded`){i=!0;return}i||(a=e.files.flatMap(e=>e.diagnostics).filter(e=>e.source===`links`),o=e.brokenLinkSuppression,t({status:`loaded`,...c()}))}}).finally(()=>{n||(r=!1,s=null,i&&(i=!1,l()))})};l();let u=I(e=>{(e.includes(`backlinks`)||F(e))&&l()}),d=He(l);return()=>{n=!0,s?.abort(),u(),d()}}function Nn(e){let t=(0,Q.c)(6),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={docName:null,state:{status:`idle`,findings:[]}},t[0]=n):n=t[0];let[r,i]=(0,Z.useState)(n),a,o;if(t[1]===e?(a=t[2],o=t[3]):(a=()=>{if(e===null){i({docName:null,state:{status:`idle`,findings:[]}});return}return i({docName:e,state:{status:`loading`,findings:[]}}),Mn(e,t=>i({docName:e,state:t}))},o=[e],t[1]=e,t[2]=a,t[3]=o),(0,Z.useEffect)(a,o),r.docName!==e){let n;return t[4]===e?n=t[5]:(n=e===null?{status:`idle`,findings:[]}:{status:`loading`,findings:[]},t[4]=e,t[5]=n),n}return r.state}function Pn(e){return Math.min(50,Math.max(1,Math.ceil(e/10)))}function Fn(e,t){return e===t||e%Pn(t)===0}var In=[250,500,1e3,2e3,4e3];function Ln(e){return e.status===503&&e.problemType===`urn:ok:error:too-many-agent-sessions`}async function Rn(e,t){let n=await t.fixItem(e);for(let r of In){if(n.ok||!Ln(n)||!t.shouldContinue()||(console.debug(`[sweep] capacity refusal, backing off %dms`,r),await t.sleep(r),!t.shouldContinue()))break;n=await t.fixItem(e)}return n}async function zn(e){let t=e.items.length,n=[];for(let[r,i]of e.items.entries()){if(r>0&&(await e.sleep(15),!e.shouldContinue()))return{failures:n,cancelled:!0};let a=await Rn(i,e);if(a.ok||n.push({item:i,detail:a.errorDetail}),!e.shouldContinue())return{failures:n,cancelled:!0};let o=r+1;Fn(o,t)&&e.onProgress(o,t)}return{failures:n,cancelled:!1}}function Bn(e){return new Promise(t=>setTimeout(t,e))}var Vn=null,Hn=!1,Un=new Set,Wn=new Set;function Gn(e){Vn=e;for(let e of Un)e()}function Kn(e){return Un.add(e),()=>{Un.delete(e)}}function qn(){return Vn}function Jn(){return(0,Z.useSyncExternalStore)(Kn,qn,qn)}function Yn(e){return Wn.add(e),()=>{Wn.delete(e)}}function Xn(){Hn=!0}function Zn(e,t,n){if(e.length>0&&(console.warn(`[lint] fix-all: ${e.length} of ${n} files failed`,e.map(e=>({file:e.item.file,detail:e.detail}))),!t)){let t=e[0];M.error(N._({id:`se-tU0`,values:{0:e.length,total:n}}),{description:t===void 0?void 0:`${t.item.file}${t.detail===null?``:` — ${t.detail}`}`})}if(t){M.info(N._({id:`H1TmTu`}));return}e.length===0&&M.success(N._({id:`SWX1O7`,values:{total:n}}))}async function Qn({items:e,fixItem:t,sleep:n=Bn}){if(Vn!==null||e.length===0)return;let r=e.length;Hn=!1,Gn({done:0,total:r});let i=[],a=!1,o=!1;try{let o=await zn({items:e,fixItem:t,sleep:n,onProgress:e=>Gn({done:e,total:r}),shouldContinue:()=>!Hn});i=o.failures,a=o.cancelled}catch(e){console.warn(`[lint] fix-all: sweep threw`,e),o=!0}finally{Gn(null)}try{o?M.error(N._({id:`vwV-kH`})):Zn(i,a,r)}finally{for(let e of Wn)e()}}var $n={errorCount:0,warningCount:0},er=new Map,tr=new Set,nr=new Map;function rr(){let e=new Map;for(let[t,n]of er){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})}nr=e;for(let e of tr)e()}var ir=Le;function ar(e){return tr.add(e),()=>{tr.delete(e)}}function or(){return nr}function sr(e){er.clear();for(let t of e)er.set(me(t.file),ir(t.diagnostics));rr()}function cr(e){er.clear();for(let t of e)er.set(me(t.file),{lint:t.lint,links:t.links});rr()}function lr(e,t){er.set(e,ir(t)),rr()}function ur(e,t,n){let r=er.get(e)??{lint:$n,links:$n},i=r[t];i.errorCount===n.errorCount&&i.warningCount===n.warningCount||(er.set(e,{...r,[t]:n}),rr())}var dr=`open-knowledge:lint-nav`;function fr(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function pr(e,t){return{docName:e,line:t.range.start.line+1,column:t.range.start.character+1,source:t.source,...t.frontmatterScope===void 0?{}:{frontmatterScope:t.frontmatterScope}}}function mr(e){if(e.source!==`links`)return null;let t=e.localTarget;return t===void 0?`document`:t.role===`image`?`image`:t.targetKind===`file`?`file`:t.targetKind===`document`?`document`:`unresolvable`}var hr={document:d,file:o,image:q,unresolvable:d};function gr(e){return e.linkTarget!==void 0&&mr(e)===`document`}function _r(e){let t=(0,Q.c)(40),{diagnostic:n,instanceCount:r}=e,{_:i}=_(),a=n.severity===`error`?H:le,o=n.range.start.line+1,s;t[0]===n?s=t[1]:(s=mr(n),t[0]=n,t[1]=s);let c=s,l=c===null?null:hr[c],u=r!==void 0&&r>1,d=n.severity===`error`?`text-destructive`:`text-amber-500`,f;t[2]===d?f=t[3]:(f=x(`mt-0.5 size-3.5 shrink-0`,d),t[2]=d,t[3]=f);let p;t[4]!==a||t[5]!==f?(p=(0,$.jsx)(a,{"aria-hidden":`true`,className:f}),t[4]=a,t[5]=f,t[6]=p):p=t[6];let m;t[7]===n?m=t[8]:(m=Dn(n),t[7]=n,t[8]=m);let h;t[9]===m?h=t[10]:(h=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 text-foreground`,children:m}),t[9]=m,t[10]=h);let v;t[11]!==u||t[12]!==r?(v=u?(0,$.jsxs)(`span`,{className:`mt-0.5 flex shrink-0 items-center gap-1`,children:[(0,$.jsx)(de,{variant:`gray`,"data-testid":`problems-instance-count`,className:`h-4 px-1 font-sans text-[10px] leading-none`,children:(0,$.jsx)(g,{id:`iZCZmF`,values:{instanceCount:r}})}),(0,$.jsx)(V,{"aria-hidden":`true`,className:`size-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`})]}):null,t[11]=u,t[12]=r,t[13]=v):v=t[13];let y;t[14]!==p||t[15]!==h||t[16]!==v?(y=(0,$.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[p,h,v]}),t[14]=p,t[15]=h,t[16]=v,t[17]=y):y=t[17];let b=c??void 0,S=l!==null&&`gap-0.5`,C;t[18]===S?C=t[19]:(C=x(`h-4 shrink-0 px-1 font-sans text-[10px] uppercase leading-none`,S),t[18]=S,t[19]=C);let w;t[20]===l?w=t[21]:(w=l===null?null:(0,$.jsx)(l,{"aria-hidden":`true`,className:`size-2.5`}),t[20]=l,t[21]=w);let T;t[22]!==n.source||t[23]!==C||t[24]!==w||t[25]!==b?(T=(0,$.jsxs)(de,{variant:`gray`,"data-testid":`problems-source-tag`,"data-target-kind":b,className:C,children:[w,n.source]}),t[22]=n.source,t[23]=C,t[24]=w,t[25]=b,t[26]=T):T=t[26];let E;t[27]!==i||t[28]!==n.code||t[29]!==o||t[30]!==u?(E=u?n.code:`${n.code} · ${i({id:`enPTnx`,values:{displayLine:o}})}`,t[27]=i,t[28]=n.code,t[29]=o,t[30]=u,t[31]=E):E=t[31];let D;t[32]===E?D=t[33]:(D=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:E}),t[32]=E,t[33]=D);let O;t[34]!==T||t[35]!==D?(O=(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 ps-5 font-mono text-xs text-muted-foreground`,children:[T,D]}),t[34]=T,t[35]=D,t[36]=O):O=t[36];let k;return t[37]!==O||t[38]!==y?(k=(0,$.jsxs)($.Fragment,{children:[y,O]}),t[37]=O,t[38]=y,t[39]=k):k=t[39],k}function vr(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 yr(e){let t=(0,Q.c)(63),{group:n,onNavigate:r,navTitle:i,renderActions:a}=e,{_:o}=_(),s=n.instances[0],c,l,u,d,f,p,m,h;if(t[0]!==o||t[1]!==s||t[2]!==n.instances.length||t[3]!==i||t[4]!==r||t[5]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Dn(s);if(n.instances.length===1){let e;t[14]!==s||t[15]!==a?(e=a(s),t[14]=s,t[15]=a,t[16]=e):e=t[16];let n=e,o;t[17]!==s||t[18]!==r?(o=()=>r(s),t[17]=s,t[18]=r,t[19]=o):o=t[19];let c;t[20]!==s||t[21]!==i?(c=i(s),t[20]=s,t[21]=i,t[22]=c):c=t[22];let l;t[23]===s?l=t[24]:(l=(0,$.jsx)(_r,{diagnostic:s}),t[23]=s,t[24]=l);let u;t[25]!==l||t[26]!==o||t[27]!==c?(u=(0,$.jsx)(`button`,{type:`button`,onClick:o,className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:c,children:l}),t[25]=l,t[26]=o,t[27]=c,t[28]=u):u=t[28];let d;t[29]===n?d=t[30]:(d=n===null?null:(0,$.jsx)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:n}),t[29]=n,t[30]=d);let f;t[31]!==u||t[32]!==d?(f=(0,$.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[u,d]}),t[31]=u,t[32]=d,t[33]=f):f=t[33],h=f;break bb0}p=`rounded`,m=`problems-duplicate-group`,l=D,t[34]!==s||t[35]!==n.instances.length?(f=(0,$.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,$.jsx)(_r,{diagnostic:s,instanceCount:n.instances.length})}),t[34]=s,t[35]=n.instances.length,t[36]=f):f=t[36],c=T,d=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,u=o({id:`_Bix3-`,values:{localizedFirstMessage:e}})}t[0]=o,t[1]=s,t[2]=n.instances.length,t[3]=i,t[4]=r,t[5]=a,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13];if(h!==Symbol.for(`react.early_return_sentinel`))return h;let g;if(t[37]!==o||t[38]!==n.instances||t[39]!==i||t[40]!==r||t[41]!==a){let e;t[43]!==o||t[44]!==i||t[45]!==r||t[46]!==a?(e=e=>{let t=a(e),n=e.range.start.line+1,s=Dn(e);return(0,$.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:`flex w-full cursor-pointer rounded px-2 py-1 text-left font-mono text-xs text-muted-foreground`,title:i(e),"aria-label":o({id:`txUHO8`,values:{localizedMessage:s,displayLine:n}}),children:o({id:`enPTnx`,values:{displayLine:n}})}),t===null?null:(0,$.jsx)(`div`,{className:`absolute bottom-0.5 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:t})]},br(e))},t[43]=o,t[44]=i,t[45]=r,t[46]=a,t[47]=e):e=t[47],g=n.instances.map(e),t[37]=o,t[38]=n.instances,t[39]=i,t[40]=r,t[41]=a,t[42]=g}else g=t[42];let v;t[48]!==u||t[49]!==g?(v=(0,$.jsx)(`ul`,{"aria-label":u,className:`flex flex-col gap-0.5 pb-1 ps-5`,"data-testid":`problems-duplicate-instances`,children:g}),t[48]=u,t[49]=g,t[50]=v):v=t[50];let y;t[51]!==c||t[52]!==d||t[53]!==v?(y=(0,$.jsx)(c,{className:d,children:v}),t[51]=c,t[52]=d,t[53]=v,t[54]=y):y=t[54];let b;t[55]!==l||t[56]!==f||t[57]!==y?(b=(0,$.jsxs)(l,{children:[f,y]}),t[55]=l,t[56]=f,t[57]=y,t[58]=b):b=t[58];let x;return t[59]!==b||t[60]!==p||t[61]!==m?(x=(0,$.jsx)(`li`,{className:p,"data-testid":m,children:b}),t[59]=b,t[60]=p,t[61]=m,t[62]=x):x=t[62],x}function br(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function xr(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function Sr(e){let t=(0,Q.c)(11),{target:n,creating:r,disabled:i,onCreate:a}=e,{_:o}=_(),s;t[0]!==o||t[1]!==n?(s=o({id:`oWsZk8`,values:{target:n}}),t[0]=o,t[1]=n,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(ie,{"aria-hidden":`true`,className:`size-3`}),t[3]=c):c=t[3];let l;t[4]===r?l=t[5]:(l=r?(0,$.jsx)(g,{id:`E9bKSA`}):(0,$.jsx)(g,{id:`XRuL0i`}),t[4]=r,t[5]=l);let u;return t[6]!==i||t[7]!==a||t[8]!==s||t[9]!==l?(u=(0,$.jsxs)(A,{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 Cr(e){let t=(0,Q.c)(8),{tip:n,testId:r,children:i}=e,a;t[0]===i?a=t[1]:(a=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:i})}),t[0]=i,t[1]=a);let o;t[2]!==r||t[3]!==n?(o=(0,$.jsx)(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,$.jsxs)(w,{children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function wr(e){let t=(0,Q.c)(21),{count:n,problemCount:r,aiAvailable:i,disabled:a,onClick:o,children:s}=e,{_:c}=_(),l;t[0]!==i||t[1]!==n||t[2]!==r?(l=n>0?(0,$.jsx)(g,{id:`vjwsDi`,values:{count:n}}):r===0?(0,$.jsx)(g,{id:`gAhHu7`}):i?(0,$.jsx)(g,{id:`zA9zRL`}):(0,$.jsx)(g,{id:`X3MMeA`}),t[0]=i,t[1]=n,t[2]=r,t[3]=l):l=t[3];let u;t[4]!==c||t[5]!==s||t[6]!==n||t[7]!==r?(u=s===void 0?r===0?c({id:`4m-xuX`}):n===0?c({id:`SqIoy_`}):void 0:void 0,t[4]=c,t[5]=s,t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(ue,{"aria-hidden":`true`,className:`size-3`}),t[9]=d):d=t[9];let f;t[10]!==s||t[11]!==n?(f=s??(0,$.jsx)(g,{id:`RZXTlY`,values:{count:n}}),t[10]=s,t[11]=n,t[12]=f):f=t[12];let p;t[13]!==a||t[14]!==o||t[15]!==u||t[16]!==f?(p=(0,$.jsxs)(A,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:a,onClick:o,"aria-label":u,"data-testid":`problems-auto-fix`,children:[d,f]}),t[13]=a,t[14]=o,t[15]=u,t[16]=f,t[17]=p):p=t[17];let m;return t[18]!==l||t[19]!==p?(m=(0,$.jsx)(Cr,{testId:`problems-auto-fix-tip`,tip:l,children:p}),t[18]=l,t[19]=p,t[20]=m):m=t[20],m}function Tr(e){let t=(0,Q.c)(12),{count:n,disabled:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(g,{id:`mgDKWS`,values:{count:n}}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(ce,{"aria-hidden":`true`,className:`size-3`}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,$.jsx)(g,{id:`gyHDWC`,values:{count:n}}),t[3]=n,t[4]=s);let c;t[5]!==r||t[6]!==i||t[7]!==s?(c=(0,$.jsxs)(A,{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,$.jsx)(Cr,{testId:`problems-fix-with-ai-tip`,tip:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Er(e){let t=(0,Q.c)(62),{docName:n,diagnostics:r,linkFindingsStatus:a,brokenLinkSuppression:o,onFix:s,onAutoFix:c,onAskAi:u,onFixWithAi:d,onDestinationComplete:p,onDestinationRequested:m}=e,h=a===void 0?`loaded`:a,{_:v}=_(),y=(0,Z.useRef)(null),b=(0,Z.useId)(),[x,T]=(0,Z.useState)(`doc`),E;t[0]===n?E=t[1]:(E=j(n),t[0]=n,t[1]=E);let D=!E,{data:O}=Ue(),k=O===null?null:O.effective.enabled?re.filter(e=>O.effective.plugins[e.id].enabled):[],N=k!==null&&k.length===0,P=o!==void 0,L=(x===`project`||D)&&k!==null&&k.length>0,ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee={status:`idle`},t[2]=ee):ee=t[2];let[R,z]=(0,Z.useState)(ee),te=Jn(),B=De(),[V,ne]=(0,Z.useState)(null),H=(0,Z.useRef)(!0),U,W;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>(H.current=!0,()=>{H.current=!1}),W=[],t[3]=U,t[4]=W):(U=t[3],W=t[4]),(0,Z.useEffect)(U,W);let G=(0,Z.useRef)(Pr),K=(0,Z.useRef)(Nr),q;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(q={status:`idle`},t[5]=q):q=t[5];let J=(0,Z.useRef)(q),Y;t[6]===R?Y=t[7]:(Y=()=>{R.status!==`loading`&&(J.current=R)},t[6]=R,t[7]=Y),(0,Z.useEffect)(Y);let ie=(0,Z.useRef)(0),X=[...r].sort(fr),ae=xr(X),oe;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(oe=async function(){ie.current+=1;let e=ie.current,t=J.current;z({status:`loading`});let n=await kn();if(n===`audit-superseded`){ie.current===e&&H.current&&z(t.status===`idle`?{status:`failed`}:t);return}n!==null&&sr(n.files),H.current&&z(n===null?{status:`failed`}:{status:`loaded`,result:n})},t[8]=oe):oe=t[8];let se=oe,le;t[9]!==v||t[10]!==R.status||t[11]!==V||t[12]!==B?(le=async function(e){let t=e.linkTarget;if(!(t===void 0||V!==null||B===null)){ne(t);try{await l({initialDir:``,suggestedName:t},{addPage:B.addPage})}catch(e){let t=e;M.error(t instanceof Error?t.message:v({id:`tfi40B`})),H.current&&ne(null);return}M.success(v({id:`EWCJFu`,values:{target:t}})),H.current&&ne(null),H.current&&R.status===`loaded`&&await se()}},t[9]=v,t[10]=R.status,t[11]=V,t[12]=B,t[13]=le):le=t[13];let de=le,he=R.status===`loaded`?R.result.files.filter(jr):[],ge=function(){Qn({items:he,fixItem:Ar})},_e;t[14]===R.status?_e=t[15]:(_e=function(e){T(e),e===`project`&&R.status===`idle`&&se()},t[14]=R.status,t[15]=_e);let ve=_e,ye;t[16]===R.status?ye=t[17]:(ye=()=>{G.current=()=>{R.status===`idle`||R.status===`failed`||se()}},t[16]=R.status,t[17]=ye),(0,Z.useEffect)(ye);let be,xe;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(be=()=>He(()=>G.current()),xe=[],t[18]=be,t[19]=xe):(be=t[18],xe=t[19]),(0,Z.useEffect)(be,xe);let Se,Ce;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Se=()=>I(e=>{F(e)&&G.current()}),Ce=[],t[20]=Se,t[21]=Ce):(Se=t[20],Ce=t[21]),(0,Z.useEffect)(Se,Ce);let we;t[22]===ve?we=t[23]:(we=(e,t)=>{e===`problems`&&(i(`problems`),t.scope!==void 0&&ve(t.scope),t.focus===`panel`&&y.current?.focus({preventScroll:!0}))},t[22]=ve,t[23]=we);let Te=(0,Z.useEffectEvent)(we),Ee;t[24]===Te?Ee=t[25]:(Ee=()=>{let e=i(`problems`);return e!==null&&Te(`problems`,e),f(Te)},t[24]=Te,t[25]=Ee);let Oe;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=[],t[26]=Oe):Oe=t[26],(0,Z.useEffect)(Ee,Oe);let Ie;t[27]===R.status?Ie=t[28]:(Ie=()=>{K.current=()=>{R.status===`idle`||R.status===`failed`||se().catch(e=>{console.warn(`[lint] post-sweep re-audit failed`,e),H.current&&z({status:`failed`})})}},t[27]=R.status,t[28]=Ie),(0,Z.useEffect)(Ie);let Le,Re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Le=()=>Yn(()=>K.current()),Re=[],t[29]=Le,t[30]=Re):(Le=t[29],Re=t[30]),(0,Z.useEffect)(Le,Re);let ze;t[31]!==n||t[32]!==p?(ze=function(e){let t={...pr(n,e),onNavigated:p};wt(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(dr,{detail:t}))},t[31]=n,t[32]=p,t[33]=ze):ze=t[33];let Be=ze,Ve;t[34]!==n||t[35]!==Be||t[36]!==p||t[37]!==m?(Ve=function(e,t){let r=me(e);if(r===n){Be(t);return}let i={...pr(r,t),onNavigated:p};wt(r,{kind:`lint`,detail:i}),m?.(r,!1,()=>{window.dispatchEvent(new CustomEvent(dr,{detail:i}))},`navigated`),window.location.hash=pe(r)},t[34]=n,t[35]=Be,t[36]=p,t[37]=m,t[38]=Ve):Ve=t[38];let We=Ve,Ge;t[39]!==v||t[40]!==de||t[41]!==V||t[42]!==u||t[43]!==s||t[44]!==B?(Ge=function(e){let t=s!==void 0&&(e.fixes?.length??0)>0,n=gr(e)&&B!==null;if(!t&&!n&&u===void 0)return null;let r=`${e.source}/${e.code}`;return(0,$.jsxs)($.Fragment,{children:[n?(0,$.jsx)(Sr,{target:e.linkTarget??``,creating:V===e.linkTarget,disabled:V!==null,onCreate:()=>void de(e)}):null,t?(0,$.jsxs)(A,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>s?.(e),"aria-label":v({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,$.jsx)(ue,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(g,{id:`c4fVUV`})]}):null,u===void 0?null:(0,$.jsxs)(A,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>u(e),"aria-label":v({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,$.jsx)(ce,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(g,{id:`xWEvuo`})]})]})},t[39]=v,t[40]=de,t[41]=V,t[42]=u,t[43]=s,t[44]=B,t[45]=Ge):Ge=t[45];let Ke=Ge,qe=Fe,Je;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,$.jsx)(g,{id:`OXdGnd`}),t[46]=Je):Je=t[46];let Ye;t[47]===b?Ye=t[48]:(Ye=(0,$.jsx)(Ae,{id:b,children:Je}),t[47]=b,t[48]=Ye);let Xe=x===`doc`&&X.length>0&&(0,$.jsx)(Ne,{children:X.length}),Ze=L&&(0,$.jsxs)(w,{children:[(0,$.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,$.jsx)(g,{id:`yxF19Y`,values:{0:k.length}})}),(0,$.jsx)(C,{"data-testid":`problems-active-plugins-tooltip`,children:(0,$.jsx)(g,{id:`ws5o1F`,values:{0:k.map(kr).join(`, `)}})})]}),Qe;t[49]!==Ye||t[50]!==Xe||t[51]!==Ze?(Qe=(0,$.jsx)(Pe,{children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[Ye,Xe,Ze]})}),t[49]=Ye,t[50]=Xe,t[51]=Ze,t[52]=Qe):Qe=t[52];let $e;t[53]!==ve||t[54]!==x?($e=(0,$.jsx)(En,{scope:x,onScopeChange:ve}),t[53]=ve,t[54]=x,t[55]=$e):$e=t[55];let et=x===`doc`?(0,$.jsxs)(Me,{className:`px-2 py-2`,children:[h===`idle`||h===`loading`?(0,$.jsx)(je,{className:`px-2 pb-2`,role:`status`,"aria-live":`polite`,"data-testid":`problems-links-loading`,children:(0,$.jsx)(g,{id:`W9NSe0`})}):h===`failed`?(0,$.jsx)(ke,{className:`px-2 pb-2`,role:`status`,"data-testid":`problems-links-failed`,children:X.length>0||P?(0,$.jsx)(g,{id:`IoHQYP`}):(0,$.jsx)(g,{id:`gpbKxw`})}):null,P&&(0,$.jsx)(zr,{suppression:o}),X.length===0?h===`loaded`?D?N?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{className:`px-2`,"data-testid":`problems-no-plugins`,children:P?(0,$.jsx)(g,{id:`mI1KPS`}):(0,$.jsx)(g,{id:`Hngy37`})}),(0,$.jsx)(`div`,{className:`px-2 pt-2`,children:(0,$.jsx)(A,{variant:`outline`,size:`sm`,onClick:fe,"data-testid":`problems-enable-plugins`,children:(0,$.jsx)(g,{id:`rnX-1S`})})})]}):P?null:(0,$.jsx)(je,{className:`px-2`,children:(0,$.jsx)(g,{id:`ZI8uvA`})}):(0,$.jsx)(je,{className:`px-2`,"data-testid":`problems-markdown-not-applicable`,children:(0,$.jsx)(g,{id:`Kdvukk`})}):null:(0,$.jsxs)($.Fragment,{children:[c!==void 0||d!==void 0?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 px-2 pb-1`,children:[c!==void 0&&(0,$.jsx)(wr,{count:ae,problemCount:X.length,aiAvailable:d!==void 0,disabled:ae===0,onClick:c}),d!==void 0&&(0,$.jsx)(Tr,{count:X.length,disabled:!1,onClick:()=>d(`doc`)})]}):null,(0,$.jsx)(`ul`,{"aria-label":v({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:vr(X).map(e=>(0,$.jsx)(yr,{group:e,onNavigate:Be,navTitle:e=>v({id:`vbMHjo`,values:{0:e.range.start.line+1}}),renderActions:Ke},e.key))})]})]}):(0,$.jsx)(Fr,{audit:R,onRefresh:()=>void se(),onNavigate:We,fixableCount:he.reduce(Or,0),problemCount:R.status===`loaded`?R.result.files.reduce(Dr,0):0,fixing:te,onAutoFix:ge,onCancelFix:Xn,onFixWithAi:d===void 0||R.status!==`loaded`?void 0:()=>d(`project`),onCreateTarget:B===null?void 0:e=>void de(e),creatingTarget:V}),tt;return t[56]!==qe||t[57]!==b||t[58]!==Qe||t[59]!==$e||t[60]!==et?(tt=(0,$.jsxs)(qe,{ref:y,tabIndex:-1,"aria-labelledby":b,"data-testid":`problems-panel`,children:[Qe,$e,et]}),t[56]=qe,t[57]=b,t[58]=Qe,t[59]=$e,t[60]=et,t[61]=tt):tt=t[61],tt}function Dr(e,t){return e+t.diagnostics.length}function Or(e,t){return e+xr(t.diagnostics)}function kr(e){return e.label}function Ar(e){return Ve(me(e.file))}function jr(e){return e.diagnostics.some(Mr)}function Mr(e){return(e.fixes?.length??0)>0}function Nr(){}function Pr(){}function Fr(e){let t=(0,Q.c)(81),{audit:n,onRefresh:r,onNavigate:i,fixableCount:a,problemCount:o,fixing:s,onAutoFix:c,onCancelFix:l,onFixWithAi:u,onCreateTarget:d,creatingTarget:f}=e,{_:p}=_(),m=n.status===`loading`||n.status===`idle`,h;t[0]!==n.result||t[1]!==n.status?(h=n.status===`loaded`?n.result.files:[],t[0]=n.result,t[1]=n.status,t[2]=h):h=t[2];let v=h,[y,b]=(0,Z.useState)(Rr),x;t[3]!==y||t[4]!==v?(x=v.length>0&&v.every(e=>y.has(e.file)),t[3]=y,t[4]=v,t[5]=x):x=t[5];let T=x,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e,t){b(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},t[6]=E):E=t[6];let D=E,O;t[7]!==T||t[8]!==v?(O=function(){b(T?new Set:new Set(v.map(Lr)))},t[7]=T,t[8]=v,t[9]=O):O=t[9];let k=O,j;t[10]!==n.result||t[11]!==n.status?(j=n.status===`loaded`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,$.jsx)(g,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[10]=n.result,t[11]=n.status,t[12]=j):j=t[12];let M;t[13]===j?M=t[14]:(M=(0,$.jsx)(`p`,{className:`min-w-0 truncate text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:j}),t[13]=j,t[14]=M);let N;t[15]!==p||t[16]!==T||t[17]!==v.length||t[18]!==k?(N=v.length>0?(0,$.jsxs)(w,{children:[(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(A,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":p(T?{id:`I4LGsH`}:{id:`Ugvy4O`}),"data-testid":`problems-audit-expand-toggle`,onClick:k,children:T?(0,$.jsx)(We,{"aria-hidden":`true`,className:`size-3.5`}):(0,$.jsx)(ne,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,$.jsx)(C,{"data-testid":`problems-audit-expand-toggle-tooltip`,children:T?(0,$.jsx)(g,{id:`I4LGsH`}):(0,$.jsx)(g,{id:`Ugvy4O`})})]}):null,t[15]=p,t[16]=T,t[17]=v.length,t[18]=k,t[19]=N):N=t[19];let P;t[20]===p?P=t[21]:(P=p({id:`I7y_vn`}),t[20]=p,t[21]=P);let F=m||s!==null,I;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),t[22]=I):I=t[22];let L;t[23]!==r||t[24]!==P||t[25]!==F?(L=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(A,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":P,"data-testid":`problems-audit-refresh`,disabled:F,onClick:r,children:I})}),t[23]=r,t[24]=P,t[25]=F,t[26]=L):L=t[26];let ee;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(C,{"data-testid":`problems-audit-refresh-tooltip`,children:(0,$.jsx)(g,{id:`I7y_vn`})}),t[27]=ee):ee=t[27];let R;t[28]===L?R=t[29]:(R=(0,$.jsxs)(w,{children:[L,ee]}),t[28]=L,t[29]=R);let z;t[30]!==R||t[31]!==N?(z=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[N,R]}),t[30]=R,t[31]=N,t[32]=z):z=t[32];let te;t[33]!==z||t[34]!==M?(te=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[M,z]}),t[33]=z,t[34]=M,t[35]=te):te=t[35];let B;t[36]!==p||t[37]!==s?(B=s===null?null:(0,$.jsx)(`span`,{className:`sr-only`,role:`status`,children:p({id:`gZElfU`,values:{0:s.done,1:s.total}})}),t[36]=p,t[37]=s,t[38]=B):B=t[38];let V;t[39]!==p||t[40]!==s||t[41]!==l?(V=s===null?null:(0,$.jsxs)(w,{children:[(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(A,{variant:`ghost`,size:`sm`,className:`h-6 shrink-0 px-2 text-muted-foreground`,"aria-label":p({id:`q2cLM6`}),"data-testid":`problems-cancel-fix`,onClick:l,children:(0,$.jsx)(g,{id:`ygCKqB`})})}),(0,$.jsx)(C,{"data-testid":`problems-cancel-fix-tooltip`,children:(0,$.jsx)(g,{id:`yvSAuM`})})]}),t[39]=p,t[40]=s,t[41]=l,t[42]=V):V=t[42];let re=u!==void 0,H=m||s!==null||a===0,U;t[43]===s?U=t[44]:(U=s===null?void 0:(0,$.jsx)(g,{id:`S9t1PI`,values:{0:s.done,1:s.total}}),t[43]=s,t[44]=U);let W;t[45]!==a||t[46]!==c||t[47]!==o||t[48]!==re||t[49]!==H||t[50]!==U?(W=(0,$.jsx)(wr,{count:a,problemCount:o,aiAvailable:re,disabled:H,onClick:c,children:U}),t[45]=a,t[46]=c,t[47]=o,t[48]=re,t[49]=H,t[50]=U,t[51]=W):W=t[51];let G;t[52]!==s||t[53]!==u||t[54]!==o?(G=u!==void 0&&o>0?(0,$.jsx)(Tr,{count:o,disabled:s!==null,onClick:u}):null,t[52]=s,t[53]=u,t[54]=o,t[55]=G):G=t[55];let K;t[56]!==B||t[57]!==V||t[58]!==W||t[59]!==G?(K=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:[B,V,W,G]}),t[56]=B,t[57]=V,t[58]=W,t[59]=G,t[60]=K):K=t[60];let q;t[61]!==te||t[62]!==K?(q=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 px-2 pb-1`,children:[te,K]}),t[61]=te,t[62]=K,t[63]=q):q=t[63];let J;t[64]!==p||t[65]!==m?(J=m&&(0,$.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":p({id:`dx-TwN`}),children:[1,2,3].map(Ir)}),t[64]=p,t[65]=m,t[66]=J):J=t[66];let Y;t[67]===n.status?Y=t[68]:(Y=n.status===`failed`&&(0,$.jsx)(ke,{className:`px-2 text-xs`,children:(0,$.jsx)(g,{id:`IFezUv`})}),t[67]=n.status,t[68]=Y);let ie;t[69]!==n.result||t[70]!==n.status||t[71]!==f||t[72]!==y||t[73]!==d||t[74]!==i?(ie=n.status===`loaded`&&(0,$.jsx)(Br,{result:n.result,onNavigate:i,onCreateTarget:d,creatingTarget:f,expandedFiles:y,onToggleFile:D}),t[69]=n.result,t[70]=n.status,t[71]=f,t[72]=y,t[73]=d,t[74]=i,t[75]=ie):ie=t[75];let X;return t[76]!==q||t[77]!==J||t[78]!==Y||t[79]!==ie?(X=(0,$.jsxs)(Me,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[q,J,Y,ie]}),t[76]=q,t[77]=J,t[78]=Y,t[79]=ie,t[80]=X):X=t[80],X}function Ir(e){return(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,$.jsx)(Be,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(Be,{className:`h-3 w-28`}),(0,$.jsx)(Be,{className:`h-3 w-40`})]})]},e)}function Lr(e){return e.file}function Rr(){return new Set}function zr(e){let t=(0,Q.c)(6),{suppression:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(oe,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),t[0]=r):r=t[0];let i;t[1]===n.count?i=t[2]:(i=(0,$.jsx)(g,{id:`gi9c0-`,values:{0:n.count}}),t[1]=n.count,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(g,{id:`l91IVc`}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,$.jsxs)(`div`,{role:`note`,"aria-live":`polite`,"data-testid":`problems-broken-link-suppression`,className:`mx-2 mb-1 flex items-start gap-1.5 rounded-md border border-border/70 bg-muted/40 px-2 py-1.5 text-xs text-muted-foreground`,children:[r,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[i,` `,a]})]}),t[4]=i,t[5]=o),o}function Br(e){let t=(0,Q.c)(24),{result:n,onNavigate:r,onCreateTarget:i,creatingTarget:a,expandedFiles:o,onToggleFile:s}=e,{_:c}=_(),l,u,d,f;if(t[0]!==c||t[1]!==n.warnings){let e=n.warnings.filter(Ur);l=n.warnings.filter(ze),u=`flex flex-col gap-1`,d=e.length>0&&(0,$.jsx)(`ul`,{"aria-label":c({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:e.map(Hr)}),f=l.map(Vr),t[0]=c,t[1]=n.warnings,t[2]=l,t[3]=u,t[4]=d,t[5]=f}else l=t[2],u=t[3],d=t[4],f=t[5];let p;t[6]===n.brokenLinkSuppression?p=t[7]:(p=n.brokenLinkSuppression!==void 0&&(0,$.jsx)(zr,{suppression:n.brokenLinkSuppression}),t[6]=n.brokenLinkSuppression,t[7]=p);let m;t[8]!==a||t[9]!==l||t[10]!==o||t[11]!==i||t[12]!==r||t[13]!==s||t[14]!==n.brokenLinkSuppression||t[15]!==n.fileCount||t[16]!==n.files?(m=n.files.length===0?n.brokenLinkSuppression===void 0&&l.length===0?(0,$.jsx)(je,{className:`px-2`,children:(0,$.jsx)(g,{id:`k_Dqw1`,values:{0:n.fileCount}})}):null:n.files.map(e=>(0,$.jsx)(Wr,{file:e,onNavigate:r,onCreateTarget:i,creatingTarget:a,open:o.has(e.file),onOpenChange:t=>s(e.file,t)},e.file)),t[8]=a,t[9]=l,t[10]=o,t[11]=i,t[12]=r,t[13]=s,t[14]=n.brokenLinkSuppression,t[15]=n.fileCount,t[16]=n.files,t[17]=m):m=t[17];let h;return t[18]!==u||t[19]!==d||t[20]!==f||t[21]!==p||t[22]!==m?(h=(0,$.jsxs)(`div`,{className:u,children:[d,f,p,m]}),t[18]=u,t[19]=d,t[20]=f,t[21]=p,t[22]=m,t[23]=h):h=t[23],h}function Vr(e){return(0,$.jsxs)(`div`,{role:`status`,className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,$.jsx)(oe,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},e)}function Hr(e,t){return(0,$.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,$.jsx)(le,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,$.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Ur(e){return!ze(e)}function Wr(e){let t=(0,Q.c)(45),{file:n,onNavigate:r,onCreateTarget:i,creatingTarget:a,open:o,onOpenChange:s}=e,{_:c}=_(),l,u,d,f,p,m,h,g,v,y;if(t[0]!==c||t[1]!==a||t[2]!==n.diagnostics||t[3]!==n.file||t[4]!==i||t[5]!==r||t[6]!==s||t[7]!==o){let e=[...n.diagnostics].sort(fr);u=D,h=o,g=s,v=`problems-audit-group`;let _;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(V,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[18]=_):_=t[18];let b;t[19]===n.file?b=t[20]:(b=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[19]=n.file,t[20]=b),y=(0,$.jsxs)(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:[_,b,(0,$.jsx)(de,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),l=T,m=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,t[21]!==c||t[22]!==n.file?(d=c({id:`zAJzIg`,values:{0:n.file}}),t[21]=c,t[22]=n.file,t[23]=d):d=t[23],f=`flex flex-col gap-0.5 pb-1 ps-3`;let x;t[24]!==c||t[25]!==a||t[26]!==n.file||t[27]!==i||t[28]!==r?(x=e=>(0,$.jsx)(yr,{group:e,onNavigate:e=>r(n.file,e),navTitle:e=>c({id:`xKDsGS`,values:{0:e.range.start.line+1,1:n.file}}),renderActions:e=>!gr(e)||i===void 0?null:(0,$.jsx)(Sr,{target:e.linkTarget??``,creating:a===e.linkTarget,disabled:a!==null,onCreate:()=>i(e)})},e.key),t[24]=c,t[25]=a,t[26]=n.file,t[27]=i,t[28]=r,t[29]=x):x=t[29],p=vr(e).map(x),t[0]=c,t[1]=a,t[2]=n.diagnostics,t[3]=n.file,t[4]=i,t[5]=r,t[6]=s,t[7]=o,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h,t[15]=g,t[16]=v,t[17]=y}else l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14],g=t[15],v=t[16],y=t[17];let b;t[30]!==d||t[31]!==f||t[32]!==p?(b=(0,$.jsx)(`ul`,{"aria-label":d,className:f,children:p}),t[30]=d,t[31]=f,t[32]=p,t[33]=b):b=t[33];let x;t[34]!==l||t[35]!==m||t[36]!==b?(x=(0,$.jsx)(l,{className:m,children:b}),t[34]=l,t[35]=m,t[36]=b,t[37]=x):x=t[37];let S;return t[38]!==u||t[39]!==x||t[40]!==h||t[41]!==g||t[42]!==v||t[43]!==y?(S=(0,$.jsxs)(u,{open:h,onOpenChange:g,"data-testid":v,children:[y,x]}),t[38]=u,t[39]=x,t[40]=h,t[41]=g,t[42]=v,t[43]=y,t[44]=S):S=t[44],S}function Gr(e,t){return e.has(t)||P(t)}var Kr=/^(#{1,6})\s+(.+)$/;function qr(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(Kr);if(!n)return null;let r=n[2].trim(),i=be(r,t);return i?{level:n[1].length,text:r,slug:i}:null}var Jr=null,Yr=[];function Xr(e){if(e===Jr)return Yr;let t=Zr(e);return Jr=e,Yr=t,t}function Zr(e){let t=[],n=new Map,r=W();for(let i=Qr(e);i<=e.lines;i++){let a=e.line(i);if(r(a.text))continue;let o=qr(a.text,n);o&&t.push({slug:o.slug,from:a.from})}return t}function Qr(e){if(!$r(e.line(1).text))return 1;for(let t=2;t<=e.lines;t++)if($r(e.line(t).text))return t+1;return 1}function $r(e){return R.test(e.endsWith(`\r`)?e.slice(0,-1):e)}function ei(e){let t=document.getElementById(e);return t?t.getBoundingClientRect().top:null}function ti(e){let t=new Map;for(let n of Xr(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 ni(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{isSourceMode:i,docName:a}=r,o=i===void 0?!1:i,[s,c]=(0,Z.useState)(void 0),l=(0,Z.useRef)(null),u;n[2]===a?u=n[3]:(u=()=>a?ae(a):null,n[2]=a,n[3]=u);let d=(0,Z.useSyncExternalStore)(U,u,ri),f,p;return n[4]!==o||n[5]!==e||n[6]!==d?(f=()=>{if(e.length===0||o&&!d){c(void 0);return}let t=function(){let t=o&&d?ti(d):ei,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))}c(i??r??e[0])},n=function(){l.current===null&&(l.current=requestAnimationFrame(()=>{l.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),l.current!==null&&(cancelAnimationFrame(l.current),l.current=null)}},p=[e,o,d],n[4]=o,n[5]=e,n[6]=d,n[7]=f,n[8]=p):(f=n[7],p=n[8]),(0,Z.useEffect)(f,p),s}function ri(){return null}var ii=300;async function ai(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new X(N._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=L.safeParse(n);throw e.success?Error(e.data.title):new X(N._({id:`zlErBl`}),{status:t.status})}let r=ee.safeParse(n);if(!r.success)throw new X(N._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var oi=32,si=12,ci=6,li=`open-knowledge:outline-nav`,ui=`ok-outline-nav`,di=`ok-outline-nav-dispatch`,fi=`ok-outline-nav-settled`;function pi(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(_e,{name:`outline-panel`,children:(0,$.jsx)(mi,{...e})}),t[0]=e,t[1]=n),n}function mi(e){let t=(0,Q.c)(68),{docName:n,isSourceMode:r,className:i,onNavigated:a}=e,o=i===void 0?``:i,{_:s}=_(),{pages:c,loading:l,error:d}=Oe(),f=v(),{activeProvider:p,activeDocName:m}=u(),h;t[0]!==n||t[1]!==c?(h=Gr(c,n),t[0]=n,t[1]=c,t[2]=h):h=t[2];let b=h,S;t[3]===f?S=t[4]:(S=f.getQueryCache(),t[3]=f,t[4]=S);let C=S,w;t[5]!==n||t[6]!==f?(w=()=>f.getQueryState([`page-headings`,n])!==void 0,t[5]=n,t[6]=f,t[7]=w):w=t[7];let T=(0,Z.useSyncExternalStore)(C.subscribe,w),E=!l&&d===null&&!b&&T,D,O;t[8]===n?(D=t[9],O=t[10]):(D=[`page-headings`,n],O=()=>ai(n),t[8]=n,t[9]=D,t[10]=O);let k=!l&&b,A;t[11]!==D||t[12]!==O||t[13]!==k?(A={queryKey:D,queryFn:O,enabled:k,staleTime:1/0},t[11]=D,t[12]=O,t[13]=k,t[14]=A):A=t[14];let{data:j,isLoading:M,error:N}=y(A),P;t[15]===j?P=t[16]:(P=j===void 0?[]:j,t[15]=j,t[16]=P);let F=P,I,L;t[17]!==n||t[18]!==E||t[19]!==f?(I=()=>{E&&f.resetQueries({queryKey:[`page-headings`,n]})},L=[E,n,f],t[17]=n,t[18]=E,t[19]=f,t[20]=I,t[21]=L):(I=t[20],L=t[21]),(0,Z.useEffect)(I,L);let ee,R;t[22]!==m||t[23]!==p||t[24]!==n||t[25]!==f?(ee=()=>{if(!p||m!==n)return;let e=p.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,f.invalidateQueries({queryKey:[`page-headings`,n]})},ii)};return e.on(`update`,r),f.invalidateQueries({queryKey:[`page-headings`,n]}),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},R=[p,m,n,f],t[22]=m,t[23]=p,t[24]=n,t[25]=f,t[26]=ee,t[27]=R):(ee=t[26],R=t[27]),(0,Z.useEffect)(ee,R);let z=l||M,te;t[28]===F?te=t[29]:(te=F.map(hi),t[28]=F,t[29]=te);let B=te,V;t[30]!==n||t[31]!==r?(V={isSourceMode:r,docName:n},t[30]=n,t[31]=r,t[32]=V):V=t[32];let ne=ni(B,V),re,H,U,W,G,K,q;if(t[33]!==s||t[34]!==ne||t[35]!==o||t[36]!==n||t[37]!==N||t[38]!==F||t[39]!==z||t[40]!==r||t[41]!==E||t[42]!==a){let e=ne?F.findIndex(e=>e.slug===ne):-1,i=function(t,i){let o={docName:n,index:t,slug:i,mode:r?`source`:`wysiwyg`,onNavigated:a};o.mode===`source`&&wt(n,{kind:`outline`,detail:o}),he(di,{docName:n,index:t,mode:o.mode,outlineCount:F.length,headingLevel:F[t]?.level,activeIndex:e}),window.dispatchEvent(new CustomEvent(li,{detail:o}))},c=((e>=0?F[e].level:1)-1)*si+(si-ci)/2,l=e*oi+(oi-ci)/2;H=Fe,K=o;let u;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(Ae,{children:(0,$.jsx)(g,{id:`dD7NPy`})}),t[50]=u):u=t[50];let d;t[51]!==N||t[52]!==F.length||t[53]!==z||t[54]!==E?(d=!z&&!N&&!E&&(0,$.jsx)(Ne,{children:F.length}),t[51]=N,t[52]=F.length,t[53]=z,t[54]=E,t[55]=d):d=t[55],t[56]===d?q=t[57]:(q=(0,$.jsx)(Pe,{children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[u,d]})}),t[56]=d,t[57]=q),re=Me,U=`px-3 py-2`,W=z,G=E?(0,$.jsx)(je,{className:`px-2`,role:`status`,children:(0,$.jsx)(g,{id:`0x9smA`})}):N?(0,$.jsx)(ke,{className:`px-2`,children:N instanceof Error?N.message:s({id:`GuqOb1`})}):F.length===0&&!z?(0,$.jsx)(je,{className:`px-2`,children:(0,$.jsx)(g,{id:`0BB9ID`})}):(0,$.jsxs)(`nav`,{"aria-label":s({id:`BymzO4`}),className:`relative`,children:[e>=0&&(0,$.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:ci,height:ci,transform:`translate(${c}px, ${l}px)`}}),F.map((e,t)=>{let n=e.slug===ne;return(0,$.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>i(t,e.slug),className:x(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-[var(--secondary-panel-accent,var(--primary))]`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*si+20}px`},title:e.text,children:e.text},t)})]}),t[33]=s,t[34]=ne,t[35]=o,t[36]=n,t[37]=N,t[38]=F,t[39]=z,t[40]=r,t[41]=E,t[42]=a,t[43]=re,t[44]=H,t[45]=U,t[46]=W,t[47]=G,t[48]=K,t[49]=q}else re=t[43],H=t[44],U=t[45],W=t[46],G=t[47],K=t[48],q=t[49];let J;t[58]!==re||t[59]!==U||t[60]!==W||t[61]!==G?(J=(0,$.jsx)(re,{className:U,"aria-busy":W,children:G}),t[58]=re,t[59]=U,t[60]=W,t[61]=G,t[62]=J):J=t[62];let Y;return t[63]!==H||t[64]!==K||t[65]!==q||t[66]!==J?(Y=(0,$.jsxs)(H,{className:K,children:[q,J]}),t[63]=H,t[64]=K,t[65]=q,t[66]=J,t[67]=Y):Y=t[67],Y}function hi(e){return e.slug}var gi=!1;function _i(){return gi||!te()?!1:(gi=!0,!0)}export{mn as A,kt as B,Sn as C,Cn as D,wn as E,Pt as F,rt as G,yt as H,Dt as I,tt as K,Et as L,Rt as M,Qt as N,en as O,$t as P,At as R,gn as S,Tn as T,nt as U,wt as V,it as W,An as _,pi as a,Dn as b,dr as c,lr as d,ur as f,kn as g,On as h,fi as i,Yt as j,pn as k,Er as l,ar as m,ui as n,Xr as o,cr as p,li as r,Gr as s,_i as t,or as u,Mn as v,xn as w,En as x,Nn as y,Tt as z};
|