@inkeep/open-knowledge 0.88.5-beta.0 → 0.88.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +0 -1
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-CJ8cm9oX.mjs +1 -0
  4. package/dist/{dist-DAAU-wLM.mjs → dist-D-8JjktL.mjs} +1 -1
  5. package/dist/{dist-CVvHVQuh.mjs → dist-DATPsg15.mjs} +1 -1
  6. package/dist/index.mjs +119 -119
  7. package/dist/init-C65uOnl8.mjs +1 -0
  8. package/dist/{init-By5HDMCa.mjs → init-lZRiTzan.mjs} +2 -2
  9. package/dist/{launch-json-removal-BGcOpHL7.mjs → launch-json-removal-BnmDFyWN.mjs} +1 -1
  10. package/dist/loader-BsHZEDON.mjs +1 -0
  11. package/dist/{loader-Ui7HnVgy.mjs → loader-xtX-6xp0.mjs} +1 -1
  12. package/dist/{md-manager-BGnqyqi1-DW5IsDjR.mjs → md-manager-BGnqyqi1-BRHF3Xt6.mjs} +79 -79
  13. package/dist/{open-browser-BLuYnAd6.mjs → open-browser-DWUyYmZM.mjs} +1 -1
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-CgLoP6aT.mjs → preview-DzrQkAf5.mjs} +1 -1
  16. package/dist/preview-Qdd8t0AD.mjs +1 -0
  17. package/dist/public/assets/{AboutSection-Dk6KkTLD.js → AboutSection-DoHiqjaH.js} +1 -1
  18. package/dist/public/assets/{AccountSection-DMdQ4xcM.js → AccountSection-BOhW7qZ_.js} +1 -1
  19. package/dist/public/assets/{ActivityModeContent-mR0MBtgI.js → ActivityModeContent-DjblaSuP.js} +1 -1
  20. package/dist/public/assets/{AddPropertiesButton-Eyu3Mn2_.js → AddPropertiesButton-B3VtGjof.js} +1 -1
  21. package/dist/public/assets/{AgentConnectionsSection-DxQ-OjW3.js → AgentConnectionsSection-DN4d1HNW.js} +1 -1
  22. package/dist/public/assets/{AgentDiffPane-DncaX777.js → AgentDiffPane-HToT-MaO.js} +1 -1
  23. package/dist/public/assets/{AgentIconCluster-6RCoigPZ.js → AgentIconCluster-gjhntxbl.js} +1 -1
  24. package/dist/public/assets/{AttachmentsSection-D0K5FLaV.js → AttachmentsSection-DhJDh3y9.js} +1 -1
  25. package/dist/public/assets/{CodeMirrorPropInput-B0xn3frp.js → CodeMirrorPropInput-DlUvrQTF.js} +61 -61
  26. package/dist/public/assets/{ConfigSharingInfoTooltip-CJywmyrk.js → ConfigSharingInfoTooltip-BFLyRkPu.js} +1 -1
  27. package/dist/public/assets/{ConsentDialogBody-DQLbNsL9.js → ConsentDialogBody-DyyNXoO8.js} +1 -1
  28. package/dist/public/assets/{ContentRulesSection-BZXw3-Zq.js → ContentRulesSection-DpZVwJeE.js} +1 -1
  29. package/dist/public/assets/{CopyButton-BT2YHECh.js → CopyButton-DM7FN3ou.js} +1 -1
  30. package/dist/public/assets/{DocumentContext-g-cDYqVv.js → DocumentContext-DnutLDM1.js} +1 -1
  31. package/dist/public/assets/{EditorModeToggle-bm40hfyi.js → EditorModeToggle-CaVjaBnW.js} +1 -1
  32. package/dist/public/assets/{ExcalidrawDocEditor-BiwQRM2B.js → ExcalidrawDocEditor-BEiMIRIh.js} +1 -1
  33. package/dist/public/assets/FeedbackForm-W3L0HkW3.js +1 -0
  34. package/dist/public/assets/{GraphPanel-COXp93Cg.js → GraphPanel-DkTlYTKG.js} +1 -1
  35. package/dist/public/assets/{HotkeysSection-CajedZ--.js → HotkeysSection-D55HONUJ.js} +1 -1
  36. package/dist/public/assets/{ImageAttachments--kYwG922.js → ImageAttachments-D1w1uosg.js} +1 -1
  37. package/dist/public/assets/{ImportSkillDialog-DTxSmPAt.js → ImportSkillDialog-CdY6nNvy.js} +1 -1
  38. package/dist/public/assets/{IntegrationsSection-BQNs8OE2.js → IntegrationsSection-BkGzPQH3.js} +1 -1
  39. package/dist/public/assets/{LinkPreviewsSection-fSYr2cXT.js → LinkPreviewsSection-C9VvbkyT.js} +1 -1
  40. package/dist/public/assets/{LintConfigEditor-BNsJpcQe.js → LintConfigEditor-PEQ1cmNe.js} +1 -1
  41. package/dist/public/assets/{LintingSection-C6qbTSSp.js → LintingSection-Db41bQig.js} +1 -1
  42. package/dist/public/assets/{ManagedArtifactProperties-BFjDpWUl.js → ManagedArtifactProperties-BAqcYlv3.js} +1 -1
  43. package/dist/public/assets/ManagedArtifactProperties-Vhp_H3KX.js +1 -0
  44. package/dist/public/assets/{McpConsentDialogBody-Cs8EdBNv.js → McpConsentDialogBody-_9U_-_AU.js} +1 -1
  45. package/dist/public/assets/{MermaidDocEditor-DeJfa8Di.js → MermaidDocEditor-DO3mrxvU.js} +1 -1
  46. package/dist/public/assets/{NetworkAccessSection-Bx6Fljc5.js → NetworkAccessSection-cvKBl4jY.js} +1 -1
  47. package/dist/public/assets/{OkCliPathRow-Dn-a2z6P.js → OkCliPathRow-Ci2ChVIJ.js} +1 -1
  48. package/dist/public/assets/{OkignoreSection-jr165zc5.js → OkignoreSection-CX5Q043q.js} +1 -1
  49. package/dist/public/assets/{ProjectTemplatesSection-BDL8pwkt.js → ProjectTemplatesSection-f4lSAHFv.js} +1 -1
  50. package/dist/public/assets/{PropertyDisplayRow-jPEkDFYU.js → PropertyDisplayRow-BviqlrdB.js} +1 -1
  51. package/dist/public/assets/{PublishToGitHubDialog-D3WS--oe.js → PublishToGitHubDialog-BoXQzAoR.js} +1 -1
  52. package/dist/public/assets/{ReportBugDialogBody-N9n3BSZV.js → ReportBugDialogBody-DqjPW80z.js} +1 -1
  53. package/dist/public/assets/{ReportBugMenuTrigger-B_QGo0FI.js → ReportBugMenuTrigger-B5oXr3N_.js} +1 -1
  54. package/dist/public/assets/{SchemaConfigEditor-Bri3lm9t.js → SchemaConfigEditor-B5tO7qZ3.js} +1 -1
  55. package/dist/public/assets/{SearchSection-Bot6T0ZL.js → SearchSection-idjxM_ZX.js} +1 -1
  56. package/dist/public/assets/{SessionsHost-DrSV4BIY.js → SessionsHost-DKzDkebu.js} +2 -2
  57. package/dist/public/assets/{SettingsDialogBody-CC-J9ZGQ.js → SettingsDialogBody-hlAjLla2.js} +2 -2
  58. package/dist/public/assets/{SettingsSectionHeader-DqND7Pty.js → SettingsSectionHeader-CpXcJhPq.js} +1 -1
  59. package/dist/public/assets/{ShareReceiveMissDialog-BHqz3ASe.js → ShareReceiveMissDialog-CVasQYvw.js} +1 -1
  60. package/dist/public/assets/{SharingSection-CP_fHQRg.js → SharingSection-B0wr2vDt.js} +1 -1
  61. package/dist/public/assets/{SkillCostValue-B40sE1dq.js → SkillCostValue-h4MKJn9R.js} +1 -1
  62. package/dist/public/assets/{SkillInstallMenu-C2iqB9-_.js → SkillInstallMenu-B14_Gl1G.js} +1 -1
  63. package/dist/public/assets/{SkillOriginInline--34x1DGi.js → SkillOriginInline-BgrR-T50.js} +1 -1
  64. package/dist/public/assets/{SkillPluginBundleDialog-Duktybbj.js → SkillPluginBundleDialog-C4GtanKU.js} +1 -1
  65. package/dist/public/assets/{SkillToolbarControls-CjiamSv_.js → SkillToolbarControls-jqV44Ebs.js} +1 -1
  66. package/dist/public/assets/{SkillsManagerSection-CGK25Vhx.js → SkillsManagerSection-AnAwZ1DX.js} +1 -1
  67. package/dist/public/assets/{SlidesPluginSection-D9esoLOb.js → SlidesPluginSection-K6GcPk6k.js} +1 -1
  68. package/dist/public/assets/{SlidesToolbarControls-D20a_7Xo.js → SlidesToolbarControls-DZlISnZM.js} +1 -1
  69. package/dist/public/assets/{SourceEditor-CDsqWnaJ.js → SourceEditor-D2hq0hNs.js} +1 -1
  70. package/dist/public/assets/{SpellingSettings-Umd-UcTV.js → SpellingSettings-DdfEMafp.js} +1 -1
  71. package/dist/public/assets/{SyncSection-Bjkh_LiV.js → SyncSection-InIWbi6A.js} +1 -1
  72. package/dist/public/assets/{SyncStatusBadge-DiEJsKO_.js → SyncStatusBadge-vvjxZqV1.js} +1 -1
  73. package/dist/public/assets/{TerminalLaunchContext-CRJ3fsc7.js → TerminalLaunchContext-D0zWlhAb.js} +1 -1
  74. package/dist/public/assets/{TerminalPanel-BIsMrJpO.js → TerminalPanel-DD-D7eio.js} +1 -1
  75. package/dist/public/assets/{TerminalSection-B5TkYlKV.js → TerminalSection-CF3h8WXM.js} +1 -1
  76. package/dist/public/assets/{TerminalWindowApp-CZc2ruFy.js → TerminalWindowApp-C7ptc_pA.js} +1 -1
  77. package/dist/public/assets/{TextDocEditor-xT10qL3d.js → TextDocEditor-C0ms9uny.js} +1 -1
  78. package/dist/public/assets/{ThemePluginSection-CRhGurqF.js → ThemePluginSection-C-SayLL7.js} +1 -1
  79. package/dist/public/assets/{ThreadView-DIaTKhjl.js → ThreadView-CcuJBytl.js} +1 -1
  80. package/dist/public/assets/{TimelineDiffPane-BpW3RrqY.js → TimelineDiffPane-DP_gJg0Y.js} +1 -1
  81. package/dist/public/assets/{agent-connections-CyCAPZDU.js → agent-connections-BBFERALo.js} +1 -1
  82. package/dist/public/assets/{client-version-B03sIju7.js → client-version-DUhmFhQU.js} +1 -1
  83. package/dist/public/assets/{comment-chips-weNAtn3U.js → comment-chips-BT3RC3B5.js} +1 -1
  84. package/dist/public/assets/{config-provider-rhvkI-p4.js → config-provider-j4mD0moX.js} +1 -1
  85. package/dist/public/assets/{doc-undo-manager-9Yo3wyyH.js → doc-undo-manager-ChCGviIJ.js} +1 -1
  86. package/dist/public/assets/field-controls-B5XGrBle.js +1 -0
  87. package/dist/public/assets/{field-controls-D3A53IPn.js → field-controls-CxY76_35.js} +1 -1
  88. package/dist/public/assets/index-Bcb3hdu4.js +2209 -0
  89. package/dist/public/assets/{lint-plugins-eYd0OhT2.js → lint-plugins-Bp3DQCRa.js} +1 -1
  90. package/dist/public/assets/{markdownlint-rule-browser-CCM0Ntgn.js → markdownlint-rule-browser-C56kvk1x.js} +1 -1
  91. package/dist/public/assets/{pending-receive-nav-store-BN3r9LqM.js → pending-receive-nav-store-xc_Qof4R.js} +1 -1
  92. package/dist/public/assets/{preferred-session-events-BBTio6p0.js → preferred-session-events-6CUsLtX0.js} +1 -1
  93. package/dist/public/assets/{progress-BswJapXs.js → progress-DAo8HCk9.js} +1 -1
  94. package/dist/public/assets/{project-paths-Cq56bh9f.js → project-paths-DZ-NYdQu.js} +1 -1
  95. package/dist/public/assets/{restart-collab-server-CHlRP7RK.js → restart-collab-server-Uk2ptZCx.js} +1 -1
  96. package/dist/public/assets/{schema-section-BHbbqbRe.js → schema-section-DNLDm-pQ.js} +1 -1
  97. package/dist/public/assets/{select-Bx_fIuqY.js → select-pACXgFe2.js} +1 -1
  98. package/dist/public/assets/{selection-context-BPU0RK6_.js → selection-context-DQkqqA5S.js} +1 -1
  99. package/dist/public/assets/{src-Dtle0q-b.js → src-SUBfAxvY.js} +1 -1
  100. package/dist/public/assets/{tag-pill-input-CV6lsM1V.js → tag-pill-input-DblQVbzJ.js} +1 -1
  101. package/dist/public/assets/{telemetry-impl-Ocl4-goG.js → telemetry-impl-CTEfwDbG.js} +1 -1
  102. package/dist/public/assets/{telemetry-startup-DDWqwm9D.js → telemetry-startup-C2ew6uG7.js} +1 -1
  103. package/dist/public/assets/{tooltip-BjuCvy5N.js → tooltip-Bz6z4_se.js} +1 -1
  104. package/dist/public/assets/{typing-burst-detector-B7I9PgKx.js → typing-burst-detector-D_gXnSRA.js} +1 -1
  105. package/dist/public/assets/{use-activity-panel-BfVoPHj2.js → use-activity-panel-DRaaa1mh.js} +1 -1
  106. package/dist/public/assets/{use-installed-clis-CYPuE-6E.js → use-installed-clis-CRqLKblW.js} +2 -2
  107. package/dist/public/assets/{use-open-skill-BLrqCx6j.js → use-open-skill-vR2f13jH.js} +1 -1
  108. package/dist/public/assets/{use-terminal-enabled-DLhb19cN.js → use-terminal-enabled-Bp_DlUqi.js} +1 -1
  109. package/dist/public/assets/{use-timeline-entry-diff-CtmKFP2f.js → use-timeline-entry-diff-z6YoYfLS.js} +1 -1
  110. package/dist/public/index.html +36 -36
  111. package/dist/{registry-probes-Cqii7vvf.mjs → registry-probes-BEFLQpPK.mjs} +1 -1
  112. package/dist/{removal-file-path-BfRF033R.mjs → removal-file-path-BwKHjOvw.mjs} +1 -1
  113. package/dist/{repair-launch-json-CdjBIyjR.mjs → repair-launch-json-TlKfCeof.mjs} +1 -1
  114. package/dist/{repair-mcp-configs-wYJ8R1hh.mjs → repair-mcp-configs-DqW6Ct5X.mjs} +1 -1
  115. package/dist/src-BYPbax8Z.mjs +1 -0
  116. package/dist/{src-CNe12pkG.mjs → src-DAAfcktF.mjs} +1 -1
  117. package/dist/start-BHo6gmgR.mjs +1 -0
  118. package/dist/{start-DK4_qLD8.mjs → start-CrRsFga_.mjs} +3 -3
  119. package/package.json +4 -4
  120. package/dist/constants-Bt6puduD.mjs +0 -1
  121. package/dist/init-BX43J4AG.mjs +0 -1
  122. package/dist/loader-Da_Q5b74.mjs +0 -1
  123. package/dist/preview-PD-DUqnp.mjs +0 -1
  124. package/dist/public/assets/FeedbackForm-SrqiyGnc.js +0 -1
  125. package/dist/public/assets/ManagedArtifactProperties-chQ9yE3Q.js +0 -1
  126. package/dist/public/assets/field-controls-fQycOI6A.js +0 -1
  127. package/dist/public/assets/index-2nOQKF9c.js +0 -2209
  128. package/dist/src-Dg74AhmP.mjs +0 -1
  129. package/dist/start-CfWsRxy2.mjs +0 -1
  130. /package/dist/public/assets/{agent-presence-DU3TT-KP.js → agent-presence-DrFUej3A.js} +0 -0
  131. /package/dist/public/assets/{channel-cli-copy-BySq87hR.js → channel-cli-copy-DBh0Rilf.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{t as r}from"./react-dom-DPxgxlDT.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{a as o,n as s}from"./dist-CSCUSbQc.js";import{a as c,c as l,i as u,l as d,n as f,o as p,t as m}from"./dist-DTFuvKje.js";import{a as h}from"./tooltip-BjuCvy5N.js";import{n as g,t as _}from"./dist-uiDX6Nr9.js";import{n as v,t as y}from"./dist-CxbWbOvU.js";import{i as b,n as x,r as S,t as C}from"./es2015-Dtr4fzLT.js";import{t as w}from"./dist-DBXmXNZF.js";import{a as T,i as E,n as D,r as O,t as k}from"./dist-DXjgFhPl2.js";import{t as A}from"./createLucideIcon-DdBzwsHe.js";import{t as j}from"./check-B2OLRY33.js";import{t as M}from"./chevron-down-CEv6N8LG.js";var N=e(n(),1),P=e(r(),1);function F(e,[t,n]){return Math.min(n,Math.max(t,e))}var I=t(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=g(z),[U,W]=l(z,[H,T]),G=T(),[ee,K]=U(z),[te,ne]=U(z),re=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:d,autoComplete:p,disabled:m,required:h,form:g}=e,v=G(t),[y,b]=N.useState(null),[x,S]=N.useState(null),[C,w]=N.useState(!1),T=_(l),[D,O]=u({prop:r,defaultProp:i??!1,onChange:a,caller:z}),[k,A]=u({prop:o,defaultProp:s,onChange:c,caller:z}),j=N.useRef(null),M=y?g||!!y.closest(`form`):!0,[P,F]=N.useState(new Set),L=Array.from(P).map(e=>e.props.value).join(`;`);return(0,I.jsx)(E,{...v,children:(0,I.jsxs)(ee,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:f(),value:k,onValueChange:A,open:D,onOpenChange:O,dir:T,triggerPointerDownPosRef:j,disabled:m,children:[(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(te,{scope:e.__scopeSelect,onNativeOptionAdd:N.useCallback(e=>{F(t=>new Set(t).add(e))},[]),onNativeOptionRemove:N.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),M?(0,I.jsxs)(Ke,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:k,onChange:e=>A(e.target.value),disabled:m,form:g,children:[k===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(P)]},L):null]})})};re.displayName=z;var ie=`SelectTrigger`,q=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=G(n),s=K(ie,n),c=s.disabled||r,l=o(t,s.onTriggerChange),u=V(n),f=N.useRef(`touch`),[m,h,g]=Je(e=>{let t=u().filter(e=>!e.disabled),n=Ye(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),_=e=>{c||(s.onOpenChange(!0),g()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(k,{asChild:!0,...a,children:(0,I.jsx)(d.button,{type:`button`,role:`combobox`,"aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":qe(s.value)?``:void 0,...i,ref:l,onClick:p(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:p(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:p(i.onKeyDown,e=>{let t=m.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&h(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(_(),e.preventDefault())})})})});q.displayName=ie;var ae=`SelectValue`,oe=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:s=``,...l}=e,u=K(ae,n),{onValueNodeHasChildrenChange:f}=u,p=a!==void 0,m=o(t,u.onValueNodeChange);return c(()=>{f(p)},[f,p]),(0,I.jsx)(d.span,{...l,ref:m,style:{pointerEvents:`none`},children:qe(u.value)?(0,I.jsx)(I.Fragment,{children:s}):a})});oe.displayName=ae;var se=`SelectIcon`,ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(d.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ce.displayName=se;var le=`SelectPortal`,ue=e=>(0,I.jsx)(y,{asChild:!0,...e});ue.displayName=le;var J=`SelectContent`,de=N.forwardRef((e,t)=>{let n=K(J,e.__scopeSelect),[r,i]=N.useState();if(c(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?P.createPortal((0,I.jsx)(fe,{scope:e.__scopeSelect,children:(0,I.jsx)(B.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(he,{...e,ref:t})});de.displayName=J;var Y=10,[fe,X]=U(J),pe=`SelectContentImpl`,me=s(`SelectContent.RemoveScroll`),he=N.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:y,...w}=e,T=K(J,n),[E,D]=N.useState(null),[O,k]=N.useState(null),A=o(t,e=>D(e)),[j,M]=N.useState(null),[P,F]=N.useState(null),L=V(n),[R,z]=N.useState(!1),B=N.useRef(!1);N.useEffect(()=>{if(E)return C(E)},[E]),S();let H=N.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),U=N.useCallback(()=>H([j,E]),[H,j,E]);N.useEffect(()=>{R&&U()},[R,U]);let{onOpenChange:W,triggerPointerDownPosRef:G}=T;N.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(G.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():E.contains(n.target)||W(!1),document.removeEventListener(`pointermove`,t),G.current=null};return G.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,W,G]),N.useEffect(()=>{let e=()=>W(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[W]);let[ee,te]=Je(e=>{let t=L().filter(e=>!e.disabled),n=Ye(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=N.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&(M(e),r&&(B.current=!0))},[T.value]),re=N.useCallback(()=>E?.focus(),[E]),ie=N.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&F(e)},[T.value]),q=r===`popper`?ye:_e,ae=q===ye?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:y}:{};return(0,I.jsx)(fe,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:j,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:U,selectedItemText:P,position:r,isPositioned:R,searchRef:ee,children:(0,I.jsx)(x,{as:me,allowPinchZoom:!0,children:(0,I.jsx)(b,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:p(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(q,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...ae,onPlaced:()=>z(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:p(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});he.displayName=pe;var ge=`SelectItemAlignedPosition`,_e=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=K(J,n),s=X(J,n),[l,u]=N.useState(null),[f,p]=N.useState(null),m=o(t,e=>p(e)),h=V(n),g=N.useRef(!1),_=N.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=N.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&f&&v&&y&&b){let e=a.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-Y,d=F(a,[Y,Math.max(Y,u-c)]);l.style.minWidth=s+`px`,l.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-Y,d=F(a,[Y,Math.max(Y,u-c)]);l.style.minWidth=s+`px`,l.style.right=d+`px`}let o=h(),s=window.innerHeight-Y*2,c=v.scrollHeight,u=window.getComputedStyle(f),d=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),m=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=d+p+c+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=d+p+k,j=x-A;if(A<=E){let e=o.length>0&&y===o[o.length-1].ref.current;l.style.bottom=`0px`;let t=f.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+m);l.style.height=n+`px`}else{let e=o.length>0&&y===o[0].ref.current;l.style.top=`0px`;let t=Math.max(E,d+v.offsetTop+(e?w:0)+O)+j;l.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}l.style.margin=`${Y}px 0`,l.style.minHeight=S+`px`,l.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,a.trigger,a.valueNode,l,f,v,y,b,a.dir,r]);c(()=>S(),[S]);let[C,w]=N.useState();return c(()=>{f&&w(window.getComputedStyle(f).zIndex)},[f]),(0,I.jsx)(be,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,I.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(d.div,{...i,ref:m,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});_e.displayName=ge;var ve=`SelectPopperPosition`,ye=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=G(n);return(0,I.jsx)(O,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ye.displayName=ve;var[be,xe]=U(J,{}),Se=`SelectViewport`,Ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=X(Se,n),s=xe(Se,n),c=o(t,a.onViewportChange),l=N.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(d.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:p(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});Ce.displayName=Se;var we=`SelectGroup`,[Te,Ee]=U(we),De=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=f();return(0,I.jsx)(Te,{scope:n,id:i,children:(0,I.jsx)(d.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});De.displayName=we;var Oe=`SelectLabel`,ke=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ee(Oe,n);return(0,I.jsx)(d.div,{id:i.id,...r,ref:t})});ke.displayName=Oe;var Z=`SelectItem`,[Ae,je]=U(Z),Me=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...s}=e,c=K(Z,n),l=X(Z,n),u=c.value===r,[m,h]=N.useState(a??``),[g,_]=N.useState(!1),v=o(t,e=>l.itemRefCallback?.(e,r,i)),y=f(),b=N.useRef(`touch`),x=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,I.jsx)(Ae,{scope:n,value:r,disabled:i,textId:y,isSelected:u,onItemTextChange:N.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,I.jsx)(d.div,{role:`option`,"aria-labelledby":y,"data-highlighted":g?``:void 0,"aria-selected":u&&g,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...s,ref:v,onFocus:p(s.onFocus,()=>_(!0)),onBlur:p(s.onBlur,()=>_(!1)),onClick:p(s.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:p(s.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:p(s.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:p(s.onPointerMove,e=>{b.current=e.pointerType,i?l.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:p(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:p(s.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});Me.displayName=Z;var Q=`SelectItemText`,Ne=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,s=K(Q,n),l=X(Q,n),u=je(Q,n),f=ne(Q,n),[p,m]=N.useState(null),h=o(t,e=>m(e),u.onItemTextChange,e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),g=p?.textContent,_=N.useMemo(()=>(0,I.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=f;return c(()=>(v(_),()=>y(_)),[v,y,_]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(d.span,{id:u.textId,...a,ref:h}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?P.createPortal(a.children,s.valueNode):null]})});Ne.displayName=Q;var Pe=`SelectItemIndicator`,Fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return je(Pe,n).isSelected?(0,I.jsx)(d.span,{"aria-hidden":!0,...r,ref:t}):null});Fe.displayName=Pe;var Ie=`SelectScrollUpButton`,Le=N.forwardRef((e,t)=>{let n=X(Ie,e.__scopeSelect),r=xe(Ie,e.__scopeSelect),[i,a]=N.useState(!1),s=o(t,r.onScrollButtonChange);return c(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Be,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Le.displayName=Ie;var Re=`SelectScrollDownButton`,ze=N.forwardRef((e,t)=>{let n=X(Re,e.__scopeSelect),r=xe(Re,e.__scopeSelect),[i,a]=N.useState(!1),s=o(t,r.onScrollButtonChange);return c(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Be,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ze.displayName=Re;var Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=N.useRef(null),s=V(n),l=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>l(),[l]),c(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,I.jsx)(d.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:p(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:p(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:p(i.onPointerLeave,()=>{l()})})}),Ve=`SelectSeparator`,He=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(d.div,{"aria-hidden":!0,...r,ref:t})});He.displayName=Ve;var Ue=`SelectArrow`,We=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n),a=K(Ue,n),o=X(Ue,n);return a.open&&o.position===`popper`?(0,I.jsx)(D,{...i,...r,ref:t}):null});We.displayName=Ue;var Ge=`SelectBubbleInput`,Ke=N.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=N.useRef(null),a=o(r,i),s=w(t);return N.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(s!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[s,t]),(0,I.jsx)(d.select,{...n,style:{...h,...n.style},ref:a,defaultValue:t})});Ke.displayName=Ge;function qe(e){return e===``||e===void 0}function Je(e){let t=m(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ye(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Xe(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Xe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ze=re,Qe=q,$e=oe,et=ce,tt=ue,nt=de,rt=Ce,it=De,at=ke,ot=Me,st=Ne,ct=Fe,lt=Le,ut=ze,dt=A(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),$=i();function ft(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(Ze,{"data-slot":`select`,...n}),t[2]=n,t[3]=r),r}function pt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(it,{"data-slot":`select-group`,...n}),t[2]=n,t[3]=r),r}function mt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)($e,{"data-slot":`select-value`,...n}),t[2]=n,t[3]=r),r}function ht(e){let t=(0,$.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,size:o,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0?`default`:o,c;t[5]===r?c=t[6]:(c=a(`flex w-full items-center justify-between gap-2 rounded-lg border border-input bg-background text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=default]:px-2.5 data-[size=sm]:px-2 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 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`,r),t[5]=r,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(et,{asChild:!0,children:(0,I.jsx)(M,{className:`size-4 opacity-50`})}),t[7]=l):l=t[7];let u;return t[8]!==n||t[9]!==i||t[10]!==s||t[11]!==c?(u=(0,I.jsxs)(Qe,{"data-slot":`select-trigger`,"data-size":s,className:c,...i,children:[n,l]}),t[8]=n,t[9]=i,t[10]=s,t[11]=c,t[12]=u):u=t[12],u}function gt(e){let t=(0,$.c)(20),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,children:n,position:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0?`popper`:o,c=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,l;t[5]!==r||t[6]!==c?(l=a(`relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-md outline-hidden duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[align-trigger=true]:animate-none motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,c,r),t[5]=r,t[6]=c,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,I.jsx)(yt,{}),t[8]=u):u=t[8];let d=s===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`,f;t[9]===d?f=t[10]:(f=a(`p-1`,d),t[9]=d,t[10]=f);let p;t[11]!==n||t[12]!==f?(p=(0,I.jsx)(rt,{className:f,children:n}),t[11]=n,t[12]=f,t[13]=p):p=t[13];let m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,I.jsx)(bt,{}),t[14]=m):m=t[14];let h;return t[15]!==s||t[16]!==i||t[17]!==l||t[18]!==p?(h=(0,I.jsx)(tt,{children:(0,I.jsxs)(nt,{"data-slot":`select-content`,"data-ok-layer-spawned":``,position:s,className:l,...i,children:[u,p,m]})}),t[15]=s,t[16]=i,t[17]=l,t[18]=p,t[19]=h):h=t[19],h}function _t(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`px-2 py-1.5 text-xs text-muted-foreground`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,I.jsx)(at,{"data-slot":`select-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function vt(e){let t=(0,$.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o;t[4]===r?o=t[5]:(o=a(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(ct,{children:(0,I.jsx)(j,{className:`size-4`})})}),t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=(0,I.jsx)(st,{children:n}),t[7]=n,t[8]=c);let l;return t[9]!==i||t[10]!==o||t[11]!==c?(l=(0,I.jsxs)(ot,{"data-slot":`select-item`,className:o,...i,children:[s,c]}),t[9]=i,t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function yt(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,I.jsx)(dt,{className:`size-4`}),t[5]=o):o=t[5];let s;return t[6]!==r||t[7]!==i?(s=(0,I.jsx)(lt,{"data-slot":`select-scroll-up-button`,className:i,...r,children:o}),t[6]=r,t[7]=i,t[8]=s):s=t[8],s}function bt(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,I.jsx)(M,{className:`size-4`}),t[5]=o):o=t[5];let s;return t[6]!==r||t[7]!==i?(s=(0,I.jsx)(ut,{"data-slot":`select-scroll-down-button`,className:i,...r,children:o}),t[6]=r,t[7]=i,t[8]=s):s=t[8],s}export{_t as a,dt as c,vt as i,gt as n,ht as o,pt as r,mt as s,ft as t};
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"./react-dom-DPxgxlDT.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{a as o,n as s}from"./dist-CSCUSbQc.js";import{a as c,c as l,i as u,l as d,n as f,o as p,t as m}from"./dist-DTFuvKje.js";import{a as h}from"./tooltip-Bz6z4_se.js";import{n as g,t as _}from"./dist-uiDX6Nr9.js";import{n as v,t as y}from"./dist-CxbWbOvU.js";import{i as b,n as x,r as S,t as C}from"./es2015-Dtr4fzLT.js";import{t as w}from"./dist-DBXmXNZF.js";import{a as T,i as E,n as D,r as O,t as k}from"./dist-DXjgFhPl2.js";import{t as A}from"./createLucideIcon-DdBzwsHe.js";import{t as j}from"./check-B2OLRY33.js";import{t as M}from"./chevron-down-CEv6N8LG.js";var N=e(n(),1),P=e(r(),1);function F(e,[t,n]){return Math.min(n,Math.max(t,e))}var I=t(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=g(z),[U,W]=l(z,[H,T]),G=T(),[ee,K]=U(z),[te,ne]=U(z),re=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:d,autoComplete:p,disabled:m,required:h,form:g}=e,v=G(t),[y,b]=N.useState(null),[x,S]=N.useState(null),[C,w]=N.useState(!1),T=_(l),[D,O]=u({prop:r,defaultProp:i??!1,onChange:a,caller:z}),[k,A]=u({prop:o,defaultProp:s,onChange:c,caller:z}),j=N.useRef(null),M=y?g||!!y.closest(`form`):!0,[P,F]=N.useState(new Set),L=Array.from(P).map(e=>e.props.value).join(`;`);return(0,I.jsx)(E,{...v,children:(0,I.jsxs)(ee,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:f(),value:k,onValueChange:A,open:D,onOpenChange:O,dir:T,triggerPointerDownPosRef:j,disabled:m,children:[(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(te,{scope:e.__scopeSelect,onNativeOptionAdd:N.useCallback(e=>{F(t=>new Set(t).add(e))},[]),onNativeOptionRemove:N.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),M?(0,I.jsxs)(Ke,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:k,onChange:e=>A(e.target.value),disabled:m,form:g,children:[k===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(P)]},L):null]})})};re.displayName=z;var ie=`SelectTrigger`,q=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=G(n),s=K(ie,n),c=s.disabled||r,l=o(t,s.onTriggerChange),u=V(n),f=N.useRef(`touch`),[m,h,g]=Je(e=>{let t=u().filter(e=>!e.disabled),n=Ye(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),_=e=>{c||(s.onOpenChange(!0),g()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(k,{asChild:!0,...a,children:(0,I.jsx)(d.button,{type:`button`,role:`combobox`,"aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":qe(s.value)?``:void 0,...i,ref:l,onClick:p(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:p(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:p(i.onKeyDown,e=>{let t=m.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&h(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(_(),e.preventDefault())})})})});q.displayName=ie;var ae=`SelectValue`,oe=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:s=``,...l}=e,u=K(ae,n),{onValueNodeHasChildrenChange:f}=u,p=a!==void 0,m=o(t,u.onValueNodeChange);return c(()=>{f(p)},[f,p]),(0,I.jsx)(d.span,{...l,ref:m,style:{pointerEvents:`none`},children:qe(u.value)?(0,I.jsx)(I.Fragment,{children:s}):a})});oe.displayName=ae;var se=`SelectIcon`,ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(d.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ce.displayName=se;var le=`SelectPortal`,ue=e=>(0,I.jsx)(y,{asChild:!0,...e});ue.displayName=le;var J=`SelectContent`,de=N.forwardRef((e,t)=>{let n=K(J,e.__scopeSelect),[r,i]=N.useState();if(c(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?P.createPortal((0,I.jsx)(fe,{scope:e.__scopeSelect,children:(0,I.jsx)(B.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(he,{...e,ref:t})});de.displayName=J;var Y=10,[fe,X]=U(J),pe=`SelectContentImpl`,me=s(`SelectContent.RemoveScroll`),he=N.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:y,...w}=e,T=K(J,n),[E,D]=N.useState(null),[O,k]=N.useState(null),A=o(t,e=>D(e)),[j,M]=N.useState(null),[P,F]=N.useState(null),L=V(n),[R,z]=N.useState(!1),B=N.useRef(!1);N.useEffect(()=>{if(E)return C(E)},[E]),S();let H=N.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),U=N.useCallback(()=>H([j,E]),[H,j,E]);N.useEffect(()=>{R&&U()},[R,U]);let{onOpenChange:W,triggerPointerDownPosRef:G}=T;N.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(G.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():E.contains(n.target)||W(!1),document.removeEventListener(`pointermove`,t),G.current=null};return G.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,W,G]),N.useEffect(()=>{let e=()=>W(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[W]);let[ee,te]=Je(e=>{let t=L().filter(e=>!e.disabled),n=Ye(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=N.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&(M(e),r&&(B.current=!0))},[T.value]),re=N.useCallback(()=>E?.focus(),[E]),ie=N.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&F(e)},[T.value]),q=r===`popper`?ye:_e,ae=q===ye?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:y}:{};return(0,I.jsx)(fe,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:j,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:U,selectedItemText:P,position:r,isPositioned:R,searchRef:ee,children:(0,I.jsx)(x,{as:me,allowPinchZoom:!0,children:(0,I.jsx)(b,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:p(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(q,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...ae,onPlaced:()=>z(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:p(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});he.displayName=pe;var ge=`SelectItemAlignedPosition`,_e=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=K(J,n),s=X(J,n),[l,u]=N.useState(null),[f,p]=N.useState(null),m=o(t,e=>p(e)),h=V(n),g=N.useRef(!1),_=N.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=N.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&f&&v&&y&&b){let e=a.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-Y,d=F(a,[Y,Math.max(Y,u-c)]);l.style.minWidth=s+`px`,l.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-Y,d=F(a,[Y,Math.max(Y,u-c)]);l.style.minWidth=s+`px`,l.style.right=d+`px`}let o=h(),s=window.innerHeight-Y*2,c=v.scrollHeight,u=window.getComputedStyle(f),d=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),m=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=d+p+c+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=d+p+k,j=x-A;if(A<=E){let e=o.length>0&&y===o[o.length-1].ref.current;l.style.bottom=`0px`;let t=f.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+m);l.style.height=n+`px`}else{let e=o.length>0&&y===o[0].ref.current;l.style.top=`0px`;let t=Math.max(E,d+v.offsetTop+(e?w:0)+O)+j;l.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}l.style.margin=`${Y}px 0`,l.style.minHeight=S+`px`,l.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,a.trigger,a.valueNode,l,f,v,y,b,a.dir,r]);c(()=>S(),[S]);let[C,w]=N.useState();return c(()=>{f&&w(window.getComputedStyle(f).zIndex)},[f]),(0,I.jsx)(be,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,I.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(d.div,{...i,ref:m,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});_e.displayName=ge;var ve=`SelectPopperPosition`,ye=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=G(n);return(0,I.jsx)(O,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ye.displayName=ve;var[be,xe]=U(J,{}),Se=`SelectViewport`,Ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=X(Se,n),s=xe(Se,n),c=o(t,a.onViewportChange),l=N.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(d.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:p(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});Ce.displayName=Se;var we=`SelectGroup`,[Te,Ee]=U(we),De=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=f();return(0,I.jsx)(Te,{scope:n,id:i,children:(0,I.jsx)(d.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});De.displayName=we;var Oe=`SelectLabel`,ke=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ee(Oe,n);return(0,I.jsx)(d.div,{id:i.id,...r,ref:t})});ke.displayName=Oe;var Z=`SelectItem`,[Ae,je]=U(Z),Me=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...s}=e,c=K(Z,n),l=X(Z,n),u=c.value===r,[m,h]=N.useState(a??``),[g,_]=N.useState(!1),v=o(t,e=>l.itemRefCallback?.(e,r,i)),y=f(),b=N.useRef(`touch`),x=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,I.jsx)(Ae,{scope:n,value:r,disabled:i,textId:y,isSelected:u,onItemTextChange:N.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,I.jsx)(d.div,{role:`option`,"aria-labelledby":y,"data-highlighted":g?``:void 0,"aria-selected":u&&g,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...s,ref:v,onFocus:p(s.onFocus,()=>_(!0)),onBlur:p(s.onBlur,()=>_(!1)),onClick:p(s.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:p(s.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:p(s.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:p(s.onPointerMove,e=>{b.current=e.pointerType,i?l.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:p(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:p(s.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});Me.displayName=Z;var Q=`SelectItemText`,Ne=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,s=K(Q,n),l=X(Q,n),u=je(Q,n),f=ne(Q,n),[p,m]=N.useState(null),h=o(t,e=>m(e),u.onItemTextChange,e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),g=p?.textContent,_=N.useMemo(()=>(0,I.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=f;return c(()=>(v(_),()=>y(_)),[v,y,_]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(d.span,{id:u.textId,...a,ref:h}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?P.createPortal(a.children,s.valueNode):null]})});Ne.displayName=Q;var Pe=`SelectItemIndicator`,Fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return je(Pe,n).isSelected?(0,I.jsx)(d.span,{"aria-hidden":!0,...r,ref:t}):null});Fe.displayName=Pe;var Ie=`SelectScrollUpButton`,Le=N.forwardRef((e,t)=>{let n=X(Ie,e.__scopeSelect),r=xe(Ie,e.__scopeSelect),[i,a]=N.useState(!1),s=o(t,r.onScrollButtonChange);return c(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Be,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Le.displayName=Ie;var Re=`SelectScrollDownButton`,ze=N.forwardRef((e,t)=>{let n=X(Re,e.__scopeSelect),r=xe(Re,e.__scopeSelect),[i,a]=N.useState(!1),s=o(t,r.onScrollButtonChange);return c(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Be,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ze.displayName=Re;var Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=N.useRef(null),s=V(n),l=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>l(),[l]),c(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,I.jsx)(d.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:p(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:p(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:p(i.onPointerLeave,()=>{l()})})}),Ve=`SelectSeparator`,He=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(d.div,{"aria-hidden":!0,...r,ref:t})});He.displayName=Ve;var Ue=`SelectArrow`,We=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n),a=K(Ue,n),o=X(Ue,n);return a.open&&o.position===`popper`?(0,I.jsx)(D,{...i,...r,ref:t}):null});We.displayName=Ue;var Ge=`SelectBubbleInput`,Ke=N.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=N.useRef(null),a=o(r,i),s=w(t);return N.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(s!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[s,t]),(0,I.jsx)(d.select,{...n,style:{...h,...n.style},ref:a,defaultValue:t})});Ke.displayName=Ge;function qe(e){return e===``||e===void 0}function Je(e){let t=m(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ye(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Xe(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Xe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ze=re,Qe=q,$e=oe,et=ce,tt=ue,nt=de,rt=Ce,it=De,at=ke,ot=Me,st=Ne,ct=Fe,lt=Le,ut=ze,dt=A(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),$=i();function ft(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(Ze,{"data-slot":`select`,...n}),t[2]=n,t[3]=r),r}function pt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(it,{"data-slot":`select-group`,...n}),t[2]=n,t[3]=r),r}function mt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)($e,{"data-slot":`select-value`,...n}),t[2]=n,t[3]=r),r}function ht(e){let t=(0,$.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,size:o,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0?`default`:o,c;t[5]===r?c=t[6]:(c=a(`flex w-full items-center justify-between gap-2 rounded-lg border border-input bg-background text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=default]:px-2.5 data-[size=sm]:px-2 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 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`,r),t[5]=r,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(et,{asChild:!0,children:(0,I.jsx)(M,{className:`size-4 opacity-50`})}),t[7]=l):l=t[7];let u;return t[8]!==n||t[9]!==i||t[10]!==s||t[11]!==c?(u=(0,I.jsxs)(Qe,{"data-slot":`select-trigger`,"data-size":s,className:c,...i,children:[n,l]}),t[8]=n,t[9]=i,t[10]=s,t[11]=c,t[12]=u):u=t[12],u}function gt(e){let t=(0,$.c)(20),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,children:n,position:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0?`popper`:o,c=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,l;t[5]!==r||t[6]!==c?(l=a(`relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-md outline-hidden duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[align-trigger=true]:animate-none motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,c,r),t[5]=r,t[6]=c,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,I.jsx)(yt,{}),t[8]=u):u=t[8];let d=s===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`,f;t[9]===d?f=t[10]:(f=a(`p-1`,d),t[9]=d,t[10]=f);let p;t[11]!==n||t[12]!==f?(p=(0,I.jsx)(rt,{className:f,children:n}),t[11]=n,t[12]=f,t[13]=p):p=t[13];let m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,I.jsx)(bt,{}),t[14]=m):m=t[14];let h;return t[15]!==s||t[16]!==i||t[17]!==l||t[18]!==p?(h=(0,I.jsx)(tt,{children:(0,I.jsxs)(nt,{"data-slot":`select-content`,"data-ok-layer-spawned":``,position:s,className:l,...i,children:[u,p,m]})}),t[15]=s,t[16]=i,t[17]=l,t[18]=p,t[19]=h):h=t[19],h}function _t(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`px-2 py-1.5 text-xs text-muted-foreground`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,I.jsx)(at,{"data-slot":`select-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function vt(e){let t=(0,$.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o;t[4]===r?o=t[5]:(o=a(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,I.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(ct,{children:(0,I.jsx)(j,{className:`size-4`})})}),t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=(0,I.jsx)(st,{children:n}),t[7]=n,t[8]=c);let l;return t[9]!==i||t[10]!==o||t[11]!==c?(l=(0,I.jsxs)(ot,{"data-slot":`select-item`,className:o,...i,children:[s,c]}),t[9]=i,t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function yt(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,I.jsx)(dt,{className:`size-4`}),t[5]=o):o=t[5];let s;return t[6]!==r||t[7]!==i?(s=(0,I.jsx)(lt,{"data-slot":`select-scroll-up-button`,className:i,...r,children:o}),t[6]=r,t[7]=i,t[8]=s):s=t[8],s}function bt(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,I.jsx)(M,{className:`size-4`}),t[5]=o):o=t[5];let s;return t[6]!==r||t[7]!==i?(s=(0,I.jsx)(ut,{"data-slot":`select-scroll-down-button`,className:i,...r,children:o}),t[6]=r,t[7]=i,t[8]=s):s=t[8],s}export{_t as a,dt as c,vt as i,gt as n,ht as o,pt as r,mt as s,ft as t};
@@ -1,4 +1,4 @@
1
- import{mt as e}from"./DocumentContext-g-cDYqVv.js";import{ut as t}from"./CodeMirrorPropInput-B0xn3frp.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
1
+ import{mt as e}from"./DocumentContext-DnutLDM1.js";import{ut as t}from"./CodeMirrorPropInput-DlUvrQTF.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var o=new Map,s=new Set,c=(e,t)=>`${t}:${e}`;function l(){for(let e of s)e()}function u(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function d(e,t,n){let r=c(e,t);if(n===null){o.delete(r)&&l();return}let i=o.get(r);i&&u(i,n)||(o.set(r,n),l())}function f(e,t){return e===null?null:o.get(c(e,t))??null}function p(e){return s.add(e),()=>{s.delete(e)}}function m(e,t){if(e.state.selection.empty)return null;let r=n(e);return r.trim()?{surface:`wysiwyg`,docName:t,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function h(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function g(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
4
4
  `);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{h as a,r as c,i,p as l,a as n,g as o,d as r,m as s,f as t};
@@ -1,2 +1,2 @@
1
- import{Xn as e}from"./CodeMirrorPropInput-B0xn3frp.js";import{F as t,H as n,T as r,U as i,V as a,at as o,b as s,m as c,ot as l,w as u,x as d}from"./config-provider-rhvkI-p4.js";import{Et as f,J as p,K as m,X as h,Z as g,kt as _,wt as v,yt as y}from"./dist-CoJBCixp.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:t(this.yanchor),yhead:t(this.yhead)}}static fromJSON(t){return new e(u(t.yanchor),u(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=d(u(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?v.cursor(n.pos,n.assoc):v.range(t.pos,n.pos)}},S=f.define({combine(e){return e[e.length-1]}}),C=y.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
1
+ import{Xn as e}from"./CodeMirrorPropInput-DlUvrQTF.js";import{F as t,H as n,T as r,U as i,V as a,at as o,b as s,m as c,ot as l,w as u,x as d}from"./config-provider-j4mD0moX.js";import{Et as f,J as p,K as m,X as h,Z as g,kt as _,wt as v,yt as y}from"./dist-CoJBCixp.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:t(this.yanchor),yhead:t(this.yhead)}}static fromJSON(t){return new e(u(t.yanchor),u(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=d(u(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?v.cursor(n.pos,n.assoc):v.range(t.pos,n.pos)}},S=f.define({combine(e){return e[e.length-1]}}),C=y.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
2
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=h.fromClass(w),E=p.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=y.define(),O=class extends g{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return a(`span`,[i(`class`,`cm-ySelectionCaret`),i(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[n(`⁠`),a(`div`,[i(`class`,`cm-ySelectionCaretDot`)]),n(`⁠`),a(`div`,[i(`class`,`cm-ySelectionInfo`)],[n(this.name)]),n(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=_.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,i=this.conf.awareness,a=[],c=this.conf.awareness.getLocalState();if(c!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),a=n?e.state.selection.main:null,o=c.cursor==null?null:u(c.cursor.anchor),l=c.cursor==null?null:u(c.cursor.head);if(a!=null){let e=r(t,a.anchor),n=r(t,a.head);(c.cursor==null||!s(o,e)||!s(l,n))&&i.setLocalStateField(`cursor`,{anchor:e,head:n})}else c.cursor!=null&&n&&i.setLocalStateField(`cursor`,null)}i.getStates().forEach((r,s)=>{if(s===i.doc.clientID)return;let c=r.cursor;if(c==null||c.anchor==null||c.head==null)return;let u=d(c.anchor,n),f=d(c.head,n);if(u==null||f==null||u.type!==t||f.type!==t)return;let{color:p=`#30bced`,name:h=`Anonymous`}=r.user||{},g=r.user&&r.user.colorLight||p+`33`,_=l(u.index,f.index),v=o(u.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)a.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{a.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),a.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;a.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}a.push({from:f.index,to:f.index,value:m.widget({side:f.index-u.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(a,!0)}},A=h.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=f.define({combine(e){return e[e.length-1]}});y.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[p.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=h.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,p.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R as t};
@@ -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-BjuCvy5N.js";import{a as ne,t as s}from"./ime-composition-CYUPSAhg.js";import{t as re}from"./x-wldAHzfP.js";import{t as ie}from"./badge-DcyFOLs8.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
+ 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-CYUPSAhg.js";import{t as re}from"./x-wldAHzfP.js";import{t as ie}from"./badge-DcyFOLs8.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-CtJnOmG6.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-nQInEDYS.js";import{n as ee,t as p}from"./propagation-api-dgM6YInk.js";import{t as m}from"./status-CUwkWWLj.js";import{t as h}from"./context-api-CMjojwfb.js";import{n as te,o as ne}from"./client-version-B03sIju7.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-CtJnOmG6.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.88.5-beta.0`}?.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.88.5-beta.0`};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-nQInEDYS.js";import{n as ee,t as p}from"./propagation-api-dgM6YInk.js";import{t as m}from"./status-CUwkWWLj.js";import{t as h}from"./context-api-CMjojwfb.js";import{n as te,o as ne}from"./client-version-DUhmFhQU.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-CtJnOmG6.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.88.5`}?.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.88.5`};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-dgM6YInk.js";import{t}from"./context-api-CMjojwfb.js";import{n}from"./startup-marks-C403iSh4.js";import{getAppTracer as r}from"./telemetry-impl-Ocl4-goG.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};
1
+ import{t as e}from"./propagation-api-dgM6YInk.js";import{t}from"./context-api-CMjojwfb.js";import{n}from"./startup-marks-C403iSh4.js";import{getAppTracer as r}from"./telemetry-impl-CTEfwDbG.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};